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