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,318 @@
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 { GroupsEntity } from '../models';
26
+ // @ts-ignore
27
+ import type { ResourcesEntity } from '../models';
28
+ /**
29
+ * ResourceApi - axios parameter creator
30
+ * @export
31
+ */
32
+ export const ResourceApiAxiosParamCreator = function (configuration?: Configuration) {
33
+ return {
34
+ /**
35
+ * Retrieve information about the existing groups, including its resources, and the total number of pages. Resource groups allow to pack resources together and easily request them.
36
+ * @summary Get Groups
37
+ * @param {number} [pageIndex] Page number
38
+ * @param {number} [pageSize] Number of items per page
39
+ * @param {string} [search] Search query to filter by. Is case-insensitive and does not need to match the entire value.
40
+ * @param {boolean} [active] Filter by active status. Accepts true/false as string or boolean.
41
+ * @param {Array<GetGroupsTypesEnum>} [types] Filter by resource types. Can be a single value or array
42
+ * @param {string} [internalId] Identifier to help you identify the resource in your own system. We recommend using a unique value.
43
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
44
+ * @param {*} [options] Override http request option.
45
+ * @throws {RequiredError}
46
+ */
47
+ getGroups: async (pageIndex?: number, pageSize?: number, search?: string, active?: boolean, types?: Array<GetGroupsTypesEnum>, internalId?: string, aPIVersion?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
48
+ const localVarPath = `/resource/group`;
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: 'GET', ...baseOptions, ...options};
57
+ const localVarHeaderParameter = {} as any;
58
+ const localVarQueryParameter = {} as any;
59
+
60
+ if (pageIndex !== undefined) {
61
+ localVarQueryParameter['pageIndex'] = pageIndex;
62
+ }
63
+
64
+ if (pageSize !== undefined) {
65
+ localVarQueryParameter['pageSize'] = pageSize;
66
+ }
67
+
68
+ if (search !== undefined) {
69
+ localVarQueryParameter['search'] = search;
70
+ }
71
+
72
+ if (active !== undefined) {
73
+ localVarQueryParameter['active'] = active;
74
+ }
75
+
76
+ if (types) {
77
+ localVarQueryParameter['types'] = types;
78
+ }
79
+
80
+ if (internalId !== undefined) {
81
+ localVarQueryParameter['internalId'] = internalId;
82
+ }
83
+
84
+
85
+
86
+ if (aPIVersion != null) {
87
+ localVarHeaderParameter['API-Version'] = String(aPIVersion);
88
+ }
89
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
90
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
91
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
92
+
93
+ return {
94
+ url: toPathString(localVarUrlObj),
95
+ options: localVarRequestOptions,
96
+ };
97
+ },
98
+ /**
99
+ * Retrieve a paginated list of resources for your organization. Resources can be documents, consents, forms.
100
+ * @summary Get Resources
101
+ * @param {number} [pageIndex] Page number
102
+ * @param {number} [pageSize] Number of items per page
103
+ * @param {string} [search] Search query to filter by. Is case-insensitive and does not need to match the entire value.
104
+ * @param {boolean} [active] Filter by active status. Accepts true/false as string or boolean.
105
+ * @param {Array<GetResourcesTypesEnum>} [types] Filter by resource types. Can be a single value or array
106
+ * @param {string} [internalId] Identifier to help you identify the resource in your own system. We recommend using a unique value.
107
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
108
+ * @param {*} [options] Override http request option.
109
+ * @throws {RequiredError}
110
+ */
111
+ getResources: async (pageIndex?: number, pageSize?: number, search?: string, active?: boolean, types?: Array<GetResourcesTypesEnum>, internalId?: string, aPIVersion?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
112
+ const localVarPath = `/resource`;
113
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
114
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
115
+ let baseOptions;
116
+ if (configuration) {
117
+ baseOptions = configuration.baseOptions;
118
+ }
119
+
120
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
121
+ const localVarHeaderParameter = {} as any;
122
+ const localVarQueryParameter = {} as any;
123
+
124
+ if (pageIndex !== undefined) {
125
+ localVarQueryParameter['pageIndex'] = pageIndex;
126
+ }
127
+
128
+ if (pageSize !== undefined) {
129
+ localVarQueryParameter['pageSize'] = pageSize;
130
+ }
131
+
132
+ if (search !== undefined) {
133
+ localVarQueryParameter['search'] = search;
134
+ }
135
+
136
+ if (active !== undefined) {
137
+ localVarQueryParameter['active'] = active;
138
+ }
139
+
140
+ if (types) {
141
+ localVarQueryParameter['types'] = types;
142
+ }
143
+
144
+ if (internalId !== undefined) {
145
+ localVarQueryParameter['internalId'] = internalId;
146
+ }
147
+
148
+
149
+
150
+ if (aPIVersion != null) {
151
+ localVarHeaderParameter['API-Version'] = String(aPIVersion);
152
+ }
153
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
154
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
155
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
156
+
157
+ return {
158
+ url: toPathString(localVarUrlObj),
159
+ options: localVarRequestOptions,
160
+ };
161
+ },
162
+ }
163
+ };
164
+
165
+ /**
166
+ * ResourceApi - functional programming interface
167
+ * @export
168
+ */
169
+ export const ResourceApiFp = function(configuration?: Configuration) {
170
+ const localVarAxiosParamCreator = ResourceApiAxiosParamCreator(configuration)
171
+ return {
172
+ /**
173
+ * Retrieve information about the existing groups, including its resources, and the total number of pages. Resource groups allow to pack resources together and easily request them.
174
+ * @summary Get Groups
175
+ * @param {number} [pageIndex] Page number
176
+ * @param {number} [pageSize] Number of items per page
177
+ * @param {string} [search] Search query to filter by. Is case-insensitive and does not need to match the entire value.
178
+ * @param {boolean} [active] Filter by active status. Accepts true/false as string or boolean.
179
+ * @param {Array<GetGroupsTypesEnum>} [types] Filter by resource types. Can be a single value or array
180
+ * @param {string} [internalId] Identifier to help you identify the resource in your own system. We recommend using a unique value.
181
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
182
+ * @param {*} [options] Override http request option.
183
+ * @throws {RequiredError}
184
+ */
185
+ async getGroups(pageIndex?: number, pageSize?: number, search?: string, active?: boolean, types?: Array<GetGroupsTypesEnum>, internalId?: string, aPIVersion?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GroupsEntity>> {
186
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getGroups(pageIndex, pageSize, search, active, types, internalId, aPIVersion, options);
187
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
188
+ const localVarOperationServerBasePath = operationServerMap['ResourceApi.getGroups']?.[localVarOperationServerIndex]?.url;
189
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
190
+ },
191
+ /**
192
+ * Retrieve a paginated list of resources for your organization. Resources can be documents, consents, forms.
193
+ * @summary Get Resources
194
+ * @param {number} [pageIndex] Page number
195
+ * @param {number} [pageSize] Number of items per page
196
+ * @param {string} [search] Search query to filter by. Is case-insensitive and does not need to match the entire value.
197
+ * @param {boolean} [active] Filter by active status. Accepts true/false as string or boolean.
198
+ * @param {Array<GetResourcesTypesEnum>} [types] Filter by resource types. Can be a single value or array
199
+ * @param {string} [internalId] Identifier to help you identify the resource in your own system. We recommend using a unique value.
200
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
201
+ * @param {*} [options] Override http request option.
202
+ * @throws {RequiredError}
203
+ */
204
+ async getResources(pageIndex?: number, pageSize?: number, search?: string, active?: boolean, types?: Array<GetResourcesTypesEnum>, internalId?: string, aPIVersion?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ResourcesEntity>> {
205
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getResources(pageIndex, pageSize, search, active, types, internalId, aPIVersion, options);
206
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
207
+ const localVarOperationServerBasePath = operationServerMap['ResourceApi.getResources']?.[localVarOperationServerIndex]?.url;
208
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
209
+ },
210
+ }
211
+ };
212
+
213
+ /**
214
+ * ResourceApi - factory interface
215
+ * @export
216
+ */
217
+ export const ResourceApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
218
+ const localVarFp = ResourceApiFp(configuration)
219
+ return {
220
+ /**
221
+ * Retrieve information about the existing groups, including its resources, and the total number of pages. Resource groups allow to pack resources together and easily request them.
222
+ * @summary Get Groups
223
+ * @param {number} [pageIndex] Page number
224
+ * @param {number} [pageSize] Number of items per page
225
+ * @param {string} [search] Search query to filter by. Is case-insensitive and does not need to match the entire value.
226
+ * @param {boolean} [active] Filter by active status. Accepts true/false as string or boolean.
227
+ * @param {Array<GetGroupsTypesEnum>} [types] Filter by resource types. Can be a single value or array
228
+ * @param {string} [internalId] Identifier to help you identify the resource in your own system. We recommend using a unique value.
229
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
230
+ * @param {*} [options] Override http request option.
231
+ * @throws {RequiredError}
232
+ */
233
+ getGroups(pageIndex?: number, pageSize?: number, search?: string, active?: boolean, types?: Array<GetGroupsTypesEnum>, internalId?: string, aPIVersion?: string, options?: RawAxiosRequestConfig): AxiosPromise<GroupsEntity> {
234
+ return localVarFp.getGroups(pageIndex, pageSize, search, active, types, internalId, aPIVersion, options).then((request) => request(axios, basePath));
235
+ },
236
+ /**
237
+ * Retrieve a paginated list of resources for your organization. Resources can be documents, consents, forms.
238
+ * @summary Get Resources
239
+ * @param {number} [pageIndex] Page number
240
+ * @param {number} [pageSize] Number of items per page
241
+ * @param {string} [search] Search query to filter by. Is case-insensitive and does not need to match the entire value.
242
+ * @param {boolean} [active] Filter by active status. Accepts true/false as string or boolean.
243
+ * @param {Array<GetResourcesTypesEnum>} [types] Filter by resource types. Can be a single value or array
244
+ * @param {string} [internalId] Identifier to help you identify the resource in your own system. We recommend using a unique value.
245
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
246
+ * @param {*} [options] Override http request option.
247
+ * @throws {RequiredError}
248
+ */
249
+ getResources(pageIndex?: number, pageSize?: number, search?: string, active?: boolean, types?: Array<GetResourcesTypesEnum>, internalId?: string, aPIVersion?: string, options?: RawAxiosRequestConfig): AxiosPromise<ResourcesEntity> {
250
+ return localVarFp.getResources(pageIndex, pageSize, search, active, types, internalId, aPIVersion, options).then((request) => request(axios, basePath));
251
+ },
252
+ };
253
+ };
254
+
255
+ /**
256
+ * ResourceApi - object-oriented interface
257
+ * @export
258
+ * @class ResourceApi
259
+ * @extends {BaseAPI}
260
+ */
261
+ export class ResourceApi extends BaseAPI {
262
+ /**
263
+ * Retrieve information about the existing groups, including its resources, and the total number of pages. Resource groups allow to pack resources together and easily request them.
264
+ * @summary Get Groups
265
+ * @param {number} [pageIndex] Page number
266
+ * @param {number} [pageSize] Number of items per page
267
+ * @param {string} [search] Search query to filter by. Is case-insensitive and does not need to match the entire value.
268
+ * @param {boolean} [active] Filter by active status. Accepts true/false as string or boolean.
269
+ * @param {Array<GetGroupsTypesEnum>} [types] Filter by resource types. Can be a single value or array
270
+ * @param {string} [internalId] Identifier to help you identify the resource in your own system. We recommend using a unique value.
271
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
272
+ * @param {*} [options] Override http request option.
273
+ * @throws {RequiredError}
274
+ * @memberof ResourceApi
275
+ */
276
+ public getGroups(pageIndex?: number, pageSize?: number, search?: string, active?: boolean, types?: Array<GetGroupsTypesEnum>, internalId?: string, aPIVersion?: string, options?: RawAxiosRequestConfig) {
277
+ return ResourceApiFp(this.configuration).getGroups(pageIndex, pageSize, search, active, types, internalId, aPIVersion, options).then((request) => request(this.axios, this.basePath));
278
+ }
279
+
280
+ /**
281
+ * Retrieve a paginated list of resources for your organization. Resources can be documents, consents, forms.
282
+ * @summary Get Resources
283
+ * @param {number} [pageIndex] Page number
284
+ * @param {number} [pageSize] Number of items per page
285
+ * @param {string} [search] Search query to filter by. Is case-insensitive and does not need to match the entire value.
286
+ * @param {boolean} [active] Filter by active status. Accepts true/false as string or boolean.
287
+ * @param {Array<GetResourcesTypesEnum>} [types] Filter by resource types. Can be a single value or array
288
+ * @param {string} [internalId] Identifier to help you identify the resource in your own system. We recommend using a unique value.
289
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
290
+ * @param {*} [options] Override http request option.
291
+ * @throws {RequiredError}
292
+ * @memberof ResourceApi
293
+ */
294
+ public getResources(pageIndex?: number, pageSize?: number, search?: string, active?: boolean, types?: Array<GetResourcesTypesEnum>, internalId?: string, aPIVersion?: string, options?: RawAxiosRequestConfig) {
295
+ return ResourceApiFp(this.configuration).getResources(pageIndex, pageSize, search, active, types, internalId, aPIVersion, options).then((request) => request(this.axios, this.basePath));
296
+ }
297
+ }
298
+
299
+ /**
300
+ * @export
301
+ */
302
+ export const GetGroupsTypesEnum = {
303
+ Consent: 'CONSENT',
304
+ Form: 'FORM',
305
+ Document: 'DOCUMENT',
306
+ Json: 'JSON'
307
+ } as const;
308
+ export type GetGroupsTypesEnum = typeof GetGroupsTypesEnum[keyof typeof GetGroupsTypesEnum];
309
+ /**
310
+ * @export
311
+ */
312
+ export const GetResourcesTypesEnum = {
313
+ Consent: 'CONSENT',
314
+ Form: 'FORM',
315
+ Document: 'DOCUMENT',
316
+ Json: 'JSON'
317
+ } as const;
318
+ export type GetResourcesTypesEnum = typeof GetResourcesTypesEnum[keyof typeof GetResourcesTypesEnum];
@@ -0,0 +1,241 @@
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 { CreateSubjectDto } from '../models';
26
+ // @ts-ignore
27
+ import type { CreateSubjectEntity } from '../models';
28
+ // @ts-ignore
29
+ import type { GetSubject400Response } from '../models';
30
+ // @ts-ignore
31
+ import type { GetSubject404Response } from '../models';
32
+ // @ts-ignore
33
+ import type { SubjectEntity } from '../models';
34
+ /**
35
+ * UserApi - axios parameter creator
36
+ * @export
37
+ */
38
+ export const UserApiAxiosParamCreator = function (configuration?: Configuration) {
39
+ return {
40
+ /**
41
+ * This endpoint allows organizations to import their existing users information into Humanos, for better management and control. - Multiple users can be created in a call. - A user can be created with just a contact (email or phone). - Optionally, additional identity information (KYC) can be included. - Optionally, organizations can attach an internal Id to allow mapping users within their database.
42
+ * @summary Create User
43
+ * @param {Array<CreateSubjectDto>} createSubjectDto Array of subjects to create. Each subject represents a user to be imported into Humanos
44
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
45
+ * @param {*} [options] Override http request option.
46
+ * @throws {RequiredError}
47
+ */
48
+ create: async (createSubjectDto: Array<CreateSubjectDto>, aPIVersion?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
49
+ // verify required parameter 'createSubjectDto' is not null or undefined
50
+ assertParamExists('create', 'createSubjectDto', createSubjectDto)
51
+ const localVarPath = `/user`;
52
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
53
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
54
+ let baseOptions;
55
+ if (configuration) {
56
+ baseOptions = configuration.baseOptions;
57
+ }
58
+
59
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
60
+ const localVarHeaderParameter = {} as any;
61
+ const localVarQueryParameter = {} as any;
62
+
63
+
64
+
65
+ localVarHeaderParameter['Content-Type'] = 'application/json';
66
+
67
+ if (aPIVersion != null) {
68
+ localVarHeaderParameter['API-Version'] = String(aPIVersion);
69
+ }
70
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
71
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
72
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
73
+ localVarRequestOptions.data = serializeDataIfNeeded(createSubjectDto, localVarRequestOptions, configuration)
74
+
75
+ return {
76
+ url: toPathString(localVarUrlObj),
77
+ options: localVarRequestOptions,
78
+ };
79
+ },
80
+ /**
81
+ * Retrieves detailed information about a user. Can and must be searched by only one of the following: contact, did, or internalId
82
+ * @summary Get User
83
+ * @param {string} [contact] Contact value (email or phone)
84
+ * @param {string} [did] Public Decentralized Identifier (DID) of the user
85
+ * @param {string} [internalId] Identifier to help you identify the user in your own system. We recommend using a unique value.
86
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
87
+ * @param {*} [options] Override http request option.
88
+ * @throws {RequiredError}
89
+ */
90
+ getSubject: async (contact?: string, did?: string, internalId?: string, aPIVersion?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
91
+ const localVarPath = `/user`;
92
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
93
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
94
+ let baseOptions;
95
+ if (configuration) {
96
+ baseOptions = configuration.baseOptions;
97
+ }
98
+
99
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
100
+ const localVarHeaderParameter = {} as any;
101
+ const localVarQueryParameter = {} as any;
102
+
103
+ if (contact !== undefined) {
104
+ localVarQueryParameter['contact'] = contact;
105
+ }
106
+
107
+ if (did !== undefined) {
108
+ localVarQueryParameter['did'] = did;
109
+ }
110
+
111
+ if (internalId !== undefined) {
112
+ localVarQueryParameter['internalId'] = internalId;
113
+ }
114
+
115
+
116
+
117
+ if (aPIVersion != null) {
118
+ localVarHeaderParameter['API-Version'] = String(aPIVersion);
119
+ }
120
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
121
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
122
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
123
+
124
+ return {
125
+ url: toPathString(localVarUrlObj),
126
+ options: localVarRequestOptions,
127
+ };
128
+ },
129
+ }
130
+ };
131
+
132
+ /**
133
+ * UserApi - functional programming interface
134
+ * @export
135
+ */
136
+ export const UserApiFp = function(configuration?: Configuration) {
137
+ const localVarAxiosParamCreator = UserApiAxiosParamCreator(configuration)
138
+ return {
139
+ /**
140
+ * This endpoint allows organizations to import their existing users information into Humanos, for better management and control. - Multiple users can be created in a call. - A user can be created with just a contact (email or phone). - Optionally, additional identity information (KYC) can be included. - Optionally, organizations can attach an internal Id to allow mapping users within their database.
141
+ * @summary Create User
142
+ * @param {Array<CreateSubjectDto>} createSubjectDto Array of subjects to create. Each subject represents a user to be imported into Humanos
143
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
144
+ * @param {*} [options] Override http request option.
145
+ * @throws {RequiredError}
146
+ */
147
+ async create(createSubjectDto: Array<CreateSubjectDto>, aPIVersion?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<CreateSubjectEntity>>> {
148
+ const localVarAxiosArgs = await localVarAxiosParamCreator.create(createSubjectDto, aPIVersion, options);
149
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
150
+ const localVarOperationServerBasePath = operationServerMap['UserApi.create']?.[localVarOperationServerIndex]?.url;
151
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
152
+ },
153
+ /**
154
+ * Retrieves detailed information about a user. Can and must be searched by only one of the following: contact, did, or internalId
155
+ * @summary Get User
156
+ * @param {string} [contact] Contact value (email or phone)
157
+ * @param {string} [did] Public Decentralized Identifier (DID) of the user
158
+ * @param {string} [internalId] Identifier to help you identify the user in your own system. We recommend using a unique value.
159
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
160
+ * @param {*} [options] Override http request option.
161
+ * @throws {RequiredError}
162
+ */
163
+ async getSubject(contact?: string, did?: string, internalId?: string, aPIVersion?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SubjectEntity>> {
164
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getSubject(contact, did, internalId, aPIVersion, options);
165
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
166
+ const localVarOperationServerBasePath = operationServerMap['UserApi.getSubject']?.[localVarOperationServerIndex]?.url;
167
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
168
+ },
169
+ }
170
+ };
171
+
172
+ /**
173
+ * UserApi - factory interface
174
+ * @export
175
+ */
176
+ export const UserApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
177
+ const localVarFp = UserApiFp(configuration)
178
+ return {
179
+ /**
180
+ * This endpoint allows organizations to import their existing users information into Humanos, for better management and control. - Multiple users can be created in a call. - A user can be created with just a contact (email or phone). - Optionally, additional identity information (KYC) can be included. - Optionally, organizations can attach an internal Id to allow mapping users within their database.
181
+ * @summary Create User
182
+ * @param {Array<CreateSubjectDto>} createSubjectDto Array of subjects to create. Each subject represents a user to be imported into Humanos
183
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
184
+ * @param {*} [options] Override http request option.
185
+ * @throws {RequiredError}
186
+ */
187
+ create(createSubjectDto: Array<CreateSubjectDto>, aPIVersion?: string, options?: RawAxiosRequestConfig): AxiosPromise<Array<CreateSubjectEntity>> {
188
+ return localVarFp.create(createSubjectDto, aPIVersion, options).then((request) => request(axios, basePath));
189
+ },
190
+ /**
191
+ * Retrieves detailed information about a user. Can and must be searched by only one of the following: contact, did, or internalId
192
+ * @summary Get User
193
+ * @param {string} [contact] Contact value (email or phone)
194
+ * @param {string} [did] Public Decentralized Identifier (DID) of the user
195
+ * @param {string} [internalId] Identifier to help you identify the user in your own system. We recommend using a unique value.
196
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
197
+ * @param {*} [options] Override http request option.
198
+ * @throws {RequiredError}
199
+ */
200
+ getSubject(contact?: string, did?: string, internalId?: string, aPIVersion?: string, options?: RawAxiosRequestConfig): AxiosPromise<SubjectEntity> {
201
+ return localVarFp.getSubject(contact, did, internalId, aPIVersion, options).then((request) => request(axios, basePath));
202
+ },
203
+ };
204
+ };
205
+
206
+ /**
207
+ * UserApi - object-oriented interface
208
+ * @export
209
+ * @class UserApi
210
+ * @extends {BaseAPI}
211
+ */
212
+ export class UserApi extends BaseAPI {
213
+ /**
214
+ * This endpoint allows organizations to import their existing users information into Humanos, for better management and control. - Multiple users can be created in a call. - A user can be created with just a contact (email or phone). - Optionally, additional identity information (KYC) can be included. - Optionally, organizations can attach an internal Id to allow mapping users within their database.
215
+ * @summary Create User
216
+ * @param {Array<CreateSubjectDto>} createSubjectDto Array of subjects to create. Each subject represents a user to be imported into Humanos
217
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
218
+ * @param {*} [options] Override http request option.
219
+ * @throws {RequiredError}
220
+ * @memberof UserApi
221
+ */
222
+ public create(createSubjectDto: Array<CreateSubjectDto>, aPIVersion?: string, options?: RawAxiosRequestConfig) {
223
+ return UserApiFp(this.configuration).create(createSubjectDto, aPIVersion, options).then((request) => request(this.axios, this.basePath));
224
+ }
225
+
226
+ /**
227
+ * Retrieves detailed information about a user. Can and must be searched by only one of the following: contact, did, or internalId
228
+ * @summary Get User
229
+ * @param {string} [contact] Contact value (email or phone)
230
+ * @param {string} [did] Public Decentralized Identifier (DID) of the user
231
+ * @param {string} [internalId] Identifier to help you identify the user in your own system. We recommend using a unique value.
232
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
233
+ * @param {*} [options] Override http request option.
234
+ * @throws {RequiredError}
235
+ * @memberof UserApi
236
+ */
237
+ public getSubject(contact?: string, did?: string, internalId?: string, aPIVersion?: string, options?: RawAxiosRequestConfig) {
238
+ return UserApiFp(this.configuration).getSubject(contact, did, internalId, aPIVersion, options).then((request) => request(this.axios, this.basePath));
239
+ }
240
+ }
241
+