@pescheckit/pescheck-client 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +97 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +23 -0
- package/README.md +200 -0
- package/dist/apis/AuthenticationApi.d.ts +131 -0
- package/dist/apis/AuthenticationApi.js +168 -0
- package/dist/apis/ChecksApi.d.ts +91 -0
- package/dist/apis/ChecksApi.js +116 -0
- package/dist/apis/DivisionsApi.d.ts +211 -0
- package/dist/apis/DivisionsApi.js +264 -0
- package/dist/apis/OAuthApi.d.ts +124 -0
- package/dist/apis/OAuthApi.js +159 -0
- package/dist/apis/ProfilesApi.d.ts +270 -0
- package/dist/apis/ProfilesApi.js +334 -0
- package/dist/apis/ScreeningsApi.d.ts +172 -0
- package/dist/apis/ScreeningsApi.js +216 -0
- package/dist/apis/WebhooksApi.d.ts +168 -0
- package/dist/apis/WebhooksApi.js +213 -0
- package/dist/apis/index.d.ts +7 -0
- package/dist/apis/index.js +25 -0
- package/dist/esm/apis/AuthenticationApi.d.ts +131 -0
- package/dist/esm/apis/AuthenticationApi.js +164 -0
- package/dist/esm/apis/ChecksApi.d.ts +91 -0
- package/dist/esm/apis/ChecksApi.js +112 -0
- package/dist/esm/apis/DivisionsApi.d.ts +211 -0
- package/dist/esm/apis/DivisionsApi.js +260 -0
- package/dist/esm/apis/OAuthApi.d.ts +124 -0
- package/dist/esm/apis/OAuthApi.js +155 -0
- package/dist/esm/apis/ProfilesApi.d.ts +270 -0
- package/dist/esm/apis/ProfilesApi.js +330 -0
- package/dist/esm/apis/ScreeningsApi.d.ts +172 -0
- package/dist/esm/apis/ScreeningsApi.js +212 -0
- package/dist/esm/apis/WebhooksApi.d.ts +168 -0
- package/dist/esm/apis/WebhooksApi.js +209 -0
- package/dist/esm/apis/index.d.ts +7 -0
- package/dist/esm/apis/index.js +9 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/models/CustomTokenObtainPair.d.ts +38 -0
- package/dist/esm/models/CustomTokenObtainPair.js +47 -0
- package/dist/esm/models/DivisionReadOnly.d.ts +116 -0
- package/dist/esm/models/DivisionReadOnly.js +73 -0
- package/dist/esm/models/DivisionWrite.d.ts +98 -0
- package/dist/esm/models/DivisionWrite.js +78 -0
- package/dist/esm/models/JWTGeneration.d.ts +50 -0
- package/dist/esm/models/JWTGeneration.js +51 -0
- package/dist/esm/models/JWTResponse.d.ts +62 -0
- package/dist/esm/models/JWTResponse.js +61 -0
- package/dist/esm/models/OAuthApplication.d.ts +84 -0
- package/dist/esm/models/OAuthApplication.js +68 -0
- package/dist/esm/models/OAuthApplicationResponse.d.ts +98 -0
- package/dist/esm/models/OAuthApplicationResponse.js +80 -0
- package/dist/esm/models/PaginatedDivisionReadOnlyList.d.ts +51 -0
- package/dist/esm/models/PaginatedDivisionReadOnlyList.js +56 -0
- package/dist/esm/models/PaginatedV2ProfileListItemList.d.ts +51 -0
- package/dist/esm/models/PaginatedV2ProfileListItemList.js +56 -0
- package/dist/esm/models/PaginatedV2ScreeningListItemList.d.ts +51 -0
- package/dist/esm/models/PaginatedV2ScreeningListItemList.js +56 -0
- package/dist/esm/models/PatchedDivisionWrite.d.ts +98 -0
- package/dist/esm/models/PatchedDivisionWrite.js +62 -0
- package/dist/esm/models/PatchedV2ProfilePartialUpdate.d.ts +39 -0
- package/dist/esm/models/PatchedV2ProfilePartialUpdate.js +43 -0
- package/dist/esm/models/TokenRefresh.d.ts +38 -0
- package/dist/esm/models/TokenRefresh.js +44 -0
- package/dist/esm/models/V2Candidate.d.ts +592 -0
- package/dist/esm/models/V2Candidate.js +318 -0
- package/dist/esm/models/V2CheckField.d.ts +56 -0
- package/dist/esm/models/V2CheckField.js +53 -0
- package/dist/esm/models/V2CheckInfo.d.ts +100 -0
- package/dist/esm/models/V2CheckInfo.js +76 -0
- package/dist/esm/models/V2Document.d.ts +115 -0
- package/dist/esm/models/V2Document.js +84 -0
- package/dist/esm/models/V2DocumentContent.d.ts +40 -0
- package/dist/esm/models/V2DocumentContent.js +45 -0
- package/dist/esm/models/V2Money.d.ts +38 -0
- package/dist/esm/models/V2Money.js +47 -0
- package/dist/esm/models/V2ProfileCheck.d.ts +85 -0
- package/dist/esm/models/V2ProfileCheck.js +68 -0
- package/dist/esm/models/V2ProfileCheckEntry.d.ts +120 -0
- package/dist/esm/models/V2ProfileCheckEntry.js +87 -0
- package/dist/esm/models/V2ProfileCreate.d.ts +45 -0
- package/dist/esm/models/V2ProfileCreate.js +50 -0
- package/dist/esm/models/V2ProfileDetail.d.ts +94 -0
- package/dist/esm/models/V2ProfileDetail.js +75 -0
- package/dist/esm/models/V2ProfileListItem.d.ts +68 -0
- package/dist/esm/models/V2ProfileListItem.js +61 -0
- package/dist/esm/models/V2ProfileUpdate.d.ts +47 -0
- package/dist/esm/models/V2ProfileUpdate.js +50 -0
- package/dist/esm/models/V2ProfileUpdateCheck.d.ts +96 -0
- package/dist/esm/models/V2ProfileUpdateCheck.js +74 -0
- package/dist/esm/models/V2ScreeningCheck.d.ts +95 -0
- package/dist/esm/models/V2ScreeningCheck.js +72 -0
- package/dist/esm/models/V2ScreeningCheckEntry.d.ts +135 -0
- package/dist/esm/models/V2ScreeningCheckEntry.js +92 -0
- package/dist/esm/models/V2ScreeningCheckListItem.d.ts +93 -0
- package/dist/esm/models/V2ScreeningCheckListItem.js +74 -0
- package/dist/esm/models/V2ScreeningCreate.d.ts +46 -0
- package/dist/esm/models/V2ScreeningCreate.js +51 -0
- package/dist/esm/models/V2ScreeningDetail.d.ts +83 -0
- package/dist/esm/models/V2ScreeningDetail.js +70 -0
- package/dist/esm/models/V2ScreeningDetailProfile.d.ts +38 -0
- package/dist/esm/models/V2ScreeningDetailProfile.js +43 -0
- package/dist/esm/models/V2ScreeningListItem.d.ts +85 -0
- package/dist/esm/models/V2ScreeningListItem.js +69 -0
- package/dist/esm/models/VerifyWebhook.d.ts +34 -0
- package/dist/esm/models/VerifyWebhook.js +43 -0
- package/dist/esm/models/Webhook.d.ts +71 -0
- package/dist/esm/models/Webhook.js +69 -0
- package/dist/esm/models/WebhookResponse.d.ts +87 -0
- package/dist/esm/models/WebhookResponse.js +51 -0
- package/dist/esm/models/index.d.ts +36 -0
- package/dist/esm/models/index.js +38 -0
- package/dist/esm/runtime.d.ts +184 -0
- package/dist/esm/runtime.js +349 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +21 -0
- package/dist/models/CustomTokenObtainPair.d.ts +38 -0
- package/dist/models/CustomTokenObtainPair.js +54 -0
- package/dist/models/DivisionReadOnly.d.ts +116 -0
- package/dist/models/DivisionReadOnly.js +80 -0
- package/dist/models/DivisionWrite.d.ts +98 -0
- package/dist/models/DivisionWrite.js +85 -0
- package/dist/models/JWTGeneration.d.ts +50 -0
- package/dist/models/JWTGeneration.js +58 -0
- package/dist/models/JWTResponse.d.ts +62 -0
- package/dist/models/JWTResponse.js +68 -0
- package/dist/models/OAuthApplication.d.ts +84 -0
- package/dist/models/OAuthApplication.js +76 -0
- package/dist/models/OAuthApplicationResponse.d.ts +98 -0
- package/dist/models/OAuthApplicationResponse.js +88 -0
- package/dist/models/PaginatedDivisionReadOnlyList.d.ts +51 -0
- package/dist/models/PaginatedDivisionReadOnlyList.js +63 -0
- package/dist/models/PaginatedV2ProfileListItemList.d.ts +51 -0
- package/dist/models/PaginatedV2ProfileListItemList.js +63 -0
- package/dist/models/PaginatedV2ScreeningListItemList.d.ts +51 -0
- package/dist/models/PaginatedV2ScreeningListItemList.js +63 -0
- package/dist/models/PatchedDivisionWrite.d.ts +98 -0
- package/dist/models/PatchedDivisionWrite.js +69 -0
- package/dist/models/PatchedV2ProfilePartialUpdate.d.ts +39 -0
- package/dist/models/PatchedV2ProfilePartialUpdate.js +50 -0
- package/dist/models/TokenRefresh.d.ts +38 -0
- package/dist/models/TokenRefresh.js +51 -0
- package/dist/models/V2Candidate.d.ts +592 -0
- package/dist/models/V2Candidate.js +326 -0
- package/dist/models/V2CheckField.d.ts +56 -0
- package/dist/models/V2CheckField.js +60 -0
- package/dist/models/V2CheckInfo.d.ts +100 -0
- package/dist/models/V2CheckInfo.js +83 -0
- package/dist/models/V2Document.d.ts +115 -0
- package/dist/models/V2Document.js +92 -0
- package/dist/models/V2DocumentContent.d.ts +40 -0
- package/dist/models/V2DocumentContent.js +52 -0
- package/dist/models/V2Money.d.ts +38 -0
- package/dist/models/V2Money.js +54 -0
- package/dist/models/V2ProfileCheck.d.ts +85 -0
- package/dist/models/V2ProfileCheck.js +76 -0
- package/dist/models/V2ProfileCheckEntry.d.ts +120 -0
- package/dist/models/V2ProfileCheckEntry.js +95 -0
- package/dist/models/V2ProfileCreate.d.ts +45 -0
- package/dist/models/V2ProfileCreate.js +57 -0
- package/dist/models/V2ProfileDetail.d.ts +94 -0
- package/dist/models/V2ProfileDetail.js +82 -0
- package/dist/models/V2ProfileListItem.d.ts +68 -0
- package/dist/models/V2ProfileListItem.js +68 -0
- package/dist/models/V2ProfileUpdate.d.ts +47 -0
- package/dist/models/V2ProfileUpdate.js +57 -0
- package/dist/models/V2ProfileUpdateCheck.d.ts +96 -0
- package/dist/models/V2ProfileUpdateCheck.js +82 -0
- package/dist/models/V2ScreeningCheck.d.ts +95 -0
- package/dist/models/V2ScreeningCheck.js +80 -0
- package/dist/models/V2ScreeningCheckEntry.d.ts +135 -0
- package/dist/models/V2ScreeningCheckEntry.js +100 -0
- package/dist/models/V2ScreeningCheckListItem.d.ts +93 -0
- package/dist/models/V2ScreeningCheckListItem.js +82 -0
- package/dist/models/V2ScreeningCreate.d.ts +46 -0
- package/dist/models/V2ScreeningCreate.js +58 -0
- package/dist/models/V2ScreeningDetail.d.ts +83 -0
- package/dist/models/V2ScreeningDetail.js +77 -0
- package/dist/models/V2ScreeningDetailProfile.d.ts +38 -0
- package/dist/models/V2ScreeningDetailProfile.js +50 -0
- package/dist/models/V2ScreeningListItem.d.ts +85 -0
- package/dist/models/V2ScreeningListItem.js +76 -0
- package/dist/models/VerifyWebhook.d.ts +34 -0
- package/dist/models/VerifyWebhook.js +50 -0
- package/dist/models/Webhook.d.ts +71 -0
- package/dist/models/Webhook.js +77 -0
- package/dist/models/WebhookResponse.d.ts +87 -0
- package/dist/models/WebhookResponse.js +58 -0
- package/dist/models/index.d.ts +36 -0
- package/dist/models/index.js +54 -0
- package/dist/runtime.d.ts +184 -0
- package/dist/runtime.js +365 -0
- package/docs/AuthenticationApi.md +227 -0
- package/docs/ChecksApi.md +150 -0
- package/docs/CustomTokenObtainPair.md +37 -0
- package/docs/DivisionReadOnly.md +62 -0
- package/docs/DivisionWrite.md +56 -0
- package/docs/DivisionsApi.md +380 -0
- package/docs/JWTGeneration.md +41 -0
- package/docs/JWTResponse.md +45 -0
- package/docs/OAuthApi.md +222 -0
- package/docs/OAuthApplication.md +43 -0
- package/docs/OAuthApplicationResponse.md +49 -0
- package/docs/PaginatedDivisionReadOnlyList.md +40 -0
- package/docs/PaginatedV2ProfileListItemList.md +40 -0
- package/docs/PaginatedV2ScreeningListItemList.md +40 -0
- package/docs/PatchedDivisionWrite.md +56 -0
- package/docs/PatchedV2ProfilePartialUpdate.md +37 -0
- package/docs/ProfilesApi.md +456 -0
- package/docs/ScreeningsApi.md +302 -0
- package/docs/TokenRefresh.md +36 -0
- package/docs/V2Candidate.md +53 -0
- package/docs/V2CheckField.md +43 -0
- package/docs/V2CheckInfo.md +57 -0
- package/docs/V2Document.md +45 -0
- package/docs/V2DocumentContent.md +37 -0
- package/docs/V2Money.md +36 -0
- package/docs/V2ProfileCheck.md +37 -0
- package/docs/V2ProfileCheckEntry.md +46 -0
- package/docs/V2ProfileCreate.md +38 -0
- package/docs/V2ProfileDetail.md +54 -0
- package/docs/V2ProfileListItem.md +46 -0
- package/docs/V2ProfileUpdate.md +39 -0
- package/docs/V2ProfileUpdateCheck.md +39 -0
- package/docs/V2ScreeningCheck.md +41 -0
- package/docs/V2ScreeningCheckEntry.md +50 -0
- package/docs/V2ScreeningCheckListItem.md +39 -0
- package/docs/V2ScreeningCreate.md +38 -0
- package/docs/V2ScreeningDetail.md +50 -0
- package/docs/V2ScreeningDetailProfile.md +36 -0
- package/docs/V2ScreeningListItem.md +51 -0
- package/docs/VerifyWebhook.md +35 -0
- package/docs/Webhook.md +43 -0
- package/docs/WebhookResponse.md +53 -0
- package/docs/WebhooksApi.md +305 -0
- package/package.json +25 -0
- package/src/apis/AuthenticationApi.ts +285 -0
- package/src/apis/ChecksApi.ts +181 -0
- package/src/apis/DivisionsApi.ts +462 -0
- package/src/apis/OAuthApi.ts +256 -0
- package/src/apis/ProfilesApi.ts +583 -0
- package/src/apis/ScreeningsApi.ts +376 -0
- package/src/apis/WebhooksApi.ts +363 -0
- package/src/apis/index.ts +9 -0
- package/src/index.ts +5 -0
- package/src/models/CustomTokenObtainPair.ts +75 -0
- package/src/models/DivisionReadOnly.ts +177 -0
- package/src/models/DivisionWrite.ts +160 -0
- package/src/models/JWTGeneration.ts +91 -0
- package/src/models/JWTResponse.ts +110 -0
- package/src/models/OAuthApplication.ts +130 -0
- package/src/models/OAuthApplicationResponse.ts +151 -0
- package/src/models/PaginatedDivisionReadOnlyList.ts +101 -0
- package/src/models/PaginatedV2ProfileListItemList.ts +101 -0
- package/src/models/PaginatedV2ScreeningListItemList.ts +101 -0
- package/src/models/PatchedDivisionWrite.ts +152 -0
- package/src/models/PatchedV2ProfilePartialUpdate.ts +74 -0
- package/src/models/TokenRefresh.ts +73 -0
- package/src/models/V2Candidate.ts +649 -0
- package/src/models/V2CheckField.ts +97 -0
- package/src/models/V2CheckInfo.ts +168 -0
- package/src/models/V2Document.ts +166 -0
- package/src/models/V2DocumentContent.ts +76 -0
- package/src/models/V2Money.ts +75 -0
- package/src/models/V2ProfileCheck.ts +122 -0
- package/src/models/V2ProfileCheckEntry.ts +173 -0
- package/src/models/V2ProfileCreate.ts +91 -0
- package/src/models/V2ProfileDetail.ts +162 -0
- package/src/models/V2ProfileListItem.ts +115 -0
- package/src/models/V2ProfileUpdate.ts +93 -0
- package/src/models/V2ProfileUpdateCheck.ts +135 -0
- package/src/models/V2ScreeningCheck.ts +136 -0
- package/src/models/V2ScreeningCheckEntry.ts +181 -0
- package/src/models/V2ScreeningCheckListItem.ts +133 -0
- package/src/models/V2ScreeningCreate.ts +98 -0
- package/src/models/V2ScreeningDetail.ts +152 -0
- package/src/models/V2ScreeningDetailProfile.ts +73 -0
- package/src/models/V2ScreeningListItem.ts +154 -0
- package/src/models/VerifyWebhook.ts +68 -0
- package/src/models/Webhook.ts +118 -0
- package/src/models/WebhookResponse.ts +140 -0
- package/src/models/index.ts +38 -0
- package/src/runtime.ts +449 -0
- package/tsconfig.esm.json +7 -0
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Pescheck API
|
|
6
|
+
* Official client library for the Pescheck API (v2), generated from the OpenAPI specification. Authenticate with OAuth2 client credentials and use the checks, profiles, screenings, webhooks and divisions endpoints. See https://github.com/pescheckit/pescheck-clients for installation and usage.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 2.0.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
18
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
19
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
20
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
21
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.WebhooksApi = void 0;
|
|
26
|
+
const runtime = require("../runtime");
|
|
27
|
+
const VerifyWebhook_1 = require("../models/VerifyWebhook");
|
|
28
|
+
const Webhook_1 = require("../models/Webhook");
|
|
29
|
+
const WebhookResponse_1 = require("../models/WebhookResponse");
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
*/
|
|
33
|
+
class WebhooksApi extends runtime.BaseAPI {
|
|
34
|
+
/**
|
|
35
|
+
* Creates request options for createWebhook2 without sending the request
|
|
36
|
+
*/
|
|
37
|
+
createWebhook2RequestOpts(requestParameters) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
if (requestParameters['webhook'] == null) {
|
|
40
|
+
throw new runtime.RequiredError('webhook', 'Required parameter "webhook" was null or undefined when calling createWebhook2().');
|
|
41
|
+
}
|
|
42
|
+
const queryParameters = {};
|
|
43
|
+
if (requestParameters['organizationId'] != null) {
|
|
44
|
+
queryParameters['organization_id'] = requestParameters['organizationId'];
|
|
45
|
+
}
|
|
46
|
+
const headerParameters = {};
|
|
47
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
48
|
+
if (requestParameters['xOrganizationId'] != null) {
|
|
49
|
+
headerParameters['X-Organization-Id'] = String(requestParameters['xOrganizationId']);
|
|
50
|
+
}
|
|
51
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
52
|
+
// oauth required
|
|
53
|
+
headerParameters["Authorization"] = `Bearer ${yield this.configuration.accessToken("oauth2", ["read:api", "create:api", "update:api"])}`;
|
|
54
|
+
}
|
|
55
|
+
let urlPath = `/api/v2/webhooks/`;
|
|
56
|
+
return {
|
|
57
|
+
path: urlPath,
|
|
58
|
+
method: 'POST',
|
|
59
|
+
headers: headerParameters,
|
|
60
|
+
query: queryParameters,
|
|
61
|
+
body: (0, Webhook_1.WebhookToJSON)(requestParameters['webhook']),
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Create webhook for event notifications. **Authentication Notes:** - OAuth2: Organization is automatically determined from the OAuth application - If your OAuth app has no organization set, pass it via `X-Organization-Id` header or `organization_id` query parameter **Valid Events:** - `check.started` - Check has been initiated - `check.completed` - Check has been completed successfully - `check.failed` - Check has failed - `screening.created` - New screening has been created - `screening.completed` - Screening has been completed - `screening.archived` - Screening has been archived - `package.created` - New package has been created - `package.updated` - Package has been updated - `division.created` - New division has been created - `division.updated` - Division has been updated Limited to 5 webhooks per organization/division.
|
|
67
|
+
*/
|
|
68
|
+
createWebhook2Raw(requestParameters, initOverrides) {
|
|
69
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
const requestOptions = yield this.createWebhook2RequestOpts(requestParameters);
|
|
71
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
72
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, WebhookResponse_1.WebhookResponseFromJSON)(jsonValue));
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Create webhook for event notifications. **Authentication Notes:** - OAuth2: Organization is automatically determined from the OAuth application - If your OAuth app has no organization set, pass it via `X-Organization-Id` header or `organization_id` query parameter **Valid Events:** - `check.started` - Check has been initiated - `check.completed` - Check has been completed successfully - `check.failed` - Check has failed - `screening.created` - New screening has been created - `screening.completed` - Screening has been completed - `screening.archived` - Screening has been archived - `package.created` - New package has been created - `package.updated` - Package has been updated - `division.created` - New division has been created - `division.updated` - Division has been updated Limited to 5 webhooks per organization/division.
|
|
77
|
+
*/
|
|
78
|
+
createWebhook2(requestParameters, initOverrides) {
|
|
79
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
const response = yield this.createWebhook2Raw(requestParameters, initOverrides);
|
|
81
|
+
return yield response.value();
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Creates request options for deleteWebhook2 without sending the request
|
|
86
|
+
*/
|
|
87
|
+
deleteWebhook2RequestOpts(requestParameters) {
|
|
88
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
89
|
+
if (requestParameters['webhookId'] == null) {
|
|
90
|
+
throw new runtime.RequiredError('webhookId', 'Required parameter "webhookId" was null or undefined when calling deleteWebhook2().');
|
|
91
|
+
}
|
|
92
|
+
const queryParameters = {};
|
|
93
|
+
const headerParameters = {};
|
|
94
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
95
|
+
// oauth required
|
|
96
|
+
headerParameters["Authorization"] = `Bearer ${yield this.configuration.accessToken("oauth2", ["read:api", "create:api", "update:api"])}`;
|
|
97
|
+
}
|
|
98
|
+
let urlPath = `/api/v2/webhooks/{webhook_id}/`;
|
|
99
|
+
urlPath = urlPath.replace('{webhook_id}', encodeURIComponent(String(requestParameters['webhookId'])));
|
|
100
|
+
return {
|
|
101
|
+
path: urlPath,
|
|
102
|
+
method: 'DELETE',
|
|
103
|
+
headers: headerParameters,
|
|
104
|
+
query: queryParameters,
|
|
105
|
+
};
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Delete a webhook
|
|
110
|
+
*/
|
|
111
|
+
deleteWebhook2Raw(requestParameters, initOverrides) {
|
|
112
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
113
|
+
const requestOptions = yield this.deleteWebhook2RequestOpts(requestParameters);
|
|
114
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
115
|
+
return new runtime.VoidApiResponse(response);
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Delete a webhook
|
|
120
|
+
*/
|
|
121
|
+
deleteWebhook2(requestParameters, initOverrides) {
|
|
122
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
123
|
+
yield this.deleteWebhook2Raw(requestParameters, initOverrides);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Creates request options for listWebhooks2 without sending the request
|
|
128
|
+
*/
|
|
129
|
+
listWebhooks2RequestOpts() {
|
|
130
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
131
|
+
const queryParameters = {};
|
|
132
|
+
const headerParameters = {};
|
|
133
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
134
|
+
// oauth required
|
|
135
|
+
headerParameters["Authorization"] = `Bearer ${yield this.configuration.accessToken("oauth2", ["read:api", "create:api", "update:api"])}`;
|
|
136
|
+
}
|
|
137
|
+
let urlPath = `/api/v2/webhooks/list/`;
|
|
138
|
+
return {
|
|
139
|
+
path: urlPath,
|
|
140
|
+
method: 'GET',
|
|
141
|
+
headers: headerParameters,
|
|
142
|
+
query: queryParameters,
|
|
143
|
+
};
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* List webhooks for the organization
|
|
148
|
+
*/
|
|
149
|
+
listWebhooks2Raw(initOverrides) {
|
|
150
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
151
|
+
const requestOptions = yield this.listWebhooks2RequestOpts();
|
|
152
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
153
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(WebhookResponse_1.WebhookResponseFromJSON));
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* List webhooks for the organization
|
|
158
|
+
*/
|
|
159
|
+
listWebhooks2(initOverrides) {
|
|
160
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
161
|
+
const response = yield this.listWebhooks2Raw(initOverrides);
|
|
162
|
+
return yield response.value();
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Creates request options for verifyWebhook2 without sending the request
|
|
167
|
+
*/
|
|
168
|
+
verifyWebhook2RequestOpts(requestParameters) {
|
|
169
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
170
|
+
if (requestParameters['webhookId'] == null) {
|
|
171
|
+
throw new runtime.RequiredError('webhookId', 'Required parameter "webhookId" was null or undefined when calling verifyWebhook2().');
|
|
172
|
+
}
|
|
173
|
+
if (requestParameters['verifyWebhook'] == null) {
|
|
174
|
+
throw new runtime.RequiredError('verifyWebhook', 'Required parameter "verifyWebhook" was null or undefined when calling verifyWebhook2().');
|
|
175
|
+
}
|
|
176
|
+
const queryParameters = {};
|
|
177
|
+
const headerParameters = {};
|
|
178
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
179
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
180
|
+
// oauth required
|
|
181
|
+
headerParameters["Authorization"] = `Bearer ${yield this.configuration.accessToken("oauth2", ["read:api", "create:api", "update:api"])}`;
|
|
182
|
+
}
|
|
183
|
+
let urlPath = `/api/v2/webhooks/{webhook_id}/verify/`;
|
|
184
|
+
urlPath = urlPath.replace('{webhook_id}', encodeURIComponent(String(requestParameters['webhookId'])));
|
|
185
|
+
return {
|
|
186
|
+
path: urlPath,
|
|
187
|
+
method: 'POST',
|
|
188
|
+
headers: headerParameters,
|
|
189
|
+
query: queryParameters,
|
|
190
|
+
body: (0, VerifyWebhook_1.VerifyWebhookToJSON)(requestParameters['verifyWebhook']),
|
|
191
|
+
};
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Verify webhook ownership
|
|
196
|
+
*/
|
|
197
|
+
verifyWebhook2Raw(requestParameters, initOverrides) {
|
|
198
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
199
|
+
const requestOptions = yield this.verifyWebhook2RequestOpts(requestParameters);
|
|
200
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
201
|
+
return new runtime.VoidApiResponse(response);
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Verify webhook ownership
|
|
206
|
+
*/
|
|
207
|
+
verifyWebhook2(requestParameters, initOverrides) {
|
|
208
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
209
|
+
yield this.verifyWebhook2Raw(requestParameters, initOverrides);
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
exports.WebhooksApi = WebhooksApi;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/* tslint:disable */
|
|
18
|
+
/* eslint-disable */
|
|
19
|
+
__exportStar(require("./AuthenticationApi"), exports);
|
|
20
|
+
__exportStar(require("./ChecksApi"), exports);
|
|
21
|
+
__exportStar(require("./DivisionsApi"), exports);
|
|
22
|
+
__exportStar(require("./OAuthApi"), exports);
|
|
23
|
+
__exportStar(require("./ProfilesApi"), exports);
|
|
24
|
+
__exportStar(require("./ScreeningsApi"), exports);
|
|
25
|
+
__exportStar(require("./WebhooksApi"), exports);
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pescheck API
|
|
3
|
+
* Official client library for the Pescheck API (v2), generated from the OpenAPI specification. Authenticate with OAuth2 client credentials and use the checks, profiles, screenings, webhooks and divisions endpoints. See https://github.com/pescheckit/pescheck-clients for installation and usage.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 2.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import * as runtime from '../runtime';
|
|
13
|
+
import { type CustomTokenObtainPair } from '../models/CustomTokenObtainPair';
|
|
14
|
+
import { type JWTGeneration } from '../models/JWTGeneration';
|
|
15
|
+
import { type JWTResponse } from '../models/JWTResponse';
|
|
16
|
+
import { type TokenRefresh } from '../models/TokenRefresh';
|
|
17
|
+
export interface GenerateJWTToken2Request {
|
|
18
|
+
jWTGeneration: JWTGeneration;
|
|
19
|
+
}
|
|
20
|
+
export interface JwtCreateRequest {
|
|
21
|
+
customTokenObtainPair: CustomTokenObtainPair;
|
|
22
|
+
}
|
|
23
|
+
export interface JwtRefreshCreateRequest {
|
|
24
|
+
tokenRefresh: Omit<TokenRefresh, 'access'>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* AuthenticationApi - interface
|
|
28
|
+
*
|
|
29
|
+
* @export
|
|
30
|
+
* @interface AuthenticationApiInterface
|
|
31
|
+
*/
|
|
32
|
+
export interface AuthenticationApiInterface {
|
|
33
|
+
/**
|
|
34
|
+
* Creates request options for generateJWTToken2 without sending the request
|
|
35
|
+
* @param {JWTGeneration} jWTGeneration
|
|
36
|
+
* @throws {RequiredError}
|
|
37
|
+
* @memberof AuthenticationApiInterface
|
|
38
|
+
*/
|
|
39
|
+
generateJWTToken2RequestOpts(requestParameters: GenerateJWTToken2Request): Promise<runtime.RequestOpts>;
|
|
40
|
+
/**
|
|
41
|
+
* Log in with email + password. Returns a JWT pair scoped to the organization or division specified by organisation_id/division_id (defaults to your current org). For a plain login, use POST /api/jwt/.
|
|
42
|
+
* @param {JWTGeneration} jWTGeneration
|
|
43
|
+
* @param {*} [options] Override http request option.
|
|
44
|
+
* @throws {RequiredError}
|
|
45
|
+
* @memberof AuthenticationApiInterface
|
|
46
|
+
*/
|
|
47
|
+
generateJWTToken2Raw(requestParameters: GenerateJWTToken2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JWTResponse>>;
|
|
48
|
+
/**
|
|
49
|
+
* Log in with email + password. Returns a JWT pair scoped to the organization or division specified by organisation_id/division_id (defaults to your current org). For a plain login, use POST /api/jwt/.
|
|
50
|
+
*/
|
|
51
|
+
generateJWTToken2(requestParameters: GenerateJWTToken2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JWTResponse>;
|
|
52
|
+
/**
|
|
53
|
+
* Creates request options for jwtCreate without sending the request
|
|
54
|
+
* @param {CustomTokenObtainPair} customTokenObtainPair
|
|
55
|
+
* @throws {RequiredError}
|
|
56
|
+
* @memberof AuthenticationApiInterface
|
|
57
|
+
*/
|
|
58
|
+
jwtCreateRequestOpts(requestParameters: JwtCreateRequest): Promise<runtime.RequestOpts>;
|
|
59
|
+
/**
|
|
60
|
+
* Log in with email + password. Returns a JWT pair scoped to your current organization (last viewed, or first available). For a token scoped to a specific org or division, use POST /api/v2/jwt/generate/.
|
|
61
|
+
* @param {CustomTokenObtainPair} customTokenObtainPair
|
|
62
|
+
* @param {*} [options] Override http request option.
|
|
63
|
+
* @throws {RequiredError}
|
|
64
|
+
* @memberof AuthenticationApiInterface
|
|
65
|
+
*/
|
|
66
|
+
jwtCreateRaw(requestParameters: JwtCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CustomTokenObtainPair>>;
|
|
67
|
+
/**
|
|
68
|
+
* Log in with email + password. Returns a JWT pair scoped to your current organization (last viewed, or first available). For a token scoped to a specific org or division, use POST /api/v2/jwt/generate/.
|
|
69
|
+
*/
|
|
70
|
+
jwtCreate(requestParameters: JwtCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CustomTokenObtainPair>;
|
|
71
|
+
/**
|
|
72
|
+
* Creates request options for jwtRefreshCreate without sending the request
|
|
73
|
+
* @param {TokenRefresh} tokenRefresh
|
|
74
|
+
* @throws {RequiredError}
|
|
75
|
+
* @memberof AuthenticationApiInterface
|
|
76
|
+
*/
|
|
77
|
+
jwtRefreshCreateRequestOpts(requestParameters: JwtRefreshCreateRequest): Promise<runtime.RequestOpts>;
|
|
78
|
+
/**
|
|
79
|
+
* Takes a refresh type JSON web token and returns an access type JSON web token if the refresh token is valid.
|
|
80
|
+
* @param {TokenRefresh} tokenRefresh
|
|
81
|
+
* @param {*} [options] Override http request option.
|
|
82
|
+
* @throws {RequiredError}
|
|
83
|
+
* @memberof AuthenticationApiInterface
|
|
84
|
+
*/
|
|
85
|
+
jwtRefreshCreateRaw(requestParameters: JwtRefreshCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TokenRefresh>>;
|
|
86
|
+
/**
|
|
87
|
+
* Takes a refresh type JSON web token and returns an access type JSON web token if the refresh token is valid.
|
|
88
|
+
*/
|
|
89
|
+
jwtRefreshCreate(requestParameters: JwtRefreshCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TokenRefresh>;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
*
|
|
93
|
+
*/
|
|
94
|
+
export declare class AuthenticationApi extends runtime.BaseAPI implements AuthenticationApiInterface {
|
|
95
|
+
/**
|
|
96
|
+
* Creates request options for generateJWTToken2 without sending the request
|
|
97
|
+
*/
|
|
98
|
+
generateJWTToken2RequestOpts(requestParameters: GenerateJWTToken2Request): Promise<runtime.RequestOpts>;
|
|
99
|
+
/**
|
|
100
|
+
* Log in with email + password. Returns a JWT pair scoped to the organization or division specified by organisation_id/division_id (defaults to your current org). For a plain login, use POST /api/jwt/.
|
|
101
|
+
*/
|
|
102
|
+
generateJWTToken2Raw(requestParameters: GenerateJWTToken2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JWTResponse>>;
|
|
103
|
+
/**
|
|
104
|
+
* Log in with email + password. Returns a JWT pair scoped to the organization or division specified by organisation_id/division_id (defaults to your current org). For a plain login, use POST /api/jwt/.
|
|
105
|
+
*/
|
|
106
|
+
generateJWTToken2(requestParameters: GenerateJWTToken2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JWTResponse>;
|
|
107
|
+
/**
|
|
108
|
+
* Creates request options for jwtCreate without sending the request
|
|
109
|
+
*/
|
|
110
|
+
jwtCreateRequestOpts(requestParameters: JwtCreateRequest): Promise<runtime.RequestOpts>;
|
|
111
|
+
/**
|
|
112
|
+
* Log in with email + password. Returns a JWT pair scoped to your current organization (last viewed, or first available). For a token scoped to a specific org or division, use POST /api/v2/jwt/generate/.
|
|
113
|
+
*/
|
|
114
|
+
jwtCreateRaw(requestParameters: JwtCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CustomTokenObtainPair>>;
|
|
115
|
+
/**
|
|
116
|
+
* Log in with email + password. Returns a JWT pair scoped to your current organization (last viewed, or first available). For a token scoped to a specific org or division, use POST /api/v2/jwt/generate/.
|
|
117
|
+
*/
|
|
118
|
+
jwtCreate(requestParameters: JwtCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CustomTokenObtainPair>;
|
|
119
|
+
/**
|
|
120
|
+
* Creates request options for jwtRefreshCreate without sending the request
|
|
121
|
+
*/
|
|
122
|
+
jwtRefreshCreateRequestOpts(requestParameters: JwtRefreshCreateRequest): Promise<runtime.RequestOpts>;
|
|
123
|
+
/**
|
|
124
|
+
* Takes a refresh type JSON web token and returns an access type JSON web token if the refresh token is valid.
|
|
125
|
+
*/
|
|
126
|
+
jwtRefreshCreateRaw(requestParameters: JwtRefreshCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TokenRefresh>>;
|
|
127
|
+
/**
|
|
128
|
+
* Takes a refresh type JSON web token and returns an access type JSON web token if the refresh token is valid.
|
|
129
|
+
*/
|
|
130
|
+
jwtRefreshCreate(requestParameters: JwtRefreshCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TokenRefresh>;
|
|
131
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Pescheck API
|
|
5
|
+
* Official client library for the Pescheck API (v2), generated from the OpenAPI specification. Authenticate with OAuth2 client credentials and use the checks, profiles, screenings, webhooks and divisions endpoints. See https://github.com/pescheckit/pescheck-clients for installation and usage.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 2.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
import * as runtime from '../runtime';
|
|
24
|
+
import { CustomTokenObtainPairFromJSON, CustomTokenObtainPairToJSON, } from '../models/CustomTokenObtainPair';
|
|
25
|
+
import { JWTGenerationToJSON, } from '../models/JWTGeneration';
|
|
26
|
+
import { JWTResponseFromJSON, } from '../models/JWTResponse';
|
|
27
|
+
import { TokenRefreshFromJSON, TokenRefreshToJSON, } from '../models/TokenRefresh';
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
export class AuthenticationApi extends runtime.BaseAPI {
|
|
32
|
+
/**
|
|
33
|
+
* Creates request options for generateJWTToken2 without sending the request
|
|
34
|
+
*/
|
|
35
|
+
generateJWTToken2RequestOpts(requestParameters) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
if (requestParameters['jWTGeneration'] == null) {
|
|
38
|
+
throw new runtime.RequiredError('jWTGeneration', 'Required parameter "jWTGeneration" was null or undefined when calling generateJWTToken2().');
|
|
39
|
+
}
|
|
40
|
+
const queryParameters = {};
|
|
41
|
+
const headerParameters = {};
|
|
42
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
43
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
44
|
+
// oauth required
|
|
45
|
+
headerParameters["Authorization"] = `Bearer ${yield this.configuration.accessToken("oauth2", ["read:api", "create:api", "update:api"])}`;
|
|
46
|
+
}
|
|
47
|
+
let urlPath = `/api/v2/jwt/generate/`;
|
|
48
|
+
return {
|
|
49
|
+
path: urlPath,
|
|
50
|
+
method: 'POST',
|
|
51
|
+
headers: headerParameters,
|
|
52
|
+
query: queryParameters,
|
|
53
|
+
body: JWTGenerationToJSON(requestParameters['jWTGeneration']),
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Log in with email + password. Returns a JWT pair scoped to the organization or division specified by organisation_id/division_id (defaults to your current org). For a plain login, use POST /api/jwt/.
|
|
59
|
+
*/
|
|
60
|
+
generateJWTToken2Raw(requestParameters, initOverrides) {
|
|
61
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
const requestOptions = yield this.generateJWTToken2RequestOpts(requestParameters);
|
|
63
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
64
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => JWTResponseFromJSON(jsonValue));
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Log in with email + password. Returns a JWT pair scoped to the organization or division specified by organisation_id/division_id (defaults to your current org). For a plain login, use POST /api/jwt/.
|
|
69
|
+
*/
|
|
70
|
+
generateJWTToken2(requestParameters, initOverrides) {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
const response = yield this.generateJWTToken2Raw(requestParameters, initOverrides);
|
|
73
|
+
return yield response.value();
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Creates request options for jwtCreate without sending the request
|
|
78
|
+
*/
|
|
79
|
+
jwtCreateRequestOpts(requestParameters) {
|
|
80
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
81
|
+
if (requestParameters['customTokenObtainPair'] == null) {
|
|
82
|
+
throw new runtime.RequiredError('customTokenObtainPair', 'Required parameter "customTokenObtainPair" was null or undefined when calling jwtCreate().');
|
|
83
|
+
}
|
|
84
|
+
const queryParameters = {};
|
|
85
|
+
const headerParameters = {};
|
|
86
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
87
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
88
|
+
// oauth required
|
|
89
|
+
headerParameters["Authorization"] = `Bearer ${yield this.configuration.accessToken("oauth2", ["read:api", "create:api", "update:api"])}`;
|
|
90
|
+
}
|
|
91
|
+
let urlPath = `/api/jwt/`;
|
|
92
|
+
return {
|
|
93
|
+
path: urlPath,
|
|
94
|
+
method: 'POST',
|
|
95
|
+
headers: headerParameters,
|
|
96
|
+
query: queryParameters,
|
|
97
|
+
body: CustomTokenObtainPairToJSON(requestParameters['customTokenObtainPair']),
|
|
98
|
+
};
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Log in with email + password. Returns a JWT pair scoped to your current organization (last viewed, or first available). For a token scoped to a specific org or division, use POST /api/v2/jwt/generate/.
|
|
103
|
+
*/
|
|
104
|
+
jwtCreateRaw(requestParameters, initOverrides) {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
+
const requestOptions = yield this.jwtCreateRequestOpts(requestParameters);
|
|
107
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
108
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => CustomTokenObtainPairFromJSON(jsonValue));
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Log in with email + password. Returns a JWT pair scoped to your current organization (last viewed, or first available). For a token scoped to a specific org or division, use POST /api/v2/jwt/generate/.
|
|
113
|
+
*/
|
|
114
|
+
jwtCreate(requestParameters, initOverrides) {
|
|
115
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
116
|
+
const response = yield this.jwtCreateRaw(requestParameters, initOverrides);
|
|
117
|
+
return yield response.value();
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Creates request options for jwtRefreshCreate without sending the request
|
|
122
|
+
*/
|
|
123
|
+
jwtRefreshCreateRequestOpts(requestParameters) {
|
|
124
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
125
|
+
if (requestParameters['tokenRefresh'] == null) {
|
|
126
|
+
throw new runtime.RequiredError('tokenRefresh', 'Required parameter "tokenRefresh" was null or undefined when calling jwtRefreshCreate().');
|
|
127
|
+
}
|
|
128
|
+
const queryParameters = {};
|
|
129
|
+
const headerParameters = {};
|
|
130
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
131
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
132
|
+
// oauth required
|
|
133
|
+
headerParameters["Authorization"] = `Bearer ${yield this.configuration.accessToken("oauth2", ["read:api", "create:api", "update:api"])}`;
|
|
134
|
+
}
|
|
135
|
+
let urlPath = `/api/jwt/refresh/`;
|
|
136
|
+
return {
|
|
137
|
+
path: urlPath,
|
|
138
|
+
method: 'POST',
|
|
139
|
+
headers: headerParameters,
|
|
140
|
+
query: queryParameters,
|
|
141
|
+
body: TokenRefreshToJSON(requestParameters['tokenRefresh']),
|
|
142
|
+
};
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Takes a refresh type JSON web token and returns an access type JSON web token if the refresh token is valid.
|
|
147
|
+
*/
|
|
148
|
+
jwtRefreshCreateRaw(requestParameters, initOverrides) {
|
|
149
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
150
|
+
const requestOptions = yield this.jwtRefreshCreateRequestOpts(requestParameters);
|
|
151
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
152
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => TokenRefreshFromJSON(jsonValue));
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Takes a refresh type JSON web token and returns an access type JSON web token if the refresh token is valid.
|
|
157
|
+
*/
|
|
158
|
+
jwtRefreshCreate(requestParameters, initOverrides) {
|
|
159
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
160
|
+
const response = yield this.jwtRefreshCreateRaw(requestParameters, initOverrides);
|
|
161
|
+
return yield response.value();
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pescheck API
|
|
3
|
+
* Official client library for the Pescheck API (v2), generated from the OpenAPI specification. Authenticate with OAuth2 client credentials and use the checks, profiles, screenings, webhooks and divisions endpoints. See https://github.com/pescheckit/pescheck-clients for installation and usage.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 2.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import * as runtime from '../runtime';
|
|
13
|
+
import { type V2CheckInfo } from '../models/V2CheckInfo';
|
|
14
|
+
export interface V2ChecksListRequest {
|
|
15
|
+
checkType?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface V2ChecksRetrieveRequest {
|
|
18
|
+
checkType: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* ChecksApi - interface
|
|
22
|
+
*
|
|
23
|
+
* @export
|
|
24
|
+
* @interface ChecksApiInterface
|
|
25
|
+
*/
|
|
26
|
+
export interface ChecksApiInterface {
|
|
27
|
+
/**
|
|
28
|
+
* Creates request options for v2ChecksList without sending the request
|
|
29
|
+
* @param {string} [checkType] Restrict the list to a single check type.
|
|
30
|
+
* @throws {RequiredError}
|
|
31
|
+
* @memberof ChecksApiInterface
|
|
32
|
+
*/
|
|
33
|
+
v2ChecksListRequestOpts(requestParameters: V2ChecksListRequest): Promise<runtime.RequestOpts>;
|
|
34
|
+
/**
|
|
35
|
+
* List the check types this API supports. The list is bounded metadata about the available check types (not a paginated collection), so the response is a flat array.
|
|
36
|
+
* @param {string} [checkType] Restrict the list to a single check type.
|
|
37
|
+
* @param {*} [options] Override http request option.
|
|
38
|
+
* @throws {RequiredError}
|
|
39
|
+
* @memberof ChecksApiInterface
|
|
40
|
+
*/
|
|
41
|
+
v2ChecksListRaw(requestParameters: V2ChecksListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<V2CheckInfo>>>;
|
|
42
|
+
/**
|
|
43
|
+
* List the check types this API supports. The list is bounded metadata about the available check types (not a paginated collection), so the response is a flat array.
|
|
44
|
+
*/
|
|
45
|
+
v2ChecksList(requestParameters: V2ChecksListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<V2CheckInfo>>;
|
|
46
|
+
/**
|
|
47
|
+
* Creates request options for v2ChecksRetrieve without sending the request
|
|
48
|
+
* @param {string} checkType
|
|
49
|
+
* @throws {RequiredError}
|
|
50
|
+
* @memberof ChecksApiInterface
|
|
51
|
+
*/
|
|
52
|
+
v2ChecksRetrieveRequestOpts(requestParameters: V2ChecksRetrieveRequest): Promise<runtime.RequestOpts>;
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
* @param {string} checkType
|
|
56
|
+
* @param {*} [options] Override http request option.
|
|
57
|
+
* @throws {RequiredError}
|
|
58
|
+
* @memberof ChecksApiInterface
|
|
59
|
+
*/
|
|
60
|
+
v2ChecksRetrieveRaw(requestParameters: V2ChecksRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<V2CheckInfo>>;
|
|
61
|
+
/**
|
|
62
|
+
*/
|
|
63
|
+
v2ChecksRetrieve(requestParameters: V2ChecksRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<V2CheckInfo>;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
*
|
|
67
|
+
*/
|
|
68
|
+
export declare class ChecksApi extends runtime.BaseAPI implements ChecksApiInterface {
|
|
69
|
+
/**
|
|
70
|
+
* Creates request options for v2ChecksList without sending the request
|
|
71
|
+
*/
|
|
72
|
+
v2ChecksListRequestOpts(requestParameters: V2ChecksListRequest): Promise<runtime.RequestOpts>;
|
|
73
|
+
/**
|
|
74
|
+
* List the check types this API supports. The list is bounded metadata about the available check types (not a paginated collection), so the response is a flat array.
|
|
75
|
+
*/
|
|
76
|
+
v2ChecksListRaw(requestParameters: V2ChecksListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<V2CheckInfo>>>;
|
|
77
|
+
/**
|
|
78
|
+
* List the check types this API supports. The list is bounded metadata about the available check types (not a paginated collection), so the response is a flat array.
|
|
79
|
+
*/
|
|
80
|
+
v2ChecksList(requestParameters?: V2ChecksListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<V2CheckInfo>>;
|
|
81
|
+
/**
|
|
82
|
+
* Creates request options for v2ChecksRetrieve without sending the request
|
|
83
|
+
*/
|
|
84
|
+
v2ChecksRetrieveRequestOpts(requestParameters: V2ChecksRetrieveRequest): Promise<runtime.RequestOpts>;
|
|
85
|
+
/**
|
|
86
|
+
*/
|
|
87
|
+
v2ChecksRetrieveRaw(requestParameters: V2ChecksRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<V2CheckInfo>>;
|
|
88
|
+
/**
|
|
89
|
+
*/
|
|
90
|
+
v2ChecksRetrieve(requestParameters: V2ChecksRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<V2CheckInfo>;
|
|
91
|
+
}
|