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
package/dist/index.js ADDED
@@ -0,0 +1,1526 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ API_VERSION: () => API_VERSION,
34
+ ActionType: () => ActionType,
35
+ Configuration: () => Configuration,
36
+ CreateSubjectEntityStatusEnum: () => CreateSubjectEntityStatusEnum,
37
+ CredentialEntityStatusEnum: () => CredentialEntityStatusEnum,
38
+ CredentialFullEntityStatusEnum: () => CredentialFullEntityStatusEnum,
39
+ CredentialStatus: () => CredentialStatus,
40
+ CredentialsApi: () => CredentialsApi,
41
+ CredentialsApiAxiosParamCreator: () => CredentialsApiAxiosParamCreator,
42
+ CredentialsApiFactory: () => CredentialsApiFactory,
43
+ CredentialsApiFp: () => CredentialsApiFp,
44
+ DeliveryActionType: () => DeliveryActionType,
45
+ GenerateRequestDtoSecurityLevelEnum: () => GenerateRequestDtoSecurityLevelEnum,
46
+ GetGroupsTypesEnum: () => GetGroupsTypesEnum,
47
+ GetRequestsSecurityLevelEnum: () => GetRequestsSecurityLevelEnum,
48
+ GetResourcesTypesEnum: () => GetResourcesTypesEnum,
49
+ GroupResourceEntityTypeEnum: () => GroupResourceEntityTypeEnum,
50
+ HumanosClient: () => HumanosClient,
51
+ IdentityFieldType: () => IdentityFieldType,
52
+ MandateDataDtoTypeEnum: () => MandateDataDtoTypeEnum,
53
+ MandateDataType: () => MandateDataType,
54
+ RequestDetailEntitySecurityLevelEnum: () => RequestDetailEntitySecurityLevelEnum,
55
+ RequestEntitySecurityLevelEnum: () => RequestEntitySecurityLevelEnum,
56
+ RequestQuerySecurityLevelEnum: () => RequestQuerySecurityLevelEnum,
57
+ RequestsApi: () => RequestsApi,
58
+ RequestsApiAxiosParamCreator: () => RequestsApiAxiosParamCreator,
59
+ RequestsApiFactory: () => RequestsApiFactory,
60
+ RequestsApiFp: () => RequestsApiFp,
61
+ ResourceApi: () => ResourceApi,
62
+ ResourceApiAxiosParamCreator: () => ResourceApiAxiosParamCreator,
63
+ ResourceApiFactory: () => ResourceApiFactory,
64
+ ResourceApiFp: () => ResourceApiFp,
65
+ ResourceEntityTypeEnum: () => ResourceEntityTypeEnum,
66
+ ResourceQueryTypesEnum: () => ResourceQueryTypesEnum,
67
+ SDK_LANGUAGE: () => SDK_LANGUAGE,
68
+ UserApi: () => UserApi,
69
+ UserApiAxiosParamCreator: () => UserApiAxiosParamCreator,
70
+ UserApiFactory: () => UserApiFactory,
71
+ UserApiFp: () => UserApiFp,
72
+ W3CProofActionTypeEnum: () => W3CProofActionTypeEnum,
73
+ WebhookEventType: () => WebhookEventType,
74
+ WebhookEventTypeCREDENTIAL: () => WebhookEventTypeCREDENTIAL,
75
+ WebhookEventTypeIDENTITY: () => WebhookEventTypeIDENTITY,
76
+ WebhookEventTypeOTPFAILED: () => WebhookEventTypeOTPFAILED,
77
+ WebhookEventTypeTEST: () => WebhookEventTypeTEST,
78
+ applySignatureInterceptor: () => applySignatureInterceptor,
79
+ createHumanosClient: () => createHumanosClient,
80
+ createSignatureInterceptor: () => createSignatureInterceptor,
81
+ createWebhookHandler: () => createWebhookHandler,
82
+ decryptWebhookPayload: () => decryptWebhookPayload,
83
+ generateSignature: () => generateSignature,
84
+ processWebhook: () => processWebhook,
85
+ verifyWebhookSignature: () => verifyWebhookSignature
86
+ });
87
+ module.exports = __toCommonJS(index_exports);
88
+
89
+ // src/client.ts
90
+ var import_axios6 = __toESM(require("axios"));
91
+
92
+ // generated/api/credentials-api.ts
93
+ var import_axios2 = __toESM(require("axios"));
94
+
95
+ // generated/base.ts
96
+ var import_axios = __toESM(require("axios"));
97
+ var BASE_PATH = "http://localhost".replace(/\/+$/, "");
98
+ var BaseAPI = class {
99
+ constructor(configuration, basePath = BASE_PATH, axios2 = import_axios.default) {
100
+ this.basePath = basePath;
101
+ this.axios = axios2;
102
+ if (configuration) {
103
+ this.configuration = configuration;
104
+ this.basePath = configuration.basePath ?? basePath;
105
+ }
106
+ }
107
+ };
108
+ var RequiredError = class extends Error {
109
+ constructor(field, msg) {
110
+ super(msg);
111
+ this.field = field;
112
+ this.name = "RequiredError";
113
+ }
114
+ };
115
+ var operationServerMap = {};
116
+
117
+ // generated/common.ts
118
+ var DUMMY_BASE_URL = "https://example.com";
119
+ var assertParamExists = function(functionName, paramName, paramValue) {
120
+ if (paramValue === null || paramValue === void 0) {
121
+ throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
122
+ }
123
+ };
124
+ function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
125
+ if (parameter == null) return;
126
+ if (typeof parameter === "object") {
127
+ if (Array.isArray(parameter)) {
128
+ parameter.forEach((item) => setFlattenedQueryParams(urlSearchParams, item, key));
129
+ } else {
130
+ Object.keys(parameter).forEach(
131
+ (currentKey) => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== "" ? "." : ""}${currentKey}`)
132
+ );
133
+ }
134
+ } else {
135
+ if (urlSearchParams.has(key)) {
136
+ urlSearchParams.append(key, parameter);
137
+ } else {
138
+ urlSearchParams.set(key, parameter);
139
+ }
140
+ }
141
+ }
142
+ var setSearchParams = function(url, ...objects) {
143
+ const searchParams = new URLSearchParams(url.search);
144
+ setFlattenedQueryParams(searchParams, objects);
145
+ url.search = searchParams.toString();
146
+ };
147
+ var serializeDataIfNeeded = function(value, requestOptions, configuration) {
148
+ const nonString = typeof value !== "string";
149
+ const needsSerialization = nonString && configuration && configuration.isJsonMime ? configuration.isJsonMime(requestOptions.headers["Content-Type"]) : nonString;
150
+ return needsSerialization ? JSON.stringify(value !== void 0 ? value : {}) : value || "";
151
+ };
152
+ var toPathString = function(url) {
153
+ return url.pathname + url.search + url.hash;
154
+ };
155
+ var createRequestFunction = function(axiosArgs, globalAxios6, BASE_PATH2, configuration) {
156
+ return (axios2 = globalAxios6, basePath = BASE_PATH2) => {
157
+ const axiosRequestArgs = { ...axiosArgs.options, url: (axios2.defaults.baseURL ? "" : configuration?.basePath ?? basePath) + axiosArgs.url };
158
+ return axios2.request(axiosRequestArgs);
159
+ };
160
+ };
161
+
162
+ // generated/api/credentials-api.ts
163
+ var CredentialsApiAxiosParamCreator = function(configuration) {
164
+ return {
165
+ /**
166
+ * Retrieve a specific credential by its ID Returns the W3C Verifiable Credential data structure including cryptographic proofs Optionally includes the PDF content for document type credentials
167
+ * @summary Get Credential
168
+ * @param {string} credentialId Unique identifier of the credential. Must be a valid MongoDB ObjectId.
169
+ * @param {boolean} [includePdf] Whether to include the PDF content for document type credentials
170
+ * @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\'s date.
171
+ * @param {*} [options] Override http request option.
172
+ * @throws {RequiredError}
173
+ */
174
+ getCredential: async (credentialId, includePdf, aPIVersion, options = {}) => {
175
+ assertParamExists("getCredential", "credentialId", credentialId);
176
+ const localVarPath = `/credential/{credentialId}`.replace(`{${"credentialId"}}`, encodeURIComponent(String(credentialId)));
177
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
178
+ let baseOptions;
179
+ if (configuration) {
180
+ baseOptions = configuration.baseOptions;
181
+ }
182
+ const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
183
+ const localVarHeaderParameter = {};
184
+ const localVarQueryParameter = {};
185
+ if (includePdf !== void 0) {
186
+ localVarQueryParameter["includePdf"] = includePdf;
187
+ }
188
+ if (aPIVersion != null) {
189
+ localVarHeaderParameter["API-Version"] = String(aPIVersion);
190
+ }
191
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
192
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
193
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
194
+ return {
195
+ url: toPathString(localVarUrlObj),
196
+ options: localVarRequestOptions
197
+ };
198
+ }
199
+ };
200
+ };
201
+ var CredentialsApiFp = function(configuration) {
202
+ const localVarAxiosParamCreator = CredentialsApiAxiosParamCreator(configuration);
203
+ return {
204
+ /**
205
+ * Retrieve a specific credential by its ID Returns the W3C Verifiable Credential data structure including cryptographic proofs Optionally includes the PDF content for document type credentials
206
+ * @summary Get Credential
207
+ * @param {string} credentialId Unique identifier of the credential. Must be a valid MongoDB ObjectId.
208
+ * @param {boolean} [includePdf] Whether to include the PDF content for document type credentials
209
+ * @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\'s date.
210
+ * @param {*} [options] Override http request option.
211
+ * @throws {RequiredError}
212
+ */
213
+ async getCredential(credentialId, includePdf, aPIVersion, options) {
214
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getCredential(credentialId, includePdf, aPIVersion, options);
215
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
216
+ const localVarOperationServerBasePath = operationServerMap["CredentialsApi.getCredential"]?.[localVarOperationServerIndex]?.url;
217
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios2.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
218
+ }
219
+ };
220
+ };
221
+ var CredentialsApiFactory = function(configuration, basePath, axios2) {
222
+ const localVarFp = CredentialsApiFp(configuration);
223
+ return {
224
+ /**
225
+ * Retrieve a specific credential by its ID Returns the W3C Verifiable Credential data structure including cryptographic proofs Optionally includes the PDF content for document type credentials
226
+ * @summary Get Credential
227
+ * @param {string} credentialId Unique identifier of the credential. Must be a valid MongoDB ObjectId.
228
+ * @param {boolean} [includePdf] Whether to include the PDF content for document type credentials
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\'s date.
230
+ * @param {*} [options] Override http request option.
231
+ * @throws {RequiredError}
232
+ */
233
+ getCredential(credentialId, includePdf, aPIVersion, options) {
234
+ return localVarFp.getCredential(credentialId, includePdf, aPIVersion, options).then((request) => request(axios2, basePath));
235
+ }
236
+ };
237
+ };
238
+ var CredentialsApi = class extends BaseAPI {
239
+ /**
240
+ * Retrieve a specific credential by its ID Returns the W3C Verifiable Credential data structure including cryptographic proofs Optionally includes the PDF content for document type credentials
241
+ * @summary Get Credential
242
+ * @param {string} credentialId Unique identifier of the credential. Must be a valid MongoDB ObjectId.
243
+ * @param {boolean} [includePdf] Whether to include the PDF content for document type credentials
244
+ * @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\'s date.
245
+ * @param {*} [options] Override http request option.
246
+ * @throws {RequiredError}
247
+ * @memberof CredentialsApi
248
+ */
249
+ getCredential(credentialId, includePdf, aPIVersion, options) {
250
+ return CredentialsApiFp(this.configuration).getCredential(credentialId, includePdf, aPIVersion, options).then((request) => request(this.axios, this.basePath));
251
+ }
252
+ };
253
+
254
+ // generated/api/requests-api.ts
255
+ var import_axios3 = __toESM(require("axios"));
256
+ var RequestsApiAxiosParamCreator = function(configuration) {
257
+ return {
258
+ /**
259
+ * This action will cancel a credential request, by setting the canceledAt timestamp on the request. This operation is irreversible, and will prevent the request from being processed further by the subjects
260
+ * @summary Cancel
261
+ * @param {string} requestId Unique identifier of the credential request to cancel. Must be a valid MongoDB ObjectId.
262
+ * @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\'s date.
263
+ * @param {*} [options] Override http request option.
264
+ * @throws {RequiredError}
265
+ */
266
+ cancelRequest: async (requestId, aPIVersion, options = {}) => {
267
+ assertParamExists("cancelRequest", "requestId", requestId);
268
+ const localVarPath = `/request/{requestId}`.replace(`{${"requestId"}}`, encodeURIComponent(String(requestId)));
269
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
270
+ let baseOptions;
271
+ if (configuration) {
272
+ baseOptions = configuration.baseOptions;
273
+ }
274
+ const localVarRequestOptions = { method: "DELETE", ...baseOptions, ...options };
275
+ const localVarHeaderParameter = {};
276
+ const localVarQueryParameter = {};
277
+ if (aPIVersion != null) {
278
+ localVarHeaderParameter["API-Version"] = String(aPIVersion);
279
+ }
280
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
281
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
282
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
283
+ return {
284
+ url: toPathString(localVarUrlObj),
285
+ options: localVarRequestOptions
286
+ };
287
+ },
288
+ /**
289
+ * Create a new credential request for one or more subjects (users). This endpoint will: - Create credentials from resources or inline JSON data - Associate credentials with subjects - Generate and send OTPs for approval via email or SMS Request details: - Resources can be specified via group IDs, resource IDs, or as inline JSON credentials - Maximum 30 credentials per request - Maximum 20 contacts per request - OTPs are automatically sent to all subjects after creation
290
+ * @summary Create
291
+ * @param {GenerateRequestDto} generateRequestDto Request body containing contacts (subjects), security level, and resources to create credentials from. Resources can be specified via groupIds, resourcesIds, or inline credentials array.
292
+ * @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\'s date.
293
+ * @param {*} [options] Override http request option.
294
+ * @throws {RequiredError}
295
+ */
296
+ generate: async (generateRequestDto, aPIVersion, options = {}) => {
297
+ assertParamExists("generate", "generateRequestDto", generateRequestDto);
298
+ const localVarPath = `/request`;
299
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
300
+ let baseOptions;
301
+ if (configuration) {
302
+ baseOptions = configuration.baseOptions;
303
+ }
304
+ const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
305
+ const localVarHeaderParameter = {};
306
+ const localVarQueryParameter = {};
307
+ localVarHeaderParameter["Content-Type"] = "application/json";
308
+ if (aPIVersion != null) {
309
+ localVarHeaderParameter["API-Version"] = String(aPIVersion);
310
+ }
311
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
312
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
313
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
314
+ localVarRequestOptions.data = serializeDataIfNeeded(generateRequestDto, localVarRequestOptions, configuration);
315
+ return {
316
+ url: toPathString(localVarUrlObj),
317
+ options: localVarRequestOptions
318
+ };
319
+ },
320
+ /**
321
+ * Retrieve detailed information about a specific credential request This includes complete W3C Verifiable Credential data for each credential, subject information, agent details (if applicable), and issuer information The credentials are returned in W3C-compliant format and can be cryptographically verified
322
+ * @summary Get Detail
323
+ * @param {string} requestId Unique identifier of the credential request. Must be a valid MongoDB ObjectId.
324
+ * @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\'s date.
325
+ * @param {*} [options] Override http request option.
326
+ * @throws {RequiredError}
327
+ */
328
+ getRequestDetail: async (requestId, aPIVersion, options = {}) => {
329
+ assertParamExists("getRequestDetail", "requestId", requestId);
330
+ const localVarPath = `/request/{requestId}`.replace(`{${"requestId"}}`, encodeURIComponent(String(requestId)));
331
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
332
+ let baseOptions;
333
+ if (configuration) {
334
+ baseOptions = configuration.baseOptions;
335
+ }
336
+ const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
337
+ const localVarHeaderParameter = {};
338
+ const localVarQueryParameter = {};
339
+ if (aPIVersion != null) {
340
+ localVarHeaderParameter["API-Version"] = String(aPIVersion);
341
+ }
342
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
343
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
344
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
345
+ return {
346
+ url: toPathString(localVarUrlObj),
347
+ options: localVarRequestOptions
348
+ };
349
+ },
350
+ /**
351
+ * Retrieve a paginated list of credential requests for your organization Each request includes information about the credentials, subjects (users), security level, and creation date. One exact search query must be provided
352
+ * @summary Get
353
+ * @param {number} [pageIndex] Page number
354
+ * @param {number} [pageSize] Number of items per page
355
+ * @param {string} [search] Search query to filter by. Is case-insensitive and does not need to match the entire value.
356
+ * @param {string} [contact] Contact value (email or phone)
357
+ * @param {string} [did] Public Decentralized Identifier (DID) of the user
358
+ * @param {string} [subjectInternalId] Identifier to help you identify the user in your own system. We recommend using a unique value.
359
+ * @param {string} [internalId] Filter by internal ID.
360
+ * @param {string} [credentialInternalId] Filter by credential internal ID.
361
+ * @param {Array<GetRequestsSecurityLevelEnum>} [securityLevel] Filter by security level. Can be a single value or array
362
+ * @param {string} [dateFrom] Filter from date (will be converted to start of day)
363
+ * @param {string} [dateTo] Filter to date (will be converted to end of day). Requires dateFrom.
364
+ * @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.
365
+ * @param {*} [options] Override http request option.
366
+ * @throws {RequiredError}
367
+ */
368
+ getRequests: async (pageIndex, pageSize, search, contact, did, subjectInternalId, internalId, credentialInternalId, securityLevel, dateFrom, dateTo, aPIVersion, options = {}) => {
369
+ const localVarPath = `/request`;
370
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
371
+ let baseOptions;
372
+ if (configuration) {
373
+ baseOptions = configuration.baseOptions;
374
+ }
375
+ const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
376
+ const localVarHeaderParameter = {};
377
+ const localVarQueryParameter = {};
378
+ if (pageIndex !== void 0) {
379
+ localVarQueryParameter["pageIndex"] = pageIndex;
380
+ }
381
+ if (pageSize !== void 0) {
382
+ localVarQueryParameter["pageSize"] = pageSize;
383
+ }
384
+ if (search !== void 0) {
385
+ localVarQueryParameter["search"] = search;
386
+ }
387
+ if (contact !== void 0) {
388
+ localVarQueryParameter["contact"] = contact;
389
+ }
390
+ if (did !== void 0) {
391
+ localVarQueryParameter["did"] = did;
392
+ }
393
+ if (subjectInternalId !== void 0) {
394
+ localVarQueryParameter["subjectInternalId"] = subjectInternalId;
395
+ }
396
+ if (internalId !== void 0) {
397
+ localVarQueryParameter["internalId"] = internalId;
398
+ }
399
+ if (credentialInternalId !== void 0) {
400
+ localVarQueryParameter["credentialInternalId"] = credentialInternalId;
401
+ }
402
+ if (securityLevel) {
403
+ localVarQueryParameter["securityLevel"] = securityLevel;
404
+ }
405
+ if (dateFrom !== void 0) {
406
+ localVarQueryParameter["dateFrom"] = dateFrom instanceof Date ? dateFrom.toISOString() : dateFrom;
407
+ }
408
+ if (dateTo !== void 0) {
409
+ localVarQueryParameter["dateTo"] = dateTo instanceof Date ? dateTo.toISOString() : dateTo;
410
+ }
411
+ if (aPIVersion != null) {
412
+ localVarHeaderParameter["API-Version"] = String(aPIVersion);
413
+ }
414
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
415
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
416
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
417
+ return {
418
+ url: toPathString(localVarUrlObj),
419
+ options: localVarRequestOptions
420
+ };
421
+ },
422
+ /**
423
+ * Resend a One-Time Password (OTP) to a subject for credential approval, via email or SMS (depending on their contact type) with a code and a signing URL One exact search query must be provided The endpoint validates: - The request is not canceled - Maximum attempts have not been reached, only successful OTP sends count towards resend limits - Sufficient time has passed since the last successful resend - Billing restrictions apply
424
+ * @summary Resend OTP
425
+ * @param {string} requestId Unique identifier of the request.
426
+ * @param {string} [contact] Contact value (email or phone)
427
+ * @param {string} [did] Public Decentralized Identifier (DID) of the user
428
+ * @param {string} [internalId] Identifier to help you identify the user in your own system. We recommend using a unique value.
429
+ * @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.
430
+ * @param {*} [options] Override http request option.
431
+ * @throws {RequiredError}
432
+ */
433
+ resendOtp: async (requestId, contact, did, internalId, aPIVersion, options = {}) => {
434
+ assertParamExists("resendOtp", "requestId", requestId);
435
+ const localVarPath = `/request/resend/{requestId}`.replace(`{${"requestId"}}`, encodeURIComponent(String(requestId)));
436
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
437
+ let baseOptions;
438
+ if (configuration) {
439
+ baseOptions = configuration.baseOptions;
440
+ }
441
+ const localVarRequestOptions = { method: "PATCH", ...baseOptions, ...options };
442
+ const localVarHeaderParameter = {};
443
+ const localVarQueryParameter = {};
444
+ if (contact !== void 0) {
445
+ localVarQueryParameter["contact"] = contact;
446
+ }
447
+ if (did !== void 0) {
448
+ localVarQueryParameter["did"] = did;
449
+ }
450
+ if (internalId !== void 0) {
451
+ localVarQueryParameter["internalId"] = internalId;
452
+ }
453
+ if (aPIVersion != null) {
454
+ localVarHeaderParameter["API-Version"] = String(aPIVersion);
455
+ }
456
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
457
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
458
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
459
+ return {
460
+ url: toPathString(localVarUrlObj),
461
+ options: localVarRequestOptions
462
+ };
463
+ }
464
+ };
465
+ };
466
+ var RequestsApiFp = function(configuration) {
467
+ const localVarAxiosParamCreator = RequestsApiAxiosParamCreator(configuration);
468
+ return {
469
+ /**
470
+ * This action will cancel a credential request, by setting the canceledAt timestamp on the request. This operation is irreversible, and will prevent the request from being processed further by the subjects
471
+ * @summary Cancel
472
+ * @param {string} requestId Unique identifier of the credential request to cancel. Must be a valid MongoDB ObjectId.
473
+ * @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.
474
+ * @param {*} [options] Override http request option.
475
+ * @throws {RequiredError}
476
+ */
477
+ async cancelRequest(requestId, aPIVersion, options) {
478
+ const localVarAxiosArgs = await localVarAxiosParamCreator.cancelRequest(requestId, aPIVersion, options);
479
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
480
+ const localVarOperationServerBasePath = operationServerMap["RequestsApi.cancelRequest"]?.[localVarOperationServerIndex]?.url;
481
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios3.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
482
+ },
483
+ /**
484
+ * Create a new credential request for one or more subjects (users). This endpoint will: - Create credentials from resources or inline JSON data - Associate credentials with subjects - Generate and send OTPs for approval via email or SMS Request details: - Resources can be specified via group IDs, resource IDs, or as inline JSON credentials - Maximum 30 credentials per request - Maximum 20 contacts per request - OTPs are automatically sent to all subjects after creation
485
+ * @summary Create
486
+ * @param {GenerateRequestDto} generateRequestDto Request body containing contacts (subjects), security level, and resources to create credentials from. Resources can be specified via groupIds, resourcesIds, or inline credentials array.
487
+ * @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.
488
+ * @param {*} [options] Override http request option.
489
+ * @throws {RequiredError}
490
+ */
491
+ async generate(generateRequestDto, aPIVersion, options) {
492
+ const localVarAxiosArgs = await localVarAxiosParamCreator.generate(generateRequestDto, aPIVersion, options);
493
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
494
+ const localVarOperationServerBasePath = operationServerMap["RequestsApi.generate"]?.[localVarOperationServerIndex]?.url;
495
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios3.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
496
+ },
497
+ /**
498
+ * Retrieve detailed information about a specific credential request This includes complete W3C Verifiable Credential data for each credential, subject information, agent details (if applicable), and issuer information The credentials are returned in W3C-compliant format and can be cryptographically verified
499
+ * @summary Get Detail
500
+ * @param {string} requestId Unique identifier of the credential request. Must be a valid MongoDB ObjectId.
501
+ * @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.
502
+ * @param {*} [options] Override http request option.
503
+ * @throws {RequiredError}
504
+ */
505
+ async getRequestDetail(requestId, aPIVersion, options) {
506
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getRequestDetail(requestId, aPIVersion, options);
507
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
508
+ const localVarOperationServerBasePath = operationServerMap["RequestsApi.getRequestDetail"]?.[localVarOperationServerIndex]?.url;
509
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios3.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
510
+ },
511
+ /**
512
+ * Retrieve a paginated list of credential requests for your organization Each request includes information about the credentials, subjects (users), security level, and creation date. One exact search query must be provided
513
+ * @summary Get
514
+ * @param {number} [pageIndex] Page number
515
+ * @param {number} [pageSize] Number of items per page
516
+ * @param {string} [search] Search query to filter by. Is case-insensitive and does not need to match the entire value.
517
+ * @param {string} [contact] Contact value (email or phone)
518
+ * @param {string} [did] Public Decentralized Identifier (DID) of the user
519
+ * @param {string} [subjectInternalId] Identifier to help you identify the user in your own system. We recommend using a unique value.
520
+ * @param {string} [internalId] Filter by internal ID.
521
+ * @param {string} [credentialInternalId] Filter by credential internal ID.
522
+ * @param {Array<GetRequestsSecurityLevelEnum>} [securityLevel] Filter by security level. Can be a single value or array
523
+ * @param {string} [dateFrom] Filter from date (will be converted to start of day)
524
+ * @param {string} [dateTo] Filter to date (will be converted to end of day). Requires dateFrom.
525
+ * @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.
526
+ * @param {*} [options] Override http request option.
527
+ * @throws {RequiredError}
528
+ */
529
+ async getRequests(pageIndex, pageSize, search, contact, did, subjectInternalId, internalId, credentialInternalId, securityLevel, dateFrom, dateTo, aPIVersion, options) {
530
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getRequests(pageIndex, pageSize, search, contact, did, subjectInternalId, internalId, credentialInternalId, securityLevel, dateFrom, dateTo, aPIVersion, options);
531
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
532
+ const localVarOperationServerBasePath = operationServerMap["RequestsApi.getRequests"]?.[localVarOperationServerIndex]?.url;
533
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios3.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
534
+ },
535
+ /**
536
+ * Resend a One-Time Password (OTP) to a subject for credential approval, via email or SMS (depending on their contact type) with a code and a signing URL One exact search query must be provided The endpoint validates: - The request is not canceled - Maximum attempts have not been reached, only successful OTP sends count towards resend limits - Sufficient time has passed since the last successful resend - Billing restrictions apply
537
+ * @summary Resend OTP
538
+ * @param {string} requestId Unique identifier of the request.
539
+ * @param {string} [contact] Contact value (email or phone)
540
+ * @param {string} [did] Public Decentralized Identifier (DID) of the user
541
+ * @param {string} [internalId] Identifier to help you identify the user in your own system. We recommend using a unique value.
542
+ * @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.
543
+ * @param {*} [options] Override http request option.
544
+ * @throws {RequiredError}
545
+ */
546
+ async resendOtp(requestId, contact, did, internalId, aPIVersion, options) {
547
+ const localVarAxiosArgs = await localVarAxiosParamCreator.resendOtp(requestId, contact, did, internalId, aPIVersion, options);
548
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
549
+ const localVarOperationServerBasePath = operationServerMap["RequestsApi.resendOtp"]?.[localVarOperationServerIndex]?.url;
550
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios3.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
551
+ }
552
+ };
553
+ };
554
+ var RequestsApiFactory = function(configuration, basePath, axios2) {
555
+ const localVarFp = RequestsApiFp(configuration);
556
+ return {
557
+ /**
558
+ * This action will cancel a credential request, by setting the canceledAt timestamp on the request. This operation is irreversible, and will prevent the request from being processed further by the subjects
559
+ * @summary Cancel
560
+ * @param {string} requestId Unique identifier of the credential request to cancel. Must be a valid MongoDB ObjectId.
561
+ * @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.
562
+ * @param {*} [options] Override http request option.
563
+ * @throws {RequiredError}
564
+ */
565
+ cancelRequest(requestId, aPIVersion, options) {
566
+ return localVarFp.cancelRequest(requestId, aPIVersion, options).then((request) => request(axios2, basePath));
567
+ },
568
+ /**
569
+ * Create a new credential request for one or more subjects (users). This endpoint will: - Create credentials from resources or inline JSON data - Associate credentials with subjects - Generate and send OTPs for approval via email or SMS Request details: - Resources can be specified via group IDs, resource IDs, or as inline JSON credentials - Maximum 30 credentials per request - Maximum 20 contacts per request - OTPs are automatically sent to all subjects after creation
570
+ * @summary Create
571
+ * @param {GenerateRequestDto} generateRequestDto Request body containing contacts (subjects), security level, and resources to create credentials from. Resources can be specified via groupIds, resourcesIds, or inline credentials array.
572
+ * @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.
573
+ * @param {*} [options] Override http request option.
574
+ * @throws {RequiredError}
575
+ */
576
+ generate(generateRequestDto, aPIVersion, options) {
577
+ return localVarFp.generate(generateRequestDto, aPIVersion, options).then((request) => request(axios2, basePath));
578
+ },
579
+ /**
580
+ * Retrieve detailed information about a specific credential request This includes complete W3C Verifiable Credential data for each credential, subject information, agent details (if applicable), and issuer information The credentials are returned in W3C-compliant format and can be cryptographically verified
581
+ * @summary Get Detail
582
+ * @param {string} requestId Unique identifier of the credential request. Must be a valid MongoDB ObjectId.
583
+ * @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.
584
+ * @param {*} [options] Override http request option.
585
+ * @throws {RequiredError}
586
+ */
587
+ getRequestDetail(requestId, aPIVersion, options) {
588
+ return localVarFp.getRequestDetail(requestId, aPIVersion, options).then((request) => request(axios2, basePath));
589
+ },
590
+ /**
591
+ * Retrieve a paginated list of credential requests for your organization Each request includes information about the credentials, subjects (users), security level, and creation date. One exact search query must be provided
592
+ * @summary Get
593
+ * @param {number} [pageIndex] Page number
594
+ * @param {number} [pageSize] Number of items per page
595
+ * @param {string} [search] Search query to filter by. Is case-insensitive and does not need to match the entire value.
596
+ * @param {string} [contact] Contact value (email or phone)
597
+ * @param {string} [did] Public Decentralized Identifier (DID) of the user
598
+ * @param {string} [subjectInternalId] Identifier to help you identify the user in your own system. We recommend using a unique value.
599
+ * @param {string} [internalId] Filter by internal ID.
600
+ * @param {string} [credentialInternalId] Filter by credential internal ID.
601
+ * @param {Array<GetRequestsSecurityLevelEnum>} [securityLevel] Filter by security level. Can be a single value or array
602
+ * @param {string} [dateFrom] Filter from date (will be converted to start of day)
603
+ * @param {string} [dateTo] Filter to date (will be converted to end of day). Requires dateFrom.
604
+ * @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.
605
+ * @param {*} [options] Override http request option.
606
+ * @throws {RequiredError}
607
+ */
608
+ getRequests(pageIndex, pageSize, search, contact, did, subjectInternalId, internalId, credentialInternalId, securityLevel, dateFrom, dateTo, aPIVersion, options) {
609
+ return localVarFp.getRequests(pageIndex, pageSize, search, contact, did, subjectInternalId, internalId, credentialInternalId, securityLevel, dateFrom, dateTo, aPIVersion, options).then((request) => request(axios2, basePath));
610
+ },
611
+ /**
612
+ * Resend a One-Time Password (OTP) to a subject for credential approval, via email or SMS (depending on their contact type) with a code and a signing URL One exact search query must be provided The endpoint validates: - The request is not canceled - Maximum attempts have not been reached, only successful OTP sends count towards resend limits - Sufficient time has passed since the last successful resend - Billing restrictions apply
613
+ * @summary Resend OTP
614
+ * @param {string} requestId Unique identifier of the request.
615
+ * @param {string} [contact] Contact value (email or phone)
616
+ * @param {string} [did] Public Decentralized Identifier (DID) of the user
617
+ * @param {string} [internalId] Identifier to help you identify the user in your own system. We recommend using a unique value.
618
+ * @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.
619
+ * @param {*} [options] Override http request option.
620
+ * @throws {RequiredError}
621
+ */
622
+ resendOtp(requestId, contact, did, internalId, aPIVersion, options) {
623
+ return localVarFp.resendOtp(requestId, contact, did, internalId, aPIVersion, options).then((request) => request(axios2, basePath));
624
+ }
625
+ };
626
+ };
627
+ var RequestsApi = class extends BaseAPI {
628
+ /**
629
+ * This action will cancel a credential request, by setting the canceledAt timestamp on the request. This operation is irreversible, and will prevent the request from being processed further by the subjects
630
+ * @summary Cancel
631
+ * @param {string} requestId Unique identifier of the credential request to cancel. Must be a valid MongoDB ObjectId.
632
+ * @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.
633
+ * @param {*} [options] Override http request option.
634
+ * @throws {RequiredError}
635
+ * @memberof RequestsApi
636
+ */
637
+ cancelRequest(requestId, aPIVersion, options) {
638
+ return RequestsApiFp(this.configuration).cancelRequest(requestId, aPIVersion, options).then((request) => request(this.axios, this.basePath));
639
+ }
640
+ /**
641
+ * Create a new credential request for one or more subjects (users). This endpoint will: - Create credentials from resources or inline JSON data - Associate credentials with subjects - Generate and send OTPs for approval via email or SMS Request details: - Resources can be specified via group IDs, resource IDs, or as inline JSON credentials - Maximum 30 credentials per request - Maximum 20 contacts per request - OTPs are automatically sent to all subjects after creation
642
+ * @summary Create
643
+ * @param {GenerateRequestDto} generateRequestDto Request body containing contacts (subjects), security level, and resources to create credentials from. Resources can be specified via groupIds, resourcesIds, or inline credentials array.
644
+ * @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.
645
+ * @param {*} [options] Override http request option.
646
+ * @throws {RequiredError}
647
+ * @memberof RequestsApi
648
+ */
649
+ generate(generateRequestDto, aPIVersion, options) {
650
+ return RequestsApiFp(this.configuration).generate(generateRequestDto, aPIVersion, options).then((request) => request(this.axios, this.basePath));
651
+ }
652
+ /**
653
+ * Retrieve detailed information about a specific credential request This includes complete W3C Verifiable Credential data for each credential, subject information, agent details (if applicable), and issuer information The credentials are returned in W3C-compliant format and can be cryptographically verified
654
+ * @summary Get Detail
655
+ * @param {string} requestId Unique identifier of the credential request. Must be a valid MongoDB ObjectId.
656
+ * @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.
657
+ * @param {*} [options] Override http request option.
658
+ * @throws {RequiredError}
659
+ * @memberof RequestsApi
660
+ */
661
+ getRequestDetail(requestId, aPIVersion, options) {
662
+ return RequestsApiFp(this.configuration).getRequestDetail(requestId, aPIVersion, options).then((request) => request(this.axios, this.basePath));
663
+ }
664
+ /**
665
+ * Retrieve a paginated list of credential requests for your organization Each request includes information about the credentials, subjects (users), security level, and creation date. One exact search query must be provided
666
+ * @summary Get
667
+ * @param {number} [pageIndex] Page number
668
+ * @param {number} [pageSize] Number of items per page
669
+ * @param {string} [search] Search query to filter by. Is case-insensitive and does not need to match the entire value.
670
+ * @param {string} [contact] Contact value (email or phone)
671
+ * @param {string} [did] Public Decentralized Identifier (DID) of the user
672
+ * @param {string} [subjectInternalId] Identifier to help you identify the user in your own system. We recommend using a unique value.
673
+ * @param {string} [internalId] Filter by internal ID.
674
+ * @param {string} [credentialInternalId] Filter by credential internal ID.
675
+ * @param {Array<GetRequestsSecurityLevelEnum>} [securityLevel] Filter by security level. Can be a single value or array
676
+ * @param {string} [dateFrom] Filter from date (will be converted to start of day)
677
+ * @param {string} [dateTo] Filter to date (will be converted to end of day). Requires dateFrom.
678
+ * @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.
679
+ * @param {*} [options] Override http request option.
680
+ * @throws {RequiredError}
681
+ * @memberof RequestsApi
682
+ */
683
+ getRequests(pageIndex, pageSize, search, contact, did, subjectInternalId, internalId, credentialInternalId, securityLevel, dateFrom, dateTo, aPIVersion, options) {
684
+ return RequestsApiFp(this.configuration).getRequests(pageIndex, pageSize, search, contact, did, subjectInternalId, internalId, credentialInternalId, securityLevel, dateFrom, dateTo, aPIVersion, options).then((request) => request(this.axios, this.basePath));
685
+ }
686
+ /**
687
+ * Resend a One-Time Password (OTP) to a subject for credential approval, via email or SMS (depending on their contact type) with a code and a signing URL One exact search query must be provided The endpoint validates: - The request is not canceled - Maximum attempts have not been reached, only successful OTP sends count towards resend limits - Sufficient time has passed since the last successful resend - Billing restrictions apply
688
+ * @summary Resend OTP
689
+ * @param {string} requestId Unique identifier of the request.
690
+ * @param {string} [contact] Contact value (email or phone)
691
+ * @param {string} [did] Public Decentralized Identifier (DID) of the user
692
+ * @param {string} [internalId] Identifier to help you identify the user in your own system. We recommend using a unique value.
693
+ * @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.
694
+ * @param {*} [options] Override http request option.
695
+ * @throws {RequiredError}
696
+ * @memberof RequestsApi
697
+ */
698
+ resendOtp(requestId, contact, did, internalId, aPIVersion, options) {
699
+ return RequestsApiFp(this.configuration).resendOtp(requestId, contact, did, internalId, aPIVersion, options).then((request) => request(this.axios, this.basePath));
700
+ }
701
+ };
702
+ var GetRequestsSecurityLevelEnum = {
703
+ Contact: "CONTACT",
704
+ OrganizationKyc: "ORGANIZATION_KYC",
705
+ HumanosKyc: "HUMANOS_KYC",
706
+ HumanosRevalidation: "HUMANOS_REVALIDATION"
707
+ };
708
+
709
+ // generated/api/resource-api.ts
710
+ var import_axios4 = __toESM(require("axios"));
711
+ var ResourceApiAxiosParamCreator = function(configuration) {
712
+ return {
713
+ /**
714
+ * 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.
715
+ * @summary Get Groups
716
+ * @param {number} [pageIndex] Page number
717
+ * @param {number} [pageSize] Number of items per page
718
+ * @param {string} [search] Search query to filter by. Is case-insensitive and does not need to match the entire value.
719
+ * @param {boolean} [active] Filter by active status. Accepts true/false as string or boolean.
720
+ * @param {Array<GetGroupsTypesEnum>} [types] Filter by resource types. Can be a single value or array
721
+ * @param {string} [internalId] Identifier to help you identify the resource in your own system. We recommend using a unique value.
722
+ * @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.
723
+ * @param {*} [options] Override http request option.
724
+ * @throws {RequiredError}
725
+ */
726
+ getGroups: async (pageIndex, pageSize, search, active, types, internalId, aPIVersion, options = {}) => {
727
+ const localVarPath = `/resource/group`;
728
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
729
+ let baseOptions;
730
+ if (configuration) {
731
+ baseOptions = configuration.baseOptions;
732
+ }
733
+ const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
734
+ const localVarHeaderParameter = {};
735
+ const localVarQueryParameter = {};
736
+ if (pageIndex !== void 0) {
737
+ localVarQueryParameter["pageIndex"] = pageIndex;
738
+ }
739
+ if (pageSize !== void 0) {
740
+ localVarQueryParameter["pageSize"] = pageSize;
741
+ }
742
+ if (search !== void 0) {
743
+ localVarQueryParameter["search"] = search;
744
+ }
745
+ if (active !== void 0) {
746
+ localVarQueryParameter["active"] = active;
747
+ }
748
+ if (types) {
749
+ localVarQueryParameter["types"] = types;
750
+ }
751
+ if (internalId !== void 0) {
752
+ localVarQueryParameter["internalId"] = internalId;
753
+ }
754
+ if (aPIVersion != null) {
755
+ localVarHeaderParameter["API-Version"] = String(aPIVersion);
756
+ }
757
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
758
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
759
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
760
+ return {
761
+ url: toPathString(localVarUrlObj),
762
+ options: localVarRequestOptions
763
+ };
764
+ },
765
+ /**
766
+ * Retrieve a paginated list of resources for your organization. Resources can be documents, consents, forms.
767
+ * @summary Get Resources
768
+ * @param {number} [pageIndex] Page number
769
+ * @param {number} [pageSize] Number of items per page
770
+ * @param {string} [search] Search query to filter by. Is case-insensitive and does not need to match the entire value.
771
+ * @param {boolean} [active] Filter by active status. Accepts true/false as string or boolean.
772
+ * @param {Array<GetResourcesTypesEnum>} [types] Filter by resource types. Can be a single value or array
773
+ * @param {string} [internalId] Identifier to help you identify the resource in your own system. We recommend using a unique value.
774
+ * @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.
775
+ * @param {*} [options] Override http request option.
776
+ * @throws {RequiredError}
777
+ */
778
+ getResources: async (pageIndex, pageSize, search, active, types, internalId, aPIVersion, options = {}) => {
779
+ const localVarPath = `/resource`;
780
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
781
+ let baseOptions;
782
+ if (configuration) {
783
+ baseOptions = configuration.baseOptions;
784
+ }
785
+ const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
786
+ const localVarHeaderParameter = {};
787
+ const localVarQueryParameter = {};
788
+ if (pageIndex !== void 0) {
789
+ localVarQueryParameter["pageIndex"] = pageIndex;
790
+ }
791
+ if (pageSize !== void 0) {
792
+ localVarQueryParameter["pageSize"] = pageSize;
793
+ }
794
+ if (search !== void 0) {
795
+ localVarQueryParameter["search"] = search;
796
+ }
797
+ if (active !== void 0) {
798
+ localVarQueryParameter["active"] = active;
799
+ }
800
+ if (types) {
801
+ localVarQueryParameter["types"] = types;
802
+ }
803
+ if (internalId !== void 0) {
804
+ localVarQueryParameter["internalId"] = internalId;
805
+ }
806
+ if (aPIVersion != null) {
807
+ localVarHeaderParameter["API-Version"] = String(aPIVersion);
808
+ }
809
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
810
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
811
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
812
+ return {
813
+ url: toPathString(localVarUrlObj),
814
+ options: localVarRequestOptions
815
+ };
816
+ }
817
+ };
818
+ };
819
+ var ResourceApiFp = function(configuration) {
820
+ const localVarAxiosParamCreator = ResourceApiAxiosParamCreator(configuration);
821
+ return {
822
+ /**
823
+ * 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.
824
+ * @summary Get Groups
825
+ * @param {number} [pageIndex] Page number
826
+ * @param {number} [pageSize] Number of items per page
827
+ * @param {string} [search] Search query to filter by. Is case-insensitive and does not need to match the entire value.
828
+ * @param {boolean} [active] Filter by active status. Accepts true/false as string or boolean.
829
+ * @param {Array<GetGroupsTypesEnum>} [types] Filter by resource types. Can be a single value or array
830
+ * @param {string} [internalId] Identifier to help you identify the resource in your own system. We recommend using a unique value.
831
+ * @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.
832
+ * @param {*} [options] Override http request option.
833
+ * @throws {RequiredError}
834
+ */
835
+ async getGroups(pageIndex, pageSize, search, active, types, internalId, aPIVersion, options) {
836
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getGroups(pageIndex, pageSize, search, active, types, internalId, aPIVersion, options);
837
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
838
+ const localVarOperationServerBasePath = operationServerMap["ResourceApi.getGroups"]?.[localVarOperationServerIndex]?.url;
839
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios4.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
840
+ },
841
+ /**
842
+ * Retrieve a paginated list of resources for your organization. Resources can be documents, consents, forms.
843
+ * @summary Get Resources
844
+ * @param {number} [pageIndex] Page number
845
+ * @param {number} [pageSize] Number of items per page
846
+ * @param {string} [search] Search query to filter by. Is case-insensitive and does not need to match the entire value.
847
+ * @param {boolean} [active] Filter by active status. Accepts true/false as string or boolean.
848
+ * @param {Array<GetResourcesTypesEnum>} [types] Filter by resource types. Can be a single value or array
849
+ * @param {string} [internalId] Identifier to help you identify the resource in your own system. We recommend using a unique value.
850
+ * @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.
851
+ * @param {*} [options] Override http request option.
852
+ * @throws {RequiredError}
853
+ */
854
+ async getResources(pageIndex, pageSize, search, active, types, internalId, aPIVersion, options) {
855
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getResources(pageIndex, pageSize, search, active, types, internalId, aPIVersion, options);
856
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
857
+ const localVarOperationServerBasePath = operationServerMap["ResourceApi.getResources"]?.[localVarOperationServerIndex]?.url;
858
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios4.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
859
+ }
860
+ };
861
+ };
862
+ var ResourceApiFactory = function(configuration, basePath, axios2) {
863
+ const localVarFp = ResourceApiFp(configuration);
864
+ return {
865
+ /**
866
+ * 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.
867
+ * @summary Get Groups
868
+ * @param {number} [pageIndex] Page number
869
+ * @param {number} [pageSize] Number of items per page
870
+ * @param {string} [search] Search query to filter by. Is case-insensitive and does not need to match the entire value.
871
+ * @param {boolean} [active] Filter by active status. Accepts true/false as string or boolean.
872
+ * @param {Array<GetGroupsTypesEnum>} [types] Filter by resource types. Can be a single value or array
873
+ * @param {string} [internalId] Identifier to help you identify the resource in your own system. We recommend using a unique value.
874
+ * @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.
875
+ * @param {*} [options] Override http request option.
876
+ * @throws {RequiredError}
877
+ */
878
+ getGroups(pageIndex, pageSize, search, active, types, internalId, aPIVersion, options) {
879
+ return localVarFp.getGroups(pageIndex, pageSize, search, active, types, internalId, aPIVersion, options).then((request) => request(axios2, basePath));
880
+ },
881
+ /**
882
+ * Retrieve a paginated list of resources for your organization. Resources can be documents, consents, forms.
883
+ * @summary Get Resources
884
+ * @param {number} [pageIndex] Page number
885
+ * @param {number} [pageSize] Number of items per page
886
+ * @param {string} [search] Search query to filter by. Is case-insensitive and does not need to match the entire value.
887
+ * @param {boolean} [active] Filter by active status. Accepts true/false as string or boolean.
888
+ * @param {Array<GetResourcesTypesEnum>} [types] Filter by resource types. Can be a single value or array
889
+ * @param {string} [internalId] Identifier to help you identify the resource in your own system. We recommend using a unique value.
890
+ * @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.
891
+ * @param {*} [options] Override http request option.
892
+ * @throws {RequiredError}
893
+ */
894
+ getResources(pageIndex, pageSize, search, active, types, internalId, aPIVersion, options) {
895
+ return localVarFp.getResources(pageIndex, pageSize, search, active, types, internalId, aPIVersion, options).then((request) => request(axios2, basePath));
896
+ }
897
+ };
898
+ };
899
+ var ResourceApi = class extends BaseAPI {
900
+ /**
901
+ * 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.
902
+ * @summary Get Groups
903
+ * @param {number} [pageIndex] Page number
904
+ * @param {number} [pageSize] Number of items per page
905
+ * @param {string} [search] Search query to filter by. Is case-insensitive and does not need to match the entire value.
906
+ * @param {boolean} [active] Filter by active status. Accepts true/false as string or boolean.
907
+ * @param {Array<GetGroupsTypesEnum>} [types] Filter by resource types. Can be a single value or array
908
+ * @param {string} [internalId] Identifier to help you identify the resource in your own system. We recommend using a unique value.
909
+ * @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.
910
+ * @param {*} [options] Override http request option.
911
+ * @throws {RequiredError}
912
+ * @memberof ResourceApi
913
+ */
914
+ getGroups(pageIndex, pageSize, search, active, types, internalId, aPIVersion, options) {
915
+ return ResourceApiFp(this.configuration).getGroups(pageIndex, pageSize, search, active, types, internalId, aPIVersion, options).then((request) => request(this.axios, this.basePath));
916
+ }
917
+ /**
918
+ * Retrieve a paginated list of resources for your organization. Resources can be documents, consents, forms.
919
+ * @summary Get Resources
920
+ * @param {number} [pageIndex] Page number
921
+ * @param {number} [pageSize] Number of items per page
922
+ * @param {string} [search] Search query to filter by. Is case-insensitive and does not need to match the entire value.
923
+ * @param {boolean} [active] Filter by active status. Accepts true/false as string or boolean.
924
+ * @param {Array<GetResourcesTypesEnum>} [types] Filter by resource types. Can be a single value or array
925
+ * @param {string} [internalId] Identifier to help you identify the resource in your own system. We recommend using a unique value.
926
+ * @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.
927
+ * @param {*} [options] Override http request option.
928
+ * @throws {RequiredError}
929
+ * @memberof ResourceApi
930
+ */
931
+ getResources(pageIndex, pageSize, search, active, types, internalId, aPIVersion, options) {
932
+ return ResourceApiFp(this.configuration).getResources(pageIndex, pageSize, search, active, types, internalId, aPIVersion, options).then((request) => request(this.axios, this.basePath));
933
+ }
934
+ };
935
+ var GetGroupsTypesEnum = {
936
+ Consent: "CONSENT",
937
+ Form: "FORM",
938
+ Document: "DOCUMENT",
939
+ Json: "JSON"
940
+ };
941
+ var GetResourcesTypesEnum = {
942
+ Consent: "CONSENT",
943
+ Form: "FORM",
944
+ Document: "DOCUMENT",
945
+ Json: "JSON"
946
+ };
947
+
948
+ // generated/api/user-api.ts
949
+ var import_axios5 = __toESM(require("axios"));
950
+ var UserApiAxiosParamCreator = function(configuration) {
951
+ return {
952
+ /**
953
+ * 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.
954
+ * @summary Create User
955
+ * @param {Array<CreateSubjectDto>} createSubjectDto Array of subjects to create. Each subject represents a user to be imported into Humanos
956
+ * @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.
957
+ * @param {*} [options] Override http request option.
958
+ * @throws {RequiredError}
959
+ */
960
+ create: async (createSubjectDto, aPIVersion, options = {}) => {
961
+ assertParamExists("create", "createSubjectDto", createSubjectDto);
962
+ const localVarPath = `/user`;
963
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
964
+ let baseOptions;
965
+ if (configuration) {
966
+ baseOptions = configuration.baseOptions;
967
+ }
968
+ const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
969
+ const localVarHeaderParameter = {};
970
+ const localVarQueryParameter = {};
971
+ localVarHeaderParameter["Content-Type"] = "application/json";
972
+ if (aPIVersion != null) {
973
+ localVarHeaderParameter["API-Version"] = String(aPIVersion);
974
+ }
975
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
976
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
977
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
978
+ localVarRequestOptions.data = serializeDataIfNeeded(createSubjectDto, localVarRequestOptions, configuration);
979
+ return {
980
+ url: toPathString(localVarUrlObj),
981
+ options: localVarRequestOptions
982
+ };
983
+ },
984
+ /**
985
+ * Retrieves detailed information about a user. Can and must be searched by only one of the following: contact, did, or internalId
986
+ * @summary Get User
987
+ * @param {string} [contact] Contact value (email or phone)
988
+ * @param {string} [did] Public Decentralized Identifier (DID) of the user
989
+ * @param {string} [internalId] Identifier to help you identify the user in your own system. We recommend using a unique value.
990
+ * @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.
991
+ * @param {*} [options] Override http request option.
992
+ * @throws {RequiredError}
993
+ */
994
+ getSubject: async (contact, did, internalId, aPIVersion, options = {}) => {
995
+ const localVarPath = `/user`;
996
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
997
+ let baseOptions;
998
+ if (configuration) {
999
+ baseOptions = configuration.baseOptions;
1000
+ }
1001
+ const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
1002
+ const localVarHeaderParameter = {};
1003
+ const localVarQueryParameter = {};
1004
+ if (contact !== void 0) {
1005
+ localVarQueryParameter["contact"] = contact;
1006
+ }
1007
+ if (did !== void 0) {
1008
+ localVarQueryParameter["did"] = did;
1009
+ }
1010
+ if (internalId !== void 0) {
1011
+ localVarQueryParameter["internalId"] = internalId;
1012
+ }
1013
+ if (aPIVersion != null) {
1014
+ localVarHeaderParameter["API-Version"] = String(aPIVersion);
1015
+ }
1016
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
1017
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1018
+ localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
1019
+ return {
1020
+ url: toPathString(localVarUrlObj),
1021
+ options: localVarRequestOptions
1022
+ };
1023
+ }
1024
+ };
1025
+ };
1026
+ var UserApiFp = function(configuration) {
1027
+ const localVarAxiosParamCreator = UserApiAxiosParamCreator(configuration);
1028
+ return {
1029
+ /**
1030
+ * 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.
1031
+ * @summary Create User
1032
+ * @param {Array<CreateSubjectDto>} createSubjectDto Array of subjects to create. Each subject represents a user to be imported into Humanos
1033
+ * @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.
1034
+ * @param {*} [options] Override http request option.
1035
+ * @throws {RequiredError}
1036
+ */
1037
+ async create(createSubjectDto, aPIVersion, options) {
1038
+ const localVarAxiosArgs = await localVarAxiosParamCreator.create(createSubjectDto, aPIVersion, options);
1039
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1040
+ const localVarOperationServerBasePath = operationServerMap["UserApi.create"]?.[localVarOperationServerIndex]?.url;
1041
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios5.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1042
+ },
1043
+ /**
1044
+ * Retrieves detailed information about a user. Can and must be searched by only one of the following: contact, did, or internalId
1045
+ * @summary Get User
1046
+ * @param {string} [contact] Contact value (email or phone)
1047
+ * @param {string} [did] Public Decentralized Identifier (DID) of the user
1048
+ * @param {string} [internalId] Identifier to help you identify the user in your own system. We recommend using a unique value.
1049
+ * @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.
1050
+ * @param {*} [options] Override http request option.
1051
+ * @throws {RequiredError}
1052
+ */
1053
+ async getSubject(contact, did, internalId, aPIVersion, options) {
1054
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getSubject(contact, did, internalId, aPIVersion, options);
1055
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1056
+ const localVarOperationServerBasePath = operationServerMap["UserApi.getSubject"]?.[localVarOperationServerIndex]?.url;
1057
+ return (axios2, basePath) => createRequestFunction(localVarAxiosArgs, import_axios5.default, BASE_PATH, configuration)(axios2, localVarOperationServerBasePath || basePath);
1058
+ }
1059
+ };
1060
+ };
1061
+ var UserApiFactory = function(configuration, basePath, axios2) {
1062
+ const localVarFp = UserApiFp(configuration);
1063
+ return {
1064
+ /**
1065
+ * 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.
1066
+ * @summary Create User
1067
+ * @param {Array<CreateSubjectDto>} createSubjectDto Array of subjects to create. Each subject represents a user to be imported into Humanos
1068
+ * @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.
1069
+ * @param {*} [options] Override http request option.
1070
+ * @throws {RequiredError}
1071
+ */
1072
+ create(createSubjectDto, aPIVersion, options) {
1073
+ return localVarFp.create(createSubjectDto, aPIVersion, options).then((request) => request(axios2, basePath));
1074
+ },
1075
+ /**
1076
+ * Retrieves detailed information about a user. Can and must be searched by only one of the following: contact, did, or internalId
1077
+ * @summary Get User
1078
+ * @param {string} [contact] Contact value (email or phone)
1079
+ * @param {string} [did] Public Decentralized Identifier (DID) of the user
1080
+ * @param {string} [internalId] Identifier to help you identify the user in your own system. We recommend using a unique value.
1081
+ * @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.
1082
+ * @param {*} [options] Override http request option.
1083
+ * @throws {RequiredError}
1084
+ */
1085
+ getSubject(contact, did, internalId, aPIVersion, options) {
1086
+ return localVarFp.getSubject(contact, did, internalId, aPIVersion, options).then((request) => request(axios2, basePath));
1087
+ }
1088
+ };
1089
+ };
1090
+ var UserApi = class extends BaseAPI {
1091
+ /**
1092
+ * 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.
1093
+ * @summary Create User
1094
+ * @param {Array<CreateSubjectDto>} createSubjectDto Array of subjects to create. Each subject represents a user to be imported into Humanos
1095
+ * @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.
1096
+ * @param {*} [options] Override http request option.
1097
+ * @throws {RequiredError}
1098
+ * @memberof UserApi
1099
+ */
1100
+ create(createSubjectDto, aPIVersion, options) {
1101
+ return UserApiFp(this.configuration).create(createSubjectDto, aPIVersion, options).then((request) => request(this.axios, this.basePath));
1102
+ }
1103
+ /**
1104
+ * Retrieves detailed information about a user. Can and must be searched by only one of the following: contact, did, or internalId
1105
+ * @summary Get User
1106
+ * @param {string} [contact] Contact value (email or phone)
1107
+ * @param {string} [did] Public Decentralized Identifier (DID) of the user
1108
+ * @param {string} [internalId] Identifier to help you identify the user in your own system. We recommend using a unique value.
1109
+ * @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.
1110
+ * @param {*} [options] Override http request option.
1111
+ * @throws {RequiredError}
1112
+ * @memberof UserApi
1113
+ */
1114
+ getSubject(contact, did, internalId, aPIVersion, options) {
1115
+ return UserApiFp(this.configuration).getSubject(contact, did, internalId, aPIVersion, options).then((request) => request(this.axios, this.basePath));
1116
+ }
1117
+ };
1118
+
1119
+ // generated/configuration.ts
1120
+ var Configuration = class {
1121
+ constructor(param = {}) {
1122
+ this.apiKey = param.apiKey;
1123
+ this.username = param.username;
1124
+ this.password = param.password;
1125
+ this.accessToken = param.accessToken;
1126
+ this.basePath = param.basePath;
1127
+ this.serverIndex = param.serverIndex;
1128
+ this.baseOptions = param.baseOptions;
1129
+ this.formDataCtor = param.formDataCtor;
1130
+ }
1131
+ /**
1132
+ * Check if the given MIME is a JSON MIME.
1133
+ * JSON MIME examples:
1134
+ * application/json
1135
+ * application/json; charset=UTF8
1136
+ * APPLICATION/JSON
1137
+ * application/vnd.company+json
1138
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
1139
+ * @return True if the given MIME is JSON, false otherwise.
1140
+ */
1141
+ isJsonMime(mime) {
1142
+ const jsonMime = new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$", "i");
1143
+ return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === "application/json-patch+json");
1144
+ }
1145
+ };
1146
+
1147
+ // generated/models/action-type.ts
1148
+ var ActionType = {
1149
+ Issue: "ISSUE",
1150
+ Accept: "ACCEPT",
1151
+ Reject: "REJECT",
1152
+ Revoke: "REVOKE"
1153
+ };
1154
+
1155
+ // generated/models/create-subject-entity.ts
1156
+ var CreateSubjectEntityStatusEnum = {
1157
+ NUMBER_200: 200,
1158
+ NUMBER_201: 201,
1159
+ NUMBER_400: 400,
1160
+ NUMBER_402: 402,
1161
+ NUMBER_407: 407,
1162
+ NUMBER_408: 408,
1163
+ NUMBER_409: 409,
1164
+ NUMBER_410: 410
1165
+ };
1166
+
1167
+ // generated/models/credential-entity.ts
1168
+ var CredentialEntityStatusEnum = {
1169
+ Pending: "PENDING",
1170
+ Approved: "APPROVED",
1171
+ Rejected: "REJECTED",
1172
+ Revoked: "REVOKED"
1173
+ };
1174
+
1175
+ // generated/models/credential-full-entity.ts
1176
+ var CredentialFullEntityStatusEnum = {
1177
+ Pending: "PENDING",
1178
+ Approved: "APPROVED",
1179
+ Rejected: "REJECTED",
1180
+ Revoked: "REVOKED"
1181
+ };
1182
+
1183
+ // generated/models/credential-status.ts
1184
+ var CredentialStatus = {
1185
+ Pending: "PENDING",
1186
+ Approved: "APPROVED",
1187
+ Rejected: "REJECTED",
1188
+ Revoked: "REVOKED"
1189
+ };
1190
+
1191
+ // generated/models/delivery-action-type.ts
1192
+ var DeliveryActionType = {
1193
+ Accept: "accept",
1194
+ Reject: "reject"
1195
+ };
1196
+
1197
+ // generated/models/generate-request-dto.ts
1198
+ var GenerateRequestDtoSecurityLevelEnum = {
1199
+ Contact: "CONTACT",
1200
+ OrganizationKyc: "ORGANIZATION_KYC",
1201
+ HumanosKyc: "HUMANOS_KYC",
1202
+ HumanosRevalidation: "HUMANOS_REVALIDATION"
1203
+ };
1204
+
1205
+ // generated/models/group-resource-entity.ts
1206
+ var GroupResourceEntityTypeEnum = {
1207
+ Consent: "CONSENT",
1208
+ Form: "FORM",
1209
+ Document: "DOCUMENT",
1210
+ Json: "JSON"
1211
+ };
1212
+
1213
+ // generated/models/identity-field-type.ts
1214
+ var IdentityFieldType = {
1215
+ FullName: "FULL_NAME",
1216
+ Birth: "BIRTH",
1217
+ HealthNumber: "HEALTH_NUMBER",
1218
+ TaxNumber: "TAX_NUMBER",
1219
+ DocId: "DOC_ID",
1220
+ CountryAlpha3: "COUNTRY_ALPHA3",
1221
+ SocialSecurityNumber: "SOCIAL_SECURITY_NUMBER",
1222
+ Email: "EMAIL",
1223
+ Phone: "PHONE"
1224
+ };
1225
+
1226
+ // generated/models/mandate-data-dto.ts
1227
+ var MandateDataDtoTypeEnum = {
1228
+ String: "string",
1229
+ Number: "number",
1230
+ Boolean: "boolean",
1231
+ Object: "object",
1232
+ Array: "array",
1233
+ Date: "date",
1234
+ Pdf: "pdf",
1235
+ Url: "url"
1236
+ };
1237
+
1238
+ // generated/models/mandate-data-type.ts
1239
+ var MandateDataType = {
1240
+ String: "string",
1241
+ Number: "number",
1242
+ Boolean: "boolean",
1243
+ Object: "object",
1244
+ Array: "array",
1245
+ Date: "date",
1246
+ Pdf: "pdf",
1247
+ Url: "url"
1248
+ };
1249
+
1250
+ // generated/models/request-detail-entity.ts
1251
+ var RequestDetailEntitySecurityLevelEnum = {
1252
+ Contact: "CONTACT",
1253
+ OrganizationKyc: "ORGANIZATION_KYC",
1254
+ HumanosKyc: "HUMANOS_KYC",
1255
+ HumanosRevalidation: "HUMANOS_REVALIDATION"
1256
+ };
1257
+
1258
+ // generated/models/request-entity.ts
1259
+ var RequestEntitySecurityLevelEnum = {
1260
+ Contact: "CONTACT",
1261
+ OrganizationKyc: "ORGANIZATION_KYC",
1262
+ HumanosKyc: "HUMANOS_KYC",
1263
+ HumanosRevalidation: "HUMANOS_REVALIDATION"
1264
+ };
1265
+
1266
+ // generated/models/request-query.ts
1267
+ var RequestQuerySecurityLevelEnum = {
1268
+ Contact: "CONTACT",
1269
+ OrganizationKyc: "ORGANIZATION_KYC",
1270
+ HumanosKyc: "HUMANOS_KYC",
1271
+ HumanosRevalidation: "HUMANOS_REVALIDATION"
1272
+ };
1273
+
1274
+ // generated/models/resource-entity.ts
1275
+ var ResourceEntityTypeEnum = {
1276
+ Consent: "CONSENT",
1277
+ Form: "FORM",
1278
+ Document: "DOCUMENT",
1279
+ Json: "JSON"
1280
+ };
1281
+
1282
+ // generated/models/resource-query.ts
1283
+ var ResourceQueryTypesEnum = {
1284
+ Consent: "CONSENT",
1285
+ Form: "FORM",
1286
+ Document: "DOCUMENT",
1287
+ Json: "JSON"
1288
+ };
1289
+
1290
+ // generated/models/w3-cproof.ts
1291
+ var W3CProofActionTypeEnum = {
1292
+ Issue: "ISSUE",
1293
+ Accept: "ACCEPT",
1294
+ Reject: "REJECT",
1295
+ Revoke: "REVOKE"
1296
+ };
1297
+
1298
+ // generated/models/webhook-event-type.ts
1299
+ var WebhookEventType = {
1300
+ Credential: "credential",
1301
+ Identity: "identity",
1302
+ OtpFailed: "otp.failed",
1303
+ Test: "test"
1304
+ };
1305
+
1306
+ // generated/models/webhook-event-type-credential.ts
1307
+ var WebhookEventTypeCREDENTIAL = {
1308
+ Credential: "credential"
1309
+ };
1310
+
1311
+ // generated/models/webhook-event-type-identity.ts
1312
+ var WebhookEventTypeIDENTITY = {
1313
+ Identity: "identity"
1314
+ };
1315
+
1316
+ // generated/models/webhook-event-type-otpfailed.ts
1317
+ var WebhookEventTypeOTPFAILED = {
1318
+ OtpFailed: "otp.failed"
1319
+ };
1320
+
1321
+ // generated/models/webhook-event-type-test.ts
1322
+ var WebhookEventTypeTEST = {
1323
+ Test: "test"
1324
+ };
1325
+
1326
+ // src/signature.ts
1327
+ var import_crypto = __toESM(require("crypto"));
1328
+ function generateSignature(body, signatureSecret, timestamp) {
1329
+ const hmac = import_crypto.default.createHmac("sha256", signatureSecret);
1330
+ let bodyString = "";
1331
+ if (body !== void 0 && body !== null) {
1332
+ const stringified = typeof body === "string" ? body : JSON.stringify(body);
1333
+ bodyString = stringified === "{}" ? "" : stringified;
1334
+ }
1335
+ const toSign = bodyString ? `${timestamp}.${bodyString}` : timestamp.toString();
1336
+ hmac.update(toSign);
1337
+ return hmac.digest("hex");
1338
+ }
1339
+ function createSignatureInterceptor(signatureSecret) {
1340
+ return (config) => {
1341
+ const timestamp = Date.now();
1342
+ const signature = generateSignature(
1343
+ config.data,
1344
+ signatureSecret,
1345
+ timestamp
1346
+ );
1347
+ config.headers = config.headers || {};
1348
+ config.headers["X-Timestamp"] = timestamp.toString();
1349
+ config.headers["X-Signature"] = signature;
1350
+ return config;
1351
+ };
1352
+ }
1353
+ function applySignatureInterceptor(axiosInstance, signatureSecret) {
1354
+ axiosInstance.interceptors.request.use(
1355
+ createSignatureInterceptor(signatureSecret)
1356
+ );
1357
+ }
1358
+
1359
+ // src/client.ts
1360
+ var API_VERSION = "2026-03-24";
1361
+ var SDK_LANGUAGE = "typescript";
1362
+ var HumanosClient = class {
1363
+ constructor(clientConfig) {
1364
+ const { basePath, apiKey, signatureSecret, axiosConfig } = clientConfig;
1365
+ this.axios = import_axios6.default.create({
1366
+ baseURL: basePath,
1367
+ headers: {
1368
+ Authorization: `Bearer ${apiKey}`,
1369
+ "Content-Type": "application/json",
1370
+ "api-version": API_VERSION,
1371
+ "X-SDK-Language": SDK_LANGUAGE
1372
+ },
1373
+ ...axiosConfig
1374
+ });
1375
+ applySignatureInterceptor(this.axios, signatureSecret);
1376
+ this.config = new Configuration({
1377
+ basePath,
1378
+ accessToken: apiKey
1379
+ });
1380
+ this.requests = new RequestsApi(this.config, basePath, this.axios);
1381
+ this.resources = new ResourceApi(this.config, basePath, this.axios);
1382
+ this.users = new UserApi(this.config, basePath, this.axios);
1383
+ }
1384
+ };
1385
+ function createHumanosClient(config) {
1386
+ return new HumanosClient(config);
1387
+ }
1388
+
1389
+ // src/webhooks.ts
1390
+ var import_crypto2 = __toESM(require("crypto"));
1391
+ function verifyWebhookSignature(payload, signature, timestamp, signatureSecret, toleranceMs = 5 * 60 * 1e3) {
1392
+ const now = Date.now();
1393
+ if (Math.abs(now - timestamp) > toleranceMs) {
1394
+ return false;
1395
+ }
1396
+ const hmac = import_crypto2.default.createHmac("sha256", signatureSecret);
1397
+ hmac.update(payload ? `${timestamp}.${payload}` : timestamp.toString());
1398
+ const expectedSignature = hmac.digest("hex");
1399
+ try {
1400
+ return import_crypto2.default.timingSafeEqual(
1401
+ Buffer.from(signature),
1402
+ Buffer.from(expectedSignature)
1403
+ );
1404
+ } catch {
1405
+ return false;
1406
+ }
1407
+ }
1408
+ function decryptWebhookPayload(encryptedPayload, encryptionSecret, encryptionSalt) {
1409
+ const { iv, data, tag } = encryptedPayload;
1410
+ const key = import_crypto2.default.pbkdf2Sync(
1411
+ Buffer.from(encryptionSecret, "base64"),
1412
+ encryptionSalt,
1413
+ 1e4,
1414
+ 32,
1415
+ "sha256"
1416
+ );
1417
+ const decipher = import_crypto2.default.createDecipheriv(
1418
+ "aes-256-gcm",
1419
+ key,
1420
+ Buffer.from(iv, "base64")
1421
+ );
1422
+ decipher.setAuthTag(Buffer.from(tag, "base64"));
1423
+ const decrypted = Buffer.concat([
1424
+ decipher.update(Buffer.from(data, "base64")),
1425
+ decipher.final()
1426
+ ]).toString("utf8");
1427
+ return JSON.parse(decrypted);
1428
+ }
1429
+ function processWebhook(rawBody, headers, config) {
1430
+ const signature = headers["x-signature"];
1431
+ const timestamp = parseInt(headers["x-timestamp"], 10);
1432
+ if (!signature || !timestamp) {
1433
+ throw new Error(
1434
+ "Missing required webhook headers: x-signature or x-timestamp"
1435
+ );
1436
+ }
1437
+ const isValid = verifyWebhookSignature(
1438
+ rawBody,
1439
+ signature,
1440
+ timestamp,
1441
+ config.signatureSecret,
1442
+ config.toleranceMs
1443
+ );
1444
+ if (!isValid) {
1445
+ throw new Error("Invalid webhook signature");
1446
+ }
1447
+ const encryptedPayload = JSON.parse(rawBody);
1448
+ return decryptWebhookPayload(
1449
+ encryptedPayload,
1450
+ config.encryptionSecret,
1451
+ config.encryptionSalt
1452
+ );
1453
+ }
1454
+ function createWebhookHandler(config, handler) {
1455
+ return async (req, res) => {
1456
+ try {
1457
+ const rawBody = typeof req.body === "string" ? req.body : JSON.stringify(req.body);
1458
+ const payload = processWebhook(rawBody, req.headers, config);
1459
+ await handler(payload);
1460
+ res.sendStatus(200);
1461
+ } catch (error) {
1462
+ console.error("Webhook processing error:", error);
1463
+ if (error instanceof Error && error.message.includes("signature")) {
1464
+ res.status(401).send("Invalid signature");
1465
+ } else {
1466
+ res.status(500).send("Webhook processing failed");
1467
+ }
1468
+ }
1469
+ };
1470
+ }
1471
+ // Annotate the CommonJS export names for ESM import in node:
1472
+ 0 && (module.exports = {
1473
+ API_VERSION,
1474
+ ActionType,
1475
+ Configuration,
1476
+ CreateSubjectEntityStatusEnum,
1477
+ CredentialEntityStatusEnum,
1478
+ CredentialFullEntityStatusEnum,
1479
+ CredentialStatus,
1480
+ CredentialsApi,
1481
+ CredentialsApiAxiosParamCreator,
1482
+ CredentialsApiFactory,
1483
+ CredentialsApiFp,
1484
+ DeliveryActionType,
1485
+ GenerateRequestDtoSecurityLevelEnum,
1486
+ GetGroupsTypesEnum,
1487
+ GetRequestsSecurityLevelEnum,
1488
+ GetResourcesTypesEnum,
1489
+ GroupResourceEntityTypeEnum,
1490
+ HumanosClient,
1491
+ IdentityFieldType,
1492
+ MandateDataDtoTypeEnum,
1493
+ MandateDataType,
1494
+ RequestDetailEntitySecurityLevelEnum,
1495
+ RequestEntitySecurityLevelEnum,
1496
+ RequestQuerySecurityLevelEnum,
1497
+ RequestsApi,
1498
+ RequestsApiAxiosParamCreator,
1499
+ RequestsApiFactory,
1500
+ RequestsApiFp,
1501
+ ResourceApi,
1502
+ ResourceApiAxiosParamCreator,
1503
+ ResourceApiFactory,
1504
+ ResourceApiFp,
1505
+ ResourceEntityTypeEnum,
1506
+ ResourceQueryTypesEnum,
1507
+ SDK_LANGUAGE,
1508
+ UserApi,
1509
+ UserApiAxiosParamCreator,
1510
+ UserApiFactory,
1511
+ UserApiFp,
1512
+ W3CProofActionTypeEnum,
1513
+ WebhookEventType,
1514
+ WebhookEventTypeCREDENTIAL,
1515
+ WebhookEventTypeIDENTITY,
1516
+ WebhookEventTypeOTPFAILED,
1517
+ WebhookEventTypeTEST,
1518
+ applySignatureInterceptor,
1519
+ createHumanosClient,
1520
+ createSignatureInterceptor,
1521
+ createWebhookHandler,
1522
+ decryptWebhookPayload,
1523
+ generateSignature,
1524
+ processWebhook,
1525
+ verifyWebhookSignature
1526
+ });