@verana-labs/vs-agent-sdk 2.0.0-dev.11 → 2.0.0-dev.111

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 (198) 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 +30 -34
  30. package/build/agent/VsAgent.js +176 -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 +7 -2
  42. package/build/blockchain/IndexerWebSocketService.js +67 -36
  43. package/build/blockchain/IndexerWebSocketService.js.map +1 -1
  44. package/build/blockchain/VeranaChainService.d.ts +38 -27
  45. package/build/blockchain/VeranaChainService.js +169 -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 +32 -0
  51. package/build/blockchain/feePreflight.js +89 -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 +27 -4
  66. package/build/blockchain/handlers/stateMutations.js +331 -45
  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 +53 -0
  73. package/build/blockchain/indexerMappers.js.map +1 -0
  74. package/build/blockchain/triggerResolver.d.ts +26 -0
  75. package/build/blockchain/triggerResolver.js +110 -0
  76. package/build/blockchain/triggerResolver.js.map +1 -0
  77. package/build/blockchain/types.d.ts +13 -70
  78. package/build/blockchain/types.js.map +1 -1
  79. package/build/bootstrap/EcsBootstrapService.d.ts +13 -4
  80. package/build/bootstrap/EcsBootstrapService.js +170 -124
  81. package/build/bootstrap/EcsBootstrapService.js.map +1 -1
  82. package/build/connections/InvitationRecord.d.ts +50 -0
  83. package/build/connections/InvitationRecord.js +60 -0
  84. package/build/connections/InvitationRecord.js.map +1 -0
  85. package/build/connections/ParentConnectionModule.d.ts +22 -0
  86. package/build/connections/ParentConnectionModule.js +91 -0
  87. package/build/connections/ParentConnectionModule.js.map +1 -0
  88. package/build/credentials/FullTailsFileService.d.ts +0 -1
  89. package/build/credentials/FullTailsFileService.js +0 -49
  90. package/build/credentials/FullTailsFileService.js.map +1 -1
  91. package/build/did/CachedDocumentLoader.d.ts +3 -0
  92. package/build/did/CachedDocumentLoader.js +9 -3
  93. package/build/did/CachedDocumentLoader.js.map +1 -1
  94. package/build/did/CachedWebDidResolver.d.ts +0 -4
  95. package/build/did/CachedWebDidResolver.js +1 -5
  96. package/build/did/CachedWebDidResolver.js.map +1 -1
  97. package/build/did/artifactServices.d.ts +12 -0
  98. package/build/did/artifactServices.js +48 -0
  99. package/build/did/artifactServices.js.map +1 -0
  100. package/build/did/legacyDidWeb.d.ts +6 -4
  101. package/build/did/legacyDidWeb.js +17 -14
  102. package/build/did/legacyDidWeb.js.map +1 -1
  103. package/build/did/publicDid.d.ts +4 -0
  104. package/build/did/publicDid.js +19 -0
  105. package/build/did/publicDid.js.map +1 -0
  106. package/build/did/reusedDidDocument.d.ts +37 -0
  107. package/build/did/reusedDidDocument.js +93 -0
  108. package/build/did/reusedDidDocument.js.map +1 -0
  109. package/build/events/BaseMessageEvents.d.ts +24 -0
  110. package/build/events/BaseMessageEvents.js +368 -14
  111. package/build/events/BaseMessageEvents.js.map +1 -1
  112. package/build/events/ConnectionEvents.js +149 -87
  113. package/build/events/ConnectionEvents.js.map +1 -1
  114. package/build/events/InvitationEvents.d.ts +6 -0
  115. package/build/events/InvitationEvents.js +57 -0
  116. package/build/events/InvitationEvents.js.map +1 -0
  117. package/build/events/VsAgentEvents.d.ts +40 -9
  118. package/build/events/VsAgentEvents.js +10 -1
  119. package/build/events/VsAgentEvents.js.map +1 -1
  120. package/build/events/VtFlowEvents.d.ts +1 -1
  121. package/build/events/VtFlowEvents.js +29 -17
  122. package/build/events/VtFlowEvents.js.map +1 -1
  123. package/build/events/index.d.ts +1 -0
  124. package/build/events/index.js +1 -0
  125. package/build/events/index.js.map +1 -1
  126. package/build/index.d.ts +9 -1
  127. package/build/index.js +20 -2
  128. package/build/index.js.map +1 -1
  129. package/build/plugins/setupBaseDidComm.js +20 -21
  130. package/build/plugins/setupBaseDidComm.js.map +1 -1
  131. package/build/transports/HttpInboundTransport.js +6 -1
  132. package/build/transports/HttpInboundTransport.js.map +1 -1
  133. package/build/transports/VsAgentWsInboundTransport.d.ts +1 -1
  134. package/build/transports/VsAgentWsInboundTransport.js +20 -14
  135. package/build/transports/VsAgentWsInboundTransport.js.map +1 -1
  136. package/build/types.d.ts +14 -13
  137. package/build/types.js +1 -2
  138. package/build/types.js.map +1 -1
  139. package/build/utils/agent.d.ts +42 -4
  140. package/build/utils/agent.js +126 -22
  141. package/build/utils/agent.js.map +1 -1
  142. package/build/utils/boundedFetch.d.ts +13 -0
  143. package/build/utils/boundedFetch.js +47 -0
  144. package/build/utils/boundedFetch.js.map +1 -0
  145. package/build/utils/didReadiness.js +5 -2
  146. package/build/utils/didReadiness.js.map +1 -1
  147. package/build/utils/ecsClaims.d.ts +46 -0
  148. package/build/utils/ecsClaims.js +115 -0
  149. package/build/utils/ecsClaims.js.map +1 -0
  150. package/build/utils/ecsService.d.ts +8 -0
  151. package/build/utils/ecsService.js +23 -0
  152. package/build/utils/ecsService.js.map +1 -0
  153. package/build/utils/index.d.ts +7 -0
  154. package/build/utils/index.js +7 -0
  155. package/build/utils/index.js.map +1 -1
  156. package/build/utils/publishedDidRecord.d.ts +15 -0
  157. package/build/utils/publishedDidRecord.js +83 -0
  158. package/build/utils/publishedDidRecord.js.map +1 -0
  159. package/build/utils/selfIssuedEcsCredential.d.ts +8 -0
  160. package/build/utils/selfIssuedEcsCredential.js +158 -0
  161. package/build/utils/selfIssuedEcsCredential.js.map +1 -0
  162. package/build/utils/setupSelfTr.d.ts +34 -74
  163. package/build/utils/setupSelfTr.js +79 -321
  164. package/build/utils/setupSelfTr.js.map +1 -1
  165. package/build/utils/trustCredentialStore.d.ts +87 -9
  166. package/build/utils/trustCredentialStore.js +343 -137
  167. package/build/utils/trustCredentialStore.js.map +1 -1
  168. package/build/utils/typeMetadata.d.ts +44 -0
  169. package/build/utils/typeMetadata.js +89 -0
  170. package/build/utils/typeMetadata.js.map +1 -0
  171. package/build/utils/util.d.ts +20 -0
  172. package/build/utils/util.js +29 -0
  173. package/build/utils/util.js.map +1 -1
  174. package/build/utils/vcdm2.d.ts +34 -0
  175. package/build/utils/vcdm2.js +60 -0
  176. package/build/utils/vcdm2.js.map +1 -0
  177. package/build/utils/vtjscResolver.d.ts +23 -0
  178. package/build/utils/vtjscResolver.js +53 -0
  179. package/build/utils/vtjscResolver.js.map +1 -0
  180. package/build/vtFlow/VtFlowOrchestrator.d.ts +108 -15
  181. package/build/vtFlow/VtFlowOrchestrator.js +692 -118
  182. package/build/vtFlow/VtFlowOrchestrator.js.map +1 -1
  183. package/build/vtFlow/assertVerifiableService.d.ts +31 -2
  184. package/build/vtFlow/assertVerifiableService.js +68 -10
  185. package/build/vtFlow/assertVerifiableService.js.map +1 -1
  186. package/build/vtFlow/ecsIssuanceExemption.d.ts +12 -0
  187. package/build/vtFlow/ecsIssuanceExemption.js +84 -0
  188. package/build/vtFlow/ecsIssuanceExemption.js.map +1 -0
  189. package/build/vtFlow/index.d.ts +1 -0
  190. package/build/vtFlow/index.js +1 -0
  191. package/build/vtFlow/index.js.map +1 -1
  192. package/package.json +27 -19
  193. package/build/did/migrateWebVhLog.d.ts +0 -34
  194. package/build/did/migrateWebVhLog.js +0 -230
  195. package/build/did/migrateWebVhLog.js.map +0 -1
  196. package/build/did/migrateWebVhVersionTime.d.ts +0 -9
  197. package/build/did/migrateWebVhVersionTime.js +0 -191
  198. package/build/did/migrateWebVhVersionTime.js.map +0 -1
@@ -1,22 +1,100 @@
1
- import { DidRecord, W3cJsonLdVerifiableCredential, W3cJsonLdVerifiablePresentation } from '@credo-ts/core';
1
+ import { DidRecord, W3cJsonLdVerifiableCredential, W3cJsonLdVerifiablePresentation, type W3cV2DataIntegritySecuredCredential, W3cV2DataIntegrityVerifiableCredential, W3cV2DataIntegrityVerifiablePresentation } from '@credo-ts/core';
2
2
  import { VsAgent } from '../agent/VsAgent';
3
- import { SelfTrDefaults } from './setupSelfTr';
3
+ import { EcsClaims } from './ecsClaims';
4
+ /**
5
+ * A trust credential the agent publishes from its DID Document: a VC Data Model 2.0 credential
6
+ * secured with a DataIntegrityProof, which is what the agent issues itself and receives over the
7
+ * RFC 0809 credential format, or a data model 1.1 credential carrying a linked data proof that an
8
+ * older issuer handed over.
9
+ */
10
+ export type TrustCredential = W3cJsonLdVerifiableCredential | W3cV2DataIntegrityVerifiableCredential;
11
+ export type TrustPresentation = W3cJsonLdVerifiablePresentation | W3cV2DataIntegrityVerifiablePresentation;
12
+ /**
13
+ * Wraps a VC Data Model 2.0 credential in a data model 2.0 presentation secured with a
14
+ * DataIntegrityProof under the cryptosuite the agent is configured with, the counterpart of the
15
+ * linked data proof a data model 1.1 linked VP carries. The presentation is published from the DID
16
+ * Document rather than presented to a verifier, so there is no challenge to bind; its proof purpose
17
+ * is `authentication`, as Data Integrity defines for presentations.
18
+ */
19
+ export declare function signLinkedDataIntegrityPresentation(agent: Pick<VsAgent, 'w3cV2Credentials' | 'context'>, options: {
20
+ id: string;
21
+ holder: string;
22
+ credential: W3cV2DataIntegrityVerifiableCredential;
23
+ verificationMethodId: string;
24
+ }): Promise<W3cV2DataIntegrityVerifiablePresentation>;
4
25
  export declare function findMetadataEntry(didRecord: DidRecord, key: '_vt/vtc' | '_vt/jsc', id?: string, jsonSchemaRef?: string): any;
5
- export declare function saveMetadataEntry(agent: VsAgent, didRecord: DidRecord, credential: W3cJsonLdVerifiableCredential, verifiablePresentation: W3cJsonLdVerifiablePresentation, didDocumentServiceId: string, key: '_vt/vtc' | '_vt/jsc', publicApiBaseUrl: string): Promise<void>;
6
- export declare function deleteMetadataEntry(agent: VsAgent, id: string, didRecord: DidRecord, key: '_vt/vtc' | '_vt/jsc', publicApiBaseUrl: string): Promise<{
26
+ export declare function saveMetadataEntry(agent: VsAgent, didRecord: DidRecord, credential: TrustCredential, verifiablePresentation: TrustPresentation, didDocumentServiceId: string, key: '_vt/vtc' | '_vt/jsc'): Promise<void>;
27
+ export declare function deleteMetadataEntry(agent: VsAgent, id: string, didRecord: DidRecord, key: '_vt/vtc' | '_vt/jsc'): Promise<{
7
28
  schemaId: any;
8
29
  } | null>;
9
- export declare function createVtc(agent: VsAgent, publicApiBaseUrl: string, id: string, credential: W3cJsonLdVerifiableCredential): Promise<W3cJsonLdVerifiablePresentation>;
30
+ export declare function createVtc(agent: VsAgent, publicApiBaseUrl: string, id: string, credential: TrustCredential): Promise<TrustPresentation>;
10
31
  export interface CreateJscOptions {
11
32
  schemaBaseId: string;
12
33
  jsonSchemaRef: string;
13
34
  precomputedDigestSRI?: string;
14
35
  }
15
- export declare function createJsc(agent: VsAgent, publicApiBaseUrl: string, ecsSchemas: Record<string, string>, options: CreateJscOptions): Promise<import("@credo-ts/core").W3cJsonCredential>;
16
- export declare function removeTrustCredential(agent: VsAgent, publicApiBaseUrl: string, schemaId: string, key: '_vt/jsc' | '_vt/vtc'): Promise<{
36
+ export declare function createJsc(agent: VsAgent, publicApiBaseUrl: string, ecsSchemas: Record<string, string>, options: CreateJscOptions): Promise<W3cV2DataIntegritySecuredCredential & {
37
+ id: string;
38
+ }>;
39
+ export declare function removeTrustCredential(agent: VsAgent, schemaId: string, key: '_vt/jsc' | '_vt/vtc'): Promise<{
17
40
  schemaId: any;
18
41
  } | null>;
19
- export declare function removeStoredTrustCredential(agent: VsAgent, publicApiBaseUrl: string, credentialExchangeRecordId: string): Promise<string | undefined>;
42
+ /**
43
+ * Reads the id of the credential from the RFC 0809 format data of an exchange.
44
+ * Returns `undefined` when the exchange is deleted. Returns `undefined` also when the exchange
45
+ * used a different format.
46
+ */
47
+ export declare function findExchangeCredentialId(agent: VsAgent, credentialExchangeRecordId: string): Promise<string | undefined>;
48
+ /**
49
+ * Removes the linked VP and the stored credential of the applicant, as
50
+ * [VSA-VTI-FLOW-OP-REVOKE] requires. The caller supplies the credential id from the flow record.
51
+ * An older record has no credential id. Then this function reads the id from the RFC 0809 format
52
+ * data of the exchange. Returns the credential id. Returns `undefined` when no id is available,
53
+ * and removes nothing.
54
+ */
55
+ export declare function removeStoredTrustCredential(agent: VsAgent, options: {
56
+ credentialId?: string;
57
+ credentialExchangeRecordId?: string;
58
+ }): Promise<string | undefined>;
20
59
  export declare function migrateVtjscServiceIds(agent: VsAgent): Promise<void>;
60
+ /**
61
+ * Takes the linked VPs of the given `_vt/jsc` entries out of the DID Document, publishing it once.
62
+ *
63
+ * The entries stay: `SelfTrController` serves them, and issued credentials name that URL in
64
+ * `credentialSchema.id`. Dropping one would 404 it and leave those credentials unverifiable.
65
+ */
66
+ export declare function detachVtjscPublications(agent: VsAgent, schemaRefs: readonly string[]): Promise<string[]>;
67
+ /**
68
+ * Puts a detached `_vt/jsc` entry back in the DID Document.
69
+ *
70
+ * The publication pass skips an entry whose digest still matches, so without this the agent would
71
+ * keep serving a VTJSC it never announces again.
72
+ */
73
+ export declare function reattachVtjscPublication(agent: VsAgent, schemaRef: string): Promise<boolean>;
21
74
  export declare function getTrustMetadata(didRecord: DidRecord, key: '_vt/vtc' | '_vt/jsc', schemaId?: string): any;
22
- export declare function rebindEcsCredentialSchema(agent: VsAgent, publicApiBaseUrl: string, schemaId: string, schemaKey: string, defaults: SelfTrDefaults): Promise<void>;
75
+ /**
76
+ * Stores the serialized SD-JWT VC Type Metadata of a VTJSC with its `_vt/jsc` entry, once. A
77
+ * stored document is never replaced: [VSA-PUB-VT-5] serves identical bytes while the schema exists.
78
+ * Returns false when the entry does not exist or already carries a document.
79
+ */
80
+ export declare function saveVtjscTypeMetadata(agent: VsAgent, schemaRef: string, typeMetadata: string): Promise<boolean>;
81
+ /**
82
+ * The stored Type Metadata of the `CredentialSchema` with the given on-chain id, as serialized.
83
+ * The `_vt/jsc` key of such a schema is `vpr:verana:{chainId}:cs:{id}`.
84
+ */
85
+ export declare function findVtjscTypeMetadata(didRecord: DidRecord, chainId: string, credentialSchemaId: string): string | undefined;
86
+ /**
87
+ * @param jsonSchemaCredentialId the VTJSC the Ecosystem published for this schema. Only the
88
+ * Ecosystem publishes it, so an agent that issues against another Corporation's Ecosystem must
89
+ * resolve it there — see resolveJsonSchemaCredentialId.
90
+ * @param issuerParticipantId this agent's ISSUER participant for the schema, which anchors the
91
+ * credential digest.
92
+ * @param schemaKey the ECS schema this agent issues against. Every ECS key is accepted; the caller
93
+ * reaches this function only for a schema the agent holds an active ISSUER entry on.
94
+ */
95
+ export declare function rebindEcsCredentialSchema(agent: VsAgent, publicApiBaseUrl: string, schemaId: string, schemaKey: string, ecsClaims: EcsClaims, jsonSchemaCredentialId: string, issuerParticipantId: number, onChainJsonSchema?: string, effectiveUntil?: string): Promise<void>;
96
+ /**
97
+ * Withdraws the ECS credentials anchored against `issuerParticipantId`, and the #whois entry
98
+ * when the Service credential is among them.
99
+ */
100
+ export declare function withdrawSelfIssuedEcsCredentials(agent: VsAgent, issuerParticipantId: number): Promise<string[]>;