@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.js
CHANGED
|
@@ -1922,6 +1922,8 @@ var DigitalCredentialEntity = class extends BaseEntity11 {
|
|
|
1922
1922
|
rpCorrelationId;
|
|
1923
1923
|
verifiedState;
|
|
1924
1924
|
tenantId;
|
|
1925
|
+
linkedVpId;
|
|
1926
|
+
linkedVpFrom;
|
|
1925
1927
|
createdAt;
|
|
1926
1928
|
presentedAt;
|
|
1927
1929
|
lastUpdatedAt;
|
|
@@ -2084,6 +2086,21 @@ _ts_decorate18([
|
|
|
2084
2086
|
}),
|
|
2085
2087
|
_ts_metadata17("design:type", String)
|
|
2086
2088
|
], DigitalCredentialEntity.prototype, "tenantId", void 0);
|
|
2089
|
+
_ts_decorate18([
|
|
2090
|
+
Column15("text", {
|
|
2091
|
+
name: "linked_vp_id",
|
|
2092
|
+
nullable: true
|
|
2093
|
+
}),
|
|
2094
|
+
_ts_metadata17("design:type", String)
|
|
2095
|
+
], DigitalCredentialEntity.prototype, "linkedVpId", void 0);
|
|
2096
|
+
_ts_decorate18([
|
|
2097
|
+
CreateDateColumn8({
|
|
2098
|
+
name: "linked_vp_from",
|
|
2099
|
+
nullable: true,
|
|
2100
|
+
type: typeOrmDateTime10()
|
|
2101
|
+
}),
|
|
2102
|
+
_ts_metadata17("design:type", typeof Date === "undefined" ? Object : Date)
|
|
2103
|
+
], DigitalCredentialEntity.prototype, "linkedVpFrom", void 0);
|
|
2087
2104
|
_ts_decorate18([
|
|
2088
2105
|
CreateDateColumn8({
|
|
2089
2106
|
name: "created_at",
|
|
@@ -5281,6 +5298,34 @@ var DigitalCredentialStore = class extends AbstractDigitalCredentialStore {
|
|
|
5281
5298
|
total
|
|
5282
5299
|
};
|
|
5283
5300
|
}, "getCredentials");
|
|
5301
|
+
updateCredential = /* @__PURE__ */ __name(async (args) => {
|
|
5302
|
+
const dcRepo = await this.getRepository();
|
|
5303
|
+
const whereClause = {};
|
|
5304
|
+
if ("id" in args) {
|
|
5305
|
+
whereClause.id = args.id;
|
|
5306
|
+
} else if ("hash" in args) {
|
|
5307
|
+
whereClause.hash = args.hash;
|
|
5308
|
+
} else {
|
|
5309
|
+
return Promise.reject(Error("No id or hash param is provided."));
|
|
5310
|
+
}
|
|
5311
|
+
const credential = await dcRepo.findOne({
|
|
5312
|
+
where: whereClause
|
|
5313
|
+
});
|
|
5314
|
+
if (!credential) {
|
|
5315
|
+
return Promise.reject(Error(`No credential found for args: ${JSON.stringify(whereClause)}`));
|
|
5316
|
+
}
|
|
5317
|
+
const updates = Object.fromEntries(Object.entries(args).filter(([key]) => key !== "id" && key !== "hash"));
|
|
5318
|
+
const entityToSave = persistedDigitalCredentialEntityFromUpdateArgs(credential, updates);
|
|
5319
|
+
const validationError = this.assertValidDigitalCredential(entityToSave);
|
|
5320
|
+
if (validationError) {
|
|
5321
|
+
return Promise.reject(validationError);
|
|
5322
|
+
}
|
|
5323
|
+
debug2("Updating credential", entityToSave);
|
|
5324
|
+
const updatedResult = await dcRepo.save(entityToSave, {
|
|
5325
|
+
transaction: true
|
|
5326
|
+
});
|
|
5327
|
+
return digitalCredentialFrom(updatedResult);
|
|
5328
|
+
}, "updateCredential");
|
|
5284
5329
|
removeCredential = /* @__PURE__ */ __name(async (args) => {
|
|
5285
5330
|
if (!args) {
|
|
5286
5331
|
return false;
|
|
@@ -5351,20 +5396,9 @@ var DigitalCredentialStore = class extends AbstractDigitalCredentialStore {
|
|
|
5351
5396
|
if (!credential) {
|
|
5352
5397
|
return Promise.reject(Error(`No credential found for args: ${JSON.stringify(whereClause)}`));
|
|
5353
5398
|
}
|
|
5354
|
-
const
|
|
5355
|
-
|
|
5356
|
-
|
|
5357
|
-
verifiedAt: args.verifiedAt
|
|
5358
|
-
},
|
|
5359
|
-
...args.verifiedState === CredentialStateType2.REVOKED && {
|
|
5360
|
-
revokedAt: args.revokedAt
|
|
5361
|
-
},
|
|
5362
|
-
identifierMethod: credential.identifierMethod,
|
|
5363
|
-
lastUpdatedAt: /* @__PURE__ */ new Date(),
|
|
5364
|
-
verifiedState: args.verifiedState
|
|
5365
|
-
};
|
|
5366
|
-
debug2("Updating credential", credential);
|
|
5367
|
-
const updatedResult = await credentialRepository.save(updatedCredential, {
|
|
5399
|
+
const entityToSave = persistedDigitalCredentialEntityFromStateArgs(credential, args);
|
|
5400
|
+
debug2("Updating credential state", entityToSave);
|
|
5401
|
+
const updatedResult = await credentialRepository.save(entityToSave, {
|
|
5368
5402
|
transaction: true
|
|
5369
5403
|
});
|
|
5370
5404
|
return digitalCredentialFrom(updatedResult);
|
|
@@ -7749,32 +7783,148 @@ var CreateDcqlQueryItem1726617600000 = class {
|
|
|
7749
7783
|
}
|
|
7750
7784
|
};
|
|
7751
7785
|
|
|
7752
|
-
// src/migrations/generic/
|
|
7786
|
+
// src/migrations/generic/14-AddLinkedVpFields.ts
|
|
7753
7787
|
import Debug13 from "debug";
|
|
7788
|
+
|
|
7789
|
+
// src/migrations/postgres/1763387280001-AddLinkedVpFields.ts
|
|
7790
|
+
var AddLinkedVpFields1763387280001 = class {
|
|
7791
|
+
static {
|
|
7792
|
+
__name(this, "AddLinkedVpFields1763387280001");
|
|
7793
|
+
}
|
|
7794
|
+
name = "AddLinkedVpFields1763387280001";
|
|
7795
|
+
async up(queryRunner) {
|
|
7796
|
+
await queryRunner.query(`
|
|
7797
|
+
ALTER TABLE "DigitalCredential"
|
|
7798
|
+
ADD COLUMN "linked_vp_id" text
|
|
7799
|
+
`);
|
|
7800
|
+
await queryRunner.query(`
|
|
7801
|
+
ALTER TABLE "DigitalCredential"
|
|
7802
|
+
ADD COLUMN "linked_vp_from" TIMESTAMP
|
|
7803
|
+
`);
|
|
7804
|
+
}
|
|
7805
|
+
async down(queryRunner) {
|
|
7806
|
+
await queryRunner.query(`
|
|
7807
|
+
ALTER TABLE "DigitalCredential"
|
|
7808
|
+
DROP COLUMN "linked_vp_from"
|
|
7809
|
+
`);
|
|
7810
|
+
await queryRunner.query(`
|
|
7811
|
+
ALTER TABLE "DigitalCredential"
|
|
7812
|
+
DROP COLUMN "linked_vp_id"
|
|
7813
|
+
`);
|
|
7814
|
+
}
|
|
7815
|
+
};
|
|
7816
|
+
|
|
7817
|
+
// src/migrations/sqlite/1763387280002-AddLinkedVpFields.ts
|
|
7818
|
+
var AddLinkedVpFields1763387280002 = class {
|
|
7819
|
+
static {
|
|
7820
|
+
__name(this, "AddLinkedVpFields1763387280002");
|
|
7821
|
+
}
|
|
7822
|
+
name = "AddLinkedVpFields1763387280002";
|
|
7823
|
+
async up(queryRunner) {
|
|
7824
|
+
await queryRunner.query(`
|
|
7825
|
+
ALTER TABLE "DigitalCredential"
|
|
7826
|
+
ADD COLUMN "linked_vp_id" text
|
|
7827
|
+
`);
|
|
7828
|
+
await queryRunner.query(`
|
|
7829
|
+
ALTER TABLE "DigitalCredential"
|
|
7830
|
+
ADD COLUMN "linked_vp_from" datetime
|
|
7831
|
+
`);
|
|
7832
|
+
}
|
|
7833
|
+
async down(queryRunner) {
|
|
7834
|
+
await queryRunner.query(`
|
|
7835
|
+
ALTER TABLE "DigitalCredential"
|
|
7836
|
+
DROP COLUMN "linked_vp_from"
|
|
7837
|
+
`);
|
|
7838
|
+
await queryRunner.query(`
|
|
7839
|
+
ALTER TABLE "DigitalCredential"
|
|
7840
|
+
DROP COLUMN "linked_vp_id"
|
|
7841
|
+
`);
|
|
7842
|
+
}
|
|
7843
|
+
};
|
|
7844
|
+
|
|
7845
|
+
// src/migrations/generic/14-AddLinkedVpFields.ts
|
|
7754
7846
|
var debug13 = Debug13("sphereon:ssi-sdk:migrations");
|
|
7847
|
+
var AddLinkedVpFields1763387280000 = class {
|
|
7848
|
+
static {
|
|
7849
|
+
__name(this, "AddLinkedVpFields1763387280000");
|
|
7850
|
+
}
|
|
7851
|
+
name = "AddLinkedVpFields1763387280000";
|
|
7852
|
+
async up(queryRunner) {
|
|
7853
|
+
debug13("migration: adding linked VP fields to DigitalCredential table");
|
|
7854
|
+
const dbType = queryRunner.connection.driver.options.type;
|
|
7855
|
+
switch (dbType) {
|
|
7856
|
+
case "postgres": {
|
|
7857
|
+
debug13("using postgres migration file for AddLinkedVpFields");
|
|
7858
|
+
const mig = new AddLinkedVpFields1763387280001();
|
|
7859
|
+
await mig.up(queryRunner);
|
|
7860
|
+
debug13("Postgres migration statements for AddLinkedVpFields executed");
|
|
7861
|
+
return;
|
|
7862
|
+
}
|
|
7863
|
+
case "sqlite":
|
|
7864
|
+
case "expo":
|
|
7865
|
+
case "react-native": {
|
|
7866
|
+
debug13("using sqlite/react-native migration file for AddLinkedVpFields");
|
|
7867
|
+
const mig = new AddLinkedVpFields1763387280002();
|
|
7868
|
+
await mig.up(queryRunner);
|
|
7869
|
+
debug13("SQLite migration statements for AddLinkedVpFields executed");
|
|
7870
|
+
return;
|
|
7871
|
+
}
|
|
7872
|
+
default:
|
|
7873
|
+
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`);
|
|
7874
|
+
}
|
|
7875
|
+
}
|
|
7876
|
+
async down(queryRunner) {
|
|
7877
|
+
debug13("migration: reverting linked VP fields from DigitalCredential table");
|
|
7878
|
+
const dbType = queryRunner.connection.driver.options.type;
|
|
7879
|
+
switch (dbType) {
|
|
7880
|
+
case "postgres": {
|
|
7881
|
+
debug13("using postgres migration file for AddLinkedVpFields");
|
|
7882
|
+
const mig = new AddLinkedVpFields1763387280001();
|
|
7883
|
+
await mig.down(queryRunner);
|
|
7884
|
+
debug13("Postgres migration statements for AddLinkedVpFields reverted");
|
|
7885
|
+
return;
|
|
7886
|
+
}
|
|
7887
|
+
case "sqlite":
|
|
7888
|
+
case "expo":
|
|
7889
|
+
case "react-native": {
|
|
7890
|
+
debug13("using sqlite/react-native migration file for AddLinkedVpFields");
|
|
7891
|
+
const mig = new AddLinkedVpFields1763387280002();
|
|
7892
|
+
await mig.down(queryRunner);
|
|
7893
|
+
debug13("SQLite migration statements for AddLinkedVpFields reverted");
|
|
7894
|
+
return;
|
|
7895
|
+
}
|
|
7896
|
+
default:
|
|
7897
|
+
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`);
|
|
7898
|
+
}
|
|
7899
|
+
}
|
|
7900
|
+
};
|
|
7901
|
+
|
|
7902
|
+
// src/migrations/generic/2-CreateIssuanceBranding.ts
|
|
7903
|
+
import Debug14 from "debug";
|
|
7904
|
+
var debug14 = Debug14("sphereon:ssi-sdk:migrations");
|
|
7755
7905
|
var CreateIssuanceBranding1659463079429 = class {
|
|
7756
7906
|
static {
|
|
7757
7907
|
__name(this, "CreateIssuanceBranding1659463079429");
|
|
7758
7908
|
}
|
|
7759
7909
|
name = "CreateIssuanceBranding1659463079429";
|
|
7760
7910
|
async up(queryRunner) {
|
|
7761
|
-
|
|
7911
|
+
debug14("migration: creating issuance branding tables");
|
|
7762
7912
|
const dbType = queryRunner.connection.driver.options.type;
|
|
7763
7913
|
switch (dbType) {
|
|
7764
7914
|
case "postgres": {
|
|
7765
|
-
|
|
7915
|
+
debug14("using postgres migration file");
|
|
7766
7916
|
const mig = new CreateIssuanceBranding1685628974232();
|
|
7767
7917
|
await mig.up(queryRunner);
|
|
7768
|
-
|
|
7918
|
+
debug14("Migration statements executed");
|
|
7769
7919
|
return;
|
|
7770
7920
|
}
|
|
7771
7921
|
case "sqlite":
|
|
7772
7922
|
case "expo":
|
|
7773
7923
|
case "react-native": {
|
|
7774
|
-
|
|
7924
|
+
debug14("using sqlite/react-native migration file");
|
|
7775
7925
|
const mig = new CreateIssuanceBranding1685628973231();
|
|
7776
7926
|
await mig.up(queryRunner);
|
|
7777
|
-
|
|
7927
|
+
debug14("Migration statements executed");
|
|
7778
7928
|
return;
|
|
7779
7929
|
}
|
|
7780
7930
|
default:
|
|
@@ -7782,23 +7932,23 @@ var CreateIssuanceBranding1659463079429 = class {
|
|
|
7782
7932
|
}
|
|
7783
7933
|
}
|
|
7784
7934
|
async down(queryRunner) {
|
|
7785
|
-
|
|
7935
|
+
debug14("migration: reverting issuance branding tables");
|
|
7786
7936
|
const dbType = queryRunner.connection.driver.options.type;
|
|
7787
7937
|
switch (dbType) {
|
|
7788
7938
|
case "postgres": {
|
|
7789
|
-
|
|
7939
|
+
debug14("using postgres migration file");
|
|
7790
7940
|
const mig = new CreateIssuanceBranding1685628974232();
|
|
7791
7941
|
await mig.down(queryRunner);
|
|
7792
|
-
|
|
7942
|
+
debug14("Migration statements executed");
|
|
7793
7943
|
return;
|
|
7794
7944
|
}
|
|
7795
7945
|
case "sqlite":
|
|
7796
7946
|
case "expo":
|
|
7797
7947
|
case "react-native": {
|
|
7798
|
-
|
|
7948
|
+
debug14("using sqlite/react-native migration file");
|
|
7799
7949
|
const mig = new CreateIssuanceBranding1685628973231();
|
|
7800
7950
|
await mig.down(queryRunner);
|
|
7801
|
-
|
|
7951
|
+
debug14("Migration statements executed");
|
|
7802
7952
|
return;
|
|
7803
7953
|
}
|
|
7804
7954
|
default:
|
|
@@ -7808,7 +7958,7 @@ var CreateIssuanceBranding1659463079429 = class {
|
|
|
7808
7958
|
};
|
|
7809
7959
|
|
|
7810
7960
|
// src/migrations/generic/3-CreateContacts.ts
|
|
7811
|
-
import
|
|
7961
|
+
import Debug15 from "debug";
|
|
7812
7962
|
|
|
7813
7963
|
// src/migrations/postgres/1690925872592-CreateContacts.ts
|
|
7814
7964
|
import { enablePostgresUuidExtension as enablePostgresUuidExtension3 } from "@sphereon/ssi-sdk.core";
|
|
@@ -8029,30 +8179,30 @@ var CreateContacts1690925872693 = class {
|
|
|
8029
8179
|
};
|
|
8030
8180
|
|
|
8031
8181
|
// src/migrations/generic/3-CreateContacts.ts
|
|
8032
|
-
var
|
|
8182
|
+
var debug15 = Debug15("sphereon:ssi-sdk:migrations");
|
|
8033
8183
|
var CreateContacts1690925872318 = class {
|
|
8034
8184
|
static {
|
|
8035
8185
|
__name(this, "CreateContacts1690925872318");
|
|
8036
8186
|
}
|
|
8037
8187
|
name = "CreateContacts1690925872318";
|
|
8038
8188
|
async up(queryRunner) {
|
|
8039
|
-
|
|
8189
|
+
debug15("migration: creating contacts tables");
|
|
8040
8190
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8041
8191
|
switch (dbType) {
|
|
8042
8192
|
case "postgres": {
|
|
8043
|
-
|
|
8193
|
+
debug15("using postgres migration file");
|
|
8044
8194
|
const mig = new CreateContacts1690925872592();
|
|
8045
8195
|
await mig.up(queryRunner);
|
|
8046
|
-
|
|
8196
|
+
debug15("Migration statements executed");
|
|
8047
8197
|
return;
|
|
8048
8198
|
}
|
|
8049
8199
|
case "sqlite":
|
|
8050
8200
|
case "expo":
|
|
8051
8201
|
case "react-native": {
|
|
8052
|
-
|
|
8202
|
+
debug15("using sqlite/react-native migration file");
|
|
8053
8203
|
const mig = new CreateContacts1690925872693();
|
|
8054
8204
|
await mig.up(queryRunner);
|
|
8055
|
-
|
|
8205
|
+
debug15("Migration statements executed");
|
|
8056
8206
|
return;
|
|
8057
8207
|
}
|
|
8058
8208
|
default:
|
|
@@ -8060,23 +8210,23 @@ var CreateContacts1690925872318 = class {
|
|
|
8060
8210
|
}
|
|
8061
8211
|
}
|
|
8062
8212
|
async down(queryRunner) {
|
|
8063
|
-
|
|
8213
|
+
debug15("migration: reverting contacts tables");
|
|
8064
8214
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8065
8215
|
switch (dbType) {
|
|
8066
8216
|
case "postgres": {
|
|
8067
|
-
|
|
8217
|
+
debug15("using postgres migration file");
|
|
8068
8218
|
const mig = new CreateContacts1690925872592();
|
|
8069
8219
|
await mig.down(queryRunner);
|
|
8070
|
-
|
|
8220
|
+
debug15("Migration statements executed");
|
|
8071
8221
|
return;
|
|
8072
8222
|
}
|
|
8073
8223
|
case "sqlite":
|
|
8074
8224
|
case "expo":
|
|
8075
8225
|
case "react-native": {
|
|
8076
|
-
|
|
8226
|
+
debug15("using sqlite/react-native migration file");
|
|
8077
8227
|
const mig = new CreateContacts1690925872693();
|
|
8078
8228
|
await mig.down(queryRunner);
|
|
8079
|
-
|
|
8229
|
+
debug15("Migration statements executed");
|
|
8080
8230
|
return;
|
|
8081
8231
|
}
|
|
8082
8232
|
default:
|
|
@@ -8086,7 +8236,7 @@ var CreateContacts1690925872318 = class {
|
|
|
8086
8236
|
};
|
|
8087
8237
|
|
|
8088
8238
|
// src/migrations/generic/4-CreateStatusList.ts
|
|
8089
|
-
import
|
|
8239
|
+
import Debug16 from "debug";
|
|
8090
8240
|
|
|
8091
8241
|
// src/migrations/postgres/1693866470001-CreateStatusList.ts
|
|
8092
8242
|
var CreateStatusList1693866470001 = class {
|
|
@@ -8292,53 +8442,53 @@ var UpdateStatusList1737110469000 = class {
|
|
|
8292
8442
|
};
|
|
8293
8443
|
|
|
8294
8444
|
// src/migrations/generic/4-CreateStatusList.ts
|
|
8295
|
-
var
|
|
8445
|
+
var debug16 = Debug16("sphereon:ssi-sdk:migrations");
|
|
8296
8446
|
var CreateStatusList1693866470000 = class {
|
|
8297
8447
|
static {
|
|
8298
8448
|
__name(this, "CreateStatusList1693866470000");
|
|
8299
8449
|
}
|
|
8300
8450
|
name = "CreateStatusList1693866470000";
|
|
8301
8451
|
async up(queryRunner) {
|
|
8302
|
-
|
|
8452
|
+
debug16("migration: creating issuance branding tables");
|
|
8303
8453
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8304
8454
|
if (dbType === "postgres") {
|
|
8305
|
-
|
|
8455
|
+
debug16("using postgres migration files");
|
|
8306
8456
|
const createMig = new CreateStatusList1693866470001();
|
|
8307
8457
|
await createMig.up(queryRunner);
|
|
8308
8458
|
const updateMig = new UpdateStatusList1737110469001();
|
|
8309
8459
|
const up = await updateMig.up(queryRunner);
|
|
8310
|
-
|
|
8460
|
+
debug16("Migration statements executed");
|
|
8311
8461
|
return up;
|
|
8312
8462
|
} else if (dbType === "sqlite" || dbType === "react-native" || dbType === "expo") {
|
|
8313
|
-
|
|
8463
|
+
debug16("using sqlite/react-native migration files");
|
|
8314
8464
|
const createMig = new CreateStatusList1693866470002();
|
|
8315
8465
|
await createMig.up(queryRunner);
|
|
8316
8466
|
const updateMig = new UpdateStatusList1737110469000();
|
|
8317
8467
|
const up = await updateMig.up(queryRunner);
|
|
8318
|
-
|
|
8468
|
+
debug16("Migration statements executed");
|
|
8319
8469
|
return up;
|
|
8320
8470
|
} else {
|
|
8321
8471
|
return Promise.reject(`Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`);
|
|
8322
8472
|
}
|
|
8323
8473
|
}
|
|
8324
8474
|
async down(queryRunner) {
|
|
8325
|
-
|
|
8475
|
+
debug16("migration: reverting issuance branding tables");
|
|
8326
8476
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8327
8477
|
if (dbType === "postgres") {
|
|
8328
|
-
|
|
8478
|
+
debug16("using postgres migration files");
|
|
8329
8479
|
const updateMig = new UpdateStatusList1737110469001();
|
|
8330
8480
|
await updateMig.down(queryRunner);
|
|
8331
8481
|
const createMig = new CreateStatusList1693866470001();
|
|
8332
8482
|
const down = await createMig.down(queryRunner);
|
|
8333
|
-
|
|
8483
|
+
debug16("Migration statements executed");
|
|
8334
8484
|
return down;
|
|
8335
8485
|
} else if (dbType === "sqlite" || dbType === "react-native" || dbType === "expo") {
|
|
8336
|
-
|
|
8486
|
+
debug16("using sqlite/react-native migration files");
|
|
8337
8487
|
const updateMig = new UpdateStatusList1737110469000();
|
|
8338
8488
|
await updateMig.down(queryRunner);
|
|
8339
8489
|
const createMig = new CreateStatusList1693866470002();
|
|
8340
8490
|
const down = await createMig.down(queryRunner);
|
|
8341
|
-
|
|
8491
|
+
debug16("Migration statements executed");
|
|
8342
8492
|
return down;
|
|
8343
8493
|
} else {
|
|
8344
8494
|
return Promise.reject(`Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`);
|
|
@@ -8347,7 +8497,7 @@ var CreateStatusList1693866470000 = class {
|
|
|
8347
8497
|
};
|
|
8348
8498
|
|
|
8349
8499
|
// src/migrations/generic/5-CreateAuditEvents.ts
|
|
8350
|
-
import
|
|
8500
|
+
import Debug17 from "debug";
|
|
8351
8501
|
|
|
8352
8502
|
// src/migrations/postgres/1701634812183-CreateAuditEvents.ts
|
|
8353
8503
|
var CreateAuditEvents1701634812183 = class {
|
|
@@ -8446,30 +8596,30 @@ var CreateAuditEvents1701634819487 = class {
|
|
|
8446
8596
|
};
|
|
8447
8597
|
|
|
8448
8598
|
// src/migrations/generic/5-CreateAuditEvents.ts
|
|
8449
|
-
var
|
|
8599
|
+
var debug17 = Debug17("sphereon:ssi-sdk:migrations");
|
|
8450
8600
|
var CreateAuditEvents1701635835330 = class {
|
|
8451
8601
|
static {
|
|
8452
8602
|
__name(this, "CreateAuditEvents1701635835330");
|
|
8453
8603
|
}
|
|
8454
8604
|
name = "CreateAuditEvents1701635835330";
|
|
8455
8605
|
async up(queryRunner) {
|
|
8456
|
-
|
|
8606
|
+
debug17("migration: creating audit events tables");
|
|
8457
8607
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8458
8608
|
switch (dbType) {
|
|
8459
8609
|
case "postgres": {
|
|
8460
|
-
|
|
8610
|
+
debug17("using postgres migration file");
|
|
8461
8611
|
const mig = new CreateAuditEvents1701634812183();
|
|
8462
8612
|
await mig.up(queryRunner);
|
|
8463
|
-
|
|
8613
|
+
debug17("Migration statements executed");
|
|
8464
8614
|
return;
|
|
8465
8615
|
}
|
|
8466
8616
|
case "sqlite":
|
|
8467
8617
|
case "expo":
|
|
8468
8618
|
case "react-native": {
|
|
8469
|
-
|
|
8619
|
+
debug17("using sqlite/react-native migration file");
|
|
8470
8620
|
const mig = new CreateAuditEvents1701634819487();
|
|
8471
8621
|
await mig.up(queryRunner);
|
|
8472
|
-
|
|
8622
|
+
debug17("Migration statements executed");
|
|
8473
8623
|
return;
|
|
8474
8624
|
}
|
|
8475
8625
|
default:
|
|
@@ -8477,23 +8627,23 @@ var CreateAuditEvents1701635835330 = class {
|
|
|
8477
8627
|
}
|
|
8478
8628
|
}
|
|
8479
8629
|
async down(queryRunner) {
|
|
8480
|
-
|
|
8630
|
+
debug17("migration: reverting audit events tables");
|
|
8481
8631
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8482
8632
|
switch (dbType) {
|
|
8483
8633
|
case "postgres": {
|
|
8484
|
-
|
|
8634
|
+
debug17("using postgres migration file");
|
|
8485
8635
|
const mig = new CreateAuditEvents1701634812183();
|
|
8486
8636
|
await mig.down(queryRunner);
|
|
8487
|
-
|
|
8637
|
+
debug17("Migration statements executed");
|
|
8488
8638
|
return;
|
|
8489
8639
|
}
|
|
8490
8640
|
case "sqlite":
|
|
8491
8641
|
case "expo":
|
|
8492
8642
|
case "react-native": {
|
|
8493
|
-
|
|
8643
|
+
debug17("using sqlite/react-native migration file");
|
|
8494
8644
|
const mig = new CreateAuditEvents1701634819487();
|
|
8495
8645
|
await mig.down(queryRunner);
|
|
8496
|
-
|
|
8646
|
+
debug17("Migration statements executed");
|
|
8497
8647
|
return;
|
|
8498
8648
|
}
|
|
8499
8649
|
default:
|
|
@@ -8503,7 +8653,7 @@ var CreateAuditEvents1701635835330 = class {
|
|
|
8503
8653
|
};
|
|
8504
8654
|
|
|
8505
8655
|
// src/migrations/generic/6-CreateDigitalCredential.ts
|
|
8506
|
-
import
|
|
8656
|
+
import Debug18 from "debug";
|
|
8507
8657
|
|
|
8508
8658
|
// src/migrations/postgres/1708525189001-CreateDigitalCredential.ts
|
|
8509
8659
|
var CreateDigitalCredential1708525189001 = class {
|
|
@@ -8611,30 +8761,30 @@ var CreateDigitalCredential1708525189002 = class {
|
|
|
8611
8761
|
};
|
|
8612
8762
|
|
|
8613
8763
|
// src/migrations/generic/6-CreateDigitalCredential.ts
|
|
8614
|
-
var
|
|
8764
|
+
var debug18 = Debug18("sphereon:ssi-sdk:migrations");
|
|
8615
8765
|
var CreateDigitalCredential1708525189000 = class {
|
|
8616
8766
|
static {
|
|
8617
8767
|
__name(this, "CreateDigitalCredential1708525189000");
|
|
8618
8768
|
}
|
|
8619
8769
|
name = "CreateDigitalCredential1708525189000";
|
|
8620
8770
|
async up(queryRunner) {
|
|
8621
|
-
|
|
8771
|
+
debug18("migration: creating DigitalCredential tables");
|
|
8622
8772
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8623
8773
|
switch (dbType) {
|
|
8624
8774
|
case "postgres": {
|
|
8625
|
-
|
|
8775
|
+
debug18("using postgres migration file for DigitalCredential");
|
|
8626
8776
|
const mig = new CreateDigitalCredential1708525189001();
|
|
8627
8777
|
await mig.up(queryRunner);
|
|
8628
|
-
|
|
8778
|
+
debug18("Postgres Migration statements for DigitalCredential executed");
|
|
8629
8779
|
return;
|
|
8630
8780
|
}
|
|
8631
8781
|
case "sqlite":
|
|
8632
8782
|
case "expo":
|
|
8633
8783
|
case "react-native": {
|
|
8634
|
-
|
|
8784
|
+
debug18("using sqlite/react-native migration file for DigitalCredential");
|
|
8635
8785
|
const mig = new CreateDigitalCredential1708525189002();
|
|
8636
8786
|
await mig.up(queryRunner);
|
|
8637
|
-
|
|
8787
|
+
debug18("SQLite Migration statements for DigitalCredential executed");
|
|
8638
8788
|
return;
|
|
8639
8789
|
}
|
|
8640
8790
|
default:
|
|
@@ -8642,23 +8792,23 @@ var CreateDigitalCredential1708525189000 = class {
|
|
|
8642
8792
|
}
|
|
8643
8793
|
}
|
|
8644
8794
|
async down(queryRunner) {
|
|
8645
|
-
|
|
8795
|
+
debug18("migration: reverting DigitalCredential tables");
|
|
8646
8796
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8647
8797
|
switch (dbType) {
|
|
8648
8798
|
case "postgres": {
|
|
8649
|
-
|
|
8799
|
+
debug18("using postgres migration file for DigitalCredential");
|
|
8650
8800
|
const mig = new CreateDigitalCredential1708525189001();
|
|
8651
8801
|
await mig.down(queryRunner);
|
|
8652
|
-
|
|
8802
|
+
debug18("Postgres Migration statements for DigitalCredential reverted");
|
|
8653
8803
|
return;
|
|
8654
8804
|
}
|
|
8655
8805
|
case "sqlite":
|
|
8656
8806
|
case "expo":
|
|
8657
8807
|
case "react-native": {
|
|
8658
|
-
|
|
8808
|
+
debug18("using sqlite/react-native migration file for DigitalCredential");
|
|
8659
8809
|
const mig = new CreateDigitalCredential1708525189002();
|
|
8660
8810
|
await mig.down(queryRunner);
|
|
8661
|
-
|
|
8811
|
+
debug18("SQLite Migration statements for DigitalCredential reverted");
|
|
8662
8812
|
return;
|
|
8663
8813
|
}
|
|
8664
8814
|
default:
|
|
@@ -8668,7 +8818,7 @@ var CreateDigitalCredential1708525189000 = class {
|
|
|
8668
8818
|
};
|
|
8669
8819
|
|
|
8670
8820
|
// src/migrations/generic/7-CreateMachineStateStore.ts
|
|
8671
|
-
import
|
|
8821
|
+
import Debug19 from "debug";
|
|
8672
8822
|
|
|
8673
8823
|
// src/migrations/postgres/1708797018115-CreateMachineStateStore.ts
|
|
8674
8824
|
var CreateMachineStateStore1708797018115 = class {
|
|
@@ -8730,30 +8880,30 @@ var CreateMachineStateStore1708796002272 = class {
|
|
|
8730
8880
|
};
|
|
8731
8881
|
|
|
8732
8882
|
// src/migrations/generic/7-CreateMachineStateStore.ts
|
|
8733
|
-
var
|
|
8883
|
+
var debug19 = Debug19("sphereon:ssi-sdk:migrations");
|
|
8734
8884
|
var CreateMachineStateStore1708098041262 = class {
|
|
8735
8885
|
static {
|
|
8736
8886
|
__name(this, "CreateMachineStateStore1708098041262");
|
|
8737
8887
|
}
|
|
8738
8888
|
name = "CreateMachineStateStore1708098041262";
|
|
8739
8889
|
async up(queryRunner) {
|
|
8740
|
-
|
|
8890
|
+
debug19("migration: creating machine state tables");
|
|
8741
8891
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8742
8892
|
switch (dbType) {
|
|
8743
8893
|
case "postgres": {
|
|
8744
|
-
|
|
8894
|
+
debug19("using postgres migration file");
|
|
8745
8895
|
const mig = new CreateMachineStateStore1708797018115();
|
|
8746
8896
|
await mig.up(queryRunner);
|
|
8747
|
-
|
|
8897
|
+
debug19("Migration statements executed");
|
|
8748
8898
|
return;
|
|
8749
8899
|
}
|
|
8750
8900
|
case "sqlite":
|
|
8751
8901
|
case "expo":
|
|
8752
8902
|
case "react-native": {
|
|
8753
|
-
|
|
8903
|
+
debug19("using sqlite/react-native migration file");
|
|
8754
8904
|
const mig = new CreateMachineStateStore1708796002272();
|
|
8755
8905
|
await mig.up(queryRunner);
|
|
8756
|
-
|
|
8906
|
+
debug19("Migration statements executed");
|
|
8757
8907
|
return;
|
|
8758
8908
|
}
|
|
8759
8909
|
default:
|
|
@@ -8761,23 +8911,23 @@ var CreateMachineStateStore1708098041262 = class {
|
|
|
8761
8911
|
}
|
|
8762
8912
|
}
|
|
8763
8913
|
async down(queryRunner) {
|
|
8764
|
-
|
|
8914
|
+
debug19("migration: reverting machine state tables");
|
|
8765
8915
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8766
8916
|
switch (dbType) {
|
|
8767
8917
|
case "postgres": {
|
|
8768
|
-
|
|
8918
|
+
debug19("using postgres migration file");
|
|
8769
8919
|
const mig = new CreateMachineStateStore1708797018115();
|
|
8770
8920
|
await mig.down(queryRunner);
|
|
8771
|
-
|
|
8921
|
+
debug19("Migration statements executed");
|
|
8772
8922
|
return;
|
|
8773
8923
|
}
|
|
8774
8924
|
case "sqlite":
|
|
8775
8925
|
case "expo":
|
|
8776
8926
|
case "react-native": {
|
|
8777
|
-
|
|
8927
|
+
debug19("using sqlite/react-native migration file");
|
|
8778
8928
|
const mig = new CreateMachineStateStore1708796002272();
|
|
8779
8929
|
await mig.down(queryRunner);
|
|
8780
|
-
|
|
8930
|
+
debug19("Migration statements executed");
|
|
8781
8931
|
return;
|
|
8782
8932
|
}
|
|
8783
8933
|
default:
|
|
@@ -8787,7 +8937,7 @@ var CreateMachineStateStore1708098041262 = class {
|
|
|
8787
8937
|
};
|
|
8788
8938
|
|
|
8789
8939
|
// src/migrations/generic/8-CreateContacts.ts
|
|
8790
|
-
import
|
|
8940
|
+
import Debug20 from "debug";
|
|
8791
8941
|
|
|
8792
8942
|
// src/migrations/postgres/1710438363001-CreateContacts.ts
|
|
8793
8943
|
var CreateContacts1710438363001 = class {
|
|
@@ -8901,30 +9051,30 @@ var CreateContacts1710438363002 = class {
|
|
|
8901
9051
|
};
|
|
8902
9052
|
|
|
8903
9053
|
// src/migrations/generic/8-CreateContacts.ts
|
|
8904
|
-
var
|
|
9054
|
+
var debug20 = Debug20("sphereon:ssi-sdk:migrations");
|
|
8905
9055
|
var CreateContacts1708525189000 = class {
|
|
8906
9056
|
static {
|
|
8907
9057
|
__name(this, "CreateContacts1708525189000");
|
|
8908
9058
|
}
|
|
8909
9059
|
name = "CreateContacts1708525189000";
|
|
8910
9060
|
async up(queryRunner) {
|
|
8911
|
-
|
|
9061
|
+
debug20("migration: updating contact tables");
|
|
8912
9062
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8913
9063
|
switch (dbType) {
|
|
8914
9064
|
case "postgres": {
|
|
8915
|
-
|
|
9065
|
+
debug20("using postgres migration file");
|
|
8916
9066
|
const mig = new CreateContacts1710438363001();
|
|
8917
9067
|
await mig.up(queryRunner);
|
|
8918
|
-
|
|
9068
|
+
debug20("Migration statements executed");
|
|
8919
9069
|
return;
|
|
8920
9070
|
}
|
|
8921
9071
|
case "sqlite":
|
|
8922
9072
|
case "expo":
|
|
8923
9073
|
case "react-native": {
|
|
8924
|
-
|
|
9074
|
+
debug20("using sqlite/react-native migration file");
|
|
8925
9075
|
const mig = new CreateContacts1710438363002();
|
|
8926
9076
|
await mig.up(queryRunner);
|
|
8927
|
-
|
|
9077
|
+
debug20("Migration statements executed");
|
|
8928
9078
|
return;
|
|
8929
9079
|
}
|
|
8930
9080
|
default:
|
|
@@ -8932,23 +9082,23 @@ var CreateContacts1708525189000 = class {
|
|
|
8932
9082
|
}
|
|
8933
9083
|
}
|
|
8934
9084
|
async down(queryRunner) {
|
|
8935
|
-
|
|
9085
|
+
debug20("migration: reverting machine state tables");
|
|
8936
9086
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8937
9087
|
switch (dbType) {
|
|
8938
9088
|
case "postgres": {
|
|
8939
|
-
|
|
9089
|
+
debug20("using postgres migration file");
|
|
8940
9090
|
const mig = new CreateContacts1710438363001();
|
|
8941
9091
|
await mig.down(queryRunner);
|
|
8942
|
-
|
|
9092
|
+
debug20("Migration statements executed");
|
|
8943
9093
|
return;
|
|
8944
9094
|
}
|
|
8945
9095
|
case "sqlite":
|
|
8946
9096
|
case "expo":
|
|
8947
9097
|
case "react-native": {
|
|
8948
|
-
|
|
9098
|
+
debug20("using sqlite/react-native migration file");
|
|
8949
9099
|
const mig = new CreateContacts1710438363002();
|
|
8950
9100
|
await mig.down(queryRunner);
|
|
8951
|
-
|
|
9101
|
+
debug20("Migration statements executed");
|
|
8952
9102
|
return;
|
|
8953
9103
|
}
|
|
8954
9104
|
default:
|
|
@@ -8958,7 +9108,7 @@ var CreateContacts1708525189000 = class {
|
|
|
8958
9108
|
};
|
|
8959
9109
|
|
|
8960
9110
|
// src/migrations/generic/9-CreateContacts.ts
|
|
8961
|
-
import
|
|
9111
|
+
import Debug21 from "debug";
|
|
8962
9112
|
|
|
8963
9113
|
// src/migrations/postgres/1715761125001-CreateContacts.ts
|
|
8964
9114
|
var CreateContacts1715761125001 = class {
|
|
@@ -9070,30 +9220,30 @@ var CreateContacts1715761125002 = class {
|
|
|
9070
9220
|
};
|
|
9071
9221
|
|
|
9072
9222
|
// src/migrations/generic/9-CreateContacts.ts
|
|
9073
|
-
var
|
|
9223
|
+
var debug21 = Debug21("sphereon:ssi-sdk:migrations");
|
|
9074
9224
|
var CreateContacts1715761125000 = class {
|
|
9075
9225
|
static {
|
|
9076
9226
|
__name(this, "CreateContacts1715761125000");
|
|
9077
9227
|
}
|
|
9078
9228
|
name = "CreateContacts1715761125000";
|
|
9079
9229
|
async up(queryRunner) {
|
|
9080
|
-
|
|
9230
|
+
debug21("migration: updating contact tables");
|
|
9081
9231
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9082
9232
|
switch (dbType) {
|
|
9083
9233
|
case "postgres": {
|
|
9084
|
-
|
|
9234
|
+
debug21("using postgres migration file");
|
|
9085
9235
|
const mig = new CreateContacts1715761125001();
|
|
9086
9236
|
await mig.up(queryRunner);
|
|
9087
|
-
|
|
9237
|
+
debug21("Migration statements executed");
|
|
9088
9238
|
return;
|
|
9089
9239
|
}
|
|
9090
9240
|
case "sqlite":
|
|
9091
9241
|
case "expo":
|
|
9092
9242
|
case "react-native": {
|
|
9093
|
-
|
|
9243
|
+
debug21("using sqlite/react-native migration file");
|
|
9094
9244
|
const mig = new CreateContacts1715761125002();
|
|
9095
9245
|
await mig.up(queryRunner);
|
|
9096
|
-
|
|
9246
|
+
debug21("Migration statements executed");
|
|
9097
9247
|
return;
|
|
9098
9248
|
}
|
|
9099
9249
|
default:
|
|
@@ -9101,23 +9251,23 @@ var CreateContacts1715761125000 = class {
|
|
|
9101
9251
|
}
|
|
9102
9252
|
}
|
|
9103
9253
|
async down(queryRunner) {
|
|
9104
|
-
|
|
9254
|
+
debug21("migration: reverting machine state tables");
|
|
9105
9255
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9106
9256
|
switch (dbType) {
|
|
9107
9257
|
case "postgres": {
|
|
9108
|
-
|
|
9258
|
+
debug21("using postgres migration file");
|
|
9109
9259
|
const mig = new CreateContacts1715761125001();
|
|
9110
9260
|
await mig.down(queryRunner);
|
|
9111
|
-
|
|
9261
|
+
debug21("Migration statements executed");
|
|
9112
9262
|
return;
|
|
9113
9263
|
}
|
|
9114
9264
|
case "sqlite":
|
|
9115
9265
|
case "expo":
|
|
9116
9266
|
case "react-native": {
|
|
9117
|
-
|
|
9267
|
+
debug21("using sqlite/react-native migration file");
|
|
9118
9268
|
const mig = new CreateContacts1715761125002();
|
|
9119
9269
|
await mig.down(queryRunner);
|
|
9120
|
-
|
|
9270
|
+
debug21("Migration statements executed");
|
|
9121
9271
|
return;
|
|
9122
9272
|
}
|
|
9123
9273
|
default:
|
|
@@ -9146,7 +9296,8 @@ var DataStoreEventLoggerMigrations = [
|
|
|
9146
9296
|
CreateAuditEvents1701635835330
|
|
9147
9297
|
];
|
|
9148
9298
|
var DataStoreDigitalCredentialMigrations = [
|
|
9149
|
-
CreateDigitalCredential1708525189000
|
|
9299
|
+
CreateDigitalCredential1708525189000,
|
|
9300
|
+
AddLinkedVpFields1763387280000
|
|
9150
9301
|
];
|
|
9151
9302
|
var DataStoreMachineStateMigrations = [
|
|
9152
9303
|
CreateMachineStateStore1708098041262
|
|
@@ -9167,7 +9318,7 @@ var DataStoreMigrations = [
|
|
|
9167
9318
|
|
|
9168
9319
|
// src/utils/digitalCredential/MappingUtils.ts
|
|
9169
9320
|
import { defaultHasher } from "@sphereon/ssi-sdk.core";
|
|
9170
|
-
import { CredentialDocumentFormat as CredentialDocumentFormat2, DocumentType as DocumentType2, RegulationType as RegulationType2 } from "@sphereon/ssi-sdk.data-store-types";
|
|
9321
|
+
import { CredentialDocumentFormat as CredentialDocumentFormat2, CredentialStateType as CredentialStateType3, DocumentType as DocumentType2, RegulationType as RegulationType2 } from "@sphereon/ssi-sdk.data-store-types";
|
|
9171
9322
|
import { CredentialMapper, DocumentFormat, ObjectUtils } from "@sphereon/ssi-types";
|
|
9172
9323
|
import { computeEntryHash } from "@veramo/utils";
|
|
9173
9324
|
function determineDocumentType(raw) {
|
|
@@ -9218,6 +9369,18 @@ function determineCredentialDocumentFormat(documentFormat) {
|
|
|
9218
9369
|
}
|
|
9219
9370
|
}
|
|
9220
9371
|
__name(determineCredentialDocumentFormat, "determineCredentialDocumentFormat");
|
|
9372
|
+
function normalizeNullableFields(obj, nullableKeys) {
|
|
9373
|
+
const normalized = {
|
|
9374
|
+
...obj
|
|
9375
|
+
};
|
|
9376
|
+
for (const key of nullableKeys) {
|
|
9377
|
+
if (normalized[key] === void 0) {
|
|
9378
|
+
normalized[key] = null;
|
|
9379
|
+
}
|
|
9380
|
+
}
|
|
9381
|
+
return normalized;
|
|
9382
|
+
}
|
|
9383
|
+
__name(normalizeNullableFields, "normalizeNullableFields");
|
|
9221
9384
|
function getValidUntil(uniformDocument) {
|
|
9222
9385
|
if ("expirationDate" in uniformDocument && uniformDocument.expirationDate) {
|
|
9223
9386
|
return new Date(uniformDocument.expirationDate);
|
|
@@ -9280,6 +9443,33 @@ var nonPersistedDigitalCredentialEntityFromAddArgs = /* @__PURE__ */ __name((add
|
|
|
9280
9443
|
lastUpdatedAt: /* @__PURE__ */ new Date()
|
|
9281
9444
|
};
|
|
9282
9445
|
}, "nonPersistedDigitalCredentialEntityFromAddArgs");
|
|
9446
|
+
var persistedDigitalCredentialEntityFromUpdateArgs = /* @__PURE__ */ __name((existingCredential, updates) => {
|
|
9447
|
+
const entity = new DigitalCredentialEntity();
|
|
9448
|
+
Object.assign(entity, existingCredential);
|
|
9449
|
+
const normalizedUpdates = normalizeNullableFields(updates, [
|
|
9450
|
+
"linkedVpId",
|
|
9451
|
+
"linkedVpFrom"
|
|
9452
|
+
]);
|
|
9453
|
+
Object.assign(entity, normalizedUpdates);
|
|
9454
|
+
entity.id = existingCredential.id;
|
|
9455
|
+
entity.hash = existingCredential.hash;
|
|
9456
|
+
entity.createdAt = existingCredential.createdAt;
|
|
9457
|
+
entity.lastUpdatedAt = /* @__PURE__ */ new Date();
|
|
9458
|
+
return entity;
|
|
9459
|
+
}, "persistedDigitalCredentialEntityFromUpdateArgs");
|
|
9460
|
+
var persistedDigitalCredentialEntityFromStateArgs = /* @__PURE__ */ __name((existingCredential, args) => {
|
|
9461
|
+
const entity = new DigitalCredentialEntity();
|
|
9462
|
+
Object.assign(entity, existingCredential);
|
|
9463
|
+
entity.verifiedState = args.verifiedState;
|
|
9464
|
+
entity.lastUpdatedAt = /* @__PURE__ */ new Date();
|
|
9465
|
+
if (args.verifiedState === CredentialStateType3.REVOKED && args.revokedAt) {
|
|
9466
|
+
entity.revokedAt = args.revokedAt;
|
|
9467
|
+
}
|
|
9468
|
+
if (args.verifiedState !== CredentialStateType3.REVOKED && args.verifiedAt) {
|
|
9469
|
+
entity.verifiedAt = args.verifiedAt;
|
|
9470
|
+
}
|
|
9471
|
+
return entity;
|
|
9472
|
+
}, "persistedDigitalCredentialEntityFromStateArgs");
|
|
9283
9473
|
var digitalCredentialFrom = /* @__PURE__ */ __name((credentialEntity) => {
|
|
9284
9474
|
const result = {
|
|
9285
9475
|
...credentialEntity
|
|
@@ -9456,6 +9646,7 @@ export {
|
|
|
9456
9646
|
naturalPersonEntityFrom,
|
|
9457
9647
|
naturalPersonFrom,
|
|
9458
9648
|
nonPersistedDigitalCredentialEntityFromAddArgs,
|
|
9649
|
+
normalizeNullableFields,
|
|
9459
9650
|
openIdConfigEntityFrom,
|
|
9460
9651
|
openIdConfigFrom,
|
|
9461
9652
|
organizationEntityFrom,
|
|
@@ -9467,6 +9658,8 @@ export {
|
|
|
9467
9658
|
partyRelationshipFrom,
|
|
9468
9659
|
partyTypeEntityFrom,
|
|
9469
9660
|
partyTypeFrom,
|
|
9661
|
+
persistedDigitalCredentialEntityFromStateArgs,
|
|
9662
|
+
persistedDigitalCredentialEntityFromUpdateArgs,
|
|
9470
9663
|
physicalAddressEntityFrom,
|
|
9471
9664
|
physicalAddressFrom,
|
|
9472
9665
|
textAttributesEntityFrom
|