@sphereon/ssi-sdk.data-store 0.34.1-feature.SSISDK.17.bitstring.sl.24 → 0.34.1-feature.SSISDK.17.bitstring.sl.26
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 +52 -50
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -9
- package/dist/index.d.ts +12 -9
- package/dist/index.js +52 -50
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/statusList/StatusListStore.ts +4 -5
- package/src/types/statusList/IAbstractStatusListStore.ts +22 -12
- package/src/types/statusList/statusList.ts +4 -4
- package/src/utils/statusList/MappingUtils.ts +48 -45
package/dist/index.cjs
CHANGED
|
@@ -6188,52 +6188,55 @@ var import_typeorm37 = require("typeorm");
|
|
|
6188
6188
|
// src/utils/statusList/MappingUtils.ts
|
|
6189
6189
|
var import_ssi_types3 = require("@sphereon/ssi-types");
|
|
6190
6190
|
var statusListEntityFrom = /* @__PURE__ */ __name((args) => {
|
|
6191
|
-
|
|
6192
|
-
|
|
6193
|
-
|
|
6194
|
-
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
|
|
6204
|
-
|
|
6205
|
-
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
|
|
6224
|
-
|
|
6225
|
-
|
|
6226
|
-
|
|
6227
|
-
|
|
6228
|
-
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
6191
|
+
switch (args.type) {
|
|
6192
|
+
case import_ssi_types3.StatusListType.StatusList2021: {
|
|
6193
|
+
const entity = new StatusList2021Entity();
|
|
6194
|
+
const sl2021 = args;
|
|
6195
|
+
entity.indexingDirection = sl2021.indexingDirection;
|
|
6196
|
+
entity.statusPurpose = sl2021.statusPurpose;
|
|
6197
|
+
setBaseFields(entity, args);
|
|
6198
|
+
Object.defineProperty(entity, "type", {
|
|
6199
|
+
value: import_ssi_types3.StatusListType.StatusList2021,
|
|
6200
|
+
enumerable: true,
|
|
6201
|
+
configurable: true
|
|
6202
|
+
});
|
|
6203
|
+
return entity;
|
|
6204
|
+
}
|
|
6205
|
+
case import_ssi_types3.StatusListType.OAuthStatusList: {
|
|
6206
|
+
const entity = new OAuthStatusListEntity();
|
|
6207
|
+
const oauthSl = args;
|
|
6208
|
+
entity.bitsPerStatus = oauthSl.bitsPerStatus;
|
|
6209
|
+
entity.expiresAt = oauthSl.expiresAt;
|
|
6210
|
+
setBaseFields(entity, args);
|
|
6211
|
+
Object.defineProperty(entity, "type", {
|
|
6212
|
+
value: import_ssi_types3.StatusListType.OAuthStatusList,
|
|
6213
|
+
enumerable: true,
|
|
6214
|
+
configurable: true
|
|
6215
|
+
});
|
|
6216
|
+
return entity;
|
|
6217
|
+
}
|
|
6218
|
+
case import_ssi_types3.StatusListType.BitstringStatusList: {
|
|
6219
|
+
const entity = new BitstringStatusListEntity();
|
|
6220
|
+
const bitstringsl = args;
|
|
6221
|
+
if (!bitstringsl.bitsPerStatus) {
|
|
6222
|
+
throw Error("bitsPerStatus must be set for BitstringStatusList");
|
|
6223
|
+
}
|
|
6224
|
+
entity.statusPurpose = bitstringsl.statusPurpose;
|
|
6225
|
+
entity.bitsPerStatus = bitstringsl.bitsPerStatus;
|
|
6226
|
+
entity.validFrom = bitstringsl.validFrom;
|
|
6227
|
+
entity.validUntil = bitstringsl.validUntil;
|
|
6228
|
+
entity.ttl = bitstringsl.ttl;
|
|
6229
|
+
setBaseFields(entity, args);
|
|
6230
|
+
Object.defineProperty(entity, "type", {
|
|
6231
|
+
value: import_ssi_types3.StatusListType.BitstringStatusList,
|
|
6232
|
+
enumerable: true,
|
|
6233
|
+
configurable: true
|
|
6234
|
+
});
|
|
6235
|
+
return entity;
|
|
6236
|
+
}
|
|
6237
|
+
default:
|
|
6238
|
+
throw new Error(`Invalid status list type ${args.type}`);
|
|
6235
6239
|
}
|
|
6236
|
-
throw new Error(`Invalid status list type ${args.type}`);
|
|
6237
6240
|
}, "statusListEntityFrom");
|
|
6238
6241
|
var statusListFrom = /* @__PURE__ */ __name((entity) => {
|
|
6239
6242
|
if (entity instanceof StatusList2021Entity) {
|
|
@@ -6332,8 +6335,7 @@ var StatusListStore = class {
|
|
|
6332
6335
|
const statusList = await this.getStatusList({
|
|
6333
6336
|
id: args.statusListId
|
|
6334
6337
|
});
|
|
6335
|
-
|
|
6336
|
-
return result;
|
|
6338
|
+
return await (await this.getStatusListEntryRepo(statusList.type)).save(args);
|
|
6337
6339
|
}
|
|
6338
6340
|
async updateStatusListEntry(args) {
|
|
6339
6341
|
const statusListId = args.statusListId;
|
|
@@ -6366,7 +6368,7 @@ var StatusListStore = class {
|
|
|
6366
6368
|
"statusListIndex"
|
|
6367
6369
|
]
|
|
6368
6370
|
});
|
|
6369
|
-
|
|
6371
|
+
debug4(updateResult);
|
|
6370
6372
|
return await this.getStatusListEntryByIndex({
|
|
6371
6373
|
...args,
|
|
6372
6374
|
statusListId: updStatusListId,
|
|
@@ -6429,7 +6431,7 @@ var StatusListStore = class {
|
|
|
6429
6431
|
},
|
|
6430
6432
|
credentialId
|
|
6431
6433
|
};
|
|
6432
|
-
|
|
6434
|
+
debug4(`Entries: ${JSON.stringify(await (await this.getStatusListEntryRepo(statusList.type)).find(), null, 2)}`);
|
|
6433
6435
|
const result = await (await this.getStatusListEntryRepo(statusList.type)).findOne({
|
|
6434
6436
|
where
|
|
6435
6437
|
});
|
|
@@ -6471,7 +6473,7 @@ var StatusListStore = class {
|
|
|
6471
6473
|
error2 = true;
|
|
6472
6474
|
}
|
|
6473
6475
|
if (error) {
|
|
6474
|
-
console.
|
|
6476
|
+
console.error(`Could not delete statusList ${args.statusListId} entry by index ${args.statusListIndex}`);
|
|
6475
6477
|
} else {
|
|
6476
6478
|
const statusList = await this.getStatusList({
|
|
6477
6479
|
id: args.statusListId
|