@affinidi/cli 1.19.0

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 (120) hide show
  1. package/README.md +231 -0
  2. package/bin/dev +17 -0
  3. package/bin/dev.cmd +3 -0
  4. package/bin/run +5 -0
  5. package/bin/run.cmd +3 -0
  6. package/dist/commands/create/project.d.ts +10 -0
  7. package/dist/commands/create/project.js +41 -0
  8. package/dist/commands/create/project.js.map +1 -0
  9. package/dist/commands/generate-application/index.d.ts +16 -0
  10. package/dist/commands/generate-application/index.js +90 -0
  11. package/dist/commands/generate-application/index.js.map +1 -0
  12. package/dist/commands/issue-vc.d.ts +14 -0
  13. package/dist/commands/issue-vc.js +85 -0
  14. package/dist/commands/issue-vc.js.map +1 -0
  15. package/dist/commands/list/index.d.ts +7 -0
  16. package/dist/commands/list/index.js +24 -0
  17. package/dist/commands/list/index.js.map +1 -0
  18. package/dist/commands/list/projects.d.ts +15 -0
  19. package/dist/commands/list/projects.js +69 -0
  20. package/dist/commands/list/projects.js.map +1 -0
  21. package/dist/commands/list/schemas.d.ts +28 -0
  22. package/dist/commands/list/schemas.js +109 -0
  23. package/dist/commands/list/schemas.js.map +1 -0
  24. package/dist/commands/login/index.d.ts +10 -0
  25. package/dist/commands/login/index.js +50 -0
  26. package/dist/commands/login/index.js.map +1 -0
  27. package/dist/commands/logout/index.d.ts +7 -0
  28. package/dist/commands/logout/index.js +32 -0
  29. package/dist/commands/logout/index.js.map +1 -0
  30. package/dist/commands/show/index.d.ts +7 -0
  31. package/dist/commands/show/index.js +24 -0
  32. package/dist/commands/show/index.js.map +1 -0
  33. package/dist/commands/show/project.d.ts +14 -0
  34. package/dist/commands/show/project.js +84 -0
  35. package/dist/commands/show/project.js.map +1 -0
  36. package/dist/commands/show/schema.d.ts +13 -0
  37. package/dist/commands/show/schema.js +61 -0
  38. package/dist/commands/show/schema.js.map +1 -0
  39. package/dist/commands/sign-up/index.d.ts +10 -0
  40. package/dist/commands/sign-up/index.js +56 -0
  41. package/dist/commands/sign-up/index.js.map +1 -0
  42. package/dist/commands/use/index.d.ts +7 -0
  43. package/dist/commands/use/index.js +20 -0
  44. package/dist/commands/use/index.js.map +1 -0
  45. package/dist/commands/use/project.d.ts +13 -0
  46. package/dist/commands/use/project.js +77 -0
  47. package/dist/commands/use/project.js.map +1 -0
  48. package/dist/commands/verify-vc.d.ts +10 -0
  49. package/dist/commands/verify-vc.js +37 -0
  50. package/dist/commands/verify-vc.js.map +1 -0
  51. package/dist/errors/index.d.ts +20 -0
  52. package/dist/errors/index.js +63 -0
  53. package/dist/errors/index.js.map +1 -0
  54. package/dist/fixtures/mock-projects.d.ts +22 -0
  55. package/dist/fixtures/mock-projects.js +38 -0
  56. package/dist/fixtures/mock-projects.js.map +1 -0
  57. package/dist/fixtures/mock-schemas.d.ts +4 -0
  58. package/dist/fixtures/mock-schemas.js +34 -0
  59. package/dist/fixtures/mock-schemas.js.map +1 -0
  60. package/dist/index.d.ts +1 -0
  61. package/dist/index.js +6 -0
  62. package/dist/index.js.map +1 -0
  63. package/dist/render/functions.d.ts +2 -0
  64. package/dist/render/functions.js +28 -0
  65. package/dist/render/functions.js.map +1 -0
  66. package/dist/render/texts.d.ts +4 -0
  67. package/dist/render/texts.js +31 -0
  68. package/dist/render/texts.js.map +1 -0
  69. package/dist/services/git/index.d.ts +3 -0
  70. package/dist/services/git/index.js +20 -0
  71. package/dist/services/git/index.js.map +1 -0
  72. package/dist/services/iam/iam.api.d.ts +145 -0
  73. package/dist/services/iam/iam.api.js +202 -0
  74. package/dist/services/iam/iam.api.js.map +1 -0
  75. package/dist/services/iam/index.d.ts +11 -0
  76. package/dist/services/iam/index.js +59 -0
  77. package/dist/services/iam/index.js.map +1 -0
  78. package/dist/services/index.d.ts +4 -0
  79. package/dist/services/index.js +13 -0
  80. package/dist/services/index.js.map +1 -0
  81. package/dist/services/issuance/index.d.ts +10 -0
  82. package/dist/services/issuance/index.js +40 -0
  83. package/dist/services/issuance/index.js.map +1 -0
  84. package/dist/services/issuance/issuance.api.d.ts +360 -0
  85. package/dist/services/issuance/issuance.api.js +311 -0
  86. package/dist/services/issuance/issuance.api.js.map +1 -0
  87. package/dist/services/issuance/parse.schema.url.d.ts +5 -0
  88. package/dist/services/issuance/parse.schema.url.js +73 -0
  89. package/dist/services/issuance/parse.schema.url.js.map +1 -0
  90. package/dist/services/schema-manager/index.d.ts +19 -0
  91. package/dist/services/schema-manager/index.js +43 -0
  92. package/dist/services/schema-manager/index.js.map +1 -0
  93. package/dist/services/schema-manager/schema-manager.api.d.ts +279 -0
  94. package/dist/services/schema-manager/schema-manager.api.js +171 -0
  95. package/dist/services/schema-manager/schema-manager.api.js.map +1 -0
  96. package/dist/services/user-management/index.d.ts +35 -0
  97. package/dist/services/user-management/index.js +108 -0
  98. package/dist/services/user-management/index.js.map +1 -0
  99. package/dist/services/user-management/user-management.api.d.ts +110 -0
  100. package/dist/services/user-management/user-management.api.js +185 -0
  101. package/dist/services/user-management/user-management.api.js.map +1 -0
  102. package/dist/services/vault/index.d.ts +23 -0
  103. package/dist/services/vault/index.js +67 -0
  104. package/dist/services/vault/index.js.map +1 -0
  105. package/dist/services/verification/index.d.ts +9 -0
  106. package/dist/services/verification/index.js +29 -0
  107. package/dist/services/verification/index.js.map +1 -0
  108. package/dist/services/verification/verifier.api.d.ts +202 -0
  109. package/dist/services/verification/verifier.api.js +187 -0
  110. package/dist/services/verification/verifier.api.js.map +1 -0
  111. package/dist/services/writer/index.d.ts +3 -0
  112. package/dist/services/writer/index.js +17 -0
  113. package/dist/services/writer/index.js.map +1 -0
  114. package/dist/user-actions/index.d.ts +1 -0
  115. package/dist/user-actions/index.js +13 -0
  116. package/dist/user-actions/index.js.map +1 -0
  117. package/dist/user-actions/prompts.d.ts +10 -0
  118. package/dist/user-actions/prompts.js +36 -0
  119. package/dist/user-actions/prompts.js.map +1 -0
  120. package/package.json +145 -0
@@ -0,0 +1,360 @@
1
+ export interface BatchIssuanceOutput {
2
+ /** Id of the batch Issuance */
3
+ id: string;
4
+ }
5
+ export interface OperationErrorType {
6
+ code: string;
7
+ message: string;
8
+ }
9
+ export interface BatchIssuanceCreateInput {
10
+ /**
11
+ * Id of the Data Source
12
+ * @pattern ^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$
13
+ */
14
+ dataSourceId: string;
15
+ /**
16
+ * Any Schema Manager URL is supported, for example:<br>
17
+ * https://ui.schema.affinidi.com/schemas/MySchemaV1-0<br>
18
+ * https://schema.affinidi.com/MySchemaV1-0.json<br>
19
+ * https://schema.affinidi.com/MySchemaV1-0.jsonld<br>
20
+ */
21
+ schemaURL: string;
22
+ /** Id of the project */
23
+ projectId: string;
24
+ /** information of the person who issue the Vcs */
25
+ issuer: {
26
+ accessToken: string;
27
+ did: string;
28
+ };
29
+ }
30
+ export interface BatchIssuanceListingItem {
31
+ /** VC type. */
32
+ schemaType: string;
33
+ /**
34
+ * Any Schema Manager URL is supported, for example:<br>
35
+ * https://ui.schema.affinidi.com/schemas/MySchemaV1-0<br>
36
+ * https://schema.affinidi.com/MySchemaV1-0.json<br>
37
+ * https://schema.affinidi.com/MySchemaV1-0.jsonld<br>
38
+ */
39
+ schemaURL: string;
40
+ /** Creation date of the bulk Issuance. */
41
+ createdAt: string;
42
+ /** Date of the bulk issuance after changing the status from Pending to Issued. */
43
+ updatedAt: string;
44
+ /**
45
+ * Number of the VCs that are issued.
46
+ * @format double
47
+ */
48
+ issued: number;
49
+ /** Issuing progress of the Bulk Issuance. */
50
+ status: 'PENDING' | 'ISSUED';
51
+ }
52
+ export interface BatchIssuanceRowItem {
53
+ /**
54
+ * Id of a VC
55
+ * @format double
56
+ */
57
+ rowId: number;
58
+ /** Did of ther person who own the VC */
59
+ holderDid: string;
60
+ /** Issuing progress of the single VC Issuance. */
61
+ status: 'PENDING' | 'SUCCESS' | 'ERROR';
62
+ /** Error information if the status is Error */
63
+ error?: string;
64
+ /** Creation date of the bulk Issuance. */
65
+ createdAt: string;
66
+ /** Update date of the VC when its status is changed */
67
+ updatedAt: string;
68
+ }
69
+ export interface BatchIssuanceDetailOutput {
70
+ /** Id of the batch Issuance */
71
+ id: string;
72
+ batchIssuance: BatchIssuanceListingItem;
73
+ batchIssuanceRows: BatchIssuanceRowItem[];
74
+ }
75
+ export interface BatchIssuanceListingOutput {
76
+ results: BatchIssuanceListingItem[];
77
+ }
78
+ export declare type AnyObject = Record<string, any>;
79
+ /**
80
+ * Result of the upload operation which contains the information to reference the data source in later operations.
81
+ */
82
+ export interface UploadFileResponse {
83
+ /** Id of the Data Source that can be used as a reference to start Batch Issuance operations. */
84
+ id: string;
85
+ }
86
+ export declare enum OfferStatus {
87
+ CREATED = "CREATED",
88
+ CLAIMED = "CLAIMED"
89
+ }
90
+ /**
91
+ * The URL interface represents an object providing static methods used for creating object URLs.
92
+ `URL` class is a global reference for `require('url').URL`
93
+ https://nodejs.org/api/url.html#the-whatwg-url-api
94
+ */
95
+ export declare type URL = string;
96
+ /**
97
+ * Description of schema
98
+ */
99
+ export interface SchemaDescription {
100
+ type: string;
101
+ /**
102
+ * The URL interface represents an object providing static methods used for creating object URLs.
103
+ * `URL` class is a global reference for `require('url').URL`
104
+ * https://nodejs.org/api/url.html#the-whatwg-url-api
105
+ */
106
+ jsonLdContextUrl: URL;
107
+ /**
108
+ * The URL interface represents an object providing static methods used for creating object URLs.
109
+ * `URL` class is a global reference for `require('url').URL`
110
+ * https://nodejs.org/api/url.html#the-whatwg-url-api
111
+ */
112
+ jsonSchemaUrl: URL;
113
+ }
114
+ export interface OfferDto {
115
+ verification: {
116
+ target: {
117
+ email: string;
118
+ };
119
+ method: string;
120
+ };
121
+ /** Description of schema */
122
+ schema: SchemaDescription;
123
+ issuerDid: string;
124
+ /** @format date-time */
125
+ expiresAt: string;
126
+ statusLog: {
127
+ /** @format date-time */
128
+ at: string;
129
+ status: OfferStatus;
130
+ }[];
131
+ status: 'CREATED' | 'CLAIMED';
132
+ id: string;
133
+ }
134
+ export interface CreateIssuanceOfferInput {
135
+ verification: {
136
+ target: {
137
+ email: string;
138
+ };
139
+ };
140
+ credentialSubject: AnyObject;
141
+ }
142
+ export declare enum VerificationMethod {
143
+ Email = "email"
144
+ }
145
+ export interface CreateIssuanceOutput {
146
+ id: string;
147
+ }
148
+ export interface CreateIssuanceInput {
149
+ template: {
150
+ verification: {
151
+ method: VerificationMethod;
152
+ };
153
+ schema: {
154
+ jsonLdContextUrl: string;
155
+ jsonSchemaUrl: string;
156
+ type: string;
157
+ };
158
+ issuerDid: string;
159
+ };
160
+ projectId: string;
161
+ }
162
+ export interface IssuanceDto {
163
+ /** @format date-time */
164
+ createdAt: string;
165
+ template: {
166
+ verification: {
167
+ method: VerificationMethod;
168
+ };
169
+ /** Description of schema */
170
+ schema: SchemaDescription;
171
+ issuerDid: string;
172
+ };
173
+ projectId: string;
174
+ id: string;
175
+ }
176
+ export interface AffinidiClaimOutput {
177
+ vcs: AnyObject[];
178
+ }
179
+ export interface AffinidiClaimInput {
180
+ credentialOfferResponseToken: string;
181
+ }
182
+ import { AxiosInstance, AxiosRequestConfig, AxiosResponse, ResponseType } from 'axios';
183
+ export declare type QueryParamsType = Record<string | number, any>;
184
+ export interface FullRequestParams extends Omit<AxiosRequestConfig, 'data' | 'params' | 'url' | 'responseType'> {
185
+ /** set parameter to `true` for call `securityWorker` for this request */
186
+ secure?: boolean;
187
+ /** request path */
188
+ path: string;
189
+ /** content type of request body */
190
+ type?: ContentType;
191
+ /** query params */
192
+ query?: QueryParamsType;
193
+ /** format of response (i.e. response.json() -> format: "json") */
194
+ format?: ResponseType;
195
+ /** request body */
196
+ body?: unknown;
197
+ }
198
+ export declare type RequestParams = Omit<FullRequestParams, 'body' | 'method' | 'query' | 'path'>;
199
+ export interface ApiConfig<SecurityDataType = unknown> extends Omit<AxiosRequestConfig, 'data' | 'cancelToken'> {
200
+ securityWorker?: (securityData: SecurityDataType | null) => Promise<AxiosRequestConfig | void> | AxiosRequestConfig | void;
201
+ secure?: boolean;
202
+ format?: ResponseType;
203
+ }
204
+ export declare enum ContentType {
205
+ Json = "application/json",
206
+ FormData = "multipart/form-data",
207
+ UrlEncoded = "application/x-www-form-urlencoded"
208
+ }
209
+ export declare class HttpClient<SecurityDataType = unknown> {
210
+ instance: AxiosInstance;
211
+ private securityData;
212
+ private securityWorker?;
213
+ private secure?;
214
+ private format?;
215
+ constructor({ securityWorker, secure, format, ...axiosConfig }?: ApiConfig<SecurityDataType>);
216
+ setSecurityData: (data: SecurityDataType | null) => void;
217
+ protected mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig;
218
+ protected stringifyFormItem(formItem: unknown): string;
219
+ protected createFormData(input: Record<string, unknown>): FormData;
220
+ request: <T = any, _E = any>({ secure, path, type, query, format, body, ...params }: FullRequestParams) => Promise<AxiosResponse<T, any>>;
221
+ }
222
+ /**
223
+ * @title console-vc-issuance
224
+ * @version 1.49.1
225
+ * @license ISC
226
+ * @baseUrl /api/v1
227
+ * @contact Yiğitcan UÇUM yigitcan.u@affinidi.com
228
+ *
229
+ * Console VC issuance operations
230
+ */
231
+ export declare class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
232
+ batchIssuance: {
233
+ /**
234
+ * @description Issue VCs in a batch
235
+ *
236
+ * @tags batch-issuance
237
+ * @name Create
238
+ * @request POST:/batch-issuance
239
+ * @secure
240
+ */
241
+ create: (data: BatchIssuanceCreateInput, params?: RequestParams) => Promise<AxiosResponse<BatchIssuanceOutput, any>>;
242
+ /**
243
+ * @description Get all Batch Issuances started in the Project scope
244
+ *
245
+ * @tags batch-issuance
246
+ * @name GetByProjectId
247
+ * @request GET:/batch-issuance
248
+ * @secure
249
+ */
250
+ getByProjectId: (query: {
251
+ projectId: string;
252
+ }, params?: RequestParams) => Promise<AxiosResponse<BatchIssuanceListingOutput, any>>;
253
+ /**
254
+ * @description Get details of a specific batch issuance records and its progress
255
+ *
256
+ * @tags batch-issuance
257
+ * @name Get
258
+ * @request GET:/batch-issuance/{batchIssuanceId}
259
+ * @secure
260
+ */
261
+ get: (batchIssuanceId: string, params?: RequestParams) => Promise<AxiosResponse<BatchIssuanceDetailOutput, any>>;
262
+ /**
263
+ * @description Get the VC issued as part of the Batch Issuance progress, using the corresponding rowId of the Issuance operation
264
+ *
265
+ * @tags batch-issuance
266
+ * @name GetRow
267
+ * @request GET:/batch-issuance/{batchIssuanceId}/row/{rowId}
268
+ * @secure
269
+ */
270
+ getRow: (batchIssuanceId: string, rowId: string, params?: RequestParams) => Promise<AxiosResponse<AnyObject, any>>;
271
+ /**
272
+ * No description
273
+ *
274
+ * @tags data-source
275
+ * @name UploadFile
276
+ * @request POST:/batch-issuance/data-source
277
+ * @secure
278
+ */
279
+ uploadFile: (data: {
280
+ projectId: string;
281
+ /** @format binary */
282
+ file: File;
283
+ }, params?: RequestParams) => Promise<AxiosResponse<UploadFileResponse, any>>;
284
+ };
285
+ issuances: {
286
+ /**
287
+ * No description
288
+ *
289
+ * @tags issuances
290
+ * @name CreateOffer
291
+ * @request POST:/issuances/{issuanceId}/offers
292
+ * @secure
293
+ */
294
+ createOffer: (issuanceId: string, data: CreateIssuanceOfferInput, params?: RequestParams) => Promise<AxiosResponse<OfferDto, any>>;
295
+ /**
296
+ * @description Get all Offers in the Issuance
297
+ *
298
+ * @tags issuances
299
+ * @name SearchOffers
300
+ * @request GET:/issuances/{issuanceId}/offers
301
+ * @secure
302
+ */
303
+ searchOffers: (issuanceId: string, params?: RequestParams) => Promise<AxiosResponse<{
304
+ offers: OfferDto[];
305
+ }, any>>;
306
+ /**
307
+ * No description
308
+ *
309
+ * @tags issuances
310
+ * @name GetCsvTemplate
311
+ * @request GET:/issuances/csv-template
312
+ * @secure
313
+ */
314
+ getCsvTemplate: (query: {
315
+ jsonSchemaUrl: string;
316
+ verificationMethod: VerificationMethod;
317
+ }, params?: RequestParams) => Promise<AxiosResponse<void, any>>;
318
+ /**
319
+ * @description Create issuance
320
+ *
321
+ * @tags issuances
322
+ * @name CreateIssuance
323
+ * @request POST:/issuances
324
+ * @secure
325
+ */
326
+ createIssuance: (data: CreateIssuanceInput, params?: RequestParams) => Promise<AxiosResponse<CreateIssuanceOutput, any>>;
327
+ /**
328
+ * @description Get all Issuances in the Project
329
+ *
330
+ * @tags issuances
331
+ * @name SearchIssuances
332
+ * @request GET:/issuances
333
+ * @secure
334
+ */
335
+ searchIssuances: (query: {
336
+ projectId: string;
337
+ }, params?: RequestParams) => Promise<AxiosResponse<{
338
+ issuances: IssuanceDto[];
339
+ }, any>>;
340
+ /**
341
+ * @description Get details of a specific issuance
342
+ *
343
+ * @tags issuances
344
+ * @name GetIssuance
345
+ * @request GET:/issuances/{issuanceId}
346
+ * @secure
347
+ */
348
+ getIssuance: (issuanceId: string, params?: RequestParams) => Promise<AxiosResponse<IssuanceDto, any>>;
349
+ };
350
+ offers: {
351
+ /**
352
+ * No description
353
+ *
354
+ * @tags offers
355
+ * @name AffinidiClaim
356
+ * @request POST:/offers/{offerId}/affinidi-claim
357
+ */
358
+ affinidiClaim: (offerId: string, data: AffinidiClaimInput, params?: RequestParams) => Promise<AxiosResponse<AffinidiClaimOutput, any>>;
359
+ };
360
+ }
@@ -0,0 +1,311 @@
1
+ "use strict";
2
+ /* eslint-disable */
3
+ /* tslint:disable */
4
+ /*
5
+ * ---------------------------------------------------------------
6
+ * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
7
+ * ## ##
8
+ * ## AUTHOR: acacode ##
9
+ * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
10
+ * ---------------------------------------------------------------
11
+ */
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.Api = exports.HttpClient = exports.ContentType = exports.VerificationMethod = exports.OfferStatus = void 0;
14
+ const tslib_1 = require("tslib");
15
+ var OfferStatus;
16
+ (function (OfferStatus) {
17
+ OfferStatus["CREATED"] = "CREATED";
18
+ OfferStatus["CLAIMED"] = "CLAIMED";
19
+ })(OfferStatus = exports.OfferStatus || (exports.OfferStatus = {}));
20
+ var VerificationMethod;
21
+ (function (VerificationMethod) {
22
+ VerificationMethod["Email"] = "email";
23
+ })(VerificationMethod = exports.VerificationMethod || (exports.VerificationMethod = {}));
24
+ const axios_1 = tslib_1.__importDefault(require("axios"));
25
+ var ContentType;
26
+ (function (ContentType) {
27
+ ContentType["Json"] = "application/json";
28
+ ContentType["FormData"] = "multipart/form-data";
29
+ ContentType["UrlEncoded"] = "application/x-www-form-urlencoded";
30
+ })(ContentType = exports.ContentType || (exports.ContentType = {}));
31
+ class HttpClient {
32
+ constructor({ securityWorker, secure, format, ...axiosConfig } = {}) {
33
+ this.securityData = null;
34
+ this.setSecurityData = (data) => {
35
+ this.securityData = data;
36
+ };
37
+ this.request = async ({ secure, path, type, query, format, body, ...params }) => {
38
+ const secureParams = ((typeof secure === 'boolean' ? secure : this.secure) &&
39
+ this.securityWorker &&
40
+ (await this.securityWorker(this.securityData))) ||
41
+ {};
42
+ const requestParams = this.mergeRequestParams(params, secureParams);
43
+ const responseFormat = format || this.format || undefined;
44
+ if (type === ContentType.FormData && body && body !== null && typeof body === 'object') {
45
+ body = this.createFormData(body);
46
+ }
47
+ return this.instance.request({
48
+ ...requestParams,
49
+ headers: {
50
+ ...(requestParams.headers || {}),
51
+ ...(type && type !== ContentType.FormData ? { 'Content-Type': type } : {}),
52
+ },
53
+ params: query,
54
+ responseType: responseFormat,
55
+ data: body,
56
+ url: path,
57
+ });
58
+ };
59
+ this.instance = axios_1.default.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || '/api/v1' });
60
+ this.secure = secure;
61
+ this.format = format;
62
+ this.securityWorker = securityWorker;
63
+ }
64
+ mergeRequestParams(params1, params2) {
65
+ const method = params1.method || (params2 && params2.method);
66
+ return {
67
+ ...this.instance.defaults,
68
+ ...params1,
69
+ ...(params2 || {}),
70
+ headers: {
71
+ ...((method &&
72
+ this.instance.defaults.headers[method.toLowerCase()]) ||
73
+ {}),
74
+ ...(params1.headers || {}),
75
+ ...((params2 && params2.headers) || {}),
76
+ },
77
+ };
78
+ }
79
+ stringifyFormItem(formItem) {
80
+ if (typeof formItem === 'object' && formItem !== null) {
81
+ return JSON.stringify(formItem);
82
+ }
83
+ else {
84
+ return `${formItem}`;
85
+ }
86
+ }
87
+ createFormData(input) {
88
+ return Object.keys(input || {}).reduce((formData, key) => {
89
+ const property = input[key];
90
+ const propertyContent = property instanceof Array ? property : [property];
91
+ for (const formItem of propertyContent) {
92
+ const isFileType = formItem instanceof Blob || formItem instanceof File;
93
+ formData.append(key, isFileType ? formItem : this.stringifyFormItem(formItem));
94
+ }
95
+ return formData;
96
+ }, new FormData());
97
+ }
98
+ }
99
+ exports.HttpClient = HttpClient;
100
+ /**
101
+ * @title console-vc-issuance
102
+ * @version 1.49.1
103
+ * @license ISC
104
+ * @baseUrl /api/v1
105
+ * @contact Yiğitcan UÇUM yigitcan.u@affinidi.com
106
+ *
107
+ * Console VC issuance operations
108
+ */
109
+ class Api extends HttpClient {
110
+ constructor() {
111
+ super(...arguments);
112
+ this.batchIssuance = {
113
+ /**
114
+ * @description Issue VCs in a batch
115
+ *
116
+ * @tags batch-issuance
117
+ * @name Create
118
+ * @request POST:/batch-issuance
119
+ * @secure
120
+ */
121
+ create: (data, params = {}) => this.request({
122
+ path: `/batch-issuance`,
123
+ method: 'POST',
124
+ body: data,
125
+ secure: true,
126
+ type: ContentType.Json,
127
+ format: 'json',
128
+ ...params,
129
+ }),
130
+ /**
131
+ * @description Get all Batch Issuances started in the Project scope
132
+ *
133
+ * @tags batch-issuance
134
+ * @name GetByProjectId
135
+ * @request GET:/batch-issuance
136
+ * @secure
137
+ */
138
+ getByProjectId: (query, params = {}) => this.request({
139
+ path: `/batch-issuance`,
140
+ method: 'GET',
141
+ query: query,
142
+ secure: true,
143
+ format: 'json',
144
+ ...params,
145
+ }),
146
+ /**
147
+ * @description Get details of a specific batch issuance records and its progress
148
+ *
149
+ * @tags batch-issuance
150
+ * @name Get
151
+ * @request GET:/batch-issuance/{batchIssuanceId}
152
+ * @secure
153
+ */
154
+ get: (batchIssuanceId, params = {}) => this.request({
155
+ path: `/batch-issuance/${batchIssuanceId}`,
156
+ method: 'GET',
157
+ secure: true,
158
+ format: 'json',
159
+ ...params,
160
+ }),
161
+ /**
162
+ * @description Get the VC issued as part of the Batch Issuance progress, using the corresponding rowId of the Issuance operation
163
+ *
164
+ * @tags batch-issuance
165
+ * @name GetRow
166
+ * @request GET:/batch-issuance/{batchIssuanceId}/row/{rowId}
167
+ * @secure
168
+ */
169
+ getRow: (batchIssuanceId, rowId, params = {}) => this.request({
170
+ path: `/batch-issuance/${batchIssuanceId}/row/${rowId}`,
171
+ method: 'GET',
172
+ secure: true,
173
+ format: 'json',
174
+ ...params,
175
+ }),
176
+ /**
177
+ * No description
178
+ *
179
+ * @tags data-source
180
+ * @name UploadFile
181
+ * @request POST:/batch-issuance/data-source
182
+ * @secure
183
+ */
184
+ uploadFile: (data, params = {}) => this.request({
185
+ path: `/batch-issuance/data-source`,
186
+ method: 'POST',
187
+ body: data,
188
+ secure: true,
189
+ type: ContentType.FormData,
190
+ format: 'json',
191
+ ...params,
192
+ }),
193
+ };
194
+ this.issuances = {
195
+ /**
196
+ * No description
197
+ *
198
+ * @tags issuances
199
+ * @name CreateOffer
200
+ * @request POST:/issuances/{issuanceId}/offers
201
+ * @secure
202
+ */
203
+ createOffer: (issuanceId, data, params = {}) => this.request({
204
+ path: `/issuances/${issuanceId}/offers`,
205
+ method: 'POST',
206
+ body: data,
207
+ secure: true,
208
+ type: ContentType.Json,
209
+ format: 'json',
210
+ ...params,
211
+ }),
212
+ /**
213
+ * @description Get all Offers in the Issuance
214
+ *
215
+ * @tags issuances
216
+ * @name SearchOffers
217
+ * @request GET:/issuances/{issuanceId}/offers
218
+ * @secure
219
+ */
220
+ searchOffers: (issuanceId, params = {}) => this.request({
221
+ path: `/issuances/${issuanceId}/offers`,
222
+ method: 'GET',
223
+ secure: true,
224
+ format: 'json',
225
+ ...params,
226
+ }),
227
+ /**
228
+ * No description
229
+ *
230
+ * @tags issuances
231
+ * @name GetCsvTemplate
232
+ * @request GET:/issuances/csv-template
233
+ * @secure
234
+ */
235
+ getCsvTemplate: (query, params = {}) => this.request({
236
+ path: `/issuances/csv-template`,
237
+ method: 'GET',
238
+ query: query,
239
+ secure: true,
240
+ ...params,
241
+ }),
242
+ /**
243
+ * @description Create issuance
244
+ *
245
+ * @tags issuances
246
+ * @name CreateIssuance
247
+ * @request POST:/issuances
248
+ * @secure
249
+ */
250
+ createIssuance: (data, params = {}) => this.request({
251
+ path: `/issuances`,
252
+ method: 'POST',
253
+ body: data,
254
+ secure: true,
255
+ type: ContentType.Json,
256
+ format: 'json',
257
+ ...params,
258
+ }),
259
+ /**
260
+ * @description Get all Issuances in the Project
261
+ *
262
+ * @tags issuances
263
+ * @name SearchIssuances
264
+ * @request GET:/issuances
265
+ * @secure
266
+ */
267
+ searchIssuances: (query, params = {}) => this.request({
268
+ path: `/issuances`,
269
+ method: 'GET',
270
+ query: query,
271
+ secure: true,
272
+ format: 'json',
273
+ ...params,
274
+ }),
275
+ /**
276
+ * @description Get details of a specific issuance
277
+ *
278
+ * @tags issuances
279
+ * @name GetIssuance
280
+ * @request GET:/issuances/{issuanceId}
281
+ * @secure
282
+ */
283
+ getIssuance: (issuanceId, params = {}) => this.request({
284
+ path: `/issuances/${issuanceId}`,
285
+ method: 'GET',
286
+ secure: true,
287
+ format: 'json',
288
+ ...params,
289
+ }),
290
+ };
291
+ this.offers = {
292
+ /**
293
+ * No description
294
+ *
295
+ * @tags offers
296
+ * @name AffinidiClaim
297
+ * @request POST:/offers/{offerId}/affinidi-claim
298
+ */
299
+ affinidiClaim: (offerId, data, params = {}) => this.request({
300
+ path: `/offers/${offerId}/affinidi-claim`,
301
+ method: 'POST',
302
+ body: data,
303
+ type: ContentType.Json,
304
+ format: 'json',
305
+ ...params,
306
+ }),
307
+ };
308
+ }
309
+ }
310
+ exports.Api = Api;
311
+ //# sourceMappingURL=issuance.api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"issuance.api.js","sourceRoot":"","sources":["../../../src/services/issuance/issuance.api.ts"],"names":[],"mappings":";AAAA,oBAAoB;AACpB,oBAAoB;AACpB;;;;;;;GAOG;;;;AAgGH,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;AACrB,CAAC,EAHW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAGtB;AA0DD,IAAY,kBAEX;AAFD,WAAY,kBAAkB;IAC5B,qCAAe,CAAA;AACjB,CAAC,EAFW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAE7B;AA4CD,0DAMc;AA+Bd,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,wCAAyB,CAAA;IACzB,+CAAgC,CAAA;IAChC,+DAAgD,CAAA;AAClD,CAAC,EAJW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAItB;AAED,MAAa,UAAU;IAOrB,YAAY,EACV,cAAc,EACd,MAAM,EACN,MAAM,EACN,GAAG,WAAW,KACiB,EAAE;QAV3B,iBAAY,GAA4B,IAAI,CAAA;QAiB7C,oBAAe,GAAG,CAAC,IAA6B,EAAE,EAAE;YACzD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAA;QAC1B,CAAC,CAAA;QA4CM,YAAO,GAAG,KAAK,EAAqB,EACzC,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,MAAM,EACN,IAAI,EACJ,GAAG,MAAM,EACS,EAA6B,EAAE;YACjD,MAAM,YAAY,GAChB,CAAC,CAAC,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;gBACnD,IAAI,CAAC,cAAc;gBACnB,CAAC,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;gBACjD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