@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.cjs +448 -100
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +463 -115
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
- package/src/__tests__/issuanceBranding.entities.test.ts +1 -1
- package/src/__tests__/issuanceBranding.store.test.ts +310 -0
- package/src/contact/ContactStore.ts +10 -1
- package/src/entities/issuanceBranding/CredentialBrandingEntity.ts +42 -1
- package/src/entities/issuanceBranding/CredentialLocaleBrandingEntity.ts +64 -1
- package/src/entities/issuanceBranding/IssuerLocaleBrandingEntity.ts +63 -1
- package/src/issuanceBranding/IssuanceBrandingStore.ts +16 -5
- package/src/migrations/generic/15-AddBrandingState.ts +64 -0
- package/src/migrations/generic/index.ts +6 -1
- package/src/migrations/postgres/1766000000000-AddBrandingState.ts +15 -0
- package/src/migrations/sqlite/1766000000000-AddBrandingState.ts +74 -0
- package/src/utils/issuanceBranding/HashUtils.ts +30 -0
- package/src/utils/issuanceBranding/MappingUtils.ts +21 -1
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,9 @@ var CredentialBrandingEntity = class extends import_typeorm26.BaseEntity {
|
|
|
3197
3270
|
updateUpdatedDate() {
|
|
3198
3271
|
this.lastUpdatedAt = /* @__PURE__ */ new Date();
|
|
3199
3272
|
}
|
|
3273
|
+
setState() {
|
|
3274
|
+
this.state = this.computeState();
|
|
3275
|
+
}
|
|
3200
3276
|
async validate() {
|
|
3201
3277
|
const validation = await (0, import_class_validator17.validate)(this);
|
|
3202
3278
|
if (validation.length > 0) {
|
|
@@ -3204,6 +3280,31 @@ var CredentialBrandingEntity = class extends import_typeorm26.BaseEntity {
|
|
|
3204
3280
|
}
|
|
3205
3281
|
return;
|
|
3206
3282
|
}
|
|
3283
|
+
computeState() {
|
|
3284
|
+
const localeStates = (this.localeBranding ?? []).map((localeBranding) => ({
|
|
3285
|
+
locale: localeBranding.locale ?? "",
|
|
3286
|
+
alias: localeBranding.alias ?? "",
|
|
3287
|
+
id: localeBranding.id ?? "",
|
|
3288
|
+
state: computeCredentialLocaleBrandingState(localeBranding)
|
|
3289
|
+
}));
|
|
3290
|
+
localeStates.sort((first, second) => {
|
|
3291
|
+
const localeCompare = first.locale.localeCompare(second.locale);
|
|
3292
|
+
if (localeCompare !== 0) {
|
|
3293
|
+
return localeCompare;
|
|
3294
|
+
}
|
|
3295
|
+
const aliasCompare = first.alias.localeCompare(second.alias);
|
|
3296
|
+
if (aliasCompare !== 0) {
|
|
3297
|
+
return aliasCompare;
|
|
3298
|
+
}
|
|
3299
|
+
return first.id.localeCompare(second.id);
|
|
3300
|
+
});
|
|
3301
|
+
const payload = {
|
|
3302
|
+
issuerCorrelationId: this.issuerCorrelationId,
|
|
3303
|
+
vcHash: this.vcHash,
|
|
3304
|
+
localeBranding: localeStates.map((entry) => entry.state)
|
|
3305
|
+
};
|
|
3306
|
+
return computeCompactHash(JSON.stringify(payload));
|
|
3307
|
+
}
|
|
3207
3308
|
};
|
|
3208
3309
|
_ts_decorate27([
|
|
3209
3310
|
(0, import_typeorm26.PrimaryGeneratedColumn)("uuid"),
|
|
@@ -3233,6 +3334,14 @@ _ts_decorate27([
|
|
|
3233
3334
|
}),
|
|
3234
3335
|
_ts_metadata26("design:type", String)
|
|
3235
3336
|
], CredentialBrandingEntity.prototype, "issuerCorrelationId", void 0);
|
|
3337
|
+
_ts_decorate27([
|
|
3338
|
+
(0, import_typeorm26.Column)("varchar", {
|
|
3339
|
+
name: "state",
|
|
3340
|
+
length: 255,
|
|
3341
|
+
nullable: false
|
|
3342
|
+
}),
|
|
3343
|
+
_ts_metadata26("design:type", String)
|
|
3344
|
+
], CredentialBrandingEntity.prototype, "state", void 0);
|
|
3236
3345
|
_ts_decorate27([
|
|
3237
3346
|
(0, import_typeorm26.OneToMany)(() => CredentialLocaleBrandingEntity, (credentialLocaleBrandingEntity) => credentialLocaleBrandingEntity.credentialBranding, {
|
|
3238
3347
|
cascade: true,
|
|
@@ -3268,6 +3377,13 @@ _ts_decorate27([
|
|
|
3268
3377
|
_ts_metadata26("design:paramtypes", []),
|
|
3269
3378
|
_ts_metadata26("design:returntype", void 0)
|
|
3270
3379
|
], CredentialBrandingEntity.prototype, "updateUpdatedDate", null);
|
|
3380
|
+
_ts_decorate27([
|
|
3381
|
+
(0, import_typeorm26.BeforeInsert)(),
|
|
3382
|
+
(0, import_typeorm26.BeforeUpdate)(),
|
|
3383
|
+
_ts_metadata26("design:type", Function),
|
|
3384
|
+
_ts_metadata26("design:paramtypes", []),
|
|
3385
|
+
_ts_metadata26("design:returntype", void 0)
|
|
3386
|
+
], CredentialBrandingEntity.prototype, "setState", null);
|
|
3271
3387
|
_ts_decorate27([
|
|
3272
3388
|
(0, import_typeorm26.BeforeInsert)(),
|
|
3273
3389
|
(0, import_typeorm26.BeforeUpdate)(),
|
|
@@ -3314,6 +3430,48 @@ var IssuerLocaleBrandingEntity = class extends BaseLocaleBrandingEntity {
|
|
|
3314
3430
|
policyUri;
|
|
3315
3431
|
contacts;
|
|
3316
3432
|
issuerBrandingId;
|
|
3433
|
+
state;
|
|
3434
|
+
setState() {
|
|
3435
|
+
this.state = this.computeState();
|
|
3436
|
+
}
|
|
3437
|
+
computeState() {
|
|
3438
|
+
const payload = {
|
|
3439
|
+
alias: this.alias ?? null,
|
|
3440
|
+
locale: this.locale ?? null,
|
|
3441
|
+
description: this.description ?? null,
|
|
3442
|
+
clientUri: this.clientUri ?? null,
|
|
3443
|
+
tosUri: this.tosUri ?? null,
|
|
3444
|
+
policyUri: this.policyUri ?? null,
|
|
3445
|
+
contacts: this.contacts ?? null,
|
|
3446
|
+
logo: this.logo ? {
|
|
3447
|
+
uri: this.logo.uri ?? null,
|
|
3448
|
+
dataUri: this.logo.dataUri ?? null,
|
|
3449
|
+
mediaType: this.logo.mediaType ?? null,
|
|
3450
|
+
alt: this.logo.alt ?? null,
|
|
3451
|
+
dimensions: this.logo.dimensions ? {
|
|
3452
|
+
width: this.logo.dimensions.width,
|
|
3453
|
+
height: this.logo.dimensions.height
|
|
3454
|
+
} : null
|
|
3455
|
+
} : null,
|
|
3456
|
+
background: this.background ? {
|
|
3457
|
+
color: this.background.color ?? null,
|
|
3458
|
+
image: this.background.image ? {
|
|
3459
|
+
uri: this.background.image.uri ?? null,
|
|
3460
|
+
dataUri: this.background.image.dataUri ?? null,
|
|
3461
|
+
mediaType: this.background.image.mediaType ?? null,
|
|
3462
|
+
alt: this.background.image.alt ?? null,
|
|
3463
|
+
dimensions: this.background.image.dimensions ? {
|
|
3464
|
+
width: this.background.image.dimensions.width,
|
|
3465
|
+
height: this.background.image.dimensions.height
|
|
3466
|
+
} : null
|
|
3467
|
+
} : null
|
|
3468
|
+
} : null,
|
|
3469
|
+
text: this.text ? {
|
|
3470
|
+
color: this.text.color ?? null
|
|
3471
|
+
} : null
|
|
3472
|
+
};
|
|
3473
|
+
return computeCompactHash(JSON.stringify(payload));
|
|
3474
|
+
}
|
|
3317
3475
|
};
|
|
3318
3476
|
_ts_decorate28([
|
|
3319
3477
|
(0, import_typeorm27.ManyToOne)(() => IssuerBrandingEntity, (issuerBranding) => issuerBranding.localeBranding, {
|
|
@@ -3372,6 +3530,21 @@ _ts_decorate28([
|
|
|
3372
3530
|
}),
|
|
3373
3531
|
_ts_metadata27("design:type", String)
|
|
3374
3532
|
], IssuerLocaleBrandingEntity.prototype, "issuerBrandingId", void 0);
|
|
3533
|
+
_ts_decorate28([
|
|
3534
|
+
(0, import_typeorm27.Column)("varchar", {
|
|
3535
|
+
name: "state",
|
|
3536
|
+
length: 255,
|
|
3537
|
+
nullable: false
|
|
3538
|
+
}),
|
|
3539
|
+
_ts_metadata27("design:type", String)
|
|
3540
|
+
], IssuerLocaleBrandingEntity.prototype, "state", void 0);
|
|
3541
|
+
_ts_decorate28([
|
|
3542
|
+
(0, import_typeorm27.BeforeInsert)(),
|
|
3543
|
+
(0, import_typeorm27.BeforeUpdate)(),
|
|
3544
|
+
_ts_metadata27("design:type", Function),
|
|
3545
|
+
_ts_metadata27("design:paramtypes", []),
|
|
3546
|
+
_ts_metadata27("design:returntype", void 0)
|
|
3547
|
+
], IssuerLocaleBrandingEntity.prototype, "setState", null);
|
|
3375
3548
|
IssuerLocaleBrandingEntity = _ts_decorate28([
|
|
3376
3549
|
(0, import_typeorm27.ChildEntity)("IssuerLocaleBranding"),
|
|
3377
3550
|
(0, import_typeorm27.Index)("IDX_IssuerLocaleBrandingEntity_issuerBranding_locale", [
|
|
@@ -4809,7 +4982,13 @@ var ContactStore = class extends import_ssi_sdk25.AbstractContactStore {
|
|
|
4809
4982
|
}
|
|
4810
4983
|
});
|
|
4811
4984
|
debug(`getParties() resulted in ${result.length} parties`);
|
|
4812
|
-
return result.
|
|
4985
|
+
return result.filter((party) => {
|
|
4986
|
+
if (!party.contact) {
|
|
4987
|
+
console.warn(`party ${party.id} does not have an associated contact`);
|
|
4988
|
+
return false;
|
|
4989
|
+
}
|
|
4990
|
+
return true;
|
|
4991
|
+
}).map(partyFrom);
|
|
4813
4992
|
}, "getParties");
|
|
4814
4993
|
addParty = /* @__PURE__ */ __name(async (args) => {
|
|
4815
4994
|
const { identities, contact, partyType } = args;
|
|
@@ -5605,7 +5784,7 @@ var import_typeorm37 = require("typeorm");
|
|
|
5605
5784
|
var credentialBrandingFrom = /* @__PURE__ */ __name((credentialBranding) => {
|
|
5606
5785
|
const result = {
|
|
5607
5786
|
...credentialBranding,
|
|
5608
|
-
localeBranding: credentialBranding.localeBranding.map((localeBranding) =>
|
|
5787
|
+
localeBranding: credentialBranding.localeBranding.map((localeBranding) => credentialLocaleBrandingFromEntity(localeBranding))
|
|
5609
5788
|
};
|
|
5610
5789
|
return replaceNullWithUndefined(result);
|
|
5611
5790
|
}, "credentialBrandingFrom");
|
|
@@ -5623,6 +5802,19 @@ var localeBrandingFrom = /* @__PURE__ */ __name((localeBranding) => {
|
|
|
5623
5802
|
};
|
|
5624
5803
|
return replaceNullWithUndefined(result);
|
|
5625
5804
|
}, "localeBrandingFrom");
|
|
5805
|
+
var credentialLocaleBrandingFromEntity = /* @__PURE__ */ __name((localeBranding) => {
|
|
5806
|
+
const base = localeBrandingFrom(localeBranding);
|
|
5807
|
+
const result = {
|
|
5808
|
+
...base,
|
|
5809
|
+
state: localeBranding.state,
|
|
5810
|
+
claims: localeBranding.claims ? localeBranding.claims.map((claim) => ({
|
|
5811
|
+
id: claim.id,
|
|
5812
|
+
key: claim.key,
|
|
5813
|
+
name: claim.name
|
|
5814
|
+
})) : void 0
|
|
5815
|
+
};
|
|
5816
|
+
return replaceNullWithUndefined(result);
|
|
5817
|
+
}, "credentialLocaleBrandingFromEntity");
|
|
5626
5818
|
var issuerLocaleBrandingEntityFrom = /* @__PURE__ */ __name((args) => {
|
|
5627
5819
|
const issuerLocaleBrandingEntity = new IssuerLocaleBrandingEntity();
|
|
5628
5820
|
issuerLocaleBrandingEntity.alias = isEmptyString(args.alias) ? void 0 : args.alias;
|
|
@@ -5727,7 +5919,7 @@ var IssuanceBrandingStore = class extends import_ssi_sdk27.AbstractIssuanceBrand
|
|
|
5727
5919
|
return credentialBrandingFrom(createdResult);
|
|
5728
5920
|
}, "addCredentialBranding");
|
|
5729
5921
|
getCredentialBranding = /* @__PURE__ */ __name(async (args) => {
|
|
5730
|
-
const { filter } = args ?? {};
|
|
5922
|
+
const { filter, knownStates } = args ?? {};
|
|
5731
5923
|
if (filter) {
|
|
5732
5924
|
filter.forEach((filter2) => {
|
|
5733
5925
|
if (filter2.localeBranding && "locale" in filter2.localeBranding && filter2.localeBranding.locale === void 0) {
|
|
@@ -5741,7 +5933,14 @@ var IssuanceBrandingStore = class extends import_ssi_sdk27.AbstractIssuanceBrand
|
|
|
5741
5933
|
where: filter
|
|
5742
5934
|
}
|
|
5743
5935
|
});
|
|
5744
|
-
|
|
5936
|
+
const credentialBranding = result.map((branding) => credentialBrandingFrom(branding));
|
|
5937
|
+
if (!knownStates) {
|
|
5938
|
+
return credentialBranding;
|
|
5939
|
+
}
|
|
5940
|
+
return credentialBranding.filter((branding) => {
|
|
5941
|
+
const knownState = knownStates[branding.id];
|
|
5942
|
+
return !knownState || knownState !== branding.state;
|
|
5943
|
+
});
|
|
5745
5944
|
}, "getCredentialBranding");
|
|
5746
5945
|
removeCredentialBranding = /* @__PURE__ */ __name(async (args) => {
|
|
5747
5946
|
const { filter } = args;
|
|
@@ -5834,7 +6033,7 @@ var IssuanceBrandingStore = class extends import_ssi_sdk27.AbstractIssuanceBrand
|
|
|
5834
6033
|
where: filter
|
|
5835
6034
|
}
|
|
5836
6035
|
});
|
|
5837
|
-
return credentialBrandingLocale ? credentialBrandingLocale.map((credentialLocaleBranding) =>
|
|
6036
|
+
return credentialBrandingLocale ? credentialBrandingLocale.map((credentialLocaleBranding) => credentialLocaleBrandingFromEntity(credentialLocaleBranding)) : [];
|
|
5838
6037
|
}, "getCredentialLocaleBranding");
|
|
5839
6038
|
removeCredentialLocaleBranding = /* @__PURE__ */ __name(async (args) => {
|
|
5840
6039
|
const { filter } = args;
|
|
@@ -8094,21 +8293,111 @@ var AddLinkedVpFields1763387280000 = class {
|
|
|
8094
8293
|
}
|
|
8095
8294
|
};
|
|
8096
8295
|
|
|
8097
|
-
// src/migrations/generic/
|
|
8296
|
+
// src/migrations/generic/15-AddBrandingState.ts
|
|
8098
8297
|
var import_debug14 = __toESM(require("debug"), 1);
|
|
8298
|
+
|
|
8299
|
+
// src/migrations/postgres/1766000000000-AddBrandingState.ts
|
|
8300
|
+
var AddBrandingStatePostgres1766000000000 = class {
|
|
8301
|
+
static {
|
|
8302
|
+
__name(this, "AddBrandingStatePostgres1766000000000");
|
|
8303
|
+
}
|
|
8304
|
+
name = "AddBrandingState1766000000000";
|
|
8305
|
+
async up(queryRunner) {
|
|
8306
|
+
await queryRunner.query(`ALTER TABLE "CredentialBranding" ADD "state" character varying(255) NOT NULL DEFAULT ''`);
|
|
8307
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" ADD "state" character varying(255) NOT NULL DEFAULT ''`);
|
|
8308
|
+
}
|
|
8309
|
+
async down(queryRunner) {
|
|
8310
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP COLUMN "state"`);
|
|
8311
|
+
await queryRunner.query(`ALTER TABLE "CredentialBranding" DROP COLUMN "state"`);
|
|
8312
|
+
}
|
|
8313
|
+
};
|
|
8314
|
+
|
|
8315
|
+
// src/migrations/sqlite/1766000000000-AddBrandingState.ts
|
|
8316
|
+
var AddBrandingStateSqlite1766000000000 = class {
|
|
8317
|
+
static {
|
|
8318
|
+
__name(this, "AddBrandingStateSqlite1766000000000");
|
|
8319
|
+
}
|
|
8320
|
+
name = "AddBrandingState1766000000000";
|
|
8321
|
+
async up(queryRunner) {
|
|
8322
|
+
await queryRunner.query(`ALTER TABLE "CredentialBranding" ADD COLUMN "state" varchar(255) NOT NULL DEFAULT ''`);
|
|
8323
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" ADD COLUMN "state" varchar(255) NOT NULL DEFAULT ''`);
|
|
8324
|
+
}
|
|
8325
|
+
async down(queryRunner) {
|
|
8326
|
+
await queryRunner.query(`
|
|
8327
|
+
CREATE TABLE "CredentialBranding_old"
|
|
8328
|
+
(
|
|
8329
|
+
"id" varchar PRIMARY KEY NOT NULL,
|
|
8330
|
+
"vcHash" varchar(255) NOT NULL,
|
|
8331
|
+
"issuerCorrelationId" varchar(255) NOT NULL,
|
|
8332
|
+
"created_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
8333
|
+
"last_updated_at" datetime NOT NULL DEFAULT (datetime('now'))
|
|
8334
|
+
)
|
|
8335
|
+
`);
|
|
8336
|
+
await queryRunner.query(`
|
|
8337
|
+
INSERT INTO "CredentialBranding_old" ("id", "vcHash", "issuerCorrelationId", "created_at", "last_updated_at")
|
|
8338
|
+
SELECT "id", "vcHash", "issuerCorrelationId", "created_at", "last_updated_at"
|
|
8339
|
+
FROM "CredentialBranding"
|
|
8340
|
+
`);
|
|
8341
|
+
await queryRunner.query(`DROP TABLE "CredentialBranding"`);
|
|
8342
|
+
await queryRunner.query(`ALTER TABLE "CredentialBranding_old" RENAME TO "CredentialBranding"`);
|
|
8343
|
+
await queryRunner.query(`CREATE INDEX "IDX_CredentialBrandingEntity_issuerCorrelationId" ON "CredentialBranding" ("issuerCorrelationId")`);
|
|
8344
|
+
await queryRunner.query(`CREATE INDEX "IDX_CredentialBrandingEntity_vcHash" ON "CredentialBranding" ("vcHash")`);
|
|
8345
|
+
await queryRunner.query(`
|
|
8346
|
+
CREATE TABLE "BaseLocaleBranding_old"
|
|
8347
|
+
(
|
|
8348
|
+
"id" varchar PRIMARY KEY NOT NULL,
|
|
8349
|
+
"alias" varchar(255),
|
|
8350
|
+
"locale" varchar(255) NOT NULL,
|
|
8351
|
+
"description" varchar(255),
|
|
8352
|
+
"created_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
8353
|
+
"last_updated_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
8354
|
+
"credentialBrandingId" varchar,
|
|
8355
|
+
"issuerBrandingId" varchar,
|
|
8356
|
+
"type" varchar NOT NULL,
|
|
8357
|
+
"logoId" varchar,
|
|
8358
|
+
"backgroundId" varchar,
|
|
8359
|
+
"textId" varchar,
|
|
8360
|
+
"client_uri" varchar,
|
|
8361
|
+
"tos_uri" varchar,
|
|
8362
|
+
"policy_uri" varchar,
|
|
8363
|
+
"contacts" varchar,
|
|
8364
|
+
CONSTRAINT "UQ_logoId" UNIQUE ("logoId"),
|
|
8365
|
+
CONSTRAINT "UQ_backgroundId" UNIQUE ("backgroundId"),
|
|
8366
|
+
CONSTRAINT "UQ_textId" UNIQUE ("textId"),
|
|
8367
|
+
CONSTRAINT "FK_BaseLocaleBranding_logoId" FOREIGN KEY ("logoId") REFERENCES "ImageAttributes" ("id") ON DELETE CASCADE ON UPDATE NO ACTION,
|
|
8368
|
+
CONSTRAINT "FK_BaseLocaleBranding_backgroundId" FOREIGN KEY ("backgroundId") REFERENCES "BackgroundAttributes" ("id") ON DELETE CASCADE ON UPDATE NO ACTION,
|
|
8369
|
+
CONSTRAINT "FK_BaseLocaleBranding_textId" FOREIGN KEY ("textId") REFERENCES "TextAttributes" ("id") ON DELETE CASCADE ON UPDATE NO ACTION,
|
|
8370
|
+
CONSTRAINT "FK_BaseLocaleBranding_credentialBrandingId" FOREIGN KEY ("credentialBrandingId") REFERENCES "CredentialBranding" ("id") ON DELETE CASCADE ON UPDATE NO ACTION,
|
|
8371
|
+
CONSTRAINT "FK_BaseLocaleBranding_issuerBrandingId" FOREIGN KEY ("issuerBrandingId") REFERENCES "IssuerBranding" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
8372
|
+
)
|
|
8373
|
+
`);
|
|
8374
|
+
await queryRunner.query(`
|
|
8375
|
+
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")
|
|
8376
|
+
SELECT "id", "alias", "locale", "description", "created_at", "last_updated_at", "credentialBrandingId", "issuerBrandingId", "type", "logoId", "backgroundId", "textId", "client_uri", "tos_uri", "policy_uri", "contacts"
|
|
8377
|
+
FROM "BaseLocaleBranding"
|
|
8378
|
+
`);
|
|
8379
|
+
await queryRunner.query(`DROP TABLE "BaseLocaleBranding"`);
|
|
8380
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding_old" RENAME TO "BaseLocaleBranding"`);
|
|
8381
|
+
await queryRunner.query(`CREATE UNIQUE INDEX "IDX_CredentialLocaleBrandingEntity_credentialBranding_locale" ON "BaseLocaleBranding" ("credentialBrandingId", "locale")`);
|
|
8382
|
+
await queryRunner.query(`CREATE UNIQUE INDEX "IDX_IssuerLocaleBrandingEntity_issuerBranding_locale" ON "BaseLocaleBranding" ("issuerBrandingId", "locale")`);
|
|
8383
|
+
await queryRunner.query(`CREATE INDEX "IDX_BaseLocaleBranding_type" ON "BaseLocaleBranding" ("type")`);
|
|
8384
|
+
}
|
|
8385
|
+
};
|
|
8386
|
+
|
|
8387
|
+
// src/migrations/generic/15-AddBrandingState.ts
|
|
8099
8388
|
var debug14 = (0, import_debug14.default)("sphereon:ssi-sdk:migrations");
|
|
8100
|
-
var
|
|
8389
|
+
var AddBrandingState1766000000000 = class {
|
|
8101
8390
|
static {
|
|
8102
|
-
__name(this, "
|
|
8391
|
+
__name(this, "AddBrandingState1766000000000");
|
|
8103
8392
|
}
|
|
8104
|
-
name = "
|
|
8393
|
+
name = "AddBrandingState1766000000000";
|
|
8105
8394
|
async up(queryRunner) {
|
|
8106
|
-
debug14("migration:
|
|
8395
|
+
debug14("migration: adding branding state checksum columns");
|
|
8107
8396
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8108
8397
|
switch (dbType) {
|
|
8109
8398
|
case "postgres": {
|
|
8110
8399
|
debug14("using postgres migration file");
|
|
8111
|
-
const mig = new
|
|
8400
|
+
const mig = new AddBrandingStatePostgres1766000000000();
|
|
8112
8401
|
await mig.up(queryRunner);
|
|
8113
8402
|
debug14("Migration statements executed");
|
|
8114
8403
|
return;
|
|
@@ -8117,7 +8406,7 @@ var CreateIssuanceBranding1659463079429 = class {
|
|
|
8117
8406
|
case "expo":
|
|
8118
8407
|
case "react-native": {
|
|
8119
8408
|
debug14("using sqlite/react-native migration file");
|
|
8120
|
-
const mig = new
|
|
8409
|
+
const mig = new AddBrandingStateSqlite1766000000000();
|
|
8121
8410
|
await mig.up(queryRunner);
|
|
8122
8411
|
debug14("Migration statements executed");
|
|
8123
8412
|
return;
|
|
@@ -8127,12 +8416,12 @@ var CreateIssuanceBranding1659463079429 = class {
|
|
|
8127
8416
|
}
|
|
8128
8417
|
}
|
|
8129
8418
|
async down(queryRunner) {
|
|
8130
|
-
debug14("migration:
|
|
8419
|
+
debug14("migration: removing branding state checksum columns");
|
|
8131
8420
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8132
8421
|
switch (dbType) {
|
|
8133
8422
|
case "postgres": {
|
|
8134
8423
|
debug14("using postgres migration file");
|
|
8135
|
-
const mig = new
|
|
8424
|
+
const mig = new AddBrandingStatePostgres1766000000000();
|
|
8136
8425
|
await mig.down(queryRunner);
|
|
8137
8426
|
debug14("Migration statements executed");
|
|
8138
8427
|
return;
|
|
@@ -8141,7 +8430,7 @@ var CreateIssuanceBranding1659463079429 = class {
|
|
|
8141
8430
|
case "expo":
|
|
8142
8431
|
case "react-native": {
|
|
8143
8432
|
debug14("using sqlite/react-native migration file");
|
|
8144
|
-
const mig = new
|
|
8433
|
+
const mig = new AddBrandingStateSqlite1766000000000();
|
|
8145
8434
|
await mig.down(queryRunner);
|
|
8146
8435
|
debug14("Migration statements executed");
|
|
8147
8436
|
return;
|
|
@@ -8152,8 +8441,66 @@ var CreateIssuanceBranding1659463079429 = class {
|
|
|
8152
8441
|
}
|
|
8153
8442
|
};
|
|
8154
8443
|
|
|
8155
|
-
// src/migrations/generic/
|
|
8444
|
+
// src/migrations/generic/2-CreateIssuanceBranding.ts
|
|
8156
8445
|
var import_debug15 = __toESM(require("debug"), 1);
|
|
8446
|
+
var debug15 = (0, import_debug15.default)("sphereon:ssi-sdk:migrations");
|
|
8447
|
+
var CreateIssuanceBranding1659463079429 = class {
|
|
8448
|
+
static {
|
|
8449
|
+
__name(this, "CreateIssuanceBranding1659463079429");
|
|
8450
|
+
}
|
|
8451
|
+
name = "CreateIssuanceBranding1659463079429";
|
|
8452
|
+
async up(queryRunner) {
|
|
8453
|
+
debug15("migration: creating issuance branding tables");
|
|
8454
|
+
const dbType = queryRunner.connection.driver.options.type;
|
|
8455
|
+
switch (dbType) {
|
|
8456
|
+
case "postgres": {
|
|
8457
|
+
debug15("using postgres migration file");
|
|
8458
|
+
const mig = new CreateIssuanceBranding1685628974232();
|
|
8459
|
+
await mig.up(queryRunner);
|
|
8460
|
+
debug15("Migration statements executed");
|
|
8461
|
+
return;
|
|
8462
|
+
}
|
|
8463
|
+
case "sqlite":
|
|
8464
|
+
case "expo":
|
|
8465
|
+
case "react-native": {
|
|
8466
|
+
debug15("using sqlite/react-native migration file");
|
|
8467
|
+
const mig = new CreateIssuanceBranding1685628973231();
|
|
8468
|
+
await mig.up(queryRunner);
|
|
8469
|
+
debug15("Migration statements executed");
|
|
8470
|
+
return;
|
|
8471
|
+
}
|
|
8472
|
+
default:
|
|
8473
|
+
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`);
|
|
8474
|
+
}
|
|
8475
|
+
}
|
|
8476
|
+
async down(queryRunner) {
|
|
8477
|
+
debug15("migration: reverting issuance branding tables");
|
|
8478
|
+
const dbType = queryRunner.connection.driver.options.type;
|
|
8479
|
+
switch (dbType) {
|
|
8480
|
+
case "postgres": {
|
|
8481
|
+
debug15("using postgres migration file");
|
|
8482
|
+
const mig = new CreateIssuanceBranding1685628974232();
|
|
8483
|
+
await mig.down(queryRunner);
|
|
8484
|
+
debug15("Migration statements executed");
|
|
8485
|
+
return;
|
|
8486
|
+
}
|
|
8487
|
+
case "sqlite":
|
|
8488
|
+
case "expo":
|
|
8489
|
+
case "react-native": {
|
|
8490
|
+
debug15("using sqlite/react-native migration file");
|
|
8491
|
+
const mig = new CreateIssuanceBranding1685628973231();
|
|
8492
|
+
await mig.down(queryRunner);
|
|
8493
|
+
debug15("Migration statements executed");
|
|
8494
|
+
return;
|
|
8495
|
+
}
|
|
8496
|
+
default:
|
|
8497
|
+
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`);
|
|
8498
|
+
}
|
|
8499
|
+
}
|
|
8500
|
+
};
|
|
8501
|
+
|
|
8502
|
+
// src/migrations/generic/3-CreateContacts.ts
|
|
8503
|
+
var import_debug16 = __toESM(require("debug"), 1);
|
|
8157
8504
|
|
|
8158
8505
|
// src/migrations/postgres/1690925872592-CreateContacts.ts
|
|
8159
8506
|
var import_ssi_sdk33 = require("@sphereon/ssi-sdk.core");
|
|
@@ -8374,30 +8721,30 @@ var CreateContacts1690925872693 = class {
|
|
|
8374
8721
|
};
|
|
8375
8722
|
|
|
8376
8723
|
// src/migrations/generic/3-CreateContacts.ts
|
|
8377
|
-
var
|
|
8724
|
+
var debug16 = (0, import_debug16.default)("sphereon:ssi-sdk:migrations");
|
|
8378
8725
|
var CreateContacts1690925872318 = class {
|
|
8379
8726
|
static {
|
|
8380
8727
|
__name(this, "CreateContacts1690925872318");
|
|
8381
8728
|
}
|
|
8382
8729
|
name = "CreateContacts1690925872318";
|
|
8383
8730
|
async up(queryRunner) {
|
|
8384
|
-
|
|
8731
|
+
debug16("migration: creating contacts tables");
|
|
8385
8732
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8386
8733
|
switch (dbType) {
|
|
8387
8734
|
case "postgres": {
|
|
8388
|
-
|
|
8735
|
+
debug16("using postgres migration file");
|
|
8389
8736
|
const mig = new CreateContacts1690925872592();
|
|
8390
8737
|
await mig.up(queryRunner);
|
|
8391
|
-
|
|
8738
|
+
debug16("Migration statements executed");
|
|
8392
8739
|
return;
|
|
8393
8740
|
}
|
|
8394
8741
|
case "sqlite":
|
|
8395
8742
|
case "expo":
|
|
8396
8743
|
case "react-native": {
|
|
8397
|
-
|
|
8744
|
+
debug16("using sqlite/react-native migration file");
|
|
8398
8745
|
const mig = new CreateContacts1690925872693();
|
|
8399
8746
|
await mig.up(queryRunner);
|
|
8400
|
-
|
|
8747
|
+
debug16("Migration statements executed");
|
|
8401
8748
|
return;
|
|
8402
8749
|
}
|
|
8403
8750
|
default:
|
|
@@ -8405,23 +8752,23 @@ var CreateContacts1690925872318 = class {
|
|
|
8405
8752
|
}
|
|
8406
8753
|
}
|
|
8407
8754
|
async down(queryRunner) {
|
|
8408
|
-
|
|
8755
|
+
debug16("migration: reverting contacts tables");
|
|
8409
8756
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8410
8757
|
switch (dbType) {
|
|
8411
8758
|
case "postgres": {
|
|
8412
|
-
|
|
8759
|
+
debug16("using postgres migration file");
|
|
8413
8760
|
const mig = new CreateContacts1690925872592();
|
|
8414
8761
|
await mig.down(queryRunner);
|
|
8415
|
-
|
|
8762
|
+
debug16("Migration statements executed");
|
|
8416
8763
|
return;
|
|
8417
8764
|
}
|
|
8418
8765
|
case "sqlite":
|
|
8419
8766
|
case "expo":
|
|
8420
8767
|
case "react-native": {
|
|
8421
|
-
|
|
8768
|
+
debug16("using sqlite/react-native migration file");
|
|
8422
8769
|
const mig = new CreateContacts1690925872693();
|
|
8423
8770
|
await mig.down(queryRunner);
|
|
8424
|
-
|
|
8771
|
+
debug16("Migration statements executed");
|
|
8425
8772
|
return;
|
|
8426
8773
|
}
|
|
8427
8774
|
default:
|
|
@@ -8431,7 +8778,7 @@ var CreateContacts1690925872318 = class {
|
|
|
8431
8778
|
};
|
|
8432
8779
|
|
|
8433
8780
|
// src/migrations/generic/4-CreateStatusList.ts
|
|
8434
|
-
var
|
|
8781
|
+
var import_debug17 = __toESM(require("debug"), 1);
|
|
8435
8782
|
|
|
8436
8783
|
// src/migrations/postgres/1693866470001-CreateStatusList.ts
|
|
8437
8784
|
var CreateStatusList1693866470001 = class {
|
|
@@ -8637,53 +8984,53 @@ var UpdateStatusList1737110469000 = class {
|
|
|
8637
8984
|
};
|
|
8638
8985
|
|
|
8639
8986
|
// src/migrations/generic/4-CreateStatusList.ts
|
|
8640
|
-
var
|
|
8987
|
+
var debug17 = (0, import_debug17.default)("sphereon:ssi-sdk:migrations");
|
|
8641
8988
|
var CreateStatusList1693866470000 = class {
|
|
8642
8989
|
static {
|
|
8643
8990
|
__name(this, "CreateStatusList1693866470000");
|
|
8644
8991
|
}
|
|
8645
8992
|
name = "CreateStatusList1693866470000";
|
|
8646
8993
|
async up(queryRunner) {
|
|
8647
|
-
|
|
8994
|
+
debug17("migration: creating issuance branding tables");
|
|
8648
8995
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8649
8996
|
if (dbType === "postgres") {
|
|
8650
|
-
|
|
8997
|
+
debug17("using postgres migration files");
|
|
8651
8998
|
const createMig = new CreateStatusList1693866470001();
|
|
8652
8999
|
await createMig.up(queryRunner);
|
|
8653
9000
|
const updateMig = new UpdateStatusList1737110469001();
|
|
8654
9001
|
const up = await updateMig.up(queryRunner);
|
|
8655
|
-
|
|
9002
|
+
debug17("Migration statements executed");
|
|
8656
9003
|
return up;
|
|
8657
9004
|
} else if (dbType === "sqlite" || dbType === "react-native" || dbType === "expo") {
|
|
8658
|
-
|
|
9005
|
+
debug17("using sqlite/react-native migration files");
|
|
8659
9006
|
const createMig = new CreateStatusList1693866470002();
|
|
8660
9007
|
await createMig.up(queryRunner);
|
|
8661
9008
|
const updateMig = new UpdateStatusList1737110469000();
|
|
8662
9009
|
const up = await updateMig.up(queryRunner);
|
|
8663
|
-
|
|
9010
|
+
debug17("Migration statements executed");
|
|
8664
9011
|
return up;
|
|
8665
9012
|
} else {
|
|
8666
9013
|
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
9014
|
}
|
|
8668
9015
|
}
|
|
8669
9016
|
async down(queryRunner) {
|
|
8670
|
-
|
|
9017
|
+
debug17("migration: reverting issuance branding tables");
|
|
8671
9018
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8672
9019
|
if (dbType === "postgres") {
|
|
8673
|
-
|
|
9020
|
+
debug17("using postgres migration files");
|
|
8674
9021
|
const updateMig = new UpdateStatusList1737110469001();
|
|
8675
9022
|
await updateMig.down(queryRunner);
|
|
8676
9023
|
const createMig = new CreateStatusList1693866470001();
|
|
8677
9024
|
const down = await createMig.down(queryRunner);
|
|
8678
|
-
|
|
9025
|
+
debug17("Migration statements executed");
|
|
8679
9026
|
return down;
|
|
8680
9027
|
} else if (dbType === "sqlite" || dbType === "react-native" || dbType === "expo") {
|
|
8681
|
-
|
|
9028
|
+
debug17("using sqlite/react-native migration files");
|
|
8682
9029
|
const updateMig = new UpdateStatusList1737110469000();
|
|
8683
9030
|
await updateMig.down(queryRunner);
|
|
8684
9031
|
const createMig = new CreateStatusList1693866470002();
|
|
8685
9032
|
const down = await createMig.down(queryRunner);
|
|
8686
|
-
|
|
9033
|
+
debug17("Migration statements executed");
|
|
8687
9034
|
return down;
|
|
8688
9035
|
} else {
|
|
8689
9036
|
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 +9039,7 @@ var CreateStatusList1693866470000 = class {
|
|
|
8692
9039
|
};
|
|
8693
9040
|
|
|
8694
9041
|
// src/migrations/generic/5-CreateAuditEvents.ts
|
|
8695
|
-
var
|
|
9042
|
+
var import_debug18 = __toESM(require("debug"), 1);
|
|
8696
9043
|
|
|
8697
9044
|
// src/migrations/postgres/1701634812183-CreateAuditEvents.ts
|
|
8698
9045
|
var CreateAuditEvents1701634812183 = class {
|
|
@@ -8791,30 +9138,30 @@ var CreateAuditEvents1701634819487 = class {
|
|
|
8791
9138
|
};
|
|
8792
9139
|
|
|
8793
9140
|
// src/migrations/generic/5-CreateAuditEvents.ts
|
|
8794
|
-
var
|
|
9141
|
+
var debug18 = (0, import_debug18.default)("sphereon:ssi-sdk:migrations");
|
|
8795
9142
|
var CreateAuditEvents1701635835330 = class {
|
|
8796
9143
|
static {
|
|
8797
9144
|
__name(this, "CreateAuditEvents1701635835330");
|
|
8798
9145
|
}
|
|
8799
9146
|
name = "CreateAuditEvents1701635835330";
|
|
8800
9147
|
async up(queryRunner) {
|
|
8801
|
-
|
|
9148
|
+
debug18("migration: creating audit events tables");
|
|
8802
9149
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8803
9150
|
switch (dbType) {
|
|
8804
9151
|
case "postgres": {
|
|
8805
|
-
|
|
9152
|
+
debug18("using postgres migration file");
|
|
8806
9153
|
const mig = new CreateAuditEvents1701634812183();
|
|
8807
9154
|
await mig.up(queryRunner);
|
|
8808
|
-
|
|
9155
|
+
debug18("Migration statements executed");
|
|
8809
9156
|
return;
|
|
8810
9157
|
}
|
|
8811
9158
|
case "sqlite":
|
|
8812
9159
|
case "expo":
|
|
8813
9160
|
case "react-native": {
|
|
8814
|
-
|
|
9161
|
+
debug18("using sqlite/react-native migration file");
|
|
8815
9162
|
const mig = new CreateAuditEvents1701634819487();
|
|
8816
9163
|
await mig.up(queryRunner);
|
|
8817
|
-
|
|
9164
|
+
debug18("Migration statements executed");
|
|
8818
9165
|
return;
|
|
8819
9166
|
}
|
|
8820
9167
|
default:
|
|
@@ -8822,23 +9169,23 @@ var CreateAuditEvents1701635835330 = class {
|
|
|
8822
9169
|
}
|
|
8823
9170
|
}
|
|
8824
9171
|
async down(queryRunner) {
|
|
8825
|
-
|
|
9172
|
+
debug18("migration: reverting audit events tables");
|
|
8826
9173
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8827
9174
|
switch (dbType) {
|
|
8828
9175
|
case "postgres": {
|
|
8829
|
-
|
|
9176
|
+
debug18("using postgres migration file");
|
|
8830
9177
|
const mig = new CreateAuditEvents1701634812183();
|
|
8831
9178
|
await mig.down(queryRunner);
|
|
8832
|
-
|
|
9179
|
+
debug18("Migration statements executed");
|
|
8833
9180
|
return;
|
|
8834
9181
|
}
|
|
8835
9182
|
case "sqlite":
|
|
8836
9183
|
case "expo":
|
|
8837
9184
|
case "react-native": {
|
|
8838
|
-
|
|
9185
|
+
debug18("using sqlite/react-native migration file");
|
|
8839
9186
|
const mig = new CreateAuditEvents1701634819487();
|
|
8840
9187
|
await mig.down(queryRunner);
|
|
8841
|
-
|
|
9188
|
+
debug18("Migration statements executed");
|
|
8842
9189
|
return;
|
|
8843
9190
|
}
|
|
8844
9191
|
default:
|
|
@@ -8848,7 +9195,7 @@ var CreateAuditEvents1701635835330 = class {
|
|
|
8848
9195
|
};
|
|
8849
9196
|
|
|
8850
9197
|
// src/migrations/generic/6-CreateDigitalCredential.ts
|
|
8851
|
-
var
|
|
9198
|
+
var import_debug19 = __toESM(require("debug"), 1);
|
|
8852
9199
|
|
|
8853
9200
|
// src/migrations/postgres/1708525189001-CreateDigitalCredential.ts
|
|
8854
9201
|
var CreateDigitalCredential1708525189001 = class {
|
|
@@ -8956,30 +9303,30 @@ var CreateDigitalCredential1708525189002 = class {
|
|
|
8956
9303
|
};
|
|
8957
9304
|
|
|
8958
9305
|
// src/migrations/generic/6-CreateDigitalCredential.ts
|
|
8959
|
-
var
|
|
9306
|
+
var debug19 = (0, import_debug19.default)("sphereon:ssi-sdk:migrations");
|
|
8960
9307
|
var CreateDigitalCredential1708525189000 = class {
|
|
8961
9308
|
static {
|
|
8962
9309
|
__name(this, "CreateDigitalCredential1708525189000");
|
|
8963
9310
|
}
|
|
8964
9311
|
name = "CreateDigitalCredential1708525189000";
|
|
8965
9312
|
async up(queryRunner) {
|
|
8966
|
-
|
|
9313
|
+
debug19("migration: creating DigitalCredential tables");
|
|
8967
9314
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8968
9315
|
switch (dbType) {
|
|
8969
9316
|
case "postgres": {
|
|
8970
|
-
|
|
9317
|
+
debug19("using postgres migration file for DigitalCredential");
|
|
8971
9318
|
const mig = new CreateDigitalCredential1708525189001();
|
|
8972
9319
|
await mig.up(queryRunner);
|
|
8973
|
-
|
|
9320
|
+
debug19("Postgres Migration statements for DigitalCredential executed");
|
|
8974
9321
|
return;
|
|
8975
9322
|
}
|
|
8976
9323
|
case "sqlite":
|
|
8977
9324
|
case "expo":
|
|
8978
9325
|
case "react-native": {
|
|
8979
|
-
|
|
9326
|
+
debug19("using sqlite/react-native migration file for DigitalCredential");
|
|
8980
9327
|
const mig = new CreateDigitalCredential1708525189002();
|
|
8981
9328
|
await mig.up(queryRunner);
|
|
8982
|
-
|
|
9329
|
+
debug19("SQLite Migration statements for DigitalCredential executed");
|
|
8983
9330
|
return;
|
|
8984
9331
|
}
|
|
8985
9332
|
default:
|
|
@@ -8987,23 +9334,23 @@ var CreateDigitalCredential1708525189000 = class {
|
|
|
8987
9334
|
}
|
|
8988
9335
|
}
|
|
8989
9336
|
async down(queryRunner) {
|
|
8990
|
-
|
|
9337
|
+
debug19("migration: reverting DigitalCredential tables");
|
|
8991
9338
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8992
9339
|
switch (dbType) {
|
|
8993
9340
|
case "postgres": {
|
|
8994
|
-
|
|
9341
|
+
debug19("using postgres migration file for DigitalCredential");
|
|
8995
9342
|
const mig = new CreateDigitalCredential1708525189001();
|
|
8996
9343
|
await mig.down(queryRunner);
|
|
8997
|
-
|
|
9344
|
+
debug19("Postgres Migration statements for DigitalCredential reverted");
|
|
8998
9345
|
return;
|
|
8999
9346
|
}
|
|
9000
9347
|
case "sqlite":
|
|
9001
9348
|
case "expo":
|
|
9002
9349
|
case "react-native": {
|
|
9003
|
-
|
|
9350
|
+
debug19("using sqlite/react-native migration file for DigitalCredential");
|
|
9004
9351
|
const mig = new CreateDigitalCredential1708525189002();
|
|
9005
9352
|
await mig.down(queryRunner);
|
|
9006
|
-
|
|
9353
|
+
debug19("SQLite Migration statements for DigitalCredential reverted");
|
|
9007
9354
|
return;
|
|
9008
9355
|
}
|
|
9009
9356
|
default:
|
|
@@ -9013,7 +9360,7 @@ var CreateDigitalCredential1708525189000 = class {
|
|
|
9013
9360
|
};
|
|
9014
9361
|
|
|
9015
9362
|
// src/migrations/generic/7-CreateMachineStateStore.ts
|
|
9016
|
-
var
|
|
9363
|
+
var import_debug20 = __toESM(require("debug"), 1);
|
|
9017
9364
|
|
|
9018
9365
|
// src/migrations/postgres/1708797018115-CreateMachineStateStore.ts
|
|
9019
9366
|
var CreateMachineStateStore1708797018115 = class {
|
|
@@ -9075,30 +9422,30 @@ var CreateMachineStateStore1708796002272 = class {
|
|
|
9075
9422
|
};
|
|
9076
9423
|
|
|
9077
9424
|
// src/migrations/generic/7-CreateMachineStateStore.ts
|
|
9078
|
-
var
|
|
9425
|
+
var debug20 = (0, import_debug20.default)("sphereon:ssi-sdk:migrations");
|
|
9079
9426
|
var CreateMachineStateStore1708098041262 = class {
|
|
9080
9427
|
static {
|
|
9081
9428
|
__name(this, "CreateMachineStateStore1708098041262");
|
|
9082
9429
|
}
|
|
9083
9430
|
name = "CreateMachineStateStore1708098041262";
|
|
9084
9431
|
async up(queryRunner) {
|
|
9085
|
-
|
|
9432
|
+
debug20("migration: creating machine state tables");
|
|
9086
9433
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9087
9434
|
switch (dbType) {
|
|
9088
9435
|
case "postgres": {
|
|
9089
|
-
|
|
9436
|
+
debug20("using postgres migration file");
|
|
9090
9437
|
const mig = new CreateMachineStateStore1708797018115();
|
|
9091
9438
|
await mig.up(queryRunner);
|
|
9092
|
-
|
|
9439
|
+
debug20("Migration statements executed");
|
|
9093
9440
|
return;
|
|
9094
9441
|
}
|
|
9095
9442
|
case "sqlite":
|
|
9096
9443
|
case "expo":
|
|
9097
9444
|
case "react-native": {
|
|
9098
|
-
|
|
9445
|
+
debug20("using sqlite/react-native migration file");
|
|
9099
9446
|
const mig = new CreateMachineStateStore1708796002272();
|
|
9100
9447
|
await mig.up(queryRunner);
|
|
9101
|
-
|
|
9448
|
+
debug20("Migration statements executed");
|
|
9102
9449
|
return;
|
|
9103
9450
|
}
|
|
9104
9451
|
default:
|
|
@@ -9106,23 +9453,23 @@ var CreateMachineStateStore1708098041262 = class {
|
|
|
9106
9453
|
}
|
|
9107
9454
|
}
|
|
9108
9455
|
async down(queryRunner) {
|
|
9109
|
-
|
|
9456
|
+
debug20("migration: reverting machine state tables");
|
|
9110
9457
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9111
9458
|
switch (dbType) {
|
|
9112
9459
|
case "postgres": {
|
|
9113
|
-
|
|
9460
|
+
debug20("using postgres migration file");
|
|
9114
9461
|
const mig = new CreateMachineStateStore1708797018115();
|
|
9115
9462
|
await mig.down(queryRunner);
|
|
9116
|
-
|
|
9463
|
+
debug20("Migration statements executed");
|
|
9117
9464
|
return;
|
|
9118
9465
|
}
|
|
9119
9466
|
case "sqlite":
|
|
9120
9467
|
case "expo":
|
|
9121
9468
|
case "react-native": {
|
|
9122
|
-
|
|
9469
|
+
debug20("using sqlite/react-native migration file");
|
|
9123
9470
|
const mig = new CreateMachineStateStore1708796002272();
|
|
9124
9471
|
await mig.down(queryRunner);
|
|
9125
|
-
|
|
9472
|
+
debug20("Migration statements executed");
|
|
9126
9473
|
return;
|
|
9127
9474
|
}
|
|
9128
9475
|
default:
|
|
@@ -9132,7 +9479,7 @@ var CreateMachineStateStore1708098041262 = class {
|
|
|
9132
9479
|
};
|
|
9133
9480
|
|
|
9134
9481
|
// src/migrations/generic/8-CreateContacts.ts
|
|
9135
|
-
var
|
|
9482
|
+
var import_debug21 = __toESM(require("debug"), 1);
|
|
9136
9483
|
|
|
9137
9484
|
// src/migrations/postgres/1710438363001-CreateContacts.ts
|
|
9138
9485
|
var CreateContacts1710438363001 = class {
|
|
@@ -9246,30 +9593,30 @@ var CreateContacts1710438363002 = class {
|
|
|
9246
9593
|
};
|
|
9247
9594
|
|
|
9248
9595
|
// src/migrations/generic/8-CreateContacts.ts
|
|
9249
|
-
var
|
|
9596
|
+
var debug21 = (0, import_debug21.default)("sphereon:ssi-sdk:migrations");
|
|
9250
9597
|
var CreateContacts1708525189000 = class {
|
|
9251
9598
|
static {
|
|
9252
9599
|
__name(this, "CreateContacts1708525189000");
|
|
9253
9600
|
}
|
|
9254
9601
|
name = "CreateContacts1708525189000";
|
|
9255
9602
|
async up(queryRunner) {
|
|
9256
|
-
|
|
9603
|
+
debug21("migration: updating contact tables");
|
|
9257
9604
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9258
9605
|
switch (dbType) {
|
|
9259
9606
|
case "postgres": {
|
|
9260
|
-
|
|
9607
|
+
debug21("using postgres migration file");
|
|
9261
9608
|
const mig = new CreateContacts1710438363001();
|
|
9262
9609
|
await mig.up(queryRunner);
|
|
9263
|
-
|
|
9610
|
+
debug21("Migration statements executed");
|
|
9264
9611
|
return;
|
|
9265
9612
|
}
|
|
9266
9613
|
case "sqlite":
|
|
9267
9614
|
case "expo":
|
|
9268
9615
|
case "react-native": {
|
|
9269
|
-
|
|
9616
|
+
debug21("using sqlite/react-native migration file");
|
|
9270
9617
|
const mig = new CreateContacts1710438363002();
|
|
9271
9618
|
await mig.up(queryRunner);
|
|
9272
|
-
|
|
9619
|
+
debug21("Migration statements executed");
|
|
9273
9620
|
return;
|
|
9274
9621
|
}
|
|
9275
9622
|
default:
|
|
@@ -9277,23 +9624,23 @@ var CreateContacts1708525189000 = class {
|
|
|
9277
9624
|
}
|
|
9278
9625
|
}
|
|
9279
9626
|
async down(queryRunner) {
|
|
9280
|
-
|
|
9627
|
+
debug21("migration: reverting machine state tables");
|
|
9281
9628
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9282
9629
|
switch (dbType) {
|
|
9283
9630
|
case "postgres": {
|
|
9284
|
-
|
|
9631
|
+
debug21("using postgres migration file");
|
|
9285
9632
|
const mig = new CreateContacts1710438363001();
|
|
9286
9633
|
await mig.down(queryRunner);
|
|
9287
|
-
|
|
9634
|
+
debug21("Migration statements executed");
|
|
9288
9635
|
return;
|
|
9289
9636
|
}
|
|
9290
9637
|
case "sqlite":
|
|
9291
9638
|
case "expo":
|
|
9292
9639
|
case "react-native": {
|
|
9293
|
-
|
|
9640
|
+
debug21("using sqlite/react-native migration file");
|
|
9294
9641
|
const mig = new CreateContacts1710438363002();
|
|
9295
9642
|
await mig.down(queryRunner);
|
|
9296
|
-
|
|
9643
|
+
debug21("Migration statements executed");
|
|
9297
9644
|
return;
|
|
9298
9645
|
}
|
|
9299
9646
|
default:
|
|
@@ -9303,7 +9650,7 @@ var CreateContacts1708525189000 = class {
|
|
|
9303
9650
|
};
|
|
9304
9651
|
|
|
9305
9652
|
// src/migrations/generic/9-CreateContacts.ts
|
|
9306
|
-
var
|
|
9653
|
+
var import_debug22 = __toESM(require("debug"), 1);
|
|
9307
9654
|
|
|
9308
9655
|
// src/migrations/postgres/1715761125001-CreateContacts.ts
|
|
9309
9656
|
var CreateContacts1715761125001 = class {
|
|
@@ -9415,30 +9762,30 @@ var CreateContacts1715761125002 = class {
|
|
|
9415
9762
|
};
|
|
9416
9763
|
|
|
9417
9764
|
// src/migrations/generic/9-CreateContacts.ts
|
|
9418
|
-
var
|
|
9765
|
+
var debug22 = (0, import_debug22.default)("sphereon:ssi-sdk:migrations");
|
|
9419
9766
|
var CreateContacts1715761125000 = class {
|
|
9420
9767
|
static {
|
|
9421
9768
|
__name(this, "CreateContacts1715761125000");
|
|
9422
9769
|
}
|
|
9423
9770
|
name = "CreateContacts1715761125000";
|
|
9424
9771
|
async up(queryRunner) {
|
|
9425
|
-
|
|
9772
|
+
debug22("migration: updating contact tables");
|
|
9426
9773
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9427
9774
|
switch (dbType) {
|
|
9428
9775
|
case "postgres": {
|
|
9429
|
-
|
|
9776
|
+
debug22("using postgres migration file");
|
|
9430
9777
|
const mig = new CreateContacts1715761125001();
|
|
9431
9778
|
await mig.up(queryRunner);
|
|
9432
|
-
|
|
9779
|
+
debug22("Migration statements executed");
|
|
9433
9780
|
return;
|
|
9434
9781
|
}
|
|
9435
9782
|
case "sqlite":
|
|
9436
9783
|
case "expo":
|
|
9437
9784
|
case "react-native": {
|
|
9438
|
-
|
|
9785
|
+
debug22("using sqlite/react-native migration file");
|
|
9439
9786
|
const mig = new CreateContacts1715761125002();
|
|
9440
9787
|
await mig.up(queryRunner);
|
|
9441
|
-
|
|
9788
|
+
debug22("Migration statements executed");
|
|
9442
9789
|
return;
|
|
9443
9790
|
}
|
|
9444
9791
|
default:
|
|
@@ -9446,23 +9793,23 @@ var CreateContacts1715761125000 = class {
|
|
|
9446
9793
|
}
|
|
9447
9794
|
}
|
|
9448
9795
|
async down(queryRunner) {
|
|
9449
|
-
|
|
9796
|
+
debug22("migration: reverting machine state tables");
|
|
9450
9797
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9451
9798
|
switch (dbType) {
|
|
9452
9799
|
case "postgres": {
|
|
9453
|
-
|
|
9800
|
+
debug22("using postgres migration file");
|
|
9454
9801
|
const mig = new CreateContacts1715761125001();
|
|
9455
9802
|
await mig.down(queryRunner);
|
|
9456
|
-
|
|
9803
|
+
debug22("Migration statements executed");
|
|
9457
9804
|
return;
|
|
9458
9805
|
}
|
|
9459
9806
|
case "sqlite":
|
|
9460
9807
|
case "expo":
|
|
9461
9808
|
case "react-native": {
|
|
9462
|
-
|
|
9809
|
+
debug22("using sqlite/react-native migration file");
|
|
9463
9810
|
const mig = new CreateContacts1715761125002();
|
|
9464
9811
|
await mig.down(queryRunner);
|
|
9465
|
-
|
|
9812
|
+
debug22("Migration statements executed");
|
|
9466
9813
|
return;
|
|
9467
9814
|
}
|
|
9468
9815
|
default:
|
|
@@ -9480,7 +9827,8 @@ var DataStoreContactMigrations = [
|
|
|
9480
9827
|
];
|
|
9481
9828
|
var DataStoreIssuanceBrandingMigrations = [
|
|
9482
9829
|
CreateIssuanceBranding1659463079429,
|
|
9483
|
-
FixCredentialClaimsReferencesUuid1741895822987
|
|
9830
|
+
FixCredentialClaimsReferencesUuid1741895822987,
|
|
9831
|
+
AddBrandingState1766000000000
|
|
9484
9832
|
];
|
|
9485
9833
|
var DataStoreStatusListMigrations = [
|
|
9486
9834
|
CreateStatusList1693866470000,
|