@sphereon/ssi-sdk.linked-vp 0.34.1-feature.SSISDK.82.and.SSISDK.70.345

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.
@@ -0,0 +1,448 @@
1
+ import { IPluginMethodMap, IAgentContext, IAgentPlugin } from '@veramo/core';
2
+ import { IIdentifierResolution } from '@sphereon/ssi-sdk-ext.identifier-resolution';
3
+ import { ICredentialStore } from '@sphereon/ssi-sdk.credential-store';
4
+ import { VcdmCredentialPlugin } from '@sphereon/ssi-sdk.credential-vcdm';
5
+ import { ISDJwtPlugin } from '@sphereon/ssi-sdk.sd-jwt';
6
+ import { DocumentFormat } from '@sphereon/ssi-types';
7
+ import { IKeyManager } from '@veramo/core/src/types/IKeyManager';
8
+
9
+ var ILinkedVPManager$1 = {
10
+ components: {
11
+ schemas: {
12
+ GeneratePresentationArgs: {
13
+ type: "object",
14
+ properties: {
15
+ linkedVpId: {
16
+ type: "string"
17
+ }
18
+ },
19
+ required: [
20
+ "linkedVpId"
21
+ ],
22
+ additionalProperties: false
23
+ },
24
+ LinkedVPPresentation: {
25
+ anyOf: [
26
+ {
27
+ type: "string"
28
+ },
29
+ {
30
+ $ref: "#/components/schemas/Record<string,any>"
31
+ }
32
+ ]
33
+ },
34
+ "Record<string,any>": {
35
+ type: "object"
36
+ },
37
+ GetServiceEntriesArgs: {
38
+ type: "object",
39
+ properties: {
40
+ tenantId: {
41
+ type: "string"
42
+ }
43
+ },
44
+ additionalProperties: false
45
+ },
46
+ LinkedVPServiceEntry: {
47
+ type: "object",
48
+ properties: {
49
+ id: {
50
+ type: "string"
51
+ },
52
+ type: {
53
+ type: "string",
54
+ "const": "LinkedVerifiablePresentation"
55
+ },
56
+ serviceEndpoint: {
57
+ type: "string"
58
+ }
59
+ },
60
+ required: [
61
+ "id",
62
+ "type",
63
+ "serviceEndpoint"
64
+ ],
65
+ additionalProperties: false
66
+ },
67
+ HasLinkedVPEntryArgs: {
68
+ type: "object",
69
+ properties: {
70
+ linkedVpId: {
71
+ type: "string"
72
+ }
73
+ },
74
+ required: [
75
+ "linkedVpId"
76
+ ],
77
+ additionalProperties: false
78
+ },
79
+ PublishCredentialArgs: {
80
+ type: "object",
81
+ properties: {
82
+ digitalCredentialId: {
83
+ type: "string"
84
+ },
85
+ linkedVpId: {
86
+ type: "string"
87
+ },
88
+ tenantId: {
89
+ type: "string"
90
+ }
91
+ },
92
+ required: [
93
+ "digitalCredentialId"
94
+ ],
95
+ additionalProperties: false
96
+ },
97
+ LinkedVPEntry: {
98
+ type: "object",
99
+ properties: {
100
+ id: {
101
+ type: "string"
102
+ },
103
+ linkedVpId: {
104
+ type: "string"
105
+ },
106
+ tenantId: {
107
+ type: "string"
108
+ },
109
+ linkedVpFrom: {
110
+ type: "string",
111
+ format: "date-time"
112
+ },
113
+ createdAt: {
114
+ type: "string",
115
+ format: "date-time"
116
+ }
117
+ },
118
+ required: [
119
+ "id",
120
+ "linkedVpId",
121
+ "createdAt"
122
+ ],
123
+ additionalProperties: false
124
+ },
125
+ UnpublishCredentialArgs: {
126
+ type: "object",
127
+ properties: {
128
+ linkedVpId: {
129
+ type: "string"
130
+ }
131
+ },
132
+ required: [
133
+ "linkedVpId"
134
+ ],
135
+ additionalProperties: false
136
+ }
137
+ },
138
+ methods: {
139
+ lvpGeneratePresentation: {
140
+ description: "Generate and return a Verifiable Presentation for a published LinkedVP This is the main endpoint handler for GET /linked-vp/",
141
+ "arguments": {
142
+ $ref: "#/components/schemas/GeneratePresentationArgs"
143
+ },
144
+ returnType: {
145
+ $ref: "#/components/schemas/LinkedVPPresentation"
146
+ }
147
+ },
148
+ lvpGetServiceEntries: {
149
+ description: "Get LinkedVP service entries for a DID to be added to a DID Document This is useful when generating DID Documents with toDidDocument",
150
+ "arguments": {
151
+ $ref: "#/components/schemas/GetServiceEntriesArgs"
152
+ },
153
+ returnType: {
154
+ type: "array",
155
+ items: {
156
+ $ref: "#/components/schemas/LinkedVPServiceEntry"
157
+ }
158
+ }
159
+ },
160
+ lvpHasEntry: {
161
+ description: "Check if a LinkedVP entry exists by linkedVpId",
162
+ "arguments": {
163
+ $ref: "#/components/schemas/HasLinkedVPEntryArgs"
164
+ },
165
+ returnType: {
166
+ type: "boolean"
167
+ }
168
+ },
169
+ lvpPublishCredential: {
170
+ description: "Publish a credential as a LinkedVP by adding it to the holder's DID Document",
171
+ "arguments": {
172
+ $ref: "#/components/schemas/PublishCredentialArgs"
173
+ },
174
+ returnType: {
175
+ $ref: "#/components/schemas/LinkedVPEntry"
176
+ }
177
+ },
178
+ lvpUnpublishCredential: {
179
+ description: "Unpublish a credential by removing its LinkedVP entry from the DID Document",
180
+ "arguments": {
181
+ $ref: "#/components/schemas/UnpublishCredentialArgs"
182
+ },
183
+ returnType: {
184
+ type: "boolean"
185
+ }
186
+ }
187
+ }
188
+ }
189
+ };
190
+ var plugin_schema = {
191
+ ILinkedVPManager: ILinkedVPManager$1
192
+ };
193
+
194
+ declare const LOGGER_NAMESPACE = "sphereon:linked-vp";
195
+ type LinkedVPPresentation = {
196
+ documentFormat: DocumentFormat;
197
+ presentationPayload: string | Record<string, any>;
198
+ };
199
+ interface ILinkedVPManager extends IPluginMethodMap {
200
+ /**
201
+ * Publish a credential as a LinkedVP by adding it to the holder's DID Document
202
+ * @param args - Publication arguments including credential ID and scope configuration
203
+ * @param context - Agent context
204
+ */
205
+ lvpPublishCredential(args: PublishCredentialArgs, context: RequiredContext): Promise<LinkedVPEntry>;
206
+ /**
207
+ * Unpublish a credential by removing its LinkedVP entry from the DID Document
208
+ * @param args - Unpublish arguments
209
+ * @param context - Agent context
210
+ */
211
+ lvpUnpublishCredential(args: UnpublishCredentialArgs, context: RequiredContext): Promise<boolean>;
212
+ /**
213
+ * Check if a LinkedVP entry exists by linkedVpId
214
+ * @param args - Query arguments
215
+ * @param context - Agent context
216
+ */
217
+ lvpHasEntry(args: HasLinkedVPEntryArgs, context: RequiredContext): Promise<boolean>;
218
+ /**
219
+ * Get LinkedVP service entries for a DID to be added to a DID Document
220
+ * This is useful when generating DID Documents with toDidDocument
221
+ * @param args - Query arguments for the DID
222
+ * @param context - Agent context
223
+ */
224
+ lvpGetServiceEntries(args: GetServiceEntriesArgs, context: RequiredContext): Promise<Array<LinkedVPServiceEntry>>;
225
+ /**
226
+ * Generate and return a Verifiable Presentation for a published LinkedVP
227
+ * This is the main endpoint handler for GET /linked-vp/{linkedVpId}
228
+ * @param args - Generation arguments
229
+ * @param context - Agent context
230
+ */
231
+ lvpGeneratePresentation(args: GeneratePresentationArgs, context: RequiredContext): Promise<LinkedVPPresentation>;
232
+ }
233
+ type PublishCredentialArgs = {
234
+ digitalCredentialId: string;
235
+ linkedVpId?: string;
236
+ };
237
+ type UnpublishCredentialArgs = {
238
+ linkedVpId: string;
239
+ };
240
+ type HasLinkedVPEntryArgs = {
241
+ linkedVpId: string;
242
+ };
243
+ type GetServiceEntriesArgs = {
244
+ tenantId?: string;
245
+ };
246
+ type GeneratePresentationArgs = {
247
+ linkedVpId: string;
248
+ };
249
+ type LinkedVPEntry = {
250
+ id: string;
251
+ linkedVpId: string;
252
+ linkedVpFrom?: Date;
253
+ tenantId?: string;
254
+ createdAt: Date;
255
+ };
256
+ type LinkedVPServiceEntry = {
257
+ id: string;
258
+ type: 'LinkedVerifiablePresentation';
259
+ serviceEndpoint: string;
260
+ };
261
+ type RequiredContext = IAgentContext<IIdentifierResolution & ICredentialStore & IKeyManager & VcdmCredentialPlugin & ISDJwtPlugin>;
262
+
263
+ declare const linkedVPManagerMethods: Array<string>;
264
+ /**
265
+ * {@inheritDoc ILinkedVPManager}
266
+ */
267
+ declare class LinkedVPManager implements IAgentPlugin {
268
+ readonly schema: {
269
+ components: {
270
+ schemas: {
271
+ GeneratePresentationArgs: {
272
+ type: string;
273
+ properties: {
274
+ linkedVpId: {
275
+ type: string;
276
+ };
277
+ };
278
+ required: string[];
279
+ additionalProperties: boolean;
280
+ };
281
+ LinkedVPPresentation: {
282
+ anyOf: ({
283
+ type: string;
284
+ $ref?: undefined;
285
+ } | {
286
+ $ref: string;
287
+ type?: undefined;
288
+ })[];
289
+ };
290
+ "Record<string,any>": {
291
+ type: string;
292
+ };
293
+ GetServiceEntriesArgs: {
294
+ type: string;
295
+ properties: {
296
+ tenantId: {
297
+ type: string;
298
+ };
299
+ };
300
+ additionalProperties: boolean;
301
+ };
302
+ LinkedVPServiceEntry: {
303
+ type: string;
304
+ properties: {
305
+ id: {
306
+ type: string;
307
+ };
308
+ type: {
309
+ type: string;
310
+ const: string;
311
+ };
312
+ serviceEndpoint: {
313
+ type: string;
314
+ };
315
+ };
316
+ required: string[];
317
+ additionalProperties: boolean;
318
+ };
319
+ HasLinkedVPEntryArgs: {
320
+ type: string;
321
+ properties: {
322
+ linkedVpId: {
323
+ type: string;
324
+ };
325
+ };
326
+ required: string[];
327
+ additionalProperties: boolean;
328
+ };
329
+ PublishCredentialArgs: {
330
+ type: string;
331
+ properties: {
332
+ digitalCredentialId: {
333
+ type: string;
334
+ };
335
+ linkedVpId: {
336
+ type: string;
337
+ };
338
+ tenantId: {
339
+ type: string;
340
+ };
341
+ };
342
+ required: string[];
343
+ additionalProperties: boolean;
344
+ };
345
+ LinkedVPEntry: {
346
+ type: string;
347
+ properties: {
348
+ id: {
349
+ type: string;
350
+ };
351
+ linkedVpId: {
352
+ type: string;
353
+ };
354
+ tenantId: {
355
+ type: string;
356
+ };
357
+ linkedVpFrom: {
358
+ type: string;
359
+ format: string;
360
+ };
361
+ createdAt: {
362
+ type: string;
363
+ format: string;
364
+ };
365
+ };
366
+ required: string[];
367
+ additionalProperties: boolean;
368
+ };
369
+ UnpublishCredentialArgs: {
370
+ type: string;
371
+ properties: {
372
+ linkedVpId: {
373
+ type: string;
374
+ };
375
+ };
376
+ required: string[];
377
+ additionalProperties: boolean;
378
+ };
379
+ };
380
+ methods: {
381
+ lvpGeneratePresentation: {
382
+ description: string;
383
+ arguments: {
384
+ $ref: string;
385
+ };
386
+ returnType: {
387
+ $ref: string;
388
+ };
389
+ };
390
+ lvpGetServiceEntries: {
391
+ description: string;
392
+ arguments: {
393
+ $ref: string;
394
+ };
395
+ returnType: {
396
+ type: string;
397
+ items: {
398
+ $ref: string;
399
+ };
400
+ };
401
+ };
402
+ lvpHasEntry: {
403
+ description: string;
404
+ arguments: {
405
+ $ref: string;
406
+ };
407
+ returnType: {
408
+ type: string;
409
+ };
410
+ };
411
+ lvpPublishCredential: {
412
+ description: string;
413
+ arguments: {
414
+ $ref: string;
415
+ };
416
+ returnType: {
417
+ $ref: string;
418
+ };
419
+ };
420
+ lvpUnpublishCredential: {
421
+ description: string;
422
+ arguments: {
423
+ $ref: string;
424
+ };
425
+ returnType: {
426
+ type: string;
427
+ };
428
+ };
429
+ };
430
+ };
431
+ };
432
+ readonly methods: ILinkedVPManager;
433
+ private lvpPublishCredential;
434
+ private lvpUnpublishCredential;
435
+ private lvpHasEntry;
436
+ private lvpGetServiceEntries;
437
+ private lvpGeneratePresentation;
438
+ private getHolderDid;
439
+ private parseTenantFromLinkedVpId;
440
+ private generateLinkedVpId;
441
+ private ensureLinkedVpIdUnique;
442
+ private buildLinkedVpId;
443
+ private getBaseUrlFromDid;
444
+ private buildServiceEndpoint;
445
+ private credentialToServiceEntry;
446
+ }
447
+
448
+ export { type GeneratePresentationArgs, type GetServiceEntriesArgs, type HasLinkedVPEntryArgs, type ILinkedVPManager, LOGGER_NAMESPACE, type LinkedVPEntry, LinkedVPManager, type LinkedVPPresentation, type LinkedVPServiceEntry, type PublishCredentialArgs, type RequiredContext, type UnpublishCredentialArgs, linkedVPManagerMethods, plugin_schema as schema };