@sphereon/ssi-sdk.vc-status-list-issuer-drivers 0.34.1-feature.SSISDK.17.bitstring.sl.9 → 0.34.1-next.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.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';
3
- import { StatusListResult, StatusList2021EntryCredentialStatus, StatusListOAuthEntryCredentialStatus, BitstringStatusListEntryCredentialStatus, IStatusListPlugin } from '@sphereon/ssi-sdk.vc-status-list';
4
- import { StatusListDriverType, StatusListCredential, StatusListCredentialIdMode, StatusListType } from '@sphereon/ssi-types';
5
- import { IDataStoreORM, IDIDManager, IKeyManager, ICredentialIssuer, ICredentialVerifier, ICredentialPlugin, IResolver, IAgentContext } from '@veramo/core';
2
+ import { StatusListStore, IAddStatusListEntryArgs, BitstringStatusListEntryCredentialStatus, IStatusListEntryEntity, IBitstringStatusListEntryEntity, IGetStatusListEntryByCredentialIdArgs, IGetStatusListEntryByIndexArgs } from '@sphereon/ssi-sdk.data-store';
3
+ import { StatusListResult, StatusList2021EntryCredentialStatus, StatusListOAuthEntryCredentialStatus, IStatusListPlugin } from '@sphereon/ssi-sdk.vc-status-list';
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,72 +70,158 @@ 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
- createStatusList(args: {
49
- statusListCredential: StatusListCredential;
50
- correlationId?: string;
51
- credentialIdMode?: StatusListCredentialIdMode;
52
- bitsPerStatus?: number;
53
- }): Promise<StatusListResult>;
54
- updateStatusList(args: {
55
- statusListCredential: StatusListCredential;
56
- correlationId: string;
57
- type: StatusListType;
58
- }): Promise<StatusListResult>;
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
+ */
59
137
  deleteStatusList(): Promise<boolean>;
60
- private isStatusList2021Entity;
61
- private isOAuthStatusListEntity;
62
- private isBitstringStatusListEntity;
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
+ */
63
143
  updateStatusListEntry(args: IAddStatusListEntryArgs): Promise<{
64
144
  credentialStatus: StatusList2021EntryCredentialStatus | StatusListOAuthEntryCredentialStatus | BitstringStatusListEntryCredentialStatus;
65
- statusListEntry: IStatusListEntryEntity;
145
+ statusListEntry: IStatusListEntryEntity | IBitstringStatusListEntryEntity;
66
146
  }>;
67
- getStatusListEntryByCredentialId(args: IGetStatusListEntryByCredentialIdArgs): Promise<IStatusListEntryEntity | undefined>;
68
- getStatusListEntryByIndex(args: IGetStatusListEntryByIndexArgs): Promise<IStatusListEntryEntity | undefined>;
69
- getRandomNewStatusListIndex(args?: {
70
- correlationId?: string;
71
- }): Promise<number>;
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
+ */
72
171
  private getRandomNewStatusListIndexImpl;
73
- getStatusListLength(args?: {
74
- correlationId?: string;
75
- }): Promise<number>;
76
- getStatusList(args?: {
77
- correlationId?: string;
78
- }): Promise<StatusListResult>;
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
+ */
79
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
+ */
80
193
  isStatusListIndexInUse(): Promise<boolean>;
81
194
  }
82
195
 
83
- type IRequiredPlugins = IDataStoreORM & IDIDManager & IKeyManager & IIdentifierResolution & ICredentialIssuer & ICredentialVerifier & ICredentialPlugin & IStatusListPlugin & IResolver;
196
+ type IRequiredPlugins = IDataStoreORM & IDIDManager & IKeyManager & IIdentifierResolution & ICredentialIssuer & ICredentialVerifier & IVcdmCredentialPlugin & IStatusListPlugin & IResolver;
84
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
+ }
85
218
  interface IStatusListDriver {
86
219
  statusListStore: StatusListStore;
87
220
  getType(): StatusListDriverType;
88
221
  getOptions(): DriverOptions;
89
- getStatusListLength(args?: {
90
- correlationId?: string;
91
- }): Promise<number>;
92
- createStatusList(args: {
93
- statusListCredential: StatusListCredential;
94
- correlationId?: string;
95
- bitsPerStatus?: number;
96
- }): Promise<StatusListResult>;
97
- getStatusList(args?: {
98
- correlationId?: string;
99
- }): Promise<StatusListResult>;
222
+ getStatusListLength(args?: IGetStatusListLengthArgs): Promise<number>;
223
+ createStatusList(args: ICreateStatusListArgs): Promise<StatusListResult>;
224
+ getStatusList(args?: IGetStatusListArgs): Promise<StatusListResult>;
100
225
  getStatusLists(): Promise<Array<StatusListResult>>;
101
226
  updateStatusListEntry(args: IAddStatusListEntryArgs): Promise<{
102
227
  credentialStatus: StatusList2021EntryCredentialStatus | StatusListOAuthEntryCredentialStatus | BitstringStatusListEntryCredentialStatus;
@@ -104,14 +229,10 @@ interface IStatusListDriver {
104
229
  }>;
105
230
  getStatusListEntryByCredentialId(args: IGetStatusListEntryByCredentialIdArgs): Promise<IStatusListEntryEntity | undefined>;
106
231
  getStatusListEntryByIndex(args: IGetStatusListEntryByIndexArgs): Promise<IStatusListEntryEntity | undefined>;
107
- updateStatusList(args: {
108
- statusListCredential: StatusListCredential;
109
- }): Promise<StatusListResult>;
232
+ updateStatusList(args: IUpdateStatusListArgs): Promise<StatusListResult>;
110
233
  deleteStatusList(): Promise<boolean>;
111
- getRandomNewStatusListIndex(args?: {
112
- correlationId?: string;
113
- }): Promise<number>;
234
+ getRandomNewStatusListIndex(args?: IGetRandomNewStatusListIndexArgs): Promise<number>;
114
235
  isStatusListIndexInUse(): Promise<boolean>;
115
236
  }
116
237
 
117
- 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';
3
- import { StatusListResult, StatusList2021EntryCredentialStatus, StatusListOAuthEntryCredentialStatus, BitstringStatusListEntryCredentialStatus, IStatusListPlugin } from '@sphereon/ssi-sdk.vc-status-list';
4
- import { StatusListDriverType, StatusListCredential, StatusListCredentialIdMode, StatusListType } from '@sphereon/ssi-types';
5
- import { IDataStoreORM, IDIDManager, IKeyManager, ICredentialIssuer, ICredentialVerifier, ICredentialPlugin, IResolver, IAgentContext } from '@veramo/core';
2
+ import { StatusListStore, IAddStatusListEntryArgs, BitstringStatusListEntryCredentialStatus, IStatusListEntryEntity, IBitstringStatusListEntryEntity, IGetStatusListEntryByCredentialIdArgs, IGetStatusListEntryByIndexArgs } from '@sphereon/ssi-sdk.data-store';
3
+ import { StatusListResult, StatusList2021EntryCredentialStatus, StatusListOAuthEntryCredentialStatus, IStatusListPlugin } from '@sphereon/ssi-sdk.vc-status-list';
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,72 +70,158 @@ 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
- createStatusList(args: {
49
- statusListCredential: StatusListCredential;
50
- correlationId?: string;
51
- credentialIdMode?: StatusListCredentialIdMode;
52
- bitsPerStatus?: number;
53
- }): Promise<StatusListResult>;
54
- updateStatusList(args: {
55
- statusListCredential: StatusListCredential;
56
- correlationId: string;
57
- type: StatusListType;
58
- }): Promise<StatusListResult>;
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
+ */
59
137
  deleteStatusList(): Promise<boolean>;
60
- private isStatusList2021Entity;
61
- private isOAuthStatusListEntity;
62
- private isBitstringStatusListEntity;
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
+ */
63
143
  updateStatusListEntry(args: IAddStatusListEntryArgs): Promise<{
64
144
  credentialStatus: StatusList2021EntryCredentialStatus | StatusListOAuthEntryCredentialStatus | BitstringStatusListEntryCredentialStatus;
65
- statusListEntry: IStatusListEntryEntity;
145
+ statusListEntry: IStatusListEntryEntity | IBitstringStatusListEntryEntity;
66
146
  }>;
67
- getStatusListEntryByCredentialId(args: IGetStatusListEntryByCredentialIdArgs): Promise<IStatusListEntryEntity | undefined>;
68
- getStatusListEntryByIndex(args: IGetStatusListEntryByIndexArgs): Promise<IStatusListEntryEntity | undefined>;
69
- getRandomNewStatusListIndex(args?: {
70
- correlationId?: string;
71
- }): Promise<number>;
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
+ */
72
171
  private getRandomNewStatusListIndexImpl;
73
- getStatusListLength(args?: {
74
- correlationId?: string;
75
- }): Promise<number>;
76
- getStatusList(args?: {
77
- correlationId?: string;
78
- }): Promise<StatusListResult>;
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
+ */
79
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
+ */
80
193
  isStatusListIndexInUse(): Promise<boolean>;
81
194
  }
82
195
 
83
- type IRequiredPlugins = IDataStoreORM & IDIDManager & IKeyManager & IIdentifierResolution & ICredentialIssuer & ICredentialVerifier & ICredentialPlugin & IStatusListPlugin & IResolver;
196
+ type IRequiredPlugins = IDataStoreORM & IDIDManager & IKeyManager & IIdentifierResolution & ICredentialIssuer & ICredentialVerifier & IVcdmCredentialPlugin & IStatusListPlugin & IResolver;
84
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
+ }
85
218
  interface IStatusListDriver {
86
219
  statusListStore: StatusListStore;
87
220
  getType(): StatusListDriverType;
88
221
  getOptions(): DriverOptions;
89
- getStatusListLength(args?: {
90
- correlationId?: string;
91
- }): Promise<number>;
92
- createStatusList(args: {
93
- statusListCredential: StatusListCredential;
94
- correlationId?: string;
95
- bitsPerStatus?: number;
96
- }): Promise<StatusListResult>;
97
- getStatusList(args?: {
98
- correlationId?: string;
99
- }): Promise<StatusListResult>;
222
+ getStatusListLength(args?: IGetStatusListLengthArgs): Promise<number>;
223
+ createStatusList(args: ICreateStatusListArgs): Promise<StatusListResult>;
224
+ getStatusList(args?: IGetStatusListArgs): Promise<StatusListResult>;
100
225
  getStatusLists(): Promise<Array<StatusListResult>>;
101
226
  updateStatusListEntry(args: IAddStatusListEntryArgs): Promise<{
102
227
  credentialStatus: StatusList2021EntryCredentialStatus | StatusListOAuthEntryCredentialStatus | BitstringStatusListEntryCredentialStatus;
@@ -104,14 +229,10 @@ interface IStatusListDriver {
104
229
  }>;
105
230
  getStatusListEntryByCredentialId(args: IGetStatusListEntryByCredentialIdArgs): Promise<IStatusListEntryEntity | undefined>;
106
231
  getStatusListEntryByIndex(args: IGetStatusListEntryByIndexArgs): Promise<IStatusListEntryEntity | undefined>;
107
- updateStatusList(args: {
108
- statusListCredential: StatusListCredential;
109
- }): Promise<StatusListResult>;
232
+ updateStatusList(args: IUpdateStatusListArgs): Promise<StatusListResult>;
110
233
  deleteStatusList(): Promise<boolean>;
111
- getRandomNewStatusListIndex(args?: {
112
- correlationId?: string;
113
- }): Promise<number>;
234
+ getRandomNewStatusListIndex(args?: IGetRandomNewStatusListIndexArgs): Promise<number>;
114
235
  isStatusListIndexInUse(): Promise<boolean>;
115
236
  }
116
237
 
117
- 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 };