@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.
Files changed (285) hide show
  1. package/.openapi-generator/FILES +97 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +23 -0
  4. package/README.md +200 -0
  5. package/dist/apis/AuthenticationApi.d.ts +131 -0
  6. package/dist/apis/AuthenticationApi.js +168 -0
  7. package/dist/apis/ChecksApi.d.ts +91 -0
  8. package/dist/apis/ChecksApi.js +116 -0
  9. package/dist/apis/DivisionsApi.d.ts +211 -0
  10. package/dist/apis/DivisionsApi.js +264 -0
  11. package/dist/apis/OAuthApi.d.ts +124 -0
  12. package/dist/apis/OAuthApi.js +159 -0
  13. package/dist/apis/ProfilesApi.d.ts +270 -0
  14. package/dist/apis/ProfilesApi.js +334 -0
  15. package/dist/apis/ScreeningsApi.d.ts +172 -0
  16. package/dist/apis/ScreeningsApi.js +216 -0
  17. package/dist/apis/WebhooksApi.d.ts +168 -0
  18. package/dist/apis/WebhooksApi.js +213 -0
  19. package/dist/apis/index.d.ts +7 -0
  20. package/dist/apis/index.js +25 -0
  21. package/dist/esm/apis/AuthenticationApi.d.ts +131 -0
  22. package/dist/esm/apis/AuthenticationApi.js +164 -0
  23. package/dist/esm/apis/ChecksApi.d.ts +91 -0
  24. package/dist/esm/apis/ChecksApi.js +112 -0
  25. package/dist/esm/apis/DivisionsApi.d.ts +211 -0
  26. package/dist/esm/apis/DivisionsApi.js +260 -0
  27. package/dist/esm/apis/OAuthApi.d.ts +124 -0
  28. package/dist/esm/apis/OAuthApi.js +155 -0
  29. package/dist/esm/apis/ProfilesApi.d.ts +270 -0
  30. package/dist/esm/apis/ProfilesApi.js +330 -0
  31. package/dist/esm/apis/ScreeningsApi.d.ts +172 -0
  32. package/dist/esm/apis/ScreeningsApi.js +212 -0
  33. package/dist/esm/apis/WebhooksApi.d.ts +168 -0
  34. package/dist/esm/apis/WebhooksApi.js +209 -0
  35. package/dist/esm/apis/index.d.ts +7 -0
  36. package/dist/esm/apis/index.js +9 -0
  37. package/dist/esm/index.d.ts +3 -0
  38. package/dist/esm/index.js +5 -0
  39. package/dist/esm/models/CustomTokenObtainPair.d.ts +38 -0
  40. package/dist/esm/models/CustomTokenObtainPair.js +47 -0
  41. package/dist/esm/models/DivisionReadOnly.d.ts +116 -0
  42. package/dist/esm/models/DivisionReadOnly.js +73 -0
  43. package/dist/esm/models/DivisionWrite.d.ts +98 -0
  44. package/dist/esm/models/DivisionWrite.js +78 -0
  45. package/dist/esm/models/JWTGeneration.d.ts +50 -0
  46. package/dist/esm/models/JWTGeneration.js +51 -0
  47. package/dist/esm/models/JWTResponse.d.ts +62 -0
  48. package/dist/esm/models/JWTResponse.js +61 -0
  49. package/dist/esm/models/OAuthApplication.d.ts +84 -0
  50. package/dist/esm/models/OAuthApplication.js +68 -0
  51. package/dist/esm/models/OAuthApplicationResponse.d.ts +98 -0
  52. package/dist/esm/models/OAuthApplicationResponse.js +80 -0
  53. package/dist/esm/models/PaginatedDivisionReadOnlyList.d.ts +51 -0
  54. package/dist/esm/models/PaginatedDivisionReadOnlyList.js +56 -0
  55. package/dist/esm/models/PaginatedV2ProfileListItemList.d.ts +51 -0
  56. package/dist/esm/models/PaginatedV2ProfileListItemList.js +56 -0
  57. package/dist/esm/models/PaginatedV2ScreeningListItemList.d.ts +51 -0
  58. package/dist/esm/models/PaginatedV2ScreeningListItemList.js +56 -0
  59. package/dist/esm/models/PatchedDivisionWrite.d.ts +98 -0
  60. package/dist/esm/models/PatchedDivisionWrite.js +62 -0
  61. package/dist/esm/models/PatchedV2ProfilePartialUpdate.d.ts +39 -0
  62. package/dist/esm/models/PatchedV2ProfilePartialUpdate.js +43 -0
  63. package/dist/esm/models/TokenRefresh.d.ts +38 -0
  64. package/dist/esm/models/TokenRefresh.js +44 -0
  65. package/dist/esm/models/V2Candidate.d.ts +592 -0
  66. package/dist/esm/models/V2Candidate.js +318 -0
  67. package/dist/esm/models/V2CheckField.d.ts +56 -0
  68. package/dist/esm/models/V2CheckField.js +53 -0
  69. package/dist/esm/models/V2CheckInfo.d.ts +100 -0
  70. package/dist/esm/models/V2CheckInfo.js +76 -0
  71. package/dist/esm/models/V2Document.d.ts +115 -0
  72. package/dist/esm/models/V2Document.js +84 -0
  73. package/dist/esm/models/V2DocumentContent.d.ts +40 -0
  74. package/dist/esm/models/V2DocumentContent.js +45 -0
  75. package/dist/esm/models/V2Money.d.ts +38 -0
  76. package/dist/esm/models/V2Money.js +47 -0
  77. package/dist/esm/models/V2ProfileCheck.d.ts +85 -0
  78. package/dist/esm/models/V2ProfileCheck.js +68 -0
  79. package/dist/esm/models/V2ProfileCheckEntry.d.ts +120 -0
  80. package/dist/esm/models/V2ProfileCheckEntry.js +87 -0
  81. package/dist/esm/models/V2ProfileCreate.d.ts +45 -0
  82. package/dist/esm/models/V2ProfileCreate.js +50 -0
  83. package/dist/esm/models/V2ProfileDetail.d.ts +94 -0
  84. package/dist/esm/models/V2ProfileDetail.js +75 -0
  85. package/dist/esm/models/V2ProfileListItem.d.ts +68 -0
  86. package/dist/esm/models/V2ProfileListItem.js +61 -0
  87. package/dist/esm/models/V2ProfileUpdate.d.ts +47 -0
  88. package/dist/esm/models/V2ProfileUpdate.js +50 -0
  89. package/dist/esm/models/V2ProfileUpdateCheck.d.ts +96 -0
  90. package/dist/esm/models/V2ProfileUpdateCheck.js +74 -0
  91. package/dist/esm/models/V2ScreeningCheck.d.ts +95 -0
  92. package/dist/esm/models/V2ScreeningCheck.js +72 -0
  93. package/dist/esm/models/V2ScreeningCheckEntry.d.ts +135 -0
  94. package/dist/esm/models/V2ScreeningCheckEntry.js +92 -0
  95. package/dist/esm/models/V2ScreeningCheckListItem.d.ts +93 -0
  96. package/dist/esm/models/V2ScreeningCheckListItem.js +74 -0
  97. package/dist/esm/models/V2ScreeningCreate.d.ts +46 -0
  98. package/dist/esm/models/V2ScreeningCreate.js +51 -0
  99. package/dist/esm/models/V2ScreeningDetail.d.ts +83 -0
  100. package/dist/esm/models/V2ScreeningDetail.js +70 -0
  101. package/dist/esm/models/V2ScreeningDetailProfile.d.ts +38 -0
  102. package/dist/esm/models/V2ScreeningDetailProfile.js +43 -0
  103. package/dist/esm/models/V2ScreeningListItem.d.ts +85 -0
  104. package/dist/esm/models/V2ScreeningListItem.js +69 -0
  105. package/dist/esm/models/VerifyWebhook.d.ts +34 -0
  106. package/dist/esm/models/VerifyWebhook.js +43 -0
  107. package/dist/esm/models/Webhook.d.ts +71 -0
  108. package/dist/esm/models/Webhook.js +69 -0
  109. package/dist/esm/models/WebhookResponse.d.ts +87 -0
  110. package/dist/esm/models/WebhookResponse.js +51 -0
  111. package/dist/esm/models/index.d.ts +36 -0
  112. package/dist/esm/models/index.js +38 -0
  113. package/dist/esm/runtime.d.ts +184 -0
  114. package/dist/esm/runtime.js +349 -0
  115. package/dist/index.d.ts +3 -0
  116. package/dist/index.js +21 -0
  117. package/dist/models/CustomTokenObtainPair.d.ts +38 -0
  118. package/dist/models/CustomTokenObtainPair.js +54 -0
  119. package/dist/models/DivisionReadOnly.d.ts +116 -0
  120. package/dist/models/DivisionReadOnly.js +80 -0
  121. package/dist/models/DivisionWrite.d.ts +98 -0
  122. package/dist/models/DivisionWrite.js +85 -0
  123. package/dist/models/JWTGeneration.d.ts +50 -0
  124. package/dist/models/JWTGeneration.js +58 -0
  125. package/dist/models/JWTResponse.d.ts +62 -0
  126. package/dist/models/JWTResponse.js +68 -0
  127. package/dist/models/OAuthApplication.d.ts +84 -0
  128. package/dist/models/OAuthApplication.js +76 -0
  129. package/dist/models/OAuthApplicationResponse.d.ts +98 -0
  130. package/dist/models/OAuthApplicationResponse.js +88 -0
  131. package/dist/models/PaginatedDivisionReadOnlyList.d.ts +51 -0
  132. package/dist/models/PaginatedDivisionReadOnlyList.js +63 -0
  133. package/dist/models/PaginatedV2ProfileListItemList.d.ts +51 -0
  134. package/dist/models/PaginatedV2ProfileListItemList.js +63 -0
  135. package/dist/models/PaginatedV2ScreeningListItemList.d.ts +51 -0
  136. package/dist/models/PaginatedV2ScreeningListItemList.js +63 -0
  137. package/dist/models/PatchedDivisionWrite.d.ts +98 -0
  138. package/dist/models/PatchedDivisionWrite.js +69 -0
  139. package/dist/models/PatchedV2ProfilePartialUpdate.d.ts +39 -0
  140. package/dist/models/PatchedV2ProfilePartialUpdate.js +50 -0
  141. package/dist/models/TokenRefresh.d.ts +38 -0
  142. package/dist/models/TokenRefresh.js +51 -0
  143. package/dist/models/V2Candidate.d.ts +592 -0
  144. package/dist/models/V2Candidate.js +326 -0
  145. package/dist/models/V2CheckField.d.ts +56 -0
  146. package/dist/models/V2CheckField.js +60 -0
  147. package/dist/models/V2CheckInfo.d.ts +100 -0
  148. package/dist/models/V2CheckInfo.js +83 -0
  149. package/dist/models/V2Document.d.ts +115 -0
  150. package/dist/models/V2Document.js +92 -0
  151. package/dist/models/V2DocumentContent.d.ts +40 -0
  152. package/dist/models/V2DocumentContent.js +52 -0
  153. package/dist/models/V2Money.d.ts +38 -0
  154. package/dist/models/V2Money.js +54 -0
  155. package/dist/models/V2ProfileCheck.d.ts +85 -0
  156. package/dist/models/V2ProfileCheck.js +76 -0
  157. package/dist/models/V2ProfileCheckEntry.d.ts +120 -0
  158. package/dist/models/V2ProfileCheckEntry.js +95 -0
  159. package/dist/models/V2ProfileCreate.d.ts +45 -0
  160. package/dist/models/V2ProfileCreate.js +57 -0
  161. package/dist/models/V2ProfileDetail.d.ts +94 -0
  162. package/dist/models/V2ProfileDetail.js +82 -0
  163. package/dist/models/V2ProfileListItem.d.ts +68 -0
  164. package/dist/models/V2ProfileListItem.js +68 -0
  165. package/dist/models/V2ProfileUpdate.d.ts +47 -0
  166. package/dist/models/V2ProfileUpdate.js +57 -0
  167. package/dist/models/V2ProfileUpdateCheck.d.ts +96 -0
  168. package/dist/models/V2ProfileUpdateCheck.js +82 -0
  169. package/dist/models/V2ScreeningCheck.d.ts +95 -0
  170. package/dist/models/V2ScreeningCheck.js +80 -0
  171. package/dist/models/V2ScreeningCheckEntry.d.ts +135 -0
  172. package/dist/models/V2ScreeningCheckEntry.js +100 -0
  173. package/dist/models/V2ScreeningCheckListItem.d.ts +93 -0
  174. package/dist/models/V2ScreeningCheckListItem.js +82 -0
  175. package/dist/models/V2ScreeningCreate.d.ts +46 -0
  176. package/dist/models/V2ScreeningCreate.js +58 -0
  177. package/dist/models/V2ScreeningDetail.d.ts +83 -0
  178. package/dist/models/V2ScreeningDetail.js +77 -0
  179. package/dist/models/V2ScreeningDetailProfile.d.ts +38 -0
  180. package/dist/models/V2ScreeningDetailProfile.js +50 -0
  181. package/dist/models/V2ScreeningListItem.d.ts +85 -0
  182. package/dist/models/V2ScreeningListItem.js +76 -0
  183. package/dist/models/VerifyWebhook.d.ts +34 -0
  184. package/dist/models/VerifyWebhook.js +50 -0
  185. package/dist/models/Webhook.d.ts +71 -0
  186. package/dist/models/Webhook.js +77 -0
  187. package/dist/models/WebhookResponse.d.ts +87 -0
  188. package/dist/models/WebhookResponse.js +58 -0
  189. package/dist/models/index.d.ts +36 -0
  190. package/dist/models/index.js +54 -0
  191. package/dist/runtime.d.ts +184 -0
  192. package/dist/runtime.js +365 -0
  193. package/docs/AuthenticationApi.md +227 -0
  194. package/docs/ChecksApi.md +150 -0
  195. package/docs/CustomTokenObtainPair.md +37 -0
  196. package/docs/DivisionReadOnly.md +62 -0
  197. package/docs/DivisionWrite.md +56 -0
  198. package/docs/DivisionsApi.md +380 -0
  199. package/docs/JWTGeneration.md +41 -0
  200. package/docs/JWTResponse.md +45 -0
  201. package/docs/OAuthApi.md +222 -0
  202. package/docs/OAuthApplication.md +43 -0
  203. package/docs/OAuthApplicationResponse.md +49 -0
  204. package/docs/PaginatedDivisionReadOnlyList.md +40 -0
  205. package/docs/PaginatedV2ProfileListItemList.md +40 -0
  206. package/docs/PaginatedV2ScreeningListItemList.md +40 -0
  207. package/docs/PatchedDivisionWrite.md +56 -0
  208. package/docs/PatchedV2ProfilePartialUpdate.md +37 -0
  209. package/docs/ProfilesApi.md +456 -0
  210. package/docs/ScreeningsApi.md +302 -0
  211. package/docs/TokenRefresh.md +36 -0
  212. package/docs/V2Candidate.md +53 -0
  213. package/docs/V2CheckField.md +43 -0
  214. package/docs/V2CheckInfo.md +57 -0
  215. package/docs/V2Document.md +45 -0
  216. package/docs/V2DocumentContent.md +37 -0
  217. package/docs/V2Money.md +36 -0
  218. package/docs/V2ProfileCheck.md +37 -0
  219. package/docs/V2ProfileCheckEntry.md +46 -0
  220. package/docs/V2ProfileCreate.md +38 -0
  221. package/docs/V2ProfileDetail.md +54 -0
  222. package/docs/V2ProfileListItem.md +46 -0
  223. package/docs/V2ProfileUpdate.md +39 -0
  224. package/docs/V2ProfileUpdateCheck.md +39 -0
  225. package/docs/V2ScreeningCheck.md +41 -0
  226. package/docs/V2ScreeningCheckEntry.md +50 -0
  227. package/docs/V2ScreeningCheckListItem.md +39 -0
  228. package/docs/V2ScreeningCreate.md +38 -0
  229. package/docs/V2ScreeningDetail.md +50 -0
  230. package/docs/V2ScreeningDetailProfile.md +36 -0
  231. package/docs/V2ScreeningListItem.md +51 -0
  232. package/docs/VerifyWebhook.md +35 -0
  233. package/docs/Webhook.md +43 -0
  234. package/docs/WebhookResponse.md +53 -0
  235. package/docs/WebhooksApi.md +305 -0
  236. package/package.json +25 -0
  237. package/src/apis/AuthenticationApi.ts +285 -0
  238. package/src/apis/ChecksApi.ts +181 -0
  239. package/src/apis/DivisionsApi.ts +462 -0
  240. package/src/apis/OAuthApi.ts +256 -0
  241. package/src/apis/ProfilesApi.ts +583 -0
  242. package/src/apis/ScreeningsApi.ts +376 -0
  243. package/src/apis/WebhooksApi.ts +363 -0
  244. package/src/apis/index.ts +9 -0
  245. package/src/index.ts +5 -0
  246. package/src/models/CustomTokenObtainPair.ts +75 -0
  247. package/src/models/DivisionReadOnly.ts +177 -0
  248. package/src/models/DivisionWrite.ts +160 -0
  249. package/src/models/JWTGeneration.ts +91 -0
  250. package/src/models/JWTResponse.ts +110 -0
  251. package/src/models/OAuthApplication.ts +130 -0
  252. package/src/models/OAuthApplicationResponse.ts +151 -0
  253. package/src/models/PaginatedDivisionReadOnlyList.ts +101 -0
  254. package/src/models/PaginatedV2ProfileListItemList.ts +101 -0
  255. package/src/models/PaginatedV2ScreeningListItemList.ts +101 -0
  256. package/src/models/PatchedDivisionWrite.ts +152 -0
  257. package/src/models/PatchedV2ProfilePartialUpdate.ts +74 -0
  258. package/src/models/TokenRefresh.ts +73 -0
  259. package/src/models/V2Candidate.ts +649 -0
  260. package/src/models/V2CheckField.ts +97 -0
  261. package/src/models/V2CheckInfo.ts +168 -0
  262. package/src/models/V2Document.ts +166 -0
  263. package/src/models/V2DocumentContent.ts +76 -0
  264. package/src/models/V2Money.ts +75 -0
  265. package/src/models/V2ProfileCheck.ts +122 -0
  266. package/src/models/V2ProfileCheckEntry.ts +173 -0
  267. package/src/models/V2ProfileCreate.ts +91 -0
  268. package/src/models/V2ProfileDetail.ts +162 -0
  269. package/src/models/V2ProfileListItem.ts +115 -0
  270. package/src/models/V2ProfileUpdate.ts +93 -0
  271. package/src/models/V2ProfileUpdateCheck.ts +135 -0
  272. package/src/models/V2ScreeningCheck.ts +136 -0
  273. package/src/models/V2ScreeningCheckEntry.ts +181 -0
  274. package/src/models/V2ScreeningCheckListItem.ts +133 -0
  275. package/src/models/V2ScreeningCreate.ts +98 -0
  276. package/src/models/V2ScreeningDetail.ts +152 -0
  277. package/src/models/V2ScreeningDetailProfile.ts +73 -0
  278. package/src/models/V2ScreeningListItem.ts +154 -0
  279. package/src/models/VerifyWebhook.ts +68 -0
  280. package/src/models/Webhook.ts +118 -0
  281. package/src/models/WebhookResponse.ts +140 -0
  282. package/src/models/index.ts +38 -0
  283. package/src/runtime.ts +449 -0
  284. package/tsconfig.esm.json +7 -0
  285. package/tsconfig.json +16 -0
@@ -0,0 +1,264 @@
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.DivisionsApi = void 0;
26
+ const runtime = require("../runtime");
27
+ const DivisionReadOnly_1 = require("../models/DivisionReadOnly");
28
+ const DivisionWrite_1 = require("../models/DivisionWrite");
29
+ const PaginatedDivisionReadOnlyList_1 = require("../models/PaginatedDivisionReadOnlyList");
30
+ const PatchedDivisionWrite_1 = require("../models/PatchedDivisionWrite");
31
+ /**
32
+ *
33
+ */
34
+ class DivisionsApi extends runtime.BaseAPI {
35
+ /**
36
+ * Creates request options for v2OrganisationsDivisionsCreate without sending the request
37
+ */
38
+ v2OrganisationsDivisionsCreateRequestOpts(requestParameters) {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ if (requestParameters['divisionWrite'] == null) {
41
+ throw new runtime.RequiredError('divisionWrite', 'Required parameter "divisionWrite" was null or undefined when calling v2OrganisationsDivisionsCreate().');
42
+ }
43
+ const queryParameters = {};
44
+ const headerParameters = {};
45
+ headerParameters['Content-Type'] = 'application/json';
46
+ if (this.configuration && this.configuration.accessToken) {
47
+ // oauth required
48
+ headerParameters["Authorization"] = `Bearer ${yield this.configuration.accessToken("oauth2", ["read:api", "create:api", "update:api"])}`;
49
+ }
50
+ let urlPath = `/api/v2/organisations/divisions/`;
51
+ return {
52
+ path: urlPath,
53
+ method: 'POST',
54
+ headers: headerParameters,
55
+ query: queryParameters,
56
+ body: (0, DivisionWrite_1.DivisionWriteToJSON)(requestParameters['divisionWrite']),
57
+ };
58
+ });
59
+ }
60
+ /**
61
+ * Create a division (a child organisation under the current parent org). Divisions are an advanced, rarely-needed feature: create one ONLY when the user has clearly stated they want to manage a separate business unit, location, or legal entity under their account. Do NOT create a division just to organise screenings, for a single-person or single-member organisation, or without an explicit request to do so. When in doubt, ask the user to confirm before calling this tool.
62
+ */
63
+ v2OrganisationsDivisionsCreateRaw(requestParameters, initOverrides) {
64
+ return __awaiter(this, void 0, void 0, function* () {
65
+ const requestOptions = yield this.v2OrganisationsDivisionsCreateRequestOpts(requestParameters);
66
+ const response = yield this.request(requestOptions, initOverrides);
67
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, DivisionWrite_1.DivisionWriteFromJSON)(jsonValue));
68
+ });
69
+ }
70
+ /**
71
+ * Create a division (a child organisation under the current parent org). Divisions are an advanced, rarely-needed feature: create one ONLY when the user has clearly stated they want to manage a separate business unit, location, or legal entity under their account. Do NOT create a division just to organise screenings, for a single-person or single-member organisation, or without an explicit request to do so. When in doubt, ask the user to confirm before calling this tool.
72
+ */
73
+ v2OrganisationsDivisionsCreate(requestParameters, initOverrides) {
74
+ return __awaiter(this, void 0, void 0, function* () {
75
+ const response = yield this.v2OrganisationsDivisionsCreateRaw(requestParameters, initOverrides);
76
+ return yield response.value();
77
+ });
78
+ }
79
+ /**
80
+ * Creates request options for v2OrganisationsDivisionsList without sending the request
81
+ */
82
+ v2OrganisationsDivisionsListRequestOpts(requestParameters) {
83
+ return __awaiter(this, void 0, void 0, function* () {
84
+ const queryParameters = {};
85
+ if (requestParameters['page'] != null) {
86
+ queryParameters['page'] = requestParameters['page'];
87
+ }
88
+ if (requestParameters['pageSize'] != null) {
89
+ queryParameters['page_size'] = requestParameters['pageSize'];
90
+ }
91
+ if (requestParameters['paginate'] != null) {
92
+ queryParameters['paginate'] = requestParameters['paginate'];
93
+ }
94
+ const headerParameters = {};
95
+ if (this.configuration && this.configuration.accessToken) {
96
+ // oauth required
97
+ headerParameters["Authorization"] = `Bearer ${yield this.configuration.accessToken("oauth2", ["read:api", "create:api", "update:api"])}`;
98
+ }
99
+ let urlPath = `/api/v2/organisations/divisions/`;
100
+ return {
101
+ path: urlPath,
102
+ method: 'GET',
103
+ headers: headerParameters,
104
+ query: queryParameters,
105
+ };
106
+ });
107
+ }
108
+ /**
109
+ * List method that handles both paginated and unpaginated responses and enforces the max_total_records limit (500).
110
+ */
111
+ v2OrganisationsDivisionsListRaw(requestParameters, initOverrides) {
112
+ return __awaiter(this, void 0, void 0, function* () {
113
+ const requestOptions = yield this.v2OrganisationsDivisionsListRequestOpts(requestParameters);
114
+ const response = yield this.request(requestOptions, initOverrides);
115
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, PaginatedDivisionReadOnlyList_1.PaginatedDivisionReadOnlyListFromJSON)(jsonValue));
116
+ });
117
+ }
118
+ /**
119
+ * List method that handles both paginated and unpaginated responses and enforces the max_total_records limit (500).
120
+ */
121
+ v2OrganisationsDivisionsList() {
122
+ return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
123
+ const response = yield this.v2OrganisationsDivisionsListRaw(requestParameters, initOverrides);
124
+ return yield response.value();
125
+ });
126
+ }
127
+ /**
128
+ * Creates request options for v2OrganisationsDivisionsPartialUpdate without sending the request
129
+ */
130
+ v2OrganisationsDivisionsPartialUpdateRequestOpts(requestParameters) {
131
+ return __awaiter(this, void 0, void 0, function* () {
132
+ if (requestParameters['id'] == null) {
133
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling v2OrganisationsDivisionsPartialUpdate().');
134
+ }
135
+ const queryParameters = {};
136
+ const headerParameters = {};
137
+ headerParameters['Content-Type'] = 'application/json';
138
+ if (this.configuration && this.configuration.accessToken) {
139
+ // oauth required
140
+ headerParameters["Authorization"] = `Bearer ${yield this.configuration.accessToken("oauth2", ["read:api", "create:api", "update:api"])}`;
141
+ }
142
+ let urlPath = `/api/v2/organisations/divisions/{id}/`;
143
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
144
+ return {
145
+ path: urlPath,
146
+ method: 'PATCH',
147
+ headers: headerParameters,
148
+ query: queryParameters,
149
+ body: (0, PatchedDivisionWrite_1.PatchedDivisionWriteToJSON)(requestParameters['patchedDivisionWrite']),
150
+ };
151
+ });
152
+ }
153
+ /**
154
+ * A division is a child organisation under a parent org, used only when a customer needs to manage genuinely separate business units, locations, or legal entities under one account. The vast majority of organisations operate as a single entity and need no divisions. Only top-level (parent) organisations can have divisions.
155
+ */
156
+ v2OrganisationsDivisionsPartialUpdateRaw(requestParameters, initOverrides) {
157
+ return __awaiter(this, void 0, void 0, function* () {
158
+ const requestOptions = yield this.v2OrganisationsDivisionsPartialUpdateRequestOpts(requestParameters);
159
+ const response = yield this.request(requestOptions, initOverrides);
160
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, DivisionWrite_1.DivisionWriteFromJSON)(jsonValue));
161
+ });
162
+ }
163
+ /**
164
+ * A division is a child organisation under a parent org, used only when a customer needs to manage genuinely separate business units, locations, or legal entities under one account. The vast majority of organisations operate as a single entity and need no divisions. Only top-level (parent) organisations can have divisions.
165
+ */
166
+ v2OrganisationsDivisionsPartialUpdate(requestParameters, initOverrides) {
167
+ return __awaiter(this, void 0, void 0, function* () {
168
+ const response = yield this.v2OrganisationsDivisionsPartialUpdateRaw(requestParameters, initOverrides);
169
+ return yield response.value();
170
+ });
171
+ }
172
+ /**
173
+ * Creates request options for v2OrganisationsDivisionsRetrieve without sending the request
174
+ */
175
+ v2OrganisationsDivisionsRetrieveRequestOpts(requestParameters) {
176
+ return __awaiter(this, void 0, void 0, function* () {
177
+ if (requestParameters['id'] == null) {
178
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling v2OrganisationsDivisionsRetrieve().');
179
+ }
180
+ const queryParameters = {};
181
+ const headerParameters = {};
182
+ if (this.configuration && this.configuration.accessToken) {
183
+ // oauth required
184
+ headerParameters["Authorization"] = `Bearer ${yield this.configuration.accessToken("oauth2", ["read:api", "create:api", "update:api"])}`;
185
+ }
186
+ let urlPath = `/api/v2/organisations/divisions/{id}/`;
187
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
188
+ return {
189
+ path: urlPath,
190
+ method: 'GET',
191
+ headers: headerParameters,
192
+ query: queryParameters,
193
+ };
194
+ });
195
+ }
196
+ /**
197
+ * A division is a child organisation under a parent org, used only when a customer needs to manage genuinely separate business units, locations, or legal entities under one account. The vast majority of organisations operate as a single entity and need no divisions. Only top-level (parent) organisations can have divisions.
198
+ */
199
+ v2OrganisationsDivisionsRetrieveRaw(requestParameters, initOverrides) {
200
+ return __awaiter(this, void 0, void 0, function* () {
201
+ const requestOptions = yield this.v2OrganisationsDivisionsRetrieveRequestOpts(requestParameters);
202
+ const response = yield this.request(requestOptions, initOverrides);
203
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, DivisionReadOnly_1.DivisionReadOnlyFromJSON)(jsonValue));
204
+ });
205
+ }
206
+ /**
207
+ * A division is a child organisation under a parent org, used only when a customer needs to manage genuinely separate business units, locations, or legal entities under one account. The vast majority of organisations operate as a single entity and need no divisions. Only top-level (parent) organisations can have divisions.
208
+ */
209
+ v2OrganisationsDivisionsRetrieve(requestParameters, initOverrides) {
210
+ return __awaiter(this, void 0, void 0, function* () {
211
+ const response = yield this.v2OrganisationsDivisionsRetrieveRaw(requestParameters, initOverrides);
212
+ return yield response.value();
213
+ });
214
+ }
215
+ /**
216
+ * Creates request options for v2OrganisationsDivisionsUpdate without sending the request
217
+ */
218
+ v2OrganisationsDivisionsUpdateRequestOpts(requestParameters) {
219
+ return __awaiter(this, void 0, void 0, function* () {
220
+ if (requestParameters['id'] == null) {
221
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling v2OrganisationsDivisionsUpdate().');
222
+ }
223
+ if (requestParameters['divisionWrite'] == null) {
224
+ throw new runtime.RequiredError('divisionWrite', 'Required parameter "divisionWrite" was null or undefined when calling v2OrganisationsDivisionsUpdate().');
225
+ }
226
+ const queryParameters = {};
227
+ const headerParameters = {};
228
+ headerParameters['Content-Type'] = 'application/json';
229
+ if (this.configuration && this.configuration.accessToken) {
230
+ // oauth required
231
+ headerParameters["Authorization"] = `Bearer ${yield this.configuration.accessToken("oauth2", ["read:api", "create:api", "update:api"])}`;
232
+ }
233
+ let urlPath = `/api/v2/organisations/divisions/{id}/`;
234
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
235
+ return {
236
+ path: urlPath,
237
+ method: 'PUT',
238
+ headers: headerParameters,
239
+ query: queryParameters,
240
+ body: (0, DivisionWrite_1.DivisionWriteToJSON)(requestParameters['divisionWrite']),
241
+ };
242
+ });
243
+ }
244
+ /**
245
+ * Update an existing division\'s contact, billing, and address details. Override also triggers a webhook on successful PUT and PATCH requests.
246
+ */
247
+ v2OrganisationsDivisionsUpdateRaw(requestParameters, initOverrides) {
248
+ return __awaiter(this, void 0, void 0, function* () {
249
+ const requestOptions = yield this.v2OrganisationsDivisionsUpdateRequestOpts(requestParameters);
250
+ const response = yield this.request(requestOptions, initOverrides);
251
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, DivisionWrite_1.DivisionWriteFromJSON)(jsonValue));
252
+ });
253
+ }
254
+ /**
255
+ * Update an existing division\'s contact, billing, and address details. Override also triggers a webhook on successful PUT and PATCH requests.
256
+ */
257
+ v2OrganisationsDivisionsUpdate(requestParameters, initOverrides) {
258
+ return __awaiter(this, void 0, void 0, function* () {
259
+ const response = yield this.v2OrganisationsDivisionsUpdateRaw(requestParameters, initOverrides);
260
+ return yield response.value();
261
+ });
262
+ }
263
+ }
264
+ exports.DivisionsApi = DivisionsApi;
@@ -0,0 +1,124 @@
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 OAuthApplication } from '../models/OAuthApplication';
14
+ import { type OAuthApplicationResponse } from '../models/OAuthApplicationResponse';
15
+ export interface CreateOAuthApplication2Request {
16
+ oAuthApplication: OAuthApplication;
17
+ }
18
+ export interface DeleteOAuthApplication2Request {
19
+ applicationId: string;
20
+ }
21
+ /**
22
+ * OAuthApi - interface
23
+ *
24
+ * @export
25
+ * @interface OAuthApiInterface
26
+ */
27
+ export interface OAuthApiInterface {
28
+ /**
29
+ * Creates request options for createOAuthApplication2 without sending the request
30
+ * @param {OAuthApplication} oAuthApplication
31
+ * @throws {RequiredError}
32
+ * @memberof OAuthApiInterface
33
+ */
34
+ createOAuthApplication2RequestOpts(requestParameters: CreateOAuthApplication2Request): Promise<runtime.RequestOpts>;
35
+ /**
36
+ * Create OAuth application for API access
37
+ * @param {OAuthApplication} oAuthApplication
38
+ * @param {*} [options] Override http request option.
39
+ * @throws {RequiredError}
40
+ * @memberof OAuthApiInterface
41
+ */
42
+ createOAuthApplication2Raw(requestParameters: CreateOAuthApplication2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<OAuthApplicationResponse>>;
43
+ /**
44
+ * Create OAuth application for API access
45
+ */
46
+ createOAuthApplication2(requestParameters: CreateOAuthApplication2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OAuthApplicationResponse>;
47
+ /**
48
+ * Creates request options for deleteOAuthApplication2 without sending the request
49
+ * @param {string} applicationId Application ID to delete
50
+ * @throws {RequiredError}
51
+ * @memberof OAuthApiInterface
52
+ */
53
+ deleteOAuthApplication2RequestOpts(requestParameters: DeleteOAuthApplication2Request): Promise<runtime.RequestOpts>;
54
+ /**
55
+ * Delete an OAuth application
56
+ * @param {string} applicationId Application ID to delete
57
+ * @param {*} [options] Override http request option.
58
+ * @throws {RequiredError}
59
+ * @memberof OAuthApiInterface
60
+ */
61
+ deleteOAuthApplication2Raw(requestParameters: DeleteOAuthApplication2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
62
+ /**
63
+ * Delete an OAuth application
64
+ */
65
+ deleteOAuthApplication2(requestParameters: DeleteOAuthApplication2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
66
+ /**
67
+ * Creates request options for listOAuthApplications2 without sending the request
68
+ * @throws {RequiredError}
69
+ * @memberof OAuthApiInterface
70
+ */
71
+ listOAuthApplications2RequestOpts(): Promise<runtime.RequestOpts>;
72
+ /**
73
+ * List OAuth applications for the organization
74
+ * @param {*} [options] Override http request option.
75
+ * @throws {RequiredError}
76
+ * @memberof OAuthApiInterface
77
+ */
78
+ listOAuthApplications2Raw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<OAuthApplicationResponse>>>;
79
+ /**
80
+ * List OAuth applications for the organization
81
+ */
82
+ listOAuthApplications2(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<OAuthApplicationResponse>>;
83
+ }
84
+ /**
85
+ *
86
+ */
87
+ export declare class OAuthApi extends runtime.BaseAPI implements OAuthApiInterface {
88
+ /**
89
+ * Creates request options for createOAuthApplication2 without sending the request
90
+ */
91
+ createOAuthApplication2RequestOpts(requestParameters: CreateOAuthApplication2Request): Promise<runtime.RequestOpts>;
92
+ /**
93
+ * Create OAuth application for API access
94
+ */
95
+ createOAuthApplication2Raw(requestParameters: CreateOAuthApplication2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<OAuthApplicationResponse>>;
96
+ /**
97
+ * Create OAuth application for API access
98
+ */
99
+ createOAuthApplication2(requestParameters: CreateOAuthApplication2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OAuthApplicationResponse>;
100
+ /**
101
+ * Creates request options for deleteOAuthApplication2 without sending the request
102
+ */
103
+ deleteOAuthApplication2RequestOpts(requestParameters: DeleteOAuthApplication2Request): Promise<runtime.RequestOpts>;
104
+ /**
105
+ * Delete an OAuth application
106
+ */
107
+ deleteOAuthApplication2Raw(requestParameters: DeleteOAuthApplication2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
108
+ /**
109
+ * Delete an OAuth application
110
+ */
111
+ deleteOAuthApplication2(requestParameters: DeleteOAuthApplication2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
112
+ /**
113
+ * Creates request options for listOAuthApplications2 without sending the request
114
+ */
115
+ listOAuthApplications2RequestOpts(): Promise<runtime.RequestOpts>;
116
+ /**
117
+ * List OAuth applications for the organization
118
+ */
119
+ listOAuthApplications2Raw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<OAuthApplicationResponse>>>;
120
+ /**
121
+ * List OAuth applications for the organization
122
+ */
123
+ listOAuthApplications2(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<OAuthApplicationResponse>>;
124
+ }
@@ -0,0 +1,159 @@
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.OAuthApi = void 0;
26
+ const runtime = require("../runtime");
27
+ const OAuthApplication_1 = require("../models/OAuthApplication");
28
+ const OAuthApplicationResponse_1 = require("../models/OAuthApplicationResponse");
29
+ /**
30
+ *
31
+ */
32
+ class OAuthApi extends runtime.BaseAPI {
33
+ /**
34
+ * Creates request options for createOAuthApplication2 without sending the request
35
+ */
36
+ createOAuthApplication2RequestOpts(requestParameters) {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ if (requestParameters['oAuthApplication'] == null) {
39
+ throw new runtime.RequiredError('oAuthApplication', 'Required parameter "oAuthApplication" was null or undefined when calling createOAuthApplication2().');
40
+ }
41
+ const queryParameters = {};
42
+ const headerParameters = {};
43
+ headerParameters['Content-Type'] = 'application/json';
44
+ if (this.configuration && this.configuration.accessToken) {
45
+ // oauth required
46
+ headerParameters["Authorization"] = `Bearer ${yield this.configuration.accessToken("oauth2", ["read:api", "create:api", "update:api"])}`;
47
+ }
48
+ let urlPath = `/api/v2/oauth/applications/`;
49
+ return {
50
+ path: urlPath,
51
+ method: 'POST',
52
+ headers: headerParameters,
53
+ query: queryParameters,
54
+ body: (0, OAuthApplication_1.OAuthApplicationToJSON)(requestParameters['oAuthApplication']),
55
+ };
56
+ });
57
+ }
58
+ /**
59
+ * Create OAuth application for API access
60
+ */
61
+ createOAuthApplication2Raw(requestParameters, initOverrides) {
62
+ return __awaiter(this, void 0, void 0, function* () {
63
+ const requestOptions = yield this.createOAuthApplication2RequestOpts(requestParameters);
64
+ const response = yield this.request(requestOptions, initOverrides);
65
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, OAuthApplicationResponse_1.OAuthApplicationResponseFromJSON)(jsonValue));
66
+ });
67
+ }
68
+ /**
69
+ * Create OAuth application for API access
70
+ */
71
+ createOAuthApplication2(requestParameters, initOverrides) {
72
+ return __awaiter(this, void 0, void 0, function* () {
73
+ const response = yield this.createOAuthApplication2Raw(requestParameters, initOverrides);
74
+ return yield response.value();
75
+ });
76
+ }
77
+ /**
78
+ * Creates request options for deleteOAuthApplication2 without sending the request
79
+ */
80
+ deleteOAuthApplication2RequestOpts(requestParameters) {
81
+ return __awaiter(this, void 0, void 0, function* () {
82
+ if (requestParameters['applicationId'] == null) {
83
+ throw new runtime.RequiredError('applicationId', 'Required parameter "applicationId" was null or undefined when calling deleteOAuthApplication2().');
84
+ }
85
+ const queryParameters = {};
86
+ const headerParameters = {};
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/v2/oauth/applications/{application_id}/`;
92
+ urlPath = urlPath.replace('{application_id}', encodeURIComponent(String(requestParameters['applicationId'])));
93
+ return {
94
+ path: urlPath,
95
+ method: 'DELETE',
96
+ headers: headerParameters,
97
+ query: queryParameters,
98
+ };
99
+ });
100
+ }
101
+ /**
102
+ * Delete an OAuth application
103
+ */
104
+ deleteOAuthApplication2Raw(requestParameters, initOverrides) {
105
+ return __awaiter(this, void 0, void 0, function* () {
106
+ const requestOptions = yield this.deleteOAuthApplication2RequestOpts(requestParameters);
107
+ const response = yield this.request(requestOptions, initOverrides);
108
+ return new runtime.VoidApiResponse(response);
109
+ });
110
+ }
111
+ /**
112
+ * Delete an OAuth application
113
+ */
114
+ deleteOAuthApplication2(requestParameters, initOverrides) {
115
+ return __awaiter(this, void 0, void 0, function* () {
116
+ yield this.deleteOAuthApplication2Raw(requestParameters, initOverrides);
117
+ });
118
+ }
119
+ /**
120
+ * Creates request options for listOAuthApplications2 without sending the request
121
+ */
122
+ listOAuthApplications2RequestOpts() {
123
+ return __awaiter(this, void 0, void 0, function* () {
124
+ const queryParameters = {};
125
+ const headerParameters = {};
126
+ if (this.configuration && this.configuration.accessToken) {
127
+ // oauth required
128
+ headerParameters["Authorization"] = `Bearer ${yield this.configuration.accessToken("oauth2", ["read:api", "create:api", "update:api"])}`;
129
+ }
130
+ let urlPath = `/api/v2/oauth/applications/list/`;
131
+ return {
132
+ path: urlPath,
133
+ method: 'GET',
134
+ headers: headerParameters,
135
+ query: queryParameters,
136
+ };
137
+ });
138
+ }
139
+ /**
140
+ * List OAuth applications for the organization
141
+ */
142
+ listOAuthApplications2Raw(initOverrides) {
143
+ return __awaiter(this, void 0, void 0, function* () {
144
+ const requestOptions = yield this.listOAuthApplications2RequestOpts();
145
+ const response = yield this.request(requestOptions, initOverrides);
146
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(OAuthApplicationResponse_1.OAuthApplicationResponseFromJSON));
147
+ });
148
+ }
149
+ /**
150
+ * List OAuth applications for the organization
151
+ */
152
+ listOAuthApplications2(initOverrides) {
153
+ return __awaiter(this, void 0, void 0, function* () {
154
+ const response = yield this.listOAuthApplications2Raw(initOverrides);
155
+ return yield response.value();
156
+ });
157
+ }
158
+ }
159
+ exports.OAuthApi = OAuthApi;