@sphereon/ssi-sdk.data-store 0.34.1-feature.SSISDK.78.280 → 0.34.1-feature.SSISDK.82.linkedVP.325
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 +262 -96
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -4
- package/dist/index.d.ts +7 -4
- package/dist/index.js +262 -96
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
- package/src/__tests__/digitalCredential.store.test.ts +116 -1
- package/src/digitalCredential/DigitalCredentialStore.ts +38 -0
- package/src/entities/digitalCredential/DigitalCredentialEntity.ts +6 -0
- package/src/migrations/generic/14-AddLinkedVpFields.ts +66 -0
- package/src/migrations/generic/index.ts +2 -1
- package/src/migrations/postgres/1741895823000-CreateBitstringStatusList.ts +1 -0
- package/src/migrations/postgres/1763387280001-AddLinkedVpFields.ts +29 -0
- package/src/migrations/sqlite/1763387280002-AddLinkedVpFields.ts +32 -0
package/dist/index.cjs
CHANGED
|
@@ -2071,6 +2071,8 @@ var DigitalCredentialEntity = class extends import_typeorm17.BaseEntity {
|
|
|
2071
2071
|
rpCorrelationId;
|
|
2072
2072
|
verifiedState;
|
|
2073
2073
|
tenantId;
|
|
2074
|
+
linkedVpId;
|
|
2075
|
+
linkedVpFrom;
|
|
2074
2076
|
createdAt;
|
|
2075
2077
|
presentedAt;
|
|
2076
2078
|
lastUpdatedAt;
|
|
@@ -2233,6 +2235,21 @@ _ts_decorate18([
|
|
|
2233
2235
|
}),
|
|
2234
2236
|
_ts_metadata17("design:type", String)
|
|
2235
2237
|
], DigitalCredentialEntity.prototype, "tenantId", void 0);
|
|
2238
|
+
_ts_decorate18([
|
|
2239
|
+
(0, import_typeorm17.Column)("text", {
|
|
2240
|
+
name: "linked_vp_id",
|
|
2241
|
+
nullable: true
|
|
2242
|
+
}),
|
|
2243
|
+
_ts_metadata17("design:type", String)
|
|
2244
|
+
], DigitalCredentialEntity.prototype, "linkedVpId", void 0);
|
|
2245
|
+
_ts_decorate18([
|
|
2246
|
+
(0, import_typeorm17.CreateDateColumn)({
|
|
2247
|
+
name: "linked_vp_from",
|
|
2248
|
+
nullable: true,
|
|
2249
|
+
type: (0, import_ssi_sdk14.typeOrmDateTime)()
|
|
2250
|
+
}),
|
|
2251
|
+
_ts_metadata17("design:type", typeof Date === "undefined" ? Object : Date)
|
|
2252
|
+
], DigitalCredentialEntity.prototype, "linkedVpFrom", void 0);
|
|
2236
2253
|
_ts_decorate18([
|
|
2237
2254
|
(0, import_typeorm17.CreateDateColumn)({
|
|
2238
2255
|
name: "created_at",
|
|
@@ -5430,6 +5447,37 @@ var DigitalCredentialStore = class extends import_ssi_sdk26.AbstractDigitalCrede
|
|
|
5430
5447
|
total
|
|
5431
5448
|
};
|
|
5432
5449
|
}, "getCredentials");
|
|
5450
|
+
updateCredential = /* @__PURE__ */ __name(async (args) => {
|
|
5451
|
+
const dcRepo = await this.getRepository();
|
|
5452
|
+
const whereClause = {};
|
|
5453
|
+
if ("id" in args) {
|
|
5454
|
+
whereClause.id = args.id;
|
|
5455
|
+
} else if ("hash" in args) {
|
|
5456
|
+
whereClause.hash = args.hash;
|
|
5457
|
+
} else {
|
|
5458
|
+
return Promise.reject(Error("No id or hash param is provided."));
|
|
5459
|
+
}
|
|
5460
|
+
const credential = await dcRepo.findOne({
|
|
5461
|
+
where: whereClause
|
|
5462
|
+
});
|
|
5463
|
+
if (!credential) {
|
|
5464
|
+
return Promise.reject(Error(`No credential found for args: ${JSON.stringify(whereClause)}`));
|
|
5465
|
+
}
|
|
5466
|
+
const { id, hash, ...updates } = args;
|
|
5467
|
+
const updatedCredential = {
|
|
5468
|
+
...credential,
|
|
5469
|
+
...updates,
|
|
5470
|
+
id: credential.id,
|
|
5471
|
+
hash: credential.hash,
|
|
5472
|
+
createdAt: credential.createdAt,
|
|
5473
|
+
lastUpdatedAt: /* @__PURE__ */ new Date()
|
|
5474
|
+
};
|
|
5475
|
+
debug2("Updating credential", updatedCredential);
|
|
5476
|
+
const updatedResult = await dcRepo.save(updatedCredential, {
|
|
5477
|
+
transaction: true
|
|
5478
|
+
});
|
|
5479
|
+
return digitalCredentialFrom(updatedResult);
|
|
5480
|
+
}, "updateCredential");
|
|
5433
5481
|
removeCredential = /* @__PURE__ */ __name(async (args) => {
|
|
5434
5482
|
if (!args) {
|
|
5435
5483
|
return false;
|
|
@@ -7560,6 +7608,7 @@ var CreateBitstringStatusListPG1741895823000 = class {
|
|
|
7560
7608
|
await queryRunner.query(`ALTER TABLE "StatusList" ADD CONSTRAINT "CHK_StatusList_type" CHECK ("type" IN ('StatusList2021', 'OAuthStatusList', 'BitstringStatusList'))`);
|
|
7561
7609
|
await queryRunner.query(`ALTER TABLE "StatusListEntry" ADD COLUMN "type" character varying NOT NULL DEFAULT 'StatusListEntryEntity'`);
|
|
7562
7610
|
await queryRunner.query(`ALTER TABLE "StatusListEntry" ADD COLUMN "statusPurpose" character varying`);
|
|
7611
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" ADD COLUMN "bitsPerStatus" integer DEFAULT 1`);
|
|
7563
7612
|
await queryRunner.query(`ALTER TABLE "StatusListEntry" ADD COLUMN "statusMessage" text`);
|
|
7564
7613
|
await queryRunner.query(`ALTER TABLE "StatusListEntry" ADD COLUMN "statusReference" text`);
|
|
7565
7614
|
await queryRunner.query(`ALTER TABLE "StatusListEntry" ADD CONSTRAINT "CHK_StatusListEntry_type" CHECK ("type" IN ('StatusListEntryEntity', 'bitstring'))`);
|
|
@@ -7897,32 +7946,148 @@ var CreateDcqlQueryItem1726617600000 = class {
|
|
|
7897
7946
|
}
|
|
7898
7947
|
};
|
|
7899
7948
|
|
|
7900
|
-
// src/migrations/generic/
|
|
7949
|
+
// src/migrations/generic/14-AddLinkedVpFields.ts
|
|
7901
7950
|
var import_debug13 = __toESM(require("debug"), 1);
|
|
7951
|
+
|
|
7952
|
+
// src/migrations/postgres/1763387280001-AddLinkedVpFields.ts
|
|
7953
|
+
var AddLinkedVpFields1763387280001 = class {
|
|
7954
|
+
static {
|
|
7955
|
+
__name(this, "AddLinkedVpFields1763387280001");
|
|
7956
|
+
}
|
|
7957
|
+
name = "AddLinkedVpFields1763387280001";
|
|
7958
|
+
async up(queryRunner) {
|
|
7959
|
+
await queryRunner.query(`
|
|
7960
|
+
ALTER TABLE "DigitalCredential"
|
|
7961
|
+
ADD COLUMN "linked_vp_id" text
|
|
7962
|
+
`);
|
|
7963
|
+
await queryRunner.query(`
|
|
7964
|
+
ALTER TABLE "DigitalCredential"
|
|
7965
|
+
ADD COLUMN "linked_vp_from" TIMESTAMP
|
|
7966
|
+
`);
|
|
7967
|
+
}
|
|
7968
|
+
async down(queryRunner) {
|
|
7969
|
+
await queryRunner.query(`
|
|
7970
|
+
ALTER TABLE "DigitalCredential"
|
|
7971
|
+
DROP COLUMN "linked_vp_from"
|
|
7972
|
+
`);
|
|
7973
|
+
await queryRunner.query(`
|
|
7974
|
+
ALTER TABLE "DigitalCredential"
|
|
7975
|
+
DROP COLUMN "linked_vp_id"
|
|
7976
|
+
`);
|
|
7977
|
+
}
|
|
7978
|
+
};
|
|
7979
|
+
|
|
7980
|
+
// src/migrations/sqlite/1763387280002-AddLinkedVpFields.ts
|
|
7981
|
+
var AddLinkedVpFields1763387280002 = class {
|
|
7982
|
+
static {
|
|
7983
|
+
__name(this, "AddLinkedVpFields1763387280002");
|
|
7984
|
+
}
|
|
7985
|
+
name = "AddLinkedVpFields1763387280002";
|
|
7986
|
+
async up(queryRunner) {
|
|
7987
|
+
await queryRunner.query(`
|
|
7988
|
+
ALTER TABLE "DigitalCredential"
|
|
7989
|
+
ADD COLUMN "linked_vp_id" text
|
|
7990
|
+
`);
|
|
7991
|
+
await queryRunner.query(`
|
|
7992
|
+
ALTER TABLE "DigitalCredential"
|
|
7993
|
+
ADD COLUMN "linked_vp_from" datetime
|
|
7994
|
+
`);
|
|
7995
|
+
}
|
|
7996
|
+
async down(queryRunner) {
|
|
7997
|
+
await queryRunner.query(`
|
|
7998
|
+
ALTER TABLE "DigitalCredential"
|
|
7999
|
+
DROP COLUMN "linked_vp_from"
|
|
8000
|
+
`);
|
|
8001
|
+
await queryRunner.query(`
|
|
8002
|
+
ALTER TABLE "DigitalCredential"
|
|
8003
|
+
DROP COLUMN "linked_vp_id"
|
|
8004
|
+
`);
|
|
8005
|
+
}
|
|
8006
|
+
};
|
|
8007
|
+
|
|
8008
|
+
// src/migrations/generic/14-AddLinkedVpFields.ts
|
|
7902
8009
|
var debug13 = (0, import_debug13.default)("sphereon:ssi-sdk:migrations");
|
|
8010
|
+
var AddLinkedVpFields1763387280000 = class {
|
|
8011
|
+
static {
|
|
8012
|
+
__name(this, "AddLinkedVpFields1763387280000");
|
|
8013
|
+
}
|
|
8014
|
+
name = "AddLinkedVpFields1763387280000";
|
|
8015
|
+
async up(queryRunner) {
|
|
8016
|
+
debug13("migration: adding linked VP fields to DigitalCredential table");
|
|
8017
|
+
const dbType = queryRunner.connection.driver.options.type;
|
|
8018
|
+
switch (dbType) {
|
|
8019
|
+
case "postgres": {
|
|
8020
|
+
debug13("using postgres migration file for AddLinkedVpFields");
|
|
8021
|
+
const mig = new AddLinkedVpFields1763387280001();
|
|
8022
|
+
await mig.up(queryRunner);
|
|
8023
|
+
debug13("Postgres migration statements for AddLinkedVpFields executed");
|
|
8024
|
+
return;
|
|
8025
|
+
}
|
|
8026
|
+
case "sqlite":
|
|
8027
|
+
case "expo":
|
|
8028
|
+
case "react-native": {
|
|
8029
|
+
debug13("using sqlite/react-native migration file for AddLinkedVpFields");
|
|
8030
|
+
const mig = new AddLinkedVpFields1763387280002();
|
|
8031
|
+
await mig.up(queryRunner);
|
|
8032
|
+
debug13("SQLite migration statements for AddLinkedVpFields executed");
|
|
8033
|
+
return;
|
|
8034
|
+
}
|
|
8035
|
+
default:
|
|
8036
|
+
return Promise.reject(`Migrations are currently only supported for sqlite, react-native, expo, and postgres for AddLinkedVpFields. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`);
|
|
8037
|
+
}
|
|
8038
|
+
}
|
|
8039
|
+
async down(queryRunner) {
|
|
8040
|
+
debug13("migration: reverting linked VP fields from DigitalCredential table");
|
|
8041
|
+
const dbType = queryRunner.connection.driver.options.type;
|
|
8042
|
+
switch (dbType) {
|
|
8043
|
+
case "postgres": {
|
|
8044
|
+
debug13("using postgres migration file for AddLinkedVpFields");
|
|
8045
|
+
const mig = new AddLinkedVpFields1763387280001();
|
|
8046
|
+
await mig.down(queryRunner);
|
|
8047
|
+
debug13("Postgres migration statements for AddLinkedVpFields reverted");
|
|
8048
|
+
return;
|
|
8049
|
+
}
|
|
8050
|
+
case "sqlite":
|
|
8051
|
+
case "expo":
|
|
8052
|
+
case "react-native": {
|
|
8053
|
+
debug13("using sqlite/react-native migration file for AddLinkedVpFields");
|
|
8054
|
+
const mig = new AddLinkedVpFields1763387280002();
|
|
8055
|
+
await mig.down(queryRunner);
|
|
8056
|
+
debug13("SQLite migration statements for AddLinkedVpFields reverted");
|
|
8057
|
+
return;
|
|
8058
|
+
}
|
|
8059
|
+
default:
|
|
8060
|
+
return Promise.reject(`Migrations are currently only supported for sqlite, react-native, expo, and postgres for AddLinkedVpFields. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`);
|
|
8061
|
+
}
|
|
8062
|
+
}
|
|
8063
|
+
};
|
|
8064
|
+
|
|
8065
|
+
// src/migrations/generic/2-CreateIssuanceBranding.ts
|
|
8066
|
+
var import_debug14 = __toESM(require("debug"), 1);
|
|
8067
|
+
var debug14 = (0, import_debug14.default)("sphereon:ssi-sdk:migrations");
|
|
7903
8068
|
var CreateIssuanceBranding1659463079429 = class {
|
|
7904
8069
|
static {
|
|
7905
8070
|
__name(this, "CreateIssuanceBranding1659463079429");
|
|
7906
8071
|
}
|
|
7907
8072
|
name = "CreateIssuanceBranding1659463079429";
|
|
7908
8073
|
async up(queryRunner) {
|
|
7909
|
-
|
|
8074
|
+
debug14("migration: creating issuance branding tables");
|
|
7910
8075
|
const dbType = queryRunner.connection.driver.options.type;
|
|
7911
8076
|
switch (dbType) {
|
|
7912
8077
|
case "postgres": {
|
|
7913
|
-
|
|
8078
|
+
debug14("using postgres migration file");
|
|
7914
8079
|
const mig = new CreateIssuanceBranding1685628974232();
|
|
7915
8080
|
await mig.up(queryRunner);
|
|
7916
|
-
|
|
8081
|
+
debug14("Migration statements executed");
|
|
7917
8082
|
return;
|
|
7918
8083
|
}
|
|
7919
8084
|
case "sqlite":
|
|
7920
8085
|
case "expo":
|
|
7921
8086
|
case "react-native": {
|
|
7922
|
-
|
|
8087
|
+
debug14("using sqlite/react-native migration file");
|
|
7923
8088
|
const mig = new CreateIssuanceBranding1685628973231();
|
|
7924
8089
|
await mig.up(queryRunner);
|
|
7925
|
-
|
|
8090
|
+
debug14("Migration statements executed");
|
|
7926
8091
|
return;
|
|
7927
8092
|
}
|
|
7928
8093
|
default:
|
|
@@ -7930,23 +8095,23 @@ var CreateIssuanceBranding1659463079429 = class {
|
|
|
7930
8095
|
}
|
|
7931
8096
|
}
|
|
7932
8097
|
async down(queryRunner) {
|
|
7933
|
-
|
|
8098
|
+
debug14("migration: reverting issuance branding tables");
|
|
7934
8099
|
const dbType = queryRunner.connection.driver.options.type;
|
|
7935
8100
|
switch (dbType) {
|
|
7936
8101
|
case "postgres": {
|
|
7937
|
-
|
|
8102
|
+
debug14("using postgres migration file");
|
|
7938
8103
|
const mig = new CreateIssuanceBranding1685628974232();
|
|
7939
8104
|
await mig.down(queryRunner);
|
|
7940
|
-
|
|
8105
|
+
debug14("Migration statements executed");
|
|
7941
8106
|
return;
|
|
7942
8107
|
}
|
|
7943
8108
|
case "sqlite":
|
|
7944
8109
|
case "expo":
|
|
7945
8110
|
case "react-native": {
|
|
7946
|
-
|
|
8111
|
+
debug14("using sqlite/react-native migration file");
|
|
7947
8112
|
const mig = new CreateIssuanceBranding1685628973231();
|
|
7948
8113
|
await mig.down(queryRunner);
|
|
7949
|
-
|
|
8114
|
+
debug14("Migration statements executed");
|
|
7950
8115
|
return;
|
|
7951
8116
|
}
|
|
7952
8117
|
default:
|
|
@@ -7956,7 +8121,7 @@ var CreateIssuanceBranding1659463079429 = class {
|
|
|
7956
8121
|
};
|
|
7957
8122
|
|
|
7958
8123
|
// src/migrations/generic/3-CreateContacts.ts
|
|
7959
|
-
var
|
|
8124
|
+
var import_debug15 = __toESM(require("debug"), 1);
|
|
7960
8125
|
|
|
7961
8126
|
// src/migrations/postgres/1690925872592-CreateContacts.ts
|
|
7962
8127
|
var import_ssi_sdk33 = require("@sphereon/ssi-sdk.core");
|
|
@@ -8177,30 +8342,30 @@ var CreateContacts1690925872693 = class {
|
|
|
8177
8342
|
};
|
|
8178
8343
|
|
|
8179
8344
|
// src/migrations/generic/3-CreateContacts.ts
|
|
8180
|
-
var
|
|
8345
|
+
var debug15 = (0, import_debug15.default)("sphereon:ssi-sdk:migrations");
|
|
8181
8346
|
var CreateContacts1690925872318 = class {
|
|
8182
8347
|
static {
|
|
8183
8348
|
__name(this, "CreateContacts1690925872318");
|
|
8184
8349
|
}
|
|
8185
8350
|
name = "CreateContacts1690925872318";
|
|
8186
8351
|
async up(queryRunner) {
|
|
8187
|
-
|
|
8352
|
+
debug15("migration: creating contacts tables");
|
|
8188
8353
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8189
8354
|
switch (dbType) {
|
|
8190
8355
|
case "postgres": {
|
|
8191
|
-
|
|
8356
|
+
debug15("using postgres migration file");
|
|
8192
8357
|
const mig = new CreateContacts1690925872592();
|
|
8193
8358
|
await mig.up(queryRunner);
|
|
8194
|
-
|
|
8359
|
+
debug15("Migration statements executed");
|
|
8195
8360
|
return;
|
|
8196
8361
|
}
|
|
8197
8362
|
case "sqlite":
|
|
8198
8363
|
case "expo":
|
|
8199
8364
|
case "react-native": {
|
|
8200
|
-
|
|
8365
|
+
debug15("using sqlite/react-native migration file");
|
|
8201
8366
|
const mig = new CreateContacts1690925872693();
|
|
8202
8367
|
await mig.up(queryRunner);
|
|
8203
|
-
|
|
8368
|
+
debug15("Migration statements executed");
|
|
8204
8369
|
return;
|
|
8205
8370
|
}
|
|
8206
8371
|
default:
|
|
@@ -8208,23 +8373,23 @@ var CreateContacts1690925872318 = class {
|
|
|
8208
8373
|
}
|
|
8209
8374
|
}
|
|
8210
8375
|
async down(queryRunner) {
|
|
8211
|
-
|
|
8376
|
+
debug15("migration: reverting contacts tables");
|
|
8212
8377
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8213
8378
|
switch (dbType) {
|
|
8214
8379
|
case "postgres": {
|
|
8215
|
-
|
|
8380
|
+
debug15("using postgres migration file");
|
|
8216
8381
|
const mig = new CreateContacts1690925872592();
|
|
8217
8382
|
await mig.down(queryRunner);
|
|
8218
|
-
|
|
8383
|
+
debug15("Migration statements executed");
|
|
8219
8384
|
return;
|
|
8220
8385
|
}
|
|
8221
8386
|
case "sqlite":
|
|
8222
8387
|
case "expo":
|
|
8223
8388
|
case "react-native": {
|
|
8224
|
-
|
|
8389
|
+
debug15("using sqlite/react-native migration file");
|
|
8225
8390
|
const mig = new CreateContacts1690925872693();
|
|
8226
8391
|
await mig.down(queryRunner);
|
|
8227
|
-
|
|
8392
|
+
debug15("Migration statements executed");
|
|
8228
8393
|
return;
|
|
8229
8394
|
}
|
|
8230
8395
|
default:
|
|
@@ -8234,7 +8399,7 @@ var CreateContacts1690925872318 = class {
|
|
|
8234
8399
|
};
|
|
8235
8400
|
|
|
8236
8401
|
// src/migrations/generic/4-CreateStatusList.ts
|
|
8237
|
-
var
|
|
8402
|
+
var import_debug16 = __toESM(require("debug"), 1);
|
|
8238
8403
|
|
|
8239
8404
|
// src/migrations/postgres/1693866470001-CreateStatusList.ts
|
|
8240
8405
|
var CreateStatusList1693866470001 = class {
|
|
@@ -8440,53 +8605,53 @@ var UpdateStatusList1737110469000 = class {
|
|
|
8440
8605
|
};
|
|
8441
8606
|
|
|
8442
8607
|
// src/migrations/generic/4-CreateStatusList.ts
|
|
8443
|
-
var
|
|
8608
|
+
var debug16 = (0, import_debug16.default)("sphereon:ssi-sdk:migrations");
|
|
8444
8609
|
var CreateStatusList1693866470000 = class {
|
|
8445
8610
|
static {
|
|
8446
8611
|
__name(this, "CreateStatusList1693866470000");
|
|
8447
8612
|
}
|
|
8448
8613
|
name = "CreateStatusList1693866470000";
|
|
8449
8614
|
async up(queryRunner) {
|
|
8450
|
-
|
|
8615
|
+
debug16("migration: creating issuance branding tables");
|
|
8451
8616
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8452
8617
|
if (dbType === "postgres") {
|
|
8453
|
-
|
|
8618
|
+
debug16("using postgres migration files");
|
|
8454
8619
|
const createMig = new CreateStatusList1693866470001();
|
|
8455
8620
|
await createMig.up(queryRunner);
|
|
8456
8621
|
const updateMig = new UpdateStatusList1737110469001();
|
|
8457
8622
|
const up = await updateMig.up(queryRunner);
|
|
8458
|
-
|
|
8623
|
+
debug16("Migration statements executed");
|
|
8459
8624
|
return up;
|
|
8460
8625
|
} else if (dbType === "sqlite" || dbType === "react-native" || dbType === "expo") {
|
|
8461
|
-
|
|
8626
|
+
debug16("using sqlite/react-native migration files");
|
|
8462
8627
|
const createMig = new CreateStatusList1693866470002();
|
|
8463
8628
|
await createMig.up(queryRunner);
|
|
8464
8629
|
const updateMig = new UpdateStatusList1737110469000();
|
|
8465
8630
|
const up = await updateMig.up(queryRunner);
|
|
8466
|
-
|
|
8631
|
+
debug16("Migration statements executed");
|
|
8467
8632
|
return up;
|
|
8468
8633
|
} else {
|
|
8469
8634
|
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`);
|
|
8470
8635
|
}
|
|
8471
8636
|
}
|
|
8472
8637
|
async down(queryRunner) {
|
|
8473
|
-
|
|
8638
|
+
debug16("migration: reverting issuance branding tables");
|
|
8474
8639
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8475
8640
|
if (dbType === "postgres") {
|
|
8476
|
-
|
|
8641
|
+
debug16("using postgres migration files");
|
|
8477
8642
|
const updateMig = new UpdateStatusList1737110469001();
|
|
8478
8643
|
await updateMig.down(queryRunner);
|
|
8479
8644
|
const createMig = new CreateStatusList1693866470001();
|
|
8480
8645
|
const down = await createMig.down(queryRunner);
|
|
8481
|
-
|
|
8646
|
+
debug16("Migration statements executed");
|
|
8482
8647
|
return down;
|
|
8483
8648
|
} else if (dbType === "sqlite" || dbType === "react-native" || dbType === "expo") {
|
|
8484
|
-
|
|
8649
|
+
debug16("using sqlite/react-native migration files");
|
|
8485
8650
|
const updateMig = new UpdateStatusList1737110469000();
|
|
8486
8651
|
await updateMig.down(queryRunner);
|
|
8487
8652
|
const createMig = new CreateStatusList1693866470002();
|
|
8488
8653
|
const down = await createMig.down(queryRunner);
|
|
8489
|
-
|
|
8654
|
+
debug16("Migration statements executed");
|
|
8490
8655
|
return down;
|
|
8491
8656
|
} else {
|
|
8492
8657
|
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`);
|
|
@@ -8495,7 +8660,7 @@ var CreateStatusList1693866470000 = class {
|
|
|
8495
8660
|
};
|
|
8496
8661
|
|
|
8497
8662
|
// src/migrations/generic/5-CreateAuditEvents.ts
|
|
8498
|
-
var
|
|
8663
|
+
var import_debug17 = __toESM(require("debug"), 1);
|
|
8499
8664
|
|
|
8500
8665
|
// src/migrations/postgres/1701634812183-CreateAuditEvents.ts
|
|
8501
8666
|
var CreateAuditEvents1701634812183 = class {
|
|
@@ -8594,30 +8759,30 @@ var CreateAuditEvents1701634819487 = class {
|
|
|
8594
8759
|
};
|
|
8595
8760
|
|
|
8596
8761
|
// src/migrations/generic/5-CreateAuditEvents.ts
|
|
8597
|
-
var
|
|
8762
|
+
var debug17 = (0, import_debug17.default)("sphereon:ssi-sdk:migrations");
|
|
8598
8763
|
var CreateAuditEvents1701635835330 = class {
|
|
8599
8764
|
static {
|
|
8600
8765
|
__name(this, "CreateAuditEvents1701635835330");
|
|
8601
8766
|
}
|
|
8602
8767
|
name = "CreateAuditEvents1701635835330";
|
|
8603
8768
|
async up(queryRunner) {
|
|
8604
|
-
|
|
8769
|
+
debug17("migration: creating audit events tables");
|
|
8605
8770
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8606
8771
|
switch (dbType) {
|
|
8607
8772
|
case "postgres": {
|
|
8608
|
-
|
|
8773
|
+
debug17("using postgres migration file");
|
|
8609
8774
|
const mig = new CreateAuditEvents1701634812183();
|
|
8610
8775
|
await mig.up(queryRunner);
|
|
8611
|
-
|
|
8776
|
+
debug17("Migration statements executed");
|
|
8612
8777
|
return;
|
|
8613
8778
|
}
|
|
8614
8779
|
case "sqlite":
|
|
8615
8780
|
case "expo":
|
|
8616
8781
|
case "react-native": {
|
|
8617
|
-
|
|
8782
|
+
debug17("using sqlite/react-native migration file");
|
|
8618
8783
|
const mig = new CreateAuditEvents1701634819487();
|
|
8619
8784
|
await mig.up(queryRunner);
|
|
8620
|
-
|
|
8785
|
+
debug17("Migration statements executed");
|
|
8621
8786
|
return;
|
|
8622
8787
|
}
|
|
8623
8788
|
default:
|
|
@@ -8625,23 +8790,23 @@ var CreateAuditEvents1701635835330 = class {
|
|
|
8625
8790
|
}
|
|
8626
8791
|
}
|
|
8627
8792
|
async down(queryRunner) {
|
|
8628
|
-
|
|
8793
|
+
debug17("migration: reverting audit events tables");
|
|
8629
8794
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8630
8795
|
switch (dbType) {
|
|
8631
8796
|
case "postgres": {
|
|
8632
|
-
|
|
8797
|
+
debug17("using postgres migration file");
|
|
8633
8798
|
const mig = new CreateAuditEvents1701634812183();
|
|
8634
8799
|
await mig.down(queryRunner);
|
|
8635
|
-
|
|
8800
|
+
debug17("Migration statements executed");
|
|
8636
8801
|
return;
|
|
8637
8802
|
}
|
|
8638
8803
|
case "sqlite":
|
|
8639
8804
|
case "expo":
|
|
8640
8805
|
case "react-native": {
|
|
8641
|
-
|
|
8806
|
+
debug17("using sqlite/react-native migration file");
|
|
8642
8807
|
const mig = new CreateAuditEvents1701634819487();
|
|
8643
8808
|
await mig.down(queryRunner);
|
|
8644
|
-
|
|
8809
|
+
debug17("Migration statements executed");
|
|
8645
8810
|
return;
|
|
8646
8811
|
}
|
|
8647
8812
|
default:
|
|
@@ -8651,7 +8816,7 @@ var CreateAuditEvents1701635835330 = class {
|
|
|
8651
8816
|
};
|
|
8652
8817
|
|
|
8653
8818
|
// src/migrations/generic/6-CreateDigitalCredential.ts
|
|
8654
|
-
var
|
|
8819
|
+
var import_debug18 = __toESM(require("debug"), 1);
|
|
8655
8820
|
|
|
8656
8821
|
// src/migrations/postgres/1708525189001-CreateDigitalCredential.ts
|
|
8657
8822
|
var CreateDigitalCredential1708525189001 = class {
|
|
@@ -8759,30 +8924,30 @@ var CreateDigitalCredential1708525189002 = class {
|
|
|
8759
8924
|
};
|
|
8760
8925
|
|
|
8761
8926
|
// src/migrations/generic/6-CreateDigitalCredential.ts
|
|
8762
|
-
var
|
|
8927
|
+
var debug18 = (0, import_debug18.default)("sphereon:ssi-sdk:migrations");
|
|
8763
8928
|
var CreateDigitalCredential1708525189000 = class {
|
|
8764
8929
|
static {
|
|
8765
8930
|
__name(this, "CreateDigitalCredential1708525189000");
|
|
8766
8931
|
}
|
|
8767
8932
|
name = "CreateDigitalCredential1708525189000";
|
|
8768
8933
|
async up(queryRunner) {
|
|
8769
|
-
|
|
8934
|
+
debug18("migration: creating DigitalCredential tables");
|
|
8770
8935
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8771
8936
|
switch (dbType) {
|
|
8772
8937
|
case "postgres": {
|
|
8773
|
-
|
|
8938
|
+
debug18("using postgres migration file for DigitalCredential");
|
|
8774
8939
|
const mig = new CreateDigitalCredential1708525189001();
|
|
8775
8940
|
await mig.up(queryRunner);
|
|
8776
|
-
|
|
8941
|
+
debug18("Postgres Migration statements for DigitalCredential executed");
|
|
8777
8942
|
return;
|
|
8778
8943
|
}
|
|
8779
8944
|
case "sqlite":
|
|
8780
8945
|
case "expo":
|
|
8781
8946
|
case "react-native": {
|
|
8782
|
-
|
|
8947
|
+
debug18("using sqlite/react-native migration file for DigitalCredential");
|
|
8783
8948
|
const mig = new CreateDigitalCredential1708525189002();
|
|
8784
8949
|
await mig.up(queryRunner);
|
|
8785
|
-
|
|
8950
|
+
debug18("SQLite Migration statements for DigitalCredential executed");
|
|
8786
8951
|
return;
|
|
8787
8952
|
}
|
|
8788
8953
|
default:
|
|
@@ -8790,23 +8955,23 @@ var CreateDigitalCredential1708525189000 = class {
|
|
|
8790
8955
|
}
|
|
8791
8956
|
}
|
|
8792
8957
|
async down(queryRunner) {
|
|
8793
|
-
|
|
8958
|
+
debug18("migration: reverting DigitalCredential tables");
|
|
8794
8959
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8795
8960
|
switch (dbType) {
|
|
8796
8961
|
case "postgres": {
|
|
8797
|
-
|
|
8962
|
+
debug18("using postgres migration file for DigitalCredential");
|
|
8798
8963
|
const mig = new CreateDigitalCredential1708525189001();
|
|
8799
8964
|
await mig.down(queryRunner);
|
|
8800
|
-
|
|
8965
|
+
debug18("Postgres Migration statements for DigitalCredential reverted");
|
|
8801
8966
|
return;
|
|
8802
8967
|
}
|
|
8803
8968
|
case "sqlite":
|
|
8804
8969
|
case "expo":
|
|
8805
8970
|
case "react-native": {
|
|
8806
|
-
|
|
8971
|
+
debug18("using sqlite/react-native migration file for DigitalCredential");
|
|
8807
8972
|
const mig = new CreateDigitalCredential1708525189002();
|
|
8808
8973
|
await mig.down(queryRunner);
|
|
8809
|
-
|
|
8974
|
+
debug18("SQLite Migration statements for DigitalCredential reverted");
|
|
8810
8975
|
return;
|
|
8811
8976
|
}
|
|
8812
8977
|
default:
|
|
@@ -8816,7 +8981,7 @@ var CreateDigitalCredential1708525189000 = class {
|
|
|
8816
8981
|
};
|
|
8817
8982
|
|
|
8818
8983
|
// src/migrations/generic/7-CreateMachineStateStore.ts
|
|
8819
|
-
var
|
|
8984
|
+
var import_debug19 = __toESM(require("debug"), 1);
|
|
8820
8985
|
|
|
8821
8986
|
// src/migrations/postgres/1708797018115-CreateMachineStateStore.ts
|
|
8822
8987
|
var CreateMachineStateStore1708797018115 = class {
|
|
@@ -8878,30 +9043,30 @@ var CreateMachineStateStore1708796002272 = class {
|
|
|
8878
9043
|
};
|
|
8879
9044
|
|
|
8880
9045
|
// src/migrations/generic/7-CreateMachineStateStore.ts
|
|
8881
|
-
var
|
|
9046
|
+
var debug19 = (0, import_debug19.default)("sphereon:ssi-sdk:migrations");
|
|
8882
9047
|
var CreateMachineStateStore1708098041262 = class {
|
|
8883
9048
|
static {
|
|
8884
9049
|
__name(this, "CreateMachineStateStore1708098041262");
|
|
8885
9050
|
}
|
|
8886
9051
|
name = "CreateMachineStateStore1708098041262";
|
|
8887
9052
|
async up(queryRunner) {
|
|
8888
|
-
|
|
9053
|
+
debug19("migration: creating machine state tables");
|
|
8889
9054
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8890
9055
|
switch (dbType) {
|
|
8891
9056
|
case "postgres": {
|
|
8892
|
-
|
|
9057
|
+
debug19("using postgres migration file");
|
|
8893
9058
|
const mig = new CreateMachineStateStore1708797018115();
|
|
8894
9059
|
await mig.up(queryRunner);
|
|
8895
|
-
|
|
9060
|
+
debug19("Migration statements executed");
|
|
8896
9061
|
return;
|
|
8897
9062
|
}
|
|
8898
9063
|
case "sqlite":
|
|
8899
9064
|
case "expo":
|
|
8900
9065
|
case "react-native": {
|
|
8901
|
-
|
|
9066
|
+
debug19("using sqlite/react-native migration file");
|
|
8902
9067
|
const mig = new CreateMachineStateStore1708796002272();
|
|
8903
9068
|
await mig.up(queryRunner);
|
|
8904
|
-
|
|
9069
|
+
debug19("Migration statements executed");
|
|
8905
9070
|
return;
|
|
8906
9071
|
}
|
|
8907
9072
|
default:
|
|
@@ -8909,23 +9074,23 @@ var CreateMachineStateStore1708098041262 = class {
|
|
|
8909
9074
|
}
|
|
8910
9075
|
}
|
|
8911
9076
|
async down(queryRunner) {
|
|
8912
|
-
|
|
9077
|
+
debug19("migration: reverting machine state tables");
|
|
8913
9078
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8914
9079
|
switch (dbType) {
|
|
8915
9080
|
case "postgres": {
|
|
8916
|
-
|
|
9081
|
+
debug19("using postgres migration file");
|
|
8917
9082
|
const mig = new CreateMachineStateStore1708797018115();
|
|
8918
9083
|
await mig.down(queryRunner);
|
|
8919
|
-
|
|
9084
|
+
debug19("Migration statements executed");
|
|
8920
9085
|
return;
|
|
8921
9086
|
}
|
|
8922
9087
|
case "sqlite":
|
|
8923
9088
|
case "expo":
|
|
8924
9089
|
case "react-native": {
|
|
8925
|
-
|
|
9090
|
+
debug19("using sqlite/react-native migration file");
|
|
8926
9091
|
const mig = new CreateMachineStateStore1708796002272();
|
|
8927
9092
|
await mig.down(queryRunner);
|
|
8928
|
-
|
|
9093
|
+
debug19("Migration statements executed");
|
|
8929
9094
|
return;
|
|
8930
9095
|
}
|
|
8931
9096
|
default:
|
|
@@ -8935,7 +9100,7 @@ var CreateMachineStateStore1708098041262 = class {
|
|
|
8935
9100
|
};
|
|
8936
9101
|
|
|
8937
9102
|
// src/migrations/generic/8-CreateContacts.ts
|
|
8938
|
-
var
|
|
9103
|
+
var import_debug20 = __toESM(require("debug"), 1);
|
|
8939
9104
|
|
|
8940
9105
|
// src/migrations/postgres/1710438363001-CreateContacts.ts
|
|
8941
9106
|
var CreateContacts1710438363001 = class {
|
|
@@ -9049,30 +9214,30 @@ var CreateContacts1710438363002 = class {
|
|
|
9049
9214
|
};
|
|
9050
9215
|
|
|
9051
9216
|
// src/migrations/generic/8-CreateContacts.ts
|
|
9052
|
-
var
|
|
9217
|
+
var debug20 = (0, import_debug20.default)("sphereon:ssi-sdk:migrations");
|
|
9053
9218
|
var CreateContacts1708525189000 = class {
|
|
9054
9219
|
static {
|
|
9055
9220
|
__name(this, "CreateContacts1708525189000");
|
|
9056
9221
|
}
|
|
9057
9222
|
name = "CreateContacts1708525189000";
|
|
9058
9223
|
async up(queryRunner) {
|
|
9059
|
-
|
|
9224
|
+
debug20("migration: updating contact tables");
|
|
9060
9225
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9061
9226
|
switch (dbType) {
|
|
9062
9227
|
case "postgres": {
|
|
9063
|
-
|
|
9228
|
+
debug20("using postgres migration file");
|
|
9064
9229
|
const mig = new CreateContacts1710438363001();
|
|
9065
9230
|
await mig.up(queryRunner);
|
|
9066
|
-
|
|
9231
|
+
debug20("Migration statements executed");
|
|
9067
9232
|
return;
|
|
9068
9233
|
}
|
|
9069
9234
|
case "sqlite":
|
|
9070
9235
|
case "expo":
|
|
9071
9236
|
case "react-native": {
|
|
9072
|
-
|
|
9237
|
+
debug20("using sqlite/react-native migration file");
|
|
9073
9238
|
const mig = new CreateContacts1710438363002();
|
|
9074
9239
|
await mig.up(queryRunner);
|
|
9075
|
-
|
|
9240
|
+
debug20("Migration statements executed");
|
|
9076
9241
|
return;
|
|
9077
9242
|
}
|
|
9078
9243
|
default:
|
|
@@ -9080,23 +9245,23 @@ var CreateContacts1708525189000 = class {
|
|
|
9080
9245
|
}
|
|
9081
9246
|
}
|
|
9082
9247
|
async down(queryRunner) {
|
|
9083
|
-
|
|
9248
|
+
debug20("migration: reverting machine state tables");
|
|
9084
9249
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9085
9250
|
switch (dbType) {
|
|
9086
9251
|
case "postgres": {
|
|
9087
|
-
|
|
9252
|
+
debug20("using postgres migration file");
|
|
9088
9253
|
const mig = new CreateContacts1710438363001();
|
|
9089
9254
|
await mig.down(queryRunner);
|
|
9090
|
-
|
|
9255
|
+
debug20("Migration statements executed");
|
|
9091
9256
|
return;
|
|
9092
9257
|
}
|
|
9093
9258
|
case "sqlite":
|
|
9094
9259
|
case "expo":
|
|
9095
9260
|
case "react-native": {
|
|
9096
|
-
|
|
9261
|
+
debug20("using sqlite/react-native migration file");
|
|
9097
9262
|
const mig = new CreateContacts1710438363002();
|
|
9098
9263
|
await mig.down(queryRunner);
|
|
9099
|
-
|
|
9264
|
+
debug20("Migration statements executed");
|
|
9100
9265
|
return;
|
|
9101
9266
|
}
|
|
9102
9267
|
default:
|
|
@@ -9106,7 +9271,7 @@ var CreateContacts1708525189000 = class {
|
|
|
9106
9271
|
};
|
|
9107
9272
|
|
|
9108
9273
|
// src/migrations/generic/9-CreateContacts.ts
|
|
9109
|
-
var
|
|
9274
|
+
var import_debug21 = __toESM(require("debug"), 1);
|
|
9110
9275
|
|
|
9111
9276
|
// src/migrations/postgres/1715761125001-CreateContacts.ts
|
|
9112
9277
|
var CreateContacts1715761125001 = class {
|
|
@@ -9218,30 +9383,30 @@ var CreateContacts1715761125002 = class {
|
|
|
9218
9383
|
};
|
|
9219
9384
|
|
|
9220
9385
|
// src/migrations/generic/9-CreateContacts.ts
|
|
9221
|
-
var
|
|
9386
|
+
var debug21 = (0, import_debug21.default)("sphereon:ssi-sdk:migrations");
|
|
9222
9387
|
var CreateContacts1715761125000 = class {
|
|
9223
9388
|
static {
|
|
9224
9389
|
__name(this, "CreateContacts1715761125000");
|
|
9225
9390
|
}
|
|
9226
9391
|
name = "CreateContacts1715761125000";
|
|
9227
9392
|
async up(queryRunner) {
|
|
9228
|
-
|
|
9393
|
+
debug21("migration: updating contact tables");
|
|
9229
9394
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9230
9395
|
switch (dbType) {
|
|
9231
9396
|
case "postgres": {
|
|
9232
|
-
|
|
9397
|
+
debug21("using postgres migration file");
|
|
9233
9398
|
const mig = new CreateContacts1715761125001();
|
|
9234
9399
|
await mig.up(queryRunner);
|
|
9235
|
-
|
|
9400
|
+
debug21("Migration statements executed");
|
|
9236
9401
|
return;
|
|
9237
9402
|
}
|
|
9238
9403
|
case "sqlite":
|
|
9239
9404
|
case "expo":
|
|
9240
9405
|
case "react-native": {
|
|
9241
|
-
|
|
9406
|
+
debug21("using sqlite/react-native migration file");
|
|
9242
9407
|
const mig = new CreateContacts1715761125002();
|
|
9243
9408
|
await mig.up(queryRunner);
|
|
9244
|
-
|
|
9409
|
+
debug21("Migration statements executed");
|
|
9245
9410
|
return;
|
|
9246
9411
|
}
|
|
9247
9412
|
default:
|
|
@@ -9249,23 +9414,23 @@ var CreateContacts1715761125000 = class {
|
|
|
9249
9414
|
}
|
|
9250
9415
|
}
|
|
9251
9416
|
async down(queryRunner) {
|
|
9252
|
-
|
|
9417
|
+
debug21("migration: reverting machine state tables");
|
|
9253
9418
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9254
9419
|
switch (dbType) {
|
|
9255
9420
|
case "postgres": {
|
|
9256
|
-
|
|
9421
|
+
debug21("using postgres migration file");
|
|
9257
9422
|
const mig = new CreateContacts1715761125001();
|
|
9258
9423
|
await mig.down(queryRunner);
|
|
9259
|
-
|
|
9424
|
+
debug21("Migration statements executed");
|
|
9260
9425
|
return;
|
|
9261
9426
|
}
|
|
9262
9427
|
case "sqlite":
|
|
9263
9428
|
case "expo":
|
|
9264
9429
|
case "react-native": {
|
|
9265
|
-
|
|
9430
|
+
debug21("using sqlite/react-native migration file");
|
|
9266
9431
|
const mig = new CreateContacts1715761125002();
|
|
9267
9432
|
await mig.down(queryRunner);
|
|
9268
|
-
|
|
9433
|
+
debug21("Migration statements executed");
|
|
9269
9434
|
return;
|
|
9270
9435
|
}
|
|
9271
9436
|
default:
|
|
@@ -9294,7 +9459,8 @@ var DataStoreEventLoggerMigrations = [
|
|
|
9294
9459
|
CreateAuditEvents1701635835330
|
|
9295
9460
|
];
|
|
9296
9461
|
var DataStoreDigitalCredentialMigrations = [
|
|
9297
|
-
CreateDigitalCredential1708525189000
|
|
9462
|
+
CreateDigitalCredential1708525189000,
|
|
9463
|
+
AddLinkedVpFields1763387280000
|
|
9298
9464
|
];
|
|
9299
9465
|
var DataStoreMachineStateMigrations = [
|
|
9300
9466
|
CreateMachineStateStore1708098041262
|