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