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