@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.cjs
CHANGED
|
@@ -133,7 +133,6 @@ __export(index_exports, {
|
|
|
133
133
|
naturalPersonEntityFrom: () => naturalPersonEntityFrom,
|
|
134
134
|
naturalPersonFrom: () => naturalPersonFrom,
|
|
135
135
|
nonPersistedDigitalCredentialEntityFromAddArgs: () => nonPersistedDigitalCredentialEntityFromAddArgs,
|
|
136
|
-
normalizeNullableFields: () => normalizeNullableFields,
|
|
137
136
|
openIdConfigEntityFrom: () => openIdConfigEntityFrom,
|
|
138
137
|
openIdConfigFrom: () => openIdConfigFrom,
|
|
139
138
|
organizationEntityFrom: () => organizationEntityFrom,
|
|
@@ -145,8 +144,6 @@ __export(index_exports, {
|
|
|
145
144
|
partyRelationshipFrom: () => partyRelationshipFrom,
|
|
146
145
|
partyTypeEntityFrom: () => partyTypeEntityFrom,
|
|
147
146
|
partyTypeFrom: () => partyTypeFrom,
|
|
148
|
-
persistedDigitalCredentialEntityFromStateArgs: () => persistedDigitalCredentialEntityFromStateArgs,
|
|
149
|
-
persistedDigitalCredentialEntityFromUpdateArgs: () => persistedDigitalCredentialEntityFromUpdateArgs,
|
|
150
147
|
physicalAddressEntityFrom: () => physicalAddressEntityFrom,
|
|
151
148
|
physicalAddressFrom: () => physicalAddressFrom,
|
|
152
149
|
textAttributesEntityFrom: () => textAttributesEntityFrom
|
|
@@ -2074,9 +2071,6 @@ var DigitalCredentialEntity = class extends import_typeorm17.BaseEntity {
|
|
|
2074
2071
|
rpCorrelationId;
|
|
2075
2072
|
verifiedState;
|
|
2076
2073
|
tenantId;
|
|
2077
|
-
linkedVpId;
|
|
2078
|
-
linkedVpFrom;
|
|
2079
|
-
linkedVpUntil;
|
|
2080
2074
|
createdAt;
|
|
2081
2075
|
presentedAt;
|
|
2082
2076
|
lastUpdatedAt;
|
|
@@ -2239,29 +2233,6 @@ _ts_decorate18([
|
|
|
2239
2233
|
}),
|
|
2240
2234
|
_ts_metadata17("design:type", String)
|
|
2241
2235
|
], DigitalCredentialEntity.prototype, "tenantId", void 0);
|
|
2242
|
-
_ts_decorate18([
|
|
2243
|
-
(0, import_typeorm17.Column)("text", {
|
|
2244
|
-
name: "linked_vp_id",
|
|
2245
|
-
nullable: true
|
|
2246
|
-
}),
|
|
2247
|
-
_ts_metadata17("design:type", String)
|
|
2248
|
-
], DigitalCredentialEntity.prototype, "linkedVpId", void 0);
|
|
2249
|
-
_ts_decorate18([
|
|
2250
|
-
(0, import_typeorm17.CreateDateColumn)({
|
|
2251
|
-
name: "linked_vp_from",
|
|
2252
|
-
nullable: true,
|
|
2253
|
-
type: (0, import_ssi_sdk14.typeOrmDateTime)()
|
|
2254
|
-
}),
|
|
2255
|
-
_ts_metadata17("design:type", typeof Date === "undefined" ? Object : Date)
|
|
2256
|
-
], DigitalCredentialEntity.prototype, "linkedVpFrom", void 0);
|
|
2257
|
-
_ts_decorate18([
|
|
2258
|
-
(0, import_typeorm17.CreateDateColumn)({
|
|
2259
|
-
name: "linked_vp_until",
|
|
2260
|
-
nullable: true,
|
|
2261
|
-
type: (0, import_ssi_sdk14.typeOrmDateTime)()
|
|
2262
|
-
}),
|
|
2263
|
-
_ts_metadata17("design:type", typeof Date === "undefined" ? Object : Date)
|
|
2264
|
-
], DigitalCredentialEntity.prototype, "linkedVpUntil", void 0);
|
|
2265
2236
|
_ts_decorate18([
|
|
2266
2237
|
(0, import_typeorm17.CreateDateColumn)({
|
|
2267
2238
|
name: "created_at",
|
|
@@ -5395,7 +5366,6 @@ var ContactStore = class extends import_ssi_sdk25.AbstractContactStore {
|
|
|
5395
5366
|
var import_ssi_sdk26 = require("@sphereon/ssi-sdk.data-store-types");
|
|
5396
5367
|
var import_ssi_types4 = require("@sphereon/ssi-types");
|
|
5397
5368
|
var import_debug2 = __toESM(require("debug"), 1);
|
|
5398
|
-
var import_typeorm36 = require("typeorm");
|
|
5399
5369
|
|
|
5400
5370
|
// src/utils/SortingUtils.ts
|
|
5401
5371
|
var parseAndValidateOrderOptions = /* @__PURE__ */ __name((order) => {
|
|
@@ -5449,25 +5419,8 @@ var DigitalCredentialStore = class extends import_ssi_sdk26.AbstractDigitalCrede
|
|
|
5449
5419
|
const { filter = {}, offset, limit, order = "createdAt.asc" } = args ?? {};
|
|
5450
5420
|
const sortOptions = order && typeof order === "string" ? parseAndValidateOrderOptions(order) : order;
|
|
5451
5421
|
const dcRepo = await this.getRepository();
|
|
5452
|
-
const processLinkedVpUntil = /* @__PURE__ */ __name((filterItem) => {
|
|
5453
|
-
const processed = {
|
|
5454
|
-
...filterItem
|
|
5455
|
-
};
|
|
5456
|
-
if (filterItem.linkedVpUntil) {
|
|
5457
|
-
processed.linkedVpUntil = (0, import_typeorm36.LessThanOrEqual)(filterItem.linkedVpUntil);
|
|
5458
|
-
}
|
|
5459
|
-
return processed;
|
|
5460
|
-
}, "processLinkedVpUntil");
|
|
5461
|
-
let whereClause;
|
|
5462
|
-
if (Array.isArray(filter) && filter.length > 0) {
|
|
5463
|
-
whereClause = filter.map(processLinkedVpUntil);
|
|
5464
|
-
} else if (Object.keys(filter).length > 0) {
|
|
5465
|
-
whereClause = processLinkedVpUntil(filter);
|
|
5466
|
-
} else {
|
|
5467
|
-
whereClause = filter;
|
|
5468
|
-
}
|
|
5469
5422
|
const [result, total] = await dcRepo.findAndCount({
|
|
5470
|
-
where:
|
|
5423
|
+
where: filter,
|
|
5471
5424
|
skip: offset,
|
|
5472
5425
|
take: limit,
|
|
5473
5426
|
order: sortOptions
|
|
@@ -5477,34 +5430,6 @@ var DigitalCredentialStore = class extends import_ssi_sdk26.AbstractDigitalCrede
|
|
|
5477
5430
|
total
|
|
5478
5431
|
};
|
|
5479
5432
|
}, "getCredentials");
|
|
5480
|
-
updateCredential = /* @__PURE__ */ __name(async (args) => {
|
|
5481
|
-
const dcRepo = await this.getRepository();
|
|
5482
|
-
const whereClause = {};
|
|
5483
|
-
if ("id" in args) {
|
|
5484
|
-
whereClause.id = args.id;
|
|
5485
|
-
} else if ("hash" in args) {
|
|
5486
|
-
whereClause.hash = args.hash;
|
|
5487
|
-
} else {
|
|
5488
|
-
return Promise.reject(Error("No id or hash param is provided."));
|
|
5489
|
-
}
|
|
5490
|
-
const credential = await dcRepo.findOne({
|
|
5491
|
-
where: whereClause
|
|
5492
|
-
});
|
|
5493
|
-
if (!credential) {
|
|
5494
|
-
return Promise.reject(Error(`No credential found for args: ${JSON.stringify(whereClause)}`));
|
|
5495
|
-
}
|
|
5496
|
-
const updates = Object.fromEntries(Object.entries(args).filter(([key]) => key !== "id" && key !== "hash"));
|
|
5497
|
-
const entityToSave = persistedDigitalCredentialEntityFromUpdateArgs(credential, updates);
|
|
5498
|
-
const validationError = this.assertValidDigitalCredential(entityToSave);
|
|
5499
|
-
if (validationError) {
|
|
5500
|
-
return Promise.reject(validationError);
|
|
5501
|
-
}
|
|
5502
|
-
debug2("Updating credential", entityToSave);
|
|
5503
|
-
const updatedResult = await dcRepo.save(entityToSave, {
|
|
5504
|
-
transaction: true
|
|
5505
|
-
});
|
|
5506
|
-
return digitalCredentialFrom(updatedResult);
|
|
5507
|
-
}, "updateCredential");
|
|
5508
5433
|
removeCredential = /* @__PURE__ */ __name(async (args) => {
|
|
5509
5434
|
if (!args) {
|
|
5510
5435
|
return false;
|
|
@@ -5575,9 +5500,20 @@ var DigitalCredentialStore = class extends import_ssi_sdk26.AbstractDigitalCrede
|
|
|
5575
5500
|
if (!credential) {
|
|
5576
5501
|
return Promise.reject(Error(`No credential found for args: ${JSON.stringify(whereClause)}`));
|
|
5577
5502
|
}
|
|
5578
|
-
const
|
|
5579
|
-
|
|
5580
|
-
|
|
5503
|
+
const updatedCredential = {
|
|
5504
|
+
...credential,
|
|
5505
|
+
...args.verifiedState !== import_ssi_sdk26.CredentialStateType.REVOKED && {
|
|
5506
|
+
verifiedAt: args.verifiedAt
|
|
5507
|
+
},
|
|
5508
|
+
...args.verifiedState === import_ssi_sdk26.CredentialStateType.REVOKED && {
|
|
5509
|
+
revokedAt: args.revokedAt
|
|
5510
|
+
},
|
|
5511
|
+
identifierMethod: credential.identifierMethod,
|
|
5512
|
+
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
5513
|
+
verifiedState: args.verifiedState
|
|
5514
|
+
};
|
|
5515
|
+
debug2("Updating credential", credential);
|
|
5516
|
+
const updatedResult = await credentialRepository.save(updatedCredential, {
|
|
5581
5517
|
transaction: true
|
|
5582
5518
|
});
|
|
5583
5519
|
return digitalCredentialFrom(updatedResult);
|
|
@@ -5599,7 +5535,7 @@ var DigitalCredentialStore = class extends import_ssi_sdk26.AbstractDigitalCrede
|
|
|
5599
5535
|
// src/issuanceBranding/IssuanceBrandingStore.ts
|
|
5600
5536
|
var import_ssi_sdk27 = require("@sphereon/ssi-sdk.data-store-types");
|
|
5601
5537
|
var import_debug3 = __toESM(require("debug"), 1);
|
|
5602
|
-
var
|
|
5538
|
+
var import_typeorm36 = require("typeorm");
|
|
5603
5539
|
|
|
5604
5540
|
// src/utils/issuanceBranding/MappingUtils.ts
|
|
5605
5541
|
var credentialBrandingFrom = /* @__PURE__ */ __name((credentialBranding) => {
|
|
@@ -5793,7 +5729,7 @@ var IssuanceBrandingStore = class extends import_ssi_sdk27.AbstractIssuanceBrand
|
|
|
5793
5729
|
credentialBranding: {
|
|
5794
5730
|
id: credentialBrandingId
|
|
5795
5731
|
},
|
|
5796
|
-
locale: (0,
|
|
5732
|
+
locale: (0, import_typeorm36.In)(localeBranding.map((localeBranding2) => localeBranding2.locale))
|
|
5797
5733
|
}
|
|
5798
5734
|
});
|
|
5799
5735
|
if (locales && locales.length > 0) {
|
|
@@ -5861,7 +5797,7 @@ var IssuanceBrandingStore = class extends import_ssi_sdk27.AbstractIssuanceBrand
|
|
|
5861
5797
|
credentialBranding: {
|
|
5862
5798
|
id: result.credentialBrandingId
|
|
5863
5799
|
},
|
|
5864
|
-
id: (0,
|
|
5800
|
+
id: (0, import_typeorm36.Not)((0, import_typeorm36.In)([
|
|
5865
5801
|
localeBranding.id
|
|
5866
5802
|
])),
|
|
5867
5803
|
locale: localeBranding.locale
|
|
@@ -5964,7 +5900,7 @@ var IssuanceBrandingStore = class extends import_ssi_sdk27.AbstractIssuanceBrand
|
|
|
5964
5900
|
issuerBranding: {
|
|
5965
5901
|
id: issuerBrandingId
|
|
5966
5902
|
},
|
|
5967
|
-
locale: (0,
|
|
5903
|
+
locale: (0, import_typeorm36.In)(localeBranding.map((localeBranding2) => localeBranding2.locale))
|
|
5968
5904
|
}
|
|
5969
5905
|
});
|
|
5970
5906
|
if (locales && locales.length > 0) {
|
|
@@ -6032,7 +5968,7 @@ var IssuanceBrandingStore = class extends import_ssi_sdk27.AbstractIssuanceBrand
|
|
|
6032
5968
|
issuerBranding: {
|
|
6033
5969
|
id: result.issuerBrandingId
|
|
6034
5970
|
},
|
|
6035
|
-
id: (0,
|
|
5971
|
+
id: (0, import_typeorm36.Not)((0, import_typeorm36.In)([
|
|
6036
5972
|
localeBranding.id
|
|
6037
5973
|
])),
|
|
6038
5974
|
locale: localeBranding.locale
|
|
@@ -6094,7 +6030,7 @@ var IssuanceBrandingStore = class extends import_ssi_sdk27.AbstractIssuanceBrand
|
|
|
6094
6030
|
// src/statusList/StatusListStore.ts
|
|
6095
6031
|
var import_ssi_types6 = require("@sphereon/ssi-types");
|
|
6096
6032
|
var import_debug4 = __toESM(require("debug"), 1);
|
|
6097
|
-
var
|
|
6033
|
+
var import_typeorm37 = require("typeorm");
|
|
6098
6034
|
|
|
6099
6035
|
// src/utils/statusList/MappingUtils.ts
|
|
6100
6036
|
var import_ssi_types5 = require("@sphereon/ssi-types");
|
|
@@ -6234,7 +6170,7 @@ var StatusListStore = class {
|
|
|
6234
6170
|
const results = (await repo.find({
|
|
6235
6171
|
where: {
|
|
6236
6172
|
statusListId: statusList.id,
|
|
6237
|
-
statusListIndex: (0,
|
|
6173
|
+
statusListIndex: (0, import_typeorm37.In)(statusListIndex)
|
|
6238
6174
|
}
|
|
6239
6175
|
})).map((index) => index.statusListIndex);
|
|
6240
6176
|
return statusListIndex.filter((index) => !results.includes(index));
|
|
@@ -6704,7 +6640,7 @@ var EventLoggerStore = class extends import_ssi_sdk28.AbstractEventLoggerStore {
|
|
|
6704
6640
|
// src/machineState/MachineStateStore.ts
|
|
6705
6641
|
var import_ssi_sdk29 = require("@sphereon/ssi-sdk.data-store-types");
|
|
6706
6642
|
var import_debug6 = __toESM(require("debug"), 1);
|
|
6707
|
-
var
|
|
6643
|
+
var import_typeorm38 = require("typeorm");
|
|
6708
6644
|
var debug6 = (0, import_debug6.default)("sphereon:ssi-sdk:machine-state:store");
|
|
6709
6645
|
var MachineStateStore = class _MachineStateStore extends import_ssi_sdk29.IAbstractMachineStateStore {
|
|
6710
6646
|
static {
|
|
@@ -6740,7 +6676,7 @@ var MachineStateStore = class _MachineStateStore extends import_ssi_sdk29.IAbstr
|
|
|
6740
6676
|
const { tenantId, machineName, instanceId } = args;
|
|
6741
6677
|
const connection = await this._dbConnection;
|
|
6742
6678
|
debug6(`Executing findActiveMachineStates query with machineName: ${machineName}, tenantId: ${tenantId}`);
|
|
6743
|
-
const queryBuilder = connection.getRepository(MachineStateInfoEntity).createQueryBuilder("state").where("state.completedAt IS NULL").andWhere(new
|
|
6679
|
+
const queryBuilder = connection.getRepository(MachineStateInfoEntity).createQueryBuilder("state").where("state.completedAt IS NULL").andWhere(new import_typeorm38.Brackets((qb) => {
|
|
6744
6680
|
qb.where("state.expiresAt IS NULL").orWhere("state.expiresAt > :now", {
|
|
6745
6681
|
now: /* @__PURE__ */ new Date()
|
|
6746
6682
|
});
|
|
@@ -6810,10 +6746,10 @@ var MachineStateStore = class _MachineStateStore extends import_ssi_sdk29.IAbstr
|
|
|
6810
6746
|
},
|
|
6811
6747
|
// When deleteOnDone state is set we only look at completedAt, in other cases we compare current time with expiresAt
|
|
6812
6748
|
...!deleteDoneStates && {
|
|
6813
|
-
expiresAt: (0,
|
|
6749
|
+
expiresAt: (0, import_typeorm38.LessThan)(/* @__PURE__ */ new Date())
|
|
6814
6750
|
},
|
|
6815
6751
|
...deleteDoneStates && {
|
|
6816
|
-
completedAt: (0,
|
|
6752
|
+
completedAt: (0, import_typeorm38.Not)((0, import_typeorm38.IsNull)())
|
|
6817
6753
|
}
|
|
6818
6754
|
};
|
|
6819
6755
|
const result = await connection.getRepository(MachineStateInfoEntity).delete(deleteCriteria);
|
|
@@ -6836,7 +6772,7 @@ var MachineStateStore = class _MachineStateStore extends import_ssi_sdk29.IAbstr
|
|
|
6836
6772
|
// src/presentationDefinition/PDStore.ts
|
|
6837
6773
|
var import_ssi_sdk30 = require("@sphereon/ssi-sdk.data-store-types");
|
|
6838
6774
|
var import_debug7 = __toESM(require("debug"), 1);
|
|
6839
|
-
var
|
|
6775
|
+
var import_typeorm39 = require("typeorm");
|
|
6840
6776
|
|
|
6841
6777
|
// src/utils/presentationDefinition/MappingUtils.ts
|
|
6842
6778
|
var blakepkg = __toESM(require("blakejs"), 1);
|
|
@@ -6941,7 +6877,7 @@ var PDStore = class extends import_ssi_sdk30.AbstractPDStore {
|
|
|
6941
6877
|
const initialResult = await this.findIds(pdRepository, filter);
|
|
6942
6878
|
const result = await pdRepository.find({
|
|
6943
6879
|
where: {
|
|
6944
|
-
id: (0,
|
|
6880
|
+
id: (0, import_typeorm39.In)(initialResult.map((entity) => entity.id))
|
|
6945
6881
|
},
|
|
6946
6882
|
order: {
|
|
6947
6883
|
version: "DESC"
|
|
@@ -7003,7 +6939,7 @@ var PDStore = class extends import_ssi_sdk30.AbstractPDStore {
|
|
|
7003
6939
|
const initialResult = await this.findIds(pdRepository, filter);
|
|
7004
6940
|
const result = await pdRepository.find({
|
|
7005
6941
|
where: {
|
|
7006
|
-
id: (0,
|
|
6942
|
+
id: (0, import_typeorm39.In)(initialResult.map((entity) => entity.id))
|
|
7007
6943
|
}
|
|
7008
6944
|
});
|
|
7009
6945
|
for (const entity of result) {
|
|
@@ -7017,7 +6953,7 @@ var PDStore = class extends import_ssi_sdk30.AbstractPDStore {
|
|
|
7017
6953
|
if (idFilters && idFilters.length > 0 && idFilters.length === filter?.length) {
|
|
7018
6954
|
return await pdRepository.find({
|
|
7019
6955
|
where: {
|
|
7020
|
-
id: (0,
|
|
6956
|
+
id: (0, import_typeorm39.In)(idFilters)
|
|
7021
6957
|
}
|
|
7022
6958
|
});
|
|
7023
6959
|
} else {
|
|
@@ -7962,164 +7898,32 @@ var CreateDcqlQueryItem1726617600000 = class {
|
|
|
7962
7898
|
}
|
|
7963
7899
|
};
|
|
7964
7900
|
|
|
7965
|
-
// src/migrations/generic/
|
|
7901
|
+
// src/migrations/generic/2-CreateIssuanceBranding.ts
|
|
7966
7902
|
var import_debug13 = __toESM(require("debug"), 1);
|
|
7967
|
-
|
|
7968
|
-
// src/migrations/postgres/1763387280001-AddLinkedVpFields.ts
|
|
7969
|
-
var AddLinkedVpFields1763387280001 = class {
|
|
7970
|
-
static {
|
|
7971
|
-
__name(this, "AddLinkedVpFields1763387280001");
|
|
7972
|
-
}
|
|
7973
|
-
name = "AddLinkedVpFields1763387280001";
|
|
7974
|
-
async up(queryRunner) {
|
|
7975
|
-
await queryRunner.query(`
|
|
7976
|
-
ALTER TABLE "DigitalCredential"
|
|
7977
|
-
ADD COLUMN "linked_vp_id" text
|
|
7978
|
-
`);
|
|
7979
|
-
await queryRunner.query(`
|
|
7980
|
-
ALTER TABLE "DigitalCredential"
|
|
7981
|
-
ADD COLUMN "linked_vp_from" TIMESTAMP
|
|
7982
|
-
`);
|
|
7983
|
-
await queryRunner.query(`
|
|
7984
|
-
ALTER TABLE "DigitalCredential"
|
|
7985
|
-
ADD COLUMN "linked_vp_until" TIMESTAMP
|
|
7986
|
-
`);
|
|
7987
|
-
}
|
|
7988
|
-
async down(queryRunner) {
|
|
7989
|
-
await queryRunner.query(`
|
|
7990
|
-
ALTER TABLE "DigitalCredential"
|
|
7991
|
-
DROP COLUMN "linked_vp_until"
|
|
7992
|
-
`);
|
|
7993
|
-
await queryRunner.query(`
|
|
7994
|
-
ALTER TABLE "DigitalCredential"
|
|
7995
|
-
DROP COLUMN "linked_vp_from"
|
|
7996
|
-
`);
|
|
7997
|
-
await queryRunner.query(`
|
|
7998
|
-
ALTER TABLE "DigitalCredential"
|
|
7999
|
-
DROP COLUMN "linked_vp_id"
|
|
8000
|
-
`);
|
|
8001
|
-
}
|
|
8002
|
-
};
|
|
8003
|
-
|
|
8004
|
-
// src/migrations/sqlite/1763387280002-AddLinkedVpFields.ts
|
|
8005
|
-
var AddLinkedVpFields1763387280002 = class {
|
|
8006
|
-
static {
|
|
8007
|
-
__name(this, "AddLinkedVpFields1763387280002");
|
|
8008
|
-
}
|
|
8009
|
-
name = "AddLinkedVpFields1763387280002";
|
|
8010
|
-
async up(queryRunner) {
|
|
8011
|
-
await queryRunner.query(`
|
|
8012
|
-
ALTER TABLE "DigitalCredential"
|
|
8013
|
-
ADD COLUMN "linked_vp_id" text
|
|
8014
|
-
`);
|
|
8015
|
-
await queryRunner.query(`
|
|
8016
|
-
ALTER TABLE "DigitalCredential"
|
|
8017
|
-
ADD COLUMN "linked_vp_from" datetime
|
|
8018
|
-
`);
|
|
8019
|
-
await queryRunner.query(`
|
|
8020
|
-
ALTER TABLE "DigitalCredential"
|
|
8021
|
-
ADD COLUMN "linked_vp_until" datetime
|
|
8022
|
-
`);
|
|
8023
|
-
}
|
|
8024
|
-
async down(queryRunner) {
|
|
8025
|
-
await queryRunner.query(`
|
|
8026
|
-
ALTER TABLE "DigitalCredential"
|
|
8027
|
-
DROP COLUMN "linked_vp_from"
|
|
8028
|
-
`);
|
|
8029
|
-
await queryRunner.query(`
|
|
8030
|
-
ALTER TABLE "DigitalCredential"
|
|
8031
|
-
DROP COLUMN "linked_vp_until"
|
|
8032
|
-
`);
|
|
8033
|
-
await queryRunner.query(`
|
|
8034
|
-
ALTER TABLE "DigitalCredential"
|
|
8035
|
-
DROP COLUMN "linked_vp_id"
|
|
8036
|
-
`);
|
|
8037
|
-
}
|
|
8038
|
-
};
|
|
8039
|
-
|
|
8040
|
-
// src/migrations/generic/14-AddLinkedVpFields.ts
|
|
8041
7903
|
var debug13 = (0, import_debug13.default)("sphereon:ssi-sdk:migrations");
|
|
8042
|
-
var AddLinkedVpFields1763387280000 = class {
|
|
8043
|
-
static {
|
|
8044
|
-
__name(this, "AddLinkedVpFields1763387280000");
|
|
8045
|
-
}
|
|
8046
|
-
name = "AddLinkedVpFields1763387280000";
|
|
8047
|
-
async up(queryRunner) {
|
|
8048
|
-
debug13("migration: adding linked VP fields to DigitalCredential table");
|
|
8049
|
-
const dbType = queryRunner.connection.driver.options.type;
|
|
8050
|
-
switch (dbType) {
|
|
8051
|
-
case "postgres": {
|
|
8052
|
-
debug13("using postgres migration file for AddLinkedVpFields");
|
|
8053
|
-
const mig = new AddLinkedVpFields1763387280001();
|
|
8054
|
-
await mig.up(queryRunner);
|
|
8055
|
-
debug13("Postgres migration statements for AddLinkedVpFields executed");
|
|
8056
|
-
return;
|
|
8057
|
-
}
|
|
8058
|
-
case "sqlite":
|
|
8059
|
-
case "expo":
|
|
8060
|
-
case "react-native": {
|
|
8061
|
-
debug13("using sqlite/react-native migration file for AddLinkedVpFields");
|
|
8062
|
-
const mig = new AddLinkedVpFields1763387280002();
|
|
8063
|
-
await mig.up(queryRunner);
|
|
8064
|
-
debug13("SQLite migration statements for AddLinkedVpFields executed");
|
|
8065
|
-
return;
|
|
8066
|
-
}
|
|
8067
|
-
default:
|
|
8068
|
-
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`);
|
|
8069
|
-
}
|
|
8070
|
-
}
|
|
8071
|
-
async down(queryRunner) {
|
|
8072
|
-
debug13("migration: reverting linked VP fields from DigitalCredential table");
|
|
8073
|
-
const dbType = queryRunner.connection.driver.options.type;
|
|
8074
|
-
switch (dbType) {
|
|
8075
|
-
case "postgres": {
|
|
8076
|
-
debug13("using postgres migration file for AddLinkedVpFields");
|
|
8077
|
-
const mig = new AddLinkedVpFields1763387280001();
|
|
8078
|
-
await mig.down(queryRunner);
|
|
8079
|
-
debug13("Postgres migration statements for AddLinkedVpFields reverted");
|
|
8080
|
-
return;
|
|
8081
|
-
}
|
|
8082
|
-
case "sqlite":
|
|
8083
|
-
case "expo":
|
|
8084
|
-
case "react-native": {
|
|
8085
|
-
debug13("using sqlite/react-native migration file for AddLinkedVpFields");
|
|
8086
|
-
const mig = new AddLinkedVpFields1763387280002();
|
|
8087
|
-
await mig.down(queryRunner);
|
|
8088
|
-
debug13("SQLite migration statements for AddLinkedVpFields reverted");
|
|
8089
|
-
return;
|
|
8090
|
-
}
|
|
8091
|
-
default:
|
|
8092
|
-
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`);
|
|
8093
|
-
}
|
|
8094
|
-
}
|
|
8095
|
-
};
|
|
8096
|
-
|
|
8097
|
-
// src/migrations/generic/2-CreateIssuanceBranding.ts
|
|
8098
|
-
var import_debug14 = __toESM(require("debug"), 1);
|
|
8099
|
-
var debug14 = (0, import_debug14.default)("sphereon:ssi-sdk:migrations");
|
|
8100
7904
|
var CreateIssuanceBranding1659463079429 = class {
|
|
8101
7905
|
static {
|
|
8102
7906
|
__name(this, "CreateIssuanceBranding1659463079429");
|
|
8103
7907
|
}
|
|
8104
7908
|
name = "CreateIssuanceBranding1659463079429";
|
|
8105
7909
|
async up(queryRunner) {
|
|
8106
|
-
|
|
7910
|
+
debug13("migration: creating issuance branding tables");
|
|
8107
7911
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8108
7912
|
switch (dbType) {
|
|
8109
7913
|
case "postgres": {
|
|
8110
|
-
|
|
7914
|
+
debug13("using postgres migration file");
|
|
8111
7915
|
const mig = new CreateIssuanceBranding1685628974232();
|
|
8112
7916
|
await mig.up(queryRunner);
|
|
8113
|
-
|
|
7917
|
+
debug13("Migration statements executed");
|
|
8114
7918
|
return;
|
|
8115
7919
|
}
|
|
8116
7920
|
case "sqlite":
|
|
8117
7921
|
case "expo":
|
|
8118
7922
|
case "react-native": {
|
|
8119
|
-
|
|
7923
|
+
debug13("using sqlite/react-native migration file");
|
|
8120
7924
|
const mig = new CreateIssuanceBranding1685628973231();
|
|
8121
7925
|
await mig.up(queryRunner);
|
|
8122
|
-
|
|
7926
|
+
debug13("Migration statements executed");
|
|
8123
7927
|
return;
|
|
8124
7928
|
}
|
|
8125
7929
|
default:
|
|
@@ -8127,23 +7931,23 @@ var CreateIssuanceBranding1659463079429 = class {
|
|
|
8127
7931
|
}
|
|
8128
7932
|
}
|
|
8129
7933
|
async down(queryRunner) {
|
|
8130
|
-
|
|
7934
|
+
debug13("migration: reverting issuance branding tables");
|
|
8131
7935
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8132
7936
|
switch (dbType) {
|
|
8133
7937
|
case "postgres": {
|
|
8134
|
-
|
|
7938
|
+
debug13("using postgres migration file");
|
|
8135
7939
|
const mig = new CreateIssuanceBranding1685628974232();
|
|
8136
7940
|
await mig.down(queryRunner);
|
|
8137
|
-
|
|
7941
|
+
debug13("Migration statements executed");
|
|
8138
7942
|
return;
|
|
8139
7943
|
}
|
|
8140
7944
|
case "sqlite":
|
|
8141
7945
|
case "expo":
|
|
8142
7946
|
case "react-native": {
|
|
8143
|
-
|
|
7947
|
+
debug13("using sqlite/react-native migration file");
|
|
8144
7948
|
const mig = new CreateIssuanceBranding1685628973231();
|
|
8145
7949
|
await mig.down(queryRunner);
|
|
8146
|
-
|
|
7950
|
+
debug13("Migration statements executed");
|
|
8147
7951
|
return;
|
|
8148
7952
|
}
|
|
8149
7953
|
default:
|
|
@@ -8153,7 +7957,7 @@ var CreateIssuanceBranding1659463079429 = class {
|
|
|
8153
7957
|
};
|
|
8154
7958
|
|
|
8155
7959
|
// src/migrations/generic/3-CreateContacts.ts
|
|
8156
|
-
var
|
|
7960
|
+
var import_debug14 = __toESM(require("debug"), 1);
|
|
8157
7961
|
|
|
8158
7962
|
// src/migrations/postgres/1690925872592-CreateContacts.ts
|
|
8159
7963
|
var import_ssi_sdk33 = require("@sphereon/ssi-sdk.core");
|
|
@@ -8374,30 +8178,30 @@ var CreateContacts1690925872693 = class {
|
|
|
8374
8178
|
};
|
|
8375
8179
|
|
|
8376
8180
|
// src/migrations/generic/3-CreateContacts.ts
|
|
8377
|
-
var
|
|
8181
|
+
var debug14 = (0, import_debug14.default)("sphereon:ssi-sdk:migrations");
|
|
8378
8182
|
var CreateContacts1690925872318 = class {
|
|
8379
8183
|
static {
|
|
8380
8184
|
__name(this, "CreateContacts1690925872318");
|
|
8381
8185
|
}
|
|
8382
8186
|
name = "CreateContacts1690925872318";
|
|
8383
8187
|
async up(queryRunner) {
|
|
8384
|
-
|
|
8188
|
+
debug14("migration: creating contacts tables");
|
|
8385
8189
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8386
8190
|
switch (dbType) {
|
|
8387
8191
|
case "postgres": {
|
|
8388
|
-
|
|
8192
|
+
debug14("using postgres migration file");
|
|
8389
8193
|
const mig = new CreateContacts1690925872592();
|
|
8390
8194
|
await mig.up(queryRunner);
|
|
8391
|
-
|
|
8195
|
+
debug14("Migration statements executed");
|
|
8392
8196
|
return;
|
|
8393
8197
|
}
|
|
8394
8198
|
case "sqlite":
|
|
8395
8199
|
case "expo":
|
|
8396
8200
|
case "react-native": {
|
|
8397
|
-
|
|
8201
|
+
debug14("using sqlite/react-native migration file");
|
|
8398
8202
|
const mig = new CreateContacts1690925872693();
|
|
8399
8203
|
await mig.up(queryRunner);
|
|
8400
|
-
|
|
8204
|
+
debug14("Migration statements executed");
|
|
8401
8205
|
return;
|
|
8402
8206
|
}
|
|
8403
8207
|
default:
|
|
@@ -8405,23 +8209,23 @@ var CreateContacts1690925872318 = class {
|
|
|
8405
8209
|
}
|
|
8406
8210
|
}
|
|
8407
8211
|
async down(queryRunner) {
|
|
8408
|
-
|
|
8212
|
+
debug14("migration: reverting contacts tables");
|
|
8409
8213
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8410
8214
|
switch (dbType) {
|
|
8411
8215
|
case "postgres": {
|
|
8412
|
-
|
|
8216
|
+
debug14("using postgres migration file");
|
|
8413
8217
|
const mig = new CreateContacts1690925872592();
|
|
8414
8218
|
await mig.down(queryRunner);
|
|
8415
|
-
|
|
8219
|
+
debug14("Migration statements executed");
|
|
8416
8220
|
return;
|
|
8417
8221
|
}
|
|
8418
8222
|
case "sqlite":
|
|
8419
8223
|
case "expo":
|
|
8420
8224
|
case "react-native": {
|
|
8421
|
-
|
|
8225
|
+
debug14("using sqlite/react-native migration file");
|
|
8422
8226
|
const mig = new CreateContacts1690925872693();
|
|
8423
8227
|
await mig.down(queryRunner);
|
|
8424
|
-
|
|
8228
|
+
debug14("Migration statements executed");
|
|
8425
8229
|
return;
|
|
8426
8230
|
}
|
|
8427
8231
|
default:
|
|
@@ -8431,7 +8235,7 @@ var CreateContacts1690925872318 = class {
|
|
|
8431
8235
|
};
|
|
8432
8236
|
|
|
8433
8237
|
// src/migrations/generic/4-CreateStatusList.ts
|
|
8434
|
-
var
|
|
8238
|
+
var import_debug15 = __toESM(require("debug"), 1);
|
|
8435
8239
|
|
|
8436
8240
|
// src/migrations/postgres/1693866470001-CreateStatusList.ts
|
|
8437
8241
|
var CreateStatusList1693866470001 = class {
|
|
@@ -8637,53 +8441,53 @@ var UpdateStatusList1737110469000 = class {
|
|
|
8637
8441
|
};
|
|
8638
8442
|
|
|
8639
8443
|
// src/migrations/generic/4-CreateStatusList.ts
|
|
8640
|
-
var
|
|
8444
|
+
var debug15 = (0, import_debug15.default)("sphereon:ssi-sdk:migrations");
|
|
8641
8445
|
var CreateStatusList1693866470000 = class {
|
|
8642
8446
|
static {
|
|
8643
8447
|
__name(this, "CreateStatusList1693866470000");
|
|
8644
8448
|
}
|
|
8645
8449
|
name = "CreateStatusList1693866470000";
|
|
8646
8450
|
async up(queryRunner) {
|
|
8647
|
-
|
|
8451
|
+
debug15("migration: creating issuance branding tables");
|
|
8648
8452
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8649
8453
|
if (dbType === "postgres") {
|
|
8650
|
-
|
|
8454
|
+
debug15("using postgres migration files");
|
|
8651
8455
|
const createMig = new CreateStatusList1693866470001();
|
|
8652
8456
|
await createMig.up(queryRunner);
|
|
8653
8457
|
const updateMig = new UpdateStatusList1737110469001();
|
|
8654
8458
|
const up = await updateMig.up(queryRunner);
|
|
8655
|
-
|
|
8459
|
+
debug15("Migration statements executed");
|
|
8656
8460
|
return up;
|
|
8657
8461
|
} else if (dbType === "sqlite" || dbType === "react-native" || dbType === "expo") {
|
|
8658
|
-
|
|
8462
|
+
debug15("using sqlite/react-native migration files");
|
|
8659
8463
|
const createMig = new CreateStatusList1693866470002();
|
|
8660
8464
|
await createMig.up(queryRunner);
|
|
8661
8465
|
const updateMig = new UpdateStatusList1737110469000();
|
|
8662
8466
|
const up = await updateMig.up(queryRunner);
|
|
8663
|
-
|
|
8467
|
+
debug15("Migration statements executed");
|
|
8664
8468
|
return up;
|
|
8665
8469
|
} else {
|
|
8666
8470
|
return Promise.reject(`Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`);
|
|
8667
8471
|
}
|
|
8668
8472
|
}
|
|
8669
8473
|
async down(queryRunner) {
|
|
8670
|
-
|
|
8474
|
+
debug15("migration: reverting issuance branding tables");
|
|
8671
8475
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8672
8476
|
if (dbType === "postgres") {
|
|
8673
|
-
|
|
8477
|
+
debug15("using postgres migration files");
|
|
8674
8478
|
const updateMig = new UpdateStatusList1737110469001();
|
|
8675
8479
|
await updateMig.down(queryRunner);
|
|
8676
8480
|
const createMig = new CreateStatusList1693866470001();
|
|
8677
8481
|
const down = await createMig.down(queryRunner);
|
|
8678
|
-
|
|
8482
|
+
debug15("Migration statements executed");
|
|
8679
8483
|
return down;
|
|
8680
8484
|
} else if (dbType === "sqlite" || dbType === "react-native" || dbType === "expo") {
|
|
8681
|
-
|
|
8485
|
+
debug15("using sqlite/react-native migration files");
|
|
8682
8486
|
const updateMig = new UpdateStatusList1737110469000();
|
|
8683
8487
|
await updateMig.down(queryRunner);
|
|
8684
8488
|
const createMig = new CreateStatusList1693866470002();
|
|
8685
8489
|
const down = await createMig.down(queryRunner);
|
|
8686
|
-
|
|
8490
|
+
debug15("Migration statements executed");
|
|
8687
8491
|
return down;
|
|
8688
8492
|
} else {
|
|
8689
8493
|
return Promise.reject(`Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`);
|
|
@@ -8692,7 +8496,7 @@ var CreateStatusList1693866470000 = class {
|
|
|
8692
8496
|
};
|
|
8693
8497
|
|
|
8694
8498
|
// src/migrations/generic/5-CreateAuditEvents.ts
|
|
8695
|
-
var
|
|
8499
|
+
var import_debug16 = __toESM(require("debug"), 1);
|
|
8696
8500
|
|
|
8697
8501
|
// src/migrations/postgres/1701634812183-CreateAuditEvents.ts
|
|
8698
8502
|
var CreateAuditEvents1701634812183 = class {
|
|
@@ -8791,30 +8595,30 @@ var CreateAuditEvents1701634819487 = class {
|
|
|
8791
8595
|
};
|
|
8792
8596
|
|
|
8793
8597
|
// src/migrations/generic/5-CreateAuditEvents.ts
|
|
8794
|
-
var
|
|
8598
|
+
var debug16 = (0, import_debug16.default)("sphereon:ssi-sdk:migrations");
|
|
8795
8599
|
var CreateAuditEvents1701635835330 = class {
|
|
8796
8600
|
static {
|
|
8797
8601
|
__name(this, "CreateAuditEvents1701635835330");
|
|
8798
8602
|
}
|
|
8799
8603
|
name = "CreateAuditEvents1701635835330";
|
|
8800
8604
|
async up(queryRunner) {
|
|
8801
|
-
|
|
8605
|
+
debug16("migration: creating audit events tables");
|
|
8802
8606
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8803
8607
|
switch (dbType) {
|
|
8804
8608
|
case "postgres": {
|
|
8805
|
-
|
|
8609
|
+
debug16("using postgres migration file");
|
|
8806
8610
|
const mig = new CreateAuditEvents1701634812183();
|
|
8807
8611
|
await mig.up(queryRunner);
|
|
8808
|
-
|
|
8612
|
+
debug16("Migration statements executed");
|
|
8809
8613
|
return;
|
|
8810
8614
|
}
|
|
8811
8615
|
case "sqlite":
|
|
8812
8616
|
case "expo":
|
|
8813
8617
|
case "react-native": {
|
|
8814
|
-
|
|
8618
|
+
debug16("using sqlite/react-native migration file");
|
|
8815
8619
|
const mig = new CreateAuditEvents1701634819487();
|
|
8816
8620
|
await mig.up(queryRunner);
|
|
8817
|
-
|
|
8621
|
+
debug16("Migration statements executed");
|
|
8818
8622
|
return;
|
|
8819
8623
|
}
|
|
8820
8624
|
default:
|
|
@@ -8822,23 +8626,23 @@ var CreateAuditEvents1701635835330 = class {
|
|
|
8822
8626
|
}
|
|
8823
8627
|
}
|
|
8824
8628
|
async down(queryRunner) {
|
|
8825
|
-
|
|
8629
|
+
debug16("migration: reverting audit events tables");
|
|
8826
8630
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8827
8631
|
switch (dbType) {
|
|
8828
8632
|
case "postgres": {
|
|
8829
|
-
|
|
8633
|
+
debug16("using postgres migration file");
|
|
8830
8634
|
const mig = new CreateAuditEvents1701634812183();
|
|
8831
8635
|
await mig.down(queryRunner);
|
|
8832
|
-
|
|
8636
|
+
debug16("Migration statements executed");
|
|
8833
8637
|
return;
|
|
8834
8638
|
}
|
|
8835
8639
|
case "sqlite":
|
|
8836
8640
|
case "expo":
|
|
8837
8641
|
case "react-native": {
|
|
8838
|
-
|
|
8642
|
+
debug16("using sqlite/react-native migration file");
|
|
8839
8643
|
const mig = new CreateAuditEvents1701634819487();
|
|
8840
8644
|
await mig.down(queryRunner);
|
|
8841
|
-
|
|
8645
|
+
debug16("Migration statements executed");
|
|
8842
8646
|
return;
|
|
8843
8647
|
}
|
|
8844
8648
|
default:
|
|
@@ -8848,7 +8652,7 @@ var CreateAuditEvents1701635835330 = class {
|
|
|
8848
8652
|
};
|
|
8849
8653
|
|
|
8850
8654
|
// src/migrations/generic/6-CreateDigitalCredential.ts
|
|
8851
|
-
var
|
|
8655
|
+
var import_debug17 = __toESM(require("debug"), 1);
|
|
8852
8656
|
|
|
8853
8657
|
// src/migrations/postgres/1708525189001-CreateDigitalCredential.ts
|
|
8854
8658
|
var CreateDigitalCredential1708525189001 = class {
|
|
@@ -8956,30 +8760,30 @@ var CreateDigitalCredential1708525189002 = class {
|
|
|
8956
8760
|
};
|
|
8957
8761
|
|
|
8958
8762
|
// src/migrations/generic/6-CreateDigitalCredential.ts
|
|
8959
|
-
var
|
|
8763
|
+
var debug17 = (0, import_debug17.default)("sphereon:ssi-sdk:migrations");
|
|
8960
8764
|
var CreateDigitalCredential1708525189000 = class {
|
|
8961
8765
|
static {
|
|
8962
8766
|
__name(this, "CreateDigitalCredential1708525189000");
|
|
8963
8767
|
}
|
|
8964
8768
|
name = "CreateDigitalCredential1708525189000";
|
|
8965
8769
|
async up(queryRunner) {
|
|
8966
|
-
|
|
8770
|
+
debug17("migration: creating DigitalCredential tables");
|
|
8967
8771
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8968
8772
|
switch (dbType) {
|
|
8969
8773
|
case "postgres": {
|
|
8970
|
-
|
|
8774
|
+
debug17("using postgres migration file for DigitalCredential");
|
|
8971
8775
|
const mig = new CreateDigitalCredential1708525189001();
|
|
8972
8776
|
await mig.up(queryRunner);
|
|
8973
|
-
|
|
8777
|
+
debug17("Postgres Migration statements for DigitalCredential executed");
|
|
8974
8778
|
return;
|
|
8975
8779
|
}
|
|
8976
8780
|
case "sqlite":
|
|
8977
8781
|
case "expo":
|
|
8978
8782
|
case "react-native": {
|
|
8979
|
-
|
|
8783
|
+
debug17("using sqlite/react-native migration file for DigitalCredential");
|
|
8980
8784
|
const mig = new CreateDigitalCredential1708525189002();
|
|
8981
8785
|
await mig.up(queryRunner);
|
|
8982
|
-
|
|
8786
|
+
debug17("SQLite Migration statements for DigitalCredential executed");
|
|
8983
8787
|
return;
|
|
8984
8788
|
}
|
|
8985
8789
|
default:
|
|
@@ -8987,23 +8791,23 @@ var CreateDigitalCredential1708525189000 = class {
|
|
|
8987
8791
|
}
|
|
8988
8792
|
}
|
|
8989
8793
|
async down(queryRunner) {
|
|
8990
|
-
|
|
8794
|
+
debug17("migration: reverting DigitalCredential tables");
|
|
8991
8795
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8992
8796
|
switch (dbType) {
|
|
8993
8797
|
case "postgres": {
|
|
8994
|
-
|
|
8798
|
+
debug17("using postgres migration file for DigitalCredential");
|
|
8995
8799
|
const mig = new CreateDigitalCredential1708525189001();
|
|
8996
8800
|
await mig.down(queryRunner);
|
|
8997
|
-
|
|
8801
|
+
debug17("Postgres Migration statements for DigitalCredential reverted");
|
|
8998
8802
|
return;
|
|
8999
8803
|
}
|
|
9000
8804
|
case "sqlite":
|
|
9001
8805
|
case "expo":
|
|
9002
8806
|
case "react-native": {
|
|
9003
|
-
|
|
8807
|
+
debug17("using sqlite/react-native migration file for DigitalCredential");
|
|
9004
8808
|
const mig = new CreateDigitalCredential1708525189002();
|
|
9005
8809
|
await mig.down(queryRunner);
|
|
9006
|
-
|
|
8810
|
+
debug17("SQLite Migration statements for DigitalCredential reverted");
|
|
9007
8811
|
return;
|
|
9008
8812
|
}
|
|
9009
8813
|
default:
|
|
@@ -9013,7 +8817,7 @@ var CreateDigitalCredential1708525189000 = class {
|
|
|
9013
8817
|
};
|
|
9014
8818
|
|
|
9015
8819
|
// src/migrations/generic/7-CreateMachineStateStore.ts
|
|
9016
|
-
var
|
|
8820
|
+
var import_debug18 = __toESM(require("debug"), 1);
|
|
9017
8821
|
|
|
9018
8822
|
// src/migrations/postgres/1708797018115-CreateMachineStateStore.ts
|
|
9019
8823
|
var CreateMachineStateStore1708797018115 = class {
|
|
@@ -9075,30 +8879,30 @@ var CreateMachineStateStore1708796002272 = class {
|
|
|
9075
8879
|
};
|
|
9076
8880
|
|
|
9077
8881
|
// src/migrations/generic/7-CreateMachineStateStore.ts
|
|
9078
|
-
var
|
|
8882
|
+
var debug18 = (0, import_debug18.default)("sphereon:ssi-sdk:migrations");
|
|
9079
8883
|
var CreateMachineStateStore1708098041262 = class {
|
|
9080
8884
|
static {
|
|
9081
8885
|
__name(this, "CreateMachineStateStore1708098041262");
|
|
9082
8886
|
}
|
|
9083
8887
|
name = "CreateMachineStateStore1708098041262";
|
|
9084
8888
|
async up(queryRunner) {
|
|
9085
|
-
|
|
8889
|
+
debug18("migration: creating machine state tables");
|
|
9086
8890
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9087
8891
|
switch (dbType) {
|
|
9088
8892
|
case "postgres": {
|
|
9089
|
-
|
|
8893
|
+
debug18("using postgres migration file");
|
|
9090
8894
|
const mig = new CreateMachineStateStore1708797018115();
|
|
9091
8895
|
await mig.up(queryRunner);
|
|
9092
|
-
|
|
8896
|
+
debug18("Migration statements executed");
|
|
9093
8897
|
return;
|
|
9094
8898
|
}
|
|
9095
8899
|
case "sqlite":
|
|
9096
8900
|
case "expo":
|
|
9097
8901
|
case "react-native": {
|
|
9098
|
-
|
|
8902
|
+
debug18("using sqlite/react-native migration file");
|
|
9099
8903
|
const mig = new CreateMachineStateStore1708796002272();
|
|
9100
8904
|
await mig.up(queryRunner);
|
|
9101
|
-
|
|
8905
|
+
debug18("Migration statements executed");
|
|
9102
8906
|
return;
|
|
9103
8907
|
}
|
|
9104
8908
|
default:
|
|
@@ -9106,23 +8910,23 @@ var CreateMachineStateStore1708098041262 = class {
|
|
|
9106
8910
|
}
|
|
9107
8911
|
}
|
|
9108
8912
|
async down(queryRunner) {
|
|
9109
|
-
|
|
8913
|
+
debug18("migration: reverting machine state tables");
|
|
9110
8914
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9111
8915
|
switch (dbType) {
|
|
9112
8916
|
case "postgres": {
|
|
9113
|
-
|
|
8917
|
+
debug18("using postgres migration file");
|
|
9114
8918
|
const mig = new CreateMachineStateStore1708797018115();
|
|
9115
8919
|
await mig.down(queryRunner);
|
|
9116
|
-
|
|
8920
|
+
debug18("Migration statements executed");
|
|
9117
8921
|
return;
|
|
9118
8922
|
}
|
|
9119
8923
|
case "sqlite":
|
|
9120
8924
|
case "expo":
|
|
9121
8925
|
case "react-native": {
|
|
9122
|
-
|
|
8926
|
+
debug18("using sqlite/react-native migration file");
|
|
9123
8927
|
const mig = new CreateMachineStateStore1708796002272();
|
|
9124
8928
|
await mig.down(queryRunner);
|
|
9125
|
-
|
|
8929
|
+
debug18("Migration statements executed");
|
|
9126
8930
|
return;
|
|
9127
8931
|
}
|
|
9128
8932
|
default:
|
|
@@ -9132,7 +8936,7 @@ var CreateMachineStateStore1708098041262 = class {
|
|
|
9132
8936
|
};
|
|
9133
8937
|
|
|
9134
8938
|
// src/migrations/generic/8-CreateContacts.ts
|
|
9135
|
-
var
|
|
8939
|
+
var import_debug19 = __toESM(require("debug"), 1);
|
|
9136
8940
|
|
|
9137
8941
|
// src/migrations/postgres/1710438363001-CreateContacts.ts
|
|
9138
8942
|
var CreateContacts1710438363001 = class {
|
|
@@ -9246,30 +9050,30 @@ var CreateContacts1710438363002 = class {
|
|
|
9246
9050
|
};
|
|
9247
9051
|
|
|
9248
9052
|
// src/migrations/generic/8-CreateContacts.ts
|
|
9249
|
-
var
|
|
9053
|
+
var debug19 = (0, import_debug19.default)("sphereon:ssi-sdk:migrations");
|
|
9250
9054
|
var CreateContacts1708525189000 = class {
|
|
9251
9055
|
static {
|
|
9252
9056
|
__name(this, "CreateContacts1708525189000");
|
|
9253
9057
|
}
|
|
9254
9058
|
name = "CreateContacts1708525189000";
|
|
9255
9059
|
async up(queryRunner) {
|
|
9256
|
-
|
|
9060
|
+
debug19("migration: updating contact tables");
|
|
9257
9061
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9258
9062
|
switch (dbType) {
|
|
9259
9063
|
case "postgres": {
|
|
9260
|
-
|
|
9064
|
+
debug19("using postgres migration file");
|
|
9261
9065
|
const mig = new CreateContacts1710438363001();
|
|
9262
9066
|
await mig.up(queryRunner);
|
|
9263
|
-
|
|
9067
|
+
debug19("Migration statements executed");
|
|
9264
9068
|
return;
|
|
9265
9069
|
}
|
|
9266
9070
|
case "sqlite":
|
|
9267
9071
|
case "expo":
|
|
9268
9072
|
case "react-native": {
|
|
9269
|
-
|
|
9073
|
+
debug19("using sqlite/react-native migration file");
|
|
9270
9074
|
const mig = new CreateContacts1710438363002();
|
|
9271
9075
|
await mig.up(queryRunner);
|
|
9272
|
-
|
|
9076
|
+
debug19("Migration statements executed");
|
|
9273
9077
|
return;
|
|
9274
9078
|
}
|
|
9275
9079
|
default:
|
|
@@ -9277,23 +9081,23 @@ var CreateContacts1708525189000 = class {
|
|
|
9277
9081
|
}
|
|
9278
9082
|
}
|
|
9279
9083
|
async down(queryRunner) {
|
|
9280
|
-
|
|
9084
|
+
debug19("migration: reverting machine state tables");
|
|
9281
9085
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9282
9086
|
switch (dbType) {
|
|
9283
9087
|
case "postgres": {
|
|
9284
|
-
|
|
9088
|
+
debug19("using postgres migration file");
|
|
9285
9089
|
const mig = new CreateContacts1710438363001();
|
|
9286
9090
|
await mig.down(queryRunner);
|
|
9287
|
-
|
|
9091
|
+
debug19("Migration statements executed");
|
|
9288
9092
|
return;
|
|
9289
9093
|
}
|
|
9290
9094
|
case "sqlite":
|
|
9291
9095
|
case "expo":
|
|
9292
9096
|
case "react-native": {
|
|
9293
|
-
|
|
9097
|
+
debug19("using sqlite/react-native migration file");
|
|
9294
9098
|
const mig = new CreateContacts1710438363002();
|
|
9295
9099
|
await mig.down(queryRunner);
|
|
9296
|
-
|
|
9100
|
+
debug19("Migration statements executed");
|
|
9297
9101
|
return;
|
|
9298
9102
|
}
|
|
9299
9103
|
default:
|
|
@@ -9303,7 +9107,7 @@ var CreateContacts1708525189000 = class {
|
|
|
9303
9107
|
};
|
|
9304
9108
|
|
|
9305
9109
|
// src/migrations/generic/9-CreateContacts.ts
|
|
9306
|
-
var
|
|
9110
|
+
var import_debug20 = __toESM(require("debug"), 1);
|
|
9307
9111
|
|
|
9308
9112
|
// src/migrations/postgres/1715761125001-CreateContacts.ts
|
|
9309
9113
|
var CreateContacts1715761125001 = class {
|
|
@@ -9415,30 +9219,30 @@ var CreateContacts1715761125002 = class {
|
|
|
9415
9219
|
};
|
|
9416
9220
|
|
|
9417
9221
|
// src/migrations/generic/9-CreateContacts.ts
|
|
9418
|
-
var
|
|
9222
|
+
var debug20 = (0, import_debug20.default)("sphereon:ssi-sdk:migrations");
|
|
9419
9223
|
var CreateContacts1715761125000 = class {
|
|
9420
9224
|
static {
|
|
9421
9225
|
__name(this, "CreateContacts1715761125000");
|
|
9422
9226
|
}
|
|
9423
9227
|
name = "CreateContacts1715761125000";
|
|
9424
9228
|
async up(queryRunner) {
|
|
9425
|
-
|
|
9229
|
+
debug20("migration: updating contact tables");
|
|
9426
9230
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9427
9231
|
switch (dbType) {
|
|
9428
9232
|
case "postgres": {
|
|
9429
|
-
|
|
9233
|
+
debug20("using postgres migration file");
|
|
9430
9234
|
const mig = new CreateContacts1715761125001();
|
|
9431
9235
|
await mig.up(queryRunner);
|
|
9432
|
-
|
|
9236
|
+
debug20("Migration statements executed");
|
|
9433
9237
|
return;
|
|
9434
9238
|
}
|
|
9435
9239
|
case "sqlite":
|
|
9436
9240
|
case "expo":
|
|
9437
9241
|
case "react-native": {
|
|
9438
|
-
|
|
9242
|
+
debug20("using sqlite/react-native migration file");
|
|
9439
9243
|
const mig = new CreateContacts1715761125002();
|
|
9440
9244
|
await mig.up(queryRunner);
|
|
9441
|
-
|
|
9245
|
+
debug20("Migration statements executed");
|
|
9442
9246
|
return;
|
|
9443
9247
|
}
|
|
9444
9248
|
default:
|
|
@@ -9446,23 +9250,23 @@ var CreateContacts1715761125000 = class {
|
|
|
9446
9250
|
}
|
|
9447
9251
|
}
|
|
9448
9252
|
async down(queryRunner) {
|
|
9449
|
-
|
|
9253
|
+
debug20("migration: reverting machine state tables");
|
|
9450
9254
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9451
9255
|
switch (dbType) {
|
|
9452
9256
|
case "postgres": {
|
|
9453
|
-
|
|
9257
|
+
debug20("using postgres migration file");
|
|
9454
9258
|
const mig = new CreateContacts1715761125001();
|
|
9455
9259
|
await mig.down(queryRunner);
|
|
9456
|
-
|
|
9260
|
+
debug20("Migration statements executed");
|
|
9457
9261
|
return;
|
|
9458
9262
|
}
|
|
9459
9263
|
case "sqlite":
|
|
9460
9264
|
case "expo":
|
|
9461
9265
|
case "react-native": {
|
|
9462
|
-
|
|
9266
|
+
debug20("using sqlite/react-native migration file");
|
|
9463
9267
|
const mig = new CreateContacts1715761125002();
|
|
9464
9268
|
await mig.down(queryRunner);
|
|
9465
|
-
|
|
9269
|
+
debug20("Migration statements executed");
|
|
9466
9270
|
return;
|
|
9467
9271
|
}
|
|
9468
9272
|
default:
|
|
@@ -9491,8 +9295,7 @@ var DataStoreEventLoggerMigrations = [
|
|
|
9491
9295
|
CreateAuditEvents1701635835330
|
|
9492
9296
|
];
|
|
9493
9297
|
var DataStoreDigitalCredentialMigrations = [
|
|
9494
|
-
CreateDigitalCredential1708525189000
|
|
9495
|
-
AddLinkedVpFields1763387280000
|
|
9298
|
+
CreateDigitalCredential1708525189000
|
|
9496
9299
|
];
|
|
9497
9300
|
var DataStoreMachineStateMigrations = [
|
|
9498
9301
|
CreateMachineStateStore1708098041262
|
|
@@ -9564,18 +9367,6 @@ function determineCredentialDocumentFormat(documentFormat) {
|
|
|
9564
9367
|
}
|
|
9565
9368
|
}
|
|
9566
9369
|
__name(determineCredentialDocumentFormat, "determineCredentialDocumentFormat");
|
|
9567
|
-
function normalizeNullableFields(obj, nullableKeys) {
|
|
9568
|
-
const normalized = {
|
|
9569
|
-
...obj
|
|
9570
|
-
};
|
|
9571
|
-
for (const key of nullableKeys) {
|
|
9572
|
-
if (normalized[key] === void 0) {
|
|
9573
|
-
normalized[key] = null;
|
|
9574
|
-
}
|
|
9575
|
-
}
|
|
9576
|
-
return normalized;
|
|
9577
|
-
}
|
|
9578
|
-
__name(normalizeNullableFields, "normalizeNullableFields");
|
|
9579
9370
|
function getValidUntil(uniformDocument) {
|
|
9580
9371
|
if ("expirationDate" in uniformDocument && uniformDocument.expirationDate) {
|
|
9581
9372
|
return new Date(uniformDocument.expirationDate);
|
|
@@ -9638,34 +9429,6 @@ var nonPersistedDigitalCredentialEntityFromAddArgs = /* @__PURE__ */ __name((add
|
|
|
9638
9429
|
lastUpdatedAt: /* @__PURE__ */ new Date()
|
|
9639
9430
|
};
|
|
9640
9431
|
}, "nonPersistedDigitalCredentialEntityFromAddArgs");
|
|
9641
|
-
var persistedDigitalCredentialEntityFromUpdateArgs = /* @__PURE__ */ __name((existingCredential, updates) => {
|
|
9642
|
-
const entity = new DigitalCredentialEntity();
|
|
9643
|
-
Object.assign(entity, existingCredential);
|
|
9644
|
-
const normalizedUpdates = normalizeNullableFields(updates, [
|
|
9645
|
-
"linkedVpId",
|
|
9646
|
-
"linkedVpFrom",
|
|
9647
|
-
"linkedVpUntil"
|
|
9648
|
-
]);
|
|
9649
|
-
Object.assign(entity, normalizedUpdates);
|
|
9650
|
-
entity.id = existingCredential.id;
|
|
9651
|
-
entity.hash = existingCredential.hash;
|
|
9652
|
-
entity.createdAt = existingCredential.createdAt;
|
|
9653
|
-
entity.lastUpdatedAt = /* @__PURE__ */ new Date();
|
|
9654
|
-
return entity;
|
|
9655
|
-
}, "persistedDigitalCredentialEntityFromUpdateArgs");
|
|
9656
|
-
var persistedDigitalCredentialEntityFromStateArgs = /* @__PURE__ */ __name((existingCredential, args) => {
|
|
9657
|
-
const entity = new DigitalCredentialEntity();
|
|
9658
|
-
Object.assign(entity, existingCredential);
|
|
9659
|
-
entity.verifiedState = args.verifiedState;
|
|
9660
|
-
entity.lastUpdatedAt = /* @__PURE__ */ new Date();
|
|
9661
|
-
if (args.verifiedState === import_ssi_sdk35.CredentialStateType.REVOKED && args.revokedAt) {
|
|
9662
|
-
entity.revokedAt = args.revokedAt;
|
|
9663
|
-
}
|
|
9664
|
-
if (args.verifiedState !== import_ssi_sdk35.CredentialStateType.REVOKED && args.verifiedAt) {
|
|
9665
|
-
entity.verifiedAt = args.verifiedAt;
|
|
9666
|
-
}
|
|
9667
|
-
return entity;
|
|
9668
|
-
}, "persistedDigitalCredentialEntityFromStateArgs");
|
|
9669
9432
|
var digitalCredentialFrom = /* @__PURE__ */ __name((credentialEntity) => {
|
|
9670
9433
|
const result = {
|
|
9671
9434
|
...credentialEntity
|