@sphereon/ssi-sdk.pd-manager 0.34.1-feature.FIDES.1.274 → 0.34.1-feature.IDK.11.48

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/dist/index.js CHANGED
@@ -1,1032 +1,1046 @@
1
1
  var __defProp = Object.defineProperty;
2
+ var __getOwnPropNames = Object.getOwnPropertyNames;
2
3
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
4
+ var __commonJS = (cb, mod) => function __require() {
5
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
6
+ };
3
7
 
4
8
  // plugin.schema.json
5
- var plugin_schema_default = {
6
- IPDManager: {
7
- components: {
8
- schemas: {
9
- DeleteDefinitionItemArgs: {
10
- type: "object",
11
- properties: {
12
- itemId: {
13
- type: "string"
14
- }
15
- },
16
- required: ["itemId"],
17
- additionalProperties: false
18
- },
19
- DeleteDefinitionItemsArgs: {
20
- $ref: "#/components/schemas/GetDefinitionItemsArgs"
21
- },
22
- GetDefinitionItemsArgs: {
23
- type: "object",
24
- properties: {
25
- filter: {
26
- $ref: "#/components/schemas/FindDefinitionArgs"
27
- },
28
- opts: {
29
- $ref: "#/components/schemas/FetchOptions"
30
- }
31
- },
32
- additionalProperties: false
33
- },
34
- FindDefinitionArgs: {
35
- type: "array",
36
- items: {
37
- $ref: "#/components/schemas/PresentationDefinitionItemFilter"
38
- }
39
- },
40
- PresentationDefinitionItemFilter: {
41
- $ref: '#/components/schemas/Partial<Omit<PresentationDefinitionItem,("queryPayload"|"dcqlPayload")>>'
42
- },
43
- 'Partial<Omit<PresentationDefinitionItem,("queryPayload"|"dcqlPayload")>>': {
44
- type: "object",
45
- properties: {
46
- id: {
47
- type: "string"
48
- },
49
- queryId: {
50
- type: "string"
51
- },
52
- tenantId: {
53
- type: "string"
54
- },
55
- version: {
56
- type: "string"
57
- },
58
- name: {
59
- type: "string"
60
- },
61
- purpose: {
62
- type: "string"
63
- },
64
- createdAt: {
65
- type: "string",
66
- format: "date-time"
67
- },
68
- lastUpdatedAt: {
69
- type: "string",
70
- format: "date-time"
71
- }
72
- },
73
- additionalProperties: false
74
- },
75
- FetchOptions: {
76
- type: "object",
77
- properties: {
78
- showVersionHistory: {
79
- type: "boolean"
80
- }
81
- },
82
- additionalProperties: false
83
- },
84
- GetDefinitionItemArgs: {
85
- type: "object",
86
- properties: {
87
- itemId: {
88
- type: "string"
89
- }
90
- },
91
- required: ["itemId"],
92
- additionalProperties: false
93
- },
94
- PresentationDefinitionItem: {
95
- type: "object",
96
- properties: {
97
- id: {
98
- type: "string"
99
- },
100
- queryId: {
101
- type: "string"
102
- },
103
- tenantId: {
104
- type: "string"
105
- },
106
- version: {
107
- type: "string"
108
- },
109
- name: {
110
- type: "string"
111
- },
112
- purpose: {
113
- type: "string"
114
- },
115
- dcqlPayload: {
116
- $ref: "#/components/schemas/DcqlQuery"
117
- },
118
- createdAt: {
119
- type: "string",
120
- format: "date-time"
121
- },
122
- lastUpdatedAt: {
123
- type: "string",
124
- format: "date-time"
125
- }
126
- },
127
- required: ["id", "queryId", "version", "query", "createdAt", "lastUpdatedAt"],
128
- additionalProperties: false
129
- },
130
- IPresentationDefinition: {
131
- anyOf: [
132
- {
133
- $ref: "#/components/schemas/PresentationDefinitionV1"
134
- },
135
- {
136
- $ref: "#/components/schemas/PresentationDefinitionV2"
137
- }
138
- ]
139
- },
140
- PresentationDefinitionV1: {
141
- type: "object",
142
- properties: {
143
- id: {
144
- type: "string"
145
- },
146
- name: {
147
- type: "string"
148
- },
149
- purpose: {
150
- type: "string"
151
- },
152
- format: {
153
- $ref: "#/components/schemas/Format"
154
- },
155
- submission_requirements: {
156
- type: "array",
157
- items: {
158
- $ref: "#/components/schemas/SubmissionRequirement"
159
- }
160
- },
161
- input_descriptors: {
9
+ var require_plugin_schema = __commonJS({
10
+ "plugin.schema.json"(exports, module) {
11
+ module.exports = {
12
+ IPDManager: {
13
+ components: {
14
+ schemas: {
15
+ DeleteDefinitionItemArgs: {
16
+ type: "object",
17
+ properties: {
18
+ itemId: {
19
+ type: "string"
20
+ }
21
+ },
22
+ required: ["itemId"],
23
+ additionalProperties: false
24
+ },
25
+ DeleteDefinitionItemsArgs: {
26
+ $ref: "#/components/schemas/GetDefinitionItemsArgs"
27
+ },
28
+ GetDefinitionItemsArgs: {
29
+ type: "object",
30
+ properties: {
31
+ filter: {
32
+ $ref: "#/components/schemas/FindDefinitionArgs"
33
+ },
34
+ opts: {
35
+ $ref: "#/components/schemas/FetchOptions"
36
+ }
37
+ },
38
+ additionalProperties: false
39
+ },
40
+ FindDefinitionArgs: {
162
41
  type: "array",
163
42
  items: {
164
- $ref: "#/components/schemas/InputDescriptorV1"
165
- }
166
- }
167
- },
168
- required: ["id", "input_descriptors"],
169
- additionalProperties: false
170
- },
171
- Format: {
172
- type: "object",
173
- properties: {
174
- jwt: {
175
- $ref: "#/components/schemas/JwtObject"
176
- },
177
- jwt_vc: {
178
- $ref: "#/components/schemas/JwtObject"
179
- },
180
- jwt_vc_json: {
181
- $ref: "#/components/schemas/JwtObject"
182
- },
183
- jwt_vp: {
184
- $ref: "#/components/schemas/JwtObject"
185
- },
186
- jwt_vp_json: {
187
- $ref: "#/components/schemas/JwtObject"
188
- },
189
- ldp: {
190
- $ref: "#/components/schemas/LdpObject"
191
- },
192
- ldp_vc: {
193
- $ref: "#/components/schemas/LdpObject"
194
- },
195
- ldp_vp: {
196
- $ref: "#/components/schemas/LdpObject"
197
- },
198
- di: {
199
- $ref: "#/components/schemas/DiObject"
200
- },
201
- di_vc: {
202
- $ref: "#/components/schemas/DiObject"
203
- },
204
- di_vp: {
205
- $ref: "#/components/schemas/DiObject"
206
- },
207
- "dc+sd-jwt": {
208
- $ref: "#/components/schemas/SdJwtObject"
209
- },
210
- mso_mdoc: {
211
- $ref: "#/components/schemas/MsoMdocObject"
212
- }
213
- },
214
- additionalProperties: false
215
- },
216
- JwtObject: {
217
- type: "object",
218
- properties: {
219
- alg: {
220
- type: "array",
221
- items: {
222
- type: "string"
223
- }
224
- }
225
- },
226
- required: ["alg"],
227
- additionalProperties: false
228
- },
229
- LdpObject: {
230
- type: "object",
231
- properties: {
232
- proof_type: {
233
- type: "array",
234
- items: {
235
- type: "string"
236
- }
237
- }
238
- },
239
- required: ["proof_type"],
240
- additionalProperties: false
241
- },
242
- DiObject: {
243
- type: "object",
244
- properties: {
245
- proof_type: {
246
- type: "array",
247
- items: {
248
- type: "string"
249
- }
250
- },
251
- cryptosuite: {
252
- type: "array",
253
- items: {
254
- type: "string"
255
- }
256
- }
257
- },
258
- required: ["proof_type", "cryptosuite"],
259
- additionalProperties: false
260
- },
261
- SdJwtObject: {
262
- type: "object",
263
- properties: {
264
- "sd-jwt_alg_values": {
265
- type: "array",
266
- items: {
267
- type: "string"
43
+ $ref: "#/components/schemas/PresentationDefinitionItemFilter"
268
44
  }
269
45
  },
270
- "kb-jwt_alg_values": {
271
- type: "array",
272
- items: {
273
- type: "string"
274
- }
275
- }
276
- },
277
- additionalProperties: false
278
- },
279
- MsoMdocObject: {
280
- type: "object",
281
- properties: {
282
- alg: {
283
- type: "array",
284
- items: {
285
- type: "string"
286
- }
287
- }
288
- },
289
- required: ["alg"],
290
- additionalProperties: false
291
- },
292
- SubmissionRequirement: {
293
- type: "object",
294
- properties: {
295
- name: {
296
- type: "string"
297
- },
298
- purpose: {
299
- type: "string"
300
- },
301
- rule: {
302
- $ref: "#/components/schemas/Rules"
303
- },
304
- count: {
305
- type: "number"
306
- },
307
- min: {
308
- type: "number"
309
- },
310
- max: {
311
- type: "number"
312
- },
313
- from: {
314
- type: "string"
315
- },
316
- from_nested: {
317
- type: "array",
318
- items: {
319
- $ref: "#/components/schemas/SubmissionRequirement"
320
- }
321
- }
322
- },
323
- required: ["rule"],
324
- additionalProperties: false
325
- },
326
- Rules: {
327
- type: "string",
328
- enum: ["all", "pick"]
329
- },
330
- InputDescriptorV1: {
331
- type: "object",
332
- properties: {
333
- id: {
334
- type: "string"
335
- },
336
- name: {
337
- type: "string"
338
- },
339
- purpose: {
340
- type: "string"
341
- },
342
- group: {
343
- type: "array",
344
- items: {
345
- type: "string"
346
- }
347
- },
348
- schema: {
349
- type: "array",
350
- items: {
351
- $ref: "#/components/schemas/Schema"
352
- }
353
- },
354
- issuance: {
355
- type: "array",
356
- items: {
357
- $ref: "#/components/schemas/Issuance"
358
- }
359
- },
360
- constraints: {
361
- $ref: "#/components/schemas/ConstraintsV1"
362
- }
363
- },
364
- required: ["id", "schema"],
365
- additionalProperties: false
366
- },
367
- Schema: {
368
- type: "object",
369
- properties: {
370
- uri: {
371
- type: "string"
372
- },
373
- required: {
374
- type: "boolean"
375
- }
376
- },
377
- required: ["uri"],
378
- additionalProperties: false
379
- },
380
- Issuance: {
381
- type: "object",
382
- properties: {
383
- manifest: {
384
- type: "string"
385
- }
386
- },
387
- additionalProperties: {}
388
- },
389
- ConstraintsV1: {
390
- type: "object",
391
- properties: {
392
- limit_disclosure: {
393
- $ref: "#/components/schemas/Optionality"
394
- },
395
- statuses: {
396
- $ref: "#/components/schemas/Statuses"
397
- },
398
- fields: {
399
- type: "array",
400
- items: {
401
- $ref: "#/components/schemas/FieldV1"
402
- }
403
- },
404
- subject_is_issuer: {
405
- $ref: "#/components/schemas/Optionality"
406
- },
407
- is_holder: {
408
- type: "array",
409
- items: {
410
- $ref: "#/components/schemas/HolderSubject"
411
- }
412
- },
413
- same_subject: {
414
- type: "array",
415
- items: {
416
- $ref: "#/components/schemas/HolderSubject"
417
- }
418
- }
419
- },
420
- additionalProperties: false
421
- },
422
- Optionality: {
423
- type: "string",
424
- enum: ["required", "preferred"]
425
- },
426
- Statuses: {
427
- type: "object",
428
- properties: {
429
- active: {
430
- $ref: "#/components/schemas/PdStatus"
431
- },
432
- suspended: {
433
- $ref: "#/components/schemas/PdStatus"
434
- },
435
- revoked: {
436
- $ref: "#/components/schemas/PdStatus"
437
- }
438
- },
439
- additionalProperties: false
440
- },
441
- PdStatus: {
442
- type: "object",
443
- properties: {
444
- directive: {
445
- $ref: "#/components/schemas/Directives"
446
- }
447
- },
448
- additionalProperties: false
449
- },
450
- Directives: {
451
- type: "string",
452
- enum: ["required", "allowed", "disallowed"]
453
- },
454
- FieldV1: {
455
- type: "object",
456
- properties: {
457
- id: {
458
- type: "string"
459
- },
460
- path: {
461
- type: "array",
462
- items: {
463
- type: "string"
464
- }
465
- },
466
- purpose: {
467
- type: "string"
468
- },
469
- filter: {
470
- $ref: "#/components/schemas/FilterV1"
471
- },
472
- predicate: {
473
- $ref: "#/components/schemas/Optionality"
474
- }
475
- },
476
- required: ["path"],
477
- additionalProperties: false
478
- },
479
- FilterV1: {
480
- type: "object",
481
- properties: {
482
- const: {
483
- $ref: "#/components/schemas/OneOfNumberStringBoolean"
484
- },
485
- enum: {
486
- type: "array",
487
- items: {
488
- $ref: "#/components/schemas/OneOfNumberStringBoolean"
489
- }
490
- },
491
- exclusiveMinimum: {
492
- $ref: "#/components/schemas/OneOfNumberString"
493
- },
494
- exclusiveMaximum: {
495
- $ref: "#/components/schemas/OneOfNumberString"
496
- },
497
- format: {
498
- type: "string"
499
- },
500
- minLength: {
501
- type: "number"
502
- },
503
- maxLength: {
504
- type: "number"
505
- },
506
- minimum: {
507
- $ref: "#/components/schemas/OneOfNumberString"
508
- },
509
- maximum: {
510
- $ref: "#/components/schemas/OneOfNumberString"
511
- },
512
- not: {
513
- type: "object"
514
- },
515
- pattern: {
516
- type: "string"
517
- },
518
- type: {
519
- type: "string"
520
- }
521
- },
522
- additionalProperties: false
523
- },
524
- OneOfNumberStringBoolean: {
525
- type: ["boolean", "number", "string"]
526
- },
527
- OneOfNumberString: {
528
- type: ["number", "string"]
529
- },
530
- HolderSubject: {
531
- type: "object",
532
- properties: {
533
- field_id: {
534
- type: "array",
535
- items: {
536
- type: "string"
537
- }
538
- },
539
- directive: {
540
- $ref: "#/components/schemas/Optionality"
541
- }
542
- },
543
- required: ["field_id", "directive"],
544
- additionalProperties: false
545
- },
546
- PresentationDefinitionV2: {
547
- type: "object",
548
- properties: {
549
- id: {
550
- type: "string"
551
- },
552
- name: {
553
- type: "string"
554
- },
555
- purpose: {
556
- type: "string"
557
- },
558
- format: {
559
- $ref: "#/components/schemas/Format"
560
- },
561
- submission_requirements: {
562
- type: "array",
563
- items: {
564
- $ref: "#/components/schemas/SubmissionRequirement"
565
- }
566
- },
567
- input_descriptors: {
568
- type: "array",
569
- items: {
570
- $ref: "#/components/schemas/InputDescriptorV2"
571
- }
572
- },
573
- frame: {
46
+ PresentationDefinitionItemFilter: {
47
+ $ref: '#/components/schemas/Partial<Omit<PresentationDefinitionItem,("definitionPayload"|"dcqlPayload")>>'
48
+ },
49
+ 'Partial<Omit<PresentationDefinitionItem,("definitionPayload"|"dcqlPayload")>>': {
50
+ type: "object",
51
+ properties: {
52
+ id: {
53
+ type: "string"
54
+ },
55
+ definitionId: {
56
+ type: "string"
57
+ },
58
+ tenantId: {
59
+ type: "string"
60
+ },
61
+ version: {
62
+ type: "string"
63
+ },
64
+ name: {
65
+ type: "string"
66
+ },
67
+ purpose: {
68
+ type: "string"
69
+ },
70
+ createdAt: {
71
+ type: "string",
72
+ format: "date-time"
73
+ },
74
+ lastUpdatedAt: {
75
+ type: "string",
76
+ format: "date-time"
77
+ }
78
+ },
79
+ additionalProperties: false
80
+ },
81
+ FetchOptions: {
82
+ type: "object",
83
+ properties: {
84
+ showVersionHistory: {
85
+ type: "boolean"
86
+ }
87
+ },
88
+ additionalProperties: false
89
+ },
90
+ GetDefinitionItemArgs: {
91
+ type: "object",
92
+ properties: {
93
+ itemId: {
94
+ type: "string"
95
+ }
96
+ },
97
+ required: ["itemId"],
98
+ additionalProperties: false
99
+ },
100
+ PresentationDefinitionItem: {
101
+ type: "object",
102
+ properties: {
103
+ id: {
104
+ type: "string"
105
+ },
106
+ definitionId: {
107
+ type: "string"
108
+ },
109
+ tenantId: {
110
+ type: "string"
111
+ },
112
+ version: {
113
+ type: "string"
114
+ },
115
+ name: {
116
+ type: "string"
117
+ },
118
+ purpose: {
119
+ type: "string"
120
+ },
121
+ definitionPayload: {
122
+ $ref: "#/components/schemas/IPresentationDefinition"
123
+ },
124
+ dcqlPayload: {
125
+ $ref: "#/components/schemas/DcqlQueryREST"
126
+ },
127
+ createdAt: {
128
+ type: "string",
129
+ format: "date-time"
130
+ },
131
+ lastUpdatedAt: {
132
+ type: "string",
133
+ format: "date-time"
134
+ }
135
+ },
136
+ required: ["id", "definitionId", "version", "definitionPayload", "createdAt", "lastUpdatedAt"],
137
+ additionalProperties: false
138
+ },
139
+ IPresentationDefinition: {
140
+ anyOf: [
141
+ {
142
+ $ref: "#/components/schemas/PresentationDefinitionV1"
143
+ },
144
+ {
145
+ $ref: "#/components/schemas/PresentationDefinitionV2"
146
+ }
147
+ ]
148
+ },
149
+ PresentationDefinitionV1: {
150
+ type: "object",
151
+ properties: {
152
+ id: {
153
+ type: "string"
154
+ },
155
+ name: {
156
+ type: "string"
157
+ },
158
+ purpose: {
159
+ type: "string"
160
+ },
161
+ format: {
162
+ $ref: "#/components/schemas/Format"
163
+ },
164
+ submission_requirements: {
165
+ type: "array",
166
+ items: {
167
+ $ref: "#/components/schemas/SubmissionRequirement"
168
+ }
169
+ },
170
+ input_descriptors: {
171
+ type: "array",
172
+ items: {
173
+ $ref: "#/components/schemas/InputDescriptorV1"
174
+ }
175
+ }
176
+ },
177
+ required: ["id", "input_descriptors"],
178
+ additionalProperties: false
179
+ },
180
+ Format: {
181
+ type: "object",
182
+ properties: {
183
+ jwt: {
184
+ $ref: "#/components/schemas/JwtObject"
185
+ },
186
+ jwt_vc: {
187
+ $ref: "#/components/schemas/JwtObject"
188
+ },
189
+ jwt_vc_json: {
190
+ $ref: "#/components/schemas/JwtObject"
191
+ },
192
+ jwt_vp: {
193
+ $ref: "#/components/schemas/JwtObject"
194
+ },
195
+ jwt_vp_json: {
196
+ $ref: "#/components/schemas/JwtObject"
197
+ },
198
+ ldp: {
199
+ $ref: "#/components/schemas/LdpObject"
200
+ },
201
+ ldp_vc: {
202
+ $ref: "#/components/schemas/LdpObject"
203
+ },
204
+ ldp_vp: {
205
+ $ref: "#/components/schemas/LdpObject"
206
+ },
207
+ di: {
208
+ $ref: "#/components/schemas/DiObject"
209
+ },
210
+ di_vc: {
211
+ $ref: "#/components/schemas/DiObject"
212
+ },
213
+ di_vp: {
214
+ $ref: "#/components/schemas/DiObject"
215
+ },
216
+ "vc+sd-jwt": {
217
+ $ref: "#/components/schemas/SdJwtObject"
218
+ },
219
+ mso_mdoc: {
220
+ $ref: "#/components/schemas/MsoMdocObject"
221
+ }
222
+ },
223
+ additionalProperties: false
224
+ },
225
+ JwtObject: {
226
+ type: "object",
227
+ properties: {
228
+ alg: {
229
+ type: "array",
230
+ items: {
231
+ type: "string"
232
+ }
233
+ }
234
+ },
235
+ required: ["alg"],
236
+ additionalProperties: false
237
+ },
238
+ LdpObject: {
239
+ type: "object",
240
+ properties: {
241
+ proof_type: {
242
+ type: "array",
243
+ items: {
244
+ type: "string"
245
+ }
246
+ }
247
+ },
248
+ required: ["proof_type"],
249
+ additionalProperties: false
250
+ },
251
+ DiObject: {
252
+ type: "object",
253
+ properties: {
254
+ proof_type: {
255
+ type: "array",
256
+ items: {
257
+ type: "string"
258
+ }
259
+ },
260
+ cryptosuite: {
261
+ type: "array",
262
+ items: {
263
+ type: "string"
264
+ }
265
+ }
266
+ },
267
+ required: ["proof_type", "cryptosuite"],
268
+ additionalProperties: false
269
+ },
270
+ SdJwtObject: {
271
+ type: "object",
272
+ properties: {
273
+ "sd-jwt_alg_values": {
274
+ type: "array",
275
+ items: {
276
+ type: "string"
277
+ }
278
+ },
279
+ "kb-jwt_alg_values": {
280
+ type: "array",
281
+ items: {
282
+ type: "string"
283
+ }
284
+ }
285
+ },
286
+ additionalProperties: false
287
+ },
288
+ MsoMdocObject: {
289
+ type: "object",
290
+ properties: {
291
+ alg: {
292
+ type: "array",
293
+ items: {
294
+ type: "string"
295
+ }
296
+ }
297
+ },
298
+ required: ["alg"],
299
+ additionalProperties: false
300
+ },
301
+ SubmissionRequirement: {
302
+ type: "object",
303
+ properties: {
304
+ name: {
305
+ type: "string"
306
+ },
307
+ purpose: {
308
+ type: "string"
309
+ },
310
+ rule: {
311
+ $ref: "#/components/schemas/Rules"
312
+ },
313
+ count: {
314
+ type: "number"
315
+ },
316
+ min: {
317
+ type: "number"
318
+ },
319
+ max: {
320
+ type: "number"
321
+ },
322
+ from: {
323
+ type: "string"
324
+ },
325
+ from_nested: {
326
+ type: "array",
327
+ items: {
328
+ $ref: "#/components/schemas/SubmissionRequirement"
329
+ }
330
+ }
331
+ },
332
+ required: ["rule"],
333
+ additionalProperties: false
334
+ },
335
+ Rules: {
336
+ type: "string",
337
+ enum: ["all", "pick"]
338
+ },
339
+ InputDescriptorV1: {
340
+ type: "object",
341
+ properties: {
342
+ id: {
343
+ type: "string"
344
+ },
345
+ name: {
346
+ type: "string"
347
+ },
348
+ purpose: {
349
+ type: "string"
350
+ },
351
+ group: {
352
+ type: "array",
353
+ items: {
354
+ type: "string"
355
+ }
356
+ },
357
+ schema: {
358
+ type: "array",
359
+ items: {
360
+ $ref: "#/components/schemas/Schema"
361
+ }
362
+ },
363
+ issuance: {
364
+ type: "array",
365
+ items: {
366
+ $ref: "#/components/schemas/Issuance"
367
+ }
368
+ },
369
+ constraints: {
370
+ $ref: "#/components/schemas/ConstraintsV1"
371
+ }
372
+ },
373
+ required: ["id", "schema"],
374
+ additionalProperties: false
375
+ },
376
+ Schema: {
377
+ type: "object",
378
+ properties: {
379
+ uri: {
380
+ type: "string"
381
+ },
382
+ required: {
383
+ type: "boolean"
384
+ }
385
+ },
386
+ required: ["uri"],
387
+ additionalProperties: false
388
+ },
389
+ Issuance: {
390
+ type: "object",
391
+ properties: {
392
+ manifest: {
393
+ type: "string"
394
+ }
395
+ },
396
+ additionalProperties: {}
397
+ },
398
+ ConstraintsV1: {
399
+ type: "object",
400
+ properties: {
401
+ limit_disclosure: {
402
+ $ref: "#/components/schemas/Optionality"
403
+ },
404
+ statuses: {
405
+ $ref: "#/components/schemas/Statuses"
406
+ },
407
+ fields: {
408
+ type: "array",
409
+ items: {
410
+ $ref: "#/components/schemas/FieldV1"
411
+ }
412
+ },
413
+ subject_is_issuer: {
414
+ $ref: "#/components/schemas/Optionality"
415
+ },
416
+ is_holder: {
417
+ type: "array",
418
+ items: {
419
+ $ref: "#/components/schemas/HolderSubject"
420
+ }
421
+ },
422
+ same_subject: {
423
+ type: "array",
424
+ items: {
425
+ $ref: "#/components/schemas/HolderSubject"
426
+ }
427
+ }
428
+ },
429
+ additionalProperties: false
430
+ },
431
+ Optionality: {
432
+ type: "string",
433
+ enum: ["required", "preferred"]
434
+ },
435
+ Statuses: {
436
+ type: "object",
437
+ properties: {
438
+ active: {
439
+ $ref: "#/components/schemas/PdStatus"
440
+ },
441
+ suspended: {
442
+ $ref: "#/components/schemas/PdStatus"
443
+ },
444
+ revoked: {
445
+ $ref: "#/components/schemas/PdStatus"
446
+ }
447
+ },
448
+ additionalProperties: false
449
+ },
450
+ PdStatus: {
451
+ type: "object",
452
+ properties: {
453
+ directive: {
454
+ $ref: "#/components/schemas/Directives"
455
+ }
456
+ },
457
+ additionalProperties: false
458
+ },
459
+ Directives: {
460
+ type: "string",
461
+ enum: ["required", "allowed", "disallowed"]
462
+ },
463
+ FieldV1: {
464
+ type: "object",
465
+ properties: {
466
+ id: {
467
+ type: "string"
468
+ },
469
+ path: {
470
+ type: "array",
471
+ items: {
472
+ type: "string"
473
+ }
474
+ },
475
+ purpose: {
476
+ type: "string"
477
+ },
478
+ filter: {
479
+ $ref: "#/components/schemas/FilterV1"
480
+ },
481
+ predicate: {
482
+ $ref: "#/components/schemas/Optionality"
483
+ }
484
+ },
485
+ required: ["path"],
486
+ additionalProperties: false
487
+ },
488
+ FilterV1: {
489
+ type: "object",
490
+ properties: {
491
+ const: {
492
+ $ref: "#/components/schemas/OneOfNumberStringBoolean"
493
+ },
494
+ enum: {
495
+ type: "array",
496
+ items: {
497
+ $ref: "#/components/schemas/OneOfNumberStringBoolean"
498
+ }
499
+ },
500
+ exclusiveMinimum: {
501
+ $ref: "#/components/schemas/OneOfNumberString"
502
+ },
503
+ exclusiveMaximum: {
504
+ $ref: "#/components/schemas/OneOfNumberString"
505
+ },
506
+ format: {
507
+ type: "string"
508
+ },
509
+ minLength: {
510
+ type: "number"
511
+ },
512
+ maxLength: {
513
+ type: "number"
514
+ },
515
+ minimum: {
516
+ $ref: "#/components/schemas/OneOfNumberString"
517
+ },
518
+ maximum: {
519
+ $ref: "#/components/schemas/OneOfNumberString"
520
+ },
521
+ not: {
522
+ type: "object"
523
+ },
524
+ pattern: {
525
+ type: "string"
526
+ },
527
+ type: {
528
+ type: "string"
529
+ }
530
+ },
531
+ additionalProperties: false
532
+ },
533
+ OneOfNumberStringBoolean: {
534
+ type: ["boolean", "number", "string"]
535
+ },
536
+ OneOfNumberString: {
537
+ type: ["number", "string"]
538
+ },
539
+ HolderSubject: {
540
+ type: "object",
541
+ properties: {
542
+ field_id: {
543
+ type: "array",
544
+ items: {
545
+ type: "string"
546
+ }
547
+ },
548
+ directive: {
549
+ $ref: "#/components/schemas/Optionality"
550
+ }
551
+ },
552
+ required: ["field_id", "directive"],
553
+ additionalProperties: false
554
+ },
555
+ PresentationDefinitionV2: {
556
+ type: "object",
557
+ properties: {
558
+ id: {
559
+ type: "string"
560
+ },
561
+ name: {
562
+ type: "string"
563
+ },
564
+ purpose: {
565
+ type: "string"
566
+ },
567
+ format: {
568
+ $ref: "#/components/schemas/Format"
569
+ },
570
+ submission_requirements: {
571
+ type: "array",
572
+ items: {
573
+ $ref: "#/components/schemas/SubmissionRequirement"
574
+ }
575
+ },
576
+ input_descriptors: {
577
+ type: "array",
578
+ items: {
579
+ $ref: "#/components/schemas/InputDescriptorV2"
580
+ }
581
+ },
582
+ frame: {
583
+ type: "object"
584
+ }
585
+ },
586
+ required: ["id", "input_descriptors"],
587
+ additionalProperties: false
588
+ },
589
+ InputDescriptorV2: {
590
+ type: "object",
591
+ properties: {
592
+ id: {
593
+ type: "string"
594
+ },
595
+ name: {
596
+ type: "string"
597
+ },
598
+ purpose: {
599
+ type: "string"
600
+ },
601
+ format: {
602
+ $ref: "#/components/schemas/Format"
603
+ },
604
+ group: {
605
+ type: "array",
606
+ items: {
607
+ type: "string"
608
+ }
609
+ },
610
+ issuance: {
611
+ type: "array",
612
+ items: {
613
+ $ref: "#/components/schemas/Issuance"
614
+ }
615
+ },
616
+ constraints: {
617
+ $ref: "#/components/schemas/ConstraintsV2"
618
+ }
619
+ },
620
+ required: ["id", "constraints"],
621
+ additionalProperties: false
622
+ },
623
+ ConstraintsV2: {
624
+ type: "object",
625
+ properties: {
626
+ limit_disclosure: {
627
+ $ref: "#/components/schemas/Optionality"
628
+ },
629
+ statuses: {
630
+ $ref: "#/components/schemas/Statuses"
631
+ },
632
+ fields: {
633
+ type: "array",
634
+ items: {
635
+ $ref: "#/components/schemas/FieldV2"
636
+ }
637
+ },
638
+ subject_is_issuer: {
639
+ $ref: "#/components/schemas/Optionality"
640
+ },
641
+ is_holder: {
642
+ type: "array",
643
+ items: {
644
+ $ref: "#/components/schemas/HolderSubject"
645
+ }
646
+ },
647
+ same_subject: {
648
+ type: "array",
649
+ items: {
650
+ $ref: "#/components/schemas/HolderSubject"
651
+ }
652
+ }
653
+ },
654
+ additionalProperties: false
655
+ },
656
+ FieldV2: {
657
+ type: "object",
658
+ properties: {
659
+ id: {
660
+ type: "string"
661
+ },
662
+ path: {
663
+ type: "array",
664
+ items: {
665
+ type: "string"
666
+ }
667
+ },
668
+ purpose: {
669
+ type: "string"
670
+ },
671
+ filter: {
672
+ $ref: "#/components/schemas/FilterV2"
673
+ },
674
+ predicate: {
675
+ $ref: "#/components/schemas/Optionality"
676
+ },
677
+ intent_to_retain: {
678
+ type: "boolean"
679
+ },
680
+ name: {
681
+ type: "string"
682
+ },
683
+ optional: {
684
+ type: "boolean"
685
+ }
686
+ },
687
+ required: ["path"],
688
+ additionalProperties: false
689
+ },
690
+ FilterV2: {
691
+ type: "object",
692
+ properties: {
693
+ const: {
694
+ $ref: "#/components/schemas/OneOfNumberStringBoolean"
695
+ },
696
+ enum: {
697
+ type: "array",
698
+ items: {
699
+ $ref: "#/components/schemas/OneOfNumberStringBoolean"
700
+ }
701
+ },
702
+ exclusiveMinimum: {
703
+ $ref: "#/components/schemas/OneOfNumberString"
704
+ },
705
+ exclusiveMaximum: {
706
+ $ref: "#/components/schemas/OneOfNumberString"
707
+ },
708
+ format: {
709
+ type: "string"
710
+ },
711
+ formatMaximum: {
712
+ type: "string"
713
+ },
714
+ formatMinimum: {
715
+ type: "string"
716
+ },
717
+ formatExclusiveMaximum: {
718
+ type: "string"
719
+ },
720
+ formatExclusiveMinimum: {
721
+ type: "string"
722
+ },
723
+ minLength: {
724
+ type: "number"
725
+ },
726
+ maxLength: {
727
+ type: "number"
728
+ },
729
+ minimum: {
730
+ $ref: "#/components/schemas/OneOfNumberString"
731
+ },
732
+ maximum: {
733
+ $ref: "#/components/schemas/OneOfNumberString"
734
+ },
735
+ not: {
736
+ type: "object"
737
+ },
738
+ pattern: {
739
+ type: "string"
740
+ },
741
+ type: {
742
+ type: "string"
743
+ },
744
+ contains: {
745
+ $ref: "#/components/schemas/FilterV2"
746
+ },
747
+ items: {
748
+ $ref: "#/components/schemas/FilterV2Items"
749
+ }
750
+ },
751
+ additionalProperties: false
752
+ },
753
+ FilterV2Items: {
754
+ type: "object",
755
+ properties: {
756
+ const: {
757
+ $ref: "#/components/schemas/OneOfNumberStringBoolean"
758
+ },
759
+ enum: {
760
+ type: "array",
761
+ items: {
762
+ $ref: "#/components/schemas/OneOfNumberStringBoolean"
763
+ }
764
+ },
765
+ exclusiveMinimum: {
766
+ $ref: "#/components/schemas/OneOfNumberString"
767
+ },
768
+ exclusiveMaximum: {
769
+ $ref: "#/components/schemas/OneOfNumberString"
770
+ },
771
+ format: {
772
+ type: "string"
773
+ },
774
+ formatMaximum: {
775
+ type: "string"
776
+ },
777
+ formatMinimum: {
778
+ type: "string"
779
+ },
780
+ formatExclusiveMaximum: {
781
+ type: "string"
782
+ },
783
+ formatExclusiveMinimum: {
784
+ type: "string"
785
+ },
786
+ minLength: {
787
+ type: "number"
788
+ },
789
+ maxLength: {
790
+ type: "number"
791
+ },
792
+ minimum: {
793
+ $ref: "#/components/schemas/OneOfNumberString"
794
+ },
795
+ maximum: {
796
+ $ref: "#/components/schemas/OneOfNumberString"
797
+ },
798
+ not: {
799
+ type: "object"
800
+ },
801
+ pattern: {
802
+ type: "string"
803
+ },
804
+ type: {
805
+ type: "string"
806
+ },
807
+ contains: {
808
+ $ref: "#/components/schemas/FilterV2"
809
+ },
810
+ items: {
811
+ $ref: "#/components/schemas/FilterV2Items"
812
+ }
813
+ },
814
+ additionalProperties: false
815
+ },
816
+ DcqlQueryREST: {
817
+ type: "object",
818
+ properties: {
819
+ credentials: {
820
+ type: "array",
821
+ items: {
822
+ $ref: "#/components/schemas/DcqlCredentialQuery"
823
+ }
824
+ }
825
+ },
826
+ required: ["credentials"],
827
+ additionalProperties: false
828
+ },
829
+ DcqlCredentialQuery: {
830
+ type: "object",
831
+ properties: {
832
+ id: {
833
+ type: "string"
834
+ },
835
+ format: {
836
+ type: "string"
837
+ },
838
+ alg: {
839
+ type: "array",
840
+ items: {
841
+ type: "string"
842
+ }
843
+ },
844
+ claims: {
845
+ type: "array",
846
+ items: {
847
+ $ref: "#/components/schemas/DcqlClaim"
848
+ }
849
+ },
850
+ meta: {
851
+ $ref: "#/components/schemas/Record<string,any>"
852
+ }
853
+ },
854
+ required: ["id", "format", "claims"],
855
+ additionalProperties: false
856
+ },
857
+ DcqlClaim: {
858
+ type: "object",
859
+ properties: {
860
+ namespace: {
861
+ type: "string"
862
+ },
863
+ claim_name: {
864
+ type: "string"
865
+ },
866
+ filter: {
867
+ $ref: "#/components/schemas/DcqlFilter"
868
+ }
869
+ },
870
+ required: ["namespace", "claim_name"],
871
+ additionalProperties: false
872
+ },
873
+ DcqlFilter: {
874
+ type: "object",
875
+ properties: {
876
+ type: {
877
+ type: "string",
878
+ enum: ["string", "number", "boolean"]
879
+ },
880
+ pattern: {
881
+ type: "string"
882
+ },
883
+ minimum: {
884
+ type: "number"
885
+ },
886
+ maximum: {
887
+ type: "number"
888
+ }
889
+ },
890
+ required: ["type"],
891
+ additionalProperties: false
892
+ },
893
+ "Record<string,any>": {
574
894
  type: "object"
575
- }
576
- },
577
- required: ["id", "input_descriptors"],
578
- additionalProperties: false
579
- },
580
- InputDescriptorV2: {
581
- type: "object",
582
- properties: {
583
- id: {
584
- type: "string"
585
895
  },
586
- name: {
587
- type: "string"
588
- },
589
- purpose: {
590
- type: "string"
591
- },
592
- format: {
593
- $ref: "#/components/schemas/Format"
594
- },
595
- group: {
596
- type: "array",
597
- items: {
598
- type: "string"
599
- }
600
- },
601
- issuance: {
602
- type: "array",
603
- items: {
604
- $ref: "#/components/schemas/Issuance"
605
- }
896
+ HasDefinitionItemArgs: {
897
+ $ref: "#/components/schemas/GetDefinitionItemArgs"
898
+ },
899
+ HasDefinitionItemsArgs: {
900
+ $ref: "#/components/schemas/GetDefinitionItemsArgs"
901
+ },
902
+ PersistDefinitionArgs: {
903
+ type: "object",
904
+ properties: {
905
+ definitionItem: {
906
+ $ref: "#/components/schemas/PersistPresentationDefinitionItem"
907
+ },
908
+ opts: {
909
+ $ref: "#/components/schemas/PersistOptions"
910
+ }
911
+ },
912
+ required: ["definitionItem"],
913
+ additionalProperties: false
914
+ },
915
+ PersistPresentationDefinitionItem: {
916
+ type: "object",
917
+ additionalProperties: false,
918
+ properties: {
919
+ id: {
920
+ type: "string"
921
+ },
922
+ definitionId: {
923
+ type: "string"
924
+ },
925
+ version: {
926
+ type: "string"
927
+ },
928
+ tenantId: {
929
+ type: "string"
930
+ },
931
+ name: {
932
+ type: "string"
933
+ },
934
+ purpose: {
935
+ type: "string"
936
+ },
937
+ definitionPayload: {
938
+ $ref: "#/components/schemas/IPresentationDefinition"
939
+ },
940
+ dcqlPayload: {
941
+ $ref: "#/components/schemas/DcqlQueryREST"
942
+ }
943
+ },
944
+ required: ["definitionPayload"]
945
+ },
946
+ PersistOptions: {
947
+ type: "object",
948
+ properties: {
949
+ versionControlMode: {
950
+ $ref: "#/components/schemas/VersionControlMode"
951
+ },
952
+ versionIncrementReleaseType: {
953
+ $ref: "#/components/schemas/ReleaseType"
954
+ }
955
+ },
956
+ additionalProperties: false
957
+ },
958
+ VersionControlMode: {
959
+ type: "string",
960
+ enum: ["AutoIncrement", "Manual", "Overwrite", "OverwriteLatest"]
606
961
  },
607
- constraints: {
608
- $ref: "#/components/schemas/ConstraintsV2"
962
+ ReleaseType: {
963
+ type: "string",
964
+ enum: ["major", "premajor", "minor", "preminor", "patch", "prepatch", "prerelease", "release"]
609
965
  }
610
966
  },
611
- required: ["id", "constraints"],
612
- additionalProperties: false
613
- },
614
- ConstraintsV2: {
615
- type: "object",
616
- properties: {
617
- limit_disclosure: {
618
- $ref: "#/components/schemas/Optionality"
619
- },
620
- statuses: {
621
- $ref: "#/components/schemas/Statuses"
622
- },
623
- fields: {
624
- type: "array",
625
- items: {
626
- $ref: "#/components/schemas/FieldV2"
967
+ methods: {
968
+ pdmDeleteDefinition: {
969
+ description: "Delete a single presentation definition records by primary key",
970
+ arguments: {
971
+ $ref: "#/components/schemas/DeleteDefinitionItemArgs"
972
+ },
973
+ returnType: {
974
+ type: "boolean"
627
975
  }
628
976
  },
629
- subject_is_issuer: {
630
- $ref: "#/components/schemas/Optionality"
631
- },
632
- is_holder: {
633
- type: "array",
634
- items: {
635
- $ref: "#/components/schemas/HolderSubject"
977
+ pdmDeleteDefinitions: {
978
+ description: "Delete multiple presentation definitions records using filters",
979
+ arguments: {
980
+ $ref: "#/components/schemas/DeleteDefinitionItemsArgs"
981
+ },
982
+ returnType: {
983
+ type: "number"
636
984
  }
637
985
  },
638
- same_subject: {
639
- type: "array",
640
- items: {
641
- $ref: "#/components/schemas/HolderSubject"
986
+ pdmGetDefinition: {
987
+ description: "Get a single presentation definition records by primary key",
988
+ arguments: {
989
+ $ref: "#/components/schemas/GetDefinitionItemArgs"
990
+ },
991
+ returnType: {
992
+ $ref: "#/components/schemas/PresentationDefinitionItem"
642
993
  }
643
- }
644
- },
645
- additionalProperties: false
646
- },
647
- FieldV2: {
648
- type: "object",
649
- properties: {
650
- id: {
651
- type: "string"
652
- },
653
- path: {
654
- type: "array",
655
- items: {
656
- type: "string"
657
- }
658
- },
659
- purpose: {
660
- type: "string"
661
- },
662
- filter: {
663
- $ref: "#/components/schemas/FilterV2"
664
- },
665
- predicate: {
666
- $ref: "#/components/schemas/Optionality"
667
- },
668
- intent_to_retain: {
669
- type: "boolean"
670
- },
671
- name: {
672
- type: "string"
673
- },
674
- optional: {
675
- type: "boolean"
676
- }
677
- },
678
- required: ["path"],
679
- additionalProperties: false
680
- },
681
- FilterV2: {
682
- type: "object",
683
- properties: {
684
- const: {
685
- $ref: "#/components/schemas/OneOfNumberStringBoolean"
686
994
  },
687
- enum: {
688
- type: "array",
689
- items: {
690
- $ref: "#/components/schemas/OneOfNumberStringBoolean"
995
+ pdmGetDefinitions: {
996
+ description: "Find one or more presentation definition records using filters",
997
+ arguments: {
998
+ $ref: "#/components/schemas/GetDefinitionItemsArgs"
999
+ },
1000
+ returnType: {
1001
+ type: "array",
1002
+ items: {
1003
+ $ref: "#/components/schemas/PresentationDefinitionItem"
1004
+ }
691
1005
  }
692
1006
  },
693
- exclusiveMinimum: {
694
- $ref: "#/components/schemas/OneOfNumberString"
695
- },
696
- exclusiveMaximum: {
697
- $ref: "#/components/schemas/OneOfNumberString"
698
- },
699
- format: {
700
- type: "string"
701
- },
702
- formatMaximum: {
703
- type: "string"
704
- },
705
- formatMinimum: {
706
- type: "string"
707
- },
708
- formatExclusiveMaximum: {
709
- type: "string"
710
- },
711
- formatExclusiveMinimum: {
712
- type: "string"
713
- },
714
- minLength: {
715
- type: "number"
716
- },
717
- maxLength: {
718
- type: "number"
719
- },
720
- minimum: {
721
- $ref: "#/components/schemas/OneOfNumberString"
722
- },
723
- maximum: {
724
- $ref: "#/components/schemas/OneOfNumberString"
725
- },
726
- not: {
727
- type: "object"
728
- },
729
- pattern: {
730
- type: "string"
731
- },
732
- type: {
733
- type: "string"
734
- },
735
- contains: {
736
- $ref: "#/components/schemas/FilterV2"
737
- },
738
- items: {
739
- $ref: "#/components/schemas/FilterV2Items"
740
- }
741
- },
742
- additionalProperties: false
743
- },
744
- FilterV2Items: {
745
- type: "object",
746
- properties: {
747
- const: {
748
- $ref: "#/components/schemas/OneOfNumberStringBoolean"
749
- },
750
- enum: {
751
- type: "array",
752
- items: {
753
- $ref: "#/components/schemas/OneOfNumberStringBoolean"
754
- }
755
- },
756
- exclusiveMinimum: {
757
- $ref: "#/components/schemas/OneOfNumberString"
758
- },
759
- exclusiveMaximum: {
760
- $ref: "#/components/schemas/OneOfNumberString"
761
- },
762
- format: {
763
- type: "string"
764
- },
765
- formatMaximum: {
766
- type: "string"
767
- },
768
- formatMinimum: {
769
- type: "string"
770
- },
771
- formatExclusiveMaximum: {
772
- type: "string"
773
- },
774
- formatExclusiveMinimum: {
775
- type: "string"
776
- },
777
- minLength: {
778
- type: "number"
779
- },
780
- maxLength: {
781
- type: "number"
782
- },
783
- minimum: {
784
- $ref: "#/components/schemas/OneOfNumberString"
785
- },
786
- maximum: {
787
- $ref: "#/components/schemas/OneOfNumberString"
788
- },
789
- not: {
790
- type: "object"
791
- },
792
- pattern: {
793
- type: "string"
794
- },
795
- type: {
796
- type: "string"
797
- },
798
- contains: {
799
- $ref: "#/components/schemas/FilterV2"
800
- },
801
- items: {
802
- $ref: "#/components/schemas/FilterV2Items"
803
- }
804
- },
805
- additionalProperties: false
806
- },
807
- DcqlQuery: {
808
- type: "object",
809
- properties: {
810
- credentials: {
811
- type: "array",
812
- items: {
813
- $ref: "#/components/schemas/DcqlCredentialQuery"
1007
+ pdmHasDefinition: {
1008
+ description: "Checks whether a presentation definition record exists by primary key",
1009
+ arguments: {
1010
+ $ref: "#/components/schemas/HasDefinitionItemArgs"
1011
+ },
1012
+ returnType: {
1013
+ type: "boolean"
814
1014
  }
815
- }
816
- },
817
- required: ["credentials"],
818
- additionalProperties: false
819
- },
820
- DcqlCredentialQuery: {
821
- type: "object",
822
- properties: {
823
- id: {
824
- type: "string"
825
1015
  },
826
- format: {
827
- type: "string"
828
- },
829
- alg: {
830
- type: "array",
831
- items: {
832
- type: "string"
1016
+ pdmHasDefinitions: {
1017
+ description: "Checks whether one or more presentation definition records exist using filters",
1018
+ arguments: {
1019
+ $ref: "#/components/schemas/HasDefinitionItemsArgs"
1020
+ },
1021
+ returnType: {
1022
+ type: "boolean"
833
1023
  }
834
1024
  },
835
- claims: {
836
- type: "array",
837
- items: {
838
- $ref: "#/components/schemas/DcqlClaim"
1025
+ pdmPersistDefinition: {
1026
+ description: "Check in a presentation definition. It has version control logic which will add or update presentation definition records and has settings for automatic version numbering.",
1027
+ arguments: {
1028
+ $ref: "#/components/schemas/PersistDefinitionArgs"
1029
+ },
1030
+ returnType: {
1031
+ $ref: "#/components/schemas/PresentationDefinitionItem"
839
1032
  }
840
- },
841
- meta: {
842
- $ref: "#/components/schemas/Record<string,any>"
843
- }
844
- },
845
- required: ["id", "format", "claims"],
846
- additionalProperties: false
847
- },
848
- DcqlClaim: {
849
- type: "object",
850
- properties: {
851
- namespace: {
852
- type: "string"
853
- },
854
- claim_name: {
855
- type: "string"
856
- },
857
- filter: {
858
- $ref: "#/components/schemas/DcqlFilter"
859
- }
860
- },
861
- required: ["namespace", "claim_name"],
862
- additionalProperties: false
863
- },
864
- DcqlFilter: {
865
- type: "object",
866
- properties: {
867
- type: {
868
- type: "string",
869
- enum: ["string", "number", "boolean"]
870
- },
871
- pattern: {
872
- type: "string"
873
- },
874
- minimum: {
875
- type: "number"
876
- },
877
- maximum: {
878
- type: "number"
879
- }
880
- },
881
- required: ["type"],
882
- additionalProperties: false
883
- },
884
- "Record<string,any>": {
885
- type: "object"
886
- },
887
- HasDefinitionItemArgs: {
888
- $ref: "#/components/schemas/GetDefinitionItemArgs"
889
- },
890
- HasDefinitionItemsArgs: {
891
- $ref: "#/components/schemas/GetDefinitionItemsArgs"
892
- },
893
- PersistDefinitionArgs: {
894
- type: "object",
895
- properties: {
896
- queryItem: {
897
- $ref: "#/components/schemas/PersistPresentationDefinitionItem"
898
- },
899
- opts: {
900
- $ref: "#/components/schemas/PersistOptions"
901
- }
902
- },
903
- required: ["queryItem"],
904
- additionalProperties: false
905
- },
906
- PersistPresentationDefinitionItem: {
907
- type: "object",
908
- additionalProperties: false,
909
- properties: {
910
- id: {
911
- type: "string"
912
- },
913
- queryId: {
914
- type: "string"
915
- },
916
- version: {
917
- type: "string"
918
- },
919
- tenantId: {
920
- type: "string"
921
- },
922
- name: {
923
- type: "string"
924
- },
925
- purpose: {
926
- type: "string"
927
- },
928
- dcqlPayload: {
929
- $ref: "#/components/schemas/DcqlQuery"
930
1033
  }
931
- },
932
- required: ["queryPayload"]
933
- },
934
- PersistOptions: {
935
- type: "object",
936
- properties: {
937
- versionControlMode: {
938
- $ref: "#/components/schemas/VersionControlMode"
939
- },
940
- versionIncrementReleaseType: {
941
- $ref: "#/components/schemas/ReleaseType"
942
- }
943
- },
944
- additionalProperties: false
945
- },
946
- VersionControlMode: {
947
- type: "string",
948
- enum: ["AutoIncrement", "Manual", "Overwrite", "OverwriteLatest"]
949
- },
950
- ReleaseType: {
951
- type: "string",
952
- enum: ["major", "premajor", "minor", "preminor", "patch", "prepatch", "prerelease", "release"]
953
- }
954
- },
955
- methods: {
956
- pdmDeleteDefinition: {
957
- description: "Delete a single presentation query records by primary key",
958
- arguments: {
959
- $ref: "#/components/schemas/DeleteDefinitionItemArgs"
960
- },
961
- returnType: {
962
- type: "boolean"
963
- }
964
- },
965
- pdmDeleteDefinitions: {
966
- description: "Delete multiple presentation querys records using filters",
967
- arguments: {
968
- $ref: "#/components/schemas/DeleteDefinitionItemsArgs"
969
- },
970
- returnType: {
971
- type: "number"
972
- }
973
- },
974
- pdmGetDefinition: {
975
- description: "Get a single presentation query records by primary key",
976
- arguments: {
977
- $ref: "#/components/schemas/GetDefinitionItemArgs"
978
- },
979
- returnType: {
980
- $ref: "#/components/schemas/PresentationDefinitionItem"
981
- }
982
- },
983
- pdmGetDefinitions: {
984
- description: "Find one or more presentation query records using filters",
985
- arguments: {
986
- $ref: "#/components/schemas/GetDefinitionItemsArgs"
987
- },
988
- returnType: {
989
- type: "array",
990
- items: {
991
- $ref: "#/components/schemas/PresentationDefinitionItem"
992
- }
993
- }
994
- },
995
- pdmHasDefinition: {
996
- description: "Checks whether a presentation query record exists by primary key",
997
- arguments: {
998
- $ref: "#/components/schemas/HasDefinitionItemArgs"
999
- },
1000
- returnType: {
1001
- type: "boolean"
1002
- }
1003
- },
1004
- pdmHasDefinitions: {
1005
- description: "Checks whether one or more presentation query records exist using filters",
1006
- arguments: {
1007
- $ref: "#/components/schemas/HasDefinitionItemsArgs"
1008
- },
1009
- returnType: {
1010
- type: "boolean"
1011
- }
1012
- },
1013
- pdmPersistDefinition: {
1014
- description: "Check in a presentation query. It has version control logic which will add or update presentation query records and has settings for automatic version numbering.",
1015
- arguments: {
1016
- $ref: "#/components/schemas/PersistDefinitionArgs"
1017
- },
1018
- returnType: {
1019
- $ref: "#/components/schemas/PresentationDefinitionItem"
1020
1034
  }
1021
1035
  }
1022
1036
  }
1023
- }
1037
+ };
1024
1038
  }
1025
- };
1039
+ });
1026
1040
 
1027
1041
  // src/agent/PDManager.ts
1028
1042
  import { isPresentationDefinitionEqual } from "@sphereon/ssi-sdk.data-store";
1029
- import semver from "semver/preload.js";
1043
+ import semver from "semver/preload";
1030
1044
  var pdManagerMethods = [
1031
1045
  "pdmHasDefinition",
1032
1046
  "pdmHasGetDefinitions",
@@ -1040,7 +1054,7 @@ var PDManager = class {
1040
1054
  static {
1041
1055
  __name(this, "PDManager");
1042
1056
  }
1043
- schema = plugin_schema_default.IPDManager;
1057
+ schema = schema.IPDManager;
1044
1058
  methods = {
1045
1059
  pdmPersistDefinition: this.pdmPersistDefinition.bind(this),
1046
1060
  pdmHasDefinition: this.pdmHasDefinition.bind(this),
@@ -1084,10 +1098,10 @@ var PDManager = class {
1084
1098
  let definitions = [];
1085
1099
  if (opts == void 0 || opts.showVersionHistory !== true) {
1086
1100
  const groupedByDefinitionId = allDefinitions.reduce((acc, entity) => {
1087
- if (!acc[entity.queryId]) {
1088
- acc[entity.queryId] = [];
1101
+ if (!acc[entity.definitionId]) {
1102
+ acc[entity.definitionId] = [];
1089
1103
  }
1090
- acc[entity.queryId].push(entity);
1104
+ acc[entity.definitionId].push(entity);
1091
1105
  return acc;
1092
1106
  }, {});
1093
1107
  definitions = Object.values(groupedByDefinitionId).map((entities) => entities.reduce((highestVersionItem, baseItem) => {
@@ -1110,99 +1124,89 @@ var PDManager = class {
1110
1124
  }
1111
1125
  /** {@inheritDoc IPDManager.pdmPersistDefinition} */
1112
1126
  async pdmPersistDefinition(args) {
1113
- try {
1114
- const { definitionItem, opts } = args;
1115
- const { versionControlMode, versionIncrementReleaseType } = opts ?? {
1116
- versionControlMode: "AutoIncrement"
1117
- };
1118
- const { version, tenantId } = definitionItem;
1119
- const definitionId = definitionItem.queryId;
1120
- let { id } = definitionItem;
1121
- if (id !== void 0 && versionControlMode !== "Overwrite") {
1122
- id = void 0;
1123
- }
1124
- const nonPersistedDefinitionItem = {
1125
- ...definitionItem,
1126
- version: version ?? "1"
1127
- };
1128
- const existing = await this.store.getDefinitions({
1129
- filter: [
1130
- {
1131
- id,
1132
- queryId: definitionId,
1133
- tenantId,
1134
- version
1135
- }
1136
- ]
1137
- });
1138
- const existingItem = existing[0];
1139
- const allDefinitions = await this.store.getDefinitions({
1140
- filter: [
1141
- {
1142
- queryId: definitionId,
1143
- tenantId
1144
- }
1145
- ]
1146
- });
1147
- allDefinitions.sort((a, b) => semver.compare(this.normalizeToSemverVersionFormat(a.version), this.normalizeToSemverVersionFormat(b.version)));
1148
- const trulyLatestVersionItem = allDefinitions[allDefinitions.length - 1];
1149
- let latestVersionItem = trulyLatestVersionItem;
1150
- if (existingItem && version) {
1151
- latestVersionItem = trulyLatestVersionItem ?? existingItem;
1152
- }
1153
- const isPayloadModified = !existingItem || !isPresentationDefinitionEqual(existingItem, definitionItem);
1154
- if (!isPayloadModified) return existingItem;
1155
- switch (versionControlMode) {
1156
- case "Overwrite":
1157
- return this.handleOverwriteMode(existingItem, nonPersistedDefinitionItem, version);
1158
- case "OverwriteLatest":
1159
- return this.handleOverwriteLatestMode(latestVersionItem, nonPersistedDefinitionItem);
1160
- case "Manual":
1161
- return this.handleManualMode(existingItem, nonPersistedDefinitionItem, tenantId, version);
1162
- case "AutoIncrement":
1163
- return this.handleAutoIncrementMode(latestVersionItem, nonPersistedDefinitionItem, versionIncrementReleaseType ?? "major");
1164
- default:
1165
- throw new Error(`Unknown version control mode: ${versionControlMode}`);
1166
- }
1167
- } catch (e) {
1168
- console.log("pdmPersistDefinition failed", e);
1169
- throw e;
1127
+ const { definitionItem, opts } = args;
1128
+ const { versionControlMode, versionIncrementReleaseType } = opts ?? {
1129
+ versionControlMode: "AutoIncrement"
1130
+ };
1131
+ const { version, tenantId } = definitionItem;
1132
+ const definitionId = definitionItem.definitionId ?? definitionItem.definitionPayload.id;
1133
+ let { id } = definitionItem;
1134
+ if (id !== void 0 && versionControlMode !== "Overwrite") {
1135
+ id = void 0;
1136
+ }
1137
+ const nonPersistedDefinitionItem = {
1138
+ ...definitionItem,
1139
+ definitionId,
1140
+ version: version ?? "1"
1141
+ };
1142
+ const existing = await this.store.getDefinitions({
1143
+ filter: [
1144
+ {
1145
+ id,
1146
+ definitionId,
1147
+ tenantId,
1148
+ version
1149
+ }
1150
+ ]
1151
+ });
1152
+ const existingItem = existing[0];
1153
+ const allDefinitions = await this.store.getDefinitions({
1154
+ filter: [
1155
+ {
1156
+ definitionId,
1157
+ tenantId
1158
+ }
1159
+ ]
1160
+ });
1161
+ allDefinitions.sort((a, b) => semver.compare(this.normalizeToSemverVersionFormat(a.version), this.normalizeToSemverVersionFormat(b.version)));
1162
+ const trulyLatestVersionItem = allDefinitions[allDefinitions.length - 1];
1163
+ let latestVersionItem = trulyLatestVersionItem;
1164
+ if (existingItem && version) {
1165
+ latestVersionItem = trulyLatestVersionItem ?? existingItem;
1166
+ }
1167
+ const isPayloadModified = !existingItem || !isPresentationDefinitionEqual(existingItem, definitionItem);
1168
+ if (!isPayloadModified) return existingItem;
1169
+ switch (versionControlMode) {
1170
+ case "Overwrite":
1171
+ return this.handleOverwriteMode(existingItem, nonPersistedDefinitionItem, version);
1172
+ case "OverwriteLatest":
1173
+ return this.handleOverwriteLatestMode(latestVersionItem, nonPersistedDefinitionItem);
1174
+ case "Manual":
1175
+ return this.handleManualMode(existingItem, nonPersistedDefinitionItem, tenantId, version);
1176
+ case "AutoIncrement":
1177
+ return this.handleAutoIncrementMode(latestVersionItem, nonPersistedDefinitionItem, versionIncrementReleaseType ?? "major");
1178
+ default:
1179
+ throw new Error(`Unknown version control mode: ${versionControlMode}`);
1170
1180
  }
1171
1181
  }
1172
1182
  async handleOverwriteMode(existingItem, definitionItem, version) {
1173
1183
  if (existingItem) {
1174
- existingItem.queryId = definitionItem.queryId;
1184
+ existingItem.definitionId = definitionItem.definitionId;
1175
1185
  existingItem.version = version ?? existingItem.version ?? "1";
1176
1186
  existingItem.tenantId = definitionItem.tenantId;
1177
- existingItem.name = definitionItem.name;
1178
- existingItem.purpose = definitionItem.purpose;
1179
- existingItem.query = definitionItem.query;
1187
+ existingItem.name = definitionItem.definitionPayload.name ?? definitionItem.name;
1188
+ existingItem.purpose = definitionItem.definitionPayload.purpose ?? definitionItem.purpose;
1189
+ existingItem.definitionPayload = definitionItem.definitionPayload;
1180
1190
  return await this.store.updateDefinition(existingItem);
1181
1191
  } else {
1182
- const newDefinitionItem = {
1183
- ...definitionItem
1184
- };
1185
- return await this.store.addDefinition(newDefinitionItem);
1192
+ return await this.store.addDefinition(definitionItem);
1186
1193
  }
1187
1194
  }
1188
1195
  async handleOverwriteLatestMode(latestVersionItem, definitionItem) {
1189
1196
  if (latestVersionItem) {
1190
- latestVersionItem.queryId = definitionItem.queryId;
1197
+ latestVersionItem.definitionId = definitionItem.definitionId;
1191
1198
  latestVersionItem.tenantId = definitionItem.tenantId;
1192
1199
  latestVersionItem.name = definitionItem.name;
1193
1200
  latestVersionItem.purpose = definitionItem.purpose;
1194
- latestVersionItem.query = definitionItem.query;
1201
+ latestVersionItem.definitionPayload = definitionItem.definitionPayload;
1195
1202
  return await this.store.updateDefinition(latestVersionItem);
1196
1203
  } else {
1197
- const newDefinitionItem = {
1198
- ...definitionItem
1199
- };
1200
- return await this.store.addDefinition(newDefinitionItem);
1204
+ return await this.store.addDefinition(definitionItem);
1201
1205
  }
1202
1206
  }
1203
1207
  async handleManualMode(existingItem, definitionItem, tenantId, version) {
1204
1208
  if (existingItem && !isPresentationDefinitionEqual(existingItem, definitionItem)) {
1205
- throw Error(`Cannot update definition ${definitionItem.queryId} for tenant ${tenantId} version ${version} because definition exists and manual version control is enabled.`);
1209
+ throw Error(`Cannot update definition ${definitionItem.definitionId} for tenant ${tenantId} version ${version} because definition exists and manual version control is enabled.`);
1206
1210
  } else {
1207
1211
  return await this.store.addDefinition(definitionItem);
1208
1212
  }
@@ -1218,7 +1222,7 @@ var PDManager = class {
1218
1222
  let normalizedBaseVersion = semver.coerce(baseVersion)?.version ?? `${defaultVersion}.0.0`;
1219
1223
  let preReleaseIdentifier = preReleaseSuffix ? preReleaseSuffix.match(/^[a-zA-Z]+/)?.[0] : void 0;
1220
1224
  let fullVersionToIncrement = preReleaseIdentifier ? `${normalizedBaseVersion}-${preReleaseSuffix}` : normalizedBaseVersion;
1221
- let incrementedVersion = semver.inc(fullVersionToIncrement, releaseType, void 0, preReleaseIdentifier);
1225
+ let incrementedVersion = semver.inc(fullVersionToIncrement, releaseType, preReleaseIdentifier);
1222
1226
  if (!incrementedVersion) {
1223
1227
  throw new Error(`Could not increment ${releaseType} version on ${currentVersion} ${preReleaseSuffix}`);
1224
1228
  }
@@ -1233,17 +1237,8 @@ var PDManager = class {
1233
1237
  resultVersion += `-${incrementedSuffix}`;
1234
1238
  }
1235
1239
  }
1236
- const newDefinitionItem = {
1237
- ...definitionItem,
1238
- version: resultVersion
1239
- };
1240
- try {
1241
- const dcqlQueryItem = await this.store.addDefinition(newDefinitionItem);
1242
- return dcqlQueryItem;
1243
- } catch (e) {
1244
- console.log(e);
1245
- throw e;
1246
- }
1240
+ definitionItem.version = resultVersion;
1241
+ return await this.store.addDefinition(definitionItem);
1247
1242
  }
1248
1243
  normalizeToSemverVersionFormat(version) {
1249
1244
  const defaultVersion = "1.0.0";
@@ -1255,9 +1250,14 @@ var PDManager = class {
1255
1250
  return normalizedBaseVersion;
1256
1251
  }
1257
1252
  };
1253
+
1254
+ // src/index.ts
1255
+ import { ReleaseType } from "semver";
1256
+ var schema = require_plugin_schema();
1258
1257
  export {
1259
1258
  PDManager,
1259
+ ReleaseType,
1260
1260
  pdManagerMethods,
1261
- plugin_schema_default as schema
1261
+ schema
1262
1262
  };
1263
1263
  //# sourceMappingURL=index.js.map