@sphereon/ssi-sdk.vc-status-list-issuer-drivers 0.34.1-next.7 → 0.34.1-next.86
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 +147 -64
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +171 -47
- package/dist/index.d.ts +171 -47
- package/dist/index.js +149 -66
- package/dist/index.js.map +1 -1
- package/package.json +11 -10
- package/src/drivers.ts +226 -84
- package/src/status-list-adapters.ts +14 -2
- package/src/types.ts +36 -18
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,34 @@
|
|
|
1
1
|
import { IIdentifierResolution } from '@sphereon/ssi-sdk-ext.identifier-resolution';
|
|
2
|
-
import { StatusListStore, IAddStatusListEntryArgs, IStatusListEntryEntity, IGetStatusListEntryByCredentialIdArgs, IGetStatusListEntryByIndexArgs } from '@sphereon/ssi-sdk.data-store';
|
|
2
|
+
import { StatusListStore, IAddStatusListEntryArgs, BitstringStatusListEntryCredentialStatus, IStatusListEntryEntity, IBitstringStatusListEntryEntity, IGetStatusListEntryByCredentialIdArgs, IGetStatusListEntryByIndexArgs } from '@sphereon/ssi-sdk.data-store';
|
|
3
3
|
import { StatusListResult, StatusList2021EntryCredentialStatus, StatusListOAuthEntryCredentialStatus, IStatusListPlugin } from '@sphereon/ssi-sdk.vc-status-list';
|
|
4
|
-
import { StatusListDriverType, StatusListCredential, StatusListCredentialIdMode
|
|
5
|
-
import { IDataStoreORM, IDIDManager, IKeyManager, ICredentialIssuer, ICredentialVerifier,
|
|
4
|
+
import { StatusListDriverType, StatusListType, StatusListCredential, StatusListCredentialIdMode } from '@sphereon/ssi-types';
|
|
5
|
+
import { IDataStoreORM, IDIDManager, IKeyManager, ICredentialIssuer, ICredentialVerifier, IResolver, IAgentContext } from '@veramo/core';
|
|
6
6
|
import { DataSources } from '@sphereon/ssi-sdk.agent-config';
|
|
7
7
|
import { DataSource } from 'typeorm';
|
|
8
|
+
import { IVcdmCredentialPlugin } from '@sphereon/ssi-sdk.credential-vcdm';
|
|
8
9
|
|
|
10
|
+
/**
|
|
11
|
+
* StatusList Driver Implementation for TypeORM/Agent Data Sources
|
|
12
|
+
*
|
|
13
|
+
* This module provides the database-backed implementation of the IStatusListDriver interface,
|
|
14
|
+
* handling persistence and retrieval of status list credentials and entries using TypeORM.
|
|
15
|
+
* It delegates status list format-specific operations to the functions layer while managing
|
|
16
|
+
* database interactions, driver configuration, and entity lifecycle.
|
|
17
|
+
*
|
|
18
|
+
* Key responsibilities:
|
|
19
|
+
* - Database connection and store management
|
|
20
|
+
* - Status list CRUD operations
|
|
21
|
+
* - Status list entry management
|
|
22
|
+
* - Random index generation for new entries
|
|
23
|
+
* - Integration with multiple data sources
|
|
24
|
+
*
|
|
25
|
+
* @author Sphereon International B.V.
|
|
26
|
+
* @since 2024
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Configuration options for status list management
|
|
31
|
+
*/
|
|
9
32
|
interface StatusListManagementOptions {
|
|
10
33
|
id?: string;
|
|
11
34
|
correlationId?: string;
|
|
@@ -13,17 +36,33 @@ interface StatusListManagementOptions {
|
|
|
13
36
|
driverOptions?: DriverOptions;
|
|
14
37
|
}
|
|
15
38
|
type DriverOptions = TypeORMOptions;
|
|
39
|
+
/**
|
|
40
|
+
* TypeORM-specific configuration options
|
|
41
|
+
*/
|
|
16
42
|
interface TypeORMOptions {
|
|
17
43
|
dbName?: string;
|
|
18
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Filesystem-specific configuration options
|
|
47
|
+
*/
|
|
19
48
|
interface FilesystemOptions {
|
|
20
49
|
path: string;
|
|
21
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Creates status list management options for TypeORM driver
|
|
53
|
+
* @param args - Configuration parameters including id, correlationId, and database name
|
|
54
|
+
* @returns StatusListManagementOptions configured for TypeORM
|
|
55
|
+
*/
|
|
22
56
|
declare function getOptions(args: {
|
|
23
57
|
id?: string;
|
|
24
58
|
correlationId?: string;
|
|
25
59
|
dbName: string;
|
|
26
60
|
}): StatusListManagementOptions;
|
|
61
|
+
/**
|
|
62
|
+
* Creates and initializes a status list driver instance
|
|
63
|
+
* @param args - Configuration parameters including database connection details
|
|
64
|
+
* @returns Promise resolving to initialized IStatusListDriver instance
|
|
65
|
+
*/
|
|
27
66
|
declare function getDriver(args: {
|
|
28
67
|
id?: string;
|
|
29
68
|
correlationId?: string;
|
|
@@ -31,84 +70,169 @@ declare function getDriver(args: {
|
|
|
31
70
|
dataSource?: DataSource;
|
|
32
71
|
dataSources?: DataSources;
|
|
33
72
|
}): Promise<IStatusListDriver>;
|
|
73
|
+
/**
|
|
74
|
+
* TypeORM-based implementation of the IStatusListDriver interface
|
|
75
|
+
*
|
|
76
|
+
* Manages status list credentials and entries using a TypeORM data source.
|
|
77
|
+
* Handles database operations while delegating format-specific logic to the functions layer.
|
|
78
|
+
*/
|
|
34
79
|
declare class AgentDataSourceStatusListDriver implements IStatusListDriver {
|
|
35
80
|
private _dataSource;
|
|
36
81
|
private _statusListStore;
|
|
37
82
|
private options;
|
|
38
83
|
private _statusListLength;
|
|
84
|
+
/**
|
|
85
|
+
* Creates a new AgentDataSourceStatusListDriver instance
|
|
86
|
+
* @param _dataSource - TypeORM DataSource for database operations
|
|
87
|
+
* @param _statusListStore - StatusListStore for data persistence
|
|
88
|
+
* @param options - Driver configuration options
|
|
89
|
+
*/
|
|
39
90
|
constructor(_dataSource: DataSource, _statusListStore: StatusListStore, options: StatusListManagementOptions);
|
|
91
|
+
/**
|
|
92
|
+
* Initializes and creates a new AgentDataSourceStatusListDriver instance
|
|
93
|
+
* @param options - Status list management configuration
|
|
94
|
+
* @param dbArgs - Database connection arguments
|
|
95
|
+
* @returns Promise resolving to initialized driver instance
|
|
96
|
+
*/
|
|
40
97
|
static init(options: StatusListManagementOptions, dbArgs?: {
|
|
41
98
|
dataSources?: DataSources;
|
|
42
99
|
dataSource?: DataSource;
|
|
43
100
|
}): Promise<AgentDataSourceStatusListDriver>;
|
|
101
|
+
/**
|
|
102
|
+
* Gets the TypeORM DataSource instance
|
|
103
|
+
* @returns DataSource instance for database operations
|
|
104
|
+
*/
|
|
44
105
|
get dataSource(): DataSource;
|
|
106
|
+
/**
|
|
107
|
+
* Gets the StatusListStore instance
|
|
108
|
+
* @returns StatusListStore for data persistence operations
|
|
109
|
+
*/
|
|
45
110
|
get statusListStore(): StatusListStore;
|
|
111
|
+
/**
|
|
112
|
+
* Gets the driver configuration options
|
|
113
|
+
* @returns DriverOptions configuration
|
|
114
|
+
*/
|
|
46
115
|
getOptions(): DriverOptions;
|
|
116
|
+
/**
|
|
117
|
+
* Gets the driver type
|
|
118
|
+
* @returns StatusListDriverType enum value
|
|
119
|
+
*/
|
|
47
120
|
getType(): StatusListDriverType;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
121
|
+
/**
|
|
122
|
+
* Creates a new status list credential and stores it in the database
|
|
123
|
+
* @param args - Status list creation parameters
|
|
124
|
+
* @returns Promise resolving to StatusListResult
|
|
125
|
+
*/
|
|
126
|
+
createStatusList(args: ICreateStatusListArgs): Promise<StatusListResult>;
|
|
127
|
+
/**
|
|
128
|
+
* Updates an existing status list credential in the database
|
|
129
|
+
* @param args - Status list update parameters
|
|
130
|
+
* @returns Promise resolving to StatusListResult
|
|
131
|
+
*/
|
|
132
|
+
updateStatusList(args: IUpdateStatusListArgs): Promise<StatusListResult>;
|
|
133
|
+
/**
|
|
134
|
+
* Deletes the status list from the database
|
|
135
|
+
* @returns Promise resolving to boolean indicating success
|
|
136
|
+
*/
|
|
58
137
|
deleteStatusList(): Promise<boolean>;
|
|
59
|
-
|
|
60
|
-
|
|
138
|
+
/**
|
|
139
|
+
* Updates a status list entry and returns the credential status
|
|
140
|
+
* @param args - Status list entry update parameters
|
|
141
|
+
* @returns Promise resolving to credential status and entry
|
|
142
|
+
*/
|
|
61
143
|
updateStatusListEntry(args: IAddStatusListEntryArgs): Promise<{
|
|
62
|
-
credentialStatus: StatusList2021EntryCredentialStatus | StatusListOAuthEntryCredentialStatus;
|
|
63
|
-
statusListEntry: IStatusListEntryEntity;
|
|
144
|
+
credentialStatus: StatusList2021EntryCredentialStatus | StatusListOAuthEntryCredentialStatus | BitstringStatusListEntryCredentialStatus;
|
|
145
|
+
statusListEntry: IStatusListEntryEntity | IBitstringStatusListEntryEntity;
|
|
64
146
|
}>;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
147
|
+
/**
|
|
148
|
+
* Retrieves a status list entry by credential ID
|
|
149
|
+
* @param args - Query parameters including credential ID
|
|
150
|
+
* @returns Promise resolving to status list entry or undefined
|
|
151
|
+
*/
|
|
152
|
+
getStatusListEntryByCredentialId(args: IGetStatusListEntryByCredentialIdArgs): Promise<IStatusListEntryEntity | IBitstringStatusListEntryEntity | undefined>;
|
|
153
|
+
/**
|
|
154
|
+
* Retrieves a status list entry by index
|
|
155
|
+
* @param args - Query parameters including status list index
|
|
156
|
+
* @returns Promise resolving to status list entry or undefined
|
|
157
|
+
*/
|
|
158
|
+
getStatusListEntryByIndex(args: IGetStatusListEntryByIndexArgs): Promise<IStatusListEntryEntity | IBitstringStatusListEntryEntity | undefined>;
|
|
159
|
+
/**
|
|
160
|
+
* Generates a random available index for new status list entries
|
|
161
|
+
* @param args - Optional correlation ID parameter
|
|
162
|
+
* @returns Promise resolving to available index number
|
|
163
|
+
*/
|
|
164
|
+
getRandomNewStatusListIndex(args?: IGetRandomNewStatusListIndexArgs): Promise<number>;
|
|
165
|
+
/**
|
|
166
|
+
* Implementation for generating random status list indices with retry logic
|
|
167
|
+
* @param tries - Number of attempts made
|
|
168
|
+
* @param args - Optional correlation ID parameter
|
|
169
|
+
* @returns Promise resolving to available index or -1 if none found
|
|
170
|
+
*/
|
|
70
171
|
private getRandomNewStatusListIndexImpl;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
172
|
+
/**
|
|
173
|
+
* Gets the length of the status list
|
|
174
|
+
* @param args - Optional correlation ID parameter
|
|
175
|
+
* @returns Promise resolving to status list length
|
|
176
|
+
*/
|
|
177
|
+
getStatusListLength(args?: IGetStatusListLengthArgs): Promise<number>;
|
|
178
|
+
/**
|
|
179
|
+
* Retrieves the status list details
|
|
180
|
+
* @param args - Optional correlation ID parameter
|
|
181
|
+
* @returns Promise resolving to StatusListResult
|
|
182
|
+
*/
|
|
183
|
+
getStatusList(args?: IGetStatusListArgs): Promise<StatusListResult>;
|
|
184
|
+
/**
|
|
185
|
+
* Retrieves all status lists
|
|
186
|
+
* @returns Promise resolving to array of StatusListResult
|
|
187
|
+
*/
|
|
77
188
|
getStatusLists(): Promise<Array<StatusListResult>>;
|
|
189
|
+
/**
|
|
190
|
+
* Checks if a status list index is currently in use
|
|
191
|
+
* @returns Promise resolving to boolean indicating usage status
|
|
192
|
+
*/
|
|
78
193
|
isStatusListIndexInUse(): Promise<boolean>;
|
|
79
194
|
}
|
|
80
195
|
|
|
81
|
-
type IRequiredPlugins = IDataStoreORM & IDIDManager & IKeyManager & IIdentifierResolution & ICredentialIssuer & ICredentialVerifier &
|
|
196
|
+
type IRequiredPlugins = IDataStoreORM & IDIDManager & IKeyManager & IIdentifierResolution & ICredentialIssuer & ICredentialVerifier & IVcdmCredentialPlugin & IStatusListPlugin & IResolver;
|
|
82
197
|
type IRequiredContext = IAgentContext<IRequiredPlugins>;
|
|
198
|
+
interface ICreateStatusListArgs {
|
|
199
|
+
statusListType: StatusListType;
|
|
200
|
+
statusListCredential: StatusListCredential;
|
|
201
|
+
credentialIdMode?: StatusListCredentialIdMode;
|
|
202
|
+
correlationId?: string;
|
|
203
|
+
bitsPerStatus?: number;
|
|
204
|
+
}
|
|
205
|
+
interface IGetStatusListArgs {
|
|
206
|
+
correlationId?: string;
|
|
207
|
+
}
|
|
208
|
+
interface IGetStatusListLengthArgs {
|
|
209
|
+
correlationId?: string;
|
|
210
|
+
}
|
|
211
|
+
interface IUpdateStatusListArgs {
|
|
212
|
+
statusListCredential: StatusListCredential;
|
|
213
|
+
correlationId: string;
|
|
214
|
+
}
|
|
215
|
+
interface IGetRandomNewStatusListIndexArgs {
|
|
216
|
+
correlationId?: string;
|
|
217
|
+
}
|
|
83
218
|
interface IStatusListDriver {
|
|
84
219
|
statusListStore: StatusListStore;
|
|
85
220
|
getType(): StatusListDriverType;
|
|
86
221
|
getOptions(): DriverOptions;
|
|
87
|
-
getStatusListLength(args?:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
createStatusList(args: {
|
|
91
|
-
statusListCredential: StatusListCredential;
|
|
92
|
-
correlationId?: string;
|
|
93
|
-
}): Promise<StatusListResult>;
|
|
94
|
-
getStatusList(args?: {
|
|
95
|
-
correlationId?: string;
|
|
96
|
-
}): Promise<StatusListResult>;
|
|
222
|
+
getStatusListLength(args?: IGetStatusListLengthArgs): Promise<number>;
|
|
223
|
+
createStatusList(args: ICreateStatusListArgs): Promise<StatusListResult>;
|
|
224
|
+
getStatusList(args?: IGetStatusListArgs): Promise<StatusListResult>;
|
|
97
225
|
getStatusLists(): Promise<Array<StatusListResult>>;
|
|
98
226
|
updateStatusListEntry(args: IAddStatusListEntryArgs): Promise<{
|
|
99
|
-
credentialStatus: StatusList2021EntryCredentialStatus | StatusListOAuthEntryCredentialStatus;
|
|
227
|
+
credentialStatus: StatusList2021EntryCredentialStatus | StatusListOAuthEntryCredentialStatus | BitstringStatusListEntryCredentialStatus;
|
|
100
228
|
statusListEntry: IStatusListEntryEntity;
|
|
101
229
|
}>;
|
|
102
230
|
getStatusListEntryByCredentialId(args: IGetStatusListEntryByCredentialIdArgs): Promise<IStatusListEntryEntity | undefined>;
|
|
103
231
|
getStatusListEntryByIndex(args: IGetStatusListEntryByIndexArgs): Promise<IStatusListEntryEntity | undefined>;
|
|
104
|
-
updateStatusList(args:
|
|
105
|
-
statusListCredential: StatusListCredential;
|
|
106
|
-
}): Promise<StatusListResult>;
|
|
232
|
+
updateStatusList(args: IUpdateStatusListArgs): Promise<StatusListResult>;
|
|
107
233
|
deleteStatusList(): Promise<boolean>;
|
|
108
|
-
getRandomNewStatusListIndex(args?:
|
|
109
|
-
correlationId?: string;
|
|
110
|
-
}): Promise<number>;
|
|
234
|
+
getRandomNewStatusListIndex(args?: IGetRandomNewStatusListIndexArgs): Promise<number>;
|
|
111
235
|
isStatusListIndexInUse(): Promise<boolean>;
|
|
112
236
|
}
|
|
113
237
|
|
|
114
|
-
export { AgentDataSourceStatusListDriver, type DriverOptions, type FilesystemOptions, type IRequiredContext, type IRequiredPlugins, type IStatusListDriver, type StatusListManagementOptions, type TypeORMOptions, getDriver, getOptions };
|
|
238
|
+
export { AgentDataSourceStatusListDriver, type DriverOptions, type FilesystemOptions, type ICreateStatusListArgs, type IGetRandomNewStatusListIndexArgs, type IGetStatusListArgs, type IGetStatusListLengthArgs, type IRequiredContext, type IRequiredPlugins, type IStatusListDriver, type IUpdateStatusListArgs, type StatusListManagementOptions, type TypeORMOptions, getDriver, getOptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,34 @@
|
|
|
1
1
|
import { IIdentifierResolution } from '@sphereon/ssi-sdk-ext.identifier-resolution';
|
|
2
|
-
import { StatusListStore, IAddStatusListEntryArgs, IStatusListEntryEntity, IGetStatusListEntryByCredentialIdArgs, IGetStatusListEntryByIndexArgs } from '@sphereon/ssi-sdk.data-store';
|
|
2
|
+
import { StatusListStore, IAddStatusListEntryArgs, BitstringStatusListEntryCredentialStatus, IStatusListEntryEntity, IBitstringStatusListEntryEntity, IGetStatusListEntryByCredentialIdArgs, IGetStatusListEntryByIndexArgs } from '@sphereon/ssi-sdk.data-store';
|
|
3
3
|
import { StatusListResult, StatusList2021EntryCredentialStatus, StatusListOAuthEntryCredentialStatus, IStatusListPlugin } from '@sphereon/ssi-sdk.vc-status-list';
|
|
4
|
-
import { StatusListDriverType, StatusListCredential, StatusListCredentialIdMode
|
|
5
|
-
import { IDataStoreORM, IDIDManager, IKeyManager, ICredentialIssuer, ICredentialVerifier,
|
|
4
|
+
import { StatusListDriverType, StatusListType, StatusListCredential, StatusListCredentialIdMode } from '@sphereon/ssi-types';
|
|
5
|
+
import { IDataStoreORM, IDIDManager, IKeyManager, ICredentialIssuer, ICredentialVerifier, IResolver, IAgentContext } from '@veramo/core';
|
|
6
6
|
import { DataSources } from '@sphereon/ssi-sdk.agent-config';
|
|
7
7
|
import { DataSource } from 'typeorm';
|
|
8
|
+
import { IVcdmCredentialPlugin } from '@sphereon/ssi-sdk.credential-vcdm';
|
|
8
9
|
|
|
10
|
+
/**
|
|
11
|
+
* StatusList Driver Implementation for TypeORM/Agent Data Sources
|
|
12
|
+
*
|
|
13
|
+
* This module provides the database-backed implementation of the IStatusListDriver interface,
|
|
14
|
+
* handling persistence and retrieval of status list credentials and entries using TypeORM.
|
|
15
|
+
* It delegates status list format-specific operations to the functions layer while managing
|
|
16
|
+
* database interactions, driver configuration, and entity lifecycle.
|
|
17
|
+
*
|
|
18
|
+
* Key responsibilities:
|
|
19
|
+
* - Database connection and store management
|
|
20
|
+
* - Status list CRUD operations
|
|
21
|
+
* - Status list entry management
|
|
22
|
+
* - Random index generation for new entries
|
|
23
|
+
* - Integration with multiple data sources
|
|
24
|
+
*
|
|
25
|
+
* @author Sphereon International B.V.
|
|
26
|
+
* @since 2024
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Configuration options for status list management
|
|
31
|
+
*/
|
|
9
32
|
interface StatusListManagementOptions {
|
|
10
33
|
id?: string;
|
|
11
34
|
correlationId?: string;
|
|
@@ -13,17 +36,33 @@ interface StatusListManagementOptions {
|
|
|
13
36
|
driverOptions?: DriverOptions;
|
|
14
37
|
}
|
|
15
38
|
type DriverOptions = TypeORMOptions;
|
|
39
|
+
/**
|
|
40
|
+
* TypeORM-specific configuration options
|
|
41
|
+
*/
|
|
16
42
|
interface TypeORMOptions {
|
|
17
43
|
dbName?: string;
|
|
18
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Filesystem-specific configuration options
|
|
47
|
+
*/
|
|
19
48
|
interface FilesystemOptions {
|
|
20
49
|
path: string;
|
|
21
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Creates status list management options for TypeORM driver
|
|
53
|
+
* @param args - Configuration parameters including id, correlationId, and database name
|
|
54
|
+
* @returns StatusListManagementOptions configured for TypeORM
|
|
55
|
+
*/
|
|
22
56
|
declare function getOptions(args: {
|
|
23
57
|
id?: string;
|
|
24
58
|
correlationId?: string;
|
|
25
59
|
dbName: string;
|
|
26
60
|
}): StatusListManagementOptions;
|
|
61
|
+
/**
|
|
62
|
+
* Creates and initializes a status list driver instance
|
|
63
|
+
* @param args - Configuration parameters including database connection details
|
|
64
|
+
* @returns Promise resolving to initialized IStatusListDriver instance
|
|
65
|
+
*/
|
|
27
66
|
declare function getDriver(args: {
|
|
28
67
|
id?: string;
|
|
29
68
|
correlationId?: string;
|
|
@@ -31,84 +70,169 @@ declare function getDriver(args: {
|
|
|
31
70
|
dataSource?: DataSource;
|
|
32
71
|
dataSources?: DataSources;
|
|
33
72
|
}): Promise<IStatusListDriver>;
|
|
73
|
+
/**
|
|
74
|
+
* TypeORM-based implementation of the IStatusListDriver interface
|
|
75
|
+
*
|
|
76
|
+
* Manages status list credentials and entries using a TypeORM data source.
|
|
77
|
+
* Handles database operations while delegating format-specific logic to the functions layer.
|
|
78
|
+
*/
|
|
34
79
|
declare class AgentDataSourceStatusListDriver implements IStatusListDriver {
|
|
35
80
|
private _dataSource;
|
|
36
81
|
private _statusListStore;
|
|
37
82
|
private options;
|
|
38
83
|
private _statusListLength;
|
|
84
|
+
/**
|
|
85
|
+
* Creates a new AgentDataSourceStatusListDriver instance
|
|
86
|
+
* @param _dataSource - TypeORM DataSource for database operations
|
|
87
|
+
* @param _statusListStore - StatusListStore for data persistence
|
|
88
|
+
* @param options - Driver configuration options
|
|
89
|
+
*/
|
|
39
90
|
constructor(_dataSource: DataSource, _statusListStore: StatusListStore, options: StatusListManagementOptions);
|
|
91
|
+
/**
|
|
92
|
+
* Initializes and creates a new AgentDataSourceStatusListDriver instance
|
|
93
|
+
* @param options - Status list management configuration
|
|
94
|
+
* @param dbArgs - Database connection arguments
|
|
95
|
+
* @returns Promise resolving to initialized driver instance
|
|
96
|
+
*/
|
|
40
97
|
static init(options: StatusListManagementOptions, dbArgs?: {
|
|
41
98
|
dataSources?: DataSources;
|
|
42
99
|
dataSource?: DataSource;
|
|
43
100
|
}): Promise<AgentDataSourceStatusListDriver>;
|
|
101
|
+
/**
|
|
102
|
+
* Gets the TypeORM DataSource instance
|
|
103
|
+
* @returns DataSource instance for database operations
|
|
104
|
+
*/
|
|
44
105
|
get dataSource(): DataSource;
|
|
106
|
+
/**
|
|
107
|
+
* Gets the StatusListStore instance
|
|
108
|
+
* @returns StatusListStore for data persistence operations
|
|
109
|
+
*/
|
|
45
110
|
get statusListStore(): StatusListStore;
|
|
111
|
+
/**
|
|
112
|
+
* Gets the driver configuration options
|
|
113
|
+
* @returns DriverOptions configuration
|
|
114
|
+
*/
|
|
46
115
|
getOptions(): DriverOptions;
|
|
116
|
+
/**
|
|
117
|
+
* Gets the driver type
|
|
118
|
+
* @returns StatusListDriverType enum value
|
|
119
|
+
*/
|
|
47
120
|
getType(): StatusListDriverType;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
121
|
+
/**
|
|
122
|
+
* Creates a new status list credential and stores it in the database
|
|
123
|
+
* @param args - Status list creation parameters
|
|
124
|
+
* @returns Promise resolving to StatusListResult
|
|
125
|
+
*/
|
|
126
|
+
createStatusList(args: ICreateStatusListArgs): Promise<StatusListResult>;
|
|
127
|
+
/**
|
|
128
|
+
* Updates an existing status list credential in the database
|
|
129
|
+
* @param args - Status list update parameters
|
|
130
|
+
* @returns Promise resolving to StatusListResult
|
|
131
|
+
*/
|
|
132
|
+
updateStatusList(args: IUpdateStatusListArgs): Promise<StatusListResult>;
|
|
133
|
+
/**
|
|
134
|
+
* Deletes the status list from the database
|
|
135
|
+
* @returns Promise resolving to boolean indicating success
|
|
136
|
+
*/
|
|
58
137
|
deleteStatusList(): Promise<boolean>;
|
|
59
|
-
|
|
60
|
-
|
|
138
|
+
/**
|
|
139
|
+
* Updates a status list entry and returns the credential status
|
|
140
|
+
* @param args - Status list entry update parameters
|
|
141
|
+
* @returns Promise resolving to credential status and entry
|
|
142
|
+
*/
|
|
61
143
|
updateStatusListEntry(args: IAddStatusListEntryArgs): Promise<{
|
|
62
|
-
credentialStatus: StatusList2021EntryCredentialStatus | StatusListOAuthEntryCredentialStatus;
|
|
63
|
-
statusListEntry: IStatusListEntryEntity;
|
|
144
|
+
credentialStatus: StatusList2021EntryCredentialStatus | StatusListOAuthEntryCredentialStatus | BitstringStatusListEntryCredentialStatus;
|
|
145
|
+
statusListEntry: IStatusListEntryEntity | IBitstringStatusListEntryEntity;
|
|
64
146
|
}>;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
147
|
+
/**
|
|
148
|
+
* Retrieves a status list entry by credential ID
|
|
149
|
+
* @param args - Query parameters including credential ID
|
|
150
|
+
* @returns Promise resolving to status list entry or undefined
|
|
151
|
+
*/
|
|
152
|
+
getStatusListEntryByCredentialId(args: IGetStatusListEntryByCredentialIdArgs): Promise<IStatusListEntryEntity | IBitstringStatusListEntryEntity | undefined>;
|
|
153
|
+
/**
|
|
154
|
+
* Retrieves a status list entry by index
|
|
155
|
+
* @param args - Query parameters including status list index
|
|
156
|
+
* @returns Promise resolving to status list entry or undefined
|
|
157
|
+
*/
|
|
158
|
+
getStatusListEntryByIndex(args: IGetStatusListEntryByIndexArgs): Promise<IStatusListEntryEntity | IBitstringStatusListEntryEntity | undefined>;
|
|
159
|
+
/**
|
|
160
|
+
* Generates a random available index for new status list entries
|
|
161
|
+
* @param args - Optional correlation ID parameter
|
|
162
|
+
* @returns Promise resolving to available index number
|
|
163
|
+
*/
|
|
164
|
+
getRandomNewStatusListIndex(args?: IGetRandomNewStatusListIndexArgs): Promise<number>;
|
|
165
|
+
/**
|
|
166
|
+
* Implementation for generating random status list indices with retry logic
|
|
167
|
+
* @param tries - Number of attempts made
|
|
168
|
+
* @param args - Optional correlation ID parameter
|
|
169
|
+
* @returns Promise resolving to available index or -1 if none found
|
|
170
|
+
*/
|
|
70
171
|
private getRandomNewStatusListIndexImpl;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
172
|
+
/**
|
|
173
|
+
* Gets the length of the status list
|
|
174
|
+
* @param args - Optional correlation ID parameter
|
|
175
|
+
* @returns Promise resolving to status list length
|
|
176
|
+
*/
|
|
177
|
+
getStatusListLength(args?: IGetStatusListLengthArgs): Promise<number>;
|
|
178
|
+
/**
|
|
179
|
+
* Retrieves the status list details
|
|
180
|
+
* @param args - Optional correlation ID parameter
|
|
181
|
+
* @returns Promise resolving to StatusListResult
|
|
182
|
+
*/
|
|
183
|
+
getStatusList(args?: IGetStatusListArgs): Promise<StatusListResult>;
|
|
184
|
+
/**
|
|
185
|
+
* Retrieves all status lists
|
|
186
|
+
* @returns Promise resolving to array of StatusListResult
|
|
187
|
+
*/
|
|
77
188
|
getStatusLists(): Promise<Array<StatusListResult>>;
|
|
189
|
+
/**
|
|
190
|
+
* Checks if a status list index is currently in use
|
|
191
|
+
* @returns Promise resolving to boolean indicating usage status
|
|
192
|
+
*/
|
|
78
193
|
isStatusListIndexInUse(): Promise<boolean>;
|
|
79
194
|
}
|
|
80
195
|
|
|
81
|
-
type IRequiredPlugins = IDataStoreORM & IDIDManager & IKeyManager & IIdentifierResolution & ICredentialIssuer & ICredentialVerifier &
|
|
196
|
+
type IRequiredPlugins = IDataStoreORM & IDIDManager & IKeyManager & IIdentifierResolution & ICredentialIssuer & ICredentialVerifier & IVcdmCredentialPlugin & IStatusListPlugin & IResolver;
|
|
82
197
|
type IRequiredContext = IAgentContext<IRequiredPlugins>;
|
|
198
|
+
interface ICreateStatusListArgs {
|
|
199
|
+
statusListType: StatusListType;
|
|
200
|
+
statusListCredential: StatusListCredential;
|
|
201
|
+
credentialIdMode?: StatusListCredentialIdMode;
|
|
202
|
+
correlationId?: string;
|
|
203
|
+
bitsPerStatus?: number;
|
|
204
|
+
}
|
|
205
|
+
interface IGetStatusListArgs {
|
|
206
|
+
correlationId?: string;
|
|
207
|
+
}
|
|
208
|
+
interface IGetStatusListLengthArgs {
|
|
209
|
+
correlationId?: string;
|
|
210
|
+
}
|
|
211
|
+
interface IUpdateStatusListArgs {
|
|
212
|
+
statusListCredential: StatusListCredential;
|
|
213
|
+
correlationId: string;
|
|
214
|
+
}
|
|
215
|
+
interface IGetRandomNewStatusListIndexArgs {
|
|
216
|
+
correlationId?: string;
|
|
217
|
+
}
|
|
83
218
|
interface IStatusListDriver {
|
|
84
219
|
statusListStore: StatusListStore;
|
|
85
220
|
getType(): StatusListDriverType;
|
|
86
221
|
getOptions(): DriverOptions;
|
|
87
|
-
getStatusListLength(args?:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
createStatusList(args: {
|
|
91
|
-
statusListCredential: StatusListCredential;
|
|
92
|
-
correlationId?: string;
|
|
93
|
-
}): Promise<StatusListResult>;
|
|
94
|
-
getStatusList(args?: {
|
|
95
|
-
correlationId?: string;
|
|
96
|
-
}): Promise<StatusListResult>;
|
|
222
|
+
getStatusListLength(args?: IGetStatusListLengthArgs): Promise<number>;
|
|
223
|
+
createStatusList(args: ICreateStatusListArgs): Promise<StatusListResult>;
|
|
224
|
+
getStatusList(args?: IGetStatusListArgs): Promise<StatusListResult>;
|
|
97
225
|
getStatusLists(): Promise<Array<StatusListResult>>;
|
|
98
226
|
updateStatusListEntry(args: IAddStatusListEntryArgs): Promise<{
|
|
99
|
-
credentialStatus: StatusList2021EntryCredentialStatus | StatusListOAuthEntryCredentialStatus;
|
|
227
|
+
credentialStatus: StatusList2021EntryCredentialStatus | StatusListOAuthEntryCredentialStatus | BitstringStatusListEntryCredentialStatus;
|
|
100
228
|
statusListEntry: IStatusListEntryEntity;
|
|
101
229
|
}>;
|
|
102
230
|
getStatusListEntryByCredentialId(args: IGetStatusListEntryByCredentialIdArgs): Promise<IStatusListEntryEntity | undefined>;
|
|
103
231
|
getStatusListEntryByIndex(args: IGetStatusListEntryByIndexArgs): Promise<IStatusListEntryEntity | undefined>;
|
|
104
|
-
updateStatusList(args:
|
|
105
|
-
statusListCredential: StatusListCredential;
|
|
106
|
-
}): Promise<StatusListResult>;
|
|
232
|
+
updateStatusList(args: IUpdateStatusListArgs): Promise<StatusListResult>;
|
|
107
233
|
deleteStatusList(): Promise<boolean>;
|
|
108
|
-
getRandomNewStatusListIndex(args?:
|
|
109
|
-
correlationId?: string;
|
|
110
|
-
}): Promise<number>;
|
|
234
|
+
getRandomNewStatusListIndex(args?: IGetRandomNewStatusListIndexArgs): Promise<number>;
|
|
111
235
|
isStatusListIndexInUse(): Promise<boolean>;
|
|
112
236
|
}
|
|
113
237
|
|
|
114
|
-
export { AgentDataSourceStatusListDriver, type DriverOptions, type FilesystemOptions, type IRequiredContext, type IRequiredPlugins, type IStatusListDriver, type StatusListManagementOptions, type TypeORMOptions, getDriver, getOptions };
|
|
238
|
+
export { AgentDataSourceStatusListDriver, type DriverOptions, type FilesystemOptions, type ICreateStatusListArgs, type IGetRandomNewStatusListIndexArgs, type IGetStatusListArgs, type IGetStatusListLengthArgs, type IRequiredContext, type IRequiredPlugins, type IStatusListDriver, type IUpdateStatusListArgs, type StatusListManagementOptions, type TypeORMOptions, getDriver, getOptions };
|