@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.
- package/README.md +0 -2
- package/build/adminApi/AdminApiError.d.ts +28 -0
- package/build/adminApi/AdminApiError.js +60 -0
- package/build/adminApi/AdminApiError.js.map +1 -0
- package/build/adminApi/didcommModules.d.ts +2 -0
- package/build/adminApi/didcommModules.js +8 -0
- package/build/adminApi/didcommModules.js.map +1 -0
- package/build/adminApi/index.d.ts +4 -0
- package/build/adminApi/index.js +21 -0
- package/build/adminApi/index.js.map +1 -0
- package/build/adminApi/moduleEndpoint.d.ts +8 -0
- package/build/adminApi/moduleEndpoint.js +28 -0
- package/build/adminApi/moduleEndpoint.js.map +1 -0
- package/build/adminApi/pagination/PageDto.d.ts +7 -0
- package/build/adminApi/pagination/PageDto.js +50 -0
- package/build/adminApi/pagination/PageDto.js.map +1 -0
- package/build/adminApi/pagination/PaginationQueryDto.d.ts +11 -0
- package/build/adminApi/pagination/PaginationQueryDto.js +46 -0
- package/build/adminApi/pagination/PaginationQueryDto.js.map +1 -0
- package/build/adminApi/pagination/cursor.d.ts +28 -0
- package/build/adminApi/pagination/cursor.js +64 -0
- package/build/adminApi/pagination/cursor.js.map +1 -0
- package/build/adminApi/pagination/index.d.ts +4 -0
- package/build/adminApi/pagination/index.js +21 -0
- package/build/adminApi/pagination/index.js.map +1 -0
- package/build/adminApi/pagination/paginate.d.ts +27 -0
- package/build/adminApi/pagination/paginate.js +77 -0
- package/build/adminApi/pagination/paginate.js.map +1 -0
- package/build/agent/VsAgent.d.ts +17 -34
- package/build/agent/VsAgent.js +75 -205
- package/build/agent/VsAgent.js.map +1 -1
- package/build/agent/createVsAgent.d.ts +5 -6
- package/build/agent/createVsAgent.js +3 -5
- package/build/agent/createVsAgent.js.map +1 -1
- package/build/blockchain/AnonCredsTrustService.d.ts +62 -0
- package/build/blockchain/AnonCredsTrustService.js +256 -0
- package/build/blockchain/AnonCredsTrustService.js.map +1 -0
- package/build/blockchain/AuthorizationService.d.ts +5 -3
- package/build/blockchain/AuthorizationService.js +17 -29
- package/build/blockchain/AuthorizationService.js.map +1 -1
- package/build/blockchain/IndexerWebSocketService.d.ts +7 -1
- package/build/blockchain/IndexerWebSocketService.js +68 -36
- package/build/blockchain/IndexerWebSocketService.js.map +1 -1
- package/build/blockchain/VeranaChainService.d.ts +26 -19
- package/build/blockchain/VeranaChainService.js +136 -152
- package/build/blockchain/VeranaChainService.js.map +1 -1
- package/build/blockchain/VeranaIndexerService.d.ts +14 -1
- package/build/blockchain/VeranaIndexerService.js +122 -8
- package/build/blockchain/VeranaIndexerService.js.map +1 -1
- package/build/blockchain/handlers/authorizationHandlers.js +2 -2
- package/build/blockchain/handlers/authorizationHandlers.js.map +1 -1
- package/build/blockchain/handlers/defaultHandlers.js +6 -1
- package/build/blockchain/handlers/defaultHandlers.js.map +1 -1
- package/build/blockchain/handlers/index.d.ts +1 -0
- package/build/blockchain/handlers/index.js +1 -0
- package/build/blockchain/handlers/index.js.map +1 -1
- package/build/blockchain/handlers/selfIssuanceHandlers.d.ts +13 -0
- package/build/blockchain/handlers/selfIssuanceHandlers.js +76 -0
- package/build/blockchain/handlers/selfIssuanceHandlers.js.map +1 -0
- package/build/blockchain/handlers/stateMutations.d.ts +26 -3
- package/build/blockchain/handlers/stateMutations.js +317 -41
- package/build/blockchain/handlers/stateMutations.js.map +1 -1
- package/build/blockchain/index.d.ts +2 -0
- package/build/blockchain/index.js +2 -0
- package/build/blockchain/index.js.map +1 -1
- package/build/blockchain/indexerMappers.d.ts +3 -0
- package/build/blockchain/indexerMappers.js +53 -0
- package/build/blockchain/indexerMappers.js.map +1 -0
- package/build/blockchain/types.d.ts +13 -69
- package/build/blockchain/types.js.map +1 -1
- package/build/bootstrap/EcsBootstrapService.d.ts +13 -3
- package/build/bootstrap/EcsBootstrapService.js +168 -79
- package/build/bootstrap/EcsBootstrapService.js.map +1 -1
- package/build/connections/ParentConnectionModule.d.ts +20 -0
- package/build/connections/ParentConnectionModule.js +56 -0
- package/build/connections/ParentConnectionModule.js.map +1 -0
- package/build/credentials/FullTailsFileService.d.ts +0 -1
- package/build/credentials/FullTailsFileService.js +0 -49
- package/build/credentials/FullTailsFileService.js.map +1 -1
- package/build/did/CachedDocumentLoader.d.ts +3 -0
- package/build/did/CachedDocumentLoader.js +7 -1
- package/build/did/CachedDocumentLoader.js.map +1 -1
- package/build/did/CachedWebDidResolver.d.ts +0 -4
- package/build/did/CachedWebDidResolver.js +1 -5
- package/build/did/CachedWebDidResolver.js.map +1 -1
- package/build/did/artifactServices.d.ts +12 -0
- package/build/did/artifactServices.js +48 -0
- package/build/did/artifactServices.js.map +1 -0
- package/build/did/legacyDidWeb.d.ts +6 -4
- package/build/did/legacyDidWeb.js +17 -14
- package/build/did/legacyDidWeb.js.map +1 -1
- package/build/did/publicDid.d.ts +4 -0
- package/build/did/publicDid.js +19 -0
- package/build/did/publicDid.js.map +1 -0
- package/build/events/BaseMessageEvents.js +139 -5
- package/build/events/BaseMessageEvents.js.map +1 -1
- package/build/events/ConnectionEvents.js +154 -86
- package/build/events/ConnectionEvents.js.map +1 -1
- package/build/events/VsAgentEvents.d.ts +11 -9
- package/build/events/VsAgentEvents.js +8 -1
- package/build/events/VsAgentEvents.js.map +1 -1
- package/build/events/VtFlowEvents.d.ts +1 -1
- package/build/events/VtFlowEvents.js +29 -17
- package/build/events/VtFlowEvents.js.map +1 -1
- package/build/index.d.ts +7 -1
- package/build/index.js +15 -2
- package/build/index.js.map +1 -1
- package/build/plugins/setupBaseDidComm.js +9 -12
- package/build/plugins/setupBaseDidComm.js.map +1 -1
- package/build/transports/VsAgentWsInboundTransport.d.ts +1 -1
- package/build/transports/VsAgentWsInboundTransport.js +20 -14
- package/build/transports/VsAgentWsInboundTransport.js.map +1 -1
- package/build/types.d.ts +14 -13
- package/build/types.js +1 -2
- package/build/types.js.map +1 -1
- package/build/utils/agent.d.ts +29 -4
- package/build/utils/agent.js +91 -22
- package/build/utils/agent.js.map +1 -1
- package/build/utils/boundedFetch.d.ts +13 -0
- package/build/utils/boundedFetch.js +47 -0
- package/build/utils/boundedFetch.js.map +1 -0
- package/build/utils/didReadiness.d.ts +9 -0
- package/build/utils/didReadiness.js +42 -0
- package/build/utils/didReadiness.js.map +1 -0
- package/build/utils/ecsClaims.d.ts +46 -0
- package/build/utils/ecsClaims.js +115 -0
- package/build/utils/ecsClaims.js.map +1 -0
- package/build/utils/ecsService.d.ts +8 -0
- package/build/utils/ecsService.js +23 -0
- package/build/utils/ecsService.js.map +1 -0
- package/build/utils/index.d.ts +6 -0
- package/build/utils/index.js +6 -0
- package/build/utils/index.js.map +1 -1
- package/build/utils/selfIssuedEcsCredential.d.ts +8 -0
- package/build/utils/selfIssuedEcsCredential.js +158 -0
- package/build/utils/selfIssuedEcsCredential.js.map +1 -0
- package/build/utils/setupSelfTr.d.ts +35 -74
- package/build/utils/setupSelfTr.js +93 -312
- package/build/utils/setupSelfTr.js.map +1 -1
- package/build/utils/trustCredentialStore.d.ts +78 -9
- package/build/utils/trustCredentialStore.js +319 -126
- package/build/utils/trustCredentialStore.js.map +1 -1
- package/build/utils/typeMetadata.d.ts +43 -0
- package/build/utils/typeMetadata.js +77 -0
- package/build/utils/typeMetadata.js.map +1 -0
- package/build/utils/util.d.ts +19 -0
- package/build/utils/util.js +24 -0
- package/build/utils/util.js.map +1 -1
- package/build/utils/vcdm2.d.ts +34 -0
- package/build/utils/vcdm2.js +60 -0
- package/build/utils/vcdm2.js.map +1 -0
- package/build/utils/vtjscResolver.d.ts +23 -0
- package/build/utils/vtjscResolver.js +54 -0
- package/build/utils/vtjscResolver.js.map +1 -0
- package/build/vtFlow/VtFlowOrchestrator.d.ts +107 -14
- package/build/vtFlow/VtFlowOrchestrator.js +734 -109
- package/build/vtFlow/VtFlowOrchestrator.js.map +1 -1
- package/build/vtFlow/assertVerifiableService.d.ts +1 -0
- package/build/vtFlow/assertVerifiableService.js +45 -5
- package/build/vtFlow/assertVerifiableService.js.map +1 -1
- package/build/vtFlow/ecsIssuanceExemption.d.ts +12 -0
- package/build/vtFlow/ecsIssuanceExemption.js +84 -0
- package/build/vtFlow/ecsIssuanceExemption.js.map +1 -0
- package/build/vtFlow/index.d.ts +1 -0
- package/build/vtFlow/index.js +1 -0
- package/build/vtFlow/index.js.map +1 -1
- package/package.json +18 -12
- package/build/did/migrateWebVhLog.d.ts +0 -34
- package/build/did/migrateWebVhLog.js +0 -230
- package/build/did/migrateWebVhLog.js.map +0 -1
- package/build/did/migrateWebVhVersionTime.d.ts +0 -9
- package/build/did/migrateWebVhVersionTime.js +0 -191
- 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 {
|
|
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:
|
|
6
|
-
export declare function deleteMetadataEntry(agent: VsAgent, id: string, didRecord: DidRecord, key: '_vt/vtc' | '_vt/jsc'
|
|
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:
|
|
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<
|
|
16
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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[]>;
|