@sphereon/ssi-sdk.vc-status-list 0.34.1-next.7 → 0.34.1-next.85
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 +695 -122
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +163 -37
- package/dist/index.d.ts +163 -37
- package/dist/index.js +698 -125
- package/dist/index.js.map +1 -1
- package/package.json +10 -7
- package/src/functions.ts +126 -47
- package/src/impl/BitstringStatusListImplementation.ts +496 -0
- package/src/impl/IStatusList.ts +102 -8
- package/src/impl/OAuthStatusList.ts +133 -38
- package/src/impl/StatusList2021.ts +114 -34
- package/src/impl/StatusListFactory.ts +2 -0
- package/src/impl/encoding/cbor.ts +14 -12
- package/src/index.ts +1 -0
- package/src/types/BitstringStatusList.ts +4 -0
- package/src/types/index.ts +56 -35
- package/src/utils.ts +82 -20
package/dist/index.d.cts
CHANGED
|
@@ -1,12 +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
|
+
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';
|
|
8
11
|
import { StatusMethod } from 'credential-status';
|
|
9
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
|
+
|
|
10
59
|
declare enum StatusOAuth {
|
|
11
60
|
Valid = 0,
|
|
12
61
|
Invalid = 1,
|
|
@@ -21,7 +70,7 @@ type StatusList2021Args = {
|
|
|
21
70
|
statusPurpose?: StatusPurpose2021;
|
|
22
71
|
};
|
|
23
72
|
type OAuthStatusListArgs = {
|
|
24
|
-
bitsPerStatus
|
|
73
|
+
bitsPerStatus: BitsPerStatus;
|
|
25
74
|
expiresAt?: Date;
|
|
26
75
|
};
|
|
27
76
|
type BaseCreateNewStatusListArgs = {
|
|
@@ -34,6 +83,7 @@ type BaseCreateNewStatusListArgs = {
|
|
|
34
83
|
keyRef?: string;
|
|
35
84
|
statusList2021?: StatusList2021Args;
|
|
36
85
|
oauthStatusList?: OAuthStatusListArgs;
|
|
86
|
+
bitstringStatusList?: BitstringStatusListArgs;
|
|
37
87
|
driverType?: StatusListDriverType;
|
|
38
88
|
};
|
|
39
89
|
type UpdateStatusList2021Args = {
|
|
@@ -43,10 +93,17 @@ type UpdateOAuthStatusListArgs = {
|
|
|
43
93
|
bitsPerStatus: BitsPerStatus;
|
|
44
94
|
expiresAt?: Date;
|
|
45
95
|
};
|
|
96
|
+
type UpdateBitstringStatusListArgs = {
|
|
97
|
+
statusPurpose: BitstringStatusPurpose;
|
|
98
|
+
bitsPerStatus: number;
|
|
99
|
+
validFrom?: Date;
|
|
100
|
+
validUntil?: Date;
|
|
101
|
+
ttl?: number;
|
|
102
|
+
};
|
|
46
103
|
interface UpdateStatusListFromEncodedListArgs {
|
|
47
104
|
type?: StatusListType;
|
|
48
105
|
statusListIndex: number | string;
|
|
49
|
-
value:
|
|
106
|
+
value: number;
|
|
50
107
|
proofFormat?: CredentialProofFormat;
|
|
51
108
|
keyRef?: string;
|
|
52
109
|
correlationId?: string;
|
|
@@ -55,6 +112,7 @@ interface UpdateStatusListFromEncodedListArgs {
|
|
|
55
112
|
id: string;
|
|
56
113
|
statusList2021?: UpdateStatusList2021Args;
|
|
57
114
|
oauthStatusList?: UpdateOAuthStatusListArgs;
|
|
115
|
+
bitstringStatusList?: UpdateBitstringStatusListArgs;
|
|
58
116
|
}
|
|
59
117
|
interface UpdateStatusListFromStatusListCredentialArgs {
|
|
60
118
|
statusListCredential: StatusListCredential;
|
|
@@ -63,27 +121,31 @@ interface UpdateStatusListFromStatusListCredentialArgs {
|
|
|
63
121
|
value: number | Status2021 | StatusOAuth;
|
|
64
122
|
}
|
|
65
123
|
interface StatusListResult {
|
|
124
|
+
id: string;
|
|
66
125
|
encodedList: string;
|
|
67
|
-
|
|
68
|
-
length: number;
|
|
126
|
+
issuer: string | IIssuer;
|
|
69
127
|
type: StatusListType;
|
|
70
128
|
proofFormat: CredentialProofFormat;
|
|
71
|
-
|
|
129
|
+
length: number;
|
|
130
|
+
statusListCredential: StatusListCredential;
|
|
72
131
|
statuslistContentType: string;
|
|
73
|
-
issuer: string | IIssuer;
|
|
74
|
-
statusList2021?: StatusList2021Details;
|
|
75
|
-
oauthStatusList?: OAuthStatusDetails;
|
|
76
132
|
correlationId?: string;
|
|
77
133
|
driverType?: StatusListDriverType;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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
|
+
};
|
|
87
149
|
}
|
|
88
150
|
interface StatusList2021EntryCredentialStatus extends ICredentialStatus {
|
|
89
151
|
type: 'StatusList2021Entry';
|
|
@@ -116,23 +178,32 @@ interface CreateStatusListArgs {
|
|
|
116
178
|
length?: number;
|
|
117
179
|
statusList2021?: StatusList2021Args;
|
|
118
180
|
oauthStatusList?: OAuthStatusListArgs;
|
|
181
|
+
bitstringStatusList?: BitstringStatusListArgs;
|
|
119
182
|
}
|
|
120
183
|
interface UpdateStatusListIndexArgs {
|
|
121
184
|
statusListCredential: StatusListCredential;
|
|
122
185
|
statusListIndex: number | string;
|
|
123
186
|
value: number | Status2021 | StatusOAuth;
|
|
187
|
+
bitsPerStatus?: number;
|
|
124
188
|
keyRef?: string;
|
|
125
189
|
expiresAt?: Date;
|
|
126
190
|
}
|
|
127
191
|
interface CheckStatusIndexArgs {
|
|
128
192
|
statusListCredential: StatusListCredential;
|
|
129
193
|
statusListIndex: string | number;
|
|
194
|
+
bitsPerStatus?: number;
|
|
130
195
|
}
|
|
131
|
-
interface
|
|
132
|
-
|
|
196
|
+
interface IToDetailsFromCredentialArgs {
|
|
197
|
+
statusListCredential: StatusListCredential;
|
|
198
|
+
statusListType: StatusListType;
|
|
199
|
+
bitsPerStatus?: number;
|
|
133
200
|
correlationId?: string;
|
|
134
201
|
driverType?: StatusListDriverType;
|
|
135
202
|
}
|
|
203
|
+
interface IMergeDetailsWithEntityArgs {
|
|
204
|
+
extractedDetails: IExtractedCredentialDetails;
|
|
205
|
+
statusListEntity: IStatusListEntity;
|
|
206
|
+
}
|
|
136
207
|
/**
|
|
137
208
|
* The interface definition for a plugin that can add statuslist info to a credential
|
|
138
209
|
*
|
|
@@ -205,12 +276,22 @@ type SignedStatusListData = {
|
|
|
205
276
|
statusListCredential: StatusListCredential;
|
|
206
277
|
encodedList: string;
|
|
207
278
|
};
|
|
208
|
-
type IRequiredPlugins =
|
|
209
|
-
type IRequiredContext = IAgentContext<ICredentialIssuer & ICredentialVerifier & IIdentifierResolution & IKeyManager &
|
|
279
|
+
type IRequiredPlugins = IVcdmCredentialPlugin & IIdentifierResolution;
|
|
280
|
+
type IRequiredContext = IAgentContext<ICredentialIssuer & ICredentialVerifier & IIdentifierResolution & IKeyManager & IVcdmCredentialPlugin>;
|
|
210
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
|
+
*/
|
|
211
287
|
declare function fetchStatusListCredential(args: {
|
|
212
288
|
statusListCredential: string;
|
|
213
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
|
+
*/
|
|
214
295
|
declare function statusPluginStatusFunction(args: {
|
|
215
296
|
documentLoader: any;
|
|
216
297
|
suite: any;
|
|
@@ -221,7 +302,8 @@ declare function statusPluginStatusFunction(args: {
|
|
|
221
302
|
}): StatusMethod;
|
|
222
303
|
/**
|
|
223
304
|
* Function that can be used together with @digitalbazar/vc and @digitialcredentials/vc
|
|
224
|
-
* @param args
|
|
305
|
+
* @param args - Configuration options for status verification
|
|
306
|
+
* @returns Function for checking credential status
|
|
225
307
|
*/
|
|
226
308
|
declare function vcLibCheckStatusFunction(args: {
|
|
227
309
|
mandatoryCredentialStatus?: boolean;
|
|
@@ -236,6 +318,11 @@ declare function vcLibCheckStatusFunction(args: {
|
|
|
236
318
|
verified: boolean;
|
|
237
319
|
error?: any;
|
|
238
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
|
+
*/
|
|
239
326
|
declare function checkStatusForCredential(args: {
|
|
240
327
|
credential: StatusListCredential;
|
|
241
328
|
documentLoader: any;
|
|
@@ -255,21 +342,60 @@ declare function simpleCheckStatusFromStatusListUrl(args: {
|
|
|
255
342
|
id?: string;
|
|
256
343
|
statusListIndex: string;
|
|
257
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
|
+
*/
|
|
258
350
|
declare function checkStatusIndexFromStatusListCredential(args: {
|
|
259
351
|
statusListCredential: StatusListCredential;
|
|
260
|
-
statusPurpose?: StatusPurpose2021;
|
|
261
|
-
type?: StatusListType | 'StatusList2021Entry';
|
|
352
|
+
statusPurpose?: StatusPurpose2021 | string | string[];
|
|
353
|
+
type?: StatusListType | 'StatusList2021Entry' | 'BitstringStatusListEntry';
|
|
262
354
|
id?: string;
|
|
263
355
|
statusListIndex: string | number;
|
|
356
|
+
bitsPerStatus?: number;
|
|
264
357
|
}): Promise<number | Status2021 | StatusOAuth>;
|
|
265
|
-
declare function createNewStatusList(args: CreateNewStatusListFuncArgs, context: IAgentContext<(
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
declare function
|
|
273
|
-
|
|
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;
|
|
274
400
|
|
|
275
|
-
export { type BaseCreateNewStatusListArgs, type CheckStatusIndexArgs, type CreateNewStatusListArgs, type CreateNewStatusListFuncArgs, type CreateStatusListArgs, type CredentialWithStatusSupport, type GetStatusListArgs, type IAddStatusToCredentialArgs, type IAddStatusToSdJwtCredentialArgs, type IIssueCredentialStatusOpts, type IRequiredContext, type IRequiredPlugins, type IStatusListPlugin, type OAuthStatusListArgs, type SignedStatusListData, Status2021, type StatusList2021Args, type StatusList2021EntryCredentialStatus, type StatusList2021ToVerifiableCredentialArgs, type StatusListOAuthEntryCredentialStatus, type StatusListResult, StatusOAuth, 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,12 +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
|
+
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';
|
|
8
11
|
import { StatusMethod } from 'credential-status';
|
|
9
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
|
+
|
|
10
59
|
declare enum StatusOAuth {
|
|
11
60
|
Valid = 0,
|
|
12
61
|
Invalid = 1,
|
|
@@ -21,7 +70,7 @@ type StatusList2021Args = {
|
|
|
21
70
|
statusPurpose?: StatusPurpose2021;
|
|
22
71
|
};
|
|
23
72
|
type OAuthStatusListArgs = {
|
|
24
|
-
bitsPerStatus
|
|
73
|
+
bitsPerStatus: BitsPerStatus;
|
|
25
74
|
expiresAt?: Date;
|
|
26
75
|
};
|
|
27
76
|
type BaseCreateNewStatusListArgs = {
|
|
@@ -34,6 +83,7 @@ type BaseCreateNewStatusListArgs = {
|
|
|
34
83
|
keyRef?: string;
|
|
35
84
|
statusList2021?: StatusList2021Args;
|
|
36
85
|
oauthStatusList?: OAuthStatusListArgs;
|
|
86
|
+
bitstringStatusList?: BitstringStatusListArgs;
|
|
37
87
|
driverType?: StatusListDriverType;
|
|
38
88
|
};
|
|
39
89
|
type UpdateStatusList2021Args = {
|
|
@@ -43,10 +93,17 @@ type UpdateOAuthStatusListArgs = {
|
|
|
43
93
|
bitsPerStatus: BitsPerStatus;
|
|
44
94
|
expiresAt?: Date;
|
|
45
95
|
};
|
|
96
|
+
type UpdateBitstringStatusListArgs = {
|
|
97
|
+
statusPurpose: BitstringStatusPurpose;
|
|
98
|
+
bitsPerStatus: number;
|
|
99
|
+
validFrom?: Date;
|
|
100
|
+
validUntil?: Date;
|
|
101
|
+
ttl?: number;
|
|
102
|
+
};
|
|
46
103
|
interface UpdateStatusListFromEncodedListArgs {
|
|
47
104
|
type?: StatusListType;
|
|
48
105
|
statusListIndex: number | string;
|
|
49
|
-
value:
|
|
106
|
+
value: number;
|
|
50
107
|
proofFormat?: CredentialProofFormat;
|
|
51
108
|
keyRef?: string;
|
|
52
109
|
correlationId?: string;
|
|
@@ -55,6 +112,7 @@ interface UpdateStatusListFromEncodedListArgs {
|
|
|
55
112
|
id: string;
|
|
56
113
|
statusList2021?: UpdateStatusList2021Args;
|
|
57
114
|
oauthStatusList?: UpdateOAuthStatusListArgs;
|
|
115
|
+
bitstringStatusList?: UpdateBitstringStatusListArgs;
|
|
58
116
|
}
|
|
59
117
|
interface UpdateStatusListFromStatusListCredentialArgs {
|
|
60
118
|
statusListCredential: StatusListCredential;
|
|
@@ -63,27 +121,31 @@ interface UpdateStatusListFromStatusListCredentialArgs {
|
|
|
63
121
|
value: number | Status2021 | StatusOAuth;
|
|
64
122
|
}
|
|
65
123
|
interface StatusListResult {
|
|
124
|
+
id: string;
|
|
66
125
|
encodedList: string;
|
|
67
|
-
|
|
68
|
-
length: number;
|
|
126
|
+
issuer: string | IIssuer;
|
|
69
127
|
type: StatusListType;
|
|
70
128
|
proofFormat: CredentialProofFormat;
|
|
71
|
-
|
|
129
|
+
length: number;
|
|
130
|
+
statusListCredential: StatusListCredential;
|
|
72
131
|
statuslistContentType: string;
|
|
73
|
-
issuer: string | IIssuer;
|
|
74
|
-
statusList2021?: StatusList2021Details;
|
|
75
|
-
oauthStatusList?: OAuthStatusDetails;
|
|
76
132
|
correlationId?: string;
|
|
77
133
|
driverType?: StatusListDriverType;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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
|
+
};
|
|
87
149
|
}
|
|
88
150
|
interface StatusList2021EntryCredentialStatus extends ICredentialStatus {
|
|
89
151
|
type: 'StatusList2021Entry';
|
|
@@ -116,23 +178,32 @@ interface CreateStatusListArgs {
|
|
|
116
178
|
length?: number;
|
|
117
179
|
statusList2021?: StatusList2021Args;
|
|
118
180
|
oauthStatusList?: OAuthStatusListArgs;
|
|
181
|
+
bitstringStatusList?: BitstringStatusListArgs;
|
|
119
182
|
}
|
|
120
183
|
interface UpdateStatusListIndexArgs {
|
|
121
184
|
statusListCredential: StatusListCredential;
|
|
122
185
|
statusListIndex: number | string;
|
|
123
186
|
value: number | Status2021 | StatusOAuth;
|
|
187
|
+
bitsPerStatus?: number;
|
|
124
188
|
keyRef?: string;
|
|
125
189
|
expiresAt?: Date;
|
|
126
190
|
}
|
|
127
191
|
interface CheckStatusIndexArgs {
|
|
128
192
|
statusListCredential: StatusListCredential;
|
|
129
193
|
statusListIndex: string | number;
|
|
194
|
+
bitsPerStatus?: number;
|
|
130
195
|
}
|
|
131
|
-
interface
|
|
132
|
-
|
|
196
|
+
interface IToDetailsFromCredentialArgs {
|
|
197
|
+
statusListCredential: StatusListCredential;
|
|
198
|
+
statusListType: StatusListType;
|
|
199
|
+
bitsPerStatus?: number;
|
|
133
200
|
correlationId?: string;
|
|
134
201
|
driverType?: StatusListDriverType;
|
|
135
202
|
}
|
|
203
|
+
interface IMergeDetailsWithEntityArgs {
|
|
204
|
+
extractedDetails: IExtractedCredentialDetails;
|
|
205
|
+
statusListEntity: IStatusListEntity;
|
|
206
|
+
}
|
|
136
207
|
/**
|
|
137
208
|
* The interface definition for a plugin that can add statuslist info to a credential
|
|
138
209
|
*
|
|
@@ -205,12 +276,22 @@ type SignedStatusListData = {
|
|
|
205
276
|
statusListCredential: StatusListCredential;
|
|
206
277
|
encodedList: string;
|
|
207
278
|
};
|
|
208
|
-
type IRequiredPlugins =
|
|
209
|
-
type IRequiredContext = IAgentContext<ICredentialIssuer & ICredentialVerifier & IIdentifierResolution & IKeyManager &
|
|
279
|
+
type IRequiredPlugins = IVcdmCredentialPlugin & IIdentifierResolution;
|
|
280
|
+
type IRequiredContext = IAgentContext<ICredentialIssuer & ICredentialVerifier & IIdentifierResolution & IKeyManager & IVcdmCredentialPlugin>;
|
|
210
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
|
+
*/
|
|
211
287
|
declare function fetchStatusListCredential(args: {
|
|
212
288
|
statusListCredential: string;
|
|
213
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
|
+
*/
|
|
214
295
|
declare function statusPluginStatusFunction(args: {
|
|
215
296
|
documentLoader: any;
|
|
216
297
|
suite: any;
|
|
@@ -221,7 +302,8 @@ declare function statusPluginStatusFunction(args: {
|
|
|
221
302
|
}): StatusMethod;
|
|
222
303
|
/**
|
|
223
304
|
* Function that can be used together with @digitalbazar/vc and @digitialcredentials/vc
|
|
224
|
-
* @param args
|
|
305
|
+
* @param args - Configuration options for status verification
|
|
306
|
+
* @returns Function for checking credential status
|
|
225
307
|
*/
|
|
226
308
|
declare function vcLibCheckStatusFunction(args: {
|
|
227
309
|
mandatoryCredentialStatus?: boolean;
|
|
@@ -236,6 +318,11 @@ declare function vcLibCheckStatusFunction(args: {
|
|
|
236
318
|
verified: boolean;
|
|
237
319
|
error?: any;
|
|
238
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
|
+
*/
|
|
239
326
|
declare function checkStatusForCredential(args: {
|
|
240
327
|
credential: StatusListCredential;
|
|
241
328
|
documentLoader: any;
|
|
@@ -255,21 +342,60 @@ declare function simpleCheckStatusFromStatusListUrl(args: {
|
|
|
255
342
|
id?: string;
|
|
256
343
|
statusListIndex: string;
|
|
257
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
|
+
*/
|
|
258
350
|
declare function checkStatusIndexFromStatusListCredential(args: {
|
|
259
351
|
statusListCredential: StatusListCredential;
|
|
260
|
-
statusPurpose?: StatusPurpose2021;
|
|
261
|
-
type?: StatusListType | 'StatusList2021Entry';
|
|
352
|
+
statusPurpose?: StatusPurpose2021 | string | string[];
|
|
353
|
+
type?: StatusListType | 'StatusList2021Entry' | 'BitstringStatusListEntry';
|
|
262
354
|
id?: string;
|
|
263
355
|
statusListIndex: string | number;
|
|
356
|
+
bitsPerStatus?: number;
|
|
264
357
|
}): Promise<number | Status2021 | StatusOAuth>;
|
|
265
|
-
declare function createNewStatusList(args: CreateNewStatusListFuncArgs, context: IAgentContext<(
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
declare function
|
|
273
|
-
|
|
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;
|
|
274
400
|
|
|
275
|
-
export { type BaseCreateNewStatusListArgs, type CheckStatusIndexArgs, type CreateNewStatusListArgs, type CreateNewStatusListFuncArgs, type CreateStatusListArgs, type CredentialWithStatusSupport, type GetStatusListArgs, type IAddStatusToCredentialArgs, type IAddStatusToSdJwtCredentialArgs, type IIssueCredentialStatusOpts, type IRequiredContext, type IRequiredPlugins, type IStatusListPlugin, type OAuthStatusListArgs, type SignedStatusListData, Status2021, type StatusList2021Args, type StatusList2021EntryCredentialStatus, type StatusList2021ToVerifiableCredentialArgs, type StatusListOAuthEntryCredentialStatus, type StatusListResult, StatusOAuth, 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 };
|