@sphereon/ssi-sdk.data-store 0.34.1-feature.SSISDK.45.94 → 0.34.1-feature.SSISDK.46.151

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
@@ -8,55 +8,55 @@ import typeorm6 from "typeorm";
8
8
  import typeorm5 from "typeorm";
9
9
 
10
10
  // src/types/contact/contact.ts
11
- var ConnectionType = /* @__PURE__ */ function(ConnectionType2) {
11
+ var ConnectionType = /* @__PURE__ */ (function(ConnectionType2) {
12
12
  ConnectionType2["OPENID_CONNECT"] = "OIDC";
13
13
  ConnectionType2["SIOPv2"] = "SIOPv2";
14
14
  ConnectionType2["SIOPv2_OpenID4VP"] = "SIOPv2+OpenID4VP";
15
15
  return ConnectionType2;
16
- }({});
17
- var CorrelationIdentifierType = /* @__PURE__ */ function(CorrelationIdentifierType2) {
16
+ })({});
17
+ var CorrelationIdentifierType = /* @__PURE__ */ (function(CorrelationIdentifierType2) {
18
18
  CorrelationIdentifierType2["DID"] = "did";
19
19
  CorrelationIdentifierType2["URL"] = "url";
20
20
  return CorrelationIdentifierType2;
21
- }({});
22
- var PartyTypeType = /* @__PURE__ */ function(PartyTypeType2) {
21
+ })({});
22
+ var PartyTypeType = /* @__PURE__ */ (function(PartyTypeType2) {
23
23
  PartyTypeType2["NATURAL_PERSON"] = "naturalPerson";
24
24
  PartyTypeType2["ORGANIZATION"] = "organization";
25
25
  return PartyTypeType2;
26
- }({});
27
- var PartyOrigin = /* @__PURE__ */ function(PartyOrigin2) {
26
+ })({});
27
+ var PartyOrigin = /* @__PURE__ */ (function(PartyOrigin2) {
28
28
  PartyOrigin2["INTERNAL"] = "INTERNAL";
29
29
  PartyOrigin2["EXTERNAL"] = "EXTERNAL";
30
30
  return PartyOrigin2;
31
- }({});
32
- var IdentityOrigin = /* @__PURE__ */ function(IdentityOrigin2) {
31
+ })({});
32
+ var IdentityOrigin = /* @__PURE__ */ (function(IdentityOrigin2) {
33
33
  IdentityOrigin2["INTERNAL"] = "INTERNAL";
34
34
  IdentityOrigin2["EXTERNAL"] = "EXTERNAL";
35
35
  return IdentityOrigin2;
36
- }({});
36
+ })({});
37
37
 
38
38
  // src/types/digitalCredential/enums.ts
39
- var DocumentType = /* @__PURE__ */ function(DocumentType2) {
39
+ var DocumentType = /* @__PURE__ */ (function(DocumentType2) {
40
40
  DocumentType2["VC"] = "VC";
41
41
  DocumentType2["VP"] = "VP";
42
42
  DocumentType2["P"] = "P";
43
43
  DocumentType2["C"] = "C";
44
44
  return DocumentType2;
45
- }({});
46
- var RegulationType = /* @__PURE__ */ function(RegulationType2) {
45
+ })({});
46
+ var RegulationType = /* @__PURE__ */ (function(RegulationType2) {
47
47
  RegulationType2["PID"] = "PID";
48
48
  RegulationType2["QEAA"] = "QEAA";
49
49
  RegulationType2["EAA"] = "EAA";
50
50
  RegulationType2["NON_REGULATED"] = "NON_REGULATED";
51
51
  return RegulationType2;
52
- }({});
53
- var CredentialDocumentFormat = /* @__PURE__ */ function(CredentialDocumentFormat2) {
52
+ })({});
53
+ var CredentialDocumentFormat = /* @__PURE__ */ (function(CredentialDocumentFormat2) {
54
54
  CredentialDocumentFormat2["JSON_LD"] = "JSON_LD";
55
55
  CredentialDocumentFormat2["JWT"] = "JWT";
56
56
  CredentialDocumentFormat2["SD_JWT"] = "SD_JWT";
57
57
  CredentialDocumentFormat2["MSO_MDOC"] = "MSO_MDOC";
58
58
  return CredentialDocumentFormat2;
59
- }({});
59
+ })({});
60
60
  (function(CredentialDocumentFormat2) {
61
61
  function fromSpecValue(credentialFormat) {
62
62
  const format = credentialFormat.toLowerCase();
@@ -89,19 +89,19 @@ var CredentialDocumentFormat = /* @__PURE__ */ function(CredentialDocumentFormat
89
89
  __name(toSpecValue, "toSpecValue");
90
90
  CredentialDocumentFormat2.toSpecValue = toSpecValue;
91
91
  })(CredentialDocumentFormat || (CredentialDocumentFormat = {}));
92
- var CredentialCorrelationType = /* @__PURE__ */ function(CredentialCorrelationType2) {
92
+ var CredentialCorrelationType = /* @__PURE__ */ (function(CredentialCorrelationType2) {
93
93
  CredentialCorrelationType2["DID"] = "DID";
94
94
  CredentialCorrelationType2["X509_SAN"] = "X509_SAN";
95
95
  CredentialCorrelationType2["KID"] = "KID";
96
96
  CredentialCorrelationType2["URL"] = "URL";
97
97
  return CredentialCorrelationType2;
98
- }({});
99
- var CredentialStateType = /* @__PURE__ */ function(CredentialStateType2) {
98
+ })({});
99
+ var CredentialStateType = /* @__PURE__ */ (function(CredentialStateType2) {
100
100
  CredentialStateType2["REVOKED"] = "REVOKED";
101
101
  CredentialStateType2["VERIFIED"] = "VERIFIED";
102
102
  CredentialStateType2["EXPIRED"] = "EXPIRED";
103
103
  return CredentialStateType2;
104
- }({});
104
+ })({});
105
105
 
106
106
  // src/entities/contact/IdentityEntity.ts
107
107
  import { BaseEntity as BaseEntity8, CreateDateColumn as CreateDateColumn7, Entity as Entity10, PrimaryGeneratedColumn as PrimaryGeneratedColumn10, UpdateDateColumn as UpdateDateColumn7, OneToOne as OneToOne4, JoinColumn as JoinColumn5, ManyToOne as ManyToOne7, Column as Column9, OneToMany as OneToMany4, BeforeInsert as BeforeInsert10, BeforeUpdate as BeforeUpdate10 } from "typeorm";
@@ -4120,7 +4120,7 @@ _ts_decorate34([
4120
4120
  Column31({
4121
4121
  name: "definition_payload",
4122
4122
  type: "text",
4123
- nullable: false,
4123
+ nullable: true,
4124
4124
  unique: false
4125
4125
  }),
4126
4126
  IsNotEmpty12({
@@ -6772,6 +6772,7 @@ import { In as In4 } from "typeorm";
6772
6772
  import Debug7 from "debug";
6773
6773
 
6774
6774
  // src/utils/presentationDefinition/MappingUtils.ts
6775
+ import { DcqlQuery } from "dcql";
6775
6776
  import * as blakepkg from "blakejs";
6776
6777
  var presentationDefinitionItemFrom = /* @__PURE__ */ __name((entity) => {
6777
6778
  const result = {
@@ -6782,10 +6783,20 @@ var presentationDefinitionItemFrom = /* @__PURE__ */ __name((entity) => {
6782
6783
  name: entity.name,
6783
6784
  purpose: entity.purpose,
6784
6785
  definitionPayload: JSON.parse(entity.definitionPayload),
6785
- dcqlPayload: JSON.parse(entity.dcqlPayload),
6786
+ ...entity.dcqlPayload && {
6787
+ dcqlPayload: {
6788
+ queryId: entity.definitionId,
6789
+ name: entity.name,
6790
+ defaultPurpose: entity.purpose,
6791
+ dcqlQuery: DcqlQuery.parse(JSON.parse(entity.dcqlPayload))
6792
+ }
6793
+ },
6786
6794
  createdAt: entity.createdAt,
6787
6795
  lastUpdatedAt: entity.lastUpdatedAt
6788
6796
  };
6797
+ if (result.dcqlPayload?.dcqlQuery) {
6798
+ DcqlQuery.validate(result.dcqlPayload?.dcqlQuery);
6799
+ }
6789
6800
  return replaceNullWithUndefined(result);
6790
6801
  }, "presentationDefinitionItemFrom");
6791
6802
  var presentationDefinitionEntityItemFrom = /* @__PURE__ */ __name((item) => {
@@ -6795,8 +6806,14 @@ var presentationDefinitionEntityItemFrom = /* @__PURE__ */ __name((item) => {
6795
6806
  entity.version = item.version;
6796
6807
  entity.name = item.name;
6797
6808
  entity.purpose = item.purpose;
6798
- entity.definitionPayload = JSON.stringify(item.definitionPayload);
6799
- entity.dcqlPayload = JSON.stringify(item.dcqlPayload);
6809
+ if (item.definitionPayload) {
6810
+ entity.definitionPayload = JSON.stringify(item.definitionPayload);
6811
+ }
6812
+ if (item.dcqlPayload) {
6813
+ const dcqlQuery = DcqlQuery.parse(item.dcqlPayload.dcqlQuery);
6814
+ DcqlQuery.validate(dcqlQuery);
6815
+ entity.dcqlPayload = JSON.stringify(item.dcqlPayload.dcqlQuery);
6816
+ }
6800
6817
  return entity;
6801
6818
  }, "presentationDefinitionEntityItemFrom");
6802
6819
  function hashPayload(payload) {
@@ -6804,13 +6821,24 @@ function hashPayload(payload) {
6804
6821
  }
6805
6822
  __name(hashPayload, "hashPayload");
6806
6823
  function isPresentationDefinitionEqual(base, compare) {
6807
- if (base.definitionId !== compare.definitionId || base.tenantId != compare.tenantId || base.version !== compare.version || base.name != compare.name || base.purpose != compare.purpose) {
6824
+ if (base.definitionId !== compare.definitionId || base.tenantId !== compare.tenantId || base.version !== compare.version || base.name !== compare.name || base.purpose !== compare.purpose) {
6825
+ return false;
6826
+ }
6827
+ if (base.dcqlPayload && compare.dcqlPayload) {
6828
+ if (hashPayload(base.dcqlPayload) !== hashPayload(compare.dcqlPayload)) {
6829
+ return false;
6830
+ }
6831
+ } else if (base.dcqlPayload || compare.dcqlPayload) {
6808
6832
  return false;
6809
6833
  }
6810
6834
  if (base.definitionPayload && compare.definitionPayload) {
6811
- return hashPayload(base.definitionPayload) === hashPayload(compare.definitionPayload);
6835
+ if (hashPayload(base.definitionPayload) !== hashPayload(compare.definitionPayload)) {
6836
+ return false;
6837
+ }
6838
+ } else if (base.definitionPayload || compare.definitionPayload) {
6839
+ return false;
6812
6840
  }
6813
- return false;
6841
+ return true;
6814
6842
  }
6815
6843
  __name(isPresentationDefinitionEqual, "isPresentationDefinitionEqual");
6816
6844
 
@@ -6899,7 +6927,12 @@ var PDStore = class extends AbstractPDStore {
6899
6927
  updatedEntity.version = item.version;
6900
6928
  updatedEntity.name = item.name;
6901
6929
  updatedEntity.purpose = item.purpose;
6902
- updatedEntity.definitionPayload = JSON.stringify(item.definitionPayload);
6930
+ if (item.definitionPayload) {
6931
+ updatedEntity.definitionPayload = JSON.stringify(item.definitionPayload);
6932
+ }
6933
+ if (item.dcqlPayload) {
6934
+ updatedEntity.dcqlPayload = JSON.stringify(item.dcqlPayload.dcqlQuery);
6935
+ }
6903
6936
  debug7("Updating presentation definition entity", updatedEntity);
6904
6937
  const updateResult = await pdRepository.save(updatedEntity, {
6905
6938
  transaction: true
@@ -7775,21 +7808,105 @@ var CreateBitstringStatusList1741895823000 = class {
7775
7808
  }
7776
7809
  };
7777
7810
 
7778
- // src/migrations/generic/2-CreateIssuanceBranding.ts
7811
+ // src/migrations/generic/13-UpdatePresentationDefinitionItemNullable.ts
7779
7812
  import Debug12 from "debug";
7813
+
7814
+ // src/migrations/postgres/1756975509000-UpdatePresentationDefinitionItemNullable.ts
7815
+ var UpdatePresentationDefinitionItemNullablePG1741895824000 = class {
7816
+ static {
7817
+ __name(this, "UpdatePresentationDefinitionItemNullablePG1741895824000");
7818
+ }
7819
+ name = "UpdatePresentationDefinitionItemNullable1741895824000";
7820
+ async up(queryRunner) {
7821
+ await queryRunner.query(`ALTER TABLE "PresentationDefinitionItem" ALTER COLUMN "definition_payload" DROP NOT NULL`);
7822
+ }
7823
+ async down(queryRunner) {
7824
+ await queryRunner.query(`ALTER TABLE "PresentationDefinitionItem" ALTER COLUMN "definition_payload" SET NOT NULL`);
7825
+ }
7826
+ };
7827
+
7828
+ // src/migrations/sqlite/1756975340000-UpdatePresentationDefinitionItemNullable.ts
7829
+ var UpdatePresentationDefinitionItemNullableSqlite1756975340000 = class {
7830
+ static {
7831
+ __name(this, "UpdatePresentationDefinitionItemNullableSqlite1756975340000");
7832
+ }
7833
+ name = "UpdatePresentationDefinitionItemNullable1756975340000";
7834
+ async up(queryRunner) {
7835
+ await queryRunner.query(`
7836
+ CREATE TABLE "temporary_PresentationDefinitionItem" (
7837
+ "id" varchar PRIMARY KEY NOT NULL,
7838
+ "definition_id" varchar(255) NOT NULL,
7839
+ "version" varchar(255) NOT NULL,
7840
+ "tenant_id" varchar(255),
7841
+ "purpose" varchar(255),
7842
+ "name" varchar(255),
7843
+ "definition_payload" text,
7844
+ "dcql_payload" text,
7845
+ "created_at" datetime NOT NULL DEFAULT (datetime('now')),
7846
+ "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')),
7847
+ CONSTRAINT "UQ_PresentationDefinitionItem_definition_id_version" UNIQUE ("definition_id", "version")
7848
+ )
7849
+ `);
7850
+ await queryRunner.query(`
7851
+ INSERT INTO "temporary_PresentationDefinitionItem"(
7852
+ "id", "definition_id", "version", "tenant_id", "purpose", "name",
7853
+ "definition_payload", "dcql_payload", "created_at", "last_updated_at"
7854
+ )
7855
+ SELECT
7856
+ "id", "definition_id", "version", "tenant_id", "purpose", "name",
7857
+ "definition_payload", "dcql_payload", "created_at", "last_updated_at"
7858
+ FROM "PresentationDefinitionItem"
7859
+ `);
7860
+ await queryRunner.query(`DROP TABLE "PresentationDefinitionItem"`);
7861
+ await queryRunner.query(`ALTER TABLE "temporary_PresentationDefinitionItem" RENAME TO "PresentationDefinitionItem"`);
7862
+ await queryRunner.query(`CREATE INDEX "IDX_PresentationDefinitionItem_version" ON "PresentationDefinitionItem" ("version")`);
7863
+ }
7864
+ async down(queryRunner) {
7865
+ await queryRunner.query(`
7866
+ CREATE TABLE "temporary_PresentationDefinitionItem" (
7867
+ "id" varchar PRIMARY KEY NOT NULL,
7868
+ "definition_id" varchar(255) NOT NULL,
7869
+ "version" varchar(255) NOT NULL,
7870
+ "tenant_id" varchar(255),
7871
+ "purpose" varchar(255),
7872
+ "name" varchar(255),
7873
+ "definition_payload" text NOT NULL,
7874
+ "dcql_payload" text,
7875
+ "created_at" datetime NOT NULL DEFAULT (datetime('now')),
7876
+ "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')),
7877
+ CONSTRAINT "UQ_PresentationDefinitionItem_definition_id_version" UNIQUE ("definition_id", "version")
7878
+ )
7879
+ `);
7880
+ await queryRunner.query(`
7881
+ INSERT INTO "temporary_PresentationDefinitionItem"(
7882
+ "id", "definition_id", "version", "tenant_id", "purpose", "name",
7883
+ "definition_payload", "dcql_payload", "created_at", "last_updated_at"
7884
+ )
7885
+ SELECT
7886
+ "id", "definition_id", "version", "tenant_id", "purpose", "name",
7887
+ "definition_payload", "dcql_payload", "created_at", "last_updated_at"
7888
+ FROM "PresentationDefinitionItem"
7889
+ `);
7890
+ await queryRunner.query(`DROP TABLE "PresentationDefinitionItem"`);
7891
+ await queryRunner.query(`ALTER TABLE "temporary_PresentationDefinitionItem" RENAME TO "PresentationDefinitionItem"`);
7892
+ await queryRunner.query(`CREATE INDEX "IDX_PresentationDefinitionItem_version" ON "PresentationDefinitionItem" ("version")`);
7893
+ }
7894
+ };
7895
+
7896
+ // src/migrations/generic/13-UpdatePresentationDefinitionItemNullable.ts
7780
7897
  var debug12 = Debug12("sphereon:ssi-sdk:migrations");
7781
- var CreateIssuanceBranding1659463079429 = class {
7898
+ var UpdatePresentationDefinitionItemNullable1741895824000 = class {
7782
7899
  static {
7783
- __name(this, "CreateIssuanceBranding1659463079429");
7900
+ __name(this, "UpdatePresentationDefinitionItemNullable1741895824000");
7784
7901
  }
7785
- name = "CreateIssuanceBranding1659463079429";
7902
+ name = "UpdatePresentationDefinitionItemNullable1741895824000";
7786
7903
  async up(queryRunner) {
7787
- debug12("migration: creating issuance branding tables");
7904
+ debug12("migration: updating presentation definition item nullable fields");
7788
7905
  const dbType = queryRunner.connection.driver.options.type;
7789
7906
  switch (dbType) {
7790
7907
  case "postgres": {
7791
7908
  debug12("using postgres migration file");
7792
- const mig = new CreateIssuanceBranding1685628974232();
7909
+ const mig = new UpdatePresentationDefinitionItemNullablePG1741895824000();
7793
7910
  await mig.up(queryRunner);
7794
7911
  debug12("Migration statements executed");
7795
7912
  return;
@@ -7798,7 +7915,7 @@ var CreateIssuanceBranding1659463079429 = class {
7798
7915
  case "expo":
7799
7916
  case "react-native": {
7800
7917
  debug12("using sqlite/react-native migration file");
7801
- const mig = new CreateIssuanceBranding1685628973231();
7918
+ const mig = new UpdatePresentationDefinitionItemNullableSqlite1756975340000();
7802
7919
  await mig.up(queryRunner);
7803
7920
  debug12("Migration statements executed");
7804
7921
  return;
@@ -7808,12 +7925,12 @@ var CreateIssuanceBranding1659463079429 = class {
7808
7925
  }
7809
7926
  }
7810
7927
  async down(queryRunner) {
7811
- debug12("migration: reverting issuance branding tables");
7928
+ debug12("migration: reverting presentation definition item nullable fields");
7812
7929
  const dbType = queryRunner.connection.driver.options.type;
7813
7930
  switch (dbType) {
7814
7931
  case "postgres": {
7815
7932
  debug12("using postgres migration file");
7816
- const mig = new CreateIssuanceBranding1685628974232();
7933
+ const mig = new UpdatePresentationDefinitionItemNullablePG1741895824000();
7817
7934
  await mig.down(queryRunner);
7818
7935
  debug12("Migration statements executed");
7819
7936
  return;
@@ -7822,7 +7939,7 @@ var CreateIssuanceBranding1659463079429 = class {
7822
7939
  case "expo":
7823
7940
  case "react-native": {
7824
7941
  debug12("using sqlite/react-native migration file");
7825
- const mig = new CreateIssuanceBranding1685628973231();
7942
+ const mig = new UpdatePresentationDefinitionItemNullableSqlite1756975340000();
7826
7943
  await mig.down(queryRunner);
7827
7944
  debug12("Migration statements executed");
7828
7945
  return;
@@ -7833,8 +7950,66 @@ var CreateIssuanceBranding1659463079429 = class {
7833
7950
  }
7834
7951
  };
7835
7952
 
7836
- // src/migrations/generic/3-CreateContacts.ts
7953
+ // src/migrations/generic/2-CreateIssuanceBranding.ts
7837
7954
  import Debug13 from "debug";
7955
+ var debug13 = Debug13("sphereon:ssi-sdk:migrations");
7956
+ var CreateIssuanceBranding1659463079429 = class {
7957
+ static {
7958
+ __name(this, "CreateIssuanceBranding1659463079429");
7959
+ }
7960
+ name = "CreateIssuanceBranding1659463079429";
7961
+ async up(queryRunner) {
7962
+ debug13("migration: creating issuance branding tables");
7963
+ const dbType = queryRunner.connection.driver.options.type;
7964
+ switch (dbType) {
7965
+ case "postgres": {
7966
+ debug13("using postgres migration file");
7967
+ const mig = new CreateIssuanceBranding1685628974232();
7968
+ await mig.up(queryRunner);
7969
+ debug13("Migration statements executed");
7970
+ return;
7971
+ }
7972
+ case "sqlite":
7973
+ case "expo":
7974
+ case "react-native": {
7975
+ debug13("using sqlite/react-native migration file");
7976
+ const mig = new CreateIssuanceBranding1685628973231();
7977
+ await mig.up(queryRunner);
7978
+ debug13("Migration statements executed");
7979
+ return;
7980
+ }
7981
+ default:
7982
+ 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`);
7983
+ }
7984
+ }
7985
+ async down(queryRunner) {
7986
+ debug13("migration: reverting issuance branding tables");
7987
+ const dbType = queryRunner.connection.driver.options.type;
7988
+ switch (dbType) {
7989
+ case "postgres": {
7990
+ debug13("using postgres migration file");
7991
+ const mig = new CreateIssuanceBranding1685628974232();
7992
+ await mig.down(queryRunner);
7993
+ debug13("Migration statements executed");
7994
+ return;
7995
+ }
7996
+ case "sqlite":
7997
+ case "expo":
7998
+ case "react-native": {
7999
+ debug13("using sqlite/react-native migration file");
8000
+ const mig = new CreateIssuanceBranding1685628973231();
8001
+ await mig.down(queryRunner);
8002
+ debug13("Migration statements executed");
8003
+ return;
8004
+ }
8005
+ default:
8006
+ 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`);
8007
+ }
8008
+ }
8009
+ };
8010
+
8011
+ // src/migrations/generic/3-CreateContacts.ts
8012
+ import Debug14 from "debug";
7838
8013
 
7839
8014
  // src/migrations/sqlite/1690925872693-CreateContacts.ts
7840
8015
  var CreateContacts1690925872693 = class {
@@ -8055,30 +8230,30 @@ var CreateContacts1690925872592 = class {
8055
8230
  };
8056
8231
 
8057
8232
  // src/migrations/generic/3-CreateContacts.ts
8058
- var debug13 = Debug13("sphereon:ssi-sdk:migrations");
8233
+ var debug14 = Debug14("sphereon:ssi-sdk:migrations");
8059
8234
  var CreateContacts1690925872318 = class {
8060
8235
  static {
8061
8236
  __name(this, "CreateContacts1690925872318");
8062
8237
  }
8063
8238
  name = "CreateContacts1690925872318";
8064
8239
  async up(queryRunner) {
8065
- debug13("migration: creating contacts tables");
8240
+ debug14("migration: creating contacts tables");
8066
8241
  const dbType = queryRunner.connection.driver.options.type;
8067
8242
  switch (dbType) {
8068
8243
  case "postgres": {
8069
- debug13("using postgres migration file");
8244
+ debug14("using postgres migration file");
8070
8245
  const mig = new CreateContacts1690925872592();
8071
8246
  await mig.up(queryRunner);
8072
- debug13("Migration statements executed");
8247
+ debug14("Migration statements executed");
8073
8248
  return;
8074
8249
  }
8075
8250
  case "sqlite":
8076
8251
  case "expo":
8077
8252
  case "react-native": {
8078
- debug13("using sqlite/react-native migration file");
8253
+ debug14("using sqlite/react-native migration file");
8079
8254
  const mig = new CreateContacts1690925872693();
8080
8255
  await mig.up(queryRunner);
8081
- debug13("Migration statements executed");
8256
+ debug14("Migration statements executed");
8082
8257
  return;
8083
8258
  }
8084
8259
  default:
@@ -8086,23 +8261,23 @@ var CreateContacts1690925872318 = class {
8086
8261
  }
8087
8262
  }
8088
8263
  async down(queryRunner) {
8089
- debug13("migration: reverting contacts tables");
8264
+ debug14("migration: reverting contacts tables");
8090
8265
  const dbType = queryRunner.connection.driver.options.type;
8091
8266
  switch (dbType) {
8092
8267
  case "postgres": {
8093
- debug13("using postgres migration file");
8268
+ debug14("using postgres migration file");
8094
8269
  const mig = new CreateContacts1690925872592();
8095
8270
  await mig.down(queryRunner);
8096
- debug13("Migration statements executed");
8271
+ debug14("Migration statements executed");
8097
8272
  return;
8098
8273
  }
8099
8274
  case "sqlite":
8100
8275
  case "expo":
8101
8276
  case "react-native": {
8102
- debug13("using sqlite/react-native migration file");
8277
+ debug14("using sqlite/react-native migration file");
8103
8278
  const mig = new CreateContacts1690925872693();
8104
8279
  await mig.down(queryRunner);
8105
- debug13("Migration statements executed");
8280
+ debug14("Migration statements executed");
8106
8281
  return;
8107
8282
  }
8108
8283
  default:
@@ -8112,7 +8287,7 @@ var CreateContacts1690925872318 = class {
8112
8287
  };
8113
8288
 
8114
8289
  // src/migrations/generic/4-CreateStatusList.ts
8115
- import Debug14 from "debug";
8290
+ import Debug15 from "debug";
8116
8291
 
8117
8292
  // src/migrations/postgres/1693866470001-CreateStatusList.ts
8118
8293
  var CreateStatusList1693866470001 = class {
@@ -8318,53 +8493,53 @@ var UpdateStatusList1737110469000 = class {
8318
8493
  };
8319
8494
 
8320
8495
  // src/migrations/generic/4-CreateStatusList.ts
8321
- var debug14 = Debug14("sphereon:ssi-sdk:migrations");
8496
+ var debug15 = Debug15("sphereon:ssi-sdk:migrations");
8322
8497
  var CreateStatusList1693866470000 = class {
8323
8498
  static {
8324
8499
  __name(this, "CreateStatusList1693866470000");
8325
8500
  }
8326
8501
  name = "CreateStatusList1693866470000";
8327
8502
  async up(queryRunner) {
8328
- debug14("migration: creating issuance branding tables");
8503
+ debug15("migration: creating issuance branding tables");
8329
8504
  const dbType = queryRunner.connection.driver.options.type;
8330
8505
  if (dbType === "postgres") {
8331
- debug14("using postgres migration files");
8506
+ debug15("using postgres migration files");
8332
8507
  const createMig = new CreateStatusList1693866470001();
8333
8508
  await createMig.up(queryRunner);
8334
8509
  const updateMig = new UpdateStatusList1737110469001();
8335
8510
  const up = await updateMig.up(queryRunner);
8336
- debug14("Migration statements executed");
8511
+ debug15("Migration statements executed");
8337
8512
  return up;
8338
8513
  } else if (dbType === "sqlite" || dbType === "react-native" || dbType === "expo") {
8339
- debug14("using sqlite/react-native migration files");
8514
+ debug15("using sqlite/react-native migration files");
8340
8515
  const createMig = new CreateStatusList1693866470002();
8341
8516
  await createMig.up(queryRunner);
8342
8517
  const updateMig = new UpdateStatusList1737110469000();
8343
8518
  const up = await updateMig.up(queryRunner);
8344
- debug14("Migration statements executed");
8519
+ debug15("Migration statements executed");
8345
8520
  return up;
8346
8521
  } else {
8347
8522
  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`);
8348
8523
  }
8349
8524
  }
8350
8525
  async down(queryRunner) {
8351
- debug14("migration: reverting issuance branding tables");
8526
+ debug15("migration: reverting issuance branding tables");
8352
8527
  const dbType = queryRunner.connection.driver.options.type;
8353
8528
  if (dbType === "postgres") {
8354
- debug14("using postgres migration files");
8529
+ debug15("using postgres migration files");
8355
8530
  const updateMig = new UpdateStatusList1737110469001();
8356
8531
  await updateMig.down(queryRunner);
8357
8532
  const createMig = new CreateStatusList1693866470001();
8358
8533
  const down = await createMig.down(queryRunner);
8359
- debug14("Migration statements executed");
8534
+ debug15("Migration statements executed");
8360
8535
  return down;
8361
8536
  } else if (dbType === "sqlite" || dbType === "react-native" || dbType === "expo") {
8362
- debug14("using sqlite/react-native migration files");
8537
+ debug15("using sqlite/react-native migration files");
8363
8538
  const updateMig = new UpdateStatusList1737110469000();
8364
8539
  await updateMig.down(queryRunner);
8365
8540
  const createMig = new CreateStatusList1693866470002();
8366
8541
  const down = await createMig.down(queryRunner);
8367
- debug14("Migration statements executed");
8542
+ debug15("Migration statements executed");
8368
8543
  return down;
8369
8544
  } else {
8370
8545
  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`);
@@ -8373,7 +8548,7 @@ var CreateStatusList1693866470000 = class {
8373
8548
  };
8374
8549
 
8375
8550
  // src/migrations/generic/5-CreateAuditEvents.ts
8376
- import Debug15 from "debug";
8551
+ import Debug16 from "debug";
8377
8552
 
8378
8553
  // src/migrations/sqlite/1701634819487-CreateAuditEvents.ts
8379
8554
  var CreateAuditEvents1701634819487 = class {
@@ -8472,30 +8647,30 @@ var CreateAuditEvents1701634812183 = class {
8472
8647
  };
8473
8648
 
8474
8649
  // src/migrations/generic/5-CreateAuditEvents.ts
8475
- var debug15 = Debug15("sphereon:ssi-sdk:migrations");
8650
+ var debug16 = Debug16("sphereon:ssi-sdk:migrations");
8476
8651
  var CreateAuditEvents1701635835330 = class {
8477
8652
  static {
8478
8653
  __name(this, "CreateAuditEvents1701635835330");
8479
8654
  }
8480
8655
  name = "CreateAuditEvents1701635835330";
8481
8656
  async up(queryRunner) {
8482
- debug15("migration: creating audit events tables");
8657
+ debug16("migration: creating audit events tables");
8483
8658
  const dbType = queryRunner.connection.driver.options.type;
8484
8659
  switch (dbType) {
8485
8660
  case "postgres": {
8486
- debug15("using postgres migration file");
8661
+ debug16("using postgres migration file");
8487
8662
  const mig = new CreateAuditEvents1701634812183();
8488
8663
  await mig.up(queryRunner);
8489
- debug15("Migration statements executed");
8664
+ debug16("Migration statements executed");
8490
8665
  return;
8491
8666
  }
8492
8667
  case "sqlite":
8493
8668
  case "expo":
8494
8669
  case "react-native": {
8495
- debug15("using sqlite/react-native migration file");
8670
+ debug16("using sqlite/react-native migration file");
8496
8671
  const mig = new CreateAuditEvents1701634819487();
8497
8672
  await mig.up(queryRunner);
8498
- debug15("Migration statements executed");
8673
+ debug16("Migration statements executed");
8499
8674
  return;
8500
8675
  }
8501
8676
  default:
@@ -8503,23 +8678,23 @@ var CreateAuditEvents1701635835330 = class {
8503
8678
  }
8504
8679
  }
8505
8680
  async down(queryRunner) {
8506
- debug15("migration: reverting audit events tables");
8681
+ debug16("migration: reverting audit events tables");
8507
8682
  const dbType = queryRunner.connection.driver.options.type;
8508
8683
  switch (dbType) {
8509
8684
  case "postgres": {
8510
- debug15("using postgres migration file");
8685
+ debug16("using postgres migration file");
8511
8686
  const mig = new CreateAuditEvents1701634812183();
8512
8687
  await mig.down(queryRunner);
8513
- debug15("Migration statements executed");
8688
+ debug16("Migration statements executed");
8514
8689
  return;
8515
8690
  }
8516
8691
  case "sqlite":
8517
8692
  case "expo":
8518
8693
  case "react-native": {
8519
- debug15("using sqlite/react-native migration file");
8694
+ debug16("using sqlite/react-native migration file");
8520
8695
  const mig = new CreateAuditEvents1701634819487();
8521
8696
  await mig.down(queryRunner);
8522
- debug15("Migration statements executed");
8697
+ debug16("Migration statements executed");
8523
8698
  return;
8524
8699
  }
8525
8700
  default:
@@ -8529,7 +8704,7 @@ var CreateAuditEvents1701635835330 = class {
8529
8704
  };
8530
8705
 
8531
8706
  // src/migrations/generic/6-CreateDigitalCredential.ts
8532
- import Debug16 from "debug";
8707
+ import Debug17 from "debug";
8533
8708
 
8534
8709
  // src/migrations/postgres/1708525189001-CreateDigitalCredential.ts
8535
8710
  var CreateDigitalCredential1708525189001 = class {
@@ -8637,30 +8812,30 @@ var CreateDigitalCredential1708525189002 = class {
8637
8812
  };
8638
8813
 
8639
8814
  // src/migrations/generic/6-CreateDigitalCredential.ts
8640
- var debug16 = Debug16("sphereon:ssi-sdk:migrations");
8815
+ var debug17 = Debug17("sphereon:ssi-sdk:migrations");
8641
8816
  var CreateDigitalCredential1708525189000 = class {
8642
8817
  static {
8643
8818
  __name(this, "CreateDigitalCredential1708525189000");
8644
8819
  }
8645
8820
  name = "CreateDigitalCredential1708525189000";
8646
8821
  async up(queryRunner) {
8647
- debug16("migration: creating DigitalCredential tables");
8822
+ debug17("migration: creating DigitalCredential tables");
8648
8823
  const dbType = queryRunner.connection.driver.options.type;
8649
8824
  switch (dbType) {
8650
8825
  case "postgres": {
8651
- debug16("using postgres migration file for DigitalCredential");
8826
+ debug17("using postgres migration file for DigitalCredential");
8652
8827
  const mig = new CreateDigitalCredential1708525189001();
8653
8828
  await mig.up(queryRunner);
8654
- debug16("Postgres Migration statements for DigitalCredential executed");
8829
+ debug17("Postgres Migration statements for DigitalCredential executed");
8655
8830
  return;
8656
8831
  }
8657
8832
  case "sqlite":
8658
8833
  case "expo":
8659
8834
  case "react-native": {
8660
- debug16("using sqlite/react-native migration file for DigitalCredential");
8835
+ debug17("using sqlite/react-native migration file for DigitalCredential");
8661
8836
  const mig = new CreateDigitalCredential1708525189002();
8662
8837
  await mig.up(queryRunner);
8663
- debug16("SQLite Migration statements for DigitalCredential executed");
8838
+ debug17("SQLite Migration statements for DigitalCredential executed");
8664
8839
  return;
8665
8840
  }
8666
8841
  default:
@@ -8668,23 +8843,23 @@ var CreateDigitalCredential1708525189000 = class {
8668
8843
  }
8669
8844
  }
8670
8845
  async down(queryRunner) {
8671
- debug16("migration: reverting DigitalCredential tables");
8846
+ debug17("migration: reverting DigitalCredential tables");
8672
8847
  const dbType = queryRunner.connection.driver.options.type;
8673
8848
  switch (dbType) {
8674
8849
  case "postgres": {
8675
- debug16("using postgres migration file for DigitalCredential");
8850
+ debug17("using postgres migration file for DigitalCredential");
8676
8851
  const mig = new CreateDigitalCredential1708525189001();
8677
8852
  await mig.down(queryRunner);
8678
- debug16("Postgres Migration statements for DigitalCredential reverted");
8853
+ debug17("Postgres Migration statements for DigitalCredential reverted");
8679
8854
  return;
8680
8855
  }
8681
8856
  case "sqlite":
8682
8857
  case "expo":
8683
8858
  case "react-native": {
8684
- debug16("using sqlite/react-native migration file for DigitalCredential");
8859
+ debug17("using sqlite/react-native migration file for DigitalCredential");
8685
8860
  const mig = new CreateDigitalCredential1708525189002();
8686
8861
  await mig.down(queryRunner);
8687
- debug16("SQLite Migration statements for DigitalCredential reverted");
8862
+ debug17("SQLite Migration statements for DigitalCredential reverted");
8688
8863
  return;
8689
8864
  }
8690
8865
  default:
@@ -8694,7 +8869,7 @@ var CreateDigitalCredential1708525189000 = class {
8694
8869
  };
8695
8870
 
8696
8871
  // src/migrations/generic/7-CreateMachineStateStore.ts
8697
- import Debug17 from "debug";
8872
+ import Debug18 from "debug";
8698
8873
 
8699
8874
  // src/migrations/postgres/1708797018115-CreateMachineStateStore.ts
8700
8875
  var CreateMachineStateStore1708797018115 = class {
@@ -8756,30 +8931,30 @@ var CreateMachineStateStore1708796002272 = class {
8756
8931
  };
8757
8932
 
8758
8933
  // src/migrations/generic/7-CreateMachineStateStore.ts
8759
- var debug17 = Debug17("sphereon:ssi-sdk:migrations");
8934
+ var debug18 = Debug18("sphereon:ssi-sdk:migrations");
8760
8935
  var CreateMachineStateStore1708098041262 = class {
8761
8936
  static {
8762
8937
  __name(this, "CreateMachineStateStore1708098041262");
8763
8938
  }
8764
8939
  name = "CreateMachineStateStore1708098041262";
8765
8940
  async up(queryRunner) {
8766
- debug17("migration: creating machine state tables");
8941
+ debug18("migration: creating machine state tables");
8767
8942
  const dbType = queryRunner.connection.driver.options.type;
8768
8943
  switch (dbType) {
8769
8944
  case "postgres": {
8770
- debug17("using postgres migration file");
8945
+ debug18("using postgres migration file");
8771
8946
  const mig = new CreateMachineStateStore1708797018115();
8772
8947
  await mig.up(queryRunner);
8773
- debug17("Migration statements executed");
8948
+ debug18("Migration statements executed");
8774
8949
  return;
8775
8950
  }
8776
8951
  case "sqlite":
8777
8952
  case "expo":
8778
8953
  case "react-native": {
8779
- debug17("using sqlite/react-native migration file");
8954
+ debug18("using sqlite/react-native migration file");
8780
8955
  const mig = new CreateMachineStateStore1708796002272();
8781
8956
  await mig.up(queryRunner);
8782
- debug17("Migration statements executed");
8957
+ debug18("Migration statements executed");
8783
8958
  return;
8784
8959
  }
8785
8960
  default:
@@ -8787,23 +8962,23 @@ var CreateMachineStateStore1708098041262 = class {
8787
8962
  }
8788
8963
  }
8789
8964
  async down(queryRunner) {
8790
- debug17("migration: reverting machine state tables");
8965
+ debug18("migration: reverting machine state tables");
8791
8966
  const dbType = queryRunner.connection.driver.options.type;
8792
8967
  switch (dbType) {
8793
8968
  case "postgres": {
8794
- debug17("using postgres migration file");
8969
+ debug18("using postgres migration file");
8795
8970
  const mig = new CreateMachineStateStore1708797018115();
8796
8971
  await mig.down(queryRunner);
8797
- debug17("Migration statements executed");
8972
+ debug18("Migration statements executed");
8798
8973
  return;
8799
8974
  }
8800
8975
  case "sqlite":
8801
8976
  case "expo":
8802
8977
  case "react-native": {
8803
- debug17("using sqlite/react-native migration file");
8978
+ debug18("using sqlite/react-native migration file");
8804
8979
  const mig = new CreateMachineStateStore1708796002272();
8805
8980
  await mig.down(queryRunner);
8806
- debug17("Migration statements executed");
8981
+ debug18("Migration statements executed");
8807
8982
  return;
8808
8983
  }
8809
8984
  default:
@@ -8813,7 +8988,7 @@ var CreateMachineStateStore1708098041262 = class {
8813
8988
  };
8814
8989
 
8815
8990
  // src/migrations/generic/8-CreateContacts.ts
8816
- import Debug18 from "debug";
8991
+ import Debug19 from "debug";
8817
8992
 
8818
8993
  // src/migrations/postgres/1710438363001-CreateContacts.ts
8819
8994
  var CreateContacts1710438363001 = class {
@@ -8927,30 +9102,30 @@ var CreateContacts1710438363002 = class {
8927
9102
  };
8928
9103
 
8929
9104
  // src/migrations/generic/8-CreateContacts.ts
8930
- var debug18 = Debug18("sphereon:ssi-sdk:migrations");
9105
+ var debug19 = Debug19("sphereon:ssi-sdk:migrations");
8931
9106
  var CreateContacts1708525189000 = class {
8932
9107
  static {
8933
9108
  __name(this, "CreateContacts1708525189000");
8934
9109
  }
8935
9110
  name = "CreateContacts1708525189000";
8936
9111
  async up(queryRunner) {
8937
- debug18("migration: updating contact tables");
9112
+ debug19("migration: updating contact tables");
8938
9113
  const dbType = queryRunner.connection.driver.options.type;
8939
9114
  switch (dbType) {
8940
9115
  case "postgres": {
8941
- debug18("using postgres migration file");
9116
+ debug19("using postgres migration file");
8942
9117
  const mig = new CreateContacts1710438363001();
8943
9118
  await mig.up(queryRunner);
8944
- debug18("Migration statements executed");
9119
+ debug19("Migration statements executed");
8945
9120
  return;
8946
9121
  }
8947
9122
  case "sqlite":
8948
9123
  case "expo":
8949
9124
  case "react-native": {
8950
- debug18("using sqlite/react-native migration file");
9125
+ debug19("using sqlite/react-native migration file");
8951
9126
  const mig = new CreateContacts1710438363002();
8952
9127
  await mig.up(queryRunner);
8953
- debug18("Migration statements executed");
9128
+ debug19("Migration statements executed");
8954
9129
  return;
8955
9130
  }
8956
9131
  default:
@@ -8958,23 +9133,23 @@ var CreateContacts1708525189000 = class {
8958
9133
  }
8959
9134
  }
8960
9135
  async down(queryRunner) {
8961
- debug18("migration: reverting machine state tables");
9136
+ debug19("migration: reverting machine state tables");
8962
9137
  const dbType = queryRunner.connection.driver.options.type;
8963
9138
  switch (dbType) {
8964
9139
  case "postgres": {
8965
- debug18("using postgres migration file");
9140
+ debug19("using postgres migration file");
8966
9141
  const mig = new CreateContacts1710438363001();
8967
9142
  await mig.down(queryRunner);
8968
- debug18("Migration statements executed");
9143
+ debug19("Migration statements executed");
8969
9144
  return;
8970
9145
  }
8971
9146
  case "sqlite":
8972
9147
  case "expo":
8973
9148
  case "react-native": {
8974
- debug18("using sqlite/react-native migration file");
9149
+ debug19("using sqlite/react-native migration file");
8975
9150
  const mig = new CreateContacts1710438363002();
8976
9151
  await mig.down(queryRunner);
8977
- debug18("Migration statements executed");
9152
+ debug19("Migration statements executed");
8978
9153
  return;
8979
9154
  }
8980
9155
  default:
@@ -8984,7 +9159,7 @@ var CreateContacts1708525189000 = class {
8984
9159
  };
8985
9160
 
8986
9161
  // src/migrations/generic/9-CreateContacts.ts
8987
- import Debug19 from "debug";
9162
+ import Debug20 from "debug";
8988
9163
 
8989
9164
  // src/migrations/postgres/1715761125001-CreateContacts.ts
8990
9165
  var CreateContacts1715761125001 = class {
@@ -9096,30 +9271,30 @@ var CreateContacts1715761125002 = class {
9096
9271
  };
9097
9272
 
9098
9273
  // src/migrations/generic/9-CreateContacts.ts
9099
- var debug19 = Debug19("sphereon:ssi-sdk:migrations");
9274
+ var debug20 = Debug20("sphereon:ssi-sdk:migrations");
9100
9275
  var CreateContacts1715761125000 = class {
9101
9276
  static {
9102
9277
  __name(this, "CreateContacts1715761125000");
9103
9278
  }
9104
9279
  name = "CreateContacts1715761125000";
9105
9280
  async up(queryRunner) {
9106
- debug19("migration: updating contact tables");
9281
+ debug20("migration: updating contact tables");
9107
9282
  const dbType = queryRunner.connection.driver.options.type;
9108
9283
  switch (dbType) {
9109
9284
  case "postgres": {
9110
- debug19("using postgres migration file");
9285
+ debug20("using postgres migration file");
9111
9286
  const mig = new CreateContacts1715761125001();
9112
9287
  await mig.up(queryRunner);
9113
- debug19("Migration statements executed");
9288
+ debug20("Migration statements executed");
9114
9289
  return;
9115
9290
  }
9116
9291
  case "sqlite":
9117
9292
  case "expo":
9118
9293
  case "react-native": {
9119
- debug19("using sqlite/react-native migration file");
9294
+ debug20("using sqlite/react-native migration file");
9120
9295
  const mig = new CreateContacts1715761125002();
9121
9296
  await mig.up(queryRunner);
9122
- debug19("Migration statements executed");
9297
+ debug20("Migration statements executed");
9123
9298
  return;
9124
9299
  }
9125
9300
  default:
@@ -9127,23 +9302,23 @@ var CreateContacts1715761125000 = class {
9127
9302
  }
9128
9303
  }
9129
9304
  async down(queryRunner) {
9130
- debug19("migration: reverting machine state tables");
9305
+ debug20("migration: reverting machine state tables");
9131
9306
  const dbType = queryRunner.connection.driver.options.type;
9132
9307
  switch (dbType) {
9133
9308
  case "postgres": {
9134
- debug19("using postgres migration file");
9309
+ debug20("using postgres migration file");
9135
9310
  const mig = new CreateContacts1715761125001();
9136
9311
  await mig.down(queryRunner);
9137
- debug19("Migration statements executed");
9312
+ debug20("Migration statements executed");
9138
9313
  return;
9139
9314
  }
9140
9315
  case "sqlite":
9141
9316
  case "expo":
9142
9317
  case "react-native": {
9143
- debug19("using sqlite/react-native migration file");
9318
+ debug20("using sqlite/react-native migration file");
9144
9319
  const mig = new CreateContacts1715761125002();
9145
9320
  await mig.down(queryRunner);
9146
- debug19("Migration statements executed");
9321
+ debug20("Migration statements executed");
9147
9322
  return;
9148
9323
  }
9149
9324
  default:
@@ -9178,7 +9353,8 @@ var DataStoreMachineStateMigrations = [
9178
9353
  CreateMachineStateStore1708098041262
9179
9354
  ];
9180
9355
  var DataStorePresentationDefinitionMigrations = [
9181
- CreatePresentationDefinitions1716533767523
9356
+ CreatePresentationDefinitions1716533767523,
9357
+ UpdatePresentationDefinitionItemNullable1741895824000
9182
9358
  ];
9183
9359
  var DataStoreMigrations = [
9184
9360
  ...DataStoreContactMigrations,