@verana-labs/vs-agent-sdk 2.0.0-dev.7 → 2.0.0-dev.72

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 (167) hide show
  1. package/README.md +0 -2
  2. package/build/adminApi/AdminApiError.d.ts +28 -0
  3. package/build/adminApi/AdminApiError.js +60 -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 +8 -0
  12. package/build/adminApi/moduleEndpoint.js +28 -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 +17 -34
  30. package/build/agent/VsAgent.js +75 -205
  31. package/build/agent/VsAgent.js.map +1 -1
  32. package/build/agent/createVsAgent.d.ts +5 -6
  33. package/build/agent/createVsAgent.js +3 -5
  34. package/build/agent/createVsAgent.js.map +1 -1
  35. package/build/blockchain/AnonCredsTrustService.d.ts +62 -0
  36. package/build/blockchain/AnonCredsTrustService.js +256 -0
  37. package/build/blockchain/AnonCredsTrustService.js.map +1 -0
  38. package/build/blockchain/AuthorizationService.d.ts +5 -3
  39. package/build/blockchain/AuthorizationService.js +17 -29
  40. package/build/blockchain/AuthorizationService.js.map +1 -1
  41. package/build/blockchain/IndexerWebSocketService.d.ts +7 -1
  42. package/build/blockchain/IndexerWebSocketService.js +68 -36
  43. package/build/blockchain/IndexerWebSocketService.js.map +1 -1
  44. package/build/blockchain/VeranaChainService.d.ts +26 -14
  45. package/build/blockchain/VeranaChainService.js +139 -127
  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/handlers/authorizationHandlers.js +2 -2
  51. package/build/blockchain/handlers/authorizationHandlers.js.map +1 -1
  52. package/build/blockchain/handlers/defaultHandlers.js +6 -1
  53. package/build/blockchain/handlers/defaultHandlers.js.map +1 -1
  54. package/build/blockchain/handlers/index.d.ts +1 -0
  55. package/build/blockchain/handlers/index.js +1 -0
  56. package/build/blockchain/handlers/index.js.map +1 -1
  57. package/build/blockchain/handlers/selfIssuanceHandlers.d.ts +13 -0
  58. package/build/blockchain/handlers/selfIssuanceHandlers.js +76 -0
  59. package/build/blockchain/handlers/selfIssuanceHandlers.js.map +1 -0
  60. package/build/blockchain/handlers/stateMutations.d.ts +20 -3
  61. package/build/blockchain/handlers/stateMutations.js +286 -41
  62. package/build/blockchain/handlers/stateMutations.js.map +1 -1
  63. package/build/blockchain/index.d.ts +2 -0
  64. package/build/blockchain/index.js +2 -0
  65. package/build/blockchain/index.js.map +1 -1
  66. package/build/blockchain/indexerMappers.d.ts +3 -0
  67. package/build/blockchain/indexerMappers.js +53 -0
  68. package/build/blockchain/indexerMappers.js.map +1 -0
  69. package/build/blockchain/types.d.ts +13 -58
  70. package/build/blockchain/types.js.map +1 -1
  71. package/build/bootstrap/EcsBootstrapService.d.ts +14 -3
  72. package/build/bootstrap/EcsBootstrapService.js +178 -79
  73. package/build/bootstrap/EcsBootstrapService.js.map +1 -1
  74. package/build/connections/ParentConnectionModule.d.ts +20 -0
  75. package/build/connections/ParentConnectionModule.js +56 -0
  76. package/build/connections/ParentConnectionModule.js.map +1 -0
  77. package/build/credentials/FullTailsFileService.d.ts +0 -1
  78. package/build/credentials/FullTailsFileService.js +0 -49
  79. package/build/credentials/FullTailsFileService.js.map +1 -1
  80. package/build/did/CachedDocumentLoader.d.ts +3 -0
  81. package/build/did/CachedDocumentLoader.js +7 -1
  82. package/build/did/CachedDocumentLoader.js.map +1 -1
  83. package/build/did/CachedWebDidResolver.d.ts +0 -4
  84. package/build/did/CachedWebDidResolver.js +1 -5
  85. package/build/did/CachedWebDidResolver.js.map +1 -1
  86. package/build/did/artifactServices.d.ts +12 -0
  87. package/build/did/artifactServices.js +48 -0
  88. package/build/did/artifactServices.js.map +1 -0
  89. package/build/did/legacyDidWeb.d.ts +6 -4
  90. package/build/did/legacyDidWeb.js +17 -14
  91. package/build/did/legacyDidWeb.js.map +1 -1
  92. package/build/did/publicDid.d.ts +4 -0
  93. package/build/did/publicDid.js +19 -0
  94. package/build/did/publicDid.js.map +1 -0
  95. package/build/events/BaseMessageEvents.js +139 -5
  96. package/build/events/BaseMessageEvents.js.map +1 -1
  97. package/build/events/ConnectionEvents.js +129 -82
  98. package/build/events/ConnectionEvents.js.map +1 -1
  99. package/build/events/VsAgentEvents.d.ts +11 -9
  100. package/build/events/VsAgentEvents.js +8 -1
  101. package/build/events/VsAgentEvents.js.map +1 -1
  102. package/build/events/VtFlowEvents.d.ts +1 -1
  103. package/build/events/VtFlowEvents.js +29 -17
  104. package/build/events/VtFlowEvents.js.map +1 -1
  105. package/build/index.d.ts +7 -1
  106. package/build/index.js +15 -2
  107. package/build/index.js.map +1 -1
  108. package/build/plugins/setupBaseDidComm.js +9 -12
  109. package/build/plugins/setupBaseDidComm.js.map +1 -1
  110. package/build/transports/VsAgentWsInboundTransport.d.ts +1 -1
  111. package/build/transports/VsAgentWsInboundTransport.js +20 -14
  112. package/build/transports/VsAgentWsInboundTransport.js.map +1 -1
  113. package/build/types.d.ts +7 -13
  114. package/build/types.js +1 -2
  115. package/build/types.js.map +1 -1
  116. package/build/utils/agent.d.ts +29 -4
  117. package/build/utils/agent.js +91 -22
  118. package/build/utils/agent.js.map +1 -1
  119. package/build/utils/didReadiness.d.ts +9 -0
  120. package/build/utils/didReadiness.js +42 -0
  121. package/build/utils/didReadiness.js.map +1 -0
  122. package/build/utils/ecsClaims.d.ts +47 -0
  123. package/build/utils/ecsClaims.js +120 -0
  124. package/build/utils/ecsClaims.js.map +1 -0
  125. package/build/utils/ecsService.d.ts +8 -0
  126. package/build/utils/ecsService.js +23 -0
  127. package/build/utils/ecsService.js.map +1 -0
  128. package/build/utils/index.d.ts +4 -0
  129. package/build/utils/index.js +4 -0
  130. package/build/utils/index.js.map +1 -1
  131. package/build/utils/selfIssuedEcsCredential.d.ts +8 -0
  132. package/build/utils/selfIssuedEcsCredential.js +158 -0
  133. package/build/utils/selfIssuedEcsCredential.js.map +1 -0
  134. package/build/utils/setupSelfTr.d.ts +34 -66
  135. package/build/utils/setupSelfTr.js +90 -294
  136. package/build/utils/setupSelfTr.js.map +1 -1
  137. package/build/utils/trustCredentialStore.d.ts +67 -9
  138. package/build/utils/trustCredentialStore.js +296 -111
  139. package/build/utils/trustCredentialStore.js.map +1 -1
  140. package/build/utils/util.d.ts +10 -0
  141. package/build/utils/util.js +16 -0
  142. package/build/utils/util.js.map +1 -1
  143. package/build/utils/vcdm2.d.ts +34 -0
  144. package/build/utils/vcdm2.js +60 -0
  145. package/build/utils/vcdm2.js.map +1 -0
  146. package/build/utils/vtjscResolver.d.ts +18 -0
  147. package/build/utils/vtjscResolver.js +54 -0
  148. package/build/utils/vtjscResolver.js.map +1 -0
  149. package/build/vtFlow/VtFlowOrchestrator.d.ts +107 -14
  150. package/build/vtFlow/VtFlowOrchestrator.js +734 -109
  151. package/build/vtFlow/VtFlowOrchestrator.js.map +1 -1
  152. package/build/vtFlow/assertVerifiableService.d.ts +1 -0
  153. package/build/vtFlow/assertVerifiableService.js +45 -5
  154. package/build/vtFlow/assertVerifiableService.js.map +1 -1
  155. package/build/vtFlow/ecsIssuanceExemption.d.ts +12 -0
  156. package/build/vtFlow/ecsIssuanceExemption.js +84 -0
  157. package/build/vtFlow/ecsIssuanceExemption.js.map +1 -0
  158. package/build/vtFlow/index.d.ts +1 -0
  159. package/build/vtFlow/index.js +1 -0
  160. package/build/vtFlow/index.js.map +1 -1
  161. package/package.json +17 -12
  162. package/build/did/migrateWebVhLog.d.ts +0 -34
  163. package/build/did/migrateWebVhLog.js +0 -230
  164. package/build/did/migrateWebVhLog.js.map +0 -1
  165. package/build/did/migrateWebVhVersionTime.d.ts +0 -9
  166. package/build/did/migrateWebVhVersionTime.js +0 -191
  167. package/build/did/migrateWebVhVersionTime.js.map +0 -1
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SOVRIN_STAGING_NET = exports.BCOVRIN_TEST_GENESIS = void 0;
4
4
  exports.fetchJson = fetchJson;
5
+ exports.anonCredsSchemaFromJsonSchema = anonCredsSchemaFromJsonSchema;
5
6
  exports.BCOVRIN_TEST_GENESIS = `{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node1","blskey":"4N8aUNHSgjQVgkpm8nhNEfDf6txHznoYREg9kirmJrkivgL4oSEimFF6nsQ6M41QvhM2Z33nves5vfSn9n1UwNFJBYtWVnHYMATn76vLuL3zU88KyeAYcHfsih3He6UHcXDxcaecHVz6jhCYz1P2UZn2bDVruL5wXpehgBfBaLKm3Ba","blskey_pop":"RahHYiCvoNCtPTrVtP7nMC5eTYrsUA8WjXbdhNc8debh1agE9bGiJxWBXYNFbnJXoXhWFMvyqhqhRoq737YQemH5ik9oL7R4NTTCz2LEZhkgLJzB3QRQqJyBNyv7acbdHrAT8nQ9UkLbaVL9NBpnWXBTw4LEMePaSHEw66RzPNdAX1","client_ip":"138.197.138.255","client_port":9702,"node_ip":"138.197.138.255","node_port":9701,"services":["VALIDATOR"]},"dest":"Gw6pDLhcBcoQesN72qfotTgFa7cbuqZpkX3Xo6pLhPhv"},"metadata":{"from":"Th7MpTaRZVRYnPiabds81Y"},"type":"0"},"txnMetadata":{"seqNo":1,"txnId":"fea82e10e894419fe2bea7d96296a6d46f50f93f9eeda954ec461b2ed2950b62"},"ver":"1"}
6
7
  {"reqSignature":{},"txn":{"data":{"data":{"alias":"Node2","blskey":"37rAPpXVoxzKhz7d9gkUe52XuXryuLXoM6P6LbWDB7LSbG62Lsb33sfG7zqS8TK1MXwuCHj1FKNzVpsnafmqLG1vXN88rt38mNFs9TENzm4QHdBzsvCuoBnPH7rpYYDo9DZNJePaDvRvqJKByCabubJz3XXKbEeshzpz4Ma5QYpJqjk","blskey_pop":"Qr658mWZ2YC8JXGXwMDQTzuZCWF7NK9EwxphGmcBvCh6ybUuLxbG65nsX4JvD4SPNtkJ2w9ug1yLTj6fgmuDg41TgECXjLCij3RMsV8CwewBVgVN67wsA45DFWvqvLtu4rjNnE9JbdFTc1Z4WCPA3Xan44K1HoHAq9EVeaRYs8zoF5","client_ip":"138.197.138.255","client_port":9704,"node_ip":"138.197.138.255","node_port":9703,"services":["VALIDATOR"]},"dest":"8ECVSk179mjsjKRLWiQtssMLgp6EPhWXtaYyStWPSGAb"},"metadata":{"from":"EbP4aYNeTHL6q385GuVpRV"},"type":"0"},"txnMetadata":{"seqNo":2,"txnId":"1ac8aece2a18ced660fef8694b61aac3af08ba875ce3026a160acbc3a3af35fc"},"ver":"1"}
7
8
  {"reqSignature":{},"txn":{"data":{"data":{"alias":"Node3","blskey":"3WFpdbg7C5cnLYZwFZevJqhubkFALBfCBBok15GdrKMUhUjGsk3jV6QKj6MZgEubF7oqCafxNdkm7eswgA4sdKTRc82tLGzZBd6vNqU8dupzup6uYUf32KTHTPQbuUM8Yk4QFXjEf2Usu2TJcNkdgpyeUSX42u5LqdDDpNSWUK5deC5","blskey_pop":"QwDeb2CkNSx6r8QC8vGQK3GRv7Yndn84TGNijX8YXHPiagXajyfTjoR87rXUu4G4QLk2cF8NNyqWiYMus1623dELWwx57rLCFqGh7N4ZRbGDRP4fnVcaKg1BcUxQ866Ven4gw8y4N56S5HzxXNBZtLYmhGHvDtk6PFkFwCvxYrNYjh","client_ip":"138.197.138.255","client_port":9706,"node_ip":"138.197.138.255","node_port":9705,"services":["VALIDATOR"]},"dest":"DKVxG2fXXTU8yT5N7hGEbXB3dfdAnYv1JczDUHpmDxya"},"metadata":{"from":"4cU41vWW82ArfxJxHkzXPG"},"type":"0"},"txnMetadata":{"seqNo":3,"txnId":"7e9f355dffa78ed24668f0e0e369fd8c224076571c51e2ea8be5f26479edebe4"},"ver":"1"}
@@ -160,4 +161,19 @@ async function fetchJson(url, arg) {
160
161
  clearTimeout(timer);
161
162
  }
162
163
  }
164
+ /**
165
+ * Maps `title` to the schema name and the `credentialSubject` properties to `attrNames`, per
166
+ * [VSA-PUB-AC-5]. The VTJSC issuer and every accredited issuer must derive the same values.
167
+ */
168
+ function anonCredsSchemaFromJsonSchema(jsonSchema) {
169
+ var _a, _b, _c;
170
+ const parsed = (typeof jsonSchema === 'string' ? JSON.parse(jsonSchema) : jsonSchema);
171
+ const name = parsed === null || parsed === void 0 ? void 0 : parsed.title;
172
+ if (!name)
173
+ throw new Error('The JSON Schema carries no title');
174
+ const attrNames = Object.keys((_c = (_b = (_a = parsed === null || parsed === void 0 ? void 0 : parsed.properties) === null || _a === void 0 ? void 0 : _a.credentialSubject) === null || _b === void 0 ? void 0 : _b.properties) !== null && _c !== void 0 ? _c : {}).map(String);
175
+ if (attrNames.length === 0)
176
+ throw new Error(`The JSON Schema "${name}" defines no credentialSubject property`);
177
+ return { name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-ts/core';
2
+ /**
3
+ * The W3C context that gives terms no other context defines an IRI under
4
+ * `https://www.w3.org/ns/credentials/undefined-term#`, which is what schema-driven ECS claims are to
5
+ * a JSON-LD consumer: issuer-dependent terms, not examples.
6
+ */
7
+ export declare const CREDENTIALS_UNDEFINED_TERMS_V2_URL = "https://www.w3.org/ns/credentials/undefined-terms/v2";
8
+ /**
9
+ * JSON-LD context of the VC Data Model 2.0 credentials the agent issues: the trust credentials it
10
+ * publishes from its DID Document and the ones it issues over DIDComm with the W3C Data Integrity
11
+ * attachment format (Aries RFC 0809).
12
+ *
13
+ * The undefined-terms context supplies the `@vocab` that lets schema-driven credential subject
14
+ * claims expand when a third party processes the credential as JSON-LD. The `eddsa-jcs-2022`
15
+ * cryptosuite securing these credentials canonicalizes JSON and never expands the context itself.
16
+ */
17
+ export declare const CREDENTIALS_V2_CONTEXT: string[];
18
+ /**
19
+ * Builds an unsigned VC Data Model 2.0 credential. Unless told otherwise it uses
20
+ * {@link CREDENTIALS_V2_CONTEXT} and is valid from now, with no `validUntil`.
21
+ */
22
+ export declare function createW3cV2Credential(options: W3cV2CredentialOptions): W3cV2Credential;
23
+ /** The plain JSON an RFC 0809 credential offer carries the unsigned credential as. */
24
+ export declare function toOfferedCredentialJson(credential: W3cV2Credential): JsonObject;
25
+ /** Whether a credential JSON uses the VC Data Model 2.0 base context, as RFC 0809 decides the data model version. */
26
+ export declare function isVcdm2Credential(credential: {
27
+ '@context'?: unknown;
28
+ }): boolean;
29
+ /**
30
+ * Whether a stored credential is what the agent publishes today: VC Data Model 2.0 secured with
31
+ * Data Integrity proofs. An agent upgraded from a version that published data model 1.1 linked
32
+ * data proofs rebuilds its trust credentials when this is false.
33
+ */
34
+ export declare function isDataIntegrityVcdm2Credential(credential: unknown): boolean;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CREDENTIALS_V2_CONTEXT = exports.CREDENTIALS_UNDEFINED_TERMS_V2_URL = void 0;
4
+ exports.createW3cV2Credential = createW3cV2Credential;
5
+ exports.toOfferedCredentialJson = toOfferedCredentialJson;
6
+ exports.isVcdm2Credential = isVcdm2Credential;
7
+ exports.isDataIntegrityVcdm2Credential = isDataIntegrityVcdm2Credential;
8
+ const core_1 = require("@credo-ts/core");
9
+ /**
10
+ * The W3C context that gives terms no other context defines an IRI under
11
+ * `https://www.w3.org/ns/credentials/undefined-term#`, which is what schema-driven ECS claims are to
12
+ * a JSON-LD consumer: issuer-dependent terms, not examples.
13
+ */
14
+ exports.CREDENTIALS_UNDEFINED_TERMS_V2_URL = 'https://www.w3.org/ns/credentials/undefined-terms/v2';
15
+ /**
16
+ * JSON-LD context of the VC Data Model 2.0 credentials the agent issues: the trust credentials it
17
+ * publishes from its DID Document and the ones it issues over DIDComm with the W3C Data Integrity
18
+ * attachment format (Aries RFC 0809).
19
+ *
20
+ * The undefined-terms context supplies the `@vocab` that lets schema-driven credential subject
21
+ * claims expand when a third party processes the credential as JSON-LD. The `eddsa-jcs-2022`
22
+ * cryptosuite securing these credentials canonicalizes JSON and never expands the context itself.
23
+ */
24
+ exports.CREDENTIALS_V2_CONTEXT = [
25
+ core_1.CREDENTIALS_CONTEXT_V2_URL,
26
+ exports.CREDENTIALS_UNDEFINED_TERMS_V2_URL,
27
+ ];
28
+ /**
29
+ * Builds an unsigned VC Data Model 2.0 credential. Unless told otherwise it uses
30
+ * {@link CREDENTIALS_V2_CONTEXT} and is valid from now, with no `validUntil`.
31
+ */
32
+ function createW3cV2Credential(options) {
33
+ var _a, _b;
34
+ return new core_1.W3cV2Credential(Object.assign(Object.assign({}, options), { context: (_a = options.context) !== null && _a !== void 0 ? _a : exports.CREDENTIALS_V2_CONTEXT, validFrom: (_b = options.validFrom) !== null && _b !== void 0 ? _b : new Date().toISOString() }));
35
+ }
36
+ /** The plain JSON an RFC 0809 credential offer carries the unsigned credential as. */
37
+ function toOfferedCredentialJson(credential) {
38
+ return core_1.JsonTransformer.toJSON(credential);
39
+ }
40
+ /** Whether a credential JSON uses the VC Data Model 2.0 base context, as RFC 0809 decides the data model version. */
41
+ function isVcdm2Credential(credential) {
42
+ const context = credential['@context'];
43
+ const base = Array.isArray(context) ? context[0] : context;
44
+ return base === core_1.CREDENTIALS_CONTEXT_V2_URL;
45
+ }
46
+ /**
47
+ * Whether a stored credential is what the agent publishes today: VC Data Model 2.0 secured with
48
+ * Data Integrity proofs. An agent upgraded from a version that published data model 1.1 linked
49
+ * data proofs rebuilds its trust credentials when this is false.
50
+ */
51
+ function isDataIntegrityVcdm2Credential(credential) {
52
+ if (!credential || typeof credential !== 'object')
53
+ return false;
54
+ const { proof } = credential;
55
+ const proofs = Array.isArray(proof) ? proof : proof ? [proof] : [];
56
+ return (isVcdm2Credential(credential) &&
57
+ proofs.length > 0 &&
58
+ proofs.every(entry => (entry === null || entry === void 0 ? void 0 : entry.type) === 'DataIntegrityProof'));
59
+ }
60
+ //# sourceMappingURL=vcdm2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vcdm2.js","sourceRoot":"","sources":["../../src/utils/vcdm2.ts"],"names":[],"mappings":";;;AAiCA,sDAMC;AAGD,0DAEC;AAGD,8CAIC;AAOD,wEASC;AAnED,yCAMuB;AAEvB;;;;GAIG;AACU,QAAA,kCAAkC,GAAG,sDAAsD,CAAA;AAExG;;;;;;;;GAQG;AACU,QAAA,sBAAsB,GAAa;IAC9C,iCAA0B;IAC1B,0CAAkC;CACnC,CAAA;AAED;;;GAGG;AACH,SAAgB,qBAAqB,CAAC,OAA+B;;IACnE,OAAO,IAAI,sBAAe,iCACrB,OAAO,KACV,OAAO,EAAE,MAAA,OAAO,CAAC,OAAO,mCAAI,8BAAsB,EAClD,SAAS,EAAE,MAAA,OAAO,CAAC,SAAS,mCAAI,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,IACxD,CAAA;AACJ,CAAC;AAED,sFAAsF;AACtF,SAAgB,uBAAuB,CAAC,UAA2B;IACjE,OAAO,sBAAe,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;AAC3C,CAAC;AAED,qHAAqH;AACrH,SAAgB,iBAAiB,CAAC,UAAoC;IACpE,MAAM,OAAO,GAAG,UAAU,CAAC,UAAU,CAAC,CAAA;IACtC,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;IAC1D,OAAO,IAAI,KAAK,iCAA0B,CAAA;AAC5C,CAAC;AAED;;;;GAIG;AACH,SAAgB,8BAA8B,CAAC,UAAmB;IAChE,IAAI,CAAC,UAAU,IAAI,OAAO,UAAU,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC/D,MAAM,EAAE,KAAK,EAAE,GAAG,UAAiC,CAAA;IACnD,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IAClE,OAAO,CACL,iBAAiB,CAAC,UAAsC,CAAC;QACzD,MAAM,CAAC,MAAM,GAAG,CAAC;QACjB,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,KAAmC,aAAnC,KAAK,uBAAL,KAAK,CAAgC,IAAI,MAAK,oBAAoB,CAAC,CAC3F,CAAA;AACH,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { VsAgent } from '../agent/VsAgent';
2
+ import type { VeranaIndexerService } from '../blockchain/VeranaIndexerService';
3
+ /**
4
+ * Resolves the VTJSC that a credential of a given schema must name as its `credentialSchema`.
5
+ *
6
+ * The Ecosystem publishes the VTJSC, and it is the only party that does. An issuer that the
7
+ * Ecosystem's Corporation assigned an ISSUER Participant entry usually belongs to another
8
+ * Corporation: it holds no local copy and MUST NOT publish one. It reads the Ecosystem
9
+ * controller's DID Document instead, and follows the Linked Verifiable Presentation that carries
10
+ * the VTJSC of this schema.
11
+ *
12
+ * An agent that controls the Ecosystem itself already stores the same presentation, so it answers
13
+ * from its own record and makes no network call.
14
+ *
15
+ * Returns the id of the JsonSchemaCredential, which is the value a credential carries in
16
+ * `credentialSchema.id`.
17
+ */
18
+ export declare function resolveJsonSchemaCredentialId(agent: VsAgent, indexer: VeranaIndexerService, credentialSchemaId: string | number, chainId: string): Promise<string>;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveJsonSchemaCredentialId = resolveJsonSchemaCredentialId;
4
+ const trustCredentialStore_1 = require("./trustCredentialStore");
5
+ const util_1 = require("./util");
6
+ const VTJSC_FETCH_TIMEOUT_MS = 30000;
7
+ /**
8
+ * Resolves the VTJSC that a credential of a given schema must name as its `credentialSchema`.
9
+ *
10
+ * The Ecosystem publishes the VTJSC, and it is the only party that does. An issuer that the
11
+ * Ecosystem's Corporation assigned an ISSUER Participant entry usually belongs to another
12
+ * Corporation: it holds no local copy and MUST NOT publish one. It reads the Ecosystem
13
+ * controller's DID Document instead, and follows the Linked Verifiable Presentation that carries
14
+ * the VTJSC of this schema.
15
+ *
16
+ * An agent that controls the Ecosystem itself already stores the same presentation, so it answers
17
+ * from its own record and makes no network call.
18
+ *
19
+ * Returns the id of the JsonSchemaCredential, which is the value a credential carries in
20
+ * `credentialSchema.id`.
21
+ */
22
+ async function resolveJsonSchemaCredentialId(agent, indexer, credentialSchemaId, chainId) {
23
+ var _a, _b, _c, _d, _e, _f, _g, _h;
24
+ const schemaId = String(credentialSchemaId);
25
+ const schemaRef = `vpr:verana:${chainId}:cs:${schemaId}`;
26
+ if (agent.did) {
27
+ const [didRecord] = await agent.dids.getCreatedDids({ did: agent.did });
28
+ const localId = didRecord
29
+ ? (_d = (_c = (_b = (_a = (0, trustCredentialStore_1.findMetadataEntry)(didRecord, '_vt/jsc', '', schemaRef)) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.verifiableCredential) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.id
30
+ : undefined;
31
+ if (localId)
32
+ return localId;
33
+ }
34
+ const schema = await indexer.getCredentialSchema(schemaId);
35
+ const ecosystem = await indexer.getEcosystem(schema.ecosystem_id);
36
+ if (!(ecosystem === null || ecosystem === void 0 ? void 0 : ecosystem.did)) {
37
+ throw new Error(`Ecosystem ${schema.ecosystem_id} of schema ${schemaId} has no DID`);
38
+ }
39
+ // createJsc registers the presentation under this exact service id.
40
+ const serviceId = `${ecosystem.did}#vpr-schemas-${schemaId}-vtjsc-vp`;
41
+ const { didDocument } = await agent.dids.resolve(ecosystem.did);
42
+ const endpoint = (_f = (_e = didDocument === null || didDocument === void 0 ? void 0 : didDocument.service) === null || _e === void 0 ? void 0 : _e.find(service => service.id === serviceId)) === null || _f === void 0 ? void 0 : _f.serviceEndpoint;
43
+ if (typeof endpoint !== 'string') {
44
+ throw new Error(`Ecosystem ${ecosystem.did} publishes no VTJSC for schema ${schemaId} (no service ${serviceId})`);
45
+ }
46
+ // fetchJson applies the timeout and turns a non-2xx answer into an error that names the URL.
47
+ const presentation = await (0, util_1.fetchJson)(endpoint, VTJSC_FETCH_TIMEOUT_MS);
48
+ const jsonSchemaCredentialId = (_h = (_g = presentation.verifiableCredential) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.id;
49
+ if (!jsonSchemaCredentialId) {
50
+ throw new Error(`The VTJSC presentation at ${endpoint} carries no credential`);
51
+ }
52
+ return jsonSchemaCredentialId;
53
+ }
54
+ //# sourceMappingURL=vtjscResolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vtjscResolver.js","sourceRoot":"","sources":["../../src/utils/vtjscResolver.ts"],"names":[],"mappings":";;AA4BA,sEAwCC;AAjED,iEAA0D;AAC1D,iCAAkC;AAElC,MAAM,sBAAsB,GAAG,KAAM,CAAA;AAOrC;;;;;;;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,GAAG,MAAA,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,0CAAE,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,KAAK,SAAS,CAAC,0CAAE,eAAe,CAAA;IACjG,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CACb,aAAa,SAAS,CAAC,GAAG,kCAAkC,QAAQ,gBAAgB,SAAS,GAAG,CACjG,CAAA;IACH,CAAC;IAED,6FAA6F;IAC7F,MAAM,YAAY,GAAG,MAAM,IAAA,gBAAS,EAAoB,QAAQ,EAAE,sBAAsB,CAAC,CAAA;IACzF,MAAM,sBAAsB,GAAG,MAAA,MAAA,YAAY,CAAC,oBAAoB,0CAAG,CAAC,CAAC,0CAAE,EAAE,CAAA;IACzE,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,6BAA6B,QAAQ,wBAAwB,CAAC,CAAA;IAChF,CAAC;IACD,OAAO,sBAAsB,CAAA;AAC/B,CAAC"}
@@ -1,10 +1,10 @@
1
- import { type DidCommJsonLdCredentialDetailFormat, type JsonCredential } from '@credo-ts/didcomm';
2
- import { VtFlowRecord } from '@verana-labs/credo-ts-didcomm-vt-flow';
1
+ import type { JsonObject } from '@credo-ts/core';
2
+ import type { DidCommDataIntegrityOfferCredentialFormat } from '@credo-ts/didcomm';
3
+ import { VtFlowRecord, type VtFlowCheckParticipantIdContext, type VtFlowEcsIssuanceExemptionContext, type VtFlowIssuance } from '@verana-labs/credo-ts-didcomm-vt-flow';
3
4
  import { BaseAgentModules, VsAgent } from '../agent';
4
- import { VeranaIndexerService } from '../blockchain/VeranaIndexerService';
5
+ import { Participant, ParticipantDto } from '../blockchain/types';
5
6
  export interface VtFlowOrchestratorOptions {
6
7
  publicApiBaseUrl?: string;
7
- indexer?: VeranaIndexerService;
8
8
  agentParticipantId?: number;
9
9
  walletAgentParticipantId?: number;
10
10
  }
@@ -13,13 +13,33 @@ export interface StartOnboardingProcessInput {
13
13
  participantSessionId?: string;
14
14
  claims?: Record<string, unknown>;
15
15
  }
16
- export interface ValidateAndOfferCredentialInput {
16
+ export interface ValidateOnboardingProcessInput {
17
17
  vtFlowRecordId: string;
18
+ /** Only for a HOLDER. It defaults to the schema of the applicant participant. */
19
+ credentialSchemaId?: string;
20
+ credentialType?: string[];
21
+ credentialContext?: string[];
22
+ }
23
+ export interface ValidateFlowInput {
24
+ vtFlowRecordId: string;
25
+ validationFees?: number;
26
+ issuanceFees?: number;
27
+ verificationFees?: number;
28
+ issuanceFeeDiscount?: number;
29
+ verificationFeeDiscount?: number;
30
+ effectiveUntil?: string;
31
+ opSummaryDigest?: string;
32
+ }
33
+ export interface OfferOnboardingCredentialInput {
34
+ vtFlowRecordId: string;
35
+ /** The credential validateOnboardingProcess built. Without it the method builds one. */
36
+ credential?: JsonObject;
37
+ /** It defaults to the schema of the applicant participant. */
38
+ credentialSchemaId?: string;
39
+ /** The participant validateOnboardingProcess returned; saves a second chain read. */
40
+ participant?: Participant;
18
41
  credentialType?: string[];
19
42
  credentialContext?: string[];
20
- credentialSchemaId: string;
21
- agentParticipantId?: number;
22
- walletAgentParticipantId?: number;
23
43
  }
24
44
  export interface AcceptCredentialInput {
25
45
  vtFlowRecordId: string;
@@ -29,25 +49,98 @@ export declare class VtFlowOrchestrator {
29
49
  private readonly options;
30
50
  constructor(agent: VsAgent<BaseAgentModules>, options?: VtFlowOrchestratorOptions);
31
51
  startOnboardingProcess(input: StartOnboardingProcessInput): Promise<VtFlowRecord>;
32
- validateAndOfferCredential(input: ValidateAndOfferCredentialInput): Promise<VtFlowRecord>;
52
+ /**
53
+ * Validate an onboarding process: record the outcome on-chain, accept the onboarding request and
54
+ * move the record to VALIDATED. It sends no credential. Only a HOLDER takes part in a credential
55
+ * exchange; an ISSUER, a VERIFIER or a grantor joins the Ecosystem, and SetParticipantOPToValidated
56
+ * is the whole of it. The caller decides what follows, from the role of the returned participant.
57
+ *
58
+ * For a HOLDER it builds the credential before the chain write, and returns it for
59
+ * offerOnboardingCredential. Claims that do not satisfy the schema, or a schema fetch that fails,
60
+ * must stop the process while the chain holds no outcome yet and the caller can repeat the call.
61
+ *
62
+ * A record that is already VALIDATED and has no credential exchange keeps the chain outcome and
63
+ * only builds the credential again. A repeat call thus re-drives an offer that did not complete.
64
+ */
65
+ validateOnboardingProcess(input: ValidateOnboardingProcessInput): Promise<{
66
+ record: VtFlowRecord;
67
+ participant: Participant;
68
+ credential?: JsonObject;
69
+ }>;
70
+ /**
71
+ * Offer the credential of an onboarding process to its applicant. Call it only for a HOLDER, and
72
+ * only after validateOnboardingProcess has moved the record to VALIDATED. Give it the credential
73
+ * that validateOnboardingProcess built, so that the process does not build the credential twice.
74
+ */
75
+ offerOnboardingCredential(input: OfferOnboardingCredentialInput): Promise<VtFlowRecord>;
76
+ /**
77
+ * Close an onboarding process that carries no credential exchange, on the validator side. The
78
+ * applicant reaches the same state from the SetParticipantOPToValidated chain event.
79
+ */
80
+ completeOnboardingProcess(vtFlowRecordId: string): Promise<VtFlowRecord>;
81
+ /** [VSA-ADM-VT-FL-VALIDATE] */
82
+ validateFlow(input: ValidateFlowInput): Promise<VtFlowRecord>;
83
+ private validateDirectIssuance;
84
+ private sendValidating;
85
+ private assertClaims;
86
+ private assertValidateState;
87
+ private validationTerms;
88
+ private assertClaimsAndTerm;
89
+ private submissionPath;
90
+ private submitValidation;
91
+ private preflight;
92
+ private anchor;
93
+ resolveValidationTx(recordId: string): Promise<void>;
94
+ private failUnlessValidated;
95
+ /**
96
+ * [VSA-VTI-FLOW-OP-ISSUE]: moves the flow to VALIDATED and fills `validation` from the validated
97
+ * entry. Without the landed transaction, a recorded broadcast keeps its tx, and its submission
98
+ * unless that tx failed.
99
+ */
100
+ markValidated(recordId: string, entry: ParticipantDto, landed?: {
101
+ hash: string;
102
+ height: number;
103
+ timestamp?: string;
104
+ }): Promise<VtFlowRecord>;
105
+ /** rejectFlow ended the flow with its transaction in flight, and no newer flow of the applicant replaced it ([VSA-ADM-VT-FL-REJECT-2]). */
106
+ isRejectedInFlight(record: VtFlowRecord): Promise<boolean>;
107
+ continueAfterValidated(recordId: string): Promise<VtFlowRecord>;
108
+ /** [VSA-ADM-VT-FL-VALIDATE-8]: at startup, resume every flow left in VALIDATION_TX_SUBMITTED. */
109
+ resumeValidationSubmissions(): Promise<void>;
110
+ /** [VSA-VTI-FLOW-ISSUE-1]: at startup, resume every anchoring left SUBMITTED through the stored issued credential. */
111
+ resumeIssuanceSubmissions(): Promise<void>;
33
112
  acceptCredential(input: AcceptCredentialInput): Promise<VtFlowRecord>;
34
113
  buildDirectIssuanceOffer(vtFlowRecordId: string): Promise<{
35
114
  credentialFormats: {
36
- jsonld: DidCommJsonLdCredentialDetailFormat;
115
+ dataIntegrity: DidCommDataIntegrityOfferCredentialFormat;
37
116
  };
38
117
  issuerParticipantId: number;
39
118
  } | null>;
119
+ /**
120
+ * Builds the unsigned VC Data Model 2.0 credential that goes into the offer. RFC 0809 derives the
121
+ * advertised data model version from its context, and the issuer secures it with a
122
+ * DataIntegrityProof once the applicant requests it.
123
+ */
40
124
  private buildCredential;
125
+ private resolveJsonSchemaCredentialId;
41
126
  /** Per the spec the algorithm comes from the schema, never from the digest value. */
42
127
  private digestAlgorithmForSchema;
43
- /** Fired after signing and before delivery, so a failure here must abort the issuance. */
44
- onCredentialIssued(vtFlowRecordId: string, signedCredential: JsonCredential): Promise<string>;
128
+ private credentialSchema;
129
+ /** Fired after signing and before delivery. A failed anchoring comes back in `issuance`, and the credential stays undelivered. */
130
+ onCredentialIssued(vtFlowRecordId: string, signedCredential: Record<string, unknown>): Promise<{
131
+ credentialDigest: string;
132
+ issuance: VtFlowIssuance;
133
+ }>;
45
134
  verifyOfferedCredential(vtFlowRecordId: string): Promise<void>;
135
+ /** [VSA-VTI-FLOW-FMT-1]. Credo already verified the proof and its assertionMethod key, for data model 2.0 only. */
136
+ private assertFlowCredentialFormat;
46
137
  onCredentialRevoked(vtFlowRecordId: string): Promise<void>;
47
138
  onCredentialCompleted(vtFlowRecordId: string): Promise<void>;
48
139
  private triggerResolver;
49
- private getOfferedCredentialJson;
50
- private requireIndexer;
140
+ /** The signed credential as the issuer attached it, which is the exact JSON its digest covers. */
141
+ private getReceivedCredentialJson;
142
+ checkEcsIssuanceExemption(context: VtFlowEcsIssuanceExemptionContext): Promise<boolean>;
143
+ checkParticipantId({ record }: VtFlowCheckParticipantIdContext): Promise<boolean | 'validated'>;
51
144
  publishCredentialAsLinkedVp(vtFlowRecordId: string): Promise<void>;
52
145
  private extractSchemaBaseId;
53
146
  rotateRequesterDidToPeer(connectionId: string): Promise<void>;