@cheqd/studio 3.16.0-develop.9 → 3.16.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 (61) hide show
  1. package/dist/app.d.ts.map +1 -1
  2. package/dist/app.js +11 -0
  3. package/dist/app.js.map +1 -1
  4. package/dist/controllers/api/accreditation.js +1 -1
  5. package/dist/controllers/api/accreditation.js.map +1 -1
  6. package/dist/controllers/api/credential.d.ts +1 -1
  7. package/dist/controllers/api/credential.d.ts.map +1 -1
  8. package/dist/controllers/api/credential.js +2 -1
  9. package/dist/controllers/api/credential.js.map +1 -1
  10. package/dist/controllers/api/received-credential.d.ts +375 -0
  11. package/dist/controllers/api/received-credential.d.ts.map +1 -0
  12. package/dist/controllers/api/received-credential.js +650 -0
  13. package/dist/controllers/api/received-credential.js.map +1 -0
  14. package/dist/database/entities/issued-credential.entity.d.ts +18 -2
  15. package/dist/database/entities/issued-credential.entity.d.ts.map +1 -1
  16. package/dist/database/entities/issued-credential.entity.js +29 -0
  17. package/dist/database/entities/issued-credential.entity.js.map +1 -1
  18. package/dist/database/migrations/1766408271347-studio-migrations.d.ts +7 -0
  19. package/dist/database/migrations/1766408271347-studio-migrations.d.ts.map +1 -0
  20. package/dist/database/migrations/1766408271347-studio-migrations.js +16 -0
  21. package/dist/database/migrations/1766408271347-studio-migrations.js.map +1 -0
  22. package/dist/database/types/types.d.ts.map +1 -1
  23. package/dist/database/types/types.js +2 -0
  24. package/dist/database/types/types.js.map +1 -1
  25. package/dist/middleware/auth/routes/api/credential-auth.d.ts.map +1 -1
  26. package/dist/middleware/auth/routes/api/credential-auth.js +12 -0
  27. package/dist/middleware/auth/routes/api/credential-auth.js.map +1 -1
  28. package/dist/services/api/accreditation.d.ts.map +1 -1
  29. package/dist/services/api/accreditation.js +8 -1
  30. package/dist/services/api/accreditation.js.map +1 -1
  31. package/dist/services/api/credentials.d.ts.map +1 -1
  32. package/dist/services/api/credentials.js +38 -6
  33. package/dist/services/api/credentials.js.map +1 -1
  34. package/dist/services/api/received-credentials.d.ts +129 -0
  35. package/dist/services/api/received-credentials.d.ts.map +1 -0
  36. package/dist/services/api/received-credentials.js +498 -0
  37. package/dist/services/api/received-credentials.js.map +1 -0
  38. package/dist/services/identity/abstract.d.ts +4 -0
  39. package/dist/services/identity/abstract.d.ts.map +1 -1
  40. package/dist/services/identity/abstract.js +12 -0
  41. package/dist/services/identity/abstract.js.map +1 -1
  42. package/dist/services/identity/index.d.ts +22 -0
  43. package/dist/services/identity/index.d.ts.map +1 -1
  44. package/dist/services/identity/index.js.map +1 -1
  45. package/dist/services/identity/providers/studio/agent.d.ts +15 -0
  46. package/dist/services/identity/providers/studio/agent.d.ts.map +1 -1
  47. package/dist/services/identity/providers/studio/agent.js +51 -9
  48. package/dist/services/identity/providers/studio/agent.js.map +1 -1
  49. package/dist/services/identity/providers/studio/local.d.ts +4 -0
  50. package/dist/services/identity/providers/studio/local.d.ts.map +1 -1
  51. package/dist/services/identity/providers/studio/local.js +12 -0
  52. package/dist/services/identity/providers/studio/local.js.map +1 -1
  53. package/dist/services/identity/providers/studio/postgres.d.ts +7 -0
  54. package/dist/services/identity/providers/studio/postgres.d.ts.map +1 -1
  55. package/dist/services/identity/providers/studio/postgres.js +19 -0
  56. package/dist/services/identity/providers/studio/postgres.js.map +1 -1
  57. package/dist/services/track/admin/account-submitter.d.ts.map +1 -1
  58. package/dist/services/track/admin/account-submitter.js +1 -3
  59. package/dist/services/track/admin/account-submitter.js.map +1 -1
  60. package/dist/static/swagger-api.json +526 -1
  61. package/package.json +4 -4
@@ -0,0 +1,375 @@
1
+ import type { Request, Response } from 'express';
2
+ export declare class ReceivedCredentialController {
3
+ static listOffersValidator: import("express-validator").ValidationChainWithExtensions<"isDID" | "isDIDArray" | "isDIDDocument" | "isVerificationMethod" | "isCreateDIDDocumentService" | "isService" | "isCheqdDidLinkedAlsoKnownAs" | "isKeyDID" | "isW3CCheqdCredential" | "isW3CCheqdCredentials" | "isW3CCheqdPresentation" | "isVeridaDID">[];
4
+ static getOfferValidator: import("express-validator").ValidationChainWithExtensions<"isDID" | "isDIDArray" | "isDIDDocument" | "isVerificationMethod" | "isCreateDIDDocumentService" | "isService" | "isCheqdDidLinkedAlsoKnownAs" | "isKeyDID" | "isW3CCheqdCredential" | "isW3CCheqdCredentials" | "isW3CCheqdPresentation" | "isVeridaDID">[];
5
+ static acceptOfferValidator: import("express-validator").ValidationChainWithExtensions<"isDID" | "isDIDArray" | "isDIDDocument" | "isVerificationMethod" | "isCreateDIDDocumentService" | "isService" | "isCheqdDidLinkedAlsoKnownAs" | "isKeyDID" | "isW3CCheqdCredential" | "isW3CCheqdCredentials" | "isW3CCheqdPresentation" | "isVeridaDID">[];
6
+ static rejectOfferValidator: import("express-validator").ValidationChainWithExtensions<"isDID" | "isDIDArray" | "isDIDDocument" | "isVerificationMethod" | "isCreateDIDDocumentService" | "isService" | "isCheqdDidLinkedAlsoKnownAs" | "isKeyDID" | "isW3CCheqdCredential" | "isW3CCheqdCredentials" | "isW3CCheqdPresentation" | "isVeridaDID">[];
7
+ static importValidator: import("express-validator").ValidationChainWithExtensions<"isDID" | "isDIDArray" | "isDIDDocument" | "isVerificationMethod" | "isCreateDIDDocumentService" | "isService" | "isCheqdDidLinkedAlsoKnownAs" | "isKeyDID" | "isW3CCheqdCredential" | "isW3CCheqdCredentials" | "isW3CCheqdPresentation" | "isVeridaDID">[];
8
+ static listReceivedValidator: import("express-validator").ValidationChainWithExtensions<"isDID" | "isDIDArray" | "isDIDDocument" | "isVerificationMethod" | "isCreateDIDDocumentService" | "isService" | "isCheqdDidLinkedAlsoKnownAs" | "isKeyDID" | "isW3CCheqdCredential" | "isW3CCheqdCredentials" | "isW3CCheqdPresentation" | "isVeridaDID">[];
9
+ static getReceivedValidator: import("express-validator").ValidationChainWithExtensions<"isDID" | "isDIDArray" | "isDIDDocument" | "isVerificationMethod" | "isCreateDIDDocumentService" | "isService" | "isCheqdDidLinkedAlsoKnownAs" | "isKeyDID" | "isW3CCheqdCredential" | "isW3CCheqdCredentials" | "isW3CCheqdPresentation" | "isVeridaDID">[];
10
+ /**
11
+ * @openapi
12
+ *
13
+ * /credentials/offers:
14
+ * get:
15
+ * tags: [ Credential Offers ]
16
+ * summary: List pending credential offers
17
+ * description: Retrieves a list of pending credential offers. If holderDid is not provided, returns all offers for all DIDs owned by the customer.
18
+ * parameters:
19
+ * - in: query
20
+ * name: holderDid
21
+ * required: false
22
+ * schema:
23
+ * type: string
24
+ * description: Optional DID of the credential holder. If not provided, returns offers for all customer DIDs.
25
+ * - in: query
26
+ * name: category
27
+ * required: false
28
+ * schema:
29
+ * type: string
30
+ * enum: [credential, accreditation]
31
+ * description: Optional category to filter by credential type
32
+ * - in: query
33
+ * name: page
34
+ * schema:
35
+ * type: integer
36
+ * minimum: 1
37
+ * default: 1
38
+ * description: Page number for pagination
39
+ * - in: query
40
+ * name: limit
41
+ * schema:
42
+ * type: integer
43
+ * minimum: 1
44
+ * maximum: 100
45
+ * default: 10
46
+ * description: Number of results per page
47
+ * responses:
48
+ * 200:
49
+ * description: List of pending credential offers
50
+ * content:
51
+ * application/json:
52
+ * schema:
53
+ * type: object
54
+ * properties:
55
+ * total:
56
+ * type: integer
57
+ * offers:
58
+ * type: array
59
+ * items:
60
+ * $ref: '#/components/schemas/IssuedCredentialResponse'
61
+ * page:
62
+ * type: integer
63
+ * limit:
64
+ * type: integer
65
+ * 400:
66
+ * $ref: '#/components/schemas/InvalidRequest'
67
+ * 401:
68
+ * $ref: '#/components/schemas/UnauthorizedError'
69
+ * 500:
70
+ * $ref: '#/components/schemas/InternalError'
71
+ */
72
+ listOffers(request: Request, response: Response): Promise<Response<any, Record<string, any>>>;
73
+ /**
74
+ * @openapi
75
+ *
76
+ * /credentials/offers/{credentialId}:
77
+ * get:
78
+ * tags: [ Credential Offers ]
79
+ * summary: Get credential offer details
80
+ * description: Retrieves detailed information about a specific credential offer
81
+ * parameters:
82
+ * - in: path
83
+ * name: credentialId
84
+ * required: true
85
+ * schema:
86
+ * type: string
87
+ * format: uuid
88
+ * description: ID of the credential offer
89
+ * - in: query
90
+ * name: holderDid
91
+ * required: true
92
+ * schema:
93
+ * type: string
94
+ * description: DID of the credential holder
95
+ * responses:
96
+ * 200:
97
+ * description: Credential offer details
98
+ * content:
99
+ * application/json:
100
+ * schema:
101
+ * $ref: '#/components/schemas/IssuedCredentialResponse'
102
+ * 400:
103
+ * $ref: '#/components/schemas/InvalidRequest'
104
+ * 401:
105
+ * $ref: '#/components/schemas/UnauthorizedError'
106
+ * 404:
107
+ * description: Credential offer not found
108
+ * 500:
109
+ * $ref: '#/components/schemas/InternalError'
110
+ */
111
+ getOfferDetails(request: Request, response: Response): Promise<Response<any, Record<string, any>>>;
112
+ /**
113
+ * @openapi
114
+ *
115
+ * /credentials/offers/{credentialId}/accept:
116
+ * post:
117
+ * tags: [ Credential Offers ]
118
+ * summary: Accept a credential offer
119
+ * description: Accepts a pending credential offer. The credential is verified and status is updated to issued.
120
+ * parameters:
121
+ * - in: path
122
+ * name: credentialId
123
+ * required: true
124
+ * schema:
125
+ * type: string
126
+ * format: uuid
127
+ * description: ID of the credential offer to accept
128
+ * requestBody:
129
+ * required: true
130
+ * content:
131
+ * application/json:
132
+ * schema:
133
+ * type: object
134
+ * required:
135
+ * - holderDid
136
+ * properties:
137
+ * holderDid:
138
+ * type: string
139
+ * description: DID of the credential holder
140
+ * createPresentation:
141
+ * type: boolean
142
+ * default: false
143
+ * description: Whether to create a verifiable presentation
144
+ * presentationDomain:
145
+ * type: string
146
+ * description: Optional domain for the presentation
147
+ * responses:
148
+ * 200:
149
+ * description: Credential offer accepted successfully
150
+ * content:
151
+ * application/json:
152
+ * schema:
153
+ * type: object
154
+ * properties:
155
+ * success:
156
+ * type: boolean
157
+ * credential:
158
+ * type: object
159
+ * presentation:
160
+ * type: string
161
+ * description: JWT presentation (if createPresentation was true)
162
+ * 400:
163
+ * $ref: '#/components/schemas/InvalidRequest'
164
+ * 401:
165
+ * $ref: '#/components/schemas/UnauthorizedError'
166
+ * 404:
167
+ * description: Credential offer not found
168
+ * 500:
169
+ * $ref: '#/components/schemas/InternalError'
170
+ */
171
+ acceptOffer(request: Request, response: Response): Promise<Response<any, Record<string, any>>>;
172
+ /**
173
+ * @openapi
174
+ *
175
+ * /credentials/offers/{credentialId}/reject:
176
+ * post:
177
+ * tags: [ Credential Offers ]
178
+ * summary: Reject a credential offer
179
+ * description: Rejects a pending credential offer. The credential is deleted and status is updated to rejected.
180
+ * parameters:
181
+ * - in: path
182
+ * name: credentialId
183
+ * required: true
184
+ * schema:
185
+ * type: string
186
+ * format: uuid
187
+ * description: ID of the credential offer to reject
188
+ * requestBody:
189
+ * required: true
190
+ * content:
191
+ * application/json:
192
+ * schema:
193
+ * type: object
194
+ * required:
195
+ * - holderDid
196
+ * properties:
197
+ * holderDid:
198
+ * type: string
199
+ * description: DID of the credential holder
200
+ * responses:
201
+ * 200:
202
+ * description: Credential offer rejected successfully
203
+ * content:
204
+ * application/json:
205
+ * schema:
206
+ * type: object
207
+ * properties:
208
+ * success:
209
+ * type: boolean
210
+ * message:
211
+ * type: string
212
+ * 400:
213
+ * $ref: '#/components/schemas/InvalidRequest'
214
+ * 401:
215
+ * $ref: '#/components/schemas/UnauthorizedError'
216
+ * 404:
217
+ * description: Credential offer not found
218
+ * 500:
219
+ * $ref: '#/components/schemas/InternalError'
220
+ */
221
+ rejectOffer(request: Request, response: Response): Promise<Response<any, Record<string, any>>>;
222
+ /**
223
+ * @openapi
224
+ *
225
+ * /credentials/import:
226
+ * post:
227
+ * tags: [ Verifiable Credentials ]
228
+ * summary: Import an externally issued credential
229
+ * description: Imports a credential issued by a third party (not in Studio) and stores it in the holder's dataStore
230
+ * requestBody:
231
+ * required: true
232
+ * content:
233
+ * application/json:
234
+ * schema:
235
+ * type: object
236
+ * required:
237
+ * - credential
238
+ * - holderDid
239
+ * properties:
240
+ * credential:
241
+ * oneOf:
242
+ * - type: object
243
+ * description: Verifiable credential as JSON object
244
+ * - type: string
245
+ * description: Verifiable credential as JWT string
246
+ * holderDid:
247
+ * type: string
248
+ * description: DID of the credential holder
249
+ * responses:
250
+ * 200:
251
+ * description: Credential imported successfully
252
+ * content:
253
+ * application/json:
254
+ * schema:
255
+ * type: object
256
+ * properties:
257
+ * success:
258
+ * type: boolean
259
+ * credentialHash:
260
+ * type: string
261
+ * description: Hash of the stored credential
262
+ * credential:
263
+ * type: object
264
+ * description: The imported credential
265
+ * 400:
266
+ * $ref: '#/components/schemas/InvalidRequest'
267
+ * 401:
268
+ * $ref: '#/components/schemas/UnauthorizedError'
269
+ * 500:
270
+ * $ref: '#/components/schemas/InternalError'
271
+ */
272
+ importCredential(request: Request, response: Response): Promise<Response<any, Record<string, any>>>;
273
+ /**
274
+ * @openapi
275
+ *
276
+ * /credentials/received:
277
+ * get:
278
+ * tags: [ Verifiable Credentials ]
279
+ * summary: List received credentials
280
+ * description: Retrieves all credentials stored in the holder's dataStore (accepted offers + imported credentials)
281
+ * parameters:
282
+ * - in: query
283
+ * name: holderDid
284
+ * schema:
285
+ * type: string
286
+ * description: Optional DID to filter credentials by subject
287
+ * - in: query
288
+ * name: category
289
+ * required: false
290
+ * schema:
291
+ * type: string
292
+ * enum: [credential, accreditation]
293
+ * description: Optional category to filter by credential type. Note that imported credentials without IssuedCredentialEntity will be excluded when filtering by category.
294
+ * - in: query
295
+ * name: page
296
+ * schema:
297
+ * type: integer
298
+ * minimum: 1
299
+ * default: 1
300
+ * description: Page number for pagination
301
+ * - in: query
302
+ * name: limit
303
+ * schema:
304
+ * type: integer
305
+ * minimum: 1
306
+ * maximum: 100
307
+ * default: 10
308
+ * description: Number of results per page
309
+ * responses:
310
+ * 200:
311
+ * description: List of received credentials
312
+ * content:
313
+ * application/json:
314
+ * schema:
315
+ * type: object
316
+ * properties:
317
+ * total:
318
+ * type: integer
319
+ * description: Total number of credentials
320
+ * credentials:
321
+ * type: array
322
+ * items:
323
+ * type: object
324
+ * properties:
325
+ * hash:
326
+ * type: string
327
+ * description: Hash of the credential
328
+ * credential:
329
+ * type: object
330
+ * description: Verifiable Credential
331
+ * page:
332
+ * type: integer
333
+ * description: Current page number
334
+ * limit:
335
+ * type: integer
336
+ * description: Number of results per page
337
+ * 401:
338
+ * $ref: '#/components/schemas/UnauthorizedError'
339
+ * 500:
340
+ * $ref: '#/components/schemas/InternalError'
341
+ */
342
+ listReceivedCredentials(request: Request, response: Response): Promise<Response<any, Record<string, any>>>;
343
+ /**
344
+ * @openapi
345
+ *
346
+ * /credentials/received/{credentialHash}:
347
+ * get:
348
+ * tags: [ Verifiable Credentials ]
349
+ * summary: Get a specific received credential
350
+ * description: Retrieves a specific credential from the holder's dataStore by its hash
351
+ * parameters:
352
+ * - in: path
353
+ * name: credentialHash
354
+ * required: true
355
+ * schema:
356
+ * type: string
357
+ * description: Hash of the credential
358
+ * responses:
359
+ * 200:
360
+ * description: Received credential
361
+ * content:
362
+ * application/json:
363
+ * schema:
364
+ * type: object
365
+ * description: Verifiable Credential
366
+ * 401:
367
+ * $ref: '#/components/schemas/UnauthorizedError'
368
+ * 404:
369
+ * description: Credential not found
370
+ * 500:
371
+ * $ref: '#/components/schemas/InternalError'
372
+ */
373
+ getReceivedCredential(request: Request, response: Response): Promise<Response<any, Record<string, any>>>;
374
+ }
375
+ //# sourceMappingURL=received-credential.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"received-credential.d.ts","sourceRoot":"","sources":["../../../src/controllers/api/received-credential.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAMjD,qBAAa,4BAA4B;IACxC,OAAc,mBAAmB,yTAc/B;IAEF,OAAc,iBAAiB,yTAe7B;IAEF,OAAc,oBAAoB,yTAsBhC;IAEF,OAAc,oBAAoB,yTAehC;IACF,OAAc,eAAe,yTAwB3B;IACF,OAAc,qBAAqB,yTAcjC;IACF,OAAc,oBAAoB,yTAQhC;IAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6DG;IAEU,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ;IAuB5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IAEU,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ;IA0BjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA0DG;IAEU,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ;IA8B7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgDG;IAEU,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ;IAsB7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiDG;IAEU,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ;IA0BlE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoEG;IAEU,uBAAuB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ;IAqBzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IAEU,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ;CAoBvE"}