@sphereon/oid4vci-common 0.8.1 → 0.8.2-next.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/functions/CredentialOfferUtil.d.ts +3 -0
  2. package/dist/functions/CredentialOfferUtil.d.ts.map +1 -1
  3. package/dist/functions/CredentialOfferUtil.js +29 -1
  4. package/dist/functions/CredentialOfferUtil.js.map +1 -1
  5. package/dist/functions/CredentialRequestUtil.d.ts +3 -2
  6. package/dist/functions/CredentialRequestUtil.d.ts.map +1 -1
  7. package/dist/functions/CredentialRequestUtil.js +26 -2
  8. package/dist/functions/CredentialRequestUtil.js.map +1 -1
  9. package/dist/functions/FormatUtils.d.ts +15 -0
  10. package/dist/functions/FormatUtils.d.ts.map +1 -0
  11. package/dist/functions/FormatUtils.js +44 -0
  12. package/dist/functions/FormatUtils.js.map +1 -0
  13. package/dist/functions/IssuerMetadataUtils.d.ts +3 -0
  14. package/dist/functions/IssuerMetadataUtils.d.ts.map +1 -1
  15. package/dist/functions/IssuerMetadataUtils.js +21 -4
  16. package/dist/functions/IssuerMetadataUtils.js.map +1 -1
  17. package/dist/functions/index.d.ts +1 -0
  18. package/dist/functions/index.d.ts.map +1 -1
  19. package/dist/functions/index.js +1 -0
  20. package/dist/functions/index.js.map +1 -1
  21. package/dist/types/Authorization.types.d.ts +14 -5
  22. package/dist/types/Authorization.types.d.ts.map +1 -1
  23. package/dist/types/Authorization.types.js.map +1 -1
  24. package/dist/types/Generic.types.d.ts +47 -17
  25. package/dist/types/Generic.types.d.ts.map +1 -1
  26. package/dist/types/Generic.types.js.map +1 -1
  27. package/dist/types/QRCode.types.d.ts +205 -0
  28. package/dist/types/QRCode.types.d.ts.map +1 -0
  29. package/dist/types/QRCode.types.js +5 -0
  30. package/dist/types/QRCode.types.js.map +1 -0
  31. package/dist/types/index.d.ts +1 -0
  32. package/dist/types/index.d.ts.map +1 -1
  33. package/dist/types/index.js +1 -0
  34. package/dist/types/index.js.map +1 -1
  35. package/dist/types/v1_0_08.types.d.ts +6 -2
  36. package/dist/types/v1_0_08.types.d.ts.map +1 -1
  37. package/dist/types/v1_0_11.types.d.ts +5 -15
  38. package/dist/types/v1_0_11.types.d.ts.map +1 -1
  39. package/dist/types/v1_0_11.types.js.map +1 -1
  40. package/lib/functions/CredentialOfferUtil.ts +27 -0
  41. package/lib/functions/CredentialRequestUtil.ts +31 -3
  42. package/lib/functions/FormatUtils.ts +52 -0
  43. package/lib/functions/IssuerMetadataUtils.ts +20 -3
  44. package/lib/functions/index.ts +1 -0
  45. package/lib/types/Authorization.types.ts +28 -5
  46. package/lib/types/Generic.types.ts +61 -15
  47. package/lib/types/QRCode.types.ts +227 -0
  48. package/lib/types/index.ts +1 -0
  49. package/lib/types/v1_0_08.types.ts +7 -2
  50. package/lib/types/v1_0_11.types.ts +8 -20
  51. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"Generic.types.d.ts","sourceRoot":"","sources":["../../lib/types/Generic.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAE7G,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,MAAM,uBAAuB,GAAG,aAAa,GAAG,gBAAgB,GAAG,QAAQ,CAAkB;AAEnG,MAAM,WAAW,aAAa;IAC5B,IAAI,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C"}
@@ -1 +1 @@
1
- {"version":3,"file":"Generic.types.js","sourceRoot":"","sources":["../../lib/types/Generic.types.ts"],"names":[],"mappings":";;;AAqMa,QAAA,qBAAqB,GAAG,qBAAqB,CAAC"}
1
+ {"version":3,"file":"Generic.types.js","sourceRoot":"","sources":["../../lib/types/Generic.types.ts"],"names":[],"mappings":";;;AAmPa,QAAA,qBAAqB,GAAG,qBAAqB,CAAC"}
@@ -0,0 +1,205 @@
1
+ /// <reference types="node" />
2
+ export interface ComponentOptions {
3
+ /**
4
+ * Component options for data/ECC.
5
+ */
6
+ data?: {
7
+ /**
8
+ * Scale factor for data/ECC dots.
9
+ * @default 1
10
+ */
11
+ scale?: number;
12
+ };
13
+ /**
14
+ * Component options for timing patterns.
15
+ */
16
+ timing?: {
17
+ /**
18
+ * Scale factor for timing patterns.
19
+ * @default 1
20
+ */
21
+ scale?: number;
22
+ /**
23
+ * Protector for timing patterns.
24
+ * @default false
25
+ */
26
+ protectors?: boolean;
27
+ };
28
+ /**
29
+ * Component options for alignment patterns.
30
+ */
31
+ alignment?: {
32
+ /**
33
+ * Scale factor for alignment patterns.
34
+ * @default 1
35
+ */
36
+ scale?: number;
37
+ /**
38
+ * Protector for alignment patterns.
39
+ * @default false
40
+ */
41
+ protectors?: boolean;
42
+ };
43
+ /**
44
+ * Component options for alignment pattern on the bottom-right corner.
45
+ */
46
+ cornerAlignment?: {
47
+ /**
48
+ * Scale factor for alignment pattern on the bottom-right corner.
49
+ * @default 1
50
+ */
51
+ scale?: number;
52
+ /**
53
+ * Protector for alignment pattern on the bottom-right corner.
54
+ * @default true
55
+ */
56
+ protectors?: boolean;
57
+ };
58
+ }
59
+ export interface QRCodeOpts {
60
+ /**
61
+ * Size of the QR code in pixel.
62
+ *
63
+ * @defaultValue 400
64
+ */
65
+ size?: number;
66
+ /**
67
+ * Size of margins around the QR code body in pixel.
68
+ *
69
+ * @defaultValue 20
70
+ */
71
+ margin?: number;
72
+ /**
73
+ * Error correction level of the QR code.
74
+ *
75
+ * Accepts a value provided by _QRErrorCorrectLevel_.
76
+ *
77
+ * For more information, please refer to [https://www.qrcode.com/en/about/error_correction.html](https://www.qrcode.com/en/about/error_correction.html).
78
+ *
79
+ * @defaultValue 0
80
+ */
81
+ correctLevel?: number;
82
+ /**
83
+ * **This is an advanced option.**
84
+ *
85
+ * Specify the mask pattern to be used in QR code encoding.
86
+ *
87
+ * Accepts a value provided by _QRMaskPattern_.
88
+ *
89
+ * To find out all eight mask patterns, please refer to [https://en.wikipedia.org/wiki/File:QR_Code_Mask_Patterns.svg](https://en.wikipedia.org/wiki/File:QR_Code_Mask_Patterns.svg)
90
+ *
91
+ * For more information, please refer to [https://en.wikiversity.org/wiki/Reed%E2%80%93Solomon_codes_for_coders#Masking](https://en.wikiversity.org/wiki/Reed%E2%80%93Solomon_codes_for_coders#Masking).
92
+ */
93
+ maskPattern?: number;
94
+ /**
95
+ * **This is an advanced option.**
96
+ *
97
+ * Specify the version to be used in QR code encoding.
98
+ *
99
+ * Accepts an integer in range [1, 40].
100
+ *
101
+ * For more information, please refer to [https://www.qrcode.com/en/about/version.html](https://www.qrcode.com/en/about/version.html).
102
+ */
103
+ version?: number;
104
+ /**
105
+ * Options to control components in the QR code.
106
+ *
107
+ * @deafultValue undefined
108
+ */
109
+ components?: ComponentOptions;
110
+ /**
111
+ * Color of the blocks on the QR code.
112
+ *
113
+ * Accepts a CSS &lt;color&gt;.
114
+ *
115
+ * For more information about CSS &lt;color&gt;, please refer to [https://developer.mozilla.org/en-US/docs/Web/CSS/color_value](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
116
+ *
117
+ * @defaultValue "#000000"
118
+ */
119
+ colorDark?: string;
120
+ /**
121
+ * Color of the empty areas on the QR code.
122
+ *
123
+ * Accepts a CSS &lt;color&gt;.
124
+ *
125
+ * For more information about CSS &lt;color&gt;, please refer to [https://developer.mozilla.org/en-US/docs/Web/CSS/color_value](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
126
+ *
127
+ * @defaultValue "#ffffff"
128
+ */
129
+ colorLight?: string;
130
+ /**
131
+ * Automatically calculate the _colorLight_ value from the QR code's background.
132
+ *
133
+ * @defaultValue true
134
+ */
135
+ autoColor?: boolean;
136
+ /**
137
+ * Background image to be used in the QR code.
138
+ *
139
+ * Accepts a `data:` string in web browsers or a Buffer in Node.js.
140
+ *
141
+ * @defaultValue undefined
142
+ */
143
+ backgroundImage?: string | Buffer;
144
+ /**
145
+ * Color of the dimming mask above the background image.
146
+ *
147
+ * Accepts a CSS &lt;color&gt;.
148
+ *
149
+ * For more information about CSS &lt;color&gt;, please refer to [https://developer.mozilla.org/en-US/docs/Web/CSS/color_value](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
150
+ *
151
+ * @defaultValue "rgba(0, 0, 0, 0)"
152
+ */
153
+ backgroundDimming?: string;
154
+ /**
155
+ * GIF background image to be used in the QR code.
156
+ *
157
+ * @defaultValue undefined
158
+ */
159
+ gifBackground?: ArrayBuffer;
160
+ /**
161
+ * Use a white margin instead of a transparent one which reveals the background of the QR code on margins.
162
+ *
163
+ * @defaultValue true
164
+ */
165
+ whiteMargin?: boolean;
166
+ /**
167
+ * Logo image to be displayed at the center of the QR code.
168
+ *
169
+ * Accepts a `data:` string in web browsers or a Buffer in Node.js.
170
+ *
171
+ * When set to `undefined` or `null`, the logo is disabled.
172
+ *
173
+ * @defaultValue undefined
174
+ */
175
+ logoImage?: string | Buffer;
176
+ /**
177
+ * Ratio of the logo size to the QR code size.
178
+ *
179
+ * @defaultValue 0.2
180
+ */
181
+ logoScale?: number;
182
+ /**
183
+ * Size of margins around the logo image in pixels.
184
+ *
185
+ * @defaultValue 6
186
+ */
187
+ logoMargin?: number;
188
+ /**
189
+ * Corner radius of the logo image in pixels.
190
+ *
191
+ * @defaultValue 8
192
+ */
193
+ logoCornerRadius?: number;
194
+ /**
195
+ * @deprecated
196
+ *
197
+ * Ratio of the real size to the full size of the blocks.
198
+ *
199
+ * This can be helpful when you want to make more parts of the background visible.
200
+ *
201
+ * @deafultValue 0.4
202
+ */
203
+ dotScale?: number;
204
+ }
205
+ //# sourceMappingURL=QRCode.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QRCode.types.d.ts","sourceRoot":"","sources":["../../lib/types/QRCode.types.ts"],"names":[],"mappings":";AAAA,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,IAAI,CAAC,EAAE;QACL;;;WAGG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IAEF;;OAEG;IACH,MAAM,CAAC,EAAE;QACP;;;WAGG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;QAEf;;;WAGG;QACH,UAAU,CAAC,EAAE,OAAO,CAAC;KACtB,CAAC;IAEF;;OAEG;IACH,SAAS,CAAC,EAAE;QACV;;;WAGG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;QAEf;;;WAGG;QACH,UAAU,CAAC,EAAE,OAAO,CAAC;KACtB,CAAC;IAEF;;OAEG;IACH,eAAe,CAAC,EAAE;QAChB;;;WAGG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;QAEf;;;WAGG;QACH,UAAU,CAAC,EAAE,OAAO,CAAC;KACtB,CAAC;CACH;AAED,MAAM,WAAW,UAAU;IACzB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;;;;;;;OAUG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAE9B;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAElC;;;;;;;;OAQG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;;OAIG;IACH,aAAa,CAAC,EAAE,WAAW,CAAC;IAE5B;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE5B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ ;
4
+ ;
5
+ //# sourceMappingURL=QRCode.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QRCode.types.js","sourceRoot":"","sources":["../../lib/types/QRCode.types.ts"],"names":[],"mappings":";;AA8DC,CAAC;AAoKD,CAAC"}
@@ -9,4 +9,5 @@ export * from './OpenID4VCIErrors';
9
9
  export * from './OpenID4VCIVersions.types';
10
10
  export * from './StateManager.types';
11
11
  export * from './Token.types';
12
+ export * from './QRCode.types';
12
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC"}
@@ -25,4 +25,5 @@ __exportStar(require("./OpenID4VCIErrors"), exports);
25
25
  __exportStar(require("./OpenID4VCIVersions.types"), exports);
26
26
  __exportStar(require("./StateManager.types"), exports);
27
27
  __exportStar(require("./Token.types"), exports);
28
+ __exportStar(require("./QRCode.types"), exports);
28
29
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,6DAA2C;AAC3C,kDAAgC;AAChC,kDAAgC;AAChC,kDAAgC;AAChC,kDAAgC;AAChC,mDAAiC;AACjC,qDAAmC;AACnC,6DAA2C;AAC3C,uDAAqC;AACrC,gDAA8B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,6DAA2C;AAC3C,kDAAgC;AAChC,kDAAgC;AAChC,kDAAgC;AAChC,kDAAgC;AAChC,mDAAiC;AACjC,qDAAmC;AACnC,6DAA2C;AAC3C,uDAAqC;AACrC,gDAA8B;AAC9B,iDAA+B"}
@@ -4,7 +4,7 @@ import { CredentialsSupportedDisplay, CredentialSupportedBrief, IssuerCredential
4
4
  export interface CredentialRequestV1_0_08 {
5
5
  type: string;
6
6
  format: CredentialFormat;
7
- proof: ProofOfPossession;
7
+ proof?: ProofOfPossession;
8
8
  }
9
9
  export interface IssuerMetadataV1_0_08 {
10
10
  issuer?: string;
@@ -28,10 +28,14 @@ export interface CredentialOfferPayloadV1_0_08 {
28
28
  export interface CredentialSupportedTypeV1_0_08 {
29
29
  [credentialType: string]: CredentialSupportedV1_0_08;
30
30
  }
31
+ export interface CredentialSupportedFormatV1_0_08 extends CredentialSupportedBrief {
32
+ name?: string;
33
+ types: string[];
34
+ }
31
35
  export interface CredentialSupportedV1_0_08 {
32
36
  display?: CredentialsSupportedDisplay[];
33
37
  formats: {
34
- [credentialFormat: string]: CredentialSupportedBrief;
38
+ [credentialFormat: string]: CredentialSupportedFormatV1_0_08;
35
39
  };
36
40
  claims?: IssuerCredentialSubject;
37
41
  }
@@ -1 +1 @@
1
- {"version":3,"file":"v1_0_08.types.d.ts","sourceRoot":"","sources":["../../lib/types/v1_0_08.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,2BAA2B,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEjJ,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,gBAAgB,CAAC;IACzB,KAAK,EAAE,iBAAiB,CAAC;CAC1B;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,qBAAqB,EAAE,8BAA8B,CAAC;IACtD,iBAAiB,CAAC,EAAE;QAElB,OAAO,EAAE,aAAa,G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BAAmB,EAAE,MAAM,CAAC;IAC5B,qBAAqB,EAAE,8BAA8B,CAAC;IACtD,iBAAiB,CAAC,EAAE;QAElB,OAAO,EAAE,aAAa,GAAG,aAAa,EAAE,CAAC;KAC1C,CAAC;IACF,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,6BAA6B;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IACnC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,iBAAiB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AACD,MAAM,WAAW,8BAA8B;IAC7C,CAAC,cAAc,EAAE,MAAM,GAAG,0BAA0B,CAAC;CACtD;AAED,MAAM,WAAW,gCAAiC,SAAQ,wBAAwB;IAChF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,0BAA0B;IACzC,OAAO,CAAC,EAAE,2BAA2B,EAAE,CAAC;IACxC,OAAO,EAAE;QAEP,CAAC,gBAAgB,EAAE,MAAM,GAAG,gCAAgC,CAAC;KAC9D,CAAC;IACF,MAAM,CAAC,EAAE,uBAAuB,CAAC;CAClC"}
@@ -1,5 +1,6 @@
1
1
  import { AuthorizationDetailsJwtVcJson, CommonAuthorizationRequest } from './Authorization.types';
2
- import { CommonCredentialRequest, CredentialDataSupplierInput, CredentialOfferFormat, CredentialRequestJwtVc, CredentialRequestLdpVc, Grant, IssuerCredentialDefinition } from './Generic.types';
2
+ import { CommonCredentialRequest, CredentialDataSupplierInput, CredentialOfferFormat, CredentialRequestJwtVcJson, CredentialRequestJwtVcJsonLdAndLdpVc, CredentialRequestSdJwtVc, Grant } from './Generic.types';
3
+ import { QRCodeOpts } from './QRCode.types';
3
4
  export interface CredentialOfferV1_0_11 {
4
5
  credential_offer?: CredentialOfferPayloadV1_0_11;
5
6
  credential_offer_uri?: string;
@@ -8,9 +9,10 @@ export interface CredentialOfferRESTRequest extends CredentialOfferV1_0_11 {
8
9
  baseUri?: string;
9
10
  scheme?: string;
10
11
  pinLength?: number;
12
+ qrCodeOpts?: QRCodeOpts;
11
13
  credentialDataSupplierInput?: CredentialDataSupplierInput;
12
14
  }
13
- export interface CommonCredentialOfferPayloadV1_0_11 {
15
+ export interface CredentialOfferPayloadV1_0_11 {
14
16
  /**
15
17
  * REQUIRED. The URL of the Credential Issuer, the Wallet is requested to obtain one or more Credentials from.
16
18
  */
@@ -35,19 +37,7 @@ export interface CommonCredentialOfferPayloadV1_0_11 {
35
37
  */
36
38
  grants?: Grant;
37
39
  }
38
- export interface CredentialOfferLdpVcV1_0_11 extends CommonCredentialOfferPayloadV1_0_11 {
39
- /**
40
- * REQUIRED. JSON object containing (and isolating) the detailed description of the credential type.
41
- * This object MUST be processed using full JSON-LD processing. It consists of the following sub-claims:
42
- * - @context: REQUIRED. JSON array as defined in Appendix E.1.3.2
43
- * - types: REQUIRED. JSON array as defined in Appendix E.1.3.2.
44
- * This claim contains the type values the Wallet shall request in the subsequent Credential Request
45
- */
46
- credential_definition: IssuerCredentialDefinition;
47
- }
48
- export type CredentialOfferJwtVcV1_0_11 = CommonCredentialOfferPayloadV1_0_11;
49
- export type CredentialOfferPayloadV1_0_11 = CommonCredentialOfferPayloadV1_0_11 & (CredentialOfferLdpVcV1_0_11 | CredentialOfferJwtVcV1_0_11);
50
- export type CredentialRequestV1_0_11 = CommonCredentialRequest & (CredentialRequestJwtVc | CredentialRequestLdpVc);
40
+ export type CredentialRequestV1_0_11 = CommonCredentialRequest & (CredentialRequestJwtVcJson | CredentialRequestJwtVcJsonLdAndLdpVc | CredentialRequestSdJwtVc);
51
41
  export interface AuthorizationRequestV1_0_11 extends AuthorizationDetailsJwtVcJson, AuthorizationDetailsJwtVcJson {
52
42
  issuer_state?: string;
53
43
  }
@@ -1 +1 @@
1
- {"version":3,"file":"v1_0_11.types.d.ts","sourceRoot":"","sources":["../../lib/types/v1_0_11.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAClG,OAAO,EACL,uBAAuB,EACvB,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,KAAK,EACL,0BAA0B,EAC3B,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,sBAAsB;IACrC,gBAAgB,CAAC,EAAE,6BAA6B,CAAC;IACjD,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,0BAA2B,SAAQ,sBAAsB;IACxE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2BAA2B,CAAC,EAAE,2BAA2B,CAAC;CAC3D;AAED,MAAM,WAAW,mCAAmC;IAClD;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;;;;;;;OAQG;IACH,WAAW,EAAE,CAAC,qBAAqB,GAAG,MAAM,CAAC,EAAE,CAAC;IAChD;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC;CAChB;AAED,MAAM,WAAW,2BAA4B,SAAQ,mCAAmC;IACtF;;;;;;OAMG;IACH,qBAAqB,EAAE,0BAA0B,CAAC;CACnD;AAED,MAAM,MAAM,2BAA2B,GAAG,mCAAmC,CAAC;AAE9E,MAAM,MAAM,6BAA6B,GAAG,mCAAmC,GAAG,CAAC,2BAA2B,GAAG,2BAA2B,CAAC,CAAC;AAE9I,MAAM,MAAM,wBAAwB,GAAG,uBAAuB,GAAG,CAAC,sBAAsB,GAAG,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,6BAA6B,EAAE,6BAA6B;IAC/G,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAGD,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAE1F"}
@@ -1 +1 @@
1
- {"version":3,"file":"v1_0_11.types.js","sourceRoot":"","sources":["../../lib/types/v1_0_11.types.ts"],"names":[],"mappings":";;;AAuEA,qDAAqD;AACrD,SAAgB,6BAA6B,CAAC,OAAmC;IAC/E,OAAO,OAAO,IAAI,cAAc,IAAI,OAAO,CAAC;AAC9C,CAAC;AAFD,sEAEC"}
1
+ {"version":3,"file":"v1_0_11.types.js","sourceRoot":"","sources":["../../lib/types/v1_0_11.types.ts"],"names":[],"mappings":";;;AA2DA,qDAAqD;AACrD,SAAgB,6BAA6B,CAAC,OAAmC;IAC/E,OAAO,OAAO,IAAI,cAAc,IAAI,OAAO,CAAC;AAC9C,CAAC;AAFD,sEAEC"}
@@ -340,3 +340,30 @@ function recordVersion(currentVersion: OpenId4VCIVersion, matchingVersion: OpenI
340
340
  `Invalid param. Some keys have been used from version: ${currentVersion} version while '${key}' is used from version: ${matchingVersion}`,
341
341
  );
342
342
  }
343
+
344
+ export function getTypesFromOffer(credentialOffer: UniformCredentialOfferPayload, opts?: { filterVerifiableCredential: boolean }) {
345
+ const types = credentialOffer.credentials.reduce<string[]>((prev, curr) => {
346
+ // FIXME returning the string value is wrong (as it's an id), but just matching the current behavior of this library
347
+ // The credential_type (from draft 8) and the actual 'type' value in a VC (from draft 11) are mixed up
348
+ // Fix for this here: https://github.com/Sphereon-Opensource/OID4VCI/pull/54
349
+ if (typeof curr === 'string') {
350
+ return [...prev, curr];
351
+ } else if (curr.format === 'jwt_vc_json-ld' || curr.format === 'ldp_vc') {
352
+ return [...prev, ...curr.credential_definition.types];
353
+ } else if (curr.format === 'jwt_vc_json') {
354
+ return [...prev, ...curr.types];
355
+ } else if (curr.format === 'vc+sd-jwt') {
356
+ return [...prev, curr.credential_definition.vct];
357
+ }
358
+
359
+ return prev;
360
+ }, []);
361
+
362
+ if (!types || types.length === 0) {
363
+ throw Error('Could not deduce types from credential offer');
364
+ }
365
+ if (opts?.filterVerifiableCredential) {
366
+ return types.filter((type) => type !== 'VerifiableCredential');
367
+ }
368
+ return types;
369
+ }
@@ -1,7 +1,17 @@
1
- import { CredentialRequestV1_0_11 } from '../types';
1
+ import { CredentialRequestV1_0_08, OpenId4VCIVersion, UniformCredentialRequest } from '../types';
2
+
3
+ import { getFormatForVersion } from './FormatUtils';
4
+
5
+ export function getTypesFromRequest(credentialRequest: UniformCredentialRequest, opts?: { filterVerifiableCredential: boolean }) {
6
+ let types: string[] = [];
7
+ if (credentialRequest.format === 'jwt_vc_json') {
8
+ types = credentialRequest.types;
9
+ } else if (credentialRequest.format === 'jwt_vc_json-ld' || credentialRequest.format === 'ldp_vc') {
10
+ types = credentialRequest.credential_definition.types;
11
+ } else if (credentialRequest.format === 'vc+sd-jwt') {
12
+ types = [credentialRequest.credential_definition.vct];
13
+ }
2
14
 
3
- export function getTypesFromRequest(credentialRequest: CredentialRequestV1_0_11, opts?: { filterVerifiableCredential: boolean }) {
4
- const types = 'types' in credentialRequest ? credentialRequest.types : credentialRequest.credential_definition.types;
5
15
  if (!types || types.length === 0) {
6
16
  throw Error('Could not deduce types from credential request');
7
17
  }
@@ -10,3 +20,21 @@ export function getTypesFromRequest(credentialRequest: CredentialRequestV1_0_11,
10
20
  }
11
21
  return types;
12
22
  }
23
+
24
+ export function getCredentialRequestForVersion(
25
+ credentialRequest: UniformCredentialRequest,
26
+ version: OpenId4VCIVersion,
27
+ ): UniformCredentialRequest | CredentialRequestV1_0_08 {
28
+ if (version === OpenId4VCIVersion.VER_1_0_08) {
29
+ const draft8Format = getFormatForVersion(credentialRequest.format, version);
30
+ const types = getTypesFromRequest(credentialRequest, { filterVerifiableCredential: true });
31
+
32
+ return {
33
+ format: draft8Format,
34
+ proof: credentialRequest.proof,
35
+ type: types[0],
36
+ } satisfies CredentialRequestV1_0_08;
37
+ }
38
+
39
+ return credentialRequest;
40
+ }
@@ -0,0 +1,52 @@
1
+ import { CredentialFormat } from '@sphereon/ssi-types';
2
+
3
+ import { OID4VCICredentialFormat, OpenId4VCIVersion } from '../types';
4
+
5
+ export function isFormat<T extends { format?: OID4VCICredentialFormat }, Format extends OID4VCICredentialFormat>(
6
+ formatObject: T,
7
+ format: Format,
8
+ ): formatObject is T & { format: Format } {
9
+ return formatObject.format === format;
10
+ }
11
+
12
+ export function isNotFormat<T extends { format?: OID4VCICredentialFormat }, Format extends OID4VCICredentialFormat>(
13
+ formatObject: T,
14
+ format: Format,
15
+ ): formatObject is T & { format: Exclude<OID4VCICredentialFormat, Format> } {
16
+ return formatObject.format !== format;
17
+ }
18
+
19
+ const isUniformFormat = (format: string): format is OID4VCICredentialFormat => {
20
+ return ['jwt_vc_json', 'jwt_vc_json-ld', 'ldp_vc', 'vc+sd-jwt'].includes(format);
21
+ };
22
+
23
+ export function getUniformFormat(format: string | OID4VCICredentialFormat | CredentialFormat): OID4VCICredentialFormat {
24
+ // Already valid format
25
+ if (isUniformFormat(format)) {
26
+ return format;
27
+ }
28
+
29
+ // Older formats
30
+ if (format === 'jwt_vc' || format === 'jwt') {
31
+ return 'jwt_vc_json';
32
+ }
33
+ if (format === 'ldp_vc' || format === 'ldp') {
34
+ return 'ldp_vc';
35
+ }
36
+
37
+ throw new Error(`Invalid format: ${format}`);
38
+ }
39
+
40
+ export function getFormatForVersion(format: string, version: OpenId4VCIVersion) {
41
+ const uniformFormat = isUniformFormat(format) ? format : getUniformFormat(format);
42
+
43
+ if (version === OpenId4VCIVersion.VER_1_0_08) {
44
+ if (uniformFormat === 'jwt_vc_json') {
45
+ return 'jwt_vc' as const;
46
+ } else if (uniformFormat === 'ldp_vc' || uniformFormat === 'jwt_vc_json-ld') {
47
+ return 'ldp_vc' as const;
48
+ }
49
+ }
50
+
51
+ return uniformFormat;
52
+ }
@@ -73,7 +73,7 @@ export function getSupportedCredential(opts?: {
73
73
  if ((opts?.types && typeof opts?.types === 'string') || opts?.types?.length === 1) {
74
74
  const types = Array.isArray(opts.types) ? opts.types[0] : opts.types;
75
75
  const supported = credentialsSupported.filter(
76
- (sup) => sup.id === types || (initiationTypes && arrayEqualsIgnoreOrder(sup.types, initiationTypes)),
76
+ (sup) => sup.id === types || (initiationTypes && arrayEqualsIgnoreOrder(getTypesFromCredentialSupported(sup), initiationTypes)),
77
77
  );
78
78
  if (supported) {
79
79
  credentialSupportedOverlap.push(...supported);
@@ -86,7 +86,7 @@ export function getSupportedCredential(opts?: {
86
86
  initiationTypes.push('VerifiableCredential');
87
87
  }
88
88
  const supported = credentialsSupported.filter((sup) => {
89
- const supTypes = sup.types;
89
+ const supTypes = getTypesFromCredentialSupported(sup);
90
90
  if (!supTypes.includes('VerifiableCredential')) {
91
91
  supTypes.push('VerifiableCredential');
92
92
  }
@@ -99,6 +99,23 @@ export function getSupportedCredential(opts?: {
99
99
  return credentialSupportedOverlap;
100
100
  }
101
101
 
102
+ export function getTypesFromCredentialSupported(credentialSupported: CredentialSupported, opts?: { filterVerifiableCredential: boolean }) {
103
+ let types: string[] = [];
104
+ if (credentialSupported.format === 'jwt_vc_json' || credentialSupported.format === 'jwt_vc_json-ld' || credentialSupported.format === 'ldp_vc') {
105
+ types = credentialSupported.types;
106
+ } else if (credentialSupported.format === 'vc+sd-jwt') {
107
+ types = [credentialSupported.credential_definition.vct];
108
+ }
109
+
110
+ if (!types || types.length === 0) {
111
+ throw Error('Could not deduce types from credential supported');
112
+ }
113
+ if (opts?.filterVerifiableCredential) {
114
+ return types.filter((type) => type !== 'VerifiableCredential');
115
+ }
116
+ return types;
117
+ }
118
+
102
119
  function arrayEqualsIgnoreOrder(a: string[], b: string[]) {
103
120
  if (a.length !== b.length) return false;
104
121
  const uniqueValues = new Set([...a, ...b]);
@@ -127,7 +144,7 @@ export function credentialSupportedV8ToV11(key: string, supportedV8: CredentialS
127
144
  }
128
145
  let credentialSupport: Partial<CredentialSupported> = {};
129
146
  credentialSupport = {
130
- format,
147
+ format: format as OID4VCICredentialFormat,
131
148
  display: supportedV8.display,
132
149
  ...credentialSupportBrief,
133
150
  credentialSubject: supportedV8.claims,
@@ -2,3 +2,4 @@ export * from './CredentialRequestUtil';
2
2
  export * from './CredentialOfferUtil';
3
3
  export * from './Encoding';
4
4
  export * from './TypeConversionUtils';
5
+ export * from './FormatUtils';
@@ -1,5 +1,12 @@
1
1
  import { CredentialOfferPayload, UniformCredentialOffer } from './CredentialIssuance.types';
2
- import { ErrorResponse, IssuerCredentialDefinition, IssuerCredentialSubject, OID4VCICredentialFormat, PRE_AUTH_CODE_LITERAL } from './Generic.types';
2
+ import {
3
+ ErrorResponse,
4
+ IssuerCredentialSubject,
5
+ JsonLdIssuerCredentialDefinition,
6
+ OID4VCICredentialFormat,
7
+ PRE_AUTH_CODE_LITERAL,
8
+ SdJwtVcCredentialDefinition,
9
+ } from './Generic.types';
3
10
  import { EndpointMetadata } from './ServerMetadata';
4
11
 
5
12
  export interface CommonAuthorizationRequest {
@@ -64,9 +71,9 @@ export interface CommonAuthorizationRequest {
64
71
  /**
65
72
  * string type added for conformity with our previous code in the client
66
73
  */
67
- export type AuthorizationDetails = AuthorizationDetailsJwtVcJson | AuthorizationRequestJwtVcJsonLdAndLdpVc | string;
74
+ export type AuthorizationDetails = AuthorizationDetailsJwtVcJson | AuthorizationDetailsJwtVcJsonLdAndLdpVc | AuthorizationDetailsSdJwtVc | string;
68
75
 
69
- export type AuthorizationRequest = AuthorizationRequestJwtVcJson | AuthorizationDetailsJwtVcJsonLdAndLdpVc;
76
+ export type AuthorizationRequest = AuthorizationRequestJwtVcJson | AuthorizationRequestJwtVcJsonLdAndLdpVc | AuthorizationRequestSdJwtVc;
70
77
 
71
78
  export interface AuthorizationRequestJwtVcJson extends CommonAuthorizationRequest {
72
79
  authorization_details?: AuthorizationDetailsJwtVcJson[];
@@ -76,6 +83,10 @@ export interface AuthorizationRequestJwtVcJsonLdAndLdpVc extends CommonAuthoriza
76
83
  authorization_details?: AuthorizationDetailsJwtVcJsonLdAndLdpVc[];
77
84
  }
78
85
 
86
+ export interface AuthorizationRequestSdJwtVc extends CommonAuthorizationRequest {
87
+ authorization_details?: AuthorizationDetailsSdJwtVc[];
88
+ }
89
+
79
90
  export interface CommonAuthorizationDetails {
80
91
  /**
81
92
  * REQUIRED. JSON string that determines the authorization details type.
@@ -94,12 +105,14 @@ export interface CommonAuthorizationDetails {
94
105
  * the authorization detail's locations common data field MUST be set to the Credential Issuer Identifier value.
95
106
  */
96
107
  locations?: string[];
97
- types: string[]; // This claim contains the type values the Wallet requests authorization for at the issuer.
108
+
98
109
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
99
110
  [key: string]: any;
100
111
  }
101
112
 
102
113
  export interface AuthorizationDetailsJwtVcJson extends CommonAuthorizationDetails {
114
+ format: 'jwt_vc_json';
115
+
103
116
  /**
104
117
  * A JSON object containing a list of key value pairs, where the key identifies the claim offered in the Credential.
105
118
  * The value MAY be a dictionary, which allows to represent the full (potentially deeply nested) structure of the
@@ -107,9 +120,13 @@ export interface AuthorizationDetailsJwtVcJson extends CommonAuthorizationDetail
107
120
  * credential to be issued.
108
121
  */
109
122
  credentialSubject?: IssuerCredentialSubject;
123
+
124
+ types: string[]; // This claim contains the type values the Wallet requests authorization for at the issuer.
110
125
  }
111
126
 
112
127
  export interface AuthorizationDetailsJwtVcJsonLdAndLdpVc extends CommonAuthorizationDetails {
128
+ format: 'ldp_vc' | 'jwt_vc_json-ld';
129
+
113
130
  /**
114
131
  * REQUIRED. JSON object containing (and isolating) the detailed description of the credential type.
115
132
  * This object MUST be processed using full JSON-LD processing. It consists of the following sub-claims:
@@ -117,7 +134,13 @@ export interface AuthorizationDetailsJwtVcJsonLdAndLdpVc extends CommonAuthoriza
117
134
  * - types: REQUIRED. JSON array as defined in Appendix E.1.3.2.
118
135
  * This claim contains the type values the Wallet shall request in the subsequent Credential Request
119
136
  */
120
- credential_definition: IssuerCredentialDefinition;
137
+ credential_definition: JsonLdIssuerCredentialDefinition;
138
+ }
139
+
140
+ export interface AuthorizationDetailsSdJwtVc extends CommonAuthorizationDetails {
141
+ format: 'vc+sd-jwt';
142
+
143
+ credential_definition: SdJwtVcCredentialDefinition;
121
144
  }
122
145
 
123
146
  export enum GrantTypes {