@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,21 +1,23 @@
1
- import { AnonCredsDidCommCredentialFormatService, AnonCredsModule, AnonCredsDidCommProofFormatService, LegacyIndyDidCommCredentialFormatService, LegacyIndyDidCommProofFormatService } from '@credo-ts/anoncreds';
1
+ import { AnonCredsModule } from '@credo-ts/anoncreds';
2
+ import { AnonCredsDidCommCredentialFormatService, AnonCredsDidCommProofFormatService } from '@credo-ts/anoncreds/didcomm';
2
3
  import { AskarModule, AskarModuleConfigStoreOptions } from '@credo-ts/askar';
3
4
  import { Agent, AgentDependencies, DidsModule, InitConfig, W3cCredentialsModule } from '@credo-ts/core';
4
- import { DidCommCredentialsModuleConfigOptions, DidCommCredentialV2Protocol, DidCommFeatureQueryOptions, DidCommJsonLdCredentialFormatService, DidCommModule, DidCommModuleConfigOptions, DidCommProofsModuleConfigOptions, DidCommProofV2Protocol } from '@credo-ts/didcomm';
5
+ import { DidCommCredentialsModuleConfigOptions, DidCommCredentialV2Protocol, DidCommDataIntegrityCredentialFormatService, DidCommFeatureQueryOptions, DidCommModule, DidCommModuleConfigOptions, DidCommProofsModuleConfigOptions, DidCommProofV2Protocol } from '@credo-ts/didcomm';
5
6
  import { VtFlowModule } from '@verana-labs/credo-ts-didcomm-vt-flow';
7
+ import { AnonCredsTrustService } from '../blockchain/AnonCredsTrustService';
6
8
  import { AuthorizationService } from '../blockchain/AuthorizationService';
7
9
  import { VeranaChainService } from '../blockchain/VeranaChainService';
10
+ import { VeranaIndexerService } from '../blockchain/VeranaIndexerService';
11
+ import { ParentConnectionModule } from '../connections/ParentConnectionModule';
12
+ import { EcsClaims } from '../utils/ecsClaims';
8
13
  type VsAgentDidCommModule = DidCommModule<DidCommModuleConfigOptions & {
9
14
  credentials: DidCommCredentialsModuleConfigOptions<[
10
15
  DidCommCredentialV2Protocol<[
11
- LegacyIndyDidCommCredentialFormatService,
12
16
  AnonCredsDidCommCredentialFormatService,
13
- DidCommJsonLdCredentialFormatService
17
+ DidCommDataIntegrityCredentialFormatService
14
18
  ]>
15
19
  ]>;
16
- proofs: DidCommProofsModuleConfigOptions<[
17
- DidCommProofV2Protocol<[LegacyIndyDidCommProofFormatService, AnonCredsDidCommProofFormatService]>
18
- ]>;
20
+ proofs: DidCommProofsModuleConfigOptions<[DidCommProofV2Protocol<[AnonCredsDidCommProofFormatService]>]>;
19
21
  }>;
20
22
  export type BaseAgentModules = {
21
23
  askar: AskarModule;
@@ -23,6 +25,7 @@ export type BaseAgentModules = {
23
25
  dids: DidsModule;
24
26
  w3cCredentials: W3cCredentialsModule;
25
27
  didcomm: VsAgentDidCommModule;
28
+ parentConnection: ParentConnectionModule;
26
29
  vtFlow: VtFlowModule;
27
30
  };
28
31
  interface AgentOptions<TModules extends BaseAgentModules> {
@@ -32,61 +35,54 @@ interface AgentOptions<TModules extends BaseAgentModules> {
32
35
  }
33
36
  export declare class VsAgent<TModules extends BaseAgentModules = BaseAgentModules> extends Agent<TModules> {
34
37
  did?: string;
35
- autoDiscloseUserProfile?: boolean;
36
38
  publicApiBaseUrl: string;
37
39
  adminApiServiceEndpoint?: string;
38
- displayPictureUrl?: string;
39
- label: string;
40
40
  veranaChain?: VeranaChainService;
41
+ indexer: VeranaIndexerService;
42
+ trustedEcosystemDids?: string[];
43
+ ecsClaims?: EcsClaims;
41
44
  authorizationService?: AuthorizationService;
42
45
  discoveryOptions?: DidCommFeatureQueryOptions[];
46
+ readonly anonCredsTrust: AnonCredsTrustService;
43
47
  constructor(options: AgentOptions<TModules> & {
44
48
  did?: string;
45
- autoDiscloseUserProfile?: boolean;
46
49
  publicApiBaseUrl: string;
47
50
  adminApiServiceEndpoint?: string;
48
- displayPictureUrl?: string;
49
- label: string;
50
51
  veranaChain?: VeranaChainService;
52
+ indexer: VeranaIndexerService;
53
+ trustedEcosystemDids?: string[];
54
+ ecsClaims?: EcsClaims;
51
55
  authorizationService?: AuthorizationService;
52
56
  discoveryOptions?: DidCommFeatureQueryOptions[];
57
+ anonCredsTrust?: AnonCredsTrustService;
58
+ /** DEMO ONLY: see AnonCredsTrustServiceOptions.skipOwnAuthorization. */
59
+ skipOwnAuthorization?: boolean;
53
60
  });
54
61
  private get hasUserProfile();
62
+ /**
63
+ * [VSA-VT-LVP-5]: a `TriggerResolver` that the coalescing window still holds is the only signal of
64
+ * the publication change behind it, so the agent sends it before it stops.
65
+ */
66
+ shutdown(): Promise<void>;
55
67
  initialize(): Promise<void>;
68
+ private ensureSharedPublicDidInvitation;
56
69
  private findCreatedDid;
57
70
  private findEd25519VerificationMethodId;
58
71
  private getDidCommServices;
59
- private persistDidDocumentKey;
60
- /**
61
- * Fix a webvh update-key mapping whose `didDocumentRelativeKeyId` was stored as the full multibase
62
- * (e.g. `#z6Mk...`) while the DID document verification method uses a short fragment (e.g. `#BVhGnL79`).
63
- * `getKmsKeyIdForVerifiacationMethod` matches by suffix (`vm.id.endsWith(relativeKeyId)`), so the
64
- * mismatch leaves the update key unresolvable and every webvh update fails with
65
- * "The key ID must be present before the log can be edited." The private key is present in the KMS;
66
- * only the mapping label is wrong. Idempotent: a mapping that already correlates to a VM is left alone.
67
- */
68
- private repairWebvhUpdateKeyMapping;
72
+ private replaceDerivedKeyAgreementKey;
73
+ private createKeyAgreementKey;
74
+ private addDidKey;
69
75
  private createAndAddDidCommKeysAndServices;
70
- private createAndAddLinkedVpServices;
71
- /**
72
- * Basic implicit webvh services, for the moment pointing to the service VP
73
- * and public base URL
74
- */
75
- private createAndAddWebVhImplicitServices;
76
- private createAndAddAnonCredsServices;
76
+ private addLinkedVpContext;
77
77
  private applyAdminApiService;
78
78
  }
79
79
  export interface VsAgentOptions {
80
80
  config: InitConfig;
81
81
  did?: string;
82
- autoDiscloseUserProfile?: boolean;
83
82
  dependencies: AgentDependencies;
84
83
  publicApiBaseUrl: string;
85
84
  adminApiServiceEndpoint?: string;
86
- masterListCscaLocation?: string;
87
85
  endpoints: string[];
88
86
  walletConfig: AskarModuleConfigStoreOptions;
89
- displayPictureUrl?: string;
90
- label: string;
91
87
  }
92
88
  export {};