@verana-labs/vs-agent-sdk 2.0.0-dev.8 → 2.0.0-pr.767.1

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 (173) 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 -19
  45. package/build/blockchain/VeranaChainService.js +136 -152
  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 +26 -3
  61. package/build/blockchain/handlers/stateMutations.js +317 -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 -69
  70. package/build/blockchain/types.js.map +1 -1
  71. package/build/bootstrap/EcsBootstrapService.d.ts +13 -3
  72. package/build/bootstrap/EcsBootstrapService.js +168 -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 +154 -86
  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 +14 -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/boundedFetch.d.ts +13 -0
  120. package/build/utils/boundedFetch.js +47 -0
  121. package/build/utils/boundedFetch.js.map +1 -0
  122. package/build/utils/didReadiness.d.ts +9 -0
  123. package/build/utils/didReadiness.js +42 -0
  124. package/build/utils/didReadiness.js.map +1 -0
  125. package/build/utils/ecsClaims.d.ts +46 -0
  126. package/build/utils/ecsClaims.js +115 -0
  127. package/build/utils/ecsClaims.js.map +1 -0
  128. package/build/utils/ecsService.d.ts +8 -0
  129. package/build/utils/ecsService.js +23 -0
  130. package/build/utils/ecsService.js.map +1 -0
  131. package/build/utils/index.d.ts +6 -0
  132. package/build/utils/index.js +6 -0
  133. package/build/utils/index.js.map +1 -1
  134. package/build/utils/selfIssuedEcsCredential.d.ts +8 -0
  135. package/build/utils/selfIssuedEcsCredential.js +158 -0
  136. package/build/utils/selfIssuedEcsCredential.js.map +1 -0
  137. package/build/utils/setupSelfTr.d.ts +35 -74
  138. package/build/utils/setupSelfTr.js +93 -312
  139. package/build/utils/setupSelfTr.js.map +1 -1
  140. package/build/utils/trustCredentialStore.d.ts +78 -9
  141. package/build/utils/trustCredentialStore.js +319 -126
  142. package/build/utils/trustCredentialStore.js.map +1 -1
  143. package/build/utils/typeMetadata.d.ts +43 -0
  144. package/build/utils/typeMetadata.js +77 -0
  145. package/build/utils/typeMetadata.js.map +1 -0
  146. package/build/utils/util.d.ts +19 -0
  147. package/build/utils/util.js +24 -0
  148. package/build/utils/util.js.map +1 -1
  149. package/build/utils/vcdm2.d.ts +34 -0
  150. package/build/utils/vcdm2.js +60 -0
  151. package/build/utils/vcdm2.js.map +1 -0
  152. package/build/utils/vtjscResolver.d.ts +23 -0
  153. package/build/utils/vtjscResolver.js +54 -0
  154. package/build/utils/vtjscResolver.js.map +1 -0
  155. package/build/vtFlow/VtFlowOrchestrator.d.ts +107 -14
  156. package/build/vtFlow/VtFlowOrchestrator.js +734 -109
  157. package/build/vtFlow/VtFlowOrchestrator.js.map +1 -1
  158. package/build/vtFlow/assertVerifiableService.d.ts +1 -0
  159. package/build/vtFlow/assertVerifiableService.js +45 -5
  160. package/build/vtFlow/assertVerifiableService.js.map +1 -1
  161. package/build/vtFlow/ecsIssuanceExemption.d.ts +12 -0
  162. package/build/vtFlow/ecsIssuanceExemption.js +84 -0
  163. package/build/vtFlow/ecsIssuanceExemption.js.map +1 -0
  164. package/build/vtFlow/index.d.ts +1 -0
  165. package/build/vtFlow/index.js +1 -0
  166. package/build/vtFlow/index.js.map +1 -1
  167. package/package.json +18 -12
  168. package/build/did/migrateWebVhLog.d.ts +0 -34
  169. package/build/did/migrateWebVhLog.js +0 -230
  170. package/build/did/migrateWebVhLog.js.map +0 -1
  171. package/build/did/migrateWebVhVersionTime.d.ts +0 -9
  172. package/build/did/migrateWebVhVersionTime.js +0 -191
  173. package/build/did/migrateWebVhVersionTime.js.map +0 -1
@@ -1,22 +1,91 @@
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
+ * Removes the linked VP and the stored credential an exchange delivered, as
44
+ * [VSA-VTI-FLOW-OP-REVOKE] requires of the applicant. The credential is read from the RFC 0809
45
+ * format data of the exchange; exchanges earlier versions completed over other formats are not
46
+ * migrated. Returns the credential id, or `undefined` when none is found, in which case nothing is
47
+ * removed.
48
+ */
49
+ export declare function removeStoredTrustCredential(agent: VsAgent, credentialExchangeRecordId: string): Promise<string | undefined>;
20
50
  export declare function migrateVtjscServiceIds(agent: VsAgent): Promise<void>;
51
+ /**
52
+ * Takes the linked VPs of the given `_vt/jsc` entries out of the DID Document, publishing it once.
53
+ *
54
+ * The entries stay: `SelfTrController` serves them, and issued credentials name that URL in
55
+ * `credentialSchema.id`. Dropping one would 404 it and leave those credentials unverifiable.
56
+ */
57
+ export declare function detachVtjscPublications(agent: VsAgent, schemaRefs: readonly string[]): Promise<string[]>;
58
+ /**
59
+ * Puts a detached `_vt/jsc` entry back in the DID Document.
60
+ *
61
+ * The publication pass skips an entry whose digest still matches, so without this the agent would
62
+ * keep serving a VTJSC it never announces again.
63
+ */
64
+ export declare function reattachVtjscPublication(agent: VsAgent, schemaRef: string): Promise<boolean>;
21
65
  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>;
66
+ /**
67
+ * Stores the serialized SD-JWT VC Type Metadata of a VTJSC with its `_vt/jsc` entry, once. A
68
+ * stored document is never replaced: [VSA-PUB-VT-5] serves identical bytes while the schema exists.
69
+ * Returns false when the entry does not exist or already carries a document.
70
+ */
71
+ export declare function saveVtjscTypeMetadata(agent: VsAgent, schemaRef: string, typeMetadata: string): Promise<boolean>;
72
+ /**
73
+ * The stored Type Metadata of the `CredentialSchema` with the given on-chain id, as serialized.
74
+ * The `_vt/jsc` key of such a schema is `vpr:verana:{chainId}:cs:{id}`.
75
+ */
76
+ export declare function findVtjscTypeMetadata(didRecord: DidRecord, chainId: string, credentialSchemaId: string): string | undefined;
77
+ /**
78
+ * @param jsonSchemaCredentialId the VTJSC the Ecosystem published for this schema. Only the
79
+ * Ecosystem publishes it, so an agent that issues against another Corporation's Ecosystem must
80
+ * resolve it there — see resolveJsonSchemaCredentialId.
81
+ * @param issuerParticipantId this agent's ISSUER participant for the schema, which anchors the
82
+ * credential digest.
83
+ * @param schemaKey the ECS schema this agent issues against. Every ECS key is accepted; the caller
84
+ * reaches this function only for a schema the agent holds an active ISSUER entry on.
85
+ */
86
+ export declare function rebindEcsCredentialSchema(agent: VsAgent, publicApiBaseUrl: string, schemaId: string, schemaKey: string, ecsClaims: EcsClaims, jsonSchemaCredentialId: string, issuerParticipantId: number, onChainJsonSchema?: string, effectiveUntil?: string): Promise<void>;
87
+ /**
88
+ * Withdraws the ECS credentials anchored against `issuerParticipantId`, and the #whois entry
89
+ * when the Service credential is among them.
90
+ */
91
+ export declare function withdrawSelfIssuedEcsCredentials(agent: VsAgent, issuerParticipantId: number): Promise<string[]>;