@sphereon/ssi-types 0.18.2-next.9 → 0.18.2-unstable.13
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/LICENSE +201 -201
- package/README.md +49 -49
- package/dist/index.d.ts +3 -3
- package/dist/index.js +19 -19
- package/dist/mapper/credential-mapper.d.ts +107 -107
- package/dist/mapper/credential-mapper.js +556 -556
- package/dist/mapper/index.d.ts +1 -1
- package/dist/mapper/index.js +17 -17
- package/dist/types/did.d.ts +35 -35
- package/dist/types/did.js +75 -75
- package/dist/types/generic.d.ts +7 -7
- package/dist/types/generic.js +2 -2
- package/dist/types/index.d.ts +6 -6
- package/dist/types/index.js +22 -22
- package/dist/types/pex.d.ts +35 -35
- package/dist/types/pex.js +2 -2
- package/dist/types/sd-jwt-vc.d.ts +170 -170
- package/dist/types/sd-jwt-vc.js +71 -71
- package/dist/types/vc.d.ts +23 -23
- package/dist/types/vc.js +23 -23
- package/dist/types/w3c-vc.d.ts +247 -247
- package/dist/types/w3c-vc.js +29 -29
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +17 -17
- package/dist/utils/object.d.ts +6 -6
- package/dist/utils/object.js +20 -20
- package/package.json +2 -2
- package/src/index.ts +3 -3
- package/src/mapper/credential-mapper.ts +686 -686
- package/src/mapper/index.ts +1 -1
- package/src/types/generic.ts +8 -8
- package/src/types/index.ts +6 -6
- package/src/types/pex.ts +36 -36
- package/src/types/sd-jwt-vc.ts +232 -232
- package/src/types/vc.ts +62 -62
- package/src/types/w3c-vc.ts +300 -300
- package/src/utils/index.ts +1 -1
- package/src/utils/object.ts +19 -19
package/dist/types/w3c-vc.d.ts
CHANGED
|
@@ -1,248 +1,248 @@
|
|
|
1
|
-
import { PresentationSubmission } from './pex';
|
|
2
|
-
import { IProofPurpose, IProofType } from './did';
|
|
3
|
-
import { OriginalType, WrappedVerifiableCredential, WrappedVerifiablePresentation } from './vc';
|
|
4
|
-
export type AdditionalClaims = Record<string, any>;
|
|
5
|
-
export type IIssuerId = string;
|
|
6
|
-
export interface ICredential {
|
|
7
|
-
'@context': ICredentialContextType | ICredentialContextType[];
|
|
8
|
-
type: string[];
|
|
9
|
-
credentialSchema?: undefined | ICredentialSchemaType | ICredentialSchemaType[];
|
|
10
|
-
issuer: IIssuerId | IIssuer;
|
|
11
|
-
issuanceDate: string;
|
|
12
|
-
credentialSubject: (ICredentialSubject & AdditionalClaims) | (ICredentialSubject & AdditionalClaims)[];
|
|
13
|
-
expirationDate?: string;
|
|
14
|
-
id?: string;
|
|
15
|
-
credentialStatus?: ICredentialStatus;
|
|
16
|
-
description?: string;
|
|
17
|
-
name?: string;
|
|
18
|
-
[x: string]: any;
|
|
19
|
-
}
|
|
20
|
-
export interface ICredentialSubject {
|
|
21
|
-
id?: string;
|
|
22
|
-
}
|
|
23
|
-
export type ICredentialContextType = (ICredentialContext & AdditionalClaims) | string;
|
|
24
|
-
export interface ICredentialContext {
|
|
25
|
-
name?: string;
|
|
26
|
-
did?: string;
|
|
27
|
-
}
|
|
28
|
-
export type ICredentialSchemaType = ICredentialSchema | string;
|
|
29
|
-
export interface ICredentialSchema {
|
|
30
|
-
id: string;
|
|
31
|
-
type?: string;
|
|
32
|
-
}
|
|
33
|
-
export interface IProof {
|
|
34
|
-
type: IProofType | string;
|
|
35
|
-
created: string;
|
|
36
|
-
proofPurpose: IProofPurpose | string;
|
|
37
|
-
verificationMethod: string;
|
|
38
|
-
challenge?: string;
|
|
39
|
-
domain?: string;
|
|
40
|
-
proofValue?: string;
|
|
41
|
-
jws?: string;
|
|
42
|
-
jwt?: string;
|
|
43
|
-
nonce?: string;
|
|
44
|
-
requiredRevealStatements?: string[];
|
|
45
|
-
[x: string]: any;
|
|
46
|
-
}
|
|
47
|
-
export interface ICredentialStatus {
|
|
48
|
-
id: string;
|
|
49
|
-
type: string;
|
|
50
|
-
}
|
|
51
|
-
export interface IIssuer {
|
|
52
|
-
id: string;
|
|
53
|
-
[x: string]: any;
|
|
54
|
-
}
|
|
55
|
-
export interface IHasProof {
|
|
56
|
-
proof: IProof | IProof[];
|
|
57
|
-
}
|
|
58
|
-
export type IVerifiableCredential = ICredential & IHasProof;
|
|
59
|
-
/**
|
|
60
|
-
* Represents a Json Web Token in compact form.
|
|
61
|
-
*/
|
|
62
|
-
export type CompactJWT = string;
|
|
63
|
-
/**
|
|
64
|
-
* Represents a signed Verifiable Credential (includes proof), in either JSON, compact JWT or compact SD-JWT VC format.
|
|
65
|
-
* See {@link https://www.w3.org/TR/vc-data-model/#credentials | VC data model}
|
|
66
|
-
* See {@link https://www.w3.org/TR/vc-data-model/#proof-formats | proof formats}
|
|
67
|
-
*/
|
|
68
|
-
export type W3CVerifiableCredential = IVerifiableCredential | CompactJWT;
|
|
69
|
-
export interface IPresentation {
|
|
70
|
-
id?: string;
|
|
71
|
-
'@context': ICredentialContextType | ICredentialContextType[];
|
|
72
|
-
type?: string | string[];
|
|
73
|
-
verifiableCredential?: W3CVerifiableCredential[];
|
|
74
|
-
presentation_submission?: PresentationSubmission;
|
|
75
|
-
holder?: string;
|
|
76
|
-
verifier?: string;
|
|
77
|
-
[x: string]: any;
|
|
78
|
-
}
|
|
79
|
-
export type IVerifiablePresentation = IPresentation & IHasProof;
|
|
80
|
-
/**
|
|
81
|
-
* Represents a signed Verifiable Presentation (includes proof), in either JSON or compact JWT format.
|
|
82
|
-
* See {@link https://www.w3.org/TR/vc-data-model/#presentations | VC data model}
|
|
83
|
-
* See {@link https://www.w3.org/TR/vc-data-model/#proof-formats | proof formats}
|
|
84
|
-
*/
|
|
85
|
-
export type W3CVerifiablePresentation = IVerifiablePresentation | CompactJWT;
|
|
86
|
-
export interface WrappedW3CVerifiableCredential {
|
|
87
|
-
/**
|
|
88
|
-
* Original VC that we've received
|
|
89
|
-
*/
|
|
90
|
-
original: W3CVerifiableCredential | JwtDecodedVerifiableCredential;
|
|
91
|
-
/**
|
|
92
|
-
* In case of JWT credential it will be the decoded version. In other cases it will be the same as original one
|
|
93
|
-
*/
|
|
94
|
-
decoded: JwtDecodedVerifiableCredential | IVerifiableCredential;
|
|
95
|
-
/**
|
|
96
|
-
* Type of this credential. Supported types are json-ld, jwt (decoded/encoded)
|
|
97
|
-
*/
|
|
98
|
-
type: OriginalType.JSONLD | OriginalType.JWT_ENCODED | OriginalType.JWT_DECODED;
|
|
99
|
-
/**
|
|
100
|
-
* The claim format, typically used during exchange transport protocols
|
|
101
|
-
*/
|
|
102
|
-
format: 'jwt_vc' | 'ldp_vc' | 'ldp' | 'jwt';
|
|
103
|
-
/**
|
|
104
|
-
* Internal stable representation of a Credential
|
|
105
|
-
*/
|
|
106
|
-
credential: IVerifiableCredential;
|
|
107
|
-
}
|
|
108
|
-
export interface WrappedW3CVerifiablePresentation {
|
|
109
|
-
/**
|
|
110
|
-
* Original VP that we've received
|
|
111
|
-
*/
|
|
112
|
-
original: W3CVerifiablePresentation | JwtDecodedVerifiablePresentation;
|
|
113
|
-
/**
|
|
114
|
-
* In case of JWT VP it will be the decoded version. In other cases it will be the same as original one
|
|
115
|
-
*/
|
|
116
|
-
decoded: JwtDecodedVerifiablePresentation | IVerifiablePresentation;
|
|
117
|
-
/**
|
|
118
|
-
* Type of this Presentation. Supported types are json-ld and jwt (decoded/encoded) and sd-jwt-vc (decoded/encoded)
|
|
119
|
-
*/
|
|
120
|
-
type: OriginalType.JSONLD | OriginalType.JWT_ENCODED | OriginalType.JWT_DECODED;
|
|
121
|
-
/**
|
|
122
|
-
* The claim format, typically used during exchange transport protocols
|
|
123
|
-
*/
|
|
124
|
-
format: 'jwt_vp' | 'ldp_vp';
|
|
125
|
-
/**
|
|
126
|
-
* Internal stable representation of a Presentation without proofs, created based on https://www.w3.org/TR/vc-data-model/#jwt-decoding
|
|
127
|
-
*/
|
|
128
|
-
presentation: UniformVerifiablePresentation;
|
|
129
|
-
/**
|
|
130
|
-
* Wrapped Verifiable Credentials belonging to the Presentation
|
|
131
|
-
*/
|
|
132
|
-
vcs: WrappedW3CVerifiableCredential[];
|
|
133
|
-
}
|
|
134
|
-
export interface UniformVerifiablePresentation {
|
|
135
|
-
'@context': ICredentialContextType | ICredentialContextType[];
|
|
136
|
-
type: string | string[];
|
|
137
|
-
verifiableCredential: WrappedW3CVerifiableCredential[];
|
|
138
|
-
presentation_submission?: PresentationSubmission;
|
|
139
|
-
holder?: string;
|
|
140
|
-
}
|
|
141
|
-
export interface JwtDecodedVerifiableCredential {
|
|
142
|
-
vc: IVerifiableCredential;
|
|
143
|
-
exp: string;
|
|
144
|
-
iss: string;
|
|
145
|
-
nbf: string;
|
|
146
|
-
sub: string;
|
|
147
|
-
jti: string;
|
|
148
|
-
[x: string]: any;
|
|
149
|
-
}
|
|
150
|
-
export interface JwtDecodedVerifiablePresentation {
|
|
151
|
-
vp: IVerifiablePresentation;
|
|
152
|
-
exp: string;
|
|
153
|
-
iss: string;
|
|
154
|
-
nbf: string;
|
|
155
|
-
sub: string;
|
|
156
|
-
jti: string;
|
|
157
|
-
aud: string;
|
|
158
|
-
iat: string;
|
|
159
|
-
[x: string]: any;
|
|
160
|
-
}
|
|
161
|
-
export declare const JWT_PROOF_TYPE_2020 = "JwtProof2020";
|
|
162
|
-
export interface IVerifyStatusResult {
|
|
163
|
-
verified: boolean;
|
|
164
|
-
/**
|
|
165
|
-
* Optional Error object for the
|
|
166
|
-
* but currently the machine readable errors are not exported from DID-JWT package to be imported here
|
|
167
|
-
*/
|
|
168
|
-
error?: IError | undefined;
|
|
169
|
-
/**
|
|
170
|
-
* Other options can be specified for verification.
|
|
171
|
-
* They will be forwarded to the lower level modules. that performt the checks
|
|
172
|
-
*/
|
|
173
|
-
[x: string]: any;
|
|
174
|
-
}
|
|
175
|
-
export interface IVerifyResult {
|
|
176
|
-
/**
|
|
177
|
-
* This value is used to transmit the global result of verification.
|
|
178
|
-
*/
|
|
179
|
-
verified: boolean;
|
|
180
|
-
results?: [
|
|
181
|
-
{
|
|
182
|
-
credential?: ICredential;
|
|
183
|
-
presentation?: IPresentation;
|
|
184
|
-
verified: boolean;
|
|
185
|
-
error?: IError;
|
|
186
|
-
log: [{
|
|
187
|
-
id: string;
|
|
188
|
-
valid: boolean;
|
|
189
|
-
}];
|
|
190
|
-
}
|
|
191
|
-
];
|
|
192
|
-
statusResult?: IVerifyStatusResult;
|
|
193
|
-
/**
|
|
194
|
-
* Optional Error object for the
|
|
195
|
-
* but currently the machine readable errors are not exported from DID-JWT package to be imported here
|
|
196
|
-
*/
|
|
197
|
-
error?: IError | undefined;
|
|
198
|
-
/**
|
|
199
|
-
* Other options can be specified for verification.
|
|
200
|
-
* They will be forwarded to the lower level modules. that performt the checks
|
|
201
|
-
*/
|
|
202
|
-
[x: string]: any;
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* An error object, which can contain a code.
|
|
206
|
-
* @beta
|
|
207
|
-
*/
|
|
208
|
-
export interface IError {
|
|
209
|
-
name?: string;
|
|
210
|
-
errors?: IError[];
|
|
211
|
-
/**
|
|
212
|
-
* The details of the error being thrown or forwarded
|
|
213
|
-
*/
|
|
214
|
-
message?: string;
|
|
215
|
-
/**
|
|
216
|
-
* The stack of the error
|
|
217
|
-
*/
|
|
218
|
-
stack?: string | string[];
|
|
219
|
-
details?: IErrorDetails;
|
|
220
|
-
/**
|
|
221
|
-
* The code for the error being throw
|
|
222
|
-
*/
|
|
223
|
-
errorCode?: string;
|
|
224
|
-
}
|
|
225
|
-
export interface IErrorDetails {
|
|
226
|
-
code?: string;
|
|
227
|
-
url?: string;
|
|
228
|
-
cause?: IError;
|
|
229
|
-
}
|
|
230
|
-
export declare enum StatusListType {
|
|
231
|
-
StatusList2021 = "StatusList2021"
|
|
232
|
-
}
|
|
233
|
-
export type StatusPurpose2021 = 'revocation' | 'suspension' | string;
|
|
234
|
-
export declare enum StatusListCredentialIdMode {
|
|
235
|
-
ISSUANCE = "ISSUANCE",
|
|
236
|
-
PERSISTENCE = "PERSISTENCE",
|
|
237
|
-
NEVER = "NEVER"
|
|
238
|
-
}
|
|
239
|
-
export type StatusListIndexingDirection = 'rightToLeft';
|
|
240
|
-
export declare enum StatusListDriverType {
|
|
241
|
-
AGENT_TYPEORM = "agent_typeorm",
|
|
242
|
-
AGENT_KV_STORE = "agent_kv_store",
|
|
243
|
-
GITHUB = "github",
|
|
244
|
-
AGENT_FILESYSTEM = "agent_filesystem"
|
|
245
|
-
}
|
|
246
|
-
export declare function isWrappedW3CVerifiableCredential(vc: WrappedVerifiableCredential): vc is WrappedW3CVerifiableCredential;
|
|
247
|
-
export declare function isWrappedW3CVerifiablePresentation(vp: WrappedVerifiablePresentation): vp is WrappedW3CVerifiablePresentation;
|
|
1
|
+
import { PresentationSubmission } from './pex';
|
|
2
|
+
import { IProofPurpose, IProofType } from './did';
|
|
3
|
+
import { OriginalType, WrappedVerifiableCredential, WrappedVerifiablePresentation } from './vc';
|
|
4
|
+
export type AdditionalClaims = Record<string, any>;
|
|
5
|
+
export type IIssuerId = string;
|
|
6
|
+
export interface ICredential {
|
|
7
|
+
'@context': ICredentialContextType | ICredentialContextType[];
|
|
8
|
+
type: string[];
|
|
9
|
+
credentialSchema?: undefined | ICredentialSchemaType | ICredentialSchemaType[];
|
|
10
|
+
issuer: IIssuerId | IIssuer;
|
|
11
|
+
issuanceDate: string;
|
|
12
|
+
credentialSubject: (ICredentialSubject & AdditionalClaims) | (ICredentialSubject & AdditionalClaims)[];
|
|
13
|
+
expirationDate?: string;
|
|
14
|
+
id?: string;
|
|
15
|
+
credentialStatus?: ICredentialStatus;
|
|
16
|
+
description?: string;
|
|
17
|
+
name?: string;
|
|
18
|
+
[x: string]: any;
|
|
19
|
+
}
|
|
20
|
+
export interface ICredentialSubject {
|
|
21
|
+
id?: string;
|
|
22
|
+
}
|
|
23
|
+
export type ICredentialContextType = (ICredentialContext & AdditionalClaims) | string;
|
|
24
|
+
export interface ICredentialContext {
|
|
25
|
+
name?: string;
|
|
26
|
+
did?: string;
|
|
27
|
+
}
|
|
28
|
+
export type ICredentialSchemaType = ICredentialSchema | string;
|
|
29
|
+
export interface ICredentialSchema {
|
|
30
|
+
id: string;
|
|
31
|
+
type?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface IProof {
|
|
34
|
+
type: IProofType | string;
|
|
35
|
+
created: string;
|
|
36
|
+
proofPurpose: IProofPurpose | string;
|
|
37
|
+
verificationMethod: string;
|
|
38
|
+
challenge?: string;
|
|
39
|
+
domain?: string;
|
|
40
|
+
proofValue?: string;
|
|
41
|
+
jws?: string;
|
|
42
|
+
jwt?: string;
|
|
43
|
+
nonce?: string;
|
|
44
|
+
requiredRevealStatements?: string[];
|
|
45
|
+
[x: string]: any;
|
|
46
|
+
}
|
|
47
|
+
export interface ICredentialStatus {
|
|
48
|
+
id: string;
|
|
49
|
+
type: string;
|
|
50
|
+
}
|
|
51
|
+
export interface IIssuer {
|
|
52
|
+
id: string;
|
|
53
|
+
[x: string]: any;
|
|
54
|
+
}
|
|
55
|
+
export interface IHasProof {
|
|
56
|
+
proof: IProof | IProof[];
|
|
57
|
+
}
|
|
58
|
+
export type IVerifiableCredential = ICredential & IHasProof;
|
|
59
|
+
/**
|
|
60
|
+
* Represents a Json Web Token in compact form.
|
|
61
|
+
*/
|
|
62
|
+
export type CompactJWT = string;
|
|
63
|
+
/**
|
|
64
|
+
* Represents a signed Verifiable Credential (includes proof), in either JSON, compact JWT or compact SD-JWT VC format.
|
|
65
|
+
* See {@link https://www.w3.org/TR/vc-data-model/#credentials | VC data model}
|
|
66
|
+
* See {@link https://www.w3.org/TR/vc-data-model/#proof-formats | proof formats}
|
|
67
|
+
*/
|
|
68
|
+
export type W3CVerifiableCredential = IVerifiableCredential | CompactJWT;
|
|
69
|
+
export interface IPresentation {
|
|
70
|
+
id?: string;
|
|
71
|
+
'@context': ICredentialContextType | ICredentialContextType[];
|
|
72
|
+
type?: string | string[];
|
|
73
|
+
verifiableCredential?: W3CVerifiableCredential[];
|
|
74
|
+
presentation_submission?: PresentationSubmission;
|
|
75
|
+
holder?: string;
|
|
76
|
+
verifier?: string;
|
|
77
|
+
[x: string]: any;
|
|
78
|
+
}
|
|
79
|
+
export type IVerifiablePresentation = IPresentation & IHasProof;
|
|
80
|
+
/**
|
|
81
|
+
* Represents a signed Verifiable Presentation (includes proof), in either JSON or compact JWT format.
|
|
82
|
+
* See {@link https://www.w3.org/TR/vc-data-model/#presentations | VC data model}
|
|
83
|
+
* See {@link https://www.w3.org/TR/vc-data-model/#proof-formats | proof formats}
|
|
84
|
+
*/
|
|
85
|
+
export type W3CVerifiablePresentation = IVerifiablePresentation | CompactJWT;
|
|
86
|
+
export interface WrappedW3CVerifiableCredential {
|
|
87
|
+
/**
|
|
88
|
+
* Original VC that we've received
|
|
89
|
+
*/
|
|
90
|
+
original: W3CVerifiableCredential | JwtDecodedVerifiableCredential;
|
|
91
|
+
/**
|
|
92
|
+
* In case of JWT credential it will be the decoded version. In other cases it will be the same as original one
|
|
93
|
+
*/
|
|
94
|
+
decoded: JwtDecodedVerifiableCredential | IVerifiableCredential;
|
|
95
|
+
/**
|
|
96
|
+
* Type of this credential. Supported types are json-ld, jwt (decoded/encoded)
|
|
97
|
+
*/
|
|
98
|
+
type: OriginalType.JSONLD | OriginalType.JWT_ENCODED | OriginalType.JWT_DECODED;
|
|
99
|
+
/**
|
|
100
|
+
* The claim format, typically used during exchange transport protocols
|
|
101
|
+
*/
|
|
102
|
+
format: 'jwt_vc' | 'ldp_vc' | 'ldp' | 'jwt';
|
|
103
|
+
/**
|
|
104
|
+
* Internal stable representation of a Credential
|
|
105
|
+
*/
|
|
106
|
+
credential: IVerifiableCredential;
|
|
107
|
+
}
|
|
108
|
+
export interface WrappedW3CVerifiablePresentation {
|
|
109
|
+
/**
|
|
110
|
+
* Original VP that we've received
|
|
111
|
+
*/
|
|
112
|
+
original: W3CVerifiablePresentation | JwtDecodedVerifiablePresentation;
|
|
113
|
+
/**
|
|
114
|
+
* In case of JWT VP it will be the decoded version. In other cases it will be the same as original one
|
|
115
|
+
*/
|
|
116
|
+
decoded: JwtDecodedVerifiablePresentation | IVerifiablePresentation;
|
|
117
|
+
/**
|
|
118
|
+
* Type of this Presentation. Supported types are json-ld and jwt (decoded/encoded) and sd-jwt-vc (decoded/encoded)
|
|
119
|
+
*/
|
|
120
|
+
type: OriginalType.JSONLD | OriginalType.JWT_ENCODED | OriginalType.JWT_DECODED;
|
|
121
|
+
/**
|
|
122
|
+
* The claim format, typically used during exchange transport protocols
|
|
123
|
+
*/
|
|
124
|
+
format: 'jwt_vp' | 'ldp_vp';
|
|
125
|
+
/**
|
|
126
|
+
* Internal stable representation of a Presentation without proofs, created based on https://www.w3.org/TR/vc-data-model/#jwt-decoding
|
|
127
|
+
*/
|
|
128
|
+
presentation: UniformVerifiablePresentation;
|
|
129
|
+
/**
|
|
130
|
+
* Wrapped Verifiable Credentials belonging to the Presentation
|
|
131
|
+
*/
|
|
132
|
+
vcs: WrappedW3CVerifiableCredential[];
|
|
133
|
+
}
|
|
134
|
+
export interface UniformVerifiablePresentation {
|
|
135
|
+
'@context': ICredentialContextType | ICredentialContextType[];
|
|
136
|
+
type: string | string[];
|
|
137
|
+
verifiableCredential: WrappedW3CVerifiableCredential[];
|
|
138
|
+
presentation_submission?: PresentationSubmission;
|
|
139
|
+
holder?: string;
|
|
140
|
+
}
|
|
141
|
+
export interface JwtDecodedVerifiableCredential {
|
|
142
|
+
vc: IVerifiableCredential;
|
|
143
|
+
exp: string;
|
|
144
|
+
iss: string;
|
|
145
|
+
nbf: string;
|
|
146
|
+
sub: string;
|
|
147
|
+
jti: string;
|
|
148
|
+
[x: string]: any;
|
|
149
|
+
}
|
|
150
|
+
export interface JwtDecodedVerifiablePresentation {
|
|
151
|
+
vp: IVerifiablePresentation;
|
|
152
|
+
exp: string;
|
|
153
|
+
iss: string;
|
|
154
|
+
nbf: string;
|
|
155
|
+
sub: string;
|
|
156
|
+
jti: string;
|
|
157
|
+
aud: string;
|
|
158
|
+
iat: string;
|
|
159
|
+
[x: string]: any;
|
|
160
|
+
}
|
|
161
|
+
export declare const JWT_PROOF_TYPE_2020 = "JwtProof2020";
|
|
162
|
+
export interface IVerifyStatusResult {
|
|
163
|
+
verified: boolean;
|
|
164
|
+
/**
|
|
165
|
+
* Optional Error object for the
|
|
166
|
+
* but currently the machine readable errors are not exported from DID-JWT package to be imported here
|
|
167
|
+
*/
|
|
168
|
+
error?: IError | undefined;
|
|
169
|
+
/**
|
|
170
|
+
* Other options can be specified for verification.
|
|
171
|
+
* They will be forwarded to the lower level modules. that performt the checks
|
|
172
|
+
*/
|
|
173
|
+
[x: string]: any;
|
|
174
|
+
}
|
|
175
|
+
export interface IVerifyResult {
|
|
176
|
+
/**
|
|
177
|
+
* This value is used to transmit the global result of verification.
|
|
178
|
+
*/
|
|
179
|
+
verified: boolean;
|
|
180
|
+
results?: [
|
|
181
|
+
{
|
|
182
|
+
credential?: ICredential;
|
|
183
|
+
presentation?: IPresentation;
|
|
184
|
+
verified: boolean;
|
|
185
|
+
error?: IError;
|
|
186
|
+
log: [{
|
|
187
|
+
id: string;
|
|
188
|
+
valid: boolean;
|
|
189
|
+
}];
|
|
190
|
+
}
|
|
191
|
+
];
|
|
192
|
+
statusResult?: IVerifyStatusResult;
|
|
193
|
+
/**
|
|
194
|
+
* Optional Error object for the
|
|
195
|
+
* but currently the machine readable errors are not exported from DID-JWT package to be imported here
|
|
196
|
+
*/
|
|
197
|
+
error?: IError | undefined;
|
|
198
|
+
/**
|
|
199
|
+
* Other options can be specified for verification.
|
|
200
|
+
* They will be forwarded to the lower level modules. that performt the checks
|
|
201
|
+
*/
|
|
202
|
+
[x: string]: any;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* An error object, which can contain a code.
|
|
206
|
+
* @beta
|
|
207
|
+
*/
|
|
208
|
+
export interface IError {
|
|
209
|
+
name?: string;
|
|
210
|
+
errors?: IError[];
|
|
211
|
+
/**
|
|
212
|
+
* The details of the error being thrown or forwarded
|
|
213
|
+
*/
|
|
214
|
+
message?: string;
|
|
215
|
+
/**
|
|
216
|
+
* The stack of the error
|
|
217
|
+
*/
|
|
218
|
+
stack?: string | string[];
|
|
219
|
+
details?: IErrorDetails;
|
|
220
|
+
/**
|
|
221
|
+
* The code for the error being throw
|
|
222
|
+
*/
|
|
223
|
+
errorCode?: string;
|
|
224
|
+
}
|
|
225
|
+
export interface IErrorDetails {
|
|
226
|
+
code?: string;
|
|
227
|
+
url?: string;
|
|
228
|
+
cause?: IError;
|
|
229
|
+
}
|
|
230
|
+
export declare enum StatusListType {
|
|
231
|
+
StatusList2021 = "StatusList2021"
|
|
232
|
+
}
|
|
233
|
+
export type StatusPurpose2021 = 'revocation' | 'suspension' | string;
|
|
234
|
+
export declare enum StatusListCredentialIdMode {
|
|
235
|
+
ISSUANCE = "ISSUANCE",
|
|
236
|
+
PERSISTENCE = "PERSISTENCE",
|
|
237
|
+
NEVER = "NEVER"
|
|
238
|
+
}
|
|
239
|
+
export type StatusListIndexingDirection = 'rightToLeft';
|
|
240
|
+
export declare enum StatusListDriverType {
|
|
241
|
+
AGENT_TYPEORM = "agent_typeorm",
|
|
242
|
+
AGENT_KV_STORE = "agent_kv_store",
|
|
243
|
+
GITHUB = "github",
|
|
244
|
+
AGENT_FILESYSTEM = "agent_filesystem"
|
|
245
|
+
}
|
|
246
|
+
export declare function isWrappedW3CVerifiableCredential(vc: WrappedVerifiableCredential): vc is WrappedW3CVerifiableCredential;
|
|
247
|
+
export declare function isWrappedW3CVerifiablePresentation(vp: WrappedVerifiablePresentation): vp is WrappedW3CVerifiablePresentation;
|
|
248
248
|
//# sourceMappingURL=w3c-vc.d.ts.map
|
package/dist/types/w3c-vc.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isWrappedW3CVerifiablePresentation = exports.isWrappedW3CVerifiableCredential = exports.StatusListDriverType = exports.StatusListCredentialIdMode = exports.StatusListType = exports.JWT_PROOF_TYPE_2020 = void 0;
|
|
4
|
-
exports.JWT_PROOF_TYPE_2020 = 'JwtProof2020';
|
|
5
|
-
var StatusListType;
|
|
6
|
-
(function (StatusListType) {
|
|
7
|
-
StatusListType["StatusList2021"] = "StatusList2021";
|
|
8
|
-
})(StatusListType = exports.StatusListType || (exports.StatusListType = {}));
|
|
9
|
-
var StatusListCredentialIdMode;
|
|
10
|
-
(function (StatusListCredentialIdMode) {
|
|
11
|
-
StatusListCredentialIdMode["ISSUANCE"] = "ISSUANCE";
|
|
12
|
-
StatusListCredentialIdMode["PERSISTENCE"] = "PERSISTENCE";
|
|
13
|
-
StatusListCredentialIdMode["NEVER"] = "NEVER";
|
|
14
|
-
})(StatusListCredentialIdMode = exports.StatusListCredentialIdMode || (exports.StatusListCredentialIdMode = {}));
|
|
15
|
-
var StatusListDriverType;
|
|
16
|
-
(function (StatusListDriverType) {
|
|
17
|
-
StatusListDriverType["AGENT_TYPEORM"] = "agent_typeorm";
|
|
18
|
-
StatusListDriverType["AGENT_KV_STORE"] = "agent_kv_store";
|
|
19
|
-
StatusListDriverType["GITHUB"] = "github";
|
|
20
|
-
StatusListDriverType["AGENT_FILESYSTEM"] = "agent_filesystem";
|
|
21
|
-
})(StatusListDriverType = exports.StatusListDriverType || (exports.StatusListDriverType = {}));
|
|
22
|
-
function isWrappedW3CVerifiableCredential(vc) {
|
|
23
|
-
return vc.format === 'jwt_vc' || vc.format === 'ldp_vc';
|
|
24
|
-
}
|
|
25
|
-
exports.isWrappedW3CVerifiableCredential = isWrappedW3CVerifiableCredential;
|
|
26
|
-
function isWrappedW3CVerifiablePresentation(vp) {
|
|
27
|
-
return vp.format === 'jwt_vp' || vp.format === 'ldp_vp';
|
|
28
|
-
}
|
|
29
|
-
exports.isWrappedW3CVerifiablePresentation = isWrappedW3CVerifiablePresentation;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isWrappedW3CVerifiablePresentation = exports.isWrappedW3CVerifiableCredential = exports.StatusListDriverType = exports.StatusListCredentialIdMode = exports.StatusListType = exports.JWT_PROOF_TYPE_2020 = void 0;
|
|
4
|
+
exports.JWT_PROOF_TYPE_2020 = 'JwtProof2020';
|
|
5
|
+
var StatusListType;
|
|
6
|
+
(function (StatusListType) {
|
|
7
|
+
StatusListType["StatusList2021"] = "StatusList2021";
|
|
8
|
+
})(StatusListType = exports.StatusListType || (exports.StatusListType = {}));
|
|
9
|
+
var StatusListCredentialIdMode;
|
|
10
|
+
(function (StatusListCredentialIdMode) {
|
|
11
|
+
StatusListCredentialIdMode["ISSUANCE"] = "ISSUANCE";
|
|
12
|
+
StatusListCredentialIdMode["PERSISTENCE"] = "PERSISTENCE";
|
|
13
|
+
StatusListCredentialIdMode["NEVER"] = "NEVER";
|
|
14
|
+
})(StatusListCredentialIdMode = exports.StatusListCredentialIdMode || (exports.StatusListCredentialIdMode = {}));
|
|
15
|
+
var StatusListDriverType;
|
|
16
|
+
(function (StatusListDriverType) {
|
|
17
|
+
StatusListDriverType["AGENT_TYPEORM"] = "agent_typeorm";
|
|
18
|
+
StatusListDriverType["AGENT_KV_STORE"] = "agent_kv_store";
|
|
19
|
+
StatusListDriverType["GITHUB"] = "github";
|
|
20
|
+
StatusListDriverType["AGENT_FILESYSTEM"] = "agent_filesystem";
|
|
21
|
+
})(StatusListDriverType = exports.StatusListDriverType || (exports.StatusListDriverType = {}));
|
|
22
|
+
function isWrappedW3CVerifiableCredential(vc) {
|
|
23
|
+
return vc.format === 'jwt_vc' || vc.format === 'ldp_vc';
|
|
24
|
+
}
|
|
25
|
+
exports.isWrappedW3CVerifiableCredential = isWrappedW3CVerifiableCredential;
|
|
26
|
+
function isWrappedW3CVerifiablePresentation(vp) {
|
|
27
|
+
return vp.format === 'jwt_vp' || vp.format === 'ldp_vp';
|
|
28
|
+
}
|
|
29
|
+
exports.isWrappedW3CVerifiablePresentation = isWrappedW3CVerifiablePresentation;
|
|
30
30
|
//# sourceMappingURL=w3c-vc.js.map
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './object';
|
|
1
|
+
export * from './object';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/utils/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./object"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./object"), exports);
|
|
18
18
|
//# sourceMappingURL=index.js.map
|
package/dist/utils/object.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare class ObjectUtils {
|
|
2
|
-
static asArray(value: unknown): any[];
|
|
3
|
-
static isObject(value: unknown): boolean;
|
|
4
|
-
static isUrlAbsolute(url: string): void;
|
|
5
|
-
static isString(value: unknown): value is string;
|
|
6
|
-
}
|
|
1
|
+
export declare class ObjectUtils {
|
|
2
|
+
static asArray(value: unknown): any[];
|
|
3
|
+
static isObject(value: unknown): boolean;
|
|
4
|
+
static isUrlAbsolute(url: string): void;
|
|
5
|
+
static isString(value: unknown): value is string;
|
|
6
|
+
}
|
|
7
7
|
//# sourceMappingURL=object.d.ts.map
|
package/dist/utils/object.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ObjectUtils = void 0;
|
|
4
|
-
class ObjectUtils {
|
|
5
|
-
static asArray(value) {
|
|
6
|
-
return Array.isArray(value) ? value : [value];
|
|
7
|
-
}
|
|
8
|
-
static isObject(value) {
|
|
9
|
-
return Object.prototype.toString.call(value) === '[object Object]';
|
|
10
|
-
}
|
|
11
|
-
static isUrlAbsolute(url) {
|
|
12
|
-
// regex to check for absolute IRI (starting scheme and ':') or blank node IRI
|
|
13
|
-
const isAbsoluteRegex = /^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;
|
|
14
|
-
ObjectUtils.isString(url) && isAbsoluteRegex.test(url);
|
|
15
|
-
}
|
|
16
|
-
static isString(value) {
|
|
17
|
-
return typeof value === 'string' || Object.prototype.toString.call(value) === '[object String]';
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.ObjectUtils = ObjectUtils;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ObjectUtils = void 0;
|
|
4
|
+
class ObjectUtils {
|
|
5
|
+
static asArray(value) {
|
|
6
|
+
return Array.isArray(value) ? value : [value];
|
|
7
|
+
}
|
|
8
|
+
static isObject(value) {
|
|
9
|
+
return Object.prototype.toString.call(value) === '[object Object]';
|
|
10
|
+
}
|
|
11
|
+
static isUrlAbsolute(url) {
|
|
12
|
+
// regex to check for absolute IRI (starting scheme and ':') or blank node IRI
|
|
13
|
+
const isAbsoluteRegex = /^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;
|
|
14
|
+
ObjectUtils.isString(url) && isAbsoluteRegex.test(url);
|
|
15
|
+
}
|
|
16
|
+
static isString(value) {
|
|
17
|
+
return typeof value === 'string' || Object.prototype.toString.call(value) === '[object String]';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.ObjectUtils = ObjectUtils;
|
|
21
21
|
//# sourceMappingURL=object.js.map
|