@triveria/wallet 0.0.191 → 0.0.193

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 (3) hide show
  1. package/api.d.ts +120 -59
  2. package/api.js +137 -74
  3. package/package.json +1 -1
package/api.d.ts CHANGED
@@ -220,6 +220,25 @@ export interface CredentialImport {
220
220
  */
221
221
  'name': string;
222
222
  }
223
+ /**
224
+ * Request for addition of already created VC to issuance queue for a client specified either by client_id or idTokenRequestId. Either clientId or idTokenRequestId MUST be present.
225
+ * @export
226
+ * @interface CredentialIssuanceInit
227
+ */
228
+ export interface CredentialIssuanceInit {
229
+ /**
230
+ *
231
+ * @type {string}
232
+ * @memberof CredentialIssuanceInit
233
+ */
234
+ 'clientId'?: string;
235
+ /**
236
+ *
237
+ * @type {string}
238
+ * @memberof CredentialIssuanceInit
239
+ */
240
+ 'idTokenRequestId'?: string;
241
+ }
223
242
  /**
224
243
  *
225
244
  * @export
@@ -246,10 +265,10 @@ export interface CredentialIssuerDefinition {
246
265
  'credentialIssuer': CredentialIssuerDefinitionCredentialIssuerEnum;
247
266
  /**
248
267
  *
249
- * @type {CredentialRequirements}
268
+ * @type {VPDrivenIssuerConfig}
250
269
  * @memberof CredentialIssuerDefinition
251
270
  */
252
- 'credentialRequirements'?: CredentialRequirements;
271
+ 'issuerConfiguration'?: VPDrivenIssuerConfig;
253
272
  /**
254
273
  * Format of the issued credential
255
274
  * @type {string}
@@ -267,6 +286,7 @@ export declare const CredentialIssuerDefinitionCredentialIssuerEnum: {
267
286
  readonly CtWalletSame: "CtWalletSame";
268
287
  readonly CtRevocable: "CtRevocable";
269
288
  readonly IssuanceQueue: "IssuanceQueue";
289
+ readonly VpDriven: "VPDriven";
270
290
  };
271
291
  export type CredentialIssuerDefinitionCredentialIssuerEnum = typeof CredentialIssuerDefinitionCredentialIssuerEnum[keyof typeof CredentialIssuerDefinitionCredentialIssuerEnum];
272
292
  /**
@@ -375,6 +395,12 @@ export interface CredentialPayload {
375
395
  * @memberof CredentialPayload
376
396
  */
377
397
  'name': string;
398
+ /**
399
+ * If true, the credential draft is checked against its schema. Defaults to true.
400
+ * @type {boolean}
401
+ * @memberof CredentialPayload
402
+ */
403
+ 'validateSchema'?: boolean;
378
404
  }
379
405
  /**
380
406
  *
@@ -590,7 +616,13 @@ export interface CredentialVerifierDefinition {
590
616
  */
591
617
  'name': string;
592
618
  /**
593
- *
619
+ * Unique ID of the definition
620
+ * @type {string}
621
+ * @memberof CredentialVerifierDefinition
622
+ */
623
+ 'id': string;
624
+ /**
625
+ * Name of verifier authorization scope.
594
626
  * @type {string}
595
627
  * @memberof CredentialVerifierDefinition
596
628
  */
@@ -1027,25 +1059,6 @@ export declare const InteractionAuthorizationRequirementsRequirementTypeEnum: {
1027
1059
  readonly Pin: "pin";
1028
1060
  };
1029
1061
  export type InteractionAuthorizationRequirementsRequirementTypeEnum = typeof InteractionAuthorizationRequirementsRequirementTypeEnum[keyof typeof InteractionAuthorizationRequirementsRequirementTypeEnum];
1030
- /**
1031
- * Request for addition of already created VC to issuance queue for a client specified either by client_id or idTokenRequestId. Either clientId or idTokenRequestId MUST be present.
1032
- * @export
1033
- * @interface IssuanceQueueCredentialAdd
1034
- */
1035
- export interface IssuanceQueueCredentialAdd {
1036
- /**
1037
- *
1038
- * @type {string}
1039
- * @memberof IssuanceQueueCredentialAdd
1040
- */
1041
- 'clientId'?: string;
1042
- /**
1043
- *
1044
- * @type {string}
1045
- * @memberof IssuanceQueueCredentialAdd
1046
- */
1047
- 'idTokenRequestId'?: string;
1048
- }
1049
1062
  /**
1050
1063
  *
1051
1064
  * @export
@@ -1685,6 +1698,25 @@ export interface TermsOfUse {
1685
1698
  */
1686
1699
  'type': string;
1687
1700
  }
1701
+ /**
1702
+ *
1703
+ * @export
1704
+ * @interface VPDrivenIssuerConfig
1705
+ */
1706
+ export interface VPDrivenIssuerConfig {
1707
+ /**
1708
+ * ID of the verifier used for verification of presented credential.
1709
+ * @type {string}
1710
+ * @memberof VPDrivenIssuerConfig
1711
+ */
1712
+ 'credentialVerifierId': string;
1713
+ /**
1714
+ * Mapping of the input values set as JSONPath elements to the output credential claims.
1715
+ * @type {object}
1716
+ * @memberof VPDrivenIssuerConfig
1717
+ */
1718
+ 'mapping'?: object;
1719
+ }
1688
1720
  /**
1689
1721
  * The offer to be accepted. The offer URL is mandatory.
1690
1722
  * @export
@@ -1959,15 +1991,6 @@ export interface WalletNotificationHistory {
1959
1991
  * @export
1960
1992
  */
1961
1993
  export declare const DefaultApiAxiosParamCreator: (configuration?: Configuration) => {
1962
- /**
1963
- * Adds created Verifiable Credential draft to issuance queue for a specified client using authorized in-time or deferred flow.
1964
- * @param {string} credentialId
1965
- * @param {string} walletId
1966
- * @param {IssuanceQueueCredentialAdd} [issuanceQueueCredentialAdd]
1967
- * @param {*} [options] Override http request option.
1968
- * @throws {RequiredError}
1969
- */
1970
- credentialAddToIssuanceQueue: (credentialId: string, walletId: string, issuanceQueueCredentialAdd?: IssuanceQueueCredentialAdd, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
1971
1994
  /**
1972
1995
  * Creates a new draft credential.
1973
1996
  * @param {string} walletId
@@ -1992,6 +2015,15 @@ export declare const DefaultApiAxiosParamCreator: (configuration?: Configuration
1992
2015
  * @throws {RequiredError}
1993
2016
  */
1994
2017
  credentialImport: (walletId: string, credentialImport?: CredentialImport, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
2018
+ /**
2019
+ * Prepares created Verifiable Credential draft for its issuance for a specific client.
2020
+ * @param {string} credentialId
2021
+ * @param {string} walletId
2022
+ * @param {CredentialIssuanceInit} [credentialIssuanceInit]
2023
+ * @param {*} [options] Override http request option.
2024
+ * @throws {RequiredError}
2025
+ */
2026
+ credentialIssuanceInit: (credentialId: string, walletId: string, credentialIssuanceInit?: CredentialIssuanceInit, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
1995
2027
  /**
1996
2028
  * Retrieves a list of credentials.
1997
2029
  * @param {string} walletId
@@ -2049,6 +2081,13 @@ export declare const DefaultApiAxiosParamCreator: (configuration?: Configuration
2049
2081
  * @throws {RequiredError}
2050
2082
  */
2051
2083
  deferredStatus: (deferredId: string, walletId: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
2084
+ /**
2085
+ * Gets the DID Document of the wallet.
2086
+ * @param {string} walletId
2087
+ * @param {*} [options] Override http request option.
2088
+ * @throws {RequiredError}
2089
+ */
2090
+ didDocumentGet: (walletId: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
2052
2091
  /**
2053
2092
  *
2054
2093
  * @param {string} walletId
@@ -2285,15 +2324,6 @@ export declare const DefaultApiAxiosParamCreator: (configuration?: Configuration
2285
2324
  * @export
2286
2325
  */
2287
2326
  export declare const DefaultApiFp: (configuration?: Configuration) => {
2288
- /**
2289
- * Adds created Verifiable Credential draft to issuance queue for a specified client using authorized in-time or deferred flow.
2290
- * @param {string} credentialId
2291
- * @param {string} walletId
2292
- * @param {IssuanceQueueCredentialAdd} [issuanceQueueCredentialAdd]
2293
- * @param {*} [options] Override http request option.
2294
- * @throws {RequiredError}
2295
- */
2296
- credentialAddToIssuanceQueue(credentialId: string, walletId: string, issuanceQueueCredentialAdd?: IssuanceQueueCredentialAdd, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>>;
2297
2327
  /**
2298
2328
  * Creates a new draft credential.
2299
2329
  * @param {string} walletId
@@ -2318,6 +2348,15 @@ export declare const DefaultApiFp: (configuration?: Configuration) => {
2318
2348
  * @throws {RequiredError}
2319
2349
  */
2320
2350
  credentialImport(walletId: string, credentialImport?: CredentialImport, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Credential>>;
2351
+ /**
2352
+ * Prepares created Verifiable Credential draft for its issuance for a specific client.
2353
+ * @param {string} credentialId
2354
+ * @param {string} walletId
2355
+ * @param {CredentialIssuanceInit} [credentialIssuanceInit]
2356
+ * @param {*} [options] Override http request option.
2357
+ * @throws {RequiredError}
2358
+ */
2359
+ credentialIssuanceInit(credentialId: string, walletId: string, credentialIssuanceInit?: CredentialIssuanceInit, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>>;
2321
2360
  /**
2322
2361
  * Retrieves a list of credentials.
2323
2362
  * @param {string} walletId
@@ -2375,6 +2414,13 @@ export declare const DefaultApiFp: (configuration?: Configuration) => {
2375
2414
  * @throws {RequiredError}
2376
2415
  */
2377
2416
  deferredStatus(deferredId: string, walletId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Deferred>>;
2417
+ /**
2418
+ * Gets the DID Document of the wallet.
2419
+ * @param {string} walletId
2420
+ * @param {*} [options] Override http request option.
2421
+ * @throws {RequiredError}
2422
+ */
2423
+ didDocumentGet(walletId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<object>>;
2378
2424
  /**
2379
2425
  *
2380
2426
  * @param {string} walletId
@@ -2611,15 +2657,6 @@ export declare const DefaultApiFp: (configuration?: Configuration) => {
2611
2657
  * @export
2612
2658
  */
2613
2659
  export declare const DefaultApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
2614
- /**
2615
- * Adds created Verifiable Credential draft to issuance queue for a specified client using authorized in-time or deferred flow.
2616
- * @param {string} credentialId
2617
- * @param {string} walletId
2618
- * @param {IssuanceQueueCredentialAdd} [issuanceQueueCredentialAdd]
2619
- * @param {*} [options] Override http request option.
2620
- * @throws {RequiredError}
2621
- */
2622
- credentialAddToIssuanceQueue(credentialId: string, walletId: string, issuanceQueueCredentialAdd?: IssuanceQueueCredentialAdd, options?: RawAxiosRequestConfig): AxiosPromise<void>;
2623
2660
  /**
2624
2661
  * Creates a new draft credential.
2625
2662
  * @param {string} walletId
@@ -2644,6 +2681,15 @@ export declare const DefaultApiFactory: (configuration?: Configuration, basePath
2644
2681
  * @throws {RequiredError}
2645
2682
  */
2646
2683
  credentialImport(walletId: string, credentialImport?: CredentialImport, options?: RawAxiosRequestConfig): AxiosPromise<Credential>;
2684
+ /**
2685
+ * Prepares created Verifiable Credential draft for its issuance for a specific client.
2686
+ * @param {string} credentialId
2687
+ * @param {string} walletId
2688
+ * @param {CredentialIssuanceInit} [credentialIssuanceInit]
2689
+ * @param {*} [options] Override http request option.
2690
+ * @throws {RequiredError}
2691
+ */
2692
+ credentialIssuanceInit(credentialId: string, walletId: string, credentialIssuanceInit?: CredentialIssuanceInit, options?: RawAxiosRequestConfig): AxiosPromise<void>;
2647
2693
  /**
2648
2694
  * Retrieves a list of credentials.
2649
2695
  * @param {string} walletId
@@ -2701,6 +2747,13 @@ export declare const DefaultApiFactory: (configuration?: Configuration, basePath
2701
2747
  * @throws {RequiredError}
2702
2748
  */
2703
2749
  deferredStatus(deferredId: string, walletId: string, options?: RawAxiosRequestConfig): AxiosPromise<Deferred>;
2750
+ /**
2751
+ * Gets the DID Document of the wallet.
2752
+ * @param {string} walletId
2753
+ * @param {*} [options] Override http request option.
2754
+ * @throws {RequiredError}
2755
+ */
2756
+ didDocumentGet(walletId: string, options?: RawAxiosRequestConfig): AxiosPromise<object>;
2704
2757
  /**
2705
2758
  *
2706
2759
  * @param {string} walletId
@@ -2939,16 +2992,6 @@ export declare const DefaultApiFactory: (configuration?: Configuration, basePath
2939
2992
  * @extends {BaseAPI}
2940
2993
  */
2941
2994
  export declare class DefaultApi extends BaseAPI {
2942
- /**
2943
- * Adds created Verifiable Credential draft to issuance queue for a specified client using authorized in-time or deferred flow.
2944
- * @param {string} credentialId
2945
- * @param {string} walletId
2946
- * @param {IssuanceQueueCredentialAdd} [issuanceQueueCredentialAdd]
2947
- * @param {*} [options] Override http request option.
2948
- * @throws {RequiredError}
2949
- * @memberof DefaultApi
2950
- */
2951
- credentialAddToIssuanceQueue(credentialId: string, walletId: string, issuanceQueueCredentialAdd?: IssuanceQueueCredentialAdd, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any>>;
2952
2995
  /**
2953
2996
  * Creates a new draft credential.
2954
2997
  * @param {string} walletId
@@ -2976,6 +3019,16 @@ export declare class DefaultApi extends BaseAPI {
2976
3019
  * @memberof DefaultApi
2977
3020
  */
2978
3021
  credentialImport(walletId: string, credentialImport?: CredentialImport, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<Credential, any>>;
3022
+ /**
3023
+ * Prepares created Verifiable Credential draft for its issuance for a specific client.
3024
+ * @param {string} credentialId
3025
+ * @param {string} walletId
3026
+ * @param {CredentialIssuanceInit} [credentialIssuanceInit]
3027
+ * @param {*} [options] Override http request option.
3028
+ * @throws {RequiredError}
3029
+ * @memberof DefaultApi
3030
+ */
3031
+ credentialIssuanceInit(credentialId: string, walletId: string, credentialIssuanceInit?: CredentialIssuanceInit, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any>>;
2979
3032
  /**
2980
3033
  * Retrieves a list of credentials.
2981
3034
  * @param {string} walletId
@@ -3039,6 +3092,14 @@ export declare class DefaultApi extends BaseAPI {
3039
3092
  * @memberof DefaultApi
3040
3093
  */
3041
3094
  deferredStatus(deferredId: string, walletId: string, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<Deferred, any>>;
3095
+ /**
3096
+ * Gets the DID Document of the wallet.
3097
+ * @param {string} walletId
3098
+ * @param {*} [options] Override http request option.
3099
+ * @throws {RequiredError}
3100
+ * @memberof DefaultApi
3101
+ */
3102
+ didDocumentGet(walletId: string, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<object, any>>;
3042
3103
  /**
3043
3104
  *
3044
3105
  * @param {string} walletId
package/api.js CHANGED
@@ -48,7 +48,8 @@ exports.CredentialFormat = {
48
48
  exports.CredentialIssuerDefinitionCredentialIssuerEnum = {
49
49
  CtWalletSame: 'CtWalletSame',
50
50
  CtRevocable: 'CtRevocable',
51
- IssuanceQueue: 'IssuanceQueue'
51
+ IssuanceQueue: 'IssuanceQueue',
52
+ VpDriven: 'VPDriven'
52
53
  };
53
54
  exports.CredentialMetadataStatusEnum = {
54
55
  Draft: 'draft',
@@ -135,20 +136,16 @@ exports.WalletNotificationEventType = {
135
136
  const DefaultApiAxiosParamCreator = function (configuration) {
136
137
  return {
137
138
  /**
138
- * Adds created Verifiable Credential draft to issuance queue for a specified client using authorized in-time or deferred flow.
139
- * @param {string} credentialId
139
+ * Creates a new draft credential.
140
140
  * @param {string} walletId
141
- * @param {IssuanceQueueCredentialAdd} [issuanceQueueCredentialAdd]
141
+ * @param {CredentialPayload} [credentialPayload] A Verifiable Credential payload in JSON format.
142
142
  * @param {*} [options] Override http request option.
143
143
  * @throws {RequiredError}
144
144
  */
145
- credentialAddToIssuanceQueue: (credentialId, walletId, issuanceQueueCredentialAdd, options = {}) => __awaiter(this, void 0, void 0, function* () {
146
- // verify required parameter 'credentialId' is not null or undefined
147
- (0, common_1.assertParamExists)('credentialAddToIssuanceQueue', 'credentialId', credentialId);
145
+ credentialCreate: (walletId, credentialPayload, options = {}) => __awaiter(this, void 0, void 0, function* () {
148
146
  // verify required parameter 'walletId' is not null or undefined
149
- (0, common_1.assertParamExists)('credentialAddToIssuanceQueue', 'walletId', walletId);
150
- const localVarPath = `/credentials/{credential_id}/add`
151
- .replace(`{${"credential_id"}}`, encodeURIComponent(String(credentialId)));
147
+ (0, common_1.assertParamExists)('credentialCreate', 'walletId', walletId);
148
+ const localVarPath = `/credentials`;
152
149
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
153
150
  const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
154
151
  let baseOptions;
@@ -168,30 +165,33 @@ const DefaultApiAxiosParamCreator = function (configuration) {
168
165
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
169
166
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
170
167
  localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
171
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(issuanceQueueCredentialAdd, localVarRequestOptions, configuration);
168
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(credentialPayload, localVarRequestOptions, configuration);
172
169
  return {
173
170
  url: (0, common_1.toPathString)(localVarUrlObj),
174
171
  options: localVarRequestOptions,
175
172
  };
176
173
  }),
177
174
  /**
178
- * Creates a new draft credential.
175
+ * Retrieves a specific verifiable credential based on the provided identifier. Upon retrieval the status of the credential is checked on the fly and therefore guaranteed.
176
+ * @param {string} credentialId Verifiable Credential Identifier
179
177
  * @param {string} walletId
180
- * @param {CredentialPayload} [credentialPayload] A Verifiable Credential payload in JSON format.
181
178
  * @param {*} [options] Override http request option.
182
179
  * @throws {RequiredError}
183
180
  */
184
- credentialCreate: (walletId, credentialPayload, options = {}) => __awaiter(this, void 0, void 0, function* () {
181
+ credentialGet: (credentialId, walletId, options = {}) => __awaiter(this, void 0, void 0, function* () {
182
+ // verify required parameter 'credentialId' is not null or undefined
183
+ (0, common_1.assertParamExists)('credentialGet', 'credentialId', credentialId);
185
184
  // verify required parameter 'walletId' is not null or undefined
186
- (0, common_1.assertParamExists)('credentialCreate', 'walletId', walletId);
187
- const localVarPath = `/credentials`;
185
+ (0, common_1.assertParamExists)('credentialGet', 'walletId', walletId);
186
+ const localVarPath = `/credentials/{credential_id}`
187
+ .replace(`{${"credential_id"}}`, encodeURIComponent(String(credentialId)));
188
188
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
189
189
  const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
190
190
  let baseOptions;
191
191
  if (configuration) {
192
192
  baseOptions = configuration.baseOptions;
193
193
  }
194
- const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
194
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
195
195
  const localVarHeaderParameter = {};
196
196
  const localVarQueryParameter = {};
197
197
  // authentication accessToken required
@@ -200,37 +200,32 @@ const DefaultApiAxiosParamCreator = function (configuration) {
200
200
  if (walletId != null) {
201
201
  localVarHeaderParameter['wallet-id'] = String(walletId);
202
202
  }
203
- localVarHeaderParameter['Content-Type'] = 'application/json';
204
203
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
205
204
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
206
205
  localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
207
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(credentialPayload, localVarRequestOptions, configuration);
208
206
  return {
209
207
  url: (0, common_1.toPathString)(localVarUrlObj),
210
208
  options: localVarRequestOptions,
211
209
  };
212
210
  }),
213
211
  /**
214
- * Retrieves a specific verifiable credential based on the provided identifier. Upon retrieval the status of the credential is checked on the fly and therefore guaranteed.
215
- * @param {string} credentialId Verifiable Credential Identifier
212
+ * Import pre-signed credential into wallet
216
213
  * @param {string} walletId
214
+ * @param {CredentialImport} [credentialImport] A Verifiable Credential payload in JSON format.
217
215
  * @param {*} [options] Override http request option.
218
216
  * @throws {RequiredError}
219
217
  */
220
- credentialGet: (credentialId, walletId, options = {}) => __awaiter(this, void 0, void 0, function* () {
221
- // verify required parameter 'credentialId' is not null or undefined
222
- (0, common_1.assertParamExists)('credentialGet', 'credentialId', credentialId);
218
+ credentialImport: (walletId, credentialImport, options = {}) => __awaiter(this, void 0, void 0, function* () {
223
219
  // verify required parameter 'walletId' is not null or undefined
224
- (0, common_1.assertParamExists)('credentialGet', 'walletId', walletId);
225
- const localVarPath = `/credentials/{credential_id}`
226
- .replace(`{${"credential_id"}}`, encodeURIComponent(String(credentialId)));
220
+ (0, common_1.assertParamExists)('credentialImport', 'walletId', walletId);
221
+ const localVarPath = `/credentials/import`;
227
222
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
228
223
  const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
229
224
  let baseOptions;
230
225
  if (configuration) {
231
226
  baseOptions = configuration.baseOptions;
232
227
  }
233
- const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
228
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
234
229
  const localVarHeaderParameter = {};
235
230
  const localVarQueryParameter = {};
236
231
  // authentication accessToken required
@@ -239,25 +234,31 @@ const DefaultApiAxiosParamCreator = function (configuration) {
239
234
  if (walletId != null) {
240
235
  localVarHeaderParameter['wallet-id'] = String(walletId);
241
236
  }
237
+ localVarHeaderParameter['Content-Type'] = 'application/json';
242
238
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
243
239
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
244
240
  localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
241
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(credentialImport, localVarRequestOptions, configuration);
245
242
  return {
246
243
  url: (0, common_1.toPathString)(localVarUrlObj),
247
244
  options: localVarRequestOptions,
248
245
  };
249
246
  }),
250
247
  /**
251
- * Import pre-signed credential into wallet
248
+ * Prepares created Verifiable Credential draft for its issuance for a specific client.
249
+ * @param {string} credentialId
252
250
  * @param {string} walletId
253
- * @param {CredentialImport} [credentialImport] A Verifiable Credential payload in JSON format.
251
+ * @param {CredentialIssuanceInit} [credentialIssuanceInit]
254
252
  * @param {*} [options] Override http request option.
255
253
  * @throws {RequiredError}
256
254
  */
257
- credentialImport: (walletId, credentialImport, options = {}) => __awaiter(this, void 0, void 0, function* () {
255
+ credentialIssuanceInit: (credentialId, walletId, credentialIssuanceInit, options = {}) => __awaiter(this, void 0, void 0, function* () {
256
+ // verify required parameter 'credentialId' is not null or undefined
257
+ (0, common_1.assertParamExists)('credentialIssuanceInit', 'credentialId', credentialId);
258
258
  // verify required parameter 'walletId' is not null or undefined
259
- (0, common_1.assertParamExists)('credentialImport', 'walletId', walletId);
260
- const localVarPath = `/credentials/import`;
259
+ (0, common_1.assertParamExists)('credentialIssuanceInit', 'walletId', walletId);
260
+ const localVarPath = `/credentials/{credential_id}/issue/init`
261
+ .replace(`{${"credential_id"}}`, encodeURIComponent(String(credentialId)));
261
262
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
262
263
  const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
263
264
  let baseOptions;
@@ -277,7 +278,7 @@ const DefaultApiAxiosParamCreator = function (configuration) {
277
278
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
278
279
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
279
280
  localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
280
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(credentialImport, localVarRequestOptions, configuration);
281
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(credentialIssuanceInit, localVarRequestOptions, configuration);
281
282
  return {
282
283
  url: (0, common_1.toPathString)(localVarUrlObj),
283
284
  options: localVarRequestOptions,
@@ -534,6 +535,34 @@ const DefaultApiAxiosParamCreator = function (configuration) {
534
535
  options: localVarRequestOptions,
535
536
  };
536
537
  }),
538
+ /**
539
+ * Gets the DID Document of the wallet.
540
+ * @param {string} walletId
541
+ * @param {*} [options] Override http request option.
542
+ * @throws {RequiredError}
543
+ */
544
+ didDocumentGet: (walletId, options = {}) => __awaiter(this, void 0, void 0, function* () {
545
+ // verify required parameter 'walletId' is not null or undefined
546
+ (0, common_1.assertParamExists)('didDocumentGet', 'walletId', walletId);
547
+ const localVarPath = `/{wallet_id}/did.json`
548
+ .replace(`{${"wallet_id"}}`, encodeURIComponent(String(walletId)));
549
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
550
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
551
+ let baseOptions;
552
+ if (configuration) {
553
+ baseOptions = configuration.baseOptions;
554
+ }
555
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
556
+ const localVarHeaderParameter = {};
557
+ const localVarQueryParameter = {};
558
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
559
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
560
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
561
+ return {
562
+ url: (0, common_1.toPathString)(localVarUrlObj),
563
+ options: localVarRequestOptions,
564
+ };
565
+ }),
537
566
  /**
538
567
  *
539
568
  * @param {string} walletId
@@ -1552,23 +1581,6 @@ exports.DefaultApiAxiosParamCreator = DefaultApiAxiosParamCreator;
1552
1581
  const DefaultApiFp = function (configuration) {
1553
1582
  const localVarAxiosParamCreator = (0, exports.DefaultApiAxiosParamCreator)(configuration);
1554
1583
  return {
1555
- /**
1556
- * Adds created Verifiable Credential draft to issuance queue for a specified client using authorized in-time or deferred flow.
1557
- * @param {string} credentialId
1558
- * @param {string} walletId
1559
- * @param {IssuanceQueueCredentialAdd} [issuanceQueueCredentialAdd]
1560
- * @param {*} [options] Override http request option.
1561
- * @throws {RequiredError}
1562
- */
1563
- credentialAddToIssuanceQueue(credentialId, walletId, issuanceQueueCredentialAdd, options) {
1564
- var _a, _b, _c;
1565
- return __awaiter(this, void 0, void 0, function* () {
1566
- const localVarAxiosArgs = yield localVarAxiosParamCreator.credentialAddToIssuanceQueue(credentialId, walletId, issuanceQueueCredentialAdd, options);
1567
- const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
1568
- const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DefaultApi.credentialAddToIssuanceQueue']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
1569
- return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1570
- });
1571
- },
1572
1584
  /**
1573
1585
  * Creates a new draft credential.
1574
1586
  * @param {string} walletId
@@ -1617,6 +1629,23 @@ const DefaultApiFp = function (configuration) {
1617
1629
  return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1618
1630
  });
1619
1631
  },
1632
+ /**
1633
+ * Prepares created Verifiable Credential draft for its issuance for a specific client.
1634
+ * @param {string} credentialId
1635
+ * @param {string} walletId
1636
+ * @param {CredentialIssuanceInit} [credentialIssuanceInit]
1637
+ * @param {*} [options] Override http request option.
1638
+ * @throws {RequiredError}
1639
+ */
1640
+ credentialIssuanceInit(credentialId, walletId, credentialIssuanceInit, options) {
1641
+ var _a, _b, _c;
1642
+ return __awaiter(this, void 0, void 0, function* () {
1643
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.credentialIssuanceInit(credentialId, walletId, credentialIssuanceInit, options);
1644
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
1645
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DefaultApi.credentialIssuanceInit']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
1646
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1647
+ });
1648
+ },
1620
1649
  /**
1621
1650
  * Retrieves a list of credentials.
1622
1651
  * @param {string} walletId
@@ -1722,6 +1751,21 @@ const DefaultApiFp = function (configuration) {
1722
1751
  return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1723
1752
  });
1724
1753
  },
1754
+ /**
1755
+ * Gets the DID Document of the wallet.
1756
+ * @param {string} walletId
1757
+ * @param {*} [options] Override http request option.
1758
+ * @throws {RequiredError}
1759
+ */
1760
+ didDocumentGet(walletId, options) {
1761
+ var _a, _b, _c;
1762
+ return __awaiter(this, void 0, void 0, function* () {
1763
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.didDocumentGet(walletId, options);
1764
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
1765
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DefaultApi.didDocumentGet']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
1766
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1767
+ });
1768
+ },
1725
1769
  /**
1726
1770
  *
1727
1771
  * @param {string} walletId
@@ -2202,17 +2246,6 @@ exports.DefaultApiFp = DefaultApiFp;
2202
2246
  const DefaultApiFactory = function (configuration, basePath, axios) {
2203
2247
  const localVarFp = (0, exports.DefaultApiFp)(configuration);
2204
2248
  return {
2205
- /**
2206
- * Adds created Verifiable Credential draft to issuance queue for a specified client using authorized in-time or deferred flow.
2207
- * @param {string} credentialId
2208
- * @param {string} walletId
2209
- * @param {IssuanceQueueCredentialAdd} [issuanceQueueCredentialAdd]
2210
- * @param {*} [options] Override http request option.
2211
- * @throws {RequiredError}
2212
- */
2213
- credentialAddToIssuanceQueue(credentialId, walletId, issuanceQueueCredentialAdd, options) {
2214
- return localVarFp.credentialAddToIssuanceQueue(credentialId, walletId, issuanceQueueCredentialAdd, options).then((request) => request(axios, basePath));
2215
- },
2216
2249
  /**
2217
2250
  * Creates a new draft credential.
2218
2251
  * @param {string} walletId
@@ -2243,6 +2276,17 @@ const DefaultApiFactory = function (configuration, basePath, axios) {
2243
2276
  credentialImport(walletId, credentialImport, options) {
2244
2277
  return localVarFp.credentialImport(walletId, credentialImport, options).then((request) => request(axios, basePath));
2245
2278
  },
2279
+ /**
2280
+ * Prepares created Verifiable Credential draft for its issuance for a specific client.
2281
+ * @param {string} credentialId
2282
+ * @param {string} walletId
2283
+ * @param {CredentialIssuanceInit} [credentialIssuanceInit]
2284
+ * @param {*} [options] Override http request option.
2285
+ * @throws {RequiredError}
2286
+ */
2287
+ credentialIssuanceInit(credentialId, walletId, credentialIssuanceInit, options) {
2288
+ return localVarFp.credentialIssuanceInit(credentialId, walletId, credentialIssuanceInit, options).then((request) => request(axios, basePath));
2289
+ },
2246
2290
  /**
2247
2291
  * Retrieves a list of credentials.
2248
2292
  * @param {string} walletId
@@ -2312,6 +2356,15 @@ const DefaultApiFactory = function (configuration, basePath, axios) {
2312
2356
  deferredStatus(deferredId, walletId, options) {
2313
2357
  return localVarFp.deferredStatus(deferredId, walletId, options).then((request) => request(axios, basePath));
2314
2358
  },
2359
+ /**
2360
+ * Gets the DID Document of the wallet.
2361
+ * @param {string} walletId
2362
+ * @param {*} [options] Override http request option.
2363
+ * @throws {RequiredError}
2364
+ */
2365
+ didDocumentGet(walletId, options) {
2366
+ return localVarFp.didDocumentGet(walletId, options).then((request) => request(axios, basePath));
2367
+ },
2315
2368
  /**
2316
2369
  *
2317
2370
  * @param {string} walletId
@@ -2612,18 +2665,6 @@ exports.DefaultApiFactory = DefaultApiFactory;
2612
2665
  * @extends {BaseAPI}
2613
2666
  */
2614
2667
  class DefaultApi extends base_1.BaseAPI {
2615
- /**
2616
- * Adds created Verifiable Credential draft to issuance queue for a specified client using authorized in-time or deferred flow.
2617
- * @param {string} credentialId
2618
- * @param {string} walletId
2619
- * @param {IssuanceQueueCredentialAdd} [issuanceQueueCredentialAdd]
2620
- * @param {*} [options] Override http request option.
2621
- * @throws {RequiredError}
2622
- * @memberof DefaultApi
2623
- */
2624
- credentialAddToIssuanceQueue(credentialId, walletId, issuanceQueueCredentialAdd, options) {
2625
- return (0, exports.DefaultApiFp)(this.configuration).credentialAddToIssuanceQueue(credentialId, walletId, issuanceQueueCredentialAdd, options).then((request) => request(this.axios, this.basePath));
2626
- }
2627
2668
  /**
2628
2669
  * Creates a new draft credential.
2629
2670
  * @param {string} walletId
@@ -2657,6 +2698,18 @@ class DefaultApi extends base_1.BaseAPI {
2657
2698
  credentialImport(walletId, credentialImport, options) {
2658
2699
  return (0, exports.DefaultApiFp)(this.configuration).credentialImport(walletId, credentialImport, options).then((request) => request(this.axios, this.basePath));
2659
2700
  }
2701
+ /**
2702
+ * Prepares created Verifiable Credential draft for its issuance for a specific client.
2703
+ * @param {string} credentialId
2704
+ * @param {string} walletId
2705
+ * @param {CredentialIssuanceInit} [credentialIssuanceInit]
2706
+ * @param {*} [options] Override http request option.
2707
+ * @throws {RequiredError}
2708
+ * @memberof DefaultApi
2709
+ */
2710
+ credentialIssuanceInit(credentialId, walletId, credentialIssuanceInit, options) {
2711
+ return (0, exports.DefaultApiFp)(this.configuration).credentialIssuanceInit(credentialId, walletId, credentialIssuanceInit, options).then((request) => request(this.axios, this.basePath));
2712
+ }
2660
2713
  /**
2661
2714
  * Retrieves a list of credentials.
2662
2715
  * @param {string} walletId
@@ -2732,6 +2785,16 @@ class DefaultApi extends base_1.BaseAPI {
2732
2785
  deferredStatus(deferredId, walletId, options) {
2733
2786
  return (0, exports.DefaultApiFp)(this.configuration).deferredStatus(deferredId, walletId, options).then((request) => request(this.axios, this.basePath));
2734
2787
  }
2788
+ /**
2789
+ * Gets the DID Document of the wallet.
2790
+ * @param {string} walletId
2791
+ * @param {*} [options] Override http request option.
2792
+ * @throws {RequiredError}
2793
+ * @memberof DefaultApi
2794
+ */
2795
+ didDocumentGet(walletId, options) {
2796
+ return (0, exports.DefaultApiFp)(this.configuration).didDocumentGet(walletId, options).then((request) => request(this.axios, this.basePath));
2797
+ }
2735
2798
  /**
2736
2799
  *
2737
2800
  * @param {string} walletId
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@triveria/wallet",
3
3
  "private": false,
4
- "version": "0.0.191",
4
+ "version": "0.0.193",
5
5
  "description": "",
6
6
  "main": "index.js",
7
7
  "scripts": {