@sphereon/oid4vci-common 0.8.2-next.6 → 0.8.2-unstable.16

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 (49) 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/HttpUtils.d.ts +3 -3
  14. package/dist/functions/HttpUtils.d.ts.map +1 -1
  15. package/dist/functions/HttpUtils.js +1 -1
  16. package/dist/functions/HttpUtils.js.map +1 -1
  17. package/dist/functions/IssuerMetadataUtils.d.ts +3 -0
  18. package/dist/functions/IssuerMetadataUtils.d.ts.map +1 -1
  19. package/dist/functions/IssuerMetadataUtils.js +27 -7
  20. package/dist/functions/IssuerMetadataUtils.js.map +1 -1
  21. package/dist/functions/index.d.ts +2 -0
  22. package/dist/functions/index.d.ts.map +1 -1
  23. package/dist/functions/index.js +2 -0
  24. package/dist/functions/index.js.map +1 -1
  25. package/dist/types/Authorization.types.d.ts +16 -6
  26. package/dist/types/Authorization.types.d.ts.map +1 -1
  27. package/dist/types/Authorization.types.js.map +1 -1
  28. package/dist/types/Generic.types.d.ts +47 -18
  29. package/dist/types/Generic.types.d.ts.map +1 -1
  30. package/dist/types/Generic.types.js.map +1 -1
  31. package/dist/types/QRCode.types.js +0 -2
  32. package/dist/types/QRCode.types.js.map +1 -1
  33. package/dist/types/v1_0_08.types.d.ts +6 -2
  34. package/dist/types/v1_0_08.types.d.ts.map +1 -1
  35. package/dist/types/v1_0_11.types.d.ts +3 -15
  36. package/dist/types/v1_0_11.types.d.ts.map +1 -1
  37. package/dist/types/v1_0_11.types.js.map +1 -1
  38. package/lib/functions/CredentialOfferUtil.ts +27 -0
  39. package/lib/functions/CredentialRequestUtil.ts +31 -3
  40. package/lib/functions/FormatUtils.ts +52 -0
  41. package/lib/functions/HttpUtils.ts +5 -5
  42. package/lib/functions/IssuerMetadataUtils.ts +26 -4
  43. package/lib/functions/index.ts +2 -0
  44. package/lib/types/Authorization.types.ts +30 -6
  45. package/lib/types/Generic.types.ts +61 -16
  46. package/lib/types/QRCode.types.ts +2 -2
  47. package/lib/types/v1_0_08.types.ts +7 -2
  48. package/lib/types/v1_0_11.types.ts +6 -20
  49. package/package.json +3 -3
@@ -15,7 +15,7 @@ export interface ImageInfo {
15
15
  [key: string]: unknown;
16
16
  }
17
17
 
18
- export type OID4VCICredentialFormat = 'jwt_vc_json' | 'jwt_vc_json-ld' | 'ldp_vc' /*| 'mso_mdoc'*/; // we do not support mdocs at this point
18
+ export type OID4VCICredentialFormat = 'jwt_vc_json' | 'jwt_vc_json-ld' | 'ldp_vc' | 'vc+sd-jwt' | 'jwt_vc'; // jwt_vc is added for backwards compat /*| 'mso_mdoc'*/; // we do not support mdocs at this point
19
19
 
20
20
  export interface NameAndLocale {
21
21
  name?: string; // REQUIRED. String value of a display name for the Credential.
@@ -62,8 +62,6 @@ export interface CredentialIssuerMetadata extends CredentialIssuerMetadataOpts,
62
62
  }
63
63
 
64
64
  export interface CredentialSupportedBrief {
65
- name?: string; // fixme: Probably should not be here, is part of the display object
66
- types: string[]; // REQUIRED. JSON array designating the types a certain credential type supports
67
65
  cryptographic_binding_methods_supported?: string[]; // OPTIONAL. Array of case sensitive strings that identify how the Credential is bound to the identifier of the End-User who possesses the Credential
68
66
  cryptographic_suites_supported?: string[]; // OPTIONAL. Array of case sensitive strings that identify the cryptographic suites that are supported for the cryptographic_binding_methods_supported
69
67
  }
@@ -75,25 +73,62 @@ export type CommonCredentialSupported = CredentialSupportedBrief & {
75
73
  /**
76
74
  * following properties are non-mso_mdoc specific and we might wanna rethink them when we're going to support mso_mdoc
77
75
  */
78
- credentialSubject?: IssuerCredentialSubject; // OPTIONAL. A JSON object containing a list of key value pairs, where the key identifies the claim offered in the Credential. The value MAY be a dictionary, which allows to represent the full (potentially deeply nested) structure of the verifiable credential to be issued.
79
- order?: string[]; //An array of claims.display.name values that lists them in the order they should be displayed by the Wallet.
80
76
  };
81
77
 
82
78
  export interface CredentialSupportedJwtVcJsonLdAndLdpVc extends CommonCredentialSupported {
79
+ types: string[]; // REQUIRED. JSON array designating the types a certain credential type supports
83
80
  '@context': ICredentialContextType[]; // REQUIRED. JSON array as defined in [VC_DATA], Section 4.1.
81
+ credentialSubject?: IssuerCredentialSubject; // OPTIONAL. A JSON object containing a list of key value pairs, where the key identifies the claim offered in the Credential. The value MAY be a dictionary, which allows to represent the full (potentially deeply nested) structure of the verifiable credential to be issued.
82
+ order?: string[]; //An array of claims.display.name values that lists them in the order they should be displayed by the Wallet.
83
+ format: 'ldp_vc' | 'jwt_vc_json-ld';
84
84
  }
85
85
 
86
86
  export interface CredentialSupportedJwtVcJson extends CommonCredentialSupported {
87
- format: 'jwt_vc_json';
87
+ types: string[]; // REQUIRED. JSON array designating the types a certain credential type supports
88
+ credentialSubject?: IssuerCredentialSubject; // OPTIONAL. A JSON object containing a list of key value pairs, where the key identifies the claim offered in the Credential. The value MAY be a dictionary, which allows to represent the full (potentially deeply nested) structure of the verifiable credential to be issued.
89
+ order?: string[]; //An array of claims.display.name values that lists them in the order they should be displayed by the Wallet.
90
+ format: 'jwt_vc_json' | 'jwt_vc'; // jwt_vc added for backwards compat
91
+ }
92
+
93
+ export interface SdJwtVcCredentialDefinition {
94
+ vct: string; // REQUIRED. JSON string designating the type of an SD-JWT vc
95
+ claims?: IssuerCredentialSubject;
96
+ }
97
+
98
+ export interface CredentialSupportedSdJwtVc extends CommonCredentialSupported {
99
+ format: 'vc+sd-jwt';
100
+
101
+ // REQUIRED. JSON object containing the detailed description of the credential type
102
+ credential_definition: SdJwtVcCredentialDefinition;
103
+ order?: string[]; //An array of claims.display.name values that lists them in the order they should be displayed by the Wallet.
88
104
  }
89
105
 
90
- export type CredentialSupported = CommonCredentialSupported & (CredentialSupportedJwtVcJson | CredentialSupportedJwtVcJsonLdAndLdpVc);
106
+ export type CredentialSupported = CommonCredentialSupported &
107
+ (CredentialSupportedJwtVcJson | CredentialSupportedJwtVcJsonLdAndLdpVc | CredentialSupportedSdJwtVc);
91
108
 
92
- export interface CredentialOfferFormat {
109
+ export interface CommonCredentialOfferFormat {
93
110
  format: OID4VCICredentialFormat | string;
94
- types: string[];
95
111
  }
96
112
 
113
+ export interface CredentialOfferFormatJwtVcJsonLdAndLdpVc extends CommonCredentialOfferFormat {
114
+ format: 'ldp_vc' | 'jwt_vc_json-ld';
115
+ // REQUIRED. JSON object containing (and isolating) the detailed description of the credential type. This object MUST be processed using full JSON-LD processing.
116
+ credential_definition: JsonLdIssuerCredentialDefinition;
117
+ }
118
+
119
+ export interface CredentialOfferFormatJwtVcJson extends CommonCredentialOfferFormat {
120
+ format: 'jwt_vc_json' | 'jwt_vc'; // jwt_vc is added for backwards compat
121
+ types: string[]; // REQUIRED. JSON array as defined in Appendix E.1.1.2. This claim contains the type values the Wallet shall request in the subsequent Credential Request.
122
+ }
123
+
124
+ export interface CredentialOfferFormatSdJwtVc extends CommonCredentialOfferFormat {
125
+ format: 'vc+sd-jwt';
126
+ credential_definition: SdJwtVcCredentialDefinition;
127
+ }
128
+
129
+ export type CredentialOfferFormat = CommonCredentialOfferFormat &
130
+ (CredentialOfferFormatJwtVcJsonLdAndLdpVc | CredentialOfferFormatJwtVcJson | CredentialOfferFormatSdJwtVc);
131
+
97
132
  /**
98
133
  * Optional storage that can help the credential Data Supplier. For instance to store credential input data during offer creation, if no additional data can be supplied later on
99
134
  */
@@ -108,10 +143,10 @@ export type CreateCredentialOfferURIResult = {
108
143
  userPinRequired: boolean;
109
144
  };
110
145
 
111
- export interface IssuerCredentialDefinition {
146
+ export interface JsonLdIssuerCredentialDefinition {
112
147
  '@context': ICredentialContextType[];
113
148
  types: string[];
114
- credentialSubject: IssuerCredentialSubject;
149
+ credentialSubject?: IssuerCredentialSubject;
115
150
  }
116
151
 
117
152
  export interface ErrorResponse extends Response {
@@ -128,15 +163,20 @@ export interface CommonCredentialRequest {
128
163
  proof?: ProofOfPossession;
129
164
  }
130
165
 
131
- export interface CredentialRequestJwtVc extends CommonCredentialRequest {
132
- format: 'jwt_vc_json' | 'jwt_vc_json-ld';
166
+ export interface CredentialRequestJwtVcJson extends CommonCredentialRequest {
167
+ format: 'jwt_vc_json' | 'jwt_vc'; // jwt_vc for backwards compat
133
168
  types: string[];
134
169
  credentialSubject?: IssuerCredentialSubject;
135
170
  }
136
171
 
137
- export interface CredentialRequestLdpVc extends CommonCredentialRequest {
138
- format: 'ldp_vc';
139
- credential_definition: IssuerCredentialDefinition;
172
+ export interface CredentialRequestJwtVcJsonLdAndLdpVc extends CommonCredentialRequest {
173
+ format: 'ldp_vc' | 'jwt_vc_json-ld';
174
+ credential_definition: JsonLdIssuerCredentialDefinition;
175
+ }
176
+
177
+ export interface CredentialRequestSdJwtVc extends CommonCredentialRequest {
178
+ format: 'vc+sd-jwt';
179
+ credential_definition: SdJwtVcCredentialDefinition;
140
180
  }
141
181
 
142
182
  export interface CommonCredentialResponse {
@@ -157,6 +197,11 @@ export interface CredentialResponseJwtVc {
157
197
  credential: string;
158
198
  }
159
199
 
200
+ export interface CredentialResponseSdJwtVc {
201
+ format: 'vc+sd-jwt';
202
+ credential: string;
203
+ }
204
+
160
205
  // export type CredentialSubjectDisplay = NameAndLocale[];
161
206
 
162
207
  export type IssuerCredentialSubjectDisplay = CredentialSubjectDisplay & { [key: string]: CredentialSubjectDisplay };
@@ -60,7 +60,7 @@ export interface ComponentOptions {
60
60
  */
61
61
  protectors?: boolean;
62
62
  };
63
- };
63
+ }
64
64
 
65
65
  export interface QRCodeOpts {
66
66
  /**
@@ -224,4 +224,4 @@ export interface QRCodeOpts {
224
224
  * @deafultValue 0.4
225
225
  */
226
226
  dotScale?: number;
227
- };
227
+ }
@@ -6,7 +6,7 @@ import { CredentialsSupportedDisplay, CredentialSupportedBrief, IssuerCredential
6
6
  export interface CredentialRequestV1_0_08 {
7
7
  type: string;
8
8
  format: CredentialFormat;
9
- proof: ProofOfPossession;
9
+ proof?: ProofOfPossession;
10
10
  }
11
11
 
12
12
  export interface IssuerMetadataV1_0_08 {
@@ -34,11 +34,16 @@ export interface CredentialSupportedTypeV1_0_08 {
34
34
  [credentialType: string]: CredentialSupportedV1_0_08;
35
35
  }
36
36
 
37
+ export interface CredentialSupportedFormatV1_0_08 extends CredentialSupportedBrief {
38
+ name?: string;
39
+ types: string[];
40
+ }
41
+
37
42
  export interface CredentialSupportedV1_0_08 {
38
43
  display?: CredentialsSupportedDisplay[];
39
44
  formats: {
40
45
  // REQUIRED. A JSON object containing a list of key value pairs, where the key is a string identifying the format of the Credential. Below is a non-exhaustive list of valid key values defined by this specification:
41
- [credentialFormat: string]: CredentialSupportedBrief;
46
+ [credentialFormat: string]: CredentialSupportedFormatV1_0_08;
42
47
  };
43
48
  claims?: IssuerCredentialSubject; // REQUIRED. A JSON object containing a list of key value pairs, where the key identifies the claim offered in the Credential. The value is a JSON object detailing the specifics about the support for the claim with a following non-exhaustive list of parameters that MAY be included:
44
49
  }
@@ -3,10 +3,10 @@ import {
3
3
  CommonCredentialRequest,
4
4
  CredentialDataSupplierInput,
5
5
  CredentialOfferFormat,
6
- CredentialRequestJwtVc,
7
- CredentialRequestLdpVc,
6
+ CredentialRequestJwtVcJson,
7
+ CredentialRequestJwtVcJsonLdAndLdpVc,
8
+ CredentialRequestSdJwtVc,
8
9
  Grant,
9
- IssuerCredentialDefinition,
10
10
  } from './Generic.types';
11
11
  import { QRCodeOpts } from './QRCode.types';
12
12
 
@@ -23,7 +23,7 @@ export interface CredentialOfferRESTRequest extends CredentialOfferV1_0_11 {
23
23
  credentialDataSupplierInput?: CredentialDataSupplierInput;
24
24
  }
25
25
 
26
- export interface CommonCredentialOfferPayloadV1_0_11 {
26
+ export interface CredentialOfferPayloadV1_0_11 {
27
27
  /**
28
28
  * REQUIRED. The URL of the Credential Issuer, the Wallet is requested to obtain one or more Credentials from.
29
29
  */
@@ -50,22 +50,8 @@ export interface CommonCredentialOfferPayloadV1_0_11 {
50
50
  grants?: Grant;
51
51
  }
52
52
 
53
- export interface CredentialOfferLdpVcV1_0_11 extends CommonCredentialOfferPayloadV1_0_11 {
54
- /**
55
- * REQUIRED. JSON object containing (and isolating) the detailed description of the credential type.
56
- * This object MUST be processed using full JSON-LD processing. It consists of the following sub-claims:
57
- * - @context: REQUIRED. JSON array as defined in Appendix E.1.3.2
58
- * - types: REQUIRED. JSON array as defined in Appendix E.1.3.2.
59
- * This claim contains the type values the Wallet shall request in the subsequent Credential Request
60
- */
61
- credential_definition: IssuerCredentialDefinition;
62
- }
63
-
64
- export type CredentialOfferJwtVcV1_0_11 = CommonCredentialOfferPayloadV1_0_11;
65
-
66
- export type CredentialOfferPayloadV1_0_11 = CommonCredentialOfferPayloadV1_0_11 & (CredentialOfferLdpVcV1_0_11 | CredentialOfferJwtVcV1_0_11);
67
-
68
- export type CredentialRequestV1_0_11 = CommonCredentialRequest & (CredentialRequestJwtVc | CredentialRequestLdpVc);
53
+ export type CredentialRequestV1_0_11 = CommonCredentialRequest &
54
+ (CredentialRequestJwtVcJson | CredentialRequestJwtVcJsonLdAndLdpVc | CredentialRequestSdJwtVc);
69
55
 
70
56
  export interface AuthorizationRequestV1_0_11 extends AuthorizationDetailsJwtVcJson, AuthorizationDetailsJwtVcJson {
71
57
  issuer_state?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sphereon/oid4vci-common",
3
- "version": "0.8.2-next.6+094ebfc",
3
+ "version": "0.8.2-unstable.16+a504fb2",
4
4
  "description": "OpenID 4 Verifiable Credential Issuance Common Types",
5
5
  "source": "lib/index.ts",
6
6
  "main": "dist/index.js",
@@ -10,7 +10,7 @@
10
10
  "build:clean": "tsc --build --clean && tsc --build"
11
11
  },
12
12
  "dependencies": {
13
- "@sphereon/ssi-types": "0.17.2",
13
+ "@sphereon/ssi-types": "0.17.6-unstable.23",
14
14
  "cross-fetch": "^3.1.8",
15
15
  "jwt-decode": "^3.1.2"
16
16
  },
@@ -46,5 +46,5 @@
46
46
  "publishConfig": {
47
47
  "access": "public"
48
48
  },
49
- "gitHead": "094ebfc61e1650e3c7bb32e4a22ec576d7049f18"
49
+ "gitHead": "a504fb24a8d6127624e3e5497f1a6633e816253d"
50
50
  }