humanos 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/README.md +310 -114
  2. package/dist/index.d.mts +3558 -1753
  3. package/dist/index.d.ts +3558 -1753
  4. package/dist/index.js +1621 -499
  5. package/dist/index.mjs +1578 -478
  6. package/generated/.openapi-generator/FILES +59 -33
  7. package/generated/api/actions-api.ts +273 -0
  8. package/generated/api/activity-api.ts +225 -0
  9. package/generated/api/{resource-api.ts → approval-api.ts} +65 -61
  10. package/generated/api/credentials-api.ts +365 -25
  11. package/generated/api/didapi.ts +138 -0
  12. package/generated/api/requests-api.ts +124 -134
  13. package/generated/api/user-api.ts +45 -36
  14. package/generated/api/webhooks-api.ts +84 -56
  15. package/generated/api.ts +5 -1
  16. package/generated/models/action-dto.ts +36 -0
  17. package/generated/models/action-entity.ts +57 -0
  18. package/generated/models/action-list-entity.ts +39 -0
  19. package/generated/models/action-query.ts +48 -0
  20. package/generated/models/action-ref-dto.ts +36 -0
  21. package/generated/models/action-version-detail-entity.ts +72 -0
  22. package/generated/models/action-version-list-entity.ts +39 -0
  23. package/generated/models/action-version-summary-entity.ts +48 -0
  24. package/generated/models/activities-entity.ts +39 -0
  25. package/generated/models/activity-entity.ts +90 -0
  26. package/generated/models/activity-query.ts +96 -0
  27. package/generated/models/consent.ts +36 -0
  28. package/generated/models/constraints-dto.ts +36 -0
  29. package/generated/models/{agent-detail-entity.ts → contact-entity.ts} +8 -8
  30. package/generated/models/create-presentation-dto.ts +30 -0
  31. package/generated/models/create-presentation400-response.ts +42 -0
  32. package/generated/models/create-presentation403-response.ts +42 -0
  33. package/generated/models/create-presentation404-response.ts +42 -0
  34. package/generated/models/create-subject-dto.ts +10 -4
  35. package/generated/models/create-subject-entity.ts +4 -4
  36. package/generated/models/{cancel-request404-response.ts → create400-response.ts} +5 -5
  37. package/generated/models/credential-dto-data-inner.ts +26 -0
  38. package/generated/models/credential-dto.ts +52 -6
  39. package/generated/models/credential-entity.ts +33 -7
  40. package/generated/models/{credential-subject.ts → credential-event-decision.ts} +13 -11
  41. package/generated/models/credential-event-user.ts +1 -1
  42. package/generated/models/credential-event.ts +15 -19
  43. package/generated/models/credential-placement-dto.ts +85 -0
  44. package/generated/models/credential-status.ts +5 -3
  45. package/generated/models/credentials-detail404-response.ts +42 -0
  46. package/generated/models/credentials-evidence404-response.ts +42 -0
  47. package/generated/models/credentials-issue-vp400-response.ts +42 -0
  48. package/generated/models/credentials-issue-vp403-response.ts +42 -0
  49. package/generated/models/credentials-issue-vp404-response.ts +42 -0
  50. package/generated/models/credentials-revoke400-response.ts +42 -0
  51. package/generated/models/credentials-revoke409-response.ts +42 -0
  52. package/generated/models/did-document-entity.ts +63 -0
  53. package/generated/models/evidence.ts +44 -0
  54. package/generated/models/generate-credential-entity.ts +2 -2
  55. package/generated/models/generate-request-dto.ts +18 -15
  56. package/generated/models/generate-request-entity.ts +6 -6
  57. package/generated/models/generate-subject-entity.ts +3 -3
  58. package/generated/models/get-evidence404-response.ts +42 -0
  59. package/generated/models/group-entity.ts +3 -3
  60. package/generated/models/groups-entity.ts +1 -1
  61. package/generated/models/identity-dto.ts +27 -27
  62. package/generated/models/identity-event-decision.ts +13 -1
  63. package/generated/models/{create-subject-user-entity.ts → identity-event-user.ts} +12 -12
  64. package/generated/models/identity-event.ts +14 -18
  65. package/generated/models/{identity-event-identity.ts → identity-payload.ts} +12 -12
  66. package/generated/models/index.ts +55 -32
  67. package/generated/models/{action-type.ts → json-value.ts} +6 -12
  68. package/generated/models/{mandate-data-dto-value.ts → organization-data-entity.ts} +9 -3
  69. package/generated/models/{issuer-detail-entity.ts → otp-error.ts} +8 -8
  70. package/generated/models/otp-failed-event-otp.ts +3 -3
  71. package/generated/models/otp-failed-event.ts +11 -15
  72. package/generated/models/partial-subject-entity.ts +42 -0
  73. package/generated/models/presentation-receipt-entity.ts +42 -0
  74. package/generated/models/presentation-response-entity.ts +39 -0
  75. package/generated/models/receipt-entity.ts +36 -0
  76. package/generated/models/request-credential-entity.ts +72 -0
  77. package/generated/models/request-detail-entity.ts +26 -20
  78. package/generated/models/request-detail-subject-entity.ts +87 -0
  79. package/generated/models/request-entity.ts +14 -8
  80. package/generated/models/request-query.ts +3 -21
  81. package/generated/models/request-subject-entity.ts +21 -6
  82. package/generated/models/requests-create400-response.ts +42 -0
  83. package/generated/models/requests-detail404-response.ts +42 -0
  84. package/generated/models/requests-entity.ts +1 -1
  85. package/generated/models/requests-resend-otp403-response.ts +42 -0
  86. package/generated/models/resend-otp403-response.ts +42 -0
  87. package/generated/models/resource-entity.ts +11 -3
  88. package/generated/models/{group-resource-entity.ts → resource-minimal-entity.ts} +13 -11
  89. package/generated/models/resource-query.ts +3 -1
  90. package/generated/models/resources-entity.ts +1 -1
  91. package/generated/models/revoke-credential-dto.ts +30 -0
  92. package/generated/models/revoke-credential-entity.ts +63 -0
  93. package/generated/models/revoke-credential400-response.ts +42 -0
  94. package/generated/models/revoke-credential409-response.ts +42 -0
  95. package/generated/models/revoke-receipt-entity.ts +42 -0
  96. package/generated/models/schema-entity.ts +57 -0
  97. package/generated/models/schema-list-entity.ts +39 -0
  98. package/generated/models/schema-query.ts +48 -0
  99. package/generated/models/schema-response-entity.ts +45 -0
  100. package/generated/models/schema-version-detail-entity.ts +72 -0
  101. package/generated/models/schema-version-list-entity.ts +39 -0
  102. package/generated/models/schema-version-response-entity.ts +54 -0
  103. package/generated/models/schema-version-summary-entity.ts +48 -0
  104. package/generated/models/subject-contact-entity.ts +7 -7
  105. package/generated/models/subject-issuer-entity.ts +69 -0
  106. package/generated/models/subject-query.ts +4 -4
  107. package/generated/models/test-event.ts +11 -15
  108. package/generated/models/user-create400-response.ts +42 -0
  109. package/generated/models/user-detail400-response.ts +42 -0
  110. package/generated/models/user-detail404-response.ts +42 -0
  111. package/generated/models/verification-method-entity.ts +48 -0
  112. package/generated/models/verify-allow-response-entity.ts +61 -0
  113. package/generated/models/verify-deny-response-entity.ts +79 -0
  114. package/generated/models/verify-evaluation-entity.ts +51 -0
  115. package/generated/models/verify-presentation-dto.ts +36 -0
  116. package/generated/models/verify-receipt-entity.ts +42 -0
  117. package/generated/models/w3-cverifiable-credential-credential-subject-mandate-action.ts +44 -0
  118. package/generated/models/w3-cverifiable-credential-credential-subject-mandate-constraint-constraint-schema.ts +44 -0
  119. package/generated/models/w3-cverifiable-credential-credential-subject-mandate-constraint.ts +41 -0
  120. package/generated/models/w3-cverifiable-credential-credential-subject-mandate-context.ts +32 -0
  121. package/generated/models/{mandate-data-type.ts → w3-cverifiable-credential-credential-subject-mandate-grantor.ts} +3 -16
  122. package/generated/models/w3-cverifiable-credential-credential-subject-mandate.ts +65 -0
  123. package/generated/models/w3-cverifiable-credential-credential-subject.ts +41 -0
  124. package/generated/models/w3-cverifiable-credential-evidences-inner.ts +42 -0
  125. package/generated/models/w3-cverifiable-credential-proofs-inner.ts +62 -0
  126. package/generated/models/w3-cverifiable-credential-valid-from.ts +24 -0
  127. package/generated/models/w3-cverifiable-credential-valid-until.ts +24 -0
  128. package/generated/models/w3-cverifiable-credential.ts +24 -25
  129. package/generated/models/webhook-call-event.ts +6 -12
  130. package/package.json +1 -1
  131. package/generated/models/credential-full-entity.ts +0 -82
  132. package/generated/models/get-credential-entity.ts +0 -48
  133. package/generated/models/identity-field-placement.ts +0 -73
  134. package/generated/models/identity-field-type.ts +0 -38
  135. package/generated/models/mandate-data-dto-type.ts +0 -73
  136. package/generated/models/mandate-data-dto.ts +0 -71
  137. package/generated/models/signature-placement-item-dto.ts +0 -72
  138. package/generated/models/signature-placement.ts +0 -56
  139. package/generated/models/subject-entity.ts +0 -48
  140. package/generated/models/w3-cproof.ts +0 -82
@@ -22,9 +22,35 @@ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObj
22
22
  // @ts-ignore
23
23
  import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
24
24
  // @ts-ignore
25
- import type { GetCredential404Response } from '../models';
25
+ import type { CreatePresentationDto } from '../models';
26
26
  // @ts-ignore
27
- import type { GetCredentialEntity } from '../models';
27
+ import type { CredentialEntity } from '../models';
28
+ // @ts-ignore
29
+ import type { CredentialsDetail404Response } from '../models';
30
+ // @ts-ignore
31
+ import type { CredentialsEvidence404Response } from '../models';
32
+ // @ts-ignore
33
+ import type { CredentialsIssueVP400Response } from '../models';
34
+ // @ts-ignore
35
+ import type { CredentialsIssueVP403Response } from '../models';
36
+ // @ts-ignore
37
+ import type { CredentialsIssueVP404Response } from '../models';
38
+ // @ts-ignore
39
+ import type { CredentialsRevoke400Response } from '../models';
40
+ // @ts-ignore
41
+ import type { CredentialsRevoke409Response } from '../models';
42
+ // @ts-ignore
43
+ import type { PresentationResponseEntity } from '../models';
44
+ // @ts-ignore
45
+ import type { RevokeCredentialDto } from '../models';
46
+ // @ts-ignore
47
+ import type { RevokeCredentialEntity } from '../models';
48
+ // @ts-ignore
49
+ import type { VerifyAllowResponseEntity } from '../models';
50
+ // @ts-ignore
51
+ import type { VerifyDenyResponseEntity } from '../models';
52
+ // @ts-ignore
53
+ import type { VerifyPresentationDto } from '../models';
28
54
  /**
29
55
  * CredentialsApi - axios parameter creator
30
56
  * @export
@@ -32,17 +58,16 @@ import type { GetCredentialEntity } from '../models';
32
58
  export const CredentialsApiAxiosParamCreator = function (configuration?: Configuration) {
33
59
  return {
34
60
  /**
35
- * 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
61
+ * Retrieve a credential by its identifier, including the full W3C Verifiable Credential, and the latest status of all grantor decisions.
36
62
  * @summary Get Credential
37
- * @param {string} credentialId Unique identifier of the credential. Must be a valid MongoDB ObjectId.
38
- * @param {boolean} [includePdf] Whether to include the PDF content for document type credentials
63
+ * @param {string} credentialId Identifier of the credential
39
64
  * @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.
40
65
  * @param {*} [options] Override http request option.
41
66
  * @throws {RequiredError}
42
67
  */
43
- getCredential: async (credentialId: string, includePdf?: boolean, aPIVersion?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
68
+ detail: async (credentialId: string, aPIVersion?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
44
69
  // verify required parameter 'credentialId' is not null or undefined
45
- assertParamExists('getCredential', 'credentialId', credentialId)
70
+ assertParamExists('detail', 'credentialId', credentialId)
46
71
  const localVarPath = `/credential/{credentialId}`
47
72
  .replace(`{${"credentialId"}}`, encodeURIComponent(String(credentialId)));
48
73
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
@@ -56,10 +81,44 @@ export const CredentialsApiAxiosParamCreator = function (configuration?: Configu
56
81
  const localVarHeaderParameter = {} as any;
57
82
  const localVarQueryParameter = {} as any;
58
83
 
59
- if (includePdf !== undefined) {
60
- localVarQueryParameter['includePdf'] = includePdf;
84
+
85
+
86
+ if (aPIVersion != null) {
87
+ localVarHeaderParameter['API-Version'] = String(aPIVersion);
88
+ }
89
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
90
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
91
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
92
+
93
+ return {
94
+ url: toPathString(localVarUrlObj),
95
+ options: localVarRequestOptions,
96
+ };
97
+ },
98
+ /**
99
+ *
100
+ * @summary Get evidence
101
+ * @param {string} evidenceId Unique identifier of the evidence file
102
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
103
+ * @param {*} [options] Override http request option.
104
+ * @throws {RequiredError}
105
+ */
106
+ evidence: async (evidenceId: string, aPIVersion?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
107
+ // verify required parameter 'evidenceId' is not null or undefined
108
+ assertParamExists('evidence', 'evidenceId', evidenceId)
109
+ const localVarPath = `/credential/evidence/{evidenceId}`
110
+ .replace(`{${"evidenceId"}}`, encodeURIComponent(String(evidenceId)));
111
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
112
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
113
+ let baseOptions;
114
+ if (configuration) {
115
+ baseOptions = configuration.baseOptions;
61
116
  }
62
117
 
118
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
119
+ const localVarHeaderParameter = {} as any;
120
+ const localVarQueryParameter = {} as any;
121
+
63
122
 
64
123
 
65
124
  if (aPIVersion != null) {
@@ -69,6 +128,132 @@ export const CredentialsApiAxiosParamCreator = function (configuration?: Configu
69
128
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
70
129
  localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
71
130
 
131
+ return {
132
+ url: toPathString(localVarUrlObj),
133
+ options: localVarRequestOptions,
134
+ };
135
+ },
136
+ /**
137
+ * Build and sign a W3C Verifiable Presentation for a stored credential. The API key must belong to the credential owner.
138
+ * @summary Issue VP
139
+ * @param {string} vcId DID of the credential to present.
140
+ * @param {CreatePresentationDto} createPresentationDto
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\&#39;s date.
142
+ * @param {*} [options] Override http request option.
143
+ * @throws {RequiredError}
144
+ */
145
+ issueVP: async (vcId: string, createPresentationDto: CreatePresentationDto, aPIVersion?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
146
+ // verify required parameter 'vcId' is not null or undefined
147
+ assertParamExists('issueVP', 'vcId', vcId)
148
+ // verify required parameter 'createPresentationDto' is not null or undefined
149
+ assertParamExists('issueVP', 'createPresentationDto', createPresentationDto)
150
+ const localVarPath = `/credential/vp/{vcId}`
151
+ .replace(`{${"vcId"}}`, encodeURIComponent(String(vcId)));
152
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
153
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
154
+ let baseOptions;
155
+ if (configuration) {
156
+ baseOptions = configuration.baseOptions;
157
+ }
158
+
159
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
160
+ const localVarHeaderParameter = {} as any;
161
+ const localVarQueryParameter = {} as any;
162
+
163
+
164
+
165
+ localVarHeaderParameter['Content-Type'] = 'application/json';
166
+
167
+ if (aPIVersion != null) {
168
+ localVarHeaderParameter['API-Version'] = String(aPIVersion);
169
+ }
170
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
171
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
172
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
173
+ localVarRequestOptions.data = serializeDataIfNeeded(createPresentationDto, localVarRequestOptions, configuration)
174
+
175
+ return {
176
+ url: toPathString(localVarUrlObj),
177
+ options: localVarRequestOptions,
178
+ };
179
+ },
180
+ /**
181
+ * Permanently revoke an active credential. Flips status to REVOKED, records revokedAt and revocationReason, Issues a MANDATE_REVOKED receipt, and emits a MANDATE_REVOKED activity event. Subsequent /vp and /verify calls for this credential are denied with reason credential_revoked.
182
+ * @summary Revoke Credential
183
+ * @param {string} credentialId URN of the credential to revoke
184
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
185
+ * @param {RevokeCredentialDto} [revokeCredentialDto]
186
+ * @param {*} [options] Override http request option.
187
+ * @throws {RequiredError}
188
+ */
189
+ revoke: async (credentialId: string, aPIVersion?: string, revokeCredentialDto?: RevokeCredentialDto, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
190
+ // verify required parameter 'credentialId' is not null or undefined
191
+ assertParamExists('revoke', 'credentialId', credentialId)
192
+ const localVarPath = `/credential/revoke/{credentialId}`
193
+ .replace(`{${"credentialId"}}`, encodeURIComponent(String(credentialId)));
194
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
195
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
196
+ let baseOptions;
197
+ if (configuration) {
198
+ baseOptions = configuration.baseOptions;
199
+ }
200
+
201
+ const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
202
+ const localVarHeaderParameter = {} as any;
203
+ const localVarQueryParameter = {} as any;
204
+
205
+
206
+
207
+ localVarHeaderParameter['Content-Type'] = 'application/json';
208
+
209
+ if (aPIVersion != null) {
210
+ localVarHeaderParameter['API-Version'] = String(aPIVersion);
211
+ }
212
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
213
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
214
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
215
+ localVarRequestOptions.data = serializeDataIfNeeded(revokeCredentialDto, localVarRequestOptions, configuration)
216
+
217
+ return {
218
+ url: toPathString(localVarUrlObj),
219
+ options: localVarRequestOptions,
220
+ };
221
+ },
222
+ /**
223
+ * Evaluate a VP against runtime context. On allow, returns 200 with the signed receipt. On deny, returns 403 with the reason, evaluations, and receipt in the error body. If the mandate has no constraint schema, only signatures, verifier access, and validity are checked.
224
+ * @summary Verify VP
225
+ * @param {VerifyPresentationDto} verifyPresentationDto
226
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
227
+ * @param {*} [options] Override http request option.
228
+ * @throws {RequiredError}
229
+ */
230
+ verify: async (verifyPresentationDto: VerifyPresentationDto, aPIVersion?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
231
+ // verify required parameter 'verifyPresentationDto' is not null or undefined
232
+ assertParamExists('verify', 'verifyPresentationDto', verifyPresentationDto)
233
+ const localVarPath = `/credential/verify`;
234
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
235
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
236
+ let baseOptions;
237
+ if (configuration) {
238
+ baseOptions = configuration.baseOptions;
239
+ }
240
+
241
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
242
+ const localVarHeaderParameter = {} as any;
243
+ const localVarQueryParameter = {} as any;
244
+
245
+
246
+
247
+ localVarHeaderParameter['Content-Type'] = 'application/json';
248
+
249
+ if (aPIVersion != null) {
250
+ localVarHeaderParameter['API-Version'] = String(aPIVersion);
251
+ }
252
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
253
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
254
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
255
+ localVarRequestOptions.data = serializeDataIfNeeded(verifyPresentationDto, localVarRequestOptions, configuration)
256
+
72
257
  return {
73
258
  url: toPathString(localVarUrlObj),
74
259
  options: localVarRequestOptions,
@@ -85,18 +270,75 @@ export const CredentialsApiFp = function(configuration?: Configuration) {
85
270
  const localVarAxiosParamCreator = CredentialsApiAxiosParamCreator(configuration)
86
271
  return {
87
272
  /**
88
- * 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
273
+ * Retrieve a credential by its identifier, including the full W3C Verifiable Credential, and the latest status of all grantor decisions.
89
274
  * @summary Get Credential
90
- * @param {string} credentialId Unique identifier of the credential. Must be a valid MongoDB ObjectId.
91
- * @param {boolean} [includePdf] Whether to include the PDF content for document type credentials
275
+ * @param {string} credentialId Identifier of the credential
92
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\&#39;s date.
93
277
  * @param {*} [options] Override http request option.
94
278
  * @throws {RequiredError}
95
279
  */
96
- async getCredential(credentialId: string, includePdf?: boolean, aPIVersion?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetCredentialEntity>> {
97
- const localVarAxiosArgs = await localVarAxiosParamCreator.getCredential(credentialId, includePdf, aPIVersion, options);
280
+ async detail(credentialId: string, aPIVersion?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CredentialEntity>> {
281
+ const localVarAxiosArgs = await localVarAxiosParamCreator.detail(credentialId, aPIVersion, options);
98
282
  const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
99
- const localVarOperationServerBasePath = operationServerMap['CredentialsApi.getCredential']?.[localVarOperationServerIndex]?.url;
283
+ const localVarOperationServerBasePath = operationServerMap['CredentialsApi.detail']?.[localVarOperationServerIndex]?.url;
284
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
285
+ },
286
+ /**
287
+ *
288
+ * @summary Get evidence
289
+ * @param {string} evidenceId Unique identifier of the evidence file
290
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
291
+ * @param {*} [options] Override http request option.
292
+ * @throws {RequiredError}
293
+ */
294
+ async evidence(evidenceId: string, aPIVersion?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> {
295
+ const localVarAxiosArgs = await localVarAxiosParamCreator.evidence(evidenceId, aPIVersion, options);
296
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
297
+ const localVarOperationServerBasePath = operationServerMap['CredentialsApi.evidence']?.[localVarOperationServerIndex]?.url;
298
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
299
+ },
300
+ /**
301
+ * Build and sign a W3C Verifiable Presentation for a stored credential. The API key must belong to the credential owner.
302
+ * @summary Issue VP
303
+ * @param {string} vcId DID of the credential to present.
304
+ * @param {CreatePresentationDto} createPresentationDto
305
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
306
+ * @param {*} [options] Override http request option.
307
+ * @throws {RequiredError}
308
+ */
309
+ async issueVP(vcId: string, createPresentationDto: CreatePresentationDto, aPIVersion?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PresentationResponseEntity>> {
310
+ const localVarAxiosArgs = await localVarAxiosParamCreator.issueVP(vcId, createPresentationDto, aPIVersion, options);
311
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
312
+ const localVarOperationServerBasePath = operationServerMap['CredentialsApi.issueVP']?.[localVarOperationServerIndex]?.url;
313
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
314
+ },
315
+ /**
316
+ * Permanently revoke an active credential. Flips status to REVOKED, records revokedAt and revocationReason, Issues a MANDATE_REVOKED receipt, and emits a MANDATE_REVOKED activity event. Subsequent /vp and /verify calls for this credential are denied with reason credential_revoked.
317
+ * @summary Revoke Credential
318
+ * @param {string} credentialId URN of the credential to revoke
319
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
320
+ * @param {RevokeCredentialDto} [revokeCredentialDto]
321
+ * @param {*} [options] Override http request option.
322
+ * @throws {RequiredError}
323
+ */
324
+ async revoke(credentialId: string, aPIVersion?: string, revokeCredentialDto?: RevokeCredentialDto, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RevokeCredentialEntity>> {
325
+ const localVarAxiosArgs = await localVarAxiosParamCreator.revoke(credentialId, aPIVersion, revokeCredentialDto, options);
326
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
327
+ const localVarOperationServerBasePath = operationServerMap['CredentialsApi.revoke']?.[localVarOperationServerIndex]?.url;
328
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
329
+ },
330
+ /**
331
+ * Evaluate a VP against runtime context. On allow, returns 200 with the signed receipt. On deny, returns 403 with the reason, evaluations, and receipt in the error body. If the mandate has no constraint schema, only signatures, verifier access, and validity are checked.
332
+ * @summary Verify VP
333
+ * @param {VerifyPresentationDto} verifyPresentationDto
334
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
335
+ * @param {*} [options] Override http request option.
336
+ * @throws {RequiredError}
337
+ */
338
+ async verify(verifyPresentationDto: VerifyPresentationDto, aPIVersion?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<VerifyAllowResponseEntity>> {
339
+ const localVarAxiosArgs = await localVarAxiosParamCreator.verify(verifyPresentationDto, aPIVersion, options);
340
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
341
+ const localVarOperationServerBasePath = operationServerMap['CredentialsApi.verify']?.[localVarOperationServerIndex]?.url;
100
342
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
101
343
  },
102
344
  }
@@ -110,16 +352,61 @@ export const CredentialsApiFactory = function (configuration?: Configuration, ba
110
352
  const localVarFp = CredentialsApiFp(configuration)
111
353
  return {
112
354
  /**
113
- * 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
355
+ * Retrieve a credential by its identifier, including the full W3C Verifiable Credential, and the latest status of all grantor decisions.
114
356
  * @summary Get Credential
115
- * @param {string} credentialId Unique identifier of the credential. Must be a valid MongoDB ObjectId.
116
- * @param {boolean} [includePdf] Whether to include the PDF content for document type credentials
357
+ * @param {string} credentialId Identifier of the credential
358
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
359
+ * @param {*} [options] Override http request option.
360
+ * @throws {RequiredError}
361
+ */
362
+ detail(credentialId: string, aPIVersion?: string, options?: RawAxiosRequestConfig): AxiosPromise<CredentialEntity> {
363
+ return localVarFp.detail(credentialId, aPIVersion, options).then((request) => request(axios, basePath));
364
+ },
365
+ /**
366
+ *
367
+ * @summary Get evidence
368
+ * @param {string} evidenceId Unique identifier of the evidence file
369
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
370
+ * @param {*} [options] Override http request option.
371
+ * @throws {RequiredError}
372
+ */
373
+ evidence(evidenceId: string, aPIVersion?: string, options?: RawAxiosRequestConfig): AxiosPromise<string> {
374
+ return localVarFp.evidence(evidenceId, aPIVersion, options).then((request) => request(axios, basePath));
375
+ },
376
+ /**
377
+ * Build and sign a W3C Verifiable Presentation for a stored credential. The API key must belong to the credential owner.
378
+ * @summary Issue VP
379
+ * @param {string} vcId DID of the credential to present.
380
+ * @param {CreatePresentationDto} createPresentationDto
381
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
382
+ * @param {*} [options] Override http request option.
383
+ * @throws {RequiredError}
384
+ */
385
+ issueVP(vcId: string, createPresentationDto: CreatePresentationDto, aPIVersion?: string, options?: RawAxiosRequestConfig): AxiosPromise<PresentationResponseEntity> {
386
+ return localVarFp.issueVP(vcId, createPresentationDto, aPIVersion, options).then((request) => request(axios, basePath));
387
+ },
388
+ /**
389
+ * Permanently revoke an active credential. Flips status to REVOKED, records revokedAt and revocationReason, Issues a MANDATE_REVOKED receipt, and emits a MANDATE_REVOKED activity event. Subsequent /vp and /verify calls for this credential are denied with reason credential_revoked.
390
+ * @summary Revoke Credential
391
+ * @param {string} credentialId URN of the credential to revoke
392
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
393
+ * @param {RevokeCredentialDto} [revokeCredentialDto]
394
+ * @param {*} [options] Override http request option.
395
+ * @throws {RequiredError}
396
+ */
397
+ revoke(credentialId: string, aPIVersion?: string, revokeCredentialDto?: RevokeCredentialDto, options?: RawAxiosRequestConfig): AxiosPromise<RevokeCredentialEntity> {
398
+ return localVarFp.revoke(credentialId, aPIVersion, revokeCredentialDto, options).then((request) => request(axios, basePath));
399
+ },
400
+ /**
401
+ * Evaluate a VP against runtime context. On allow, returns 200 with the signed receipt. On deny, returns 403 with the reason, evaluations, and receipt in the error body. If the mandate has no constraint schema, only signatures, verifier access, and validity are checked.
402
+ * @summary Verify VP
403
+ * @param {VerifyPresentationDto} verifyPresentationDto
117
404
  * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
118
405
  * @param {*} [options] Override http request option.
119
406
  * @throws {RequiredError}
120
407
  */
121
- getCredential(credentialId: string, includePdf?: boolean, aPIVersion?: string, options?: RawAxiosRequestConfig): AxiosPromise<GetCredentialEntity> {
122
- return localVarFp.getCredential(credentialId, includePdf, aPIVersion, options).then((request) => request(axios, basePath));
408
+ verify(verifyPresentationDto: VerifyPresentationDto, aPIVersion?: string, options?: RawAxiosRequestConfig): AxiosPromise<VerifyAllowResponseEntity> {
409
+ return localVarFp.verify(verifyPresentationDto, aPIVersion, options).then((request) => request(axios, basePath));
123
410
  },
124
411
  };
125
412
  };
@@ -132,17 +419,70 @@ export const CredentialsApiFactory = function (configuration?: Configuration, ba
132
419
  */
133
420
  export class CredentialsApi extends BaseAPI {
134
421
  /**
135
- * 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
422
+ * Retrieve a credential by its identifier, including the full W3C Verifiable Credential, and the latest status of all grantor decisions.
136
423
  * @summary Get Credential
137
- * @param {string} credentialId Unique identifier of the credential. Must be a valid MongoDB ObjectId.
138
- * @param {boolean} [includePdf] Whether to include the PDF content for document type credentials
424
+ * @param {string} credentialId Identifier of the credential
425
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
426
+ * @param {*} [options] Override http request option.
427
+ * @throws {RequiredError}
428
+ * @memberof CredentialsApi
429
+ */
430
+ public detail(credentialId: string, aPIVersion?: string, options?: RawAxiosRequestConfig) {
431
+ return CredentialsApiFp(this.configuration).detail(credentialId, aPIVersion, options).then((request) => request(this.axios, this.basePath));
432
+ }
433
+
434
+ /**
435
+ *
436
+ * @summary Get evidence
437
+ * @param {string} evidenceId Unique identifier of the evidence file
438
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
439
+ * @param {*} [options] Override http request option.
440
+ * @throws {RequiredError}
441
+ * @memberof CredentialsApi
442
+ */
443
+ public evidence(evidenceId: string, aPIVersion?: string, options?: RawAxiosRequestConfig) {
444
+ return CredentialsApiFp(this.configuration).evidence(evidenceId, aPIVersion, options).then((request) => request(this.axios, this.basePath));
445
+ }
446
+
447
+ /**
448
+ * Build and sign a W3C Verifiable Presentation for a stored credential. The API key must belong to the credential owner.
449
+ * @summary Issue VP
450
+ * @param {string} vcId DID of the credential to present.
451
+ * @param {CreatePresentationDto} createPresentationDto
452
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
453
+ * @param {*} [options] Override http request option.
454
+ * @throws {RequiredError}
455
+ * @memberof CredentialsApi
456
+ */
457
+ public issueVP(vcId: string, createPresentationDto: CreatePresentationDto, aPIVersion?: string, options?: RawAxiosRequestConfig) {
458
+ return CredentialsApiFp(this.configuration).issueVP(vcId, createPresentationDto, aPIVersion, options).then((request) => request(this.axios, this.basePath));
459
+ }
460
+
461
+ /**
462
+ * Permanently revoke an active credential. Flips status to REVOKED, records revokedAt and revocationReason, Issues a MANDATE_REVOKED receipt, and emits a MANDATE_REVOKED activity event. Subsequent /vp and /verify calls for this credential are denied with reason credential_revoked.
463
+ * @summary Revoke Credential
464
+ * @param {string} credentialId URN of the credential to revoke
465
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
466
+ * @param {RevokeCredentialDto} [revokeCredentialDto]
467
+ * @param {*} [options] Override http request option.
468
+ * @throws {RequiredError}
469
+ * @memberof CredentialsApi
470
+ */
471
+ public revoke(credentialId: string, aPIVersion?: string, revokeCredentialDto?: RevokeCredentialDto, options?: RawAxiosRequestConfig) {
472
+ return CredentialsApiFp(this.configuration).revoke(credentialId, aPIVersion, revokeCredentialDto, options).then((request) => request(this.axios, this.basePath));
473
+ }
474
+
475
+ /**
476
+ * Evaluate a VP against runtime context. On allow, returns 200 with the signed receipt. On deny, returns 403 with the reason, evaluations, and receipt in the error body. If the mandate has no constraint schema, only signatures, verifier access, and validity are checked.
477
+ * @summary Verify VP
478
+ * @param {VerifyPresentationDto} verifyPresentationDto
139
479
  * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
140
480
  * @param {*} [options] Override http request option.
141
481
  * @throws {RequiredError}
142
482
  * @memberof CredentialsApi
143
483
  */
144
- public getCredential(credentialId: string, includePdf?: boolean, aPIVersion?: string, options?: RawAxiosRequestConfig) {
145
- return CredentialsApiFp(this.configuration).getCredential(credentialId, includePdf, aPIVersion, options).then((request) => request(this.axios, this.basePath));
484
+ public verify(verifyPresentationDto: VerifyPresentationDto, aPIVersion?: string, options?: RawAxiosRequestConfig) {
485
+ return CredentialsApiFp(this.configuration).verify(verifyPresentationDto, aPIVersion, options).then((request) => request(this.axios, this.basePath));
146
486
  }
147
487
  }
148
488
 
@@ -0,0 +1,138 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Humanos API
5
+ * Humanos API
6
+ *
7
+ * The version of the OpenAPI document: 1.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import type { Configuration } from '../configuration';
17
+ import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
18
+ import globalAxios from 'axios';
19
+ // Some imports not used depending on template conditions
20
+ // @ts-ignore
21
+ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
22
+ // @ts-ignore
23
+ import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
24
+ // @ts-ignore
25
+ import type { DidDocumentEntity } from '../models';
26
+ /**
27
+ * DIDApi - axios parameter creator
28
+ * @export
29
+ */
30
+ export const DIDApiAxiosParamCreator = function (configuration?: Configuration) {
31
+ return {
32
+ /**
33
+ * Resolve a DID string to a W3C DID 1.1 Document.
34
+ * @summary Resolve DID
35
+ * @param {string} did The DID string to resolve
36
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
37
+ * @param {*} [options] Override http request option.
38
+ * @throws {RequiredError}
39
+ */
40
+ resolve: async (did: string, aPIVersion?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
41
+ // verify required parameter 'did' is not null or undefined
42
+ assertParamExists('resolve', 'did', did)
43
+ const localVarPath = `/did/resolve/{did}`
44
+ .replace(`{${"did"}}`, encodeURIComponent(String(did)));
45
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
46
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
47
+ let baseOptions;
48
+ if (configuration) {
49
+ baseOptions = configuration.baseOptions;
50
+ }
51
+
52
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
53
+ const localVarHeaderParameter = {} as any;
54
+ const localVarQueryParameter = {} as any;
55
+
56
+
57
+
58
+ if (aPIVersion != null) {
59
+ localVarHeaderParameter['API-Version'] = String(aPIVersion);
60
+ }
61
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
62
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
63
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
64
+
65
+ return {
66
+ url: toPathString(localVarUrlObj),
67
+ options: localVarRequestOptions,
68
+ };
69
+ },
70
+ }
71
+ };
72
+
73
+ /**
74
+ * DIDApi - functional programming interface
75
+ * @export
76
+ */
77
+ export const DIDApiFp = function(configuration?: Configuration) {
78
+ const localVarAxiosParamCreator = DIDApiAxiosParamCreator(configuration)
79
+ return {
80
+ /**
81
+ * Resolve a DID string to a W3C DID 1.1 Document.
82
+ * @summary Resolve DID
83
+ * @param {string} did The DID string to resolve
84
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
85
+ * @param {*} [options] Override http request option.
86
+ * @throws {RequiredError}
87
+ */
88
+ async resolve(did: string, aPIVersion?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DidDocumentEntity>> {
89
+ const localVarAxiosArgs = await localVarAxiosParamCreator.resolve(did, aPIVersion, options);
90
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
91
+ const localVarOperationServerBasePath = operationServerMap['DIDApi.resolve']?.[localVarOperationServerIndex]?.url;
92
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
93
+ },
94
+ }
95
+ };
96
+
97
+ /**
98
+ * DIDApi - factory interface
99
+ * @export
100
+ */
101
+ export const DIDApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
102
+ const localVarFp = DIDApiFp(configuration)
103
+ return {
104
+ /**
105
+ * Resolve a DID string to a W3C DID 1.1 Document.
106
+ * @summary Resolve DID
107
+ * @param {string} did The DID string to resolve
108
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
109
+ * @param {*} [options] Override http request option.
110
+ * @throws {RequiredError}
111
+ */
112
+ resolve(did: string, aPIVersion?: string, options?: RawAxiosRequestConfig): AxiosPromise<DidDocumentEntity> {
113
+ return localVarFp.resolve(did, aPIVersion, options).then((request) => request(axios, basePath));
114
+ },
115
+ };
116
+ };
117
+
118
+ /**
119
+ * DIDApi - object-oriented interface
120
+ * @export
121
+ * @class DIDApi
122
+ * @extends {BaseAPI}
123
+ */
124
+ export class DIDApi extends BaseAPI {
125
+ /**
126
+ * Resolve a DID string to a W3C DID 1.1 Document.
127
+ * @summary Resolve DID
128
+ * @param {string} did The DID string to resolve
129
+ * @param {string} [aPIVersion] Pin responses to a specific API version (YYYY-MM-DD). When omitted, defaults to the version stored in your issuer config or today\&#39;s date.
130
+ * @param {*} [options] Override http request option.
131
+ * @throws {RequiredError}
132
+ * @memberof DIDApi
133
+ */
134
+ public resolve(did: string, aPIVersion?: string, options?: RawAxiosRequestConfig) {
135
+ return DIDApiFp(this.configuration).resolve(did, aPIVersion, options).then((request) => request(this.axios, this.basePath));
136
+ }
137
+ }
138
+