@verana-labs/vs-agent-sdk 2.0.0-dev.12 → 2.0.0-dev.121

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 (205) hide show
  1. package/README.md +0 -2
  2. package/build/adminApi/AdminApiError.d.ts +28 -0
  3. package/build/adminApi/AdminApiError.js +67 -0
  4. package/build/adminApi/AdminApiError.js.map +1 -0
  5. package/build/adminApi/didcommModules.d.ts +2 -0
  6. package/build/adminApi/didcommModules.js +8 -0
  7. package/build/adminApi/didcommModules.js.map +1 -0
  8. package/build/adminApi/index.d.ts +4 -0
  9. package/build/adminApi/index.js +21 -0
  10. package/build/adminApi/index.js.map +1 -0
  11. package/build/adminApi/moduleEndpoint.d.ts +7 -0
  12. package/build/adminApi/moduleEndpoint.js +21 -0
  13. package/build/adminApi/moduleEndpoint.js.map +1 -0
  14. package/build/adminApi/pagination/PageDto.d.ts +7 -0
  15. package/build/adminApi/pagination/PageDto.js +50 -0
  16. package/build/adminApi/pagination/PageDto.js.map +1 -0
  17. package/build/adminApi/pagination/PaginationQueryDto.d.ts +11 -0
  18. package/build/adminApi/pagination/PaginationQueryDto.js +46 -0
  19. package/build/adminApi/pagination/PaginationQueryDto.js.map +1 -0
  20. package/build/adminApi/pagination/cursor.d.ts +28 -0
  21. package/build/adminApi/pagination/cursor.js +64 -0
  22. package/build/adminApi/pagination/cursor.js.map +1 -0
  23. package/build/adminApi/pagination/index.d.ts +4 -0
  24. package/build/adminApi/pagination/index.js +21 -0
  25. package/build/adminApi/pagination/index.js.map +1 -0
  26. package/build/adminApi/pagination/paginate.d.ts +27 -0
  27. package/build/adminApi/pagination/paginate.js +77 -0
  28. package/build/adminApi/pagination/paginate.js.map +1 -0
  29. package/build/agent/VsAgent.d.ts +32 -36
  30. package/build/agent/VsAgent.js +179 -221
  31. package/build/agent/VsAgent.js.map +1 -1
  32. package/build/agent/createVsAgent.d.ts +9 -6
  33. package/build/agent/createVsAgent.js +5 -5
  34. package/build/agent/createVsAgent.js.map +1 -1
  35. package/build/blockchain/AnonCredsTrustService.d.ts +115 -0
  36. package/build/blockchain/AnonCredsTrustService.js +287 -0
  37. package/build/blockchain/AnonCredsTrustService.js.map +1 -0
  38. package/build/blockchain/AuthorizationService.d.ts +8 -6
  39. package/build/blockchain/AuthorizationService.js +30 -38
  40. package/build/blockchain/AuthorizationService.js.map +1 -1
  41. package/build/blockchain/IndexerWebSocketService.d.ts +5 -1
  42. package/build/blockchain/IndexerWebSocketService.js +42 -21
  43. package/build/blockchain/IndexerWebSocketService.js.map +1 -1
  44. package/build/blockchain/VeranaChainService.d.ts +38 -27
  45. package/build/blockchain/VeranaChainService.js +186 -177
  46. package/build/blockchain/VeranaChainService.js.map +1 -1
  47. package/build/blockchain/VeranaIndexerService.d.ts +14 -1
  48. package/build/blockchain/VeranaIndexerService.js +122 -8
  49. package/build/blockchain/VeranaIndexerService.js.map +1 -1
  50. package/build/blockchain/feePreflight.d.ts +34 -0
  51. package/build/blockchain/feePreflight.js +96 -0
  52. package/build/blockchain/feePreflight.js.map +1 -0
  53. package/build/blockchain/handlers/IndexerHandlerRegistry.d.ts +0 -1
  54. package/build/blockchain/handlers/IndexerHandlerRegistry.js.map +1 -1
  55. package/build/blockchain/handlers/authorizationHandlers.js +2 -2
  56. package/build/blockchain/handlers/authorizationHandlers.js.map +1 -1
  57. package/build/blockchain/handlers/defaultHandlers.js +7 -2
  58. package/build/blockchain/handlers/defaultHandlers.js.map +1 -1
  59. package/build/blockchain/handlers/index.d.ts +1 -0
  60. package/build/blockchain/handlers/index.js +1 -0
  61. package/build/blockchain/handlers/index.js.map +1 -1
  62. package/build/blockchain/handlers/selfIssuanceHandlers.d.ts +13 -0
  63. package/build/blockchain/handlers/selfIssuanceHandlers.js +76 -0
  64. package/build/blockchain/handlers/selfIssuanceHandlers.js.map +1 -0
  65. package/build/blockchain/handlers/stateMutations.d.ts +28 -4
  66. package/build/blockchain/handlers/stateMutations.js +356 -48
  67. package/build/blockchain/handlers/stateMutations.js.map +1 -1
  68. package/build/blockchain/index.d.ts +4 -0
  69. package/build/blockchain/index.js +4 -0
  70. package/build/blockchain/index.js.map +1 -1
  71. package/build/blockchain/indexerMappers.d.ts +3 -0
  72. package/build/blockchain/indexerMappers.js +57 -0
  73. package/build/blockchain/indexerMappers.js.map +1 -0
  74. package/build/blockchain/rpcRetry.d.ts +2 -0
  75. package/build/blockchain/rpcRetry.js +43 -0
  76. package/build/blockchain/rpcRetry.js.map +1 -0
  77. package/build/blockchain/triggerResolver.d.ts +26 -0
  78. package/build/blockchain/triggerResolver.js +110 -0
  79. package/build/blockchain/triggerResolver.js.map +1 -0
  80. package/build/blockchain/types.d.ts +14 -70
  81. package/build/blockchain/types.js +6 -1
  82. package/build/blockchain/types.js.map +1 -1
  83. package/build/bootstrap/EcsBootstrapService.d.ts +13 -4
  84. package/build/bootstrap/EcsBootstrapService.js +176 -124
  85. package/build/bootstrap/EcsBootstrapService.js.map +1 -1
  86. package/build/connections/InvitationRecord.d.ts +50 -0
  87. package/build/connections/InvitationRecord.js +60 -0
  88. package/build/connections/InvitationRecord.js.map +1 -0
  89. package/build/connections/ParentConnectionModule.d.ts +22 -0
  90. package/build/connections/ParentConnectionModule.js +91 -0
  91. package/build/connections/ParentConnectionModule.js.map +1 -0
  92. package/build/credentials/FullTailsFileService.d.ts +0 -1
  93. package/build/credentials/FullTailsFileService.js +0 -49
  94. package/build/credentials/FullTailsFileService.js.map +1 -1
  95. package/build/did/CachedDocumentLoader.d.ts +3 -0
  96. package/build/did/CachedDocumentLoader.js +9 -3
  97. package/build/did/CachedDocumentLoader.js.map +1 -1
  98. package/build/did/CachedWebDidResolver.d.ts +0 -4
  99. package/build/did/CachedWebDidResolver.js +1 -5
  100. package/build/did/CachedWebDidResolver.js.map +1 -1
  101. package/build/did/artifactServices.d.ts +12 -0
  102. package/build/did/artifactServices.js +48 -0
  103. package/build/did/artifactServices.js.map +1 -0
  104. package/build/did/legacyDidWeb.d.ts +6 -4
  105. package/build/did/legacyDidWeb.js +17 -14
  106. package/build/did/legacyDidWeb.js.map +1 -1
  107. package/build/did/publicDid.d.ts +4 -0
  108. package/build/did/publicDid.js +19 -0
  109. package/build/did/publicDid.js.map +1 -0
  110. package/build/did/reusedDidDocument.d.ts +37 -0
  111. package/build/did/reusedDidDocument.js +93 -0
  112. package/build/did/reusedDidDocument.js.map +1 -0
  113. package/build/events/BaseMessageEvents.d.ts +24 -0
  114. package/build/events/BaseMessageEvents.js +368 -14
  115. package/build/events/BaseMessageEvents.js.map +1 -1
  116. package/build/events/ConnectionEvents.js +149 -87
  117. package/build/events/ConnectionEvents.js.map +1 -1
  118. package/build/events/InvitationEvents.d.ts +6 -0
  119. package/build/events/InvitationEvents.js +57 -0
  120. package/build/events/InvitationEvents.js.map +1 -0
  121. package/build/events/VsAgentEvents.d.ts +40 -9
  122. package/build/events/VsAgentEvents.js +10 -1
  123. package/build/events/VsAgentEvents.js.map +1 -1
  124. package/build/events/VtFlowEvents.d.ts +1 -1
  125. package/build/events/VtFlowEvents.js +29 -17
  126. package/build/events/VtFlowEvents.js.map +1 -1
  127. package/build/events/index.d.ts +1 -0
  128. package/build/events/index.js +1 -0
  129. package/build/events/index.js.map +1 -1
  130. package/build/index.d.ts +9 -1
  131. package/build/index.js +20 -2
  132. package/build/index.js.map +1 -1
  133. package/build/plugins/setupBaseDidComm.js +24 -22
  134. package/build/plugins/setupBaseDidComm.js.map +1 -1
  135. package/build/transports/HttpInboundTransport.js +6 -1
  136. package/build/transports/HttpInboundTransport.js.map +1 -1
  137. package/build/transports/VsAgentWsInboundTransport.d.ts +1 -1
  138. package/build/transports/VsAgentWsInboundTransport.js +20 -14
  139. package/build/transports/VsAgentWsInboundTransport.js.map +1 -1
  140. package/build/types.d.ts +14 -13
  141. package/build/types.js +1 -2
  142. package/build/types.js.map +1 -1
  143. package/build/utils/agent.d.ts +42 -4
  144. package/build/utils/agent.js +126 -22
  145. package/build/utils/agent.js.map +1 -1
  146. package/build/utils/boundedFetch.d.ts +13 -0
  147. package/build/utils/boundedFetch.js +47 -0
  148. package/build/utils/boundedFetch.js.map +1 -0
  149. package/build/utils/didReadiness.js +5 -2
  150. package/build/utils/didReadiness.js.map +1 -1
  151. package/build/utils/ecsClaims.d.ts +46 -0
  152. package/build/utils/ecsClaims.js +115 -0
  153. package/build/utils/ecsClaims.js.map +1 -0
  154. package/build/utils/ecsService.d.ts +8 -0
  155. package/build/utils/ecsService.js +23 -0
  156. package/build/utils/ecsService.js.map +1 -0
  157. package/build/utils/index.d.ts +7 -0
  158. package/build/utils/index.js +7 -0
  159. package/build/utils/index.js.map +1 -1
  160. package/build/utils/publishedDidRecord.d.ts +15 -0
  161. package/build/utils/publishedDidRecord.js +83 -0
  162. package/build/utils/publishedDidRecord.js.map +1 -0
  163. package/build/utils/selfIssuedEcsCredential.d.ts +8 -0
  164. package/build/utils/selfIssuedEcsCredential.js +158 -0
  165. package/build/utils/selfIssuedEcsCredential.js.map +1 -0
  166. package/build/utils/setupSelfTr.d.ts +34 -74
  167. package/build/utils/setupSelfTr.js +79 -321
  168. package/build/utils/setupSelfTr.js.map +1 -1
  169. package/build/utils/trustCredentialStore.d.ts +86 -9
  170. package/build/utils/trustCredentialStore.js +342 -137
  171. package/build/utils/trustCredentialStore.js.map +1 -1
  172. package/build/utils/typeMetadata.d.ts +44 -0
  173. package/build/utils/typeMetadata.js +89 -0
  174. package/build/utils/typeMetadata.js.map +1 -0
  175. package/build/utils/util.d.ts +20 -0
  176. package/build/utils/util.js +32 -1
  177. package/build/utils/util.js.map +1 -1
  178. package/build/utils/vcdm2.d.ts +34 -0
  179. package/build/utils/vcdm2.js +60 -0
  180. package/build/utils/vcdm2.js.map +1 -0
  181. package/build/utils/vtjscResolver.d.ts +23 -0
  182. package/build/utils/vtjscResolver.js +53 -0
  183. package/build/utils/vtjscResolver.js.map +1 -0
  184. package/build/vtFlow/VtFlowOrchestrator.d.ts +134 -16
  185. package/build/vtFlow/VtFlowOrchestrator.js +965 -138
  186. package/build/vtFlow/VtFlowOrchestrator.js.map +1 -1
  187. package/build/vtFlow/assertVerifiableService.d.ts +31 -2
  188. package/build/vtFlow/assertVerifiableService.js +68 -10
  189. package/build/vtFlow/assertVerifiableService.js.map +1 -1
  190. package/build/vtFlow/ecsIssuanceExemption.d.ts +12 -0
  191. package/build/vtFlow/ecsIssuanceExemption.js +63 -0
  192. package/build/vtFlow/ecsIssuanceExemption.js.map +1 -0
  193. package/build/vtFlow/index.d.ts +2 -0
  194. package/build/vtFlow/index.js +2 -0
  195. package/build/vtFlow/index.js.map +1 -1
  196. package/build/vtFlow/issuanceRepair.d.ts +4 -0
  197. package/build/vtFlow/issuanceRepair.js +181 -0
  198. package/build/vtFlow/issuanceRepair.js.map +1 -0
  199. package/package.json +27 -19
  200. package/build/did/migrateWebVhLog.d.ts +0 -34
  201. package/build/did/migrateWebVhLog.js +0 -230
  202. package/build/did/migrateWebVhLog.js.map +0 -1
  203. package/build/did/migrateWebVhVersionTime.d.ts +0 -9
  204. package/build/did/migrateWebVhVersionTime.js +0 -191
  205. package/build/did/migrateWebVhVersionTime.js.map +0 -1
@@ -3,55 +3,29 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.setupSelfTr = exports.sortKeysDeep = exports.mapToSelfTr = exports.linkedVpFragment = exports.createJsonSubjectRef = exports.createJsonSchema = exports.credentials = exports.presentations = void 0;
6
+ exports.sortKeysDeep = exports.linkedVpFragment = exports.linkedVpSchemaId = exports.createJsonSubjectRef = exports.createJsonSchema = void 0;
7
7
  exports.createCredential = createCredential;
8
+ exports.getDataIntegrityCryptosuite = getDataIntegrityCryptosuite;
8
9
  exports.signerW3c = signerW3c;
9
- exports.generateVerifiablePresentation = generateVerifiablePresentation;
10
10
  exports.createPresentation = createPresentation;
11
11
  exports.getClaims = getClaims;
12
+ exports.schemaViolations = schemaViolations;
12
13
  exports.validateSchema = validateSchema;
13
14
  exports.addDigestSRI = addDigestSRI;
14
15
  exports.generateDigestSRI = generateDigestSRI;
15
- exports.urlDigestSri = urlDigestSri;
16
16
  exports.getVerificationMethodId = getVerificationMethodId;
17
17
  const core_1 = require("@credo-ts/core");
18
- // No type definitions available for this library
19
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
20
- //@ts-expect-error
21
- const jsonld_signatures_1 = require("@digitalcredentials/jsonld-signatures");
18
+ const credo_ts_didcomm_vt_flow_1 = require("@verana-labs/credo-ts-didcomm-vt-flow");
22
19
  const vs_agent_model_1 = require("@verana-labs/vs-agent-model");
23
20
  const _2020_1 = __importDefault(require("ajv/dist/2020"));
24
21
  const ajv_formats_1 = __importDefault(require("ajv-formats"));
25
- const axios_1 = __importDefault(require("axios"));
26
- const crypto_1 = require("crypto");
27
- const data_1 = require("./data");
28
- const ajv = new _2020_1.default({ strict: false });
22
+ const reusedDidDocument_1 = require("../did/reusedDidDocument");
23
+ const boundedFetch_1 = require("./boundedFetch");
24
+ const ecsClaims_1 = require("./ecsClaims");
25
+ const vcdm2_1 = require("./vcdm2");
26
+ const TEN_YEARS_MS = 10 * 365 * 24 * 60 * 60 * 1000;
27
+ const ajv = new _2020_1.default({ strict: false, allErrors: true });
29
28
  (0, ajv_formats_1.default)(ajv);
30
- const DIGEST_FETCH_TIMEOUT_MS = 5000;
31
- // Helpers
32
- exports.presentations = [
33
- {
34
- name: 'ecs-service',
35
- schemaUrl: `ecosystem/schemas-example-service-jsc.json`,
36
- },
37
- {
38
- name: 'ecs-org',
39
- schemaUrl: `ecosystem/schemas-example-org-jsc.json`,
40
- },
41
- ];
42
- exports.credentials = [
43
- {
44
- name: 'example-service',
45
- credUrl: `ecosystem/cs/v1/js/ecs-service`,
46
- schemaUrl: `ecosystem/schemas-example-service-jsc.json`,
47
- },
48
- {
49
- name: 'example-org',
50
- credUrl: `ecosystem/cs/v1/js/ecs-org`,
51
- schemaUrl: `ecosystem/schemas-example-org-jsc.json`,
52
- },
53
- ];
54
- // Default JSON Schema objects
55
29
  exports.createJsonSchema = {
56
30
  id: 'https://www.w3.org/ns/credentials/json-schema/v2.json',
57
31
  type: 'JsonSchema',
@@ -67,10 +41,10 @@ const createJsonSubjectRef = (id) => ({
67
41
  });
68
42
  exports.createJsonSubjectRef = createJsonSubjectRef;
69
43
  // fragment format per [VT-CRED-W3C-LINKED-VP]
70
- const linkedVpFragment = (schemaKey) => `vpr-schemas-${schemaKey.replace(/^ecs-/, '')}-vtc-vp`;
44
+ const linkedVpSchemaId = (schemaKey) => schemaKey.replace(/^ecs-/, '');
45
+ exports.linkedVpSchemaId = linkedVpSchemaId;
46
+ const linkedVpFragment = (schemaKey) => `vpr-schemas-${(0, exports.linkedVpSchemaId)(schemaKey)}-vtc-vp`;
71
47
  exports.linkedVpFragment = linkedVpFragment;
72
- const mapToSelfTr = (url, publicApiBaseUrl) => url.replace('ecosystem', `${publicApiBaseUrl}/vt`);
73
- exports.mapToSelfTr = mapToSelfTr;
74
48
  // A plain array replacer only allowlists property names, applied at every
75
49
  // nesting level — nested objects like `claims` and `credentialSchema` would
76
50
  // serialize to `{}` since none of their own keys appear in a top-level
@@ -90,229 +64,49 @@ const sortKeysDeep = (value) => {
90
64
  return value;
91
65
  };
92
66
  exports.sortKeysDeep = sortKeysDeep;
93
- const buildIntegrityData = (data) => {
94
- return generateDigestSRI(JSON.stringify((0, exports.sortKeysDeep)(data)));
95
- };
96
- const setupSelfTr = async ({ agent, publicApiBaseUrl, defaults, }) => {
97
- const ecsSchemas = (0, data_1.getEcsSchemas)(publicApiBaseUrl);
98
- const logger = agent.config.logger;
99
- for (const { name, schemaUrl } of exports.presentations) {
100
- try {
101
- await generateVerifiablePresentation(agent, `${publicApiBaseUrl}/vt/${name}-vtc-vp.json`, ecsSchemas, name, ['VerifiableCredential', 'VerifiableTrustCredential'], {
102
- id: (0, exports.mapToSelfTr)(schemaUrl, publicApiBaseUrl),
103
- type: 'JsonSchemaCredential',
104
- }, defaults);
105
- }
106
- catch (error) {
107
- logger.warn(`Skipping self-issued ${name}: ${error instanceof Error ? error.message : error}`);
108
- }
109
- }
110
- for (const { name, credUrl, schemaUrl } of exports.credentials) {
111
- const id = (0, exports.mapToSelfTr)(schemaUrl, publicApiBaseUrl);
112
- const ref = (0, exports.mapToSelfTr)(credUrl, publicApiBaseUrl);
113
- try {
114
- await generateVerifiableCredential(agent, id, ecsSchemas, name, ['VerifiableCredential', 'JsonSchemaCredential'], (0, exports.createJsonSubjectRef)(ref), exports.createJsonSchema, defaults);
115
- }
116
- catch (error) {
117
- logger.warn(`Skipping self-issued ${name}: ${error instanceof Error ? error.message : error}`);
118
- }
119
- }
120
- };
121
- exports.setupSelfTr = setupSelfTr;
122
67
  /**
123
- * Generates and signs a verifiable credential using the agent's DID.
124
- * Stores the signed credential and its integrity metadata in the DID record.
125
- *
126
- * - If the claims for the subject are not provided, they are retrieved (default claims) and validated against the schema.
127
- * - The integrity of the claims is tracked using a Subresource Integrity (SRI) digest.
128
- * - If a credential with the same integrity already exists in the DID metadata, it is returned directly.
129
- * - Otherwise, a new credential is created, signed, and stored in the DID metadata.
130
- * - If a presentation is provided, the signed credential is embedded and a signed presentation is returned.
131
- *
132
- * @param agent - The VsAgent instance used for signing and DID management.
133
- * @param logger - Logger instance for logging operations.
134
- * @param ecsSchemas - Map of ECS schemas for validation.
135
- * @param schemaKey - Unique identifier for the credential type and metadata key.
136
- * @param type - Array of credential types (e.g., ['VerifiableCredential']).
137
- * @param subject - Subject information, including ID and optional claims.
138
- * @param credentialSchema - Schema definition for the credential.
139
- * @param presentation - Optional presentation to include the credential.
140
- * @returns The signed verifiable credential or presentation, with integrity metadata.
68
+ * Builds an unsigned credential: a VC Data Model 2.0 credential, as
69
+ * [VT-CRED-W3C] and [VT-JSON-SCHEMA-CRED-W3C] require the `https://www.w3.org/ns/credentials/v2`
70
+ * context, valid from now for ten years unless told otherwise.
141
71
  */
142
- async function generateVerifiableCredential(agent, id, ecsSchemas, schemaKey, type, subject, credentialSchema, defaults, presentation) {
72
+ function createCredential(options) {
143
73
  var _a;
144
- const logger = agent.config.logger;
145
- const [didRecord] = await agent.dids.getCreatedDids({ did: agent.did });
146
- const { id: subjectId } = subject;
147
- let claims = subject.claims;
148
- if (!claims) {
149
- claims = await getClaims(logger, ecsSchemas, { id: subjectId }, schemaKey, defaults);
150
- }
151
- const integrityData = buildIntegrityData({ id, type, credentialSchema, claims });
152
- const record = (_a = didRecord.metadata.get('_vt/jsc')) !== null && _a !== void 0 ? _a : {};
153
- const metadata = record[subjectId];
154
- if ((metadata === null || metadata === void 0 ? void 0 : metadata.integrityData) === integrityData)
155
- return metadata.credential;
156
- const unsignedCredential = createCredential({
157
- id,
158
- type,
159
- issuer: agent.did,
160
- credentialSubject: {
161
- id: subjectId,
162
- claims: presentation ? claims : await addDigestSRI(subjectId, claims, ecsSchemas),
163
- },
164
- });
165
- unsignedCredential.credentialSchema = presentation
166
- ? credentialSchema
167
- : await addDigestSRI(credentialSchema.id, credentialSchema, ecsSchemas);
168
- // Note: this is dependant on DIDComm invitation keys. Not sure if it is fine or we should use a dedicated
169
- // key for this feature
170
- const verificationMethodId = getVerificationMethodId(logger, didRecord);
171
- const signedCredential = await signerW3c(agent, unsignedCredential, verificationMethodId);
172
- if (presentation) {
173
- presentation.verifiableCredential = [signedCredential];
174
- return await signerW3c(agent, presentation, verificationMethodId);
175
- }
176
- else {
177
- record[subjectId] = {
178
- credential: signedCredential.jsonCredential,
179
- verifiablePresentation: {},
180
- didDocumentServiceId: '',
181
- integrityData,
182
- };
183
- didRecord.metadata.set('_vt/jsc', record);
184
- await agent.context.dependencyManager.resolve(core_1.DidRepository).update(agent.context, didRecord);
185
- return signedCredential.jsonCredential;
186
- }
74
+ return (0, vcdm2_1.createW3cV2Credential)(Object.assign(Object.assign({}, options), { validUntil: (_a = options.validUntil) !== null && _a !== void 0 ? _a : new Date(Date.now() + TEN_YEARS_MS).toISOString() }));
187
75
  }
188
- function createCredential(options) {
189
- var _a, _b, _c;
190
- (_a = options.context) !== null && _a !== void 0 ? _a : (options.context = [
191
- 'https://www.w3.org/2018/credentials/v1',
192
- 'https://www.w3.org/ns/credentials/examples/v2',
193
- ]);
194
- (_b = options.issuanceDate) !== null && _b !== void 0 ? _b : (options.issuanceDate = new Date().toISOString());
195
- (_c = options.expirationDate) !== null && _c !== void 0 ? _c : (options.expirationDate = new Date(Date.now() + 10 * 365 * 24 * 60 * 60 * 1000).toISOString());
196
- return new core_1.W3cCredential(options);
76
+ /**
77
+ * The Data Integrity cryptosuite this agent is configured with, read from the registered
78
+ * `VtFlowModuleConfig` so the self issued credentials are secured and linked VPs with the
79
+ * same suite `VtFlowApi.issueCredentialForSession` applies to the credentials it issues. Falls back
80
+ * to the module default when the vt-flow module is not registered on the agent.
81
+ */
82
+ function getDataIntegrityCryptosuite(agent) {
83
+ const { dependencyManager } = agent.context;
84
+ return dependencyManager.isRegistered(credo_ts_didcomm_vt_flow_1.VtFlowModuleConfig)
85
+ ? dependencyManager.resolve(credo_ts_didcomm_vt_flow_1.VtFlowModuleConfig).dataIntegrityCryptosuite
86
+ : credo_ts_didcomm_vt_flow_1.DEFAULT_DATA_INTEGRITY_CRYPTOSUITE;
197
87
  }
198
88
  async function signerW3c(agent, obj, verificationMethod) {
199
- const proofPurpose = new jsonld_signatures_1.purposes.AssertionProofPurpose();
200
- if (obj instanceof core_1.W3cCredential) {
201
- return await agent.w3cCredentials.signCredential({
202
- format: core_1.ClaimFormat.LdpVc,
89
+ const cryptosuite = getDataIntegrityCryptosuite(agent);
90
+ if (obj instanceof core_1.W3cV2Credential) {
91
+ return await agent.w3cV2Credentials.signCredential({
92
+ format: core_1.ClaimFormat.DiVc,
203
93
  credential: obj,
204
- proofType: 'Ed25519Signature2020',
94
+ cryptosuite,
205
95
  verificationMethod,
206
- proofPurpose,
207
96
  });
208
97
  }
209
- if (obj instanceof core_1.W3cPresentation) {
210
- return await agent.w3cCredentials.signPresentation({
211
- format: core_1.ClaimFormat.LdpVp,
212
- presentation: obj,
213
- proofType: 'Ed25519Signature2020',
214
- verificationMethod,
215
- proofPurpose,
216
- });
217
- }
218
- }
219
- /**
220
- * Generates and signs a verifiable presentation containing a verifiable credential.
221
- * Stores the signed presentation and its integrity metadata in the DID record.
222
- *
223
- * - Retrieves and validates claims for the agent's DID.
224
- * - Computes an integrity digest for the claims.
225
- * - If a presentation with the same integrity already exists in the DID metadata, it is returned.
226
- * - Otherwise, a new presentation is created, signed, and stored in the DID metadata.
227
- *
228
- * @param agent - The VsAgent instance used for signing and DID management.
229
- * @param logger - Logger instance for logging operations.
230
- * @param ecsSchemas - Map of ECS schemas for validation.
231
- * @param schemaKey - Unique identifier for the presentation type and metadata key.
232
- * @param type - Array of credential types to include.
233
- * @param credentialSchema - Schema definition for the credential.
234
- * @param beforePublish - Step that must succeed before a linked presentation counts as published.
235
- * @returns The signed verifiable presentation, with integrity metadata.
236
- */
237
- async function generateVerifiablePresentation(agent, id, ecsSchemas, schemaKey, type, credentialSchema, defaults, beforePublish) {
238
- var _a, _b, _c, _d, _e;
239
- if (!agent.did)
240
- throw Error('The DID must be set up');
241
- const [didRecord] = await agent.dids.getCreatedDids({ did: agent.did });
242
- const didDocument = didRecord.didDocument;
243
- if (!didDocument)
244
- throw Error('The DID Document be set up');
245
- const claims = await getClaims(agent.config.logger, ecsSchemas, { id: agent.did }, schemaKey, defaults);
246
- // Use full input for integrityData to ensure update detection
247
- const didDocumentServiceId = `${agent.did}#${(0, exports.linkedVpFragment)(schemaKey)}`;
248
- const integrityData = buildIntegrityData({ id, type, credentialSchema, claims });
249
- const record = (_a = didRecord.metadata.get('_vt/vtc')) !== null && _a !== void 0 ? _a : {};
250
- const metadata = record[credentialSchema.id];
251
- const attached = (_b = metadata === null || metadata === void 0 ? void 0 : metadata.attached) !== null && _b !== void 0 ? _b : true;
252
- if ((metadata === null || metadata === void 0 ? void 0 : metadata.integrityData) === integrityData) {
253
- // the presentation is already public, so a failed beforePublish step still needs a retry here
254
- if (attached)
255
- await (beforePublish === null || beforePublish === void 0 ? void 0 : beforePublish(metadata.verifiablePresentation));
256
- return metadata.verifiablePresentation;
257
- }
258
- const presentation = createPresentation({
259
- id,
260
- holder: agent.did,
261
- verifiableCredential: [],
98
+ // The options type requires a challenge for every presentation format, while a Data Integrity
99
+ // proof only carries one when it is given
100
+ return await agent.w3cV2Credentials.signPresentation({
101
+ format: core_1.ClaimFormat.DiVp,
102
+ presentation: obj,
103
+ cryptosuite,
104
+ verificationMethod,
262
105
  });
263
- const verifiablePresentation = await generateVerifiableCredential(agent, agent.did, ecsSchemas, schemaKey, type, { id: agent.did }, credentialSchema, defaults, presentation);
264
- // nothing is persisted yet, so a failure here leaves no public presentation behind
265
- if (attached)
266
- await (beforePublish === null || beforePublish === void 0 ? void 0 : beforePublish(verifiablePresentation));
267
- // Update linked VP when the presentation has changed
268
- if (attached)
269
- didDocument.service = (_c = didDocument.service) === null || _c === void 0 ? void 0 : _c.map(s => {
270
- if (typeof s.serviceEndpoint !== 'string')
271
- return s;
272
- if (s.serviceEndpoint.includes(schemaKey) && s.id !== `${agent.did}#whois`) {
273
- s.id = didDocumentServiceId;
274
- s.serviceEndpoint = id;
275
- }
276
- return s;
277
- });
278
- // Resolvers only discover the credential through the [VT-CRED-W3C-LINKED-VP] fragment, and
279
- // #whois does not match it. The rename above only covers documents that already carry the
280
- // service, so publish it here when nothing declared it yet.
281
- let didDocumentChanged = false;
282
- if (attached && !((_d = didDocument.service) === null || _d === void 0 ? void 0 : _d.some(s => s.id === didDocumentServiceId))) {
283
- didDocument.service = [
284
- ...((_e = didDocument.service) !== null && _e !== void 0 ? _e : []),
285
- new core_1.DidDocumentService({
286
- id: didDocumentServiceId,
287
- serviceEndpoint: id,
288
- type: 'LinkedVerifiablePresentation',
289
- }),
290
- ];
291
- didDocumentChanged = true;
292
- }
293
- const credential = verifiablePresentation.verifiableCredential[0];
294
- record[credentialSchema.id] = {
295
- credential,
296
- verifiablePresentation,
297
- didDocumentServiceId,
298
- integrityData,
299
- attached,
300
- };
301
- didRecord.metadata.set('_vt/vtc', record);
302
- await agent.context.dependencyManager.resolve(core_1.DidRepository).update(agent.context, didRecord);
303
- if (didDocumentChanged) {
304
- await agent.dids.update({ did: didRecord.did, didDocument });
305
- }
306
- return verifiablePresentation;
307
106
  }
107
+ /** Builds an unsigned VC Data Model 2.0 presentation; the class supplies the v2 context. */
308
108
  function createPresentation(options) {
309
- var _a, _b;
310
- (_a = options.context) !== null && _a !== void 0 ? _a : (options.context = [
311
- 'https://www.w3.org/2018/credentials/v1',
312
- 'https://www.w3.org/ns/credentials/examples/v2',
313
- ]);
314
- (_b = options.type) !== null && _b !== void 0 ? _b : (options.type = ['VerifiablePresentation']);
315
- return new core_1.W3cPresentation(options);
109
+ return new core_1.W3cV2Presentation(Object.assign({ type: ['VerifiablePresentation'] }, options));
316
110
  }
317
111
  /**
318
112
  * Retrieves and validates claims for a credential subject.
@@ -325,60 +119,43 @@ function createPresentation(options) {
325
119
  * @returns The validated claims object.
326
120
  * @throws If claims are invalid or schema is missing.
327
121
  */
328
- async function getClaims(logger, ecsSchemas, { id, claims }, schemaKey, defaults) {
329
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
330
- // Default claims fallback
331
- const logoUri = (_a = claims === null || claims === void 0 ? void 0 : claims.logoUri) !== null && _a !== void 0 ? _a : defaults.serviceLogoUri;
332
- const termsAndConditionsUri = (_b = claims === null || claims === void 0 ? void 0 : claims.termsAndConditionsUri) !== null && _b !== void 0 ? _b : defaults.serviceTermsAndConditions;
333
- const privacyPolicyUri = (_c = claims === null || claims === void 0 ? void 0 : claims.privacyPolicyUri) !== null && _c !== void 0 ? _c : defaults.servicePrivacyPolicy;
334
- claims =
335
- schemaKey === 'ecs-service'
336
- ? {
337
- name: (_d = claims === null || claims === void 0 ? void 0 : claims.name) !== null && _d !== void 0 ? _d : defaults.agentLabel,
338
- type: (_e = claims === null || claims === void 0 ? void 0 : claims.type) !== null && _e !== void 0 ? _e : defaults.serviceType,
339
- description: (_f = claims === null || claims === void 0 ? void 0 : claims.description) !== null && _f !== void 0 ? _f : defaults.serviceDescription,
340
- logoUri,
341
- logoDigestSri: (_h = (_g = claims === null || claims === void 0 ? void 0 : claims.logoDigestSri) !== null && _g !== void 0 ? _g : defaults.serviceLogoDigestSri) !== null && _h !== void 0 ? _h : (await urlDigestSri(logoUri)),
342
- minimumAgeRequired: (_j = claims === null || claims === void 0 ? void 0 : claims.minimumAgeRequired) !== null && _j !== void 0 ? _j : defaults.serviceMinimumAgeRequired,
343
- termsAndConditionsUri,
344
- termsAndConditionsDigestSri: (_l = (_k = claims === null || claims === void 0 ? void 0 : claims.termsAndConditionsDigestSri) !== null && _k !== void 0 ? _k : defaults.serviceTermsAndConditionsDigestSri) !== null && _l !== void 0 ? _l : (await urlDigestSri(termsAndConditionsUri)),
345
- privacyPolicyUri,
346
- privacyPolicyDigestSri: (_o = (_m = claims === null || claims === void 0 ? void 0 : claims.privacyPolicyDigestSri) !== null && _m !== void 0 ? _m : defaults.servicePrivacyPolicyDigestSri) !== null && _o !== void 0 ? _o : (await urlDigestSri(privacyPolicyUri)),
347
- }
348
- : {
349
- name: (_p = claims === null || claims === void 0 ? void 0 : claims.name) !== null && _p !== void 0 ? _p : defaults.agentLabel,
350
- logoUri,
351
- logoDigestSri: (_r = (_q = claims === null || claims === void 0 ? void 0 : claims.logoDigestSri) !== null && _q !== void 0 ? _q : defaults.serviceLogoDigestSri) !== null && _r !== void 0 ? _r : (await urlDigestSri(logoUri)),
352
- registryId: (_s = claims === null || claims === void 0 ? void 0 : claims.registryId) !== null && _s !== void 0 ? _s : defaults.orgRegistryId,
353
- registryUri: (_t = claims === null || claims === void 0 ? void 0 : claims.registryUri) !== null && _t !== void 0 ? _t : defaults.orgRegistryUri,
354
- address: (_u = claims === null || claims === void 0 ? void 0 : claims.address) !== null && _u !== void 0 ? _u : defaults.orgAddress,
355
- organizationKind: (_v = claims === null || claims === void 0 ? void 0 : claims.organizationKind) !== null && _v !== void 0 ? _v : defaults.orgOrganizationKind,
356
- countryCode: (_w = claims === null || claims === void 0 ? void 0 : claims.countryCode) !== null && _w !== void 0 ? _w : defaults.orgCountryCode,
357
- };
122
+ async function getClaims(logger, ecsSchemas, { id }, schemaKey, ecsClaims) {
123
+ const claims = await (0, ecsClaims_1.composeEcsClaims)(ecsClaims, schemaKey, logger);
124
+ if (!claims)
125
+ throw new Error(`No ECS_CLAIMS_* variable is set for ${schemaKey}`);
358
126
  const ecsSchema = ecsSchemas[schemaKey];
359
127
  if (!ecsSchema) {
360
128
  throw new Error(`Schema not defined in data schemas for schemaKey: ${schemaKey}`);
361
129
  }
362
- const credentialSubject = Object.assign({ id }, claims);
363
- validateSchema(JSON.parse(ecsSchema), credentialSubject);
130
+ validateSchema(JSON.parse(ecsSchema), Object.assign({ id }, claims));
364
131
  return claims;
365
132
  }
133
+ function schemaViolations(ecsSchema, credentialSubject) {
134
+ var _a, _b;
135
+ const validate = ajv.compile((_a = ecsSchema.properties) === null || _a === void 0 ? void 0 : _a.credentialSubject);
136
+ if (validate(credentialSubject))
137
+ return [];
138
+ return ((_b = validate.errors) !== null && _b !== void 0 ? _b : []).map(e => { var _a; return ({ path: e.instancePath, message: (_a = e.message) !== null && _a !== void 0 ? _a : e.keyword }); });
139
+ }
366
140
  /**
367
141
  * Validate a validateSchema object against the corresponding AJV schema.
368
142
  * Throws an Error if the schema is missing or validation fails.
369
143
  */
370
144
  function validateSchema(ecsSchema, credentialSubject) {
371
- var _a, _b;
372
- const validate = ajv.compile((_a = ecsSchema.properties) === null || _a === void 0 ? void 0 : _a.credentialSubject);
373
- const isValid = validate(credentialSubject);
374
- if (!isValid) {
375
- const errorDetails = (_b = validate.errors) === null || _b === void 0 ? void 0 : _b.map(e => ({
376
- message: e.message,
377
- path: e.instancePath,
378
- keyword: e.keyword,
379
- params: e.params,
380
- }));
381
- throw new Error(`Invalid claims for ${ecsSchema.$id}: ${JSON.stringify(errorDetails, null, 2)}`);
145
+ const violations = schemaViolations(ecsSchema, credentialSubject);
146
+ if (violations.length > 0) {
147
+ throw new Error(`Invalid claims for ${ecsSchema.$id}: ${JSON.stringify(violations, null, 2)}`);
148
+ }
149
+ }
150
+ async function fetchSchemaContent(id) {
151
+ try {
152
+ const response = await fetch((0, vs_agent_model_1.mapToEcosystem)(id));
153
+ if (!response.ok)
154
+ return { error: `${response.status} ${response.statusText}` };
155
+ return { content: await response.text() };
156
+ }
157
+ catch (error) {
158
+ return { error: error instanceof Error ? error.message : String(error) };
382
159
  }
383
160
  }
384
161
  /**
@@ -393,15 +170,16 @@ function validateSchema(ecsSchema, credentialSubject) {
393
170
  * @throws Error if both the fetch and local fallback fail.
394
171
  */
395
172
  async function addDigestSRI(id, data, ecsSchemas) {
173
+ var _a;
396
174
  if (!id || !data) {
397
175
  throw new Error(`id and data has requiered`);
398
176
  }
399
- const response = await fetch((0, vs_agent_model_1.mapToEcosystem)(id));
177
+ const fetched = await fetchSchemaContent(id);
400
178
  const key = id.split('/').pop();
401
179
  const fallbackSchema = key && (ecsSchemas === null || ecsSchemas === void 0 ? void 0 : ecsSchemas[key]);
402
- const schemaContent = response.ok ? await response.text() : fallbackSchema;
180
+ const schemaContent = (_a = fetched.content) !== null && _a !== void 0 ? _a : fallbackSchema;
403
181
  if (!schemaContent) {
404
- throw new Error(`Failed to fetch schema from ${id}: ${response.status} ${response.statusText}, and no local fallback found.`);
182
+ throw new Error(`Failed to fetch schema from ${id}: ${fetched.error}, and no local fallback found.`);
405
183
  }
406
184
  assertValidSchema(schemaContent, id);
407
185
  return Object.assign(Object.assign({}, data), { digestSRI: generateDigestSRI(schemaContent) });
@@ -423,36 +201,16 @@ function assertValidSchema(schemaContent, id) {
423
201
  throw new Error(`Schema from ${id} is not valid: ${message}`);
424
202
  }
425
203
  }
426
- /**
427
- * Generates a SRI digest string for the given content using the specified algorithm.
428
- * @param content - The content to hash.
429
- * @param algorithm - The hash algorithm to use (default: sha256).
430
- * @returns The SRI digest string.
431
- */
432
- function generateDigestSRI(content, algorithm = 'sha384') {
433
- const hash = (0, crypto_1.createHash)(algorithm).update(content).digest('base64');
434
- return `${algorithm}-${hash}`;
435
- }
436
- /**
437
- * Digest of the resource a credential references. Throws rather than attest content it could
438
- * not read: a wrong digestSRI is a false integrity claim in a signed credential.
439
- */
440
- async function urlDigestSri(url) {
441
- const response = await axios_1.default.get(url, { responseType: 'arraybuffer', timeout: DIGEST_FETCH_TIMEOUT_MS });
442
- return `sha384-${(0, crypto_1.createHash)('sha384').update(Buffer.from(response.data)).digest('base64')}`;
204
+ function generateDigestSRI(content) {
205
+ return (0, boundedFetch_1.digestOfBytes)(content);
443
206
  }
444
207
  function getVerificationMethodId(logger, didRecord) {
445
- var _a, _b;
446
208
  try {
447
- const verificationMethod = (_b = (_a = didRecord.didDocument) === null || _a === void 0 ? void 0 : _a.verificationMethod) === null || _b === void 0 ? void 0 : _b.find(method => {
448
- var _a, _b;
449
- return (method.type === 'Ed25519VerificationKey2020' || method.type === 'Ed25519VerificationKey2018') &&
450
- method.id === ((_b = (_a = didRecord.didDocument) === null || _a === void 0 ? void 0 : _a.assertionMethod) === null || _b === void 0 ? void 0 : _b[0]);
451
- });
452
- if (!verificationMethod) {
453
- throw new Error('Cannot find a suitable Ed25519Signature2020 verification method in DID Document');
209
+ const verificationMethodId = didRecord.didDocument && (0, reusedDidDocument_1.findSigningVerificationMethodId)(didRecord.didDocument);
210
+ if (!verificationMethodId) {
211
+ throw new Error('Cannot find a suitable Ed25519 verification method in DID Document');
454
212
  }
455
- return verificationMethod.id;
213
+ return verificationMethodId;
456
214
  }
457
215
  catch (error) {
458
216
  logger.error(`Failed to get verification method ID.`, error);
@@ -1 +1 @@
1
- {"version":3,"file":"setupSelfTr.js","sourceRoot":"","sources":["../../src/utils/setupSelfTr.ts"],"names":[],"mappings":";;;;;;AA6PA,4CAUC;AAyBD,8BA0BC;AAoBD,wEAoFC;A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