@sphereon/ssi-sdk.data-store 0.36.1-feature.SSISDK.89.metadata.persistence.103 → 0.36.1-feature.fides.fixes.111

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2871,10 +2871,23 @@ BaseLocaleBrandingEntity = _ts_decorate24([
2871
2871
  // src/entities/issuanceBranding/CredentialBrandingEntity.ts
2872
2872
  import { typeOrmDateTime as typeOrmDateTime13 } from "@sphereon/ssi-sdk.agent-config";
2873
2873
  import { ArrayMinSize, IsNotEmpty as IsNotEmpty10, validate as validate16 } from "class-validator";
2874
- import { BaseEntity as BaseEntity19, BeforeInsert as BeforeInsert18, BeforeUpdate as BeforeUpdate18, Column as Column24, CreateDateColumn as CreateDateColumn11, Entity as Entity21, Index as Index5, OneToMany as OneToMany6, PrimaryGeneratedColumn as PrimaryGeneratedColumn21, UpdateDateColumn as UpdateDateColumn11 } from "typeorm";
2874
+ import { BaseEntity as BaseEntity19, BeforeInsert as BeforeInsert19, BeforeUpdate as BeforeUpdate19, Column as Column24, CreateDateColumn as CreateDateColumn11, Entity as Entity21, Index as Index5, OneToMany as OneToMany6, PrimaryGeneratedColumn as PrimaryGeneratedColumn21, UpdateDateColumn as UpdateDateColumn11 } from "typeorm";
2875
2875
 
2876
2876
  // src/entities/issuanceBranding/CredentialLocaleBrandingEntity.ts
2877
- import { ChildEntity as ChildEntity5, Column as Column23, Index as Index4, JoinColumn as JoinColumn11, ManyToOne as ManyToOne9, OneToMany as OneToMany5 } from "typeorm";
2877
+ import { BeforeInsert as BeforeInsert18, BeforeUpdate as BeforeUpdate18, ChildEntity as ChildEntity5, Column as Column23, Index as Index4, JoinColumn as JoinColumn11, ManyToOne as ManyToOne9, OneToMany as OneToMany5 } from "typeorm";
2878
+
2879
+ // src/utils/issuanceBranding/HashUtils.ts
2880
+ var FNV_PRIME = 0x100000001b3n;
2881
+ var OFFSET_BASIS = 0xcbf29ce484222325n;
2882
+ function computeCompactHash(input) {
2883
+ let hash = OFFSET_BASIS;
2884
+ for (let i = 0; i < input.length; i++) {
2885
+ hash ^= BigInt(input.charCodeAt(i));
2886
+ hash = hash * FNV_PRIME & 0xffffffffffffffffn;
2887
+ }
2888
+ return hash.toString(36);
2889
+ }
2890
+ __name(computeCompactHash, "computeCompactHash");
2878
2891
 
2879
2892
  // src/entities/issuanceBranding/CredentialClaimsEntity.ts
2880
2893
  import { validate as validate15, Validate as Validate8 } from "class-validator";
@@ -2980,6 +2993,10 @@ var CredentialLocaleBrandingEntity = class extends BaseLocaleBrandingEntity {
2980
2993
  credentialBranding;
2981
2994
  claims;
2982
2995
  credentialBrandingId;
2996
+ state;
2997
+ setState() {
2998
+ this.state = computeCredentialLocaleBrandingState(this);
2999
+ }
2983
3000
  };
2984
3001
  _ts_decorate26([
2985
3002
  ManyToOne9(() => CredentialBrandingEntity, (credentialBranding) => credentialBranding.localeBranding, {
@@ -3009,6 +3026,21 @@ _ts_decorate26([
3009
3026
  }),
3010
3027
  _ts_metadata25("design:type", String)
3011
3028
  ], CredentialLocaleBrandingEntity.prototype, "credentialBrandingId", void 0);
3029
+ _ts_decorate26([
3030
+ Column23("varchar", {
3031
+ name: "state",
3032
+ length: 255,
3033
+ nullable: false
3034
+ }),
3035
+ _ts_metadata25("design:type", String)
3036
+ ], CredentialLocaleBrandingEntity.prototype, "state", void 0);
3037
+ _ts_decorate26([
3038
+ BeforeInsert18(),
3039
+ BeforeUpdate18(),
3040
+ _ts_metadata25("design:type", Function),
3041
+ _ts_metadata25("design:paramtypes", []),
3042
+ _ts_metadata25("design:returntype", void 0)
3043
+ ], CredentialLocaleBrandingEntity.prototype, "setState", null);
3012
3044
  CredentialLocaleBrandingEntity = _ts_decorate26([
3013
3045
  ChildEntity5("CredentialLocaleBranding"),
3014
3046
  Index4("IDX_CredentialLocaleBrandingEntity_credentialBranding_locale", [
@@ -3018,6 +3050,45 @@ CredentialLocaleBrandingEntity = _ts_decorate26([
3018
3050
  unique: true
3019
3051
  })
3020
3052
  ], CredentialLocaleBrandingEntity);
3053
+ var computeCredentialLocaleBrandingState = /* @__PURE__ */ __name((localeBranding) => {
3054
+ const sortedClaims = (localeBranding.claims ?? []).map((claim) => ({
3055
+ key: claim.key,
3056
+ name: claim.name
3057
+ })).sort((first, second) => first.key.localeCompare(second.key));
3058
+ const payload = {
3059
+ alias: localeBranding.alias ?? null,
3060
+ locale: localeBranding.locale ?? null,
3061
+ description: localeBranding.description ?? null,
3062
+ logo: localeBranding.logo ? {
3063
+ uri: localeBranding.logo.uri ?? null,
3064
+ dataUri: localeBranding.logo.dataUri ?? null,
3065
+ mediaType: localeBranding.logo.mediaType ?? null,
3066
+ alt: localeBranding.logo.alt ?? null,
3067
+ dimensions: localeBranding.logo.dimensions ? {
3068
+ width: localeBranding.logo.dimensions.width,
3069
+ height: localeBranding.logo.dimensions.height
3070
+ } : null
3071
+ } : null,
3072
+ background: localeBranding.background ? {
3073
+ color: localeBranding.background.color ?? null,
3074
+ image: localeBranding.background.image ? {
3075
+ uri: localeBranding.background.image.uri ?? null,
3076
+ dataUri: localeBranding.background.image.dataUri ?? null,
3077
+ mediaType: localeBranding.background.image.mediaType ?? null,
3078
+ alt: localeBranding.background.image.alt ?? null,
3079
+ dimensions: localeBranding.background.image.dimensions ? {
3080
+ width: localeBranding.background.image.dimensions.width,
3081
+ height: localeBranding.background.image.dimensions.height
3082
+ } : null
3083
+ } : null
3084
+ } : null,
3085
+ text: localeBranding.text ? {
3086
+ color: localeBranding.text.color ?? null
3087
+ } : null,
3088
+ claims: sortedClaims
3089
+ };
3090
+ return computeCompactHash(JSON.stringify(payload));
3091
+ }, "computeCredentialLocaleBrandingState");
3021
3092
 
3022
3093
  // src/entities/issuanceBranding/CredentialBrandingEntity.ts
3023
3094
  function _ts_decorate27(decorators, target, key, desc) {
@@ -3038,6 +3109,7 @@ var CredentialBrandingEntity = class extends BaseEntity19 {
3038
3109
  id;
3039
3110
  vcHash;
3040
3111
  issuerCorrelationId;
3112
+ state;
3041
3113
  localeBranding;
3042
3114
  createdAt;
3043
3115
  lastUpdatedAt;
@@ -3045,6 +3117,9 @@ var CredentialBrandingEntity = class extends BaseEntity19 {
3045
3117
  updateUpdatedDate() {
3046
3118
  this.lastUpdatedAt = /* @__PURE__ */ new Date();
3047
3119
  }
3120
+ setState() {
3121
+ this.state = this.computeState();
3122
+ }
3048
3123
  async validate() {
3049
3124
  const validation = await validate16(this);
3050
3125
  if (validation.length > 0) {
@@ -3052,6 +3127,31 @@ var CredentialBrandingEntity = class extends BaseEntity19 {
3052
3127
  }
3053
3128
  return;
3054
3129
  }
3130
+ computeState() {
3131
+ const localeStates = (this.localeBranding ?? []).map((localeBranding) => ({
3132
+ locale: localeBranding.locale ?? "",
3133
+ alias: localeBranding.alias ?? "",
3134
+ id: localeBranding.id ?? "",
3135
+ state: computeCredentialLocaleBrandingState(localeBranding)
3136
+ }));
3137
+ localeStates.sort((first, second) => {
3138
+ const localeCompare = first.locale.localeCompare(second.locale);
3139
+ if (localeCompare !== 0) {
3140
+ return localeCompare;
3141
+ }
3142
+ const aliasCompare = first.alias.localeCompare(second.alias);
3143
+ if (aliasCompare !== 0) {
3144
+ return aliasCompare;
3145
+ }
3146
+ return first.id.localeCompare(second.id);
3147
+ });
3148
+ const payload = {
3149
+ issuerCorrelationId: this.issuerCorrelationId,
3150
+ vcHash: this.vcHash,
3151
+ localeBranding: localeStates.map((entry) => entry.state)
3152
+ };
3153
+ return computeCompactHash(JSON.stringify(payload));
3154
+ }
3055
3155
  };
3056
3156
  _ts_decorate27([
3057
3157
  PrimaryGeneratedColumn21("uuid"),
@@ -3081,6 +3181,14 @@ _ts_decorate27([
3081
3181
  }),
3082
3182
  _ts_metadata26("design:type", String)
3083
3183
  ], CredentialBrandingEntity.prototype, "issuerCorrelationId", void 0);
3184
+ _ts_decorate27([
3185
+ Column24("varchar", {
3186
+ name: "state",
3187
+ length: 255,
3188
+ nullable: false
3189
+ }),
3190
+ _ts_metadata26("design:type", String)
3191
+ ], CredentialBrandingEntity.prototype, "state", void 0);
3084
3192
  _ts_decorate27([
3085
3193
  OneToMany6(() => CredentialLocaleBrandingEntity, (credentialLocaleBrandingEntity) => credentialLocaleBrandingEntity.credentialBranding, {
3086
3194
  cascade: true,
@@ -3110,15 +3218,22 @@ _ts_decorate27([
3110
3218
  _ts_metadata26("design:type", typeof Date === "undefined" ? Object : Date)
3111
3219
  ], CredentialBrandingEntity.prototype, "lastUpdatedAt", void 0);
3112
3220
  _ts_decorate27([
3113
- BeforeInsert18(),
3114
- BeforeUpdate18(),
3221
+ BeforeInsert19(),
3222
+ BeforeUpdate19(),
3115
3223
  _ts_metadata26("design:type", Function),
3116
3224
  _ts_metadata26("design:paramtypes", []),
3117
3225
  _ts_metadata26("design:returntype", void 0)
3118
3226
  ], CredentialBrandingEntity.prototype, "updateUpdatedDate", null);
3119
3227
  _ts_decorate27([
3120
- BeforeInsert18(),
3121
- BeforeUpdate18(),
3228
+ BeforeInsert19(),
3229
+ BeforeUpdate19(),
3230
+ _ts_metadata26("design:type", Function),
3231
+ _ts_metadata26("design:paramtypes", []),
3232
+ _ts_metadata26("design:returntype", void 0)
3233
+ ], CredentialBrandingEntity.prototype, "setState", null);
3234
+ _ts_decorate27([
3235
+ BeforeInsert19(),
3236
+ BeforeUpdate19(),
3122
3237
  _ts_metadata26("design:type", Function),
3123
3238
  _ts_metadata26("design:paramtypes", []),
3124
3239
  _ts_metadata26("design:returntype", Promise)
@@ -3136,11 +3251,11 @@ CredentialBrandingEntity = _ts_decorate27([
3136
3251
  // src/entities/issuanceBranding/IssuerBrandingEntity.ts
3137
3252
  import { typeOrmDateTime as typeOrmDateTime14 } from "@sphereon/ssi-sdk.agent-config";
3138
3253
  import { ArrayMinSize as ArrayMinSize2, IsNotEmpty as IsNotEmpty11, validate as validate17 } from "class-validator";
3139
- import { BaseEntity as BaseEntity20, BeforeInsert as BeforeInsert19, BeforeUpdate as BeforeUpdate19, Column as Column26, CreateDateColumn as CreateDateColumn12, Entity as Entity22, Index as Index7, OneToMany as OneToMany7, PrimaryGeneratedColumn as PrimaryGeneratedColumn22, UpdateDateColumn as UpdateDateColumn12 } from "typeorm";
3254
+ import { BaseEntity as BaseEntity20, BeforeInsert as BeforeInsert21, BeforeUpdate as BeforeUpdate21, Column as Column26, CreateDateColumn as CreateDateColumn12, Entity as Entity22, Index as Index7, OneToMany as OneToMany7, PrimaryGeneratedColumn as PrimaryGeneratedColumn22, UpdateDateColumn as UpdateDateColumn12 } from "typeorm";
3140
3255
 
3141
3256
  // src/entities/issuanceBranding/IssuerLocaleBrandingEntity.ts
3142
3257
  import { Validate as Validate9 } from "class-validator";
3143
- import { ChildEntity as ChildEntity6, Column as Column25, Index as Index6, JoinColumn as JoinColumn12, ManyToOne as ManyToOne10 } from "typeorm";
3258
+ import { BeforeInsert as BeforeInsert20, BeforeUpdate as BeforeUpdate20, ChildEntity as ChildEntity6, Column as Column25, Index as Index6, JoinColumn as JoinColumn12, ManyToOne as ManyToOne10 } from "typeorm";
3144
3259
  function _ts_decorate28(decorators, target, key, desc) {
3145
3260
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3146
3261
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -3162,6 +3277,48 @@ var IssuerLocaleBrandingEntity = class extends BaseLocaleBrandingEntity {
3162
3277
  policyUri;
3163
3278
  contacts;
3164
3279
  issuerBrandingId;
3280
+ state;
3281
+ setState() {
3282
+ this.state = this.computeState();
3283
+ }
3284
+ computeState() {
3285
+ const payload = {
3286
+ alias: this.alias ?? null,
3287
+ locale: this.locale ?? null,
3288
+ description: this.description ?? null,
3289
+ clientUri: this.clientUri ?? null,
3290
+ tosUri: this.tosUri ?? null,
3291
+ policyUri: this.policyUri ?? null,
3292
+ contacts: this.contacts ?? null,
3293
+ logo: this.logo ? {
3294
+ uri: this.logo.uri ?? null,
3295
+ dataUri: this.logo.dataUri ?? null,
3296
+ mediaType: this.logo.mediaType ?? null,
3297
+ alt: this.logo.alt ?? null,
3298
+ dimensions: this.logo.dimensions ? {
3299
+ width: this.logo.dimensions.width,
3300
+ height: this.logo.dimensions.height
3301
+ } : null
3302
+ } : null,
3303
+ background: this.background ? {
3304
+ color: this.background.color ?? null,
3305
+ image: this.background.image ? {
3306
+ uri: this.background.image.uri ?? null,
3307
+ dataUri: this.background.image.dataUri ?? null,
3308
+ mediaType: this.background.image.mediaType ?? null,
3309
+ alt: this.background.image.alt ?? null,
3310
+ dimensions: this.background.image.dimensions ? {
3311
+ width: this.background.image.dimensions.width,
3312
+ height: this.background.image.dimensions.height
3313
+ } : null
3314
+ } : null
3315
+ } : null,
3316
+ text: this.text ? {
3317
+ color: this.text.color ?? null
3318
+ } : null
3319
+ };
3320
+ return computeCompactHash(JSON.stringify(payload));
3321
+ }
3165
3322
  };
3166
3323
  _ts_decorate28([
3167
3324
  ManyToOne10(() => IssuerBrandingEntity, (issuerBranding) => issuerBranding.localeBranding, {
@@ -3220,6 +3377,21 @@ _ts_decorate28([
3220
3377
  }),
3221
3378
  _ts_metadata27("design:type", String)
3222
3379
  ], IssuerLocaleBrandingEntity.prototype, "issuerBrandingId", void 0);
3380
+ _ts_decorate28([
3381
+ Column25("varchar", {
3382
+ name: "state",
3383
+ length: 255,
3384
+ nullable: false
3385
+ }),
3386
+ _ts_metadata27("design:type", String)
3387
+ ], IssuerLocaleBrandingEntity.prototype, "state", void 0);
3388
+ _ts_decorate28([
3389
+ BeforeInsert20(),
3390
+ BeforeUpdate20(),
3391
+ _ts_metadata27("design:type", Function),
3392
+ _ts_metadata27("design:paramtypes", []),
3393
+ _ts_metadata27("design:returntype", void 0)
3394
+ ], IssuerLocaleBrandingEntity.prototype, "setState", null);
3223
3395
  IssuerLocaleBrandingEntity = _ts_decorate28([
3224
3396
  ChildEntity6("IssuerLocaleBranding"),
3225
3397
  Index6("IDX_IssuerLocaleBrandingEntity_issuerBranding_locale", [
@@ -3308,15 +3480,15 @@ _ts_decorate29([
3308
3480
  _ts_metadata28("design:type", typeof Date === "undefined" ? Object : Date)
3309
3481
  ], IssuerBrandingEntity.prototype, "lastUpdatedAt", void 0);
3310
3482
  _ts_decorate29([
3311
- BeforeInsert19(),
3312
- BeforeUpdate19(),
3483
+ BeforeInsert21(),
3484
+ BeforeUpdate21(),
3313
3485
  _ts_metadata28("design:type", Function),
3314
3486
  _ts_metadata28("design:paramtypes", []),
3315
3487
  _ts_metadata28("design:returntype", void 0)
3316
3488
  ], IssuerBrandingEntity.prototype, "updateUpdatedDate", null);
3317
3489
  _ts_decorate29([
3318
- BeforeInsert19(),
3319
- BeforeUpdate19(),
3490
+ BeforeInsert21(),
3491
+ BeforeUpdate21(),
3320
3492
  _ts_metadata28("design:type", Function),
3321
3493
  _ts_metadata28("design:paramtypes", []),
3322
3494
  _ts_metadata28("design:returntype", Promise)
@@ -3567,7 +3739,7 @@ Oid4vcStateEntity = _ts_decorate31([
3567
3739
  // src/entities/presentationDefinition/DcqlQueryItemEntity.ts
3568
3740
  import { typeOrmDateTime as typeOrmDateTime17 } from "@sphereon/ssi-sdk.agent-config";
3569
3741
  import { IsNotEmpty as IsNotEmpty12 } from "class-validator";
3570
- import { BaseEntity as BaseEntity23, BeforeInsert as BeforeInsert20, BeforeUpdate as BeforeUpdate20, Column as Column29, CreateDateColumn as CreateDateColumn15, Entity as Entity25, Index as Index8, PrimaryGeneratedColumn as PrimaryGeneratedColumn23, UpdateDateColumn as UpdateDateColumn15 } from "typeorm";
3742
+ import { BaseEntity as BaseEntity23, BeforeInsert as BeforeInsert22, BeforeUpdate as BeforeUpdate22, Column as Column29, CreateDateColumn as CreateDateColumn15, Entity as Entity25, Index as Index8, PrimaryGeneratedColumn as PrimaryGeneratedColumn23, UpdateDateColumn as UpdateDateColumn15 } from "typeorm";
3571
3743
  function _ts_decorate32(decorators, target, key, desc) {
3572
3744
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3573
3745
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -3686,8 +3858,8 @@ _ts_decorate32([
3686
3858
  _ts_metadata31("design:type", typeof Date === "undefined" ? Object : Date)
3687
3859
  ], DcqlQueryItemEntity.prototype, "lastUpdatedAt", void 0);
3688
3860
  _ts_decorate32([
3689
- BeforeInsert20(),
3690
- BeforeUpdate20(),
3861
+ BeforeInsert22(),
3862
+ BeforeUpdate22(),
3691
3863
  _ts_metadata31("design:type", Function),
3692
3864
  _ts_metadata31("design:paramtypes", []),
3693
3865
  _ts_metadata31("design:returntype", void 0)
@@ -4657,7 +4829,13 @@ var ContactStore = class extends AbstractContactStore {
4657
4829
  }
4658
4830
  });
4659
4831
  debug(`getParties() resulted in ${result.length} parties`);
4660
- return result.map(partyFrom);
4832
+ return result.filter((party) => {
4833
+ if (!party.contact) {
4834
+ console.warn(`party ${party.id} does not have an associated contact`);
4835
+ return false;
4836
+ }
4837
+ return true;
4838
+ }).map(partyFrom);
4661
4839
  }, "getParties");
4662
4840
  addParty = /* @__PURE__ */ __name(async (args) => {
4663
4841
  const { identities, contact, partyType } = args;
@@ -5453,7 +5631,7 @@ import { In as In2, Not } from "typeorm";
5453
5631
  var credentialBrandingFrom = /* @__PURE__ */ __name((credentialBranding) => {
5454
5632
  const result = {
5455
5633
  ...credentialBranding,
5456
- localeBranding: credentialBranding.localeBranding.map((localeBranding) => localeBrandingFrom(localeBranding))
5634
+ localeBranding: credentialBranding.localeBranding.map((localeBranding) => credentialLocaleBrandingFromEntity(localeBranding))
5457
5635
  };
5458
5636
  return replaceNullWithUndefined(result);
5459
5637
  }, "credentialBrandingFrom");
@@ -5471,6 +5649,19 @@ var localeBrandingFrom = /* @__PURE__ */ __name((localeBranding) => {
5471
5649
  };
5472
5650
  return replaceNullWithUndefined(result);
5473
5651
  }, "localeBrandingFrom");
5652
+ var credentialLocaleBrandingFromEntity = /* @__PURE__ */ __name((localeBranding) => {
5653
+ const base = localeBrandingFrom(localeBranding);
5654
+ const result = {
5655
+ ...base,
5656
+ state: localeBranding.state,
5657
+ claims: localeBranding.claims ? localeBranding.claims.map((claim) => ({
5658
+ id: claim.id,
5659
+ key: claim.key,
5660
+ name: claim.name
5661
+ })) : void 0
5662
+ };
5663
+ return replaceNullWithUndefined(result);
5664
+ }, "credentialLocaleBrandingFromEntity");
5474
5665
  var issuerLocaleBrandingEntityFrom = /* @__PURE__ */ __name((args) => {
5475
5666
  const issuerLocaleBrandingEntity = new IssuerLocaleBrandingEntity();
5476
5667
  issuerLocaleBrandingEntity.alias = isEmptyString(args.alias) ? void 0 : args.alias;
@@ -5575,7 +5766,7 @@ var IssuanceBrandingStore = class extends AbstractIssuanceBrandingStore {
5575
5766
  return credentialBrandingFrom(createdResult);
5576
5767
  }, "addCredentialBranding");
5577
5768
  getCredentialBranding = /* @__PURE__ */ __name(async (args) => {
5578
- const { filter } = args ?? {};
5769
+ const { filter, knownStates } = args ?? {};
5579
5770
  if (filter) {
5580
5771
  filter.forEach((filter2) => {
5581
5772
  if (filter2.localeBranding && "locale" in filter2.localeBranding && filter2.localeBranding.locale === void 0) {
@@ -5589,7 +5780,14 @@ var IssuanceBrandingStore = class extends AbstractIssuanceBrandingStore {
5589
5780
  where: filter
5590
5781
  }
5591
5782
  });
5592
- return result.map((credentialBranding) => credentialBrandingFrom(credentialBranding));
5783
+ const credentialBranding = result.map((branding) => credentialBrandingFrom(branding));
5784
+ if (!knownStates) {
5785
+ return credentialBranding;
5786
+ }
5787
+ return credentialBranding.filter((branding) => {
5788
+ const knownState = knownStates[branding.id];
5789
+ return !knownState || knownState !== branding.state;
5790
+ });
5593
5791
  }, "getCredentialBranding");
5594
5792
  removeCredentialBranding = /* @__PURE__ */ __name(async (args) => {
5595
5793
  const { filter } = args;
@@ -5682,7 +5880,7 @@ var IssuanceBrandingStore = class extends AbstractIssuanceBrandingStore {
5682
5880
  where: filter
5683
5881
  }
5684
5882
  });
5685
- return credentialBrandingLocale ? credentialBrandingLocale.map((credentialLocaleBranding) => localeBrandingFrom(credentialLocaleBranding)) : [];
5883
+ return credentialBrandingLocale ? credentialBrandingLocale.map((credentialLocaleBranding) => credentialLocaleBrandingFromEntity(credentialLocaleBranding)) : [];
5686
5884
  }, "getCredentialLocaleBranding");
5687
5885
  removeCredentialLocaleBranding = /* @__PURE__ */ __name(async (args) => {
5688
5886
  const { filter } = args;
@@ -7942,21 +8140,111 @@ var AddLinkedVpFields1763387280000 = class {
7942
8140
  }
7943
8141
  };
7944
8142
 
7945
- // src/migrations/generic/2-CreateIssuanceBranding.ts
8143
+ // src/migrations/generic/15-AddBrandingState.ts
7946
8144
  import Debug14 from "debug";
8145
+
8146
+ // src/migrations/postgres/1766000000000-AddBrandingState.ts
8147
+ var AddBrandingStatePostgres1766000000000 = class {
8148
+ static {
8149
+ __name(this, "AddBrandingStatePostgres1766000000000");
8150
+ }
8151
+ name = "AddBrandingState1766000000000";
8152
+ async up(queryRunner) {
8153
+ await queryRunner.query(`ALTER TABLE "CredentialBranding" ADD "state" character varying(255) NOT NULL DEFAULT ''`);
8154
+ await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" ADD "state" character varying(255) NOT NULL DEFAULT ''`);
8155
+ }
8156
+ async down(queryRunner) {
8157
+ await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP COLUMN "state"`);
8158
+ await queryRunner.query(`ALTER TABLE "CredentialBranding" DROP COLUMN "state"`);
8159
+ }
8160
+ };
8161
+
8162
+ // src/migrations/sqlite/1766000000000-AddBrandingState.ts
8163
+ var AddBrandingStateSqlite1766000000000 = class {
8164
+ static {
8165
+ __name(this, "AddBrandingStateSqlite1766000000000");
8166
+ }
8167
+ name = "AddBrandingState1766000000000";
8168
+ async up(queryRunner) {
8169
+ await queryRunner.query(`ALTER TABLE "CredentialBranding" ADD COLUMN "state" varchar(255) NOT NULL DEFAULT ''`);
8170
+ await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" ADD COLUMN "state" varchar(255) NOT NULL DEFAULT ''`);
8171
+ }
8172
+ async down(queryRunner) {
8173
+ await queryRunner.query(`
8174
+ CREATE TABLE "CredentialBranding_old"
8175
+ (
8176
+ "id" varchar PRIMARY KEY NOT NULL,
8177
+ "vcHash" varchar(255) NOT NULL,
8178
+ "issuerCorrelationId" varchar(255) NOT NULL,
8179
+ "created_at" datetime NOT NULL DEFAULT (datetime('now')),
8180
+ "last_updated_at" datetime NOT NULL DEFAULT (datetime('now'))
8181
+ )
8182
+ `);
8183
+ await queryRunner.query(`
8184
+ INSERT INTO "CredentialBranding_old" ("id", "vcHash", "issuerCorrelationId", "created_at", "last_updated_at")
8185
+ SELECT "id", "vcHash", "issuerCorrelationId", "created_at", "last_updated_at"
8186
+ FROM "CredentialBranding"
8187
+ `);
8188
+ await queryRunner.query(`DROP TABLE "CredentialBranding"`);
8189
+ await queryRunner.query(`ALTER TABLE "CredentialBranding_old" RENAME TO "CredentialBranding"`);
8190
+ await queryRunner.query(`CREATE INDEX "IDX_CredentialBrandingEntity_issuerCorrelationId" ON "CredentialBranding" ("issuerCorrelationId")`);
8191
+ await queryRunner.query(`CREATE INDEX "IDX_CredentialBrandingEntity_vcHash" ON "CredentialBranding" ("vcHash")`);
8192
+ await queryRunner.query(`
8193
+ CREATE TABLE "BaseLocaleBranding_old"
8194
+ (
8195
+ "id" varchar PRIMARY KEY NOT NULL,
8196
+ "alias" varchar(255),
8197
+ "locale" varchar(255) NOT NULL,
8198
+ "description" varchar(255),
8199
+ "created_at" datetime NOT NULL DEFAULT (datetime('now')),
8200
+ "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')),
8201
+ "credentialBrandingId" varchar,
8202
+ "issuerBrandingId" varchar,
8203
+ "type" varchar NOT NULL,
8204
+ "logoId" varchar,
8205
+ "backgroundId" varchar,
8206
+ "textId" varchar,
8207
+ "client_uri" varchar,
8208
+ "tos_uri" varchar,
8209
+ "policy_uri" varchar,
8210
+ "contacts" varchar,
8211
+ CONSTRAINT "UQ_logoId" UNIQUE ("logoId"),
8212
+ CONSTRAINT "UQ_backgroundId" UNIQUE ("backgroundId"),
8213
+ CONSTRAINT "UQ_textId" UNIQUE ("textId"),
8214
+ CONSTRAINT "FK_BaseLocaleBranding_logoId" FOREIGN KEY ("logoId") REFERENCES "ImageAttributes" ("id") ON DELETE CASCADE ON UPDATE NO ACTION,
8215
+ CONSTRAINT "FK_BaseLocaleBranding_backgroundId" FOREIGN KEY ("backgroundId") REFERENCES "BackgroundAttributes" ("id") ON DELETE CASCADE ON UPDATE NO ACTION,
8216
+ CONSTRAINT "FK_BaseLocaleBranding_textId" FOREIGN KEY ("textId") REFERENCES "TextAttributes" ("id") ON DELETE CASCADE ON UPDATE NO ACTION,
8217
+ CONSTRAINT "FK_BaseLocaleBranding_credentialBrandingId" FOREIGN KEY ("credentialBrandingId") REFERENCES "CredentialBranding" ("id") ON DELETE CASCADE ON UPDATE NO ACTION,
8218
+ CONSTRAINT "FK_BaseLocaleBranding_issuerBrandingId" FOREIGN KEY ("issuerBrandingId") REFERENCES "IssuerBranding" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
8219
+ )
8220
+ `);
8221
+ await queryRunner.query(`
8222
+ 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")
8223
+ SELECT "id", "alias", "locale", "description", "created_at", "last_updated_at", "credentialBrandingId", "issuerBrandingId", "type", "logoId", "backgroundId", "textId", "client_uri", "tos_uri", "policy_uri", "contacts"
8224
+ FROM "BaseLocaleBranding"
8225
+ `);
8226
+ await queryRunner.query(`DROP TABLE "BaseLocaleBranding"`);
8227
+ await queryRunner.query(`ALTER TABLE "BaseLocaleBranding_old" RENAME TO "BaseLocaleBranding"`);
8228
+ await queryRunner.query(`CREATE UNIQUE INDEX "IDX_CredentialLocaleBrandingEntity_credentialBranding_locale" ON "BaseLocaleBranding" ("credentialBrandingId", "locale")`);
8229
+ await queryRunner.query(`CREATE UNIQUE INDEX "IDX_IssuerLocaleBrandingEntity_issuerBranding_locale" ON "BaseLocaleBranding" ("issuerBrandingId", "locale")`);
8230
+ await queryRunner.query(`CREATE INDEX "IDX_BaseLocaleBranding_type" ON "BaseLocaleBranding" ("type")`);
8231
+ }
8232
+ };
8233
+
8234
+ // src/migrations/generic/15-AddBrandingState.ts
7947
8235
  var debug14 = Debug14("sphereon:ssi-sdk:migrations");
7948
- var CreateIssuanceBranding1659463079429 = class {
8236
+ var AddBrandingState1766000000000 = class {
7949
8237
  static {
7950
- __name(this, "CreateIssuanceBranding1659463079429");
8238
+ __name(this, "AddBrandingState1766000000000");
7951
8239
  }
7952
- name = "CreateIssuanceBranding1659463079429";
8240
+ name = "AddBrandingState1766000000000";
7953
8241
  async up(queryRunner) {
7954
- debug14("migration: creating issuance branding tables");
8242
+ debug14("migration: adding branding state checksum columns");
7955
8243
  const dbType = queryRunner.connection.driver.options.type;
7956
8244
  switch (dbType) {
7957
8245
  case "postgres": {
7958
8246
  debug14("using postgres migration file");
7959
- const mig = new CreateIssuanceBranding1685628974232();
8247
+ const mig = new AddBrandingStatePostgres1766000000000();
7960
8248
  await mig.up(queryRunner);
7961
8249
  debug14("Migration statements executed");
7962
8250
  return;
@@ -7965,7 +8253,7 @@ var CreateIssuanceBranding1659463079429 = class {
7965
8253
  case "expo":
7966
8254
  case "react-native": {
7967
8255
  debug14("using sqlite/react-native migration file");
7968
- const mig = new CreateIssuanceBranding1685628973231();
8256
+ const mig = new AddBrandingStateSqlite1766000000000();
7969
8257
  await mig.up(queryRunner);
7970
8258
  debug14("Migration statements executed");
7971
8259
  return;
@@ -7975,12 +8263,12 @@ var CreateIssuanceBranding1659463079429 = class {
7975
8263
  }
7976
8264
  }
7977
8265
  async down(queryRunner) {
7978
- debug14("migration: reverting issuance branding tables");
8266
+ debug14("migration: removing branding state checksum columns");
7979
8267
  const dbType = queryRunner.connection.driver.options.type;
7980
8268
  switch (dbType) {
7981
8269
  case "postgres": {
7982
8270
  debug14("using postgres migration file");
7983
- const mig = new CreateIssuanceBranding1685628974232();
8271
+ const mig = new AddBrandingStatePostgres1766000000000();
7984
8272
  await mig.down(queryRunner);
7985
8273
  debug14("Migration statements executed");
7986
8274
  return;
@@ -7989,7 +8277,7 @@ var CreateIssuanceBranding1659463079429 = class {
7989
8277
  case "expo":
7990
8278
  case "react-native": {
7991
8279
  debug14("using sqlite/react-native migration file");
7992
- const mig = new CreateIssuanceBranding1685628973231();
8280
+ const mig = new AddBrandingStateSqlite1766000000000();
7993
8281
  await mig.down(queryRunner);
7994
8282
  debug14("Migration statements executed");
7995
8283
  return;
@@ -8000,8 +8288,66 @@ var CreateIssuanceBranding1659463079429 = class {
8000
8288
  }
8001
8289
  };
8002
8290
 
8003
- // src/migrations/generic/3-CreateContacts.ts
8291
+ // src/migrations/generic/2-CreateIssuanceBranding.ts
8004
8292
  import Debug15 from "debug";
8293
+ var debug15 = Debug15("sphereon:ssi-sdk:migrations");
8294
+ var CreateIssuanceBranding1659463079429 = class {
8295
+ static {
8296
+ __name(this, "CreateIssuanceBranding1659463079429");
8297
+ }
8298
+ name = "CreateIssuanceBranding1659463079429";
8299
+ async up(queryRunner) {
8300
+ debug15("migration: creating issuance branding tables");
8301
+ const dbType = queryRunner.connection.driver.options.type;
8302
+ switch (dbType) {
8303
+ case "postgres": {
8304
+ debug15("using postgres migration file");
8305
+ const mig = new CreateIssuanceBranding1685628974232();
8306
+ await mig.up(queryRunner);
8307
+ debug15("Migration statements executed");
8308
+ return;
8309
+ }
8310
+ case "sqlite":
8311
+ case "expo":
8312
+ case "react-native": {
8313
+ debug15("using sqlite/react-native migration file");
8314
+ const mig = new CreateIssuanceBranding1685628973231();
8315
+ await mig.up(queryRunner);
8316
+ debug15("Migration statements executed");
8317
+ return;
8318
+ }
8319
+ default:
8320
+ 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`);
8321
+ }
8322
+ }
8323
+ async down(queryRunner) {
8324
+ debug15("migration: reverting issuance branding tables");
8325
+ const dbType = queryRunner.connection.driver.options.type;
8326
+ switch (dbType) {
8327
+ case "postgres": {
8328
+ debug15("using postgres migration file");
8329
+ const mig = new CreateIssuanceBranding1685628974232();
8330
+ await mig.down(queryRunner);
8331
+ debug15("Migration statements executed");
8332
+ return;
8333
+ }
8334
+ case "sqlite":
8335
+ case "expo":
8336
+ case "react-native": {
8337
+ debug15("using sqlite/react-native migration file");
8338
+ const mig = new CreateIssuanceBranding1685628973231();
8339
+ await mig.down(queryRunner);
8340
+ debug15("Migration statements executed");
8341
+ return;
8342
+ }
8343
+ default:
8344
+ 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`);
8345
+ }
8346
+ }
8347
+ };
8348
+
8349
+ // src/migrations/generic/3-CreateContacts.ts
8350
+ import Debug16 from "debug";
8005
8351
 
8006
8352
  // src/migrations/postgres/1690925872592-CreateContacts.ts
8007
8353
  import { enablePostgresUuidExtension as enablePostgresUuidExtension3 } from "@sphereon/ssi-sdk.core";
@@ -8222,30 +8568,30 @@ var CreateContacts1690925872693 = class {
8222
8568
  };
8223
8569
 
8224
8570
  // src/migrations/generic/3-CreateContacts.ts
8225
- var debug15 = Debug15("sphereon:ssi-sdk:migrations");
8571
+ var debug16 = Debug16("sphereon:ssi-sdk:migrations");
8226
8572
  var CreateContacts1690925872318 = class {
8227
8573
  static {
8228
8574
  __name(this, "CreateContacts1690925872318");
8229
8575
  }
8230
8576
  name = "CreateContacts1690925872318";
8231
8577
  async up(queryRunner) {
8232
- debug15("migration: creating contacts tables");
8578
+ debug16("migration: creating contacts tables");
8233
8579
  const dbType = queryRunner.connection.driver.options.type;
8234
8580
  switch (dbType) {
8235
8581
  case "postgres": {
8236
- debug15("using postgres migration file");
8582
+ debug16("using postgres migration file");
8237
8583
  const mig = new CreateContacts1690925872592();
8238
8584
  await mig.up(queryRunner);
8239
- debug15("Migration statements executed");
8585
+ debug16("Migration statements executed");
8240
8586
  return;
8241
8587
  }
8242
8588
  case "sqlite":
8243
8589
  case "expo":
8244
8590
  case "react-native": {
8245
- debug15("using sqlite/react-native migration file");
8591
+ debug16("using sqlite/react-native migration file");
8246
8592
  const mig = new CreateContacts1690925872693();
8247
8593
  await mig.up(queryRunner);
8248
- debug15("Migration statements executed");
8594
+ debug16("Migration statements executed");
8249
8595
  return;
8250
8596
  }
8251
8597
  default:
@@ -8253,23 +8599,23 @@ var CreateContacts1690925872318 = class {
8253
8599
  }
8254
8600
  }
8255
8601
  async down(queryRunner) {
8256
- debug15("migration: reverting contacts tables");
8602
+ debug16("migration: reverting contacts tables");
8257
8603
  const dbType = queryRunner.connection.driver.options.type;
8258
8604
  switch (dbType) {
8259
8605
  case "postgres": {
8260
- debug15("using postgres migration file");
8606
+ debug16("using postgres migration file");
8261
8607
  const mig = new CreateContacts1690925872592();
8262
8608
  await mig.down(queryRunner);
8263
- debug15("Migration statements executed");
8609
+ debug16("Migration statements executed");
8264
8610
  return;
8265
8611
  }
8266
8612
  case "sqlite":
8267
8613
  case "expo":
8268
8614
  case "react-native": {
8269
- debug15("using sqlite/react-native migration file");
8615
+ debug16("using sqlite/react-native migration file");
8270
8616
  const mig = new CreateContacts1690925872693();
8271
8617
  await mig.down(queryRunner);
8272
- debug15("Migration statements executed");
8618
+ debug16("Migration statements executed");
8273
8619
  return;
8274
8620
  }
8275
8621
  default:
@@ -8279,7 +8625,7 @@ var CreateContacts1690925872318 = class {
8279
8625
  };
8280
8626
 
8281
8627
  // src/migrations/generic/4-CreateStatusList.ts
8282
- import Debug16 from "debug";
8628
+ import Debug17 from "debug";
8283
8629
 
8284
8630
  // src/migrations/postgres/1693866470001-CreateStatusList.ts
8285
8631
  var CreateStatusList1693866470001 = class {
@@ -8485,53 +8831,53 @@ var UpdateStatusList1737110469000 = class {
8485
8831
  };
8486
8832
 
8487
8833
  // src/migrations/generic/4-CreateStatusList.ts
8488
- var debug16 = Debug16("sphereon:ssi-sdk:migrations");
8834
+ var debug17 = Debug17("sphereon:ssi-sdk:migrations");
8489
8835
  var CreateStatusList1693866470000 = class {
8490
8836
  static {
8491
8837
  __name(this, "CreateStatusList1693866470000");
8492
8838
  }
8493
8839
  name = "CreateStatusList1693866470000";
8494
8840
  async up(queryRunner) {
8495
- debug16("migration: creating issuance branding tables");
8841
+ debug17("migration: creating issuance branding tables");
8496
8842
  const dbType = queryRunner.connection.driver.options.type;
8497
8843
  if (dbType === "postgres") {
8498
- debug16("using postgres migration files");
8844
+ debug17("using postgres migration files");
8499
8845
  const createMig = new CreateStatusList1693866470001();
8500
8846
  await createMig.up(queryRunner);
8501
8847
  const updateMig = new UpdateStatusList1737110469001();
8502
8848
  const up = await updateMig.up(queryRunner);
8503
- debug16("Migration statements executed");
8849
+ debug17("Migration statements executed");
8504
8850
  return up;
8505
8851
  } else if (dbType === "sqlite" || dbType === "react-native" || dbType === "expo") {
8506
- debug16("using sqlite/react-native migration files");
8852
+ debug17("using sqlite/react-native migration files");
8507
8853
  const createMig = new CreateStatusList1693866470002();
8508
8854
  await createMig.up(queryRunner);
8509
8855
  const updateMig = new UpdateStatusList1737110469000();
8510
8856
  const up = await updateMig.up(queryRunner);
8511
- debug16("Migration statements executed");
8857
+ debug17("Migration statements executed");
8512
8858
  return up;
8513
8859
  } else {
8514
8860
  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`);
8515
8861
  }
8516
8862
  }
8517
8863
  async down(queryRunner) {
8518
- debug16("migration: reverting issuance branding tables");
8864
+ debug17("migration: reverting issuance branding tables");
8519
8865
  const dbType = queryRunner.connection.driver.options.type;
8520
8866
  if (dbType === "postgres") {
8521
- debug16("using postgres migration files");
8867
+ debug17("using postgres migration files");
8522
8868
  const updateMig = new UpdateStatusList1737110469001();
8523
8869
  await updateMig.down(queryRunner);
8524
8870
  const createMig = new CreateStatusList1693866470001();
8525
8871
  const down = await createMig.down(queryRunner);
8526
- debug16("Migration statements executed");
8872
+ debug17("Migration statements executed");
8527
8873
  return down;
8528
8874
  } else if (dbType === "sqlite" || dbType === "react-native" || dbType === "expo") {
8529
- debug16("using sqlite/react-native migration files");
8875
+ debug17("using sqlite/react-native migration files");
8530
8876
  const updateMig = new UpdateStatusList1737110469000();
8531
8877
  await updateMig.down(queryRunner);
8532
8878
  const createMig = new CreateStatusList1693866470002();
8533
8879
  const down = await createMig.down(queryRunner);
8534
- debug16("Migration statements executed");
8880
+ debug17("Migration statements executed");
8535
8881
  return down;
8536
8882
  } else {
8537
8883
  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`);
@@ -8540,7 +8886,7 @@ var CreateStatusList1693866470000 = class {
8540
8886
  };
8541
8887
 
8542
8888
  // src/migrations/generic/5-CreateAuditEvents.ts
8543
- import Debug17 from "debug";
8889
+ import Debug18 from "debug";
8544
8890
 
8545
8891
  // src/migrations/postgres/1701634812183-CreateAuditEvents.ts
8546
8892
  var CreateAuditEvents1701634812183 = class {
@@ -8639,30 +8985,30 @@ var CreateAuditEvents1701634819487 = class {
8639
8985
  };
8640
8986
 
8641
8987
  // src/migrations/generic/5-CreateAuditEvents.ts
8642
- var debug17 = Debug17("sphereon:ssi-sdk:migrations");
8988
+ var debug18 = Debug18("sphereon:ssi-sdk:migrations");
8643
8989
  var CreateAuditEvents1701635835330 = class {
8644
8990
  static {
8645
8991
  __name(this, "CreateAuditEvents1701635835330");
8646
8992
  }
8647
8993
  name = "CreateAuditEvents1701635835330";
8648
8994
  async up(queryRunner) {
8649
- debug17("migration: creating audit events tables");
8995
+ debug18("migration: creating audit events tables");
8650
8996
  const dbType = queryRunner.connection.driver.options.type;
8651
8997
  switch (dbType) {
8652
8998
  case "postgres": {
8653
- debug17("using postgres migration file");
8999
+ debug18("using postgres migration file");
8654
9000
  const mig = new CreateAuditEvents1701634812183();
8655
9001
  await mig.up(queryRunner);
8656
- debug17("Migration statements executed");
9002
+ debug18("Migration statements executed");
8657
9003
  return;
8658
9004
  }
8659
9005
  case "sqlite":
8660
9006
  case "expo":
8661
9007
  case "react-native": {
8662
- debug17("using sqlite/react-native migration file");
9008
+ debug18("using sqlite/react-native migration file");
8663
9009
  const mig = new CreateAuditEvents1701634819487();
8664
9010
  await mig.up(queryRunner);
8665
- debug17("Migration statements executed");
9011
+ debug18("Migration statements executed");
8666
9012
  return;
8667
9013
  }
8668
9014
  default:
@@ -8670,23 +9016,23 @@ var CreateAuditEvents1701635835330 = class {
8670
9016
  }
8671
9017
  }
8672
9018
  async down(queryRunner) {
8673
- debug17("migration: reverting audit events tables");
9019
+ debug18("migration: reverting audit events tables");
8674
9020
  const dbType = queryRunner.connection.driver.options.type;
8675
9021
  switch (dbType) {
8676
9022
  case "postgres": {
8677
- debug17("using postgres migration file");
9023
+ debug18("using postgres migration file");
8678
9024
  const mig = new CreateAuditEvents1701634812183();
8679
9025
  await mig.down(queryRunner);
8680
- debug17("Migration statements executed");
9026
+ debug18("Migration statements executed");
8681
9027
  return;
8682
9028
  }
8683
9029
  case "sqlite":
8684
9030
  case "expo":
8685
9031
  case "react-native": {
8686
- debug17("using sqlite/react-native migration file");
9032
+ debug18("using sqlite/react-native migration file");
8687
9033
  const mig = new CreateAuditEvents1701634819487();
8688
9034
  await mig.down(queryRunner);
8689
- debug17("Migration statements executed");
9035
+ debug18("Migration statements executed");
8690
9036
  return;
8691
9037
  }
8692
9038
  default:
@@ -8696,7 +9042,7 @@ var CreateAuditEvents1701635835330 = class {
8696
9042
  };
8697
9043
 
8698
9044
  // src/migrations/generic/6-CreateDigitalCredential.ts
8699
- import Debug18 from "debug";
9045
+ import Debug19 from "debug";
8700
9046
 
8701
9047
  // src/migrations/postgres/1708525189001-CreateDigitalCredential.ts
8702
9048
  var CreateDigitalCredential1708525189001 = class {
@@ -8804,30 +9150,30 @@ var CreateDigitalCredential1708525189002 = class {
8804
9150
  };
8805
9151
 
8806
9152
  // src/migrations/generic/6-CreateDigitalCredential.ts
8807
- var debug18 = Debug18("sphereon:ssi-sdk:migrations");
9153
+ var debug19 = Debug19("sphereon:ssi-sdk:migrations");
8808
9154
  var CreateDigitalCredential1708525189000 = class {
8809
9155
  static {
8810
9156
  __name(this, "CreateDigitalCredential1708525189000");
8811
9157
  }
8812
9158
  name = "CreateDigitalCredential1708525189000";
8813
9159
  async up(queryRunner) {
8814
- debug18("migration: creating DigitalCredential tables");
9160
+ debug19("migration: creating DigitalCredential tables");
8815
9161
  const dbType = queryRunner.connection.driver.options.type;
8816
9162
  switch (dbType) {
8817
9163
  case "postgres": {
8818
- debug18("using postgres migration file for DigitalCredential");
9164
+ debug19("using postgres migration file for DigitalCredential");
8819
9165
  const mig = new CreateDigitalCredential1708525189001();
8820
9166
  await mig.up(queryRunner);
8821
- debug18("Postgres Migration statements for DigitalCredential executed");
9167
+ debug19("Postgres Migration statements for DigitalCredential executed");
8822
9168
  return;
8823
9169
  }
8824
9170
  case "sqlite":
8825
9171
  case "expo":
8826
9172
  case "react-native": {
8827
- debug18("using sqlite/react-native migration file for DigitalCredential");
9173
+ debug19("using sqlite/react-native migration file for DigitalCredential");
8828
9174
  const mig = new CreateDigitalCredential1708525189002();
8829
9175
  await mig.up(queryRunner);
8830
- debug18("SQLite Migration statements for DigitalCredential executed");
9176
+ debug19("SQLite Migration statements for DigitalCredential executed");
8831
9177
  return;
8832
9178
  }
8833
9179
  default:
@@ -8835,23 +9181,23 @@ var CreateDigitalCredential1708525189000 = class {
8835
9181
  }
8836
9182
  }
8837
9183
  async down(queryRunner) {
8838
- debug18("migration: reverting DigitalCredential tables");
9184
+ debug19("migration: reverting DigitalCredential tables");
8839
9185
  const dbType = queryRunner.connection.driver.options.type;
8840
9186
  switch (dbType) {
8841
9187
  case "postgres": {
8842
- debug18("using postgres migration file for DigitalCredential");
9188
+ debug19("using postgres migration file for DigitalCredential");
8843
9189
  const mig = new CreateDigitalCredential1708525189001();
8844
9190
  await mig.down(queryRunner);
8845
- debug18("Postgres Migration statements for DigitalCredential reverted");
9191
+ debug19("Postgres Migration statements for DigitalCredential reverted");
8846
9192
  return;
8847
9193
  }
8848
9194
  case "sqlite":
8849
9195
  case "expo":
8850
9196
  case "react-native": {
8851
- debug18("using sqlite/react-native migration file for DigitalCredential");
9197
+ debug19("using sqlite/react-native migration file for DigitalCredential");
8852
9198
  const mig = new CreateDigitalCredential1708525189002();
8853
9199
  await mig.down(queryRunner);
8854
- debug18("SQLite Migration statements for DigitalCredential reverted");
9200
+ debug19("SQLite Migration statements for DigitalCredential reverted");
8855
9201
  return;
8856
9202
  }
8857
9203
  default:
@@ -8861,7 +9207,7 @@ var CreateDigitalCredential1708525189000 = class {
8861
9207
  };
8862
9208
 
8863
9209
  // src/migrations/generic/7-CreateMachineStateStore.ts
8864
- import Debug19 from "debug";
9210
+ import Debug20 from "debug";
8865
9211
 
8866
9212
  // src/migrations/postgres/1708797018115-CreateMachineStateStore.ts
8867
9213
  var CreateMachineStateStore1708797018115 = class {
@@ -8923,30 +9269,30 @@ var CreateMachineStateStore1708796002272 = class {
8923
9269
  };
8924
9270
 
8925
9271
  // src/migrations/generic/7-CreateMachineStateStore.ts
8926
- var debug19 = Debug19("sphereon:ssi-sdk:migrations");
9272
+ var debug20 = Debug20("sphereon:ssi-sdk:migrations");
8927
9273
  var CreateMachineStateStore1708098041262 = class {
8928
9274
  static {
8929
9275
  __name(this, "CreateMachineStateStore1708098041262");
8930
9276
  }
8931
9277
  name = "CreateMachineStateStore1708098041262";
8932
9278
  async up(queryRunner) {
8933
- debug19("migration: creating machine state tables");
9279
+ debug20("migration: creating machine state tables");
8934
9280
  const dbType = queryRunner.connection.driver.options.type;
8935
9281
  switch (dbType) {
8936
9282
  case "postgres": {
8937
- debug19("using postgres migration file");
9283
+ debug20("using postgres migration file");
8938
9284
  const mig = new CreateMachineStateStore1708797018115();
8939
9285
  await mig.up(queryRunner);
8940
- debug19("Migration statements executed");
9286
+ debug20("Migration statements executed");
8941
9287
  return;
8942
9288
  }
8943
9289
  case "sqlite":
8944
9290
  case "expo":
8945
9291
  case "react-native": {
8946
- debug19("using sqlite/react-native migration file");
9292
+ debug20("using sqlite/react-native migration file");
8947
9293
  const mig = new CreateMachineStateStore1708796002272();
8948
9294
  await mig.up(queryRunner);
8949
- debug19("Migration statements executed");
9295
+ debug20("Migration statements executed");
8950
9296
  return;
8951
9297
  }
8952
9298
  default:
@@ -8954,23 +9300,23 @@ var CreateMachineStateStore1708098041262 = class {
8954
9300
  }
8955
9301
  }
8956
9302
  async down(queryRunner) {
8957
- debug19("migration: reverting machine state tables");
9303
+ debug20("migration: reverting machine state tables");
8958
9304
  const dbType = queryRunner.connection.driver.options.type;
8959
9305
  switch (dbType) {
8960
9306
  case "postgres": {
8961
- debug19("using postgres migration file");
9307
+ debug20("using postgres migration file");
8962
9308
  const mig = new CreateMachineStateStore1708797018115();
8963
9309
  await mig.down(queryRunner);
8964
- debug19("Migration statements executed");
9310
+ debug20("Migration statements executed");
8965
9311
  return;
8966
9312
  }
8967
9313
  case "sqlite":
8968
9314
  case "expo":
8969
9315
  case "react-native": {
8970
- debug19("using sqlite/react-native migration file");
9316
+ debug20("using sqlite/react-native migration file");
8971
9317
  const mig = new CreateMachineStateStore1708796002272();
8972
9318
  await mig.down(queryRunner);
8973
- debug19("Migration statements executed");
9319
+ debug20("Migration statements executed");
8974
9320
  return;
8975
9321
  }
8976
9322
  default:
@@ -8980,7 +9326,7 @@ var CreateMachineStateStore1708098041262 = class {
8980
9326
  };
8981
9327
 
8982
9328
  // src/migrations/generic/8-CreateContacts.ts
8983
- import Debug20 from "debug";
9329
+ import Debug21 from "debug";
8984
9330
 
8985
9331
  // src/migrations/postgres/1710438363001-CreateContacts.ts
8986
9332
  var CreateContacts1710438363001 = class {
@@ -9094,30 +9440,30 @@ var CreateContacts1710438363002 = class {
9094
9440
  };
9095
9441
 
9096
9442
  // src/migrations/generic/8-CreateContacts.ts
9097
- var debug20 = Debug20("sphereon:ssi-sdk:migrations");
9443
+ var debug21 = Debug21("sphereon:ssi-sdk:migrations");
9098
9444
  var CreateContacts1708525189000 = class {
9099
9445
  static {
9100
9446
  __name(this, "CreateContacts1708525189000");
9101
9447
  }
9102
9448
  name = "CreateContacts1708525189000";
9103
9449
  async up(queryRunner) {
9104
- debug20("migration: updating contact tables");
9450
+ debug21("migration: updating contact tables");
9105
9451
  const dbType = queryRunner.connection.driver.options.type;
9106
9452
  switch (dbType) {
9107
9453
  case "postgres": {
9108
- debug20("using postgres migration file");
9454
+ debug21("using postgres migration file");
9109
9455
  const mig = new CreateContacts1710438363001();
9110
9456
  await mig.up(queryRunner);
9111
- debug20("Migration statements executed");
9457
+ debug21("Migration statements executed");
9112
9458
  return;
9113
9459
  }
9114
9460
  case "sqlite":
9115
9461
  case "expo":
9116
9462
  case "react-native": {
9117
- debug20("using sqlite/react-native migration file");
9463
+ debug21("using sqlite/react-native migration file");
9118
9464
  const mig = new CreateContacts1710438363002();
9119
9465
  await mig.up(queryRunner);
9120
- debug20("Migration statements executed");
9466
+ debug21("Migration statements executed");
9121
9467
  return;
9122
9468
  }
9123
9469
  default:
@@ -9125,23 +9471,23 @@ var CreateContacts1708525189000 = class {
9125
9471
  }
9126
9472
  }
9127
9473
  async down(queryRunner) {
9128
- debug20("migration: reverting machine state tables");
9474
+ debug21("migration: reverting machine state tables");
9129
9475
  const dbType = queryRunner.connection.driver.options.type;
9130
9476
  switch (dbType) {
9131
9477
  case "postgres": {
9132
- debug20("using postgres migration file");
9478
+ debug21("using postgres migration file");
9133
9479
  const mig = new CreateContacts1710438363001();
9134
9480
  await mig.down(queryRunner);
9135
- debug20("Migration statements executed");
9481
+ debug21("Migration statements executed");
9136
9482
  return;
9137
9483
  }
9138
9484
  case "sqlite":
9139
9485
  case "expo":
9140
9486
  case "react-native": {
9141
- debug20("using sqlite/react-native migration file");
9487
+ debug21("using sqlite/react-native migration file");
9142
9488
  const mig = new CreateContacts1710438363002();
9143
9489
  await mig.down(queryRunner);
9144
- debug20("Migration statements executed");
9490
+ debug21("Migration statements executed");
9145
9491
  return;
9146
9492
  }
9147
9493
  default:
@@ -9151,7 +9497,7 @@ var CreateContacts1708525189000 = class {
9151
9497
  };
9152
9498
 
9153
9499
  // src/migrations/generic/9-CreateContacts.ts
9154
- import Debug21 from "debug";
9500
+ import Debug22 from "debug";
9155
9501
 
9156
9502
  // src/migrations/postgres/1715761125001-CreateContacts.ts
9157
9503
  var CreateContacts1715761125001 = class {
@@ -9263,30 +9609,30 @@ var CreateContacts1715761125002 = class {
9263
9609
  };
9264
9610
 
9265
9611
  // src/migrations/generic/9-CreateContacts.ts
9266
- var debug21 = Debug21("sphereon:ssi-sdk:migrations");
9612
+ var debug22 = Debug22("sphereon:ssi-sdk:migrations");
9267
9613
  var CreateContacts1715761125000 = class {
9268
9614
  static {
9269
9615
  __name(this, "CreateContacts1715761125000");
9270
9616
  }
9271
9617
  name = "CreateContacts1715761125000";
9272
9618
  async up(queryRunner) {
9273
- debug21("migration: updating contact tables");
9619
+ debug22("migration: updating contact tables");
9274
9620
  const dbType = queryRunner.connection.driver.options.type;
9275
9621
  switch (dbType) {
9276
9622
  case "postgres": {
9277
- debug21("using postgres migration file");
9623
+ debug22("using postgres migration file");
9278
9624
  const mig = new CreateContacts1715761125001();
9279
9625
  await mig.up(queryRunner);
9280
- debug21("Migration statements executed");
9626
+ debug22("Migration statements executed");
9281
9627
  return;
9282
9628
  }
9283
9629
  case "sqlite":
9284
9630
  case "expo":
9285
9631
  case "react-native": {
9286
- debug21("using sqlite/react-native migration file");
9632
+ debug22("using sqlite/react-native migration file");
9287
9633
  const mig = new CreateContacts1715761125002();
9288
9634
  await mig.up(queryRunner);
9289
- debug21("Migration statements executed");
9635
+ debug22("Migration statements executed");
9290
9636
  return;
9291
9637
  }
9292
9638
  default:
@@ -9294,23 +9640,23 @@ var CreateContacts1715761125000 = class {
9294
9640
  }
9295
9641
  }
9296
9642
  async down(queryRunner) {
9297
- debug21("migration: reverting machine state tables");
9643
+ debug22("migration: reverting machine state tables");
9298
9644
  const dbType = queryRunner.connection.driver.options.type;
9299
9645
  switch (dbType) {
9300
9646
  case "postgres": {
9301
- debug21("using postgres migration file");
9647
+ debug22("using postgres migration file");
9302
9648
  const mig = new CreateContacts1715761125001();
9303
9649
  await mig.down(queryRunner);
9304
- debug21("Migration statements executed");
9650
+ debug22("Migration statements executed");
9305
9651
  return;
9306
9652
  }
9307
9653
  case "sqlite":
9308
9654
  case "expo":
9309
9655
  case "react-native": {
9310
- debug21("using sqlite/react-native migration file");
9656
+ debug22("using sqlite/react-native migration file");
9311
9657
  const mig = new CreateContacts1715761125002();
9312
9658
  await mig.down(queryRunner);
9313
- debug21("Migration statements executed");
9659
+ debug22("Migration statements executed");
9314
9660
  return;
9315
9661
  }
9316
9662
  default:
@@ -9328,7 +9674,8 @@ var DataStoreContactMigrations = [
9328
9674
  ];
9329
9675
  var DataStoreIssuanceBrandingMigrations = [
9330
9676
  CreateIssuanceBranding1659463079429,
9331
- FixCredentialClaimsReferencesUuid1741895822987
9677
+ FixCredentialClaimsReferencesUuid1741895822987,
9678
+ AddBrandingState1766000000000
9332
9679
  ];
9333
9680
  var DataStoreStatusListMigrations = [
9334
9681
  CreateStatusList1693866470000,
@@ -9663,6 +10010,7 @@ export {
9663
10010
  credentialBrandingFrom,
9664
10011
  credentialClaimsEntityFrom,
9665
10012
  credentialLocaleBrandingEntityFrom,
10013
+ credentialLocaleBrandingFromEntity,
9666
10014
  dcqlQueryEntityItemFrom,
9667
10015
  dcqlQueryItemFrom,
9668
10016
  didAuthConfigEntityFrom,