@sphereon/ssi-sdk.data-store 0.34.1-feature.SSISDK.17.bitstring.sl.10 → 0.34.1-feature.SSISDK.17.bitstring.sl.13

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 CHANGED
@@ -6326,13 +6326,20 @@ var StatusListStore = class {
6326
6326
  return statusListIndex.filter((index) => !results.includes(index));
6327
6327
  }
6328
6328
  async addStatusListEntry(args) {
6329
+ if (!args.statusListId) {
6330
+ throw new Error("statusListId is required");
6331
+ }
6329
6332
  const statusList = await this.getStatusList({
6330
6333
  id: args.statusListId
6331
6334
  });
6332
- return (await this.getStatusListEntryRepo(statusList.type)).save(args);
6335
+ const result = await (await this.getStatusListEntryRepo(statusList.type)).save(args);
6336
+ return result;
6333
6337
  }
6334
6338
  async updateStatusListEntry(args) {
6335
- const statusListId = args.statusListId ?? args.statusList?.id;
6339
+ const statusListId = args.statusListId;
6340
+ if (!statusListId) {
6341
+ throw new Error("statusListId is required");
6342
+ }
6336
6343
  const statusList = await this.getStatusList({
6337
6344
  id: statusListId
6338
6345
  });
@@ -6342,10 +6349,9 @@ var StatusListStore = class {
6342
6349
  errorOnNotFound: false
6343
6350
  });
6344
6351
  const updatedEntry = {
6345
- value: args.value,
6346
- correlationId: args.correlationId,
6347
- credentialHash: args.credentialHash,
6348
- credentialId: args.credentialId
6352
+ ...result,
6353
+ ...args,
6354
+ statusListId
6349
6355
  };
6350
6356
  const updStatusListId = result?.statusListId ?? statusListId;
6351
6357
  const updateResult = await (await this.getStatusListEntryRepo(statusList.type)).upsert({
@@ -6487,15 +6493,13 @@ var StatusListStore = class {
6487
6493
  const statusList = await this.getStatusList({
6488
6494
  id: args.statusListId
6489
6495
  });
6490
- return (await this.getStatusListEntryRepo(statusList.type)).find({
6496
+ const results = await (await this.getStatusListEntryRepo(statusList.type)).find({
6491
6497
  where: {
6492
6498
  ...args?.filter,
6493
6499
  statusList: args.statusListId
6494
6500
  }
6495
6501
  });
6496
- }
6497
- async getStatusList(args) {
6498
- return statusListFrom(await this.getStatusListEntity(args));
6502
+ return results;
6499
6503
  }
6500
6504
  async getStatusListEntity(args) {
6501
6505
  if (!args.id && !args.correlationId) {
@@ -6519,6 +6523,10 @@ var StatusListStore = class {
6519
6523
  }
6520
6524
  return result;
6521
6525
  }
6526
+ async getStatusList(args) {
6527
+ const entity = await this.getStatusListEntity(args);
6528
+ return statusListFrom(entity);
6529
+ }
6522
6530
  async getStatusLists(args) {
6523
6531
  const result = await (await this.getStatusListRepo()).find({
6524
6532
  where: args.filter