@sphereon/ssi-sdk.data-store 0.36.1-next.129 → 0.36.1-next.150

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,6 +1,9 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
3
 
4
+ // src/index.ts
5
+ import { Entities as VeramoDataStoreEntities2 } from "@veramo/data-store";
6
+
4
7
  // src/entities/contact/BaseConfigEntity.ts
5
8
  import { BaseEntity as BaseEntity10, Entity as Entity12, JoinColumn as JoinColumn7, OneToOne as OneToOne6, PrimaryGeneratedColumn as PrimaryGeneratedColumn12, TableInheritance as TableInheritance2 } from "typeorm";
6
9
 
@@ -1741,7 +1744,7 @@ _ts_decorate16([
1741
1744
  Column13("varchar", {
1742
1745
  name: "client_secret",
1743
1746
  length: 255,
1744
- nullable: false
1747
+ nullable: true
1745
1748
  }),
1746
1749
  _ts_metadata15("design:type", String)
1747
1750
  ], OpenIdConfigEntity.prototype, "clientSecret", void 0);
@@ -4955,10 +4958,54 @@ var ContactStore = class extends AbstractContactStore {
4955
4958
  return Promise.reject(Error(`Connection type ${identity.connection.type}, does not match for provided config`));
4956
4959
  }
4957
4960
  }
4958
- const identityEntity = identityEntityFrom(identity);
4961
+ const identityRepository = (await this.dbConnection).getRepository(IdentityEntity);
4962
+ const correlationIdentifierRepository = (await this.dbConnection).getRepository(CorrelationIdentifierEntity);
4963
+ const existingCorrelationIdentifier = await correlationIdentifierRepository.findOne({
4964
+ where: {
4965
+ correlationId: identity.identifier.correlationId
4966
+ }
4967
+ });
4968
+ if (existingCorrelationIdentifier) {
4969
+ const existingIdentity = await identityRepository.findOne({
4970
+ where: {
4971
+ identifier: {
4972
+ id: existingCorrelationIdentifier.id
4973
+ }
4974
+ }
4975
+ });
4976
+ if (existingIdentity) {
4977
+ debug("Identity with same correlationId already exists, returning existing identity", identity.identifier.correlationId);
4978
+ return identityFrom(existingIdentity);
4979
+ }
4980
+ }
4981
+ const existingAlias = await identityRepository.findOne({
4982
+ where: {
4983
+ alias: identity.alias
4984
+ }
4985
+ });
4986
+ let uniqueAlias = identity.alias;
4987
+ if (existingAlias) {
4988
+ let counter = 1;
4989
+ while (await identityRepository.findOne({
4990
+ where: {
4991
+ alias: `${identity.alias}_${counter}`
4992
+ }
4993
+ })) {
4994
+ counter++;
4995
+ }
4996
+ uniqueAlias = `${identity.alias}_${counter}`;
4997
+ debug("Alias collision detected, using unique alias", {
4998
+ original: identity.alias,
4999
+ unique: uniqueAlias
5000
+ });
5001
+ }
5002
+ const identityEntity = identityEntityFrom({
5003
+ ...identity,
5004
+ alias: uniqueAlias
5005
+ });
4959
5006
  identityEntity.party = party;
4960
5007
  debug("Adding identity", identity);
4961
- const result = await (await this.dbConnection).getRepository(IdentityEntity).save(identityEntity, {
5008
+ const result = await identityRepository.save(identityEntity, {
4962
5009
  transaction: true
4963
5010
  });
4964
5011
  return identityFrom(result);
@@ -6910,8 +6957,9 @@ import Debug7 from "debug";
6910
6957
  import { In as In4 } from "typeorm";
6911
6958
 
6912
6959
  // src/utils/presentationDefinition/MappingUtils.ts
6913
- import * as blakepkg from "blakejs";
6960
+ import * as blakejs from "blakejs";
6914
6961
  import { DcqlQuery } from "dcql";
6962
+ var blake = blakejs.default ?? blakejs;
6915
6963
  var dcqlQueryItemFrom = /* @__PURE__ */ __name((entity) => {
6916
6964
  const result = {
6917
6965
  id: entity.id,
@@ -6944,7 +6992,7 @@ var dcqlQueryEntityItemFrom = /* @__PURE__ */ __name((item) => {
6944
6992
  return entity;
6945
6993
  }, "dcqlQueryEntityItemFrom");
6946
6994
  function hashPayload(payload) {
6947
- return blakepkg.blake2bHex(JSON.stringify(payload));
6995
+ return blake.blake2bHex(JSON.stringify(payload));
6948
6996
  }
6949
6997
  __name(hashPayload, "hashPayload");
6950
6998
  function isPresentationDefinitionEqual(base, compare) {
@@ -7117,6 +7165,9 @@ var cleanFilter = /* @__PURE__ */ __name((filter) => {
7117
7165
  });
7118
7166
  }, "cleanFilter");
7119
7167
 
7168
+ // src/migrations/generic/index.ts
7169
+ import { migrations as VeramoDataStoreMigrations, Entities as VeramoDataStoreEntities } from "@veramo/data-store";
7170
+
7120
7171
  // src/migrations/generic/1-CreateContacts.ts
7121
7172
  import Debug8 from "debug";
7122
7173
 
@@ -8315,32 +8366,254 @@ var AddBrandingState1766000000000 = class {
8315
8366
  }
8316
8367
  };
8317
8368
 
8318
- // src/migrations/generic/2-CreateIssuanceBranding.ts
8369
+ // src/migrations/generic/15-AddServiceMetadata.ts
8370
+ import Debug17 from "debug";
8371
+
8372
+ // src/migrations/postgres/1764000000001-AddServiceMetadata.ts
8319
8373
  import Debug15 from "debug";
8320
8374
  var debug15 = Debug15("sphereon:ssi-sdk:migrations");
8375
+ var AddServiceMetadata1764000000001 = class {
8376
+ static {
8377
+ __name(this, "AddServiceMetadata1764000000001");
8378
+ }
8379
+ name = "AddServiceMetadata1764000000001";
8380
+ async up(queryRunner) {
8381
+ const table = await queryRunner.getTable("service");
8382
+ if (!table) {
8383
+ debug15("AddServiceMetadata: Skipping migration - service table does not exist. This is expected if Veramo DID Manager is not being used. If you need service metadata support, ensure Veramo migrations run before SSI-SDK migrations.");
8384
+ console.warn("[SSI-SDK Migration] AddServiceMetadata: Skipping - service table does not exist (Veramo DID Manager not in use)");
8385
+ return;
8386
+ }
8387
+ await queryRunner.query(`
8388
+ ALTER TABLE "service"
8389
+ ADD COLUMN IF NOT EXISTS "metadata" jsonb
8390
+ `);
8391
+ debug15("AddServiceMetadata: Added metadata column to service table");
8392
+ }
8393
+ async down(queryRunner) {
8394
+ const table = await queryRunner.getTable("service");
8395
+ if (!table) {
8396
+ return;
8397
+ }
8398
+ await queryRunner.query(`
8399
+ ALTER TABLE "service"
8400
+ DROP COLUMN IF EXISTS "metadata"
8401
+ `);
8402
+ }
8403
+ };
8404
+
8405
+ // src/migrations/sqlite/1764000000002-AddServiceMetadata.ts
8406
+ import Debug16 from "debug";
8407
+ var debug16 = Debug16("sphereon:ssi-sdk:migrations");
8408
+ var AddServiceMetadata1764000000002 = class {
8409
+ static {
8410
+ __name(this, "AddServiceMetadata1764000000002");
8411
+ }
8412
+ name = "AddServiceMetadata1764000000002";
8413
+ async up(queryRunner) {
8414
+ const table = await queryRunner.getTable("service");
8415
+ if (!table) {
8416
+ debug16("AddServiceMetadata: Skipping migration - service table does not exist. This is expected if Veramo DID Manager is not being used. If you need service metadata support, ensure Veramo migrations run before SSI-SDK migrations.");
8417
+ console.warn("[SSI-SDK Migration] AddServiceMetadata: Skipping - service table does not exist (Veramo DID Manager not in use)");
8418
+ return;
8419
+ }
8420
+ const hasMetadataColumn = table.columns.some((col) => col.name === "metadata");
8421
+ if (!hasMetadataColumn) {
8422
+ await queryRunner.query(`
8423
+ ALTER TABLE "service"
8424
+ ADD COLUMN "metadata" text
8425
+ `);
8426
+ debug16("AddServiceMetadata: Added metadata column to service table");
8427
+ }
8428
+ }
8429
+ async down(queryRunner) {
8430
+ }
8431
+ };
8432
+
8433
+ // src/migrations/generic/15-AddServiceMetadata.ts
8434
+ var debug17 = Debug17("sphereon:ssi-sdk:migrations");
8435
+ var AddServiceMetadata1764000000000 = class {
8436
+ static {
8437
+ __name(this, "AddServiceMetadata1764000000000");
8438
+ }
8439
+ name = "AddServiceMetadata1764000000000";
8440
+ async up(queryRunner) {
8441
+ debug17("migration: adding metadata column to service table");
8442
+ const dbType = queryRunner.connection.driver.options.type;
8443
+ switch (dbType) {
8444
+ case "postgres": {
8445
+ debug17("using postgres migration file for AddServiceMetadata");
8446
+ const mig = new AddServiceMetadata1764000000001();
8447
+ await mig.up(queryRunner);
8448
+ debug17("Postgres migration statements for AddServiceMetadata executed");
8449
+ return;
8450
+ }
8451
+ case "sqlite":
8452
+ case "expo":
8453
+ case "react-native": {
8454
+ debug17("using sqlite/react-native migration file for AddServiceMetadata");
8455
+ const mig = new AddServiceMetadata1764000000002();
8456
+ await mig.up(queryRunner);
8457
+ debug17("SQLite migration statements for AddServiceMetadata executed");
8458
+ return;
8459
+ }
8460
+ default:
8461
+ return Promise.reject(`Migrations are currently only supported for sqlite, react-native, expo, and postgres for AddServiceMetadata. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`);
8462
+ }
8463
+ }
8464
+ async down(queryRunner) {
8465
+ debug17("migration: reverting metadata column from service table");
8466
+ const dbType = queryRunner.connection.driver.options.type;
8467
+ switch (dbType) {
8468
+ case "postgres": {
8469
+ debug17("using postgres migration file for AddServiceMetadata");
8470
+ const mig = new AddServiceMetadata1764000000001();
8471
+ await mig.down(queryRunner);
8472
+ debug17("Postgres migration statements for AddServiceMetadata reverted");
8473
+ return;
8474
+ }
8475
+ case "sqlite":
8476
+ case "expo":
8477
+ case "react-native": {
8478
+ debug17("using sqlite/react-native migration file for AddServiceMetadata");
8479
+ const mig = new AddServiceMetadata1764000000002();
8480
+ await mig.down(queryRunner);
8481
+ debug17("SQLite migration statements for AddServiceMetadata reverted");
8482
+ return;
8483
+ }
8484
+ default:
8485
+ return Promise.reject(`Migrations are currently only supported for sqlite, react-native, expo, and postgres for AddServiceMetadata. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`);
8486
+ }
8487
+ }
8488
+ };
8489
+
8490
+ // src/migrations/generic/16-MakeOpenIdClientSecretNullable.ts
8491
+ import Debug20 from "debug";
8492
+
8493
+ // src/migrations/postgres/1767000000001-MakeOpenIdClientSecretNullable.ts
8494
+ import Debug18 from "debug";
8495
+ var debug18 = Debug18("sphereon:ssi-sdk:migrations");
8496
+ var MakeOpenIdClientSecretNullable1767000000001 = class {
8497
+ static {
8498
+ __name(this, "MakeOpenIdClientSecretNullable1767000000001");
8499
+ }
8500
+ name = "MakeOpenIdClientSecretNullable1767000000001";
8501
+ async up(queryRunner) {
8502
+ const table = await queryRunner.getTable("BaseConfig");
8503
+ if (!table) {
8504
+ debug18("MakeOpenIdClientSecretNullable: Skipping migration - BaseConfig table does not exist");
8505
+ return;
8506
+ }
8507
+ const column = table.columns.find((col) => col.name === "client_secret");
8508
+ if (column && !column.isNullable) {
8509
+ await queryRunner.query(`ALTER TABLE "BaseConfig" ALTER COLUMN "client_secret" DROP NOT NULL`);
8510
+ debug18("MakeOpenIdClientSecretNullable: Made client_secret nullable");
8511
+ }
8512
+ }
8513
+ async down(queryRunner) {
8514
+ const table = await queryRunner.getTable("BaseConfig");
8515
+ if (!table) {
8516
+ return;
8517
+ }
8518
+ await queryRunner.query(`UPDATE "BaseConfig" SET "client_secret" = '' WHERE "client_secret" IS NULL`);
8519
+ await queryRunner.query(`ALTER TABLE "BaseConfig" ALTER COLUMN "client_secret" SET NOT NULL`);
8520
+ }
8521
+ };
8522
+
8523
+ // src/migrations/sqlite/1767000000002-MakeOpenIdClientSecretNullable.ts
8524
+ import Debug19 from "debug";
8525
+ var debug19 = Debug19("sphereon:ssi-sdk:migrations");
8526
+ var MakeOpenIdClientSecretNullable1767000000002 = class {
8527
+ static {
8528
+ __name(this, "MakeOpenIdClientSecretNullable1767000000002");
8529
+ }
8530
+ name = "MakeOpenIdClientSecretNullable1767000000002";
8531
+ async up(queryRunner) {
8532
+ debug19("MakeOpenIdClientSecretNullable: SQLite does not support ALTER COLUMN, no action needed for nullable change");
8533
+ }
8534
+ async down(queryRunner) {
8535
+ }
8536
+ };
8537
+
8538
+ // src/migrations/generic/16-MakeOpenIdClientSecretNullable.ts
8539
+ var debug20 = Debug20("sphereon:ssi-sdk:migrations");
8540
+ var MakeOpenIdClientSecretNullable1767000000000 = class {
8541
+ static {
8542
+ __name(this, "MakeOpenIdClientSecretNullable1767000000000");
8543
+ }
8544
+ name = "MakeOpenIdClientSecretNullable1767000000000";
8545
+ async up(queryRunner) {
8546
+ debug20("migration: making client_secret nullable in BaseConfig table");
8547
+ const dbType = queryRunner.connection.driver.options.type;
8548
+ switch (dbType) {
8549
+ case "postgres": {
8550
+ debug20("using postgres migration file for MakeOpenIdClientSecretNullable");
8551
+ const mig = new MakeOpenIdClientSecretNullable1767000000001();
8552
+ await mig.up(queryRunner);
8553
+ debug20("Postgres migration statements for MakeOpenIdClientSecretNullable executed");
8554
+ return;
8555
+ }
8556
+ case "sqlite":
8557
+ case "expo":
8558
+ case "react-native": {
8559
+ debug20("using sqlite/react-native migration file for MakeOpenIdClientSecretNullable");
8560
+ const mig = new MakeOpenIdClientSecretNullable1767000000002();
8561
+ await mig.up(queryRunner);
8562
+ debug20("SQLite migration statements for MakeOpenIdClientSecretNullable executed");
8563
+ return;
8564
+ }
8565
+ default:
8566
+ return Promise.reject(`Migrations are currently only supported for sqlite, react-native, expo, and postgres for MakeOpenIdClientSecretNullable. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`);
8567
+ }
8568
+ }
8569
+ async down(queryRunner) {
8570
+ debug20("migration: reverting client_secret nullable in BaseConfig table");
8571
+ const dbType = queryRunner.connection.driver.options.type;
8572
+ switch (dbType) {
8573
+ case "postgres": {
8574
+ const mig = new MakeOpenIdClientSecretNullable1767000000001();
8575
+ await mig.down(queryRunner);
8576
+ return;
8577
+ }
8578
+ case "sqlite":
8579
+ case "expo":
8580
+ case "react-native": {
8581
+ const mig = new MakeOpenIdClientSecretNullable1767000000002();
8582
+ await mig.down(queryRunner);
8583
+ return;
8584
+ }
8585
+ default:
8586
+ return Promise.reject(`Migrations are currently only supported for sqlite, react-native, expo, and postgres for MakeOpenIdClientSecretNullable. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`);
8587
+ }
8588
+ }
8589
+ };
8590
+
8591
+ // src/migrations/generic/2-CreateIssuanceBranding.ts
8592
+ import Debug21 from "debug";
8593
+ var debug21 = Debug21("sphereon:ssi-sdk:migrations");
8321
8594
  var CreateIssuanceBranding1659463079429 = class {
8322
8595
  static {
8323
8596
  __name(this, "CreateIssuanceBranding1659463079429");
8324
8597
  }
8325
8598
  name = "CreateIssuanceBranding1659463079429";
8326
8599
  async up(queryRunner) {
8327
- debug15("migration: creating issuance branding tables");
8600
+ debug21("migration: creating issuance branding tables");
8328
8601
  const dbType = queryRunner.connection.driver.options.type;
8329
8602
  switch (dbType) {
8330
8603
  case "postgres": {
8331
- debug15("using postgres migration file");
8604
+ debug21("using postgres migration file");
8332
8605
  const mig = new CreateIssuanceBranding1685628974232();
8333
8606
  await mig.up(queryRunner);
8334
- debug15("Migration statements executed");
8607
+ debug21("Migration statements executed");
8335
8608
  return;
8336
8609
  }
8337
8610
  case "sqlite":
8338
8611
  case "expo":
8339
8612
  case "react-native": {
8340
- debug15("using sqlite/react-native migration file");
8613
+ debug21("using sqlite/react-native migration file");
8341
8614
  const mig = new CreateIssuanceBranding1685628973231();
8342
8615
  await mig.up(queryRunner);
8343
- debug15("Migration statements executed");
8616
+ debug21("Migration statements executed");
8344
8617
  return;
8345
8618
  }
8346
8619
  default:
@@ -8348,23 +8621,23 @@ var CreateIssuanceBranding1659463079429 = class {
8348
8621
  }
8349
8622
  }
8350
8623
  async down(queryRunner) {
8351
- debug15("migration: reverting issuance branding tables");
8624
+ debug21("migration: reverting issuance branding tables");
8352
8625
  const dbType = queryRunner.connection.driver.options.type;
8353
8626
  switch (dbType) {
8354
8627
  case "postgres": {
8355
- debug15("using postgres migration file");
8628
+ debug21("using postgres migration file");
8356
8629
  const mig = new CreateIssuanceBranding1685628974232();
8357
8630
  await mig.down(queryRunner);
8358
- debug15("Migration statements executed");
8631
+ debug21("Migration statements executed");
8359
8632
  return;
8360
8633
  }
8361
8634
  case "sqlite":
8362
8635
  case "expo":
8363
8636
  case "react-native": {
8364
- debug15("using sqlite/react-native migration file");
8637
+ debug21("using sqlite/react-native migration file");
8365
8638
  const mig = new CreateIssuanceBranding1685628973231();
8366
8639
  await mig.down(queryRunner);
8367
- debug15("Migration statements executed");
8640
+ debug21("Migration statements executed");
8368
8641
  return;
8369
8642
  }
8370
8643
  default:
@@ -8374,7 +8647,7 @@ var CreateIssuanceBranding1659463079429 = class {
8374
8647
  };
8375
8648
 
8376
8649
  // src/migrations/generic/3-CreateContacts.ts
8377
- import Debug16 from "debug";
8650
+ import Debug22 from "debug";
8378
8651
 
8379
8652
  // src/migrations/postgres/1690925872592-CreateContacts.ts
8380
8653
  import { enablePostgresUuidExtension as enablePostgresUuidExtension3 } from "@sphereon/ssi-sdk.core";
@@ -8595,30 +8868,30 @@ var CreateContacts1690925872693 = class {
8595
8868
  };
8596
8869
 
8597
8870
  // src/migrations/generic/3-CreateContacts.ts
8598
- var debug16 = Debug16("sphereon:ssi-sdk:migrations");
8871
+ var debug22 = Debug22("sphereon:ssi-sdk:migrations");
8599
8872
  var CreateContacts1690925872318 = class {
8600
8873
  static {
8601
8874
  __name(this, "CreateContacts1690925872318");
8602
8875
  }
8603
8876
  name = "CreateContacts1690925872318";
8604
8877
  async up(queryRunner) {
8605
- debug16("migration: creating contacts tables");
8878
+ debug22("migration: creating contacts tables");
8606
8879
  const dbType = queryRunner.connection.driver.options.type;
8607
8880
  switch (dbType) {
8608
8881
  case "postgres": {
8609
- debug16("using postgres migration file");
8882
+ debug22("using postgres migration file");
8610
8883
  const mig = new CreateContacts1690925872592();
8611
8884
  await mig.up(queryRunner);
8612
- debug16("Migration statements executed");
8885
+ debug22("Migration statements executed");
8613
8886
  return;
8614
8887
  }
8615
8888
  case "sqlite":
8616
8889
  case "expo":
8617
8890
  case "react-native": {
8618
- debug16("using sqlite/react-native migration file");
8891
+ debug22("using sqlite/react-native migration file");
8619
8892
  const mig = new CreateContacts1690925872693();
8620
8893
  await mig.up(queryRunner);
8621
- debug16("Migration statements executed");
8894
+ debug22("Migration statements executed");
8622
8895
  return;
8623
8896
  }
8624
8897
  default:
@@ -8626,23 +8899,23 @@ var CreateContacts1690925872318 = class {
8626
8899
  }
8627
8900
  }
8628
8901
  async down(queryRunner) {
8629
- debug16("migration: reverting contacts tables");
8902
+ debug22("migration: reverting contacts tables");
8630
8903
  const dbType = queryRunner.connection.driver.options.type;
8631
8904
  switch (dbType) {
8632
8905
  case "postgres": {
8633
- debug16("using postgres migration file");
8906
+ debug22("using postgres migration file");
8634
8907
  const mig = new CreateContacts1690925872592();
8635
8908
  await mig.down(queryRunner);
8636
- debug16("Migration statements executed");
8909
+ debug22("Migration statements executed");
8637
8910
  return;
8638
8911
  }
8639
8912
  case "sqlite":
8640
8913
  case "expo":
8641
8914
  case "react-native": {
8642
- debug16("using sqlite/react-native migration file");
8915
+ debug22("using sqlite/react-native migration file");
8643
8916
  const mig = new CreateContacts1690925872693();
8644
8917
  await mig.down(queryRunner);
8645
- debug16("Migration statements executed");
8918
+ debug22("Migration statements executed");
8646
8919
  return;
8647
8920
  }
8648
8921
  default:
@@ -8652,7 +8925,7 @@ var CreateContacts1690925872318 = class {
8652
8925
  };
8653
8926
 
8654
8927
  // src/migrations/generic/4-CreateStatusList.ts
8655
- import Debug17 from "debug";
8928
+ import Debug23 from "debug";
8656
8929
 
8657
8930
  // src/migrations/postgres/1693866470001-CreateStatusList.ts
8658
8931
  var CreateStatusList1693866470001 = class {
@@ -8858,53 +9131,53 @@ var UpdateStatusList1737110469000 = class {
8858
9131
  };
8859
9132
 
8860
9133
  // src/migrations/generic/4-CreateStatusList.ts
8861
- var debug17 = Debug17("sphereon:ssi-sdk:migrations");
9134
+ var debug23 = Debug23("sphereon:ssi-sdk:migrations");
8862
9135
  var CreateStatusList1693866470000 = class {
8863
9136
  static {
8864
9137
  __name(this, "CreateStatusList1693866470000");
8865
9138
  }
8866
9139
  name = "CreateStatusList1693866470000";
8867
9140
  async up(queryRunner) {
8868
- debug17("migration: creating issuance branding tables");
9141
+ debug23("migration: creating issuance branding tables");
8869
9142
  const dbType = queryRunner.connection.driver.options.type;
8870
9143
  if (dbType === "postgres") {
8871
- debug17("using postgres migration files");
9144
+ debug23("using postgres migration files");
8872
9145
  const createMig = new CreateStatusList1693866470001();
8873
9146
  await createMig.up(queryRunner);
8874
9147
  const updateMig = new UpdateStatusList1737110469001();
8875
9148
  const up = await updateMig.up(queryRunner);
8876
- debug17("Migration statements executed");
9149
+ debug23("Migration statements executed");
8877
9150
  return up;
8878
9151
  } else if (dbType === "sqlite" || dbType === "react-native" || dbType === "expo") {
8879
- debug17("using sqlite/react-native migration files");
9152
+ debug23("using sqlite/react-native migration files");
8880
9153
  const createMig = new CreateStatusList1693866470002();
8881
9154
  await createMig.up(queryRunner);
8882
9155
  const updateMig = new UpdateStatusList1737110469000();
8883
9156
  const up = await updateMig.up(queryRunner);
8884
- debug17("Migration statements executed");
9157
+ debug23("Migration statements executed");
8885
9158
  return up;
8886
9159
  } else {
8887
9160
  return Promise.reject(`Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`);
8888
9161
  }
8889
9162
  }
8890
9163
  async down(queryRunner) {
8891
- debug17("migration: reverting issuance branding tables");
9164
+ debug23("migration: reverting issuance branding tables");
8892
9165
  const dbType = queryRunner.connection.driver.options.type;
8893
9166
  if (dbType === "postgres") {
8894
- debug17("using postgres migration files");
9167
+ debug23("using postgres migration files");
8895
9168
  const updateMig = new UpdateStatusList1737110469001();
8896
9169
  await updateMig.down(queryRunner);
8897
9170
  const createMig = new CreateStatusList1693866470001();
8898
9171
  const down = await createMig.down(queryRunner);
8899
- debug17("Migration statements executed");
9172
+ debug23("Migration statements executed");
8900
9173
  return down;
8901
9174
  } else if (dbType === "sqlite" || dbType === "react-native" || dbType === "expo") {
8902
- debug17("using sqlite/react-native migration files");
9175
+ debug23("using sqlite/react-native migration files");
8903
9176
  const updateMig = new UpdateStatusList1737110469000();
8904
9177
  await updateMig.down(queryRunner);
8905
9178
  const createMig = new CreateStatusList1693866470002();
8906
9179
  const down = await createMig.down(queryRunner);
8907
- debug17("Migration statements executed");
9180
+ debug23("Migration statements executed");
8908
9181
  return down;
8909
9182
  } else {
8910
9183
  return Promise.reject(`Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`);
@@ -8913,7 +9186,7 @@ var CreateStatusList1693866470000 = class {
8913
9186
  };
8914
9187
 
8915
9188
  // src/migrations/generic/5-CreateAuditEvents.ts
8916
- import Debug18 from "debug";
9189
+ import Debug24 from "debug";
8917
9190
 
8918
9191
  // src/migrations/postgres/1701634812183-CreateAuditEvents.ts
8919
9192
  var CreateAuditEvents1701634812183 = class {
@@ -9012,30 +9285,30 @@ var CreateAuditEvents1701634819487 = class {
9012
9285
  };
9013
9286
 
9014
9287
  // src/migrations/generic/5-CreateAuditEvents.ts
9015
- var debug18 = Debug18("sphereon:ssi-sdk:migrations");
9288
+ var debug24 = Debug24("sphereon:ssi-sdk:migrations");
9016
9289
  var CreateAuditEvents1701635835330 = class {
9017
9290
  static {
9018
9291
  __name(this, "CreateAuditEvents1701635835330");
9019
9292
  }
9020
9293
  name = "CreateAuditEvents1701635835330";
9021
9294
  async up(queryRunner) {
9022
- debug18("migration: creating audit events tables");
9295
+ debug24("migration: creating audit events tables");
9023
9296
  const dbType = queryRunner.connection.driver.options.type;
9024
9297
  switch (dbType) {
9025
9298
  case "postgres": {
9026
- debug18("using postgres migration file");
9299
+ debug24("using postgres migration file");
9027
9300
  const mig = new CreateAuditEvents1701634812183();
9028
9301
  await mig.up(queryRunner);
9029
- debug18("Migration statements executed");
9302
+ debug24("Migration statements executed");
9030
9303
  return;
9031
9304
  }
9032
9305
  case "sqlite":
9033
9306
  case "expo":
9034
9307
  case "react-native": {
9035
- debug18("using sqlite/react-native migration file");
9308
+ debug24("using sqlite/react-native migration file");
9036
9309
  const mig = new CreateAuditEvents1701634819487();
9037
9310
  await mig.up(queryRunner);
9038
- debug18("Migration statements executed");
9311
+ debug24("Migration statements executed");
9039
9312
  return;
9040
9313
  }
9041
9314
  default:
@@ -9043,23 +9316,23 @@ var CreateAuditEvents1701635835330 = class {
9043
9316
  }
9044
9317
  }
9045
9318
  async down(queryRunner) {
9046
- debug18("migration: reverting audit events tables");
9319
+ debug24("migration: reverting audit events tables");
9047
9320
  const dbType = queryRunner.connection.driver.options.type;
9048
9321
  switch (dbType) {
9049
9322
  case "postgres": {
9050
- debug18("using postgres migration file");
9323
+ debug24("using postgres migration file");
9051
9324
  const mig = new CreateAuditEvents1701634812183();
9052
9325
  await mig.down(queryRunner);
9053
- debug18("Migration statements executed");
9326
+ debug24("Migration statements executed");
9054
9327
  return;
9055
9328
  }
9056
9329
  case "sqlite":
9057
9330
  case "expo":
9058
9331
  case "react-native": {
9059
- debug18("using sqlite/react-native migration file");
9332
+ debug24("using sqlite/react-native migration file");
9060
9333
  const mig = new CreateAuditEvents1701634819487();
9061
9334
  await mig.down(queryRunner);
9062
- debug18("Migration statements executed");
9335
+ debug24("Migration statements executed");
9063
9336
  return;
9064
9337
  }
9065
9338
  default:
@@ -9069,7 +9342,7 @@ var CreateAuditEvents1701635835330 = class {
9069
9342
  };
9070
9343
 
9071
9344
  // src/migrations/generic/6-CreateDigitalCredential.ts
9072
- import Debug19 from "debug";
9345
+ import Debug25 from "debug";
9073
9346
 
9074
9347
  // src/migrations/postgres/1708525189001-CreateDigitalCredential.ts
9075
9348
  var CreateDigitalCredential1708525189001 = class {
@@ -9177,30 +9450,30 @@ var CreateDigitalCredential1708525189002 = class {
9177
9450
  };
9178
9451
 
9179
9452
  // src/migrations/generic/6-CreateDigitalCredential.ts
9180
- var debug19 = Debug19("sphereon:ssi-sdk:migrations");
9453
+ var debug25 = Debug25("sphereon:ssi-sdk:migrations");
9181
9454
  var CreateDigitalCredential1708525189000 = class {
9182
9455
  static {
9183
9456
  __name(this, "CreateDigitalCredential1708525189000");
9184
9457
  }
9185
9458
  name = "CreateDigitalCredential1708525189000";
9186
9459
  async up(queryRunner) {
9187
- debug19("migration: creating DigitalCredential tables");
9460
+ debug25("migration: creating DigitalCredential tables");
9188
9461
  const dbType = queryRunner.connection.driver.options.type;
9189
9462
  switch (dbType) {
9190
9463
  case "postgres": {
9191
- debug19("using postgres migration file for DigitalCredential");
9464
+ debug25("using postgres migration file for DigitalCredential");
9192
9465
  const mig = new CreateDigitalCredential1708525189001();
9193
9466
  await mig.up(queryRunner);
9194
- debug19("Postgres Migration statements for DigitalCredential executed");
9467
+ debug25("Postgres Migration statements for DigitalCredential executed");
9195
9468
  return;
9196
9469
  }
9197
9470
  case "sqlite":
9198
9471
  case "expo":
9199
9472
  case "react-native": {
9200
- debug19("using sqlite/react-native migration file for DigitalCredential");
9473
+ debug25("using sqlite/react-native migration file for DigitalCredential");
9201
9474
  const mig = new CreateDigitalCredential1708525189002();
9202
9475
  await mig.up(queryRunner);
9203
- debug19("SQLite Migration statements for DigitalCredential executed");
9476
+ debug25("SQLite Migration statements for DigitalCredential executed");
9204
9477
  return;
9205
9478
  }
9206
9479
  default:
@@ -9208,23 +9481,23 @@ var CreateDigitalCredential1708525189000 = class {
9208
9481
  }
9209
9482
  }
9210
9483
  async down(queryRunner) {
9211
- debug19("migration: reverting DigitalCredential tables");
9484
+ debug25("migration: reverting DigitalCredential tables");
9212
9485
  const dbType = queryRunner.connection.driver.options.type;
9213
9486
  switch (dbType) {
9214
9487
  case "postgres": {
9215
- debug19("using postgres migration file for DigitalCredential");
9488
+ debug25("using postgres migration file for DigitalCredential");
9216
9489
  const mig = new CreateDigitalCredential1708525189001();
9217
9490
  await mig.down(queryRunner);
9218
- debug19("Postgres Migration statements for DigitalCredential reverted");
9491
+ debug25("Postgres Migration statements for DigitalCredential reverted");
9219
9492
  return;
9220
9493
  }
9221
9494
  case "sqlite":
9222
9495
  case "expo":
9223
9496
  case "react-native": {
9224
- debug19("using sqlite/react-native migration file for DigitalCredential");
9497
+ debug25("using sqlite/react-native migration file for DigitalCredential");
9225
9498
  const mig = new CreateDigitalCredential1708525189002();
9226
9499
  await mig.down(queryRunner);
9227
- debug19("SQLite Migration statements for DigitalCredential reverted");
9500
+ debug25("SQLite Migration statements for DigitalCredential reverted");
9228
9501
  return;
9229
9502
  }
9230
9503
  default:
@@ -9234,7 +9507,7 @@ var CreateDigitalCredential1708525189000 = class {
9234
9507
  };
9235
9508
 
9236
9509
  // src/migrations/generic/7-CreateMachineStateStore.ts
9237
- import Debug20 from "debug";
9510
+ import Debug26 from "debug";
9238
9511
 
9239
9512
  // src/migrations/postgres/1708797018115-CreateMachineStateStore.ts
9240
9513
  var CreateMachineStateStore1708797018115 = class {
@@ -9296,30 +9569,30 @@ var CreateMachineStateStore1708796002272 = class {
9296
9569
  };
9297
9570
 
9298
9571
  // src/migrations/generic/7-CreateMachineStateStore.ts
9299
- var debug20 = Debug20("sphereon:ssi-sdk:migrations");
9572
+ var debug26 = Debug26("sphereon:ssi-sdk:migrations");
9300
9573
  var CreateMachineStateStore1708098041262 = class {
9301
9574
  static {
9302
9575
  __name(this, "CreateMachineStateStore1708098041262");
9303
9576
  }
9304
9577
  name = "CreateMachineStateStore1708098041262";
9305
9578
  async up(queryRunner) {
9306
- debug20("migration: creating machine state tables");
9579
+ debug26("migration: creating machine state tables");
9307
9580
  const dbType = queryRunner.connection.driver.options.type;
9308
9581
  switch (dbType) {
9309
9582
  case "postgres": {
9310
- debug20("using postgres migration file");
9583
+ debug26("using postgres migration file");
9311
9584
  const mig = new CreateMachineStateStore1708797018115();
9312
9585
  await mig.up(queryRunner);
9313
- debug20("Migration statements executed");
9586
+ debug26("Migration statements executed");
9314
9587
  return;
9315
9588
  }
9316
9589
  case "sqlite":
9317
9590
  case "expo":
9318
9591
  case "react-native": {
9319
- debug20("using sqlite/react-native migration file");
9592
+ debug26("using sqlite/react-native migration file");
9320
9593
  const mig = new CreateMachineStateStore1708796002272();
9321
9594
  await mig.up(queryRunner);
9322
- debug20("Migration statements executed");
9595
+ debug26("Migration statements executed");
9323
9596
  return;
9324
9597
  }
9325
9598
  default:
@@ -9327,23 +9600,23 @@ var CreateMachineStateStore1708098041262 = class {
9327
9600
  }
9328
9601
  }
9329
9602
  async down(queryRunner) {
9330
- debug20("migration: reverting machine state tables");
9603
+ debug26("migration: reverting machine state tables");
9331
9604
  const dbType = queryRunner.connection.driver.options.type;
9332
9605
  switch (dbType) {
9333
9606
  case "postgres": {
9334
- debug20("using postgres migration file");
9607
+ debug26("using postgres migration file");
9335
9608
  const mig = new CreateMachineStateStore1708797018115();
9336
9609
  await mig.down(queryRunner);
9337
- debug20("Migration statements executed");
9610
+ debug26("Migration statements executed");
9338
9611
  return;
9339
9612
  }
9340
9613
  case "sqlite":
9341
9614
  case "expo":
9342
9615
  case "react-native": {
9343
- debug20("using sqlite/react-native migration file");
9616
+ debug26("using sqlite/react-native migration file");
9344
9617
  const mig = new CreateMachineStateStore1708796002272();
9345
9618
  await mig.down(queryRunner);
9346
- debug20("Migration statements executed");
9619
+ debug26("Migration statements executed");
9347
9620
  return;
9348
9621
  }
9349
9622
  default:
@@ -9353,7 +9626,7 @@ var CreateMachineStateStore1708098041262 = class {
9353
9626
  };
9354
9627
 
9355
9628
  // src/migrations/generic/8-CreateContacts.ts
9356
- import Debug21 from "debug";
9629
+ import Debug27 from "debug";
9357
9630
 
9358
9631
  // src/migrations/postgres/1710438363001-CreateContacts.ts
9359
9632
  var CreateContacts1710438363001 = class {
@@ -9467,30 +9740,30 @@ var CreateContacts1710438363002 = class {
9467
9740
  };
9468
9741
 
9469
9742
  // src/migrations/generic/8-CreateContacts.ts
9470
- var debug21 = Debug21("sphereon:ssi-sdk:migrations");
9743
+ var debug27 = Debug27("sphereon:ssi-sdk:migrations");
9471
9744
  var CreateContacts1708525189000 = class {
9472
9745
  static {
9473
9746
  __name(this, "CreateContacts1708525189000");
9474
9747
  }
9475
9748
  name = "CreateContacts1708525189000";
9476
9749
  async up(queryRunner) {
9477
- debug21("migration: updating contact tables");
9750
+ debug27("migration: updating contact tables");
9478
9751
  const dbType = queryRunner.connection.driver.options.type;
9479
9752
  switch (dbType) {
9480
9753
  case "postgres": {
9481
- debug21("using postgres migration file");
9754
+ debug27("using postgres migration file");
9482
9755
  const mig = new CreateContacts1710438363001();
9483
9756
  await mig.up(queryRunner);
9484
- debug21("Migration statements executed");
9757
+ debug27("Migration statements executed");
9485
9758
  return;
9486
9759
  }
9487
9760
  case "sqlite":
9488
9761
  case "expo":
9489
9762
  case "react-native": {
9490
- debug21("using sqlite/react-native migration file");
9763
+ debug27("using sqlite/react-native migration file");
9491
9764
  const mig = new CreateContacts1710438363002();
9492
9765
  await mig.up(queryRunner);
9493
- debug21("Migration statements executed");
9766
+ debug27("Migration statements executed");
9494
9767
  return;
9495
9768
  }
9496
9769
  default:
@@ -9498,23 +9771,23 @@ var CreateContacts1708525189000 = class {
9498
9771
  }
9499
9772
  }
9500
9773
  async down(queryRunner) {
9501
- debug21("migration: reverting machine state tables");
9774
+ debug27("migration: reverting machine state tables");
9502
9775
  const dbType = queryRunner.connection.driver.options.type;
9503
9776
  switch (dbType) {
9504
9777
  case "postgres": {
9505
- debug21("using postgres migration file");
9778
+ debug27("using postgres migration file");
9506
9779
  const mig = new CreateContacts1710438363001();
9507
9780
  await mig.down(queryRunner);
9508
- debug21("Migration statements executed");
9781
+ debug27("Migration statements executed");
9509
9782
  return;
9510
9783
  }
9511
9784
  case "sqlite":
9512
9785
  case "expo":
9513
9786
  case "react-native": {
9514
- debug21("using sqlite/react-native migration file");
9787
+ debug27("using sqlite/react-native migration file");
9515
9788
  const mig = new CreateContacts1710438363002();
9516
9789
  await mig.down(queryRunner);
9517
- debug21("Migration statements executed");
9790
+ debug27("Migration statements executed");
9518
9791
  return;
9519
9792
  }
9520
9793
  default:
@@ -9524,7 +9797,7 @@ var CreateContacts1708525189000 = class {
9524
9797
  };
9525
9798
 
9526
9799
  // src/migrations/generic/9-CreateContacts.ts
9527
- import Debug22 from "debug";
9800
+ import Debug28 from "debug";
9528
9801
 
9529
9802
  // src/migrations/postgres/1715761125001-CreateContacts.ts
9530
9803
  var CreateContacts1715761125001 = class {
@@ -9636,30 +9909,30 @@ var CreateContacts1715761125002 = class {
9636
9909
  };
9637
9910
 
9638
9911
  // src/migrations/generic/9-CreateContacts.ts
9639
- var debug22 = Debug22("sphereon:ssi-sdk:migrations");
9912
+ var debug28 = Debug28("sphereon:ssi-sdk:migrations");
9640
9913
  var CreateContacts1715761125000 = class {
9641
9914
  static {
9642
9915
  __name(this, "CreateContacts1715761125000");
9643
9916
  }
9644
9917
  name = "CreateContacts1715761125000";
9645
9918
  async up(queryRunner) {
9646
- debug22("migration: updating contact tables");
9919
+ debug28("migration: updating contact tables");
9647
9920
  const dbType = queryRunner.connection.driver.options.type;
9648
9921
  switch (dbType) {
9649
9922
  case "postgres": {
9650
- debug22("using postgres migration file");
9923
+ debug28("using postgres migration file");
9651
9924
  const mig = new CreateContacts1715761125001();
9652
9925
  await mig.up(queryRunner);
9653
- debug22("Migration statements executed");
9926
+ debug28("Migration statements executed");
9654
9927
  return;
9655
9928
  }
9656
9929
  case "sqlite":
9657
9930
  case "expo":
9658
9931
  case "react-native": {
9659
- debug22("using sqlite/react-native migration file");
9932
+ debug28("using sqlite/react-native migration file");
9660
9933
  const mig = new CreateContacts1715761125002();
9661
9934
  await mig.up(queryRunner);
9662
- debug22("Migration statements executed");
9935
+ debug28("Migration statements executed");
9663
9936
  return;
9664
9937
  }
9665
9938
  default:
@@ -9667,23 +9940,23 @@ var CreateContacts1715761125000 = class {
9667
9940
  }
9668
9941
  }
9669
9942
  async down(queryRunner) {
9670
- debug22("migration: reverting machine state tables");
9943
+ debug28("migration: reverting machine state tables");
9671
9944
  const dbType = queryRunner.connection.driver.options.type;
9672
9945
  switch (dbType) {
9673
9946
  case "postgres": {
9674
- debug22("using postgres migration file");
9947
+ debug28("using postgres migration file");
9675
9948
  const mig = new CreateContacts1715761125001();
9676
9949
  await mig.down(queryRunner);
9677
- debug22("Migration statements executed");
9950
+ debug28("Migration statements executed");
9678
9951
  return;
9679
9952
  }
9680
9953
  case "sqlite":
9681
9954
  case "expo":
9682
9955
  case "react-native": {
9683
- debug22("using sqlite/react-native migration file");
9956
+ debug28("using sqlite/react-native migration file");
9684
9957
  const mig = new CreateContacts1715761125002();
9685
9958
  await mig.down(queryRunner);
9686
- debug22("Migration statements executed");
9959
+ debug28("Migration statements executed");
9687
9960
  return;
9688
9961
  }
9689
9962
  default:
@@ -9697,7 +9970,8 @@ var DataStoreContactMigrations = [
9697
9970
  CreateContacts1659463079429,
9698
9971
  CreateContacts1690925872318,
9699
9972
  CreateContacts1708525189000,
9700
- CreateContacts1715761125000
9973
+ CreateContacts1715761125000,
9974
+ MakeOpenIdClientSecretNullable1767000000000
9701
9975
  ];
9702
9976
  var DataStoreIssuanceBrandingMigrations = [
9703
9977
  CreateIssuanceBranding1659463079429,
@@ -9723,6 +9997,9 @@ var DataStorePresentationDefinitionMigrations = [
9723
9997
  CreatePresentationDefinitions1716533767523,
9724
9998
  CreateDcqlQueryItem1726617600000
9725
9999
  ];
10000
+ var DataStoreServiceMigrations = [
10001
+ AddServiceMetadata1764000000000
10002
+ ];
9726
10003
  var DataStoreMigrations = [
9727
10004
  ...DataStoreContactMigrations,
9728
10005
  ...DataStoreIssuanceBrandingMigrations,
@@ -9730,7 +10007,12 @@ var DataStoreMigrations = [
9730
10007
  ...DataStoreEventLoggerMigrations,
9731
10008
  ...DataStoreDigitalCredentialMigrations,
9732
10009
  ...DataStoreMachineStateMigrations,
9733
- ...DataStorePresentationDefinitionMigrations
10010
+ ...DataStorePresentationDefinitionMigrations,
10011
+ ...DataStoreServiceMigrations
10012
+ ];
10013
+ var DataStoreMigrationsWithVeramo = [
10014
+ ...VeramoDataStoreMigrations,
10015
+ ...DataStoreMigrations
9734
10016
  ];
9735
10017
 
9736
10018
  // src/utils/digitalCredential/MappingUtils.ts
@@ -9961,6 +10243,10 @@ var DataStoreEntities = [
9961
10243
  ...DataStoreMachineStateEntities,
9962
10244
  ...DataStorePresentationDefinitionEntities
9963
10245
  ];
10246
+ var DataStoreEntitiesWithVeramo = [
10247
+ ...VeramoDataStoreEntities2,
10248
+ ...DataStoreEntities
10249
+ ];
9964
10250
  export {
9965
10251
  AbstractEventLoggerStore2 as AbstractEventLoggerStore,
9966
10252
  AuditEventEntity,
@@ -9982,6 +10268,7 @@ export {
9982
10268
  DataStoreDigitalCredentialEntities,
9983
10269
  DataStoreDigitalCredentialMigrations,
9984
10270
  DataStoreEntities,
10271
+ DataStoreEntitiesWithVeramo,
9985
10272
  DataStoreEventLoggerEntities,
9986
10273
  DataStoreEventLoggerMigrations,
9987
10274
  DataStoreIssuanceBrandingEntities,
@@ -9989,9 +10276,11 @@ export {
9989
10276
  DataStoreMachineStateEntities,
9990
10277
  DataStoreMachineStateMigrations,
9991
10278
  DataStoreMigrations,
10279
+ DataStoreMigrationsWithVeramo,
9992
10280
  DataStoreOid4vcStateEntities,
9993
10281
  DataStorePresentationDefinitionEntities,
9994
10282
  DataStorePresentationDefinitionMigrations,
10283
+ DataStoreServiceMigrations,
9995
10284
  DataStoreStatusListEntities,
9996
10285
  DataStoreStatusListMigrations,
9997
10286
  DcqlQueryItemEntity,
@@ -10020,6 +10309,8 @@ export {
10020
10309
  StatusListEntryEntity,
10021
10310
  StatusListStore,
10022
10311
  TextAttributesEntity,
10312
+ VeramoDataStoreEntities,
10313
+ VeramoDataStoreMigrations,
10023
10314
  activityEventEntityFrom,
10024
10315
  activityEventFrom,
10025
10316
  auditEventEntityFrom,