@sphereon/ssi-types 0.17.6-unstable.8 → 0.18.0

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/src/types/vc.ts CHANGED
@@ -1,311 +1,62 @@
1
- import { PresentationSubmission } from './pex'
2
- import { IProofPurpose, IProofType } from './did'
1
+ import { SdJwtDecodedVerifiableCredential, WrappedSdJwtVerifiableCredential, WrappedSdJwtVerifiablePresentation } from './sd-jwt-vc'
2
+ import {
3
+ JwtDecodedVerifiableCredential,
4
+ JwtDecodedVerifiablePresentation,
5
+ W3CVerifiableCredential,
6
+ W3CVerifiablePresentation,
7
+ WrappedW3CVerifiableCredential,
8
+ WrappedW3CVerifiablePresentation,
9
+ } from './w3c-vc'
3
10
 
4
- export type AdditionalClaims = Record<string, any>
11
+ export type WrappedVerifiableCredential = WrappedW3CVerifiableCredential | WrappedSdJwtVerifiableCredential
5
12
 
6
- export type IIssuerId = string
7
-
8
- export interface ICredential {
9
- '@context': ICredentialContextType | ICredentialContextType[]
10
- type: string[]
11
- credentialSchema?: undefined | ICredentialSchemaType | ICredentialSchemaType[]
12
- // If iss is present, the value MUST be used to set the issuer property of the new credential JSON object or the holderDID property of the new presentation JSON object.
13
- issuer: IIssuerId | IIssuer
14
- // If nbf is present, the UNIX timestamp MUST be converted to an [XMLSCHEMA11-2] date-time, and MUST be used to set the value of the issuanceDate property of the new JSON object.
15
- issuanceDate: string
16
- // If sub is present, the value MUST be used to set the value of the id property of credentialSubject of the new credential JSON object.
17
- credentialSubject: (ICredentialSubject & AdditionalClaims) | (ICredentialSubject & AdditionalClaims)[]
18
- // If exp is present, the UNIX timestamp MUST be converted to an [XMLSCHEMA11-2] date-time, and MUST be used to set the value of the expirationDate property of credentialSubject of the new JSON object.
19
- expirationDate?: string
20
- // If jti is present, the value MUST be used to set the value of the id property of the new JSON object.
21
- id?: string
22
- credentialStatus?: ICredentialStatus
23
- description?: string
24
- name?: string
25
-
26
- [x: string]: any
27
- }
28
-
29
- export interface ICredentialSubject {
30
- id?: string
31
- }
32
-
33
- export type ICredentialContextType = (ICredentialContext & AdditionalClaims) | string
34
-
35
- export interface ICredentialContext {
36
- name?: string
37
- did?: string
38
- }
39
-
40
- export type ICredentialSchemaType = ICredentialSchema | string
41
-
42
- export interface ICredentialSchema {
43
- id: string
44
- type?: string
45
- }
46
-
47
- export interface IProof {
48
- type: IProofType | string // The proof type
49
- created: string // The ISO8601 date-time string for creation
50
- proofPurpose: IProofPurpose | string // The specific intent for the proof
51
- verificationMethod: string // A set of parameters required to independently verify the proof
52
- challenge?: string // A challenge to protect against replay attacks
53
- domain?: string // A string restricting the (usage of a) proof to the domain and protects against replay attacks
54
- proofValue?: string // One of any number of valid representations of proof values
55
- jws?: string // JWS based proof
56
- jwt?: string //Jwt 2020 proof. Used to map a JWT VC onto a uniform presentation, and retain access to the original JWT
57
- nonce?: string // Similar to challenge. A nonce to protect against replay attacks, used in some ZKP proofs
58
- requiredRevealStatements?: string[] // The parts of the proof that must be revealed in a derived proof
59
-
60
- [x: string]: any // Any because we want to be able to access value1.value2.value3, which unknown does not allow for without a cast
61
- }
62
-
63
- export interface ICredentialStatus {
64
- id: string
65
- type: string
66
- }
67
-
68
- export interface IIssuer {
69
- id: string
70
-
71
- [x: string]: any
72
- }
73
-
74
- export interface IHasProof {
75
- proof: IProof | IProof[]
76
- }
77
-
78
- export type IVerifiableCredential = ICredential & IHasProof
79
-
80
- /**
81
- * Represents a Json Web Token in compact form.
82
- */
83
- export type CompactJWT = string
84
-
85
- /**
86
- * Represents a signed Verifiable Credential (includes proof), in either JSON or compact JWT format.
87
- * See {@link https://www.w3.org/TR/vc-data-model/#credentials | VC data model}
88
- * See {@link https://www.w3.org/TR/vc-data-model/#proof-formats | proof formats}
89
- */
90
- export type W3CVerifiableCredential = IVerifiableCredential | CompactJWT
91
-
92
- export interface IPresentation {
93
- id?: string
94
- '@context': ICredentialContextType | ICredentialContextType[]
95
- type?: string | string[]
96
- verifiableCredential?: W3CVerifiableCredential[]
97
- presentation_submission?: PresentationSubmission
98
- holder?: string
99
- verifier?: string
100
-
101
- [x: string]: any
102
- }
103
-
104
- export type IVerifiablePresentation = IPresentation & IHasProof
105
-
106
- /**
107
- * Represents a signed Verifiable Presentation (includes proof), in either JSON or compact JWT format.
108
- * See {@link https://www.w3.org/TR/vc-data-model/#presentations | VC data model}
109
- * See {@link https://www.w3.org/TR/vc-data-model/#proof-formats | proof formats}
110
- */
111
- export type W3CVerifiablePresentation = IVerifiablePresentation | CompactJWT
112
-
113
- export interface WrappedVerifiableCredential {
114
- /**
115
- * Original VC that we've received
116
- */
117
- original: OriginalVerifiableCredential
118
- /**
119
- * In case of JWT credential it will be the decoded version. In other cases it will be the same as original one
120
- */
121
- decoded: JwtDecodedVerifiableCredential | IVerifiableCredential
122
- /**
123
- * Type of this credential. Supported types are json-ld and jwt (decoded/encoded)
124
- */
125
- type: OriginalType
126
- /**
127
- * The claim format, typically used during exchange transport protocols
128
- */
129
- format: CredentialFormat
130
- /**
131
- * Internal stable representation of a Credential
132
- */
133
- credential: IVerifiableCredential
134
- }
135
-
136
- export interface WrappedVerifiablePresentation {
137
- /**
138
- * Original VP that we've received
139
- */
140
- original: OriginalVerifiablePresentation
141
- /**
142
- * In case of JWT VP it will be the decoded version. In other cases it will be the same as original one
143
- */
144
- decoded: JwtDecodedVerifiablePresentation | IVerifiablePresentation
145
- /**
146
- * Type of this Presentation. Supported types are json-ld and jwt (decoded/encoded)
147
- */
148
- type: OriginalType
149
- /**
150
- * The claim format, typically used during exchange transport protocols
151
- */
152
- format: PresentationFormat
153
- /**
154
- * Internal stable representation of a Presentation without proofs, created based on https://www.w3.org/TR/vc-data-model/#jwt-decoding
155
- */
156
- presentation: UniformVerifiablePresentation
157
- /**
158
- * Wrapped Verifiable Credentials belonging to the Presentation
159
- */
160
- vcs: WrappedVerifiableCredential[]
161
- }
13
+ export type WrappedVerifiablePresentation = WrappedW3CVerifiablePresentation | WrappedSdJwtVerifiablePresentation
162
14
 
163
15
  export enum OriginalType {
16
+ // W3C
164
17
  JSONLD = 'json-ld',
165
18
  JWT_ENCODED = 'jwt-encoded',
166
19
  JWT_DECODED = 'jwt-decoded',
167
- }
168
-
169
- export interface UniformVerifiablePresentation {
170
- '@context': ICredentialContextType | ICredentialContextType[]
171
- type: string | string[]
172
- verifiableCredential: WrappedVerifiableCredential[]
173
- presentation_submission?: PresentationSubmission
174
- holder?: string
175
- }
176
-
177
- export interface JwtDecodedVerifiableCredential {
178
- vc: IVerifiableCredential
179
- exp: string
180
- iss: string
181
- nbf: string
182
- sub: string
183
- jti: string
184
-
185
- [x: string]: any
186
- }
187
-
188
- export interface JwtDecodedVerifiablePresentation {
189
- vp: IVerifiablePresentation
190
- exp: string
191
- iss: string
192
- nbf: string
193
- sub: string
194
- jti: string
195
- aud: string
196
- iat: string
197
20
 
198
- [x: string]: any
199
- }
21
+ // SD-JWT
22
+ SD_JWT_VC_ENCODED = 'sd-jwt-vc-encoded',
23
+ SD_JWT_VC_DECODED = 'sd-jwt-vc-decoded',
24
+ }
25
+
26
+ export type CredentialFormat =
27
+ // W3C
28
+ | 'jwt_vc'
29
+ | 'ldp_vc'
30
+ // SD-JWT
31
+ | 'vc+sd-jwt'
32
+ // Remaining
33
+ | 'jwt'
34
+ | 'ldp'
35
+ | string
36
+
37
+ export type PresentationFormat =
38
+ // W3C
39
+ | 'jwt_vp'
40
+ | 'ldp_vp'
41
+ // SD-JWT
42
+ | 'vc+sd-jwt'
43
+ // Remaining
44
+ | 'jwt'
45
+ | 'ldp'
46
+ | string
200
47
 
201
- export type CredentialFormat = 'jwt' | 'ldp' | 'jwt_vc' | 'ldp_vc' | string
202
- export type PresentationFormat = 'jwt' | 'ldp' | 'jwt_vp' | 'ldp_vp' | string
203
48
  export type ClaimFormat = CredentialFormat | PresentationFormat
204
49
 
205
- export type OriginalVerifiableCredential = W3CVerifiableCredential | JwtDecodedVerifiableCredential
206
- export type OriginalVerifiablePresentation = W3CVerifiablePresentation | JwtDecodedVerifiablePresentation
50
+ export type OriginalVerifiableCredential = W3CVerifiableCredential | JwtDecodedVerifiableCredential | SdJwtDecodedVerifiableCredential
51
+ export type OriginalVerifiablePresentation = W3CVerifiablePresentation | JwtDecodedVerifiablePresentation | SdJwtDecodedVerifiableCredential
207
52
  export type Original = OriginalVerifiablePresentation | OriginalVerifiableCredential
208
53
 
209
54
  export const enum DocumentFormat {
55
+ // W3C
210
56
  JWT,
211
57
  JSONLD,
58
+ // SD-JWT
59
+ SD_JWT_VC,
60
+ // Remaining
212
61
  EIP712,
213
62
  }
214
-
215
- export const JWT_PROOF_TYPE_2020 = 'JwtProof2020'
216
-
217
- export interface IVerifyStatusResult {
218
- verified: boolean
219
- /**
220
- * Optional Error object for the
221
- * but currently the machine readable errors are not exported from DID-JWT package to be imported here
222
- */
223
- error?: IError | undefined
224
-
225
- /**
226
- * Other options can be specified for verification.
227
- * They will be forwarded to the lower level modules. that performt the checks
228
- */
229
- [x: string]: any
230
- }
231
-
232
- export interface IVerifyResult {
233
- /**
234
- * This value is used to transmit the global result of verification.
235
- */
236
- verified: boolean
237
-
238
- results?: [
239
- {
240
- credential?: ICredential
241
- presentation?: IPresentation
242
- verified: boolean
243
- error?: IError
244
- log: [{ id: string; valid: boolean }]
245
- }
246
- ]
247
-
248
- statusResult?: IVerifyStatusResult
249
-
250
- /**
251
- * Optional Error object for the
252
- * but currently the machine readable errors are not exported from DID-JWT package to be imported here
253
- */
254
- error?: IError | undefined
255
-
256
- /**
257
- * Other options can be specified for verification.
258
- * They will be forwarded to the lower level modules. that performt the checks
259
- */
260
- [x: string]: any
261
- }
262
-
263
- /**
264
- * An error object, which can contain a code.
265
- * @beta
266
- */
267
- export interface IError {
268
- name?: string
269
-
270
- errors?: IError[]
271
-
272
- /**
273
- * The details of the error being thrown or forwarded
274
- */
275
- message?: string
276
-
277
- /**
278
- * The stack of the error
279
- */
280
- stack?: string | string[]
281
-
282
- details?: IErrorDetails
283
-
284
- /**
285
- * The code for the error being throw
286
- */
287
- errorCode?: string
288
- }
289
-
290
- export interface IErrorDetails {
291
- code?: string
292
- url?: string
293
- cause?: IError
294
- }
295
-
296
- export enum StatusListType {
297
- StatusList2021 = 'StatusList2021',
298
- }
299
- export type StatusPurpose2021 = 'revocation' | 'suspension' | string
300
- export enum StatusListCredentialIdMode {
301
- ISSUANCE = 'ISSUANCE',
302
- PERSISTENCE = 'PERSISTENCE',
303
- NEVER = 'NEVER',
304
- }
305
- export type StatusListIndexingDirection = 'rightToLeft'
306
- export enum StatusListDriverType {
307
- AGENT_TYPEORM = 'agent_typeorm',
308
- AGENT_KV_STORE = 'agent_kv_store',
309
- GITHUB = 'github',
310
- AGENT_FILESYSTEM = 'agent_filesystem',
311
- }
@@ -0,0 +1,300 @@
1
+ import { PresentationSubmission } from './pex'
2
+ import { IProofPurpose, IProofType } from './did'
3
+ import { OriginalType, WrappedVerifiableCredential, WrappedVerifiablePresentation } from './vc'
4
+
5
+ export type AdditionalClaims = Record<string, any>
6
+
7
+ export type IIssuerId = string
8
+
9
+ export interface ICredential {
10
+ '@context': ICredentialContextType | ICredentialContextType[]
11
+ type: string[]
12
+ credentialSchema?: undefined | ICredentialSchemaType | ICredentialSchemaType[]
13
+ // If iss is present, the value MUST be used to set the issuer property of the new credential JSON object or the holderDID property of the new presentation JSON object.
14
+ issuer: IIssuerId | IIssuer
15
+ // If nbf is present, the UNIX timestamp MUST be converted to an [XMLSCHEMA11-2] date-time, and MUST be used to set the value of the issuanceDate property of the new JSON object.
16
+ issuanceDate: string
17
+ // If sub is present, the value MUST be used to set the value of the id property of credentialSubject of the new credential JSON object.
18
+ credentialSubject: (ICredentialSubject & AdditionalClaims) | (ICredentialSubject & AdditionalClaims)[]
19
+ // If exp is present, the UNIX timestamp MUST be converted to an [XMLSCHEMA11-2] date-time, and MUST be used to set the value of the expirationDate property of credentialSubject of the new JSON object.
20
+ expirationDate?: string
21
+ // If jti is present, the value MUST be used to set the value of the id property of the new JSON object.
22
+ id?: string
23
+ credentialStatus?: ICredentialStatus
24
+ description?: string
25
+ name?: string
26
+
27
+ [x: string]: any
28
+ }
29
+
30
+ export interface ICredentialSubject {
31
+ id?: string
32
+ }
33
+
34
+ export type ICredentialContextType = (ICredentialContext & AdditionalClaims) | string
35
+
36
+ export interface ICredentialContext {
37
+ name?: string
38
+ did?: string
39
+ }
40
+
41
+ export type ICredentialSchemaType = ICredentialSchema | string
42
+
43
+ export interface ICredentialSchema {
44
+ id: string
45
+ type?: string
46
+ }
47
+
48
+ export interface IProof {
49
+ type: IProofType | string // The proof type
50
+ created: string // The ISO8601 date-time string for creation
51
+ proofPurpose: IProofPurpose | string // The specific intent for the proof
52
+ verificationMethod: string // A set of parameters required to independently verify the proof
53
+ challenge?: string // A challenge to protect against replay attacks
54
+ domain?: string // A string restricting the (usage of a) proof to the domain and protects against replay attacks
55
+ proofValue?: string // One of any number of valid representations of proof values
56
+ jws?: string // JWS based proof
57
+ jwt?: string //Jwt 2020 proof. Used to map a JWT VC onto a uniform presentation, and retain access to the original JWT
58
+ nonce?: string // Similar to challenge. A nonce to protect against replay attacks, used in some ZKP proofs
59
+ requiredRevealStatements?: string[] // The parts of the proof that must be revealed in a derived proof
60
+
61
+ [x: string]: any // Any because we want to be able to access value1.value2.value3, which unknown does not allow for without a cast
62
+ }
63
+
64
+ export interface ICredentialStatus {
65
+ id: string
66
+ type: string
67
+ }
68
+
69
+ export interface IIssuer {
70
+ id: string
71
+
72
+ [x: string]: any
73
+ }
74
+
75
+ export interface IHasProof {
76
+ proof: IProof | IProof[]
77
+ }
78
+
79
+ export type IVerifiableCredential = ICredential & IHasProof
80
+
81
+ /**
82
+ * Represents a Json Web Token in compact form.
83
+ */
84
+ export type CompactJWT = string
85
+
86
+ /**
87
+ * Represents a signed Verifiable Credential (includes proof), in either JSON, compact JWT or compact SD-JWT VC format.
88
+ * See {@link https://www.w3.org/TR/vc-data-model/#credentials | VC data model}
89
+ * See {@link https://www.w3.org/TR/vc-data-model/#proof-formats | proof formats}
90
+ */
91
+ export type W3CVerifiableCredential = IVerifiableCredential | CompactJWT
92
+
93
+ export interface IPresentation {
94
+ id?: string
95
+ '@context': ICredentialContextType | ICredentialContextType[]
96
+ type?: string | string[]
97
+ verifiableCredential?: W3CVerifiableCredential[]
98
+ presentation_submission?: PresentationSubmission
99
+ holder?: string
100
+ verifier?: string
101
+
102
+ [x: string]: any
103
+ }
104
+
105
+ export type IVerifiablePresentation = IPresentation & IHasProof
106
+
107
+ /**
108
+ * Represents a signed Verifiable Presentation (includes proof), in either JSON or compact JWT format.
109
+ * See {@link https://www.w3.org/TR/vc-data-model/#presentations | VC data model}
110
+ * See {@link https://www.w3.org/TR/vc-data-model/#proof-formats | proof formats}
111
+ */
112
+ export type W3CVerifiablePresentation = IVerifiablePresentation | CompactJWT
113
+
114
+ export interface WrappedW3CVerifiableCredential {
115
+ /**
116
+ * Original VC that we've received
117
+ */
118
+ original: W3CVerifiableCredential | JwtDecodedVerifiableCredential
119
+ /**
120
+ * In case of JWT credential it will be the decoded version. In other cases it will be the same as original one
121
+ */
122
+ decoded: JwtDecodedVerifiableCredential | IVerifiableCredential
123
+ /**
124
+ * Type of this credential. Supported types are json-ld, jwt (decoded/encoded)
125
+ */
126
+ type: OriginalType.JSONLD | OriginalType.JWT_ENCODED | OriginalType.JWT_DECODED
127
+ /**
128
+ * The claim format, typically used during exchange transport protocols
129
+ */
130
+ format: 'jwt_vc' | 'ldp_vc' | 'ldp' | 'jwt'
131
+ /**
132
+ * Internal stable representation of a Credential
133
+ */
134
+ credential: IVerifiableCredential
135
+ }
136
+
137
+ export interface WrappedW3CVerifiablePresentation {
138
+ /**
139
+ * Original VP that we've received
140
+ */
141
+ original: W3CVerifiablePresentation | JwtDecodedVerifiablePresentation
142
+ /**
143
+ * In case of JWT VP it will be the decoded version. In other cases it will be the same as original one
144
+ */
145
+ decoded: JwtDecodedVerifiablePresentation | IVerifiablePresentation
146
+ /**
147
+ * Type of this Presentation. Supported types are json-ld and jwt (decoded/encoded) and sd-jwt-vc (decoded/encoded)
148
+ */
149
+ type: OriginalType.JSONLD | OriginalType.JWT_ENCODED | OriginalType.JWT_DECODED
150
+ /**
151
+ * The claim format, typically used during exchange transport protocols
152
+ */
153
+ format: 'jwt_vp' | 'ldp_vp'
154
+ /**
155
+ * Internal stable representation of a Presentation without proofs, created based on https://www.w3.org/TR/vc-data-model/#jwt-decoding
156
+ */
157
+ presentation: UniformVerifiablePresentation
158
+ /**
159
+ * Wrapped Verifiable Credentials belonging to the Presentation
160
+ */
161
+ vcs: WrappedW3CVerifiableCredential[]
162
+ }
163
+
164
+ export interface UniformVerifiablePresentation {
165
+ '@context': ICredentialContextType | ICredentialContextType[]
166
+ type: string | string[]
167
+ verifiableCredential: WrappedW3CVerifiableCredential[]
168
+ presentation_submission?: PresentationSubmission
169
+ holder?: string
170
+ }
171
+
172
+ export interface JwtDecodedVerifiableCredential {
173
+ vc: IVerifiableCredential
174
+ exp: string
175
+ iss: string
176
+ nbf: string
177
+ sub: string
178
+ jti: string
179
+
180
+ [x: string]: any
181
+ }
182
+
183
+ export interface JwtDecodedVerifiablePresentation {
184
+ vp: IVerifiablePresentation
185
+ exp: string
186
+ iss: string
187
+ nbf: string
188
+ sub: string
189
+ jti: string
190
+ aud: string
191
+ iat: string
192
+
193
+ [x: string]: any
194
+ }
195
+
196
+ export const JWT_PROOF_TYPE_2020 = 'JwtProof2020'
197
+
198
+ export interface IVerifyStatusResult {
199
+ verified: boolean
200
+ /**
201
+ * Optional Error object for the
202
+ * but currently the machine readable errors are not exported from DID-JWT package to be imported here
203
+ */
204
+ error?: IError | undefined
205
+
206
+ /**
207
+ * Other options can be specified for verification.
208
+ * They will be forwarded to the lower level modules. that performt the checks
209
+ */
210
+ [x: string]: any
211
+ }
212
+
213
+ export interface IVerifyResult {
214
+ /**
215
+ * This value is used to transmit the global result of verification.
216
+ */
217
+ verified: boolean
218
+
219
+ results?: [
220
+ {
221
+ credential?: ICredential
222
+ presentation?: IPresentation
223
+ verified: boolean
224
+ error?: IError
225
+ log: [{ id: string; valid: boolean }]
226
+ }
227
+ ]
228
+
229
+ statusResult?: IVerifyStatusResult
230
+
231
+ /**
232
+ * Optional Error object for the
233
+ * but currently the machine readable errors are not exported from DID-JWT package to be imported here
234
+ */
235
+ error?: IError | undefined
236
+
237
+ /**
238
+ * Other options can be specified for verification.
239
+ * They will be forwarded to the lower level modules. that performt the checks
240
+ */
241
+ [x: string]: any
242
+ }
243
+
244
+ /**
245
+ * An error object, which can contain a code.
246
+ * @beta
247
+ */
248
+ export interface IError {
249
+ name?: string
250
+
251
+ errors?: IError[]
252
+
253
+ /**
254
+ * The details of the error being thrown or forwarded
255
+ */
256
+ message?: string
257
+
258
+ /**
259
+ * The stack of the error
260
+ */
261
+ stack?: string | string[]
262
+
263
+ details?: IErrorDetails
264
+
265
+ /**
266
+ * The code for the error being throw
267
+ */
268
+ errorCode?: string
269
+ }
270
+
271
+ export interface IErrorDetails {
272
+ code?: string
273
+ url?: string
274
+ cause?: IError
275
+ }
276
+
277
+ export enum StatusListType {
278
+ StatusList2021 = 'StatusList2021',
279
+ }
280
+ export type StatusPurpose2021 = 'revocation' | 'suspension' | string
281
+ export enum StatusListCredentialIdMode {
282
+ ISSUANCE = 'ISSUANCE',
283
+ PERSISTENCE = 'PERSISTENCE',
284
+ NEVER = 'NEVER',
285
+ }
286
+ export type StatusListIndexingDirection = 'rightToLeft'
287
+ export enum StatusListDriverType {
288
+ AGENT_TYPEORM = 'agent_typeorm',
289
+ AGENT_KV_STORE = 'agent_kv_store',
290
+ GITHUB = 'github',
291
+ AGENT_FILESYSTEM = 'agent_filesystem',
292
+ }
293
+
294
+ export function isWrappedW3CVerifiableCredential(vc: WrappedVerifiableCredential): vc is WrappedW3CVerifiableCredential {
295
+ return vc.format === 'jwt_vc' || vc.format === 'ldp_vc'
296
+ }
297
+
298
+ export function isWrappedW3CVerifiablePresentation(vp: WrappedVerifiablePresentation): vp is WrappedW3CVerifiablePresentation {
299
+ return vp.format === 'jwt_vp' || vp.format === 'ldp_vp'
300
+ }
@@ -13,7 +13,7 @@ export class ObjectUtils {
13
13
  ObjectUtils.isString(url) && isAbsoluteRegex.test(url)
14
14
  }
15
15
 
16
- public static isString(value: unknown): boolean {
16
+ public static isString(value: unknown): value is string {
17
17
  return typeof value === 'string' || Object.prototype.toString.call(value) === '[object String]'
18
18
  }
19
19
  }