@verana-labs/vs-agent-sdk 1.12.0-dev.2 → 1.12.0-dev.3

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 (46) hide show
  1. package/README.md +7 -26
  2. package/build/agent/VsAgent.d.ts +2 -0
  3. package/build/agent/VsAgent.js.map +1 -1
  4. package/build/blockchain/IndexerWebSocketService.d.ts +0 -4
  5. package/build/blockchain/IndexerWebSocketService.js +30 -30
  6. package/build/blockchain/IndexerWebSocketService.js.map +1 -1
  7. package/build/blockchain/VeranaChainService.d.ts +11 -17
  8. package/build/blockchain/VeranaChainService.js +101 -65
  9. package/build/blockchain/VeranaChainService.js.map +1 -1
  10. package/build/blockchain/VeranaHelpers.js +2 -2
  11. package/build/blockchain/VeranaHelpers.js.map +1 -1
  12. package/build/blockchain/VeranaIndexerService.d.ts +3 -4
  13. package/build/blockchain/VeranaIndexerService.js +8 -19
  14. package/build/blockchain/VeranaIndexerService.js.map +1 -1
  15. package/build/blockchain/handlers/IndexerHandlerRegistry.d.ts +1 -0
  16. package/build/blockchain/handlers/IndexerHandlerRegistry.js.map +1 -1
  17. package/build/blockchain/handlers/defaultHandlers.js +37 -32
  18. package/build/blockchain/handlers/defaultHandlers.js.map +1 -1
  19. package/build/blockchain/handlers/stateMutations.d.ts +12 -4
  20. package/build/blockchain/handlers/stateMutations.js +103 -28
  21. package/build/blockchain/handlers/stateMutations.js.map +1 -1
  22. package/build/blockchain/types.d.ts +188 -49
  23. package/build/blockchain/types.js +8 -1
  24. package/build/blockchain/types.js.map +1 -1
  25. package/build/credentials/FullTailsFileService.d.ts +1 -1
  26. package/build/credentials/FullTailsFileService.js +6 -10
  27. package/build/credentials/FullTailsFileService.js.map +1 -1
  28. package/build/index.d.ts +2 -3
  29. package/build/index.js +3 -3
  30. package/build/index.js.map +1 -1
  31. package/build/plugins/setupBaseDidComm.d.ts +3 -1
  32. package/build/plugins/setupBaseDidComm.js +3 -1
  33. package/build/plugins/setupBaseDidComm.js.map +1 -1
  34. package/build/types.d.ts +1 -0
  35. package/build/types.js +2 -1
  36. package/build/types.js.map +1 -1
  37. package/build/vtFlow/VtFlowOrchestrator.d.ts +37 -0
  38. package/build/vtFlow/VtFlowOrchestrator.js +244 -0
  39. package/build/vtFlow/VtFlowOrchestrator.js.map +1 -0
  40. package/build/vtFlow/credentialDigest.d.ts +3 -0
  41. package/build/vtFlow/credentialDigest.js +23 -0
  42. package/build/vtFlow/credentialDigest.js.map +1 -0
  43. package/build/vtFlow/index.d.ts +1 -0
  44. package/build/vtFlow/index.js +18 -0
  45. package/build/vtFlow/index.js.map +1 -0
  46. package/package.json +7 -4
@@ -1,4 +1,22 @@
1
1
  import { BaseLogger } from '@credo-ts/core';
2
+ export declare enum ValidationState {
3
+ UNSPECIFIED = 0,
4
+ PENDING = 1,
5
+ VALIDATED = 2,
6
+ TERMINATED = 3
7
+ }
8
+ export interface Participant {
9
+ id: number;
10
+ schemaId: number;
11
+ role: number;
12
+ did: string;
13
+ corporation: string;
14
+ validatorParticipantId: number;
15
+ opState?: ValidationState;
16
+ opSummaryDigest: string;
17
+ revoked: Date | undefined;
18
+ slashed: Date | undefined;
19
+ }
2
20
  export declare const VERANA_BECH32_PREFIX = "verana";
3
21
  export declare const RECORD_ID = "verana-blockchain-sync-state";
4
22
  export type IndexerEventRecord = {
@@ -18,14 +36,33 @@ export type IndexerEventRecord = {
18
36
  related_dids: string[];
19
37
  entity_type?: string;
20
38
  entity_id?: string;
39
+ corporation_id?: number;
40
+ related_corporation_ids?: number[];
21
41
  };
22
42
  };
43
+ export interface IndexerReadyMessage {
44
+ type: 'ready';
45
+ block: number;
46
+ blockTime: string;
47
+ blockIntervalMs: number;
48
+ }
49
+ export interface IndexerBlockMessage {
50
+ type: 'block';
51
+ block: number;
52
+ blockTime: string;
53
+ events: IndexerEventRecord[];
54
+ }
55
+ export interface IndexerSubscribeMessage {
56
+ action: 'subscribe';
57
+ dids?: string[];
58
+ corporationId?: number;
59
+ }
23
60
  export interface IndexerEventsResponse {
24
61
  events: IndexerEventRecord[];
25
62
  count: number;
26
63
  after_block_height: number;
27
64
  }
28
- export type IndexerEntityType = 'TrustRegistry' | 'CredentialSchema' | 'Permission' | 'PermissionSession' | 'TrustDeposit';
65
+ export type IndexerEntityType = 'Ecosystem' | 'CredentialSchema' | 'Participant' | 'ParticipantSession' | 'TrustDeposit';
29
66
  export interface IndexerActivity {
30
67
  timestamp: string;
31
68
  block_height: string | number;
@@ -44,29 +81,29 @@ export interface VeranaIdxConfig {
44
81
  baseUrl: string;
45
82
  logger: BaseLogger;
46
83
  }
47
- export interface SyncedTrustRegistry {
84
+ export interface SyncedEcosystem {
48
85
  id: number;
49
86
  did: string;
50
- controller: string;
87
+ corporationId: number;
51
88
  archived: boolean;
52
- activeGfVersion?: number;
89
+ activeVersion?: number;
53
90
  lastModifiedBlock: number;
54
91
  }
55
92
  export interface SyncedCredentialSchema {
56
93
  id: number;
57
- trId: number;
94
+ ecosystemId: number;
58
95
  jsonSchema: string;
59
96
  issuerMode?: string;
60
97
  verifierMode?: string;
61
98
  archived: boolean;
62
99
  lastModifiedBlock: number;
63
100
  }
64
- export interface SyncedPermission {
101
+ export interface SyncedParticipant {
65
102
  id: number;
66
103
  schemaId: number;
67
104
  did: string;
68
- type: number;
69
- vpState?: string;
105
+ role: number;
106
+ opState?: string;
70
107
  effectiveUntil?: string;
71
108
  revoked: boolean;
72
109
  slashed: boolean;
@@ -74,49 +111,62 @@ export interface SyncedPermission {
74
111
  }
75
112
  export interface VeranaSyncState {
76
113
  lastBlockHeight: number;
77
- trustRegistries: Record<string, SyncedTrustRegistry>;
114
+ ecosystems: Record<string, SyncedEcosystem>;
78
115
  credentialSchemas: Record<string, SyncedCredentialSchema>;
79
- permissions: Record<string, SyncedPermission>;
116
+ participants: Record<string, SyncedParticipant>;
80
117
  }
81
- export interface TrustRegistryDto {
118
+ export interface EcosystemDto {
82
119
  id: number;
83
120
  did: string;
84
- controller: string;
121
+ corporation_id: number;
85
122
  archived: string | null;
86
- active_gf_version?: number;
123
+ active_version?: number;
87
124
  }
88
125
  export interface CredentialSchemaDto {
89
126
  id: number;
90
- tr_id: number;
127
+ ecosystem_id: number;
91
128
  json_schema: string;
92
- issuer_perm_management_mode?: string;
93
- verifier_perm_management_mode?: string;
129
+ issuer_onboarding_mode?: string;
130
+ verifier_onboarding_mode?: string;
94
131
  archived: string | null;
95
132
  created: string;
96
133
  modified: string;
97
134
  }
98
- export interface PermissionDto {
135
+ export interface ParticipantDto {
99
136
  id: number;
100
137
  schema_id: number;
101
138
  did: string | null;
102
- type: number;
103
- perm_state: 'ACTIVE' | 'REVOKED' | 'SLASHED' | 'REPAID' | 'EXPIRED' | 'FUTURE' | 'INACTIVE';
104
- vp_state?: string;
139
+ role: string;
140
+ op_state?: string;
105
141
  revoked: string | null;
106
142
  slashed: string | null;
107
143
  effective_until?: string;
108
144
  modified: string;
145
+ validator_participant_id?: number | null;
146
+ op_summary_digest?: string;
109
147
  }
110
- export interface PermQueryClient {
111
- GetPermission(req: {
112
- id: Long;
148
+ export interface RawParticipant {
149
+ id: number;
150
+ schemaId: number;
151
+ role: number;
152
+ did: string;
153
+ corporationId?: number;
154
+ validatorParticipantId: number;
155
+ opState?: number;
156
+ opSummaryDigest?: string;
157
+ revoked: Date | undefined;
158
+ slashed: Date | undefined;
159
+ }
160
+ export interface ParticipantQueryClient {
161
+ GetParticipant(req: {
162
+ id: number;
113
163
  }): Promise<{
114
- permission?: unknown;
164
+ participant?: RawParticipant;
115
165
  }>;
116
- FindPermissionsWithDID(req: object): Promise<{
117
- permissions: unknown[];
166
+ FindParticipantsWithDID(req: object): Promise<{
167
+ participants: RawParticipant[];
118
168
  }>;
119
- GetPermissionSession(req: {
169
+ GetParticipantSession(req: {
120
170
  id: string;
121
171
  }): Promise<{
122
172
  session?: unknown;
@@ -128,31 +178,120 @@ export interface VeranaChainConfig {
128
178
  mnemonic: string;
129
179
  logger: BaseLogger;
130
180
  gasPrice?: string;
181
+ corporationAddress?: string;
182
+ /**
183
+ * FIXME(verana setValidated->AUTHZ-CHECK-3): temporary. On the current chain, validating a participant
184
+ * (OperatorAuthorization) and creating its session (VSOperatorAuthorization) need two mutually-exclusive
185
+ * account permissions, so one account cannot do both. When set, the session is signed by this second
186
+ * account. Remove once the chain authorizes both under one vs_operator (AUTHZ-CHECK-3).
187
+ */
188
+ sessionOperatorMnemonic?: string;
131
189
  }
132
- export interface StartPermissionVPParams {
133
- type: number;
134
- validatorPermId: Long;
135
- country: string;
190
+ /** Wrapper for optional uint64 values per `verana.pp.v1.OptionalUInt64`. */
191
+ export interface OptionalUInt64 {
192
+ value: number;
193
+ }
194
+ export interface StartParticipantOPParams {
195
+ role: number;
196
+ validatorParticipantId: number;
136
197
  did: string;
137
- validationFees?: {
138
- value: Long;
139
- };
198
+ validationFees?: OptionalUInt64;
199
+ issuanceFees?: OptionalUInt64;
200
+ verificationFees?: OptionalUInt64;
140
201
  }
141
- export interface SetPermissionVPToValidatedParams {
142
- id: Long;
202
+ export interface SetParticipantOPToValidatedParams {
203
+ id: number;
143
204
  effectiveUntil?: Date;
144
- validationFees: Long;
145
- issuanceFees: Long;
146
- verificationFees: Long;
147
- country: string;
148
- vpSummaryDigestSri: string;
149
- issuanceFeeDiscount: Long;
150
- verificationFeeDiscount: Long;
151
- }
152
- export interface CreateOrUpdatePermissionSessionParams {
205
+ validationFees?: number;
206
+ issuanceFees?: number;
207
+ verificationFees?: number;
208
+ opSummaryDigest: string;
209
+ issuanceFeeDiscount?: number;
210
+ verificationFeeDiscount?: number;
211
+ corporation?: string;
212
+ }
213
+ export interface CreateOrUpdateParticipantSessionParams {
153
214
  id: string;
154
- issuerPermId: Long;
155
- verifierPermId: Long;
156
- agentPermId: Long;
157
- walletAgentPermId: Long;
215
+ issuerParticipantId?: number;
216
+ verifierParticipantId?: number;
217
+ agentParticipantId: number;
218
+ walletAgentParticipantId: number;
219
+ digest?: string;
220
+ corporation?: string;
221
+ }
222
+ export interface Coin {
223
+ denom: string;
224
+ amount: string;
225
+ }
226
+ export interface DurationParam {
227
+ seconds: number;
228
+ nanos?: number;
229
+ }
230
+ export interface GrantOperatorAuthorizationParams {
231
+ grantee: string;
232
+ msgTypes: string[];
233
+ expiration?: Date;
234
+ authzSpendLimit?: Coin[];
235
+ authzSpendLimitPeriod?: DurationParam;
236
+ withFeegrant?: boolean;
237
+ feegrantSpendLimit?: Coin[];
238
+ feegrantSpendLimitPeriod?: DurationParam;
239
+ feeSpendLimit?: Coin[];
240
+ }
241
+ export interface RevokeOperatorAuthorizationParams {
242
+ grantee: string;
243
+ }
244
+ export interface CreateEcosystemParams {
245
+ did: string;
246
+ language: string;
247
+ docUrl: string;
248
+ docDigestSri: string;
249
+ aka?: string;
250
+ }
251
+ export interface ArchiveEcosystemParams {
252
+ ecosystemId: number;
253
+ archive: boolean;
254
+ }
255
+ /** Wrapper for optional uint32 values per `verana.cs.v1.OptionalUInt32`. */
256
+ export interface OptionalUInt32 {
257
+ value: number;
258
+ }
259
+ export interface CreateCredentialSchemaParams {
260
+ ecosystemId: number;
261
+ jsonSchema: string;
262
+ issuerOnboardingMode?: number;
263
+ verifierOnboardingMode?: number;
264
+ holderOnboardingMode?: number;
265
+ pricingAssetType?: number;
266
+ pricingAsset?: string;
267
+ digestAlgorithm?: string;
268
+ issuerGrantorValidationValidityPeriod?: OptionalUInt32;
269
+ verifierGrantorValidationValidityPeriod?: OptionalUInt32;
270
+ issuerValidationValidityPeriod?: OptionalUInt32;
271
+ verifierValidationValidityPeriod?: OptionalUInt32;
272
+ holderValidationValidityPeriod?: OptionalUInt32;
273
+ }
274
+ export interface CreateRootParticipantParams {
275
+ schemaId: number;
276
+ did: string;
277
+ effectiveFrom?: Date;
278
+ effectiveUntil?: Date;
279
+ validationFees?: number;
280
+ issuanceFees?: number;
281
+ verificationFees?: number;
282
+ }
283
+ export interface SelfCreateParticipantParams {
284
+ role: number;
285
+ validatorParticipantId: number;
286
+ did: string;
287
+ effectiveFrom?: Date;
288
+ effectiveUntil?: Date;
289
+ validationFees?: number;
290
+ verificationFees?: number;
291
+ vsOperator?: string;
292
+ vsOperatorAuthzEnabled?: boolean;
293
+ vsOperatorAuthzSpendLimit?: Coin[];
294
+ vsOperatorAuthzWithFeegrant?: boolean;
295
+ vsOperatorAuthzFeeSpendLimit?: Coin[];
296
+ vsOperatorAuthzSpendPeriod?: DurationParam;
158
297
  }
@@ -1,6 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RECORD_ID = exports.VERANA_BECH32_PREFIX = void 0;
3
+ exports.RECORD_ID = exports.VERANA_BECH32_PREFIX = exports.ValidationState = void 0;
4
+ var ValidationState;
5
+ (function (ValidationState) {
6
+ ValidationState[ValidationState["UNSPECIFIED"] = 0] = "UNSPECIFIED";
7
+ ValidationState[ValidationState["PENDING"] = 1] = "PENDING";
8
+ ValidationState[ValidationState["VALIDATED"] = 2] = "VALIDATED";
9
+ ValidationState[ValidationState["TERMINATED"] = 3] = "TERMINATED";
10
+ })(ValidationState || (exports.ValidationState = ValidationState = {}));
4
11
  exports.VERANA_BECH32_PREFIX = 'verana';
5
12
  exports.RECORD_ID = 'verana-blockchain-sync-state';
6
13
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/blockchain/types.ts"],"names":[],"mappings":";;;AAEa,QAAA,oBAAoB,GAAG,QAAQ,CAAA;AAC/B,QAAA,SAAS,GAAG,8BAA8B,CAAA"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/blockchain/types.ts"],"names":[],"mappings":";;;AAEA,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,mEAAe,CAAA;IACf,2DAAW,CAAA;IACX,+DAAa,CAAA;IACb,iEAAc,CAAA;AAChB,CAAC,EALW,eAAe,+BAAf,eAAe,QAK1B;AAeY,QAAA,oBAAoB,GAAG,QAAQ,CAAA;AAC/B,QAAA,SAAS,GAAG,8BAA8B,CAAA"}
@@ -13,6 +13,6 @@ export declare class FullTailsFileService extends BasicTailsFileService {
13
13
  tailsFileUrl: string;
14
14
  }>;
15
15
  }
16
- export declare const baseFilePath = "./tails";
16
+ export declare const baseFilePath: string;
17
17
  export declare const tailsIndex: Record<string, string>;
18
18
  export declare function deleteTailsEntry(tailsFileUrl: string): void;
@@ -9,6 +9,8 @@ const anoncreds_1 = require("@credo-ts/anoncreds");
9
9
  const core_1 = require("@credo-ts/core");
10
10
  const crypto_1 = require("crypto");
11
11
  const fs_1 = __importDefault(require("fs"));
12
+ const os_1 = __importDefault(require("os"));
13
+ const path_1 = __importDefault(require("path"));
12
14
  class FullTailsFileService extends anoncreds_1.BasicTailsFileService {
13
15
  constructor(options) {
14
16
  super(options);
@@ -18,19 +20,13 @@ class FullTailsFileService extends anoncreds_1.BasicTailsFileService {
18
20
  const revocationRegistryDefinition = options.revocationRegistryDefinition;
19
21
  const localTailsFilePath = revocationRegistryDefinition.value.tailsLocation;
20
22
  const tailsFileId = core_1.utils.uuid();
21
- try {
22
- await saveTailsFile(localTailsFilePath, tailsFileId, agentContext.config.logger);
23
- agentContext.config.logger.info('Tails file processed successfully!');
24
- }
25
- catch (error) {
26
- agentContext.config.logger.error(`Failed to process tails file: ${error.message}`);
27
- }
23
+ await saveTailsFile(localTailsFilePath, tailsFileId, agentContext.config.logger);
28
24
  return { tailsFileUrl: `${this.tailsServerBaseUrl}/${encodeURIComponent(tailsFileId)}` };
29
25
  }
30
26
  }
31
27
  exports.FullTailsFileService = FullTailsFileService;
32
- exports.baseFilePath = './tails';
33
- const indexFilePath = `./${exports.baseFilePath}/index.json`;
28
+ exports.baseFilePath = process.env.TAILS_DIRECTORY_PATH || path_1.default.join(os_1.default.homedir(), '.afj', 'tails');
29
+ const indexFilePath = path_1.default.join(exports.baseFilePath, 'index.json');
34
30
  if (!fs_1.default.existsSync(exports.baseFilePath)) {
35
31
  fs_1.default.mkdirSync(exports.baseFilePath, { recursive: true });
36
32
  }
@@ -43,7 +39,7 @@ function fileHash(filePath, algorithm = 'sha256') {
43
39
  s.on('data', function (data) {
44
40
  shasum.update(data);
45
41
  });
46
- // making digest
42
+ s.on('error', reject);
47
43
  s.on('end', function () {
48
44
  const hash = shasum.digest('hex');
49
45
  return resolve(hash);
@@ -1 +1 @@
1
- {"version":3,"file":"FullTailsFileService.js","sourceRoot":"","sources":["../../src/credentials/FullTailsFileService.ts"],"names":[],"mappings":";;;;;;AAgEA,4CAaC;AA1ED,mDAA2D;AAC3D,yCAAsC;AACtC,mCAAmC;AACnC,4CAAmB;AAEnB,MAAa,oBAAqB,SAAQ,iCAAqB;IAE7D,YAAmB,OAAoE;QACrF,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAA;IACtD,CAAC;IAEM,KAAK,CAAC,eAAe,CAC1B,YAA0B,EAC1B,OAEC;QAED,MAAM,4BAA4B,GAAG,OAAO,CAAC,4BAA4B,CAAA;QACzE,MAAM,kBAAkB,GAAG,4BAA4B,CAAC,KAAK,CAAC,aAAa,CAAA;QAE3E,MAAM,WAAW,GAAG,YAAK,CAAC,IAAI,EAAE,CAAA;QAChC,IAAI,CAAC;YACH,MAAM,aAAa,CAAC,kBAAkB,EAAE,WAAW,EAAE,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;YAChF,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAA;QACvE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,iCAAiC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAA;QACpF,CAAC;QACD,OAAO,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,kBAAkB,IAAI,kBAAkB,CAAC,WAAW,CAAC,EAAE,EAAE,CAAA;IAC1F,CAAC;CACF;AAzBD,oDAyBC;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AAkC,WAAW,EAAE,CAAC,CAAA;IAE7F,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,aAAa,CAAC,CAAA;IAC1C,MAAM,eAAe,GAAG,GAAG,oBAAY,IAAI,IAAI,EAAE,CAAA;IACjD,IAAI,YAAE,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC;QACnC,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAA;IAC1C,CAAC;SAAM,CAAC;QACN,YAAE,CAAC,YAAY,CAAC,aAAa,EAAE,eAAe,CAAC,CAAA;IACjD,CAAC;IAED,kBAAU,CAAC,WAAW,CAAC,GAAG,IAAI,CAAA;IAC9B,YAAE,CAAC,aAAa,CAAC,aAAa,EAAE,IAAI,CAAC,SAAS,CAAC,kBAAU,CAAC,CAAC,CAAA;IAE3D,MAAM,CAAC,IAAI,CAAC,qCAAqC,WAAW,EAAE,CAAC,CAAA;AACjE,CAAC"}
package/build/index.d.ts CHANGED
@@ -1,10 +1,8 @@
1
1
  export * from './agent';
2
- export type { Plugin } from './types';
2
+ export * from './types';
3
3
  export * from './events';
4
4
  export { setupBaseDidComm } from './plugins/setupBaseDidComm';
5
5
  export type { BaseDidCommPlugin, BaseDidCommPluginOptions } from './plugins/setupBaseDidComm';
6
- export type { VsAgentNestPlugin, MessageHandler } from './types';
7
- export { MESSAGE_HANDLERS } from './types';
8
6
  export { CachedWebDidResolver } from './did/CachedWebDidResolver';
9
7
  export { WebDidRegistrar } from './did/WebDidRegistrar';
10
8
  export { getLegacyDidDocument } from './did/legacyDidWeb';
@@ -14,3 +12,4 @@ export { VsAgentWsOutboundTransport } from './transports/VsAgentWsOutboundTransp
14
12
  export { FullTailsFileService, tailsIndex, baseFilePath, deleteTailsEntry, } from './credentials/FullTailsFileService';
15
13
  export * from './utils';
16
14
  export * from './blockchain';
15
+ export * from './vtFlow';
package/build/index.js CHANGED
@@ -14,16 +14,15 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.deleteTailsEntry = exports.baseFilePath = exports.tailsIndex = exports.FullTailsFileService = exports.VsAgentWsOutboundTransport = exports.WebSocketTransportSession = exports.VsAgentWsInboundTransport = exports.HttpTransportSession = exports.HttpInboundTransport = exports.getLegacyDidDocument = exports.WebDidRegistrar = exports.CachedWebDidResolver = exports.MESSAGE_HANDLERS = exports.setupBaseDidComm = void 0;
17
+ exports.deleteTailsEntry = exports.baseFilePath = exports.tailsIndex = exports.FullTailsFileService = exports.VsAgentWsOutboundTransport = exports.WebSocketTransportSession = exports.VsAgentWsInboundTransport = exports.HttpTransportSession = exports.HttpInboundTransport = exports.getLegacyDidDocument = exports.WebDidRegistrar = exports.CachedWebDidResolver = exports.setupBaseDidComm = void 0;
18
18
  // Agent
19
19
  __exportStar(require("./agent"), exports);
20
+ __exportStar(require("./types"), exports);
20
21
  // Events
21
22
  __exportStar(require("./events"), exports);
22
23
  // Plugins
23
24
  var setupBaseDidComm_1 = require("./plugins/setupBaseDidComm");
24
25
  Object.defineProperty(exports, "setupBaseDidComm", { enumerable: true, get: function () { return setupBaseDidComm_1.setupBaseDidComm; } });
25
- var types_1 = require("./types");
26
- Object.defineProperty(exports, "MESSAGE_HANDLERS", { enumerable: true, get: function () { return types_1.MESSAGE_HANDLERS; } });
27
26
  // DID utilities
28
27
  var CachedWebDidResolver_1 = require("./did/CachedWebDidResolver");
29
28
  Object.defineProperty(exports, "CachedWebDidResolver", { enumerable: true, get: function () { return CachedWebDidResolver_1.CachedWebDidResolver; } });
@@ -49,4 +48,5 @@ Object.defineProperty(exports, "deleteTailsEntry", { enumerable: true, get: func
49
48
  // Utils
50
49
  __exportStar(require("./utils"), exports);
51
50
  __exportStar(require("./blockchain"), exports);
51
+ __exportStar(require("./vtFlow"), exports);
52
52
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,QAAQ;AACR,0CAAuB;AAGvB,SAAS;AACT,2CAAwB;AAExB,UAAU;AACV,+DAA6D;AAApD,oHAAA,gBAAgB,OAAA;AAKzB,iCAA0C;AAAjC,yGAAA,gBAAgB,OAAA;AAEzB,gBAAgB;AAChB,mEAAiE;AAAxD,4HAAA,oBAAoB,OAAA;AAC7B,yDAAuD;AAA9C,kHAAA,eAAe,OAAA;AACxB,mDAAyD;AAAhD,oHAAA,oBAAoB,OAAA;AAE7B,aAAa;AACb,0EAA8F;AAArF,4HAAA,oBAAoB,OAAA;AAAE,4HAAA,oBAAoB,OAAA;AACnD,oFAA6G;AAApG,sIAAA,yBAAyB,OAAA;AAAE,sIAAA,yBAAyB,OAAA;AAC7D,sFAAoF;AAA3E,wIAAA,0BAA0B,OAAA;AAEnC,cAAc;AACd,2EAK2C;AAJzC,4HAAA,oBAAoB,OAAA;AACpB,kHAAA,UAAU,OAAA;AACV,oHAAA,YAAY,OAAA;AACZ,wHAAA,gBAAgB,OAAA;AAGlB,QAAQ;AACR,0CAAuB;AAEvB,+CAA4B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,QAAQ;AACR,0CAAuB;AACvB,0CAAuB;AAEvB,SAAS;AACT,2CAAwB;AAExB,UAAU;AACV,+DAA6D;AAApD,oHAAA,gBAAgB,OAAA;AAGzB,gBAAgB;AAChB,mEAAiE;AAAxD,4HAAA,oBAAoB,OAAA;AAC7B,yDAAuD;AAA9C,kHAAA,eAAe,OAAA;AACxB,mDAAyD;AAAhD,oHAAA,oBAAoB,OAAA;AAE7B,aAAa;AACb,0EAA8F;AAArF,4HAAA,oBAAoB,OAAA;AAAE,4HAAA,oBAAoB,OAAA;AACnD,oFAA6G;AAApG,sIAAA,yBAAyB,OAAA;AAAE,sIAAA,yBAAyB,OAAA;AAC7D,sFAAoF;AAA3E,wIAAA,0BAA0B,OAAA;AAEnC,cAAc;AACd,2EAK2C;AAJzC,4HAAA,oBAAoB,OAAA;AACpB,kHAAA,UAAU,OAAA;AACV,oHAAA,YAAY,OAAA;AACZ,wHAAA,gBAAgB,OAAA;AAGlB,QAAQ;AACR,0CAAuB;AAEvB,+CAA4B;AAC5B,2CAAwB"}
@@ -1,17 +1,19 @@
1
1
  import type { DidCommVersion } from '@credo-ts/didcomm';
2
2
  import { AskarModuleConfigStoreOptions } from '@credo-ts/askar';
3
+ import { type VtFlowModuleConfigOptions } from '@verana-labs/credo-ts-didcomm-vt-flow';
3
4
  import { BaseAgentModules } from '../agent/VsAgent';
4
5
  export interface BaseDidCommPluginOptions {
5
6
  walletConfig: AskarModuleConfigStoreOptions;
6
7
  publicApiBaseUrl: string;
7
8
  endpoints: string[];
9
+ vtFlow?: VtFlowModuleConfigOptions;
8
10
  didcommVersions?: DidCommVersion[];
9
11
  }
10
12
  export interface BaseDidCommPlugin {
11
13
  modules: BaseAgentModules;
12
14
  }
13
15
  /**
14
- * Sets up the base DIDComm module: connections, OOB, credential exchange, and proof exchange.
16
+ * Sets up the base DIDComm module: connections, OOB, credential exchange, proof exchange, and vt-flow.
15
17
  * For chat protocols, add setupChatProtocols(). For eMRTD, add setupMrtdProtocol().
16
18
  */
17
19
  export declare function setupBaseDidComm(options: BaseDidCommPluginOptions): BaseDidCommPlugin;
@@ -8,6 +8,7 @@ const didcomm_1 = require("@credo-ts/didcomm");
8
8
  const webvh_1 = require("@credo-ts/webvh");
9
9
  const anoncreds_nodejs_1 = require("@hyperledger/anoncreds-nodejs");
10
10
  const askar_nodejs_1 = require("@openwallet-foundation/askar-nodejs");
11
+ const credo_ts_didcomm_vt_flow_1 = require("@verana-labs/credo-ts-didcomm-vt-flow");
11
12
  const credo_ts_didweb_anoncreds_1 = require("credo-ts-didweb-anoncreds");
12
13
  const FullTailsFileService_1 = require("../credentials/FullTailsFileService");
13
14
  const CachedDocumentLoader_1 = require("../did/CachedDocumentLoader");
@@ -15,7 +16,7 @@ const CachedWebDidResolver_1 = require("../did/CachedWebDidResolver");
15
16
  const WebDidRegistrar_1 = require("../did/WebDidRegistrar");
16
17
  const VsAgentWsOutboundTransport_1 = require("../transports/VsAgentWsOutboundTransport");
17
18
  /**
18
- * Sets up the base DIDComm module: connections, OOB, credential exchange, and proof exchange.
19
+ * Sets up the base DIDComm module: connections, OOB, credential exchange, proof exchange, and vt-flow.
19
20
  * For chat protocols, add setupChatProtocols(). For eMRTD, add setupMrtdProtocol().
20
21
  */
21
22
  function setupBaseDidComm(options) {
@@ -84,6 +85,7 @@ function setupBaseDidComm(options) {
84
85
  w3cCredentials: new core_1.W3cCredentialsModule({
85
86
  documentLoader: CachedDocumentLoader_1.defaultDocumentLoader,
86
87
  }),
88
+ vtFlow: new credo_ts_didcomm_vt_flow_1.VtFlowModule(options.vtFlow),
87
89
  },
88
90
  };
89
91
  }
@@ -1 +1 @@
1
- {"version":3,"file":"setupBaseDidComm.js","sourceRoot":"","sources":["../../src/plugins/setupBaseDidComm.ts"],"names":[],"mappings":";;AA+CA,4CAmEC;AAhHD,mDAM4B;AAC5B,2CAA4E;AAC5E,yCAAiE;AACjE,+CAQ0B;AAC1B,2CAA6F;AAC7F,oEAAyD;AACzD,sEAA2D;AAC3D,yEAAmE;AAGnE,8EAA0E;AAC1E,sEAAmE;AACnE,sEAAkE;AAClE,4DAAwD;AACxD,yFAAqF;AAarF;;;GAGG;AACH,SAAgB,gBAAgB,CAAC,OAAiC;;IAChE,OAAO;QACL,OAAO,EAAE;YACP,OAAO,EAAE,IAAI,uBAAa,CAAC;gBACzB,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,eAAe,EAAE,OAAO,CAAC,eAAe;gBACxC,2FAA2F;gBAC3F,aAAa,EAAE,EAAE,SAAS,EAAE,MAAA,OAAO,CAAC,eAAe,mCAAI,CAAC,IAAI,CAAC,EAAE;gBAC/D,UA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/build/types.d.ts CHANGED
@@ -24,3 +24,4 @@ export interface VsAgentNestPlugin {
24
24
  imports?: any[];
25
25
  registerEvents?: (agent: VsAgent<BaseAgentModules>, logger: BaseLogger) => void;
26
26
  }
27
+ export declare const ISSUER_PARTICIPANT_TYPE = 1;
package/build/types.js CHANGED
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MESSAGE_HANDLERS = void 0;
3
+ exports.ISSUER_PARTICIPANT_TYPE = exports.MESSAGE_HANDLERS = void 0;
4
4
  exports.MESSAGE_HANDLERS = 'MESSAGE_HANDLERS';
5
+ exports.ISSUER_PARTICIPANT_TYPE = 1;
5
6
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAMa,QAAA,gBAAgB,GAAG,kBAAkB,CAAA"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAMa,QAAA,gBAAgB,GAAG,kBAAkB,CAAA;AAwBrC,QAAA,uBAAuB,GAAG,CAAC,CAAA"}
@@ -0,0 +1,37 @@
1
+ import { VtFlowRecord } from '@verana-labs/credo-ts-didcomm-vt-flow';
2
+ import { BaseAgentModules, VsAgent } from '../agent';
3
+ import { VeranaIndexerService } from '../blockchain/VeranaIndexerService';
4
+ export interface VtFlowOrchestratorOptions {
5
+ publicApiBaseUrl?: string;
6
+ indexer?: VeranaIndexerService;
7
+ }
8
+ export interface StartOnboardingProcessInput {
9
+ applicantParticipantId: number;
10
+ participantSessionId?: string;
11
+ claims?: Record<string, unknown>;
12
+ }
13
+ export interface ValidateAndOfferCredentialInput {
14
+ vtFlowRecordId: string;
15
+ credentialType?: string[];
16
+ credentialContext?: string[];
17
+ credentialSchemaId: string;
18
+ agentParticipantId?: number;
19
+ walletAgentParticipantId?: number;
20
+ }
21
+ export interface AcceptCredentialInput {
22
+ vtFlowRecordId: string;
23
+ }
24
+ export declare class VtFlowOrchestrator {
25
+ private readonly agent;
26
+ private readonly options;
27
+ constructor(agent: VsAgent<BaseAgentModules>, options?: VtFlowOrchestratorOptions);
28
+ startOnboardingProcess(input: StartOnboardingProcessInput): Promise<VtFlowRecord>;
29
+ validateAndOfferCredential(input: ValidateAndOfferCredentialInput): Promise<VtFlowRecord>;
30
+ acceptCredential(input: AcceptCredentialInput): Promise<VtFlowRecord>;
31
+ verifyOfferedCredential(vtFlowRecordId: string): Promise<void>;
32
+ private resolveHolderAndValidatorState;
33
+ publishCredentialAsLinkedVp(vtFlowRecordId: string): Promise<void>;
34
+ private extractSchemaBaseId;
35
+ private resolveVtFlowApi;
36
+ private requireChain;
37
+ }