🚀New lib version v0.0.12 [CI SKIP]
All checks were successful
continuous-integration/drone Build is passing

This commit is contained in:
2021-01-13 19:36:10 +00:00
parent 2f554700a7
commit f2b867cd04
55 changed files with 431 additions and 27 deletions

68
dist/services/DonationService.d.ts vendored Normal file
View File

@@ -0,0 +1,68 @@
import type { CreateDistanceDonation } from '../models/CreateDistanceDonation';
import type { CreateFixedDonation } from '../models/CreateFixedDonation';
import type { ResponseDistanceDonation } from '../models/ResponseDistanceDonation';
import type { ResponseDonation } from '../models/ResponseDonation';
import type { ResponseEmpty } from '../models/ResponseEmpty';
import type { UpdateDistanceDonation } from '../models/UpdateDistanceDonation';
import type { UpdateFixedDonation } from '../models/UpdateFixedDonation';
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).
* @returns any
* @throws ApiError
*/
static donationControllerGetAll(): Promise<(Array<ResponseDonation> | Array<ResponseDistanceDonation>)>;
/**
* Get one
* Lists all information about the donation whose id got provided. This includes the donation's runner's distance ran (if distance donation).
* @param id
* @returns any
* @throws ApiError
*/
static donationControllerGetOne(id: number): Promise<(ResponseDonation | ResponseDistanceDonation)>;
/**
* Remove
* Delete the donation whose id you provided. <br> If no donation with this id exists it will just return 204(no content).
* @param id
* @param force
* @returns any
* @returns ResponseEmpty
* @throws ApiError
*/
static donationControllerRemove(id: number, force?: boolean): Promise<(ResponseDonation | ResponseDistanceDonation) | ResponseEmpty>;
/**
* Post fixed
* Create a fixed donation (not distance donation - use /donations/distance instead). <br> Please rmemember to provide the donation's donors's id and amount.
* @param requestBody CreateFixedDonation
* @returns ResponseDonation
* @throws ApiError
*/
static donationControllerPostFixed(requestBody?: CreateFixedDonation): 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).
* @param requestBody CreateDistanceDonation
* @returns ResponseDistanceDonation
* @throws ApiError
*/
static donationControllerPostDistance(requestBody?: CreateDistanceDonation): Promise<ResponseDistanceDonation>;
/**
* Put fixed
* Update the fixed donation (not distance donation - use /donations/distance instead) whose id you provided. <br> Please remember that ids can't be changed and amounts must be positive.
* @param id
* @param requestBody UpdateFixedDonation
* @returns ResponseDonation
* @throws ApiError
*/
static donationControllerPutFixed(id: number, requestBody?: UpdateFixedDonation): Promise<ResponseDonation>;
/**
* Put distance
* Update the distance donation (not fixed donation - use /donations/fixed instead) whose id you provided. <br> Please remember that ids can't be changed and amountPerDistance must be positive.
* @param id
* @param requestBody UpdateDistanceDonation
* @returns ResponseDonation
* @throws ApiError
*/
static donationControllerPutDistance(id: number, requestBody?: UpdateDistanceDonation): Promise<ResponseDonation>;
}

115
dist/services/DonationService.js vendored Normal file
View File

@@ -0,0 +1,115 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DonationService = void 0;
const request_1 = require("../core/request");
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).
* @returns any
* @throws ApiError
*/
static async donationControllerGetAll() {
const result = await request_1.request({
method: 'GET',
path: `/api/donations`,
});
return result.body;
}
/**
* Get one
* Lists all information about the donation whose id got provided. This includes the donation's runner's distance ran (if distance donation).
* @param id
* @returns any
* @throws ApiError
*/
static async donationControllerGetOne(id) {
const result = await request_1.request({
method: 'GET',
path: `/api/donations/${id}`,
});
return result.body;
}
/**
* Remove
* Delete the donation whose id you provided. <br> If no donation with this id exists it will just return 204(no content).
* @param id
* @param force
* @returns any
* @returns ResponseEmpty
* @throws ApiError
*/
static async donationControllerRemove(id, force) {
const result = await request_1.request({
method: 'DELETE',
path: `/api/donations/${id}`,
query: {
'force': force,
},
});
return result.body;
}
/**
* Post fixed
* Create a fixed donation (not distance donation - use /donations/distance instead). <br> Please rmemember to provide the donation's donors's id and amount.
* @param requestBody CreateFixedDonation
* @returns ResponseDonation
* @throws ApiError
*/
static async donationControllerPostFixed(requestBody) {
const result = await request_1.request({
method: 'POST',
path: `/api/donations/fixed`,
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).
* @param requestBody CreateDistanceDonation
* @returns ResponseDistanceDonation
* @throws ApiError
*/
static async donationControllerPostDistance(requestBody) {
const result = await request_1.request({
method: 'POST',
path: `/api/donations/distance`,
body: requestBody,
});
return result.body;
}
/**
* Put fixed
* Update the fixed donation (not distance donation - use /donations/distance instead) whose id you provided. <br> Please remember that ids can't be changed and amounts must be positive.
* @param id
* @param requestBody UpdateFixedDonation
* @returns ResponseDonation
* @throws ApiError
*/
static async donationControllerPutFixed(id, requestBody) {
const result = await request_1.request({
method: 'PUT',
path: `/api/donations/fixed/${id}`,
body: requestBody,
});
return result.body;
}
/**
* Put distance
* Update the distance donation (not fixed donation - use /donations/fixed instead) whose id you provided. <br> Please remember that ids can't be changed and amountPerDistance must be positive.
* @param id
* @param requestBody UpdateDistanceDonation
* @returns ResponseDonation
* @throws ApiError
*/
static async donationControllerPutDistance(id, requestBody) {
const result = await request_1.request({
method: 'PUT',
path: `/api/donations/distance/${id}`,
body: requestBody,
});
return result.body;
}
}
exports.DonationService = DonationService;

View File

@@ -5,14 +5,14 @@ import type { UpdateDonor } from '../models/UpdateDonor';
export declare class DonorService {
/**
* Get all
* Lists all runners from all teams/orgs. <br> This includes the runner's group and distance ran.
* Lists all donor. <br> This includes the donor's current donation amount.
* @returns ResponseDonor
* @throws ApiError
*/
static donorControllerGetAll(): Promise<Array<ResponseDonor>>;
/**
* Post
* Create a new runner. <br> Please remeber to provide the runner's group's id.
* Create a new donor.
* @param requestBody CreateDonor
* @returns ResponseDonor
* @throws ApiError
@@ -20,7 +20,7 @@ export declare class DonorService {
static donorControllerPost(requestBody?: CreateDonor): Promise<ResponseDonor>;
/**
* Get one
* Lists all information about the runner whose id got provided.
* Lists all information about the donor whose id got provided. <br> This includes the donor's current donation amount.
* @param id
* @returns ResponseDonor
* @throws ApiError
@@ -28,7 +28,7 @@ export declare class DonorService {
static donorControllerGetOne(id: number): Promise<ResponseDonor>;
/**
* Put
* Update the runner whose id you provided. <br> Please remember that ids can't be changed.
* Update the donor whose id you provided. <br> Please remember that ids can't be changed.
* @param id
* @param requestBody UpdateDonor
* @returns ResponseDonor
@@ -37,7 +37,7 @@ export declare class DonorService {
static donorControllerPut(id: number, requestBody?: UpdateDonor): Promise<ResponseDonor>;
/**
* Remove
* Delete the runner whose id you provided. <br> If no runner with this id exists it will just return 204(no content).
* Delete the donor whose id you provided. <br> If no donor with this id exists it will just return 204(no content). <br> If the donor still has donations associated this will fail, please provide the query param ?force=true to delete the donor with all associated donations.
* @param id
* @param force
* @returns ResponseDonor

View File

@@ -5,7 +5,7 @@ const request_1 = require("../core/request");
class DonorService {
/**
* Get all
* Lists all runners from all teams/orgs. <br> This includes the runner's group and distance ran.
* Lists all donor. <br> This includes the donor's current donation amount.
* @returns ResponseDonor
* @throws ApiError
*/
@@ -18,7 +18,7 @@ class DonorService {
}
/**
* Post
* Create a new runner. <br> Please remeber to provide the runner's group's id.
* Create a new donor.
* @param requestBody CreateDonor
* @returns ResponseDonor
* @throws ApiError
@@ -33,7 +33,7 @@ class DonorService {
}
/**
* Get one
* Lists all information about the runner whose id got provided.
* Lists all information about the donor whose id got provided. <br> This includes the donor's current donation amount.
* @param id
* @returns ResponseDonor
* @throws ApiError
@@ -47,7 +47,7 @@ class DonorService {
}
/**
* Put
* Update the runner whose id you provided. <br> Please remember that ids can't be changed.
* Update the donor whose id you provided. <br> Please remember that ids can't be changed.
* @param id
* @param requestBody UpdateDonor
* @returns ResponseDonor
@@ -63,7 +63,7 @@ class DonorService {
}
/**
* Remove
* Delete the runner whose id you provided. <br> If no runner with this id exists it will just return 204(no content).
* Delete the donor whose id you provided. <br> If no donor with this id exists it will just return 204(no content). <br> If the donor still has donations associated this will fail, please provide the query param ?force=true to delete the donor with all associated donations.
* @param id
* @param force
* @returns ResponseDonor

View File

@@ -6,4 +6,11 @@ export declare class StatusService {
* @throws ApiError
*/
static statusControllerGet(): Promise<any>;
/**
* Get version
* A very basic endpoint that just returns the curent package version.
* @returns any Successful response
* @throws ApiError
*/
static statusControllerGetVersion(): Promise<any>;
}

View File

@@ -19,5 +19,18 @@ class StatusService {
});
return result.body;
}
/**
* Get version
* A very basic endpoint that just returns the curent package version.
* @returns any Successful response
* @throws ApiError
*/
static async statusControllerGetVersion() {
const result = await request_1.request({
method: 'GET',
path: `/api/version`,
});
return result.body;
}
}
exports.StatusService = StatusService;

View File

@@ -2,11 +2,10 @@ import type { CreateUser } from '../models/CreateUser';
import type { ResponseEmpty } from '../models/ResponseEmpty';
import type { ResponseUser } from '../models/ResponseUser';
import type { UpdateUser } from '../models/UpdateUser';
import type { UserGroupNotFoundError } from '../models/UserGroupNotFoundError';
export declare class UserService {
/**
* Get all
* Lists all users. <br> This includes their groups and permissions directly granted to them (if existing/associated).
* Lists all users. <br> This includes their groups and permissions granted to them.
* @returns ResponseUser
* @throws ApiError
*/
@@ -15,13 +14,13 @@ export declare class UserService {
* 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.
* @param requestBody CreateUser
* @returns any
* @returns ResponseUser
* @throws ApiError
*/
static userControllerPost(requestBody?: CreateUser): Promise<(ResponseUser | UserGroupNotFoundError)>;
static userControllerPost(requestBody?: CreateUser): Promise<ResponseUser>;
/**
* Get one
* Lists all information about the user whose id got provided. <br> Please remember that only permissions granted directly to the user will show up here, not permissions inherited from groups.
* Lists all information about the user whose id got provided. <br> Please remember that all permissions granted to the user will show up here.
* @param id
* @returns ResponseUser
* @throws ApiError
@@ -46,4 +45,12 @@ export declare class UserService {
* @throws ApiError
*/
static userControllerRemove(id: number, force?: boolean): Promise<ResponseUser | ResponseEmpty>;
/**
* Get permissions
* Lists all permissions granted to the user sorted into directly granted and inherited as permission response objects.
* @param id
* @returns ResponseUser
* @throws ApiError
*/
static userControllerGetPermissions(id: number): Promise<ResponseUser>;
}

View File

@@ -5,7 +5,7 @@ const request_1 = require("../core/request");
class UserService {
/**
* Get all
* Lists all users. <br> This includes their groups and permissions directly granted to them (if existing/associated).
* Lists all users. <br> This includes their groups and permissions granted to them.
* @returns ResponseUser
* @throws ApiError
*/
@@ -20,7 +20,7 @@ class UserService {
* 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.
* @param requestBody CreateUser
* @returns any
* @returns ResponseUser
* @throws ApiError
*/
static async userControllerPost(requestBody) {
@@ -33,7 +33,7 @@ class UserService {
}
/**
* Get one
* Lists all information about the user whose id got provided. <br> Please remember that only permissions granted directly to the user will show up here, not permissions inherited from groups.
* Lists all information about the user whose id got provided. <br> Please remember that all permissions granted to the user will show up here.
* @param id
* @returns ResponseUser
* @throws ApiError
@@ -80,5 +80,19 @@ class UserService {
});
return result.body;
}
/**
* Get permissions
* Lists all permissions granted to the user sorted into directly granted and inherited as permission response objects.
* @param id
* @returns ResponseUser
* @throws ApiError
*/
static async userControllerGetPermissions(id) {
const result = await request_1.request({
method: 'GET',
path: `/api/users/${id}/permissions`,
});
return result.body;
}
}
exports.UserService = UserService;