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

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
@@ -106,6 +106,7 @@ __export(index_exports, {
106
106
  credentialBrandingFrom: () => credentialBrandingFrom,
107
107
  credentialClaimsEntityFrom: () => credentialClaimsEntityFrom,
108
108
  credentialLocaleBrandingEntityFrom: () => credentialLocaleBrandingEntityFrom,
109
+ credentialLocaleBrandingFromEntity: () => credentialLocaleBrandingFromEntity,
109
110
  dcqlQueryEntityItemFrom: () => dcqlQueryEntityItemFrom,
110
111
  dcqlQueryItemFrom: () => dcqlQueryItemFrom,
111
112
  didAuthConfigEntityFrom: () => didAuthConfigEntityFrom,
@@ -3028,6 +3029,19 @@ var import_typeorm26 = require("typeorm");
3028
3029
  // src/entities/issuanceBranding/CredentialLocaleBrandingEntity.ts
3029
3030
  var import_typeorm25 = require("typeorm");
3030
3031
 
3032
+ // src/utils/issuanceBranding/HashUtils.ts
3033
+ var FNV_PRIME = 0x100000001b3n;
3034
+ var OFFSET_BASIS = 0xcbf29ce484222325n;
3035
+ function computeCompactHash(input) {
3036
+ let hash = OFFSET_BASIS;
3037
+ for (let i = 0; i < input.length; i++) {
3038
+ hash ^= BigInt(input.charCodeAt(i));
3039
+ hash = hash * FNV_PRIME & 0xffffffffffffffffn;
3040
+ }
3041
+ return hash.toString(36);
3042
+ }
3043
+ __name(computeCompactHash, "computeCompactHash");
3044
+
3031
3045
  // src/entities/issuanceBranding/CredentialClaimsEntity.ts
3032
3046
  var import_class_validator16 = require("class-validator");
3033
3047
  var import_typeorm24 = require("typeorm");
@@ -3132,6 +3146,10 @@ var CredentialLocaleBrandingEntity = class extends BaseLocaleBrandingEntity {
3132
3146
  credentialBranding;
3133
3147
  claims;
3134
3148
  credentialBrandingId;
3149
+ state;
3150
+ setState() {
3151
+ this.state = computeCredentialLocaleBrandingState(this);
3152
+ }
3135
3153
  };
3136
3154
  _ts_decorate26([
3137
3155
  (0, import_typeorm25.ManyToOne)(() => CredentialBrandingEntity, (credentialBranding) => credentialBranding.localeBranding, {
@@ -3161,6 +3179,21 @@ _ts_decorate26([
3161
3179
  }),
3162
3180
  _ts_metadata25("design:type", String)
3163
3181
  ], CredentialLocaleBrandingEntity.prototype, "credentialBrandingId", void 0);
3182
+ _ts_decorate26([
3183
+ (0, import_typeorm25.Column)("varchar", {
3184
+ name: "state",
3185
+ length: 255,
3186
+ nullable: false
3187
+ }),
3188
+ _ts_metadata25("design:type", String)
3189
+ ], CredentialLocaleBrandingEntity.prototype, "state", void 0);
3190
+ _ts_decorate26([
3191
+ (0, import_typeorm25.BeforeInsert)(),
3192
+ (0, import_typeorm25.BeforeUpdate)(),
3193
+ _ts_metadata25("design:type", Function),
3194
+ _ts_metadata25("design:paramtypes", []),
3195
+ _ts_metadata25("design:returntype", void 0)
3196
+ ], CredentialLocaleBrandingEntity.prototype, "setState", null);
3164
3197
  CredentialLocaleBrandingEntity = _ts_decorate26([
3165
3198
  (0, import_typeorm25.ChildEntity)("CredentialLocaleBranding"),
3166
3199
  (0, import_typeorm25.Index)("IDX_CredentialLocaleBrandingEntity_credentialBranding_locale", [
@@ -3170,6 +3203,45 @@ CredentialLocaleBrandingEntity = _ts_decorate26([
3170
3203
  unique: true
3171
3204
  })
3172
3205
  ], CredentialLocaleBrandingEntity);
3206
+ var computeCredentialLocaleBrandingState = /* @__PURE__ */ __name((localeBranding) => {
3207
+ const sortedClaims = (localeBranding.claims ?? []).map((claim) => ({
3208
+ key: claim.key,
3209
+ name: claim.name
3210
+ })).sort((first, second) => first.key.localeCompare(second.key));
3211
+ const payload = {
3212
+ alias: localeBranding.alias ?? null,
3213
+ locale: localeBranding.locale ?? null,
3214
+ description: localeBranding.description ?? null,
3215
+ logo: localeBranding.logo ? {
3216
+ uri: localeBranding.logo.uri ?? null,
3217
+ dataUri: localeBranding.logo.dataUri ?? null,
3218
+ mediaType: localeBranding.logo.mediaType ?? null,
3219
+ alt: localeBranding.logo.alt ?? null,
3220
+ dimensions: localeBranding.logo.dimensions ? {
3221
+ width: localeBranding.logo.dimensions.width,
3222
+ height: localeBranding.logo.dimensions.height
3223
+ } : null
3224
+ } : null,
3225
+ background: localeBranding.background ? {
3226
+ color: localeBranding.background.color ?? null,
3227
+ image: localeBranding.background.image ? {
3228
+ uri: localeBranding.background.image.uri ?? null,
3229
+ dataUri: localeBranding.background.image.dataUri ?? null,
3230
+ mediaType: localeBranding.background.image.mediaType ?? null,
3231
+ alt: localeBranding.background.image.alt ?? null,
3232
+ dimensions: localeBranding.background.image.dimensions ? {
3233
+ width: localeBranding.background.image.dimensions.width,
3234
+ height: localeBranding.background.image.dimensions.height
3235
+ } : null
3236
+ } : null
3237
+ } : null,
3238
+ text: localeBranding.text ? {
3239
+ color: localeBranding.text.color ?? null
3240
+ } : null,
3241
+ claims: sortedClaims
3242
+ };
3243
+ return computeCompactHash(JSON.stringify(payload));
3244
+ }, "computeCredentialLocaleBrandingState");
3173
3245
 
3174
3246
  // src/entities/issuanceBranding/CredentialBrandingEntity.ts
3175
3247
  function _ts_decorate27(decorators, target, key, desc) {
@@ -3190,6 +3262,7 @@ var CredentialBrandingEntity = class extends import_typeorm26.BaseEntity {
3190
3262
  id;
3191
3263
  vcHash;
3192
3264
  issuerCorrelationId;
3265
+ state;
3193
3266
  localeBranding;
3194
3267
  createdAt;
3195
3268
  lastUpdatedAt;
@@ -3197,6 +3270,11 @@ var CredentialBrandingEntity = class extends import_typeorm26.BaseEntity {
3197
3270
  updateUpdatedDate() {
3198
3271
  this.lastUpdatedAt = /* @__PURE__ */ new Date();
3199
3272
  }
3273
+ setState() {
3274
+ if (this.localeBranding && Array.isArray(this.localeBranding)) {
3275
+ this.state = this.computeState();
3276
+ }
3277
+ }
3200
3278
  async validate() {
3201
3279
  const validation = await (0, import_class_validator17.validate)(this);
3202
3280
  if (validation.length > 0) {
@@ -3204,6 +3282,31 @@ var CredentialBrandingEntity = class extends import_typeorm26.BaseEntity {
3204
3282
  }
3205
3283
  return;
3206
3284
  }
3285
+ computeState() {
3286
+ const localeStates = (this.localeBranding ?? []).map((localeBranding) => ({
3287
+ locale: localeBranding.locale ?? "",
3288
+ alias: localeBranding.alias ?? "",
3289
+ id: localeBranding.id ?? "",
3290
+ state: computeCredentialLocaleBrandingState(localeBranding)
3291
+ }));
3292
+ localeStates.sort((first, second) => {
3293
+ const localeCompare = first.locale.localeCompare(second.locale);
3294
+ if (localeCompare !== 0) {
3295
+ return localeCompare;
3296
+ }
3297
+ const aliasCompare = first.alias.localeCompare(second.alias);
3298
+ if (aliasCompare !== 0) {
3299
+ return aliasCompare;
3300
+ }
3301
+ return first.id.localeCompare(second.id);
3302
+ });
3303
+ const payload = {
3304
+ issuerCorrelationId: this.issuerCorrelationId,
3305
+ vcHash: this.vcHash,
3306
+ localeBranding: localeStates.map((entry) => entry.state)
3307
+ };
3308
+ return computeCompactHash(JSON.stringify(payload));
3309
+ }
3207
3310
  };
3208
3311
  _ts_decorate27([
3209
3312
  (0, import_typeorm26.PrimaryGeneratedColumn)("uuid"),
@@ -3233,6 +3336,14 @@ _ts_decorate27([
3233
3336
  }),
3234
3337
  _ts_metadata26("design:type", String)
3235
3338
  ], CredentialBrandingEntity.prototype, "issuerCorrelationId", void 0);
3339
+ _ts_decorate27([
3340
+ (0, import_typeorm26.Column)("varchar", {
3341
+ name: "state",
3342
+ length: 255,
3343
+ nullable: false
3344
+ }),
3345
+ _ts_metadata26("design:type", String)
3346
+ ], CredentialBrandingEntity.prototype, "state", void 0);
3236
3347
  _ts_decorate27([
3237
3348
  (0, import_typeorm26.OneToMany)(() => CredentialLocaleBrandingEntity, (credentialLocaleBrandingEntity) => credentialLocaleBrandingEntity.credentialBranding, {
3238
3349
  cascade: true,
@@ -3268,6 +3379,13 @@ _ts_decorate27([
3268
3379
  _ts_metadata26("design:paramtypes", []),
3269
3380
  _ts_metadata26("design:returntype", void 0)
3270
3381
  ], CredentialBrandingEntity.prototype, "updateUpdatedDate", null);
3382
+ _ts_decorate27([
3383
+ (0, import_typeorm26.BeforeInsert)(),
3384
+ (0, import_typeorm26.BeforeUpdate)(),
3385
+ _ts_metadata26("design:type", Function),
3386
+ _ts_metadata26("design:paramtypes", []),
3387
+ _ts_metadata26("design:returntype", void 0)
3388
+ ], CredentialBrandingEntity.prototype, "setState", null);
3271
3389
  _ts_decorate27([
3272
3390
  (0, import_typeorm26.BeforeInsert)(),
3273
3391
  (0, import_typeorm26.BeforeUpdate)(),
@@ -3314,6 +3432,48 @@ var IssuerLocaleBrandingEntity = class extends BaseLocaleBrandingEntity {
3314
3432
  policyUri;
3315
3433
  contacts;
3316
3434
  issuerBrandingId;
3435
+ state;
3436
+ setState() {
3437
+ this.state = this.computeState();
3438
+ }
3439
+ computeState() {
3440
+ const payload = {
3441
+ alias: this.alias ?? null,
3442
+ locale: this.locale ?? null,
3443
+ description: this.description ?? null,
3444
+ clientUri: this.clientUri ?? null,
3445
+ tosUri: this.tosUri ?? null,
3446
+ policyUri: this.policyUri ?? null,
3447
+ contacts: this.contacts ?? null,
3448
+ logo: this.logo ? {
3449
+ uri: this.logo.uri ?? null,
3450
+ dataUri: this.logo.dataUri ?? null,
3451
+ mediaType: this.logo.mediaType ?? null,
3452
+ alt: this.logo.alt ?? null,
3453
+ dimensions: this.logo.dimensions ? {
3454
+ width: this.logo.dimensions.width,
3455
+ height: this.logo.dimensions.height
3456
+ } : null
3457
+ } : null,
3458
+ background: this.background ? {
3459
+ color: this.background.color ?? null,
3460
+ image: this.background.image ? {
3461
+ uri: this.background.image.uri ?? null,
3462
+ dataUri: this.background.image.dataUri ?? null,
3463
+ mediaType: this.background.image.mediaType ?? null,
3464
+ alt: this.background.image.alt ?? null,
3465
+ dimensions: this.background.image.dimensions ? {
3466
+ width: this.background.image.dimensions.width,
3467
+ height: this.background.image.dimensions.height
3468
+ } : null
3469
+ } : null
3470
+ } : null,
3471
+ text: this.text ? {
3472
+ color: this.text.color ?? null
3473
+ } : null
3474
+ };
3475
+ return computeCompactHash(JSON.stringify(payload));
3476
+ }
3317
3477
  };
3318
3478
  _ts_decorate28([
3319
3479
  (0, import_typeorm27.ManyToOne)(() => IssuerBrandingEntity, (issuerBranding) => issuerBranding.localeBranding, {
@@ -3372,6 +3532,21 @@ _ts_decorate28([
3372
3532
  }),
3373
3533
  _ts_metadata27("design:type", String)
3374
3534
  ], IssuerLocaleBrandingEntity.prototype, "issuerBrandingId", void 0);
3535
+ _ts_decorate28([
3536
+ (0, import_typeorm27.Column)("varchar", {
3537
+ name: "state",
3538
+ length: 255,
3539
+ nullable: false
3540
+ }),
3541
+ _ts_metadata27("design:type", String)
3542
+ ], IssuerLocaleBrandingEntity.prototype, "state", void 0);
3543
+ _ts_decorate28([
3544
+ (0, import_typeorm27.BeforeInsert)(),
3545
+ (0, import_typeorm27.BeforeUpdate)(),
3546
+ _ts_metadata27("design:type", Function),
3547
+ _ts_metadata27("design:paramtypes", []),
3548
+ _ts_metadata27("design:returntype", void 0)
3549
+ ], IssuerLocaleBrandingEntity.prototype, "setState", null);
3375
3550
  IssuerLocaleBrandingEntity = _ts_decorate28([
3376
3551
  (0, import_typeorm27.ChildEntity)("IssuerLocaleBranding"),
3377
3552
  (0, import_typeorm27.Index)("IDX_IssuerLocaleBrandingEntity_issuerBranding_locale", [
@@ -4806,10 +4981,19 @@ var ContactStore = class extends import_ssi_sdk25.AbstractContactStore {
4806
4981
  const result = await partyRepository.find({
4807
4982
  where: {
4808
4983
  id: (0, import_typeorm35.In)(initialResult.map((party) => party.id))
4809
- }
4984
+ },
4985
+ relations: [
4986
+ "contact"
4987
+ ]
4810
4988
  });
4811
4989
  debug(`getParties() resulted in ${result.length} parties`);
4812
- return result.map(partyFrom);
4990
+ return result.filter((party) => {
4991
+ if (!party.contact) {
4992
+ console.warn(`party ${party.id} does not have an associated contact`);
4993
+ return false;
4994
+ }
4995
+ return true;
4996
+ }).map(partyFrom);
4813
4997
  }, "getParties");
4814
4998
  addParty = /* @__PURE__ */ __name(async (args) => {
4815
4999
  const { identities, contact, partyType } = args;
@@ -5605,7 +5789,7 @@ var import_typeorm37 = require("typeorm");
5605
5789
  var credentialBrandingFrom = /* @__PURE__ */ __name((credentialBranding) => {
5606
5790
  const result = {
5607
5791
  ...credentialBranding,
5608
- localeBranding: credentialBranding.localeBranding.map((localeBranding) => localeBrandingFrom(localeBranding))
5792
+ localeBranding: credentialBranding.localeBranding.map((localeBranding) => credentialLocaleBrandingFromEntity(localeBranding))
5609
5793
  };
5610
5794
  return replaceNullWithUndefined(result);
5611
5795
  }, "credentialBrandingFrom");
@@ -5623,6 +5807,19 @@ var localeBrandingFrom = /* @__PURE__ */ __name((localeBranding) => {
5623
5807
  };
5624
5808
  return replaceNullWithUndefined(result);
5625
5809
  }, "localeBrandingFrom");
5810
+ var credentialLocaleBrandingFromEntity = /* @__PURE__ */ __name((localeBranding) => {
5811
+ const base = localeBrandingFrom(localeBranding);
5812
+ const result = {
5813
+ ...base,
5814
+ state: localeBranding.state,
5815
+ claims: localeBranding.claims ? localeBranding.claims.map((claim) => ({
5816
+ id: claim.id,
5817
+ key: claim.key,
5818
+ name: claim.name
5819
+ })) : void 0
5820
+ };
5821
+ return replaceNullWithUndefined(result);
5822
+ }, "credentialLocaleBrandingFromEntity");
5626
5823
  var issuerLocaleBrandingEntityFrom = /* @__PURE__ */ __name((args) => {
5627
5824
  const issuerLocaleBrandingEntity = new IssuerLocaleBrandingEntity();
5628
5825
  issuerLocaleBrandingEntity.alias = isEmptyString(args.alias) ? void 0 : args.alias;
@@ -5727,7 +5924,7 @@ var IssuanceBrandingStore = class extends import_ssi_sdk27.AbstractIssuanceBrand
5727
5924
  return credentialBrandingFrom(createdResult);
5728
5925
  }, "addCredentialBranding");
5729
5926
  getCredentialBranding = /* @__PURE__ */ __name(async (args) => {
5730
- const { filter } = args ?? {};
5927
+ const { filter, knownStates } = args ?? {};
5731
5928
  if (filter) {
5732
5929
  filter.forEach((filter2) => {
5733
5930
  if (filter2.localeBranding && "locale" in filter2.localeBranding && filter2.localeBranding.locale === void 0) {
@@ -5736,12 +5933,39 @@ var IssuanceBrandingStore = class extends import_ssi_sdk27.AbstractIssuanceBrand
5736
5933
  });
5737
5934
  }
5738
5935
  debug3("Getting credential branding", args);
5739
- const result = await (await this.dbConnection).getRepository(CredentialBrandingEntity).find({
5936
+ const repository = (await this.dbConnection).getRepository(CredentialBrandingEntity);
5937
+ if (knownStates && Object.keys(knownStates).length > 0) {
5938
+ const stateQuery = repository.createQueryBuilder("branding").select([
5939
+ "branding.id",
5940
+ "branding.state"
5941
+ ]);
5942
+ if (filter) {
5943
+ stateQuery.where(filter);
5944
+ }
5945
+ const stateResults = await stateQuery.getRawMany().then((rows) => rows.map((row) => ({
5946
+ id: row.branding_id,
5947
+ state: row.branding_state
5948
+ })));
5949
+ const dirtyIds = stateResults.filter((result3) => {
5950
+ const knownState = knownStates[result3.id];
5951
+ return !knownState || knownState !== result3.state;
5952
+ }).map((result3) => result3.id);
5953
+ if (dirtyIds.length === 0) {
5954
+ return [];
5955
+ }
5956
+ const result2 = await repository.find({
5957
+ where: {
5958
+ id: (0, import_typeorm37.In)(dirtyIds)
5959
+ }
5960
+ });
5961
+ return result2.map((branding) => credentialBrandingFrom(branding));
5962
+ }
5963
+ const result = await repository.find({
5740
5964
  ...filter && {
5741
5965
  where: filter
5742
5966
  }
5743
5967
  });
5744
- return result.map((credentialBranding) => credentialBrandingFrom(credentialBranding));
5968
+ return result.map((branding) => credentialBrandingFrom(branding));
5745
5969
  }, "getCredentialBranding");
5746
5970
  removeCredentialBranding = /* @__PURE__ */ __name(async (args) => {
5747
5971
  const { filter } = args;
@@ -5834,7 +6058,7 @@ var IssuanceBrandingStore = class extends import_ssi_sdk27.AbstractIssuanceBrand
5834
6058
  where: filter
5835
6059
  }
5836
6060
  });
5837
- return credentialBrandingLocale ? credentialBrandingLocale.map((credentialLocaleBranding) => localeBrandingFrom(credentialLocaleBranding)) : [];
6061
+ return credentialBrandingLocale ? credentialBrandingLocale.map((credentialLocaleBranding) => credentialLocaleBrandingFromEntity(credentialLocaleBranding)) : [];
5838
6062
  }, "getCredentialLocaleBranding");
5839
6063
  removeCredentialLocaleBranding = /* @__PURE__ */ __name(async (args) => {
5840
6064
  const { filter } = args;
@@ -8094,21 +8318,113 @@ var AddLinkedVpFields1763387280000 = class {
8094
8318
  }
8095
8319
  };
8096
8320
 
8097
- // src/migrations/generic/2-CreateIssuanceBranding.ts
8321
+ // src/migrations/generic/15-AddBrandingState.ts
8098
8322
  var import_debug14 = __toESM(require("debug"), 1);
8323
+
8324
+ // src/migrations/postgres/1766000000000-AddBrandingState.ts
8325
+ var AddBrandingStatePostgres1766000000000 = class {
8326
+ static {
8327
+ __name(this, "AddBrandingStatePostgres1766000000000");
8328
+ }
8329
+ name = "AddBrandingState1766000000000";
8330
+ async up(queryRunner) {
8331
+ await queryRunner.query(`ALTER TABLE "CredentialBranding" ADD "state" character varying(255) NOT NULL DEFAULT ''`);
8332
+ await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" ADD "state" character varying(255) NOT NULL DEFAULT ''`);
8333
+ }
8334
+ async down(queryRunner) {
8335
+ await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP COLUMN "state"`);
8336
+ await queryRunner.query(`ALTER TABLE "CredentialBranding" DROP COLUMN "state"`);
8337
+ }
8338
+ };
8339
+
8340
+ // src/migrations/sqlite/1766000000000-AddBrandingState.ts
8341
+ var AddBrandingStateSqlite1766000000000 = class {
8342
+ static {
8343
+ __name(this, "AddBrandingStateSqlite1766000000000");
8344
+ }
8345
+ name = "AddBrandingState1766000000000";
8346
+ async up(queryRunner) {
8347
+ await queryRunner.query(`ALTER TABLE "CredentialBranding" ADD COLUMN "state" varchar(255) NOT NULL DEFAULT ''`);
8348
+ await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" ADD COLUMN "state" varchar(255) NOT NULL DEFAULT ''`);
8349
+ }
8350
+ async down(queryRunner) {
8351
+ await queryRunner.query(`PRAGMA foreign_keys = OFF`);
8352
+ await queryRunner.query(`
8353
+ CREATE TABLE "CredentialBranding_old"
8354
+ (
8355
+ "id" varchar PRIMARY KEY NOT NULL,
8356
+ "vcHash" varchar(255) NOT NULL,
8357
+ "issuerCorrelationId" varchar(255) NOT NULL,
8358
+ "created_at" datetime NOT NULL DEFAULT (datetime('now')),
8359
+ "last_updated_at" datetime NOT NULL DEFAULT (datetime('now'))
8360
+ )
8361
+ `);
8362
+ await queryRunner.query(`
8363
+ INSERT INTO "CredentialBranding_old" ("id", "vcHash", "issuerCorrelationId", "created_at", "last_updated_at")
8364
+ SELECT "id", "vcHash", "issuerCorrelationId", "created_at", "last_updated_at"
8365
+ FROM "CredentialBranding"
8366
+ `);
8367
+ await queryRunner.query(`DROP TABLE "CredentialBranding"`);
8368
+ await queryRunner.query(`ALTER TABLE "CredentialBranding_old" RENAME TO "CredentialBranding"`);
8369
+ await queryRunner.query(`CREATE INDEX "IDX_CredentialBrandingEntity_issuerCorrelationId" ON "CredentialBranding" ("issuerCorrelationId")`);
8370
+ await queryRunner.query(`CREATE INDEX "IDX_CredentialBrandingEntity_vcHash" ON "CredentialBranding" ("vcHash")`);
8371
+ await queryRunner.query(`
8372
+ CREATE TABLE "BaseLocaleBranding_old"
8373
+ (
8374
+ "id" varchar PRIMARY KEY NOT NULL,
8375
+ "alias" varchar(255),
8376
+ "locale" varchar(255) NOT NULL,
8377
+ "description" varchar(255),
8378
+ "created_at" datetime NOT NULL DEFAULT (datetime('now')),
8379
+ "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')),
8380
+ "credentialBrandingId" varchar,
8381
+ "issuerBrandingId" varchar,
8382
+ "type" varchar NOT NULL,
8383
+ "logoId" varchar,
8384
+ "backgroundId" varchar,
8385
+ "textId" varchar,
8386
+ "client_uri" varchar,
8387
+ "tos_uri" varchar,
8388
+ "policy_uri" varchar,
8389
+ "contacts" varchar,
8390
+ CONSTRAINT "UQ_logoId" UNIQUE ("logoId"),
8391
+ CONSTRAINT "UQ_backgroundId" UNIQUE ("backgroundId"),
8392
+ CONSTRAINT "UQ_textId" UNIQUE ("textId"),
8393
+ CONSTRAINT "FK_BaseLocaleBranding_logoId" FOREIGN KEY ("logoId") REFERENCES "ImageAttributes" ("id") ON DELETE CASCADE ON UPDATE NO ACTION,
8394
+ CONSTRAINT "FK_BaseLocaleBranding_backgroundId" FOREIGN KEY ("backgroundId") REFERENCES "BackgroundAttributes" ("id") ON DELETE CASCADE ON UPDATE NO ACTION,
8395
+ CONSTRAINT "FK_BaseLocaleBranding_textId" FOREIGN KEY ("textId") REFERENCES "TextAttributes" ("id") ON DELETE CASCADE ON UPDATE NO ACTION,
8396
+ CONSTRAINT "FK_BaseLocaleBranding_credentialBrandingId" FOREIGN KEY ("credentialBrandingId") REFERENCES "CredentialBranding" ("id") ON DELETE CASCADE ON UPDATE NO ACTION,
8397
+ CONSTRAINT "FK_BaseLocaleBranding_issuerBrandingId" FOREIGN KEY ("issuerBrandingId") REFERENCES "IssuerBranding" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
8398
+ )
8399
+ `);
8400
+ await queryRunner.query(`
8401
+ 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")
8402
+ SELECT "id", "alias", "locale", "description", "created_at", "last_updated_at", "credentialBrandingId", "issuerBrandingId", "type", "logoId", "backgroundId", "textId", "client_uri", "tos_uri", "policy_uri", "contacts"
8403
+ FROM "BaseLocaleBranding"
8404
+ `);
8405
+ await queryRunner.query(`DROP TABLE "BaseLocaleBranding"`);
8406
+ await queryRunner.query(`ALTER TABLE "BaseLocaleBranding_old" RENAME TO "BaseLocaleBranding"`);
8407
+ await queryRunner.query(`CREATE UNIQUE INDEX "IDX_CredentialLocaleBrandingEntity_credentialBranding_locale" ON "BaseLocaleBranding" ("credentialBrandingId", "locale")`);
8408
+ await queryRunner.query(`CREATE UNIQUE INDEX "IDX_IssuerLocaleBrandingEntity_issuerBranding_locale" ON "BaseLocaleBranding" ("issuerBrandingId", "locale")`);
8409
+ await queryRunner.query(`CREATE INDEX "IDX_BaseLocaleBranding_type" ON "BaseLocaleBranding" ("type")`);
8410
+ await queryRunner.query(`PRAGMA foreign_keys = ON`);
8411
+ }
8412
+ };
8413
+
8414
+ // src/migrations/generic/15-AddBrandingState.ts
8099
8415
  var debug14 = (0, import_debug14.default)("sphereon:ssi-sdk:migrations");
8100
- var CreateIssuanceBranding1659463079429 = class {
8416
+ var AddBrandingState1766000000000 = class {
8101
8417
  static {
8102
- __name(this, "CreateIssuanceBranding1659463079429");
8418
+ __name(this, "AddBrandingState1766000000000");
8103
8419
  }
8104
- name = "CreateIssuanceBranding1659463079429";
8420
+ name = "AddBrandingState1766000000000";
8105
8421
  async up(queryRunner) {
8106
- debug14("migration: creating issuance branding tables");
8422
+ debug14("migration: adding branding state checksum columns");
8107
8423
  const dbType = queryRunner.connection.driver.options.type;
8108
8424
  switch (dbType) {
8109
8425
  case "postgres": {
8110
8426
  debug14("using postgres migration file");
8111
- const mig = new CreateIssuanceBranding1685628974232();
8427
+ const mig = new AddBrandingStatePostgres1766000000000();
8112
8428
  await mig.up(queryRunner);
8113
8429
  debug14("Migration statements executed");
8114
8430
  return;
@@ -8117,7 +8433,7 @@ var CreateIssuanceBranding1659463079429 = class {
8117
8433
  case "expo":
8118
8434
  case "react-native": {
8119
8435
  debug14("using sqlite/react-native migration file");
8120
- const mig = new CreateIssuanceBranding1685628973231();
8436
+ const mig = new AddBrandingStateSqlite1766000000000();
8121
8437
  await mig.up(queryRunner);
8122
8438
  debug14("Migration statements executed");
8123
8439
  return;
@@ -8127,12 +8443,12 @@ var CreateIssuanceBranding1659463079429 = class {
8127
8443
  }
8128
8444
  }
8129
8445
  async down(queryRunner) {
8130
- debug14("migration: reverting issuance branding tables");
8446
+ debug14("migration: removing branding state checksum columns");
8131
8447
  const dbType = queryRunner.connection.driver.options.type;
8132
8448
  switch (dbType) {
8133
8449
  case "postgres": {
8134
8450
  debug14("using postgres migration file");
8135
- const mig = new CreateIssuanceBranding1685628974232();
8451
+ const mig = new AddBrandingStatePostgres1766000000000();
8136
8452
  await mig.down(queryRunner);
8137
8453
  debug14("Migration statements executed");
8138
8454
  return;
@@ -8141,7 +8457,7 @@ var CreateIssuanceBranding1659463079429 = class {
8141
8457
  case "expo":
8142
8458
  case "react-native": {
8143
8459
  debug14("using sqlite/react-native migration file");
8144
- const mig = new CreateIssuanceBranding1685628973231();
8460
+ const mig = new AddBrandingStateSqlite1766000000000();
8145
8461
  await mig.down(queryRunner);
8146
8462
  debug14("Migration statements executed");
8147
8463
  return;
@@ -8152,8 +8468,66 @@ var CreateIssuanceBranding1659463079429 = class {
8152
8468
  }
8153
8469
  };
8154
8470
 
8155
- // src/migrations/generic/3-CreateContacts.ts
8471
+ // src/migrations/generic/2-CreateIssuanceBranding.ts
8156
8472
  var import_debug15 = __toESM(require("debug"), 1);
8473
+ var debug15 = (0, import_debug15.default)("sphereon:ssi-sdk:migrations");
8474
+ var CreateIssuanceBranding1659463079429 = class {
8475
+ static {
8476
+ __name(this, "CreateIssuanceBranding1659463079429");
8477
+ }
8478
+ name = "CreateIssuanceBranding1659463079429";
8479
+ async up(queryRunner) {
8480
+ debug15("migration: creating issuance branding tables");
8481
+ const dbType = queryRunner.connection.driver.options.type;
8482
+ switch (dbType) {
8483
+ case "postgres": {
8484
+ debug15("using postgres migration file");
8485
+ const mig = new CreateIssuanceBranding1685628974232();
8486
+ await mig.up(queryRunner);
8487
+ debug15("Migration statements executed");
8488
+ return;
8489
+ }
8490
+ case "sqlite":
8491
+ case "expo":
8492
+ case "react-native": {
8493
+ debug15("using sqlite/react-native migration file");
8494
+ const mig = new CreateIssuanceBranding1685628973231();
8495
+ await mig.up(queryRunner);
8496
+ debug15("Migration statements executed");
8497
+ return;
8498
+ }
8499
+ default:
8500
+ 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`);
8501
+ }
8502
+ }
8503
+ async down(queryRunner) {
8504
+ debug15("migration: reverting issuance branding tables");
8505
+ const dbType = queryRunner.connection.driver.options.type;
8506
+ switch (dbType) {
8507
+ case "postgres": {
8508
+ debug15("using postgres migration file");
8509
+ const mig = new CreateIssuanceBranding1685628974232();
8510
+ await mig.down(queryRunner);
8511
+ debug15("Migration statements executed");
8512
+ return;
8513
+ }
8514
+ case "sqlite":
8515
+ case "expo":
8516
+ case "react-native": {
8517
+ debug15("using sqlite/react-native migration file");
8518
+ const mig = new CreateIssuanceBranding1685628973231();
8519
+ await mig.down(queryRunner);
8520
+ debug15("Migration statements executed");
8521
+ return;
8522
+ }
8523
+ default:
8524
+ 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`);
8525
+ }
8526
+ }
8527
+ };
8528
+
8529
+ // src/migrations/generic/3-CreateContacts.ts
8530
+ var import_debug16 = __toESM(require("debug"), 1);
8157
8531
 
8158
8532
  // src/migrations/postgres/1690925872592-CreateContacts.ts
8159
8533
  var import_ssi_sdk33 = require("@sphereon/ssi-sdk.core");
@@ -8374,30 +8748,30 @@ var CreateContacts1690925872693 = class {
8374
8748
  };
8375
8749
 
8376
8750
  // src/migrations/generic/3-CreateContacts.ts
8377
- var debug15 = (0, import_debug15.default)("sphereon:ssi-sdk:migrations");
8751
+ var debug16 = (0, import_debug16.default)("sphereon:ssi-sdk:migrations");
8378
8752
  var CreateContacts1690925872318 = class {
8379
8753
  static {
8380
8754
  __name(this, "CreateContacts1690925872318");
8381
8755
  }
8382
8756
  name = "CreateContacts1690925872318";
8383
8757
  async up(queryRunner) {
8384
- debug15("migration: creating contacts tables");
8758
+ debug16("migration: creating contacts tables");
8385
8759
  const dbType = queryRunner.connection.driver.options.type;
8386
8760
  switch (dbType) {
8387
8761
  case "postgres": {
8388
- debug15("using postgres migration file");
8762
+ debug16("using postgres migration file");
8389
8763
  const mig = new CreateContacts1690925872592();
8390
8764
  await mig.up(queryRunner);
8391
- debug15("Migration statements executed");
8765
+ debug16("Migration statements executed");
8392
8766
  return;
8393
8767
  }
8394
8768
  case "sqlite":
8395
8769
  case "expo":
8396
8770
  case "react-native": {
8397
- debug15("using sqlite/react-native migration file");
8771
+ debug16("using sqlite/react-native migration file");
8398
8772
  const mig = new CreateContacts1690925872693();
8399
8773
  await mig.up(queryRunner);
8400
- debug15("Migration statements executed");
8774
+ debug16("Migration statements executed");
8401
8775
  return;
8402
8776
  }
8403
8777
  default:
@@ -8405,23 +8779,23 @@ var CreateContacts1690925872318 = class {
8405
8779
  }
8406
8780
  }
8407
8781
  async down(queryRunner) {
8408
- debug15("migration: reverting contacts tables");
8782
+ debug16("migration: reverting contacts tables");
8409
8783
  const dbType = queryRunner.connection.driver.options.type;
8410
8784
  switch (dbType) {
8411
8785
  case "postgres": {
8412
- debug15("using postgres migration file");
8786
+ debug16("using postgres migration file");
8413
8787
  const mig = new CreateContacts1690925872592();
8414
8788
  await mig.down(queryRunner);
8415
- debug15("Migration statements executed");
8789
+ debug16("Migration statements executed");
8416
8790
  return;
8417
8791
  }
8418
8792
  case "sqlite":
8419
8793
  case "expo":
8420
8794
  case "react-native": {
8421
- debug15("using sqlite/react-native migration file");
8795
+ debug16("using sqlite/react-native migration file");
8422
8796
  const mig = new CreateContacts1690925872693();
8423
8797
  await mig.down(queryRunner);
8424
- debug15("Migration statements executed");
8798
+ debug16("Migration statements executed");
8425
8799
  return;
8426
8800
  }
8427
8801
  default:
@@ -8431,7 +8805,7 @@ var CreateContacts1690925872318 = class {
8431
8805
  };
8432
8806
 
8433
8807
  // src/migrations/generic/4-CreateStatusList.ts
8434
- var import_debug16 = __toESM(require("debug"), 1);
8808
+ var import_debug17 = __toESM(require("debug"), 1);
8435
8809
 
8436
8810
  // src/migrations/postgres/1693866470001-CreateStatusList.ts
8437
8811
  var CreateStatusList1693866470001 = class {
@@ -8637,53 +9011,53 @@ var UpdateStatusList1737110469000 = class {
8637
9011
  };
8638
9012
 
8639
9013
  // src/migrations/generic/4-CreateStatusList.ts
8640
- var debug16 = (0, import_debug16.default)("sphereon:ssi-sdk:migrations");
9014
+ var debug17 = (0, import_debug17.default)("sphereon:ssi-sdk:migrations");
8641
9015
  var CreateStatusList1693866470000 = class {
8642
9016
  static {
8643
9017
  __name(this, "CreateStatusList1693866470000");
8644
9018
  }
8645
9019
  name = "CreateStatusList1693866470000";
8646
9020
  async up(queryRunner) {
8647
- debug16("migration: creating issuance branding tables");
9021
+ debug17("migration: creating issuance branding tables");
8648
9022
  const dbType = queryRunner.connection.driver.options.type;
8649
9023
  if (dbType === "postgres") {
8650
- debug16("using postgres migration files");
9024
+ debug17("using postgres migration files");
8651
9025
  const createMig = new CreateStatusList1693866470001();
8652
9026
  await createMig.up(queryRunner);
8653
9027
  const updateMig = new UpdateStatusList1737110469001();
8654
9028
  const up = await updateMig.up(queryRunner);
8655
- debug16("Migration statements executed");
9029
+ debug17("Migration statements executed");
8656
9030
  return up;
8657
9031
  } else if (dbType === "sqlite" || dbType === "react-native" || dbType === "expo") {
8658
- debug16("using sqlite/react-native migration files");
9032
+ debug17("using sqlite/react-native migration files");
8659
9033
  const createMig = new CreateStatusList1693866470002();
8660
9034
  await createMig.up(queryRunner);
8661
9035
  const updateMig = new UpdateStatusList1737110469000();
8662
9036
  const up = await updateMig.up(queryRunner);
8663
- debug16("Migration statements executed");
9037
+ debug17("Migration statements executed");
8664
9038
  return up;
8665
9039
  } else {
8666
9040
  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`);
8667
9041
  }
8668
9042
  }
8669
9043
  async down(queryRunner) {
8670
- debug16("migration: reverting issuance branding tables");
9044
+ debug17("migration: reverting issuance branding tables");
8671
9045
  const dbType = queryRunner.connection.driver.options.type;
8672
9046
  if (dbType === "postgres") {
8673
- debug16("using postgres migration files");
9047
+ debug17("using postgres migration files");
8674
9048
  const updateMig = new UpdateStatusList1737110469001();
8675
9049
  await updateMig.down(queryRunner);
8676
9050
  const createMig = new CreateStatusList1693866470001();
8677
9051
  const down = await createMig.down(queryRunner);
8678
- debug16("Migration statements executed");
9052
+ debug17("Migration statements executed");
8679
9053
  return down;
8680
9054
  } else if (dbType === "sqlite" || dbType === "react-native" || dbType === "expo") {
8681
- debug16("using sqlite/react-native migration files");
9055
+ debug17("using sqlite/react-native migration files");
8682
9056
  const updateMig = new UpdateStatusList1737110469000();
8683
9057
  await updateMig.down(queryRunner);
8684
9058
  const createMig = new CreateStatusList1693866470002();
8685
9059
  const down = await createMig.down(queryRunner);
8686
- debug16("Migration statements executed");
9060
+ debug17("Migration statements executed");
8687
9061
  return down;
8688
9062
  } else {
8689
9063
  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`);
@@ -8692,7 +9066,7 @@ var CreateStatusList1693866470000 = class {
8692
9066
  };
8693
9067
 
8694
9068
  // src/migrations/generic/5-CreateAuditEvents.ts
8695
- var import_debug17 = __toESM(require("debug"), 1);
9069
+ var import_debug18 = __toESM(require("debug"), 1);
8696
9070
 
8697
9071
  // src/migrations/postgres/1701634812183-CreateAuditEvents.ts
8698
9072
  var CreateAuditEvents1701634812183 = class {
@@ -8791,30 +9165,30 @@ var CreateAuditEvents1701634819487 = class {
8791
9165
  };
8792
9166
 
8793
9167
  // src/migrations/generic/5-CreateAuditEvents.ts
8794
- var debug17 = (0, import_debug17.default)("sphereon:ssi-sdk:migrations");
9168
+ var debug18 = (0, import_debug18.default)("sphereon:ssi-sdk:migrations");
8795
9169
  var CreateAuditEvents1701635835330 = class {
8796
9170
  static {
8797
9171
  __name(this, "CreateAuditEvents1701635835330");
8798
9172
  }
8799
9173
  name = "CreateAuditEvents1701635835330";
8800
9174
  async up(queryRunner) {
8801
- debug17("migration: creating audit events tables");
9175
+ debug18("migration: creating audit events tables");
8802
9176
  const dbType = queryRunner.connection.driver.options.type;
8803
9177
  switch (dbType) {
8804
9178
  case "postgres": {
8805
- debug17("using postgres migration file");
9179
+ debug18("using postgres migration file");
8806
9180
  const mig = new CreateAuditEvents1701634812183();
8807
9181
  await mig.up(queryRunner);
8808
- debug17("Migration statements executed");
9182
+ debug18("Migration statements executed");
8809
9183
  return;
8810
9184
  }
8811
9185
  case "sqlite":
8812
9186
  case "expo":
8813
9187
  case "react-native": {
8814
- debug17("using sqlite/react-native migration file");
9188
+ debug18("using sqlite/react-native migration file");
8815
9189
  const mig = new CreateAuditEvents1701634819487();
8816
9190
  await mig.up(queryRunner);
8817
- debug17("Migration statements executed");
9191
+ debug18("Migration statements executed");
8818
9192
  return;
8819
9193
  }
8820
9194
  default:
@@ -8822,23 +9196,23 @@ var CreateAuditEvents1701635835330 = class {
8822
9196
  }
8823
9197
  }
8824
9198
  async down(queryRunner) {
8825
- debug17("migration: reverting audit events tables");
9199
+ debug18("migration: reverting audit events tables");
8826
9200
  const dbType = queryRunner.connection.driver.options.type;
8827
9201
  switch (dbType) {
8828
9202
  case "postgres": {
8829
- debug17("using postgres migration file");
9203
+ debug18("using postgres migration file");
8830
9204
  const mig = new CreateAuditEvents1701634812183();
8831
9205
  await mig.down(queryRunner);
8832
- debug17("Migration statements executed");
9206
+ debug18("Migration statements executed");
8833
9207
  return;
8834
9208
  }
8835
9209
  case "sqlite":
8836
9210
  case "expo":
8837
9211
  case "react-native": {
8838
- debug17("using sqlite/react-native migration file");
9212
+ debug18("using sqlite/react-native migration file");
8839
9213
  const mig = new CreateAuditEvents1701634819487();
8840
9214
  await mig.down(queryRunner);
8841
- debug17("Migration statements executed");
9215
+ debug18("Migration statements executed");
8842
9216
  return;
8843
9217
  }
8844
9218
  default:
@@ -8848,7 +9222,7 @@ var CreateAuditEvents1701635835330 = class {
8848
9222
  };
8849
9223
 
8850
9224
  // src/migrations/generic/6-CreateDigitalCredential.ts
8851
- var import_debug18 = __toESM(require("debug"), 1);
9225
+ var import_debug19 = __toESM(require("debug"), 1);
8852
9226
 
8853
9227
  // src/migrations/postgres/1708525189001-CreateDigitalCredential.ts
8854
9228
  var CreateDigitalCredential1708525189001 = class {
@@ -8956,30 +9330,30 @@ var CreateDigitalCredential1708525189002 = class {
8956
9330
  };
8957
9331
 
8958
9332
  // src/migrations/generic/6-CreateDigitalCredential.ts
8959
- var debug18 = (0, import_debug18.default)("sphereon:ssi-sdk:migrations");
9333
+ var debug19 = (0, import_debug19.default)("sphereon:ssi-sdk:migrations");
8960
9334
  var CreateDigitalCredential1708525189000 = class {
8961
9335
  static {
8962
9336
  __name(this, "CreateDigitalCredential1708525189000");
8963
9337
  }
8964
9338
  name = "CreateDigitalCredential1708525189000";
8965
9339
  async up(queryRunner) {
8966
- debug18("migration: creating DigitalCredential tables");
9340
+ debug19("migration: creating DigitalCredential tables");
8967
9341
  const dbType = queryRunner.connection.driver.options.type;
8968
9342
  switch (dbType) {
8969
9343
  case "postgres": {
8970
- debug18("using postgres migration file for DigitalCredential");
9344
+ debug19("using postgres migration file for DigitalCredential");
8971
9345
  const mig = new CreateDigitalCredential1708525189001();
8972
9346
  await mig.up(queryRunner);
8973
- debug18("Postgres Migration statements for DigitalCredential executed");
9347
+ debug19("Postgres Migration statements for DigitalCredential executed");
8974
9348
  return;
8975
9349
  }
8976
9350
  case "sqlite":
8977
9351
  case "expo":
8978
9352
  case "react-native": {
8979
- debug18("using sqlite/react-native migration file for DigitalCredential");
9353
+ debug19("using sqlite/react-native migration file for DigitalCredential");
8980
9354
  const mig = new CreateDigitalCredential1708525189002();
8981
9355
  await mig.up(queryRunner);
8982
- debug18("SQLite Migration statements for DigitalCredential executed");
9356
+ debug19("SQLite Migration statements for DigitalCredential executed");
8983
9357
  return;
8984
9358
  }
8985
9359
  default:
@@ -8987,23 +9361,23 @@ var CreateDigitalCredential1708525189000 = class {
8987
9361
  }
8988
9362
  }
8989
9363
  async down(queryRunner) {
8990
- debug18("migration: reverting DigitalCredential tables");
9364
+ debug19("migration: reverting DigitalCredential tables");
8991
9365
  const dbType = queryRunner.connection.driver.options.type;
8992
9366
  switch (dbType) {
8993
9367
  case "postgres": {
8994
- debug18("using postgres migration file for DigitalCredential");
9368
+ debug19("using postgres migration file for DigitalCredential");
8995
9369
  const mig = new CreateDigitalCredential1708525189001();
8996
9370
  await mig.down(queryRunner);
8997
- debug18("Postgres Migration statements for DigitalCredential reverted");
9371
+ debug19("Postgres Migration statements for DigitalCredential reverted");
8998
9372
  return;
8999
9373
  }
9000
9374
  case "sqlite":
9001
9375
  case "expo":
9002
9376
  case "react-native": {
9003
- debug18("using sqlite/react-native migration file for DigitalCredential");
9377
+ debug19("using sqlite/react-native migration file for DigitalCredential");
9004
9378
  const mig = new CreateDigitalCredential1708525189002();
9005
9379
  await mig.down(queryRunner);
9006
- debug18("SQLite Migration statements for DigitalCredential reverted");
9380
+ debug19("SQLite Migration statements for DigitalCredential reverted");
9007
9381
  return;
9008
9382
  }
9009
9383
  default:
@@ -9013,7 +9387,7 @@ var CreateDigitalCredential1708525189000 = class {
9013
9387
  };
9014
9388
 
9015
9389
  // src/migrations/generic/7-CreateMachineStateStore.ts
9016
- var import_debug19 = __toESM(require("debug"), 1);
9390
+ var import_debug20 = __toESM(require("debug"), 1);
9017
9391
 
9018
9392
  // src/migrations/postgres/1708797018115-CreateMachineStateStore.ts
9019
9393
  var CreateMachineStateStore1708797018115 = class {
@@ -9075,30 +9449,30 @@ var CreateMachineStateStore1708796002272 = class {
9075
9449
  };
9076
9450
 
9077
9451
  // src/migrations/generic/7-CreateMachineStateStore.ts
9078
- var debug19 = (0, import_debug19.default)("sphereon:ssi-sdk:migrations");
9452
+ var debug20 = (0, import_debug20.default)("sphereon:ssi-sdk:migrations");
9079
9453
  var CreateMachineStateStore1708098041262 = class {
9080
9454
  static {
9081
9455
  __name(this, "CreateMachineStateStore1708098041262");
9082
9456
  }
9083
9457
  name = "CreateMachineStateStore1708098041262";
9084
9458
  async up(queryRunner) {
9085
- debug19("migration: creating machine state tables");
9459
+ debug20("migration: creating machine state tables");
9086
9460
  const dbType = queryRunner.connection.driver.options.type;
9087
9461
  switch (dbType) {
9088
9462
  case "postgres": {
9089
- debug19("using postgres migration file");
9463
+ debug20("using postgres migration file");
9090
9464
  const mig = new CreateMachineStateStore1708797018115();
9091
9465
  await mig.up(queryRunner);
9092
- debug19("Migration statements executed");
9466
+ debug20("Migration statements executed");
9093
9467
  return;
9094
9468
  }
9095
9469
  case "sqlite":
9096
9470
  case "expo":
9097
9471
  case "react-native": {
9098
- debug19("using sqlite/react-native migration file");
9472
+ debug20("using sqlite/react-native migration file");
9099
9473
  const mig = new CreateMachineStateStore1708796002272();
9100
9474
  await mig.up(queryRunner);
9101
- debug19("Migration statements executed");
9475
+ debug20("Migration statements executed");
9102
9476
  return;
9103
9477
  }
9104
9478
  default:
@@ -9106,23 +9480,23 @@ var CreateMachineStateStore1708098041262 = class {
9106
9480
  }
9107
9481
  }
9108
9482
  async down(queryRunner) {
9109
- debug19("migration: reverting machine state tables");
9483
+ debug20("migration: reverting machine state tables");
9110
9484
  const dbType = queryRunner.connection.driver.options.type;
9111
9485
  switch (dbType) {
9112
9486
  case "postgres": {
9113
- debug19("using postgres migration file");
9487
+ debug20("using postgres migration file");
9114
9488
  const mig = new CreateMachineStateStore1708797018115();
9115
9489
  await mig.down(queryRunner);
9116
- debug19("Migration statements executed");
9490
+ debug20("Migration statements executed");
9117
9491
  return;
9118
9492
  }
9119
9493
  case "sqlite":
9120
9494
  case "expo":
9121
9495
  case "react-native": {
9122
- debug19("using sqlite/react-native migration file");
9496
+ debug20("using sqlite/react-native migration file");
9123
9497
  const mig = new CreateMachineStateStore1708796002272();
9124
9498
  await mig.down(queryRunner);
9125
- debug19("Migration statements executed");
9499
+ debug20("Migration statements executed");
9126
9500
  return;
9127
9501
  }
9128
9502
  default:
@@ -9132,7 +9506,7 @@ var CreateMachineStateStore1708098041262 = class {
9132
9506
  };
9133
9507
 
9134
9508
  // src/migrations/generic/8-CreateContacts.ts
9135
- var import_debug20 = __toESM(require("debug"), 1);
9509
+ var import_debug21 = __toESM(require("debug"), 1);
9136
9510
 
9137
9511
  // src/migrations/postgres/1710438363001-CreateContacts.ts
9138
9512
  var CreateContacts1710438363001 = class {
@@ -9246,30 +9620,30 @@ var CreateContacts1710438363002 = class {
9246
9620
  };
9247
9621
 
9248
9622
  // src/migrations/generic/8-CreateContacts.ts
9249
- var debug20 = (0, import_debug20.default)("sphereon:ssi-sdk:migrations");
9623
+ var debug21 = (0, import_debug21.default)("sphereon:ssi-sdk:migrations");
9250
9624
  var CreateContacts1708525189000 = class {
9251
9625
  static {
9252
9626
  __name(this, "CreateContacts1708525189000");
9253
9627
  }
9254
9628
  name = "CreateContacts1708525189000";
9255
9629
  async up(queryRunner) {
9256
- debug20("migration: updating contact tables");
9630
+ debug21("migration: updating contact tables");
9257
9631
  const dbType = queryRunner.connection.driver.options.type;
9258
9632
  switch (dbType) {
9259
9633
  case "postgres": {
9260
- debug20("using postgres migration file");
9634
+ debug21("using postgres migration file");
9261
9635
  const mig = new CreateContacts1710438363001();
9262
9636
  await mig.up(queryRunner);
9263
- debug20("Migration statements executed");
9637
+ debug21("Migration statements executed");
9264
9638
  return;
9265
9639
  }
9266
9640
  case "sqlite":
9267
9641
  case "expo":
9268
9642
  case "react-native": {
9269
- debug20("using sqlite/react-native migration file");
9643
+ debug21("using sqlite/react-native migration file");
9270
9644
  const mig = new CreateContacts1710438363002();
9271
9645
  await mig.up(queryRunner);
9272
- debug20("Migration statements executed");
9646
+ debug21("Migration statements executed");
9273
9647
  return;
9274
9648
  }
9275
9649
  default:
@@ -9277,23 +9651,23 @@ var CreateContacts1708525189000 = class {
9277
9651
  }
9278
9652
  }
9279
9653
  async down(queryRunner) {
9280
- debug20("migration: reverting machine state tables");
9654
+ debug21("migration: reverting machine state tables");
9281
9655
  const dbType = queryRunner.connection.driver.options.type;
9282
9656
  switch (dbType) {
9283
9657
  case "postgres": {
9284
- debug20("using postgres migration file");
9658
+ debug21("using postgres migration file");
9285
9659
  const mig = new CreateContacts1710438363001();
9286
9660
  await mig.down(queryRunner);
9287
- debug20("Migration statements executed");
9661
+ debug21("Migration statements executed");
9288
9662
  return;
9289
9663
  }
9290
9664
  case "sqlite":
9291
9665
  case "expo":
9292
9666
  case "react-native": {
9293
- debug20("using sqlite/react-native migration file");
9667
+ debug21("using sqlite/react-native migration file");
9294
9668
  const mig = new CreateContacts1710438363002();
9295
9669
  await mig.down(queryRunner);
9296
- debug20("Migration statements executed");
9670
+ debug21("Migration statements executed");
9297
9671
  return;
9298
9672
  }
9299
9673
  default:
@@ -9303,7 +9677,7 @@ var CreateContacts1708525189000 = class {
9303
9677
  };
9304
9678
 
9305
9679
  // src/migrations/generic/9-CreateContacts.ts
9306
- var import_debug21 = __toESM(require("debug"), 1);
9680
+ var import_debug22 = __toESM(require("debug"), 1);
9307
9681
 
9308
9682
  // src/migrations/postgres/1715761125001-CreateContacts.ts
9309
9683
  var CreateContacts1715761125001 = class {
@@ -9415,30 +9789,30 @@ var CreateContacts1715761125002 = class {
9415
9789
  };
9416
9790
 
9417
9791
  // src/migrations/generic/9-CreateContacts.ts
9418
- var debug21 = (0, import_debug21.default)("sphereon:ssi-sdk:migrations");
9792
+ var debug22 = (0, import_debug22.default)("sphereon:ssi-sdk:migrations");
9419
9793
  var CreateContacts1715761125000 = class {
9420
9794
  static {
9421
9795
  __name(this, "CreateContacts1715761125000");
9422
9796
  }
9423
9797
  name = "CreateContacts1715761125000";
9424
9798
  async up(queryRunner) {
9425
- debug21("migration: updating contact tables");
9799
+ debug22("migration: updating contact tables");
9426
9800
  const dbType = queryRunner.connection.driver.options.type;
9427
9801
  switch (dbType) {
9428
9802
  case "postgres": {
9429
- debug21("using postgres migration file");
9803
+ debug22("using postgres migration file");
9430
9804
  const mig = new CreateContacts1715761125001();
9431
9805
  await mig.up(queryRunner);
9432
- debug21("Migration statements executed");
9806
+ debug22("Migration statements executed");
9433
9807
  return;
9434
9808
  }
9435
9809
  case "sqlite":
9436
9810
  case "expo":
9437
9811
  case "react-native": {
9438
- debug21("using sqlite/react-native migration file");
9812
+ debug22("using sqlite/react-native migration file");
9439
9813
  const mig = new CreateContacts1715761125002();
9440
9814
  await mig.up(queryRunner);
9441
- debug21("Migration statements executed");
9815
+ debug22("Migration statements executed");
9442
9816
  return;
9443
9817
  }
9444
9818
  default:
@@ -9446,23 +9820,23 @@ var CreateContacts1715761125000 = class {
9446
9820
  }
9447
9821
  }
9448
9822
  async down(queryRunner) {
9449
- debug21("migration: reverting machine state tables");
9823
+ debug22("migration: reverting machine state tables");
9450
9824
  const dbType = queryRunner.connection.driver.options.type;
9451
9825
  switch (dbType) {
9452
9826
  case "postgres": {
9453
- debug21("using postgres migration file");
9827
+ debug22("using postgres migration file");
9454
9828
  const mig = new CreateContacts1715761125001();
9455
9829
  await mig.down(queryRunner);
9456
- debug21("Migration statements executed");
9830
+ debug22("Migration statements executed");
9457
9831
  return;
9458
9832
  }
9459
9833
  case "sqlite":
9460
9834
  case "expo":
9461
9835
  case "react-native": {
9462
- debug21("using sqlite/react-native migration file");
9836
+ debug22("using sqlite/react-native migration file");
9463
9837
  const mig = new CreateContacts1715761125002();
9464
9838
  await mig.down(queryRunner);
9465
- debug21("Migration statements executed");
9839
+ debug22("Migration statements executed");
9466
9840
  return;
9467
9841
  }
9468
9842
  default:
@@ -9480,7 +9854,8 @@ var DataStoreContactMigrations = [
9480
9854
  ];
9481
9855
  var DataStoreIssuanceBrandingMigrations = [
9482
9856
  CreateIssuanceBranding1659463079429,
9483
- FixCredentialClaimsReferencesUuid1741895822987
9857
+ FixCredentialClaimsReferencesUuid1741895822987,
9858
+ AddBrandingState1766000000000
9484
9859
  ];
9485
9860
  var DataStoreStatusListMigrations = [
9486
9861
  CreateStatusList1693866470000,