@sphereon/ssi-sdk.data-store 0.34.1-feature.SSISDK.78.306 → 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 +261 -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 +261 -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/1763387280001-AddLinkedVpFields.ts +29 -0
- package/src/migrations/sqlite/1763387280002-AddLinkedVpFields.ts +32 -0
package/dist/index.js
CHANGED
|
@@ -1922,6 +1922,8 @@ var DigitalCredentialEntity = class extends BaseEntity11 {
|
|
|
1922
1922
|
rpCorrelationId;
|
|
1923
1923
|
verifiedState;
|
|
1924
1924
|
tenantId;
|
|
1925
|
+
linkedVpId;
|
|
1926
|
+
linkedVpFrom;
|
|
1925
1927
|
createdAt;
|
|
1926
1928
|
presentedAt;
|
|
1927
1929
|
lastUpdatedAt;
|
|
@@ -2084,6 +2086,21 @@ _ts_decorate18([
|
|
|
2084
2086
|
}),
|
|
2085
2087
|
_ts_metadata17("design:type", String)
|
|
2086
2088
|
], DigitalCredentialEntity.prototype, "tenantId", void 0);
|
|
2089
|
+
_ts_decorate18([
|
|
2090
|
+
Column15("text", {
|
|
2091
|
+
name: "linked_vp_id",
|
|
2092
|
+
nullable: true
|
|
2093
|
+
}),
|
|
2094
|
+
_ts_metadata17("design:type", String)
|
|
2095
|
+
], DigitalCredentialEntity.prototype, "linkedVpId", void 0);
|
|
2096
|
+
_ts_decorate18([
|
|
2097
|
+
CreateDateColumn8({
|
|
2098
|
+
name: "linked_vp_from",
|
|
2099
|
+
nullable: true,
|
|
2100
|
+
type: typeOrmDateTime10()
|
|
2101
|
+
}),
|
|
2102
|
+
_ts_metadata17("design:type", typeof Date === "undefined" ? Object : Date)
|
|
2103
|
+
], DigitalCredentialEntity.prototype, "linkedVpFrom", void 0);
|
|
2087
2104
|
_ts_decorate18([
|
|
2088
2105
|
CreateDateColumn8({
|
|
2089
2106
|
name: "created_at",
|
|
@@ -5281,6 +5298,37 @@ var DigitalCredentialStore = class extends AbstractDigitalCredentialStore {
|
|
|
5281
5298
|
total
|
|
5282
5299
|
};
|
|
5283
5300
|
}, "getCredentials");
|
|
5301
|
+
updateCredential = /* @__PURE__ */ __name(async (args) => {
|
|
5302
|
+
const dcRepo = await this.getRepository();
|
|
5303
|
+
const whereClause = {};
|
|
5304
|
+
if ("id" in args) {
|
|
5305
|
+
whereClause.id = args.id;
|
|
5306
|
+
} else if ("hash" in args) {
|
|
5307
|
+
whereClause.hash = args.hash;
|
|
5308
|
+
} else {
|
|
5309
|
+
return Promise.reject(Error("No id or hash param is provided."));
|
|
5310
|
+
}
|
|
5311
|
+
const credential = await dcRepo.findOne({
|
|
5312
|
+
where: whereClause
|
|
5313
|
+
});
|
|
5314
|
+
if (!credential) {
|
|
5315
|
+
return Promise.reject(Error(`No credential found for args: ${JSON.stringify(whereClause)}`));
|
|
5316
|
+
}
|
|
5317
|
+
const { id, hash, ...updates } = args;
|
|
5318
|
+
const updatedCredential = {
|
|
5319
|
+
...credential,
|
|
5320
|
+
...updates,
|
|
5321
|
+
id: credential.id,
|
|
5322
|
+
hash: credential.hash,
|
|
5323
|
+
createdAt: credential.createdAt,
|
|
5324
|
+
lastUpdatedAt: /* @__PURE__ */ new Date()
|
|
5325
|
+
};
|
|
5326
|
+
debug2("Updating credential", updatedCredential);
|
|
5327
|
+
const updatedResult = await dcRepo.save(updatedCredential, {
|
|
5328
|
+
transaction: true
|
|
5329
|
+
});
|
|
5330
|
+
return digitalCredentialFrom(updatedResult);
|
|
5331
|
+
}, "updateCredential");
|
|
5284
5332
|
removeCredential = /* @__PURE__ */ __name(async (args) => {
|
|
5285
5333
|
if (!args) {
|
|
5286
5334
|
return false;
|
|
@@ -7749,32 +7797,148 @@ var CreateDcqlQueryItem1726617600000 = class {
|
|
|
7749
7797
|
}
|
|
7750
7798
|
};
|
|
7751
7799
|
|
|
7752
|
-
// src/migrations/generic/
|
|
7800
|
+
// src/migrations/generic/14-AddLinkedVpFields.ts
|
|
7753
7801
|
import Debug13 from "debug";
|
|
7802
|
+
|
|
7803
|
+
// src/migrations/postgres/1763387280001-AddLinkedVpFields.ts
|
|
7804
|
+
var AddLinkedVpFields1763387280001 = class {
|
|
7805
|
+
static {
|
|
7806
|
+
__name(this, "AddLinkedVpFields1763387280001");
|
|
7807
|
+
}
|
|
7808
|
+
name = "AddLinkedVpFields1763387280001";
|
|
7809
|
+
async up(queryRunner) {
|
|
7810
|
+
await queryRunner.query(`
|
|
7811
|
+
ALTER TABLE "DigitalCredential"
|
|
7812
|
+
ADD COLUMN "linked_vp_id" text
|
|
7813
|
+
`);
|
|
7814
|
+
await queryRunner.query(`
|
|
7815
|
+
ALTER TABLE "DigitalCredential"
|
|
7816
|
+
ADD COLUMN "linked_vp_from" TIMESTAMP
|
|
7817
|
+
`);
|
|
7818
|
+
}
|
|
7819
|
+
async down(queryRunner) {
|
|
7820
|
+
await queryRunner.query(`
|
|
7821
|
+
ALTER TABLE "DigitalCredential"
|
|
7822
|
+
DROP COLUMN "linked_vp_from"
|
|
7823
|
+
`);
|
|
7824
|
+
await queryRunner.query(`
|
|
7825
|
+
ALTER TABLE "DigitalCredential"
|
|
7826
|
+
DROP COLUMN "linked_vp_id"
|
|
7827
|
+
`);
|
|
7828
|
+
}
|
|
7829
|
+
};
|
|
7830
|
+
|
|
7831
|
+
// src/migrations/sqlite/1763387280002-AddLinkedVpFields.ts
|
|
7832
|
+
var AddLinkedVpFields1763387280002 = class {
|
|
7833
|
+
static {
|
|
7834
|
+
__name(this, "AddLinkedVpFields1763387280002");
|
|
7835
|
+
}
|
|
7836
|
+
name = "AddLinkedVpFields1763387280002";
|
|
7837
|
+
async up(queryRunner) {
|
|
7838
|
+
await queryRunner.query(`
|
|
7839
|
+
ALTER TABLE "DigitalCredential"
|
|
7840
|
+
ADD COLUMN "linked_vp_id" text
|
|
7841
|
+
`);
|
|
7842
|
+
await queryRunner.query(`
|
|
7843
|
+
ALTER TABLE "DigitalCredential"
|
|
7844
|
+
ADD COLUMN "linked_vp_from" datetime
|
|
7845
|
+
`);
|
|
7846
|
+
}
|
|
7847
|
+
async down(queryRunner) {
|
|
7848
|
+
await queryRunner.query(`
|
|
7849
|
+
ALTER TABLE "DigitalCredential"
|
|
7850
|
+
DROP COLUMN "linked_vp_from"
|
|
7851
|
+
`);
|
|
7852
|
+
await queryRunner.query(`
|
|
7853
|
+
ALTER TABLE "DigitalCredential"
|
|
7854
|
+
DROP COLUMN "linked_vp_id"
|
|
7855
|
+
`);
|
|
7856
|
+
}
|
|
7857
|
+
};
|
|
7858
|
+
|
|
7859
|
+
// src/migrations/generic/14-AddLinkedVpFields.ts
|
|
7754
7860
|
var debug13 = Debug13("sphereon:ssi-sdk:migrations");
|
|
7861
|
+
var AddLinkedVpFields1763387280000 = class {
|
|
7862
|
+
static {
|
|
7863
|
+
__name(this, "AddLinkedVpFields1763387280000");
|
|
7864
|
+
}
|
|
7865
|
+
name = "AddLinkedVpFields1763387280000";
|
|
7866
|
+
async up(queryRunner) {
|
|
7867
|
+
debug13("migration: adding linked VP fields to DigitalCredential table");
|
|
7868
|
+
const dbType = queryRunner.connection.driver.options.type;
|
|
7869
|
+
switch (dbType) {
|
|
7870
|
+
case "postgres": {
|
|
7871
|
+
debug13("using postgres migration file for AddLinkedVpFields");
|
|
7872
|
+
const mig = new AddLinkedVpFields1763387280001();
|
|
7873
|
+
await mig.up(queryRunner);
|
|
7874
|
+
debug13("Postgres migration statements for AddLinkedVpFields executed");
|
|
7875
|
+
return;
|
|
7876
|
+
}
|
|
7877
|
+
case "sqlite":
|
|
7878
|
+
case "expo":
|
|
7879
|
+
case "react-native": {
|
|
7880
|
+
debug13("using sqlite/react-native migration file for AddLinkedVpFields");
|
|
7881
|
+
const mig = new AddLinkedVpFields1763387280002();
|
|
7882
|
+
await mig.up(queryRunner);
|
|
7883
|
+
debug13("SQLite migration statements for AddLinkedVpFields executed");
|
|
7884
|
+
return;
|
|
7885
|
+
}
|
|
7886
|
+
default:
|
|
7887
|
+
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`);
|
|
7888
|
+
}
|
|
7889
|
+
}
|
|
7890
|
+
async down(queryRunner) {
|
|
7891
|
+
debug13("migration: reverting linked VP fields from DigitalCredential table");
|
|
7892
|
+
const dbType = queryRunner.connection.driver.options.type;
|
|
7893
|
+
switch (dbType) {
|
|
7894
|
+
case "postgres": {
|
|
7895
|
+
debug13("using postgres migration file for AddLinkedVpFields");
|
|
7896
|
+
const mig = new AddLinkedVpFields1763387280001();
|
|
7897
|
+
await mig.down(queryRunner);
|
|
7898
|
+
debug13("Postgres migration statements for AddLinkedVpFields reverted");
|
|
7899
|
+
return;
|
|
7900
|
+
}
|
|
7901
|
+
case "sqlite":
|
|
7902
|
+
case "expo":
|
|
7903
|
+
case "react-native": {
|
|
7904
|
+
debug13("using sqlite/react-native migration file for AddLinkedVpFields");
|
|
7905
|
+
const mig = new AddLinkedVpFields1763387280002();
|
|
7906
|
+
await mig.down(queryRunner);
|
|
7907
|
+
debug13("SQLite migration statements for AddLinkedVpFields reverted");
|
|
7908
|
+
return;
|
|
7909
|
+
}
|
|
7910
|
+
default:
|
|
7911
|
+
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`);
|
|
7912
|
+
}
|
|
7913
|
+
}
|
|
7914
|
+
};
|
|
7915
|
+
|
|
7916
|
+
// src/migrations/generic/2-CreateIssuanceBranding.ts
|
|
7917
|
+
import Debug14 from "debug";
|
|
7918
|
+
var debug14 = Debug14("sphereon:ssi-sdk:migrations");
|
|
7755
7919
|
var CreateIssuanceBranding1659463079429 = class {
|
|
7756
7920
|
static {
|
|
7757
7921
|
__name(this, "CreateIssuanceBranding1659463079429");
|
|
7758
7922
|
}
|
|
7759
7923
|
name = "CreateIssuanceBranding1659463079429";
|
|
7760
7924
|
async up(queryRunner) {
|
|
7761
|
-
|
|
7925
|
+
debug14("migration: creating issuance branding tables");
|
|
7762
7926
|
const dbType = queryRunner.connection.driver.options.type;
|
|
7763
7927
|
switch (dbType) {
|
|
7764
7928
|
case "postgres": {
|
|
7765
|
-
|
|
7929
|
+
debug14("using postgres migration file");
|
|
7766
7930
|
const mig = new CreateIssuanceBranding1685628974232();
|
|
7767
7931
|
await mig.up(queryRunner);
|
|
7768
|
-
|
|
7932
|
+
debug14("Migration statements executed");
|
|
7769
7933
|
return;
|
|
7770
7934
|
}
|
|
7771
7935
|
case "sqlite":
|
|
7772
7936
|
case "expo":
|
|
7773
7937
|
case "react-native": {
|
|
7774
|
-
|
|
7938
|
+
debug14("using sqlite/react-native migration file");
|
|
7775
7939
|
const mig = new CreateIssuanceBranding1685628973231();
|
|
7776
7940
|
await mig.up(queryRunner);
|
|
7777
|
-
|
|
7941
|
+
debug14("Migration statements executed");
|
|
7778
7942
|
return;
|
|
7779
7943
|
}
|
|
7780
7944
|
default:
|
|
@@ -7782,23 +7946,23 @@ var CreateIssuanceBranding1659463079429 = class {
|
|
|
7782
7946
|
}
|
|
7783
7947
|
}
|
|
7784
7948
|
async down(queryRunner) {
|
|
7785
|
-
|
|
7949
|
+
debug14("migration: reverting issuance branding tables");
|
|
7786
7950
|
const dbType = queryRunner.connection.driver.options.type;
|
|
7787
7951
|
switch (dbType) {
|
|
7788
7952
|
case "postgres": {
|
|
7789
|
-
|
|
7953
|
+
debug14("using postgres migration file");
|
|
7790
7954
|
const mig = new CreateIssuanceBranding1685628974232();
|
|
7791
7955
|
await mig.down(queryRunner);
|
|
7792
|
-
|
|
7956
|
+
debug14("Migration statements executed");
|
|
7793
7957
|
return;
|
|
7794
7958
|
}
|
|
7795
7959
|
case "sqlite":
|
|
7796
7960
|
case "expo":
|
|
7797
7961
|
case "react-native": {
|
|
7798
|
-
|
|
7962
|
+
debug14("using sqlite/react-native migration file");
|
|
7799
7963
|
const mig = new CreateIssuanceBranding1685628973231();
|
|
7800
7964
|
await mig.down(queryRunner);
|
|
7801
|
-
|
|
7965
|
+
debug14("Migration statements executed");
|
|
7802
7966
|
return;
|
|
7803
7967
|
}
|
|
7804
7968
|
default:
|
|
@@ -7808,7 +7972,7 @@ var CreateIssuanceBranding1659463079429 = class {
|
|
|
7808
7972
|
};
|
|
7809
7973
|
|
|
7810
7974
|
// src/migrations/generic/3-CreateContacts.ts
|
|
7811
|
-
import
|
|
7975
|
+
import Debug15 from "debug";
|
|
7812
7976
|
|
|
7813
7977
|
// src/migrations/postgres/1690925872592-CreateContacts.ts
|
|
7814
7978
|
import { enablePostgresUuidExtension as enablePostgresUuidExtension3 } from "@sphereon/ssi-sdk.core";
|
|
@@ -8029,30 +8193,30 @@ var CreateContacts1690925872693 = class {
|
|
|
8029
8193
|
};
|
|
8030
8194
|
|
|
8031
8195
|
// src/migrations/generic/3-CreateContacts.ts
|
|
8032
|
-
var
|
|
8196
|
+
var debug15 = Debug15("sphereon:ssi-sdk:migrations");
|
|
8033
8197
|
var CreateContacts1690925872318 = class {
|
|
8034
8198
|
static {
|
|
8035
8199
|
__name(this, "CreateContacts1690925872318");
|
|
8036
8200
|
}
|
|
8037
8201
|
name = "CreateContacts1690925872318";
|
|
8038
8202
|
async up(queryRunner) {
|
|
8039
|
-
|
|
8203
|
+
debug15("migration: creating contacts tables");
|
|
8040
8204
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8041
8205
|
switch (dbType) {
|
|
8042
8206
|
case "postgres": {
|
|
8043
|
-
|
|
8207
|
+
debug15("using postgres migration file");
|
|
8044
8208
|
const mig = new CreateContacts1690925872592();
|
|
8045
8209
|
await mig.up(queryRunner);
|
|
8046
|
-
|
|
8210
|
+
debug15("Migration statements executed");
|
|
8047
8211
|
return;
|
|
8048
8212
|
}
|
|
8049
8213
|
case "sqlite":
|
|
8050
8214
|
case "expo":
|
|
8051
8215
|
case "react-native": {
|
|
8052
|
-
|
|
8216
|
+
debug15("using sqlite/react-native migration file");
|
|
8053
8217
|
const mig = new CreateContacts1690925872693();
|
|
8054
8218
|
await mig.up(queryRunner);
|
|
8055
|
-
|
|
8219
|
+
debug15("Migration statements executed");
|
|
8056
8220
|
return;
|
|
8057
8221
|
}
|
|
8058
8222
|
default:
|
|
@@ -8060,23 +8224,23 @@ var CreateContacts1690925872318 = class {
|
|
|
8060
8224
|
}
|
|
8061
8225
|
}
|
|
8062
8226
|
async down(queryRunner) {
|
|
8063
|
-
|
|
8227
|
+
debug15("migration: reverting contacts tables");
|
|
8064
8228
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8065
8229
|
switch (dbType) {
|
|
8066
8230
|
case "postgres": {
|
|
8067
|
-
|
|
8231
|
+
debug15("using postgres migration file");
|
|
8068
8232
|
const mig = new CreateContacts1690925872592();
|
|
8069
8233
|
await mig.down(queryRunner);
|
|
8070
|
-
|
|
8234
|
+
debug15("Migration statements executed");
|
|
8071
8235
|
return;
|
|
8072
8236
|
}
|
|
8073
8237
|
case "sqlite":
|
|
8074
8238
|
case "expo":
|
|
8075
8239
|
case "react-native": {
|
|
8076
|
-
|
|
8240
|
+
debug15("using sqlite/react-native migration file");
|
|
8077
8241
|
const mig = new CreateContacts1690925872693();
|
|
8078
8242
|
await mig.down(queryRunner);
|
|
8079
|
-
|
|
8243
|
+
debug15("Migration statements executed");
|
|
8080
8244
|
return;
|
|
8081
8245
|
}
|
|
8082
8246
|
default:
|
|
@@ -8086,7 +8250,7 @@ var CreateContacts1690925872318 = class {
|
|
|
8086
8250
|
};
|
|
8087
8251
|
|
|
8088
8252
|
// src/migrations/generic/4-CreateStatusList.ts
|
|
8089
|
-
import
|
|
8253
|
+
import Debug16 from "debug";
|
|
8090
8254
|
|
|
8091
8255
|
// src/migrations/postgres/1693866470001-CreateStatusList.ts
|
|
8092
8256
|
var CreateStatusList1693866470001 = class {
|
|
@@ -8292,53 +8456,53 @@ var UpdateStatusList1737110469000 = class {
|
|
|
8292
8456
|
};
|
|
8293
8457
|
|
|
8294
8458
|
// src/migrations/generic/4-CreateStatusList.ts
|
|
8295
|
-
var
|
|
8459
|
+
var debug16 = Debug16("sphereon:ssi-sdk:migrations");
|
|
8296
8460
|
var CreateStatusList1693866470000 = class {
|
|
8297
8461
|
static {
|
|
8298
8462
|
__name(this, "CreateStatusList1693866470000");
|
|
8299
8463
|
}
|
|
8300
8464
|
name = "CreateStatusList1693866470000";
|
|
8301
8465
|
async up(queryRunner) {
|
|
8302
|
-
|
|
8466
|
+
debug16("migration: creating issuance branding tables");
|
|
8303
8467
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8304
8468
|
if (dbType === "postgres") {
|
|
8305
|
-
|
|
8469
|
+
debug16("using postgres migration files");
|
|
8306
8470
|
const createMig = new CreateStatusList1693866470001();
|
|
8307
8471
|
await createMig.up(queryRunner);
|
|
8308
8472
|
const updateMig = new UpdateStatusList1737110469001();
|
|
8309
8473
|
const up = await updateMig.up(queryRunner);
|
|
8310
|
-
|
|
8474
|
+
debug16("Migration statements executed");
|
|
8311
8475
|
return up;
|
|
8312
8476
|
} else if (dbType === "sqlite" || dbType === "react-native" || dbType === "expo") {
|
|
8313
|
-
|
|
8477
|
+
debug16("using sqlite/react-native migration files");
|
|
8314
8478
|
const createMig = new CreateStatusList1693866470002();
|
|
8315
8479
|
await createMig.up(queryRunner);
|
|
8316
8480
|
const updateMig = new UpdateStatusList1737110469000();
|
|
8317
8481
|
const up = await updateMig.up(queryRunner);
|
|
8318
|
-
|
|
8482
|
+
debug16("Migration statements executed");
|
|
8319
8483
|
return up;
|
|
8320
8484
|
} else {
|
|
8321
8485
|
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`);
|
|
8322
8486
|
}
|
|
8323
8487
|
}
|
|
8324
8488
|
async down(queryRunner) {
|
|
8325
|
-
|
|
8489
|
+
debug16("migration: reverting issuance branding tables");
|
|
8326
8490
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8327
8491
|
if (dbType === "postgres") {
|
|
8328
|
-
|
|
8492
|
+
debug16("using postgres migration files");
|
|
8329
8493
|
const updateMig = new UpdateStatusList1737110469001();
|
|
8330
8494
|
await updateMig.down(queryRunner);
|
|
8331
8495
|
const createMig = new CreateStatusList1693866470001();
|
|
8332
8496
|
const down = await createMig.down(queryRunner);
|
|
8333
|
-
|
|
8497
|
+
debug16("Migration statements executed");
|
|
8334
8498
|
return down;
|
|
8335
8499
|
} else if (dbType === "sqlite" || dbType === "react-native" || dbType === "expo") {
|
|
8336
|
-
|
|
8500
|
+
debug16("using sqlite/react-native migration files");
|
|
8337
8501
|
const updateMig = new UpdateStatusList1737110469000();
|
|
8338
8502
|
await updateMig.down(queryRunner);
|
|
8339
8503
|
const createMig = new CreateStatusList1693866470002();
|
|
8340
8504
|
const down = await createMig.down(queryRunner);
|
|
8341
|
-
|
|
8505
|
+
debug16("Migration statements executed");
|
|
8342
8506
|
return down;
|
|
8343
8507
|
} else {
|
|
8344
8508
|
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`);
|
|
@@ -8347,7 +8511,7 @@ var CreateStatusList1693866470000 = class {
|
|
|
8347
8511
|
};
|
|
8348
8512
|
|
|
8349
8513
|
// src/migrations/generic/5-CreateAuditEvents.ts
|
|
8350
|
-
import
|
|
8514
|
+
import Debug17 from "debug";
|
|
8351
8515
|
|
|
8352
8516
|
// src/migrations/postgres/1701634812183-CreateAuditEvents.ts
|
|
8353
8517
|
var CreateAuditEvents1701634812183 = class {
|
|
@@ -8446,30 +8610,30 @@ var CreateAuditEvents1701634819487 = class {
|
|
|
8446
8610
|
};
|
|
8447
8611
|
|
|
8448
8612
|
// src/migrations/generic/5-CreateAuditEvents.ts
|
|
8449
|
-
var
|
|
8613
|
+
var debug17 = Debug17("sphereon:ssi-sdk:migrations");
|
|
8450
8614
|
var CreateAuditEvents1701635835330 = class {
|
|
8451
8615
|
static {
|
|
8452
8616
|
__name(this, "CreateAuditEvents1701635835330");
|
|
8453
8617
|
}
|
|
8454
8618
|
name = "CreateAuditEvents1701635835330";
|
|
8455
8619
|
async up(queryRunner) {
|
|
8456
|
-
|
|
8620
|
+
debug17("migration: creating audit events tables");
|
|
8457
8621
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8458
8622
|
switch (dbType) {
|
|
8459
8623
|
case "postgres": {
|
|
8460
|
-
|
|
8624
|
+
debug17("using postgres migration file");
|
|
8461
8625
|
const mig = new CreateAuditEvents1701634812183();
|
|
8462
8626
|
await mig.up(queryRunner);
|
|
8463
|
-
|
|
8627
|
+
debug17("Migration statements executed");
|
|
8464
8628
|
return;
|
|
8465
8629
|
}
|
|
8466
8630
|
case "sqlite":
|
|
8467
8631
|
case "expo":
|
|
8468
8632
|
case "react-native": {
|
|
8469
|
-
|
|
8633
|
+
debug17("using sqlite/react-native migration file");
|
|
8470
8634
|
const mig = new CreateAuditEvents1701634819487();
|
|
8471
8635
|
await mig.up(queryRunner);
|
|
8472
|
-
|
|
8636
|
+
debug17("Migration statements executed");
|
|
8473
8637
|
return;
|
|
8474
8638
|
}
|
|
8475
8639
|
default:
|
|
@@ -8477,23 +8641,23 @@ var CreateAuditEvents1701635835330 = class {
|
|
|
8477
8641
|
}
|
|
8478
8642
|
}
|
|
8479
8643
|
async down(queryRunner) {
|
|
8480
|
-
|
|
8644
|
+
debug17("migration: reverting audit events tables");
|
|
8481
8645
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8482
8646
|
switch (dbType) {
|
|
8483
8647
|
case "postgres": {
|
|
8484
|
-
|
|
8648
|
+
debug17("using postgres migration file");
|
|
8485
8649
|
const mig = new CreateAuditEvents1701634812183();
|
|
8486
8650
|
await mig.down(queryRunner);
|
|
8487
|
-
|
|
8651
|
+
debug17("Migration statements executed");
|
|
8488
8652
|
return;
|
|
8489
8653
|
}
|
|
8490
8654
|
case "sqlite":
|
|
8491
8655
|
case "expo":
|
|
8492
8656
|
case "react-native": {
|
|
8493
|
-
|
|
8657
|
+
debug17("using sqlite/react-native migration file");
|
|
8494
8658
|
const mig = new CreateAuditEvents1701634819487();
|
|
8495
8659
|
await mig.down(queryRunner);
|
|
8496
|
-
|
|
8660
|
+
debug17("Migration statements executed");
|
|
8497
8661
|
return;
|
|
8498
8662
|
}
|
|
8499
8663
|
default:
|
|
@@ -8503,7 +8667,7 @@ var CreateAuditEvents1701635835330 = class {
|
|
|
8503
8667
|
};
|
|
8504
8668
|
|
|
8505
8669
|
// src/migrations/generic/6-CreateDigitalCredential.ts
|
|
8506
|
-
import
|
|
8670
|
+
import Debug18 from "debug";
|
|
8507
8671
|
|
|
8508
8672
|
// src/migrations/postgres/1708525189001-CreateDigitalCredential.ts
|
|
8509
8673
|
var CreateDigitalCredential1708525189001 = class {
|
|
@@ -8611,30 +8775,30 @@ var CreateDigitalCredential1708525189002 = class {
|
|
|
8611
8775
|
};
|
|
8612
8776
|
|
|
8613
8777
|
// src/migrations/generic/6-CreateDigitalCredential.ts
|
|
8614
|
-
var
|
|
8778
|
+
var debug18 = Debug18("sphereon:ssi-sdk:migrations");
|
|
8615
8779
|
var CreateDigitalCredential1708525189000 = class {
|
|
8616
8780
|
static {
|
|
8617
8781
|
__name(this, "CreateDigitalCredential1708525189000");
|
|
8618
8782
|
}
|
|
8619
8783
|
name = "CreateDigitalCredential1708525189000";
|
|
8620
8784
|
async up(queryRunner) {
|
|
8621
|
-
|
|
8785
|
+
debug18("migration: creating DigitalCredential tables");
|
|
8622
8786
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8623
8787
|
switch (dbType) {
|
|
8624
8788
|
case "postgres": {
|
|
8625
|
-
|
|
8789
|
+
debug18("using postgres migration file for DigitalCredential");
|
|
8626
8790
|
const mig = new CreateDigitalCredential1708525189001();
|
|
8627
8791
|
await mig.up(queryRunner);
|
|
8628
|
-
|
|
8792
|
+
debug18("Postgres Migration statements for DigitalCredential executed");
|
|
8629
8793
|
return;
|
|
8630
8794
|
}
|
|
8631
8795
|
case "sqlite":
|
|
8632
8796
|
case "expo":
|
|
8633
8797
|
case "react-native": {
|
|
8634
|
-
|
|
8798
|
+
debug18("using sqlite/react-native migration file for DigitalCredential");
|
|
8635
8799
|
const mig = new CreateDigitalCredential1708525189002();
|
|
8636
8800
|
await mig.up(queryRunner);
|
|
8637
|
-
|
|
8801
|
+
debug18("SQLite Migration statements for DigitalCredential executed");
|
|
8638
8802
|
return;
|
|
8639
8803
|
}
|
|
8640
8804
|
default:
|
|
@@ -8642,23 +8806,23 @@ var CreateDigitalCredential1708525189000 = class {
|
|
|
8642
8806
|
}
|
|
8643
8807
|
}
|
|
8644
8808
|
async down(queryRunner) {
|
|
8645
|
-
|
|
8809
|
+
debug18("migration: reverting DigitalCredential tables");
|
|
8646
8810
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8647
8811
|
switch (dbType) {
|
|
8648
8812
|
case "postgres": {
|
|
8649
|
-
|
|
8813
|
+
debug18("using postgres migration file for DigitalCredential");
|
|
8650
8814
|
const mig = new CreateDigitalCredential1708525189001();
|
|
8651
8815
|
await mig.down(queryRunner);
|
|
8652
|
-
|
|
8816
|
+
debug18("Postgres Migration statements for DigitalCredential reverted");
|
|
8653
8817
|
return;
|
|
8654
8818
|
}
|
|
8655
8819
|
case "sqlite":
|
|
8656
8820
|
case "expo":
|
|
8657
8821
|
case "react-native": {
|
|
8658
|
-
|
|
8822
|
+
debug18("using sqlite/react-native migration file for DigitalCredential");
|
|
8659
8823
|
const mig = new CreateDigitalCredential1708525189002();
|
|
8660
8824
|
await mig.down(queryRunner);
|
|
8661
|
-
|
|
8825
|
+
debug18("SQLite Migration statements for DigitalCredential reverted");
|
|
8662
8826
|
return;
|
|
8663
8827
|
}
|
|
8664
8828
|
default:
|
|
@@ -8668,7 +8832,7 @@ var CreateDigitalCredential1708525189000 = class {
|
|
|
8668
8832
|
};
|
|
8669
8833
|
|
|
8670
8834
|
// src/migrations/generic/7-CreateMachineStateStore.ts
|
|
8671
|
-
import
|
|
8835
|
+
import Debug19 from "debug";
|
|
8672
8836
|
|
|
8673
8837
|
// src/migrations/postgres/1708797018115-CreateMachineStateStore.ts
|
|
8674
8838
|
var CreateMachineStateStore1708797018115 = class {
|
|
@@ -8730,30 +8894,30 @@ var CreateMachineStateStore1708796002272 = class {
|
|
|
8730
8894
|
};
|
|
8731
8895
|
|
|
8732
8896
|
// src/migrations/generic/7-CreateMachineStateStore.ts
|
|
8733
|
-
var
|
|
8897
|
+
var debug19 = Debug19("sphereon:ssi-sdk:migrations");
|
|
8734
8898
|
var CreateMachineStateStore1708098041262 = class {
|
|
8735
8899
|
static {
|
|
8736
8900
|
__name(this, "CreateMachineStateStore1708098041262");
|
|
8737
8901
|
}
|
|
8738
8902
|
name = "CreateMachineStateStore1708098041262";
|
|
8739
8903
|
async up(queryRunner) {
|
|
8740
|
-
|
|
8904
|
+
debug19("migration: creating machine state tables");
|
|
8741
8905
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8742
8906
|
switch (dbType) {
|
|
8743
8907
|
case "postgres": {
|
|
8744
|
-
|
|
8908
|
+
debug19("using postgres migration file");
|
|
8745
8909
|
const mig = new CreateMachineStateStore1708797018115();
|
|
8746
8910
|
await mig.up(queryRunner);
|
|
8747
|
-
|
|
8911
|
+
debug19("Migration statements executed");
|
|
8748
8912
|
return;
|
|
8749
8913
|
}
|
|
8750
8914
|
case "sqlite":
|
|
8751
8915
|
case "expo":
|
|
8752
8916
|
case "react-native": {
|
|
8753
|
-
|
|
8917
|
+
debug19("using sqlite/react-native migration file");
|
|
8754
8918
|
const mig = new CreateMachineStateStore1708796002272();
|
|
8755
8919
|
await mig.up(queryRunner);
|
|
8756
|
-
|
|
8920
|
+
debug19("Migration statements executed");
|
|
8757
8921
|
return;
|
|
8758
8922
|
}
|
|
8759
8923
|
default:
|
|
@@ -8761,23 +8925,23 @@ var CreateMachineStateStore1708098041262 = class {
|
|
|
8761
8925
|
}
|
|
8762
8926
|
}
|
|
8763
8927
|
async down(queryRunner) {
|
|
8764
|
-
|
|
8928
|
+
debug19("migration: reverting machine state tables");
|
|
8765
8929
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8766
8930
|
switch (dbType) {
|
|
8767
8931
|
case "postgres": {
|
|
8768
|
-
|
|
8932
|
+
debug19("using postgres migration file");
|
|
8769
8933
|
const mig = new CreateMachineStateStore1708797018115();
|
|
8770
8934
|
await mig.down(queryRunner);
|
|
8771
|
-
|
|
8935
|
+
debug19("Migration statements executed");
|
|
8772
8936
|
return;
|
|
8773
8937
|
}
|
|
8774
8938
|
case "sqlite":
|
|
8775
8939
|
case "expo":
|
|
8776
8940
|
case "react-native": {
|
|
8777
|
-
|
|
8941
|
+
debug19("using sqlite/react-native migration file");
|
|
8778
8942
|
const mig = new CreateMachineStateStore1708796002272();
|
|
8779
8943
|
await mig.down(queryRunner);
|
|
8780
|
-
|
|
8944
|
+
debug19("Migration statements executed");
|
|
8781
8945
|
return;
|
|
8782
8946
|
}
|
|
8783
8947
|
default:
|
|
@@ -8787,7 +8951,7 @@ var CreateMachineStateStore1708098041262 = class {
|
|
|
8787
8951
|
};
|
|
8788
8952
|
|
|
8789
8953
|
// src/migrations/generic/8-CreateContacts.ts
|
|
8790
|
-
import
|
|
8954
|
+
import Debug20 from "debug";
|
|
8791
8955
|
|
|
8792
8956
|
// src/migrations/postgres/1710438363001-CreateContacts.ts
|
|
8793
8957
|
var CreateContacts1710438363001 = class {
|
|
@@ -8901,30 +9065,30 @@ var CreateContacts1710438363002 = class {
|
|
|
8901
9065
|
};
|
|
8902
9066
|
|
|
8903
9067
|
// src/migrations/generic/8-CreateContacts.ts
|
|
8904
|
-
var
|
|
9068
|
+
var debug20 = Debug20("sphereon:ssi-sdk:migrations");
|
|
8905
9069
|
var CreateContacts1708525189000 = class {
|
|
8906
9070
|
static {
|
|
8907
9071
|
__name(this, "CreateContacts1708525189000");
|
|
8908
9072
|
}
|
|
8909
9073
|
name = "CreateContacts1708525189000";
|
|
8910
9074
|
async up(queryRunner) {
|
|
8911
|
-
|
|
9075
|
+
debug20("migration: updating contact tables");
|
|
8912
9076
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8913
9077
|
switch (dbType) {
|
|
8914
9078
|
case "postgres": {
|
|
8915
|
-
|
|
9079
|
+
debug20("using postgres migration file");
|
|
8916
9080
|
const mig = new CreateContacts1710438363001();
|
|
8917
9081
|
await mig.up(queryRunner);
|
|
8918
|
-
|
|
9082
|
+
debug20("Migration statements executed");
|
|
8919
9083
|
return;
|
|
8920
9084
|
}
|
|
8921
9085
|
case "sqlite":
|
|
8922
9086
|
case "expo":
|
|
8923
9087
|
case "react-native": {
|
|
8924
|
-
|
|
9088
|
+
debug20("using sqlite/react-native migration file");
|
|
8925
9089
|
const mig = new CreateContacts1710438363002();
|
|
8926
9090
|
await mig.up(queryRunner);
|
|
8927
|
-
|
|
9091
|
+
debug20("Migration statements executed");
|
|
8928
9092
|
return;
|
|
8929
9093
|
}
|
|
8930
9094
|
default:
|
|
@@ -8932,23 +9096,23 @@ var CreateContacts1708525189000 = class {
|
|
|
8932
9096
|
}
|
|
8933
9097
|
}
|
|
8934
9098
|
async down(queryRunner) {
|
|
8935
|
-
|
|
9099
|
+
debug20("migration: reverting machine state tables");
|
|
8936
9100
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8937
9101
|
switch (dbType) {
|
|
8938
9102
|
case "postgres": {
|
|
8939
|
-
|
|
9103
|
+
debug20("using postgres migration file");
|
|
8940
9104
|
const mig = new CreateContacts1710438363001();
|
|
8941
9105
|
await mig.down(queryRunner);
|
|
8942
|
-
|
|
9106
|
+
debug20("Migration statements executed");
|
|
8943
9107
|
return;
|
|
8944
9108
|
}
|
|
8945
9109
|
case "sqlite":
|
|
8946
9110
|
case "expo":
|
|
8947
9111
|
case "react-native": {
|
|
8948
|
-
|
|
9112
|
+
debug20("using sqlite/react-native migration file");
|
|
8949
9113
|
const mig = new CreateContacts1710438363002();
|
|
8950
9114
|
await mig.down(queryRunner);
|
|
8951
|
-
|
|
9115
|
+
debug20("Migration statements executed");
|
|
8952
9116
|
return;
|
|
8953
9117
|
}
|
|
8954
9118
|
default:
|
|
@@ -8958,7 +9122,7 @@ var CreateContacts1708525189000 = class {
|
|
|
8958
9122
|
};
|
|
8959
9123
|
|
|
8960
9124
|
// src/migrations/generic/9-CreateContacts.ts
|
|
8961
|
-
import
|
|
9125
|
+
import Debug21 from "debug";
|
|
8962
9126
|
|
|
8963
9127
|
// src/migrations/postgres/1715761125001-CreateContacts.ts
|
|
8964
9128
|
var CreateContacts1715761125001 = class {
|
|
@@ -9070,30 +9234,30 @@ var CreateContacts1715761125002 = class {
|
|
|
9070
9234
|
};
|
|
9071
9235
|
|
|
9072
9236
|
// src/migrations/generic/9-CreateContacts.ts
|
|
9073
|
-
var
|
|
9237
|
+
var debug21 = Debug21("sphereon:ssi-sdk:migrations");
|
|
9074
9238
|
var CreateContacts1715761125000 = class {
|
|
9075
9239
|
static {
|
|
9076
9240
|
__name(this, "CreateContacts1715761125000");
|
|
9077
9241
|
}
|
|
9078
9242
|
name = "CreateContacts1715761125000";
|
|
9079
9243
|
async up(queryRunner) {
|
|
9080
|
-
|
|
9244
|
+
debug21("migration: updating contact tables");
|
|
9081
9245
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9082
9246
|
switch (dbType) {
|
|
9083
9247
|
case "postgres": {
|
|
9084
|
-
|
|
9248
|
+
debug21("using postgres migration file");
|
|
9085
9249
|
const mig = new CreateContacts1715761125001();
|
|
9086
9250
|
await mig.up(queryRunner);
|
|
9087
|
-
|
|
9251
|
+
debug21("Migration statements executed");
|
|
9088
9252
|
return;
|
|
9089
9253
|
}
|
|
9090
9254
|
case "sqlite":
|
|
9091
9255
|
case "expo":
|
|
9092
9256
|
case "react-native": {
|
|
9093
|
-
|
|
9257
|
+
debug21("using sqlite/react-native migration file");
|
|
9094
9258
|
const mig = new CreateContacts1715761125002();
|
|
9095
9259
|
await mig.up(queryRunner);
|
|
9096
|
-
|
|
9260
|
+
debug21("Migration statements executed");
|
|
9097
9261
|
return;
|
|
9098
9262
|
}
|
|
9099
9263
|
default:
|
|
@@ -9101,23 +9265,23 @@ var CreateContacts1715761125000 = class {
|
|
|
9101
9265
|
}
|
|
9102
9266
|
}
|
|
9103
9267
|
async down(queryRunner) {
|
|
9104
|
-
|
|
9268
|
+
debug21("migration: reverting machine state tables");
|
|
9105
9269
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9106
9270
|
switch (dbType) {
|
|
9107
9271
|
case "postgres": {
|
|
9108
|
-
|
|
9272
|
+
debug21("using postgres migration file");
|
|
9109
9273
|
const mig = new CreateContacts1715761125001();
|
|
9110
9274
|
await mig.down(queryRunner);
|
|
9111
|
-
|
|
9275
|
+
debug21("Migration statements executed");
|
|
9112
9276
|
return;
|
|
9113
9277
|
}
|
|
9114
9278
|
case "sqlite":
|
|
9115
9279
|
case "expo":
|
|
9116
9280
|
case "react-native": {
|
|
9117
|
-
|
|
9281
|
+
debug21("using sqlite/react-native migration file");
|
|
9118
9282
|
const mig = new CreateContacts1715761125002();
|
|
9119
9283
|
await mig.down(queryRunner);
|
|
9120
|
-
|
|
9284
|
+
debug21("Migration statements executed");
|
|
9121
9285
|
return;
|
|
9122
9286
|
}
|
|
9123
9287
|
default:
|
|
@@ -9146,7 +9310,8 @@ var DataStoreEventLoggerMigrations = [
|
|
|
9146
9310
|
CreateAuditEvents1701635835330
|
|
9147
9311
|
];
|
|
9148
9312
|
var DataStoreDigitalCredentialMigrations = [
|
|
9149
|
-
CreateDigitalCredential1708525189000
|
|
9313
|
+
CreateDigitalCredential1708525189000,
|
|
9314
|
+
AddLinkedVpFields1763387280000
|
|
9150
9315
|
];
|
|
9151
9316
|
var DataStoreMachineStateMigrations = [
|
|
9152
9317
|
CreateMachineStateStore1708098041262
|