@sphereon/ssi-sdk.data-store 0.36.1-feature.vdx24.einvoice.inbox.127 → 0.36.1-feature.vdx24.einvoice.inbox.138

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
@@ -111,6 +111,7 @@ __export(index_exports, {
111
111
  credentialBrandingFrom: () => credentialBrandingFrom,
112
112
  credentialClaimsEntityFrom: () => credentialClaimsEntityFrom,
113
113
  credentialLocaleBrandingEntityFrom: () => credentialLocaleBrandingEntityFrom,
114
+ credentialLocaleBrandingFromEntity: () => credentialLocaleBrandingFromEntity,
114
115
  dcqlQueryEntityItemFrom: () => dcqlQueryEntityItemFrom,
115
116
  dcqlQueryItemFrom: () => dcqlQueryItemFrom,
116
117
  didAuthConfigEntityFrom: () => didAuthConfigEntityFrom,
@@ -3034,6 +3035,19 @@ var import_typeorm26 = require("typeorm");
3034
3035
  // src/entities/issuanceBranding/CredentialLocaleBrandingEntity.ts
3035
3036
  var import_typeorm25 = require("typeorm");
3036
3037
 
3038
+ // src/utils/issuanceBranding/HashUtils.ts
3039
+ var FNV_PRIME = 0x100000001b3n;
3040
+ var OFFSET_BASIS = 0xcbf29ce484222325n;
3041
+ function computeCompactHash(input) {
3042
+ let hash = OFFSET_BASIS;
3043
+ for (let i = 0; i < input.length; i++) {
3044
+ hash ^= BigInt(input.charCodeAt(i));
3045
+ hash = hash * FNV_PRIME & 0xffffffffffffffffn;
3046
+ }
3047
+ return hash.toString(36);
3048
+ }
3049
+ __name(computeCompactHash, "computeCompactHash");
3050
+
3037
3051
  // src/entities/issuanceBranding/CredentialClaimsEntity.ts
3038
3052
  var import_class_validator16 = require("class-validator");
3039
3053
  var import_typeorm24 = require("typeorm");
@@ -3138,6 +3152,10 @@ var CredentialLocaleBrandingEntity = class extends BaseLocaleBrandingEntity {
3138
3152
  credentialBranding;
3139
3153
  claims;
3140
3154
  credentialBrandingId;
3155
+ state;
3156
+ setState() {
3157
+ this.state = computeCredentialLocaleBrandingState(this);
3158
+ }
3141
3159
  };
3142
3160
  _ts_decorate26([
3143
3161
  (0, import_typeorm25.ManyToOne)(() => CredentialBrandingEntity, (credentialBranding) => credentialBranding.localeBranding, {
@@ -3167,6 +3185,21 @@ _ts_decorate26([
3167
3185
  }),
3168
3186
  _ts_metadata25("design:type", String)
3169
3187
  ], CredentialLocaleBrandingEntity.prototype, "credentialBrandingId", void 0);
3188
+ _ts_decorate26([
3189
+ (0, import_typeorm25.Column)("varchar", {
3190
+ name: "state",
3191
+ length: 255,
3192
+ nullable: false
3193
+ }),
3194
+ _ts_metadata25("design:type", String)
3195
+ ], CredentialLocaleBrandingEntity.prototype, "state", void 0);
3196
+ _ts_decorate26([
3197
+ (0, import_typeorm25.BeforeInsert)(),
3198
+ (0, import_typeorm25.BeforeUpdate)(),
3199
+ _ts_metadata25("design:type", Function),
3200
+ _ts_metadata25("design:paramtypes", []),
3201
+ _ts_metadata25("design:returntype", void 0)
3202
+ ], CredentialLocaleBrandingEntity.prototype, "setState", null);
3170
3203
  CredentialLocaleBrandingEntity = _ts_decorate26([
3171
3204
  (0, import_typeorm25.ChildEntity)("CredentialLocaleBranding"),
3172
3205
  (0, import_typeorm25.Index)("IDX_CredentialLocaleBrandingEntity_credentialBranding_locale", [
@@ -3176,6 +3209,45 @@ CredentialLocaleBrandingEntity = _ts_decorate26([
3176
3209
  unique: true
3177
3210
  })
3178
3211
  ], CredentialLocaleBrandingEntity);
3212
+ var computeCredentialLocaleBrandingState = /* @__PURE__ */ __name((localeBranding) => {
3213
+ const sortedClaims = (localeBranding.claims ?? []).map((claim) => ({
3214
+ key: claim.key,
3215
+ name: claim.name
3216
+ })).sort((first, second) => first.key.localeCompare(second.key));
3217
+ const payload = {
3218
+ alias: localeBranding.alias ?? null,
3219
+ locale: localeBranding.locale ?? null,
3220
+ description: localeBranding.description ?? null,
3221
+ logo: localeBranding.logo ? {
3222
+ uri: localeBranding.logo.uri ?? null,
3223
+ dataUri: localeBranding.logo.dataUri ?? null,
3224
+ mediaType: localeBranding.logo.mediaType ?? null,
3225
+ alt: localeBranding.logo.alt ?? null,
3226
+ dimensions: localeBranding.logo.dimensions ? {
3227
+ width: localeBranding.logo.dimensions.width,
3228
+ height: localeBranding.logo.dimensions.height
3229
+ } : null
3230
+ } : null,
3231
+ background: localeBranding.background ? {
3232
+ color: localeBranding.background.color ?? null,
3233
+ image: localeBranding.background.image ? {
3234
+ uri: localeBranding.background.image.uri ?? null,
3235
+ dataUri: localeBranding.background.image.dataUri ?? null,
3236
+ mediaType: localeBranding.background.image.mediaType ?? null,
3237
+ alt: localeBranding.background.image.alt ?? null,
3238
+ dimensions: localeBranding.background.image.dimensions ? {
3239
+ width: localeBranding.background.image.dimensions.width,
3240
+ height: localeBranding.background.image.dimensions.height
3241
+ } : null
3242
+ } : null
3243
+ } : null,
3244
+ text: localeBranding.text ? {
3245
+ color: localeBranding.text.color ?? null
3246
+ } : null,
3247
+ claims: sortedClaims
3248
+ };
3249
+ return computeCompactHash(JSON.stringify(payload));
3250
+ }, "computeCredentialLocaleBrandingState");
3179
3251
 
3180
3252
  // src/entities/issuanceBranding/CredentialBrandingEntity.ts
3181
3253
  function _ts_decorate27(decorators, target, key, desc) {
@@ -3196,6 +3268,7 @@ var CredentialBrandingEntity = class extends import_typeorm26.BaseEntity {
3196
3268
  id;
3197
3269
  vcHash;
3198
3270
  issuerCorrelationId;
3271
+ state;
3199
3272
  localeBranding;
3200
3273
  createdAt;
3201
3274
  lastUpdatedAt;
@@ -3203,6 +3276,11 @@ var CredentialBrandingEntity = class extends import_typeorm26.BaseEntity {
3203
3276
  updateUpdatedDate() {
3204
3277
  this.lastUpdatedAt = /* @__PURE__ */ new Date();
3205
3278
  }
3279
+ setState() {
3280
+ if (this.localeBranding && Array.isArray(this.localeBranding)) {
3281
+ this.state = this.computeState();
3282
+ }
3283
+ }
3206
3284
  async validate() {
3207
3285
  const validation = await (0, import_class_validator17.validate)(this);
3208
3286
  if (validation.length > 0) {
@@ -3210,6 +3288,31 @@ var CredentialBrandingEntity = class extends import_typeorm26.BaseEntity {
3210
3288
  }
3211
3289
  return;
3212
3290
  }
3291
+ computeState() {
3292
+ const localeStates = (this.localeBranding ?? []).map((localeBranding) => ({
3293
+ locale: localeBranding.locale ?? "",
3294
+ alias: localeBranding.alias ?? "",
3295
+ id: localeBranding.id ?? "",
3296
+ state: computeCredentialLocaleBrandingState(localeBranding)
3297
+ }));
3298
+ localeStates.sort((first, second) => {
3299
+ const localeCompare = first.locale.localeCompare(second.locale);
3300
+ if (localeCompare !== 0) {
3301
+ return localeCompare;
3302
+ }
3303
+ const aliasCompare = first.alias.localeCompare(second.alias);
3304
+ if (aliasCompare !== 0) {
3305
+ return aliasCompare;
3306
+ }
3307
+ return first.id.localeCompare(second.id);
3308
+ });
3309
+ const payload = {
3310
+ issuerCorrelationId: this.issuerCorrelationId,
3311
+ vcHash: this.vcHash,
3312
+ localeBranding: localeStates.map((entry) => entry.state)
3313
+ };
3314
+ return computeCompactHash(JSON.stringify(payload));
3315
+ }
3213
3316
  };
3214
3317
  _ts_decorate27([
3215
3318
  (0, import_typeorm26.PrimaryGeneratedColumn)("uuid"),
@@ -3239,6 +3342,14 @@ _ts_decorate27([
3239
3342
  }),
3240
3343
  _ts_metadata26("design:type", String)
3241
3344
  ], CredentialBrandingEntity.prototype, "issuerCorrelationId", void 0);
3345
+ _ts_decorate27([
3346
+ (0, import_typeorm26.Column)("varchar", {
3347
+ name: "state",
3348
+ length: 255,
3349
+ nullable: false
3350
+ }),
3351
+ _ts_metadata26("design:type", String)
3352
+ ], CredentialBrandingEntity.prototype, "state", void 0);
3242
3353
  _ts_decorate27([
3243
3354
  (0, import_typeorm26.OneToMany)(() => CredentialLocaleBrandingEntity, (credentialLocaleBrandingEntity) => credentialLocaleBrandingEntity.credentialBranding, {
3244
3355
  cascade: true,
@@ -3274,6 +3385,13 @@ _ts_decorate27([
3274
3385
  _ts_metadata26("design:paramtypes", []),
3275
3386
  _ts_metadata26("design:returntype", void 0)
3276
3387
  ], CredentialBrandingEntity.prototype, "updateUpdatedDate", null);
3388
+ _ts_decorate27([
3389
+ (0, import_typeorm26.BeforeInsert)(),
3390
+ (0, import_typeorm26.BeforeUpdate)(),
3391
+ _ts_metadata26("design:type", Function),
3392
+ _ts_metadata26("design:paramtypes", []),
3393
+ _ts_metadata26("design:returntype", void 0)
3394
+ ], CredentialBrandingEntity.prototype, "setState", null);
3277
3395
  _ts_decorate27([
3278
3396
  (0, import_typeorm26.BeforeInsert)(),
3279
3397
  (0, import_typeorm26.BeforeUpdate)(),
@@ -3320,6 +3438,48 @@ var IssuerLocaleBrandingEntity = class extends BaseLocaleBrandingEntity {
3320
3438
  policyUri;
3321
3439
  contacts;
3322
3440
  issuerBrandingId;
3441
+ state;
3442
+ setState() {
3443
+ this.state = this.computeState();
3444
+ }
3445
+ computeState() {
3446
+ const payload = {
3447
+ alias: this.alias ?? null,
3448
+ locale: this.locale ?? null,
3449
+ description: this.description ?? null,
3450
+ clientUri: this.clientUri ?? null,
3451
+ tosUri: this.tosUri ?? null,
3452
+ policyUri: this.policyUri ?? null,
3453
+ contacts: this.contacts ?? null,
3454
+ logo: this.logo ? {
3455
+ uri: this.logo.uri ?? null,
3456
+ dataUri: this.logo.dataUri ?? null,
3457
+ mediaType: this.logo.mediaType ?? null,
3458
+ alt: this.logo.alt ?? null,
3459
+ dimensions: this.logo.dimensions ? {
3460
+ width: this.logo.dimensions.width,
3461
+ height: this.logo.dimensions.height
3462
+ } : null
3463
+ } : null,
3464
+ background: this.background ? {
3465
+ color: this.background.color ?? null,
3466
+ image: this.background.image ? {
3467
+ uri: this.background.image.uri ?? null,
3468
+ dataUri: this.background.image.dataUri ?? null,
3469
+ mediaType: this.background.image.mediaType ?? null,
3470
+ alt: this.background.image.alt ?? null,
3471
+ dimensions: this.background.image.dimensions ? {
3472
+ width: this.background.image.dimensions.width,
3473
+ height: this.background.image.dimensions.height
3474
+ } : null
3475
+ } : null
3476
+ } : null,
3477
+ text: this.text ? {
3478
+ color: this.text.color ?? null
3479
+ } : null
3480
+ };
3481
+ return computeCompactHash(JSON.stringify(payload));
3482
+ }
3323
3483
  };
3324
3484
  _ts_decorate28([
3325
3485
  (0, import_typeorm27.ManyToOne)(() => IssuerBrandingEntity, (issuerBranding) => issuerBranding.localeBranding, {
@@ -3378,6 +3538,21 @@ _ts_decorate28([
3378
3538
  }),
3379
3539
  _ts_metadata27("design:type", String)
3380
3540
  ], IssuerLocaleBrandingEntity.prototype, "issuerBrandingId", void 0);
3541
+ _ts_decorate28([
3542
+ (0, import_typeorm27.Column)("varchar", {
3543
+ name: "state",
3544
+ length: 255,
3545
+ nullable: false
3546
+ }),
3547
+ _ts_metadata27("design:type", String)
3548
+ ], IssuerLocaleBrandingEntity.prototype, "state", void 0);
3549
+ _ts_decorate28([
3550
+ (0, import_typeorm27.BeforeInsert)(),
3551
+ (0, import_typeorm27.BeforeUpdate)(),
3552
+ _ts_metadata27("design:type", Function),
3553
+ _ts_metadata27("design:paramtypes", []),
3554
+ _ts_metadata27("design:returntype", void 0)
3555
+ ], IssuerLocaleBrandingEntity.prototype, "setState", null);
3381
3556
  IssuerLocaleBrandingEntity = _ts_decorate28([
3382
3557
  (0, import_typeorm27.ChildEntity)("IssuerLocaleBranding"),
3383
3558
  (0, import_typeorm27.Index)("IDX_IssuerLocaleBrandingEntity_issuerBranding_locale", [
@@ -4812,10 +4987,19 @@ var ContactStore = class extends import_ssi_sdk25.AbstractContactStore {
4812
4987
  const result = await partyRepository.find({
4813
4988
  where: {
4814
4989
  id: (0, import_typeorm35.In)(initialResult.map((party) => party.id))
4815
- }
4990
+ },
4991
+ relations: [
4992
+ "contact"
4993
+ ]
4816
4994
  });
4817
4995
  debug(`getParties() resulted in ${result.length} parties`);
4818
- return result.map(partyFrom);
4996
+ return result.filter((party) => {
4997
+ if (!party.contact) {
4998
+ console.warn(`party ${party.id} does not have an associated contact`);
4999
+ return false;
5000
+ }
5001
+ return true;
5002
+ }).map(partyFrom);
4819
5003
  }, "getParties");
4820
5004
  addParty = /* @__PURE__ */ __name(async (args) => {
4821
5005
  const { identities, contact, partyType } = args;
@@ -5611,7 +5795,7 @@ var import_typeorm37 = require("typeorm");
5611
5795
  var credentialBrandingFrom = /* @__PURE__ */ __name((credentialBranding) => {
5612
5796
  const result = {
5613
5797
  ...credentialBranding,
5614
- localeBranding: credentialBranding.localeBranding.map((localeBranding) => localeBrandingFrom(localeBranding))
5798
+ localeBranding: credentialBranding.localeBranding.map((localeBranding) => credentialLocaleBrandingFromEntity(localeBranding))
5615
5799
  };
5616
5800
  return replaceNullWithUndefined(result);
5617
5801
  }, "credentialBrandingFrom");
@@ -5629,6 +5813,19 @@ var localeBrandingFrom = /* @__PURE__ */ __name((localeBranding) => {
5629
5813
  };
5630
5814
  return replaceNullWithUndefined(result);
5631
5815
  }, "localeBrandingFrom");
5816
+ var credentialLocaleBrandingFromEntity = /* @__PURE__ */ __name((localeBranding) => {
5817
+ const base = localeBrandingFrom(localeBranding);
5818
+ const result = {
5819
+ ...base,
5820
+ state: localeBranding.state,
5821
+ claims: localeBranding.claims ? localeBranding.claims.map((claim) => ({
5822
+ id: claim.id,
5823
+ key: claim.key,
5824
+ name: claim.name
5825
+ })) : void 0
5826
+ };
5827
+ return replaceNullWithUndefined(result);
5828
+ }, "credentialLocaleBrandingFromEntity");
5632
5829
  var issuerLocaleBrandingEntityFrom = /* @__PURE__ */ __name((args) => {
5633
5830
  const issuerLocaleBrandingEntity = new IssuerLocaleBrandingEntity();
5634
5831
  issuerLocaleBrandingEntity.alias = isEmptyString(args.alias) ? void 0 : args.alias;
@@ -5733,7 +5930,7 @@ var IssuanceBrandingStore = class extends import_ssi_sdk27.AbstractIssuanceBrand
5733
5930
  return credentialBrandingFrom(createdResult);
5734
5931
  }, "addCredentialBranding");
5735
5932
  getCredentialBranding = /* @__PURE__ */ __name(async (args) => {
5736
- const { filter } = args ?? {};
5933
+ const { filter, knownStates } = args ?? {};
5737
5934
  if (filter) {
5738
5935
  filter.forEach((filter2) => {
5739
5936
  if (filter2.localeBranding && "locale" in filter2.localeBranding && filter2.localeBranding.locale === void 0) {
@@ -5742,12 +5939,39 @@ var IssuanceBrandingStore = class extends import_ssi_sdk27.AbstractIssuanceBrand
5742
5939
  });
5743
5940
  }
5744
5941
  debug3("Getting credential branding", args);
5745
- const result = await (await this.dbConnection).getRepository(CredentialBrandingEntity).find({
5942
+ const repository = (await this.dbConnection).getRepository(CredentialBrandingEntity);
5943
+ if (knownStates && Object.keys(knownStates).length > 0) {
5944
+ const stateQuery = repository.createQueryBuilder("branding").select([
5945
+ "branding.id",
5946
+ "branding.state"
5947
+ ]);
5948
+ if (filter) {
5949
+ stateQuery.where(filter);
5950
+ }
5951
+ const stateResults = await stateQuery.getRawMany().then((rows) => rows.map((row) => ({
5952
+ id: row.branding_id,
5953
+ state: row.branding_state
5954
+ })));
5955
+ const dirtyIds = stateResults.filter((result3) => {
5956
+ const knownState = knownStates[result3.id];
5957
+ return !knownState || knownState !== result3.state;
5958
+ }).map((result3) => result3.id);
5959
+ if (dirtyIds.length === 0) {
5960
+ return [];
5961
+ }
5962
+ const result2 = await repository.find({
5963
+ where: {
5964
+ id: (0, import_typeorm37.In)(dirtyIds)
5965
+ }
5966
+ });
5967
+ return result2.map((branding) => credentialBrandingFrom(branding));
5968
+ }
5969
+ const result = await repository.find({
5746
5970
  ...filter && {
5747
5971
  where: filter
5748
5972
  }
5749
5973
  });
5750
- return result.map((credentialBranding) => credentialBrandingFrom(credentialBranding));
5974
+ return result.map((branding) => credentialBrandingFrom(branding));
5751
5975
  }, "getCredentialBranding");
5752
5976
  removeCredentialBranding = /* @__PURE__ */ __name(async (args) => {
5753
5977
  const { filter } = args;
@@ -5840,7 +6064,7 @@ var IssuanceBrandingStore = class extends import_ssi_sdk27.AbstractIssuanceBrand
5840
6064
  where: filter
5841
6065
  }
5842
6066
  });
5843
- return credentialBrandingLocale ? credentialBrandingLocale.map((credentialLocaleBranding) => localeBrandingFrom(credentialLocaleBranding)) : [];
6067
+ return credentialBrandingLocale ? credentialBrandingLocale.map((credentialLocaleBranding) => credentialLocaleBrandingFromEntity(credentialLocaleBranding)) : [];
5844
6068
  }, "getCredentialLocaleBranding");
5845
6069
  removeCredentialLocaleBranding = /* @__PURE__ */ __name(async (args) => {
5846
6070
  const { filter } = args;
@@ -8103,12 +8327,162 @@ var AddLinkedVpFields1763387280000 = class {
8103
8327
  }
8104
8328
  };
8105
8329
 
8330
+ // src/migrations/generic/15-AddBrandingState.ts
8331
+ var import_debug14 = __toESM(require("debug"), 1);
8332
+
8333
+ // src/migrations/postgres/1766000000000-AddBrandingState.ts
8334
+ var AddBrandingStatePostgres1766000000000 = class {
8335
+ static {
8336
+ __name(this, "AddBrandingStatePostgres1766000000000");
8337
+ }
8338
+ name = "AddBrandingState1766000000000";
8339
+ async up(queryRunner) {
8340
+ await queryRunner.query(`ALTER TABLE "CredentialBranding" ADD "state" character varying(255) NOT NULL DEFAULT ''`);
8341
+ await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" ADD "state" character varying(255) NOT NULL DEFAULT ''`);
8342
+ }
8343
+ async down(queryRunner) {
8344
+ await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP COLUMN "state"`);
8345
+ await queryRunner.query(`ALTER TABLE "CredentialBranding" DROP COLUMN "state"`);
8346
+ }
8347
+ };
8348
+
8349
+ // src/migrations/sqlite/1766000000000-AddBrandingState.ts
8350
+ var AddBrandingStateSqlite1766000000000 = class {
8351
+ static {
8352
+ __name(this, "AddBrandingStateSqlite1766000000000");
8353
+ }
8354
+ name = "AddBrandingState1766000000000";
8355
+ async up(queryRunner) {
8356
+ await queryRunner.query(`ALTER TABLE "CredentialBranding" ADD COLUMN "state" varchar(255) NOT NULL DEFAULT ''`);
8357
+ await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" ADD COLUMN "state" varchar(255) NOT NULL DEFAULT ''`);
8358
+ }
8359
+ async down(queryRunner) {
8360
+ await queryRunner.query(`PRAGMA foreign_keys = OFF`);
8361
+ await queryRunner.query(`
8362
+ CREATE TABLE "CredentialBranding_old"
8363
+ (
8364
+ "id" varchar PRIMARY KEY NOT NULL,
8365
+ "vcHash" varchar(255) NOT NULL,
8366
+ "issuerCorrelationId" varchar(255) NOT NULL,
8367
+ "created_at" datetime NOT NULL DEFAULT (datetime('now')),
8368
+ "last_updated_at" datetime NOT NULL DEFAULT (datetime('now'))
8369
+ )
8370
+ `);
8371
+ await queryRunner.query(`
8372
+ INSERT INTO "CredentialBranding_old" ("id", "vcHash", "issuerCorrelationId", "created_at", "last_updated_at")
8373
+ SELECT "id", "vcHash", "issuerCorrelationId", "created_at", "last_updated_at"
8374
+ FROM "CredentialBranding"
8375
+ `);
8376
+ await queryRunner.query(`DROP TABLE "CredentialBranding"`);
8377
+ await queryRunner.query(`ALTER TABLE "CredentialBranding_old" RENAME TO "CredentialBranding"`);
8378
+ await queryRunner.query(`CREATE INDEX "IDX_CredentialBrandingEntity_issuerCorrelationId" ON "CredentialBranding" ("issuerCorrelationId")`);
8379
+ await queryRunner.query(`CREATE INDEX "IDX_CredentialBrandingEntity_vcHash" ON "CredentialBranding" ("vcHash")`);
8380
+ await queryRunner.query(`
8381
+ CREATE TABLE "BaseLocaleBranding_old"
8382
+ (
8383
+ "id" varchar PRIMARY KEY NOT NULL,
8384
+ "alias" varchar(255),
8385
+ "locale" varchar(255) NOT NULL,
8386
+ "description" varchar(255),
8387
+ "created_at" datetime NOT NULL DEFAULT (datetime('now')),
8388
+ "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')),
8389
+ "credentialBrandingId" varchar,
8390
+ "issuerBrandingId" varchar,
8391
+ "type" varchar NOT NULL,
8392
+ "logoId" varchar,
8393
+ "backgroundId" varchar,
8394
+ "textId" varchar,
8395
+ "client_uri" varchar,
8396
+ "tos_uri" varchar,
8397
+ "policy_uri" varchar,
8398
+ "contacts" varchar,
8399
+ CONSTRAINT "UQ_logoId" UNIQUE ("logoId"),
8400
+ CONSTRAINT "UQ_backgroundId" UNIQUE ("backgroundId"),
8401
+ CONSTRAINT "UQ_textId" UNIQUE ("textId"),
8402
+ CONSTRAINT "FK_BaseLocaleBranding_logoId" FOREIGN KEY ("logoId") REFERENCES "ImageAttributes" ("id") ON DELETE CASCADE ON UPDATE NO ACTION,
8403
+ CONSTRAINT "FK_BaseLocaleBranding_backgroundId" FOREIGN KEY ("backgroundId") REFERENCES "BackgroundAttributes" ("id") ON DELETE CASCADE ON UPDATE NO ACTION,
8404
+ CONSTRAINT "FK_BaseLocaleBranding_textId" FOREIGN KEY ("textId") REFERENCES "TextAttributes" ("id") ON DELETE CASCADE ON UPDATE NO ACTION,
8405
+ CONSTRAINT "FK_BaseLocaleBranding_credentialBrandingId" FOREIGN KEY ("credentialBrandingId") REFERENCES "CredentialBranding" ("id") ON DELETE CASCADE ON UPDATE NO ACTION,
8406
+ CONSTRAINT "FK_BaseLocaleBranding_issuerBrandingId" FOREIGN KEY ("issuerBrandingId") REFERENCES "IssuerBranding" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
8407
+ )
8408
+ `);
8409
+ await queryRunner.query(`
8410
+ INSERT INTO "BaseLocaleBranding_old" ("id", "alias", "locale", "description", "created_at", "last_updated_at", "credentialBrandingId", "issuerBrandingId", "type", "logoId", "backgroundId", "textId", "client_uri", "tos_uri", "policy_uri", "contacts")
8411
+ SELECT "id", "alias", "locale", "description", "created_at", "last_updated_at", "credentialBrandingId", "issuerBrandingId", "type", "logoId", "backgroundId", "textId", "client_uri", "tos_uri", "policy_uri", "contacts"
8412
+ FROM "BaseLocaleBranding"
8413
+ `);
8414
+ await queryRunner.query(`DROP TABLE "BaseLocaleBranding"`);
8415
+ await queryRunner.query(`ALTER TABLE "BaseLocaleBranding_old" RENAME TO "BaseLocaleBranding"`);
8416
+ await queryRunner.query(`CREATE UNIQUE INDEX "IDX_CredentialLocaleBrandingEntity_credentialBranding_locale" ON "BaseLocaleBranding" ("credentialBrandingId", "locale")`);
8417
+ await queryRunner.query(`CREATE UNIQUE INDEX "IDX_IssuerLocaleBrandingEntity_issuerBranding_locale" ON "BaseLocaleBranding" ("issuerBrandingId", "locale")`);
8418
+ await queryRunner.query(`CREATE INDEX "IDX_BaseLocaleBranding_type" ON "BaseLocaleBranding" ("type")`);
8419
+ await queryRunner.query(`PRAGMA foreign_keys = ON`);
8420
+ }
8421
+ };
8422
+
8423
+ // src/migrations/generic/15-AddBrandingState.ts
8424
+ var debug14 = (0, import_debug14.default)("sphereon:ssi-sdk:migrations");
8425
+ var AddBrandingState1766000000000 = class {
8426
+ static {
8427
+ __name(this, "AddBrandingState1766000000000");
8428
+ }
8429
+ name = "AddBrandingState1766000000000";
8430
+ async up(queryRunner) {
8431
+ debug14("migration: adding branding state checksum columns");
8432
+ const dbType = queryRunner.connection.driver.options.type;
8433
+ switch (dbType) {
8434
+ case "postgres": {
8435
+ debug14("using postgres migration file");
8436
+ const mig = new AddBrandingStatePostgres1766000000000();
8437
+ await mig.up(queryRunner);
8438
+ debug14("Migration statements executed");
8439
+ return;
8440
+ }
8441
+ case "sqlite":
8442
+ case "expo":
8443
+ case "react-native": {
8444
+ debug14("using sqlite/react-native migration file");
8445
+ const mig = new AddBrandingStateSqlite1766000000000();
8446
+ await mig.up(queryRunner);
8447
+ debug14("Migration statements executed");
8448
+ return;
8449
+ }
8450
+ default:
8451
+ 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`);
8452
+ }
8453
+ }
8454
+ async down(queryRunner) {
8455
+ debug14("migration: removing branding state checksum columns");
8456
+ const dbType = queryRunner.connection.driver.options.type;
8457
+ switch (dbType) {
8458
+ case "postgres": {
8459
+ debug14("using postgres migration file");
8460
+ const mig = new AddBrandingStatePostgres1766000000000();
8461
+ await mig.down(queryRunner);
8462
+ debug14("Migration statements executed");
8463
+ return;
8464
+ }
8465
+ case "sqlite":
8466
+ case "expo":
8467
+ case "react-native": {
8468
+ debug14("using sqlite/react-native migration file");
8469
+ const mig = new AddBrandingStateSqlite1766000000000();
8470
+ await mig.down(queryRunner);
8471
+ debug14("Migration statements executed");
8472
+ return;
8473
+ }
8474
+ default:
8475
+ 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`);
8476
+ }
8477
+ }
8478
+ };
8479
+
8106
8480
  // src/migrations/generic/15-AddServiceMetadata.ts
8107
- var import_debug16 = __toESM(require("debug"), 1);
8481
+ var import_debug17 = __toESM(require("debug"), 1);
8108
8482
 
8109
8483
  // src/migrations/postgres/1764000000001-AddServiceMetadata.ts
8110
- var import_debug14 = __toESM(require("debug"), 1);
8111
- var debug14 = (0, import_debug14.default)("sphereon:ssi-sdk:migrations");
8484
+ var import_debug15 = __toESM(require("debug"), 1);
8485
+ var debug15 = (0, import_debug15.default)("sphereon:ssi-sdk:migrations");
8112
8486
  var AddServiceMetadata1764000000001 = class {
8113
8487
  static {
8114
8488
  __name(this, "AddServiceMetadata1764000000001");
@@ -8117,7 +8491,7 @@ var AddServiceMetadata1764000000001 = class {
8117
8491
  async up(queryRunner) {
8118
8492
  const table = await queryRunner.getTable("service");
8119
8493
  if (!table) {
8120
- debug14("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.");
8494
+ 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.");
8121
8495
  console.warn("[SSI-SDK Migration] AddServiceMetadata: Skipping - service table does not exist (Veramo DID Manager not in use)");
8122
8496
  return;
8123
8497
  }
@@ -8125,7 +8499,7 @@ var AddServiceMetadata1764000000001 = class {
8125
8499
  ALTER TABLE "service"
8126
8500
  ADD COLUMN IF NOT EXISTS "metadata" jsonb
8127
8501
  `);
8128
- debug14("AddServiceMetadata: Added metadata column to service table");
8502
+ debug15("AddServiceMetadata: Added metadata column to service table");
8129
8503
  }
8130
8504
  async down(queryRunner) {
8131
8505
  const table = await queryRunner.getTable("service");
@@ -8140,8 +8514,8 @@ var AddServiceMetadata1764000000001 = class {
8140
8514
  };
8141
8515
 
8142
8516
  // src/migrations/sqlite/1764000000002-AddServiceMetadata.ts
8143
- var import_debug15 = __toESM(require("debug"), 1);
8144
- var debug15 = (0, import_debug15.default)("sphereon:ssi-sdk:migrations");
8517
+ var import_debug16 = __toESM(require("debug"), 1);
8518
+ var debug16 = (0, import_debug16.default)("sphereon:ssi-sdk:migrations");
8145
8519
  var AddServiceMetadata1764000000002 = class {
8146
8520
  static {
8147
8521
  __name(this, "AddServiceMetadata1764000000002");
@@ -8150,7 +8524,7 @@ var AddServiceMetadata1764000000002 = class {
8150
8524
  async up(queryRunner) {
8151
8525
  const table = await queryRunner.getTable("service");
8152
8526
  if (!table) {
8153
- 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.");
8527
+ 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.");
8154
8528
  console.warn("[SSI-SDK Migration] AddServiceMetadata: Skipping - service table does not exist (Veramo DID Manager not in use)");
8155
8529
  return;
8156
8530
  }
@@ -8160,7 +8534,7 @@ var AddServiceMetadata1764000000002 = class {
8160
8534
  ALTER TABLE "service"
8161
8535
  ADD COLUMN "metadata" text
8162
8536
  `);
8163
- debug15("AddServiceMetadata: Added metadata column to service table");
8537
+ debug16("AddServiceMetadata: Added metadata column to service table");
8164
8538
  }
8165
8539
  }
8166
8540
  async down(queryRunner) {
@@ -8168,30 +8542,30 @@ var AddServiceMetadata1764000000002 = class {
8168
8542
  };
8169
8543
 
8170
8544
  // src/migrations/generic/15-AddServiceMetadata.ts
8171
- var debug16 = (0, import_debug16.default)("sphereon:ssi-sdk:migrations");
8545
+ var debug17 = (0, import_debug17.default)("sphereon:ssi-sdk:migrations");
8172
8546
  var AddServiceMetadata1764000000000 = class {
8173
8547
  static {
8174
8548
  __name(this, "AddServiceMetadata1764000000000");
8175
8549
  }
8176
8550
  name = "AddServiceMetadata1764000000000";
8177
8551
  async up(queryRunner) {
8178
- debug16("migration: adding metadata column to service table");
8552
+ debug17("migration: adding metadata column to service table");
8179
8553
  const dbType = queryRunner.connection.driver.options.type;
8180
8554
  switch (dbType) {
8181
8555
  case "postgres": {
8182
- debug16("using postgres migration file for AddServiceMetadata");
8556
+ debug17("using postgres migration file for AddServiceMetadata");
8183
8557
  const mig = new AddServiceMetadata1764000000001();
8184
8558
  await mig.up(queryRunner);
8185
- debug16("Postgres migration statements for AddServiceMetadata executed");
8559
+ debug17("Postgres migration statements for AddServiceMetadata executed");
8186
8560
  return;
8187
8561
  }
8188
8562
  case "sqlite":
8189
8563
  case "expo":
8190
8564
  case "react-native": {
8191
- debug16("using sqlite/react-native migration file for AddServiceMetadata");
8565
+ debug17("using sqlite/react-native migration file for AddServiceMetadata");
8192
8566
  const mig = new AddServiceMetadata1764000000002();
8193
8567
  await mig.up(queryRunner);
8194
- debug16("SQLite migration statements for AddServiceMetadata executed");
8568
+ debug17("SQLite migration statements for AddServiceMetadata executed");
8195
8569
  return;
8196
8570
  }
8197
8571
  default:
@@ -8199,23 +8573,23 @@ var AddServiceMetadata1764000000000 = class {
8199
8573
  }
8200
8574
  }
8201
8575
  async down(queryRunner) {
8202
- debug16("migration: reverting metadata column from service table");
8576
+ debug17("migration: reverting metadata column from service table");
8203
8577
  const dbType = queryRunner.connection.driver.options.type;
8204
8578
  switch (dbType) {
8205
8579
  case "postgres": {
8206
- debug16("using postgres migration file for AddServiceMetadata");
8580
+ debug17("using postgres migration file for AddServiceMetadata");
8207
8581
  const mig = new AddServiceMetadata1764000000001();
8208
8582
  await mig.down(queryRunner);
8209
- debug16("Postgres migration statements for AddServiceMetadata reverted");
8583
+ debug17("Postgres migration statements for AddServiceMetadata reverted");
8210
8584
  return;
8211
8585
  }
8212
8586
  case "sqlite":
8213
8587
  case "expo":
8214
8588
  case "react-native": {
8215
- debug16("using sqlite/react-native migration file for AddServiceMetadata");
8589
+ debug17("using sqlite/react-native migration file for AddServiceMetadata");
8216
8590
  const mig = new AddServiceMetadata1764000000002();
8217
8591
  await mig.down(queryRunner);
8218
- debug16("SQLite migration statements for AddServiceMetadata reverted");
8592
+ debug17("SQLite migration statements for AddServiceMetadata reverted");
8219
8593
  return;
8220
8594
  }
8221
8595
  default:
@@ -8225,31 +8599,31 @@ var AddServiceMetadata1764000000000 = class {
8225
8599
  };
8226
8600
 
8227
8601
  // src/migrations/generic/2-CreateIssuanceBranding.ts
8228
- var import_debug17 = __toESM(require("debug"), 1);
8229
- var debug17 = (0, import_debug17.default)("sphereon:ssi-sdk:migrations");
8602
+ var import_debug18 = __toESM(require("debug"), 1);
8603
+ var debug18 = (0, import_debug18.default)("sphereon:ssi-sdk:migrations");
8230
8604
  var CreateIssuanceBranding1659463079429 = class {
8231
8605
  static {
8232
8606
  __name(this, "CreateIssuanceBranding1659463079429");
8233
8607
  }
8234
8608
  name = "CreateIssuanceBranding1659463079429";
8235
8609
  async up(queryRunner) {
8236
- debug17("migration: creating issuance branding tables");
8610
+ debug18("migration: creating issuance branding tables");
8237
8611
  const dbType = queryRunner.connection.driver.options.type;
8238
8612
  switch (dbType) {
8239
8613
  case "postgres": {
8240
- debug17("using postgres migration file");
8614
+ debug18("using postgres migration file");
8241
8615
  const mig = new CreateIssuanceBranding1685628974232();
8242
8616
  await mig.up(queryRunner);
8243
- debug17("Migration statements executed");
8617
+ debug18("Migration statements executed");
8244
8618
  return;
8245
8619
  }
8246
8620
  case "sqlite":
8247
8621
  case "expo":
8248
8622
  case "react-native": {
8249
- debug17("using sqlite/react-native migration file");
8623
+ debug18("using sqlite/react-native migration file");
8250
8624
  const mig = new CreateIssuanceBranding1685628973231();
8251
8625
  await mig.up(queryRunner);
8252
- debug17("Migration statements executed");
8626
+ debug18("Migration statements executed");
8253
8627
  return;
8254
8628
  }
8255
8629
  default:
@@ -8257,23 +8631,23 @@ var CreateIssuanceBranding1659463079429 = class {
8257
8631
  }
8258
8632
  }
8259
8633
  async down(queryRunner) {
8260
- debug17("migration: reverting issuance branding tables");
8634
+ debug18("migration: reverting issuance branding tables");
8261
8635
  const dbType = queryRunner.connection.driver.options.type;
8262
8636
  switch (dbType) {
8263
8637
  case "postgres": {
8264
- debug17("using postgres migration file");
8638
+ debug18("using postgres migration file");
8265
8639
  const mig = new CreateIssuanceBranding1685628974232();
8266
8640
  await mig.down(queryRunner);
8267
- debug17("Migration statements executed");
8641
+ debug18("Migration statements executed");
8268
8642
  return;
8269
8643
  }
8270
8644
  case "sqlite":
8271
8645
  case "expo":
8272
8646
  case "react-native": {
8273
- debug17("using sqlite/react-native migration file");
8647
+ debug18("using sqlite/react-native migration file");
8274
8648
  const mig = new CreateIssuanceBranding1685628973231();
8275
8649
  await mig.down(queryRunner);
8276
- debug17("Migration statements executed");
8650
+ debug18("Migration statements executed");
8277
8651
  return;
8278
8652
  }
8279
8653
  default:
@@ -8283,7 +8657,7 @@ var CreateIssuanceBranding1659463079429 = class {
8283
8657
  };
8284
8658
 
8285
8659
  // src/migrations/generic/3-CreateContacts.ts
8286
- var import_debug18 = __toESM(require("debug"), 1);
8660
+ var import_debug19 = __toESM(require("debug"), 1);
8287
8661
 
8288
8662
  // src/migrations/postgres/1690925872592-CreateContacts.ts
8289
8663
  var import_ssi_sdk33 = require("@sphereon/ssi-sdk.core");
@@ -8504,30 +8878,30 @@ var CreateContacts1690925872693 = class {
8504
8878
  };
8505
8879
 
8506
8880
  // src/migrations/generic/3-CreateContacts.ts
8507
- var debug18 = (0, import_debug18.default)("sphereon:ssi-sdk:migrations");
8881
+ var debug19 = (0, import_debug19.default)("sphereon:ssi-sdk:migrations");
8508
8882
  var CreateContacts1690925872318 = class {
8509
8883
  static {
8510
8884
  __name(this, "CreateContacts1690925872318");
8511
8885
  }
8512
8886
  name = "CreateContacts1690925872318";
8513
8887
  async up(queryRunner) {
8514
- debug18("migration: creating contacts tables");
8888
+ debug19("migration: creating contacts tables");
8515
8889
  const dbType = queryRunner.connection.driver.options.type;
8516
8890
  switch (dbType) {
8517
8891
  case "postgres": {
8518
- debug18("using postgres migration file");
8892
+ debug19("using postgres migration file");
8519
8893
  const mig = new CreateContacts1690925872592();
8520
8894
  await mig.up(queryRunner);
8521
- debug18("Migration statements executed");
8895
+ debug19("Migration statements executed");
8522
8896
  return;
8523
8897
  }
8524
8898
  case "sqlite":
8525
8899
  case "expo":
8526
8900
  case "react-native": {
8527
- debug18("using sqlite/react-native migration file");
8901
+ debug19("using sqlite/react-native migration file");
8528
8902
  const mig = new CreateContacts1690925872693();
8529
8903
  await mig.up(queryRunner);
8530
- debug18("Migration statements executed");
8904
+ debug19("Migration statements executed");
8531
8905
  return;
8532
8906
  }
8533
8907
  default:
@@ -8535,23 +8909,23 @@ var CreateContacts1690925872318 = class {
8535
8909
  }
8536
8910
  }
8537
8911
  async down(queryRunner) {
8538
- debug18("migration: reverting contacts tables");
8912
+ debug19("migration: reverting contacts tables");
8539
8913
  const dbType = queryRunner.connection.driver.options.type;
8540
8914
  switch (dbType) {
8541
8915
  case "postgres": {
8542
- debug18("using postgres migration file");
8916
+ debug19("using postgres migration file");
8543
8917
  const mig = new CreateContacts1690925872592();
8544
8918
  await mig.down(queryRunner);
8545
- debug18("Migration statements executed");
8919
+ debug19("Migration statements executed");
8546
8920
  return;
8547
8921
  }
8548
8922
  case "sqlite":
8549
8923
  case "expo":
8550
8924
  case "react-native": {
8551
- debug18("using sqlite/react-native migration file");
8925
+ debug19("using sqlite/react-native migration file");
8552
8926
  const mig = new CreateContacts1690925872693();
8553
8927
  await mig.down(queryRunner);
8554
- debug18("Migration statements executed");
8928
+ debug19("Migration statements executed");
8555
8929
  return;
8556
8930
  }
8557
8931
  default:
@@ -8561,7 +8935,7 @@ var CreateContacts1690925872318 = class {
8561
8935
  };
8562
8936
 
8563
8937
  // src/migrations/generic/4-CreateStatusList.ts
8564
- var import_debug19 = __toESM(require("debug"), 1);
8938
+ var import_debug20 = __toESM(require("debug"), 1);
8565
8939
 
8566
8940
  // src/migrations/postgres/1693866470001-CreateStatusList.ts
8567
8941
  var CreateStatusList1693866470001 = class {
@@ -8767,53 +9141,53 @@ var UpdateStatusList1737110469000 = class {
8767
9141
  };
8768
9142
 
8769
9143
  // src/migrations/generic/4-CreateStatusList.ts
8770
- var debug19 = (0, import_debug19.default)("sphereon:ssi-sdk:migrations");
9144
+ var debug20 = (0, import_debug20.default)("sphereon:ssi-sdk:migrations");
8771
9145
  var CreateStatusList1693866470000 = class {
8772
9146
  static {
8773
9147
  __name(this, "CreateStatusList1693866470000");
8774
9148
  }
8775
9149
  name = "CreateStatusList1693866470000";
8776
9150
  async up(queryRunner) {
8777
- debug19("migration: creating issuance branding tables");
9151
+ debug20("migration: creating issuance branding tables");
8778
9152
  const dbType = queryRunner.connection.driver.options.type;
8779
9153
  if (dbType === "postgres") {
8780
- debug19("using postgres migration files");
9154
+ debug20("using postgres migration files");
8781
9155
  const createMig = new CreateStatusList1693866470001();
8782
9156
  await createMig.up(queryRunner);
8783
9157
  const updateMig = new UpdateStatusList1737110469001();
8784
9158
  const up = await updateMig.up(queryRunner);
8785
- debug19("Migration statements executed");
9159
+ debug20("Migration statements executed");
8786
9160
  return up;
8787
9161
  } else if (dbType === "sqlite" || dbType === "react-native" || dbType === "expo") {
8788
- debug19("using sqlite/react-native migration files");
9162
+ debug20("using sqlite/react-native migration files");
8789
9163
  const createMig = new CreateStatusList1693866470002();
8790
9164
  await createMig.up(queryRunner);
8791
9165
  const updateMig = new UpdateStatusList1737110469000();
8792
9166
  const up = await updateMig.up(queryRunner);
8793
- debug19("Migration statements executed");
9167
+ debug20("Migration statements executed");
8794
9168
  return up;
8795
9169
  } else {
8796
9170
  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`);
8797
9171
  }
8798
9172
  }
8799
9173
  async down(queryRunner) {
8800
- debug19("migration: reverting issuance branding tables");
9174
+ debug20("migration: reverting issuance branding tables");
8801
9175
  const dbType = queryRunner.connection.driver.options.type;
8802
9176
  if (dbType === "postgres") {
8803
- debug19("using postgres migration files");
9177
+ debug20("using postgres migration files");
8804
9178
  const updateMig = new UpdateStatusList1737110469001();
8805
9179
  await updateMig.down(queryRunner);
8806
9180
  const createMig = new CreateStatusList1693866470001();
8807
9181
  const down = await createMig.down(queryRunner);
8808
- debug19("Migration statements executed");
9182
+ debug20("Migration statements executed");
8809
9183
  return down;
8810
9184
  } else if (dbType === "sqlite" || dbType === "react-native" || dbType === "expo") {
8811
- debug19("using sqlite/react-native migration files");
9185
+ debug20("using sqlite/react-native migration files");
8812
9186
  const updateMig = new UpdateStatusList1737110469000();
8813
9187
  await updateMig.down(queryRunner);
8814
9188
  const createMig = new CreateStatusList1693866470002();
8815
9189
  const down = await createMig.down(queryRunner);
8816
- debug19("Migration statements executed");
9190
+ debug20("Migration statements executed");
8817
9191
  return down;
8818
9192
  } else {
8819
9193
  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`);
@@ -8822,7 +9196,7 @@ var CreateStatusList1693866470000 = class {
8822
9196
  };
8823
9197
 
8824
9198
  // src/migrations/generic/5-CreateAuditEvents.ts
8825
- var import_debug20 = __toESM(require("debug"), 1);
9199
+ var import_debug21 = __toESM(require("debug"), 1);
8826
9200
 
8827
9201
  // src/migrations/postgres/1701634812183-CreateAuditEvents.ts
8828
9202
  var CreateAuditEvents1701634812183 = class {
@@ -8921,30 +9295,30 @@ var CreateAuditEvents1701634819487 = class {
8921
9295
  };
8922
9296
 
8923
9297
  // src/migrations/generic/5-CreateAuditEvents.ts
8924
- var debug20 = (0, import_debug20.default)("sphereon:ssi-sdk:migrations");
9298
+ var debug21 = (0, import_debug21.default)("sphereon:ssi-sdk:migrations");
8925
9299
  var CreateAuditEvents1701635835330 = class {
8926
9300
  static {
8927
9301
  __name(this, "CreateAuditEvents1701635835330");
8928
9302
  }
8929
9303
  name = "CreateAuditEvents1701635835330";
8930
9304
  async up(queryRunner) {
8931
- debug20("migration: creating audit events tables");
9305
+ debug21("migration: creating audit events tables");
8932
9306
  const dbType = queryRunner.connection.driver.options.type;
8933
9307
  switch (dbType) {
8934
9308
  case "postgres": {
8935
- debug20("using postgres migration file");
9309
+ debug21("using postgres migration file");
8936
9310
  const mig = new CreateAuditEvents1701634812183();
8937
9311
  await mig.up(queryRunner);
8938
- debug20("Migration statements executed");
9312
+ debug21("Migration statements executed");
8939
9313
  return;
8940
9314
  }
8941
9315
  case "sqlite":
8942
9316
  case "expo":
8943
9317
  case "react-native": {
8944
- debug20("using sqlite/react-native migration file");
9318
+ debug21("using sqlite/react-native migration file");
8945
9319
  const mig = new CreateAuditEvents1701634819487();
8946
9320
  await mig.up(queryRunner);
8947
- debug20("Migration statements executed");
9321
+ debug21("Migration statements executed");
8948
9322
  return;
8949
9323
  }
8950
9324
  default:
@@ -8952,23 +9326,23 @@ var CreateAuditEvents1701635835330 = class {
8952
9326
  }
8953
9327
  }
8954
9328
  async down(queryRunner) {
8955
- debug20("migration: reverting audit events tables");
9329
+ debug21("migration: reverting audit events tables");
8956
9330
  const dbType = queryRunner.connection.driver.options.type;
8957
9331
  switch (dbType) {
8958
9332
  case "postgres": {
8959
- debug20("using postgres migration file");
9333
+ debug21("using postgres migration file");
8960
9334
  const mig = new CreateAuditEvents1701634812183();
8961
9335
  await mig.down(queryRunner);
8962
- debug20("Migration statements executed");
9336
+ debug21("Migration statements executed");
8963
9337
  return;
8964
9338
  }
8965
9339
  case "sqlite":
8966
9340
  case "expo":
8967
9341
  case "react-native": {
8968
- debug20("using sqlite/react-native migration file");
9342
+ debug21("using sqlite/react-native migration file");
8969
9343
  const mig = new CreateAuditEvents1701634819487();
8970
9344
  await mig.down(queryRunner);
8971
- debug20("Migration statements executed");
9345
+ debug21("Migration statements executed");
8972
9346
  return;
8973
9347
  }
8974
9348
  default:
@@ -8978,7 +9352,7 @@ var CreateAuditEvents1701635835330 = class {
8978
9352
  };
8979
9353
 
8980
9354
  // src/migrations/generic/6-CreateDigitalCredential.ts
8981
- var import_debug21 = __toESM(require("debug"), 1);
9355
+ var import_debug22 = __toESM(require("debug"), 1);
8982
9356
 
8983
9357
  // src/migrations/postgres/1708525189001-CreateDigitalCredential.ts
8984
9358
  var CreateDigitalCredential1708525189001 = class {
@@ -9086,30 +9460,30 @@ var CreateDigitalCredential1708525189002 = class {
9086
9460
  };
9087
9461
 
9088
9462
  // src/migrations/generic/6-CreateDigitalCredential.ts
9089
- var debug21 = (0, import_debug21.default)("sphereon:ssi-sdk:migrations");
9463
+ var debug22 = (0, import_debug22.default)("sphereon:ssi-sdk:migrations");
9090
9464
  var CreateDigitalCredential1708525189000 = class {
9091
9465
  static {
9092
9466
  __name(this, "CreateDigitalCredential1708525189000");
9093
9467
  }
9094
9468
  name = "CreateDigitalCredential1708525189000";
9095
9469
  async up(queryRunner) {
9096
- debug21("migration: creating DigitalCredential tables");
9470
+ debug22("migration: creating DigitalCredential tables");
9097
9471
  const dbType = queryRunner.connection.driver.options.type;
9098
9472
  switch (dbType) {
9099
9473
  case "postgres": {
9100
- debug21("using postgres migration file for DigitalCredential");
9474
+ debug22("using postgres migration file for DigitalCredential");
9101
9475
  const mig = new CreateDigitalCredential1708525189001();
9102
9476
  await mig.up(queryRunner);
9103
- debug21("Postgres Migration statements for DigitalCredential executed");
9477
+ debug22("Postgres Migration statements for DigitalCredential executed");
9104
9478
  return;
9105
9479
  }
9106
9480
  case "sqlite":
9107
9481
  case "expo":
9108
9482
  case "react-native": {
9109
- debug21("using sqlite/react-native migration file for DigitalCredential");
9483
+ debug22("using sqlite/react-native migration file for DigitalCredential");
9110
9484
  const mig = new CreateDigitalCredential1708525189002();
9111
9485
  await mig.up(queryRunner);
9112
- debug21("SQLite Migration statements for DigitalCredential executed");
9486
+ debug22("SQLite Migration statements for DigitalCredential executed");
9113
9487
  return;
9114
9488
  }
9115
9489
  default:
@@ -9117,23 +9491,23 @@ var CreateDigitalCredential1708525189000 = class {
9117
9491
  }
9118
9492
  }
9119
9493
  async down(queryRunner) {
9120
- debug21("migration: reverting DigitalCredential tables");
9494
+ debug22("migration: reverting DigitalCredential tables");
9121
9495
  const dbType = queryRunner.connection.driver.options.type;
9122
9496
  switch (dbType) {
9123
9497
  case "postgres": {
9124
- debug21("using postgres migration file for DigitalCredential");
9498
+ debug22("using postgres migration file for DigitalCredential");
9125
9499
  const mig = new CreateDigitalCredential1708525189001();
9126
9500
  await mig.down(queryRunner);
9127
- debug21("Postgres Migration statements for DigitalCredential reverted");
9501
+ debug22("Postgres Migration statements for DigitalCredential reverted");
9128
9502
  return;
9129
9503
  }
9130
9504
  case "sqlite":
9131
9505
  case "expo":
9132
9506
  case "react-native": {
9133
- debug21("using sqlite/react-native migration file for DigitalCredential");
9507
+ debug22("using sqlite/react-native migration file for DigitalCredential");
9134
9508
  const mig = new CreateDigitalCredential1708525189002();
9135
9509
  await mig.down(queryRunner);
9136
- debug21("SQLite Migration statements for DigitalCredential reverted");
9510
+ debug22("SQLite Migration statements for DigitalCredential reverted");
9137
9511
  return;
9138
9512
  }
9139
9513
  default:
@@ -9143,7 +9517,7 @@ var CreateDigitalCredential1708525189000 = class {
9143
9517
  };
9144
9518
 
9145
9519
  // src/migrations/generic/7-CreateMachineStateStore.ts
9146
- var import_debug22 = __toESM(require("debug"), 1);
9520
+ var import_debug23 = __toESM(require("debug"), 1);
9147
9521
 
9148
9522
  // src/migrations/postgres/1708797018115-CreateMachineStateStore.ts
9149
9523
  var CreateMachineStateStore1708797018115 = class {
@@ -9205,30 +9579,30 @@ var CreateMachineStateStore1708796002272 = class {
9205
9579
  };
9206
9580
 
9207
9581
  // src/migrations/generic/7-CreateMachineStateStore.ts
9208
- var debug22 = (0, import_debug22.default)("sphereon:ssi-sdk:migrations");
9582
+ var debug23 = (0, import_debug23.default)("sphereon:ssi-sdk:migrations");
9209
9583
  var CreateMachineStateStore1708098041262 = class {
9210
9584
  static {
9211
9585
  __name(this, "CreateMachineStateStore1708098041262");
9212
9586
  }
9213
9587
  name = "CreateMachineStateStore1708098041262";
9214
9588
  async up(queryRunner) {
9215
- debug22("migration: creating machine state tables");
9589
+ debug23("migration: creating machine state tables");
9216
9590
  const dbType = queryRunner.connection.driver.options.type;
9217
9591
  switch (dbType) {
9218
9592
  case "postgres": {
9219
- debug22("using postgres migration file");
9593
+ debug23("using postgres migration file");
9220
9594
  const mig = new CreateMachineStateStore1708797018115();
9221
9595
  await mig.up(queryRunner);
9222
- debug22("Migration statements executed");
9596
+ debug23("Migration statements executed");
9223
9597
  return;
9224
9598
  }
9225
9599
  case "sqlite":
9226
9600
  case "expo":
9227
9601
  case "react-native": {
9228
- debug22("using sqlite/react-native migration file");
9602
+ debug23("using sqlite/react-native migration file");
9229
9603
  const mig = new CreateMachineStateStore1708796002272();
9230
9604
  await mig.up(queryRunner);
9231
- debug22("Migration statements executed");
9605
+ debug23("Migration statements executed");
9232
9606
  return;
9233
9607
  }
9234
9608
  default:
@@ -9236,23 +9610,23 @@ var CreateMachineStateStore1708098041262 = class {
9236
9610
  }
9237
9611
  }
9238
9612
  async down(queryRunner) {
9239
- debug22("migration: reverting machine state tables");
9613
+ debug23("migration: reverting machine state tables");
9240
9614
  const dbType = queryRunner.connection.driver.options.type;
9241
9615
  switch (dbType) {
9242
9616
  case "postgres": {
9243
- debug22("using postgres migration file");
9617
+ debug23("using postgres migration file");
9244
9618
  const mig = new CreateMachineStateStore1708797018115();
9245
9619
  await mig.down(queryRunner);
9246
- debug22("Migration statements executed");
9620
+ debug23("Migration statements executed");
9247
9621
  return;
9248
9622
  }
9249
9623
  case "sqlite":
9250
9624
  case "expo":
9251
9625
  case "react-native": {
9252
- debug22("using sqlite/react-native migration file");
9626
+ debug23("using sqlite/react-native migration file");
9253
9627
  const mig = new CreateMachineStateStore1708796002272();
9254
9628
  await mig.down(queryRunner);
9255
- debug22("Migration statements executed");
9629
+ debug23("Migration statements executed");
9256
9630
  return;
9257
9631
  }
9258
9632
  default:
@@ -9262,7 +9636,7 @@ var CreateMachineStateStore1708098041262 = class {
9262
9636
  };
9263
9637
 
9264
9638
  // src/migrations/generic/8-CreateContacts.ts
9265
- var import_debug23 = __toESM(require("debug"), 1);
9639
+ var import_debug24 = __toESM(require("debug"), 1);
9266
9640
 
9267
9641
  // src/migrations/postgres/1710438363001-CreateContacts.ts
9268
9642
  var CreateContacts1710438363001 = class {
@@ -9376,30 +9750,30 @@ var CreateContacts1710438363002 = class {
9376
9750
  };
9377
9751
 
9378
9752
  // src/migrations/generic/8-CreateContacts.ts
9379
- var debug23 = (0, import_debug23.default)("sphereon:ssi-sdk:migrations");
9753
+ var debug24 = (0, import_debug24.default)("sphereon:ssi-sdk:migrations");
9380
9754
  var CreateContacts1708525189000 = class {
9381
9755
  static {
9382
9756
  __name(this, "CreateContacts1708525189000");
9383
9757
  }
9384
9758
  name = "CreateContacts1708525189000";
9385
9759
  async up(queryRunner) {
9386
- debug23("migration: updating contact tables");
9760
+ debug24("migration: updating contact tables");
9387
9761
  const dbType = queryRunner.connection.driver.options.type;
9388
9762
  switch (dbType) {
9389
9763
  case "postgres": {
9390
- debug23("using postgres migration file");
9764
+ debug24("using postgres migration file");
9391
9765
  const mig = new CreateContacts1710438363001();
9392
9766
  await mig.up(queryRunner);
9393
- debug23("Migration statements executed");
9767
+ debug24("Migration statements executed");
9394
9768
  return;
9395
9769
  }
9396
9770
  case "sqlite":
9397
9771
  case "expo":
9398
9772
  case "react-native": {
9399
- debug23("using sqlite/react-native migration file");
9773
+ debug24("using sqlite/react-native migration file");
9400
9774
  const mig = new CreateContacts1710438363002();
9401
9775
  await mig.up(queryRunner);
9402
- debug23("Migration statements executed");
9776
+ debug24("Migration statements executed");
9403
9777
  return;
9404
9778
  }
9405
9779
  default:
@@ -9407,23 +9781,23 @@ var CreateContacts1708525189000 = class {
9407
9781
  }
9408
9782
  }
9409
9783
  async down(queryRunner) {
9410
- debug23("migration: reverting machine state tables");
9784
+ debug24("migration: reverting machine state tables");
9411
9785
  const dbType = queryRunner.connection.driver.options.type;
9412
9786
  switch (dbType) {
9413
9787
  case "postgres": {
9414
- debug23("using postgres migration file");
9788
+ debug24("using postgres migration file");
9415
9789
  const mig = new CreateContacts1710438363001();
9416
9790
  await mig.down(queryRunner);
9417
- debug23("Migration statements executed");
9791
+ debug24("Migration statements executed");
9418
9792
  return;
9419
9793
  }
9420
9794
  case "sqlite":
9421
9795
  case "expo":
9422
9796
  case "react-native": {
9423
- debug23("using sqlite/react-native migration file");
9797
+ debug24("using sqlite/react-native migration file");
9424
9798
  const mig = new CreateContacts1710438363002();
9425
9799
  await mig.down(queryRunner);
9426
- debug23("Migration statements executed");
9800
+ debug24("Migration statements executed");
9427
9801
  return;
9428
9802
  }
9429
9803
  default:
@@ -9433,7 +9807,7 @@ var CreateContacts1708525189000 = class {
9433
9807
  };
9434
9808
 
9435
9809
  // src/migrations/generic/9-CreateContacts.ts
9436
- var import_debug24 = __toESM(require("debug"), 1);
9810
+ var import_debug25 = __toESM(require("debug"), 1);
9437
9811
 
9438
9812
  // src/migrations/postgres/1715761125001-CreateContacts.ts
9439
9813
  var CreateContacts1715761125001 = class {
@@ -9545,30 +9919,30 @@ var CreateContacts1715761125002 = class {
9545
9919
  };
9546
9920
 
9547
9921
  // src/migrations/generic/9-CreateContacts.ts
9548
- var debug24 = (0, import_debug24.default)("sphereon:ssi-sdk:migrations");
9922
+ var debug25 = (0, import_debug25.default)("sphereon:ssi-sdk:migrations");
9549
9923
  var CreateContacts1715761125000 = class {
9550
9924
  static {
9551
9925
  __name(this, "CreateContacts1715761125000");
9552
9926
  }
9553
9927
  name = "CreateContacts1715761125000";
9554
9928
  async up(queryRunner) {
9555
- debug24("migration: updating contact tables");
9929
+ debug25("migration: updating contact tables");
9556
9930
  const dbType = queryRunner.connection.driver.options.type;
9557
9931
  switch (dbType) {
9558
9932
  case "postgres": {
9559
- debug24("using postgres migration file");
9933
+ debug25("using postgres migration file");
9560
9934
  const mig = new CreateContacts1715761125001();
9561
9935
  await mig.up(queryRunner);
9562
- debug24("Migration statements executed");
9936
+ debug25("Migration statements executed");
9563
9937
  return;
9564
9938
  }
9565
9939
  case "sqlite":
9566
9940
  case "expo":
9567
9941
  case "react-native": {
9568
- debug24("using sqlite/react-native migration file");
9942
+ debug25("using sqlite/react-native migration file");
9569
9943
  const mig = new CreateContacts1715761125002();
9570
9944
  await mig.up(queryRunner);
9571
- debug24("Migration statements executed");
9945
+ debug25("Migration statements executed");
9572
9946
  return;
9573
9947
  }
9574
9948
  default:
@@ -9576,23 +9950,23 @@ var CreateContacts1715761125000 = class {
9576
9950
  }
9577
9951
  }
9578
9952
  async down(queryRunner) {
9579
- debug24("migration: reverting machine state tables");
9953
+ debug25("migration: reverting machine state tables");
9580
9954
  const dbType = queryRunner.connection.driver.options.type;
9581
9955
  switch (dbType) {
9582
9956
  case "postgres": {
9583
- debug24("using postgres migration file");
9957
+ debug25("using postgres migration file");
9584
9958
  const mig = new CreateContacts1715761125001();
9585
9959
  await mig.down(queryRunner);
9586
- debug24("Migration statements executed");
9960
+ debug25("Migration statements executed");
9587
9961
  return;
9588
9962
  }
9589
9963
  case "sqlite":
9590
9964
  case "expo":
9591
9965
  case "react-native": {
9592
- debug24("using sqlite/react-native migration file");
9966
+ debug25("using sqlite/react-native migration file");
9593
9967
  const mig = new CreateContacts1715761125002();
9594
9968
  await mig.down(queryRunner);
9595
- debug24("Migration statements executed");
9969
+ debug25("Migration statements executed");
9596
9970
  return;
9597
9971
  }
9598
9972
  default:
@@ -9610,7 +9984,8 @@ var DataStoreContactMigrations = [
9610
9984
  ];
9611
9985
  var DataStoreIssuanceBrandingMigrations = [
9612
9986
  CreateIssuanceBranding1659463079429,
9613
- FixCredentialClaimsReferencesUuid1741895822987
9987
+ FixCredentialClaimsReferencesUuid1741895822987,
9988
+ AddBrandingState1766000000000
9614
9989
  ];
9615
9990
  var DataStoreStatusListMigrations = [
9616
9991
  CreateStatusList1693866470000,