@sphereon/ssi-sdk.data-store 0.34.1-feature.SSISDK.78.306 → 0.34.1-feature.SSISDK.82.and.SSISDK.70.345
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 +303 -110
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -5
- package/dist/index.d.ts +15 -5
- package/dist/index.js +304 -111
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
- package/src/__tests__/digitalCredential.store.test.ts +116 -1
- package/src/digitalCredential/DigitalCredentialStore.ts +51 -13
- package/src/entities/digitalCredential/DigitalCredentialEntity.ts +6 -0
- package/src/migrations/generic/14-AddLinkedVpFields.ts +66 -0
- package/src/migrations/generic/index.ts +2 -1
- package/src/migrations/postgres/1763387280001-AddLinkedVpFields.ts +29 -0
- package/src/migrations/sqlite/1763387280002-AddLinkedVpFields.ts +32 -0
- package/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,8 @@ var DigitalCredentialEntity = class extends import_typeorm17.BaseEntity {
|
|
|
2071
2074
|
rpCorrelationId;
|
|
2072
2075
|
verifiedState;
|
|
2073
2076
|
tenantId;
|
|
2077
|
+
linkedVpId;
|
|
2078
|
+
linkedVpFrom;
|
|
2074
2079
|
createdAt;
|
|
2075
2080
|
presentedAt;
|
|
2076
2081
|
lastUpdatedAt;
|
|
@@ -2233,6 +2238,21 @@ _ts_decorate18([
|
|
|
2233
2238
|
}),
|
|
2234
2239
|
_ts_metadata17("design:type", String)
|
|
2235
2240
|
], DigitalCredentialEntity.prototype, "tenantId", void 0);
|
|
2241
|
+
_ts_decorate18([
|
|
2242
|
+
(0, import_typeorm17.Column)("text", {
|
|
2243
|
+
name: "linked_vp_id",
|
|
2244
|
+
nullable: true
|
|
2245
|
+
}),
|
|
2246
|
+
_ts_metadata17("design:type", String)
|
|
2247
|
+
], DigitalCredentialEntity.prototype, "linkedVpId", void 0);
|
|
2248
|
+
_ts_decorate18([
|
|
2249
|
+
(0, import_typeorm17.CreateDateColumn)({
|
|
2250
|
+
name: "linked_vp_from",
|
|
2251
|
+
nullable: true,
|
|
2252
|
+
type: (0, import_ssi_sdk14.typeOrmDateTime)()
|
|
2253
|
+
}),
|
|
2254
|
+
_ts_metadata17("design:type", typeof Date === "undefined" ? Object : Date)
|
|
2255
|
+
], DigitalCredentialEntity.prototype, "linkedVpFrom", void 0);
|
|
2236
2256
|
_ts_decorate18([
|
|
2237
2257
|
(0, import_typeorm17.CreateDateColumn)({
|
|
2238
2258
|
name: "created_at",
|
|
@@ -5430,6 +5450,34 @@ var DigitalCredentialStore = class extends import_ssi_sdk26.AbstractDigitalCrede
|
|
|
5430
5450
|
total
|
|
5431
5451
|
};
|
|
5432
5452
|
}, "getCredentials");
|
|
5453
|
+
updateCredential = /* @__PURE__ */ __name(async (args) => {
|
|
5454
|
+
const dcRepo = await this.getRepository();
|
|
5455
|
+
const whereClause = {};
|
|
5456
|
+
if ("id" in args) {
|
|
5457
|
+
whereClause.id = args.id;
|
|
5458
|
+
} else if ("hash" in args) {
|
|
5459
|
+
whereClause.hash = args.hash;
|
|
5460
|
+
} else {
|
|
5461
|
+
return Promise.reject(Error("No id or hash param is provided."));
|
|
5462
|
+
}
|
|
5463
|
+
const credential = await dcRepo.findOne({
|
|
5464
|
+
where: whereClause
|
|
5465
|
+
});
|
|
5466
|
+
if (!credential) {
|
|
5467
|
+
return Promise.reject(Error(`No credential found for args: ${JSON.stringify(whereClause)}`));
|
|
5468
|
+
}
|
|
5469
|
+
const updates = Object.fromEntries(Object.entries(args).filter(([key]) => key !== "id" && key !== "hash"));
|
|
5470
|
+
const entityToSave = persistedDigitalCredentialEntityFromUpdateArgs(credential, updates);
|
|
5471
|
+
const validationError = this.assertValidDigitalCredential(entityToSave);
|
|
5472
|
+
if (validationError) {
|
|
5473
|
+
return Promise.reject(validationError);
|
|
5474
|
+
}
|
|
5475
|
+
debug2("Updating credential", entityToSave);
|
|
5476
|
+
const updatedResult = await dcRepo.save(entityToSave, {
|
|
5477
|
+
transaction: true
|
|
5478
|
+
});
|
|
5479
|
+
return digitalCredentialFrom(updatedResult);
|
|
5480
|
+
}, "updateCredential");
|
|
5433
5481
|
removeCredential = /* @__PURE__ */ __name(async (args) => {
|
|
5434
5482
|
if (!args) {
|
|
5435
5483
|
return false;
|
|
@@ -5500,20 +5548,9 @@ var DigitalCredentialStore = class extends import_ssi_sdk26.AbstractDigitalCrede
|
|
|
5500
5548
|
if (!credential) {
|
|
5501
5549
|
return Promise.reject(Error(`No credential found for args: ${JSON.stringify(whereClause)}`));
|
|
5502
5550
|
}
|
|
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, {
|
|
5551
|
+
const entityToSave = persistedDigitalCredentialEntityFromStateArgs(credential, args);
|
|
5552
|
+
debug2("Updating credential state", entityToSave);
|
|
5553
|
+
const updatedResult = await credentialRepository.save(entityToSave, {
|
|
5517
5554
|
transaction: true
|
|
5518
5555
|
});
|
|
5519
5556
|
return digitalCredentialFrom(updatedResult);
|
|
@@ -7898,32 +7935,148 @@ var CreateDcqlQueryItem1726617600000 = class {
|
|
|
7898
7935
|
}
|
|
7899
7936
|
};
|
|
7900
7937
|
|
|
7901
|
-
// src/migrations/generic/
|
|
7938
|
+
// src/migrations/generic/14-AddLinkedVpFields.ts
|
|
7902
7939
|
var import_debug13 = __toESM(require("debug"), 1);
|
|
7940
|
+
|
|
7941
|
+
// src/migrations/postgres/1763387280001-AddLinkedVpFields.ts
|
|
7942
|
+
var AddLinkedVpFields1763387280001 = class {
|
|
7943
|
+
static {
|
|
7944
|
+
__name(this, "AddLinkedVpFields1763387280001");
|
|
7945
|
+
}
|
|
7946
|
+
name = "AddLinkedVpFields1763387280001";
|
|
7947
|
+
async up(queryRunner) {
|
|
7948
|
+
await queryRunner.query(`
|
|
7949
|
+
ALTER TABLE "DigitalCredential"
|
|
7950
|
+
ADD COLUMN "linked_vp_id" text
|
|
7951
|
+
`);
|
|
7952
|
+
await queryRunner.query(`
|
|
7953
|
+
ALTER TABLE "DigitalCredential"
|
|
7954
|
+
ADD COLUMN "linked_vp_from" TIMESTAMP
|
|
7955
|
+
`);
|
|
7956
|
+
}
|
|
7957
|
+
async down(queryRunner) {
|
|
7958
|
+
await queryRunner.query(`
|
|
7959
|
+
ALTER TABLE "DigitalCredential"
|
|
7960
|
+
DROP COLUMN "linked_vp_from"
|
|
7961
|
+
`);
|
|
7962
|
+
await queryRunner.query(`
|
|
7963
|
+
ALTER TABLE "DigitalCredential"
|
|
7964
|
+
DROP COLUMN "linked_vp_id"
|
|
7965
|
+
`);
|
|
7966
|
+
}
|
|
7967
|
+
};
|
|
7968
|
+
|
|
7969
|
+
// src/migrations/sqlite/1763387280002-AddLinkedVpFields.ts
|
|
7970
|
+
var AddLinkedVpFields1763387280002 = class {
|
|
7971
|
+
static {
|
|
7972
|
+
__name(this, "AddLinkedVpFields1763387280002");
|
|
7973
|
+
}
|
|
7974
|
+
name = "AddLinkedVpFields1763387280002";
|
|
7975
|
+
async up(queryRunner) {
|
|
7976
|
+
await queryRunner.query(`
|
|
7977
|
+
ALTER TABLE "DigitalCredential"
|
|
7978
|
+
ADD COLUMN "linked_vp_id" text
|
|
7979
|
+
`);
|
|
7980
|
+
await queryRunner.query(`
|
|
7981
|
+
ALTER TABLE "DigitalCredential"
|
|
7982
|
+
ADD COLUMN "linked_vp_from" datetime
|
|
7983
|
+
`);
|
|
7984
|
+
}
|
|
7985
|
+
async down(queryRunner) {
|
|
7986
|
+
await queryRunner.query(`
|
|
7987
|
+
ALTER TABLE "DigitalCredential"
|
|
7988
|
+
DROP COLUMN "linked_vp_from"
|
|
7989
|
+
`);
|
|
7990
|
+
await queryRunner.query(`
|
|
7991
|
+
ALTER TABLE "DigitalCredential"
|
|
7992
|
+
DROP COLUMN "linked_vp_id"
|
|
7993
|
+
`);
|
|
7994
|
+
}
|
|
7995
|
+
};
|
|
7996
|
+
|
|
7997
|
+
// src/migrations/generic/14-AddLinkedVpFields.ts
|
|
7903
7998
|
var debug13 = (0, import_debug13.default)("sphereon:ssi-sdk:migrations");
|
|
7999
|
+
var AddLinkedVpFields1763387280000 = class {
|
|
8000
|
+
static {
|
|
8001
|
+
__name(this, "AddLinkedVpFields1763387280000");
|
|
8002
|
+
}
|
|
8003
|
+
name = "AddLinkedVpFields1763387280000";
|
|
8004
|
+
async up(queryRunner) {
|
|
8005
|
+
debug13("migration: adding linked VP fields to DigitalCredential table");
|
|
8006
|
+
const dbType = queryRunner.connection.driver.options.type;
|
|
8007
|
+
switch (dbType) {
|
|
8008
|
+
case "postgres": {
|
|
8009
|
+
debug13("using postgres migration file for AddLinkedVpFields");
|
|
8010
|
+
const mig = new AddLinkedVpFields1763387280001();
|
|
8011
|
+
await mig.up(queryRunner);
|
|
8012
|
+
debug13("Postgres migration statements for AddLinkedVpFields executed");
|
|
8013
|
+
return;
|
|
8014
|
+
}
|
|
8015
|
+
case "sqlite":
|
|
8016
|
+
case "expo":
|
|
8017
|
+
case "react-native": {
|
|
8018
|
+
debug13("using sqlite/react-native migration file for AddLinkedVpFields");
|
|
8019
|
+
const mig = new AddLinkedVpFields1763387280002();
|
|
8020
|
+
await mig.up(queryRunner);
|
|
8021
|
+
debug13("SQLite migration statements for AddLinkedVpFields executed");
|
|
8022
|
+
return;
|
|
8023
|
+
}
|
|
8024
|
+
default:
|
|
8025
|
+
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`);
|
|
8026
|
+
}
|
|
8027
|
+
}
|
|
8028
|
+
async down(queryRunner) {
|
|
8029
|
+
debug13("migration: reverting linked VP fields from DigitalCredential table");
|
|
8030
|
+
const dbType = queryRunner.connection.driver.options.type;
|
|
8031
|
+
switch (dbType) {
|
|
8032
|
+
case "postgres": {
|
|
8033
|
+
debug13("using postgres migration file for AddLinkedVpFields");
|
|
8034
|
+
const mig = new AddLinkedVpFields1763387280001();
|
|
8035
|
+
await mig.down(queryRunner);
|
|
8036
|
+
debug13("Postgres migration statements for AddLinkedVpFields reverted");
|
|
8037
|
+
return;
|
|
8038
|
+
}
|
|
8039
|
+
case "sqlite":
|
|
8040
|
+
case "expo":
|
|
8041
|
+
case "react-native": {
|
|
8042
|
+
debug13("using sqlite/react-native migration file for AddLinkedVpFields");
|
|
8043
|
+
const mig = new AddLinkedVpFields1763387280002();
|
|
8044
|
+
await mig.down(queryRunner);
|
|
8045
|
+
debug13("SQLite migration statements for AddLinkedVpFields reverted");
|
|
8046
|
+
return;
|
|
8047
|
+
}
|
|
8048
|
+
default:
|
|
8049
|
+
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`);
|
|
8050
|
+
}
|
|
8051
|
+
}
|
|
8052
|
+
};
|
|
8053
|
+
|
|
8054
|
+
// src/migrations/generic/2-CreateIssuanceBranding.ts
|
|
8055
|
+
var import_debug14 = __toESM(require("debug"), 1);
|
|
8056
|
+
var debug14 = (0, import_debug14.default)("sphereon:ssi-sdk:migrations");
|
|
7904
8057
|
var CreateIssuanceBranding1659463079429 = class {
|
|
7905
8058
|
static {
|
|
7906
8059
|
__name(this, "CreateIssuanceBranding1659463079429");
|
|
7907
8060
|
}
|
|
7908
8061
|
name = "CreateIssuanceBranding1659463079429";
|
|
7909
8062
|
async up(queryRunner) {
|
|
7910
|
-
|
|
8063
|
+
debug14("migration: creating issuance branding tables");
|
|
7911
8064
|
const dbType = queryRunner.connection.driver.options.type;
|
|
7912
8065
|
switch (dbType) {
|
|
7913
8066
|
case "postgres": {
|
|
7914
|
-
|
|
8067
|
+
debug14("using postgres migration file");
|
|
7915
8068
|
const mig = new CreateIssuanceBranding1685628974232();
|
|
7916
8069
|
await mig.up(queryRunner);
|
|
7917
|
-
|
|
8070
|
+
debug14("Migration statements executed");
|
|
7918
8071
|
return;
|
|
7919
8072
|
}
|
|
7920
8073
|
case "sqlite":
|
|
7921
8074
|
case "expo":
|
|
7922
8075
|
case "react-native": {
|
|
7923
|
-
|
|
8076
|
+
debug14("using sqlite/react-native migration file");
|
|
7924
8077
|
const mig = new CreateIssuanceBranding1685628973231();
|
|
7925
8078
|
await mig.up(queryRunner);
|
|
7926
|
-
|
|
8079
|
+
debug14("Migration statements executed");
|
|
7927
8080
|
return;
|
|
7928
8081
|
}
|
|
7929
8082
|
default:
|
|
@@ -7931,23 +8084,23 @@ var CreateIssuanceBranding1659463079429 = class {
|
|
|
7931
8084
|
}
|
|
7932
8085
|
}
|
|
7933
8086
|
async down(queryRunner) {
|
|
7934
|
-
|
|
8087
|
+
debug14("migration: reverting issuance branding tables");
|
|
7935
8088
|
const dbType = queryRunner.connection.driver.options.type;
|
|
7936
8089
|
switch (dbType) {
|
|
7937
8090
|
case "postgres": {
|
|
7938
|
-
|
|
8091
|
+
debug14("using postgres migration file");
|
|
7939
8092
|
const mig = new CreateIssuanceBranding1685628974232();
|
|
7940
8093
|
await mig.down(queryRunner);
|
|
7941
|
-
|
|
8094
|
+
debug14("Migration statements executed");
|
|
7942
8095
|
return;
|
|
7943
8096
|
}
|
|
7944
8097
|
case "sqlite":
|
|
7945
8098
|
case "expo":
|
|
7946
8099
|
case "react-native": {
|
|
7947
|
-
|
|
8100
|
+
debug14("using sqlite/react-native migration file");
|
|
7948
8101
|
const mig = new CreateIssuanceBranding1685628973231();
|
|
7949
8102
|
await mig.down(queryRunner);
|
|
7950
|
-
|
|
8103
|
+
debug14("Migration statements executed");
|
|
7951
8104
|
return;
|
|
7952
8105
|
}
|
|
7953
8106
|
default:
|
|
@@ -7957,7 +8110,7 @@ var CreateIssuanceBranding1659463079429 = class {
|
|
|
7957
8110
|
};
|
|
7958
8111
|
|
|
7959
8112
|
// src/migrations/generic/3-CreateContacts.ts
|
|
7960
|
-
var
|
|
8113
|
+
var import_debug15 = __toESM(require("debug"), 1);
|
|
7961
8114
|
|
|
7962
8115
|
// src/migrations/postgres/1690925872592-CreateContacts.ts
|
|
7963
8116
|
var import_ssi_sdk33 = require("@sphereon/ssi-sdk.core");
|
|
@@ -8178,30 +8331,30 @@ var CreateContacts1690925872693 = class {
|
|
|
8178
8331
|
};
|
|
8179
8332
|
|
|
8180
8333
|
// src/migrations/generic/3-CreateContacts.ts
|
|
8181
|
-
var
|
|
8334
|
+
var debug15 = (0, import_debug15.default)("sphereon:ssi-sdk:migrations");
|
|
8182
8335
|
var CreateContacts1690925872318 = class {
|
|
8183
8336
|
static {
|
|
8184
8337
|
__name(this, "CreateContacts1690925872318");
|
|
8185
8338
|
}
|
|
8186
8339
|
name = "CreateContacts1690925872318";
|
|
8187
8340
|
async up(queryRunner) {
|
|
8188
|
-
|
|
8341
|
+
debug15("migration: creating contacts tables");
|
|
8189
8342
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8190
8343
|
switch (dbType) {
|
|
8191
8344
|
case "postgres": {
|
|
8192
|
-
|
|
8345
|
+
debug15("using postgres migration file");
|
|
8193
8346
|
const mig = new CreateContacts1690925872592();
|
|
8194
8347
|
await mig.up(queryRunner);
|
|
8195
|
-
|
|
8348
|
+
debug15("Migration statements executed");
|
|
8196
8349
|
return;
|
|
8197
8350
|
}
|
|
8198
8351
|
case "sqlite":
|
|
8199
8352
|
case "expo":
|
|
8200
8353
|
case "react-native": {
|
|
8201
|
-
|
|
8354
|
+
debug15("using sqlite/react-native migration file");
|
|
8202
8355
|
const mig = new CreateContacts1690925872693();
|
|
8203
8356
|
await mig.up(queryRunner);
|
|
8204
|
-
|
|
8357
|
+
debug15("Migration statements executed");
|
|
8205
8358
|
return;
|
|
8206
8359
|
}
|
|
8207
8360
|
default:
|
|
@@ -8209,23 +8362,23 @@ var CreateContacts1690925872318 = class {
|
|
|
8209
8362
|
}
|
|
8210
8363
|
}
|
|
8211
8364
|
async down(queryRunner) {
|
|
8212
|
-
|
|
8365
|
+
debug15("migration: reverting contacts tables");
|
|
8213
8366
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8214
8367
|
switch (dbType) {
|
|
8215
8368
|
case "postgres": {
|
|
8216
|
-
|
|
8369
|
+
debug15("using postgres migration file");
|
|
8217
8370
|
const mig = new CreateContacts1690925872592();
|
|
8218
8371
|
await mig.down(queryRunner);
|
|
8219
|
-
|
|
8372
|
+
debug15("Migration statements executed");
|
|
8220
8373
|
return;
|
|
8221
8374
|
}
|
|
8222
8375
|
case "sqlite":
|
|
8223
8376
|
case "expo":
|
|
8224
8377
|
case "react-native": {
|
|
8225
|
-
|
|
8378
|
+
debug15("using sqlite/react-native migration file");
|
|
8226
8379
|
const mig = new CreateContacts1690925872693();
|
|
8227
8380
|
await mig.down(queryRunner);
|
|
8228
|
-
|
|
8381
|
+
debug15("Migration statements executed");
|
|
8229
8382
|
return;
|
|
8230
8383
|
}
|
|
8231
8384
|
default:
|
|
@@ -8235,7 +8388,7 @@ var CreateContacts1690925872318 = class {
|
|
|
8235
8388
|
};
|
|
8236
8389
|
|
|
8237
8390
|
// src/migrations/generic/4-CreateStatusList.ts
|
|
8238
|
-
var
|
|
8391
|
+
var import_debug16 = __toESM(require("debug"), 1);
|
|
8239
8392
|
|
|
8240
8393
|
// src/migrations/postgres/1693866470001-CreateStatusList.ts
|
|
8241
8394
|
var CreateStatusList1693866470001 = class {
|
|
@@ -8441,53 +8594,53 @@ var UpdateStatusList1737110469000 = class {
|
|
|
8441
8594
|
};
|
|
8442
8595
|
|
|
8443
8596
|
// src/migrations/generic/4-CreateStatusList.ts
|
|
8444
|
-
var
|
|
8597
|
+
var debug16 = (0, import_debug16.default)("sphereon:ssi-sdk:migrations");
|
|
8445
8598
|
var CreateStatusList1693866470000 = class {
|
|
8446
8599
|
static {
|
|
8447
8600
|
__name(this, "CreateStatusList1693866470000");
|
|
8448
8601
|
}
|
|
8449
8602
|
name = "CreateStatusList1693866470000";
|
|
8450
8603
|
async up(queryRunner) {
|
|
8451
|
-
|
|
8604
|
+
debug16("migration: creating issuance branding tables");
|
|
8452
8605
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8453
8606
|
if (dbType === "postgres") {
|
|
8454
|
-
|
|
8607
|
+
debug16("using postgres migration files");
|
|
8455
8608
|
const createMig = new CreateStatusList1693866470001();
|
|
8456
8609
|
await createMig.up(queryRunner);
|
|
8457
8610
|
const updateMig = new UpdateStatusList1737110469001();
|
|
8458
8611
|
const up = await updateMig.up(queryRunner);
|
|
8459
|
-
|
|
8612
|
+
debug16("Migration statements executed");
|
|
8460
8613
|
return up;
|
|
8461
8614
|
} else if (dbType === "sqlite" || dbType === "react-native" || dbType === "expo") {
|
|
8462
|
-
|
|
8615
|
+
debug16("using sqlite/react-native migration files");
|
|
8463
8616
|
const createMig = new CreateStatusList1693866470002();
|
|
8464
8617
|
await createMig.up(queryRunner);
|
|
8465
8618
|
const updateMig = new UpdateStatusList1737110469000();
|
|
8466
8619
|
const up = await updateMig.up(queryRunner);
|
|
8467
|
-
|
|
8620
|
+
debug16("Migration statements executed");
|
|
8468
8621
|
return up;
|
|
8469
8622
|
} else {
|
|
8470
8623
|
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
8624
|
}
|
|
8472
8625
|
}
|
|
8473
8626
|
async down(queryRunner) {
|
|
8474
|
-
|
|
8627
|
+
debug16("migration: reverting issuance branding tables");
|
|
8475
8628
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8476
8629
|
if (dbType === "postgres") {
|
|
8477
|
-
|
|
8630
|
+
debug16("using postgres migration files");
|
|
8478
8631
|
const updateMig = new UpdateStatusList1737110469001();
|
|
8479
8632
|
await updateMig.down(queryRunner);
|
|
8480
8633
|
const createMig = new CreateStatusList1693866470001();
|
|
8481
8634
|
const down = await createMig.down(queryRunner);
|
|
8482
|
-
|
|
8635
|
+
debug16("Migration statements executed");
|
|
8483
8636
|
return down;
|
|
8484
8637
|
} else if (dbType === "sqlite" || dbType === "react-native" || dbType === "expo") {
|
|
8485
|
-
|
|
8638
|
+
debug16("using sqlite/react-native migration files");
|
|
8486
8639
|
const updateMig = new UpdateStatusList1737110469000();
|
|
8487
8640
|
await updateMig.down(queryRunner);
|
|
8488
8641
|
const createMig = new CreateStatusList1693866470002();
|
|
8489
8642
|
const down = await createMig.down(queryRunner);
|
|
8490
|
-
|
|
8643
|
+
debug16("Migration statements executed");
|
|
8491
8644
|
return down;
|
|
8492
8645
|
} else {
|
|
8493
8646
|
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 +8649,7 @@ var CreateStatusList1693866470000 = class {
|
|
|
8496
8649
|
};
|
|
8497
8650
|
|
|
8498
8651
|
// src/migrations/generic/5-CreateAuditEvents.ts
|
|
8499
|
-
var
|
|
8652
|
+
var import_debug17 = __toESM(require("debug"), 1);
|
|
8500
8653
|
|
|
8501
8654
|
// src/migrations/postgres/1701634812183-CreateAuditEvents.ts
|
|
8502
8655
|
var CreateAuditEvents1701634812183 = class {
|
|
@@ -8595,30 +8748,30 @@ var CreateAuditEvents1701634819487 = class {
|
|
|
8595
8748
|
};
|
|
8596
8749
|
|
|
8597
8750
|
// src/migrations/generic/5-CreateAuditEvents.ts
|
|
8598
|
-
var
|
|
8751
|
+
var debug17 = (0, import_debug17.default)("sphereon:ssi-sdk:migrations");
|
|
8599
8752
|
var CreateAuditEvents1701635835330 = class {
|
|
8600
8753
|
static {
|
|
8601
8754
|
__name(this, "CreateAuditEvents1701635835330");
|
|
8602
8755
|
}
|
|
8603
8756
|
name = "CreateAuditEvents1701635835330";
|
|
8604
8757
|
async up(queryRunner) {
|
|
8605
|
-
|
|
8758
|
+
debug17("migration: creating audit events tables");
|
|
8606
8759
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8607
8760
|
switch (dbType) {
|
|
8608
8761
|
case "postgres": {
|
|
8609
|
-
|
|
8762
|
+
debug17("using postgres migration file");
|
|
8610
8763
|
const mig = new CreateAuditEvents1701634812183();
|
|
8611
8764
|
await mig.up(queryRunner);
|
|
8612
|
-
|
|
8765
|
+
debug17("Migration statements executed");
|
|
8613
8766
|
return;
|
|
8614
8767
|
}
|
|
8615
8768
|
case "sqlite":
|
|
8616
8769
|
case "expo":
|
|
8617
8770
|
case "react-native": {
|
|
8618
|
-
|
|
8771
|
+
debug17("using sqlite/react-native migration file");
|
|
8619
8772
|
const mig = new CreateAuditEvents1701634819487();
|
|
8620
8773
|
await mig.up(queryRunner);
|
|
8621
|
-
|
|
8774
|
+
debug17("Migration statements executed");
|
|
8622
8775
|
return;
|
|
8623
8776
|
}
|
|
8624
8777
|
default:
|
|
@@ -8626,23 +8779,23 @@ var CreateAuditEvents1701635835330 = class {
|
|
|
8626
8779
|
}
|
|
8627
8780
|
}
|
|
8628
8781
|
async down(queryRunner) {
|
|
8629
|
-
|
|
8782
|
+
debug17("migration: reverting audit events tables");
|
|
8630
8783
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8631
8784
|
switch (dbType) {
|
|
8632
8785
|
case "postgres": {
|
|
8633
|
-
|
|
8786
|
+
debug17("using postgres migration file");
|
|
8634
8787
|
const mig = new CreateAuditEvents1701634812183();
|
|
8635
8788
|
await mig.down(queryRunner);
|
|
8636
|
-
|
|
8789
|
+
debug17("Migration statements executed");
|
|
8637
8790
|
return;
|
|
8638
8791
|
}
|
|
8639
8792
|
case "sqlite":
|
|
8640
8793
|
case "expo":
|
|
8641
8794
|
case "react-native": {
|
|
8642
|
-
|
|
8795
|
+
debug17("using sqlite/react-native migration file");
|
|
8643
8796
|
const mig = new CreateAuditEvents1701634819487();
|
|
8644
8797
|
await mig.down(queryRunner);
|
|
8645
|
-
|
|
8798
|
+
debug17("Migration statements executed");
|
|
8646
8799
|
return;
|
|
8647
8800
|
}
|
|
8648
8801
|
default:
|
|
@@ -8652,7 +8805,7 @@ var CreateAuditEvents1701635835330 = class {
|
|
|
8652
8805
|
};
|
|
8653
8806
|
|
|
8654
8807
|
// src/migrations/generic/6-CreateDigitalCredential.ts
|
|
8655
|
-
var
|
|
8808
|
+
var import_debug18 = __toESM(require("debug"), 1);
|
|
8656
8809
|
|
|
8657
8810
|
// src/migrations/postgres/1708525189001-CreateDigitalCredential.ts
|
|
8658
8811
|
var CreateDigitalCredential1708525189001 = class {
|
|
@@ -8760,30 +8913,30 @@ var CreateDigitalCredential1708525189002 = class {
|
|
|
8760
8913
|
};
|
|
8761
8914
|
|
|
8762
8915
|
// src/migrations/generic/6-CreateDigitalCredential.ts
|
|
8763
|
-
var
|
|
8916
|
+
var debug18 = (0, import_debug18.default)("sphereon:ssi-sdk:migrations");
|
|
8764
8917
|
var CreateDigitalCredential1708525189000 = class {
|
|
8765
8918
|
static {
|
|
8766
8919
|
__name(this, "CreateDigitalCredential1708525189000");
|
|
8767
8920
|
}
|
|
8768
8921
|
name = "CreateDigitalCredential1708525189000";
|
|
8769
8922
|
async up(queryRunner) {
|
|
8770
|
-
|
|
8923
|
+
debug18("migration: creating DigitalCredential tables");
|
|
8771
8924
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8772
8925
|
switch (dbType) {
|
|
8773
8926
|
case "postgres": {
|
|
8774
|
-
|
|
8927
|
+
debug18("using postgres migration file for DigitalCredential");
|
|
8775
8928
|
const mig = new CreateDigitalCredential1708525189001();
|
|
8776
8929
|
await mig.up(queryRunner);
|
|
8777
|
-
|
|
8930
|
+
debug18("Postgres Migration statements for DigitalCredential executed");
|
|
8778
8931
|
return;
|
|
8779
8932
|
}
|
|
8780
8933
|
case "sqlite":
|
|
8781
8934
|
case "expo":
|
|
8782
8935
|
case "react-native": {
|
|
8783
|
-
|
|
8936
|
+
debug18("using sqlite/react-native migration file for DigitalCredential");
|
|
8784
8937
|
const mig = new CreateDigitalCredential1708525189002();
|
|
8785
8938
|
await mig.up(queryRunner);
|
|
8786
|
-
|
|
8939
|
+
debug18("SQLite Migration statements for DigitalCredential executed");
|
|
8787
8940
|
return;
|
|
8788
8941
|
}
|
|
8789
8942
|
default:
|
|
@@ -8791,23 +8944,23 @@ var CreateDigitalCredential1708525189000 = class {
|
|
|
8791
8944
|
}
|
|
8792
8945
|
}
|
|
8793
8946
|
async down(queryRunner) {
|
|
8794
|
-
|
|
8947
|
+
debug18("migration: reverting DigitalCredential tables");
|
|
8795
8948
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8796
8949
|
switch (dbType) {
|
|
8797
8950
|
case "postgres": {
|
|
8798
|
-
|
|
8951
|
+
debug18("using postgres migration file for DigitalCredential");
|
|
8799
8952
|
const mig = new CreateDigitalCredential1708525189001();
|
|
8800
8953
|
await mig.down(queryRunner);
|
|
8801
|
-
|
|
8954
|
+
debug18("Postgres Migration statements for DigitalCredential reverted");
|
|
8802
8955
|
return;
|
|
8803
8956
|
}
|
|
8804
8957
|
case "sqlite":
|
|
8805
8958
|
case "expo":
|
|
8806
8959
|
case "react-native": {
|
|
8807
|
-
|
|
8960
|
+
debug18("using sqlite/react-native migration file for DigitalCredential");
|
|
8808
8961
|
const mig = new CreateDigitalCredential1708525189002();
|
|
8809
8962
|
await mig.down(queryRunner);
|
|
8810
|
-
|
|
8963
|
+
debug18("SQLite Migration statements for DigitalCredential reverted");
|
|
8811
8964
|
return;
|
|
8812
8965
|
}
|
|
8813
8966
|
default:
|
|
@@ -8817,7 +8970,7 @@ var CreateDigitalCredential1708525189000 = class {
|
|
|
8817
8970
|
};
|
|
8818
8971
|
|
|
8819
8972
|
// src/migrations/generic/7-CreateMachineStateStore.ts
|
|
8820
|
-
var
|
|
8973
|
+
var import_debug19 = __toESM(require("debug"), 1);
|
|
8821
8974
|
|
|
8822
8975
|
// src/migrations/postgres/1708797018115-CreateMachineStateStore.ts
|
|
8823
8976
|
var CreateMachineStateStore1708797018115 = class {
|
|
@@ -8879,30 +9032,30 @@ var CreateMachineStateStore1708796002272 = class {
|
|
|
8879
9032
|
};
|
|
8880
9033
|
|
|
8881
9034
|
// src/migrations/generic/7-CreateMachineStateStore.ts
|
|
8882
|
-
var
|
|
9035
|
+
var debug19 = (0, import_debug19.default)("sphereon:ssi-sdk:migrations");
|
|
8883
9036
|
var CreateMachineStateStore1708098041262 = class {
|
|
8884
9037
|
static {
|
|
8885
9038
|
__name(this, "CreateMachineStateStore1708098041262");
|
|
8886
9039
|
}
|
|
8887
9040
|
name = "CreateMachineStateStore1708098041262";
|
|
8888
9041
|
async up(queryRunner) {
|
|
8889
|
-
|
|
9042
|
+
debug19("migration: creating machine state tables");
|
|
8890
9043
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8891
9044
|
switch (dbType) {
|
|
8892
9045
|
case "postgres": {
|
|
8893
|
-
|
|
9046
|
+
debug19("using postgres migration file");
|
|
8894
9047
|
const mig = new CreateMachineStateStore1708797018115();
|
|
8895
9048
|
await mig.up(queryRunner);
|
|
8896
|
-
|
|
9049
|
+
debug19("Migration statements executed");
|
|
8897
9050
|
return;
|
|
8898
9051
|
}
|
|
8899
9052
|
case "sqlite":
|
|
8900
9053
|
case "expo":
|
|
8901
9054
|
case "react-native": {
|
|
8902
|
-
|
|
9055
|
+
debug19("using sqlite/react-native migration file");
|
|
8903
9056
|
const mig = new CreateMachineStateStore1708796002272();
|
|
8904
9057
|
await mig.up(queryRunner);
|
|
8905
|
-
|
|
9058
|
+
debug19("Migration statements executed");
|
|
8906
9059
|
return;
|
|
8907
9060
|
}
|
|
8908
9061
|
default:
|
|
@@ -8910,23 +9063,23 @@ var CreateMachineStateStore1708098041262 = class {
|
|
|
8910
9063
|
}
|
|
8911
9064
|
}
|
|
8912
9065
|
async down(queryRunner) {
|
|
8913
|
-
|
|
9066
|
+
debug19("migration: reverting machine state tables");
|
|
8914
9067
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8915
9068
|
switch (dbType) {
|
|
8916
9069
|
case "postgres": {
|
|
8917
|
-
|
|
9070
|
+
debug19("using postgres migration file");
|
|
8918
9071
|
const mig = new CreateMachineStateStore1708797018115();
|
|
8919
9072
|
await mig.down(queryRunner);
|
|
8920
|
-
|
|
9073
|
+
debug19("Migration statements executed");
|
|
8921
9074
|
return;
|
|
8922
9075
|
}
|
|
8923
9076
|
case "sqlite":
|
|
8924
9077
|
case "expo":
|
|
8925
9078
|
case "react-native": {
|
|
8926
|
-
|
|
9079
|
+
debug19("using sqlite/react-native migration file");
|
|
8927
9080
|
const mig = new CreateMachineStateStore1708796002272();
|
|
8928
9081
|
await mig.down(queryRunner);
|
|
8929
|
-
|
|
9082
|
+
debug19("Migration statements executed");
|
|
8930
9083
|
return;
|
|
8931
9084
|
}
|
|
8932
9085
|
default:
|
|
@@ -8936,7 +9089,7 @@ var CreateMachineStateStore1708098041262 = class {
|
|
|
8936
9089
|
};
|
|
8937
9090
|
|
|
8938
9091
|
// src/migrations/generic/8-CreateContacts.ts
|
|
8939
|
-
var
|
|
9092
|
+
var import_debug20 = __toESM(require("debug"), 1);
|
|
8940
9093
|
|
|
8941
9094
|
// src/migrations/postgres/1710438363001-CreateContacts.ts
|
|
8942
9095
|
var CreateContacts1710438363001 = class {
|
|
@@ -9050,30 +9203,30 @@ var CreateContacts1710438363002 = class {
|
|
|
9050
9203
|
};
|
|
9051
9204
|
|
|
9052
9205
|
// src/migrations/generic/8-CreateContacts.ts
|
|
9053
|
-
var
|
|
9206
|
+
var debug20 = (0, import_debug20.default)("sphereon:ssi-sdk:migrations");
|
|
9054
9207
|
var CreateContacts1708525189000 = class {
|
|
9055
9208
|
static {
|
|
9056
9209
|
__name(this, "CreateContacts1708525189000");
|
|
9057
9210
|
}
|
|
9058
9211
|
name = "CreateContacts1708525189000";
|
|
9059
9212
|
async up(queryRunner) {
|
|
9060
|
-
|
|
9213
|
+
debug20("migration: updating contact tables");
|
|
9061
9214
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9062
9215
|
switch (dbType) {
|
|
9063
9216
|
case "postgres": {
|
|
9064
|
-
|
|
9217
|
+
debug20("using postgres migration file");
|
|
9065
9218
|
const mig = new CreateContacts1710438363001();
|
|
9066
9219
|
await mig.up(queryRunner);
|
|
9067
|
-
|
|
9220
|
+
debug20("Migration statements executed");
|
|
9068
9221
|
return;
|
|
9069
9222
|
}
|
|
9070
9223
|
case "sqlite":
|
|
9071
9224
|
case "expo":
|
|
9072
9225
|
case "react-native": {
|
|
9073
|
-
|
|
9226
|
+
debug20("using sqlite/react-native migration file");
|
|
9074
9227
|
const mig = new CreateContacts1710438363002();
|
|
9075
9228
|
await mig.up(queryRunner);
|
|
9076
|
-
|
|
9229
|
+
debug20("Migration statements executed");
|
|
9077
9230
|
return;
|
|
9078
9231
|
}
|
|
9079
9232
|
default:
|
|
@@ -9081,23 +9234,23 @@ var CreateContacts1708525189000 = class {
|
|
|
9081
9234
|
}
|
|
9082
9235
|
}
|
|
9083
9236
|
async down(queryRunner) {
|
|
9084
|
-
|
|
9237
|
+
debug20("migration: reverting machine state tables");
|
|
9085
9238
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9086
9239
|
switch (dbType) {
|
|
9087
9240
|
case "postgres": {
|
|
9088
|
-
|
|
9241
|
+
debug20("using postgres migration file");
|
|
9089
9242
|
const mig = new CreateContacts1710438363001();
|
|
9090
9243
|
await mig.down(queryRunner);
|
|
9091
|
-
|
|
9244
|
+
debug20("Migration statements executed");
|
|
9092
9245
|
return;
|
|
9093
9246
|
}
|
|
9094
9247
|
case "sqlite":
|
|
9095
9248
|
case "expo":
|
|
9096
9249
|
case "react-native": {
|
|
9097
|
-
|
|
9250
|
+
debug20("using sqlite/react-native migration file");
|
|
9098
9251
|
const mig = new CreateContacts1710438363002();
|
|
9099
9252
|
await mig.down(queryRunner);
|
|
9100
|
-
|
|
9253
|
+
debug20("Migration statements executed");
|
|
9101
9254
|
return;
|
|
9102
9255
|
}
|
|
9103
9256
|
default:
|
|
@@ -9107,7 +9260,7 @@ var CreateContacts1708525189000 = class {
|
|
|
9107
9260
|
};
|
|
9108
9261
|
|
|
9109
9262
|
// src/migrations/generic/9-CreateContacts.ts
|
|
9110
|
-
var
|
|
9263
|
+
var import_debug21 = __toESM(require("debug"), 1);
|
|
9111
9264
|
|
|
9112
9265
|
// src/migrations/postgres/1715761125001-CreateContacts.ts
|
|
9113
9266
|
var CreateContacts1715761125001 = class {
|
|
@@ -9219,30 +9372,30 @@ var CreateContacts1715761125002 = class {
|
|
|
9219
9372
|
};
|
|
9220
9373
|
|
|
9221
9374
|
// src/migrations/generic/9-CreateContacts.ts
|
|
9222
|
-
var
|
|
9375
|
+
var debug21 = (0, import_debug21.default)("sphereon:ssi-sdk:migrations");
|
|
9223
9376
|
var CreateContacts1715761125000 = class {
|
|
9224
9377
|
static {
|
|
9225
9378
|
__name(this, "CreateContacts1715761125000");
|
|
9226
9379
|
}
|
|
9227
9380
|
name = "CreateContacts1715761125000";
|
|
9228
9381
|
async up(queryRunner) {
|
|
9229
|
-
|
|
9382
|
+
debug21("migration: updating contact tables");
|
|
9230
9383
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9231
9384
|
switch (dbType) {
|
|
9232
9385
|
case "postgres": {
|
|
9233
|
-
|
|
9386
|
+
debug21("using postgres migration file");
|
|
9234
9387
|
const mig = new CreateContacts1715761125001();
|
|
9235
9388
|
await mig.up(queryRunner);
|
|
9236
|
-
|
|
9389
|
+
debug21("Migration statements executed");
|
|
9237
9390
|
return;
|
|
9238
9391
|
}
|
|
9239
9392
|
case "sqlite":
|
|
9240
9393
|
case "expo":
|
|
9241
9394
|
case "react-native": {
|
|
9242
|
-
|
|
9395
|
+
debug21("using sqlite/react-native migration file");
|
|
9243
9396
|
const mig = new CreateContacts1715761125002();
|
|
9244
9397
|
await mig.up(queryRunner);
|
|
9245
|
-
|
|
9398
|
+
debug21("Migration statements executed");
|
|
9246
9399
|
return;
|
|
9247
9400
|
}
|
|
9248
9401
|
default:
|
|
@@ -9250,23 +9403,23 @@ var CreateContacts1715761125000 = class {
|
|
|
9250
9403
|
}
|
|
9251
9404
|
}
|
|
9252
9405
|
async down(queryRunner) {
|
|
9253
|
-
|
|
9406
|
+
debug21("migration: reverting machine state tables");
|
|
9254
9407
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9255
9408
|
switch (dbType) {
|
|
9256
9409
|
case "postgres": {
|
|
9257
|
-
|
|
9410
|
+
debug21("using postgres migration file");
|
|
9258
9411
|
const mig = new CreateContacts1715761125001();
|
|
9259
9412
|
await mig.down(queryRunner);
|
|
9260
|
-
|
|
9413
|
+
debug21("Migration statements executed");
|
|
9261
9414
|
return;
|
|
9262
9415
|
}
|
|
9263
9416
|
case "sqlite":
|
|
9264
9417
|
case "expo":
|
|
9265
9418
|
case "react-native": {
|
|
9266
|
-
|
|
9419
|
+
debug21("using sqlite/react-native migration file");
|
|
9267
9420
|
const mig = new CreateContacts1715761125002();
|
|
9268
9421
|
await mig.down(queryRunner);
|
|
9269
|
-
|
|
9422
|
+
debug21("Migration statements executed");
|
|
9270
9423
|
return;
|
|
9271
9424
|
}
|
|
9272
9425
|
default:
|
|
@@ -9295,7 +9448,8 @@ var DataStoreEventLoggerMigrations = [
|
|
|
9295
9448
|
CreateAuditEvents1701635835330
|
|
9296
9449
|
];
|
|
9297
9450
|
var DataStoreDigitalCredentialMigrations = [
|
|
9298
|
-
CreateDigitalCredential1708525189000
|
|
9451
|
+
CreateDigitalCredential1708525189000,
|
|
9452
|
+
AddLinkedVpFields1763387280000
|
|
9299
9453
|
];
|
|
9300
9454
|
var DataStoreMachineStateMigrations = [
|
|
9301
9455
|
CreateMachineStateStore1708098041262
|
|
@@ -9367,6 +9521,18 @@ function determineCredentialDocumentFormat(documentFormat) {
|
|
|
9367
9521
|
}
|
|
9368
9522
|
}
|
|
9369
9523
|
__name(determineCredentialDocumentFormat, "determineCredentialDocumentFormat");
|
|
9524
|
+
function normalizeNullableFields(obj, nullableKeys) {
|
|
9525
|
+
const normalized = {
|
|
9526
|
+
...obj
|
|
9527
|
+
};
|
|
9528
|
+
for (const key of nullableKeys) {
|
|
9529
|
+
if (normalized[key] === void 0) {
|
|
9530
|
+
normalized[key] = null;
|
|
9531
|
+
}
|
|
9532
|
+
}
|
|
9533
|
+
return normalized;
|
|
9534
|
+
}
|
|
9535
|
+
__name(normalizeNullableFields, "normalizeNullableFields");
|
|
9370
9536
|
function getValidUntil(uniformDocument) {
|
|
9371
9537
|
if ("expirationDate" in uniformDocument && uniformDocument.expirationDate) {
|
|
9372
9538
|
return new Date(uniformDocument.expirationDate);
|
|
@@ -9429,6 +9595,33 @@ var nonPersistedDigitalCredentialEntityFromAddArgs = /* @__PURE__ */ __name((add
|
|
|
9429
9595
|
lastUpdatedAt: /* @__PURE__ */ new Date()
|
|
9430
9596
|
};
|
|
9431
9597
|
}, "nonPersistedDigitalCredentialEntityFromAddArgs");
|
|
9598
|
+
var persistedDigitalCredentialEntityFromUpdateArgs = /* @__PURE__ */ __name((existingCredential, updates) => {
|
|
9599
|
+
const entity = new DigitalCredentialEntity();
|
|
9600
|
+
Object.assign(entity, existingCredential);
|
|
9601
|
+
const normalizedUpdates = normalizeNullableFields(updates, [
|
|
9602
|
+
"linkedVpId",
|
|
9603
|
+
"linkedVpFrom"
|
|
9604
|
+
]);
|
|
9605
|
+
Object.assign(entity, normalizedUpdates);
|
|
9606
|
+
entity.id = existingCredential.id;
|
|
9607
|
+
entity.hash = existingCredential.hash;
|
|
9608
|
+
entity.createdAt = existingCredential.createdAt;
|
|
9609
|
+
entity.lastUpdatedAt = /* @__PURE__ */ new Date();
|
|
9610
|
+
return entity;
|
|
9611
|
+
}, "persistedDigitalCredentialEntityFromUpdateArgs");
|
|
9612
|
+
var persistedDigitalCredentialEntityFromStateArgs = /* @__PURE__ */ __name((existingCredential, args) => {
|
|
9613
|
+
const entity = new DigitalCredentialEntity();
|
|
9614
|
+
Object.assign(entity, existingCredential);
|
|
9615
|
+
entity.verifiedState = args.verifiedState;
|
|
9616
|
+
entity.lastUpdatedAt = /* @__PURE__ */ new Date();
|
|
9617
|
+
if (args.verifiedState === import_ssi_sdk35.CredentialStateType.REVOKED && args.revokedAt) {
|
|
9618
|
+
entity.revokedAt = args.revokedAt;
|
|
9619
|
+
}
|
|
9620
|
+
if (args.verifiedState !== import_ssi_sdk35.CredentialStateType.REVOKED && args.verifiedAt) {
|
|
9621
|
+
entity.verifiedAt = args.verifiedAt;
|
|
9622
|
+
}
|
|
9623
|
+
return entity;
|
|
9624
|
+
}, "persistedDigitalCredentialEntityFromStateArgs");
|
|
9432
9625
|
var digitalCredentialFrom = /* @__PURE__ */ __name((credentialEntity) => {
|
|
9433
9626
|
const result = {
|
|
9434
9627
|
...credentialEntity
|