@sphereon/ssi-sdk.vc-status-list 0.34.1-feature.SSISDK.17.bitstring.sl.13 → 0.34.1-feature.SSISDK.17.bitstring.sl.16
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 +303 -159
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +117 -43
- package/dist/index.d.ts +117 -43
- package/dist/index.js +303 -159
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/functions.ts +100 -36
- package/src/impl/BitstringStatusListImplementation.ts +117 -65
- package/src/impl/IStatusList.ts +35 -7
- package/src/impl/OAuthStatusList.ts +82 -30
- package/src/impl/StatusList2021.ts +78 -34
- package/src/index.ts +1 -0
- package/src/types/index.ts +18 -39
- package/src/utils.ts +47 -18
package/dist/index.d.cts
CHANGED
|
@@ -1,15 +1,61 @@
|
|
|
1
1
|
import { IIdentifierResolution } from '@sphereon/ssi-sdk-ext.identifier-resolution';
|
|
2
|
-
import {
|
|
2
|
+
import { IIssuer, StatusListType, CredentialProofFormat, StatusListCredential, StatusListDriverType, StatusListIndexingDirection, StatusPurpose2021, ICredentialStatus, OrPromise, ICredential, IVerifiableCredential } from '@sphereon/ssi-types';
|
|
3
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
9
|
import { IVcdmCredentialPlugin } from '@sphereon/ssi-sdk.credential-vcdm';
|
|
10
|
-
import {
|
|
10
|
+
import { BitstringStatusListArgs, IStatusListEntity, StatusListEntity, IStatusListEntryEntity, IBitstringStatusListEntryEntity, BitstringStatusListEntryCredentialStatus } from '@sphereon/ssi-sdk.data-store';
|
|
11
11
|
import { StatusMethod } from 'credential-status';
|
|
12
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
|
+
|
|
13
59
|
declare enum StatusOAuth {
|
|
14
60
|
Valid = 0,
|
|
15
61
|
Invalid = 1,
|
|
@@ -19,7 +65,6 @@ declare enum Status2021 {
|
|
|
19
65
|
Valid = 0,
|
|
20
66
|
Invalid = 1
|
|
21
67
|
}
|
|
22
|
-
type BitstringStatus = number;
|
|
23
68
|
type StatusList2021Args = {
|
|
24
69
|
indexingDirection: StatusListIndexingDirection;
|
|
25
70
|
statusPurpose?: StatusPurpose2021;
|
|
@@ -28,13 +73,6 @@ type OAuthStatusListArgs = {
|
|
|
28
73
|
bitsPerStatus: BitsPerStatus;
|
|
29
74
|
expiresAt?: Date;
|
|
30
75
|
};
|
|
31
|
-
type BitstringStatusListArgs = {
|
|
32
|
-
statusPurpose: BitstringStatusPurpose;
|
|
33
|
-
bitsPerStatus: number;
|
|
34
|
-
ttl?: number;
|
|
35
|
-
validFrom?: Date;
|
|
36
|
-
validUntil?: Date;
|
|
37
|
-
};
|
|
38
76
|
type BaseCreateNewStatusListArgs = {
|
|
39
77
|
type: StatusListType;
|
|
40
78
|
id: string;
|
|
@@ -80,7 +118,7 @@ interface UpdateStatusListFromStatusListCredentialArgs {
|
|
|
80
118
|
statusListCredential: StatusListCredential;
|
|
81
119
|
keyRef?: string;
|
|
82
120
|
statusListIndex: number | string;
|
|
83
|
-
value: number | Status2021 | StatusOAuth
|
|
121
|
+
value: number | Status2021 | StatusOAuth;
|
|
84
122
|
}
|
|
85
123
|
interface StatusListResult {
|
|
86
124
|
id: string;
|
|
@@ -93,13 +131,6 @@ interface StatusListResult {
|
|
|
93
131
|
statuslistContentType: string;
|
|
94
132
|
correlationId?: string;
|
|
95
133
|
driverType?: StatusListDriverType;
|
|
96
|
-
indexingDirection?: StatusListIndexingDirection;
|
|
97
|
-
statusPurpose?: StatusPurpose2021 | BitstringStatusPurpose | BitstringStatusPurpose[];
|
|
98
|
-
bitsPerStatus?: number;
|
|
99
|
-
expiresAt?: Date;
|
|
100
|
-
validFrom?: Date;
|
|
101
|
-
validUntil?: Date;
|
|
102
|
-
ttl?: number;
|
|
103
134
|
statusList2021?: {
|
|
104
135
|
indexingDirection: StatusListIndexingDirection;
|
|
105
136
|
statusPurpose: StatusPurpose2021;
|
|
@@ -129,15 +160,6 @@ interface StatusListOAuthEntryCredentialStatus extends ICredentialStatus {
|
|
|
129
160
|
statusListCredential: string;
|
|
130
161
|
expiresAt?: Date;
|
|
131
162
|
}
|
|
132
|
-
interface BitstringStatusListEntryCredentialStatus extends ICredentialStatus {
|
|
133
|
-
type: 'BitstringStatusListEntry';
|
|
134
|
-
statusPurpose: BitstringStatusPurpose | BitstringStatusPurpose[];
|
|
135
|
-
statusListIndex: string;
|
|
136
|
-
statusListCredential: string;
|
|
137
|
-
bitsPerStatus?: number;
|
|
138
|
-
statusMessage?: Array<BitstringStatus>;
|
|
139
|
-
statusReference?: string | string[];
|
|
140
|
-
}
|
|
141
163
|
interface StatusList2021ToVerifiableCredentialArgs {
|
|
142
164
|
issuer: string | IIssuer;
|
|
143
165
|
id: string;
|
|
@@ -161,7 +183,7 @@ interface CreateStatusListArgs {
|
|
|
161
183
|
interface UpdateStatusListIndexArgs {
|
|
162
184
|
statusListCredential: StatusListCredential;
|
|
163
185
|
statusListIndex: number | string;
|
|
164
|
-
value: number | Status2021 | StatusOAuth
|
|
186
|
+
value: number | Status2021 | StatusOAuth;
|
|
165
187
|
bitsPerStatus?: number;
|
|
166
188
|
keyRef?: string;
|
|
167
189
|
expiresAt?: Date;
|
|
@@ -171,11 +193,16 @@ interface CheckStatusIndexArgs {
|
|
|
171
193
|
statusListIndex: string | number;
|
|
172
194
|
bitsPerStatus?: number;
|
|
173
195
|
}
|
|
174
|
-
interface
|
|
175
|
-
|
|
196
|
+
interface IToDetailsFromCredentialArgs {
|
|
197
|
+
statusListCredential: StatusListCredential;
|
|
198
|
+
statusListType: StatusListType;
|
|
199
|
+
bitsPerStatus?: number;
|
|
176
200
|
correlationId?: string;
|
|
177
201
|
driverType?: StatusListDriverType;
|
|
178
|
-
|
|
202
|
+
}
|
|
203
|
+
interface IMergeDetailsWithEntityArgs {
|
|
204
|
+
extractedDetails: IExtractedCredentialDetails;
|
|
205
|
+
statusListEntity: IStatusListEntity;
|
|
179
206
|
}
|
|
180
207
|
/**
|
|
181
208
|
* The interface definition for a plugin that can add statuslist info to a credential
|
|
@@ -252,9 +279,19 @@ type SignedStatusListData = {
|
|
|
252
279
|
type IRequiredPlugins = IVcdmCredentialPlugin & IIdentifierResolution;
|
|
253
280
|
type IRequiredContext = IAgentContext<ICredentialIssuer & ICredentialVerifier & IIdentifierResolution & IKeyManager & IVcdmCredentialPlugin>;
|
|
254
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
|
+
*/
|
|
255
287
|
declare function fetchStatusListCredential(args: {
|
|
256
288
|
statusListCredential: string;
|
|
257
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
|
+
*/
|
|
258
295
|
declare function statusPluginStatusFunction(args: {
|
|
259
296
|
documentLoader: any;
|
|
260
297
|
suite: any;
|
|
@@ -265,7 +302,8 @@ declare function statusPluginStatusFunction(args: {
|
|
|
265
302
|
}): StatusMethod;
|
|
266
303
|
/**
|
|
267
304
|
* Function that can be used together with @digitalbazar/vc and @digitialcredentials/vc
|
|
268
|
-
* @param args
|
|
305
|
+
* @param args - Configuration options for status verification
|
|
306
|
+
* @returns Function for checking credential status
|
|
269
307
|
*/
|
|
270
308
|
declare function vcLibCheckStatusFunction(args: {
|
|
271
309
|
mandatoryCredentialStatus?: boolean;
|
|
@@ -280,6 +318,11 @@ declare function vcLibCheckStatusFunction(args: {
|
|
|
280
318
|
verified: boolean;
|
|
281
319
|
error?: any;
|
|
282
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
|
+
*/
|
|
283
326
|
declare function checkStatusForCredential(args: {
|
|
284
327
|
credential: StatusListCredential;
|
|
285
328
|
documentLoader: any;
|
|
@@ -298,7 +341,12 @@ declare function simpleCheckStatusFromStatusListUrl(args: {
|
|
|
298
341
|
type?: StatusListType | 'StatusList2021Entry';
|
|
299
342
|
id?: string;
|
|
300
343
|
statusListIndex: string;
|
|
301
|
-
}): 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
|
+
*/
|
|
302
350
|
declare function checkStatusIndexFromStatusListCredential(args: {
|
|
303
351
|
statusListCredential: StatusListCredential;
|
|
304
352
|
statusPurpose?: StatusPurpose2021 | string | string[];
|
|
@@ -306,22 +354,48 @@ declare function checkStatusIndexFromStatusListCredential(args: {
|
|
|
306
354
|
id?: string;
|
|
307
355
|
statusListIndex: string | number;
|
|
308
356
|
bitsPerStatus?: number;
|
|
309
|
-
}): Promise<number | Status2021 | StatusOAuth
|
|
357
|
+
}): Promise<number | Status2021 | StatusOAuth>;
|
|
310
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
|
+
*/
|
|
311
365
|
declare function updateStatusIndexFromStatusListCredential(args: UpdateStatusListIndexArgs, context: IAgentContext<IVcdmCredentialPlugin & IIdentifierResolution>): Promise<StatusListResult>;
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
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
|
+
*/
|
|
319
379
|
declare function createCredentialStatusFromStatusList(args: {
|
|
320
380
|
statusList: StatusListEntity;
|
|
321
381
|
statusListEntry: IStatusListEntryEntity | IBitstringStatusListEntryEntity;
|
|
322
382
|
statusListIndex: number;
|
|
323
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
|
+
*/
|
|
324
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
|
+
*/
|
|
325
397
|
declare function statusList2021ToVerifiableCredential(args: StatusList2021ToVerifiableCredentialArgs, context: IAgentContext<IVcdmCredentialPlugin & IIdentifierResolution>): Promise<StatusListCredential>;
|
|
326
398
|
|
|
327
|
-
|
|
399
|
+
declare function determineStatusListType(credential: StatusListCredential): StatusListType;
|
|
400
|
+
|
|
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,15 +1,61 @@
|
|
|
1
1
|
import { IIdentifierResolution } from '@sphereon/ssi-sdk-ext.identifier-resolution';
|
|
2
|
-
import {
|
|
2
|
+
import { IIssuer, StatusListType, CredentialProofFormat, StatusListCredential, StatusListDriverType, StatusListIndexingDirection, StatusPurpose2021, ICredentialStatus, OrPromise, ICredential, IVerifiableCredential } from '@sphereon/ssi-types';
|
|
3
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
9
|
import { IVcdmCredentialPlugin } from '@sphereon/ssi-sdk.credential-vcdm';
|
|
10
|
-
import {
|
|
10
|
+
import { BitstringStatusListArgs, IStatusListEntity, StatusListEntity, IStatusListEntryEntity, IBitstringStatusListEntryEntity, BitstringStatusListEntryCredentialStatus } from '@sphereon/ssi-sdk.data-store';
|
|
11
11
|
import { StatusMethod } from 'credential-status';
|
|
12
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
|
+
|
|
13
59
|
declare enum StatusOAuth {
|
|
14
60
|
Valid = 0,
|
|
15
61
|
Invalid = 1,
|
|
@@ -19,7 +65,6 @@ declare enum Status2021 {
|
|
|
19
65
|
Valid = 0,
|
|
20
66
|
Invalid = 1
|
|
21
67
|
}
|
|
22
|
-
type BitstringStatus = number;
|
|
23
68
|
type StatusList2021Args = {
|
|
24
69
|
indexingDirection: StatusListIndexingDirection;
|
|
25
70
|
statusPurpose?: StatusPurpose2021;
|
|
@@ -28,13 +73,6 @@ type OAuthStatusListArgs = {
|
|
|
28
73
|
bitsPerStatus: BitsPerStatus;
|
|
29
74
|
expiresAt?: Date;
|
|
30
75
|
};
|
|
31
|
-
type BitstringStatusListArgs = {
|
|
32
|
-
statusPurpose: BitstringStatusPurpose;
|
|
33
|
-
bitsPerStatus: number;
|
|
34
|
-
ttl?: number;
|
|
35
|
-
validFrom?: Date;
|
|
36
|
-
validUntil?: Date;
|
|
37
|
-
};
|
|
38
76
|
type BaseCreateNewStatusListArgs = {
|
|
39
77
|
type: StatusListType;
|
|
40
78
|
id: string;
|
|
@@ -80,7 +118,7 @@ interface UpdateStatusListFromStatusListCredentialArgs {
|
|
|
80
118
|
statusListCredential: StatusListCredential;
|
|
81
119
|
keyRef?: string;
|
|
82
120
|
statusListIndex: number | string;
|
|
83
|
-
value: number | Status2021 | StatusOAuth
|
|
121
|
+
value: number | Status2021 | StatusOAuth;
|
|
84
122
|
}
|
|
85
123
|
interface StatusListResult {
|
|
86
124
|
id: string;
|
|
@@ -93,13 +131,6 @@ interface StatusListResult {
|
|
|
93
131
|
statuslistContentType: string;
|
|
94
132
|
correlationId?: string;
|
|
95
133
|
driverType?: StatusListDriverType;
|
|
96
|
-
indexingDirection?: StatusListIndexingDirection;
|
|
97
|
-
statusPurpose?: StatusPurpose2021 | BitstringStatusPurpose | BitstringStatusPurpose[];
|
|
98
|
-
bitsPerStatus?: number;
|
|
99
|
-
expiresAt?: Date;
|
|
100
|
-
validFrom?: Date;
|
|
101
|
-
validUntil?: Date;
|
|
102
|
-
ttl?: number;
|
|
103
134
|
statusList2021?: {
|
|
104
135
|
indexingDirection: StatusListIndexingDirection;
|
|
105
136
|
statusPurpose: StatusPurpose2021;
|
|
@@ -129,15 +160,6 @@ interface StatusListOAuthEntryCredentialStatus extends ICredentialStatus {
|
|
|
129
160
|
statusListCredential: string;
|
|
130
161
|
expiresAt?: Date;
|
|
131
162
|
}
|
|
132
|
-
interface BitstringStatusListEntryCredentialStatus extends ICredentialStatus {
|
|
133
|
-
type: 'BitstringStatusListEntry';
|
|
134
|
-
statusPurpose: BitstringStatusPurpose | BitstringStatusPurpose[];
|
|
135
|
-
statusListIndex: string;
|
|
136
|
-
statusListCredential: string;
|
|
137
|
-
bitsPerStatus?: number;
|
|
138
|
-
statusMessage?: Array<BitstringStatus>;
|
|
139
|
-
statusReference?: string | string[];
|
|
140
|
-
}
|
|
141
163
|
interface StatusList2021ToVerifiableCredentialArgs {
|
|
142
164
|
issuer: string | IIssuer;
|
|
143
165
|
id: string;
|
|
@@ -161,7 +183,7 @@ interface CreateStatusListArgs {
|
|
|
161
183
|
interface UpdateStatusListIndexArgs {
|
|
162
184
|
statusListCredential: StatusListCredential;
|
|
163
185
|
statusListIndex: number | string;
|
|
164
|
-
value: number | Status2021 | StatusOAuth
|
|
186
|
+
value: number | Status2021 | StatusOAuth;
|
|
165
187
|
bitsPerStatus?: number;
|
|
166
188
|
keyRef?: string;
|
|
167
189
|
expiresAt?: Date;
|
|
@@ -171,11 +193,16 @@ interface CheckStatusIndexArgs {
|
|
|
171
193
|
statusListIndex: string | number;
|
|
172
194
|
bitsPerStatus?: number;
|
|
173
195
|
}
|
|
174
|
-
interface
|
|
175
|
-
|
|
196
|
+
interface IToDetailsFromCredentialArgs {
|
|
197
|
+
statusListCredential: StatusListCredential;
|
|
198
|
+
statusListType: StatusListType;
|
|
199
|
+
bitsPerStatus?: number;
|
|
176
200
|
correlationId?: string;
|
|
177
201
|
driverType?: StatusListDriverType;
|
|
178
|
-
|
|
202
|
+
}
|
|
203
|
+
interface IMergeDetailsWithEntityArgs {
|
|
204
|
+
extractedDetails: IExtractedCredentialDetails;
|
|
205
|
+
statusListEntity: IStatusListEntity;
|
|
179
206
|
}
|
|
180
207
|
/**
|
|
181
208
|
* The interface definition for a plugin that can add statuslist info to a credential
|
|
@@ -252,9 +279,19 @@ type SignedStatusListData = {
|
|
|
252
279
|
type IRequiredPlugins = IVcdmCredentialPlugin & IIdentifierResolution;
|
|
253
280
|
type IRequiredContext = IAgentContext<ICredentialIssuer & ICredentialVerifier & IIdentifierResolution & IKeyManager & IVcdmCredentialPlugin>;
|
|
254
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
|
+
*/
|
|
255
287
|
declare function fetchStatusListCredential(args: {
|
|
256
288
|
statusListCredential: string;
|
|
257
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
|
+
*/
|
|
258
295
|
declare function statusPluginStatusFunction(args: {
|
|
259
296
|
documentLoader: any;
|
|
260
297
|
suite: any;
|
|
@@ -265,7 +302,8 @@ declare function statusPluginStatusFunction(args: {
|
|
|
265
302
|
}): StatusMethod;
|
|
266
303
|
/**
|
|
267
304
|
* Function that can be used together with @digitalbazar/vc and @digitialcredentials/vc
|
|
268
|
-
* @param args
|
|
305
|
+
* @param args - Configuration options for status verification
|
|
306
|
+
* @returns Function for checking credential status
|
|
269
307
|
*/
|
|
270
308
|
declare function vcLibCheckStatusFunction(args: {
|
|
271
309
|
mandatoryCredentialStatus?: boolean;
|
|
@@ -280,6 +318,11 @@ declare function vcLibCheckStatusFunction(args: {
|
|
|
280
318
|
verified: boolean;
|
|
281
319
|
error?: any;
|
|
282
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
|
+
*/
|
|
283
326
|
declare function checkStatusForCredential(args: {
|
|
284
327
|
credential: StatusListCredential;
|
|
285
328
|
documentLoader: any;
|
|
@@ -298,7 +341,12 @@ declare function simpleCheckStatusFromStatusListUrl(args: {
|
|
|
298
341
|
type?: StatusListType | 'StatusList2021Entry';
|
|
299
342
|
id?: string;
|
|
300
343
|
statusListIndex: string;
|
|
301
|
-
}): 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
|
+
*/
|
|
302
350
|
declare function checkStatusIndexFromStatusListCredential(args: {
|
|
303
351
|
statusListCredential: StatusListCredential;
|
|
304
352
|
statusPurpose?: StatusPurpose2021 | string | string[];
|
|
@@ -306,22 +354,48 @@ declare function checkStatusIndexFromStatusListCredential(args: {
|
|
|
306
354
|
id?: string;
|
|
307
355
|
statusListIndex: string | number;
|
|
308
356
|
bitsPerStatus?: number;
|
|
309
|
-
}): Promise<number | Status2021 | StatusOAuth
|
|
357
|
+
}): Promise<number | Status2021 | StatusOAuth>;
|
|
310
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
|
+
*/
|
|
311
365
|
declare function updateStatusIndexFromStatusListCredential(args: UpdateStatusListIndexArgs, context: IAgentContext<IVcdmCredentialPlugin & IIdentifierResolution>): Promise<StatusListResult>;
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
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
|
+
*/
|
|
319
379
|
declare function createCredentialStatusFromStatusList(args: {
|
|
320
380
|
statusList: StatusListEntity;
|
|
321
381
|
statusListEntry: IStatusListEntryEntity | IBitstringStatusListEntryEntity;
|
|
322
382
|
statusListIndex: number;
|
|
323
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
|
+
*/
|
|
324
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
|
+
*/
|
|
325
397
|
declare function statusList2021ToVerifiableCredential(args: StatusList2021ToVerifiableCredentialArgs, context: IAgentContext<IVcdmCredentialPlugin & IIdentifierResolution>): Promise<StatusListCredential>;
|
|
326
398
|
|
|
327
|
-
|
|
399
|
+
declare function determineStatusListType(credential: StatusListCredential): StatusListType;
|
|
400
|
+
|
|
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 };
|