@sphereon/ssi-sdk.data-store 0.36.1-feature.SSISDK.82.and.SSISDK.70.35 → 0.36.1-next.11
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 +126 -363
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -16
- package/dist/index.d.ts +5 -16
- package/dist/index.js +112 -349
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
- package/src/__tests__/digitalCredential.store.test.ts +7 -349
- package/src/digitalCredential/DigitalCredentialStore.ts +15 -73
- package/src/entities/digitalCredential/DigitalCredentialEntity.ts +0 -9
- package/src/migrations/generic/index.ts +1 -2
- package/src/utils/digitalCredential/MappingUtils.ts +2 -69
- package/src/migrations/generic/14-AddLinkedVpFields.ts +0 -66
- package/src/migrations/postgres/1763387280001-AddLinkedVpFields.ts +0 -39
- package/src/migrations/sqlite/1763387280002-AddLinkedVpFields.ts +0 -39
package/dist/index.js
CHANGED
|
@@ -1922,9 +1922,6 @@ var DigitalCredentialEntity = class extends BaseEntity11 {
|
|
|
1922
1922
|
rpCorrelationId;
|
|
1923
1923
|
verifiedState;
|
|
1924
1924
|
tenantId;
|
|
1925
|
-
linkedVpId;
|
|
1926
|
-
linkedVpFrom;
|
|
1927
|
-
linkedVpUntil;
|
|
1928
1925
|
createdAt;
|
|
1929
1926
|
presentedAt;
|
|
1930
1927
|
lastUpdatedAt;
|
|
@@ -2087,29 +2084,6 @@ _ts_decorate18([
|
|
|
2087
2084
|
}),
|
|
2088
2085
|
_ts_metadata17("design:type", String)
|
|
2089
2086
|
], DigitalCredentialEntity.prototype, "tenantId", void 0);
|
|
2090
|
-
_ts_decorate18([
|
|
2091
|
-
Column15("text", {
|
|
2092
|
-
name: "linked_vp_id",
|
|
2093
|
-
nullable: true
|
|
2094
|
-
}),
|
|
2095
|
-
_ts_metadata17("design:type", String)
|
|
2096
|
-
], DigitalCredentialEntity.prototype, "linkedVpId", void 0);
|
|
2097
|
-
_ts_decorate18([
|
|
2098
|
-
CreateDateColumn8({
|
|
2099
|
-
name: "linked_vp_from",
|
|
2100
|
-
nullable: true,
|
|
2101
|
-
type: typeOrmDateTime10()
|
|
2102
|
-
}),
|
|
2103
|
-
_ts_metadata17("design:type", typeof Date === "undefined" ? Object : Date)
|
|
2104
|
-
], DigitalCredentialEntity.prototype, "linkedVpFrom", void 0);
|
|
2105
|
-
_ts_decorate18([
|
|
2106
|
-
CreateDateColumn8({
|
|
2107
|
-
name: "linked_vp_until",
|
|
2108
|
-
nullable: true,
|
|
2109
|
-
type: typeOrmDateTime10()
|
|
2110
|
-
}),
|
|
2111
|
-
_ts_metadata17("design:type", typeof Date === "undefined" ? Object : Date)
|
|
2112
|
-
], DigitalCredentialEntity.prototype, "linkedVpUntil", void 0);
|
|
2113
2087
|
_ts_decorate18([
|
|
2114
2088
|
CreateDateColumn8({
|
|
2115
2089
|
name: "created_at",
|
|
@@ -5243,7 +5217,6 @@ var ContactStore = class extends AbstractContactStore {
|
|
|
5243
5217
|
import { AbstractDigitalCredentialStore, CredentialStateType as CredentialStateType2 } from "@sphereon/ssi-sdk.data-store-types";
|
|
5244
5218
|
import { CredentialRole as CredentialRole2 } from "@sphereon/ssi-types";
|
|
5245
5219
|
import Debug2 from "debug";
|
|
5246
|
-
import { LessThanOrEqual } from "typeorm";
|
|
5247
5220
|
|
|
5248
5221
|
// src/utils/SortingUtils.ts
|
|
5249
5222
|
var parseAndValidateOrderOptions = /* @__PURE__ */ __name((order) => {
|
|
@@ -5297,25 +5270,8 @@ var DigitalCredentialStore = class extends AbstractDigitalCredentialStore {
|
|
|
5297
5270
|
const { filter = {}, offset, limit, order = "createdAt.asc" } = args ?? {};
|
|
5298
5271
|
const sortOptions = order && typeof order === "string" ? parseAndValidateOrderOptions(order) : order;
|
|
5299
5272
|
const dcRepo = await this.getRepository();
|
|
5300
|
-
const processLinkedVpUntil = /* @__PURE__ */ __name((filterItem) => {
|
|
5301
|
-
const processed = {
|
|
5302
|
-
...filterItem
|
|
5303
|
-
};
|
|
5304
|
-
if (filterItem.linkedVpUntil) {
|
|
5305
|
-
processed.linkedVpUntil = LessThanOrEqual(filterItem.linkedVpUntil);
|
|
5306
|
-
}
|
|
5307
|
-
return processed;
|
|
5308
|
-
}, "processLinkedVpUntil");
|
|
5309
|
-
let whereClause;
|
|
5310
|
-
if (Array.isArray(filter) && filter.length > 0) {
|
|
5311
|
-
whereClause = filter.map(processLinkedVpUntil);
|
|
5312
|
-
} else if (Object.keys(filter).length > 0) {
|
|
5313
|
-
whereClause = processLinkedVpUntil(filter);
|
|
5314
|
-
} else {
|
|
5315
|
-
whereClause = filter;
|
|
5316
|
-
}
|
|
5317
5273
|
const [result, total] = await dcRepo.findAndCount({
|
|
5318
|
-
where:
|
|
5274
|
+
where: filter,
|
|
5319
5275
|
skip: offset,
|
|
5320
5276
|
take: limit,
|
|
5321
5277
|
order: sortOptions
|
|
@@ -5325,34 +5281,6 @@ var DigitalCredentialStore = class extends AbstractDigitalCredentialStore {
|
|
|
5325
5281
|
total
|
|
5326
5282
|
};
|
|
5327
5283
|
}, "getCredentials");
|
|
5328
|
-
updateCredential = /* @__PURE__ */ __name(async (args) => {
|
|
5329
|
-
const dcRepo = await this.getRepository();
|
|
5330
|
-
const whereClause = {};
|
|
5331
|
-
if ("id" in args) {
|
|
5332
|
-
whereClause.id = args.id;
|
|
5333
|
-
} else if ("hash" in args) {
|
|
5334
|
-
whereClause.hash = args.hash;
|
|
5335
|
-
} else {
|
|
5336
|
-
return Promise.reject(Error("No id or hash param is provided."));
|
|
5337
|
-
}
|
|
5338
|
-
const credential = await dcRepo.findOne({
|
|
5339
|
-
where: whereClause
|
|
5340
|
-
});
|
|
5341
|
-
if (!credential) {
|
|
5342
|
-
return Promise.reject(Error(`No credential found for args: ${JSON.stringify(whereClause)}`));
|
|
5343
|
-
}
|
|
5344
|
-
const updates = Object.fromEntries(Object.entries(args).filter(([key]) => key !== "id" && key !== "hash"));
|
|
5345
|
-
const entityToSave = persistedDigitalCredentialEntityFromUpdateArgs(credential, updates);
|
|
5346
|
-
const validationError = this.assertValidDigitalCredential(entityToSave);
|
|
5347
|
-
if (validationError) {
|
|
5348
|
-
return Promise.reject(validationError);
|
|
5349
|
-
}
|
|
5350
|
-
debug2("Updating credential", entityToSave);
|
|
5351
|
-
const updatedResult = await dcRepo.save(entityToSave, {
|
|
5352
|
-
transaction: true
|
|
5353
|
-
});
|
|
5354
|
-
return digitalCredentialFrom(updatedResult);
|
|
5355
|
-
}, "updateCredential");
|
|
5356
5284
|
removeCredential = /* @__PURE__ */ __name(async (args) => {
|
|
5357
5285
|
if (!args) {
|
|
5358
5286
|
return false;
|
|
@@ -5423,9 +5351,20 @@ var DigitalCredentialStore = class extends AbstractDigitalCredentialStore {
|
|
|
5423
5351
|
if (!credential) {
|
|
5424
5352
|
return Promise.reject(Error(`No credential found for args: ${JSON.stringify(whereClause)}`));
|
|
5425
5353
|
}
|
|
5426
|
-
const
|
|
5427
|
-
|
|
5428
|
-
|
|
5354
|
+
const updatedCredential = {
|
|
5355
|
+
...credential,
|
|
5356
|
+
...args.verifiedState !== CredentialStateType2.REVOKED && {
|
|
5357
|
+
verifiedAt: args.verifiedAt
|
|
5358
|
+
},
|
|
5359
|
+
...args.verifiedState === CredentialStateType2.REVOKED && {
|
|
5360
|
+
revokedAt: args.revokedAt
|
|
5361
|
+
},
|
|
5362
|
+
identifierMethod: credential.identifierMethod,
|
|
5363
|
+
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
5364
|
+
verifiedState: args.verifiedState
|
|
5365
|
+
};
|
|
5366
|
+
debug2("Updating credential", credential);
|
|
5367
|
+
const updatedResult = await credentialRepository.save(updatedCredential, {
|
|
5429
5368
|
transaction: true
|
|
5430
5369
|
});
|
|
5431
5370
|
return digitalCredentialFrom(updatedResult);
|
|
@@ -7810,164 +7749,32 @@ var CreateDcqlQueryItem1726617600000 = class {
|
|
|
7810
7749
|
}
|
|
7811
7750
|
};
|
|
7812
7751
|
|
|
7813
|
-
// src/migrations/generic/
|
|
7752
|
+
// src/migrations/generic/2-CreateIssuanceBranding.ts
|
|
7814
7753
|
import Debug13 from "debug";
|
|
7815
|
-
|
|
7816
|
-
// src/migrations/postgres/1763387280001-AddLinkedVpFields.ts
|
|
7817
|
-
var AddLinkedVpFields1763387280001 = class {
|
|
7818
|
-
static {
|
|
7819
|
-
__name(this, "AddLinkedVpFields1763387280001");
|
|
7820
|
-
}
|
|
7821
|
-
name = "AddLinkedVpFields1763387280001";
|
|
7822
|
-
async up(queryRunner) {
|
|
7823
|
-
await queryRunner.query(`
|
|
7824
|
-
ALTER TABLE "DigitalCredential"
|
|
7825
|
-
ADD COLUMN "linked_vp_id" text
|
|
7826
|
-
`);
|
|
7827
|
-
await queryRunner.query(`
|
|
7828
|
-
ALTER TABLE "DigitalCredential"
|
|
7829
|
-
ADD COLUMN "linked_vp_from" TIMESTAMP
|
|
7830
|
-
`);
|
|
7831
|
-
await queryRunner.query(`
|
|
7832
|
-
ALTER TABLE "DigitalCredential"
|
|
7833
|
-
ADD COLUMN "linked_vp_until" TIMESTAMP
|
|
7834
|
-
`);
|
|
7835
|
-
}
|
|
7836
|
-
async down(queryRunner) {
|
|
7837
|
-
await queryRunner.query(`
|
|
7838
|
-
ALTER TABLE "DigitalCredential"
|
|
7839
|
-
DROP COLUMN "linked_vp_until"
|
|
7840
|
-
`);
|
|
7841
|
-
await queryRunner.query(`
|
|
7842
|
-
ALTER TABLE "DigitalCredential"
|
|
7843
|
-
DROP COLUMN "linked_vp_from"
|
|
7844
|
-
`);
|
|
7845
|
-
await queryRunner.query(`
|
|
7846
|
-
ALTER TABLE "DigitalCredential"
|
|
7847
|
-
DROP COLUMN "linked_vp_id"
|
|
7848
|
-
`);
|
|
7849
|
-
}
|
|
7850
|
-
};
|
|
7851
|
-
|
|
7852
|
-
// src/migrations/sqlite/1763387280002-AddLinkedVpFields.ts
|
|
7853
|
-
var AddLinkedVpFields1763387280002 = class {
|
|
7854
|
-
static {
|
|
7855
|
-
__name(this, "AddLinkedVpFields1763387280002");
|
|
7856
|
-
}
|
|
7857
|
-
name = "AddLinkedVpFields1763387280002";
|
|
7858
|
-
async up(queryRunner) {
|
|
7859
|
-
await queryRunner.query(`
|
|
7860
|
-
ALTER TABLE "DigitalCredential"
|
|
7861
|
-
ADD COLUMN "linked_vp_id" text
|
|
7862
|
-
`);
|
|
7863
|
-
await queryRunner.query(`
|
|
7864
|
-
ALTER TABLE "DigitalCredential"
|
|
7865
|
-
ADD COLUMN "linked_vp_from" datetime
|
|
7866
|
-
`);
|
|
7867
|
-
await queryRunner.query(`
|
|
7868
|
-
ALTER TABLE "DigitalCredential"
|
|
7869
|
-
ADD COLUMN "linked_vp_until" datetime
|
|
7870
|
-
`);
|
|
7871
|
-
}
|
|
7872
|
-
async down(queryRunner) {
|
|
7873
|
-
await queryRunner.query(`
|
|
7874
|
-
ALTER TABLE "DigitalCredential"
|
|
7875
|
-
DROP COLUMN "linked_vp_from"
|
|
7876
|
-
`);
|
|
7877
|
-
await queryRunner.query(`
|
|
7878
|
-
ALTER TABLE "DigitalCredential"
|
|
7879
|
-
DROP COLUMN "linked_vp_until"
|
|
7880
|
-
`);
|
|
7881
|
-
await queryRunner.query(`
|
|
7882
|
-
ALTER TABLE "DigitalCredential"
|
|
7883
|
-
DROP COLUMN "linked_vp_id"
|
|
7884
|
-
`);
|
|
7885
|
-
}
|
|
7886
|
-
};
|
|
7887
|
-
|
|
7888
|
-
// src/migrations/generic/14-AddLinkedVpFields.ts
|
|
7889
7754
|
var debug13 = Debug13("sphereon:ssi-sdk:migrations");
|
|
7890
|
-
var AddLinkedVpFields1763387280000 = class {
|
|
7891
|
-
static {
|
|
7892
|
-
__name(this, "AddLinkedVpFields1763387280000");
|
|
7893
|
-
}
|
|
7894
|
-
name = "AddLinkedVpFields1763387280000";
|
|
7895
|
-
async up(queryRunner) {
|
|
7896
|
-
debug13("migration: adding linked VP fields to DigitalCredential table");
|
|
7897
|
-
const dbType = queryRunner.connection.driver.options.type;
|
|
7898
|
-
switch (dbType) {
|
|
7899
|
-
case "postgres": {
|
|
7900
|
-
debug13("using postgres migration file for AddLinkedVpFields");
|
|
7901
|
-
const mig = new AddLinkedVpFields1763387280001();
|
|
7902
|
-
await mig.up(queryRunner);
|
|
7903
|
-
debug13("Postgres migration statements for AddLinkedVpFields executed");
|
|
7904
|
-
return;
|
|
7905
|
-
}
|
|
7906
|
-
case "sqlite":
|
|
7907
|
-
case "expo":
|
|
7908
|
-
case "react-native": {
|
|
7909
|
-
debug13("using sqlite/react-native migration file for AddLinkedVpFields");
|
|
7910
|
-
const mig = new AddLinkedVpFields1763387280002();
|
|
7911
|
-
await mig.up(queryRunner);
|
|
7912
|
-
debug13("SQLite migration statements for AddLinkedVpFields executed");
|
|
7913
|
-
return;
|
|
7914
|
-
}
|
|
7915
|
-
default:
|
|
7916
|
-
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`);
|
|
7917
|
-
}
|
|
7918
|
-
}
|
|
7919
|
-
async down(queryRunner) {
|
|
7920
|
-
debug13("migration: reverting linked VP fields from DigitalCredential table");
|
|
7921
|
-
const dbType = queryRunner.connection.driver.options.type;
|
|
7922
|
-
switch (dbType) {
|
|
7923
|
-
case "postgres": {
|
|
7924
|
-
debug13("using postgres migration file for AddLinkedVpFields");
|
|
7925
|
-
const mig = new AddLinkedVpFields1763387280001();
|
|
7926
|
-
await mig.down(queryRunner);
|
|
7927
|
-
debug13("Postgres migration statements for AddLinkedVpFields reverted");
|
|
7928
|
-
return;
|
|
7929
|
-
}
|
|
7930
|
-
case "sqlite":
|
|
7931
|
-
case "expo":
|
|
7932
|
-
case "react-native": {
|
|
7933
|
-
debug13("using sqlite/react-native migration file for AddLinkedVpFields");
|
|
7934
|
-
const mig = new AddLinkedVpFields1763387280002();
|
|
7935
|
-
await mig.down(queryRunner);
|
|
7936
|
-
debug13("SQLite migration statements for AddLinkedVpFields reverted");
|
|
7937
|
-
return;
|
|
7938
|
-
}
|
|
7939
|
-
default:
|
|
7940
|
-
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`);
|
|
7941
|
-
}
|
|
7942
|
-
}
|
|
7943
|
-
};
|
|
7944
|
-
|
|
7945
|
-
// src/migrations/generic/2-CreateIssuanceBranding.ts
|
|
7946
|
-
import Debug14 from "debug";
|
|
7947
|
-
var debug14 = Debug14("sphereon:ssi-sdk:migrations");
|
|
7948
7755
|
var CreateIssuanceBranding1659463079429 = class {
|
|
7949
7756
|
static {
|
|
7950
7757
|
__name(this, "CreateIssuanceBranding1659463079429");
|
|
7951
7758
|
}
|
|
7952
7759
|
name = "CreateIssuanceBranding1659463079429";
|
|
7953
7760
|
async up(queryRunner) {
|
|
7954
|
-
|
|
7761
|
+
debug13("migration: creating issuance branding tables");
|
|
7955
7762
|
const dbType = queryRunner.connection.driver.options.type;
|
|
7956
7763
|
switch (dbType) {
|
|
7957
7764
|
case "postgres": {
|
|
7958
|
-
|
|
7765
|
+
debug13("using postgres migration file");
|
|
7959
7766
|
const mig = new CreateIssuanceBranding1685628974232();
|
|
7960
7767
|
await mig.up(queryRunner);
|
|
7961
|
-
|
|
7768
|
+
debug13("Migration statements executed");
|
|
7962
7769
|
return;
|
|
7963
7770
|
}
|
|
7964
7771
|
case "sqlite":
|
|
7965
7772
|
case "expo":
|
|
7966
7773
|
case "react-native": {
|
|
7967
|
-
|
|
7774
|
+
debug13("using sqlite/react-native migration file");
|
|
7968
7775
|
const mig = new CreateIssuanceBranding1685628973231();
|
|
7969
7776
|
await mig.up(queryRunner);
|
|
7970
|
-
|
|
7777
|
+
debug13("Migration statements executed");
|
|
7971
7778
|
return;
|
|
7972
7779
|
}
|
|
7973
7780
|
default:
|
|
@@ -7975,23 +7782,23 @@ var CreateIssuanceBranding1659463079429 = class {
|
|
|
7975
7782
|
}
|
|
7976
7783
|
}
|
|
7977
7784
|
async down(queryRunner) {
|
|
7978
|
-
|
|
7785
|
+
debug13("migration: reverting issuance branding tables");
|
|
7979
7786
|
const dbType = queryRunner.connection.driver.options.type;
|
|
7980
7787
|
switch (dbType) {
|
|
7981
7788
|
case "postgres": {
|
|
7982
|
-
|
|
7789
|
+
debug13("using postgres migration file");
|
|
7983
7790
|
const mig = new CreateIssuanceBranding1685628974232();
|
|
7984
7791
|
await mig.down(queryRunner);
|
|
7985
|
-
|
|
7792
|
+
debug13("Migration statements executed");
|
|
7986
7793
|
return;
|
|
7987
7794
|
}
|
|
7988
7795
|
case "sqlite":
|
|
7989
7796
|
case "expo":
|
|
7990
7797
|
case "react-native": {
|
|
7991
|
-
|
|
7798
|
+
debug13("using sqlite/react-native migration file");
|
|
7992
7799
|
const mig = new CreateIssuanceBranding1685628973231();
|
|
7993
7800
|
await mig.down(queryRunner);
|
|
7994
|
-
|
|
7801
|
+
debug13("Migration statements executed");
|
|
7995
7802
|
return;
|
|
7996
7803
|
}
|
|
7997
7804
|
default:
|
|
@@ -8001,7 +7808,7 @@ var CreateIssuanceBranding1659463079429 = class {
|
|
|
8001
7808
|
};
|
|
8002
7809
|
|
|
8003
7810
|
// src/migrations/generic/3-CreateContacts.ts
|
|
8004
|
-
import
|
|
7811
|
+
import Debug14 from "debug";
|
|
8005
7812
|
|
|
8006
7813
|
// src/migrations/postgres/1690925872592-CreateContacts.ts
|
|
8007
7814
|
import { enablePostgresUuidExtension as enablePostgresUuidExtension3 } from "@sphereon/ssi-sdk.core";
|
|
@@ -8222,30 +8029,30 @@ var CreateContacts1690925872693 = class {
|
|
|
8222
8029
|
};
|
|
8223
8030
|
|
|
8224
8031
|
// src/migrations/generic/3-CreateContacts.ts
|
|
8225
|
-
var
|
|
8032
|
+
var debug14 = Debug14("sphereon:ssi-sdk:migrations");
|
|
8226
8033
|
var CreateContacts1690925872318 = class {
|
|
8227
8034
|
static {
|
|
8228
8035
|
__name(this, "CreateContacts1690925872318");
|
|
8229
8036
|
}
|
|
8230
8037
|
name = "CreateContacts1690925872318";
|
|
8231
8038
|
async up(queryRunner) {
|
|
8232
|
-
|
|
8039
|
+
debug14("migration: creating contacts tables");
|
|
8233
8040
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8234
8041
|
switch (dbType) {
|
|
8235
8042
|
case "postgres": {
|
|
8236
|
-
|
|
8043
|
+
debug14("using postgres migration file");
|
|
8237
8044
|
const mig = new CreateContacts1690925872592();
|
|
8238
8045
|
await mig.up(queryRunner);
|
|
8239
|
-
|
|
8046
|
+
debug14("Migration statements executed");
|
|
8240
8047
|
return;
|
|
8241
8048
|
}
|
|
8242
8049
|
case "sqlite":
|
|
8243
8050
|
case "expo":
|
|
8244
8051
|
case "react-native": {
|
|
8245
|
-
|
|
8052
|
+
debug14("using sqlite/react-native migration file");
|
|
8246
8053
|
const mig = new CreateContacts1690925872693();
|
|
8247
8054
|
await mig.up(queryRunner);
|
|
8248
|
-
|
|
8055
|
+
debug14("Migration statements executed");
|
|
8249
8056
|
return;
|
|
8250
8057
|
}
|
|
8251
8058
|
default:
|
|
@@ -8253,23 +8060,23 @@ var CreateContacts1690925872318 = class {
|
|
|
8253
8060
|
}
|
|
8254
8061
|
}
|
|
8255
8062
|
async down(queryRunner) {
|
|
8256
|
-
|
|
8063
|
+
debug14("migration: reverting contacts tables");
|
|
8257
8064
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8258
8065
|
switch (dbType) {
|
|
8259
8066
|
case "postgres": {
|
|
8260
|
-
|
|
8067
|
+
debug14("using postgres migration file");
|
|
8261
8068
|
const mig = new CreateContacts1690925872592();
|
|
8262
8069
|
await mig.down(queryRunner);
|
|
8263
|
-
|
|
8070
|
+
debug14("Migration statements executed");
|
|
8264
8071
|
return;
|
|
8265
8072
|
}
|
|
8266
8073
|
case "sqlite":
|
|
8267
8074
|
case "expo":
|
|
8268
8075
|
case "react-native": {
|
|
8269
|
-
|
|
8076
|
+
debug14("using sqlite/react-native migration file");
|
|
8270
8077
|
const mig = new CreateContacts1690925872693();
|
|
8271
8078
|
await mig.down(queryRunner);
|
|
8272
|
-
|
|
8079
|
+
debug14("Migration statements executed");
|
|
8273
8080
|
return;
|
|
8274
8081
|
}
|
|
8275
8082
|
default:
|
|
@@ -8279,7 +8086,7 @@ var CreateContacts1690925872318 = class {
|
|
|
8279
8086
|
};
|
|
8280
8087
|
|
|
8281
8088
|
// src/migrations/generic/4-CreateStatusList.ts
|
|
8282
|
-
import
|
|
8089
|
+
import Debug15 from "debug";
|
|
8283
8090
|
|
|
8284
8091
|
// src/migrations/postgres/1693866470001-CreateStatusList.ts
|
|
8285
8092
|
var CreateStatusList1693866470001 = class {
|
|
@@ -8485,53 +8292,53 @@ var UpdateStatusList1737110469000 = class {
|
|
|
8485
8292
|
};
|
|
8486
8293
|
|
|
8487
8294
|
// src/migrations/generic/4-CreateStatusList.ts
|
|
8488
|
-
var
|
|
8295
|
+
var debug15 = Debug15("sphereon:ssi-sdk:migrations");
|
|
8489
8296
|
var CreateStatusList1693866470000 = class {
|
|
8490
8297
|
static {
|
|
8491
8298
|
__name(this, "CreateStatusList1693866470000");
|
|
8492
8299
|
}
|
|
8493
8300
|
name = "CreateStatusList1693866470000";
|
|
8494
8301
|
async up(queryRunner) {
|
|
8495
|
-
|
|
8302
|
+
debug15("migration: creating issuance branding tables");
|
|
8496
8303
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8497
8304
|
if (dbType === "postgres") {
|
|
8498
|
-
|
|
8305
|
+
debug15("using postgres migration files");
|
|
8499
8306
|
const createMig = new CreateStatusList1693866470001();
|
|
8500
8307
|
await createMig.up(queryRunner);
|
|
8501
8308
|
const updateMig = new UpdateStatusList1737110469001();
|
|
8502
8309
|
const up = await updateMig.up(queryRunner);
|
|
8503
|
-
|
|
8310
|
+
debug15("Migration statements executed");
|
|
8504
8311
|
return up;
|
|
8505
8312
|
} else if (dbType === "sqlite" || dbType === "react-native" || dbType === "expo") {
|
|
8506
|
-
|
|
8313
|
+
debug15("using sqlite/react-native migration files");
|
|
8507
8314
|
const createMig = new CreateStatusList1693866470002();
|
|
8508
8315
|
await createMig.up(queryRunner);
|
|
8509
8316
|
const updateMig = new UpdateStatusList1737110469000();
|
|
8510
8317
|
const up = await updateMig.up(queryRunner);
|
|
8511
|
-
|
|
8318
|
+
debug15("Migration statements executed");
|
|
8512
8319
|
return up;
|
|
8513
8320
|
} else {
|
|
8514
8321
|
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
8322
|
}
|
|
8516
8323
|
}
|
|
8517
8324
|
async down(queryRunner) {
|
|
8518
|
-
|
|
8325
|
+
debug15("migration: reverting issuance branding tables");
|
|
8519
8326
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8520
8327
|
if (dbType === "postgres") {
|
|
8521
|
-
|
|
8328
|
+
debug15("using postgres migration files");
|
|
8522
8329
|
const updateMig = new UpdateStatusList1737110469001();
|
|
8523
8330
|
await updateMig.down(queryRunner);
|
|
8524
8331
|
const createMig = new CreateStatusList1693866470001();
|
|
8525
8332
|
const down = await createMig.down(queryRunner);
|
|
8526
|
-
|
|
8333
|
+
debug15("Migration statements executed");
|
|
8527
8334
|
return down;
|
|
8528
8335
|
} else if (dbType === "sqlite" || dbType === "react-native" || dbType === "expo") {
|
|
8529
|
-
|
|
8336
|
+
debug15("using sqlite/react-native migration files");
|
|
8530
8337
|
const updateMig = new UpdateStatusList1737110469000();
|
|
8531
8338
|
await updateMig.down(queryRunner);
|
|
8532
8339
|
const createMig = new CreateStatusList1693866470002();
|
|
8533
8340
|
const down = await createMig.down(queryRunner);
|
|
8534
|
-
|
|
8341
|
+
debug15("Migration statements executed");
|
|
8535
8342
|
return down;
|
|
8536
8343
|
} else {
|
|
8537
8344
|
return Promise.reject(`Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`);
|
|
@@ -8540,7 +8347,7 @@ var CreateStatusList1693866470000 = class {
|
|
|
8540
8347
|
};
|
|
8541
8348
|
|
|
8542
8349
|
// src/migrations/generic/5-CreateAuditEvents.ts
|
|
8543
|
-
import
|
|
8350
|
+
import Debug16 from "debug";
|
|
8544
8351
|
|
|
8545
8352
|
// src/migrations/postgres/1701634812183-CreateAuditEvents.ts
|
|
8546
8353
|
var CreateAuditEvents1701634812183 = class {
|
|
@@ -8639,30 +8446,30 @@ var CreateAuditEvents1701634819487 = class {
|
|
|
8639
8446
|
};
|
|
8640
8447
|
|
|
8641
8448
|
// src/migrations/generic/5-CreateAuditEvents.ts
|
|
8642
|
-
var
|
|
8449
|
+
var debug16 = Debug16("sphereon:ssi-sdk:migrations");
|
|
8643
8450
|
var CreateAuditEvents1701635835330 = class {
|
|
8644
8451
|
static {
|
|
8645
8452
|
__name(this, "CreateAuditEvents1701635835330");
|
|
8646
8453
|
}
|
|
8647
8454
|
name = "CreateAuditEvents1701635835330";
|
|
8648
8455
|
async up(queryRunner) {
|
|
8649
|
-
|
|
8456
|
+
debug16("migration: creating audit events tables");
|
|
8650
8457
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8651
8458
|
switch (dbType) {
|
|
8652
8459
|
case "postgres": {
|
|
8653
|
-
|
|
8460
|
+
debug16("using postgres migration file");
|
|
8654
8461
|
const mig = new CreateAuditEvents1701634812183();
|
|
8655
8462
|
await mig.up(queryRunner);
|
|
8656
|
-
|
|
8463
|
+
debug16("Migration statements executed");
|
|
8657
8464
|
return;
|
|
8658
8465
|
}
|
|
8659
8466
|
case "sqlite":
|
|
8660
8467
|
case "expo":
|
|
8661
8468
|
case "react-native": {
|
|
8662
|
-
|
|
8469
|
+
debug16("using sqlite/react-native migration file");
|
|
8663
8470
|
const mig = new CreateAuditEvents1701634819487();
|
|
8664
8471
|
await mig.up(queryRunner);
|
|
8665
|
-
|
|
8472
|
+
debug16("Migration statements executed");
|
|
8666
8473
|
return;
|
|
8667
8474
|
}
|
|
8668
8475
|
default:
|
|
@@ -8670,23 +8477,23 @@ var CreateAuditEvents1701635835330 = class {
|
|
|
8670
8477
|
}
|
|
8671
8478
|
}
|
|
8672
8479
|
async down(queryRunner) {
|
|
8673
|
-
|
|
8480
|
+
debug16("migration: reverting audit events tables");
|
|
8674
8481
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8675
8482
|
switch (dbType) {
|
|
8676
8483
|
case "postgres": {
|
|
8677
|
-
|
|
8484
|
+
debug16("using postgres migration file");
|
|
8678
8485
|
const mig = new CreateAuditEvents1701634812183();
|
|
8679
8486
|
await mig.down(queryRunner);
|
|
8680
|
-
|
|
8487
|
+
debug16("Migration statements executed");
|
|
8681
8488
|
return;
|
|
8682
8489
|
}
|
|
8683
8490
|
case "sqlite":
|
|
8684
8491
|
case "expo":
|
|
8685
8492
|
case "react-native": {
|
|
8686
|
-
|
|
8493
|
+
debug16("using sqlite/react-native migration file");
|
|
8687
8494
|
const mig = new CreateAuditEvents1701634819487();
|
|
8688
8495
|
await mig.down(queryRunner);
|
|
8689
|
-
|
|
8496
|
+
debug16("Migration statements executed");
|
|
8690
8497
|
return;
|
|
8691
8498
|
}
|
|
8692
8499
|
default:
|
|
@@ -8696,7 +8503,7 @@ var CreateAuditEvents1701635835330 = class {
|
|
|
8696
8503
|
};
|
|
8697
8504
|
|
|
8698
8505
|
// src/migrations/generic/6-CreateDigitalCredential.ts
|
|
8699
|
-
import
|
|
8506
|
+
import Debug17 from "debug";
|
|
8700
8507
|
|
|
8701
8508
|
// src/migrations/postgres/1708525189001-CreateDigitalCredential.ts
|
|
8702
8509
|
var CreateDigitalCredential1708525189001 = class {
|
|
@@ -8804,30 +8611,30 @@ var CreateDigitalCredential1708525189002 = class {
|
|
|
8804
8611
|
};
|
|
8805
8612
|
|
|
8806
8613
|
// src/migrations/generic/6-CreateDigitalCredential.ts
|
|
8807
|
-
var
|
|
8614
|
+
var debug17 = Debug17("sphereon:ssi-sdk:migrations");
|
|
8808
8615
|
var CreateDigitalCredential1708525189000 = class {
|
|
8809
8616
|
static {
|
|
8810
8617
|
__name(this, "CreateDigitalCredential1708525189000");
|
|
8811
8618
|
}
|
|
8812
8619
|
name = "CreateDigitalCredential1708525189000";
|
|
8813
8620
|
async up(queryRunner) {
|
|
8814
|
-
|
|
8621
|
+
debug17("migration: creating DigitalCredential tables");
|
|
8815
8622
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8816
8623
|
switch (dbType) {
|
|
8817
8624
|
case "postgres": {
|
|
8818
|
-
|
|
8625
|
+
debug17("using postgres migration file for DigitalCredential");
|
|
8819
8626
|
const mig = new CreateDigitalCredential1708525189001();
|
|
8820
8627
|
await mig.up(queryRunner);
|
|
8821
|
-
|
|
8628
|
+
debug17("Postgres Migration statements for DigitalCredential executed");
|
|
8822
8629
|
return;
|
|
8823
8630
|
}
|
|
8824
8631
|
case "sqlite":
|
|
8825
8632
|
case "expo":
|
|
8826
8633
|
case "react-native": {
|
|
8827
|
-
|
|
8634
|
+
debug17("using sqlite/react-native migration file for DigitalCredential");
|
|
8828
8635
|
const mig = new CreateDigitalCredential1708525189002();
|
|
8829
8636
|
await mig.up(queryRunner);
|
|
8830
|
-
|
|
8637
|
+
debug17("SQLite Migration statements for DigitalCredential executed");
|
|
8831
8638
|
return;
|
|
8832
8639
|
}
|
|
8833
8640
|
default:
|
|
@@ -8835,23 +8642,23 @@ var CreateDigitalCredential1708525189000 = class {
|
|
|
8835
8642
|
}
|
|
8836
8643
|
}
|
|
8837
8644
|
async down(queryRunner) {
|
|
8838
|
-
|
|
8645
|
+
debug17("migration: reverting DigitalCredential tables");
|
|
8839
8646
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8840
8647
|
switch (dbType) {
|
|
8841
8648
|
case "postgres": {
|
|
8842
|
-
|
|
8649
|
+
debug17("using postgres migration file for DigitalCredential");
|
|
8843
8650
|
const mig = new CreateDigitalCredential1708525189001();
|
|
8844
8651
|
await mig.down(queryRunner);
|
|
8845
|
-
|
|
8652
|
+
debug17("Postgres Migration statements for DigitalCredential reverted");
|
|
8846
8653
|
return;
|
|
8847
8654
|
}
|
|
8848
8655
|
case "sqlite":
|
|
8849
8656
|
case "expo":
|
|
8850
8657
|
case "react-native": {
|
|
8851
|
-
|
|
8658
|
+
debug17("using sqlite/react-native migration file for DigitalCredential");
|
|
8852
8659
|
const mig = new CreateDigitalCredential1708525189002();
|
|
8853
8660
|
await mig.down(queryRunner);
|
|
8854
|
-
|
|
8661
|
+
debug17("SQLite Migration statements for DigitalCredential reverted");
|
|
8855
8662
|
return;
|
|
8856
8663
|
}
|
|
8857
8664
|
default:
|
|
@@ -8861,7 +8668,7 @@ var CreateDigitalCredential1708525189000 = class {
|
|
|
8861
8668
|
};
|
|
8862
8669
|
|
|
8863
8670
|
// src/migrations/generic/7-CreateMachineStateStore.ts
|
|
8864
|
-
import
|
|
8671
|
+
import Debug18 from "debug";
|
|
8865
8672
|
|
|
8866
8673
|
// src/migrations/postgres/1708797018115-CreateMachineStateStore.ts
|
|
8867
8674
|
var CreateMachineStateStore1708797018115 = class {
|
|
@@ -8923,30 +8730,30 @@ var CreateMachineStateStore1708796002272 = class {
|
|
|
8923
8730
|
};
|
|
8924
8731
|
|
|
8925
8732
|
// src/migrations/generic/7-CreateMachineStateStore.ts
|
|
8926
|
-
var
|
|
8733
|
+
var debug18 = Debug18("sphereon:ssi-sdk:migrations");
|
|
8927
8734
|
var CreateMachineStateStore1708098041262 = class {
|
|
8928
8735
|
static {
|
|
8929
8736
|
__name(this, "CreateMachineStateStore1708098041262");
|
|
8930
8737
|
}
|
|
8931
8738
|
name = "CreateMachineStateStore1708098041262";
|
|
8932
8739
|
async up(queryRunner) {
|
|
8933
|
-
|
|
8740
|
+
debug18("migration: creating machine state tables");
|
|
8934
8741
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8935
8742
|
switch (dbType) {
|
|
8936
8743
|
case "postgres": {
|
|
8937
|
-
|
|
8744
|
+
debug18("using postgres migration file");
|
|
8938
8745
|
const mig = new CreateMachineStateStore1708797018115();
|
|
8939
8746
|
await mig.up(queryRunner);
|
|
8940
|
-
|
|
8747
|
+
debug18("Migration statements executed");
|
|
8941
8748
|
return;
|
|
8942
8749
|
}
|
|
8943
8750
|
case "sqlite":
|
|
8944
8751
|
case "expo":
|
|
8945
8752
|
case "react-native": {
|
|
8946
|
-
|
|
8753
|
+
debug18("using sqlite/react-native migration file");
|
|
8947
8754
|
const mig = new CreateMachineStateStore1708796002272();
|
|
8948
8755
|
await mig.up(queryRunner);
|
|
8949
|
-
|
|
8756
|
+
debug18("Migration statements executed");
|
|
8950
8757
|
return;
|
|
8951
8758
|
}
|
|
8952
8759
|
default:
|
|
@@ -8954,23 +8761,23 @@ var CreateMachineStateStore1708098041262 = class {
|
|
|
8954
8761
|
}
|
|
8955
8762
|
}
|
|
8956
8763
|
async down(queryRunner) {
|
|
8957
|
-
|
|
8764
|
+
debug18("migration: reverting machine state tables");
|
|
8958
8765
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8959
8766
|
switch (dbType) {
|
|
8960
8767
|
case "postgres": {
|
|
8961
|
-
|
|
8768
|
+
debug18("using postgres migration file");
|
|
8962
8769
|
const mig = new CreateMachineStateStore1708797018115();
|
|
8963
8770
|
await mig.down(queryRunner);
|
|
8964
|
-
|
|
8771
|
+
debug18("Migration statements executed");
|
|
8965
8772
|
return;
|
|
8966
8773
|
}
|
|
8967
8774
|
case "sqlite":
|
|
8968
8775
|
case "expo":
|
|
8969
8776
|
case "react-native": {
|
|
8970
|
-
|
|
8777
|
+
debug18("using sqlite/react-native migration file");
|
|
8971
8778
|
const mig = new CreateMachineStateStore1708796002272();
|
|
8972
8779
|
await mig.down(queryRunner);
|
|
8973
|
-
|
|
8780
|
+
debug18("Migration statements executed");
|
|
8974
8781
|
return;
|
|
8975
8782
|
}
|
|
8976
8783
|
default:
|
|
@@ -8980,7 +8787,7 @@ var CreateMachineStateStore1708098041262 = class {
|
|
|
8980
8787
|
};
|
|
8981
8788
|
|
|
8982
8789
|
// src/migrations/generic/8-CreateContacts.ts
|
|
8983
|
-
import
|
|
8790
|
+
import Debug19 from "debug";
|
|
8984
8791
|
|
|
8985
8792
|
// src/migrations/postgres/1710438363001-CreateContacts.ts
|
|
8986
8793
|
var CreateContacts1710438363001 = class {
|
|
@@ -9094,30 +8901,30 @@ var CreateContacts1710438363002 = class {
|
|
|
9094
8901
|
};
|
|
9095
8902
|
|
|
9096
8903
|
// src/migrations/generic/8-CreateContacts.ts
|
|
9097
|
-
var
|
|
8904
|
+
var debug19 = Debug19("sphereon:ssi-sdk:migrations");
|
|
9098
8905
|
var CreateContacts1708525189000 = class {
|
|
9099
8906
|
static {
|
|
9100
8907
|
__name(this, "CreateContacts1708525189000");
|
|
9101
8908
|
}
|
|
9102
8909
|
name = "CreateContacts1708525189000";
|
|
9103
8910
|
async up(queryRunner) {
|
|
9104
|
-
|
|
8911
|
+
debug19("migration: updating contact tables");
|
|
9105
8912
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9106
8913
|
switch (dbType) {
|
|
9107
8914
|
case "postgres": {
|
|
9108
|
-
|
|
8915
|
+
debug19("using postgres migration file");
|
|
9109
8916
|
const mig = new CreateContacts1710438363001();
|
|
9110
8917
|
await mig.up(queryRunner);
|
|
9111
|
-
|
|
8918
|
+
debug19("Migration statements executed");
|
|
9112
8919
|
return;
|
|
9113
8920
|
}
|
|
9114
8921
|
case "sqlite":
|
|
9115
8922
|
case "expo":
|
|
9116
8923
|
case "react-native": {
|
|
9117
|
-
|
|
8924
|
+
debug19("using sqlite/react-native migration file");
|
|
9118
8925
|
const mig = new CreateContacts1710438363002();
|
|
9119
8926
|
await mig.up(queryRunner);
|
|
9120
|
-
|
|
8927
|
+
debug19("Migration statements executed");
|
|
9121
8928
|
return;
|
|
9122
8929
|
}
|
|
9123
8930
|
default:
|
|
@@ -9125,23 +8932,23 @@ var CreateContacts1708525189000 = class {
|
|
|
9125
8932
|
}
|
|
9126
8933
|
}
|
|
9127
8934
|
async down(queryRunner) {
|
|
9128
|
-
|
|
8935
|
+
debug19("migration: reverting machine state tables");
|
|
9129
8936
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9130
8937
|
switch (dbType) {
|
|
9131
8938
|
case "postgres": {
|
|
9132
|
-
|
|
8939
|
+
debug19("using postgres migration file");
|
|
9133
8940
|
const mig = new CreateContacts1710438363001();
|
|
9134
8941
|
await mig.down(queryRunner);
|
|
9135
|
-
|
|
8942
|
+
debug19("Migration statements executed");
|
|
9136
8943
|
return;
|
|
9137
8944
|
}
|
|
9138
8945
|
case "sqlite":
|
|
9139
8946
|
case "expo":
|
|
9140
8947
|
case "react-native": {
|
|
9141
|
-
|
|
8948
|
+
debug19("using sqlite/react-native migration file");
|
|
9142
8949
|
const mig = new CreateContacts1710438363002();
|
|
9143
8950
|
await mig.down(queryRunner);
|
|
9144
|
-
|
|
8951
|
+
debug19("Migration statements executed");
|
|
9145
8952
|
return;
|
|
9146
8953
|
}
|
|
9147
8954
|
default:
|
|
@@ -9151,7 +8958,7 @@ var CreateContacts1708525189000 = class {
|
|
|
9151
8958
|
};
|
|
9152
8959
|
|
|
9153
8960
|
// src/migrations/generic/9-CreateContacts.ts
|
|
9154
|
-
import
|
|
8961
|
+
import Debug20 from "debug";
|
|
9155
8962
|
|
|
9156
8963
|
// src/migrations/postgres/1715761125001-CreateContacts.ts
|
|
9157
8964
|
var CreateContacts1715761125001 = class {
|
|
@@ -9263,30 +9070,30 @@ var CreateContacts1715761125002 = class {
|
|
|
9263
9070
|
};
|
|
9264
9071
|
|
|
9265
9072
|
// src/migrations/generic/9-CreateContacts.ts
|
|
9266
|
-
var
|
|
9073
|
+
var debug20 = Debug20("sphereon:ssi-sdk:migrations");
|
|
9267
9074
|
var CreateContacts1715761125000 = class {
|
|
9268
9075
|
static {
|
|
9269
9076
|
__name(this, "CreateContacts1715761125000");
|
|
9270
9077
|
}
|
|
9271
9078
|
name = "CreateContacts1715761125000";
|
|
9272
9079
|
async up(queryRunner) {
|
|
9273
|
-
|
|
9080
|
+
debug20("migration: updating contact tables");
|
|
9274
9081
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9275
9082
|
switch (dbType) {
|
|
9276
9083
|
case "postgres": {
|
|
9277
|
-
|
|
9084
|
+
debug20("using postgres migration file");
|
|
9278
9085
|
const mig = new CreateContacts1715761125001();
|
|
9279
9086
|
await mig.up(queryRunner);
|
|
9280
|
-
|
|
9087
|
+
debug20("Migration statements executed");
|
|
9281
9088
|
return;
|
|
9282
9089
|
}
|
|
9283
9090
|
case "sqlite":
|
|
9284
9091
|
case "expo":
|
|
9285
9092
|
case "react-native": {
|
|
9286
|
-
|
|
9093
|
+
debug20("using sqlite/react-native migration file");
|
|
9287
9094
|
const mig = new CreateContacts1715761125002();
|
|
9288
9095
|
await mig.up(queryRunner);
|
|
9289
|
-
|
|
9096
|
+
debug20("Migration statements executed");
|
|
9290
9097
|
return;
|
|
9291
9098
|
}
|
|
9292
9099
|
default:
|
|
@@ -9294,23 +9101,23 @@ var CreateContacts1715761125000 = class {
|
|
|
9294
9101
|
}
|
|
9295
9102
|
}
|
|
9296
9103
|
async down(queryRunner) {
|
|
9297
|
-
|
|
9104
|
+
debug20("migration: reverting machine state tables");
|
|
9298
9105
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9299
9106
|
switch (dbType) {
|
|
9300
9107
|
case "postgres": {
|
|
9301
|
-
|
|
9108
|
+
debug20("using postgres migration file");
|
|
9302
9109
|
const mig = new CreateContacts1715761125001();
|
|
9303
9110
|
await mig.down(queryRunner);
|
|
9304
|
-
|
|
9111
|
+
debug20("Migration statements executed");
|
|
9305
9112
|
return;
|
|
9306
9113
|
}
|
|
9307
9114
|
case "sqlite":
|
|
9308
9115
|
case "expo":
|
|
9309
9116
|
case "react-native": {
|
|
9310
|
-
|
|
9117
|
+
debug20("using sqlite/react-native migration file");
|
|
9311
9118
|
const mig = new CreateContacts1715761125002();
|
|
9312
9119
|
await mig.down(queryRunner);
|
|
9313
|
-
|
|
9120
|
+
debug20("Migration statements executed");
|
|
9314
9121
|
return;
|
|
9315
9122
|
}
|
|
9316
9123
|
default:
|
|
@@ -9339,8 +9146,7 @@ var DataStoreEventLoggerMigrations = [
|
|
|
9339
9146
|
CreateAuditEvents1701635835330
|
|
9340
9147
|
];
|
|
9341
9148
|
var DataStoreDigitalCredentialMigrations = [
|
|
9342
|
-
CreateDigitalCredential1708525189000
|
|
9343
|
-
AddLinkedVpFields1763387280000
|
|
9149
|
+
CreateDigitalCredential1708525189000
|
|
9344
9150
|
];
|
|
9345
9151
|
var DataStoreMachineStateMigrations = [
|
|
9346
9152
|
CreateMachineStateStore1708098041262
|
|
@@ -9361,7 +9167,7 @@ var DataStoreMigrations = [
|
|
|
9361
9167
|
|
|
9362
9168
|
// src/utils/digitalCredential/MappingUtils.ts
|
|
9363
9169
|
import { defaultHasher } from "@sphereon/ssi-sdk.core";
|
|
9364
|
-
import { CredentialDocumentFormat as CredentialDocumentFormat2,
|
|
9170
|
+
import { CredentialDocumentFormat as CredentialDocumentFormat2, DocumentType as DocumentType2, RegulationType as RegulationType2 } from "@sphereon/ssi-sdk.data-store-types";
|
|
9365
9171
|
import { CredentialMapper, DocumentFormat, ObjectUtils } from "@sphereon/ssi-types";
|
|
9366
9172
|
import { computeEntryHash } from "@veramo/utils";
|
|
9367
9173
|
function determineDocumentType(raw) {
|
|
@@ -9412,18 +9218,6 @@ function determineCredentialDocumentFormat(documentFormat) {
|
|
|
9412
9218
|
}
|
|
9413
9219
|
}
|
|
9414
9220
|
__name(determineCredentialDocumentFormat, "determineCredentialDocumentFormat");
|
|
9415
|
-
function normalizeNullableFields(obj, nullableKeys) {
|
|
9416
|
-
const normalized = {
|
|
9417
|
-
...obj
|
|
9418
|
-
};
|
|
9419
|
-
for (const key of nullableKeys) {
|
|
9420
|
-
if (normalized[key] === void 0) {
|
|
9421
|
-
normalized[key] = null;
|
|
9422
|
-
}
|
|
9423
|
-
}
|
|
9424
|
-
return normalized;
|
|
9425
|
-
}
|
|
9426
|
-
__name(normalizeNullableFields, "normalizeNullableFields");
|
|
9427
9221
|
function getValidUntil(uniformDocument) {
|
|
9428
9222
|
if ("expirationDate" in uniformDocument && uniformDocument.expirationDate) {
|
|
9429
9223
|
return new Date(uniformDocument.expirationDate);
|
|
@@ -9486,34 +9280,6 @@ var nonPersistedDigitalCredentialEntityFromAddArgs = /* @__PURE__ */ __name((add
|
|
|
9486
9280
|
lastUpdatedAt: /* @__PURE__ */ new Date()
|
|
9487
9281
|
};
|
|
9488
9282
|
}, "nonPersistedDigitalCredentialEntityFromAddArgs");
|
|
9489
|
-
var persistedDigitalCredentialEntityFromUpdateArgs = /* @__PURE__ */ __name((existingCredential, updates) => {
|
|
9490
|
-
const entity = new DigitalCredentialEntity();
|
|
9491
|
-
Object.assign(entity, existingCredential);
|
|
9492
|
-
const normalizedUpdates = normalizeNullableFields(updates, [
|
|
9493
|
-
"linkedVpId",
|
|
9494
|
-
"linkedVpFrom",
|
|
9495
|
-
"linkedVpUntil"
|
|
9496
|
-
]);
|
|
9497
|
-
Object.assign(entity, normalizedUpdates);
|
|
9498
|
-
entity.id = existingCredential.id;
|
|
9499
|
-
entity.hash = existingCredential.hash;
|
|
9500
|
-
entity.createdAt = existingCredential.createdAt;
|
|
9501
|
-
entity.lastUpdatedAt = /* @__PURE__ */ new Date();
|
|
9502
|
-
return entity;
|
|
9503
|
-
}, "persistedDigitalCredentialEntityFromUpdateArgs");
|
|
9504
|
-
var persistedDigitalCredentialEntityFromStateArgs = /* @__PURE__ */ __name((existingCredential, args) => {
|
|
9505
|
-
const entity = new DigitalCredentialEntity();
|
|
9506
|
-
Object.assign(entity, existingCredential);
|
|
9507
|
-
entity.verifiedState = args.verifiedState;
|
|
9508
|
-
entity.lastUpdatedAt = /* @__PURE__ */ new Date();
|
|
9509
|
-
if (args.verifiedState === CredentialStateType3.REVOKED && args.revokedAt) {
|
|
9510
|
-
entity.revokedAt = args.revokedAt;
|
|
9511
|
-
}
|
|
9512
|
-
if (args.verifiedState !== CredentialStateType3.REVOKED && args.verifiedAt) {
|
|
9513
|
-
entity.verifiedAt = args.verifiedAt;
|
|
9514
|
-
}
|
|
9515
|
-
return entity;
|
|
9516
|
-
}, "persistedDigitalCredentialEntityFromStateArgs");
|
|
9517
9283
|
var digitalCredentialFrom = /* @__PURE__ */ __name((credentialEntity) => {
|
|
9518
9284
|
const result = {
|
|
9519
9285
|
...credentialEntity
|
|
@@ -9690,7 +9456,6 @@ export {
|
|
|
9690
9456
|
naturalPersonEntityFrom,
|
|
9691
9457
|
naturalPersonFrom,
|
|
9692
9458
|
nonPersistedDigitalCredentialEntityFromAddArgs,
|
|
9693
|
-
normalizeNullableFields,
|
|
9694
9459
|
openIdConfigEntityFrom,
|
|
9695
9460
|
openIdConfigFrom,
|
|
9696
9461
|
organizationEntityFrom,
|
|
@@ -9702,8 +9467,6 @@ export {
|
|
|
9702
9467
|
partyRelationshipFrom,
|
|
9703
9468
|
partyTypeEntityFrom,
|
|
9704
9469
|
partyTypeFrom,
|
|
9705
|
-
persistedDigitalCredentialEntityFromStateArgs,
|
|
9706
|
-
persistedDigitalCredentialEntityFromUpdateArgs,
|
|
9707
9470
|
physicalAddressEntityFrom,
|
|
9708
9471
|
physicalAddressFrom,
|
|
9709
9472
|
textAttributesEntityFrom
|