Merge branch 'main' of git.odit.services:lfk/lfk-client-js into main
continuous-integration/drone Build is passing Details

This commit is contained in:
Nicolai Ort 2021-04-14 19:17:30 +02:00
commit 98e32555cf
26 changed files with 217 additions and 20 deletions

View File

@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.OpenAPI = void 0;
exports.OpenAPI = {
BASE: '',
VERSION: '0.5.0',
VERSION: '0.10.1',
WITH_CREDENTIALS: false,
TOKEN: undefined,
USERNAME: undefined,

6
dist/index.d.ts vendored
View File

@ -53,7 +53,11 @@ export type { Logout } from './models/Logout';
export type { MailSendingError } from './models/MailSendingError';
export type { NoPermissionError } from './models/NoPermissionError';
export type { Participant } from './models/Participant';
export type { PasswordMustContainLowercaseLetterError } from './models/PasswordMustContainLowercaseLetterError';
export type { PasswordMustContainNumberError } from './models/PasswordMustContainNumberError';
export type { PasswordMustContainUppercaseLetterError } from './models/PasswordMustContainUppercaseLetterError';
export type { PasswordNeededError } from './models/PasswordNeededError';
export type { PasswordTooShortError } from './models/PasswordTooShortError';
export { Permission } from './models/Permission';
export type { PermissionIdsNotMatchingError } from './models/PermissionIdsNotMatchingError';
export type { PermissionNeedsPrincipalError } from './models/PermissionNeedsPrincipalError';
@ -82,6 +86,7 @@ export type { ResponseRunnerTeam } from './models/ResponseRunnerTeam';
export type { ResponseScan } from './models/ResponseScan';
export type { ResponseScanStation } from './models/ResponseScanStation';
export type { ResponseSelfServiceDonation } from './models/ResponseSelfServiceDonation';
export type { ResponseSelfServiceDonor } from './models/ResponseSelfServiceDonor';
export type { ResponseSelfServiceOrganisation } from './models/ResponseSelfServiceOrganisation';
export type { ResponseSelfServiceRunner } from './models/ResponseSelfServiceRunner';
export type { ResponseSelfServiceScan } from './models/ResponseSelfServiceScan';
@ -116,6 +121,7 @@ export type { RunnerOrganizationHasTeamsError } from './models/RunnerOrganizatio
export type { RunnerOrganizationIdsNotMatchingError } from './models/RunnerOrganizationIdsNotMatchingError';
export type { RunnerOrganizationNotFoundError } from './models/RunnerOrganizationNotFoundError';
export type { RunnerOrganizationWrongTypeError } from './models/RunnerOrganizationWrongTypeError';
export type { RunnerSelfserviceTimeoutError } from './models/RunnerSelfserviceTimeoutError';
export type { RunnerTeam } from './models/RunnerTeam';
export type { RunnerTeamHasRunnersError } from './models/RunnerTeamHasRunnersError';
export type { RunnerTeamIdsNotMatchingError } from './models/RunnerTeamIdsNotMatchingError';

View File

@ -1,4 +1,4 @@
export declare type CreateTrackScan = {
card: number;
station: number;
station?: number;
};

View File

@ -0,0 +1,4 @@
export declare type PasswordMustContainLowercaseLetterError = {
name: string;
message: string;
};

View File

@ -0,0 +1,5 @@
"use strict";
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,4 @@
export declare type PasswordMustContainNumberError = {
name: string;
message: string;
};

View File

@ -0,0 +1,5 @@
"use strict";
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,4 @@
export declare type PasswordMustContainUppercaseLetterError = {
name: string;
message: string;
};

View File

@ -0,0 +1,5 @@
"use strict";
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,4 @@
export declare type PasswordTooShortError = {
name: string;
message: string;
};

5
dist/models/PasswordTooShortError.js vendored Normal file
View File

@ -0,0 +1,5 @@
"use strict";
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,6 @@
export declare type ResponseSelfServiceDonor = {
id: number;
firstname: string;
middlename: string;
lastname: string;
};

View File

@ -0,0 +1,5 @@
"use strict";
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -2,7 +2,7 @@ export declare type ResponseSelfServiceRunner = {
distance: number;
donationAmount: number;
group: string;
donations: string;
distanceDonations: string;
token?: string;
id: number;
firstname: string;

View File

@ -1,5 +1,6 @@
export declare type Runner = {
group: string;
resetRequestedTimestamp?: string;
distance: number;
distanceDonationAmount: number;
id: number;

View File

@ -0,0 +1,4 @@
export declare type RunnerSelfserviceTimeoutError = {
name: string;
message: string;
};

View File

@ -0,0 +1,5 @@
"use strict";
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -2,5 +2,5 @@ export declare type UpdateTrackScan = {
id: number;
runner: number;
valid?: boolean;
station: number;
track: number;
};

View File

@ -3,12 +3,12 @@ import type { ResponseUserPermissions } from '../models/ResponseUserPermissions'
import type { UpdateUser } from '../models/UpdateUser';
export declare class MeService {
/**
* Get permissions
* Lists all permissions granted to the you sorted into directly granted and inherited as permission response objects.
* @returns ResponseUserPermissions
* Get
* Lists all information about yourself.
* @returns ResponseUser
* @throws ApiError
*/
static meControllerGetPermissions(): Promise<ResponseUserPermissions>;
static meControllerGet(): Promise<ResponseUser>;
/**
* Put
* Update the yourself. <br> You can't edit your own permissions or group memberships here - Please use the /api/users/:id enpoint instead. <br> Please remember that ids can't be changed.
@ -25,4 +25,11 @@ export declare class MeService {
* @throws ApiError
*/
static meControllerRemove(force?: boolean): Promise<ResponseUser>;
/**
* Get permissions
* Lists all permissions granted to the you sorted into directly granted and inherited as permission response objects.
* @returns ResponseUserPermissions
* @throws ApiError
*/
static meControllerGetPermissions(): Promise<ResponseUserPermissions>;
}

View File

@ -4,12 +4,12 @@ exports.MeService = void 0;
const request_1 = require("../core/request");
class MeService {
/**
* Get permissions
* Lists all permissions granted to the you sorted into directly granted and inherited as permission response objects.
* @returns ResponseUserPermissions
* Get
* Lists all information about yourself.
* @returns ResponseUser
* @throws ApiError
*/
static async meControllerGetPermissions() {
static async meControllerGet() {
const result = await request_1.request({
method: 'GET',
path: `/api/users/me/`,
@ -48,5 +48,18 @@ class MeService {
});
return result.body;
}
/**
* Get permissions
* Lists all permissions granted to the you sorted into directly granted and inherited as permission response objects.
* @returns ResponseUserPermissions
* @throws ApiError
*/
static async meControllerGetPermissions() {
const result = await request_1.request({
method: 'GET',
path: `/api/users/me/permissions`,
});
return result.body;
}
}
exports.MeService = MeService;

View File

@ -45,4 +45,13 @@ export declare class RunnerCardService {
* @throws ApiError
*/
static runnerCardControllerRemove(id: number, force?: boolean): Promise<ResponseRunnerCard | ResponseEmpty>;
/**
* Post blanco bulk
* Create blank cards in bulk. <br> Just provide the count as a query param and wait for the 200 response. <br> You can provide the 'returnCards' query param if you want to receive the RESPONSERUNNERCARD objects in the response.
* @param count
* @param returnCards
* @returns ResponseEmpty
* @throws ApiError
*/
static runnerCardControllerPostBlancoBulk(count?: number, returnCards?: boolean): Promise<ResponseEmpty>;
}

View File

@ -80,5 +80,24 @@ class RunnerCardService {
});
return result.body;
}
/**
* Post blanco bulk
* Create blank cards in bulk. <br> Just provide the count as a query param and wait for the 200 response. <br> You can provide the 'returnCards' query param if you want to receive the RESPONSERUNNERCARD objects in the response.
* @param count
* @param returnCards
* @returns ResponseEmpty
* @throws ApiError
*/
static async runnerCardControllerPostBlancoBulk(count, returnCards) {
const result = await request_1.request({
method: 'POST',
path: `/api/cards/bulk`,
query: {
'count': count,
'returnCards': returnCards,
},
});
return result.body;
}
}
exports.RunnerCardService = RunnerCardService;

View File

@ -1,17 +1,27 @@
import type { CreateSelfServiceCitizenRunner } from '../models/CreateSelfServiceCitizenRunner';
import type { CreateSelfServiceRunner } from '../models/CreateSelfServiceRunner';
import type { ResponseScanStation } from '../models/ResponseScanStation';
import type { ResponseSelfServiceOrganisation } from '../models/ResponseSelfServiceOrganisation';
import type { ResponseSelfServiceRunner } from '../models/ResponseSelfServiceRunner';
import type { ResponseSelfServiceScan } from '../models/ResponseSelfServiceScan';
export declare class RunnerSelfService {
/**
* Get
* Lists all information about yourself. <br> Please provide your runner jwt(that code we gave you during registration) for auth. <br> If you lost your jwt/personalized link please contact support.
* Lists all information about yourself. <br> Please provide your runner jwt(that code we gave you during registration) for auth. <br> If you lost your jwt/personalized link please use the forgot endpoint.
* @param jwt
* @returns ResponseSelfServiceRunner
* @throws ApiError
*/
static runnerSelfServiceControllerGet(jwt: string): Promise<ResponseSelfServiceRunner>;
/**
* Remove
* Deletes all information about yourself. <br> Please provide your runner jwt(that code we gave you during registration) for auth. <br> If you lost your jwt/personalized link please use the forgot endpoint.
* @param jwt
* @param force
* @returns ResponseSelfServiceRunner
* @throws ApiError
*/
static runnerSelfServiceControllerRemove(jwt: string, force?: boolean): Promise<ResponseSelfServiceRunner>;
/**
* Get scans
* Lists all your (runner) scans. <br> Please provide your runner jwt(that code we gave you during registration) for auth. <br> If you lost your jwt/personalized link please contact support.
@ -20,23 +30,41 @@ export declare class RunnerSelfService {
* @throws ApiError
*/
static runnerSelfServiceControllerGetScans(jwt: string): Promise<Array<ResponseSelfServiceScan>>;
/**
* Get station me
* Lists basic information about the station whose token got provided. <br> This includes it's associated track.
* @returns ResponseScanStation
* @throws ApiError
*/
static runnerSelfServiceControllerGetStationMe(): Promise<ResponseScanStation>;
/**
* Request new token
* Use this endpoint to reuqest a new selfservice token/link to be sent to your mail address (rate limited to one mail every 24hrs).
* @param mail
* @param locale
* @returns any Successful response
* @throws ApiError
*/
static runnerSelfServiceControllerRequestNewToken(mail?: string, locale?: string): Promise<any>;
/**
* Register runner
* Create a new selfservice runner in the citizen org. <br> This endpoint shoud be used to allow "everyday citizen" to register themselves. <br> You have to provide a mail address, b/c the future we'll implement email verification.
* @param locale
* @param requestBody CreateSelfServiceCitizenRunner
* @returns ResponseSelfServiceRunner
* @throws ApiError
*/
static runnerSelfServiceControllerRegisterRunner(requestBody?: CreateSelfServiceCitizenRunner): Promise<ResponseSelfServiceRunner>;
static runnerSelfServiceControllerRegisterRunner(locale?: string, requestBody?: CreateSelfServiceCitizenRunner): Promise<ResponseSelfServiceRunner>;
/**
* Register organization runner
* Create a new selfservice runner in a provided org. <br> The orgs get provided and authorized via api tokens that can be optained via the /organizations endpoint.
* @param token
* @param locale
* @param requestBody CreateSelfServiceRunner
* @returns ResponseSelfServiceRunner
* @throws ApiError
*/
static runnerSelfServiceControllerRegisterOrganizationRunner(token: string, requestBody?: CreateSelfServiceRunner): Promise<ResponseSelfServiceRunner>;
static runnerSelfServiceControllerRegisterOrganizationRunner(token: string, locale?: string, requestBody?: CreateSelfServiceRunner): Promise<ResponseSelfServiceRunner>;
/**
* Get selfservice org
* Get the basic info and teams for a org.

View File

@ -5,7 +5,7 @@ const request_1 = require("../core/request");
class RunnerSelfService {
/**
* Get
* Lists all information about yourself. <br> Please provide your runner jwt(that code we gave you during registration) for auth. <br> If you lost your jwt/personalized link please contact support.
* Lists all information about yourself. <br> Please provide your runner jwt(that code we gave you during registration) for auth. <br> If you lost your jwt/personalized link please use the forgot endpoint.
* @param jwt
* @returns ResponseSelfServiceRunner
* @throws ApiError
@ -17,6 +17,24 @@ class RunnerSelfService {
});
return result.body;
}
/**
* Remove
* Deletes all information about yourself. <br> Please provide your runner jwt(that code we gave you during registration) for auth. <br> If you lost your jwt/personalized link please use the forgot endpoint.
* @param jwt
* @param force
* @returns ResponseSelfServiceRunner
* @throws ApiError
*/
static async runnerSelfServiceControllerRemove(jwt, force) {
const result = await request_1.request({
method: 'DELETE',
path: `/api/runners/me/${jwt}`,
query: {
'force': force,
},
});
return result.body;
}
/**
* Get scans
* Lists all your (runner) scans. <br> Please provide your runner jwt(that code we gave you during registration) for auth. <br> If you lost your jwt/personalized link please contact support.
@ -31,17 +49,53 @@ class RunnerSelfService {
});
return result.body;
}
/**
* Get station me
* Lists basic information about the station whose token got provided. <br> This includes it's associated track.
* @returns ResponseScanStation
* @throws ApiError
*/
static async runnerSelfServiceControllerGetStationMe() {
const result = await request_1.request({
method: 'GET',
path: `/api/stations/me`,
});
return result.body;
}
/**
* Request new token
* Use this endpoint to reuqest a new selfservice token/link to be sent to your mail address (rate limited to one mail every 24hrs).
* @param mail
* @param locale
* @returns any Successful response
* @throws ApiError
*/
static async runnerSelfServiceControllerRequestNewToken(mail, locale) {
const result = await request_1.request({
method: 'POST',
path: `/api/runners/forgot`,
query: {
'mail': mail,
'locale': locale,
},
});
return result.body;
}
/**
* Register runner
* Create a new selfservice runner in the citizen org. <br> This endpoint shoud be used to allow "everyday citizen" to register themselves. <br> You have to provide a mail address, b/c the future we'll implement email verification.
* @param locale
* @param requestBody CreateSelfServiceCitizenRunner
* @returns ResponseSelfServiceRunner
* @throws ApiError
*/
static async runnerSelfServiceControllerRegisterRunner(requestBody) {
static async runnerSelfServiceControllerRegisterRunner(locale, requestBody) {
const result = await request_1.request({
method: 'POST',
path: `/api/runners/register`,
query: {
'locale': locale,
},
body: requestBody,
});
return result.body;
@ -50,14 +104,18 @@ class RunnerSelfService {
* Register organization runner
* Create a new selfservice runner in a provided org. <br> The orgs get provided and authorized via api tokens that can be optained via the /organizations endpoint.
* @param token
* @param locale
* @param requestBody CreateSelfServiceRunner
* @returns ResponseSelfServiceRunner
* @throws ApiError
*/
static async runnerSelfServiceControllerRegisterOrganizationRunner(token, requestBody) {
static async runnerSelfServiceControllerRegisterOrganizationRunner(token, locale, requestBody) {
const result = await request_1.request({
method: 'POST',
path: `/api/runners/register/${token}`,
query: {
'locale': locale,
},
body: requestBody,
});
return result.body;

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
{
"name": "@odit/lfk-client-js",
"description": "A lib to interact with https://git.odit.services/lfk/backend. Use this version for native JS applications.",
"version": "0.5.0",
"version": "0.10.1",
"license": "CC-BY-NC-SA-4.0",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",