humanos 1.0.1

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 (89) hide show
  1. package/README.md +246 -0
  2. package/dist/index.d.mts +3898 -0
  3. package/dist/index.d.ts +3898 -0
  4. package/dist/index.js +1526 -0
  5. package/dist/index.mjs +1437 -0
  6. package/generated/.openapi-generator/FILES +82 -0
  7. package/generated/.openapi-generator/VERSION +1 -0
  8. package/generated/.openapi-generator-ignore +23 -0
  9. package/generated/README.md +46 -0
  10. package/generated/api/credentials-api.ts +148 -0
  11. package/generated/api/requests-api.ts +577 -0
  12. package/generated/api/resource-api.ts +318 -0
  13. package/generated/api/user-api.ts +241 -0
  14. package/generated/api/webhooks-api.ts +352 -0
  15. package/generated/api.ts +21 -0
  16. package/generated/base.ts +86 -0
  17. package/generated/common.ts +150 -0
  18. package/generated/configuration.ts +110 -0
  19. package/generated/git_push.sh +57 -0
  20. package/generated/index.ts +18 -0
  21. package/generated/models/action-type.ts +33 -0
  22. package/generated/models/agent-detail-entity.ts +36 -0
  23. package/generated/models/cancel-request404-response.ts +42 -0
  24. package/generated/models/create-subject-dto.ts +45 -0
  25. package/generated/models/create-subject-entity.ts +59 -0
  26. package/generated/models/credential-dto.ts +57 -0
  27. package/generated/models/credential-entity.ts +64 -0
  28. package/generated/models/credential-event-user.ts +42 -0
  29. package/generated/models/credential-event.ts +94 -0
  30. package/generated/models/credential-full-entity.ts +82 -0
  31. package/generated/models/credential-status.ts +33 -0
  32. package/generated/models/credential-subject.ts +39 -0
  33. package/generated/models/delivery-action-type.ts +31 -0
  34. package/generated/models/generate-credential-entity.ts +42 -0
  35. package/generated/models/generate-request-dto.ts +106 -0
  36. package/generated/models/generate-request-entity.ts +48 -0
  37. package/generated/models/generate-subject-entity.ts +48 -0
  38. package/generated/models/generate400-response.ts +42 -0
  39. package/generated/models/get-credential-entity.ts +48 -0
  40. package/generated/models/get-credential404-response.ts +42 -0
  41. package/generated/models/get-request-detail404-response.ts +42 -0
  42. package/generated/models/get-subject400-response.ts +42 -0
  43. package/generated/models/get-subject404-response.ts +42 -0
  44. package/generated/models/group-entity.ts +63 -0
  45. package/generated/models/group-resource-entity.ts +64 -0
  46. package/generated/models/groups-entity.ts +39 -0
  47. package/generated/models/identity-dto.ts +132 -0
  48. package/generated/models/identity-event-decision.ts +48 -0
  49. package/generated/models/identity-event-identity.ts +84 -0
  50. package/generated/models/identity-event.ts +94 -0
  51. package/generated/models/identity-field-placement.ts +73 -0
  52. package/generated/models/identity-field-type.ts +38 -0
  53. package/generated/models/index.ts +64 -0
  54. package/generated/models/issuer-detail-entity.ts +36 -0
  55. package/generated/models/mandate-data-dto-type.ts +73 -0
  56. package/generated/models/mandate-data-dto-value.ts +24 -0
  57. package/generated/models/mandate-data-dto.ts +71 -0
  58. package/generated/models/mandate-data-type.ts +37 -0
  59. package/generated/models/otp-failed-event-otp-error.ts +36 -0
  60. package/generated/models/otp-failed-event-otp.ts +39 -0
  61. package/generated/models/otp-failed-event.ts +85 -0
  62. package/generated/models/request-detail-entity.ts +94 -0
  63. package/generated/models/request-entity.ts +94 -0
  64. package/generated/models/request-query.ts +100 -0
  65. package/generated/models/request-subject-entity.ts +48 -0
  66. package/generated/models/requests-entity.ts +39 -0
  67. package/generated/models/resource-entity.ts +94 -0
  68. package/generated/models/resource-query.ts +70 -0
  69. package/generated/models/resources-entity.ts +39 -0
  70. package/generated/models/signature-placement-item-dto.ts +72 -0
  71. package/generated/models/signature-placement.ts +56 -0
  72. package/generated/models/subject-contact-entity.ts +42 -0
  73. package/generated/models/subject-entity.ts +48 -0
  74. package/generated/models/subject-query.ts +42 -0
  75. package/generated/models/subject.ts +42 -0
  76. package/generated/models/success-entity.ts +30 -0
  77. package/generated/models/test-event.ts +82 -0
  78. package/generated/models/w3-cproof.ts +82 -0
  79. package/generated/models/w3-cverifiable-credential.ts +90 -0
  80. package/generated/models/webhook-call-event.ts +56 -0
  81. package/generated/models/webhook-event-type-credential.ts +30 -0
  82. package/generated/models/webhook-event-type-identity.ts +30 -0
  83. package/generated/models/webhook-event-type-otpfailed.ts +30 -0
  84. package/generated/models/webhook-event-type-test.ts +30 -0
  85. package/generated/models/webhook-event-type.ts +33 -0
  86. package/generated/package.json +33 -0
  87. package/generated/tsconfig.esm.json +7 -0
  88. package/generated/tsconfig.json +18 -0
  89. package/package.json +68 -0
@@ -0,0 +1,352 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Humanos API
5
+ * Humanos API
6
+ *
7
+ * The version of the OpenAPI document: 1.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
+
16
+ import type { Configuration } from '../configuration';
17
+ import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
18
+ import globalAxios from 'axios';
19
+ // Some imports not used depending on template conditions
20
+ // @ts-ignore
21
+ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
22
+ // @ts-ignore
23
+ import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
24
+ // @ts-ignore
25
+ import type { CredentialEvent } from '../models';
26
+ // @ts-ignore
27
+ import type { IdentityEvent } from '../models';
28
+ // @ts-ignore
29
+ import type { OtpFailedEvent } from '../models';
30
+ // @ts-ignore
31
+ import type { TestEvent } from '../models';
32
+ /**
33
+ * WebhooksApi - axios parameter creator
34
+ * @export
35
+ */
36
+ export const WebhooksApiAxiosParamCreator = function (configuration?: Configuration) {
37
+ return {
38
+ /**
39
+ * Fired when a credential request is accepted or rejected by the subject.
40
+ * @summary Credential Event
41
+ * @param {CredentialEvent} credentialEvent
42
+ * @param {*} [options] Override http request option.
43
+ * @throws {RequiredError}
44
+ */
45
+ webhookCredential: async (credentialEvent: CredentialEvent, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
46
+ // verify required parameter 'credentialEvent' is not null or undefined
47
+ assertParamExists('webhookCredential', 'credentialEvent', credentialEvent)
48
+ const localVarPath = `/credential`;
49
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
50
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
51
+ let baseOptions;
52
+ if (configuration) {
53
+ baseOptions = configuration.baseOptions;
54
+ }
55
+
56
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
57
+ const localVarHeaderParameter = {} as any;
58
+ const localVarQueryParameter = {} as any;
59
+
60
+
61
+
62
+ localVarHeaderParameter['Content-Type'] = 'application/json';
63
+
64
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
65
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
66
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
67
+ localVarRequestOptions.data = serializeDataIfNeeded(credentialEvent, localVarRequestOptions, configuration)
68
+
69
+ return {
70
+ url: toPathString(localVarUrlObj),
71
+ options: localVarRequestOptions,
72
+ };
73
+ },
74
+ /**
75
+ * Fired when an identity verification (KYC) decision is reached.
76
+ * @summary Identity Event
77
+ * @param {IdentityEvent} identityEvent
78
+ * @param {*} [options] Override http request option.
79
+ * @throws {RequiredError}
80
+ */
81
+ webhookIdentity: async (identityEvent: IdentityEvent, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
82
+ // verify required parameter 'identityEvent' is not null or undefined
83
+ assertParamExists('webhookIdentity', 'identityEvent', identityEvent)
84
+ const localVarPath = `/identity`;
85
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
86
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
87
+ let baseOptions;
88
+ if (configuration) {
89
+ baseOptions = configuration.baseOptions;
90
+ }
91
+
92
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
93
+ const localVarHeaderParameter = {} as any;
94
+ const localVarQueryParameter = {} as any;
95
+
96
+
97
+
98
+ localVarHeaderParameter['Content-Type'] = 'application/json';
99
+
100
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
101
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
102
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
103
+ localVarRequestOptions.data = serializeDataIfNeeded(identityEvent, localVarRequestOptions, configuration)
104
+
105
+ return {
106
+ url: toPathString(localVarUrlObj),
107
+ options: localVarRequestOptions,
108
+ };
109
+ },
110
+ /**
111
+ * Fired when an OTP delivery to the subject fails.
112
+ * @summary OTP Failed Event
113
+ * @param {OtpFailedEvent} otpFailedEvent
114
+ * @param {*} [options] Override http request option.
115
+ * @throws {RequiredError}
116
+ */
117
+ webhookOtpFailed: async (otpFailedEvent: OtpFailedEvent, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
118
+ // verify required parameter 'otpFailedEvent' is not null or undefined
119
+ assertParamExists('webhookOtpFailed', 'otpFailedEvent', otpFailedEvent)
120
+ const localVarPath = `/otp.failed`;
121
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
122
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
123
+ let baseOptions;
124
+ if (configuration) {
125
+ baseOptions = configuration.baseOptions;
126
+ }
127
+
128
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
129
+ const localVarHeaderParameter = {} as any;
130
+ const localVarQueryParameter = {} as any;
131
+
132
+
133
+
134
+ localVarHeaderParameter['Content-Type'] = 'application/json';
135
+
136
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
137
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
138
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
139
+ localVarRequestOptions.data = serializeDataIfNeeded(otpFailedEvent, localVarRequestOptions, configuration)
140
+
141
+ return {
142
+ url: toPathString(localVarUrlObj),
143
+ options: localVarRequestOptions,
144
+ };
145
+ },
146
+ /**
147
+ * Fired when a webhook test is triggered from the dashboard.
148
+ * @summary Test Event
149
+ * @param {TestEvent} testEvent
150
+ * @param {*} [options] Override http request option.
151
+ * @throws {RequiredError}
152
+ */
153
+ webhookTest: async (testEvent: TestEvent, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
154
+ // verify required parameter 'testEvent' is not null or undefined
155
+ assertParamExists('webhookTest', 'testEvent', testEvent)
156
+ const localVarPath = `/test`;
157
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
158
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
159
+ let baseOptions;
160
+ if (configuration) {
161
+ baseOptions = configuration.baseOptions;
162
+ }
163
+
164
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
165
+ const localVarHeaderParameter = {} as any;
166
+ const localVarQueryParameter = {} as any;
167
+
168
+
169
+
170
+ localVarHeaderParameter['Content-Type'] = 'application/json';
171
+
172
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
173
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
174
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
175
+ localVarRequestOptions.data = serializeDataIfNeeded(testEvent, localVarRequestOptions, configuration)
176
+
177
+ return {
178
+ url: toPathString(localVarUrlObj),
179
+ options: localVarRequestOptions,
180
+ };
181
+ },
182
+ }
183
+ };
184
+
185
+ /**
186
+ * WebhooksApi - functional programming interface
187
+ * @export
188
+ */
189
+ export const WebhooksApiFp = function(configuration?: Configuration) {
190
+ const localVarAxiosParamCreator = WebhooksApiAxiosParamCreator(configuration)
191
+ return {
192
+ /**
193
+ * Fired when a credential request is accepted or rejected by the subject.
194
+ * @summary Credential Event
195
+ * @param {CredentialEvent} credentialEvent
196
+ * @param {*} [options] Override http request option.
197
+ * @throws {RequiredError}
198
+ */
199
+ async webhookCredential(credentialEvent: CredentialEvent, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
200
+ const localVarAxiosArgs = await localVarAxiosParamCreator.webhookCredential(credentialEvent, options);
201
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
202
+ const localVarOperationServerBasePath = operationServerMap['WebhooksApi.webhookCredential']?.[localVarOperationServerIndex]?.url;
203
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
204
+ },
205
+ /**
206
+ * Fired when an identity verification (KYC) decision is reached.
207
+ * @summary Identity Event
208
+ * @param {IdentityEvent} identityEvent
209
+ * @param {*} [options] Override http request option.
210
+ * @throws {RequiredError}
211
+ */
212
+ async webhookIdentity(identityEvent: IdentityEvent, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
213
+ const localVarAxiosArgs = await localVarAxiosParamCreator.webhookIdentity(identityEvent, options);
214
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
215
+ const localVarOperationServerBasePath = operationServerMap['WebhooksApi.webhookIdentity']?.[localVarOperationServerIndex]?.url;
216
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
217
+ },
218
+ /**
219
+ * Fired when an OTP delivery to the subject fails.
220
+ * @summary OTP Failed Event
221
+ * @param {OtpFailedEvent} otpFailedEvent
222
+ * @param {*} [options] Override http request option.
223
+ * @throws {RequiredError}
224
+ */
225
+ async webhookOtpFailed(otpFailedEvent: OtpFailedEvent, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
226
+ const localVarAxiosArgs = await localVarAxiosParamCreator.webhookOtpFailed(otpFailedEvent, options);
227
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
228
+ const localVarOperationServerBasePath = operationServerMap['WebhooksApi.webhookOtpFailed']?.[localVarOperationServerIndex]?.url;
229
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
230
+ },
231
+ /**
232
+ * Fired when a webhook test is triggered from the dashboard.
233
+ * @summary Test Event
234
+ * @param {TestEvent} testEvent
235
+ * @param {*} [options] Override http request option.
236
+ * @throws {RequiredError}
237
+ */
238
+ async webhookTest(testEvent: TestEvent, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
239
+ const localVarAxiosArgs = await localVarAxiosParamCreator.webhookTest(testEvent, options);
240
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
241
+ const localVarOperationServerBasePath = operationServerMap['WebhooksApi.webhookTest']?.[localVarOperationServerIndex]?.url;
242
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
243
+ },
244
+ }
245
+ };
246
+
247
+ /**
248
+ * WebhooksApi - factory interface
249
+ * @export
250
+ */
251
+ export const WebhooksApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
252
+ const localVarFp = WebhooksApiFp(configuration)
253
+ return {
254
+ /**
255
+ * Fired when a credential request is accepted or rejected by the subject.
256
+ * @summary Credential Event
257
+ * @param {CredentialEvent} credentialEvent
258
+ * @param {*} [options] Override http request option.
259
+ * @throws {RequiredError}
260
+ */
261
+ webhookCredential(credentialEvent: CredentialEvent, options?: RawAxiosRequestConfig): AxiosPromise<void> {
262
+ return localVarFp.webhookCredential(credentialEvent, options).then((request) => request(axios, basePath));
263
+ },
264
+ /**
265
+ * Fired when an identity verification (KYC) decision is reached.
266
+ * @summary Identity Event
267
+ * @param {IdentityEvent} identityEvent
268
+ * @param {*} [options] Override http request option.
269
+ * @throws {RequiredError}
270
+ */
271
+ webhookIdentity(identityEvent: IdentityEvent, options?: RawAxiosRequestConfig): AxiosPromise<void> {
272
+ return localVarFp.webhookIdentity(identityEvent, options).then((request) => request(axios, basePath));
273
+ },
274
+ /**
275
+ * Fired when an OTP delivery to the subject fails.
276
+ * @summary OTP Failed Event
277
+ * @param {OtpFailedEvent} otpFailedEvent
278
+ * @param {*} [options] Override http request option.
279
+ * @throws {RequiredError}
280
+ */
281
+ webhookOtpFailed(otpFailedEvent: OtpFailedEvent, options?: RawAxiosRequestConfig): AxiosPromise<void> {
282
+ return localVarFp.webhookOtpFailed(otpFailedEvent, options).then((request) => request(axios, basePath));
283
+ },
284
+ /**
285
+ * Fired when a webhook test is triggered from the dashboard.
286
+ * @summary Test Event
287
+ * @param {TestEvent} testEvent
288
+ * @param {*} [options] Override http request option.
289
+ * @throws {RequiredError}
290
+ */
291
+ webhookTest(testEvent: TestEvent, options?: RawAxiosRequestConfig): AxiosPromise<void> {
292
+ return localVarFp.webhookTest(testEvent, options).then((request) => request(axios, basePath));
293
+ },
294
+ };
295
+ };
296
+
297
+ /**
298
+ * WebhooksApi - object-oriented interface
299
+ * @export
300
+ * @class WebhooksApi
301
+ * @extends {BaseAPI}
302
+ */
303
+ export class WebhooksApi extends BaseAPI {
304
+ /**
305
+ * Fired when a credential request is accepted or rejected by the subject.
306
+ * @summary Credential Event
307
+ * @param {CredentialEvent} credentialEvent
308
+ * @param {*} [options] Override http request option.
309
+ * @throws {RequiredError}
310
+ * @memberof WebhooksApi
311
+ */
312
+ public webhookCredential(credentialEvent: CredentialEvent, options?: RawAxiosRequestConfig) {
313
+ return WebhooksApiFp(this.configuration).webhookCredential(credentialEvent, options).then((request) => request(this.axios, this.basePath));
314
+ }
315
+
316
+ /**
317
+ * Fired when an identity verification (KYC) decision is reached.
318
+ * @summary Identity Event
319
+ * @param {IdentityEvent} identityEvent
320
+ * @param {*} [options] Override http request option.
321
+ * @throws {RequiredError}
322
+ * @memberof WebhooksApi
323
+ */
324
+ public webhookIdentity(identityEvent: IdentityEvent, options?: RawAxiosRequestConfig) {
325
+ return WebhooksApiFp(this.configuration).webhookIdentity(identityEvent, options).then((request) => request(this.axios, this.basePath));
326
+ }
327
+
328
+ /**
329
+ * Fired when an OTP delivery to the subject fails.
330
+ * @summary OTP Failed Event
331
+ * @param {OtpFailedEvent} otpFailedEvent
332
+ * @param {*} [options] Override http request option.
333
+ * @throws {RequiredError}
334
+ * @memberof WebhooksApi
335
+ */
336
+ public webhookOtpFailed(otpFailedEvent: OtpFailedEvent, options?: RawAxiosRequestConfig) {
337
+ return WebhooksApiFp(this.configuration).webhookOtpFailed(otpFailedEvent, options).then((request) => request(this.axios, this.basePath));
338
+ }
339
+
340
+ /**
341
+ * Fired when a webhook test is triggered from the dashboard.
342
+ * @summary Test Event
343
+ * @param {TestEvent} testEvent
344
+ * @param {*} [options] Override http request option.
345
+ * @throws {RequiredError}
346
+ * @memberof WebhooksApi
347
+ */
348
+ public webhookTest(testEvent: TestEvent, options?: RawAxiosRequestConfig) {
349
+ return WebhooksApiFp(this.configuration).webhookTest(testEvent, options).then((request) => request(this.axios, this.basePath));
350
+ }
351
+ }
352
+
@@ -0,0 +1,21 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Humanos API
5
+ * Humanos API
6
+ *
7
+ * The version of the OpenAPI document: 1.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
+
16
+
17
+ export * from './api/credentials-api';
18
+ export * from './api/requests-api';
19
+ export * from './api/resource-api';
20
+ export * from './api/user-api';
21
+
@@ -0,0 +1,86 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Humanos API
5
+ * Humanos API
6
+ *
7
+ * The version of the OpenAPI document: 1.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
+
16
+ import type { Configuration } from './configuration';
17
+ // Some imports not used depending on template conditions
18
+ // @ts-ignore
19
+ import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
20
+ import globalAxios from 'axios';
21
+
22
+ export const BASE_PATH = "http://localhost".replace(/\/+$/, "");
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ */
28
+ export const COLLECTION_FORMATS = {
29
+ csv: ",",
30
+ ssv: " ",
31
+ tsv: "\t",
32
+ pipes: "|",
33
+ };
34
+
35
+ /**
36
+ *
37
+ * @export
38
+ * @interface RequestArgs
39
+ */
40
+ export interface RequestArgs {
41
+ url: string;
42
+ options: RawAxiosRequestConfig;
43
+ }
44
+
45
+ /**
46
+ *
47
+ * @export
48
+ * @class BaseAPI
49
+ */
50
+ export class BaseAPI {
51
+ protected configuration: Configuration | undefined;
52
+
53
+ constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
54
+ if (configuration) {
55
+ this.configuration = configuration;
56
+ this.basePath = configuration.basePath ?? basePath;
57
+ }
58
+ }
59
+ };
60
+
61
+ /**
62
+ *
63
+ * @export
64
+ * @class RequiredError
65
+ * @extends {Error}
66
+ */
67
+ export class RequiredError extends Error {
68
+ constructor(public field: string, msg?: string) {
69
+ super(msg);
70
+ this.name = "RequiredError"
71
+ }
72
+ }
73
+
74
+ interface ServerMap {
75
+ [key: string]: {
76
+ url: string,
77
+ description: string,
78
+ }[];
79
+ }
80
+
81
+ /**
82
+ *
83
+ * @export
84
+ */
85
+ export const operationServerMap: ServerMap = {
86
+ }
@@ -0,0 +1,150 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Humanos API
5
+ * Humanos API
6
+ *
7
+ * The version of the OpenAPI document: 1.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
+
16
+ import type { Configuration } from "./configuration";
17
+ import type { RequestArgs } from "./base";
18
+ import type { AxiosInstance, AxiosResponse } from 'axios';
19
+ import { RequiredError } from "./base";
20
+
21
+ /**
22
+ *
23
+ * @export
24
+ */
25
+ export const DUMMY_BASE_URL = 'https://example.com'
26
+
27
+ /**
28
+ *
29
+ * @throws {RequiredError}
30
+ * @export
31
+ */
32
+ export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) {
33
+ if (paramValue === null || paramValue === undefined) {
34
+ throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
35
+ }
36
+ }
37
+
38
+ /**
39
+ *
40
+ * @export
41
+ */
42
+ export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) {
43
+ if (configuration && configuration.apiKey) {
44
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
45
+ ? await configuration.apiKey(keyParamName)
46
+ : await configuration.apiKey;
47
+ object[keyParamName] = localVarApiKeyValue;
48
+ }
49
+ }
50
+
51
+ /**
52
+ *
53
+ * @export
54
+ */
55
+ export const setBasicAuthToObject = function (object: any, configuration?: Configuration) {
56
+ if (configuration && (configuration.username || configuration.password)) {
57
+ object["auth"] = { username: configuration.username, password: configuration.password };
58
+ }
59
+ }
60
+
61
+ /**
62
+ *
63
+ * @export
64
+ */
65
+ export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) {
66
+ if (configuration && configuration.accessToken) {
67
+ const accessToken = typeof configuration.accessToken === 'function'
68
+ ? await configuration.accessToken()
69
+ : await configuration.accessToken;
70
+ object["Authorization"] = "Bearer " + accessToken;
71
+ }
72
+ }
73
+
74
+ /**
75
+ *
76
+ * @export
77
+ */
78
+ export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) {
79
+ if (configuration && configuration.accessToken) {
80
+ const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
81
+ ? await configuration.accessToken(name, scopes)
82
+ : await configuration.accessToken;
83
+ object["Authorization"] = "Bearer " + localVarAccessTokenValue;
84
+ }
85
+ }
86
+
87
+ function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void {
88
+ if (parameter == null) return;
89
+ if (typeof parameter === "object") {
90
+ if (Array.isArray(parameter)) {
91
+ (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
92
+ }
93
+ else {
94
+ Object.keys(parameter).forEach(currentKey =>
95
+ setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`)
96
+ );
97
+ }
98
+ }
99
+ else {
100
+ if (urlSearchParams.has(key)) {
101
+ urlSearchParams.append(key, parameter);
102
+ }
103
+ else {
104
+ urlSearchParams.set(key, parameter);
105
+ }
106
+ }
107
+ }
108
+
109
+ /**
110
+ *
111
+ * @export
112
+ */
113
+ export const setSearchParams = function (url: URL, ...objects: any[]) {
114
+ const searchParams = new URLSearchParams(url.search);
115
+ setFlattenedQueryParams(searchParams, objects);
116
+ url.search = searchParams.toString();
117
+ }
118
+
119
+ /**
120
+ *
121
+ * @export
122
+ */
123
+ export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) {
124
+ const nonString = typeof value !== 'string';
125
+ const needsSerialization = nonString && configuration && configuration.isJsonMime
126
+ ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
127
+ : nonString;
128
+ return needsSerialization
129
+ ? JSON.stringify(value !== undefined ? value : {})
130
+ : (value || "");
131
+ }
132
+
133
+ /**
134
+ *
135
+ * @export
136
+ */
137
+ export const toPathString = function (url: URL) {
138
+ return url.pathname + url.search + url.hash
139
+ }
140
+
141
+ /**
142
+ *
143
+ * @export
144
+ */
145
+ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
146
+ return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
147
+ const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url};
148
+ return axios.request<T, R>(axiosRequestArgs);
149
+ };
150
+ }