@sphereon/ssi-sdk.vc-status-list-issuer-drivers 0.33.1-feature.vcdm2.tsup.31 → 0.33.1-next.2

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.js CHANGED
@@ -1,295 +1,22 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
- // src/drivers.ts
5
- import { DataSources } from "@sphereon/ssi-sdk.agent-config";
6
- import { StatusListStore } from "@sphereon/ssi-sdk.data-store";
7
- import { statusListCredentialToDetails } from "@sphereon/ssi-sdk.vc-status-list";
8
- import { StatusListCredentialIdMode, StatusListDriverType } from "@sphereon/ssi-types";
9
-
10
- // src/status-list-adapters.ts
11
- import { StatusListType } from "@sphereon/ssi-types";
12
- import { OAuthStatusListEntity, StatusList2021Entity } from "@sphereon/ssi-sdk.data-store";
13
- function statusListResultToEntity(result) {
14
- const baseFields = {
15
- id: result.id,
16
- correlationId: result.correlationId,
17
- driverType: result.driverType,
18
- credentialIdMode: result.credentialIdMode,
19
- length: result.length,
20
- issuer: result.issuer,
21
- type: result.type,
22
- proofFormat: result.proofFormat,
23
- statusListCredential: result.statusListCredential
24
- };
25
- if (result.type === StatusListType.StatusList2021) {
26
- if (!result.statusList2021) {
27
- throw new Error("Missing statusList2021 details");
28
- }
29
- return Object.assign(new StatusList2021Entity(), {
30
- ...baseFields,
31
- indexingDirection: result.statusList2021.indexingDirection,
32
- statusPurpose: result.statusList2021.statusPurpose
33
- });
34
- } else if (result.type === StatusListType.OAuthStatusList) {
35
- if (!result.oauthStatusList) {
36
- throw new Error("Missing oauthStatusList details");
37
- }
38
- return Object.assign(new OAuthStatusListEntity(), {
39
- ...baseFields,
40
- bitsPerStatus: result.oauthStatusList.bitsPerStatus,
41
- expiresAt: result.oauthStatusList.expiresAt
42
- });
43
- }
44
- throw new Error(`Unsupported status list type: ${result.type}`);
45
- }
46
- __name(statusListResultToEntity, "statusListResultToEntity");
47
-
48
- // src/drivers.ts
49
- import { OAuthStatusListEntity as OAuthStatusListEntity2, StatusList2021Entity as StatusList2021Entity2 } from "@sphereon/ssi-sdk.data-store";
50
- function getOptions(args) {
51
- return {
52
- id: args.id,
53
- correlationId: args.correlationId,
54
- driverType: StatusListDriverType.AGENT_TYPEORM,
55
- driverOptions: {
56
- dbName: args.dbName
57
- }
58
- };
59
- }
60
- __name(getOptions, "getOptions");
61
- async function getDriver(args) {
62
- const dbName = args.dbName ?? args.dataSource?.name;
63
- if (!dbName) {
64
- throw Error(`Please provide either a DB name or data source`);
65
- }
66
- const dataSources = args.dataSources ?? DataSources.singleInstance();
67
- return await AgentDataSourceStatusListDriver.init(getOptions({
68
- ...args,
69
- dbName
70
- }), {
71
- dataSource: args.dataSource ?? await dataSources.getDbConnection(dbName),
72
- dataSources
73
- });
74
- }
75
- __name(getDriver, "getDriver");
76
- var AgentDataSourceStatusListDriver = class _AgentDataSourceStatusListDriver {
77
- static {
78
- __name(this, "AgentDataSourceStatusListDriver");
79
- }
80
- _dataSource;
81
- _statusListStore;
82
- options;
83
- _statusListLength;
84
- constructor(_dataSource, _statusListStore, options) {
85
- this._dataSource = _dataSource;
86
- this._statusListStore = _statusListStore;
87
- this.options = options;
88
- }
89
- static async init(options, dbArgs) {
90
- if (options.driverType !== StatusListDriverType.AGENT_TYPEORM) {
91
- throw Error(`TypeORM driver can only be used when the TypeORM driver type is selected in the configuration. Got: ${options.driverType}`);
92
- } else if (!options.driverOptions) {
93
- throw Error(`TypeORM driver can only be used when the TypeORM options are provided.`);
94
- }
95
- let dataSource;
96
- let statusListStore;
97
- if (dbArgs?.dataSource) {
98
- dataSource = dbArgs.dataSource;
99
- } else if (options.driverOptions.dbName) {
100
- if (dbArgs?.dataSources) {
101
- dataSource = await dbArgs.dataSources.getDbConnection(options.driverOptions.dbName);
102
- } else {
103
- dataSource = await DataSources.singleInstance().getDbConnection(options.driverOptions.dbName);
104
- }
105
- } else {
106
- return Promise.reject(Error(`Either a datasource or dbName needs to be provided`));
107
- }
108
- statusListStore = new StatusListStore(dataSource);
109
- return new _AgentDataSourceStatusListDriver(dataSource, statusListStore, options);
110
- }
111
- get dataSource() {
112
- if (!this._dataSource) {
113
- throw Error(`Datasource not available yet for ${this.options.driverOptions?.dbName}`);
114
- }
115
- return this._dataSource;
116
- }
117
- get statusListStore() {
118
- if (!this._statusListStore) {
119
- this._statusListStore = new StatusListStore(this.dataSource);
120
- }
121
- return this._statusListStore;
122
- }
123
- getOptions() {
124
- return this.options.driverOptions ?? {};
125
- }
126
- getType() {
127
- return this.options.driverType;
128
- }
129
- async createStatusList(args) {
130
- const correlationId = args.correlationId ?? this.options.correlationId;
131
- if (!correlationId) {
132
- throw Error("Either a correlationId needs to be set as an option, or it needs to be provided when creating a status list. None found");
133
- }
134
- const credentialIdMode = args.credentialIdMode ?? StatusListCredentialIdMode.ISSUANCE;
135
- const details = await statusListCredentialToDetails({
136
- ...args,
137
- correlationId,
138
- driverType: this.getType()
139
- });
140
- await this.statusListStore.addStatusList({
141
- ...details,
142
- credentialIdMode,
143
- correlationId,
144
- driverType: this.getType()
145
- });
146
- this._statusListLength = details.length;
147
- return details;
148
- }
149
- async updateStatusList(args) {
150
- const correlationId = args.correlationId ?? this.options.correlationId;
151
- const details = await statusListCredentialToDetails({
152
- ...args,
153
- correlationId,
154
- driverType: this.getType()
155
- });
156
- const entity = await (await this.statusListStore.getStatusListRepo(args.type)).findOne({
157
- where: [
158
- {
159
- id: details.id
160
- },
161
- {
162
- correlationId
163
- }
164
- ]
165
- });
166
- if (!entity) {
167
- throw Error(`Status list ${details.id}, correlationId ${args.correlationId} could not be found`);
168
- }
169
- await this.statusListStore.updateStatusList({
170
- ...entity,
171
- ...details,
172
- correlationId,
173
- driverType: this.getType()
174
- });
175
- this._statusListLength = details.length;
176
- return {
177
- ...entity,
178
- ...details
179
- };
180
- }
181
- async deleteStatusList() {
182
- await this.statusListStore.removeStatusList({
183
- id: this.options.id,
184
- correlationId: this.options.correlationId
185
- });
186
- return Promise.resolve(true);
187
- }
188
- isStatusList2021Entity(statusList) {
189
- return statusList instanceof StatusList2021Entity2;
190
- }
191
- isOAuthStatusListEntity(statusList) {
192
- return statusList instanceof OAuthStatusListEntity2;
193
- }
194
- async updateStatusListEntry(args) {
195
- const statusList = args.statusList ? args.statusList : statusListResultToEntity(await this.getStatusList());
196
- const statusListEntry = await this.statusListStore.updateStatusListEntry({
197
- ...args,
198
- statusListId: statusList.id
199
- });
200
- if (this.isStatusList2021Entity(statusList)) {
201
- return {
202
- credentialStatus: {
203
- id: `${statusList.id}#${statusListEntry.statusListIndex}`,
204
- type: "StatusList2021Entry",
205
- statusPurpose: statusList.statusPurpose ?? "revocation",
206
- statusListIndex: "" + statusListEntry.statusListIndex,
207
- statusListCredential: statusList.id
208
- },
209
- statusListEntry
210
- };
211
- } else if (this.isOAuthStatusListEntity(statusList)) {
212
- return {
213
- credentialStatus: {
214
- id: `${statusList.id}#${statusListEntry.statusListIndex}`,
215
- type: "OAuthStatusListEntry",
216
- bitsPerStatus: statusList.bitsPerStatus,
217
- statusListIndex: "" + statusListEntry.statusListIndex,
218
- statusListCredential: statusList.id,
219
- expiresAt: statusList.expiresAt
220
- },
221
- statusListEntry
222
- };
223
- }
224
- throw new Error(`Unsupported status list type: ${typeof statusList}`);
225
- }
226
- async getStatusListEntryByCredentialId(args) {
227
- return await this.statusListStore.getStatusListEntryByCredentialId(args);
228
- }
229
- async getStatusListEntryByIndex(args) {
230
- return await this.statusListStore.getStatusListEntryByIndex(args);
231
- }
232
- async getRandomNewStatusListIndex(args) {
233
- let result = -1;
234
- let tries = 0;
235
- while (result < 0) {
236
- result = await this.getRandomNewStatusListIndexImpl(tries++, args);
237
- }
238
- return result;
239
- }
240
- async getRandomNewStatusListIndexImpl(tries, args) {
241
- const statusListId = this.options.id;
242
- const correlationId = args?.correlationId ?? this.options.correlationId;
243
- if (tries >= 10) {
244
- throw Error(`We could not find any random status list index that is available in the statuslist ${statusListId}`);
245
- }
246
- const length = await this.getStatusListLength(args);
247
- const statusListIndex = Array.from({
248
- length: 20
249
- }, () => Math.floor(Math.random() * length));
250
- const available = await this.statusListStore.availableStatusListEntries({
251
- statusListId,
252
- ...correlationId && {
253
- correlationId
254
- },
255
- statusListIndex
256
- });
257
- if (available.length > 0) {
258
- return available[0];
259
- }
260
- return -1;
261
- }
262
- async getStatusListLength(args) {
263
- if (!this._statusListLength) {
264
- this._statusListLength = await this.getStatusList(args).then((details) => details.length);
265
- }
266
- return this._statusListLength;
267
- }
268
- async getStatusList(args) {
269
- const id = this.options.id;
270
- const correlationId = args?.correlationId ?? this.options.correlationId;
271
- return await this.statusListStore.getStatusList({
272
- id,
273
- correlationId
274
- }).then((statusListEntity) => statusListCredentialToDetails({
275
- statusListCredential: statusListEntity.statusListCredential
276
- }));
277
- }
278
- async getStatusLists() {
279
- const statusLists = await this.statusListStore.getStatusLists({});
280
- return Promise.all(statusLists.map(async (statusListEntity) => {
281
- return statusListCredentialToDetails({
282
- statusListCredential: statusListEntity.statusListCredential
283
- });
284
- }));
285
- }
286
- isStatusListIndexInUse() {
287
- return Promise.resolve(false);
288
- }
289
- };
290
- export {
291
- AgentDataSourceStatusListDriver,
292
- getDriver,
293
- getOptions
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
294
15
  };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /**
18
+ * @public
19
+ */
20
+ __exportStar(require("./types"), exports);
21
+ __exportStar(require("./drivers"), exports);
295
22
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/drivers.ts","../src/status-list-adapters.ts"],"sourcesContent":["import { DataSources } from '@sphereon/ssi-sdk.agent-config'\nimport {\n IAddStatusListEntryArgs,\n IGetStatusListEntryByCredentialIdArgs,\n IGetStatusListEntryByIndexArgs,\n IStatusListEntity,\n IStatusListEntryEntity,\n StatusListEntity,\n StatusListStore,\n} from '@sphereon/ssi-sdk.data-store'\nimport {\n StatusList2021EntryCredentialStatus,\n statusListCredentialToDetails,\n StatusListOAuthEntryCredentialStatus,\n StatusListResult,\n} from '@sphereon/ssi-sdk.vc-status-list'\nimport { StatusListCredentialIdMode, StatusListDriverType, StatusListType, StatusListCredential } from '@sphereon/ssi-types'\nimport { DataSource } from 'typeorm'\nimport { IStatusListDriver } from './types'\nimport { statusListResultToEntity } from './status-list-adapters'\nimport { OAuthStatusListEntity, StatusList2021Entity } from '@sphereon/ssi-sdk.data-store'\n\nexport interface StatusListManagementOptions {\n id?: string\n correlationId?: string\n driverType: StatusListDriverType\n driverOptions?: DriverOptions\n}\n\nexport type DriverOptions = TypeORMOptions\n\nexport interface TypeORMOptions {\n dbName?: string\n}\n\nexport interface FilesystemOptions {\n path: string // The base path where statusList Credentials will be persisted. Should be a folder and thus not include the VC/StatusList itself\n}\n\nexport function getOptions(args: { id?: string; correlationId?: string; dbName: string }): StatusListManagementOptions {\n return {\n id: args.id,\n correlationId: args.correlationId,\n driverType: StatusListDriverType.AGENT_TYPEORM,\n driverOptions: { dbName: args.dbName },\n }\n}\n\nexport async function getDriver(args: {\n id?: string\n correlationId?: string\n dbName?: string\n dataSource?: DataSource\n dataSources?: DataSources\n}): Promise<IStatusListDriver> {\n const dbName = args.dbName ?? args.dataSource?.name\n if (!dbName) {\n throw Error(`Please provide either a DB name or data source`)\n }\n const dataSources = args.dataSources ?? DataSources.singleInstance()\n return await AgentDataSourceStatusListDriver.init(\n getOptions({\n ...args,\n dbName,\n }),\n { dataSource: args.dataSource ?? (await dataSources.getDbConnection(dbName)), dataSources },\n )\n}\n\nexport class AgentDataSourceStatusListDriver implements IStatusListDriver {\n private _statusListLength: number | undefined\n\n constructor(\n private _dataSource: DataSource,\n private _statusListStore: StatusListStore,\n private options: StatusListManagementOptions,\n ) {}\n\n public static async init(\n options: StatusListManagementOptions,\n dbArgs?: {\n dataSources?: DataSources\n dataSource?: DataSource\n },\n ): Promise<AgentDataSourceStatusListDriver> {\n if (options.driverType !== StatusListDriverType.AGENT_TYPEORM) {\n throw Error(`TypeORM driver can only be used when the TypeORM driver type is selected in the configuration. Got: ${options.driverType}`)\n } else if (!options.driverOptions) {\n throw Error(`TypeORM driver can only be used when the TypeORM options are provided.`)\n }\n let dataSource: DataSource\n let statusListStore: StatusListStore\n if (dbArgs?.dataSource) {\n dataSource = dbArgs.dataSource\n } else if (options.driverOptions.dbName) {\n if (dbArgs?.dataSources) {\n dataSource = await dbArgs.dataSources.getDbConnection(options.driverOptions.dbName)\n } else {\n dataSource = await DataSources.singleInstance().getDbConnection(options.driverOptions.dbName)\n }\n } else {\n return Promise.reject(Error(`Either a datasource or dbName needs to be provided`))\n }\n\n statusListStore = new StatusListStore(dataSource)\n return new AgentDataSourceStatusListDriver(dataSource, statusListStore, options)\n }\n\n get dataSource(): DataSource {\n if (!this._dataSource) {\n throw Error(`Datasource not available yet for ${this.options.driverOptions?.dbName}`)\n }\n return this._dataSource\n }\n\n get statusListStore(): StatusListStore {\n if (!this._statusListStore) {\n this._statusListStore = new StatusListStore(this.dataSource)\n }\n return this._statusListStore\n }\n\n getOptions(): DriverOptions {\n return this.options.driverOptions ?? {}\n }\n\n getType(): StatusListDriverType {\n return this.options.driverType\n }\n\n async createStatusList(args: {\n statusListCredential: StatusListCredential\n correlationId?: string\n credentialIdMode?: StatusListCredentialIdMode\n }): Promise<StatusListResult> {\n const correlationId = args.correlationId ?? this.options.correlationId\n if (!correlationId) {\n throw Error('Either a correlationId needs to be set as an option, or it needs to be provided when creating a status list. None found')\n }\n const credentialIdMode = args.credentialIdMode ?? StatusListCredentialIdMode.ISSUANCE\n const details = await statusListCredentialToDetails({ ...args, correlationId, driverType: this.getType() })\n\n // (StatusListStore does the duplicate entity check)\n await this.statusListStore.addStatusList({\n ...details,\n credentialIdMode,\n correlationId,\n driverType: this.getType(),\n })\n this._statusListLength = details.length\n return details\n }\n\n async updateStatusList(args: {\n statusListCredential: StatusListCredential\n correlationId: string\n type: StatusListType\n }): Promise<StatusListResult> {\n const correlationId = args.correlationId ?? this.options.correlationId\n const details = await statusListCredentialToDetails({ ...args, correlationId, driverType: this.getType() })\n const entity = await (\n await this.statusListStore.getStatusListRepo(args.type)\n ).findOne({\n where: [\n {\n id: details.id,\n },\n {\n correlationId,\n },\n ],\n })\n if (!entity) {\n throw Error(`Status list ${details.id}, correlationId ${args.correlationId} could not be found`)\n }\n await this.statusListStore.updateStatusList({\n ...entity,\n ...details,\n correlationId,\n driverType: this.getType(),\n })\n this._statusListLength = details.length\n return { ...entity, ...details }\n }\n\n async deleteStatusList(): Promise<boolean> {\n await this.statusListStore.removeStatusList({ id: this.options.id, correlationId: this.options.correlationId })\n return Promise.resolve(true)\n }\n\n private isStatusList2021Entity(statusList: StatusListEntity): statusList is StatusList2021Entity {\n return statusList instanceof StatusList2021Entity\n }\n\n private isOAuthStatusListEntity(statusList: StatusListEntity): statusList is OAuthStatusListEntity {\n return statusList instanceof OAuthStatusListEntity\n }\n\n async updateStatusListEntry(args: IAddStatusListEntryArgs): Promise<{\n credentialStatus: StatusList2021EntryCredentialStatus | StatusListOAuthEntryCredentialStatus\n statusListEntry: IStatusListEntryEntity\n }> {\n const statusList: StatusListEntity = args.statusList ? args.statusList : statusListResultToEntity(await this.getStatusList())\n const statusListEntry = await this.statusListStore.updateStatusListEntry({ ...args, statusListId: statusList.id })\n\n if (this.isStatusList2021Entity(statusList)) {\n return {\n credentialStatus: {\n id: `${statusList.id}#${statusListEntry.statusListIndex}`,\n type: 'StatusList2021Entry',\n statusPurpose: statusList.statusPurpose ?? 'revocation',\n statusListIndex: '' + statusListEntry.statusListIndex,\n statusListCredential: statusList.id,\n },\n statusListEntry,\n }\n } else if (this.isOAuthStatusListEntity(statusList)) {\n return {\n credentialStatus: {\n id: `${statusList.id}#${statusListEntry.statusListIndex}`,\n type: 'OAuthStatusListEntry',\n bitsPerStatus: statusList.bitsPerStatus,\n statusListIndex: '' + statusListEntry.statusListIndex,\n statusListCredential: statusList.id,\n expiresAt: statusList.expiresAt,\n },\n statusListEntry,\n }\n }\n\n throw new Error(`Unsupported status list type: ${typeof statusList}`)\n }\n\n async getStatusListEntryByCredentialId(args: IGetStatusListEntryByCredentialIdArgs): Promise<IStatusListEntryEntity | undefined> {\n return await this.statusListStore.getStatusListEntryByCredentialId(args)\n }\n\n async getStatusListEntryByIndex(args: IGetStatusListEntryByIndexArgs): Promise<IStatusListEntryEntity | undefined> {\n return await this.statusListStore.getStatusListEntryByIndex(args)\n }\n\n async getRandomNewStatusListIndex(args?: { correlationId?: string }): Promise<number> {\n let result = -1\n let tries = 0\n while (result < 0) {\n // no tries guard, because we will throw an error when they are exhausted anyway\n result = await this.getRandomNewStatusListIndexImpl(tries++, args)\n }\n return result\n }\n\n private async getRandomNewStatusListIndexImpl(tries: number, args?: { correlationId?: string }): Promise<number> {\n const statusListId = this.options.id\n const correlationId = args?.correlationId ?? this.options.correlationId\n if (tries >= 10) {\n throw Error(`We could not find any random status list index that is available in the statuslist ${statusListId}`)\n }\n // TODO: Check against DB\n const length = await this.getStatusListLength(args)\n const statusListIndex = Array.from({ length: 20 }, () => Math.floor(Math.random() * length))\n const available = await this.statusListStore.availableStatusListEntries({\n statusListId,\n ...(correlationId && { correlationId }),\n statusListIndex,\n })\n if (available.length > 0) {\n return available[0] // doesn't matter we pick the first element, as they are all random anyway\n }\n return -1\n }\n\n async getStatusListLength(args?: { correlationId?: string }): Promise<number> {\n if (!this._statusListLength) {\n this._statusListLength = await this.getStatusList(args).then((details) => details.length)\n }\n return this._statusListLength!\n }\n\n async getStatusList(args?: { correlationId?: string }): Promise<StatusListResult> {\n const id = this.options.id\n const correlationId = args?.correlationId ?? this.options.correlationId\n return await this.statusListStore\n .getStatusList({ id, correlationId })\n .then((statusListEntity: IStatusListEntity) => statusListCredentialToDetails({ statusListCredential: statusListEntity.statusListCredential! }))\n }\n\n async getStatusLists(): Promise<Array<StatusListResult>> {\n const statusLists = await this.statusListStore.getStatusLists({})\n return Promise.all(\n statusLists.map(async (statusListEntity) => {\n return statusListCredentialToDetails({\n statusListCredential: statusListEntity.statusListCredential!,\n })\n }),\n )\n }\n\n isStatusListIndexInUse(): Promise<boolean> {\n return Promise.resolve(false)\n }\n}\n","import { StatusListType } from '@sphereon/ssi-types'\nimport { OAuthStatusListEntity, StatusList2021Entity } from '@sphereon/ssi-sdk.data-store'\nimport { StatusListResult } from '@sphereon/ssi-sdk.vc-status-list'\n\nexport function statusListResultToEntity(result: StatusListResult): StatusList2021Entity | OAuthStatusListEntity {\n const baseFields = {\n id: result.id,\n correlationId: result.correlationId,\n driverType: result.driverType,\n credentialIdMode: result.credentialIdMode,\n length: result.length,\n issuer: result.issuer,\n type: result.type,\n proofFormat: result.proofFormat,\n statusListCredential: result.statusListCredential,\n }\n\n if (result.type === StatusListType.StatusList2021) {\n if (!result.statusList2021) {\n throw new Error('Missing statusList2021 details')\n }\n return Object.assign(new StatusList2021Entity(), {\n ...baseFields,\n indexingDirection: result.statusList2021.indexingDirection,\n statusPurpose: result.statusList2021.statusPurpose,\n })\n } else if (result.type === StatusListType.OAuthStatusList) {\n if (!result.oauthStatusList) {\n throw new Error('Missing oauthStatusList details')\n }\n return Object.assign(new OAuthStatusListEntity(), {\n ...baseFields,\n bitsPerStatus: result.oauthStatusList.bitsPerStatus,\n expiresAt: result.oauthStatusList.expiresAt,\n })\n }\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D,MAA8D;AAChF,UAAMC,KAAK,KAAKqB,QAAQrB;AACxB,UAAMC,gBAAgBF,MAAME,iBAAiB,KAAKoB,QAAQpB;AAC1D,WAAO,MAAM,KAAKsB,gBACf6B,cAAc;MAAEpD;MAAIC;IAAc,CAAA,EAClC0E,KAAK,CAACC,qBAAwC3C,8BAA8B;MAAEyB,sBAAsBkB,iBAAiBlB;IAAsB,CAAA,CAAA;EAChJ;EAEA,MAAMmB,iBAAmD;AACvD,UAAMC,cAAc,MAAM,KAAKvD,gBAAgBsD,eAAe,CAAC,CAAA;AAC/D,WAAOrD,QAAQuD,IACbD,YAAYE,IAAI,OAAOJ,qBAAAA;AACrB,aAAO3C,8BAA8B;QACnCyB,sBAAsBkB,iBAAiBlB;MACzC,CAAA;IACF,CAAA,CAAA;EAEJ;EAEAuB,yBAA2C;AACzC,WAAOzD,QAAQoB,QAAQ,KAAA;EACzB;AACF;","names":["DataSources","StatusListStore","statusListCredentialToDetails","StatusListCredentialIdMode","StatusListDriverType","StatusListType","OAuthStatusListEntity","StatusList2021Entity","statusListResultToEntity","result","baseFields","id","correlationId","driverType","credentialIdMode","length","issuer","type","proofFormat","statusListCredential","StatusListType","StatusList2021","statusList2021","Error","Object","assign","StatusList2021Entity","indexingDirection","statusPurpose","OAuthStatusList","oauthStatusList","OAuthStatusListEntity","bitsPerStatus","expiresAt","OAuthStatusListEntity","StatusList2021Entity","getOptions","args","id","correlationId","driverType","StatusListDriverType","AGENT_TYPEORM","driverOptions","dbName","getDriver","dataSource","name","Error","dataSources","DataSources","singleInstance","AgentDataSourceStatusListDriver","init","getDbConnection","_statusListLength","constructor","_dataSource","_statusListStore","options","dbArgs","statusListStore","Promise","reject","StatusListStore","getType","createStatusList","credentialIdMode","StatusListCredentialIdMode","ISSUANCE","details","statusListCredentialToDetails","addStatusList","length","updateStatusList","entity","getStatusListRepo","type","findOne","where","deleteStatusList","removeStatusList","resolve","isStatusList2021Entity","statusList","StatusList2021Entity","isOAuthStatusListEntity","OAuthStatusListEntity","updateStatusListEntry","statusListResultToEntity","getStatusList","statusListEntry","statusListId","credentialStatus","statusListIndex","statusPurpose","statusListCredential","bitsPerStatus","expiresAt","getStatusListEntryByCredentialId","getStatusListEntryByIndex","getRandomNewStatusListIndex","result","tries","getRandomNewStatusListIndexImpl","getStatusListLength","Array","from","Math","floor","random","available","availableStatusListEntries","then","statusListEntity","getStatusLists","statusLists","all","map","isStatusListIndexInUse"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,0CAAuB;AACvB,4CAAyB"}
@@ -0,0 +1,4 @@
1
+ import { OAuthStatusListEntity, StatusList2021Entity } from '@sphereon/ssi-sdk.data-store/dist/entities/statusList/StatusListEntities';
2
+ import { StatusListResult } from '@sphereon/ssi-sdk.vc-status-list';
3
+ export declare function statusListResultToEntity(result: StatusListResult): StatusList2021Entity | OAuthStatusListEntity;
4
+ //# sourceMappingURL=status-list-adapters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status-list-adapters.d.ts","sourceRoot":"","sources":["../src/status-list-adapters.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,0EAA0E,CAAA;AACtI,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AAEnE,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,gBAAgB,GAAG,oBAAoB,GAAG,qBAAqB,CAiC/G"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.statusListResultToEntity = statusListResultToEntity;
4
+ const ssi_types_1 = require("@sphereon/ssi-types");
5
+ const StatusListEntities_1 = require("@sphereon/ssi-sdk.data-store/dist/entities/statusList/StatusListEntities");
6
+ function statusListResultToEntity(result) {
7
+ const baseFields = {
8
+ id: result.id,
9
+ correlationId: result.correlationId,
10
+ driverType: result.driverType,
11
+ credentialIdMode: result.credentialIdMode,
12
+ length: result.length,
13
+ issuer: result.issuer,
14
+ type: result.type,
15
+ proofFormat: result.proofFormat,
16
+ statusListCredential: result.statusListCredential,
17
+ };
18
+ if (result.type === ssi_types_1.StatusListType.StatusList2021) {
19
+ if (!result.statusList2021) {
20
+ throw new Error('Missing statusList2021 details');
21
+ }
22
+ return Object.assign(new StatusListEntities_1.StatusList2021Entity(), Object.assign(Object.assign({}, baseFields), { indexingDirection: result.statusList2021.indexingDirection, statusPurpose: result.statusList2021.statusPurpose }));
23
+ }
24
+ else if (result.type === ssi_types_1.StatusListType.OAuthStatusList) {
25
+ if (!result.oauthStatusList) {
26
+ throw new Error('Missing oauthStatusList details');
27
+ }
28
+ return Object.assign(new StatusListEntities_1.OAuthStatusListEntity(), Object.assign(Object.assign({}, baseFields), { bitsPerStatus: result.oauthStatusList.bitsPerStatus, expiresAt: result.oauthStatusList.expiresAt }));
29
+ }
30
+ throw new Error(`Unsupported status list type: ${result.type}`);
31
+ }
32
+ //# sourceMappingURL=status-list-adapters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status-list-adapters.js","sourceRoot":"","sources":["../src/status-list-adapters.ts"],"names":[],"mappings":";;AAIA,4DAiCC;AArCD,mDAAoD;AACpD,iHAAsI;AAGtI,SAAgB,wBAAwB,CAAC,MAAwB;IAC/D,MAAM,UAAU,GAAG;QACjB,EAAE,EAAE,MAAM,CAAC,EAAE;QACb,aAAa,EAAE,MAAM,CAAC,aAAa;QACnC,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;QACzC,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,oBAAoB,EAAE,MAAM,CAAC,oBAAoB;KAClD,CAAA;IAED,IAAI,MAAM,CAAC,IAAI,KAAK,0BAAc,CAAC,cAAc,EAAE,CAAC;QAClD,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;QACnD,CAAC;QACD,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,yCAAoB,EAAE,kCAC1C,UAAU,KACb,iBAAiB,EAAE,MAAM,CAAC,cAAc,CAAC,iBAAiB,EAC1D,aAAa,EAAE,MAAM,CAAC,cAAc,CAAC,aAAa,IAClD,CAAA;IACJ,CAAC;SAAM,IAAI,MAAM,CAAC,IAAI,KAAK,0BAAc,CAAC,eAAe,EAAE,CAAC;QAC1D,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC;YAC5B,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;QACpD,CAAC;QACD,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,0CAAqB,EAAE,kCAC3C,UAAU,KACb,aAAa,EAAE,MAAM,CAAC,eAAe,CAAC,aAAa,EACnD,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC,SAAS,IAC3C,CAAA;IACJ,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,iCAAiC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAA;AACjE,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { IIdentifierResolution } from '@sphereon/ssi-sdk-ext.identifier-resolution';
2
+ import { IAddStatusListEntryArgs, IGetStatusListEntryByCredentialIdArgs, IGetStatusListEntryByIndexArgs, IStatusListEntryEntity, StatusListStore } from '@sphereon/ssi-sdk.data-store';
3
+ import { IStatusListPlugin, StatusList2021EntryCredentialStatus, StatusListOAuthEntryCredentialStatus, StatusListResult } from '@sphereon/ssi-sdk.vc-status-list';
4
+ import { StatusListCredential, StatusListDriverType } from '@sphereon/ssi-types';
5
+ import { IAgentContext, ICredentialIssuer, ICredentialPlugin, ICredentialVerifier, IDataStoreORM, IDIDManager, IKeyManager, IResolver } from '@veramo/core';
6
+ import { DriverOptions } from './drivers';
7
+ export type IRequiredPlugins = IDataStoreORM & IDIDManager & IKeyManager & IIdentifierResolution & ICredentialIssuer & ICredentialVerifier & ICredentialPlugin & IStatusListPlugin & IResolver;
8
+ export type IRequiredContext = IAgentContext<IRequiredPlugins>;
9
+ export interface IStatusListDriver {
10
+ statusListStore: StatusListStore;
11
+ getType(): StatusListDriverType;
12
+ getOptions(): DriverOptions;
13
+ getStatusListLength(args?: {
14
+ correlationId?: string;
15
+ }): Promise<number>;
16
+ createStatusList(args: {
17
+ statusListCredential: StatusListCredential;
18
+ correlationId?: string;
19
+ }): Promise<StatusListResult>;
20
+ getStatusList(args?: {
21
+ correlationId?: string;
22
+ }): Promise<StatusListResult>;
23
+ getStatusLists(): Promise<Array<StatusListResult>>;
24
+ updateStatusListEntry(args: IAddStatusListEntryArgs): Promise<{
25
+ credentialStatus: StatusList2021EntryCredentialStatus | StatusListOAuthEntryCredentialStatus;
26
+ statusListEntry: IStatusListEntryEntity;
27
+ }>;
28
+ getStatusListEntryByCredentialId(args: IGetStatusListEntryByCredentialIdArgs): Promise<IStatusListEntryEntity | undefined>;
29
+ getStatusListEntryByIndex(args: IGetStatusListEntryByIndexArgs): Promise<IStatusListEntryEntity | undefined>;
30
+ updateStatusList(args: {
31
+ statusListCredential: StatusListCredential;
32
+ }): Promise<StatusListResult>;
33
+ deleteStatusList(): Promise<boolean>;
34
+ getRandomNewStatusListIndex(args?: {
35
+ correlationId?: string;
36
+ }): Promise<number>;
37
+ isStatusListIndexInUse(): Promise<boolean>;
38
+ }
39
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;AACnF,OAAO,EACL,uBAAuB,EACvB,qCAAqC,EACrC,8BAA8B,EAC9B,sBAAsB,EACtB,eAAe,EAChB,MAAM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,mCAAmC,GAAG,oCAAoC,CAAA;QAC5F,eAAe,EAAE,sBAAsB,CAAA;KACxC,CAAC,CAAA;IAEF,gCAAgC,CAAC,IAAI,EAAE,qCAAqC,GAAG,OAAO,CAAC,sBAAsB,GAAG,SAAS,CAAC,CAAA;IAE1H,yBAAyB,CAAC,IAAI,EAAE,8BAA8B,GAAG,OAAO,CAAC,sBAAsB,GAAG,SAAS,CAAC,CAAA;IAE5G,gBAAgB,CAAC,IAAI,EAAE;QAAE,oBAAoB,EAAE,oBAAoB,CAAA;KAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAA;IAEjG,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAA;IAEpC,2BAA2B,CAAC,IAAI,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAE/E,sBAAsB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAA;CAC3C"}
package/dist/types.js ADDED
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,49 +1,38 @@
1
1
  {
2
2
  "name": "@sphereon/ssi-sdk.vc-status-list-issuer-drivers",
3
3
  "description": "Sphereon SSI-SDK plugin for Status List management, like StatusList2021. Issuer drivers module",
4
- "version": "0.33.1-feature.vcdm2.tsup.31+71b615ad",
4
+ "version": "0.33.1-next.2+6f7f40b9",
5
5
  "source": "src/index.ts",
6
- "type": "module",
7
- "main": "./dist/index.cjs",
8
- "module": "./dist/index.js",
9
- "types": "./dist/index.d.ts",
10
- "exports": {
11
- "import": {
12
- "types": "./dist/index.d.ts",
13
- "import": "./dist/index.js"
14
- },
15
- "require": {
16
- "types": "./dist/index.d.cts",
17
- "require": "./dist/index.cjs"
18
- }
19
- },
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
20
8
  "scripts": {
21
- "build": "tsup --config ../../tsup.config.ts --tsconfig ../../tsconfig.tsup.json"
9
+ "build": "tsc --build",
10
+ "build:clean": "tsc --build --clean && tsc --build"
22
11
  },
23
12
  "dependencies": {
24
- "@sphereon/ssi-express-support": "^0.33.1-feature.vcdm2.tsup.31+71b615ad",
25
- "@sphereon/ssi-sdk-ext.did-utils": "0.28.1-feature.esm.cjs.16",
26
- "@sphereon/ssi-sdk-ext.identifier-resolution": "0.28.1-feature.esm.cjs.16",
27
- "@sphereon/ssi-sdk.agent-config": "^0.33.1-feature.vcdm2.tsup.31+71b615ad",
28
- "@sphereon/ssi-sdk.core": "^0.33.1-feature.vcdm2.tsup.31+71b615ad",
29
- "@sphereon/ssi-sdk.data-store": "^0.33.1-feature.vcdm2.tsup.31+71b615ad",
30
- "@sphereon/ssi-sdk.vc-status-list": "^0.33.1-feature.vcdm2.tsup.31+71b615ad",
31
- "@sphereon/ssi-types": "^0.33.1-feature.vcdm2.tsup.31+71b615ad",
13
+ "@sphereon/ssi-express-support": "0.33.1-next.2+6f7f40b9",
14
+ "@sphereon/ssi-sdk-ext.did-utils": "0.28.0",
15
+ "@sphereon/ssi-sdk-ext.identifier-resolution": "0.28.0",
16
+ "@sphereon/ssi-sdk.agent-config": "0.33.1-next.2+6f7f40b9",
17
+ "@sphereon/ssi-sdk.core": "0.33.1-next.2+6f7f40b9",
18
+ "@sphereon/ssi-sdk.data-store": "0.33.1-next.2+6f7f40b9",
19
+ "@sphereon/ssi-sdk.vc-status-list": "0.33.1-next.2+6f7f40b9",
20
+ "@sphereon/ssi-types": "0.33.1-next.2+6f7f40b9",
32
21
  "@sphereon/vc-status-list": "7.0.0-next.0",
33
22
  "@veramo/core": "4.2.0",
34
23
  "debug": "^4.3.5",
35
- "typeorm": "^0.3.22",
24
+ "typeorm": "^0.3.21",
36
25
  "uint8arrays": "^3.1.1"
37
26
  },
38
27
  "devDependencies": {
39
- "@sphereon/ssi-sdk.agent-config": "workspace:^",
28
+ "@sphereon/ssi-sdk.agent-config": "workspace:*",
40
29
  "@types/debug": "^4.1.12",
41
30
  "@types/node": "^20.17.1",
42
- "typescript": "5.8.3"
31
+ "typescript": "5.4.2"
43
32
  },
44
33
  "files": [
45
- "dist",
46
- "src",
34
+ "dist/**/*",
35
+ "src/**/*",
47
36
  "README.md",
48
37
  "LICENSE"
49
38
  ],
@@ -59,5 +48,6 @@
59
48
  "SSI",
60
49
  "StatusList2021"
61
50
  ],
62
- "gitHead": "71b615adbfef8ecd843edb2f3d0c58cb6453cff9"
51
+ "nx": {},
52
+ "gitHead": "6f7f40b94beb385369fede046c3912bd0c053408"
63
53
  }
package/src/drivers.ts CHANGED
@@ -18,7 +18,7 @@ import { StatusListCredentialIdMode, StatusListDriverType, StatusListType, Statu
18
18
  import { DataSource } from 'typeorm'
19
19
  import { IStatusListDriver } from './types'
20
20
  import { statusListResultToEntity } from './status-list-adapters'
21
- import { OAuthStatusListEntity, StatusList2021Entity } from '@sphereon/ssi-sdk.data-store'
21
+ import { OAuthStatusListEntity, StatusList2021Entity } from '@sphereon/ssi-sdk.data-store/dist/entities/statusList/StatusListEntities'
22
22
 
23
23
  export interface StatusListManagementOptions {
24
24
  id?: string
@@ -1,5 +1,5 @@
1
1
  import { StatusListType } from '@sphereon/ssi-types'
2
- import { OAuthStatusListEntity, StatusList2021Entity } from '@sphereon/ssi-sdk.data-store'
2
+ import { OAuthStatusListEntity, StatusList2021Entity } from '@sphereon/ssi-sdk.data-store/dist/entities/statusList/StatusListEntities'
3
3
  import { StatusListResult } from '@sphereon/ssi-sdk.vc-status-list'
4
4
 
5
5
  export function statusListResultToEntity(result: StatusListResult): StatusList2021Entity | OAuthStatusListEntity {