@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,365 @@
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.TextApiResponse = exports.BlobApiResponse = exports.VoidApiResponse = exports.JSONApiResponse = exports.COLLECTION_FORMATS = exports.RequiredError = exports.FetchError = exports.ResponseError = exports.BaseAPI = exports.DefaultConfig = exports.Configuration = exports.BASE_PATH = void 0;
26
+ exports.querystring = querystring;
27
+ exports.exists = exists;
28
+ exports.mapValues = mapValues;
29
+ exports.canConsumeForm = canConsumeForm;
30
+ exports.BASE_PATH = "https://api.pescheck.io".replace(/\/+$/, "");
31
+ class Configuration {
32
+ constructor(configuration = {}) {
33
+ this.configuration = configuration;
34
+ }
35
+ set config(configuration) {
36
+ this.configuration = configuration;
37
+ }
38
+ get basePath() {
39
+ return this.configuration.basePath != null ? this.configuration.basePath : exports.BASE_PATH;
40
+ }
41
+ get fetchApi() {
42
+ return this.configuration.fetchApi;
43
+ }
44
+ get middleware() {
45
+ return this.configuration.middleware || [];
46
+ }
47
+ get queryParamsStringify() {
48
+ return this.configuration.queryParamsStringify || querystring;
49
+ }
50
+ get username() {
51
+ return this.configuration.username;
52
+ }
53
+ get password() {
54
+ return this.configuration.password;
55
+ }
56
+ get apiKey() {
57
+ const apiKey = this.configuration.apiKey;
58
+ if (apiKey) {
59
+ return typeof apiKey === 'function' ? apiKey : () => apiKey;
60
+ }
61
+ return undefined;
62
+ }
63
+ get accessToken() {
64
+ const accessToken = this.configuration.accessToken;
65
+ if (accessToken) {
66
+ return typeof accessToken === 'function' ? accessToken : () => __awaiter(this, void 0, void 0, function* () { return accessToken; });
67
+ }
68
+ return undefined;
69
+ }
70
+ get headers() {
71
+ return this.configuration.headers;
72
+ }
73
+ get credentials() {
74
+ return this.configuration.credentials;
75
+ }
76
+ }
77
+ exports.Configuration = Configuration;
78
+ exports.DefaultConfig = new Configuration();
79
+ /**
80
+ * This is the base class for all generated API classes.
81
+ */
82
+ class BaseAPI {
83
+ constructor(configuration = exports.DefaultConfig) {
84
+ this.configuration = configuration;
85
+ this.fetchApi = (url, init) => __awaiter(this, void 0, void 0, function* () {
86
+ let fetchParams = { url, init };
87
+ for (const middleware of this.middleware) {
88
+ if (middleware.pre) {
89
+ fetchParams = (yield middleware.pre(Object.assign({ fetch: this.fetchApi }, fetchParams))) || fetchParams;
90
+ }
91
+ }
92
+ let response = undefined;
93
+ try {
94
+ response = yield (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
95
+ }
96
+ catch (e) {
97
+ for (const middleware of this.middleware) {
98
+ if (middleware.onError) {
99
+ response = (yield middleware.onError({
100
+ fetch: this.fetchApi,
101
+ url: fetchParams.url,
102
+ init: fetchParams.init,
103
+ error: e,
104
+ response: response ? response.clone() : undefined,
105
+ })) || response;
106
+ }
107
+ }
108
+ if (response === undefined) {
109
+ if (e instanceof Error) {
110
+ throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response');
111
+ }
112
+ else {
113
+ throw e;
114
+ }
115
+ }
116
+ }
117
+ for (const middleware of this.middleware) {
118
+ if (middleware.post) {
119
+ response = (yield middleware.post({
120
+ fetch: this.fetchApi,
121
+ url: fetchParams.url,
122
+ init: fetchParams.init,
123
+ response: response.clone(),
124
+ })) || response;
125
+ }
126
+ }
127
+ return response;
128
+ });
129
+ this.middleware = configuration.middleware;
130
+ }
131
+ withMiddleware(...middlewares) {
132
+ const next = this.clone();
133
+ next.middleware = next.middleware.concat(...middlewares);
134
+ return next;
135
+ }
136
+ withPreMiddleware(...preMiddlewares) {
137
+ const middlewares = preMiddlewares.map((pre) => ({ pre }));
138
+ return this.withMiddleware(...middlewares);
139
+ }
140
+ withPostMiddleware(...postMiddlewares) {
141
+ const middlewares = postMiddlewares.map((post) => ({ post }));
142
+ return this.withMiddleware(...middlewares);
143
+ }
144
+ /**
145
+ * Check if the given MIME is a JSON MIME.
146
+ * JSON MIME examples:
147
+ * application/json
148
+ * application/json; charset=UTF8
149
+ * APPLICATION/JSON
150
+ * application/vnd.company+json
151
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
152
+ * @return True if the given MIME is JSON, false otherwise.
153
+ */
154
+ isJsonMime(mime) {
155
+ if (!mime) {
156
+ return false;
157
+ }
158
+ return BaseAPI.jsonRegex.test(mime);
159
+ }
160
+ request(context, initOverrides) {
161
+ return __awaiter(this, void 0, void 0, function* () {
162
+ const { url, init } = yield this.createFetchParams(context, initOverrides);
163
+ const response = yield this.fetchApi(url, init);
164
+ if (response && (response.status >= 200 && response.status < 300)) {
165
+ return response;
166
+ }
167
+ throw new ResponseError(response, 'Response returned an error code');
168
+ });
169
+ }
170
+ createFetchParams(context, initOverrides) {
171
+ return __awaiter(this, void 0, void 0, function* () {
172
+ let url = this.configuration.basePath + context.path;
173
+ if (context.query !== undefined && Object.keys(context.query).length !== 0) {
174
+ // only add the querystring to the URL if there are query parameters.
175
+ // this is done to avoid urls ending with a "?" character which buggy webservers
176
+ // do not handle correctly sometimes.
177
+ url += '?' + this.configuration.queryParamsStringify(context.query);
178
+ }
179
+ const headers = Object.assign({}, this.configuration.headers, context.headers);
180
+ Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {});
181
+ const initOverrideFn = typeof initOverrides === "function"
182
+ ? initOverrides
183
+ : () => __awaiter(this, void 0, void 0, function* () { return initOverrides; });
184
+ const initParams = {
185
+ method: context.method,
186
+ headers,
187
+ body: context.body,
188
+ credentials: this.configuration.credentials,
189
+ };
190
+ const overriddenInit = Object.assign(Object.assign({}, initParams), (yield initOverrideFn({
191
+ init: initParams,
192
+ context,
193
+ })));
194
+ let body;
195
+ if (isFormData(overriddenInit.body)
196
+ || (overriddenInit.body instanceof URLSearchParams)
197
+ || isBlob(overriddenInit.body)) {
198
+ body = overriddenInit.body;
199
+ }
200
+ else if (this.isJsonMime(headers['Content-Type'])) {
201
+ body = JSON.stringify(overriddenInit.body);
202
+ }
203
+ else {
204
+ body = overriddenInit.body;
205
+ }
206
+ const init = Object.assign(Object.assign({}, overriddenInit), { body });
207
+ return { url, init };
208
+ });
209
+ }
210
+ /**
211
+ * Create a shallow clone of `this` by constructing a new instance
212
+ * and then shallow cloning data members.
213
+ */
214
+ clone() {
215
+ const constructor = this.constructor;
216
+ const next = new constructor(this.configuration);
217
+ next.middleware = this.middleware.slice();
218
+ return next;
219
+ }
220
+ }
221
+ exports.BaseAPI = BaseAPI;
222
+ BaseAPI.jsonRegex = /^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$/i;
223
+ ;
224
+ function isBlob(value) {
225
+ return typeof Blob !== 'undefined' && value instanceof Blob;
226
+ }
227
+ function isFormData(value) {
228
+ return typeof FormData !== "undefined" && value instanceof FormData;
229
+ }
230
+ class ResponseError extends Error {
231
+ constructor(response, msg) {
232
+ super(msg);
233
+ this.response = response;
234
+ this.name = "ResponseError";
235
+ // restore prototype chain
236
+ const actualProto = new.target.prototype;
237
+ if (Object.setPrototypeOf) {
238
+ Object.setPrototypeOf(this, actualProto);
239
+ }
240
+ }
241
+ }
242
+ exports.ResponseError = ResponseError;
243
+ class FetchError extends Error {
244
+ constructor(cause, msg) {
245
+ super(msg);
246
+ this.cause = cause;
247
+ this.name = "FetchError";
248
+ // restore prototype chain
249
+ const actualProto = new.target.prototype;
250
+ if (Object.setPrototypeOf) {
251
+ Object.setPrototypeOf(this, actualProto);
252
+ }
253
+ }
254
+ }
255
+ exports.FetchError = FetchError;
256
+ class RequiredError extends Error {
257
+ constructor(field, msg) {
258
+ super(msg);
259
+ this.field = field;
260
+ this.name = "RequiredError";
261
+ // restore prototype chain
262
+ const actualProto = new.target.prototype;
263
+ if (Object.setPrototypeOf) {
264
+ Object.setPrototypeOf(this, actualProto);
265
+ }
266
+ }
267
+ }
268
+ exports.RequiredError = RequiredError;
269
+ exports.COLLECTION_FORMATS = {
270
+ csv: ",",
271
+ ssv: " ",
272
+ tsv: "\t",
273
+ pipes: "|",
274
+ };
275
+ function querystring(params, prefix = '') {
276
+ return Object.keys(params)
277
+ .map(key => querystringSingleKey(key, params[key], prefix))
278
+ .filter(part => part.length > 0)
279
+ .join('&');
280
+ }
281
+ function querystringSingleKey(key, value, keyPrefix = '') {
282
+ const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
283
+ if (value instanceof Array) {
284
+ const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue)))
285
+ .join(`&${encodeURIComponent(fullKey)}=`);
286
+ return `${encodeURIComponent(fullKey)}=${multiValue}`;
287
+ }
288
+ if (value instanceof Set) {
289
+ const valueAsArray = Array.from(value);
290
+ return querystringSingleKey(key, valueAsArray, keyPrefix);
291
+ }
292
+ if (value instanceof Date) {
293
+ return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
294
+ }
295
+ if (value instanceof Object) {
296
+ return querystring(value, fullKey);
297
+ }
298
+ return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
299
+ }
300
+ function exists(json, key) {
301
+ const value = json[key];
302
+ return value !== null && value !== undefined;
303
+ }
304
+ function mapValues(data, fn) {
305
+ const result = {};
306
+ for (const key of Object.keys(data)) {
307
+ result[key] = fn(data[key]);
308
+ }
309
+ return result;
310
+ }
311
+ function canConsumeForm(consumes) {
312
+ for (const consume of consumes) {
313
+ if ('multipart/form-data' === consume.contentType) {
314
+ return true;
315
+ }
316
+ }
317
+ return false;
318
+ }
319
+ class JSONApiResponse {
320
+ constructor(raw, transformer = (jsonValue) => jsonValue) {
321
+ this.raw = raw;
322
+ this.transformer = transformer;
323
+ }
324
+ value() {
325
+ return __awaiter(this, void 0, void 0, function* () {
326
+ return this.transformer(yield this.raw.json());
327
+ });
328
+ }
329
+ }
330
+ exports.JSONApiResponse = JSONApiResponse;
331
+ class VoidApiResponse {
332
+ constructor(raw) {
333
+ this.raw = raw;
334
+ }
335
+ value() {
336
+ return __awaiter(this, void 0, void 0, function* () {
337
+ return undefined;
338
+ });
339
+ }
340
+ }
341
+ exports.VoidApiResponse = VoidApiResponse;
342
+ class BlobApiResponse {
343
+ constructor(raw) {
344
+ this.raw = raw;
345
+ }
346
+ value() {
347
+ return __awaiter(this, void 0, void 0, function* () {
348
+ return yield this.raw.blob();
349
+ });
350
+ }
351
+ ;
352
+ }
353
+ exports.BlobApiResponse = BlobApiResponse;
354
+ class TextApiResponse {
355
+ constructor(raw) {
356
+ this.raw = raw;
357
+ }
358
+ value() {
359
+ return __awaiter(this, void 0, void 0, function* () {
360
+ return yield this.raw.text();
361
+ });
362
+ }
363
+ ;
364
+ }
365
+ exports.TextApiResponse = TextApiResponse;
@@ -0,0 +1,227 @@
1
+ # AuthenticationApi
2
+
3
+ All URIs are relative to *https://api.pescheck.io*
4
+
5
+ | Method | HTTP request | Description |
6
+ |------------- | ------------- | -------------|
7
+ | [**generateJWTToken2**](AuthenticationApi.md#generatejwttoken2) | **POST** /api/v2/jwt/generate/ | |
8
+ | [**jwtCreate**](AuthenticationApi.md#jwtcreate) | **POST** /api/jwt/ | |
9
+ | [**jwtRefreshCreate**](AuthenticationApi.md#jwtrefreshcreate) | **POST** /api/jwt/refresh/ | |
10
+
11
+
12
+
13
+ ## generateJWTToken2
14
+
15
+ > JWTResponse generateJWTToken2(jWTGeneration)
16
+
17
+
18
+
19
+ 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/.
20
+
21
+ ### Example
22
+
23
+ ```ts
24
+ import {
25
+ Configuration,
26
+ AuthenticationApi,
27
+ } from '@pescheckit/pescheck-client';
28
+ import type { GenerateJWTToken2Request } from '@pescheckit/pescheck-client';
29
+
30
+ async function example() {
31
+ console.log("🚀 Testing @pescheckit/pescheck-client SDK...");
32
+ const config = new Configuration({
33
+ // To configure OAuth2 access token for authorization: oauth2 application
34
+ accessToken: "YOUR ACCESS TOKEN",
35
+ });
36
+ const api = new AuthenticationApi(config);
37
+
38
+ const body = {
39
+ // JWTGeneration
40
+ jWTGeneration: ...,
41
+ } satisfies GenerateJWTToken2Request;
42
+
43
+ try {
44
+ const data = await api.generateJWTToken2(body);
45
+ console.log(data);
46
+ } catch (error) {
47
+ console.error(error);
48
+ }
49
+ }
50
+
51
+ // Run the test
52
+ example().catch(console.error);
53
+ ```
54
+
55
+ ### Parameters
56
+
57
+
58
+ | Name | Type | Description | Notes |
59
+ |------------- | ------------- | ------------- | -------------|
60
+ | **jWTGeneration** | [JWTGeneration](JWTGeneration.md) | | |
61
+
62
+ ### Return type
63
+
64
+ [**JWTResponse**](JWTResponse.md)
65
+
66
+ ### Authorization
67
+
68
+ [oauth2 application](../README.md#oauth2-application)
69
+
70
+ ### HTTP request headers
71
+
72
+ - **Content-Type**: `application/json`, `multipart/form-data`
73
+ - **Accept**: `application/json`
74
+
75
+
76
+ ### HTTP response details
77
+ | Status code | Description | Response headers |
78
+ |-------------|-------------|------------------|
79
+ | **200** | | - |
80
+ | **400** | Bad Request | - |
81
+ | **401** | Unauthorized | - |
82
+ | **403** | Forbidden | - |
83
+
84
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
85
+
86
+
87
+ ## jwtCreate
88
+
89
+ > CustomTokenObtainPair jwtCreate(customTokenObtainPair)
90
+
91
+
92
+
93
+ 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/.
94
+
95
+ ### Example
96
+
97
+ ```ts
98
+ import {
99
+ Configuration,
100
+ AuthenticationApi,
101
+ } from '@pescheckit/pescheck-client';
102
+ import type { JwtCreateRequest } from '@pescheckit/pescheck-client';
103
+
104
+ async function example() {
105
+ console.log("🚀 Testing @pescheckit/pescheck-client SDK...");
106
+ const config = new Configuration({
107
+ // To configure OAuth2 access token for authorization: oauth2 application
108
+ accessToken: "YOUR ACCESS TOKEN",
109
+ });
110
+ const api = new AuthenticationApi(config);
111
+
112
+ const body = {
113
+ // CustomTokenObtainPair
114
+ customTokenObtainPair: ...,
115
+ } satisfies JwtCreateRequest;
116
+
117
+ try {
118
+ const data = await api.jwtCreate(body);
119
+ console.log(data);
120
+ } catch (error) {
121
+ console.error(error);
122
+ }
123
+ }
124
+
125
+ // Run the test
126
+ example().catch(console.error);
127
+ ```
128
+
129
+ ### Parameters
130
+
131
+
132
+ | Name | Type | Description | Notes |
133
+ |------------- | ------------- | ------------- | -------------|
134
+ | **customTokenObtainPair** | [CustomTokenObtainPair](CustomTokenObtainPair.md) | | |
135
+
136
+ ### Return type
137
+
138
+ [**CustomTokenObtainPair**](CustomTokenObtainPair.md)
139
+
140
+ ### Authorization
141
+
142
+ [oauth2 application](../README.md#oauth2-application)
143
+
144
+ ### HTTP request headers
145
+
146
+ - **Content-Type**: `application/json`, `multipart/form-data`
147
+ - **Accept**: `application/json`
148
+
149
+
150
+ ### HTTP response details
151
+ | Status code | Description | Response headers |
152
+ |-------------|-------------|------------------|
153
+ | **200** | | - |
154
+
155
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
156
+
157
+
158
+ ## jwtRefreshCreate
159
+
160
+ > TokenRefresh jwtRefreshCreate(tokenRefresh)
161
+
162
+
163
+
164
+ Takes a refresh type JSON web token and returns an access type JSON web token if the refresh token is valid.
165
+
166
+ ### Example
167
+
168
+ ```ts
169
+ import {
170
+ Configuration,
171
+ AuthenticationApi,
172
+ } from '@pescheckit/pescheck-client';
173
+ import type { JwtRefreshCreateRequest } from '@pescheckit/pescheck-client';
174
+
175
+ async function example() {
176
+ console.log("🚀 Testing @pescheckit/pescheck-client SDK...");
177
+ const config = new Configuration({
178
+ // To configure OAuth2 access token for authorization: oauth2 application
179
+ accessToken: "YOUR ACCESS TOKEN",
180
+ });
181
+ const api = new AuthenticationApi(config);
182
+
183
+ const body = {
184
+ // TokenRefresh
185
+ tokenRefresh: ...,
186
+ } satisfies JwtRefreshCreateRequest;
187
+
188
+ try {
189
+ const data = await api.jwtRefreshCreate(body);
190
+ console.log(data);
191
+ } catch (error) {
192
+ console.error(error);
193
+ }
194
+ }
195
+
196
+ // Run the test
197
+ example().catch(console.error);
198
+ ```
199
+
200
+ ### Parameters
201
+
202
+
203
+ | Name | Type | Description | Notes |
204
+ |------------- | ------------- | ------------- | -------------|
205
+ | **tokenRefresh** | [TokenRefresh](TokenRefresh.md) | | |
206
+
207
+ ### Return type
208
+
209
+ [**TokenRefresh**](TokenRefresh.md)
210
+
211
+ ### Authorization
212
+
213
+ [oauth2 application](../README.md#oauth2-application)
214
+
215
+ ### HTTP request headers
216
+
217
+ - **Content-Type**: `application/json`, `multipart/form-data`
218
+ - **Accept**: `application/json`
219
+
220
+
221
+ ### HTTP response details
222
+ | Status code | Description | Response headers |
223
+ |-------------|-------------|------------------|
224
+ | **200** | | - |
225
+
226
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
227
+