@sphereon/ssi-types 0.30.1-unstable.4 → 0.30.1

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