@cheqd/studio 3.4.0-develop.1 → 3.4.0-develop.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 (33) hide show
  1. package/dist/app.d.ts.map +1 -1
  2. package/dist/app.js +3 -0
  3. package/dist/app.js.map +1 -1
  4. package/dist/controllers/api/accreditation.d.ts +133 -0
  5. package/dist/controllers/api/accreditation.d.ts.map +1 -1
  6. package/dist/controllers/api/accreditation.js +315 -24
  7. package/dist/controllers/api/accreditation.js.map +1 -1
  8. package/dist/helpers/helpers.d.ts +2 -0
  9. package/dist/helpers/helpers.d.ts.map +1 -1
  10. package/dist/helpers/helpers.js +14 -0
  11. package/dist/helpers/helpers.js.map +1 -1
  12. package/dist/middleware/auth/routes/api/accreditation-auth.d.ts.map +1 -1
  13. package/dist/middleware/auth/routes/api/accreditation-auth.js +6 -0
  14. package/dist/middleware/auth/routes/api/accreditation-auth.js.map +1 -1
  15. package/dist/services/api/accreditation.d.ts.map +1 -1
  16. package/dist/services/api/accreditation.js +24 -16
  17. package/dist/services/api/accreditation.js.map +1 -1
  18. package/dist/static/swagger-api.json +228 -18
  19. package/dist/types/accreditation.d.ts +23 -5
  20. package/dist/types/accreditation.d.ts.map +1 -1
  21. package/dist/types/accreditation.js.map +1 -1
  22. package/dist/types/common.d.ts +1 -0
  23. package/dist/types/common.d.ts.map +1 -1
  24. package/dist/types/constants.d.ts.map +1 -1
  25. package/dist/types/constants.js +1 -1
  26. package/dist/types/constants.js.map +1 -1
  27. package/dist/types/credential.d.ts +4 -4
  28. package/dist/types/credential.d.ts.map +1 -1
  29. package/dist/types/swagger-api-types.d.ts +45 -13
  30. package/dist/types/swagger-api-types.d.ts.map +1 -1
  31. package/dist/types/swagger-api-types.js +45 -13
  32. package/dist/types/swagger-api-types.js.map +1 -1
  33. package/package.json +1 -1
package/dist/app.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;;AAqT9B,wBAAiC"}
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;;AAoU9B,wBAAiC"}
package/dist/app.js CHANGED
@@ -136,6 +136,9 @@ class App {
136
136
  // Trust Registry API
137
137
  app.post('/trust-registry/accreditation/issue', AccreditationController.issueValidator, new AccreditationController().issue);
138
138
  app.post('/trust-registry/accreditation/verify', AccreditationController.verifyValidator, new AccreditationController().verify);
139
+ app.post('/trust-registry/accreditation/revoke', AccreditationController.publishValidator, new AccreditationController().revoke);
140
+ app.post('/trust-registry/accreditation/suspend', AccreditationController.publishValidator, new AccreditationController().suspend);
141
+ app.post('/trust-registry/accreditation/reinstate', AccreditationController.publishValidator, new AccreditationController().reinstate);
139
142
  // Resource API
140
143
  app.post('/resource/create/:did', ResourceController.createResourceValidator, new ResourceController().createResource);
141
144
  app.get('/resource/search/:did', ResourceController.searchResourceValidator, new ResourceController().searchResource);
package/dist/app.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,OAAO,MAAM,iBAAiB,CAAC;AACtC,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAA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U;YACV,GAAG,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,iBAAiB,EAAE,CAAC,aAAa,CAAC,CAAC;YAElE,WAAW;YACX,GAAG,CAAC,IAAI,CACP,4BAA4B,EAC5B,sBAAsB,CAAC,2BAA2B,EAClD,IAAI,sBAAsB,EAAE,CAAC,MAAM,CACnC,CAAC;YACF,GAAG,CAAC,GAAG,CAAC,yBAAyB,EAAE,IAAI,sBAAsB,EAAE,CAAC,GAAG,CAAC,CAAC;QACtE,CAAC;QAED,6BAA6B;QAC7B,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;IACtF,CAAC;CACD;AAED,eAAe,IAAI,GAAG,EAAE,CAAC,OAAO,CAAC"}
@@ -2,6 +2,7 @@ import type { Request, Response } from 'express';
2
2
  export declare class AccreditationController {
3
3
  static issueValidator: import("express-validator").ValidationChainWithExtensions<"isDID" | "isDIDArray" | "isDIDDocument" | "isVerificationMethod" | "isCreateDIDDocumentService" | "isService" | "isCheqdDidLinkedAlsoKnownAs" | "isKeyDID" | "isW3CCheqdCredential" | "isW3CCheqdPresentation" | "isVeridaDID">[];
4
4
  static verifyValidator: import("express-validator").ValidationChainWithExtensions<"isDID" | "isDIDArray" | "isDIDDocument" | "isVerificationMethod" | "isCreateDIDDocumentService" | "isService" | "isCheqdDidLinkedAlsoKnownAs" | "isKeyDID" | "isW3CCheqdCredential" | "isW3CCheqdPresentation" | "isVeridaDID">[];
5
+ static publishValidator: import("express-validator").ValidationChainWithExtensions<"isDID" | "isDIDArray" | "isDIDDocument" | "isVerificationMethod" | "isCreateDIDDocumentService" | "isService" | "isCheqdDidLinkedAlsoKnownAs" | "isKeyDID" | "isW3CCheqdCredential" | "isW3CCheqdPresentation" | "isVeridaDID">[];
5
6
  /**
6
7
  * @openapi
7
8
  *
@@ -90,5 +91,137 @@ export declare class AccreditationController {
90
91
  * $ref: '#/components/schemas/InternalError'
91
92
  */
92
93
  verify(request: Request, response: Response): Promise<Response<any, Record<string, any>>>;
94
+ /**
95
+ * @openapi
96
+ *
97
+ * /trust-registry/accreditation/revoke:
98
+ * post:
99
+ * tags: [ Trust Registry ]
100
+ * summary: Revoke a Verifiable Accreditation.
101
+ * description: This endpoint revokes a given Verifiable Accreditation. As input, it can take the didUrl as a string. The StatusList2021 resource should already be setup in the VC and `credentialStatus` property present in the VC.
102
+ * operationId: accredit-revoke
103
+ * parameters:
104
+ * - in: query
105
+ * name: publish
106
+ * description: Set whether the StatusList2021 resource should be published to the ledger or not. If set to `false`, the StatusList2021 publisher should manually publish the resource.
107
+ * required: true
108
+ * schema:
109
+ * type: boolean
110
+ * default: true
111
+ * requestBody:
112
+ * content:
113
+ * application/x-www-form-urlencoded:
114
+ * schema:
115
+ * $ref: '#/components/schemas/AccreditationRevokeRequest'
116
+ * application/json:
117
+ * schema:
118
+ * $ref: '#/components/schemas/AccreditationRevokeRequest'
119
+ * responses:
120
+ * 200:
121
+ * description: The request was successful.
122
+ * content:
123
+ * application/json:
124
+ * schema:
125
+ * $ref: '#/components/schemas/RevocationResult'
126
+ * 400:
127
+ * $ref: '#/components/schemas/InvalidRequest'
128
+ * 401:
129
+ * $ref: '#/components/schemas/UnauthorizedError'
130
+ * 500:
131
+ * $ref: '#/components/schemas/InternalError'
132
+ */
133
+ revoke(request: Request, response: Response): Promise<Response<any, Record<string, any>> | {
134
+ success: boolean;
135
+ status: number;
136
+ error: string;
137
+ }>;
138
+ /**
139
+ * @openapi
140
+ *
141
+ * /trust-registry/accreditation/suspend:
142
+ * post:
143
+ * tags: [ Trust Registry ]
144
+ * summary: Suspend a Verifiable Accreditation.
145
+ * description: This endpoint suspends a given Verifiable Accreditation. As input, it can take the didUrl as a string. The StatusList2021 resource should already be setup in the VC and `credentialStatus` property present in the VC.
146
+ * operationId: accredit-suspend
147
+ * parameters:
148
+ * - in: query
149
+ * name: publish
150
+ * description: Set whether the StatusList2021 resource should be published to the ledger or not. If set to `false`, the StatusList2021 publisher should manually publish the resource.
151
+ * required: true
152
+ * schema:
153
+ * type: boolean
154
+ * default: true
155
+ * requestBody:
156
+ * content:
157
+ * application/x-www-form-urlencoded:
158
+ * schema:
159
+ * $ref: '#/components/schemas/AccreditationRevokeRequest'
160
+ * application/json:
161
+ * schema:
162
+ * $ref: '#/components/schemas/AccreditationRevokeRequest'
163
+ * responses:
164
+ * 200:
165
+ * description: The request was successful.
166
+ * content:
167
+ * application/json:
168
+ * schema:
169
+ * $ref: '#/components/schemas/RevocationResult'
170
+ * 400:
171
+ * $ref: '#/components/schemas/InvalidRequest'
172
+ * 401:
173
+ * $ref: '#/components/schemas/UnauthorizedError'
174
+ * 500:
175
+ * $ref: '#/components/schemas/InternalError'
176
+ */
177
+ suspend(request: Request, response: Response): Promise<Response<any, Record<string, any>> | {
178
+ success: boolean;
179
+ status: number;
180
+ error: string;
181
+ }>;
182
+ /**
183
+ * @openapi
184
+ *
185
+ * /trust-registry/accreditation/reinstate:
186
+ * post:
187
+ * tags: [ Trust Registry ]
188
+ * summary: Reinstate a Verifiable Accreditation.
189
+ * description: This endpoint reinstates a given Verifiable Accreditation. As input, it can take the didUrl as a string. The StatusList2021 resource should already be setup in the VC and `credentialStatus` property present in the VC.
190
+ * operationId: accredit-reinstate
191
+ * parameters:
192
+ * - in: query
193
+ * name: publish
194
+ * description: Set whether the StatusList2021 resource should be published to the ledger or not. If set to `false`, the StatusList2021 publisher should manually publish the resource.
195
+ * required: true
196
+ * schema:
197
+ * type: boolean
198
+ * default: true
199
+ * requestBody:
200
+ * content:
201
+ * application/x-www-form-urlencoded:
202
+ * schema:
203
+ * $ref: '#/components/schemas/AccreditationRevokeRequest'
204
+ * application/json:
205
+ * schema:
206
+ * $ref: '#/components/schemas/AccreditationRevokeRequest'
207
+ * responses:
208
+ * 200:
209
+ * description: The request was successful.
210
+ * content:
211
+ * application/json:
212
+ * schema:
213
+ * $ref: '#/components/schemas/RevocationResult'
214
+ * 400:
215
+ * $ref: '#/components/schemas/InvalidRequest'
216
+ * 401:
217
+ * $ref: '#/components/schemas/UnauthorizedError'
218
+ * 500:
219
+ * $ref: '#/components/schemas/InternalError'
220
+ */
221
+ reinstate(request: Request, response: Response): Promise<Response<any, Record<string, any>> | {
222
+ success: boolean;
223
+ status: number;
224
+ error: string;
225
+ }>;
93
226
  }
94
227
  //# sourceMappingURL=accreditation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"accreditation.d.ts","sourceRoot":"","sources":["../../../src/controllers/api/accreditation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AA4BjD,qBAAa,uBAAuB;IACnC,OAAc,cAAc,+RA+C1B;IAEF,OAAc,eAAe,+RA4C3B;IAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;IAEU,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ;IAqKvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2CG;IAEU,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ;CA8DxD"}
1
+ {"version":3,"file":"accreditation.d.ts","sourceRoot":"","sources":["../../../src/controllers/api/accreditation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAgCjD,qBAAa,uBAAuB;IACnC,OAAc,cAAc,+RAkD1B;IAEF,OAAc,eAAe,+RA4C3B;IAEF,OAAc,gBAAgB,+RAE5B;IAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;IAEU,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ;IAuKvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2CG;IAEU,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ;IAqDxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IAEU,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ;;;;;IAuExD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IAEU,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ;;;;;IAuEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IAEU,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ;;;;;CAsE3D"}
@@ -6,7 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { StatusCodes } from 'http-status-codes';
8
8
  import { v4 } from 'uuid';
9
- import { AccreditationRequestType, DIDAccreditationTypes, isDidAndResourceId, isDidAndResourceName, isDidUrl, } from '../../types/accreditation.js';
9
+ import { AccreditationRequestType, DIDAccreditationTypes } from '../../types/accreditation.js';
10
10
  import { CredentialConnectors } from '../../types/credential.js';
11
11
  import { OperationCategoryNameEnum, OperationNameEnum } from '../../types/constants.js';
12
12
  import { IdentityServiceStrategySetup } from '../../services/identity/index.js';
@@ -15,7 +15,7 @@ import { Credentials } from '../../services/api/credentials.js';
15
15
  import { eventTracker } from '../../services/track/tracker.js';
16
16
  import { body, query } from '../validator/index.js';
17
17
  import { validate } from '../validator/decorator.js';
18
- import { parseDidFromDidUrl } from '../../helpers/helpers.js';
18
+ import { constructDidUrl, parseDidFromDidUrl } from '../../helpers/helpers.js';
19
19
  export class AccreditationController {
20
20
  static issueValidator = [
21
21
  query('accreditationType')
@@ -26,15 +26,18 @@ export class AccreditationController {
26
26
  AccreditationRequestType.attest,
27
27
  ])
28
28
  .bail(),
29
- body('issuerDid').exists().isString().isDID().bail(),
30
- body('subjectDid').exists().isString().isDID().bail(),
29
+ body('accreditationName').exists().isString().withMessage('accreditationName is required').bail(),
30
+ body('issuerDid').exists().isDID().bail(),
31
+ body('subjectDid').exists().isDID().bail(),
31
32
  body('schemas').exists().isArray().withMessage('schemas must be a array').bail(),
32
33
  body('schemas.*.url').isString().withMessage('schema urls must be a string').bail(),
33
34
  body('schemas.*.type')
34
35
  .custom((value) => typeof value === 'string' || (Array.isArray(value) && typeof value[0] === 'string'))
35
36
  .withMessage('schema type must be a string'),
36
- body('parentAccreditation').optional().bail(),
37
- body('rootAuthorization').optional().bail(),
37
+ body('parentAccreditation').optional().isString().withMessage('parentAccreditation must be a string').bail(),
38
+ body('rootAuthorization').optional().isString().withMessage('rootAuthorization must be a string').bail(),
39
+ body('trustFramework').optional().isString().withMessage('trustFramework must be a string').bail(),
40
+ body('trustFrameworkId').optional().isString().withMessage('trustFrameworkId must be a string').bail(),
38
41
  query('accreditationType')
39
42
  .custom((value, { req }) => {
40
43
  const { parentAccreditation, rootAuthorization, trustFramework, trustFrameworkId } = req.body;
@@ -99,6 +102,9 @@ export class AccreditationController {
99
102
  .bail(),
100
103
  query('policies').optional().isObject().withMessage('Verification policies should be an object').bail(),
101
104
  ];
105
+ static publishValidator = [
106
+ query('publish').optional().isBoolean().withMessage('publish should be a boolean value').toBoolean().bail(),
107
+ ];
102
108
  /**
103
109
  * @openapi
104
110
  *
@@ -153,7 +159,7 @@ export class AccreditationController {
153
159
  if (typeof request.body['@context'] === 'string') {
154
160
  request.body['@context'] = [request.body['@context']];
155
161
  }
156
- const { issuerDid, subjectDid, schemas, type, parentAccreditation, rootAuthorization, trustFramework, trustFrameworkId, attributes, accreditationName, format, } = request.body;
162
+ const { issuerDid, subjectDid, schemas, type, parentAccreditation, rootAuthorization, trustFramework, trustFrameworkId, attributes, accreditationName, format, credentialStatus, } = request.body;
157
163
  try {
158
164
  // Validate issuer DID
159
165
  const resolvedResult = await identityServiceStrategySetup.agent.resolve(issuerDid);
@@ -200,6 +206,7 @@ export class AccreditationController {
200
206
  connector: CredentialConnectors.Resource, // resource connector
201
207
  credentialId: resourceId,
202
208
  credentialName: accreditationName,
209
+ credentialStatus,
203
210
  };
204
211
  let resourceType;
205
212
  switch (accreditationType) {
@@ -317,21 +324,8 @@ export class AccreditationController {
317
324
  let { verifyStatus = false, allowDeactivatedDid = false } = request.query;
318
325
  const { policies, subjectDid, schemas } = request.body;
319
326
  // construct didUrl
320
- let didUrl;
321
- let did;
322
- if (isDidUrl(request.body)) {
323
- didUrl = request.body.didUrl;
324
- did = parseDidFromDidUrl(didUrl);
325
- }
326
- else if (isDidAndResourceId(request.body)) {
327
- did = request.body.did;
328
- didUrl = `${did}/resources/${request.body.resourceId}`;
329
- }
330
- else if (isDidAndResourceName(request.body)) {
331
- did = request.body.did;
332
- didUrl = `${did}?resourceName=${request.body.resourceName}&resourceType=${request.body.resourceType}`;
333
- }
334
- else {
327
+ const didUrl = constructDidUrl(request.body);
328
+ if (!didUrl) {
335
329
  return response.status(400).json({
336
330
  error: `Invalid Request: Either didUrl or did with resource attributes are required`,
337
331
  });
@@ -349,7 +343,7 @@ export class AccreditationController {
349
343
  customer: response.locals.customer,
350
344
  user: response.locals.user,
351
345
  data: {
352
- did,
346
+ did: parseDidFromDidUrl(didUrl),
353
347
  },
354
348
  };
355
349
  eventTracker.emit('track', trackInfo);
@@ -357,8 +351,296 @@ export class AccreditationController {
357
351
  return response.status(StatusCodes.OK).json(result.data);
358
352
  }
359
353
  else {
360
- return response.status(result.status).json({ verified: false, error: result.error });
354
+ return response.status(result.status).json({ ...result.data, verified: false, error: result.error });
355
+ }
356
+ }
357
+ catch (error) {
358
+ return response.status(StatusCodes.INTERNAL_SERVER_ERROR).json({
359
+ error: `Internal error: ${error?.message || error}`,
360
+ });
361
+ }
362
+ }
363
+ /**
364
+ * @openapi
365
+ *
366
+ * /trust-registry/accreditation/revoke:
367
+ * post:
368
+ * tags: [ Trust Registry ]
369
+ * summary: Revoke a Verifiable Accreditation.
370
+ * description: This endpoint revokes a given Verifiable Accreditation. As input, it can take the didUrl as a string. The StatusList2021 resource should already be setup in the VC and `credentialStatus` property present in the VC.
371
+ * operationId: accredit-revoke
372
+ * parameters:
373
+ * - in: query
374
+ * name: publish
375
+ * description: Set whether the StatusList2021 resource should be published to the ledger or not. If set to `false`, the StatusList2021 publisher should manually publish the resource.
376
+ * required: true
377
+ * schema:
378
+ * type: boolean
379
+ * default: true
380
+ * requestBody:
381
+ * content:
382
+ * application/x-www-form-urlencoded:
383
+ * schema:
384
+ * $ref: '#/components/schemas/AccreditationRevokeRequest'
385
+ * application/json:
386
+ * schema:
387
+ * $ref: '#/components/schemas/AccreditationRevokeRequest'
388
+ * responses:
389
+ * 200:
390
+ * description: The request was successful.
391
+ * content:
392
+ * application/json:
393
+ * schema:
394
+ * $ref: '#/components/schemas/RevocationResult'
395
+ * 400:
396
+ * $ref: '#/components/schemas/InvalidRequest'
397
+ * 401:
398
+ * $ref: '#/components/schemas/UnauthorizedError'
399
+ * 500:
400
+ * $ref: '#/components/schemas/InternalError'
401
+ */
402
+ async revoke(request, response) {
403
+ // Get publish flag
404
+ const { publish } = request.query;
405
+ // Get symmetric key
406
+ const { symmetricKey, ...didUrlParams } = request.body;
407
+ // Get strategy e.g. postgres or local
408
+ const identityServiceStrategySetup = new IdentityServiceStrategySetup(response.locals.customer.customerId);
409
+ const didUrl = constructDidUrl(didUrlParams);
410
+ if (!didUrl) {
411
+ return response.status(400).json({
412
+ error: `Invalid Request: Either didUrl or did with resource attributes are required`,
413
+ });
414
+ }
415
+ try {
416
+ const res = await identityServiceStrategySetup.agent.resolve(didUrl);
417
+ const resource = await res.json();
418
+ if (resource.dereferencingMetadata) {
419
+ return {
420
+ success: false,
421
+ status: 404,
422
+ error: `DID URL ${didUrl} is not found`,
423
+ };
361
424
  }
425
+ const accreditation = resource;
426
+ const result = await identityServiceStrategySetup.agent.revokeCredentials(accreditation, publish, response.locals.customer, symmetricKey);
427
+ // Track operation if revocation was successful and publish is true
428
+ // Otherwise the StatusList2021 publisher should manually publish the resource
429
+ // and it will be tracked there
430
+ if (!result.error && result.resourceMetadata && publish) {
431
+ // get issuer did
432
+ const issuerDid = typeof accreditation.issuer === 'string'
433
+ ? accreditation.issuer
434
+ : accreditation.issuer.id;
435
+ const trackInfo = {
436
+ category: OperationCategoryNameEnum.CREDENTIAL,
437
+ name: OperationNameEnum.CREDENTIAL_REVOKE,
438
+ customer: response.locals.customer,
439
+ user: response.locals.user,
440
+ data: {
441
+ did: issuerDid,
442
+ encrypted: result.statusList?.metadata?.encrypted,
443
+ resource: result.resourceMetadata,
444
+ symmetricKey: '',
445
+ },
446
+ };
447
+ // Track operation
448
+ eventTracker.emit('track', trackInfo);
449
+ }
450
+ // Return Ok response
451
+ return response.status(StatusCodes.OK).json(result);
452
+ }
453
+ catch (error) {
454
+ return response.status(StatusCodes.INTERNAL_SERVER_ERROR).json({
455
+ error: `Internal error: ${error?.message || error}`,
456
+ });
457
+ }
458
+ }
459
+ /**
460
+ * @openapi
461
+ *
462
+ * /trust-registry/accreditation/suspend:
463
+ * post:
464
+ * tags: [ Trust Registry ]
465
+ * summary: Suspend a Verifiable Accreditation.
466
+ * description: This endpoint suspends a given Verifiable Accreditation. As input, it can take the didUrl as a string. The StatusList2021 resource should already be setup in the VC and `credentialStatus` property present in the VC.
467
+ * operationId: accredit-suspend
468
+ * parameters:
469
+ * - in: query
470
+ * name: publish
471
+ * description: Set whether the StatusList2021 resource should be published to the ledger or not. If set to `false`, the StatusList2021 publisher should manually publish the resource.
472
+ * required: true
473
+ * schema:
474
+ * type: boolean
475
+ * default: true
476
+ * requestBody:
477
+ * content:
478
+ * application/x-www-form-urlencoded:
479
+ * schema:
480
+ * $ref: '#/components/schemas/AccreditationRevokeRequest'
481
+ * application/json:
482
+ * schema:
483
+ * $ref: '#/components/schemas/AccreditationRevokeRequest'
484
+ * responses:
485
+ * 200:
486
+ * description: The request was successful.
487
+ * content:
488
+ * application/json:
489
+ * schema:
490
+ * $ref: '#/components/schemas/RevocationResult'
491
+ * 400:
492
+ * $ref: '#/components/schemas/InvalidRequest'
493
+ * 401:
494
+ * $ref: '#/components/schemas/UnauthorizedError'
495
+ * 500:
496
+ * $ref: '#/components/schemas/InternalError'
497
+ */
498
+ async suspend(request, response) {
499
+ // Get publish flag
500
+ const { publish } = request.query;
501
+ // Get symmetric key
502
+ const { symmetricKey, ...didUrlParams } = request.body;
503
+ // Get strategy e.g. postgres or local
504
+ const identityServiceStrategySetup = new IdentityServiceStrategySetup(response.locals.customer.customerId);
505
+ const didUrl = constructDidUrl(didUrlParams);
506
+ if (!didUrl) {
507
+ return response.status(400).json({
508
+ error: `Invalid Request: Either didUrl or did with resource attributes are required`,
509
+ });
510
+ }
511
+ try {
512
+ const res = await identityServiceStrategySetup.agent.resolve(didUrl);
513
+ const resource = await res.json();
514
+ if (resource.dereferencingMetadata) {
515
+ return {
516
+ success: false,
517
+ status: 404,
518
+ error: `DID URL ${didUrl} is not found`,
519
+ };
520
+ }
521
+ const accreditation = resource;
522
+ const result = await identityServiceStrategySetup.agent.suspendCredentials(accreditation, publish, response.locals.customer, symmetricKey);
523
+ // Track operation if revocation was successful and publish is true
524
+ // Otherwise the StatusList2021 publisher should manually publish the resource
525
+ // and it will be tracked there
526
+ if (!result.error && result.resourceMetadata && publish) {
527
+ // get issuer did
528
+ const issuerDid = typeof accreditation.issuer === 'string'
529
+ ? accreditation.issuer
530
+ : accreditation.issuer.id;
531
+ const trackInfo = {
532
+ category: OperationCategoryNameEnum.CREDENTIAL,
533
+ name: OperationNameEnum.CREDENTIAL_SUSPEND,
534
+ customer: response.locals.customer,
535
+ user: response.locals.user,
536
+ data: {
537
+ did: issuerDid,
538
+ encrypted: result.statusList?.metadata?.encrypted,
539
+ resource: result.resourceMetadata,
540
+ symmetricKey: '',
541
+ },
542
+ };
543
+ // Track operation
544
+ eventTracker.emit('track', trackInfo);
545
+ }
546
+ // Return Ok response
547
+ return response.status(StatusCodes.OK).json(result);
548
+ }
549
+ catch (error) {
550
+ return response.status(StatusCodes.INTERNAL_SERVER_ERROR).json({
551
+ error: `Internal error: ${error?.message || error}`,
552
+ });
553
+ }
554
+ }
555
+ /**
556
+ * @openapi
557
+ *
558
+ * /trust-registry/accreditation/reinstate:
559
+ * post:
560
+ * tags: [ Trust Registry ]
561
+ * summary: Reinstate a Verifiable Accreditation.
562
+ * description: This endpoint reinstates a given Verifiable Accreditation. As input, it can take the didUrl as a string. The StatusList2021 resource should already be setup in the VC and `credentialStatus` property present in the VC.
563
+ * operationId: accredit-reinstate
564
+ * parameters:
565
+ * - in: query
566
+ * name: publish
567
+ * description: Set whether the StatusList2021 resource should be published to the ledger or not. If set to `false`, the StatusList2021 publisher should manually publish the resource.
568
+ * required: true
569
+ * schema:
570
+ * type: boolean
571
+ * default: true
572
+ * requestBody:
573
+ * content:
574
+ * application/x-www-form-urlencoded:
575
+ * schema:
576
+ * $ref: '#/components/schemas/AccreditationRevokeRequest'
577
+ * application/json:
578
+ * schema:
579
+ * $ref: '#/components/schemas/AccreditationRevokeRequest'
580
+ * responses:
581
+ * 200:
582
+ * description: The request was successful.
583
+ * content:
584
+ * application/json:
585
+ * schema:
586
+ * $ref: '#/components/schemas/RevocationResult'
587
+ * 400:
588
+ * $ref: '#/components/schemas/InvalidRequest'
589
+ * 401:
590
+ * $ref: '#/components/schemas/UnauthorizedError'
591
+ * 500:
592
+ * $ref: '#/components/schemas/InternalError'
593
+ */
594
+ async reinstate(request, response) {
595
+ // Get publish flag
596
+ const { publish } = request.query;
597
+ // Get symmetric key
598
+ const { symmetricKey, ...didUrlParams } = request.body;
599
+ // Get strategy e.g. postgres or local
600
+ const identityServiceStrategySetup = new IdentityServiceStrategySetup(response.locals.customer.customerId);
601
+ const didUrl = constructDidUrl(didUrlParams);
602
+ if (!didUrl) {
603
+ return response.status(400).json({
604
+ error: `Invalid Request: Either didUrl or did with resource attributes are required`,
605
+ });
606
+ }
607
+ try {
608
+ const res = await identityServiceStrategySetup.agent.resolve(didUrl);
609
+ const resource = await res.json();
610
+ if (resource.dereferencingMetadata) {
611
+ return {
612
+ success: false,
613
+ status: 404,
614
+ error: `DID URL ${didUrl} is not found`,
615
+ };
616
+ }
617
+ const accreditation = resource;
618
+ const result = await identityServiceStrategySetup.agent.reinstateCredentials(accreditation, publish, response.locals.customer, symmetricKey);
619
+ // Track operation if revocation was successful and publish is true
620
+ // Otherwise the StatusList2021 publisher should manually publish the resource
621
+ // and it will be tracked there
622
+ if (!result.error && result.resourceMetadata && publish) {
623
+ // get issuer did
624
+ const issuerDid = typeof accreditation.issuer === 'string'
625
+ ? accreditation.issuer
626
+ : accreditation.issuer.id;
627
+ const trackInfo = {
628
+ category: OperationCategoryNameEnum.CREDENTIAL,
629
+ name: OperationNameEnum.CREDENTIAL_UNSUSPEND,
630
+ customer: response.locals.customer,
631
+ user: response.locals.user,
632
+ data: {
633
+ did: issuerDid,
634
+ encrypted: result.statusList?.metadata?.encrypted || false,
635
+ resource: result.resourceMetadata,
636
+ symmetricKey: '',
637
+ },
638
+ };
639
+ // Track operation
640
+ eventTracker.emit('track', trackInfo);
641
+ }
642
+ // Return Ok response
643
+ return response.status(StatusCodes.OK).json(result);
362
644
  }
363
645
  catch (error) {
364
646
  return response.status(StatusCodes.INTERNAL_SERVER_ERROR).json({
@@ -373,4 +655,13 @@ __decorate([
373
655
  __decorate([
374
656
  validate
375
657
  ], AccreditationController.prototype, "verify", null);
658
+ __decorate([
659
+ validate
660
+ ], AccreditationController.prototype, "revoke", null);
661
+ __decorate([
662
+ validate
663
+ ], AccreditationController.prototype, "suspend", null);
664
+ __decorate([
665
+ validate
666
+ ], AccreditationController.prototype, "reinstate", null);
376
667
  //# sourceMappingURL=accreditation.js.map