Compare commits

..

48 Commits

Author SHA1 Message Date
9a87a52ed6 chore(release): 1.2.7 2025-05-01 16:12:13 +02:00
93e30efd8a chore: update openapi.json 2025-05-01 16:12:05 +02:00
a595166b9d fix: Correct quote style in update:commit script in package.json 2025-05-01 16:11:41 +02:00
d6a11cf418 feat: Enhance update:auto script to include commit step for openapi.json 2025-05-01 16:10:33 +02:00
645cc59535 chore(release): 1.2.6 2025-05-01 16:08:16 +02:00
00ce1c6b3a fix: Update release script to include npm publish for proper deployment 2025-05-01 16:06:58 +02:00
4fa6e8a1db feat: Update release script to only version for streamlined releases 2025-04-28 21:37:06 +02:00
87e05ff637 chore: Remove unused hooks from release-it configuration 2025-04-28 20:28:45 +02:00
03a778c24f refactor: Rename update script to update:auto for clarity 2025-04-28 20:27:38 +02:00
ef2bc38a63 docs: Update README with detailed setup and build instructions 2025-04-28 20:26:32 +02:00
26d518fb8e feat: Added scripts to auto-update to latest version 2025-04-28 20:24:22 +02:00
087371b3ce feat: Added release script 2025-04-28 20:20:49 +02:00
7238275835 bump version to 1.2.5 in package.json 2025-04-28 19:51:15 +02:00
962d1f40b4 chore: Fresh openapi spec 2025-04-28 19:50:55 +02:00
f2e54490f2 bump version to 1.2.4 in package.json 2025-04-17 21:01:57 +02:00
ea3d42427b chore(release): 1.2.3 2025-04-09 11:45:59 +02:00
fb04bb8dc2 chore: 1.2.2 2025-04-08 21:10:08 +02:00
cdddf5c2b4 chore: Fresh openapi 2025-04-08 21:09:51 +02:00
a4747a23e7 chore: 1.2.1 2025-04-08 20:09:18 +02:00
9b36d6e6dc chore: Fresh build 2025-04-08 20:09:05 +02:00
a8045635c6 chore: 1.2.0 2025-03-28 21:55:41 +01:00
ffd92702bb Merge branch 'main' of git.odit.services:lfk/lfk-client-js
All checks were successful
ci/woodpecker/manual/release Pipeline was successful
2023-11-06 20:18:48 +01:00
45f5564b08 feat(ci)!: Switch to woodpecker 2023-11-06 20:18:40 +01:00
1003935a45 🚀New lib version v1.1.3 [CI SKIP] 2023-05-10 11:39:57 +00:00
86cf24fabf 🚀New lib version v1.1.2 [CI SKIP]
All checks were successful
continuous-integration/drone Build is passing
2023-05-10 11:18:22 +00:00
c5bf49fbdb 🚀New lib version v1.1.1 [CI SKIP]
All checks were successful
continuous-integration/drone Build is passing
2023-04-19 16:12:37 +00:00
3f9b115055 🚀New lib version v1.1.0 [CI SKIP]
All checks were successful
continuous-integration/drone Build is passing
2023-04-19 13:50:01 +00:00
43cc46b4df 🚀New lib version v1.0.1 [CI SKIP]
All checks were successful
continuous-integration/drone Build is passing
2023-04-18 18:11:42 +00:00
f4905b8df6 🚀New lib version v1.0.0 [CI SKIP]
All checks were successful
continuous-integration/drone Build is passing
2023-04-18 18:05:41 +00:00
a014e77edf 🚀New lib version v0.15.4 [CI SKIP]
All checks were successful
continuous-integration/drone Build is passing
2023-04-15 20:53:55 +00:00
b8ea9d985f 🚀New lib version v0.15.3 [CI SKIP]
All checks were successful
continuous-integration/drone Build is passing
2023-04-15 20:37:52 +00:00
471618b513 🚀New lib version v0.15.2 [CI SKIP]
All checks were successful
continuous-integration/drone Build is passing
2023-04-15 19:18:47 +00:00
e21c429f41 🚀New lib version v0.15.1 [CI SKIP]
All checks were successful
continuous-integration/drone Build is passing
2023-04-15 19:13:37 +00:00
76aa7537a8 🚀New lib version v0.15.0 [CI SKIP]
All checks were successful
continuous-integration/drone Build is passing
2023-04-15 18:53:15 +00:00
44b8832a82 🚀New lib version v0.14.6 [CI SKIP]
All checks were successful
continuous-integration/drone Build is passing
2023-04-15 16:22:46 +00:00
1279eedc5d 🚀New lib version v0.14.5 [CI SKIP]
All checks were successful
continuous-integration/drone Build is passing
2023-04-15 16:17:53 +00:00
650243b835 🚀New lib version v0.14.4 [CI SKIP]
All checks were successful
continuous-integration/drone Build is passing
2023-04-15 16:12:43 +00:00
a325ed0aa3 🚀New lib version v0.14.3 [CI SKIP]
All checks were successful
continuous-integration/drone Build is passing
2023-03-18 21:16:51 +00:00
bc5063e947 🚀New lib version v0.14.2 [CI SKIP]
All checks were successful
continuous-integration/drone Build is passing
2023-03-18 20:57:17 +00:00
9fbb2ae68b 🚀New lib version v0.14.1 [CI SKIP]
All checks were successful
continuous-integration/drone Build is passing
2023-03-18 20:48:22 +00:00
c3605261b2 🚀New lib version v0.14.0 [CI SKIP]
All checks were successful
continuous-integration/drone Build is passing
2023-03-15 13:46:33 +00:00
aa98c893ab 🚀New lib version v0.13.3 [CI SKIP]
All checks were successful
continuous-integration/drone Build is passing
2023-02-15 13:57:48 +00:00
04e4222be8 🚀New lib version v0.13.2 [CI SKIP]
All checks were successful
continuous-integration/drone Build is passing
2023-02-03 15:14:05 +00:00
9b6d686d93 🚀New lib version v0.13.1 [CI SKIP]
All checks were successful
continuous-integration/drone Build is passing
2023-02-02 15:19:00 +00:00
ad90844846 Fresh dist
All checks were successful
continuous-integration/drone Build is passing
2023-02-02 16:14:10 +01:00
e996375677 🚀New lib version v0.13.0 [CI SKIP] 2023-02-02 12:00:11 +00:00
699792bd2d Merge branch 'main' of git.odit.services:lfk/lfk-client-js
All checks were successful
continuous-integration/drone Build is passing
2023-02-02 10:45:57 +01:00
88438290bf Bump 2023-02-02 10:45:55 +01:00
72 changed files with 2753 additions and 158 deletions

View File

@@ -1,64 +1,41 @@
---
kind: secret
name: git_ssh
get:
path: odit-git-bot
name: sshkey
---
kind: secret
name: npm_token
get:
path: niggl-npm-key
name: npmkey
---
kind: pipeline
type: kubernetes
name: build:tag
steps:
- name: checkout backend
image: registry.odit.services/hub/alpine/git
commands:
- git clone https://git.odit.services/lfk/backend backend
- cd backend
- git checkout dev
- name: run openapi export
image: registry.odit.services/hub/library/node:19.5.0-alpine3.16
commands:
- cd backend
- yarn
- yarn openapi:export
- mv ./openapi.json ../openapi.json
- cd ..
- rm -rf backend
- name: run lib build
image: registry.odit.services/hub/library/node:19.5.0-alpine3.16
commands:
- yarn
- yarn build
- npm --no-git-tag-version version ${SOURCE_TAG}
- name: push to repo
image: appleboy/drone-git-push
settings:
branch: main
commit: true
commit_message: 🚀New lib version ${SOURCE_TAG} [CI SKIP]
author_email: bot@odit.services
remote: git@git.odit.services:lfk/lfk-client-js.git
ssh_key:
from_secret: git_ssh
- name: npm
image: plugins/npm
settings:
token:
from_secret: npm_token
email: info@odit.services
trigger:
event:
exclude:
- push
include:
- custom
steps:
- name: checkout backend
image: registry.odit.services/hub/alpine/git
commands:
- git clone https://git.odit.services/lfk/backend backend
- cd backend
- git checkout dev
- name: run openapi export
image: registry.odit.services/hub/library/node:19.5.0-alpine3.16
commands:
- cd backend
- yarn
- yarn openapi:export
- mv ./openapi.json ../openapi.json
- cd ..
- rm -rf backend
- name: run lib build
image: registry.odit.services/hub/library/node:19.5.0-alpine3.16
commands:
- yarn
- yarn build
- npm --no-git-tag-version version ${SOURCE_TAG}
- name: push to repo
image: appleboy/drone-git-push
settings:
branch: main
commit: true
commit_message: 🚀New lib version ${SOURCE_TAG} [CI SKIP]
author_email: bot@odit.services
remote: git@git.odit.services:lfk/lfk-client-js.git
ssh_key:
from_secret: odit-git-bot-sshkey
- name: npm
image: plugins/npm
settings:
token:
from_secret: niggl-npm-key
email: info@odit.services
when:
event:
- manual

View File

@@ -5,7 +5,25 @@ The official library for the LfK [backend server](https://git.odit.services/lfk/
Automagicly™ generated by [openapi-typescript-codegen](https://www.npmjs.com/package/openapi-typescript-codegen)
## 🛠 Building
Get's automagicly™ build by drone for every new backend release.
### Setup ⬇️
```bash
git clone https://git.odit.services/lfk/lfk-client-js.git
cd lfk-client-js
pnpm i
```
### Build 🔨
```bash
pnpm update:openapi # Update the openapi.json file
pnpm build # Build the project
pnpm release # Bump and release to npm
# Or just do it all in one command
pnpm update:auto
```
## Use

View File

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

4
dist/index.d.ts vendored
View File

@@ -6,6 +6,8 @@ export type { AddressCountryEmptyError } from './models/AddressCountryEmptyError
export type { AddressFirstLineEmptyError } from './models/AddressFirstLineEmptyError';
export type { AddressPostalCodeEmptyError } from './models/AddressPostalCodeEmptyError';
export type { AddressPostalCodeInvalidError } from './models/AddressPostalCodeInvalidError';
export type { ConfigFlag } from './models/ConfigFlag';
export type { CreateAnonymousDonation } from './models/CreateAnonymousDonation';
export type { CreateAuth } from './models/CreateAuth';
export type { CreateDistanceDonation } from './models/CreateDistanceDonation';
export type { CreateDonation } from './models/CreateDonation';
@@ -69,6 +71,7 @@ export type { RefreshAuth } from './models/RefreshAuth';
export type { RefreshTokenCountInvalidError } from './models/RefreshTokenCountInvalidError';
export type { ResetAlreadyRequestedError } from './models/ResetAlreadyRequestedError';
export type { ResetPassword } from './models/ResetPassword';
export type { ResponseAnonymousDonation } from './models/ResponseAnonymousDonation';
export type { ResponseAuth } from './models/ResponseAuth';
export type { ResponseDistanceDonation } from './models/ResponseDistanceDonation';
export type { ResponseDonation } from './models/ResponseDonation';
@@ -151,6 +154,7 @@ export type { UpdateGroupContact } from './models/UpdateGroupContact';
export type { UpdatePermission } from './models/UpdatePermission';
export type { UpdateRunner } from './models/UpdateRunner';
export type { UpdateRunnerCard } from './models/UpdateRunnerCard';
export type { UpdateRunnerCardByCode } from './models/UpdateRunnerCardByCode';
export type { UpdateRunnerOrganization } from './models/UpdateRunnerOrganization';
export type { UpdateRunnerTeam } from './models/UpdateRunnerTeam';
export type { UpdateScan } from './models/UpdateScan';

4
dist/models/ConfigFlag.d.ts vendored Normal file
View File

@@ -0,0 +1,4 @@
export type ConfigFlag = {
option: string;
value: string;
};

5
dist/models/ConfigFlag.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,5 @@
export type CreateAnonymousDonation = {
amount: number;
donor?: number;
paidAmount?: number;
};

View File

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

View File

@@ -1,6 +1,6 @@
export type CreateDistanceDonation = {
donor?: number;
paidAmount?: number;
runner: number;
amountPerDistance: number;
donor: number;
paidAmount?: number;
};

View File

@@ -1,4 +1,4 @@
export type CreateDonation = {
donor: number;
donor?: number;
paidAmount?: number;
};

View File

@@ -6,4 +6,5 @@ export type CreateDonor = {
phone?: string;
email?: string;
address?: any;
created_via?: string;
};

View File

@@ -1,5 +1,5 @@
export type CreateFixedDonation = {
amount: number;
donor: number;
donor?: number;
paidAmount?: number;
amount: number;
};

View File

@@ -5,4 +5,5 @@ export type CreateParticipant = {
phone?: string;
email?: string;
address?: any;
created_via?: string;
};

View File

@@ -6,4 +6,5 @@ export type CreateRunner = {
phone?: string;
email?: string;
address?: any;
created_via?: string;
};

View File

@@ -5,4 +5,5 @@ export type CreateSelfServiceCitizenRunner = {
lastname: string;
phone?: string;
address?: any;
created_via?: string;
};

View File

@@ -6,4 +6,5 @@ export type CreateSelfServiceRunner = {
phone?: string;
email?: string;
address?: any;
created_via?: string;
};

View File

@@ -2,6 +2,5 @@ export type DistanceDonation = {
runner: string;
amountPerDistance: number;
id: number;
donor: string;
paidAmount: number;
};

View File

@@ -1,5 +1,4 @@
export type Donation = {
id: number;
donor: string;
paidAmount: number;
};

View File

@@ -8,4 +8,5 @@ export type Donor = {
lastname: string;
phone?: string;
email?: string;
created_via?: string;
};

View File

@@ -2,6 +2,5 @@ export type FixedDonation = {
_amount: number;
amount: number;
id: number;
donor: string;
paidAmount: number;
};

View File

@@ -5,4 +5,5 @@ export type Participant = {
lastname: string;
phone?: string;
email?: string;
created_via?: string;
};

View File

@@ -0,0 +1,5 @@
export type ResponseAnonymousDonation = {
id: number;
amount: number;
paidAmount: number;
};

View File

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

View File

@@ -8,5 +8,6 @@ export type ResponseDonor = {
lastname: string;
phone: string;
email: string;
created_via: string;
address?: any;
};

View File

@@ -5,5 +5,6 @@ export type ResponseParticipant = {
lastname: string;
phone: string;
email: string;
created_via: string;
address?: any;
};

View File

@@ -1,11 +1,14 @@
export type ResponseRunner = {
distance: number;
donationAmount: number;
group: any;
selfserviceLink?: string;
id: number;
firstname: string;
middlename: string;
lastname: string;
phone: string;
email: string;
created_via: string;
address?: any;
};

View File

@@ -2,4 +2,5 @@ export type ResponseRunnerGroup = {
id: number;
name: string;
contact?: any;
total_distance?: number;
};

View File

@@ -6,4 +6,5 @@ export type ResponseRunnerOrganization = {
id: number;
name: string;
contact?: any;
total_distance?: number;
};

View File

@@ -3,4 +3,5 @@ export type ResponseRunnerTeam = {
id: number;
name: string;
contact?: any;
total_distance?: number;
};

View File

@@ -10,5 +10,6 @@ export type ResponseSelfServiceRunner = {
lastname: string;
phone: string;
email: string;
created_via: string;
address?: any;
};

View File

@@ -1,4 +1,6 @@
export type ResponseStats = {
runnersViaSelfservice: number;
runnersViaKiosk: number;
total_runners: number;
total_teams: number;
total_orgs: number;
@@ -6,5 +8,8 @@ export type ResponseStats = {
total_scans: number;
total_distance: number;
total_donation: number;
total_donations: number;
total_donors: number;
average_distance: number;
average_donation: number;
};

View File

@@ -9,4 +9,5 @@ export type Runner = {
lastname: string;
phone?: string;
email?: string;
created_via?: string;
};

View File

@@ -7,4 +7,5 @@ export type UpdateDonor = {
phone?: string;
email?: string;
address?: any;
created_via?: string;
};

View File

@@ -7,4 +7,5 @@ export type UpdateRunner = {
phone?: string;
email?: string;
address?: any;
created_via?: string;
};

View File

@@ -0,0 +1,5 @@
export type UpdateRunnerCardByCode = {
code: string;
runner?: number;
enabled: boolean;
};

5
dist/models/UpdateRunnerCardByCode.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

@@ -17,8 +17,8 @@ export declare class AuthService {
/**
* Login
* Login with your username/email and password. <br> You will receive:
* * access token (use it as a bearer token)
* * refresh token (will also be sent as a cookie)
* * access token (use it as a bearer token)
* * refresh token (will also be sent as a cookie)
* @param requestBody CreateAuth
* @result any
* @throws ApiError
@@ -35,8 +35,8 @@ export declare class AuthService {
/**
* Refresh
* Refresh your access and refresh tokens using a valid refresh token. <br> You will receive:
* * access token (use it as a bearer token)
* * refresh token (will also be sent as a cookie)
* * access token (use it as a bearer token)
* * refresh token (will also be sent as a cookie)
* @param requestBody RefreshAuth
* @result any
* @throws ApiError

View File

@@ -6,8 +6,8 @@ class AuthService {
/**
* Login
* Login with your username/email and password. <br> You will receive:
* * access token (use it as a bearer token)
* * refresh token (will also be sent as a cookie)
* * access token (use it as a bearer token)
* * refresh token (will also be sent as a cookie)
* @param requestBody CreateAuth
* @result any
* @throws ApiError
@@ -38,8 +38,8 @@ class AuthService {
/**
* Refresh
* Refresh your access and refresh tokens using a valid refresh token. <br> You will receive:
* * access token (use it as a bearer token)
* * refresh token (will also be sent as a cookie)
* * access token (use it as a bearer token)
* * refresh token (will also be sent as a cookie)
* @param requestBody RefreshAuth
* @result any
* @throws ApiError

View File

@@ -1,5 +1,7 @@
import type { CreateAnonymousDonation } from '../models/CreateAnonymousDonation';
import type { CreateDistanceDonation } from '../models/CreateDistanceDonation';
import type { CreateFixedDonation } from '../models/CreateFixedDonation';
import type { ResponseAnonymousDonation } from '../models/ResponseAnonymousDonation';
import type { ResponseDistanceDonation } from '../models/ResponseDistanceDonation';
import type { ResponseDonation } from '../models/ResponseDonation';
import type { ResponseEmpty } from '../models/ResponseEmpty';
@@ -9,10 +11,12 @@ export declare class DonationService {
/**
* Get all
* Lists all donations (fixed or distance based) from all donors. <br> This includes the donations's runner's distance ran(if distance donation).
* @param page
* @param pageSize
* @result any
* @throws ApiError
*/
static donationControllerGetAll(): Promise<(Array<ResponseDonation> | Array<ResponseDistanceDonation>)>;
static donationControllerGetAll(page?: number, pageSize?: number): Promise<(Array<ResponseDonation> | Array<ResponseDistanceDonation> | Array<ResponseAnonymousDonation>)>;
/**
* Get one
* Lists all information about the donation whose id got provided. This includes the donation's runner's distance ran (if distance donation).
@@ -20,7 +24,7 @@ export declare class DonationService {
* @result any
* @throws ApiError
*/
static donationControllerGetOne(id: number): Promise<(ResponseDonation | ResponseDistanceDonation)>;
static donationControllerGetOne(id: number): Promise<(ResponseDonation | ResponseDistanceDonation | ResponseAnonymousDonation)>;
/**
* Remove
* Delete the donation whose id you provided. <br> If no donation with this id exists it will just return 204(no content).
@@ -39,6 +43,14 @@ export declare class DonationService {
* @throws ApiError
*/
static donationControllerPostFixed(requestBody?: CreateFixedDonation): Promise<ResponseDonation>;
/**
* Post anonymous
* Create a anonymous donation
* @param requestBody CreateAnonymousDonation
* @result ResponseDonation
* @throws ApiError
*/
static donationControllerPostAnonymous(requestBody?: CreateAnonymousDonation): Promise<ResponseDonation>;
/**
* Post distance
* Create a distance donation (not fixed donation - use /donations/fixed instead). <br> Please rmemember to provide the donation's donors's and runners ids and amount per distance (kilometer).

View File

@@ -6,13 +6,19 @@ class DonationService {
/**
* Get all
* Lists all donations (fixed or distance based) from all donors. <br> This includes the donations's runner's distance ran(if distance donation).
* @param page
* @param pageSize
* @result any
* @throws ApiError
*/
static async donationControllerGetAll() {
static async donationControllerGetAll(page, pageSize) {
const result = await (0, request_1.request)({
method: 'GET',
path: `/api/donations`,
query: {
'page': page,
'page_size': pageSize,
},
});
return result.body;
}
@@ -64,6 +70,21 @@ class DonationService {
});
return result.body;
}
/**
* Post anonymous
* Create a anonymous donation
* @param requestBody CreateAnonymousDonation
* @result ResponseDonation
* @throws ApiError
*/
static async donationControllerPostAnonymous(requestBody) {
const result = await (0, request_1.request)({
method: 'POST',
path: `/api/donations/anonymous`,
body: requestBody,
});
return result.body;
}
/**
* Post distance
* Create a distance donation (not fixed donation - use /donations/fixed instead). <br> Please rmemember to provide the donation's donors's and runners ids and amount per distance (kilometer).

View File

@@ -6,10 +6,12 @@ export declare class DonorService {
/**
* Get all
* Lists all donor. <br> This includes the donor's current donation amount.
* @param page
* @param pageSize
* @result ResponseDonor
* @throws ApiError
*/
static donorControllerGetAll(): Promise<Array<ResponseDonor>>;
static donorControllerGetAll(page?: number, pageSize?: number): Promise<Array<ResponseDonor>>;
/**
* Post
* Create a new donor.

View File

@@ -6,13 +6,19 @@ class DonorService {
/**
* Get all
* Lists all donor. <br> This includes the donor's current donation amount.
* @param page
* @param pageSize
* @result ResponseDonor
* @throws ApiError
*/
static async donorControllerGetAll() {
static async donorControllerGetAll(page, pageSize) {
const result = await (0, request_1.request)({
method: 'GET',
path: `/api/donors`,
query: {
'page': page,
'page_size': pageSize,
},
});
return result.body;
}

View File

@@ -6,10 +6,12 @@ export declare class GroupContactService {
/**
* Get all
* Lists all contacts. <br> This includes the contact's associated groups.
* @param page
* @param pageSize
* @result ResponseGroupContact
* @throws ApiError
*/
static groupContactControllerGetAll(): Promise<Array<ResponseGroupContact>>;
static groupContactControllerGetAll(page?: number, pageSize?: number): Promise<Array<ResponseGroupContact>>;
/**
* Post
* Create a new contact.

View File

@@ -6,13 +6,19 @@ class GroupContactService {
/**
* Get all
* Lists all contacts. <br> This includes the contact's associated groups.
* @param page
* @param pageSize
* @result ResponseGroupContact
* @throws ApiError
*/
static async groupContactControllerGetAll() {
static async groupContactControllerGetAll(page, pageSize) {
const result = await (0, request_1.request)({
method: 'GET',
path: `/api/contacts`,
query: {
'page': page,
'page_size': pageSize,
},
});
return result.body;
}

View File

@@ -7,10 +7,12 @@ export declare class PermissionService {
/**
* Get all
* Lists all permissions for all users and groups.
* @param page
* @param pageSize
* @result ResponsePermission
* @throws ApiError
*/
static permissionControllerGetAll(): Promise<Array<ResponsePermission>>;
static permissionControllerGetAll(page?: number, pageSize?: number): Promise<Array<ResponsePermission>>;
/**
* Post
* Create a new permission for a existing principal(user/group). <br> If a permission with this target, action and prinicpal already exists that permission will be returned instead of creating a new one.

View File

@@ -6,13 +6,19 @@ class PermissionService {
/**
* Get all
* Lists all permissions for all users and groups.
* @param page
* @param pageSize
* @result ResponsePermission
* @throws ApiError
*/
static async permissionControllerGetAll() {
static async permissionControllerGetAll(page, pageSize) {
const result = await (0, request_1.request)({
method: 'GET',
path: `/api/permissions`,
query: {
'page': page,
'page_size': pageSize,
},
});
return result.body;
}

View File

@@ -2,14 +2,17 @@ import type { CreateRunnerCard } from '../models/CreateRunnerCard';
import type { ResponseEmpty } from '../models/ResponseEmpty';
import type { ResponseRunnerCard } from '../models/ResponseRunnerCard';
import type { UpdateRunnerCard } from '../models/UpdateRunnerCard';
import type { UpdateRunnerCardByCode } from '../models/UpdateRunnerCardByCode';
export declare class RunnerCardService {
/**
* Get all
* Lists all card.
* @param page
* @param pageSize
* @result ResponseRunnerCard
* @throws ApiError
*/
static runnerCardControllerGetAll(): Promise<Array<ResponseRunnerCard>>;
static runnerCardControllerGetAll(page?: number, pageSize?: number): Promise<Array<ResponseRunnerCard>>;
/**
* Post
* Create a new card. <br> You can provide a associated runner by id but you don't have to.
@@ -54,4 +57,13 @@ export declare class RunnerCardService {
* @throws ApiError
*/
static runnerCardControllerPostBlancoBulk(count?: number, returnCards?: boolean): Promise<ResponseEmpty>;
/**
* Put by code
* Update the card whose code you provided.
* @param code
* @param requestBody UpdateRunnerCardByCode
* @result ResponseRunnerCard
* @throws ApiError
*/
static runnerCardControllerPutByCode(code: string, requestBody?: UpdateRunnerCardByCode): Promise<ResponseRunnerCard>;
}

View File

@@ -6,13 +6,19 @@ class RunnerCardService {
/**
* Get all
* Lists all card.
* @param page
* @param pageSize
* @result ResponseRunnerCard
* @throws ApiError
*/
static async runnerCardControllerGetAll() {
static async runnerCardControllerGetAll(page, pageSize) {
const result = await (0, request_1.request)({
method: 'GET',
path: `/api/cards`,
query: {
'page': page,
'page_size': pageSize,
},
});
return result.body;
}
@@ -99,5 +105,21 @@ class RunnerCardService {
});
return result.body;
}
/**
* Put by code
* Update the card whose code you provided.
* @param code
* @param requestBody UpdateRunnerCardByCode
* @result ResponseRunnerCard
* @throws ApiError
*/
static async runnerCardControllerPutByCode(code, requestBody) {
const result = await (0, request_1.request)({
method: 'PUT',
path: `/api/cards/${code}`,
body: requestBody,
});
return result.body;
}
}
exports.RunnerCardService = RunnerCardService;

View File

@@ -7,10 +7,12 @@ export declare class RunnerOrganizationService {
/**
* Get all
* Lists all organizations. <br> This includes their address, contact and teams (if existing/associated).
* @param page
* @param pageSize
* @result ResponseRunnerOrganization
* @throws ApiError
*/
static runnerOrganizationControllerGetAll(): Promise<Array<ResponseRunnerOrganization>>;
static runnerOrganizationControllerGetAll(page?: number, pageSize?: number): Promise<Array<ResponseRunnerOrganization>>;
/**
* Post
* Create a new organsisation.
@@ -51,8 +53,9 @@ export declare class RunnerOrganizationService {
* Lists all runners from this org and it's teams (if you don't provide the ?onlyDirect=true param). <br> This includes the runner's group and distance ran.
* @param id
* @param onlyDirect
* @param selfserviceLinks
* @result ResponseRunner
* @throws ApiError
*/
static runnerOrganizationControllerGetRunners(id: number, onlyDirect?: boolean): Promise<Array<ResponseRunner>>;
static runnerOrganizationControllerGetRunners(id: number, onlyDirect?: boolean, selfserviceLinks?: boolean): Promise<Array<ResponseRunner>>;
}

View File

@@ -6,13 +6,19 @@ class RunnerOrganizationService {
/**
* Get all
* Lists all organizations. <br> This includes their address, contact and teams (if existing/associated).
* @param page
* @param pageSize
* @result ResponseRunnerOrganization
* @throws ApiError
*/
static async runnerOrganizationControllerGetAll() {
static async runnerOrganizationControllerGetAll(page, pageSize) {
const result = await (0, request_1.request)({
method: 'GET',
path: `/api/organizations`,
query: {
'page': page,
'page_size': pageSize,
},
});
return result.body;
}
@@ -85,15 +91,17 @@ class RunnerOrganizationService {
* Lists all runners from this org and it's teams (if you don't provide the ?onlyDirect=true param). <br> This includes the runner's group and distance ran.
* @param id
* @param onlyDirect
* @param selfserviceLinks
* @result ResponseRunner
* @throws ApiError
*/
static async runnerOrganizationControllerGetRunners(id, onlyDirect) {
static async runnerOrganizationControllerGetRunners(id, onlyDirect, selfserviceLinks) {
const result = await (0, request_1.request)({
method: 'GET',
path: `/api/organizations/${id}/runners`,
query: {
'onlyDirect': onlyDirect,
'selfservice_links': selfserviceLinks,
},
});
return result.body;

View File

@@ -39,7 +39,7 @@ export declare class RunnerSelfService {
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).
* Use this endpoint to reuqest a new selfservice magic-login-link to be sent to your mail address (rate limited to one mail every 15mins).
* @param mail
* @param locale
* @result any Successful response

View File

@@ -64,7 +64,7 @@ class RunnerSelfService {
}
/**
* 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).
* Use this endpoint to reuqest a new selfservice magic-login-link to be sent to your mail address (rate limited to one mail every 15mins).
* @param mail
* @param locale
* @result any Successful response
@@ -73,7 +73,7 @@ class RunnerSelfService {
static async runnerSelfServiceControllerRequestNewToken(mail, locale) {
const result = await (0, request_1.request)({
method: 'POST',
path: `/api/runners/forgot`,
path: `/api/runners/login`,
query: {
'mail': mail,
'locale': locale,

View File

@@ -10,10 +10,14 @@ export declare class RunnerService {
/**
* Get all
* Lists all runners from all teams/orgs. <br> This includes the runner's group and distance ran.
* @param page
* @param pageSize
* @param createdVia
* @param selfserviceLinks
* @result ResponseRunner
* @throws ApiError
*/
static runnerControllerGetAll(): Promise<Array<ResponseRunner>>;
static runnerControllerGetAll(page?: number, pageSize?: number, createdVia?: string, selfserviceLinks?: boolean): Promise<Array<ResponseRunner>>;
/**
* Post
* Create a new runner. <br> Please remeber to provide the runner's group's id.

View File

@@ -6,13 +6,23 @@ class RunnerService {
/**
* Get all
* Lists all runners from all teams/orgs. <br> This includes the runner's group and distance ran.
* @param page
* @param pageSize
* @param createdVia
* @param selfserviceLinks
* @result ResponseRunner
* @throws ApiError
*/
static async runnerControllerGetAll() {
static async runnerControllerGetAll(page, pageSize, createdVia, selfserviceLinks) {
const result = await (0, request_1.request)({
method: 'GET',
path: `/api/runners`,
query: {
'page': page,
'page_size': pageSize,
'created_via': createdVia,
'selfservice_links': selfserviceLinks,
},
});
return result.body;
}

View File

@@ -7,10 +7,12 @@ export declare class RunnerTeamService {
/**
* Get all
* Lists all teams. <br> This includes their parent organization and contact (if existing/associated).
* @param page
* @param pageSize
* @result ResponseRunnerTeam
* @throws ApiError
*/
static runnerTeamControllerGetAll(): Promise<Array<ResponseRunnerTeam>>;
static runnerTeamControllerGetAll(page?: number, pageSize?: number): Promise<Array<ResponseRunnerTeam>>;
/**
* Post
* Create a new organsisation. <br> Please remember to provide it's parent group's id.
@@ -50,8 +52,9 @@ export declare class RunnerTeamService {
* Get runners
* Lists all runners from this team. <br> This includes the runner's group and distance ran.
* @param id
* @param selfserviceLinks
* @result ResponseRunner
* @throws ApiError
*/
static runnerTeamControllerGetRunners(id: number): Promise<Array<ResponseRunner>>;
static runnerTeamControllerGetRunners(id: number, selfserviceLinks?: boolean): Promise<Array<ResponseRunner>>;
}

View File

@@ -6,13 +6,19 @@ class RunnerTeamService {
/**
* Get all
* Lists all teams. <br> This includes their parent organization and contact (if existing/associated).
* @param page
* @param pageSize
* @result ResponseRunnerTeam
* @throws ApiError
*/
static async runnerTeamControllerGetAll() {
static async runnerTeamControllerGetAll(page, pageSize) {
const result = await (0, request_1.request)({
method: 'GET',
path: `/api/teams`,
query: {
'page': page,
'page_size': pageSize,
},
});
return result.body;
}
@@ -84,13 +90,17 @@ class RunnerTeamService {
* Get runners
* Lists all runners from this team. <br> This includes the runner's group and distance ran.
* @param id
* @param selfserviceLinks
* @result ResponseRunner
* @throws ApiError
*/
static async runnerTeamControllerGetRunners(id) {
static async runnerTeamControllerGetRunners(id, selfserviceLinks) {
const result = await (0, request_1.request)({
method: 'GET',
path: `/api/teams/${id}/runners`,
query: {
'selfservice_links': selfserviceLinks,
},
});
return result.body;
}

View File

@@ -9,10 +9,12 @@ export declare class ScanService {
/**
* Get all
* Lists all scans (normal or track) from all runners. <br> This includes the scan's runner's distance ran.
* @param page
* @param pageSize
* @result any
* @throws ApiError
*/
static scanControllerGetAll(): Promise<(Array<ResponseScan> | Array<ResponseTrackScan>)>;
static scanControllerGetAll(page?: number, pageSize?: number): Promise<(Array<ResponseScan> | Array<ResponseTrackScan>)>;
/**
* Post
* Create a new scan (not track scan - use /scans/trackscans instead). <br> Please rmemember to provide the scan's runner's id and distance.

View File

@@ -6,13 +6,19 @@ class ScanService {
/**
* Get all
* Lists all scans (normal or track) from all runners. <br> This includes the scan's runner's distance ran.
* @param page
* @param pageSize
* @result any
* @throws ApiError
*/
static async scanControllerGetAll() {
static async scanControllerGetAll(page, pageSize) {
const result = await (0, request_1.request)({
method: 'GET',
path: `/api/scans`,
query: {
'page': page,
'page_size': pageSize,
},
});
return result.body;
}

View File

@@ -6,10 +6,12 @@ export declare class ScanStationService {
/**
* Get all
* Lists all stations. <br> This includes their associated tracks.
* @param page
* @param pageSize
* @result ResponseScanStation
* @throws ApiError
*/
static scanStationControllerGetAll(): Promise<Array<ResponseScanStation>>;
static scanStationControllerGetAll(page?: number, pageSize?: number): Promise<Array<ResponseScanStation>>;
/**
* Post
* Create a new station. <br> Please remeber to provide the station's track's id. <br> Please also remember that the station key is only visibe on creation.

View File

@@ -6,13 +6,19 @@ class ScanStationService {
/**
* Get all
* Lists all stations. <br> This includes their associated tracks.
* @param page
* @param pageSize
* @result ResponseScanStation
* @throws ApiError
*/
static async scanStationControllerGetAll() {
static async scanStationControllerGetAll(page, pageSize) {
const result = await (0, request_1.request)({
method: 'GET',
path: `/api/stations`,
query: {
'page': page,
'page_size': pageSize,
},
});
return result.body;
}

View File

@@ -5,10 +5,12 @@ export declare class StatsClientService {
/**
* Get all
* Lists all stats clients. Please remember that the key can only be viewed on creation.
* @param page
* @param pageSize
* @result ResponseStatsClient
* @throws ApiError
*/
static statsClientControllerGetAll(): Promise<Array<ResponseStatsClient>>;
static statsClientControllerGetAll(page?: number, pageSize?: number): Promise<Array<ResponseStatsClient>>;
/**
* Post
* Create a new stats client. <br> Please remember that the client's key will be generated automaticly and that it can only be viewed on creation.

View File

@@ -6,13 +6,19 @@ class StatsClientService {
/**
* Get all
* Lists all stats clients. Please remember that the key can only be viewed on creation.
* @param page
* @param pageSize
* @result ResponseStatsClient
* @throws ApiError
*/
static async statsClientControllerGetAll() {
static async statsClientControllerGetAll(page, pageSize) {
const result = await (0, request_1.request)({
method: 'GET',
path: `/api/statsclients`,
query: {
'page': page,
'page_size': pageSize,
},
});
return result.body;
}

View File

@@ -6,10 +6,12 @@ export declare class TrackService {
/**
* Get all
* Lists all tracks.
* @param page
* @param pageSize
* @result ResponseTrack
* @throws ApiError
*/
static trackControllerGetAll(): Promise<Array<ResponseTrack>>;
static trackControllerGetAll(page?: number, pageSize?: number): Promise<Array<ResponseTrack>>;
/**
* Post
* Create a new track. <br> Please remember that the track's distance must be greater than 0.

View File

@@ -6,13 +6,19 @@ class TrackService {
/**
* Get all
* Lists all tracks.
* @param page
* @param pageSize
* @result ResponseTrack
* @throws ApiError
*/
static async trackControllerGetAll() {
static async trackControllerGetAll(page, pageSize) {
const result = await (0, request_1.request)({
method: 'GET',
path: `/api/tracks`,
query: {
'page': page,
'page_size': pageSize,
},
});
return result.body;
}

View File

@@ -9,10 +9,12 @@ export declare class UserGroupService {
/**
* Get all
* Lists all groups. <br> The information provided might change while the project continues to evolve.
* @param page
* @param pageSize
* @result ResponseUserGroup
* @throws ApiError
*/
static userGroupControllerGetAll(): Promise<Array<ResponseUserGroup>>;
static userGroupControllerGetAll(page?: number, pageSize?: number): Promise<Array<ResponseUserGroup>>;
/**
* Post
* Create a new group. <br> If you want to grant permissions to the group you have to create them seperately by posting to /api/permissions after creating the group.

View File

@@ -6,13 +6,19 @@ class UserGroupService {
/**
* Get all
* Lists all groups. <br> The information provided might change while the project continues to evolve.
* @param page
* @param pageSize
* @result ResponseUserGroup
* @throws ApiError
*/
static async userGroupControllerGetAll() {
static async userGroupControllerGetAll(page, pageSize) {
const result = await (0, request_1.request)({
method: 'GET',
path: `/api/usergroups`,
query: {
'page': page,
'page_size': pageSize,
},
});
return result.body;
}

View File

@@ -6,10 +6,12 @@ export declare class UserService {
/**
* Get all
* Lists all users. <br> This includes their groups and permissions granted to them.
* @param page
* @param pageSize
* @result ResponseUser
* @throws ApiError
*/
static userControllerGetAll(): Promise<Array<ResponseUser>>;
static userControllerGetAll(page?: number, pageSize?: number): Promise<Array<ResponseUser>>;
/**
* Post
* Create a new user. <br> If you want to grant permissions to the user you have to create them seperately by posting to /api/permissions after creating the user.

View File

@@ -6,13 +6,19 @@ class UserService {
/**
* Get all
* Lists all users. <br> This includes their groups and permissions granted to them.
* @param page
* @param pageSize
* @result ResponseUser
* @throws ApiError
*/
static async userControllerGetAll() {
static async userControllerGetAll(page, pageSize) {
const result = await (0, request_1.request)({
method: 'GET',
path: `/api/users`,
query: {
'page': page,
'page_size': pageSize,
},
});
return result.body;
}

File diff suppressed because one or more lines are too long

View File

@@ -1,39 +1,58 @@
{
"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.11.1",
"license": "CC-BY-NC-SA-4.0",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"repository": {
"type": "git",
"url": "git+https://git.odit.services/lfk/lfk-client-js"
},
"keywords": [
"odit",
"odit.services",
"lfk"
],
"author": "ODIT.Services",
"files": [
"**/dist",
"package.json",
"README.md"
],
"scripts": {
"build": "npm run build:prepare && npm run build:lib && npm run build:compile && npm run build:cleanup",
"build:prepare": "rimraf ./lib ./dist",
"build:lib": "openapi --input ./openapi.json --output ./lib --client fetch",
"build:compile": "tsc",
"build:cleanup": "rimraf ./lib"
},
"bugs": {
"url": "https://git.odit.services/lfk/lfk-client-js/issues"
},
"homepage": "https://git.odit.services/lfk/lfk-client-js/",
"devDependencies": {
"openapi-typescript-codegen": "0.7.0",
"rimraf": "4.1.2",
"typescript": "4.9.5"
}
}
{
"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": "1.2.7",
"license": "CC-BY-NC-SA-4.0",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"repository": {
"type": "git",
"url": "git+https://git.odit.services/lfk/lfk-client-js"
},
"keywords": [
"odit",
"odit.services",
"lfk"
],
"author": "ODIT.Services",
"files": [
"dist",
"package.json",
"README.md"
],
"scripts": {
"build": "npm run build:prepare && npm run build:lib && npm run build:compile && npm run build:cleanup",
"build:prepare": "rimraf ./lib ./dist",
"build:lib": "openapi --input ./openapi.json --output ./lib --client fetch",
"build:compile": "tsc",
"build:cleanup": "rimraf ./lib",
"update:openapi": "rimraf ./openapi.json && node ./scripts/getliveopenapi.js",
"update:auto": "npm run update:openapi && npm run build && npm run update:commit && npm run release",
"update:commit": "git add . && git commit -m \"chore: update openapi.json\"",
"release": "release-it --only-version && npm publish"
},
"bugs": {
"url": "https://git.odit.services/lfk/lfk-client-js/issues"
},
"homepage": "https://git.odit.services/lfk/lfk-client-js/",
"devDependencies": {
"openapi-typescript-codegen": "0.7.0",
"release-it": "17.10.0",
"rimraf": "6.0.1",
"typescript": "4.9.5"
},
"release-it": {
"git": {
"commit": true,
"requireCleanWorkingDir": false,
"commitMessage": "chore(release): ${version}",
"push": true,
"tag": true,
"tagName": "${version}",
"tagAnnotation": "${version}"
},
"npm": {
"publish": false
}
}
}

2313
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

27
scripts/getliveopenapi.js Normal file
View File

@@ -0,0 +1,27 @@
const https = require('https');
const fs = require('fs');
const url = 'https://run.lauf-fuer-kaya.de/api/docs/openapi.json';
const output = 'openapi.json';
https.get(url, (res) => {
if (res.statusCode !== 200) {
console.error(`Request Failed. Status Code: ${res.statusCode}`);
res.resume();
return;
}
let data = '';
res.on('data', chunk => data += chunk);
res.on('end', () => {
fs.writeFile(output, data, (err) => {
if (err) {
console.error('Error writing file:', err);
} else {
console.log(`Saved latest OpenAPI JSON to ${output}`);
}
});
});
}).on('error', (e) => {
console.error(`Got error: ${e.message}`);
});