@verana-labs/vs-agent-sdk 2.0.0-dev.9 → 2.0.0-dev.91
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 +67 -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 +25 -34
- package/build/agent/VsAgent.js +86 -205
- package/build/agent/VsAgent.js.map +1 -1
- package/build/agent/createVsAgent.d.ts +9 -6
- package/build/agent/createVsAgent.js +5 -5
- package/build/agent/createVsAgent.js.map +1 -1
- package/build/blockchain/AnonCredsTrustService.d.ts +84 -0
- package/build/blockchain/AnonCredsTrustService.js +276 -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 -2
- package/build/blockchain/IndexerWebSocketService.js +67 -36
- package/build/blockchain/IndexerWebSocketService.js.map +1 -1
- package/build/blockchain/VeranaChainService.d.ts +38 -27
- package/build/blockchain/VeranaChainService.js +169 -177
- 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/feePreflight.d.ts +32 -0
- package/build/blockchain/feePreflight.js +89 -0
- package/build/blockchain/feePreflight.js.map +1 -0
- package/build/blockchain/handlers/IndexerHandlerRegistry.d.ts +0 -1
- package/build/blockchain/handlers/IndexerHandlerRegistry.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 +7 -2
- 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 +27 -4
- package/build/blockchain/handlers/stateMutations.js +325 -44
- package/build/blockchain/handlers/stateMutations.js.map +1 -1
- package/build/blockchain/index.d.ts +4 -0
- package/build/blockchain/index.js +4 -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/triggerResolver.d.ts +26 -0
- package/build/blockchain/triggerResolver.js +120 -0
- package/build/blockchain/triggerResolver.js.map +1 -0
- package/build/blockchain/types.d.ts +13 -70
- package/build/blockchain/types.js.map +1 -1
- package/build/bootstrap/EcsBootstrapService.d.ts +13 -4
- package/build/bootstrap/EcsBootstrapService.js +170 -124
- 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 +151 -87
- 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 +34 -4
- package/build/utils/agent.js +103 -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.js +5 -2
- package/build/utils/didReadiness.js.map +1 -1
- 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 +7 -0
- package/build/utils/index.js +7 -0
- package/build/utils/index.js.map +1 -1
- package/build/utils/publishedDidRecord.d.ts +15 -0
- package/build/utils/publishedDidRecord.js +83 -0
- package/build/utils/publishedDidRecord.js.map +1 -0
- package/build/utils/selfIssuedEcsCredential.d.ts +8 -0
- package/build/utils/selfIssuedEcsCredential.js +153 -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 +324 -136
- package/build/utils/trustCredentialStore.js.map +1 -1
- package/build/utils/typeMetadata.d.ts +44 -0
- package/build/utils/typeMetadata.js +89 -0
- package/build/utils/typeMetadata.js.map +1 -0
- package/build/utils/util.d.ts +20 -0
- package/build/utils/util.js +29 -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 +53 -0
- package/build/utils/vtjscResolver.js.map +1 -0
- package/build/vtFlow/VtFlowOrchestrator.d.ts +107 -15
- package/build/vtFlow/VtFlowOrchestrator.js +678 -116
- package/build/vtFlow/VtFlowOrchestrator.js.map +1 -1
- package/build/vtFlow/assertVerifiableService.d.ts +31 -2
- package/build/vtFlow/assertVerifiableService.js +68 -10
- 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 +24 -18
- 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,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
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 {
|
|
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
|
|
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,97 @@ 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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
44
|
-
|
|
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
|
-
|
|
49
|
-
private
|
|
50
|
-
|
|
139
|
+
/** The signed credential as the issuer attached it, which is the exact JSON its digest covers. */
|
|
140
|
+
private getReceivedCredentialJson;
|
|
141
|
+
checkEcsIssuanceExemption(context: VtFlowEcsIssuanceExemptionContext): Promise<boolean>;
|
|
142
|
+
checkParticipantId({ record }: VtFlowCheckParticipantIdContext): Promise<boolean | 'validated'>;
|
|
51
143
|
publishCredentialAsLinkedVp(vtFlowRecordId: string): Promise<void>;
|
|
52
144
|
private extractSchemaBaseId;
|
|
53
145
|
rotateRequesterDidToPeer(connectionId: string): Promise<void>;
|