@sphereon/ssi-sdk.data-store 0.36.1-next.119 → 0.36.1-next.149
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 +669 -107
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -1
- package/dist/index.d.ts +21 -1
- package/dist/index.js +686 -122
- package/dist/index.js.map +1 -1
- package/package.json +9 -8
- package/src/__tests__/contact.entities.test.ts +3 -3
- package/src/__tests__/contact.store.test.ts +3 -3
- package/src/__tests__/issuanceBranding.entities.test.ts +5 -5
- package/src/__tests__/issuanceBranding.store.test.ts +314 -4
- package/src/contact/ContactStore.ts +51 -4
- package/src/entities/issuanceBranding/CredentialBrandingEntity.ts +44 -1
- package/src/entities/issuanceBranding/CredentialLocaleBrandingEntity.ts +64 -1
- package/src/entities/issuanceBranding/IssuerLocaleBrandingEntity.ts +63 -1
- package/src/index.ts +12 -0
- package/src/issuanceBranding/IssuanceBrandingStore.ts +45 -6
- package/src/migrations/generic/15-AddBrandingState.ts +64 -0
- package/src/migrations/generic/15-AddServiceMetadata.ts +66 -0
- package/src/migrations/generic/index.ts +21 -1
- package/src/migrations/index.ts +4 -0
- package/src/migrations/postgres/1764000000001-AddServiceMetadata.ts +44 -0
- package/src/migrations/postgres/1766000000000-AddBrandingState.ts +15 -0
- package/src/migrations/sqlite/1764000000002-AddServiceMetadata.ts +41 -0
- package/src/migrations/sqlite/1766000000000-AddBrandingState.ts +87 -0
- package/src/utils/issuanceBranding/HashUtils.ts +30 -0
- package/src/utils/issuanceBranding/MappingUtils.ts +21 -1
- package/src/utils/presentationDefinition/MappingUtils.ts +5 -2
package/dist/index.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
3
|
|
|
4
|
+
// src/index.ts
|
|
5
|
+
import { Entities as VeramoDataStoreEntities2 } from "@veramo/data-store";
|
|
6
|
+
|
|
4
7
|
// src/entities/contact/BaseConfigEntity.ts
|
|
5
8
|
import { BaseEntity as BaseEntity10, Entity as Entity12, JoinColumn as JoinColumn7, OneToOne as OneToOne6, PrimaryGeneratedColumn as PrimaryGeneratedColumn12, TableInheritance as TableInheritance2 } from "typeorm";
|
|
6
9
|
|
|
@@ -2871,10 +2874,23 @@ BaseLocaleBrandingEntity = _ts_decorate24([
|
|
|
2871
2874
|
// src/entities/issuanceBranding/CredentialBrandingEntity.ts
|
|
2872
2875
|
import { typeOrmDateTime as typeOrmDateTime13 } from "@sphereon/ssi-sdk.agent-config";
|
|
2873
2876
|
import { ArrayMinSize, IsNotEmpty as IsNotEmpty10, validate as validate16 } from "class-validator";
|
|
2874
|
-
import { BaseEntity as BaseEntity19, BeforeInsert as
|
|
2877
|
+
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
2878
|
|
|
2876
2879
|
// 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";
|
|
2880
|
+
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";
|
|
2881
|
+
|
|
2882
|
+
// src/utils/issuanceBranding/HashUtils.ts
|
|
2883
|
+
var FNV_PRIME = 0x100000001b3n;
|
|
2884
|
+
var OFFSET_BASIS = 0xcbf29ce484222325n;
|
|
2885
|
+
function computeCompactHash(input) {
|
|
2886
|
+
let hash = OFFSET_BASIS;
|
|
2887
|
+
for (let i = 0; i < input.length; i++) {
|
|
2888
|
+
hash ^= BigInt(input.charCodeAt(i));
|
|
2889
|
+
hash = hash * FNV_PRIME & 0xffffffffffffffffn;
|
|
2890
|
+
}
|
|
2891
|
+
return hash.toString(36);
|
|
2892
|
+
}
|
|
2893
|
+
__name(computeCompactHash, "computeCompactHash");
|
|
2878
2894
|
|
|
2879
2895
|
// src/entities/issuanceBranding/CredentialClaimsEntity.ts
|
|
2880
2896
|
import { validate as validate15, Validate as Validate8 } from "class-validator";
|
|
@@ -2980,6 +2996,10 @@ var CredentialLocaleBrandingEntity = class extends BaseLocaleBrandingEntity {
|
|
|
2980
2996
|
credentialBranding;
|
|
2981
2997
|
claims;
|
|
2982
2998
|
credentialBrandingId;
|
|
2999
|
+
state;
|
|
3000
|
+
setState() {
|
|
3001
|
+
this.state = computeCredentialLocaleBrandingState(this);
|
|
3002
|
+
}
|
|
2983
3003
|
};
|
|
2984
3004
|
_ts_decorate26([
|
|
2985
3005
|
ManyToOne9(() => CredentialBrandingEntity, (credentialBranding) => credentialBranding.localeBranding, {
|
|
@@ -3009,6 +3029,21 @@ _ts_decorate26([
|
|
|
3009
3029
|
}),
|
|
3010
3030
|
_ts_metadata25("design:type", String)
|
|
3011
3031
|
], CredentialLocaleBrandingEntity.prototype, "credentialBrandingId", void 0);
|
|
3032
|
+
_ts_decorate26([
|
|
3033
|
+
Column23("varchar", {
|
|
3034
|
+
name: "state",
|
|
3035
|
+
length: 255,
|
|
3036
|
+
nullable: false
|
|
3037
|
+
}),
|
|
3038
|
+
_ts_metadata25("design:type", String)
|
|
3039
|
+
], CredentialLocaleBrandingEntity.prototype, "state", void 0);
|
|
3040
|
+
_ts_decorate26([
|
|
3041
|
+
BeforeInsert18(),
|
|
3042
|
+
BeforeUpdate18(),
|
|
3043
|
+
_ts_metadata25("design:type", Function),
|
|
3044
|
+
_ts_metadata25("design:paramtypes", []),
|
|
3045
|
+
_ts_metadata25("design:returntype", void 0)
|
|
3046
|
+
], CredentialLocaleBrandingEntity.prototype, "setState", null);
|
|
3012
3047
|
CredentialLocaleBrandingEntity = _ts_decorate26([
|
|
3013
3048
|
ChildEntity5("CredentialLocaleBranding"),
|
|
3014
3049
|
Index4("IDX_CredentialLocaleBrandingEntity_credentialBranding_locale", [
|
|
@@ -3018,6 +3053,45 @@ CredentialLocaleBrandingEntity = _ts_decorate26([
|
|
|
3018
3053
|
unique: true
|
|
3019
3054
|
})
|
|
3020
3055
|
], CredentialLocaleBrandingEntity);
|
|
3056
|
+
var computeCredentialLocaleBrandingState = /* @__PURE__ */ __name((localeBranding) => {
|
|
3057
|
+
const sortedClaims = (localeBranding.claims ?? []).map((claim) => ({
|
|
3058
|
+
key: claim.key,
|
|
3059
|
+
name: claim.name
|
|
3060
|
+
})).sort((first, second) => first.key.localeCompare(second.key));
|
|
3061
|
+
const payload = {
|
|
3062
|
+
alias: localeBranding.alias ?? null,
|
|
3063
|
+
locale: localeBranding.locale ?? null,
|
|
3064
|
+
description: localeBranding.description ?? null,
|
|
3065
|
+
logo: localeBranding.logo ? {
|
|
3066
|
+
uri: localeBranding.logo.uri ?? null,
|
|
3067
|
+
dataUri: localeBranding.logo.dataUri ?? null,
|
|
3068
|
+
mediaType: localeBranding.logo.mediaType ?? null,
|
|
3069
|
+
alt: localeBranding.logo.alt ?? null,
|
|
3070
|
+
dimensions: localeBranding.logo.dimensions ? {
|
|
3071
|
+
width: localeBranding.logo.dimensions.width,
|
|
3072
|
+
height: localeBranding.logo.dimensions.height
|
|
3073
|
+
} : null
|
|
3074
|
+
} : null,
|
|
3075
|
+
background: localeBranding.background ? {
|
|
3076
|
+
color: localeBranding.background.color ?? null,
|
|
3077
|
+
image: localeBranding.background.image ? {
|
|
3078
|
+
uri: localeBranding.background.image.uri ?? null,
|
|
3079
|
+
dataUri: localeBranding.background.image.dataUri ?? null,
|
|
3080
|
+
mediaType: localeBranding.background.image.mediaType ?? null,
|
|
3081
|
+
alt: localeBranding.background.image.alt ?? null,
|
|
3082
|
+
dimensions: localeBranding.background.image.dimensions ? {
|
|
3083
|
+
width: localeBranding.background.image.dimensions.width,
|
|
3084
|
+
height: localeBranding.background.image.dimensions.height
|
|
3085
|
+
} : null
|
|
3086
|
+
} : null
|
|
3087
|
+
} : null,
|
|
3088
|
+
text: localeBranding.text ? {
|
|
3089
|
+
color: localeBranding.text.color ?? null
|
|
3090
|
+
} : null,
|
|
3091
|
+
claims: sortedClaims
|
|
3092
|
+
};
|
|
3093
|
+
return computeCompactHash(JSON.stringify(payload));
|
|
3094
|
+
}, "computeCredentialLocaleBrandingState");
|
|
3021
3095
|
|
|
3022
3096
|
// src/entities/issuanceBranding/CredentialBrandingEntity.ts
|
|
3023
3097
|
function _ts_decorate27(decorators, target, key, desc) {
|
|
@@ -3038,6 +3112,7 @@ var CredentialBrandingEntity = class extends BaseEntity19 {
|
|
|
3038
3112
|
id;
|
|
3039
3113
|
vcHash;
|
|
3040
3114
|
issuerCorrelationId;
|
|
3115
|
+
state;
|
|
3041
3116
|
localeBranding;
|
|
3042
3117
|
createdAt;
|
|
3043
3118
|
lastUpdatedAt;
|
|
@@ -3045,6 +3120,11 @@ var CredentialBrandingEntity = class extends BaseEntity19 {
|
|
|
3045
3120
|
updateUpdatedDate() {
|
|
3046
3121
|
this.lastUpdatedAt = /* @__PURE__ */ new Date();
|
|
3047
3122
|
}
|
|
3123
|
+
setState() {
|
|
3124
|
+
if (this.localeBranding && Array.isArray(this.localeBranding)) {
|
|
3125
|
+
this.state = this.computeState();
|
|
3126
|
+
}
|
|
3127
|
+
}
|
|
3048
3128
|
async validate() {
|
|
3049
3129
|
const validation = await validate16(this);
|
|
3050
3130
|
if (validation.length > 0) {
|
|
@@ -3052,6 +3132,31 @@ var CredentialBrandingEntity = class extends BaseEntity19 {
|
|
|
3052
3132
|
}
|
|
3053
3133
|
return;
|
|
3054
3134
|
}
|
|
3135
|
+
computeState() {
|
|
3136
|
+
const localeStates = (this.localeBranding ?? []).map((localeBranding) => ({
|
|
3137
|
+
locale: localeBranding.locale ?? "",
|
|
3138
|
+
alias: localeBranding.alias ?? "",
|
|
3139
|
+
id: localeBranding.id ?? "",
|
|
3140
|
+
state: computeCredentialLocaleBrandingState(localeBranding)
|
|
3141
|
+
}));
|
|
3142
|
+
localeStates.sort((first, second) => {
|
|
3143
|
+
const localeCompare = first.locale.localeCompare(second.locale);
|
|
3144
|
+
if (localeCompare !== 0) {
|
|
3145
|
+
return localeCompare;
|
|
3146
|
+
}
|
|
3147
|
+
const aliasCompare = first.alias.localeCompare(second.alias);
|
|
3148
|
+
if (aliasCompare !== 0) {
|
|
3149
|
+
return aliasCompare;
|
|
3150
|
+
}
|
|
3151
|
+
return first.id.localeCompare(second.id);
|
|
3152
|
+
});
|
|
3153
|
+
const payload = {
|
|
3154
|
+
issuerCorrelationId: this.issuerCorrelationId,
|
|
3155
|
+
vcHash: this.vcHash,
|
|
3156
|
+
localeBranding: localeStates.map((entry) => entry.state)
|
|
3157
|
+
};
|
|
3158
|
+
return computeCompactHash(JSON.stringify(payload));
|
|
3159
|
+
}
|
|
3055
3160
|
};
|
|
3056
3161
|
_ts_decorate27([
|
|
3057
3162
|
PrimaryGeneratedColumn21("uuid"),
|
|
@@ -3081,6 +3186,14 @@ _ts_decorate27([
|
|
|
3081
3186
|
}),
|
|
3082
3187
|
_ts_metadata26("design:type", String)
|
|
3083
3188
|
], CredentialBrandingEntity.prototype, "issuerCorrelationId", void 0);
|
|
3189
|
+
_ts_decorate27([
|
|
3190
|
+
Column24("varchar", {
|
|
3191
|
+
name: "state",
|
|
3192
|
+
length: 255,
|
|
3193
|
+
nullable: false
|
|
3194
|
+
}),
|
|
3195
|
+
_ts_metadata26("design:type", String)
|
|
3196
|
+
], CredentialBrandingEntity.prototype, "state", void 0);
|
|
3084
3197
|
_ts_decorate27([
|
|
3085
3198
|
OneToMany6(() => CredentialLocaleBrandingEntity, (credentialLocaleBrandingEntity) => credentialLocaleBrandingEntity.credentialBranding, {
|
|
3086
3199
|
cascade: true,
|
|
@@ -3110,15 +3223,22 @@ _ts_decorate27([
|
|
|
3110
3223
|
_ts_metadata26("design:type", typeof Date === "undefined" ? Object : Date)
|
|
3111
3224
|
], CredentialBrandingEntity.prototype, "lastUpdatedAt", void 0);
|
|
3112
3225
|
_ts_decorate27([
|
|
3113
|
-
|
|
3114
|
-
|
|
3226
|
+
BeforeInsert19(),
|
|
3227
|
+
BeforeUpdate19(),
|
|
3115
3228
|
_ts_metadata26("design:type", Function),
|
|
3116
3229
|
_ts_metadata26("design:paramtypes", []),
|
|
3117
3230
|
_ts_metadata26("design:returntype", void 0)
|
|
3118
3231
|
], CredentialBrandingEntity.prototype, "updateUpdatedDate", null);
|
|
3119
3232
|
_ts_decorate27([
|
|
3120
|
-
|
|
3121
|
-
|
|
3233
|
+
BeforeInsert19(),
|
|
3234
|
+
BeforeUpdate19(),
|
|
3235
|
+
_ts_metadata26("design:type", Function),
|
|
3236
|
+
_ts_metadata26("design:paramtypes", []),
|
|
3237
|
+
_ts_metadata26("design:returntype", void 0)
|
|
3238
|
+
], CredentialBrandingEntity.prototype, "setState", null);
|
|
3239
|
+
_ts_decorate27([
|
|
3240
|
+
BeforeInsert19(),
|
|
3241
|
+
BeforeUpdate19(),
|
|
3122
3242
|
_ts_metadata26("design:type", Function),
|
|
3123
3243
|
_ts_metadata26("design:paramtypes", []),
|
|
3124
3244
|
_ts_metadata26("design:returntype", Promise)
|
|
@@ -3136,11 +3256,11 @@ CredentialBrandingEntity = _ts_decorate27([
|
|
|
3136
3256
|
// src/entities/issuanceBranding/IssuerBrandingEntity.ts
|
|
3137
3257
|
import { typeOrmDateTime as typeOrmDateTime14 } from "@sphereon/ssi-sdk.agent-config";
|
|
3138
3258
|
import { ArrayMinSize as ArrayMinSize2, IsNotEmpty as IsNotEmpty11, validate as validate17 } from "class-validator";
|
|
3139
|
-
import { BaseEntity as BaseEntity20, BeforeInsert as
|
|
3259
|
+
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
3260
|
|
|
3141
3261
|
// src/entities/issuanceBranding/IssuerLocaleBrandingEntity.ts
|
|
3142
3262
|
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";
|
|
3263
|
+
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
3264
|
function _ts_decorate28(decorators, target, key, desc) {
|
|
3145
3265
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3146
3266
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3162,6 +3282,48 @@ var IssuerLocaleBrandingEntity = class extends BaseLocaleBrandingEntity {
|
|
|
3162
3282
|
policyUri;
|
|
3163
3283
|
contacts;
|
|
3164
3284
|
issuerBrandingId;
|
|
3285
|
+
state;
|
|
3286
|
+
setState() {
|
|
3287
|
+
this.state = this.computeState();
|
|
3288
|
+
}
|
|
3289
|
+
computeState() {
|
|
3290
|
+
const payload = {
|
|
3291
|
+
alias: this.alias ?? null,
|
|
3292
|
+
locale: this.locale ?? null,
|
|
3293
|
+
description: this.description ?? null,
|
|
3294
|
+
clientUri: this.clientUri ?? null,
|
|
3295
|
+
tosUri: this.tosUri ?? null,
|
|
3296
|
+
policyUri: this.policyUri ?? null,
|
|
3297
|
+
contacts: this.contacts ?? null,
|
|
3298
|
+
logo: this.logo ? {
|
|
3299
|
+
uri: this.logo.uri ?? null,
|
|
3300
|
+
dataUri: this.logo.dataUri ?? null,
|
|
3301
|
+
mediaType: this.logo.mediaType ?? null,
|
|
3302
|
+
alt: this.logo.alt ?? null,
|
|
3303
|
+
dimensions: this.logo.dimensions ? {
|
|
3304
|
+
width: this.logo.dimensions.width,
|
|
3305
|
+
height: this.logo.dimensions.height
|
|
3306
|
+
} : null
|
|
3307
|
+
} : null,
|
|
3308
|
+
background: this.background ? {
|
|
3309
|
+
color: this.background.color ?? null,
|
|
3310
|
+
image: this.background.image ? {
|
|
3311
|
+
uri: this.background.image.uri ?? null,
|
|
3312
|
+
dataUri: this.background.image.dataUri ?? null,
|
|
3313
|
+
mediaType: this.background.image.mediaType ?? null,
|
|
3314
|
+
alt: this.background.image.alt ?? null,
|
|
3315
|
+
dimensions: this.background.image.dimensions ? {
|
|
3316
|
+
width: this.background.image.dimensions.width,
|
|
3317
|
+
height: this.background.image.dimensions.height
|
|
3318
|
+
} : null
|
|
3319
|
+
} : null
|
|
3320
|
+
} : null,
|
|
3321
|
+
text: this.text ? {
|
|
3322
|
+
color: this.text.color ?? null
|
|
3323
|
+
} : null
|
|
3324
|
+
};
|
|
3325
|
+
return computeCompactHash(JSON.stringify(payload));
|
|
3326
|
+
}
|
|
3165
3327
|
};
|
|
3166
3328
|
_ts_decorate28([
|
|
3167
3329
|
ManyToOne10(() => IssuerBrandingEntity, (issuerBranding) => issuerBranding.localeBranding, {
|
|
@@ -3220,6 +3382,21 @@ _ts_decorate28([
|
|
|
3220
3382
|
}),
|
|
3221
3383
|
_ts_metadata27("design:type", String)
|
|
3222
3384
|
], IssuerLocaleBrandingEntity.prototype, "issuerBrandingId", void 0);
|
|
3385
|
+
_ts_decorate28([
|
|
3386
|
+
Column25("varchar", {
|
|
3387
|
+
name: "state",
|
|
3388
|
+
length: 255,
|
|
3389
|
+
nullable: false
|
|
3390
|
+
}),
|
|
3391
|
+
_ts_metadata27("design:type", String)
|
|
3392
|
+
], IssuerLocaleBrandingEntity.prototype, "state", void 0);
|
|
3393
|
+
_ts_decorate28([
|
|
3394
|
+
BeforeInsert20(),
|
|
3395
|
+
BeforeUpdate20(),
|
|
3396
|
+
_ts_metadata27("design:type", Function),
|
|
3397
|
+
_ts_metadata27("design:paramtypes", []),
|
|
3398
|
+
_ts_metadata27("design:returntype", void 0)
|
|
3399
|
+
], IssuerLocaleBrandingEntity.prototype, "setState", null);
|
|
3223
3400
|
IssuerLocaleBrandingEntity = _ts_decorate28([
|
|
3224
3401
|
ChildEntity6("IssuerLocaleBranding"),
|
|
3225
3402
|
Index6("IDX_IssuerLocaleBrandingEntity_issuerBranding_locale", [
|
|
@@ -3308,15 +3485,15 @@ _ts_decorate29([
|
|
|
3308
3485
|
_ts_metadata28("design:type", typeof Date === "undefined" ? Object : Date)
|
|
3309
3486
|
], IssuerBrandingEntity.prototype, "lastUpdatedAt", void 0);
|
|
3310
3487
|
_ts_decorate29([
|
|
3311
|
-
|
|
3312
|
-
|
|
3488
|
+
BeforeInsert21(),
|
|
3489
|
+
BeforeUpdate21(),
|
|
3313
3490
|
_ts_metadata28("design:type", Function),
|
|
3314
3491
|
_ts_metadata28("design:paramtypes", []),
|
|
3315
3492
|
_ts_metadata28("design:returntype", void 0)
|
|
3316
3493
|
], IssuerBrandingEntity.prototype, "updateUpdatedDate", null);
|
|
3317
3494
|
_ts_decorate29([
|
|
3318
|
-
|
|
3319
|
-
|
|
3495
|
+
BeforeInsert21(),
|
|
3496
|
+
BeforeUpdate21(),
|
|
3320
3497
|
_ts_metadata28("design:type", Function),
|
|
3321
3498
|
_ts_metadata28("design:paramtypes", []),
|
|
3322
3499
|
_ts_metadata28("design:returntype", Promise)
|
|
@@ -3567,7 +3744,7 @@ Oid4vcStateEntity = _ts_decorate31([
|
|
|
3567
3744
|
// src/entities/presentationDefinition/DcqlQueryItemEntity.ts
|
|
3568
3745
|
import { typeOrmDateTime as typeOrmDateTime17 } from "@sphereon/ssi-sdk.agent-config";
|
|
3569
3746
|
import { IsNotEmpty as IsNotEmpty12 } from "class-validator";
|
|
3570
|
-
import { BaseEntity as BaseEntity23, BeforeInsert as
|
|
3747
|
+
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
3748
|
function _ts_decorate32(decorators, target, key, desc) {
|
|
3572
3749
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3573
3750
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3686,8 +3863,8 @@ _ts_decorate32([
|
|
|
3686
3863
|
_ts_metadata31("design:type", typeof Date === "undefined" ? Object : Date)
|
|
3687
3864
|
], DcqlQueryItemEntity.prototype, "lastUpdatedAt", void 0);
|
|
3688
3865
|
_ts_decorate32([
|
|
3689
|
-
|
|
3690
|
-
|
|
3866
|
+
BeforeInsert22(),
|
|
3867
|
+
BeforeUpdate22(),
|
|
3691
3868
|
_ts_metadata31("design:type", Function),
|
|
3692
3869
|
_ts_metadata31("design:paramtypes", []),
|
|
3693
3870
|
_ts_metadata31("design:returntype", void 0)
|
|
@@ -4654,10 +4831,19 @@ var ContactStore = class extends AbstractContactStore {
|
|
|
4654
4831
|
const result = await partyRepository.find({
|
|
4655
4832
|
where: {
|
|
4656
4833
|
id: In(initialResult.map((party) => party.id))
|
|
4657
|
-
}
|
|
4834
|
+
},
|
|
4835
|
+
relations: [
|
|
4836
|
+
"contact"
|
|
4837
|
+
]
|
|
4658
4838
|
});
|
|
4659
4839
|
debug(`getParties() resulted in ${result.length} parties`);
|
|
4660
|
-
return result.
|
|
4840
|
+
return result.filter((party) => {
|
|
4841
|
+
if (!party.contact) {
|
|
4842
|
+
console.warn(`party ${party.id} does not have an associated contact`);
|
|
4843
|
+
return false;
|
|
4844
|
+
}
|
|
4845
|
+
return true;
|
|
4846
|
+
}).map(partyFrom);
|
|
4661
4847
|
}, "getParties");
|
|
4662
4848
|
addParty = /* @__PURE__ */ __name(async (args) => {
|
|
4663
4849
|
const { identities, contact, partyType } = args;
|
|
@@ -4772,10 +4958,54 @@ var ContactStore = class extends AbstractContactStore {
|
|
|
4772
4958
|
return Promise.reject(Error(`Connection type ${identity.connection.type}, does not match for provided config`));
|
|
4773
4959
|
}
|
|
4774
4960
|
}
|
|
4775
|
-
const
|
|
4961
|
+
const identityRepository = (await this.dbConnection).getRepository(IdentityEntity);
|
|
4962
|
+
const correlationIdentifierRepository = (await this.dbConnection).getRepository(CorrelationIdentifierEntity);
|
|
4963
|
+
const existingCorrelationIdentifier = await correlationIdentifierRepository.findOne({
|
|
4964
|
+
where: {
|
|
4965
|
+
correlationId: identity.identifier.correlationId
|
|
4966
|
+
}
|
|
4967
|
+
});
|
|
4968
|
+
if (existingCorrelationIdentifier) {
|
|
4969
|
+
const existingIdentity = await identityRepository.findOne({
|
|
4970
|
+
where: {
|
|
4971
|
+
identifier: {
|
|
4972
|
+
id: existingCorrelationIdentifier.id
|
|
4973
|
+
}
|
|
4974
|
+
}
|
|
4975
|
+
});
|
|
4976
|
+
if (existingIdentity) {
|
|
4977
|
+
debug("Identity with same correlationId already exists, returning existing identity", identity.identifier.correlationId);
|
|
4978
|
+
return identityFrom(existingIdentity);
|
|
4979
|
+
}
|
|
4980
|
+
}
|
|
4981
|
+
const existingAlias = await identityRepository.findOne({
|
|
4982
|
+
where: {
|
|
4983
|
+
alias: identity.alias
|
|
4984
|
+
}
|
|
4985
|
+
});
|
|
4986
|
+
let uniqueAlias = identity.alias;
|
|
4987
|
+
if (existingAlias) {
|
|
4988
|
+
let counter = 1;
|
|
4989
|
+
while (await identityRepository.findOne({
|
|
4990
|
+
where: {
|
|
4991
|
+
alias: `${identity.alias}_${counter}`
|
|
4992
|
+
}
|
|
4993
|
+
})) {
|
|
4994
|
+
counter++;
|
|
4995
|
+
}
|
|
4996
|
+
uniqueAlias = `${identity.alias}_${counter}`;
|
|
4997
|
+
debug("Alias collision detected, using unique alias", {
|
|
4998
|
+
original: identity.alias,
|
|
4999
|
+
unique: uniqueAlias
|
|
5000
|
+
});
|
|
5001
|
+
}
|
|
5002
|
+
const identityEntity = identityEntityFrom({
|
|
5003
|
+
...identity,
|
|
5004
|
+
alias: uniqueAlias
|
|
5005
|
+
});
|
|
4776
5006
|
identityEntity.party = party;
|
|
4777
5007
|
debug("Adding identity", identity);
|
|
4778
|
-
const result = await
|
|
5008
|
+
const result = await identityRepository.save(identityEntity, {
|
|
4779
5009
|
transaction: true
|
|
4780
5010
|
});
|
|
4781
5011
|
return identityFrom(result);
|
|
@@ -5453,7 +5683,7 @@ import { In as In2, Not } from "typeorm";
|
|
|
5453
5683
|
var credentialBrandingFrom = /* @__PURE__ */ __name((credentialBranding) => {
|
|
5454
5684
|
const result = {
|
|
5455
5685
|
...credentialBranding,
|
|
5456
|
-
localeBranding: credentialBranding.localeBranding.map((localeBranding) =>
|
|
5686
|
+
localeBranding: credentialBranding.localeBranding.map((localeBranding) => credentialLocaleBrandingFromEntity(localeBranding))
|
|
5457
5687
|
};
|
|
5458
5688
|
return replaceNullWithUndefined(result);
|
|
5459
5689
|
}, "credentialBrandingFrom");
|
|
@@ -5471,6 +5701,19 @@ var localeBrandingFrom = /* @__PURE__ */ __name((localeBranding) => {
|
|
|
5471
5701
|
};
|
|
5472
5702
|
return replaceNullWithUndefined(result);
|
|
5473
5703
|
}, "localeBrandingFrom");
|
|
5704
|
+
var credentialLocaleBrandingFromEntity = /* @__PURE__ */ __name((localeBranding) => {
|
|
5705
|
+
const base = localeBrandingFrom(localeBranding);
|
|
5706
|
+
const result = {
|
|
5707
|
+
...base,
|
|
5708
|
+
state: localeBranding.state,
|
|
5709
|
+
claims: localeBranding.claims ? localeBranding.claims.map((claim) => ({
|
|
5710
|
+
id: claim.id,
|
|
5711
|
+
key: claim.key,
|
|
5712
|
+
name: claim.name
|
|
5713
|
+
})) : void 0
|
|
5714
|
+
};
|
|
5715
|
+
return replaceNullWithUndefined(result);
|
|
5716
|
+
}, "credentialLocaleBrandingFromEntity");
|
|
5474
5717
|
var issuerLocaleBrandingEntityFrom = /* @__PURE__ */ __name((args) => {
|
|
5475
5718
|
const issuerLocaleBrandingEntity = new IssuerLocaleBrandingEntity();
|
|
5476
5719
|
issuerLocaleBrandingEntity.alias = isEmptyString(args.alias) ? void 0 : args.alias;
|
|
@@ -5575,7 +5818,7 @@ var IssuanceBrandingStore = class extends AbstractIssuanceBrandingStore {
|
|
|
5575
5818
|
return credentialBrandingFrom(createdResult);
|
|
5576
5819
|
}, "addCredentialBranding");
|
|
5577
5820
|
getCredentialBranding = /* @__PURE__ */ __name(async (args) => {
|
|
5578
|
-
const { filter } = args ?? {};
|
|
5821
|
+
const { filter, knownStates } = args ?? {};
|
|
5579
5822
|
if (filter) {
|
|
5580
5823
|
filter.forEach((filter2) => {
|
|
5581
5824
|
if (filter2.localeBranding && "locale" in filter2.localeBranding && filter2.localeBranding.locale === void 0) {
|
|
@@ -5584,12 +5827,39 @@ var IssuanceBrandingStore = class extends AbstractIssuanceBrandingStore {
|
|
|
5584
5827
|
});
|
|
5585
5828
|
}
|
|
5586
5829
|
debug3("Getting credential branding", args);
|
|
5587
|
-
const
|
|
5830
|
+
const repository = (await this.dbConnection).getRepository(CredentialBrandingEntity);
|
|
5831
|
+
if (knownStates && Object.keys(knownStates).length > 0) {
|
|
5832
|
+
const stateQuery = repository.createQueryBuilder("branding").select([
|
|
5833
|
+
"branding.id",
|
|
5834
|
+
"branding.state"
|
|
5835
|
+
]);
|
|
5836
|
+
if (filter) {
|
|
5837
|
+
stateQuery.where(filter);
|
|
5838
|
+
}
|
|
5839
|
+
const stateResults = await stateQuery.getRawMany().then((rows) => rows.map((row) => ({
|
|
5840
|
+
id: row.branding_id,
|
|
5841
|
+
state: row.branding_state
|
|
5842
|
+
})));
|
|
5843
|
+
const dirtyIds = stateResults.filter((result3) => {
|
|
5844
|
+
const knownState = knownStates[result3.id];
|
|
5845
|
+
return !knownState || knownState !== result3.state;
|
|
5846
|
+
}).map((result3) => result3.id);
|
|
5847
|
+
if (dirtyIds.length === 0) {
|
|
5848
|
+
return [];
|
|
5849
|
+
}
|
|
5850
|
+
const result2 = await repository.find({
|
|
5851
|
+
where: {
|
|
5852
|
+
id: In2(dirtyIds)
|
|
5853
|
+
}
|
|
5854
|
+
});
|
|
5855
|
+
return result2.map((branding) => credentialBrandingFrom(branding));
|
|
5856
|
+
}
|
|
5857
|
+
const result = await repository.find({
|
|
5588
5858
|
...filter && {
|
|
5589
5859
|
where: filter
|
|
5590
5860
|
}
|
|
5591
5861
|
});
|
|
5592
|
-
return result.map((
|
|
5862
|
+
return result.map((branding) => credentialBrandingFrom(branding));
|
|
5593
5863
|
}, "getCredentialBranding");
|
|
5594
5864
|
removeCredentialBranding = /* @__PURE__ */ __name(async (args) => {
|
|
5595
5865
|
const { filter } = args;
|
|
@@ -5682,7 +5952,7 @@ var IssuanceBrandingStore = class extends AbstractIssuanceBrandingStore {
|
|
|
5682
5952
|
where: filter
|
|
5683
5953
|
}
|
|
5684
5954
|
});
|
|
5685
|
-
return credentialBrandingLocale ? credentialBrandingLocale.map((credentialLocaleBranding) =>
|
|
5955
|
+
return credentialBrandingLocale ? credentialBrandingLocale.map((credentialLocaleBranding) => credentialLocaleBrandingFromEntity(credentialLocaleBranding)) : [];
|
|
5686
5956
|
}, "getCredentialLocaleBranding");
|
|
5687
5957
|
removeCredentialLocaleBranding = /* @__PURE__ */ __name(async (args) => {
|
|
5688
5958
|
const { filter } = args;
|
|
@@ -6687,8 +6957,9 @@ import Debug7 from "debug";
|
|
|
6687
6957
|
import { In as In4 } from "typeorm";
|
|
6688
6958
|
|
|
6689
6959
|
// src/utils/presentationDefinition/MappingUtils.ts
|
|
6690
|
-
import * as
|
|
6960
|
+
import * as blakejs from "blakejs";
|
|
6691
6961
|
import { DcqlQuery } from "dcql";
|
|
6962
|
+
var blake = blakejs.default ?? blakejs;
|
|
6692
6963
|
var dcqlQueryItemFrom = /* @__PURE__ */ __name((entity) => {
|
|
6693
6964
|
const result = {
|
|
6694
6965
|
id: entity.id,
|
|
@@ -6721,7 +6992,7 @@ var dcqlQueryEntityItemFrom = /* @__PURE__ */ __name((item) => {
|
|
|
6721
6992
|
return entity;
|
|
6722
6993
|
}, "dcqlQueryEntityItemFrom");
|
|
6723
6994
|
function hashPayload(payload) {
|
|
6724
|
-
return
|
|
6995
|
+
return blake.blake2bHex(JSON.stringify(payload));
|
|
6725
6996
|
}
|
|
6726
6997
|
__name(hashPayload, "hashPayload");
|
|
6727
6998
|
function isPresentationDefinitionEqual(base, compare) {
|
|
@@ -6894,6 +7165,9 @@ var cleanFilter = /* @__PURE__ */ __name((filter) => {
|
|
|
6894
7165
|
});
|
|
6895
7166
|
}, "cleanFilter");
|
|
6896
7167
|
|
|
7168
|
+
// src/migrations/generic/index.ts
|
|
7169
|
+
import { migrations as VeramoDataStoreMigrations, Entities as VeramoDataStoreEntities } from "@veramo/data-store";
|
|
7170
|
+
|
|
6897
7171
|
// src/migrations/generic/1-CreateContacts.ts
|
|
6898
7172
|
import Debug8 from "debug";
|
|
6899
7173
|
|
|
@@ -7942,21 +8216,113 @@ var AddLinkedVpFields1763387280000 = class {
|
|
|
7942
8216
|
}
|
|
7943
8217
|
};
|
|
7944
8218
|
|
|
7945
|
-
// src/migrations/generic/
|
|
8219
|
+
// src/migrations/generic/15-AddBrandingState.ts
|
|
7946
8220
|
import Debug14 from "debug";
|
|
8221
|
+
|
|
8222
|
+
// src/migrations/postgres/1766000000000-AddBrandingState.ts
|
|
8223
|
+
var AddBrandingStatePostgres1766000000000 = class {
|
|
8224
|
+
static {
|
|
8225
|
+
__name(this, "AddBrandingStatePostgres1766000000000");
|
|
8226
|
+
}
|
|
8227
|
+
name = "AddBrandingState1766000000000";
|
|
8228
|
+
async up(queryRunner) {
|
|
8229
|
+
await queryRunner.query(`ALTER TABLE "CredentialBranding" ADD "state" character varying(255) NOT NULL DEFAULT ''`);
|
|
8230
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" ADD "state" character varying(255) NOT NULL DEFAULT ''`);
|
|
8231
|
+
}
|
|
8232
|
+
async down(queryRunner) {
|
|
8233
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP COLUMN "state"`);
|
|
8234
|
+
await queryRunner.query(`ALTER TABLE "CredentialBranding" DROP COLUMN "state"`);
|
|
8235
|
+
}
|
|
8236
|
+
};
|
|
8237
|
+
|
|
8238
|
+
// src/migrations/sqlite/1766000000000-AddBrandingState.ts
|
|
8239
|
+
var AddBrandingStateSqlite1766000000000 = class {
|
|
8240
|
+
static {
|
|
8241
|
+
__name(this, "AddBrandingStateSqlite1766000000000");
|
|
8242
|
+
}
|
|
8243
|
+
name = "AddBrandingState1766000000000";
|
|
8244
|
+
async up(queryRunner) {
|
|
8245
|
+
await queryRunner.query(`ALTER TABLE "CredentialBranding" ADD COLUMN "state" varchar(255) NOT NULL DEFAULT ''`);
|
|
8246
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" ADD COLUMN "state" varchar(255) NOT NULL DEFAULT ''`);
|
|
8247
|
+
}
|
|
8248
|
+
async down(queryRunner) {
|
|
8249
|
+
await queryRunner.query(`PRAGMA foreign_keys = OFF`);
|
|
8250
|
+
await queryRunner.query(`
|
|
8251
|
+
CREATE TABLE "CredentialBranding_old"
|
|
8252
|
+
(
|
|
8253
|
+
"id" varchar PRIMARY KEY NOT NULL,
|
|
8254
|
+
"vcHash" varchar(255) NOT NULL,
|
|
8255
|
+
"issuerCorrelationId" varchar(255) NOT NULL,
|
|
8256
|
+
"created_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
8257
|
+
"last_updated_at" datetime NOT NULL DEFAULT (datetime('now'))
|
|
8258
|
+
)
|
|
8259
|
+
`);
|
|
8260
|
+
await queryRunner.query(`
|
|
8261
|
+
INSERT INTO "CredentialBranding_old" ("id", "vcHash", "issuerCorrelationId", "created_at", "last_updated_at")
|
|
8262
|
+
SELECT "id", "vcHash", "issuerCorrelationId", "created_at", "last_updated_at"
|
|
8263
|
+
FROM "CredentialBranding"
|
|
8264
|
+
`);
|
|
8265
|
+
await queryRunner.query(`DROP TABLE "CredentialBranding"`);
|
|
8266
|
+
await queryRunner.query(`ALTER TABLE "CredentialBranding_old" RENAME TO "CredentialBranding"`);
|
|
8267
|
+
await queryRunner.query(`CREATE INDEX "IDX_CredentialBrandingEntity_issuerCorrelationId" ON "CredentialBranding" ("issuerCorrelationId")`);
|
|
8268
|
+
await queryRunner.query(`CREATE INDEX "IDX_CredentialBrandingEntity_vcHash" ON "CredentialBranding" ("vcHash")`);
|
|
8269
|
+
await queryRunner.query(`
|
|
8270
|
+
CREATE TABLE "BaseLocaleBranding_old"
|
|
8271
|
+
(
|
|
8272
|
+
"id" varchar PRIMARY KEY NOT NULL,
|
|
8273
|
+
"alias" varchar(255),
|
|
8274
|
+
"locale" varchar(255) NOT NULL,
|
|
8275
|
+
"description" varchar(255),
|
|
8276
|
+
"created_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
8277
|
+
"last_updated_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
8278
|
+
"credentialBrandingId" varchar,
|
|
8279
|
+
"issuerBrandingId" varchar,
|
|
8280
|
+
"type" varchar NOT NULL,
|
|
8281
|
+
"logoId" varchar,
|
|
8282
|
+
"backgroundId" varchar,
|
|
8283
|
+
"textId" varchar,
|
|
8284
|
+
"client_uri" varchar,
|
|
8285
|
+
"tos_uri" varchar,
|
|
8286
|
+
"policy_uri" varchar,
|
|
8287
|
+
"contacts" varchar,
|
|
8288
|
+
CONSTRAINT "UQ_logoId" UNIQUE ("logoId"),
|
|
8289
|
+
CONSTRAINT "UQ_backgroundId" UNIQUE ("backgroundId"),
|
|
8290
|
+
CONSTRAINT "UQ_textId" UNIQUE ("textId"),
|
|
8291
|
+
CONSTRAINT "FK_BaseLocaleBranding_logoId" FOREIGN KEY ("logoId") REFERENCES "ImageAttributes" ("id") ON DELETE CASCADE ON UPDATE NO ACTION,
|
|
8292
|
+
CONSTRAINT "FK_BaseLocaleBranding_backgroundId" FOREIGN KEY ("backgroundId") REFERENCES "BackgroundAttributes" ("id") ON DELETE CASCADE ON UPDATE NO ACTION,
|
|
8293
|
+
CONSTRAINT "FK_BaseLocaleBranding_textId" FOREIGN KEY ("textId") REFERENCES "TextAttributes" ("id") ON DELETE CASCADE ON UPDATE NO ACTION,
|
|
8294
|
+
CONSTRAINT "FK_BaseLocaleBranding_credentialBrandingId" FOREIGN KEY ("credentialBrandingId") REFERENCES "CredentialBranding" ("id") ON DELETE CASCADE ON UPDATE NO ACTION,
|
|
8295
|
+
CONSTRAINT "FK_BaseLocaleBranding_issuerBrandingId" FOREIGN KEY ("issuerBrandingId") REFERENCES "IssuerBranding" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
8296
|
+
)
|
|
8297
|
+
`);
|
|
8298
|
+
await queryRunner.query(`
|
|
8299
|
+
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")
|
|
8300
|
+
SELECT "id", "alias", "locale", "description", "created_at", "last_updated_at", "credentialBrandingId", "issuerBrandingId", "type", "logoId", "backgroundId", "textId", "client_uri", "tos_uri", "policy_uri", "contacts"
|
|
8301
|
+
FROM "BaseLocaleBranding"
|
|
8302
|
+
`);
|
|
8303
|
+
await queryRunner.query(`DROP TABLE "BaseLocaleBranding"`);
|
|
8304
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding_old" RENAME TO "BaseLocaleBranding"`);
|
|
8305
|
+
await queryRunner.query(`CREATE UNIQUE INDEX "IDX_CredentialLocaleBrandingEntity_credentialBranding_locale" ON "BaseLocaleBranding" ("credentialBrandingId", "locale")`);
|
|
8306
|
+
await queryRunner.query(`CREATE UNIQUE INDEX "IDX_IssuerLocaleBrandingEntity_issuerBranding_locale" ON "BaseLocaleBranding" ("issuerBrandingId", "locale")`);
|
|
8307
|
+
await queryRunner.query(`CREATE INDEX "IDX_BaseLocaleBranding_type" ON "BaseLocaleBranding" ("type")`);
|
|
8308
|
+
await queryRunner.query(`PRAGMA foreign_keys = ON`);
|
|
8309
|
+
}
|
|
8310
|
+
};
|
|
8311
|
+
|
|
8312
|
+
// src/migrations/generic/15-AddBrandingState.ts
|
|
7947
8313
|
var debug14 = Debug14("sphereon:ssi-sdk:migrations");
|
|
7948
|
-
var
|
|
8314
|
+
var AddBrandingState1766000000000 = class {
|
|
7949
8315
|
static {
|
|
7950
|
-
__name(this, "
|
|
8316
|
+
__name(this, "AddBrandingState1766000000000");
|
|
7951
8317
|
}
|
|
7952
|
-
name = "
|
|
8318
|
+
name = "AddBrandingState1766000000000";
|
|
7953
8319
|
async up(queryRunner) {
|
|
7954
|
-
debug14("migration:
|
|
8320
|
+
debug14("migration: adding branding state checksum columns");
|
|
7955
8321
|
const dbType = queryRunner.connection.driver.options.type;
|
|
7956
8322
|
switch (dbType) {
|
|
7957
8323
|
case "postgres": {
|
|
7958
8324
|
debug14("using postgres migration file");
|
|
7959
|
-
const mig = new
|
|
8325
|
+
const mig = new AddBrandingStatePostgres1766000000000();
|
|
7960
8326
|
await mig.up(queryRunner);
|
|
7961
8327
|
debug14("Migration statements executed");
|
|
7962
8328
|
return;
|
|
@@ -7965,7 +8331,7 @@ var CreateIssuanceBranding1659463079429 = class {
|
|
|
7965
8331
|
case "expo":
|
|
7966
8332
|
case "react-native": {
|
|
7967
8333
|
debug14("using sqlite/react-native migration file");
|
|
7968
|
-
const mig = new
|
|
8334
|
+
const mig = new AddBrandingStateSqlite1766000000000();
|
|
7969
8335
|
await mig.up(queryRunner);
|
|
7970
8336
|
debug14("Migration statements executed");
|
|
7971
8337
|
return;
|
|
@@ -7975,12 +8341,12 @@ var CreateIssuanceBranding1659463079429 = class {
|
|
|
7975
8341
|
}
|
|
7976
8342
|
}
|
|
7977
8343
|
async down(queryRunner) {
|
|
7978
|
-
debug14("migration:
|
|
8344
|
+
debug14("migration: removing branding state checksum columns");
|
|
7979
8345
|
const dbType = queryRunner.connection.driver.options.type;
|
|
7980
8346
|
switch (dbType) {
|
|
7981
8347
|
case "postgres": {
|
|
7982
8348
|
debug14("using postgres migration file");
|
|
7983
|
-
const mig = new
|
|
8349
|
+
const mig = new AddBrandingStatePostgres1766000000000();
|
|
7984
8350
|
await mig.down(queryRunner);
|
|
7985
8351
|
debug14("Migration statements executed");
|
|
7986
8352
|
return;
|
|
@@ -7989,7 +8355,7 @@ var CreateIssuanceBranding1659463079429 = class {
|
|
|
7989
8355
|
case "expo":
|
|
7990
8356
|
case "react-native": {
|
|
7991
8357
|
debug14("using sqlite/react-native migration file");
|
|
7992
|
-
const mig = new
|
|
8358
|
+
const mig = new AddBrandingStateSqlite1766000000000();
|
|
7993
8359
|
await mig.down(queryRunner);
|
|
7994
8360
|
debug14("Migration statements executed");
|
|
7995
8361
|
return;
|
|
@@ -8000,8 +8366,187 @@ var CreateIssuanceBranding1659463079429 = class {
|
|
|
8000
8366
|
}
|
|
8001
8367
|
};
|
|
8002
8368
|
|
|
8003
|
-
// src/migrations/generic/
|
|
8369
|
+
// src/migrations/generic/15-AddServiceMetadata.ts
|
|
8370
|
+
import Debug17 from "debug";
|
|
8371
|
+
|
|
8372
|
+
// src/migrations/postgres/1764000000001-AddServiceMetadata.ts
|
|
8004
8373
|
import Debug15 from "debug";
|
|
8374
|
+
var debug15 = Debug15("sphereon:ssi-sdk:migrations");
|
|
8375
|
+
var AddServiceMetadata1764000000001 = class {
|
|
8376
|
+
static {
|
|
8377
|
+
__name(this, "AddServiceMetadata1764000000001");
|
|
8378
|
+
}
|
|
8379
|
+
name = "AddServiceMetadata1764000000001";
|
|
8380
|
+
async up(queryRunner) {
|
|
8381
|
+
const table = await queryRunner.getTable("service");
|
|
8382
|
+
if (!table) {
|
|
8383
|
+
debug15("AddServiceMetadata: Skipping migration - service table does not exist. This is expected if Veramo DID Manager is not being used. If you need service metadata support, ensure Veramo migrations run before SSI-SDK migrations.");
|
|
8384
|
+
console.warn("[SSI-SDK Migration] AddServiceMetadata: Skipping - service table does not exist (Veramo DID Manager not in use)");
|
|
8385
|
+
return;
|
|
8386
|
+
}
|
|
8387
|
+
await queryRunner.query(`
|
|
8388
|
+
ALTER TABLE "service"
|
|
8389
|
+
ADD COLUMN IF NOT EXISTS "metadata" jsonb
|
|
8390
|
+
`);
|
|
8391
|
+
debug15("AddServiceMetadata: Added metadata column to service table");
|
|
8392
|
+
}
|
|
8393
|
+
async down(queryRunner) {
|
|
8394
|
+
const table = await queryRunner.getTable("service");
|
|
8395
|
+
if (!table) {
|
|
8396
|
+
return;
|
|
8397
|
+
}
|
|
8398
|
+
await queryRunner.query(`
|
|
8399
|
+
ALTER TABLE "service"
|
|
8400
|
+
DROP COLUMN IF EXISTS "metadata"
|
|
8401
|
+
`);
|
|
8402
|
+
}
|
|
8403
|
+
};
|
|
8404
|
+
|
|
8405
|
+
// src/migrations/sqlite/1764000000002-AddServiceMetadata.ts
|
|
8406
|
+
import Debug16 from "debug";
|
|
8407
|
+
var debug16 = Debug16("sphereon:ssi-sdk:migrations");
|
|
8408
|
+
var AddServiceMetadata1764000000002 = class {
|
|
8409
|
+
static {
|
|
8410
|
+
__name(this, "AddServiceMetadata1764000000002");
|
|
8411
|
+
}
|
|
8412
|
+
name = "AddServiceMetadata1764000000002";
|
|
8413
|
+
async up(queryRunner) {
|
|
8414
|
+
const table = await queryRunner.getTable("service");
|
|
8415
|
+
if (!table) {
|
|
8416
|
+
debug16("AddServiceMetadata: Skipping migration - service table does not exist. This is expected if Veramo DID Manager is not being used. If you need service metadata support, ensure Veramo migrations run before SSI-SDK migrations.");
|
|
8417
|
+
console.warn("[SSI-SDK Migration] AddServiceMetadata: Skipping - service table does not exist (Veramo DID Manager not in use)");
|
|
8418
|
+
return;
|
|
8419
|
+
}
|
|
8420
|
+
const hasMetadataColumn = table.columns.some((col) => col.name === "metadata");
|
|
8421
|
+
if (!hasMetadataColumn) {
|
|
8422
|
+
await queryRunner.query(`
|
|
8423
|
+
ALTER TABLE "service"
|
|
8424
|
+
ADD COLUMN "metadata" text
|
|
8425
|
+
`);
|
|
8426
|
+
debug16("AddServiceMetadata: Added metadata column to service table");
|
|
8427
|
+
}
|
|
8428
|
+
}
|
|
8429
|
+
async down(queryRunner) {
|
|
8430
|
+
}
|
|
8431
|
+
};
|
|
8432
|
+
|
|
8433
|
+
// src/migrations/generic/15-AddServiceMetadata.ts
|
|
8434
|
+
var debug17 = Debug17("sphereon:ssi-sdk:migrations");
|
|
8435
|
+
var AddServiceMetadata1764000000000 = class {
|
|
8436
|
+
static {
|
|
8437
|
+
__name(this, "AddServiceMetadata1764000000000");
|
|
8438
|
+
}
|
|
8439
|
+
name = "AddServiceMetadata1764000000000";
|
|
8440
|
+
async up(queryRunner) {
|
|
8441
|
+
debug17("migration: adding metadata column to service table");
|
|
8442
|
+
const dbType = queryRunner.connection.driver.options.type;
|
|
8443
|
+
switch (dbType) {
|
|
8444
|
+
case "postgres": {
|
|
8445
|
+
debug17("using postgres migration file for AddServiceMetadata");
|
|
8446
|
+
const mig = new AddServiceMetadata1764000000001();
|
|
8447
|
+
await mig.up(queryRunner);
|
|
8448
|
+
debug17("Postgres migration statements for AddServiceMetadata executed");
|
|
8449
|
+
return;
|
|
8450
|
+
}
|
|
8451
|
+
case "sqlite":
|
|
8452
|
+
case "expo":
|
|
8453
|
+
case "react-native": {
|
|
8454
|
+
debug17("using sqlite/react-native migration file for AddServiceMetadata");
|
|
8455
|
+
const mig = new AddServiceMetadata1764000000002();
|
|
8456
|
+
await mig.up(queryRunner);
|
|
8457
|
+
debug17("SQLite migration statements for AddServiceMetadata executed");
|
|
8458
|
+
return;
|
|
8459
|
+
}
|
|
8460
|
+
default:
|
|
8461
|
+
return Promise.reject(`Migrations are currently only supported for sqlite, react-native, expo, and postgres for AddServiceMetadata. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`);
|
|
8462
|
+
}
|
|
8463
|
+
}
|
|
8464
|
+
async down(queryRunner) {
|
|
8465
|
+
debug17("migration: reverting metadata column from service table");
|
|
8466
|
+
const dbType = queryRunner.connection.driver.options.type;
|
|
8467
|
+
switch (dbType) {
|
|
8468
|
+
case "postgres": {
|
|
8469
|
+
debug17("using postgres migration file for AddServiceMetadata");
|
|
8470
|
+
const mig = new AddServiceMetadata1764000000001();
|
|
8471
|
+
await mig.down(queryRunner);
|
|
8472
|
+
debug17("Postgres migration statements for AddServiceMetadata reverted");
|
|
8473
|
+
return;
|
|
8474
|
+
}
|
|
8475
|
+
case "sqlite":
|
|
8476
|
+
case "expo":
|
|
8477
|
+
case "react-native": {
|
|
8478
|
+
debug17("using sqlite/react-native migration file for AddServiceMetadata");
|
|
8479
|
+
const mig = new AddServiceMetadata1764000000002();
|
|
8480
|
+
await mig.down(queryRunner);
|
|
8481
|
+
debug17("SQLite migration statements for AddServiceMetadata reverted");
|
|
8482
|
+
return;
|
|
8483
|
+
}
|
|
8484
|
+
default:
|
|
8485
|
+
return Promise.reject(`Migrations are currently only supported for sqlite, react-native, expo, and postgres for AddServiceMetadata. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`);
|
|
8486
|
+
}
|
|
8487
|
+
}
|
|
8488
|
+
};
|
|
8489
|
+
|
|
8490
|
+
// src/migrations/generic/2-CreateIssuanceBranding.ts
|
|
8491
|
+
import Debug18 from "debug";
|
|
8492
|
+
var debug18 = Debug18("sphereon:ssi-sdk:migrations");
|
|
8493
|
+
var CreateIssuanceBranding1659463079429 = class {
|
|
8494
|
+
static {
|
|
8495
|
+
__name(this, "CreateIssuanceBranding1659463079429");
|
|
8496
|
+
}
|
|
8497
|
+
name = "CreateIssuanceBranding1659463079429";
|
|
8498
|
+
async up(queryRunner) {
|
|
8499
|
+
debug18("migration: creating issuance branding tables");
|
|
8500
|
+
const dbType = queryRunner.connection.driver.options.type;
|
|
8501
|
+
switch (dbType) {
|
|
8502
|
+
case "postgres": {
|
|
8503
|
+
debug18("using postgres migration file");
|
|
8504
|
+
const mig = new CreateIssuanceBranding1685628974232();
|
|
8505
|
+
await mig.up(queryRunner);
|
|
8506
|
+
debug18("Migration statements executed");
|
|
8507
|
+
return;
|
|
8508
|
+
}
|
|
8509
|
+
case "sqlite":
|
|
8510
|
+
case "expo":
|
|
8511
|
+
case "react-native": {
|
|
8512
|
+
debug18("using sqlite/react-native migration file");
|
|
8513
|
+
const mig = new CreateIssuanceBranding1685628973231();
|
|
8514
|
+
await mig.up(queryRunner);
|
|
8515
|
+
debug18("Migration statements executed");
|
|
8516
|
+
return;
|
|
8517
|
+
}
|
|
8518
|
+
default:
|
|
8519
|
+
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`);
|
|
8520
|
+
}
|
|
8521
|
+
}
|
|
8522
|
+
async down(queryRunner) {
|
|
8523
|
+
debug18("migration: reverting issuance branding tables");
|
|
8524
|
+
const dbType = queryRunner.connection.driver.options.type;
|
|
8525
|
+
switch (dbType) {
|
|
8526
|
+
case "postgres": {
|
|
8527
|
+
debug18("using postgres migration file");
|
|
8528
|
+
const mig = new CreateIssuanceBranding1685628974232();
|
|
8529
|
+
await mig.down(queryRunner);
|
|
8530
|
+
debug18("Migration statements executed");
|
|
8531
|
+
return;
|
|
8532
|
+
}
|
|
8533
|
+
case "sqlite":
|
|
8534
|
+
case "expo":
|
|
8535
|
+
case "react-native": {
|
|
8536
|
+
debug18("using sqlite/react-native migration file");
|
|
8537
|
+
const mig = new CreateIssuanceBranding1685628973231();
|
|
8538
|
+
await mig.down(queryRunner);
|
|
8539
|
+
debug18("Migration statements executed");
|
|
8540
|
+
return;
|
|
8541
|
+
}
|
|
8542
|
+
default:
|
|
8543
|
+
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`);
|
|
8544
|
+
}
|
|
8545
|
+
}
|
|
8546
|
+
};
|
|
8547
|
+
|
|
8548
|
+
// src/migrations/generic/3-CreateContacts.ts
|
|
8549
|
+
import Debug19 from "debug";
|
|
8005
8550
|
|
|
8006
8551
|
// src/migrations/postgres/1690925872592-CreateContacts.ts
|
|
8007
8552
|
import { enablePostgresUuidExtension as enablePostgresUuidExtension3 } from "@sphereon/ssi-sdk.core";
|
|
@@ -8222,30 +8767,30 @@ var CreateContacts1690925872693 = class {
|
|
|
8222
8767
|
};
|
|
8223
8768
|
|
|
8224
8769
|
// src/migrations/generic/3-CreateContacts.ts
|
|
8225
|
-
var
|
|
8770
|
+
var debug19 = Debug19("sphereon:ssi-sdk:migrations");
|
|
8226
8771
|
var CreateContacts1690925872318 = class {
|
|
8227
8772
|
static {
|
|
8228
8773
|
__name(this, "CreateContacts1690925872318");
|
|
8229
8774
|
}
|
|
8230
8775
|
name = "CreateContacts1690925872318";
|
|
8231
8776
|
async up(queryRunner) {
|
|
8232
|
-
|
|
8777
|
+
debug19("migration: creating contacts tables");
|
|
8233
8778
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8234
8779
|
switch (dbType) {
|
|
8235
8780
|
case "postgres": {
|
|
8236
|
-
|
|
8781
|
+
debug19("using postgres migration file");
|
|
8237
8782
|
const mig = new CreateContacts1690925872592();
|
|
8238
8783
|
await mig.up(queryRunner);
|
|
8239
|
-
|
|
8784
|
+
debug19("Migration statements executed");
|
|
8240
8785
|
return;
|
|
8241
8786
|
}
|
|
8242
8787
|
case "sqlite":
|
|
8243
8788
|
case "expo":
|
|
8244
8789
|
case "react-native": {
|
|
8245
|
-
|
|
8790
|
+
debug19("using sqlite/react-native migration file");
|
|
8246
8791
|
const mig = new CreateContacts1690925872693();
|
|
8247
8792
|
await mig.up(queryRunner);
|
|
8248
|
-
|
|
8793
|
+
debug19("Migration statements executed");
|
|
8249
8794
|
return;
|
|
8250
8795
|
}
|
|
8251
8796
|
default:
|
|
@@ -8253,23 +8798,23 @@ var CreateContacts1690925872318 = class {
|
|
|
8253
8798
|
}
|
|
8254
8799
|
}
|
|
8255
8800
|
async down(queryRunner) {
|
|
8256
|
-
|
|
8801
|
+
debug19("migration: reverting contacts tables");
|
|
8257
8802
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8258
8803
|
switch (dbType) {
|
|
8259
8804
|
case "postgres": {
|
|
8260
|
-
|
|
8805
|
+
debug19("using postgres migration file");
|
|
8261
8806
|
const mig = new CreateContacts1690925872592();
|
|
8262
8807
|
await mig.down(queryRunner);
|
|
8263
|
-
|
|
8808
|
+
debug19("Migration statements executed");
|
|
8264
8809
|
return;
|
|
8265
8810
|
}
|
|
8266
8811
|
case "sqlite":
|
|
8267
8812
|
case "expo":
|
|
8268
8813
|
case "react-native": {
|
|
8269
|
-
|
|
8814
|
+
debug19("using sqlite/react-native migration file");
|
|
8270
8815
|
const mig = new CreateContacts1690925872693();
|
|
8271
8816
|
await mig.down(queryRunner);
|
|
8272
|
-
|
|
8817
|
+
debug19("Migration statements executed");
|
|
8273
8818
|
return;
|
|
8274
8819
|
}
|
|
8275
8820
|
default:
|
|
@@ -8279,7 +8824,7 @@ var CreateContacts1690925872318 = class {
|
|
|
8279
8824
|
};
|
|
8280
8825
|
|
|
8281
8826
|
// src/migrations/generic/4-CreateStatusList.ts
|
|
8282
|
-
import
|
|
8827
|
+
import Debug20 from "debug";
|
|
8283
8828
|
|
|
8284
8829
|
// src/migrations/postgres/1693866470001-CreateStatusList.ts
|
|
8285
8830
|
var CreateStatusList1693866470001 = class {
|
|
@@ -8485,53 +9030,53 @@ var UpdateStatusList1737110469000 = class {
|
|
|
8485
9030
|
};
|
|
8486
9031
|
|
|
8487
9032
|
// src/migrations/generic/4-CreateStatusList.ts
|
|
8488
|
-
var
|
|
9033
|
+
var debug20 = Debug20("sphereon:ssi-sdk:migrations");
|
|
8489
9034
|
var CreateStatusList1693866470000 = class {
|
|
8490
9035
|
static {
|
|
8491
9036
|
__name(this, "CreateStatusList1693866470000");
|
|
8492
9037
|
}
|
|
8493
9038
|
name = "CreateStatusList1693866470000";
|
|
8494
9039
|
async up(queryRunner) {
|
|
8495
|
-
|
|
9040
|
+
debug20("migration: creating issuance branding tables");
|
|
8496
9041
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8497
9042
|
if (dbType === "postgres") {
|
|
8498
|
-
|
|
9043
|
+
debug20("using postgres migration files");
|
|
8499
9044
|
const createMig = new CreateStatusList1693866470001();
|
|
8500
9045
|
await createMig.up(queryRunner);
|
|
8501
9046
|
const updateMig = new UpdateStatusList1737110469001();
|
|
8502
9047
|
const up = await updateMig.up(queryRunner);
|
|
8503
|
-
|
|
9048
|
+
debug20("Migration statements executed");
|
|
8504
9049
|
return up;
|
|
8505
9050
|
} else if (dbType === "sqlite" || dbType === "react-native" || dbType === "expo") {
|
|
8506
|
-
|
|
9051
|
+
debug20("using sqlite/react-native migration files");
|
|
8507
9052
|
const createMig = new CreateStatusList1693866470002();
|
|
8508
9053
|
await createMig.up(queryRunner);
|
|
8509
9054
|
const updateMig = new UpdateStatusList1737110469000();
|
|
8510
9055
|
const up = await updateMig.up(queryRunner);
|
|
8511
|
-
|
|
9056
|
+
debug20("Migration statements executed");
|
|
8512
9057
|
return up;
|
|
8513
9058
|
} else {
|
|
8514
9059
|
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
9060
|
}
|
|
8516
9061
|
}
|
|
8517
9062
|
async down(queryRunner) {
|
|
8518
|
-
|
|
9063
|
+
debug20("migration: reverting issuance branding tables");
|
|
8519
9064
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8520
9065
|
if (dbType === "postgres") {
|
|
8521
|
-
|
|
9066
|
+
debug20("using postgres migration files");
|
|
8522
9067
|
const updateMig = new UpdateStatusList1737110469001();
|
|
8523
9068
|
await updateMig.down(queryRunner);
|
|
8524
9069
|
const createMig = new CreateStatusList1693866470001();
|
|
8525
9070
|
const down = await createMig.down(queryRunner);
|
|
8526
|
-
|
|
9071
|
+
debug20("Migration statements executed");
|
|
8527
9072
|
return down;
|
|
8528
9073
|
} else if (dbType === "sqlite" || dbType === "react-native" || dbType === "expo") {
|
|
8529
|
-
|
|
9074
|
+
debug20("using sqlite/react-native migration files");
|
|
8530
9075
|
const updateMig = new UpdateStatusList1737110469000();
|
|
8531
9076
|
await updateMig.down(queryRunner);
|
|
8532
9077
|
const createMig = new CreateStatusList1693866470002();
|
|
8533
9078
|
const down = await createMig.down(queryRunner);
|
|
8534
|
-
|
|
9079
|
+
debug20("Migration statements executed");
|
|
8535
9080
|
return down;
|
|
8536
9081
|
} else {
|
|
8537
9082
|
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 +9085,7 @@ var CreateStatusList1693866470000 = class {
|
|
|
8540
9085
|
};
|
|
8541
9086
|
|
|
8542
9087
|
// src/migrations/generic/5-CreateAuditEvents.ts
|
|
8543
|
-
import
|
|
9088
|
+
import Debug21 from "debug";
|
|
8544
9089
|
|
|
8545
9090
|
// src/migrations/postgres/1701634812183-CreateAuditEvents.ts
|
|
8546
9091
|
var CreateAuditEvents1701634812183 = class {
|
|
@@ -8639,30 +9184,30 @@ var CreateAuditEvents1701634819487 = class {
|
|
|
8639
9184
|
};
|
|
8640
9185
|
|
|
8641
9186
|
// src/migrations/generic/5-CreateAuditEvents.ts
|
|
8642
|
-
var
|
|
9187
|
+
var debug21 = Debug21("sphereon:ssi-sdk:migrations");
|
|
8643
9188
|
var CreateAuditEvents1701635835330 = class {
|
|
8644
9189
|
static {
|
|
8645
9190
|
__name(this, "CreateAuditEvents1701635835330");
|
|
8646
9191
|
}
|
|
8647
9192
|
name = "CreateAuditEvents1701635835330";
|
|
8648
9193
|
async up(queryRunner) {
|
|
8649
|
-
|
|
9194
|
+
debug21("migration: creating audit events tables");
|
|
8650
9195
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8651
9196
|
switch (dbType) {
|
|
8652
9197
|
case "postgres": {
|
|
8653
|
-
|
|
9198
|
+
debug21("using postgres migration file");
|
|
8654
9199
|
const mig = new CreateAuditEvents1701634812183();
|
|
8655
9200
|
await mig.up(queryRunner);
|
|
8656
|
-
|
|
9201
|
+
debug21("Migration statements executed");
|
|
8657
9202
|
return;
|
|
8658
9203
|
}
|
|
8659
9204
|
case "sqlite":
|
|
8660
9205
|
case "expo":
|
|
8661
9206
|
case "react-native": {
|
|
8662
|
-
|
|
9207
|
+
debug21("using sqlite/react-native migration file");
|
|
8663
9208
|
const mig = new CreateAuditEvents1701634819487();
|
|
8664
9209
|
await mig.up(queryRunner);
|
|
8665
|
-
|
|
9210
|
+
debug21("Migration statements executed");
|
|
8666
9211
|
return;
|
|
8667
9212
|
}
|
|
8668
9213
|
default:
|
|
@@ -8670,23 +9215,23 @@ var CreateAuditEvents1701635835330 = class {
|
|
|
8670
9215
|
}
|
|
8671
9216
|
}
|
|
8672
9217
|
async down(queryRunner) {
|
|
8673
|
-
|
|
9218
|
+
debug21("migration: reverting audit events tables");
|
|
8674
9219
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8675
9220
|
switch (dbType) {
|
|
8676
9221
|
case "postgres": {
|
|
8677
|
-
|
|
9222
|
+
debug21("using postgres migration file");
|
|
8678
9223
|
const mig = new CreateAuditEvents1701634812183();
|
|
8679
9224
|
await mig.down(queryRunner);
|
|
8680
|
-
|
|
9225
|
+
debug21("Migration statements executed");
|
|
8681
9226
|
return;
|
|
8682
9227
|
}
|
|
8683
9228
|
case "sqlite":
|
|
8684
9229
|
case "expo":
|
|
8685
9230
|
case "react-native": {
|
|
8686
|
-
|
|
9231
|
+
debug21("using sqlite/react-native migration file");
|
|
8687
9232
|
const mig = new CreateAuditEvents1701634819487();
|
|
8688
9233
|
await mig.down(queryRunner);
|
|
8689
|
-
|
|
9234
|
+
debug21("Migration statements executed");
|
|
8690
9235
|
return;
|
|
8691
9236
|
}
|
|
8692
9237
|
default:
|
|
@@ -8696,7 +9241,7 @@ var CreateAuditEvents1701635835330 = class {
|
|
|
8696
9241
|
};
|
|
8697
9242
|
|
|
8698
9243
|
// src/migrations/generic/6-CreateDigitalCredential.ts
|
|
8699
|
-
import
|
|
9244
|
+
import Debug22 from "debug";
|
|
8700
9245
|
|
|
8701
9246
|
// src/migrations/postgres/1708525189001-CreateDigitalCredential.ts
|
|
8702
9247
|
var CreateDigitalCredential1708525189001 = class {
|
|
@@ -8804,30 +9349,30 @@ var CreateDigitalCredential1708525189002 = class {
|
|
|
8804
9349
|
};
|
|
8805
9350
|
|
|
8806
9351
|
// src/migrations/generic/6-CreateDigitalCredential.ts
|
|
8807
|
-
var
|
|
9352
|
+
var debug22 = Debug22("sphereon:ssi-sdk:migrations");
|
|
8808
9353
|
var CreateDigitalCredential1708525189000 = class {
|
|
8809
9354
|
static {
|
|
8810
9355
|
__name(this, "CreateDigitalCredential1708525189000");
|
|
8811
9356
|
}
|
|
8812
9357
|
name = "CreateDigitalCredential1708525189000";
|
|
8813
9358
|
async up(queryRunner) {
|
|
8814
|
-
|
|
9359
|
+
debug22("migration: creating DigitalCredential tables");
|
|
8815
9360
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8816
9361
|
switch (dbType) {
|
|
8817
9362
|
case "postgres": {
|
|
8818
|
-
|
|
9363
|
+
debug22("using postgres migration file for DigitalCredential");
|
|
8819
9364
|
const mig = new CreateDigitalCredential1708525189001();
|
|
8820
9365
|
await mig.up(queryRunner);
|
|
8821
|
-
|
|
9366
|
+
debug22("Postgres Migration statements for DigitalCredential executed");
|
|
8822
9367
|
return;
|
|
8823
9368
|
}
|
|
8824
9369
|
case "sqlite":
|
|
8825
9370
|
case "expo":
|
|
8826
9371
|
case "react-native": {
|
|
8827
|
-
|
|
9372
|
+
debug22("using sqlite/react-native migration file for DigitalCredential");
|
|
8828
9373
|
const mig = new CreateDigitalCredential1708525189002();
|
|
8829
9374
|
await mig.up(queryRunner);
|
|
8830
|
-
|
|
9375
|
+
debug22("SQLite Migration statements for DigitalCredential executed");
|
|
8831
9376
|
return;
|
|
8832
9377
|
}
|
|
8833
9378
|
default:
|
|
@@ -8835,23 +9380,23 @@ var CreateDigitalCredential1708525189000 = class {
|
|
|
8835
9380
|
}
|
|
8836
9381
|
}
|
|
8837
9382
|
async down(queryRunner) {
|
|
8838
|
-
|
|
9383
|
+
debug22("migration: reverting DigitalCredential tables");
|
|
8839
9384
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8840
9385
|
switch (dbType) {
|
|
8841
9386
|
case "postgres": {
|
|
8842
|
-
|
|
9387
|
+
debug22("using postgres migration file for DigitalCredential");
|
|
8843
9388
|
const mig = new CreateDigitalCredential1708525189001();
|
|
8844
9389
|
await mig.down(queryRunner);
|
|
8845
|
-
|
|
9390
|
+
debug22("Postgres Migration statements for DigitalCredential reverted");
|
|
8846
9391
|
return;
|
|
8847
9392
|
}
|
|
8848
9393
|
case "sqlite":
|
|
8849
9394
|
case "expo":
|
|
8850
9395
|
case "react-native": {
|
|
8851
|
-
|
|
9396
|
+
debug22("using sqlite/react-native migration file for DigitalCredential");
|
|
8852
9397
|
const mig = new CreateDigitalCredential1708525189002();
|
|
8853
9398
|
await mig.down(queryRunner);
|
|
8854
|
-
|
|
9399
|
+
debug22("SQLite Migration statements for DigitalCredential reverted");
|
|
8855
9400
|
return;
|
|
8856
9401
|
}
|
|
8857
9402
|
default:
|
|
@@ -8861,7 +9406,7 @@ var CreateDigitalCredential1708525189000 = class {
|
|
|
8861
9406
|
};
|
|
8862
9407
|
|
|
8863
9408
|
// src/migrations/generic/7-CreateMachineStateStore.ts
|
|
8864
|
-
import
|
|
9409
|
+
import Debug23 from "debug";
|
|
8865
9410
|
|
|
8866
9411
|
// src/migrations/postgres/1708797018115-CreateMachineStateStore.ts
|
|
8867
9412
|
var CreateMachineStateStore1708797018115 = class {
|
|
@@ -8923,30 +9468,30 @@ var CreateMachineStateStore1708796002272 = class {
|
|
|
8923
9468
|
};
|
|
8924
9469
|
|
|
8925
9470
|
// src/migrations/generic/7-CreateMachineStateStore.ts
|
|
8926
|
-
var
|
|
9471
|
+
var debug23 = Debug23("sphereon:ssi-sdk:migrations");
|
|
8927
9472
|
var CreateMachineStateStore1708098041262 = class {
|
|
8928
9473
|
static {
|
|
8929
9474
|
__name(this, "CreateMachineStateStore1708098041262");
|
|
8930
9475
|
}
|
|
8931
9476
|
name = "CreateMachineStateStore1708098041262";
|
|
8932
9477
|
async up(queryRunner) {
|
|
8933
|
-
|
|
9478
|
+
debug23("migration: creating machine state tables");
|
|
8934
9479
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8935
9480
|
switch (dbType) {
|
|
8936
9481
|
case "postgres": {
|
|
8937
|
-
|
|
9482
|
+
debug23("using postgres migration file");
|
|
8938
9483
|
const mig = new CreateMachineStateStore1708797018115();
|
|
8939
9484
|
await mig.up(queryRunner);
|
|
8940
|
-
|
|
9485
|
+
debug23("Migration statements executed");
|
|
8941
9486
|
return;
|
|
8942
9487
|
}
|
|
8943
9488
|
case "sqlite":
|
|
8944
9489
|
case "expo":
|
|
8945
9490
|
case "react-native": {
|
|
8946
|
-
|
|
9491
|
+
debug23("using sqlite/react-native migration file");
|
|
8947
9492
|
const mig = new CreateMachineStateStore1708796002272();
|
|
8948
9493
|
await mig.up(queryRunner);
|
|
8949
|
-
|
|
9494
|
+
debug23("Migration statements executed");
|
|
8950
9495
|
return;
|
|
8951
9496
|
}
|
|
8952
9497
|
default:
|
|
@@ -8954,23 +9499,23 @@ var CreateMachineStateStore1708098041262 = class {
|
|
|
8954
9499
|
}
|
|
8955
9500
|
}
|
|
8956
9501
|
async down(queryRunner) {
|
|
8957
|
-
|
|
9502
|
+
debug23("migration: reverting machine state tables");
|
|
8958
9503
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8959
9504
|
switch (dbType) {
|
|
8960
9505
|
case "postgres": {
|
|
8961
|
-
|
|
9506
|
+
debug23("using postgres migration file");
|
|
8962
9507
|
const mig = new CreateMachineStateStore1708797018115();
|
|
8963
9508
|
await mig.down(queryRunner);
|
|
8964
|
-
|
|
9509
|
+
debug23("Migration statements executed");
|
|
8965
9510
|
return;
|
|
8966
9511
|
}
|
|
8967
9512
|
case "sqlite":
|
|
8968
9513
|
case "expo":
|
|
8969
9514
|
case "react-native": {
|
|
8970
|
-
|
|
9515
|
+
debug23("using sqlite/react-native migration file");
|
|
8971
9516
|
const mig = new CreateMachineStateStore1708796002272();
|
|
8972
9517
|
await mig.down(queryRunner);
|
|
8973
|
-
|
|
9518
|
+
debug23("Migration statements executed");
|
|
8974
9519
|
return;
|
|
8975
9520
|
}
|
|
8976
9521
|
default:
|
|
@@ -8980,7 +9525,7 @@ var CreateMachineStateStore1708098041262 = class {
|
|
|
8980
9525
|
};
|
|
8981
9526
|
|
|
8982
9527
|
// src/migrations/generic/8-CreateContacts.ts
|
|
8983
|
-
import
|
|
9528
|
+
import Debug24 from "debug";
|
|
8984
9529
|
|
|
8985
9530
|
// src/migrations/postgres/1710438363001-CreateContacts.ts
|
|
8986
9531
|
var CreateContacts1710438363001 = class {
|
|
@@ -9094,30 +9639,30 @@ var CreateContacts1710438363002 = class {
|
|
|
9094
9639
|
};
|
|
9095
9640
|
|
|
9096
9641
|
// src/migrations/generic/8-CreateContacts.ts
|
|
9097
|
-
var
|
|
9642
|
+
var debug24 = Debug24("sphereon:ssi-sdk:migrations");
|
|
9098
9643
|
var CreateContacts1708525189000 = class {
|
|
9099
9644
|
static {
|
|
9100
9645
|
__name(this, "CreateContacts1708525189000");
|
|
9101
9646
|
}
|
|
9102
9647
|
name = "CreateContacts1708525189000";
|
|
9103
9648
|
async up(queryRunner) {
|
|
9104
|
-
|
|
9649
|
+
debug24("migration: updating contact tables");
|
|
9105
9650
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9106
9651
|
switch (dbType) {
|
|
9107
9652
|
case "postgres": {
|
|
9108
|
-
|
|
9653
|
+
debug24("using postgres migration file");
|
|
9109
9654
|
const mig = new CreateContacts1710438363001();
|
|
9110
9655
|
await mig.up(queryRunner);
|
|
9111
|
-
|
|
9656
|
+
debug24("Migration statements executed");
|
|
9112
9657
|
return;
|
|
9113
9658
|
}
|
|
9114
9659
|
case "sqlite":
|
|
9115
9660
|
case "expo":
|
|
9116
9661
|
case "react-native": {
|
|
9117
|
-
|
|
9662
|
+
debug24("using sqlite/react-native migration file");
|
|
9118
9663
|
const mig = new CreateContacts1710438363002();
|
|
9119
9664
|
await mig.up(queryRunner);
|
|
9120
|
-
|
|
9665
|
+
debug24("Migration statements executed");
|
|
9121
9666
|
return;
|
|
9122
9667
|
}
|
|
9123
9668
|
default:
|
|
@@ -9125,23 +9670,23 @@ var CreateContacts1708525189000 = class {
|
|
|
9125
9670
|
}
|
|
9126
9671
|
}
|
|
9127
9672
|
async down(queryRunner) {
|
|
9128
|
-
|
|
9673
|
+
debug24("migration: reverting machine state tables");
|
|
9129
9674
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9130
9675
|
switch (dbType) {
|
|
9131
9676
|
case "postgres": {
|
|
9132
|
-
|
|
9677
|
+
debug24("using postgres migration file");
|
|
9133
9678
|
const mig = new CreateContacts1710438363001();
|
|
9134
9679
|
await mig.down(queryRunner);
|
|
9135
|
-
|
|
9680
|
+
debug24("Migration statements executed");
|
|
9136
9681
|
return;
|
|
9137
9682
|
}
|
|
9138
9683
|
case "sqlite":
|
|
9139
9684
|
case "expo":
|
|
9140
9685
|
case "react-native": {
|
|
9141
|
-
|
|
9686
|
+
debug24("using sqlite/react-native migration file");
|
|
9142
9687
|
const mig = new CreateContacts1710438363002();
|
|
9143
9688
|
await mig.down(queryRunner);
|
|
9144
|
-
|
|
9689
|
+
debug24("Migration statements executed");
|
|
9145
9690
|
return;
|
|
9146
9691
|
}
|
|
9147
9692
|
default:
|
|
@@ -9151,7 +9696,7 @@ var CreateContacts1708525189000 = class {
|
|
|
9151
9696
|
};
|
|
9152
9697
|
|
|
9153
9698
|
// src/migrations/generic/9-CreateContacts.ts
|
|
9154
|
-
import
|
|
9699
|
+
import Debug25 from "debug";
|
|
9155
9700
|
|
|
9156
9701
|
// src/migrations/postgres/1715761125001-CreateContacts.ts
|
|
9157
9702
|
var CreateContacts1715761125001 = class {
|
|
@@ -9263,30 +9808,30 @@ var CreateContacts1715761125002 = class {
|
|
|
9263
9808
|
};
|
|
9264
9809
|
|
|
9265
9810
|
// src/migrations/generic/9-CreateContacts.ts
|
|
9266
|
-
var
|
|
9811
|
+
var debug25 = Debug25("sphereon:ssi-sdk:migrations");
|
|
9267
9812
|
var CreateContacts1715761125000 = class {
|
|
9268
9813
|
static {
|
|
9269
9814
|
__name(this, "CreateContacts1715761125000");
|
|
9270
9815
|
}
|
|
9271
9816
|
name = "CreateContacts1715761125000";
|
|
9272
9817
|
async up(queryRunner) {
|
|
9273
|
-
|
|
9818
|
+
debug25("migration: updating contact tables");
|
|
9274
9819
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9275
9820
|
switch (dbType) {
|
|
9276
9821
|
case "postgres": {
|
|
9277
|
-
|
|
9822
|
+
debug25("using postgres migration file");
|
|
9278
9823
|
const mig = new CreateContacts1715761125001();
|
|
9279
9824
|
await mig.up(queryRunner);
|
|
9280
|
-
|
|
9825
|
+
debug25("Migration statements executed");
|
|
9281
9826
|
return;
|
|
9282
9827
|
}
|
|
9283
9828
|
case "sqlite":
|
|
9284
9829
|
case "expo":
|
|
9285
9830
|
case "react-native": {
|
|
9286
|
-
|
|
9831
|
+
debug25("using sqlite/react-native migration file");
|
|
9287
9832
|
const mig = new CreateContacts1715761125002();
|
|
9288
9833
|
await mig.up(queryRunner);
|
|
9289
|
-
|
|
9834
|
+
debug25("Migration statements executed");
|
|
9290
9835
|
return;
|
|
9291
9836
|
}
|
|
9292
9837
|
default:
|
|
@@ -9294,23 +9839,23 @@ var CreateContacts1715761125000 = class {
|
|
|
9294
9839
|
}
|
|
9295
9840
|
}
|
|
9296
9841
|
async down(queryRunner) {
|
|
9297
|
-
|
|
9842
|
+
debug25("migration: reverting machine state tables");
|
|
9298
9843
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9299
9844
|
switch (dbType) {
|
|
9300
9845
|
case "postgres": {
|
|
9301
|
-
|
|
9846
|
+
debug25("using postgres migration file");
|
|
9302
9847
|
const mig = new CreateContacts1715761125001();
|
|
9303
9848
|
await mig.down(queryRunner);
|
|
9304
|
-
|
|
9849
|
+
debug25("Migration statements executed");
|
|
9305
9850
|
return;
|
|
9306
9851
|
}
|
|
9307
9852
|
case "sqlite":
|
|
9308
9853
|
case "expo":
|
|
9309
9854
|
case "react-native": {
|
|
9310
|
-
|
|
9855
|
+
debug25("using sqlite/react-native migration file");
|
|
9311
9856
|
const mig = new CreateContacts1715761125002();
|
|
9312
9857
|
await mig.down(queryRunner);
|
|
9313
|
-
|
|
9858
|
+
debug25("Migration statements executed");
|
|
9314
9859
|
return;
|
|
9315
9860
|
}
|
|
9316
9861
|
default:
|
|
@@ -9328,7 +9873,8 @@ var DataStoreContactMigrations = [
|
|
|
9328
9873
|
];
|
|
9329
9874
|
var DataStoreIssuanceBrandingMigrations = [
|
|
9330
9875
|
CreateIssuanceBranding1659463079429,
|
|
9331
|
-
FixCredentialClaimsReferencesUuid1741895822987
|
|
9876
|
+
FixCredentialClaimsReferencesUuid1741895822987,
|
|
9877
|
+
AddBrandingState1766000000000
|
|
9332
9878
|
];
|
|
9333
9879
|
var DataStoreStatusListMigrations = [
|
|
9334
9880
|
CreateStatusList1693866470000,
|
|
@@ -9349,6 +9895,9 @@ var DataStorePresentationDefinitionMigrations = [
|
|
|
9349
9895
|
CreatePresentationDefinitions1716533767523,
|
|
9350
9896
|
CreateDcqlQueryItem1726617600000
|
|
9351
9897
|
];
|
|
9898
|
+
var DataStoreServiceMigrations = [
|
|
9899
|
+
AddServiceMetadata1764000000000
|
|
9900
|
+
];
|
|
9352
9901
|
var DataStoreMigrations = [
|
|
9353
9902
|
...DataStoreContactMigrations,
|
|
9354
9903
|
...DataStoreIssuanceBrandingMigrations,
|
|
@@ -9356,7 +9905,12 @@ var DataStoreMigrations = [
|
|
|
9356
9905
|
...DataStoreEventLoggerMigrations,
|
|
9357
9906
|
...DataStoreDigitalCredentialMigrations,
|
|
9358
9907
|
...DataStoreMachineStateMigrations,
|
|
9359
|
-
...DataStorePresentationDefinitionMigrations
|
|
9908
|
+
...DataStorePresentationDefinitionMigrations,
|
|
9909
|
+
...DataStoreServiceMigrations
|
|
9910
|
+
];
|
|
9911
|
+
var DataStoreMigrationsWithVeramo = [
|
|
9912
|
+
...VeramoDataStoreMigrations,
|
|
9913
|
+
...DataStoreMigrations
|
|
9360
9914
|
];
|
|
9361
9915
|
|
|
9362
9916
|
// src/utils/digitalCredential/MappingUtils.ts
|
|
@@ -9587,6 +10141,10 @@ var DataStoreEntities = [
|
|
|
9587
10141
|
...DataStoreMachineStateEntities,
|
|
9588
10142
|
...DataStorePresentationDefinitionEntities
|
|
9589
10143
|
];
|
|
10144
|
+
var DataStoreEntitiesWithVeramo = [
|
|
10145
|
+
...VeramoDataStoreEntities2,
|
|
10146
|
+
...DataStoreEntities
|
|
10147
|
+
];
|
|
9590
10148
|
export {
|
|
9591
10149
|
AbstractEventLoggerStore2 as AbstractEventLoggerStore,
|
|
9592
10150
|
AuditEventEntity,
|
|
@@ -9608,6 +10166,7 @@ export {
|
|
|
9608
10166
|
DataStoreDigitalCredentialEntities,
|
|
9609
10167
|
DataStoreDigitalCredentialMigrations,
|
|
9610
10168
|
DataStoreEntities,
|
|
10169
|
+
DataStoreEntitiesWithVeramo,
|
|
9611
10170
|
DataStoreEventLoggerEntities,
|
|
9612
10171
|
DataStoreEventLoggerMigrations,
|
|
9613
10172
|
DataStoreIssuanceBrandingEntities,
|
|
@@ -9615,9 +10174,11 @@ export {
|
|
|
9615
10174
|
DataStoreMachineStateEntities,
|
|
9616
10175
|
DataStoreMachineStateMigrations,
|
|
9617
10176
|
DataStoreMigrations,
|
|
10177
|
+
DataStoreMigrationsWithVeramo,
|
|
9618
10178
|
DataStoreOid4vcStateEntities,
|
|
9619
10179
|
DataStorePresentationDefinitionEntities,
|
|
9620
10180
|
DataStorePresentationDefinitionMigrations,
|
|
10181
|
+
DataStoreServiceMigrations,
|
|
9621
10182
|
DataStoreStatusListEntities,
|
|
9622
10183
|
DataStoreStatusListMigrations,
|
|
9623
10184
|
DcqlQueryItemEntity,
|
|
@@ -9646,6 +10207,8 @@ export {
|
|
|
9646
10207
|
StatusListEntryEntity,
|
|
9647
10208
|
StatusListStore,
|
|
9648
10209
|
TextAttributesEntity,
|
|
10210
|
+
VeramoDataStoreEntities,
|
|
10211
|
+
VeramoDataStoreMigrations,
|
|
9649
10212
|
activityEventEntityFrom,
|
|
9650
10213
|
activityEventFrom,
|
|
9651
10214
|
auditEventEntityFrom,
|
|
@@ -9663,6 +10226,7 @@ export {
|
|
|
9663
10226
|
credentialBrandingFrom,
|
|
9664
10227
|
credentialClaimsEntityFrom,
|
|
9665
10228
|
credentialLocaleBrandingEntityFrom,
|
|
10229
|
+
credentialLocaleBrandingFromEntity,
|
|
9666
10230
|
dcqlQueryEntityItemFrom,
|
|
9667
10231
|
dcqlQueryItemFrom,
|
|
9668
10232
|
didAuthConfigEntityFrom,
|