@sphereon/ssi-sdk.vc-status-list 0.34.1-feature.SSISDK.17.bitstring.sl.9 → 0.34.1-next.29
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/dist/index.cjs +477 -184
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +151 -66
- package/dist/index.d.ts +151 -66
- package/dist/index.js +478 -185
- package/dist/index.js.map +1 -1
- package/package.json +9 -7
- package/src/functions.ts +125 -55
- package/src/impl/BitstringStatusListImplementation.ts +292 -97
- package/src/impl/IStatusList.ts +102 -9
- package/src/impl/OAuthStatusList.ts +118 -29
- package/src/impl/StatusList2021.ts +111 -31
- package/src/index.ts +1 -0
- package/src/types/index.ts +42 -65
- package/src/utils.ts +48 -19
package/dist/index.d.cts
CHANGED
|
@@ -1,13 +1,61 @@
|
|
|
1
1
|
import { IIdentifierResolution } from '@sphereon/ssi-sdk-ext.identifier-resolution';
|
|
2
|
-
import {
|
|
3
|
-
import { IPluginMethodMap, IAgentContext, ICredentialIssuer, ICredentialVerifier, IKeyManager,
|
|
2
|
+
import { IIssuer, StatusListType, CredentialProofFormat, StatusListCredential, StatusListDriverType, StatusListIndexingDirection, StatusPurpose2021, ICredentialStatus, OrPromise, ICredential, IVerifiableCredential } from '@sphereon/ssi-types';
|
|
3
|
+
import { IPluginMethodMap, IAgentContext, ICredentialIssuer, ICredentialVerifier, IKeyManager, CredentialPayload } from '@veramo/core';
|
|
4
4
|
import { DataSource } from 'typeorm';
|
|
5
|
-
import { BitsPerStatus } from '@sd-jwt/jwt-status-list';
|
|
5
|
+
import { StatusList, BitsPerStatus } from '@sd-jwt/jwt-status-list';
|
|
6
6
|
import { SdJwtVcPayload } from '@sd-jwt/sd-jwt-vc';
|
|
7
7
|
import { StatusListOpts } from '@sphereon/oid4vci-common';
|
|
8
8
|
import { BitstringStatusPurpose } from '@4sure-tech/vc-bitstring-status-lists';
|
|
9
|
+
import { IVcdmCredentialPlugin } from '@sphereon/ssi-sdk.credential-vcdm';
|
|
10
|
+
import { BitstringStatusListArgs, IStatusListEntity, StatusListEntity, IStatusListEntryEntity, IBitstringStatusListEntryEntity, BitstringStatusListEntryCredentialStatus } from '@sphereon/ssi-sdk.data-store';
|
|
9
11
|
import { StatusMethod } from 'credential-status';
|
|
10
12
|
|
|
13
|
+
interface DecodedStatusListPayload {
|
|
14
|
+
issuer: string;
|
|
15
|
+
id: string;
|
|
16
|
+
statusList: StatusList;
|
|
17
|
+
exp?: number;
|
|
18
|
+
ttl?: number;
|
|
19
|
+
iat: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface IExtractedCredentialDetails {
|
|
23
|
+
id: string;
|
|
24
|
+
issuer: string | IIssuer;
|
|
25
|
+
encodedList: string;
|
|
26
|
+
decodedPayload?: DecodedStatusListPayload;
|
|
27
|
+
}
|
|
28
|
+
interface IStatusListImplementationResult {
|
|
29
|
+
id: string;
|
|
30
|
+
encodedList: string;
|
|
31
|
+
issuer: string | IIssuer;
|
|
32
|
+
type: StatusListType;
|
|
33
|
+
proofFormat: CredentialProofFormat;
|
|
34
|
+
length: number;
|
|
35
|
+
statusListCredential: StatusListCredential;
|
|
36
|
+
statuslistContentType: string;
|
|
37
|
+
correlationId?: string;
|
|
38
|
+
driverType?: StatusListDriverType;
|
|
39
|
+
}
|
|
40
|
+
interface IStatusList2021ImplementationResult extends IStatusListImplementationResult {
|
|
41
|
+
type: StatusListType.StatusList2021;
|
|
42
|
+
indexingDirection: StatusListIndexingDirection;
|
|
43
|
+
statusPurpose: StatusPurpose2021;
|
|
44
|
+
}
|
|
45
|
+
interface IOAuthStatusListImplementationResult extends IStatusListImplementationResult {
|
|
46
|
+
type: StatusListType.OAuthStatusList;
|
|
47
|
+
bitsPerStatus: number;
|
|
48
|
+
expiresAt?: Date;
|
|
49
|
+
}
|
|
50
|
+
interface IBitstringStatusListImplementationResult extends IStatusListImplementationResult {
|
|
51
|
+
type: StatusListType.BitstringStatusList;
|
|
52
|
+
statusPurpose: BitstringStatusPurpose | BitstringStatusPurpose[];
|
|
53
|
+
bitsPerStatus?: number;
|
|
54
|
+
validFrom?: Date;
|
|
55
|
+
validUntil?: Date;
|
|
56
|
+
ttl?: number;
|
|
57
|
+
}
|
|
58
|
+
|
|
11
59
|
declare enum StatusOAuth {
|
|
12
60
|
Valid = 0,
|
|
13
61
|
Invalid = 1,
|
|
@@ -17,22 +65,14 @@ declare enum Status2021 {
|
|
|
17
65
|
Valid = 0,
|
|
18
66
|
Invalid = 1
|
|
19
67
|
}
|
|
20
|
-
type BitstringStatus = number;
|
|
21
68
|
type StatusList2021Args = {
|
|
22
69
|
indexingDirection: StatusListIndexingDirection;
|
|
23
70
|
statusPurpose?: StatusPurpose2021;
|
|
24
71
|
};
|
|
25
72
|
type OAuthStatusListArgs = {
|
|
26
|
-
bitsPerStatus
|
|
73
|
+
bitsPerStatus: BitsPerStatus;
|
|
27
74
|
expiresAt?: Date;
|
|
28
75
|
};
|
|
29
|
-
type BitstringStatusListArgs = {
|
|
30
|
-
statusPurpose: BitstringStatusPurpose;
|
|
31
|
-
bitsPerStatus: number;
|
|
32
|
-
ttl?: number;
|
|
33
|
-
validFrom?: Date;
|
|
34
|
-
validUntil?: Date;
|
|
35
|
-
};
|
|
36
76
|
type BaseCreateNewStatusListArgs = {
|
|
37
77
|
type: StatusListType;
|
|
38
78
|
id: string;
|
|
@@ -78,38 +118,34 @@ interface UpdateStatusListFromStatusListCredentialArgs {
|
|
|
78
118
|
statusListCredential: StatusListCredential;
|
|
79
119
|
keyRef?: string;
|
|
80
120
|
statusListIndex: number | string;
|
|
81
|
-
value: number | Status2021 | StatusOAuth
|
|
121
|
+
value: number | Status2021 | StatusOAuth;
|
|
82
122
|
}
|
|
83
123
|
interface StatusListResult {
|
|
124
|
+
id: string;
|
|
84
125
|
encodedList: string;
|
|
85
|
-
|
|
86
|
-
length: number;
|
|
126
|
+
issuer: string | IIssuer;
|
|
87
127
|
type: StatusListType;
|
|
88
128
|
proofFormat: CredentialProofFormat;
|
|
89
|
-
|
|
129
|
+
length: number;
|
|
130
|
+
statusListCredential: StatusListCredential;
|
|
90
131
|
statuslistContentType: string;
|
|
91
|
-
issuer: string | IIssuer;
|
|
92
|
-
statusList2021?: StatusList2021Details;
|
|
93
|
-
oauthStatusList?: OAuthStatusDetails;
|
|
94
|
-
bitstringStatusList?: BitstringStatusDetails;
|
|
95
132
|
correlationId?: string;
|
|
96
133
|
driverType?: StatusListDriverType;
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
ttl?: number;
|
|
134
|
+
statusList2021?: {
|
|
135
|
+
indexingDirection: StatusListIndexingDirection;
|
|
136
|
+
statusPurpose: StatusPurpose2021;
|
|
137
|
+
};
|
|
138
|
+
oauthStatusList?: {
|
|
139
|
+
bitsPerStatus: number;
|
|
140
|
+
expiresAt?: Date;
|
|
141
|
+
};
|
|
142
|
+
bitstringStatusList?: {
|
|
143
|
+
statusPurpose: BitstringStatusPurpose | BitstringStatusPurpose[];
|
|
144
|
+
bitsPerStatus?: number;
|
|
145
|
+
validFrom?: Date;
|
|
146
|
+
validUntil?: Date;
|
|
147
|
+
ttl?: number;
|
|
148
|
+
};
|
|
113
149
|
}
|
|
114
150
|
interface StatusList2021EntryCredentialStatus extends ICredentialStatus {
|
|
115
151
|
type: 'StatusList2021Entry';
|
|
@@ -124,15 +160,6 @@ interface StatusListOAuthEntryCredentialStatus extends ICredentialStatus {
|
|
|
124
160
|
statusListCredential: string;
|
|
125
161
|
expiresAt?: Date;
|
|
126
162
|
}
|
|
127
|
-
interface BitstringStatusListEntryCredentialStatus extends ICredentialStatus {
|
|
128
|
-
type: 'BitstringStatusListEntry';
|
|
129
|
-
statusPurpose: BitstringStatusPurpose | BitstringStatusPurpose[];
|
|
130
|
-
statusListIndex: string;
|
|
131
|
-
statusListCredential: string;
|
|
132
|
-
bitsPerStatus?: number;
|
|
133
|
-
statusMessage?: Array<BitstringStatus>;
|
|
134
|
-
statusReference?: string | string[];
|
|
135
|
-
}
|
|
136
163
|
interface StatusList2021ToVerifiableCredentialArgs {
|
|
137
164
|
issuer: string | IIssuer;
|
|
138
165
|
id: string;
|
|
@@ -156,7 +183,7 @@ interface CreateStatusListArgs {
|
|
|
156
183
|
interface UpdateStatusListIndexArgs {
|
|
157
184
|
statusListCredential: StatusListCredential;
|
|
158
185
|
statusListIndex: number | string;
|
|
159
|
-
value: number | Status2021 | StatusOAuth
|
|
186
|
+
value: number | Status2021 | StatusOAuth;
|
|
160
187
|
bitsPerStatus?: number;
|
|
161
188
|
keyRef?: string;
|
|
162
189
|
expiresAt?: Date;
|
|
@@ -166,11 +193,16 @@ interface CheckStatusIndexArgs {
|
|
|
166
193
|
statusListIndex: string | number;
|
|
167
194
|
bitsPerStatus?: number;
|
|
168
195
|
}
|
|
169
|
-
interface
|
|
170
|
-
|
|
196
|
+
interface IToDetailsFromCredentialArgs {
|
|
197
|
+
statusListCredential: StatusListCredential;
|
|
198
|
+
statusListType: StatusListType;
|
|
199
|
+
bitsPerStatus?: number;
|
|
171
200
|
correlationId?: string;
|
|
172
201
|
driverType?: StatusListDriverType;
|
|
173
|
-
|
|
202
|
+
}
|
|
203
|
+
interface IMergeDetailsWithEntityArgs {
|
|
204
|
+
extractedDetails: IExtractedCredentialDetails;
|
|
205
|
+
statusListEntity: IStatusListEntity;
|
|
174
206
|
}
|
|
175
207
|
/**
|
|
176
208
|
* The interface definition for a plugin that can add statuslist info to a credential
|
|
@@ -244,12 +276,22 @@ type SignedStatusListData = {
|
|
|
244
276
|
statusListCredential: StatusListCredential;
|
|
245
277
|
encodedList: string;
|
|
246
278
|
};
|
|
247
|
-
type IRequiredPlugins =
|
|
248
|
-
type IRequiredContext = IAgentContext<ICredentialIssuer & ICredentialVerifier & IIdentifierResolution & IKeyManager &
|
|
279
|
+
type IRequiredPlugins = IVcdmCredentialPlugin & IIdentifierResolution;
|
|
280
|
+
type IRequiredContext = IAgentContext<ICredentialIssuer & ICredentialVerifier & IIdentifierResolution & IKeyManager & IVcdmCredentialPlugin>;
|
|
249
281
|
|
|
282
|
+
/**
|
|
283
|
+
* Fetches a status list credential from a URL
|
|
284
|
+
* @param args - Object containing the status list credential URL
|
|
285
|
+
* @returns Promise resolving to the fetched StatusListCredential
|
|
286
|
+
*/
|
|
250
287
|
declare function fetchStatusListCredential(args: {
|
|
251
288
|
statusListCredential: string;
|
|
252
289
|
}): Promise<StatusListCredential>;
|
|
290
|
+
/**
|
|
291
|
+
* Creates a status checking function for credential-status plugin
|
|
292
|
+
* @param args - Configuration options for status verification
|
|
293
|
+
* @returns StatusMethod function for checking credential status
|
|
294
|
+
*/
|
|
253
295
|
declare function statusPluginStatusFunction(args: {
|
|
254
296
|
documentLoader: any;
|
|
255
297
|
suite: any;
|
|
@@ -260,7 +302,8 @@ declare function statusPluginStatusFunction(args: {
|
|
|
260
302
|
}): StatusMethod;
|
|
261
303
|
/**
|
|
262
304
|
* Function that can be used together with @digitalbazar/vc and @digitialcredentials/vc
|
|
263
|
-
* @param args
|
|
305
|
+
* @param args - Configuration options for status verification
|
|
306
|
+
* @returns Function for checking credential status
|
|
264
307
|
*/
|
|
265
308
|
declare function vcLibCheckStatusFunction(args: {
|
|
266
309
|
mandatoryCredentialStatus?: boolean;
|
|
@@ -275,6 +318,11 @@ declare function vcLibCheckStatusFunction(args: {
|
|
|
275
318
|
verified: boolean;
|
|
276
319
|
error?: any;
|
|
277
320
|
}>;
|
|
321
|
+
/**
|
|
322
|
+
* Checks the status of a credential using its credential status information
|
|
323
|
+
* @param args - Parameters for credential status verification
|
|
324
|
+
* @returns Promise resolving to verification result with error details if any
|
|
325
|
+
*/
|
|
278
326
|
declare function checkStatusForCredential(args: {
|
|
279
327
|
credential: StatusListCredential;
|
|
280
328
|
documentLoader: any;
|
|
@@ -293,24 +341,61 @@ declare function simpleCheckStatusFromStatusListUrl(args: {
|
|
|
293
341
|
type?: StatusListType | 'StatusList2021Entry';
|
|
294
342
|
id?: string;
|
|
295
343
|
statusListIndex: string;
|
|
296
|
-
}): Promise<number | Status2021 | StatusOAuth
|
|
344
|
+
}): Promise<number | Status2021 | StatusOAuth>;
|
|
345
|
+
/**
|
|
346
|
+
* Checks the status at a specific index in a status list credential
|
|
347
|
+
* @param args - Parameters including credential and index to check
|
|
348
|
+
* @returns Promise resolving to status value at the specified index
|
|
349
|
+
*/
|
|
297
350
|
declare function checkStatusIndexFromStatusListCredential(args: {
|
|
298
351
|
statusListCredential: StatusListCredential;
|
|
299
|
-
statusPurpose?: StatusPurpose2021;
|
|
352
|
+
statusPurpose?: StatusPurpose2021 | string | string[];
|
|
300
353
|
type?: StatusListType | 'StatusList2021Entry' | 'BitstringStatusListEntry';
|
|
301
354
|
id?: string;
|
|
302
355
|
statusListIndex: string | number;
|
|
303
356
|
bitsPerStatus?: number;
|
|
304
|
-
}): Promise<number | Status2021 | StatusOAuth
|
|
305
|
-
declare function createNewStatusList(args: CreateNewStatusListFuncArgs, context: IAgentContext<(
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
357
|
+
}): Promise<number | Status2021 | StatusOAuth>;
|
|
358
|
+
declare function createNewStatusList(args: CreateNewStatusListFuncArgs, context: IAgentContext<(IVcdmCredentialPlugin | any) & IIdentifierResolution>): Promise<StatusListResult>;
|
|
359
|
+
/**
|
|
360
|
+
* Updates a status index in a status list credential
|
|
361
|
+
* @param args - Parameters for status update including credential and new value
|
|
362
|
+
* @param context - Agent context with required plugins
|
|
363
|
+
* @returns Promise resolving to updated status list details
|
|
364
|
+
*/
|
|
365
|
+
declare function updateStatusIndexFromStatusListCredential(args: UpdateStatusListIndexArgs, context: IAgentContext<IVcdmCredentialPlugin & IIdentifierResolution>): Promise<StatusListResult>;
|
|
366
|
+
/**
|
|
367
|
+
* Extracts credential details from a status list credential
|
|
368
|
+
* @param statusListCredential - The status list credential to extract from
|
|
369
|
+
* @returns Promise resolving to extracted credential details
|
|
370
|
+
*/
|
|
371
|
+
declare function extractCredentialDetails(statusListCredential: StatusListCredential): Promise<IExtractedCredentialDetails>;
|
|
372
|
+
declare function toStatusListDetails(args: IToDetailsFromCredentialArgs): Promise<StatusListResult & (IStatusList2021ImplementationResult | IOAuthStatusListImplementationResult | IBitstringStatusListImplementationResult)>;
|
|
373
|
+
declare function toStatusListDetails(args: IMergeDetailsWithEntityArgs): Promise<StatusListResult & (IStatusList2021ImplementationResult | IOAuthStatusListImplementationResult | IBitstringStatusListImplementationResult)>;
|
|
374
|
+
/**
|
|
375
|
+
* Creates a credential status object from status list and entry information
|
|
376
|
+
* @param args - Parameters including status list, entry, and index
|
|
377
|
+
* @returns Promise resolving to appropriate credential status type
|
|
378
|
+
*/
|
|
379
|
+
declare function createCredentialStatusFromStatusList(args: {
|
|
380
|
+
statusList: StatusListEntity;
|
|
381
|
+
statusListEntry: IStatusListEntryEntity | IBitstringStatusListEntryEntity;
|
|
382
|
+
statusListIndex: number;
|
|
383
|
+
}): Promise<StatusList2021EntryCredentialStatus | StatusListOAuthEntryCredentialStatus | BitstringStatusListEntryCredentialStatus>;
|
|
384
|
+
/**
|
|
385
|
+
* Updates a status list using a base64 encoded list of statuses
|
|
386
|
+
* @param args - Parameters including encoded list and update details
|
|
387
|
+
* @param context - Agent context with required plugins
|
|
388
|
+
* @returns Promise resolving to updated status list details
|
|
389
|
+
*/
|
|
390
|
+
declare function updateStatusListIndexFromEncodedList(args: UpdateStatusListFromEncodedListArgs, context: IAgentContext<IVcdmCredentialPlugin & IIdentifierResolution>): Promise<StatusListResult>;
|
|
391
|
+
/**
|
|
392
|
+
* Converts a StatusList2021 to a verifiable credential
|
|
393
|
+
* @param args - Parameters for credential creation including issuer and encoded list
|
|
394
|
+
* @param context - Agent context with required plugins
|
|
395
|
+
* @returns Promise resolving to signed status list credential
|
|
396
|
+
*/
|
|
397
|
+
declare function statusList2021ToVerifiableCredential(args: StatusList2021ToVerifiableCredentialArgs, context: IAgentContext<IVcdmCredentialPlugin & IIdentifierResolution>): Promise<StatusListCredential>;
|
|
398
|
+
|
|
399
|
+
declare function determineStatusListType(credential: StatusListCredential): StatusListType;
|
|
315
400
|
|
|
316
|
-
export { type BaseCreateNewStatusListArgs, type
|
|
401
|
+
export { type BaseCreateNewStatusListArgs, type CheckStatusIndexArgs, type CreateNewStatusListArgs, type CreateNewStatusListFuncArgs, type CreateStatusListArgs, type CredentialWithStatusSupport, type GetStatusListArgs, type IAddStatusToCredentialArgs, type IAddStatusToSdJwtCredentialArgs, type IIssueCredentialStatusOpts, type IMergeDetailsWithEntityArgs, type IRequiredContext, type IRequiredPlugins, type IStatusListPlugin, type IToDetailsFromCredentialArgs, type OAuthStatusListArgs, type SignedStatusListData, Status2021, type StatusList2021Args, type StatusList2021EntryCredentialStatus, type StatusList2021ToVerifiableCredentialArgs, type StatusListOAuthEntryCredentialStatus, type StatusListResult, StatusOAuth, type UpdateBitstringStatusListArgs, type UpdateOAuthStatusListArgs, type UpdateStatusList2021Args, type UpdateStatusListFromEncodedListArgs, type UpdateStatusListFromStatusListCredentialArgs, type UpdateStatusListIndexArgs, checkStatusForCredential, checkStatusIndexFromStatusListCredential, createCredentialStatusFromStatusList, createNewStatusList, determineStatusListType, extractCredentialDetails, fetchStatusListCredential, simpleCheckStatusFromStatusListUrl, statusList2021ToVerifiableCredential, statusPluginStatusFunction, toStatusListDetails, updateStatusIndexFromStatusListCredential, updateStatusListIndexFromEncodedList, vcLibCheckStatusFunction };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,61 @@
|
|
|
1
1
|
import { IIdentifierResolution } from '@sphereon/ssi-sdk-ext.identifier-resolution';
|
|
2
|
-
import {
|
|
3
|
-
import { IPluginMethodMap, IAgentContext, ICredentialIssuer, ICredentialVerifier, IKeyManager,
|
|
2
|
+
import { IIssuer, StatusListType, CredentialProofFormat, StatusListCredential, StatusListDriverType, StatusListIndexingDirection, StatusPurpose2021, ICredentialStatus, OrPromise, ICredential, IVerifiableCredential } from '@sphereon/ssi-types';
|
|
3
|
+
import { IPluginMethodMap, IAgentContext, ICredentialIssuer, ICredentialVerifier, IKeyManager, CredentialPayload } from '@veramo/core';
|
|
4
4
|
import { DataSource } from 'typeorm';
|
|
5
|
-
import { BitsPerStatus } from '@sd-jwt/jwt-status-list';
|
|
5
|
+
import { StatusList, BitsPerStatus } from '@sd-jwt/jwt-status-list';
|
|
6
6
|
import { SdJwtVcPayload } from '@sd-jwt/sd-jwt-vc';
|
|
7
7
|
import { StatusListOpts } from '@sphereon/oid4vci-common';
|
|
8
8
|
import { BitstringStatusPurpose } from '@4sure-tech/vc-bitstring-status-lists';
|
|
9
|
+
import { IVcdmCredentialPlugin } from '@sphereon/ssi-sdk.credential-vcdm';
|
|
10
|
+
import { BitstringStatusListArgs, IStatusListEntity, StatusListEntity, IStatusListEntryEntity, IBitstringStatusListEntryEntity, BitstringStatusListEntryCredentialStatus } from '@sphereon/ssi-sdk.data-store';
|
|
9
11
|
import { StatusMethod } from 'credential-status';
|
|
10
12
|
|
|
13
|
+
interface DecodedStatusListPayload {
|
|
14
|
+
issuer: string;
|
|
15
|
+
id: string;
|
|
16
|
+
statusList: StatusList;
|
|
17
|
+
exp?: number;
|
|
18
|
+
ttl?: number;
|
|
19
|
+
iat: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface IExtractedCredentialDetails {
|
|
23
|
+
id: string;
|
|
24
|
+
issuer: string | IIssuer;
|
|
25
|
+
encodedList: string;
|
|
26
|
+
decodedPayload?: DecodedStatusListPayload;
|
|
27
|
+
}
|
|
28
|
+
interface IStatusListImplementationResult {
|
|
29
|
+
id: string;
|
|
30
|
+
encodedList: string;
|
|
31
|
+
issuer: string | IIssuer;
|
|
32
|
+
type: StatusListType;
|
|
33
|
+
proofFormat: CredentialProofFormat;
|
|
34
|
+
length: number;
|
|
35
|
+
statusListCredential: StatusListCredential;
|
|
36
|
+
statuslistContentType: string;
|
|
37
|
+
correlationId?: string;
|
|
38
|
+
driverType?: StatusListDriverType;
|
|
39
|
+
}
|
|
40
|
+
interface IStatusList2021ImplementationResult extends IStatusListImplementationResult {
|
|
41
|
+
type: StatusListType.StatusList2021;
|
|
42
|
+
indexingDirection: StatusListIndexingDirection;
|
|
43
|
+
statusPurpose: StatusPurpose2021;
|
|
44
|
+
}
|
|
45
|
+
interface IOAuthStatusListImplementationResult extends IStatusListImplementationResult {
|
|
46
|
+
type: StatusListType.OAuthStatusList;
|
|
47
|
+
bitsPerStatus: number;
|
|
48
|
+
expiresAt?: Date;
|
|
49
|
+
}
|
|
50
|
+
interface IBitstringStatusListImplementationResult extends IStatusListImplementationResult {
|
|
51
|
+
type: StatusListType.BitstringStatusList;
|
|
52
|
+
statusPurpose: BitstringStatusPurpose | BitstringStatusPurpose[];
|
|
53
|
+
bitsPerStatus?: number;
|
|
54
|
+
validFrom?: Date;
|
|
55
|
+
validUntil?: Date;
|
|
56
|
+
ttl?: number;
|
|
57
|
+
}
|
|
58
|
+
|
|
11
59
|
declare enum StatusOAuth {
|
|
12
60
|
Valid = 0,
|
|
13
61
|
Invalid = 1,
|
|
@@ -17,22 +65,14 @@ declare enum Status2021 {
|
|
|
17
65
|
Valid = 0,
|
|
18
66
|
Invalid = 1
|
|
19
67
|
}
|
|
20
|
-
type BitstringStatus = number;
|
|
21
68
|
type StatusList2021Args = {
|
|
22
69
|
indexingDirection: StatusListIndexingDirection;
|
|
23
70
|
statusPurpose?: StatusPurpose2021;
|
|
24
71
|
};
|
|
25
72
|
type OAuthStatusListArgs = {
|
|
26
|
-
bitsPerStatus
|
|
73
|
+
bitsPerStatus: BitsPerStatus;
|
|
27
74
|
expiresAt?: Date;
|
|
28
75
|
};
|
|
29
|
-
type BitstringStatusListArgs = {
|
|
30
|
-
statusPurpose: BitstringStatusPurpose;
|
|
31
|
-
bitsPerStatus: number;
|
|
32
|
-
ttl?: number;
|
|
33
|
-
validFrom?: Date;
|
|
34
|
-
validUntil?: Date;
|
|
35
|
-
};
|
|
36
76
|
type BaseCreateNewStatusListArgs = {
|
|
37
77
|
type: StatusListType;
|
|
38
78
|
id: string;
|
|
@@ -78,38 +118,34 @@ interface UpdateStatusListFromStatusListCredentialArgs {
|
|
|
78
118
|
statusListCredential: StatusListCredential;
|
|
79
119
|
keyRef?: string;
|
|
80
120
|
statusListIndex: number | string;
|
|
81
|
-
value: number | Status2021 | StatusOAuth
|
|
121
|
+
value: number | Status2021 | StatusOAuth;
|
|
82
122
|
}
|
|
83
123
|
interface StatusListResult {
|
|
124
|
+
id: string;
|
|
84
125
|
encodedList: string;
|
|
85
|
-
|
|
86
|
-
length: number;
|
|
126
|
+
issuer: string | IIssuer;
|
|
87
127
|
type: StatusListType;
|
|
88
128
|
proofFormat: CredentialProofFormat;
|
|
89
|
-
|
|
129
|
+
length: number;
|
|
130
|
+
statusListCredential: StatusListCredential;
|
|
90
131
|
statuslistContentType: string;
|
|
91
|
-
issuer: string | IIssuer;
|
|
92
|
-
statusList2021?: StatusList2021Details;
|
|
93
|
-
oauthStatusList?: OAuthStatusDetails;
|
|
94
|
-
bitstringStatusList?: BitstringStatusDetails;
|
|
95
132
|
correlationId?: string;
|
|
96
133
|
driverType?: StatusListDriverType;
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
ttl?: number;
|
|
134
|
+
statusList2021?: {
|
|
135
|
+
indexingDirection: StatusListIndexingDirection;
|
|
136
|
+
statusPurpose: StatusPurpose2021;
|
|
137
|
+
};
|
|
138
|
+
oauthStatusList?: {
|
|
139
|
+
bitsPerStatus: number;
|
|
140
|
+
expiresAt?: Date;
|
|
141
|
+
};
|
|
142
|
+
bitstringStatusList?: {
|
|
143
|
+
statusPurpose: BitstringStatusPurpose | BitstringStatusPurpose[];
|
|
144
|
+
bitsPerStatus?: number;
|
|
145
|
+
validFrom?: Date;
|
|
146
|
+
validUntil?: Date;
|
|
147
|
+
ttl?: number;
|
|
148
|
+
};
|
|
113
149
|
}
|
|
114
150
|
interface StatusList2021EntryCredentialStatus extends ICredentialStatus {
|
|
115
151
|
type: 'StatusList2021Entry';
|
|
@@ -124,15 +160,6 @@ interface StatusListOAuthEntryCredentialStatus extends ICredentialStatus {
|
|
|
124
160
|
statusListCredential: string;
|
|
125
161
|
expiresAt?: Date;
|
|
126
162
|
}
|
|
127
|
-
interface BitstringStatusListEntryCredentialStatus extends ICredentialStatus {
|
|
128
|
-
type: 'BitstringStatusListEntry';
|
|
129
|
-
statusPurpose: BitstringStatusPurpose | BitstringStatusPurpose[];
|
|
130
|
-
statusListIndex: string;
|
|
131
|
-
statusListCredential: string;
|
|
132
|
-
bitsPerStatus?: number;
|
|
133
|
-
statusMessage?: Array<BitstringStatus>;
|
|
134
|
-
statusReference?: string | string[];
|
|
135
|
-
}
|
|
136
163
|
interface StatusList2021ToVerifiableCredentialArgs {
|
|
137
164
|
issuer: string | IIssuer;
|
|
138
165
|
id: string;
|
|
@@ -156,7 +183,7 @@ interface CreateStatusListArgs {
|
|
|
156
183
|
interface UpdateStatusListIndexArgs {
|
|
157
184
|
statusListCredential: StatusListCredential;
|
|
158
185
|
statusListIndex: number | string;
|
|
159
|
-
value: number | Status2021 | StatusOAuth
|
|
186
|
+
value: number | Status2021 | StatusOAuth;
|
|
160
187
|
bitsPerStatus?: number;
|
|
161
188
|
keyRef?: string;
|
|
162
189
|
expiresAt?: Date;
|
|
@@ -166,11 +193,16 @@ interface CheckStatusIndexArgs {
|
|
|
166
193
|
statusListIndex: string | number;
|
|
167
194
|
bitsPerStatus?: number;
|
|
168
195
|
}
|
|
169
|
-
interface
|
|
170
|
-
|
|
196
|
+
interface IToDetailsFromCredentialArgs {
|
|
197
|
+
statusListCredential: StatusListCredential;
|
|
198
|
+
statusListType: StatusListType;
|
|
199
|
+
bitsPerStatus?: number;
|
|
171
200
|
correlationId?: string;
|
|
172
201
|
driverType?: StatusListDriverType;
|
|
173
|
-
|
|
202
|
+
}
|
|
203
|
+
interface IMergeDetailsWithEntityArgs {
|
|
204
|
+
extractedDetails: IExtractedCredentialDetails;
|
|
205
|
+
statusListEntity: IStatusListEntity;
|
|
174
206
|
}
|
|
175
207
|
/**
|
|
176
208
|
* The interface definition for a plugin that can add statuslist info to a credential
|
|
@@ -244,12 +276,22 @@ type SignedStatusListData = {
|
|
|
244
276
|
statusListCredential: StatusListCredential;
|
|
245
277
|
encodedList: string;
|
|
246
278
|
};
|
|
247
|
-
type IRequiredPlugins =
|
|
248
|
-
type IRequiredContext = IAgentContext<ICredentialIssuer & ICredentialVerifier & IIdentifierResolution & IKeyManager &
|
|
279
|
+
type IRequiredPlugins = IVcdmCredentialPlugin & IIdentifierResolution;
|
|
280
|
+
type IRequiredContext = IAgentContext<ICredentialIssuer & ICredentialVerifier & IIdentifierResolution & IKeyManager & IVcdmCredentialPlugin>;
|
|
249
281
|
|
|
282
|
+
/**
|
|
283
|
+
* Fetches a status list credential from a URL
|
|
284
|
+
* @param args - Object containing the status list credential URL
|
|
285
|
+
* @returns Promise resolving to the fetched StatusListCredential
|
|
286
|
+
*/
|
|
250
287
|
declare function fetchStatusListCredential(args: {
|
|
251
288
|
statusListCredential: string;
|
|
252
289
|
}): Promise<StatusListCredential>;
|
|
290
|
+
/**
|
|
291
|
+
* Creates a status checking function for credential-status plugin
|
|
292
|
+
* @param args - Configuration options for status verification
|
|
293
|
+
* @returns StatusMethod function for checking credential status
|
|
294
|
+
*/
|
|
253
295
|
declare function statusPluginStatusFunction(args: {
|
|
254
296
|
documentLoader: any;
|
|
255
297
|
suite: any;
|
|
@@ -260,7 +302,8 @@ declare function statusPluginStatusFunction(args: {
|
|
|
260
302
|
}): StatusMethod;
|
|
261
303
|
/**
|
|
262
304
|
* Function that can be used together with @digitalbazar/vc and @digitialcredentials/vc
|
|
263
|
-
* @param args
|
|
305
|
+
* @param args - Configuration options for status verification
|
|
306
|
+
* @returns Function for checking credential status
|
|
264
307
|
*/
|
|
265
308
|
declare function vcLibCheckStatusFunction(args: {
|
|
266
309
|
mandatoryCredentialStatus?: boolean;
|
|
@@ -275,6 +318,11 @@ declare function vcLibCheckStatusFunction(args: {
|
|
|
275
318
|
verified: boolean;
|
|
276
319
|
error?: any;
|
|
277
320
|
}>;
|
|
321
|
+
/**
|
|
322
|
+
* Checks the status of a credential using its credential status information
|
|
323
|
+
* @param args - Parameters for credential status verification
|
|
324
|
+
* @returns Promise resolving to verification result with error details if any
|
|
325
|
+
*/
|
|
278
326
|
declare function checkStatusForCredential(args: {
|
|
279
327
|
credential: StatusListCredential;
|
|
280
328
|
documentLoader: any;
|
|
@@ -293,24 +341,61 @@ declare function simpleCheckStatusFromStatusListUrl(args: {
|
|
|
293
341
|
type?: StatusListType | 'StatusList2021Entry';
|
|
294
342
|
id?: string;
|
|
295
343
|
statusListIndex: string;
|
|
296
|
-
}): Promise<number | Status2021 | StatusOAuth
|
|
344
|
+
}): Promise<number | Status2021 | StatusOAuth>;
|
|
345
|
+
/**
|
|
346
|
+
* Checks the status at a specific index in a status list credential
|
|
347
|
+
* @param args - Parameters including credential and index to check
|
|
348
|
+
* @returns Promise resolving to status value at the specified index
|
|
349
|
+
*/
|
|
297
350
|
declare function checkStatusIndexFromStatusListCredential(args: {
|
|
298
351
|
statusListCredential: StatusListCredential;
|
|
299
|
-
statusPurpose?: StatusPurpose2021;
|
|
352
|
+
statusPurpose?: StatusPurpose2021 | string | string[];
|
|
300
353
|
type?: StatusListType | 'StatusList2021Entry' | 'BitstringStatusListEntry';
|
|
301
354
|
id?: string;
|
|
302
355
|
statusListIndex: string | number;
|
|
303
356
|
bitsPerStatus?: number;
|
|
304
|
-
}): Promise<number | Status2021 | StatusOAuth
|
|
305
|
-
declare function createNewStatusList(args: CreateNewStatusListFuncArgs, context: IAgentContext<(
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
357
|
+
}): Promise<number | Status2021 | StatusOAuth>;
|
|
358
|
+
declare function createNewStatusList(args: CreateNewStatusListFuncArgs, context: IAgentContext<(IVcdmCredentialPlugin | any) & IIdentifierResolution>): Promise<StatusListResult>;
|
|
359
|
+
/**
|
|
360
|
+
* Updates a status index in a status list credential
|
|
361
|
+
* @param args - Parameters for status update including credential and new value
|
|
362
|
+
* @param context - Agent context with required plugins
|
|
363
|
+
* @returns Promise resolving to updated status list details
|
|
364
|
+
*/
|
|
365
|
+
declare function updateStatusIndexFromStatusListCredential(args: UpdateStatusListIndexArgs, context: IAgentContext<IVcdmCredentialPlugin & IIdentifierResolution>): Promise<StatusListResult>;
|
|
366
|
+
/**
|
|
367
|
+
* Extracts credential details from a status list credential
|
|
368
|
+
* @param statusListCredential - The status list credential to extract from
|
|
369
|
+
* @returns Promise resolving to extracted credential details
|
|
370
|
+
*/
|
|
371
|
+
declare function extractCredentialDetails(statusListCredential: StatusListCredential): Promise<IExtractedCredentialDetails>;
|
|
372
|
+
declare function toStatusListDetails(args: IToDetailsFromCredentialArgs): Promise<StatusListResult & (IStatusList2021ImplementationResult | IOAuthStatusListImplementationResult | IBitstringStatusListImplementationResult)>;
|
|
373
|
+
declare function toStatusListDetails(args: IMergeDetailsWithEntityArgs): Promise<StatusListResult & (IStatusList2021ImplementationResult | IOAuthStatusListImplementationResult | IBitstringStatusListImplementationResult)>;
|
|
374
|
+
/**
|
|
375
|
+
* Creates a credential status object from status list and entry information
|
|
376
|
+
* @param args - Parameters including status list, entry, and index
|
|
377
|
+
* @returns Promise resolving to appropriate credential status type
|
|
378
|
+
*/
|
|
379
|
+
declare function createCredentialStatusFromStatusList(args: {
|
|
380
|
+
statusList: StatusListEntity;
|
|
381
|
+
statusListEntry: IStatusListEntryEntity | IBitstringStatusListEntryEntity;
|
|
382
|
+
statusListIndex: number;
|
|
383
|
+
}): Promise<StatusList2021EntryCredentialStatus | StatusListOAuthEntryCredentialStatus | BitstringStatusListEntryCredentialStatus>;
|
|
384
|
+
/**
|
|
385
|
+
* Updates a status list using a base64 encoded list of statuses
|
|
386
|
+
* @param args - Parameters including encoded list and update details
|
|
387
|
+
* @param context - Agent context with required plugins
|
|
388
|
+
* @returns Promise resolving to updated status list details
|
|
389
|
+
*/
|
|
390
|
+
declare function updateStatusListIndexFromEncodedList(args: UpdateStatusListFromEncodedListArgs, context: IAgentContext<IVcdmCredentialPlugin & IIdentifierResolution>): Promise<StatusListResult>;
|
|
391
|
+
/**
|
|
392
|
+
* Converts a StatusList2021 to a verifiable credential
|
|
393
|
+
* @param args - Parameters for credential creation including issuer and encoded list
|
|
394
|
+
* @param context - Agent context with required plugins
|
|
395
|
+
* @returns Promise resolving to signed status list credential
|
|
396
|
+
*/
|
|
397
|
+
declare function statusList2021ToVerifiableCredential(args: StatusList2021ToVerifiableCredentialArgs, context: IAgentContext<IVcdmCredentialPlugin & IIdentifierResolution>): Promise<StatusListCredential>;
|
|
398
|
+
|
|
399
|
+
declare function determineStatusListType(credential: StatusListCredential): StatusListType;
|
|
315
400
|
|
|
316
|
-
export { type BaseCreateNewStatusListArgs, type
|
|
401
|
+
export { type BaseCreateNewStatusListArgs, type CheckStatusIndexArgs, type CreateNewStatusListArgs, type CreateNewStatusListFuncArgs, type CreateStatusListArgs, type CredentialWithStatusSupport, type GetStatusListArgs, type IAddStatusToCredentialArgs, type IAddStatusToSdJwtCredentialArgs, type IIssueCredentialStatusOpts, type IMergeDetailsWithEntityArgs, type IRequiredContext, type IRequiredPlugins, type IStatusListPlugin, type IToDetailsFromCredentialArgs, type OAuthStatusListArgs, type SignedStatusListData, Status2021, type StatusList2021Args, type StatusList2021EntryCredentialStatus, type StatusList2021ToVerifiableCredentialArgs, type StatusListOAuthEntryCredentialStatus, type StatusListResult, StatusOAuth, type UpdateBitstringStatusListArgs, type UpdateOAuthStatusListArgs, type UpdateStatusList2021Args, type UpdateStatusListFromEncodedListArgs, type UpdateStatusListFromStatusListCredentialArgs, type UpdateStatusListIndexArgs, checkStatusForCredential, checkStatusIndexFromStatusListCredential, createCredentialStatusFromStatusList, createNewStatusList, determineStatusListType, extractCredentialDetails, fetchStatusListCredential, simpleCheckStatusFromStatusListUrl, statusList2021ToVerifiableCredential, statusPluginStatusFunction, toStatusListDetails, updateStatusIndexFromStatusListCredential, updateStatusListIndexFromEncodedList, vcLibCheckStatusFunction };
|