@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,305 @@
|
|
|
1
|
+
# WebhooksApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://api.pescheck.io*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
| [**createWebhook2**](WebhooksApi.md#createwebhook2) | **POST** /api/v2/webhooks/ | |
|
|
8
|
+
| [**deleteWebhook2**](WebhooksApi.md#deletewebhook2) | **DELETE** /api/v2/webhooks/{webhook_id}/ | |
|
|
9
|
+
| [**listWebhooks2**](WebhooksApi.md#listwebhooks2) | **GET** /api/v2/webhooks/list/ | |
|
|
10
|
+
| [**verifyWebhook2**](WebhooksApi.md#verifywebhook2) | **POST** /api/v2/webhooks/{webhook_id}/verify/ | |
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## createWebhook2
|
|
15
|
+
|
|
16
|
+
> WebhookResponse createWebhook2(webhook, xOrganizationId, organizationId)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
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.
|
|
21
|
+
|
|
22
|
+
### Example
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import {
|
|
26
|
+
Configuration,
|
|
27
|
+
WebhooksApi,
|
|
28
|
+
} from '@pescheckit/pescheck-client';
|
|
29
|
+
import type { CreateWebhook2Request } from '@pescheckit/pescheck-client';
|
|
30
|
+
|
|
31
|
+
async function example() {
|
|
32
|
+
console.log("🚀 Testing @pescheckit/pescheck-client SDK...");
|
|
33
|
+
const config = new Configuration({
|
|
34
|
+
// To configure OAuth2 access token for authorization: oauth2 application
|
|
35
|
+
accessToken: "YOUR ACCESS TOKEN",
|
|
36
|
+
});
|
|
37
|
+
const api = new WebhooksApi(config);
|
|
38
|
+
|
|
39
|
+
const body = {
|
|
40
|
+
// Webhook
|
|
41
|
+
webhook: {"name":"My Event Webhook","url":"https://webhook.site/4a33d2f6-48a8-4b49-b6c4-a7bb044c8cb3","events":["check.completed","screening.created","screening.completed"],"active":true,"division_id":"3fa85f64-5717-4562-b3fc-2c963f66afa6"},
|
|
42
|
+
// string | Organization ID (for JWT/Session auth only) (optional)
|
|
43
|
+
xOrganizationId: xOrganizationId_example,
|
|
44
|
+
// string | Organization ID (for JWT/Session auth only) (optional)
|
|
45
|
+
organizationId: organizationId_example,
|
|
46
|
+
} satisfies CreateWebhook2Request;
|
|
47
|
+
|
|
48
|
+
try {
|
|
49
|
+
const data = await api.createWebhook2(body);
|
|
50
|
+
console.log(data);
|
|
51
|
+
} catch (error) {
|
|
52
|
+
console.error(error);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Run the test
|
|
57
|
+
example().catch(console.error);
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Parameters
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
| Name | Type | Description | Notes |
|
|
64
|
+
|------------- | ------------- | ------------- | -------------|
|
|
65
|
+
| **webhook** | [Webhook](Webhook.md) | | |
|
|
66
|
+
| **xOrganizationId** | `string` | Organization ID (for JWT/Session auth only) | [Optional] [Defaults to `undefined`] |
|
|
67
|
+
| **organizationId** | `string` | Organization ID (for JWT/Session auth only) | [Optional] [Defaults to `undefined`] |
|
|
68
|
+
|
|
69
|
+
### Return type
|
|
70
|
+
|
|
71
|
+
[**WebhookResponse**](WebhookResponse.md)
|
|
72
|
+
|
|
73
|
+
### Authorization
|
|
74
|
+
|
|
75
|
+
[oauth2 application](../README.md#oauth2-application)
|
|
76
|
+
|
|
77
|
+
### HTTP request headers
|
|
78
|
+
|
|
79
|
+
- **Content-Type**: `application/json`, `multipart/form-data`
|
|
80
|
+
- **Accept**: `application/json`
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
### HTTP response details
|
|
84
|
+
| Status code | Description | Response headers |
|
|
85
|
+
|-------------|-------------|------------------|
|
|
86
|
+
| **201** | | - |
|
|
87
|
+
| **400** | Bad Request | - |
|
|
88
|
+
| **403** | Forbidden - Organization not found or no permission | - |
|
|
89
|
+
| **409** | Conflict - Max webhooks reached | - |
|
|
90
|
+
|
|
91
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
## deleteWebhook2
|
|
95
|
+
|
|
96
|
+
> deleteWebhook2(webhookId)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
Delete a webhook
|
|
101
|
+
|
|
102
|
+
### Example
|
|
103
|
+
|
|
104
|
+
```ts
|
|
105
|
+
import {
|
|
106
|
+
Configuration,
|
|
107
|
+
WebhooksApi,
|
|
108
|
+
} from '@pescheckit/pescheck-client';
|
|
109
|
+
import type { DeleteWebhook2Request } from '@pescheckit/pescheck-client';
|
|
110
|
+
|
|
111
|
+
async function example() {
|
|
112
|
+
console.log("🚀 Testing @pescheckit/pescheck-client SDK...");
|
|
113
|
+
const config = new Configuration({
|
|
114
|
+
// To configure OAuth2 access token for authorization: oauth2 application
|
|
115
|
+
accessToken: "YOUR ACCESS TOKEN",
|
|
116
|
+
});
|
|
117
|
+
const api = new WebhooksApi(config);
|
|
118
|
+
|
|
119
|
+
const body = {
|
|
120
|
+
// string | Webhook ID to delete
|
|
121
|
+
webhookId: webhookId_example,
|
|
122
|
+
} satisfies DeleteWebhook2Request;
|
|
123
|
+
|
|
124
|
+
try {
|
|
125
|
+
const data = await api.deleteWebhook2(body);
|
|
126
|
+
console.log(data);
|
|
127
|
+
} catch (error) {
|
|
128
|
+
console.error(error);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Run the test
|
|
133
|
+
example().catch(console.error);
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Parameters
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
| Name | Type | Description | Notes |
|
|
140
|
+
|------------- | ------------- | ------------- | -------------|
|
|
141
|
+
| **webhookId** | `string` | Webhook ID to delete | [Defaults to `undefined`] |
|
|
142
|
+
|
|
143
|
+
### Return type
|
|
144
|
+
|
|
145
|
+
`void` (Empty response body)
|
|
146
|
+
|
|
147
|
+
### Authorization
|
|
148
|
+
|
|
149
|
+
[oauth2 application](../README.md#oauth2-application)
|
|
150
|
+
|
|
151
|
+
### HTTP request headers
|
|
152
|
+
|
|
153
|
+
- **Content-Type**: Not defined
|
|
154
|
+
- **Accept**: Not defined
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
### HTTP response details
|
|
158
|
+
| Status code | Description | Response headers |
|
|
159
|
+
|-------------|-------------|------------------|
|
|
160
|
+
| **204** | Webhook deleted | - |
|
|
161
|
+
| **403** | Forbidden | - |
|
|
162
|
+
| **404** | Webhook not found | - |
|
|
163
|
+
|
|
164
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
## listWebhooks2
|
|
168
|
+
|
|
169
|
+
> Array<WebhookResponse> listWebhooks2()
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
List webhooks for the organization
|
|
174
|
+
|
|
175
|
+
### Example
|
|
176
|
+
|
|
177
|
+
```ts
|
|
178
|
+
import {
|
|
179
|
+
Configuration,
|
|
180
|
+
WebhooksApi,
|
|
181
|
+
} from '@pescheckit/pescheck-client';
|
|
182
|
+
import type { ListWebhooks2Request } from '@pescheckit/pescheck-client';
|
|
183
|
+
|
|
184
|
+
async function example() {
|
|
185
|
+
console.log("🚀 Testing @pescheckit/pescheck-client SDK...");
|
|
186
|
+
const config = new Configuration({
|
|
187
|
+
// To configure OAuth2 access token for authorization: oauth2 application
|
|
188
|
+
accessToken: "YOUR ACCESS TOKEN",
|
|
189
|
+
});
|
|
190
|
+
const api = new WebhooksApi(config);
|
|
191
|
+
|
|
192
|
+
try {
|
|
193
|
+
const data = await api.listWebhooks2();
|
|
194
|
+
console.log(data);
|
|
195
|
+
} catch (error) {
|
|
196
|
+
console.error(error);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// Run the test
|
|
201
|
+
example().catch(console.error);
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Parameters
|
|
205
|
+
|
|
206
|
+
This endpoint does not need any parameter.
|
|
207
|
+
|
|
208
|
+
### Return type
|
|
209
|
+
|
|
210
|
+
[**Array<WebhookResponse>**](WebhookResponse.md)
|
|
211
|
+
|
|
212
|
+
### Authorization
|
|
213
|
+
|
|
214
|
+
[oauth2 application](../README.md#oauth2-application)
|
|
215
|
+
|
|
216
|
+
### HTTP request headers
|
|
217
|
+
|
|
218
|
+
- **Content-Type**: Not defined
|
|
219
|
+
- **Accept**: `application/json`
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
### HTTP response details
|
|
223
|
+
| Status code | Description | Response headers |
|
|
224
|
+
|-------------|-------------|------------------|
|
|
225
|
+
| **200** | | - |
|
|
226
|
+
| **403** | Forbidden | - |
|
|
227
|
+
|
|
228
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
## verifyWebhook2
|
|
232
|
+
|
|
233
|
+
> verifyWebhook2(webhookId, verifyWebhook)
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
Verify webhook ownership
|
|
238
|
+
|
|
239
|
+
### Example
|
|
240
|
+
|
|
241
|
+
```ts
|
|
242
|
+
import {
|
|
243
|
+
Configuration,
|
|
244
|
+
WebhooksApi,
|
|
245
|
+
} from '@pescheckit/pescheck-client';
|
|
246
|
+
import type { VerifyWebhook2Request } from '@pescheckit/pescheck-client';
|
|
247
|
+
|
|
248
|
+
async function example() {
|
|
249
|
+
console.log("🚀 Testing @pescheckit/pescheck-client SDK...");
|
|
250
|
+
const config = new Configuration({
|
|
251
|
+
// To configure OAuth2 access token for authorization: oauth2 application
|
|
252
|
+
accessToken: "YOUR ACCESS TOKEN",
|
|
253
|
+
});
|
|
254
|
+
const api = new WebhooksApi(config);
|
|
255
|
+
|
|
256
|
+
const body = {
|
|
257
|
+
// string | Webhook ID
|
|
258
|
+
webhookId: webhookId_example,
|
|
259
|
+
// VerifyWebhook
|
|
260
|
+
verifyWebhook: ...,
|
|
261
|
+
} satisfies VerifyWebhook2Request;
|
|
262
|
+
|
|
263
|
+
try {
|
|
264
|
+
const data = await api.verifyWebhook2(body);
|
|
265
|
+
console.log(data);
|
|
266
|
+
} catch (error) {
|
|
267
|
+
console.error(error);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// Run the test
|
|
272
|
+
example().catch(console.error);
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### Parameters
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
| Name | Type | Description | Notes |
|
|
279
|
+
|------------- | ------------- | ------------- | -------------|
|
|
280
|
+
| **webhookId** | `string` | Webhook ID | [Defaults to `undefined`] |
|
|
281
|
+
| **verifyWebhook** | [VerifyWebhook](VerifyWebhook.md) | | |
|
|
282
|
+
|
|
283
|
+
### Return type
|
|
284
|
+
|
|
285
|
+
`void` (Empty response body)
|
|
286
|
+
|
|
287
|
+
### Authorization
|
|
288
|
+
|
|
289
|
+
[oauth2 application](../README.md#oauth2-application)
|
|
290
|
+
|
|
291
|
+
### HTTP request headers
|
|
292
|
+
|
|
293
|
+
- **Content-Type**: `application/json`, `multipart/form-data`
|
|
294
|
+
- **Accept**: Not defined
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
### HTTP response details
|
|
298
|
+
| Status code | Description | Response headers |
|
|
299
|
+
|-------------|-------------|------------------|
|
|
300
|
+
| **200** | Webhook verified | - |
|
|
301
|
+
| **400** | Invalid verification code | - |
|
|
302
|
+
| **404** | Webhook not found | - |
|
|
303
|
+
|
|
304
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
305
|
+
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pescheckit/pescheck-client",
|
|
3
|
+
"version": "0.0.5",
|
|
4
|
+
"description": "OpenAPI client for @pescheckit/pescheck-client",
|
|
5
|
+
"author": "OpenAPI-Generator",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/pescheckit/pescheck-clients.git"
|
|
9
|
+
},
|
|
10
|
+
"main": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"module": "./dist/esm/index.js",
|
|
13
|
+
"sideEffects": false,
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc && tsc -p tsconfig.esm.json",
|
|
16
|
+
"prepare": "npm run build"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"typescript": "^4.0 || ^5.0"
|
|
20
|
+
},
|
|
21
|
+
"homepage": "https://pescheck.io",
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/pescheckit/pescheck-clients/issues"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,285 @@
|
|
|
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
|
+
|
|
15
|
+
import * as runtime from '../runtime';
|
|
16
|
+
import {
|
|
17
|
+
type CustomTokenObtainPair,
|
|
18
|
+
CustomTokenObtainPairFromJSON,
|
|
19
|
+
CustomTokenObtainPairToJSON,
|
|
20
|
+
} from '../models/CustomTokenObtainPair';
|
|
21
|
+
import {
|
|
22
|
+
type JWTGeneration,
|
|
23
|
+
JWTGenerationFromJSON,
|
|
24
|
+
JWTGenerationToJSON,
|
|
25
|
+
} from '../models/JWTGeneration';
|
|
26
|
+
import {
|
|
27
|
+
type JWTResponse,
|
|
28
|
+
JWTResponseFromJSON,
|
|
29
|
+
JWTResponseToJSON,
|
|
30
|
+
} from '../models/JWTResponse';
|
|
31
|
+
import {
|
|
32
|
+
type TokenRefresh,
|
|
33
|
+
TokenRefreshFromJSON,
|
|
34
|
+
TokenRefreshToJSON,
|
|
35
|
+
} from '../models/TokenRefresh';
|
|
36
|
+
|
|
37
|
+
export interface GenerateJWTToken2Request {
|
|
38
|
+
jWTGeneration: JWTGeneration;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface JwtCreateRequest {
|
|
42
|
+
customTokenObtainPair: CustomTokenObtainPair;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface JwtRefreshCreateRequest {
|
|
46
|
+
tokenRefresh: Omit<TokenRefresh, 'access'>;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* AuthenticationApi - interface
|
|
51
|
+
*
|
|
52
|
+
* @export
|
|
53
|
+
* @interface AuthenticationApiInterface
|
|
54
|
+
*/
|
|
55
|
+
export interface AuthenticationApiInterface {
|
|
56
|
+
/**
|
|
57
|
+
* Creates request options for generateJWTToken2 without sending the request
|
|
58
|
+
* @param {JWTGeneration} jWTGeneration
|
|
59
|
+
* @throws {RequiredError}
|
|
60
|
+
* @memberof AuthenticationApiInterface
|
|
61
|
+
*/
|
|
62
|
+
generateJWTToken2RequestOpts(requestParameters: GenerateJWTToken2Request): Promise<runtime.RequestOpts>;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* 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/.
|
|
66
|
+
* @param {JWTGeneration} jWTGeneration
|
|
67
|
+
* @param {*} [options] Override http request option.
|
|
68
|
+
* @throws {RequiredError}
|
|
69
|
+
* @memberof AuthenticationApiInterface
|
|
70
|
+
*/
|
|
71
|
+
generateJWTToken2Raw(requestParameters: GenerateJWTToken2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JWTResponse>>;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* 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/.
|
|
75
|
+
*/
|
|
76
|
+
generateJWTToken2(requestParameters: GenerateJWTToken2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JWTResponse>;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Creates request options for jwtCreate without sending the request
|
|
80
|
+
* @param {CustomTokenObtainPair} customTokenObtainPair
|
|
81
|
+
* @throws {RequiredError}
|
|
82
|
+
* @memberof AuthenticationApiInterface
|
|
83
|
+
*/
|
|
84
|
+
jwtCreateRequestOpts(requestParameters: JwtCreateRequest): Promise<runtime.RequestOpts>;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* 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/.
|
|
88
|
+
* @param {CustomTokenObtainPair} customTokenObtainPair
|
|
89
|
+
* @param {*} [options] Override http request option.
|
|
90
|
+
* @throws {RequiredError}
|
|
91
|
+
* @memberof AuthenticationApiInterface
|
|
92
|
+
*/
|
|
93
|
+
jwtCreateRaw(requestParameters: JwtCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CustomTokenObtainPair>>;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* 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/.
|
|
97
|
+
*/
|
|
98
|
+
jwtCreate(requestParameters: JwtCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CustomTokenObtainPair>;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Creates request options for jwtRefreshCreate without sending the request
|
|
102
|
+
* @param {TokenRefresh} tokenRefresh
|
|
103
|
+
* @throws {RequiredError}
|
|
104
|
+
* @memberof AuthenticationApiInterface
|
|
105
|
+
*/
|
|
106
|
+
jwtRefreshCreateRequestOpts(requestParameters: JwtRefreshCreateRequest): Promise<runtime.RequestOpts>;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Takes a refresh type JSON web token and returns an access type JSON web token if the refresh token is valid.
|
|
110
|
+
* @param {TokenRefresh} tokenRefresh
|
|
111
|
+
* @param {*} [options] Override http request option.
|
|
112
|
+
* @throws {RequiredError}
|
|
113
|
+
* @memberof AuthenticationApiInterface
|
|
114
|
+
*/
|
|
115
|
+
jwtRefreshCreateRaw(requestParameters: JwtRefreshCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TokenRefresh>>;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Takes a refresh type JSON web token and returns an access type JSON web token if the refresh token is valid.
|
|
119
|
+
*/
|
|
120
|
+
jwtRefreshCreate(requestParameters: JwtRefreshCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TokenRefresh>;
|
|
121
|
+
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
*
|
|
126
|
+
*/
|
|
127
|
+
export class AuthenticationApi extends runtime.BaseAPI implements AuthenticationApiInterface {
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Creates request options for generateJWTToken2 without sending the request
|
|
131
|
+
*/
|
|
132
|
+
async generateJWTToken2RequestOpts(requestParameters: GenerateJWTToken2Request): Promise<runtime.RequestOpts> {
|
|
133
|
+
if (requestParameters['jWTGeneration'] == null) {
|
|
134
|
+
throw new runtime.RequiredError(
|
|
135
|
+
'jWTGeneration',
|
|
136
|
+
'Required parameter "jWTGeneration" was null or undefined when calling generateJWTToken2().'
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const queryParameters: any = {};
|
|
141
|
+
|
|
142
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
143
|
+
|
|
144
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
145
|
+
|
|
146
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
147
|
+
// oauth required
|
|
148
|
+
headerParameters["Authorization"] = `Bearer ${await this.configuration.accessToken("oauth2", ["read:api", "create:api", "update:api"])}`;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
let urlPath = `/api/v2/jwt/generate/`;
|
|
153
|
+
|
|
154
|
+
return {
|
|
155
|
+
path: urlPath,
|
|
156
|
+
method: 'POST',
|
|
157
|
+
headers: headerParameters,
|
|
158
|
+
query: queryParameters,
|
|
159
|
+
body: JWTGenerationToJSON(requestParameters['jWTGeneration']),
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* 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/.
|
|
165
|
+
*/
|
|
166
|
+
async generateJWTToken2Raw(requestParameters: GenerateJWTToken2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JWTResponse>> {
|
|
167
|
+
const requestOptions = await this.generateJWTToken2RequestOpts(requestParameters);
|
|
168
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
169
|
+
|
|
170
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => JWTResponseFromJSON(jsonValue));
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* 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/.
|
|
175
|
+
*/
|
|
176
|
+
async generateJWTToken2(requestParameters: GenerateJWTToken2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JWTResponse> {
|
|
177
|
+
const response = await this.generateJWTToken2Raw(requestParameters, initOverrides);
|
|
178
|
+
return await response.value();
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Creates request options for jwtCreate without sending the request
|
|
183
|
+
*/
|
|
184
|
+
async jwtCreateRequestOpts(requestParameters: JwtCreateRequest): Promise<runtime.RequestOpts> {
|
|
185
|
+
if (requestParameters['customTokenObtainPair'] == null) {
|
|
186
|
+
throw new runtime.RequiredError(
|
|
187
|
+
'customTokenObtainPair',
|
|
188
|
+
'Required parameter "customTokenObtainPair" was null or undefined when calling jwtCreate().'
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
const queryParameters: any = {};
|
|
193
|
+
|
|
194
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
195
|
+
|
|
196
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
197
|
+
|
|
198
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
199
|
+
// oauth required
|
|
200
|
+
headerParameters["Authorization"] = `Bearer ${await this.configuration.accessToken("oauth2", ["read:api", "create:api", "update:api"])}`;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
let urlPath = `/api/jwt/`;
|
|
205
|
+
|
|
206
|
+
return {
|
|
207
|
+
path: urlPath,
|
|
208
|
+
method: 'POST',
|
|
209
|
+
headers: headerParameters,
|
|
210
|
+
query: queryParameters,
|
|
211
|
+
body: CustomTokenObtainPairToJSON(requestParameters['customTokenObtainPair']),
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* 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/.
|
|
217
|
+
*/
|
|
218
|
+
async jwtCreateRaw(requestParameters: JwtCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CustomTokenObtainPair>> {
|
|
219
|
+
const requestOptions = await this.jwtCreateRequestOpts(requestParameters);
|
|
220
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
221
|
+
|
|
222
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => CustomTokenObtainPairFromJSON(jsonValue));
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* 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/.
|
|
227
|
+
*/
|
|
228
|
+
async jwtCreate(requestParameters: JwtCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CustomTokenObtainPair> {
|
|
229
|
+
const response = await this.jwtCreateRaw(requestParameters, initOverrides);
|
|
230
|
+
return await response.value();
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Creates request options for jwtRefreshCreate without sending the request
|
|
235
|
+
*/
|
|
236
|
+
async jwtRefreshCreateRequestOpts(requestParameters: JwtRefreshCreateRequest): Promise<runtime.RequestOpts> {
|
|
237
|
+
if (requestParameters['tokenRefresh'] == null) {
|
|
238
|
+
throw new runtime.RequiredError(
|
|
239
|
+
'tokenRefresh',
|
|
240
|
+
'Required parameter "tokenRefresh" was null or undefined when calling jwtRefreshCreate().'
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
const queryParameters: any = {};
|
|
245
|
+
|
|
246
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
247
|
+
|
|
248
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
249
|
+
|
|
250
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
251
|
+
// oauth required
|
|
252
|
+
headerParameters["Authorization"] = `Bearer ${await this.configuration.accessToken("oauth2", ["read:api", "create:api", "update:api"])}`;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
let urlPath = `/api/jwt/refresh/`;
|
|
257
|
+
|
|
258
|
+
return {
|
|
259
|
+
path: urlPath,
|
|
260
|
+
method: 'POST',
|
|
261
|
+
headers: headerParameters,
|
|
262
|
+
query: queryParameters,
|
|
263
|
+
body: TokenRefreshToJSON(requestParameters['tokenRefresh']),
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Takes a refresh type JSON web token and returns an access type JSON web token if the refresh token is valid.
|
|
269
|
+
*/
|
|
270
|
+
async jwtRefreshCreateRaw(requestParameters: JwtRefreshCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TokenRefresh>> {
|
|
271
|
+
const requestOptions = await this.jwtRefreshCreateRequestOpts(requestParameters);
|
|
272
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
273
|
+
|
|
274
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => TokenRefreshFromJSON(jsonValue));
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Takes a refresh type JSON web token and returns an access type JSON web token if the refresh token is valid.
|
|
279
|
+
*/
|
|
280
|
+
async jwtRefreshCreate(requestParameters: JwtRefreshCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TokenRefresh> {
|
|
281
|
+
const response = await this.jwtRefreshCreateRaw(requestParameters, initOverrides);
|
|
282
|
+
return await response.value();
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
}
|