@sphereon/ssi-sdk.issuance-branding 0.33.1-feature.vcdm2.tsup.32 → 0.33.1-next.2

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,1492 +1,27 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropNames = Object.getOwnPropertyNames;
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
- };
7
-
8
- // plugin.schema.json
9
- var require_plugin_schema = __commonJS({
10
- "plugin.schema.json"(exports, module) {
11
- module.exports = {
12
- IIssuanceBranding: {
13
- components: {
14
- schemas: {
15
- IAddCredentialBrandingArgs: {
16
- type: "object",
17
- properties: {
18
- issuerCorrelationId: {
19
- type: "string"
20
- },
21
- vcHash: {
22
- type: "string"
23
- },
24
- localeBranding: {
25
- type: "array",
26
- items: {
27
- $ref: "#/components/schemas/IBasicCredentialLocaleBranding"
28
- }
29
- }
30
- },
31
- required: [
32
- "issuerCorrelationId",
33
- "vcHash",
34
- "localeBranding"
35
- ]
36
- },
37
- IBasicCredentialLocaleBranding: {
38
- type: "object",
39
- properties: {
40
- alias: {},
41
- locale: {},
42
- description: {},
43
- logo: {
44
- $ref: "#/components/schemas/IBasicImageAttributes"
45
- },
46
- background: {
47
- $ref: "#/components/schemas/IBasicBackgroundAttributes"
48
- },
49
- text: {
50
- $ref: "#/components/schemas/IBasicTextAttributes"
51
- },
52
- claims: {
53
- type: "array",
54
- items: {
55
- $ref: "#/components/schemas/IBasicCredentialClaim"
56
- }
57
- }
58
- },
59
- required: [
60
- "alias",
61
- "description",
62
- "locale"
63
- ]
64
- },
65
- IBasicImageAttributes: {
66
- type: "object",
67
- properties: {
68
- uri: {
69
- type: "string"
70
- },
71
- dataUri: {
72
- type: "string"
73
- },
74
- mediaType: {
75
- type: "string"
76
- },
77
- alt: {
78
- type: "string"
79
- },
80
- dimensions: {
81
- $ref: "#/components/schemas/IBasicImageDimensions"
82
- }
83
- }
84
- },
85
- IBasicImageDimensions: {
86
- type: "object",
87
- properties: {
88
- width: {
89
- type: "number"
90
- },
91
- height: {
92
- type: "number"
93
- }
94
- },
95
- required: [
96
- "height",
97
- "width"
98
- ]
99
- },
100
- IBasicBackgroundAttributes: {
101
- type: "object",
102
- properties: {
103
- color: {
104
- type: "string"
105
- },
106
- image: {
107
- $ref: "#/components/schemas/IBasicImageAttributes"
108
- }
109
- }
110
- },
111
- IBasicTextAttributes: {
112
- type: "object",
113
- properties: {
114
- color: {
115
- type: "string"
116
- }
117
- }
118
- },
119
- IBasicCredentialClaim: {
120
- type: "object",
121
- properties: {
122
- key: {
123
- type: "string"
124
- },
125
- name: {
126
- type: "string"
127
- }
128
- },
129
- required: [
130
- "key",
131
- "name"
132
- ]
133
- },
134
- ICredentialBranding: {
135
- type: "object",
136
- properties: {
137
- id: {
138
- type: "string"
139
- },
140
- issuerCorrelationId: {
141
- type: "string"
142
- },
143
- vcHash: {
144
- type: "string"
145
- },
146
- localeBranding: {
147
- type: "array",
148
- items: {
149
- $ref: "#/components/schemas/ICredentialLocaleBranding"
150
- }
151
- },
152
- createdAt: {
153
- type: "string",
154
- format: "date-time"
155
- },
156
- lastUpdatedAt: {
157
- type: "string",
158
- format: "date-time"
159
- }
160
- },
161
- required: [
162
- "id",
163
- "issuerCorrelationId",
164
- "vcHash",
165
- "localeBranding",
166
- "createdAt",
167
- "lastUpdatedAt"
168
- ]
169
- },
170
- ICredentialLocaleBranding: {
171
- type: "object",
172
- properties: {
173
- id: {
174
- type: "string"
175
- },
176
- alias: {
177
- type: "string"
178
- },
179
- locale: {
180
- type: "string"
181
- },
182
- logo: {
183
- $ref: "#/components/schemas/IImageAttributes"
184
- },
185
- description: {
186
- type: "string"
187
- },
188
- background: {
189
- $ref: "#/components/schemas/IBackgroundAttributes"
190
- },
191
- text: {
192
- $ref: "#/components/schemas/ITextAttributes"
193
- },
194
- createdAt: {
195
- type: "string",
196
- format: "date-time"
197
- },
198
- lastUpdatedAt: {
199
- type: "string",
200
- format: "date-time"
201
- },
202
- claims: {
203
- type: "array",
204
- items: {
205
- $ref: "#/components/schemas/ICredentialClaim"
206
- }
207
- }
208
- },
209
- required: [
210
- "createdAt",
211
- "id",
212
- "lastUpdatedAt"
213
- ]
214
- },
215
- IImageAttributes: {
216
- type: "object",
217
- properties: {
218
- id: {
219
- type: "string"
220
- },
221
- uri: {
222
- type: "string"
223
- },
224
- dataUri: {
225
- type: "string"
226
- },
227
- mediaType: {
228
- type: "string"
229
- },
230
- alt: {
231
- type: "string"
232
- },
233
- dimensions: {
234
- $ref: "#/components/schemas/IImageDimensions"
235
- }
236
- },
237
- required: [
238
- "id"
239
- ]
240
- },
241
- IImageDimensions: {
242
- type: "object",
243
- properties: {
244
- id: {
245
- type: "string"
246
- },
247
- width: {
248
- type: "number"
249
- },
250
- height: {
251
- type: "number"
252
- }
253
- },
254
- required: [
255
- "id",
256
- "width",
257
- "height"
258
- ]
259
- },
260
- IBackgroundAttributes: {
261
- type: "object",
262
- properties: {
263
- id: {
264
- type: "string"
265
- },
266
- color: {
267
- type: "string"
268
- },
269
- image: {
270
- $ref: "#/components/schemas/IImageAttributes"
271
- }
272
- },
273
- required: [
274
- "id"
275
- ]
276
- },
277
- ITextAttributes: {
278
- type: "object",
279
- properties: {
280
- id: {
281
- type: "string"
282
- },
283
- color: {
284
- type: "string"
285
- }
286
- },
287
- required: [
288
- "id"
289
- ]
290
- },
291
- ICredentialClaim: {
292
- type: "object",
293
- properties: {
294
- id: {
295
- type: "string"
296
- },
297
- key: {
298
- type: "string"
299
- },
300
- name: {
301
- type: "string"
302
- }
303
- },
304
- required: [
305
- "id",
306
- "key",
307
- "name"
308
- ]
309
- },
310
- IAddCredentialLocaleBrandingArgs: {
311
- type: "object",
312
- properties: {
313
- credentialBrandingId: {
314
- type: "string"
315
- },
316
- localeBranding: {
317
- type: "array",
318
- items: {
319
- $ref: "#/components/schemas/IBasicCredentialLocaleBranding"
320
- }
321
- }
322
- },
323
- required: [
324
- "credentialBrandingId",
325
- "localeBranding"
326
- ]
327
- },
328
- IAddIssuerBrandingArgs: {
329
- type: "object",
330
- properties: {
331
- issuerCorrelationId: {
332
- type: "string"
333
- },
334
- localeBranding: {
335
- type: "array",
336
- items: {
337
- $ref: "#/components/schemas/IBasicIssuerLocaleBranding"
338
- }
339
- }
340
- },
341
- required: [
342
- "issuerCorrelationId",
343
- "localeBranding"
344
- ]
345
- },
346
- IBasicIssuerLocaleBranding: {
347
- type: "object",
348
- properties: {
349
- clientUri: {
350
- type: "string"
351
- },
352
- tosUri: {
353
- type: "string"
354
- },
355
- policyUri: {
356
- type: "string"
357
- },
358
- contacts: {
359
- type: "array",
360
- items: {
361
- type: "string"
362
- }
363
- },
364
- alias: {},
365
- locale: {},
366
- description: {},
367
- logo: {
368
- $ref: "#/components/schemas/IBasicImageAttributes"
369
- },
370
- background: {
371
- $ref: "#/components/schemas/IBasicBackgroundAttributes"
372
- },
373
- text: {
374
- $ref: "#/components/schemas/IBasicTextAttributes"
375
- }
376
- },
377
- required: [
378
- "alias",
379
- "description",
380
- "locale"
381
- ]
382
- },
383
- IIssuerBranding: {
384
- type: "object",
385
- properties: {
386
- id: {
387
- type: "string"
388
- },
389
- issuerCorrelationId: {
390
- type: "string"
391
- },
392
- localeBranding: {
393
- type: "array",
394
- items: {
395
- $ref: "#/components/schemas/IIssuerLocaleBranding"
396
- }
397
- },
398
- createdAt: {
399
- type: "string",
400
- format: "date-time"
401
- },
402
- lastUpdatedAt: {
403
- type: "string",
404
- format: "date-time"
405
- }
406
- },
407
- required: [
408
- "id",
409
- "issuerCorrelationId",
410
- "localeBranding",
411
- "createdAt",
412
- "lastUpdatedAt"
413
- ]
414
- },
415
- IIssuerLocaleBranding: {
416
- type: "object",
417
- properties: {
418
- id: {
419
- type: "string"
420
- },
421
- alias: {
422
- type: "string"
423
- },
424
- locale: {
425
- type: "string"
426
- },
427
- logo: {
428
- $ref: "#/components/schemas/IImageAttributes"
429
- },
430
- description: {
431
- type: "string"
432
- },
433
- background: {
434
- $ref: "#/components/schemas/IBackgroundAttributes"
435
- },
436
- text: {
437
- $ref: "#/components/schemas/ITextAttributes"
438
- },
439
- createdAt: {
440
- type: "string",
441
- format: "date-time"
442
- },
443
- lastUpdatedAt: {
444
- type: "string",
445
- format: "date-time"
446
- },
447
- clientUri: {
448
- type: "string"
449
- },
450
- tosUri: {
451
- type: "string"
452
- },
453
- policyUri: {
454
- type: "string"
455
- },
456
- contacts: {
457
- type: "array",
458
- items: {
459
- type: "string"
460
- }
461
- }
462
- },
463
- required: [
464
- "createdAt",
465
- "id",
466
- "lastUpdatedAt"
467
- ]
468
- },
469
- IAddIssuerLocaleBrandingArgs: {
470
- type: "object",
471
- properties: {
472
- issuerBrandingId: {
473
- type: "string"
474
- },
475
- localeBranding: {
476
- type: "array",
477
- items: {
478
- $ref: "#/components/schemas/IBasicIssuerLocaleBranding"
479
- }
480
- }
481
- },
482
- required: [
483
- "issuerBrandingId",
484
- "localeBranding"
485
- ]
486
- },
487
- ICredentialBrandingFromArgs: {
488
- type: "object",
489
- properties: {
490
- localeBranding: {
491
- $ref: "#/components/schemas/IBasicCredentialLocaleBranding"
492
- }
493
- },
494
- required: [
495
- "localeBranding"
496
- ]
497
- },
498
- IGetCredentialBrandingArgs: {
499
- type: "object",
500
- properties: {
501
- filter: {
502
- $ref: "#/components/schemas/FindCredentialBrandingArgs"
503
- }
504
- }
505
- },
506
- FindCredentialBrandingArgs: {
507
- type: "array",
508
- items: {
509
- $ref: "#/components/schemas/ICredentialBrandingFilter"
510
- }
511
- },
512
- ICredentialBrandingFilter: {
513
- type: "object",
514
- properties: {
515
- id: {
516
- type: "string"
517
- },
518
- issuerCorrelationId: {
519
- type: "string"
520
- },
521
- vcHash: {
522
- type: "string"
523
- },
524
- createdAt: {
525
- type: "string",
526
- format: "date-time"
527
- },
528
- lastUpdatedAt: {
529
- type: "string",
530
- format: "date-time"
531
- },
532
- localeBranding: {
533
- $ref: "#/components/schemas/IPartialCredentialLocaleBranding"
534
- }
535
- }
536
- },
537
- IPartialCredentialLocaleBranding: {
538
- type: "object",
539
- properties: {
540
- id: {},
541
- alias: {},
542
- locale: {},
543
- description: {},
544
- createdAt: {},
545
- lastUpdatedAt: {},
546
- logo: {
547
- $ref: "#/components/schemas/IPartialImageAttributes"
548
- },
549
- background: {
550
- $ref: "#/components/schemas/IPartialBackgroundAttributes"
551
- },
552
- text: {
553
- $ref: "#/components/schemas/IPartialTextAttributes"
554
- },
555
- claims: {
556
- $ref: "#/components/schemas/IPartialCredentialClaim"
557
- }
558
- }
559
- },
560
- IPartialImageAttributes: {
561
- type: "object",
562
- properties: {
563
- id: {
564
- type: "string"
565
- },
566
- uri: {
567
- type: "string"
568
- },
569
- dataUri: {
570
- type: "string"
571
- },
572
- mediaType: {
573
- type: "string"
574
- },
575
- alt: {
576
- type: "string"
577
- },
578
- dimensions: {
579
- $ref: "#/components/schemas/IPartialImageDimensions"
580
- }
581
- }
582
- },
583
- IPartialImageDimensions: {
584
- type: "object",
585
- properties: {
586
- id: {
587
- type: "string"
588
- },
589
- width: {
590
- type: "number"
591
- },
592
- height: {
593
- type: "number"
594
- }
595
- }
596
- },
597
- IPartialBackgroundAttributes: {
598
- type: "object",
599
- properties: {
600
- id: {
601
- type: "string"
602
- },
603
- color: {
604
- type: "string"
605
- },
606
- image: {
607
- $ref: "#/components/schemas/IPartialImageAttributes"
608
- }
609
- }
610
- },
611
- IPartialTextAttributes: {
612
- type: "object",
613
- properties: {
614
- id: {
615
- type: "string"
616
- },
617
- color: {
618
- type: "string"
619
- }
620
- }
621
- },
622
- IPartialCredentialClaim: {
623
- type: "object",
624
- properties: {
625
- id: {
626
- type: "string"
627
- },
628
- key: {
629
- type: "string"
630
- },
631
- name: {
632
- type: "string"
633
- }
634
- }
635
- },
636
- IGetCredentialLocaleBrandingArgs: {
637
- type: "object",
638
- properties: {
639
- filter: {
640
- $ref: "#/components/schemas/FindCredentialLocaleBrandingArgs"
641
- }
642
- }
643
- },
644
- FindCredentialLocaleBrandingArgs: {
645
- type: "array",
646
- items: {
647
- $ref: "#/components/schemas/ICredentialLocaleBrandingFilter"
648
- }
649
- },
650
- ICredentialLocaleBrandingFilter: {
651
- type: "object",
652
- properties: {
653
- id: {},
654
- alias: {},
655
- locale: {},
656
- description: {},
657
- createdAt: {},
658
- lastUpdatedAt: {},
659
- logo: {
660
- $ref: "#/components/schemas/IPartialImageAttributes"
661
- },
662
- background: {
663
- $ref: "#/components/schemas/IPartialBackgroundAttributes"
664
- },
665
- text: {
666
- $ref: "#/components/schemas/IPartialTextAttributes"
667
- },
668
- claims: {
669
- $ref: "#/components/schemas/IPartialCredentialClaim"
670
- },
671
- credentialBranding: {
672
- $ref: "#/components/schemas/IPartialCredentialBranding"
673
- }
674
- }
675
- },
676
- IPartialCredentialBranding: {
677
- type: "object",
678
- properties: {
679
- id: {
680
- type: "string"
681
- },
682
- issuerCorrelationId: {
683
- type: "string"
684
- },
685
- vcHash: {
686
- type: "string"
687
- },
688
- createdAt: {
689
- type: "string",
690
- format: "date-time"
691
- },
692
- lastUpdatedAt: {
693
- type: "string",
694
- format: "date-time"
695
- },
696
- localeBranding: {
697
- $ref: "#/components/schemas/IPartialCredentialLocaleBranding"
698
- }
699
- }
700
- },
701
- IGetIssuerBrandingArgs: {
702
- type: "object",
703
- properties: {
704
- filter: {
705
- $ref: "#/components/schemas/FindIssuerBrandingArgs"
706
- }
707
- }
708
- },
709
- FindIssuerBrandingArgs: {
710
- type: "array",
711
- items: {
712
- $ref: "#/components/schemas/IIssuerBrandingFilter"
713
- }
714
- },
715
- IIssuerBrandingFilter: {
716
- type: "object",
717
- properties: {
718
- id: {
719
- type: "string"
720
- },
721
- issuerCorrelationId: {
722
- type: "string"
723
- },
724
- createdAt: {
725
- type: "string",
726
- format: "date-time"
727
- },
728
- lastUpdatedAt: {
729
- type: "string",
730
- format: "date-time"
731
- },
732
- localeBranding: {
733
- $ref: "#/components/schemas/IPartialIssuerLocaleBranding"
734
- }
735
- }
736
- },
737
- IPartialIssuerLocaleBranding: {
738
- type: "object",
739
- properties: {
740
- clientUri: {
741
- type: "string"
742
- },
743
- tosUri: {
744
- type: "string"
745
- },
746
- policyUri: {
747
- type: "string"
748
- },
749
- id: {},
750
- alias: {},
751
- locale: {},
752
- description: {},
753
- createdAt: {},
754
- lastUpdatedAt: {},
755
- logo: {
756
- $ref: "#/components/schemas/IPartialImageAttributes"
757
- },
758
- background: {
759
- $ref: "#/components/schemas/IPartialBackgroundAttributes"
760
- },
761
- text: {
762
- $ref: "#/components/schemas/IPartialTextAttributes"
763
- },
764
- contacts: {
765
- type: "string"
766
- }
767
- }
768
- },
769
- IGetIssuerLocaleBrandingArgs: {
770
- type: "object",
771
- properties: {
772
- filter: {
773
- $ref: "#/components/schemas/FindIssuerLocaleBrandingArgs"
774
- }
775
- }
776
- },
777
- FindIssuerLocaleBrandingArgs: {
778
- type: "array",
779
- items: {
780
- $ref: "#/components/schemas/IIssuerLocaleBrandingFilter"
781
- }
782
- },
783
- IIssuerLocaleBrandingFilter: {
784
- type: "object",
785
- properties: {
786
- clientUri: {
787
- type: "string"
788
- },
789
- tosUri: {
790
- type: "string"
791
- },
792
- policyUri: {
793
- type: "string"
794
- },
795
- id: {},
796
- alias: {},
797
- locale: {},
798
- description: {},
799
- createdAt: {},
800
- lastUpdatedAt: {},
801
- logo: {
802
- $ref: "#/components/schemas/IPartialImageAttributes"
803
- },
804
- background: {
805
- $ref: "#/components/schemas/IPartialBackgroundAttributes"
806
- },
807
- text: {
808
- $ref: "#/components/schemas/IPartialTextAttributes"
809
- },
810
- contacts: {
811
- type: "string"
812
- },
813
- issuerBranding: {
814
- $ref: "#/components/schemas/IPartialIssuerBranding"
815
- }
816
- }
817
- },
818
- IPartialIssuerBranding: {
819
- type: "object",
820
- properties: {
821
- id: {
822
- type: "string"
823
- },
824
- issuerCorrelationId: {
825
- type: "string"
826
- },
827
- createdAt: {
828
- type: "string",
829
- format: "date-time"
830
- },
831
- lastUpdatedAt: {
832
- type: "string",
833
- format: "date-time"
834
- },
835
- localeBranding: {
836
- $ref: "#/components/schemas/IPartialIssuerLocaleBranding"
837
- }
838
- }
839
- },
840
- IIssuerBrandingFromArgs: {
841
- type: "object",
842
- properties: {
843
- localeBranding: {
844
- $ref: "#/components/schemas/IBasicIssuerLocaleBranding"
845
- }
846
- },
847
- required: [
848
- "localeBranding"
849
- ]
850
- },
851
- IRemoveCredentialBrandingArgs: {
852
- type: "object",
853
- properties: {
854
- filter: {
855
- $ref: "#/components/schemas/FindCredentialBrandingArgs"
856
- }
857
- },
858
- required: [
859
- "filter"
860
- ]
861
- },
862
- IDeletionResult: {
863
- type: "object",
864
- properties: {
865
- result: {
866
- type: "boolean"
867
- },
868
- error: {
869
- type: "string"
870
- }
871
- },
872
- required: [
873
- "result"
874
- ]
875
- },
876
- IRemoveCredentialLocaleBrandingArgs: {
877
- type: "object",
878
- properties: {
879
- filter: {
880
- $ref: "#/components/schemas/FindCredentialLocaleBrandingArgs"
881
- }
882
- },
883
- required: [
884
- "filter"
885
- ]
886
- },
887
- IRemoveIssuerBrandingArgs: {
888
- type: "object",
889
- properties: {
890
- filter: {
891
- $ref: "#/components/schemas/FindIssuerBrandingArgs"
892
- }
893
- },
894
- required: [
895
- "filter"
896
- ]
897
- },
898
- IRemoveIssuerLocaleBrandingArgs: {
899
- type: "object",
900
- properties: {
901
- filter: {
902
- $ref: "#/components/schemas/FindIssuerLocaleBrandingArgs"
903
- }
904
- },
905
- required: [
906
- "filter"
907
- ]
908
- },
909
- IUpdateCredentialBrandingArgs: {
910
- type: "object",
911
- properties: {
912
- credentialBranding: {
913
- type: "object",
914
- properties: {
915
- id: {
916
- type: "string"
917
- },
918
- issuerCorrelationId: {
919
- type: "string"
920
- },
921
- vcHash: {
922
- type: "string"
923
- }
924
- },
925
- required: [
926
- "id",
927
- "issuerCorrelationId",
928
- "vcHash"
929
- ]
930
- }
931
- },
932
- required: [
933
- "credentialBranding"
934
- ]
935
- },
936
- IUpdateCredentialLocaleBrandingArgs: {
937
- type: "object",
938
- properties: {
939
- localeBranding: {
940
- type: "object",
941
- properties: {
942
- id: {
943
- type: "string"
944
- },
945
- alias: {
946
- type: "string"
947
- },
948
- locale: {
949
- type: "string"
950
- },
951
- logo: {
952
- $ref: "#/components/schemas/IImageAttributes"
953
- },
954
- description: {
955
- type: "string"
956
- },
957
- background: {
958
- $ref: "#/components/schemas/IBackgroundAttributes"
959
- },
960
- text: {
961
- $ref: "#/components/schemas/ITextAttributes"
962
- }
963
- },
964
- required: [
965
- "id"
966
- ]
967
- }
968
- },
969
- required: [
970
- "localeBranding"
971
- ]
972
- },
973
- IUpdateIssuerBrandingArgs: {
974
- type: "object",
975
- properties: {
976
- issuerBranding: {
977
- type: "object",
978
- properties: {
979
- id: {
980
- type: "string"
981
- },
982
- issuerCorrelationId: {
983
- type: "string"
984
- }
985
- },
986
- required: [
987
- "id",
988
- "issuerCorrelationId"
989
- ]
990
- }
991
- },
992
- required: [
993
- "issuerBranding"
994
- ]
995
- },
996
- IUpdateIssuerLocaleBrandingArgs: {
997
- type: "object",
998
- properties: {
999
- localeBranding: {
1000
- type: "object",
1001
- properties: {
1002
- id: {
1003
- type: "string"
1004
- },
1005
- alias: {
1006
- type: "string"
1007
- },
1008
- locale: {
1009
- type: "string"
1010
- },
1011
- logo: {
1012
- $ref: "#/components/schemas/IImageAttributes"
1013
- },
1014
- description: {
1015
- type: "string"
1016
- },
1017
- background: {
1018
- $ref: "#/components/schemas/IBackgroundAttributes"
1019
- },
1020
- text: {
1021
- $ref: "#/components/schemas/ITextAttributes"
1022
- }
1023
- },
1024
- required: [
1025
- "id"
1026
- ]
1027
- }
1028
- },
1029
- required: [
1030
- "localeBranding"
1031
- ]
1032
- }
1033
- },
1034
- methods: {
1035
- ibAddCredentialBranding: {
1036
- description: "",
1037
- arguments: {
1038
- $ref: "#/components/schemas/IAddCredentialBrandingArgs"
1039
- },
1040
- returnType: {
1041
- $ref: "#/components/schemas/ICredentialBranding"
1042
- }
1043
- },
1044
- ibAddCredentialLocaleBranding: {
1045
- description: "",
1046
- arguments: {
1047
- $ref: "#/components/schemas/IAddCredentialLocaleBrandingArgs"
1048
- },
1049
- returnType: {
1050
- $ref: "#/components/schemas/ICredentialBranding"
1051
- }
1052
- },
1053
- ibAddIssuerBranding: {
1054
- description: "",
1055
- arguments: {
1056
- $ref: "#/components/schemas/IAddIssuerBrandingArgs"
1057
- },
1058
- returnType: {
1059
- $ref: "#/components/schemas/IIssuerBranding"
1060
- }
1061
- },
1062
- ibAddIssuerLocaleBranding: {
1063
- description: "",
1064
- arguments: {
1065
- $ref: "#/components/schemas/IAddIssuerLocaleBrandingArgs"
1066
- },
1067
- returnType: {
1068
- $ref: "#/components/schemas/IIssuerBranding"
1069
- }
1070
- },
1071
- ibCredentialLocaleBrandingFrom: {
1072
- description: "",
1073
- arguments: {
1074
- $ref: "#/components/schemas/ICredentialBrandingFromArgs"
1075
- },
1076
- returnType: {
1077
- $ref: "#/components/schemas/IBasicCredentialLocaleBranding"
1078
- }
1079
- },
1080
- ibGetCredentialBranding: {
1081
- description: "",
1082
- arguments: {
1083
- $ref: "#/components/schemas/IGetCredentialBrandingArgs"
1084
- },
1085
- returnType: {
1086
- type: "array",
1087
- items: {
1088
- $ref: "#/components/schemas/ICredentialBranding"
1089
- }
1090
- }
1091
- },
1092
- ibGetCredentialLocaleBranding: {
1093
- description: "",
1094
- arguments: {
1095
- $ref: "#/components/schemas/IGetCredentialLocaleBrandingArgs"
1096
- },
1097
- returnType: {
1098
- type: "array",
1099
- items: {
1100
- $ref: "#/components/schemas/ICredentialLocaleBranding"
1101
- }
1102
- }
1103
- },
1104
- ibGetIssuerBranding: {
1105
- description: "",
1106
- arguments: {
1107
- $ref: "#/components/schemas/IGetIssuerBrandingArgs"
1108
- },
1109
- returnType: {
1110
- type: "array",
1111
- items: {
1112
- $ref: "#/components/schemas/IIssuerBranding"
1113
- }
1114
- }
1115
- },
1116
- ibGetIssuerLocaleBranding: {
1117
- description: "",
1118
- arguments: {
1119
- $ref: "#/components/schemas/IGetIssuerLocaleBrandingArgs"
1120
- },
1121
- returnType: {
1122
- type: "array",
1123
- items: {
1124
- $ref: "#/components/schemas/IIssuerLocaleBranding"
1125
- }
1126
- }
1127
- },
1128
- ibIssuerLocaleBrandingFrom: {
1129
- description: "",
1130
- arguments: {
1131
- $ref: "#/components/schemas/IIssuerBrandingFromArgs"
1132
- },
1133
- returnType: {
1134
- $ref: "#/components/schemas/IBasicIssuerLocaleBranding"
1135
- }
1136
- },
1137
- ibRemoveCredentialBranding: {
1138
- description: "",
1139
- arguments: {
1140
- $ref: "#/components/schemas/IRemoveCredentialBrandingArgs"
1141
- },
1142
- returnType: {
1143
- $ref: "#/components/schemas/IDeletionResult"
1144
- }
1145
- },
1146
- ibRemoveCredentialLocaleBranding: {
1147
- description: "",
1148
- arguments: {
1149
- $ref: "#/components/schemas/IRemoveCredentialLocaleBrandingArgs"
1150
- },
1151
- returnType: {
1152
- $ref: "#/components/schemas/IDeletionResult"
1153
- }
1154
- },
1155
- ibRemoveIssuerBranding: {
1156
- description: "",
1157
- arguments: {
1158
- $ref: "#/components/schemas/IRemoveIssuerBrandingArgs"
1159
- },
1160
- returnType: {
1161
- $ref: "#/components/schemas/IDeletionResult"
1162
- }
1163
- },
1164
- ibRemoveIssuerLocaleBranding: {
1165
- description: "",
1166
- arguments: {
1167
- $ref: "#/components/schemas/IRemoveIssuerLocaleBrandingArgs"
1168
- },
1169
- returnType: {
1170
- $ref: "#/components/schemas/IDeletionResult"
1171
- }
1172
- },
1173
- ibUpdateCredentialBranding: {
1174
- description: "",
1175
- arguments: {
1176
- $ref: "#/components/schemas/IUpdateCredentialBrandingArgs"
1177
- },
1178
- returnType: {
1179
- $ref: "#/components/schemas/ICredentialBranding"
1180
- }
1181
- },
1182
- ibUpdateCredentialLocaleBranding: {
1183
- description: "",
1184
- arguments: {
1185
- $ref: "#/components/schemas/IUpdateCredentialLocaleBrandingArgs"
1186
- },
1187
- returnType: {
1188
- $ref: "#/components/schemas/ICredentialLocaleBranding"
1189
- }
1190
- },
1191
- ibUpdateIssuerBranding: {
1192
- description: "",
1193
- arguments: {
1194
- $ref: "#/components/schemas/IUpdateIssuerBrandingArgs"
1195
- },
1196
- returnType: {
1197
- $ref: "#/components/schemas/IIssuerBranding"
1198
- }
1199
- },
1200
- ibUpdateIssuerLocaleBranding: {
1201
- description: "",
1202
- arguments: {
1203
- $ref: "#/components/schemas/IUpdateIssuerLocaleBrandingArgs"
1204
- },
1205
- returnType: {
1206
- $ref: "#/components/schemas/IIssuerLocaleBranding"
1207
- }
1208
- }
1209
- }
1210
- }
1211
- }
1212
- };
1213
- }
1214
- });
1215
-
1216
- // src/agent/IssuanceBranding.ts
1217
- import { downloadImage, getImageDimensions, getImageMediaType } from "@sphereon/ssi-sdk.core";
1218
- import Debug from "debug";
1219
- var debug = Debug("sphereon:ssi-sdk:issuance-branding");
1220
- var issuanceBrandingMethods = [
1221
- "ibAddCredentialBranding",
1222
- "ibGetCredentialBranding",
1223
- "ibUpdateCredentialBranding",
1224
- "ibRemoveCredentialBranding",
1225
- "ibAddCredentialLocaleBranding",
1226
- "ibGetCredentialLocaleBranding",
1227
- "ibRemoveCredentialLocaleBranding",
1228
- "ibUpdateCredentialLocaleBranding",
1229
- "ibCredentialLocaleBrandingFrom",
1230
- "ibAddIssuerBranding",
1231
- "ibGetIssuerBranding",
1232
- "ibUpdateIssuerBranding",
1233
- "ibRemoveIssuerBranding",
1234
- "ibAddIssuerLocaleBranding",
1235
- "ibGetIssuerLocaleBranding",
1236
- "ibRemoveIssuerLocaleBranding",
1237
- "ibUpdateIssuerLocaleBranding",
1238
- "ibIssuerLocaleBrandingFrom"
1239
- ];
1240
- var EMPTY_IMAGE_ATTRIBUTES = {
1241
- mediaType: void 0,
1242
- dataUri: void 0,
1243
- dimensions: void 0
1244
- };
1245
- var IssuanceBranding = class {
1246
- static {
1247
- __name(this, "IssuanceBranding");
1248
- }
1249
- schema = schema.IIssuanceBranding;
1250
- methods = {
1251
- ibAddCredentialBranding: this.ibAddCredentialBranding.bind(this),
1252
- ibGetCredentialBranding: this.ibGetCredentialBranding.bind(this),
1253
- ibUpdateCredentialBranding: this.ibUpdateCredentialBranding.bind(this),
1254
- ibRemoveCredentialBranding: this.ibRemoveCredentialBranding.bind(this),
1255
- ibAddCredentialLocaleBranding: this.ibAddCredentialLocaleBranding.bind(this),
1256
- ibGetCredentialLocaleBranding: this.ibGetCredentialLocaleBranding.bind(this),
1257
- ibRemoveCredentialLocaleBranding: this.ibRemoveCredentialLocaleBranding.bind(this),
1258
- ibUpdateCredentialLocaleBranding: this.ibUpdateCredentialLocaleBranding.bind(this),
1259
- ibCredentialLocaleBrandingFrom: this.ibCredentialLocaleBrandingFrom.bind(this),
1260
- ibAddIssuerBranding: this.ibAddIssuerBranding.bind(this),
1261
- ibGetIssuerBranding: this.ibGetIssuerBranding.bind(this),
1262
- ibUpdateIssuerBranding: this.ibUpdateIssuerBranding.bind(this),
1263
- ibRemoveIssuerBranding: this.inRemoveIssuerBranding.bind(this),
1264
- ibAddIssuerLocaleBranding: this.ibAddIssuerLocaleBranding.bind(this),
1265
- ibGetIssuerLocaleBranding: this.ibAGetIssuerLocaleBranding.bind(this),
1266
- ibRemoveIssuerLocaleBranding: this.ibRemoveIssuerLocaleBranding.bind(this),
1267
- ibUpdateIssuerLocaleBranding: this.ibUpdateIssuerLocaleBranding.bind(this),
1268
- ibIssuerLocaleBrandingFrom: this.ibIssuerLocaleBrandingFrom.bind(this)
1269
- };
1270
- store;
1271
- constructor(options) {
1272
- this.store = options.store;
1273
- }
1274
- /** {@inheritDoc IIssuanceBranding.ibAddCredentialBranding} */
1275
- async ibAddCredentialBranding(args, context) {
1276
- const localeBranding = await Promise.all(args.localeBranding.map((localeBranding2) => this.setAdditionalImageAttributes(localeBranding2)));
1277
- const credentialBranding = {
1278
- ...args,
1279
- localeBranding
1280
- };
1281
- debug("Adding credential branding", credentialBranding);
1282
- return this.store.addCredentialBranding(credentialBranding);
1283
- }
1284
- /** {@inheritDoc IIssuanceBranding.ibGetCredentialBranding} */
1285
- async ibGetCredentialBranding(args) {
1286
- debug("Getting credential branding", args);
1287
- return this.store.getCredentialBranding(args);
1288
- }
1289
- /** {@inheritDoc IIssuanceBranding.ibUpdateCredentialBranding} */
1290
- async ibUpdateCredentialBranding(args, context) {
1291
- debug("Updating credential branding", args);
1292
- return this.store.updateCredentialBranding(args);
1293
- }
1294
- /** {@inheritDoc IIssuanceBranding.ibRemoveCredentialBranding} */
1295
- async ibRemoveCredentialBranding(args, context) {
1296
- debug("Removing credential branding", args);
1297
- return this.store.removeCredentialBranding(args).then(() => ({
1298
- result: true
1299
- })).catch((error) => ({
1300
- result: false,
1301
- error: error.message
1302
- }));
1303
- }
1304
- /** {@inheritDoc IIssuanceBranding.ibAddCredentialLocaleBranding} */
1305
- async ibAddCredentialLocaleBranding(args, context) {
1306
- const localeBranding = await Promise.all(args.localeBranding.map((localeBranding2) => this.setAdditionalImageAttributes(localeBranding2)));
1307
- const addCredentialLocaleBrandingArgs = {
1308
- ...args,
1309
- localeBranding
1310
- };
1311
- debug("Adding credential locale branding", addCredentialLocaleBrandingArgs);
1312
- return this.store.addCredentialLocaleBranding(addCredentialLocaleBrandingArgs);
1313
- }
1314
- /** {@inheritDoc IIssuanceBranding.ibGetCredentialLocaleBranding} */
1315
- async ibGetCredentialLocaleBranding(args) {
1316
- debug("Getting credential locale branding", args);
1317
- return this.store.getCredentialLocaleBranding(args);
1318
- }
1319
- /** {@inheritDoc IIssuanceBranding.ibRemoveCredentialLocaleBranding} */
1320
- async ibRemoveCredentialLocaleBranding(args, context) {
1321
- debug("Removing credential locale branding", args);
1322
- return this.store.removeCredentialLocaleBranding(args).then(() => ({
1323
- result: true
1324
- })).catch((error) => ({
1325
- result: false,
1326
- error: error.message
1327
- }));
1328
- }
1329
- /** {@inheritDoc IIssuanceBranding.ibUpdateCredentialLocaleBranding} */
1330
- async ibUpdateCredentialLocaleBranding(args, context) {
1331
- const localeBranding = await this.setAdditionalImageAttributes(args.localeBranding);
1332
- const updateCredentialLocaleBrandingArgs = {
1333
- ...args,
1334
- localeBranding
1335
- };
1336
- debug("Updating credential locale branding", updateCredentialLocaleBrandingArgs);
1337
- return this.store.updateCredentialLocaleBranding(updateCredentialLocaleBrandingArgs);
1338
- }
1339
- /** {@inheritDoc IIssuanceBranding.ibCredentialLocaleBrandingFrom} */
1340
- async ibCredentialLocaleBrandingFrom(args, context) {
1341
- debug("get credential locale branding from", args);
1342
- return this.setAdditionalImageAttributes(args.localeBranding);
1343
- }
1344
- /** {@inheritDoc IIssuanceBranding.ibAddIssuerBranding} */
1345
- async ibAddIssuerBranding(args, context) {
1346
- const localeBranding = await Promise.all(args.localeBranding.map((localeBranding2) => this.setAdditionalImageAttributes(localeBranding2)));
1347
- const issuerBranding = {
1348
- ...args,
1349
- localeBranding
1350
- };
1351
- debug("Adding issuer branding", issuerBranding);
1352
- return this.store.addIssuerBranding(issuerBranding);
1353
- }
1354
- /** {@inheritDoc IIssuanceBranding.ibGetIssuerBranding} */
1355
- async ibGetIssuerBranding(args) {
1356
- debug("Getting issuer branding", args);
1357
- return this.store.getIssuerBranding(args);
1358
- }
1359
- /** {@inheritDoc IIssuanceBranding.ibUpdateIssuerBranding} */
1360
- async ibUpdateIssuerBranding(args, context) {
1361
- debug("Updating issuer branding", args);
1362
- return this.store.updateIssuerBranding(args);
1363
- }
1364
- /** {@inheritDoc IIssuanceBranding.inRemoveIssuerBranding} */
1365
- async inRemoveIssuerBranding(args, context) {
1366
- debug("Removing issuer branding", args);
1367
- return this.store.removeIssuerBranding(args).then(() => ({
1368
- result: true
1369
- })).catch((error) => ({
1370
- result: false,
1371
- error: error.message
1372
- }));
1373
- }
1374
- /** {@inheritDoc IIssuanceBranding.ibAddIssuerLocaleBranding} */
1375
- async ibAddIssuerLocaleBranding(args, context) {
1376
- const localeBranding = await Promise.all(args.localeBranding.map((localeBranding2) => this.setAdditionalImageAttributes(localeBranding2)));
1377
- const addIssuerLocaleBrandingArgs = {
1378
- ...args,
1379
- localeBranding
1380
- };
1381
- debug("Adding issuer locale branding", addIssuerLocaleBrandingArgs);
1382
- return this.store.addIssuerLocaleBranding(addIssuerLocaleBrandingArgs);
1383
- }
1384
- /** {@inheritDoc IIssuanceBranding.ibAGetIssuerLocaleBranding} */
1385
- async ibAGetIssuerLocaleBranding(args) {
1386
- debug("Getting issuer locale branding", args);
1387
- return this.store.getIssuerLocaleBranding(args);
1388
- }
1389
- /** {@inheritDoc IIssuanceBranding.ibRemoveIssuerLocaleBranding} */
1390
- async ibRemoveIssuerLocaleBranding(args, context) {
1391
- debug("Removing issuer locale branding", args);
1392
- return this.store.removeIssuerLocaleBranding(args).then(() => ({
1393
- result: true
1394
- })).catch((error) => ({
1395
- result: false,
1396
- error: error.message
1397
- }));
1398
- }
1399
- /** {@inheritDoc IIssuanceBranding.ibUpdateIssuerLocaleBranding} */
1400
- async ibUpdateIssuerLocaleBranding(args, context) {
1401
- const localeBranding = await this.setAdditionalImageAttributes(args.localeBranding);
1402
- const updateIssuerLocaleBrandingArgs = {
1403
- ...args,
1404
- localeBranding
1405
- };
1406
- debug("Updating issuer locale branding", updateIssuerLocaleBrandingArgs);
1407
- return this.store.updateIssuerLocaleBranding(updateIssuerLocaleBrandingArgs);
1408
- }
1409
- /** {@inheritDoc IIssuanceBranding.ibIssuerLocaleBrandingFrom} */
1410
- async ibIssuerLocaleBrandingFrom(args, context) {
1411
- debug("get issuer locale branding from", args);
1412
- return this.setAdditionalImageAttributes(args.localeBranding);
1413
- }
1414
- // todo: We really should add a cache for urls. We now fetch the same images multiple times in case the logo/background image is the same for multiple locales.
1415
- async setAdditionalImageAttributes(localeBranding) {
1416
- return {
1417
- ...localeBranding,
1418
- ...localeBranding.logo && {
1419
- logo: {
1420
- ...localeBranding.logo,
1421
- ...localeBranding.logo.uri ? {
1422
- ...await this.getAdditionalImageAttributes(localeBranding.logo)
1423
- } : EMPTY_IMAGE_ATTRIBUTES
1424
- }
1425
- },
1426
- ...localeBranding.background && {
1427
- background: {
1428
- ...localeBranding.background,
1429
- ...localeBranding.background.image && {
1430
- image: {
1431
- ...localeBranding.background.image,
1432
- ...localeBranding.background.image.uri ? {
1433
- ...await this.getAdditionalImageAttributes(localeBranding.background.image)
1434
- } : EMPTY_IMAGE_ATTRIBUTES
1435
- }
1436
- }
1437
- }
1438
- }
1439
- };
1440
- }
1441
- async getAdditionalImageAttributes(image) {
1442
- if (!image.uri) {
1443
- debug(`No image URI present, returning empty attributes`);
1444
- return EMPTY_IMAGE_ATTRIBUTES;
1445
- }
1446
- const data_uri_regex = /^data:image\/[^;]+;base64,/;
1447
- if (data_uri_regex.test(image.uri)) {
1448
- debug("Setting additional image properties for uri", image.uri);
1449
- const base64Content = await this.extractBase64FromDataURI(image.uri);
1450
- const dimensions2 = image.dimensions ?? await getImageDimensions(base64Content);
1451
- const mediaType2 = image.mediaType ?? await this.getDataTypeFromDataURI(image.uri);
1452
- return {
1453
- mediaType: mediaType2,
1454
- dimensions: dimensions2
1455
- };
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
1456
7
  }
1457
- debug("Setting additional image properties for url", image.uri);
1458
- const resource = !image.dataUri ? await downloadImage(image.uri) : void 0;
1459
- const dimensions = image.dimensions ?? await getImageDimensions(resource?.base64Content ?? await this.extractBase64FromDataURI(image.dataUri));
1460
- const mediaType = image.mediaType ?? resource?.contentType ?? (resource?.base64Content ? await getImageMediaType(resource?.base64Content) : await this.getDataTypeFromDataURI(image.uri));
1461
- return {
1462
- mediaType,
1463
- dataUri: image.dataUri ?? `data:${mediaType};base64,${resource.base64Content}`,
1464
- dimensions
1465
- };
1466
- }
1467
- async extractBase64FromDataURI(uri) {
1468
- const data_uri_base64_regex = /^data:[^;]+;base64,([\w+/=-]+)$/i;
1469
- const matches = uri.match(data_uri_base64_regex);
1470
- if (!matches || matches.length <= 1) {
1471
- return Promise.reject(Error("invalid base64 uri"));
1472
- }
1473
- return matches[1];
1474
- }
1475
- async getDataTypeFromDataURI(uri) {
1476
- const data_uri_data_type_regex = /^data:([^;]+);base64,([\w+/=-]+)$/i;
1477
- const matches = uri.match(data_uri_data_type_regex);
1478
- if (!matches || matches.length <= 1) {
1479
- return Promise.reject(Error("invalid base64 uri"));
1480
- }
1481
- return matches[1];
1482
- }
1483
- };
1484
-
1485
- // src/index.ts
1486
- var schema = require_plugin_schema();
1487
- export {
1488
- IssuanceBranding,
1489
- issuanceBrandingMethods,
1490
- schema
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1491
15
  };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.issuanceBrandingMethods = exports.IssuanceBranding = exports.schema = void 0;
18
+ /**
19
+ * @public
20
+ */
21
+ const schema = require('../plugin.schema.json');
22
+ exports.schema = schema;
23
+ var IssuanceBranding_1 = require("./agent/IssuanceBranding");
24
+ Object.defineProperty(exports, "IssuanceBranding", { enumerable: true, get: function () { return IssuanceBranding_1.IssuanceBranding; } });
25
+ Object.defineProperty(exports, "issuanceBrandingMethods", { enumerable: true, get: function () { return IssuanceBranding_1.issuanceBrandingMethods; } });
26
+ __exportStar(require("./types/IIssuanceBranding"), exports);
1492
27
  //# sourceMappingURL=index.js.map