@sphereon/ssi-sdk.data-store 0.34.1-feature.SSISDK.26.RP.58 → 0.34.1-feature.SSISDK.45.189
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 +1616 -1477
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +187 -194
- package/dist/index.d.ts +187 -194
- package/dist/index.js +1582 -1443
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
- package/src/__tests__/contact.entities.test.ts +2 -2
- package/src/__tests__/contact.store.test.ts +1 -1
- package/src/__tests__/digitalCredential.entities.test.ts +2 -1
- package/src/__tests__/digitalCredential.store.test.ts +5 -5
- package/src/__tests__/pd-manager.entities.test.ts +27 -98
- package/src/__tests__/pd-manager.store.test.ts +151 -101
- package/src/digitalCredential/DigitalCredentialStore.ts +9 -9
- package/src/entities/contact/IdentityEntity.ts +2 -1
- package/src/entities/digitalCredential/DigitalCredentialEntity.ts +2 -1
- package/src/entities/presentationDefinition/{PresentationDefinitionItemEntity.ts → DcqlQueryItemEntity.ts} +8 -12
- package/src/index.ts +3 -3
- package/src/migrations/generic/12-CreateBitstringStatusList.ts +32 -2
- package/src/migrations/generic/13-CreateDcqlQueryItem.ts +67 -0
- package/src/migrations/generic/index.ts +10 -5
- package/src/migrations/postgres/1716475165345-CreatePresentationDefinitions.ts +1 -1
- package/src/migrations/postgres/1726588800000-CreateDcqlQueryItem.ts +25 -0
- package/src/migrations/postgres/1737110469001-UpdateStatusList.ts +1 -1
- package/src/migrations/postgres/1741895823000-CreateBitstringStatusList.ts +15 -2
- package/src/migrations/sqlite/1716475165344-CreatePresentationDefinitions.ts +1 -1
- package/src/migrations/sqlite/1726617600000-CreateDcqlQueryItem.ts +24 -0
- package/src/presentationDefinition/AbstractPDStore.ts +5 -5
- package/src/presentationDefinition/PDStore.ts +40 -40
- package/src/types/contact/contact.ts +1 -1
- package/src/types/digitalCredential/IAbstractDigitalCredentialStore.ts +2 -1
- package/src/types/digitalCredential/enums.ts +0 -7
- package/src/types/digitalCredential/types.ts +2 -1
- package/src/types/presentationDefinition/IAbstractPDStore.ts +5 -5
- package/src/types/presentationDefinition/presentationDefinition.ts +8 -9
- package/src/utils/presentationDefinition/MappingUtils.ts +31 -22
package/dist/index.js
CHANGED
|
@@ -8,55 +8,55 @@ import typeorm6 from "typeorm";
|
|
|
8
8
|
import typeorm5 from "typeorm";
|
|
9
9
|
|
|
10
10
|
// src/types/contact/contact.ts
|
|
11
|
-
var ConnectionType = /* @__PURE__ */ function(ConnectionType2) {
|
|
11
|
+
var ConnectionType = /* @__PURE__ */ (function(ConnectionType2) {
|
|
12
12
|
ConnectionType2["OPENID_CONNECT"] = "OIDC";
|
|
13
13
|
ConnectionType2["SIOPv2"] = "SIOPv2";
|
|
14
14
|
ConnectionType2["SIOPv2_OpenID4VP"] = "SIOPv2+OpenID4VP";
|
|
15
15
|
return ConnectionType2;
|
|
16
|
-
}({});
|
|
17
|
-
var CorrelationIdentifierType = /* @__PURE__ */ function(CorrelationIdentifierType2) {
|
|
16
|
+
})({});
|
|
17
|
+
var CorrelationIdentifierType = /* @__PURE__ */ (function(CorrelationIdentifierType2) {
|
|
18
18
|
CorrelationIdentifierType2["DID"] = "did";
|
|
19
19
|
CorrelationIdentifierType2["URL"] = "url";
|
|
20
20
|
return CorrelationIdentifierType2;
|
|
21
|
-
}({});
|
|
22
|
-
var PartyTypeType = /* @__PURE__ */ function(PartyTypeType2) {
|
|
21
|
+
})({});
|
|
22
|
+
var PartyTypeType = /* @__PURE__ */ (function(PartyTypeType2) {
|
|
23
23
|
PartyTypeType2["NATURAL_PERSON"] = "naturalPerson";
|
|
24
24
|
PartyTypeType2["ORGANIZATION"] = "organization";
|
|
25
25
|
return PartyTypeType2;
|
|
26
|
-
}({});
|
|
27
|
-
var PartyOrigin = /* @__PURE__ */ function(PartyOrigin2) {
|
|
26
|
+
})({});
|
|
27
|
+
var PartyOrigin = /* @__PURE__ */ (function(PartyOrigin2) {
|
|
28
28
|
PartyOrigin2["INTERNAL"] = "INTERNAL";
|
|
29
29
|
PartyOrigin2["EXTERNAL"] = "EXTERNAL";
|
|
30
30
|
return PartyOrigin2;
|
|
31
|
-
}({});
|
|
32
|
-
var IdentityOrigin = /* @__PURE__ */ function(IdentityOrigin2) {
|
|
31
|
+
})({});
|
|
32
|
+
var IdentityOrigin = /* @__PURE__ */ (function(IdentityOrigin2) {
|
|
33
33
|
IdentityOrigin2["INTERNAL"] = "INTERNAL";
|
|
34
34
|
IdentityOrigin2["EXTERNAL"] = "EXTERNAL";
|
|
35
35
|
return IdentityOrigin2;
|
|
36
|
-
}({});
|
|
36
|
+
})({});
|
|
37
37
|
|
|
38
38
|
// src/types/digitalCredential/enums.ts
|
|
39
|
-
var DocumentType = /* @__PURE__ */ function(DocumentType2) {
|
|
39
|
+
var DocumentType = /* @__PURE__ */ (function(DocumentType2) {
|
|
40
40
|
DocumentType2["VC"] = "VC";
|
|
41
41
|
DocumentType2["VP"] = "VP";
|
|
42
42
|
DocumentType2["P"] = "P";
|
|
43
43
|
DocumentType2["C"] = "C";
|
|
44
44
|
return DocumentType2;
|
|
45
|
-
}({});
|
|
46
|
-
var RegulationType = /* @__PURE__ */ function(RegulationType2) {
|
|
45
|
+
})({});
|
|
46
|
+
var RegulationType = /* @__PURE__ */ (function(RegulationType2) {
|
|
47
47
|
RegulationType2["PID"] = "PID";
|
|
48
48
|
RegulationType2["QEAA"] = "QEAA";
|
|
49
49
|
RegulationType2["EAA"] = "EAA";
|
|
50
50
|
RegulationType2["NON_REGULATED"] = "NON_REGULATED";
|
|
51
51
|
return RegulationType2;
|
|
52
|
-
}({});
|
|
53
|
-
var CredentialDocumentFormat = /* @__PURE__ */ function(CredentialDocumentFormat2) {
|
|
52
|
+
})({});
|
|
53
|
+
var CredentialDocumentFormat = /* @__PURE__ */ (function(CredentialDocumentFormat2) {
|
|
54
54
|
CredentialDocumentFormat2["JSON_LD"] = "JSON_LD";
|
|
55
55
|
CredentialDocumentFormat2["JWT"] = "JWT";
|
|
56
56
|
CredentialDocumentFormat2["SD_JWT"] = "SD_JWT";
|
|
57
57
|
CredentialDocumentFormat2["MSO_MDOC"] = "MSO_MDOC";
|
|
58
58
|
return CredentialDocumentFormat2;
|
|
59
|
-
}({});
|
|
59
|
+
})({});
|
|
60
60
|
(function(CredentialDocumentFormat2) {
|
|
61
61
|
function fromSpecValue(credentialFormat) {
|
|
62
62
|
const format = credentialFormat.toLowerCase();
|
|
@@ -89,26 +89,19 @@ var CredentialDocumentFormat = /* @__PURE__ */ function(CredentialDocumentFormat
|
|
|
89
89
|
__name(toSpecValue, "toSpecValue");
|
|
90
90
|
CredentialDocumentFormat2.toSpecValue = toSpecValue;
|
|
91
91
|
})(CredentialDocumentFormat || (CredentialDocumentFormat = {}));
|
|
92
|
-
var CredentialCorrelationType = /* @__PURE__ */ function(CredentialCorrelationType2) {
|
|
92
|
+
var CredentialCorrelationType = /* @__PURE__ */ (function(CredentialCorrelationType2) {
|
|
93
93
|
CredentialCorrelationType2["DID"] = "DID";
|
|
94
94
|
CredentialCorrelationType2["X509_SAN"] = "X509_SAN";
|
|
95
95
|
CredentialCorrelationType2["KID"] = "KID";
|
|
96
96
|
CredentialCorrelationType2["URL"] = "URL";
|
|
97
97
|
return CredentialCorrelationType2;
|
|
98
|
-
}({});
|
|
99
|
-
var
|
|
100
|
-
CredentialRole2["ISSUER"] = "ISSUER";
|
|
101
|
-
CredentialRole2["VERIFIER"] = "VERIFIER";
|
|
102
|
-
CredentialRole2["HOLDER"] = "HOLDER";
|
|
103
|
-
CredentialRole2["FEDERATION_TRUST_ANCHOR"] = "FEDERATION_TRUST_ANCHOR";
|
|
104
|
-
return CredentialRole2;
|
|
105
|
-
}({});
|
|
106
|
-
var CredentialStateType = /* @__PURE__ */ function(CredentialStateType2) {
|
|
98
|
+
})({});
|
|
99
|
+
var CredentialStateType = /* @__PURE__ */ (function(CredentialStateType2) {
|
|
107
100
|
CredentialStateType2["REVOKED"] = "REVOKED";
|
|
108
101
|
CredentialStateType2["VERIFIED"] = "VERIFIED";
|
|
109
102
|
CredentialStateType2["EXPIRED"] = "EXPIRED";
|
|
110
103
|
return CredentialStateType2;
|
|
111
|
-
}({});
|
|
104
|
+
})({});
|
|
112
105
|
|
|
113
106
|
// src/entities/contact/IdentityEntity.ts
|
|
114
107
|
import { BaseEntity as BaseEntity8, CreateDateColumn as CreateDateColumn7, Entity as Entity10, PrimaryGeneratedColumn as PrimaryGeneratedColumn10, UpdateDateColumn as UpdateDateColumn7, OneToOne as OneToOne4, JoinColumn as JoinColumn5, ManyToOne as ManyToOne7, Column as Column9, OneToMany as OneToMany4, BeforeInsert as BeforeInsert10, BeforeUpdate as BeforeUpdate10 } from "typeorm";
|
|
@@ -3769,6 +3762,7 @@ AuditEventEntity = _ts_decorate32([
|
|
|
3769
3762
|
|
|
3770
3763
|
// src/entities/digitalCredential/DigitalCredentialEntity.ts
|
|
3771
3764
|
import { typeormDate, typeOrmDateTime as typeOrmDateTime16 } from "@sphereon/ssi-sdk.agent-config";
|
|
3765
|
+
import { CredentialRole } from "@sphereon/ssi-types";
|
|
3772
3766
|
import { BaseEntity as BaseEntity23, Column as Column30, CreateDateColumn as CreateDateColumn13, Entity as Entity25, PrimaryGeneratedColumn as PrimaryGeneratedColumn22, UpdateDateColumn as UpdateDateColumn13 } from "typeorm";
|
|
3773
3767
|
function _ts_decorate33(decorators, target, key, desc) {
|
|
3774
3768
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -4028,7 +4022,7 @@ DigitalCredentialEntity = _ts_decorate33([
|
|
|
4028
4022
|
Entity25("DigitalCredential")
|
|
4029
4023
|
], DigitalCredentialEntity);
|
|
4030
4024
|
|
|
4031
|
-
// src/entities/presentationDefinition/
|
|
4025
|
+
// src/entities/presentationDefinition/DcqlQueryItemEntity.ts
|
|
4032
4026
|
import { BaseEntity as BaseEntity24, BeforeInsert as BeforeInsert20, BeforeUpdate as BeforeUpdate20, Column as Column31, CreateDateColumn as CreateDateColumn14, Entity as Entity26, Index as Index8, PrimaryGeneratedColumn as PrimaryGeneratedColumn23, UpdateDateColumn as UpdateDateColumn14 } from "typeorm";
|
|
4033
4027
|
import { IsNotEmpty as IsNotEmpty12 } from "class-validator";
|
|
4034
4028
|
import { typeOrmDateTime as typeOrmDateTime17 } from "@sphereon/ssi-sdk.agent-config";
|
|
@@ -4043,18 +4037,17 @@ function _ts_metadata33(k, v) {
|
|
|
4043
4037
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
4044
4038
|
}
|
|
4045
4039
|
__name(_ts_metadata33, "_ts_metadata");
|
|
4046
|
-
var
|
|
4040
|
+
var DcqlQueryItemEntity = class extends BaseEntity24 {
|
|
4047
4041
|
static {
|
|
4048
|
-
__name(this, "
|
|
4042
|
+
__name(this, "DcqlQueryItemEntity");
|
|
4049
4043
|
}
|
|
4050
4044
|
id;
|
|
4051
|
-
|
|
4045
|
+
queryId;
|
|
4052
4046
|
version;
|
|
4053
4047
|
tenantId;
|
|
4054
4048
|
purpose;
|
|
4055
4049
|
name;
|
|
4056
|
-
|
|
4057
|
-
dcqlPayload;
|
|
4050
|
+
query;
|
|
4058
4051
|
createdAt;
|
|
4059
4052
|
lastUpdatedAt;
|
|
4060
4053
|
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
@@ -4065,20 +4058,20 @@ var PresentationDefinitionItemEntity = class extends BaseEntity24 {
|
|
|
4065
4058
|
_ts_decorate34([
|
|
4066
4059
|
PrimaryGeneratedColumn23("uuid"),
|
|
4067
4060
|
_ts_metadata33("design:type", String)
|
|
4068
|
-
],
|
|
4061
|
+
], DcqlQueryItemEntity.prototype, "id", void 0);
|
|
4069
4062
|
_ts_decorate34([
|
|
4070
4063
|
Column31({
|
|
4071
|
-
name: "
|
|
4064
|
+
name: "query_id",
|
|
4072
4065
|
length: 255,
|
|
4073
4066
|
type: "varchar",
|
|
4074
4067
|
nullable: false,
|
|
4075
4068
|
unique: false
|
|
4076
4069
|
}),
|
|
4077
4070
|
IsNotEmpty12({
|
|
4078
|
-
message: "A blank
|
|
4071
|
+
message: "A blank query id field is not allowed"
|
|
4079
4072
|
}),
|
|
4080
4073
|
_ts_metadata33("design:type", String)
|
|
4081
|
-
],
|
|
4074
|
+
], DcqlQueryItemEntity.prototype, "queryId", void 0);
|
|
4082
4075
|
_ts_decorate34([
|
|
4083
4076
|
Column31({
|
|
4084
4077
|
name: "version",
|
|
@@ -4091,7 +4084,7 @@ _ts_decorate34([
|
|
|
4091
4084
|
message: "A blank version field is not allowed"
|
|
4092
4085
|
}),
|
|
4093
4086
|
_ts_metadata33("design:type", String)
|
|
4094
|
-
],
|
|
4087
|
+
], DcqlQueryItemEntity.prototype, "version", void 0);
|
|
4095
4088
|
_ts_decorate34([
|
|
4096
4089
|
Column31({
|
|
4097
4090
|
name: "tenant_id",
|
|
@@ -4101,7 +4094,7 @@ _ts_decorate34([
|
|
|
4101
4094
|
unique: false
|
|
4102
4095
|
}),
|
|
4103
4096
|
_ts_metadata33("design:type", String)
|
|
4104
|
-
],
|
|
4097
|
+
], DcqlQueryItemEntity.prototype, "tenantId", void 0);
|
|
4105
4098
|
_ts_decorate34([
|
|
4106
4099
|
Column31({
|
|
4107
4100
|
name: "purpose",
|
|
@@ -4111,7 +4104,7 @@ _ts_decorate34([
|
|
|
4111
4104
|
unique: false
|
|
4112
4105
|
}),
|
|
4113
4106
|
_ts_metadata33("design:type", String)
|
|
4114
|
-
],
|
|
4107
|
+
], DcqlQueryItemEntity.prototype, "purpose", void 0);
|
|
4115
4108
|
_ts_decorate34([
|
|
4116
4109
|
Column31({
|
|
4117
4110
|
name: "name",
|
|
@@ -4121,31 +4114,19 @@ _ts_decorate34([
|
|
|
4121
4114
|
unique: false
|
|
4122
4115
|
}),
|
|
4123
4116
|
_ts_metadata33("design:type", String)
|
|
4124
|
-
],
|
|
4117
|
+
], DcqlQueryItemEntity.prototype, "name", void 0);
|
|
4125
4118
|
_ts_decorate34([
|
|
4126
4119
|
Column31({
|
|
4127
|
-
name: "
|
|
4120
|
+
name: "query",
|
|
4128
4121
|
type: "text",
|
|
4129
4122
|
nullable: false,
|
|
4130
4123
|
unique: false
|
|
4131
4124
|
}),
|
|
4132
4125
|
IsNotEmpty12({
|
|
4133
|
-
message: "A blank
|
|
4126
|
+
message: "A blank dcql query payload field is not allowed"
|
|
4134
4127
|
}),
|
|
4135
4128
|
_ts_metadata33("design:type", String)
|
|
4136
|
-
],
|
|
4137
|
-
_ts_decorate34([
|
|
4138
|
-
Column31({
|
|
4139
|
-
name: "dcql_payload",
|
|
4140
|
-
type: "text",
|
|
4141
|
-
nullable: true,
|
|
4142
|
-
unique: false
|
|
4143
|
-
}),
|
|
4144
|
-
IsNotEmpty12({
|
|
4145
|
-
message: "A blank dcql definition payload field is not allowed"
|
|
4146
|
-
}),
|
|
4147
|
-
_ts_metadata33("design:type", String)
|
|
4148
|
-
], PresentationDefinitionItemEntity.prototype, "dcqlPayload", void 0);
|
|
4129
|
+
], DcqlQueryItemEntity.prototype, "query", void 0);
|
|
4149
4130
|
_ts_decorate34([
|
|
4150
4131
|
CreateDateColumn14({
|
|
4151
4132
|
name: "created_at",
|
|
@@ -4153,7 +4134,7 @@ _ts_decorate34([
|
|
|
4153
4134
|
type: typeOrmDateTime17()
|
|
4154
4135
|
}),
|
|
4155
4136
|
_ts_metadata33("design:type", typeof Date === "undefined" ? Object : Date)
|
|
4156
|
-
],
|
|
4137
|
+
], DcqlQueryItemEntity.prototype, "createdAt", void 0);
|
|
4157
4138
|
_ts_decorate34([
|
|
4158
4139
|
UpdateDateColumn14({
|
|
4159
4140
|
name: "last_updated_at",
|
|
@@ -4161,22 +4142,22 @@ _ts_decorate34([
|
|
|
4161
4142
|
type: typeOrmDateTime17()
|
|
4162
4143
|
}),
|
|
4163
4144
|
_ts_metadata33("design:type", typeof Date === "undefined" ? Object : Date)
|
|
4164
|
-
],
|
|
4145
|
+
], DcqlQueryItemEntity.prototype, "lastUpdatedAt", void 0);
|
|
4165
4146
|
_ts_decorate34([
|
|
4166
4147
|
BeforeInsert20(),
|
|
4167
4148
|
BeforeUpdate20(),
|
|
4168
4149
|
_ts_metadata33("design:type", Function),
|
|
4169
4150
|
_ts_metadata33("design:paramtypes", []),
|
|
4170
4151
|
_ts_metadata33("design:returntype", void 0)
|
|
4171
|
-
],
|
|
4172
|
-
|
|
4173
|
-
Entity26("
|
|
4152
|
+
], DcqlQueryItemEntity.prototype, "updateUpdatedDate", null);
|
|
4153
|
+
DcqlQueryItemEntity = _ts_decorate34([
|
|
4154
|
+
Entity26("DcqlQueryItem"),
|
|
4174
4155
|
Index8([
|
|
4175
4156
|
"version"
|
|
4176
4157
|
], {
|
|
4177
4158
|
unique: false
|
|
4178
4159
|
})
|
|
4179
|
-
],
|
|
4160
|
+
], DcqlQueryItemEntity);
|
|
4180
4161
|
|
|
4181
4162
|
// src/entities/oid4vcState/Oid4vcStateEntity.ts
|
|
4182
4163
|
import { typeOrmDateTime as typeOrmDateTime18 } from "@sphereon/ssi-sdk.agent-config";
|
|
@@ -5346,6 +5327,7 @@ var AbstractDigitalCredentialStore = class {
|
|
|
5346
5327
|
};
|
|
5347
5328
|
|
|
5348
5329
|
// src/digitalCredential/DigitalCredentialStore.ts
|
|
5330
|
+
import { CredentialRole as CredentialRole2 } from "@sphereon/ssi-types";
|
|
5349
5331
|
import Debug2 from "debug";
|
|
5350
5332
|
|
|
5351
5333
|
// src/utils/SortingUtils.ts
|
|
@@ -5415,7 +5397,7 @@ var DigitalCredentialStore = class extends AbstractDigitalCredentialStore {
|
|
|
5415
5397
|
if (!args) {
|
|
5416
5398
|
return false;
|
|
5417
5399
|
}
|
|
5418
|
-
|
|
5400
|
+
const query = {};
|
|
5419
5401
|
if ("id" in args) {
|
|
5420
5402
|
query.id = args.id;
|
|
5421
5403
|
} else if ("hash" in args) {
|
|
@@ -5501,7 +5483,7 @@ var DigitalCredentialStore = class extends AbstractDigitalCredentialStore {
|
|
|
5501
5483
|
}, "updateCredentialState");
|
|
5502
5484
|
assertValidDigitalCredential(credentialEntity) {
|
|
5503
5485
|
const { kmsKeyRef, identifierMethod, credentialRole, isIssuerSigned } = credentialEntity;
|
|
5504
|
-
const isRoleInvalid = credentialRole ===
|
|
5486
|
+
const isRoleInvalid = credentialRole === CredentialRole2.ISSUER || credentialRole === CredentialRole2.HOLDER && !isIssuerSigned;
|
|
5505
5487
|
if (isRoleInvalid && (!kmsKeyRef || !identifierMethod)) {
|
|
5506
5488
|
const missingFields = [];
|
|
5507
5489
|
if (!kmsKeyRef) missingFields.push("kmsKeyRef");
|
|
@@ -6778,44 +6760,54 @@ import Debug7 from "debug";
|
|
|
6778
6760
|
|
|
6779
6761
|
// src/utils/presentationDefinition/MappingUtils.ts
|
|
6780
6762
|
import * as blakepkg from "blakejs";
|
|
6781
|
-
|
|
6763
|
+
import { DcqlQuery } from "dcql";
|
|
6764
|
+
var dcqlQueryItemFrom = /* @__PURE__ */ __name((entity) => {
|
|
6782
6765
|
const result = {
|
|
6783
6766
|
id: entity.id,
|
|
6784
6767
|
tenantId: entity.tenantId,
|
|
6785
|
-
|
|
6768
|
+
queryId: entity.queryId,
|
|
6786
6769
|
version: entity.version,
|
|
6787
6770
|
name: entity.name,
|
|
6788
6771
|
purpose: entity.purpose,
|
|
6789
|
-
|
|
6790
|
-
dcqlPayload: JSON.parse(entity.dcqlPayload),
|
|
6772
|
+
query: DcqlQuery.parse(JSON.parse(entity.query)),
|
|
6791
6773
|
createdAt: entity.createdAt,
|
|
6792
6774
|
lastUpdatedAt: entity.lastUpdatedAt
|
|
6793
6775
|
};
|
|
6776
|
+
if (result.query) {
|
|
6777
|
+
DcqlQuery.validate(result.query);
|
|
6778
|
+
}
|
|
6794
6779
|
return replaceNullWithUndefined(result);
|
|
6795
|
-
}, "
|
|
6796
|
-
var
|
|
6797
|
-
const entity = new
|
|
6780
|
+
}, "dcqlQueryItemFrom");
|
|
6781
|
+
var dcqlQueryEntityItemFrom = /* @__PURE__ */ __name((item) => {
|
|
6782
|
+
const entity = new DcqlQueryItemEntity();
|
|
6798
6783
|
entity.tenantId = item.tenantId;
|
|
6799
|
-
entity.
|
|
6784
|
+
entity.queryId = item.queryId;
|
|
6800
6785
|
entity.version = item.version;
|
|
6801
6786
|
entity.name = item.name;
|
|
6802
6787
|
entity.purpose = item.purpose;
|
|
6803
|
-
|
|
6804
|
-
|
|
6788
|
+
if (item.query) {
|
|
6789
|
+
const dcqlQuery = DcqlQuery.parse(item.query);
|
|
6790
|
+
DcqlQuery.validate(dcqlQuery);
|
|
6791
|
+
entity.query = JSON.stringify(item.query);
|
|
6792
|
+
}
|
|
6805
6793
|
return entity;
|
|
6806
|
-
}, "
|
|
6794
|
+
}, "dcqlQueryEntityItemFrom");
|
|
6807
6795
|
function hashPayload(payload) {
|
|
6808
6796
|
return blakepkg.blake2bHex(JSON.stringify(payload));
|
|
6809
6797
|
}
|
|
6810
6798
|
__name(hashPayload, "hashPayload");
|
|
6811
6799
|
function isPresentationDefinitionEqual(base, compare) {
|
|
6812
|
-
if (base.
|
|
6800
|
+
if (base.queryId !== compare.queryId || base.tenantId !== compare.tenantId || base.version !== compare.version || base.name !== compare.name || base.purpose !== compare.purpose) {
|
|
6813
6801
|
return false;
|
|
6814
6802
|
}
|
|
6815
|
-
if (base.
|
|
6816
|
-
|
|
6803
|
+
if (base.query && compare.query) {
|
|
6804
|
+
if (hashPayload(base.query) !== hashPayload(compare.query)) {
|
|
6805
|
+
return false;
|
|
6806
|
+
}
|
|
6807
|
+
} else if (base.query || compare.query) {
|
|
6808
|
+
return false;
|
|
6817
6809
|
}
|
|
6818
|
-
return
|
|
6810
|
+
return true;
|
|
6819
6811
|
}
|
|
6820
6812
|
__name(isPresentationDefinitionEqual, "isPresentationDefinitionEqual");
|
|
6821
6813
|
|
|
@@ -6832,7 +6824,7 @@ var PDStore = class extends AbstractPDStore {
|
|
|
6832
6824
|
}
|
|
6833
6825
|
getDefinition = /* @__PURE__ */ __name(async (args) => {
|
|
6834
6826
|
const { itemId } = args ?? {};
|
|
6835
|
-
const pdRepository = (await this.dbConnection).getRepository(
|
|
6827
|
+
const pdRepository = (await this.dbConnection).getRepository(DcqlQueryItemEntity);
|
|
6836
6828
|
const result = await pdRepository.findOne({
|
|
6837
6829
|
where: {
|
|
6838
6830
|
id: itemId
|
|
@@ -6841,11 +6833,11 @@ var PDStore = class extends AbstractPDStore {
|
|
|
6841
6833
|
if (!result) {
|
|
6842
6834
|
return Promise.reject(Error(`No presentation definition item found for id: ${itemId}`));
|
|
6843
6835
|
}
|
|
6844
|
-
return
|
|
6836
|
+
return dcqlQueryItemFrom(result);
|
|
6845
6837
|
}, "getDefinition");
|
|
6846
6838
|
hasDefinition = /* @__PURE__ */ __name(async (args) => {
|
|
6847
6839
|
const { itemId } = args ?? {};
|
|
6848
|
-
const pdRepository = (await this.dbConnection).getRepository(
|
|
6840
|
+
const pdRepository = (await this.dbConnection).getRepository(DcqlQueryItemEntity);
|
|
6849
6841
|
const resultCount = await pdRepository.count({
|
|
6850
6842
|
where: {
|
|
6851
6843
|
id: itemId
|
|
@@ -6855,7 +6847,7 @@ var PDStore = class extends AbstractPDStore {
|
|
|
6855
6847
|
}, "hasDefinition");
|
|
6856
6848
|
hasDefinitions = /* @__PURE__ */ __name(async (args) => {
|
|
6857
6849
|
const { filter } = args;
|
|
6858
|
-
const pdRepository = (await this.dbConnection).getRepository(
|
|
6850
|
+
const pdRepository = (await this.dbConnection).getRepository(DcqlQueryItemEntity);
|
|
6859
6851
|
const resultCount = await pdRepository.count({
|
|
6860
6852
|
...filter && {
|
|
6861
6853
|
where: cleanFilter(filter)
|
|
@@ -6865,7 +6857,7 @@ var PDStore = class extends AbstractPDStore {
|
|
|
6865
6857
|
}, "hasDefinitions");
|
|
6866
6858
|
getDefinitions = /* @__PURE__ */ __name(async (args) => {
|
|
6867
6859
|
const { filter } = args;
|
|
6868
|
-
const pdRepository = (await this.dbConnection).getRepository(
|
|
6860
|
+
const pdRepository = (await this.dbConnection).getRepository(DcqlQueryItemEntity);
|
|
6869
6861
|
const initialResult = await this.findIds(pdRepository, filter);
|
|
6870
6862
|
const result = await pdRepository.find({
|
|
6871
6863
|
where: {
|
|
@@ -6875,19 +6867,19 @@ var PDStore = class extends AbstractPDStore {
|
|
|
6875
6867
|
version: "DESC"
|
|
6876
6868
|
}
|
|
6877
6869
|
});
|
|
6878
|
-
return result.map((entity) =>
|
|
6870
|
+
return result.map((entity) => dcqlQueryItemFrom(entity));
|
|
6879
6871
|
}, "getDefinitions");
|
|
6880
6872
|
addDefinition = /* @__PURE__ */ __name(async (item) => {
|
|
6881
|
-
const pdRepository = (await this.dbConnection).getRepository(
|
|
6882
|
-
const entity =
|
|
6873
|
+
const pdRepository = (await this.dbConnection).getRepository(DcqlQueryItemEntity);
|
|
6874
|
+
const entity = dcqlQueryEntityItemFrom(item);
|
|
6883
6875
|
debug7("Adding presentation definition entity", item);
|
|
6884
6876
|
const result = await pdRepository.save(entity, {
|
|
6885
6877
|
transaction: true
|
|
6886
6878
|
});
|
|
6887
|
-
return
|
|
6879
|
+
return dcqlQueryItemFrom(result);
|
|
6888
6880
|
}, "addDefinition");
|
|
6889
6881
|
updateDefinition = /* @__PURE__ */ __name(async (item) => {
|
|
6890
|
-
const pdRepository = (await this.dbConnection).getRepository(
|
|
6882
|
+
const pdRepository = (await this.dbConnection).getRepository(DcqlQueryItemEntity);
|
|
6891
6883
|
const result = await pdRepository.findOne({
|
|
6892
6884
|
where: {
|
|
6893
6885
|
id: item.id
|
|
@@ -6900,20 +6892,20 @@ var PDStore = class extends AbstractPDStore {
|
|
|
6900
6892
|
...result
|
|
6901
6893
|
};
|
|
6902
6894
|
updatedEntity.tenantId = item.tenantId;
|
|
6903
|
-
updatedEntity.
|
|
6895
|
+
updatedEntity.queryId = item.queryId;
|
|
6904
6896
|
updatedEntity.version = item.version;
|
|
6905
6897
|
updatedEntity.name = item.name;
|
|
6906
6898
|
updatedEntity.purpose = item.purpose;
|
|
6907
|
-
updatedEntity.
|
|
6899
|
+
updatedEntity.query = JSON.stringify(item.query);
|
|
6908
6900
|
debug7("Updating presentation definition entity", updatedEntity);
|
|
6909
6901
|
const updateResult = await pdRepository.save(updatedEntity, {
|
|
6910
6902
|
transaction: true
|
|
6911
6903
|
});
|
|
6912
|
-
return
|
|
6904
|
+
return dcqlQueryItemFrom(updateResult);
|
|
6913
6905
|
}, "updateDefinition");
|
|
6914
6906
|
deleteDefinition = /* @__PURE__ */ __name(async (args) => {
|
|
6915
6907
|
const { itemId } = args;
|
|
6916
|
-
const pdRepository = (await this.dbConnection).getRepository(
|
|
6908
|
+
const pdRepository = (await this.dbConnection).getRepository(DcqlQueryItemEntity);
|
|
6917
6909
|
const entity = await pdRepository.findOne({
|
|
6918
6910
|
where: {
|
|
6919
6911
|
id: itemId
|
|
@@ -6927,7 +6919,7 @@ var PDStore = class extends AbstractPDStore {
|
|
|
6927
6919
|
}, "deleteDefinition");
|
|
6928
6920
|
deleteDefinitions = /* @__PURE__ */ __name(async (args) => {
|
|
6929
6921
|
const { filter } = args;
|
|
6930
|
-
const pdRepository = (await this.dbConnection).getRepository(
|
|
6922
|
+
const pdRepository = (await this.dbConnection).getRepository(DcqlQueryItemEntity);
|
|
6931
6923
|
const initialResult = await this.findIds(pdRepository, filter);
|
|
6932
6924
|
const result = await pdRepository.find({
|
|
6933
6925
|
where: {
|
|
@@ -7140,9 +7132,120 @@ var CreateContacts1659463079429 = class {
|
|
|
7140
7132
|
}
|
|
7141
7133
|
};
|
|
7142
7134
|
|
|
7143
|
-
// src/migrations/generic/
|
|
7135
|
+
// src/migrations/generic/10-CreatePresentationDefinitions.ts
|
|
7144
7136
|
import Debug9 from "debug";
|
|
7145
7137
|
|
|
7138
|
+
// src/migrations/postgres/1716475165345-CreatePresentationDefinitions.ts
|
|
7139
|
+
var CreatePresentationDefinitions1716475165345 = class {
|
|
7140
|
+
static {
|
|
7141
|
+
__name(this, "CreatePresentationDefinitions1716475165345");
|
|
7142
|
+
}
|
|
7143
|
+
name = "CreatePresentationDefinitions1716475165345";
|
|
7144
|
+
async up(queryRunner) {
|
|
7145
|
+
await queryRunner.query(`
|
|
7146
|
+
CREATE TABLE "PresentationDefinitionItem" (
|
|
7147
|
+
"id" uuid NOT NULL DEFAULT uuid_generate_v4(),
|
|
7148
|
+
"tenant_id" TEXT,
|
|
7149
|
+
"definition_id" TEXT NOT NULL,
|
|
7150
|
+
"name" TEXT,
|
|
7151
|
+
"version" TEXT NOT NULL,
|
|
7152
|
+
"purpose" TEXT,
|
|
7153
|
+
"definition_payload" TEXT NOT NULL,
|
|
7154
|
+
"query" TEXT,
|
|
7155
|
+
"created_at" TIMESTAMP NOT NULL DEFAULT now(),
|
|
7156
|
+
"last_updated_at" TIMESTAMP NOT NULL DEFAULT now(),
|
|
7157
|
+
CONSTRAINT "PK_PresentationDefinitionItem_id" PRIMARY KEY ("id"))
|
|
7158
|
+
`);
|
|
7159
|
+
}
|
|
7160
|
+
async down(queryRunner) {
|
|
7161
|
+
await queryRunner.query(`DROP TABLE "PresentationDefinitionItem"`);
|
|
7162
|
+
}
|
|
7163
|
+
};
|
|
7164
|
+
|
|
7165
|
+
// src/migrations/sqlite/1716475165344-CreatePresentationDefinitions.ts
|
|
7166
|
+
var CreatePresentationDefinitions1716475165344 = class {
|
|
7167
|
+
static {
|
|
7168
|
+
__name(this, "CreatePresentationDefinitions1716475165344");
|
|
7169
|
+
}
|
|
7170
|
+
name = "CreatePresentationDefinitions1716475165344";
|
|
7171
|
+
async up(queryRunner) {
|
|
7172
|
+
await queryRunner.query(`CREATE TABLE "PresentationDefinitionItem" (
|
|
7173
|
+
"id" varchar PRIMARY KEY NOT NULL,
|
|
7174
|
+
"tenant_id" varchar,
|
|
7175
|
+
"definition_id" varchar NOT NULL,
|
|
7176
|
+
"name" varchar,
|
|
7177
|
+
"version" varchar NOT NULL,
|
|
7178
|
+
"purpose" varchar,
|
|
7179
|
+
"definition_payload" varchar NOT NULL,
|
|
7180
|
+
"query" varchar,
|
|
7181
|
+
"created_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
7182
|
+
"last_updated_at" datetime NOT NULL DEFAULT (datetime('now')))`);
|
|
7183
|
+
}
|
|
7184
|
+
async down(queryRunner) {
|
|
7185
|
+
await queryRunner.query(`DROP TABLE "PresentationDefinitionItem"`);
|
|
7186
|
+
}
|
|
7187
|
+
};
|
|
7188
|
+
|
|
7189
|
+
// src/migrations/generic/10-CreatePresentationDefinitions.ts
|
|
7190
|
+
var debug9 = Debug9("sphereon:ssi-sdk:migrations");
|
|
7191
|
+
var CreatePresentationDefinitions1716533767523 = class {
|
|
7192
|
+
static {
|
|
7193
|
+
__name(this, "CreatePresentationDefinitions1716533767523");
|
|
7194
|
+
}
|
|
7195
|
+
name = "CreatePresentationDefinitionItems1716533767523";
|
|
7196
|
+
async up(queryRunner) {
|
|
7197
|
+
debug9("migration: creating machine state tables");
|
|
7198
|
+
const dbType = queryRunner.connection.driver.options.type;
|
|
7199
|
+
switch (dbType) {
|
|
7200
|
+
case "postgres": {
|
|
7201
|
+
debug9("using postgres migration file");
|
|
7202
|
+
const mig = new CreatePresentationDefinitions1716475165345();
|
|
7203
|
+
await mig.up(queryRunner);
|
|
7204
|
+
debug9("Migration statements executed");
|
|
7205
|
+
return;
|
|
7206
|
+
}
|
|
7207
|
+
case "sqlite":
|
|
7208
|
+
case "expo":
|
|
7209
|
+
case "react-native": {
|
|
7210
|
+
debug9("using sqlite/react-native migration file");
|
|
7211
|
+
const mig = new CreatePresentationDefinitions1716475165344();
|
|
7212
|
+
await mig.up(queryRunner);
|
|
7213
|
+
debug9("Migration statements executed");
|
|
7214
|
+
return;
|
|
7215
|
+
}
|
|
7216
|
+
default:
|
|
7217
|
+
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`);
|
|
7218
|
+
}
|
|
7219
|
+
}
|
|
7220
|
+
async down(queryRunner) {
|
|
7221
|
+
debug9("migration: reverting machine state tables");
|
|
7222
|
+
const dbType = queryRunner.connection.driver.options.type;
|
|
7223
|
+
switch (dbType) {
|
|
7224
|
+
case "postgres": {
|
|
7225
|
+
debug9("using postgres migration file");
|
|
7226
|
+
const mig = new CreatePresentationDefinitions1716475165345();
|
|
7227
|
+
await mig.down(queryRunner);
|
|
7228
|
+
debug9("Migration statements executed");
|
|
7229
|
+
return;
|
|
7230
|
+
}
|
|
7231
|
+
case "sqlite":
|
|
7232
|
+
case "expo":
|
|
7233
|
+
case "react-native": {
|
|
7234
|
+
debug9("using sqlite/react-native migration file");
|
|
7235
|
+
const mig = new CreatePresentationDefinitions1716475165344();
|
|
7236
|
+
await mig.down(queryRunner);
|
|
7237
|
+
debug9("Migration statements executed");
|
|
7238
|
+
return;
|
|
7239
|
+
}
|
|
7240
|
+
default:
|
|
7241
|
+
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`);
|
|
7242
|
+
}
|
|
7243
|
+
}
|
|
7244
|
+
};
|
|
7245
|
+
|
|
7246
|
+
// src/migrations/generic/11-FixCredentialClaimsReferenceUuid.ts
|
|
7247
|
+
import Debug10 from "debug";
|
|
7248
|
+
|
|
7146
7249
|
// src/migrations/postgres/1685628974232-CreateIssuanceBranding.ts
|
|
7147
7250
|
import { enablePostgresUuidExtension as enablePostgresUuidExtension2 } from "@sphereon/ssi-sdk.core";
|
|
7148
7251
|
var CreateIssuanceBranding1685628974232 = class {
|
|
@@ -7279,31 +7382,105 @@ var CreateIssuanceBranding1685628973231 = class {
|
|
|
7279
7382
|
}
|
|
7280
7383
|
};
|
|
7281
7384
|
|
|
7282
|
-
// src/migrations/
|
|
7283
|
-
var
|
|
7284
|
-
var CreateIssuanceBranding1659463079429 = class {
|
|
7385
|
+
// src/migrations/postgres/1741895822987-FixCredentialClaimsReferencesUuid.ts
|
|
7386
|
+
var FixCredentialClaimsReferencesUuidPG1741895822987 = class {
|
|
7285
7387
|
static {
|
|
7286
|
-
__name(this, "
|
|
7388
|
+
__name(this, "FixCredentialClaimsReferencesUuidPG1741895822987");
|
|
7287
7389
|
}
|
|
7288
|
-
name = "
|
|
7390
|
+
name = "FixCredentialClaimsReferencesUuid1741895822987";
|
|
7391
|
+
async up(queryRunner) {
|
|
7392
|
+
await queryRunner.query(`
|
|
7393
|
+
ALTER TABLE "CredentialClaims"
|
|
7394
|
+
ALTER COLUMN "credentialLocaleBrandingId" TYPE uuid USING "credentialLocaleBrandingId"::uuid;
|
|
7395
|
+
`);
|
|
7396
|
+
}
|
|
7397
|
+
async down(queryRunner) {
|
|
7398
|
+
await queryRunner.query(`
|
|
7399
|
+
ALTER TABLE "CredentialClaims"
|
|
7400
|
+
ALTER COLUMN "credentialLocaleBrandingId" TYPE character varying USING "credentialLocaleBrandingId"::text;
|
|
7401
|
+
`);
|
|
7402
|
+
}
|
|
7403
|
+
};
|
|
7404
|
+
|
|
7405
|
+
// src/migrations/sqlite/1741895822987-FixCredentialClaimsReferencesUuid.ts
|
|
7406
|
+
var FixCredentialClaimsReferencesUuidSqlite1741895822987 = class {
|
|
7407
|
+
static {
|
|
7408
|
+
__name(this, "FixCredentialClaimsReferencesUuidSqlite1741895822987");
|
|
7409
|
+
}
|
|
7410
|
+
name = "FixCredentialClaimsReferencesUuid1741895822987";
|
|
7411
|
+
async up(queryRunner) {
|
|
7412
|
+
await queryRunner.query(`
|
|
7413
|
+
CREATE TABLE "CredentialClaims_new"
|
|
7414
|
+
(
|
|
7415
|
+
"id" uuid NOT NULL DEFAULT (lower(hex(randomblob(16)))),
|
|
7416
|
+
"key" character varying(255) NOT NULL,
|
|
7417
|
+
"name" character varying(255) NOT NULL,
|
|
7418
|
+
"credentialLocaleBrandingId" uuid,
|
|
7419
|
+
CONSTRAINT "PK_CredentialClaims_id" PRIMARY KEY ("id")
|
|
7420
|
+
)
|
|
7421
|
+
`);
|
|
7422
|
+
await queryRunner.query(`
|
|
7423
|
+
INSERT INTO "CredentialClaims_new" ("id", "key", "name", "credentialLocaleBrandingId")
|
|
7424
|
+
SELECT "id", "key", "name", "credentialLocaleBrandingId"
|
|
7425
|
+
FROM "CredentialClaims"
|
|
7426
|
+
`);
|
|
7427
|
+
await queryRunner.query(`DROP TABLE "CredentialClaims"`);
|
|
7428
|
+
await queryRunner.query(`ALTER TABLE "CredentialClaims_new" RENAME TO "CredentialClaims"`);
|
|
7429
|
+
await queryRunner.query(`
|
|
7430
|
+
CREATE UNIQUE INDEX "IDX_CredentialClaimsEntity_credentialLocaleBranding_locale"
|
|
7431
|
+
ON "CredentialClaims" ("credentialLocaleBrandingId", "key")
|
|
7432
|
+
`);
|
|
7433
|
+
}
|
|
7434
|
+
async down(queryRunner) {
|
|
7435
|
+
await queryRunner.query(`
|
|
7436
|
+
CREATE TABLE "CredentialClaims_old"
|
|
7437
|
+
(
|
|
7438
|
+
"id" uuid NOT NULL DEFAULT (lower(hex(randomblob(16)))),
|
|
7439
|
+
"key" character varying(255) NOT NULL,
|
|
7440
|
+
"name" character varying(255) NOT NULL,
|
|
7441
|
+
"credentialLocaleBrandingId" character varying,
|
|
7442
|
+
CONSTRAINT "PK_CredentialClaims_id" PRIMARY KEY ("id")
|
|
7443
|
+
)
|
|
7444
|
+
`);
|
|
7445
|
+
await queryRunner.query(`
|
|
7446
|
+
INSERT INTO "CredentialClaims_old" ("id", "key", "name", "credentialLocaleBrandingId")
|
|
7447
|
+
SELECT "id", "key", "name", "credentialLocaleBrandingId"
|
|
7448
|
+
FROM "CredentialClaims"
|
|
7449
|
+
`);
|
|
7450
|
+
await queryRunner.query(`DROP TABLE "CredentialClaims"`);
|
|
7451
|
+
await queryRunner.query(`ALTER TABLE "CredentialClaims_old" RENAME TO "CredentialClaims"`);
|
|
7452
|
+
await queryRunner.query(`
|
|
7453
|
+
CREATE UNIQUE INDEX "IDX_CredentialClaimsEntity_credentialLocaleBranding_locale"
|
|
7454
|
+
ON "CredentialClaims" ("credentialLocaleBrandingId", "key")
|
|
7455
|
+
`);
|
|
7456
|
+
}
|
|
7457
|
+
};
|
|
7458
|
+
|
|
7459
|
+
// src/migrations/generic/11-FixCredentialClaimsReferenceUuid.ts
|
|
7460
|
+
var debug10 = Debug10("sphereon:ssi-sdk:migrations");
|
|
7461
|
+
var FixCredentialClaimsReferencesUuid1741895822987 = class {
|
|
7462
|
+
static {
|
|
7463
|
+
__name(this, "FixCredentialClaimsReferencesUuid1741895822987");
|
|
7464
|
+
}
|
|
7465
|
+
name = "FixCredentialClaimsReferenceUuid1741895822987";
|
|
7289
7466
|
async up(queryRunner) {
|
|
7290
|
-
|
|
7467
|
+
debug10("migration: creating issuance branding uuid problem");
|
|
7291
7468
|
const dbType = queryRunner.connection.driver.options.type;
|
|
7292
7469
|
switch (dbType) {
|
|
7293
7470
|
case "postgres": {
|
|
7294
|
-
|
|
7295
|
-
const mig = new
|
|
7471
|
+
debug10("using postgres migration file");
|
|
7472
|
+
const mig = new FixCredentialClaimsReferencesUuidPG1741895822987();
|
|
7296
7473
|
await mig.up(queryRunner);
|
|
7297
|
-
|
|
7474
|
+
debug10("Migration statements executed");
|
|
7298
7475
|
return;
|
|
7299
7476
|
}
|
|
7300
7477
|
case "sqlite":
|
|
7301
7478
|
case "expo":
|
|
7302
7479
|
case "react-native": {
|
|
7303
|
-
|
|
7304
|
-
const mig = new
|
|
7480
|
+
debug10("using sqlite/react-native migration file");
|
|
7481
|
+
const mig = new FixCredentialClaimsReferencesUuidSqlite1741895822987();
|
|
7305
7482
|
await mig.up(queryRunner);
|
|
7306
|
-
|
|
7483
|
+
debug10("Migration statements executed");
|
|
7307
7484
|
return;
|
|
7308
7485
|
}
|
|
7309
7486
|
default:
|
|
@@ -7311,23 +7488,23 @@ var CreateIssuanceBranding1659463079429 = class {
|
|
|
7311
7488
|
}
|
|
7312
7489
|
}
|
|
7313
7490
|
async down(queryRunner) {
|
|
7314
|
-
|
|
7491
|
+
debug10("migration: reverting issuance branding uuid migration");
|
|
7315
7492
|
const dbType = queryRunner.connection.driver.options.type;
|
|
7316
7493
|
switch (dbType) {
|
|
7317
7494
|
case "postgres": {
|
|
7318
|
-
|
|
7495
|
+
debug10("using postgres migration file");
|
|
7319
7496
|
const mig = new CreateIssuanceBranding1685628974232();
|
|
7320
7497
|
await mig.down(queryRunner);
|
|
7321
|
-
|
|
7498
|
+
debug10("Migration statements executed");
|
|
7322
7499
|
return;
|
|
7323
7500
|
}
|
|
7324
7501
|
case "sqlite":
|
|
7325
7502
|
case "expo":
|
|
7326
7503
|
case "react-native": {
|
|
7327
|
-
|
|
7504
|
+
debug10("using sqlite/react-native migration file");
|
|
7328
7505
|
const mig = new CreateIssuanceBranding1685628973231();
|
|
7329
7506
|
await mig.down(queryRunner);
|
|
7330
|
-
|
|
7507
|
+
debug10("Migration statements executed");
|
|
7331
7508
|
return;
|
|
7332
7509
|
}
|
|
7333
7510
|
default:
|
|
@@ -7336,669 +7513,678 @@ var CreateIssuanceBranding1659463079429 = class {
|
|
|
7336
7513
|
}
|
|
7337
7514
|
};
|
|
7338
7515
|
|
|
7339
|
-
// src/migrations/generic/
|
|
7340
|
-
import
|
|
7516
|
+
// src/migrations/generic/12-CreateBitstringStatusList.ts
|
|
7517
|
+
import Debug11 from "debug";
|
|
7341
7518
|
|
|
7342
|
-
// src/migrations/
|
|
7343
|
-
var
|
|
7519
|
+
// src/migrations/postgres/1741895823000-CreateBitstringStatusList.ts
|
|
7520
|
+
var AddBitstringStatusListEnumPG1741895823000 = class {
|
|
7344
7521
|
static {
|
|
7345
|
-
__name(this, "
|
|
7522
|
+
__name(this, "AddBitstringStatusListEnumPG1741895823000");
|
|
7346
7523
|
}
|
|
7347
|
-
name = "
|
|
7524
|
+
name = "AddBitstringStatusListEnum1741895823000";
|
|
7348
7525
|
async up(queryRunner) {
|
|
7349
|
-
await queryRunner.
|
|
7350
|
-
await queryRunner.query(`
|
|
7351
|
-
await queryRunner.
|
|
7352
|
-
await queryRunner.query(`ALTER TABLE "temporary_CorrelationIdentifier" RENAME TO "CorrelationIdentifier"`);
|
|
7353
|
-
await queryRunner.query(`CREATE TABLE "temporary_Identity" ("id" varchar PRIMARY KEY NOT NULL, "alias" varchar(255) NOT NULL, "roles" text NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "contactId" varchar, CONSTRAINT "UQ_Identity_alias" UNIQUE ("alias"))`);
|
|
7354
|
-
await queryRunner.query(`INSERT INTO "temporary_Identity"("id", "alias", "roles", "created_at", "last_updated_at", "contactId") SELECT "id", "alias", "roles", "created_at", "last_updated_at", "contactId" FROM "Identity"`);
|
|
7355
|
-
await queryRunner.query(`DROP TABLE "Identity"`);
|
|
7356
|
-
await queryRunner.query(`ALTER TABLE "temporary_Identity" RENAME TO "Identity"`);
|
|
7357
|
-
await queryRunner.query(`CREATE TABLE "temporary_Connection" ("id" varchar PRIMARY KEY NOT NULL, "type" varchar CHECK( "type" IN ('OIDC','SIOPv2','SIOPv2+OpenID4VP') ) NOT NULL, "identityId" varchar, CONSTRAINT "REL_Connection_identityId" UNIQUE ("identityId"))`);
|
|
7358
|
-
await queryRunner.query(`INSERT INTO "temporary_Connection"("id", "type", "identityId") SELECT "id", "type", "identityId" FROM "Connection"`);
|
|
7359
|
-
await queryRunner.query(`DROP TABLE "Connection"`);
|
|
7360
|
-
await queryRunner.query(`ALTER TABLE "temporary_Connection" RENAME TO "Connection"`);
|
|
7361
|
-
await queryRunner.query(`CREATE TABLE "temporary_CorrelationIdentifier" ("id" varchar PRIMARY KEY NOT NULL, "type" varchar CHECK( "type" IN ('did','url') ) NOT NULL, "correlation_id" text NOT NULL, "identity_id" varchar, CONSTRAINT "REL_CorrelationIdentifier_identityId" UNIQUE ("identity_id"), CONSTRAINT "UQ_CorrelationIdentifier_correlation_id" UNIQUE ("correlation_id"))`);
|
|
7362
|
-
await queryRunner.query(`INSERT INTO "temporary_CorrelationIdentifier"("id", "type", "correlation_id", "identity_id") SELECT "id", "type", "correlation_id", "identityId" FROM "CorrelationIdentifier"`);
|
|
7363
|
-
await queryRunner.query(`DROP TABLE "CorrelationIdentifier"`);
|
|
7364
|
-
await queryRunner.query(`ALTER TABLE "temporary_CorrelationIdentifier" RENAME TO "CorrelationIdentifier"`);
|
|
7365
|
-
await queryRunner.query(`CREATE TABLE "temporary_Identity" ("id" varchar PRIMARY KEY NOT NULL, "alias" varchar(255) NOT NULL, "roles" text NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "partyId" varchar, CONSTRAINT "UQ_Identity_alias" UNIQUE ("alias"))`);
|
|
7366
|
-
await queryRunner.query(`INSERT INTO "temporary_Identity"("id", "alias", "roles", "created_at", "last_updated_at", "partyId") SELECT "id", "alias", "roles", "created_at", "last_updated_at", "contactId" FROM "Identity"`);
|
|
7367
|
-
await queryRunner.query(`DROP TABLE "Identity"`);
|
|
7368
|
-
await queryRunner.query(`ALTER TABLE "temporary_Identity" RENAME TO "Identity"`);
|
|
7369
|
-
await queryRunner.query(`CREATE TABLE "temporary_Connection" ("id" varchar PRIMARY KEY NOT NULL, "type" varchar CHECK( "type" IN ('OIDC','SIOPv2','SIOPv2+OpenID4VP') ) NOT NULL, "identity_id" varchar, CONSTRAINT "REL_Connection_identityId" UNIQUE ("identity_id"))`);
|
|
7370
|
-
await queryRunner.query(`INSERT INTO "temporary_Connection"("id", "type", "identity_id") SELECT "id", "type", "identityId" FROM "Connection"`);
|
|
7371
|
-
await queryRunner.query(`DROP TABLE "Connection"`);
|
|
7372
|
-
await queryRunner.query(`ALTER TABLE "temporary_Connection" RENAME TO "Connection"`);
|
|
7373
|
-
await queryRunner.query(`CREATE TABLE "PartyType" ("id" varchar PRIMARY KEY NOT NULL, "type" varchar CHECK( "type" IN ('naturalPerson','organization') ) NOT NULL, "origin" varchar CHECK( "origin" IN ('INTERNAL', 'EXTERNAL') ) NOT NULL, "name" varchar(255) NOT NULL, "description" varchar(255), "tenant_id" varchar(255) NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), CONSTRAINT "UQ_PartyType_name" UNIQUE ("name"))`);
|
|
7374
|
-
await queryRunner.query(`CREATE UNIQUE INDEX "IDX_PartyType_type_tenant_id" ON "PartyType" ("type", "tenant_id")`);
|
|
7375
|
-
await queryRunner.query(`CREATE TABLE "BaseContact" ("id" varchar PRIMARY KEY NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "legal_name" varchar(255), "display_name" varchar(255), "first_name" varchar(255), "middle_name" varchar(255), "last_name" varchar(255), "type" varchar NOT NULL, "party_id" varchar, CONSTRAINT "UQ_BaseContact_legal_name" UNIQUE ("legal_name"), CONSTRAINT "REL_BaseContact_party_id" UNIQUE ("party_id"))`);
|
|
7376
|
-
await queryRunner.query(`CREATE INDEX "IDX_BaseContact_type" ON "BaseContact" ("type")`);
|
|
7377
|
-
await queryRunner.query(`CREATE TABLE "PartyRelationship" ("id" varchar PRIMARY KEY NOT NULL, "left_id" varchar NOT NULL, "right_id" varchar NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')))`);
|
|
7378
|
-
await queryRunner.query(`CREATE UNIQUE INDEX "IDX_PartyRelationship_left_right" ON "PartyRelationship" ("left_id", "right_id")`);
|
|
7379
|
-
await queryRunner.query(`CREATE TABLE "Party" ("id" varchar PRIMARY KEY NOT NULL, "uri" varchar(255) NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "party_type_id" varchar NOT NULL)`);
|
|
7380
|
-
await queryRunner.query(`CREATE TABLE "BaseConfig" ("id" varchar PRIMARY KEY NOT NULL, "identifier" varchar(255), "redirect_url" varchar(255), "session_id" varchar(255), "client_id" varchar(255), "client_secret" varchar(255), "scopes" text, "issuer" varchar(255), "dangerously_allow_insecure_http_requests" boolean, "client_auth_method" text, "type" varchar NOT NULL, "connection_id" varchar, CONSTRAINT "REL_BaseConfig_connection_id" UNIQUE ("connection_id"))`);
|
|
7381
|
-
await queryRunner.query(`CREATE INDEX "IDX_BaseConfig_type" ON "BaseConfig" ("type")`);
|
|
7382
|
-
await queryRunner.query(`CREATE TABLE "temporary_CorrelationIdentifier" ("id" varchar PRIMARY KEY NOT NULL, "type" varchar CHECK( "type" IN ('did','url') ) NOT NULL, "correlation_id" text NOT NULL, "identity_id" varchar, CONSTRAINT "REL_CorrelationIdentifier_identity_id" UNIQUE ("identity_id"), CONSTRAINT "UQ_CorrelationIdentifier_correlation_id" UNIQUE ("correlation_id"), CONSTRAINT "FK_CorrelationIdentifier_identity_id" FOREIGN KEY ("identity_id") REFERENCES "Identity" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`);
|
|
7383
|
-
await queryRunner.query(`INSERT INTO "temporary_CorrelationIdentifier"("id", "type", "correlation_id", "identity_id") SELECT "id", "type", "correlation_id", "identity_id" FROM "CorrelationIdentifier"`);
|
|
7384
|
-
await queryRunner.query(`DROP TABLE "CorrelationIdentifier"`);
|
|
7385
|
-
await queryRunner.query(`ALTER TABLE "temporary_CorrelationIdentifier" RENAME TO "CorrelationIdentifier"`);
|
|
7386
|
-
await queryRunner.query(`DROP INDEX "IDX_BaseContact_type"`);
|
|
7387
|
-
await queryRunner.query(`CREATE TABLE "temporary_BaseContact" ("id" varchar PRIMARY KEY NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "legal_name" varchar(255), "display_name" varchar(255), "first_name" varchar(255), "middle_name" varchar(255), "last_name" varchar(255), "type" varchar NOT NULL, "party_id" varchar, CONSTRAINT "UQ_BaseContact_legal_name" UNIQUE ("legal_name"), CONSTRAINT "REL_BaseContact_party_id" UNIQUE ("party_id"), CONSTRAINT "FK_BaseContact_party_id" FOREIGN KEY ("party_id") REFERENCES "Party" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`);
|
|
7388
|
-
await queryRunner.query(`INSERT INTO "temporary_BaseContact"("id", "created_at", "last_updated_at", "legal_name", "display_name", "first_name", "middle_name", "last_name", "type", "party_id") SELECT "id", "created_at", "last_updated_at", "legal_name", "display_name", "first_name", "middle_name", "last_name", "type", "party_id" FROM "BaseContact"`);
|
|
7389
|
-
await queryRunner.query(`DROP TABLE "BaseContact"`);
|
|
7390
|
-
await queryRunner.query(`ALTER TABLE "temporary_BaseContact" RENAME TO "BaseContact"`);
|
|
7391
|
-
await queryRunner.query(`CREATE INDEX "IDX_BaseContact_type" ON "BaseContact" ("type")`);
|
|
7392
|
-
await queryRunner.query(`DROP INDEX "IDX_PartyRelationship_left_right"`);
|
|
7393
|
-
await queryRunner.query(`CREATE TABLE "temporary_PartyRelationship" ("id" varchar PRIMARY KEY NOT NULL, "left_id" varchar NOT NULL, "right_id" varchar NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), CONSTRAINT "FK_PartyRelationship_left_id" FOREIGN KEY ("left_id") REFERENCES "Party" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_PartyRelationship_right_id" FOREIGN KEY ("right_id") REFERENCES "Party" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`);
|
|
7394
|
-
await queryRunner.query(`INSERT INTO "temporary_PartyRelationship"("id", "left_id", "right_id", "created_at", "last_updated_at") SELECT "id", "left_id", "right_id", "created_at", "last_updated_at" FROM "PartyRelationship"`);
|
|
7395
|
-
await queryRunner.query(`DROP TABLE "PartyRelationship"`);
|
|
7396
|
-
await queryRunner.query(`ALTER TABLE "temporary_PartyRelationship" RENAME TO "PartyRelationship"`);
|
|
7397
|
-
await queryRunner.query(`CREATE UNIQUE INDEX "IDX_PartyRelationship_left_right" ON "PartyRelationship" ("left_id", "right_id")`);
|
|
7398
|
-
await queryRunner.query(`CREATE TABLE "ElectronicAddress" ("id" varchar PRIMARY KEY NOT NULL, "type" varchar(255) NOT NULL, "electronic_address" varchar(255) NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "partyId" varchar, CONSTRAINT "FK_ElectronicAddress_partyId" FOREIGN KEY ("partyId") REFERENCES "Party" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`);
|
|
7399
|
-
await queryRunner.query(`CREATE TABLE "PhysicalAddress" ("id" varchar PRIMARY KEY NOT NULL, "type" varchar(255) NOT NULL, "street_name" varchar(255) NOT NULL, "street_number" varchar(255) NOT NULL, "postal_code" varchar(255) NOT NULL, "city_name" varchar(255) NOT NULL, "province_name" varchar(255) NOT NULL, "country_code" varchar(2) NOT NULL, "building_name" varchar(255), "partyId" varchar, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), CONSTRAINT "FK_PhysicalAddressEntity_partyId" FOREIGN KEY ("partyId") REFERENCES "Party" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`);
|
|
7400
|
-
await queryRunner.query(`CREATE TABLE "temporary_Party" ("id" varchar PRIMARY KEY NOT NULL, "uri" varchar(255), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "party_type_id" varchar NOT NULL, CONSTRAINT "FK_Party_party_type_id" FOREIGN KEY ("party_type_id") REFERENCES "PartyType" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION)`);
|
|
7401
|
-
await queryRunner.query(`INSERT INTO "temporary_Party"("id", "uri", "created_at", "last_updated_at", "party_type_id") SELECT "id", "uri", "created_at", "last_updated_at", "party_type_id" FROM "Party"`);
|
|
7402
|
-
await queryRunner.query(`DROP TABLE "Party"`);
|
|
7403
|
-
await queryRunner.query(`ALTER TABLE "temporary_Party" RENAME TO "Party"`);
|
|
7404
|
-
await queryRunner.query(`CREATE TABLE "temporary_Identity" ("id" varchar PRIMARY KEY NOT NULL, "alias" varchar(255) NOT NULL, "roles" text NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "partyId" varchar, CONSTRAINT "UQ_Identity_alias" UNIQUE ("alias"), CONSTRAINT "FK_Identity_partyId" FOREIGN KEY ("partyId") REFERENCES "Party" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`);
|
|
7405
|
-
await queryRunner.query(`INSERT INTO "temporary_Identity"("id", "alias", "roles", "created_at", "last_updated_at", "partyId") SELECT "id", "alias", "roles", "created_at", "last_updated_at", "partyId" FROM "Identity"`);
|
|
7406
|
-
await queryRunner.query(`DROP TABLE "Identity"`);
|
|
7407
|
-
await queryRunner.query(`ALTER TABLE "temporary_Identity" RENAME TO "Identity"`);
|
|
7408
|
-
await queryRunner.query(`CREATE TABLE "temporary_Connection" ("id" varchar PRIMARY KEY NOT NULL, "type" varchar CHECK( "type" IN ('OIDC','SIOPv2','SIOPv2+OpenID4VP') ) NOT NULL, "identity_id" varchar, CONSTRAINT "REL_Connection_identity_id" UNIQUE ("identity_id"), CONSTRAINT "FK_Connection_identity_id" FOREIGN KEY ("identity_id") REFERENCES "Identity" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`);
|
|
7409
|
-
await queryRunner.query(`INSERT INTO "temporary_Connection"("id", "type", "identity_id") SELECT "id", "type", "identity_id" FROM "Connection"`);
|
|
7410
|
-
await queryRunner.query(`DROP TABLE "Connection"`);
|
|
7411
|
-
await queryRunner.query(`ALTER TABLE "temporary_Connection" RENAME TO "Connection"`);
|
|
7412
|
-
await queryRunner.query(`DROP INDEX "IDX_BaseConfig_type"`);
|
|
7413
|
-
await queryRunner.query(`CREATE TABLE "temporary_BaseConfig" ("id" varchar PRIMARY KEY NOT NULL, "identifier" varchar(255), "redirect_url" varchar(255), "session_id" varchar(255), "client_id" varchar(255), "client_secret" varchar(255), "scopes" text, "issuer" varchar(255), "dangerously_allow_insecure_http_requests" boolean, "client_auth_method" text, "type" varchar NOT NULL, "connection_id" varchar, CONSTRAINT "REL_BaseConfig_connection_id" UNIQUE ("connection_id"), CONSTRAINT "FK_BaseConfig_connection_id" FOREIGN KEY ("connection_id") REFERENCES "Connection" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`);
|
|
7414
|
-
await queryRunner.query(`INSERT INTO "temporary_BaseConfig"("id", "identifier", "redirect_url", "session_id", "client_id", "client_secret", "scopes", "issuer", "dangerously_allow_insecure_http_requests", "client_auth_method", "type", "connection_id") SELECT "id", "identifier", "redirect_url", "session_id", "client_id", "client_secret", "scopes", "issuer", "dangerously_allow_insecure_http_requests", "client_auth_method", "type", "connection_id" FROM "BaseConfig"`);
|
|
7415
|
-
await queryRunner.query(`DROP TABLE "BaseConfig"`);
|
|
7416
|
-
await queryRunner.query(`ALTER TABLE "temporary_BaseConfig" RENAME TO "BaseConfig"`);
|
|
7417
|
-
await queryRunner.query(`CREATE INDEX "IDX_BaseConfig_type" ON "BaseConfig" ("type")`);
|
|
7418
|
-
await queryRunner.query(`INSERT INTO "BaseConfig"("id", "identifier", "redirect_url", "session_id", "client_id", "client_secret", "scopes", "issuer", "dangerously_allow_insecure_http_requests", "client_auth_method", "type", "connection_id") SELECT "id", "identifier", "redirect_url", "session_id", "client_id", "client_secret", "scopes", "issuer", "dangerously_allow_insecure_http_requests", "client_auth_method", "type", "connectionId" FROM "BaseConfigEntity"`);
|
|
7419
|
-
await queryRunner.query(`DROP TABLE "BaseConfigEntity"`);
|
|
7420
|
-
await queryRunner.query(`INSERT INTO "PartyType"(id, type, origin, name, description, tenant_id, created_at, last_updated_at) VALUES ('3875c12e-fdaa-4ef6-a340-c936e054b627', 'organization', 'INTERNAL', 'Sphereon_default_organization_type', 'sphereon_default_organization', '95e09cfc-c974-4174-86aa-7bf1d5251fb4', datetime('now'), datetime('now'))`);
|
|
7421
|
-
await queryRunner.query(`INSERT INTO "PartyType"(id, type, origin, name, description, tenant_id, created_at, last_updated_at) VALUES ('7d248798-41ca-4fc1-a130-9934b43d532e', 'naturalPerson', 'INTERNAL', 'Sphereon_default_natural_person_type', 'sphereon_default_natural_person', '95e09cfc-c974-4174-86aa-7bf1d5251fb4', datetime('now'), datetime('now'))`);
|
|
7422
|
-
await queryRunner.query(`INSERT INTO "Party"(id, uri, created_at, last_updated_at, party_type_id) SELECT id, uri, created_at, last_updated_at, '3875c12e-fdaa-4ef6-a340-c936e054b627' FROM "Contact"`);
|
|
7423
|
-
await queryRunner.query(`INSERT INTO "BaseContact"(id, legal_name, display_name, party_id, created_at, last_updated_at, type) SELECT id, name, alias, id, created_at, last_updated_at, 'Organization' FROM "Contact"`);
|
|
7424
|
-
await queryRunner.query(`DROP TABLE "Contact"`);
|
|
7526
|
+
await queryRunner.startTransaction();
|
|
7527
|
+
await queryRunner.query(`ALTER TYPE "StatusList_type_enum" ADD VALUE 'BitstringStatusList'`);
|
|
7528
|
+
await queryRunner.commitTransaction();
|
|
7425
7529
|
}
|
|
7530
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7426
7531
|
async down(queryRunner) {
|
|
7427
|
-
|
|
7428
|
-
|
|
7429
|
-
|
|
7430
|
-
|
|
7431
|
-
|
|
7432
|
-
|
|
7433
|
-
|
|
7434
|
-
|
|
7435
|
-
await queryRunner.query(`
|
|
7436
|
-
await queryRunner.query(`
|
|
7437
|
-
await queryRunner.query(`ALTER TABLE "
|
|
7438
|
-
await queryRunner.query(`DROP
|
|
7439
|
-
await queryRunner.query(`
|
|
7440
|
-
await queryRunner.query(`
|
|
7441
|
-
await queryRunner.query(`
|
|
7442
|
-
await queryRunner.query(`ALTER TABLE "
|
|
7443
|
-
await queryRunner.query(`
|
|
7444
|
-
await queryRunner.query(`
|
|
7445
|
-
|
|
7446
|
-
|
|
7447
|
-
await queryRunner.query(`
|
|
7448
|
-
await queryRunner.query(`ALTER TABLE "
|
|
7449
|
-
await queryRunner.query(`
|
|
7450
|
-
await queryRunner.query(`DROP
|
|
7451
|
-
await queryRunner.query(`
|
|
7452
|
-
await queryRunner.query(`
|
|
7453
|
-
await queryRunner.query(`
|
|
7454
|
-
await queryRunner.query(`ALTER TABLE "
|
|
7455
|
-
await queryRunner.query(`
|
|
7456
|
-
await queryRunner.query(`DROP
|
|
7457
|
-
await queryRunner.query(`
|
|
7458
|
-
await queryRunner.query(`
|
|
7459
|
-
await queryRunner.query(`DROP TABLE "Identity"`);
|
|
7460
|
-
await queryRunner.query(`DROP TABLE "CorrelationIdentifier"`);
|
|
7461
|
-
await queryRunner.query(`DROP TABLE "ElectronicAddress"`);
|
|
7462
|
-
await queryRunner.query(`DROP TABLE "PhysicalAddress"`);
|
|
7532
|
+
}
|
|
7533
|
+
};
|
|
7534
|
+
var CreateBitstringStatusListPG1741895823000 = class {
|
|
7535
|
+
static {
|
|
7536
|
+
__name(this, "CreateBitstringStatusListPG1741895823000");
|
|
7537
|
+
}
|
|
7538
|
+
name = "CreateBitstringStatusList1741895823000";
|
|
7539
|
+
async up(queryRunner) {
|
|
7540
|
+
await queryRunner.query(`ALTER TABLE "StatusList" ADD COLUMN "ttl" integer`);
|
|
7541
|
+
await queryRunner.query(`ALTER TABLE "StatusList" ADD COLUMN "validFrom" TIMESTAMP`);
|
|
7542
|
+
await queryRunner.query(`ALTER TABLE "StatusList" ADD COLUMN "validUntil" TIMESTAMP`);
|
|
7543
|
+
await queryRunner.query(`ALTER TABLE "StatusList" DROP CONSTRAINT IF EXISTS "CHK_StatusList_type"`);
|
|
7544
|
+
await queryRunner.query(`ALTER TABLE "StatusList" ADD CONSTRAINT "CHK_StatusList_type" CHECK ("type" IN ('StatusList2021', 'OAuthStatusList', 'BitstringStatusList'))`);
|
|
7545
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" ADD COLUMN "type" character varying NOT NULL DEFAULT 'StatusListEntryEntity'`);
|
|
7546
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" ADD COLUMN "statusPurpose" character varying`);
|
|
7547
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" ADD COLUMN "statusMessage" text`);
|
|
7548
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" ADD COLUMN "statusReference" text`);
|
|
7549
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" ADD CONSTRAINT "CHK_StatusListEntry_type" CHECK ("type" IN ('StatusListEntryEntity', 'bitstring'))`);
|
|
7550
|
+
}
|
|
7551
|
+
async down(queryRunner) {
|
|
7552
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" DROP CONSTRAINT "CHK_StatusListEntry_type"`);
|
|
7553
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" DROP COLUMN "statusReference"`);
|
|
7554
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" DROP COLUMN "statusMessage"`);
|
|
7555
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" DROP COLUMN "bitsPerStatus"`);
|
|
7556
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" DROP COLUMN "statusPurpose"`);
|
|
7557
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry" DROP COLUMN "type"`);
|
|
7558
|
+
await queryRunner.query(`ALTER TABLE "StatusList" DROP CONSTRAINT "CHK_StatusList_type"`);
|
|
7559
|
+
await queryRunner.query(`ALTER TABLE "StatusList" ADD CONSTRAINT "CHK_StatusList_type" CHECK ("type" IN ('StatusList2021', 'OAuthStatusList'))`);
|
|
7560
|
+
await queryRunner.query(`ALTER TABLE "StatusList" DROP COLUMN "validUntil"`);
|
|
7561
|
+
await queryRunner.query(`ALTER TABLE "StatusList" DROP COLUMN "validFrom"`);
|
|
7562
|
+
await queryRunner.query(`ALTER TABLE "StatusList" DROP COLUMN "ttl"`);
|
|
7563
|
+
await queryRunner.query(`ALTER TABLE "StatusList" DROP COLUMN "bitsPerStatus"`);
|
|
7463
7564
|
}
|
|
7464
7565
|
};
|
|
7465
7566
|
|
|
7466
|
-
// src/migrations/
|
|
7467
|
-
|
|
7468
|
-
var CreateContacts1690925872592 = class {
|
|
7567
|
+
// src/migrations/sqlite/1741895823001-CreateBitstringStatusList.ts
|
|
7568
|
+
var CreateBitstringStatusListSqlite1741895823001 = class {
|
|
7469
7569
|
static {
|
|
7470
|
-
__name(this, "
|
|
7570
|
+
__name(this, "CreateBitstringStatusListSqlite1741895823001");
|
|
7471
7571
|
}
|
|
7472
|
-
name = "
|
|
7572
|
+
name = "CreateBitstringStatusList1741895823000";
|
|
7473
7573
|
async up(queryRunner) {
|
|
7474
|
-
await
|
|
7475
|
-
|
|
7476
|
-
|
|
7477
|
-
|
|
7478
|
-
|
|
7479
|
-
|
|
7480
|
-
|
|
7481
|
-
|
|
7482
|
-
|
|
7483
|
-
|
|
7484
|
-
|
|
7485
|
-
|
|
7486
|
-
|
|
7487
|
-
|
|
7488
|
-
|
|
7489
|
-
|
|
7490
|
-
|
|
7491
|
-
|
|
7492
|
-
|
|
7493
|
-
|
|
7494
|
-
|
|
7495
|
-
await queryRunner.query(`
|
|
7496
|
-
|
|
7497
|
-
|
|
7498
|
-
|
|
7499
|
-
|
|
7500
|
-
|
|
7501
|
-
|
|
7502
|
-
|
|
7503
|
-
|
|
7504
|
-
|
|
7505
|
-
|
|
7506
|
-
|
|
7507
|
-
await queryRunner.query(`
|
|
7508
|
-
await queryRunner.query(`ALTER TABLE "
|
|
7509
|
-
await queryRunner.query(`
|
|
7510
|
-
|
|
7511
|
-
|
|
7512
|
-
|
|
7513
|
-
|
|
7514
|
-
|
|
7515
|
-
|
|
7516
|
-
|
|
7517
|
-
|
|
7518
|
-
|
|
7574
|
+
await queryRunner.query(`
|
|
7575
|
+
CREATE TABLE "temporary_StatusList" (
|
|
7576
|
+
"id" varchar PRIMARY KEY NOT NULL,
|
|
7577
|
+
"correlationId" varchar NOT NULL,
|
|
7578
|
+
"length" integer NOT NULL,
|
|
7579
|
+
"issuer" text NOT NULL,
|
|
7580
|
+
"type" varchar CHECK( "type" IN ('StatusList2021', 'OAuthStatusList', 'BitstringStatusList') ) NOT NULL DEFAULT ('StatusList2021'),
|
|
7581
|
+
"driverType" varchar CHECK( "driverType" IN ('agent_typeorm','agent_kv_store','github','agent_filesystem') ) NOT NULL DEFAULT ('agent_typeorm'),
|
|
7582
|
+
"credentialIdMode" varchar CHECK( "credentialIdMode" IN ('ISSUANCE','PERSISTENCE','NEVER') ) NOT NULL DEFAULT ('ISSUANCE'),
|
|
7583
|
+
"proofFormat" varchar CHECK( "proofFormat" IN ('lds','jwt', 'vc+jwt') ) NOT NULL DEFAULT ('lds'),
|
|
7584
|
+
"indexingDirection" varchar CHECK( "indexingDirection" IN ('rightToLeft') ),
|
|
7585
|
+
"statusPurpose" varchar,
|
|
7586
|
+
"statusListCredential" text,
|
|
7587
|
+
"expiresAt" datetime,
|
|
7588
|
+
"bitsPerStatus" integer DEFAULT (1),
|
|
7589
|
+
"ttl" integer,
|
|
7590
|
+
"validFrom" datetime,
|
|
7591
|
+
"validUntil" datetime,
|
|
7592
|
+
CONSTRAINT "UQ_correlationId" UNIQUE ("correlationId")
|
|
7593
|
+
)
|
|
7594
|
+
`);
|
|
7595
|
+
await queryRunner.query(`
|
|
7596
|
+
INSERT INTO "temporary_StatusList"(
|
|
7597
|
+
"id", "correlationId", "length", "issuer", "type", "driverType",
|
|
7598
|
+
"credentialIdMode", "proofFormat", "indexingDirection", "statusPurpose",
|
|
7599
|
+
"statusListCredential", "bitsPerStatus", "expiresAt"
|
|
7600
|
+
)
|
|
7601
|
+
SELECT
|
|
7602
|
+
"id", "correlationId", "length", "issuer", "type", "driverType",
|
|
7603
|
+
"credentialIdMode", "proofFormat", "indexingDirection", "statusPurpose",
|
|
7604
|
+
"statusListCredential", "bitsPerStatus", "expiresAt"
|
|
7605
|
+
FROM "StatusList"
|
|
7606
|
+
`);
|
|
7607
|
+
await queryRunner.query(`DROP TABLE "StatusList"`);
|
|
7608
|
+
await queryRunner.query(`ALTER TABLE "temporary_StatusList" RENAME TO "StatusList"`);
|
|
7609
|
+
await queryRunner.query(`
|
|
7610
|
+
CREATE TABLE "temporary_StatusListEntry" (
|
|
7611
|
+
"statusListId" varchar NOT NULL,
|
|
7612
|
+
"statusListIndex" integer NOT NULL,
|
|
7613
|
+
"credentialId" text,
|
|
7614
|
+
"credentialHash" varchar(128),
|
|
7615
|
+
"correlationId" varchar(255),
|
|
7616
|
+
"value" varchar(50),
|
|
7617
|
+
"type" varchar CHECK( "type" IN ('StatusListEntryEntity', 'bitstring') ) NOT NULL DEFAULT ('StatusListEntryEntity'),
|
|
7618
|
+
"statusPurpose" varchar,
|
|
7619
|
+
"bitsPerStatus" integer DEFAULT (1),
|
|
7620
|
+
"statusMessage" text,
|
|
7621
|
+
"statusReference" text,
|
|
7622
|
+
PRIMARY KEY ("statusListId", "statusListIndex")
|
|
7623
|
+
)
|
|
7624
|
+
`);
|
|
7625
|
+
await queryRunner.query(`
|
|
7626
|
+
INSERT INTO "temporary_StatusListEntry"(
|
|
7627
|
+
"statusListId", "statusListIndex", "credentialId", "credentialHash",
|
|
7628
|
+
"correlationId", "value", "type"
|
|
7629
|
+
)
|
|
7630
|
+
SELECT
|
|
7631
|
+
"statusListId", "statusListIndex", "credentialId", "credentialHash",
|
|
7632
|
+
"correlationId", "value", 'StatusListEntryEntity'
|
|
7633
|
+
FROM "StatusListEntry"
|
|
7634
|
+
`);
|
|
7635
|
+
await queryRunner.query(`DROP TABLE "StatusListEntry"`);
|
|
7636
|
+
await queryRunner.query(`ALTER TABLE "temporary_StatusListEntry" RENAME TO "StatusListEntry"`);
|
|
7519
7637
|
}
|
|
7520
7638
|
async down(queryRunner) {
|
|
7521
|
-
await queryRunner.query(`
|
|
7522
|
-
|
|
7523
|
-
|
|
7524
|
-
|
|
7525
|
-
|
|
7526
|
-
|
|
7527
|
-
|
|
7528
|
-
|
|
7529
|
-
|
|
7530
|
-
|
|
7531
|
-
|
|
7532
|
-
await queryRunner.query(`
|
|
7533
|
-
|
|
7534
|
-
|
|
7535
|
-
|
|
7536
|
-
|
|
7537
|
-
|
|
7538
|
-
|
|
7539
|
-
|
|
7540
|
-
|
|
7541
|
-
|
|
7542
|
-
|
|
7543
|
-
await queryRunner.query(`DROP
|
|
7544
|
-
await queryRunner.query(`
|
|
7545
|
-
await queryRunner.query(`
|
|
7546
|
-
|
|
7547
|
-
|
|
7548
|
-
|
|
7549
|
-
|
|
7550
|
-
|
|
7551
|
-
|
|
7552
|
-
|
|
7553
|
-
|
|
7554
|
-
|
|
7555
|
-
|
|
7556
|
-
|
|
7639
|
+
await queryRunner.query(`
|
|
7640
|
+
CREATE TABLE "temporary_StatusListEntry" (
|
|
7641
|
+
"statusListId" varchar NOT NULL,
|
|
7642
|
+
"statusListIndex" integer NOT NULL,
|
|
7643
|
+
"credentialId" text,
|
|
7644
|
+
"credentialHash" varchar(128),
|
|
7645
|
+
"correlationId" varchar(255),
|
|
7646
|
+
"value" varchar(50),
|
|
7647
|
+
PRIMARY KEY ("statusListId", "statusListIndex")
|
|
7648
|
+
)
|
|
7649
|
+
`);
|
|
7650
|
+
await queryRunner.query(`
|
|
7651
|
+
INSERT INTO "temporary_StatusListEntry"(
|
|
7652
|
+
"statusListId", "statusListIndex", "credentialId", "credentialHash",
|
|
7653
|
+
"correlationId", "value"
|
|
7654
|
+
)
|
|
7655
|
+
SELECT
|
|
7656
|
+
"statusListId", "statusListIndex", "credentialId", "credentialHash",
|
|
7657
|
+
"correlationId", "value"
|
|
7658
|
+
FROM "StatusListEntry"
|
|
7659
|
+
WHERE "type" = 'StatusListEntryEntity'
|
|
7660
|
+
`);
|
|
7661
|
+
await queryRunner.query(`DROP TABLE "StatusListEntry"`);
|
|
7662
|
+
await queryRunner.query(`ALTER TABLE "temporary_StatusListEntry" RENAME TO "StatusListEntry"`);
|
|
7663
|
+
await queryRunner.query(`
|
|
7664
|
+
CREATE TABLE "temporary_StatusList" (
|
|
7665
|
+
"id" varchar PRIMARY KEY NOT NULL,
|
|
7666
|
+
"correlationId" varchar NOT NULL,
|
|
7667
|
+
"length" integer NOT NULL,
|
|
7668
|
+
"issuer" text NOT NULL,
|
|
7669
|
+
"type" varchar CHECK( "type" IN ('StatusList2021', 'OAuthStatusList') ) NOT NULL DEFAULT ('StatusList2021'),
|
|
7670
|
+
"driverType" varchar CHECK( "driverType" IN ('agent_typeorm','agent_kv_store','github','agent_filesystem') ) NOT NULL DEFAULT ('agent_typeorm'),
|
|
7671
|
+
"credentialIdMode" varchar CHECK( "credentialIdMode" IN ('ISSUANCE','PERSISTENCE','NEVER') ) NOT NULL DEFAULT ('ISSUANCE'),
|
|
7672
|
+
"proofFormat" varchar CHECK( "proofFormat" IN ('lds','jwt', 'vc+jwt') ) NOT NULL DEFAULT ('lds'),
|
|
7673
|
+
"indexingDirection" varchar CHECK( "indexingDirection" IN ('rightToLeft') ),
|
|
7674
|
+
"statusPurpose" varchar,
|
|
7675
|
+
"statusListCredential" text,
|
|
7676
|
+
"bitsPerStatus" integer,
|
|
7677
|
+
"expiresAt" datetime,
|
|
7678
|
+
CONSTRAINT "UQ_correlationId" UNIQUE ("correlationId")
|
|
7679
|
+
)
|
|
7680
|
+
`);
|
|
7681
|
+
await queryRunner.query(`
|
|
7682
|
+
INSERT INTO "temporary_StatusList"(
|
|
7683
|
+
"id", "correlationId", "length", "issuer", "type", "driverType",
|
|
7684
|
+
"credentialIdMode", "proofFormat", "indexingDirection", "statusPurpose",
|
|
7685
|
+
"statusListCredential", "bitsPerStatus", "expiresAt"
|
|
7686
|
+
)
|
|
7687
|
+
SELECT
|
|
7688
|
+
"id", "correlationId", "length", "issuer",
|
|
7689
|
+
CASE WHEN "type" = 'BitstringStatusList' THEN 'StatusList2021' ELSE "type" END,
|
|
7690
|
+
"driverType", "credentialIdMode", "proofFormat", "indexingDirection",
|
|
7691
|
+
"statusPurpose", "statusListCredential", "bitsPerStatus", "expiresAt"
|
|
7692
|
+
FROM "StatusList"
|
|
7693
|
+
`);
|
|
7694
|
+
await queryRunner.query(`DROP TABLE "StatusList"`);
|
|
7695
|
+
await queryRunner.query(`ALTER TABLE "temporary_StatusList" RENAME TO "StatusList"`);
|
|
7557
7696
|
}
|
|
7558
7697
|
};
|
|
7559
7698
|
|
|
7560
|
-
// src/migrations/generic/
|
|
7561
|
-
var
|
|
7562
|
-
var
|
|
7699
|
+
// src/migrations/generic/12-CreateBitstringStatusList.ts
|
|
7700
|
+
var debug11 = Debug11("sphereon:ssi-sdk:migrations");
|
|
7701
|
+
var AddBitstringStatusListEnum1741895823000 = class {
|
|
7702
|
+
static {
|
|
7703
|
+
__name(this, "AddBitstringStatusListEnum1741895823000");
|
|
7704
|
+
}
|
|
7705
|
+
name = "AddBitstringStatusListEnum1741895823000";
|
|
7706
|
+
async up(queryRunner) {
|
|
7707
|
+
debug11("migration: creating bitstring status list tables");
|
|
7708
|
+
const dbType = queryRunner.connection.driver.options.type;
|
|
7709
|
+
switch (dbType) {
|
|
7710
|
+
case "postgres": {
|
|
7711
|
+
const mig = new AddBitstringStatusListEnumPG1741895823000();
|
|
7712
|
+
await mig.up(queryRunner);
|
|
7713
|
+
return;
|
|
7714
|
+
}
|
|
7715
|
+
case "sqlite":
|
|
7716
|
+
case "expo":
|
|
7717
|
+
case "react-native": {
|
|
7718
|
+
return;
|
|
7719
|
+
}
|
|
7720
|
+
default:
|
|
7721
|
+
return Promise.reject(`Migrations only supported for sqlite and postgres. Was ${dbType}`);
|
|
7722
|
+
}
|
|
7723
|
+
}
|
|
7724
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7725
|
+
async down(queryRunner) {
|
|
7726
|
+
}
|
|
7727
|
+
};
|
|
7728
|
+
var CreateBitstringStatusList1741895823000 = class {
|
|
7563
7729
|
static {
|
|
7564
|
-
__name(this, "
|
|
7730
|
+
__name(this, "CreateBitstringStatusList1741895823000");
|
|
7565
7731
|
}
|
|
7566
|
-
name = "
|
|
7732
|
+
name = "CreateBitstringStatusList1741895823000";
|
|
7567
7733
|
async up(queryRunner) {
|
|
7568
|
-
|
|
7734
|
+
debug11("migration: creating bitstring status list tables");
|
|
7569
7735
|
const dbType = queryRunner.connection.driver.options.type;
|
|
7570
7736
|
switch (dbType) {
|
|
7571
7737
|
case "postgres": {
|
|
7572
|
-
|
|
7573
|
-
const mig = new CreateContacts1690925872592();
|
|
7738
|
+
const mig = new CreateBitstringStatusListPG1741895823000();
|
|
7574
7739
|
await mig.up(queryRunner);
|
|
7575
|
-
debug10("Migration statements executed");
|
|
7576
7740
|
return;
|
|
7577
7741
|
}
|
|
7578
7742
|
case "sqlite":
|
|
7579
7743
|
case "expo":
|
|
7580
7744
|
case "react-native": {
|
|
7581
|
-
|
|
7582
|
-
const mig = new CreateContacts1690925872693();
|
|
7745
|
+
const mig = new CreateBitstringStatusListSqlite1741895823001();
|
|
7583
7746
|
await mig.up(queryRunner);
|
|
7584
|
-
debug10("Migration statements executed");
|
|
7585
7747
|
return;
|
|
7586
7748
|
}
|
|
7587
7749
|
default:
|
|
7588
|
-
return Promise.reject(`Migrations
|
|
7750
|
+
return Promise.reject(`Migrations only supported for sqlite and postgres. Was ${dbType}`);
|
|
7589
7751
|
}
|
|
7590
7752
|
}
|
|
7591
7753
|
async down(queryRunner) {
|
|
7592
|
-
|
|
7754
|
+
debug11("migration: dropping bitstring status list tables");
|
|
7593
7755
|
const dbType = queryRunner.connection.driver.options.type;
|
|
7594
7756
|
switch (dbType) {
|
|
7595
7757
|
case "postgres": {
|
|
7596
|
-
|
|
7597
|
-
const mig = new CreateContacts1690925872592();
|
|
7758
|
+
const mig = new CreateBitstringStatusListPG1741895823000();
|
|
7598
7759
|
await mig.down(queryRunner);
|
|
7599
|
-
debug10("Migration statements executed");
|
|
7600
7760
|
return;
|
|
7601
7761
|
}
|
|
7602
7762
|
case "sqlite":
|
|
7603
7763
|
case "expo":
|
|
7604
7764
|
case "react-native": {
|
|
7605
|
-
|
|
7606
|
-
const mig = new CreateContacts1690925872693();
|
|
7765
|
+
const mig = new CreateBitstringStatusListSqlite1741895823001();
|
|
7607
7766
|
await mig.down(queryRunner);
|
|
7608
|
-
debug10("Migration statements executed");
|
|
7609
7767
|
return;
|
|
7610
7768
|
}
|
|
7611
7769
|
default:
|
|
7612
|
-
return Promise.reject(`Migrations
|
|
7770
|
+
return Promise.reject(`Migrations only supported for sqlite and postgres. Was ${dbType}`);
|
|
7613
7771
|
}
|
|
7614
7772
|
}
|
|
7615
7773
|
};
|
|
7616
7774
|
|
|
7617
|
-
// src/migrations/generic/
|
|
7618
|
-
import
|
|
7619
|
-
|
|
7620
|
-
// src/migrations/postgres/1693866470001-CreateStatusList.ts
|
|
7621
|
-
var CreateStatusList1693866470001 = class {
|
|
7622
|
-
static {
|
|
7623
|
-
__name(this, "CreateStatusList1693866470001");
|
|
7624
|
-
}
|
|
7625
|
-
name = "CreateStatusList1693866470001";
|
|
7626
|
-
async up(queryRunner) {
|
|
7627
|
-
await queryRunner.query(`CREATE TYPE "StatusList_type_enum" AS ENUM('StatusList2021')`);
|
|
7628
|
-
await queryRunner.query(`CREATE TYPE "StatusList_drivertype_enum" AS ENUM('agent_typeorm', 'agent_kv_store', 'github', 'agent_filesystem')`);
|
|
7629
|
-
await queryRunner.query(`CREATE TYPE "StatusList_credentialidmode_enum" AS ENUM('ISSUANCE', 'PERSISTENCE', 'NEVER')`);
|
|
7630
|
-
await queryRunner.query(`CREATE TABLE "StatusListEntry"
|
|
7631
|
-
(
|
|
7632
|
-
"statusListId" character varying NOT NULL,
|
|
7633
|
-
"statusListIndex" integer NOT NULL,
|
|
7634
|
-
"credentialId" character varying,
|
|
7635
|
-
"credentialHash" character varying(128),
|
|
7636
|
-
"correlationId" character varying(255),
|
|
7637
|
-
"value" character varying(50),
|
|
7638
|
-
CONSTRAINT "PK_68704d2d13857360c6b44a3d1d0" PRIMARY KEY ("statusListId", "statusListIndex")
|
|
7639
|
-
)`);
|
|
7640
|
-
await queryRunner.query(`CREATE TABLE "StatusList"
|
|
7641
|
-
(
|
|
7642
|
-
"id" character varying NOT NULL,
|
|
7643
|
-
"correlationId" character varying NOT NULL,
|
|
7644
|
-
"length" integer NOT NULL,
|
|
7645
|
-
"issuer" text NOT NULL,
|
|
7646
|
-
"type" "StatusList_type_enum" NOT NULL DEFAULT 'StatusList2021',
|
|
7647
|
-
"driverType" "StatusList_drivertype_enum" NOT NULL DEFAULT 'agent_typeorm',
|
|
7648
|
-
"credentialIdMode" "StatusList_credentialidmode_enum" NOT NULL DEFAULT 'ISSUANCE',
|
|
7649
|
-
"proofFormat" character varying NOT NULL DEFAULT 'lds',
|
|
7650
|
-
"indexingDirection" character varying NOT NULL DEFAULT 'rightToLeft',
|
|
7651
|
-
"statusPurpose" character varying NOT NULL DEFAULT 'revocation',
|
|
7652
|
-
"statusListCredential" text,
|
|
7653
|
-
CONSTRAINT "UQ_correlationId" UNIQUE ("correlationId"),
|
|
7654
|
-
CONSTRAINT "PK_StatusList_Id" PRIMARY KEY ("id")
|
|
7655
|
-
)`);
|
|
7656
|
-
await queryRunner.query(`ALTER TABLE "StatusListEntry"
|
|
7657
|
-
ADD CONSTRAINT "FK_statusListEntry_statusListId" FOREIGN KEY ("statusListId") REFERENCES "StatusList" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
7658
|
-
}
|
|
7659
|
-
async down(queryRunner) {
|
|
7660
|
-
await queryRunner.query(`ALTER TABLE "StatusListEntry"
|
|
7661
|
-
DROP CONSTRAINT "FK_statusListEntry_statusListId"`);
|
|
7662
|
-
await queryRunner.query(`DROP TABLE "StatusListEntry"`);
|
|
7663
|
-
await queryRunner.query(`DROP TABLE "StatusList"`);
|
|
7664
|
-
await queryRunner.query(`DROP TYPE "StatusList_credentialidmode_enum"`);
|
|
7665
|
-
await queryRunner.query(`DROP TYPE "StatusList_drivertype_enum"`);
|
|
7666
|
-
await queryRunner.query(`DROP TYPE "StatusList_type_enum"`);
|
|
7667
|
-
}
|
|
7668
|
-
};
|
|
7775
|
+
// src/migrations/generic/13-CreateDcqlQueryItem.ts
|
|
7776
|
+
import Debug12 from "debug";
|
|
7669
7777
|
|
|
7670
|
-
// src/migrations/
|
|
7671
|
-
var
|
|
7778
|
+
// src/migrations/postgres/1726588800000-CreateDcqlQueryItem.ts
|
|
7779
|
+
var CreateDcqlQueryItemPG1726588800000 = class {
|
|
7672
7780
|
static {
|
|
7673
|
-
__name(this, "
|
|
7781
|
+
__name(this, "CreateDcqlQueryItemPG1726588800000");
|
|
7674
7782
|
}
|
|
7675
|
-
name = "
|
|
7783
|
+
name = "CreateDcqlQueryItemPG1726588800000";
|
|
7676
7784
|
async up(queryRunner) {
|
|
7677
|
-
await queryRunner.query(`
|
|
7678
|
-
|
|
7679
|
-
|
|
7680
|
-
|
|
7681
|
-
|
|
7682
|
-
|
|
7683
|
-
|
|
7684
|
-
|
|
7685
|
-
|
|
7686
|
-
|
|
7687
|
-
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
"correlationId" varchar NOT NULL,
|
|
7691
|
-
"length" integer NOT NULL,
|
|
7692
|
-
"issuer" text NOT NULL,
|
|
7693
|
-
"type" varchar CHECK ( "type" IN ('StatusList2021') ) NOT NULL DEFAULT ('StatusList2021'),
|
|
7694
|
-
"driverType" varchar CHECK ( "driverType" IN ('agent_typeorm', 'agent_kv_store', 'github',
|
|
7695
|
-
'agent_filesystem') ) NOT NULL DEFAULT ('agent_typeorm'),
|
|
7696
|
-
"credentialIdMode" varchar CHECK ( "credentialIdMode" IN ('ISSUANCE', 'PERSISTENCE', 'NEVER') ) NOT NULL DEFAULT ('ISSUANCE'),
|
|
7697
|
-
"proofFormat" varchar CHECK ( "proofFormat" IN ('lds', 'jwt') ) NOT NULL DEFAULT ('lds'),
|
|
7698
|
-
"indexingDirection" varchar CHECK ( "indexingDirection" IN ('rightToLeft') ) NOT NULL DEFAULT ('rightToLeft'),
|
|
7699
|
-
"statusPurpose" varchar NOT NULL DEFAULT ('revocation'),
|
|
7700
|
-
"statusListCredential" text,
|
|
7701
|
-
CONSTRAINT "UQ_correlationId" UNIQUE ("correlationId")
|
|
7702
|
-
)`);
|
|
7703
|
-
await queryRunner.query(`CREATE TABLE "temporary_StatusListEntry"
|
|
7704
|
-
(
|
|
7705
|
-
"statusListId" varchar NOT NULL,
|
|
7706
|
-
"statusListIndex" integer NOT NULL,
|
|
7707
|
-
"credentialId" varchar,
|
|
7708
|
-
"credentialHash" varchar(128),
|
|
7709
|
-
"correlationId" varchar(255),
|
|
7710
|
-
"value" varchar(50),
|
|
7711
|
-
CONSTRAINT "FK_statusListEntry_statusListId" FOREIGN KEY ("statusListId") REFERENCES "StatusList" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
|
|
7712
|
-
PRIMARY KEY ("statusListId", "statusListIndex")
|
|
7713
|
-
)`);
|
|
7714
|
-
await queryRunner.query(`INSERT INTO "temporary_StatusListEntry"("statusListId", "statusListIndex", "credentialId",
|
|
7715
|
-
"credentialHash", "correlationId", "value")
|
|
7716
|
-
SELECT "statusListId", "statusListIndex", "credentialId", "credentialHash", "correlationId", "value"
|
|
7717
|
-
FROM "StatusListEntry"`);
|
|
7718
|
-
await queryRunner.query(`DROP TABLE "StatusListEntry"`);
|
|
7719
|
-
await queryRunner.query(`ALTER TABLE "temporary_StatusListEntry" RENAME TO "StatusListEntry"`);
|
|
7785
|
+
await queryRunner.query(`
|
|
7786
|
+
CREATE TABLE "DcqlQueryItem" (
|
|
7787
|
+
"id" uuid NOT NULL DEFAULT uuid_generate_v4(),
|
|
7788
|
+
"tenant_id" TEXT,
|
|
7789
|
+
"query_id" TEXT NOT NULL,
|
|
7790
|
+
"name" TEXT,
|
|
7791
|
+
"version" TEXT NOT NULL,
|
|
7792
|
+
"purpose" TEXT,
|
|
7793
|
+
"query" TEXT NOT NULL,
|
|
7794
|
+
"created_at" TIMESTAMP NOT NULL DEFAULT now(),
|
|
7795
|
+
"last_updated_at" TIMESTAMP NOT NULL DEFAULT now(),
|
|
7796
|
+
CONSTRAINT "PK_DcqlQueryItem_id" PRIMARY KEY ("id"))
|
|
7797
|
+
`);
|
|
7720
7798
|
}
|
|
7721
7799
|
async down(queryRunner) {
|
|
7722
|
-
await queryRunner.query(`DROP TABLE "
|
|
7723
|
-
await queryRunner.query(`DROP TABLE "StatusList"`);
|
|
7800
|
+
await queryRunner.query(`DROP TABLE "DcqlQueryItem"`);
|
|
7724
7801
|
}
|
|
7725
7802
|
};
|
|
7726
7803
|
|
|
7727
|
-
// src/migrations/
|
|
7728
|
-
var
|
|
7804
|
+
// src/migrations/sqlite/1726617600000-CreateDcqlQueryItem.ts
|
|
7805
|
+
var CreateDcqlQueryItemSQlite1726617600000 = class {
|
|
7729
7806
|
static {
|
|
7730
|
-
__name(this, "
|
|
7807
|
+
__name(this, "CreateDcqlQueryItemSQlite1726617600000");
|
|
7731
7808
|
}
|
|
7732
|
-
name = "
|
|
7809
|
+
name = "CreateDcqlQueryItemSQlite1726617600000";
|
|
7733
7810
|
async up(queryRunner) {
|
|
7734
|
-
await queryRunner.query(`
|
|
7735
|
-
|
|
7736
|
-
|
|
7737
|
-
|
|
7738
|
-
|
|
7811
|
+
await queryRunner.query(`CREATE TABLE "DcqlQueryItem" (
|
|
7812
|
+
"id" varchar PRIMARY KEY NOT NULL,
|
|
7813
|
+
"tenant_id" varchar,
|
|
7814
|
+
"query_id" varchar NOT NULL,
|
|
7815
|
+
"name" varchar,
|
|
7816
|
+
"version" varchar NOT NULL,
|
|
7817
|
+
"purpose" varchar,
|
|
7818
|
+
"query" varchar NOT NULL,
|
|
7819
|
+
"created_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
7820
|
+
"last_updated_at" datetime NOT NULL DEFAULT (datetime('now')))`);
|
|
7739
7821
|
}
|
|
7740
7822
|
async down(queryRunner) {
|
|
7741
|
-
await queryRunner.query(`
|
|
7742
|
-
await queryRunner.query(`ALTER TABLE "StatusList" DROP COLUMN "bitsPerStatus"`);
|
|
7743
|
-
await queryRunner.query(`ALTER TABLE "StatusList" ALTER COLUMN "statusPurpose" SET NOT NULL`);
|
|
7744
|
-
await queryRunner.query(`ALTER TABLE "StatusList" ALTER COLUMN "indexingDirection" SET NOT NULL`);
|
|
7823
|
+
await queryRunner.query(`DROP TABLE "DcqlQueryItem"`);
|
|
7745
7824
|
}
|
|
7746
7825
|
};
|
|
7747
7826
|
|
|
7748
|
-
// src/migrations/
|
|
7749
|
-
var
|
|
7827
|
+
// src/migrations/generic/13-CreateDcqlQueryItem.ts
|
|
7828
|
+
var debug12 = Debug12("sphereon:ssi-sdk:migrations");
|
|
7829
|
+
var CreateDcqlQueryItem1726617600000 = class {
|
|
7750
7830
|
static {
|
|
7751
|
-
__name(this, "
|
|
7831
|
+
__name(this, "CreateDcqlQueryItem1726617600000");
|
|
7752
7832
|
}
|
|
7753
|
-
name = "
|
|
7833
|
+
name = "CreateDcqlQueryItem1726617600000";
|
|
7754
7834
|
async up(queryRunner) {
|
|
7755
|
-
|
|
7756
|
-
|
|
7757
|
-
|
|
7758
|
-
|
|
7759
|
-
|
|
7760
|
-
|
|
7761
|
-
|
|
7762
|
-
|
|
7763
|
-
|
|
7764
|
-
|
|
7765
|
-
|
|
7766
|
-
|
|
7767
|
-
|
|
7768
|
-
|
|
7769
|
-
|
|
7770
|
-
|
|
7771
|
-
|
|
7772
|
-
|
|
7773
|
-
|
|
7774
|
-
|
|
7775
|
-
|
|
7776
|
-
|
|
7777
|
-
"id", "correlationId", "length", "issuer", "type", "driverType",
|
|
7778
|
-
"credentialIdMode", "proofFormat", "indexingDirection", "statusPurpose",
|
|
7779
|
-
"statusListCredential"
|
|
7780
|
-
FROM "StatusList"`);
|
|
7781
|
-
await queryRunner.query(`DROP TABLE "StatusList"`);
|
|
7782
|
-
await queryRunner.query(`ALTER TABLE "temporary_StatusList" RENAME TO "StatusList"`);
|
|
7835
|
+
debug12("migration: updating presentation definition item nullable fields");
|
|
7836
|
+
const dbType = queryRunner.connection.driver.options.type;
|
|
7837
|
+
switch (dbType) {
|
|
7838
|
+
case "postgres": {
|
|
7839
|
+
debug12("using postgres migration file");
|
|
7840
|
+
const mig = new CreateDcqlQueryItemPG1726588800000();
|
|
7841
|
+
await mig.up(queryRunner);
|
|
7842
|
+
debug12("Migration statements executed");
|
|
7843
|
+
return;
|
|
7844
|
+
}
|
|
7845
|
+
case "sqlite":
|
|
7846
|
+
case "expo":
|
|
7847
|
+
case "react-native": {
|
|
7848
|
+
debug12("using sqlite/react-native migration file");
|
|
7849
|
+
const mig = new CreateDcqlQueryItemSQlite1726617600000();
|
|
7850
|
+
await mig.up(queryRunner);
|
|
7851
|
+
debug12("Migration statements executed");
|
|
7852
|
+
return;
|
|
7853
|
+
}
|
|
7854
|
+
default:
|
|
7855
|
+
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`);
|
|
7856
|
+
}
|
|
7783
7857
|
}
|
|
7784
7858
|
async down(queryRunner) {
|
|
7785
|
-
|
|
7786
|
-
|
|
7787
|
-
|
|
7788
|
-
|
|
7789
|
-
|
|
7790
|
-
|
|
7791
|
-
|
|
7792
|
-
|
|
7793
|
-
|
|
7794
|
-
|
|
7795
|
-
|
|
7796
|
-
|
|
7797
|
-
|
|
7798
|
-
|
|
7799
|
-
|
|
7800
|
-
|
|
7801
|
-
|
|
7802
|
-
|
|
7803
|
-
|
|
7804
|
-
|
|
7805
|
-
|
|
7806
|
-
|
|
7807
|
-
await queryRunner.query(`INSERT INTO "temporary_StatusList"(
|
|
7808
|
-
"id", "correlationId", "length", "issuer", "type", "driverType",
|
|
7809
|
-
"credentialIdMode", "proofFormat", "indexingDirection", "statusPurpose",
|
|
7810
|
-
"statusListCredential"
|
|
7811
|
-
)
|
|
7812
|
-
SELECT
|
|
7813
|
-
"id", "correlationId", "length", "issuer",
|
|
7814
|
-
CASE WHEN "type" = 'OAuthStatusList' THEN 'StatusList2021' ELSE "type" END,
|
|
7815
|
-
"driverType", "credentialIdMode", "proofFormat", "indexingDirection",
|
|
7816
|
-
COALESCE("statusPurpose", 'revocation'), "statusListCredential"
|
|
7817
|
-
FROM "StatusList"`);
|
|
7818
|
-
await queryRunner.query(`DROP TABLE "StatusList"`);
|
|
7819
|
-
await queryRunner.query(`ALTER TABLE "temporary_StatusList" RENAME TO "StatusList"`);
|
|
7859
|
+
debug12("migration: reverting presentation definition item nullable fields");
|
|
7860
|
+
const dbType = queryRunner.connection.driver.options.type;
|
|
7861
|
+
switch (dbType) {
|
|
7862
|
+
case "postgres": {
|
|
7863
|
+
debug12("using postgres migration file");
|
|
7864
|
+
const mig = new CreateDcqlQueryItemPG1726588800000();
|
|
7865
|
+
await mig.down(queryRunner);
|
|
7866
|
+
debug12("Migration statements executed");
|
|
7867
|
+
return;
|
|
7868
|
+
}
|
|
7869
|
+
case "sqlite":
|
|
7870
|
+
case "expo":
|
|
7871
|
+
case "react-native": {
|
|
7872
|
+
debug12("using sqlite/react-native migration file");
|
|
7873
|
+
const mig = new CreateDcqlQueryItemSQlite1726617600000();
|
|
7874
|
+
await mig.down(queryRunner);
|
|
7875
|
+
debug12("Migration statements executed");
|
|
7876
|
+
return;
|
|
7877
|
+
}
|
|
7878
|
+
default:
|
|
7879
|
+
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`);
|
|
7880
|
+
}
|
|
7820
7881
|
}
|
|
7821
7882
|
};
|
|
7822
7883
|
|
|
7823
|
-
// src/migrations/generic/
|
|
7824
|
-
|
|
7825
|
-
var
|
|
7884
|
+
// src/migrations/generic/2-CreateIssuanceBranding.ts
|
|
7885
|
+
import Debug13 from "debug";
|
|
7886
|
+
var debug13 = Debug13("sphereon:ssi-sdk:migrations");
|
|
7887
|
+
var CreateIssuanceBranding1659463079429 = class {
|
|
7826
7888
|
static {
|
|
7827
|
-
__name(this, "
|
|
7889
|
+
__name(this, "CreateIssuanceBranding1659463079429");
|
|
7828
7890
|
}
|
|
7829
|
-
name = "
|
|
7891
|
+
name = "CreateIssuanceBranding1659463079429";
|
|
7830
7892
|
async up(queryRunner) {
|
|
7831
|
-
|
|
7893
|
+
debug13("migration: creating issuance branding tables");
|
|
7832
7894
|
const dbType = queryRunner.connection.driver.options.type;
|
|
7833
|
-
|
|
7834
|
-
|
|
7835
|
-
|
|
7836
|
-
|
|
7837
|
-
|
|
7838
|
-
|
|
7839
|
-
|
|
7840
|
-
|
|
7841
|
-
|
|
7842
|
-
|
|
7843
|
-
|
|
7844
|
-
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
|
|
7849
|
-
|
|
7850
|
-
|
|
7895
|
+
switch (dbType) {
|
|
7896
|
+
case "postgres": {
|
|
7897
|
+
debug13("using postgres migration file");
|
|
7898
|
+
const mig = new CreateIssuanceBranding1685628974232();
|
|
7899
|
+
await mig.up(queryRunner);
|
|
7900
|
+
debug13("Migration statements executed");
|
|
7901
|
+
return;
|
|
7902
|
+
}
|
|
7903
|
+
case "sqlite":
|
|
7904
|
+
case "expo":
|
|
7905
|
+
case "react-native": {
|
|
7906
|
+
debug13("using sqlite/react-native migration file");
|
|
7907
|
+
const mig = new CreateIssuanceBranding1685628973231();
|
|
7908
|
+
await mig.up(queryRunner);
|
|
7909
|
+
debug13("Migration statements executed");
|
|
7910
|
+
return;
|
|
7911
|
+
}
|
|
7912
|
+
default:
|
|
7913
|
+
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`);
|
|
7851
7914
|
}
|
|
7852
7915
|
}
|
|
7853
7916
|
async down(queryRunner) {
|
|
7854
|
-
|
|
7917
|
+
debug13("migration: reverting issuance branding tables");
|
|
7855
7918
|
const dbType = queryRunner.connection.driver.options.type;
|
|
7856
|
-
|
|
7857
|
-
|
|
7858
|
-
|
|
7859
|
-
|
|
7860
|
-
|
|
7861
|
-
|
|
7862
|
-
|
|
7863
|
-
|
|
7864
|
-
|
|
7865
|
-
|
|
7866
|
-
|
|
7867
|
-
|
|
7868
|
-
|
|
7869
|
-
|
|
7870
|
-
|
|
7871
|
-
|
|
7872
|
-
|
|
7873
|
-
|
|
7919
|
+
switch (dbType) {
|
|
7920
|
+
case "postgres": {
|
|
7921
|
+
debug13("using postgres migration file");
|
|
7922
|
+
const mig = new CreateIssuanceBranding1685628974232();
|
|
7923
|
+
await mig.down(queryRunner);
|
|
7924
|
+
debug13("Migration statements executed");
|
|
7925
|
+
return;
|
|
7926
|
+
}
|
|
7927
|
+
case "sqlite":
|
|
7928
|
+
case "expo":
|
|
7929
|
+
case "react-native": {
|
|
7930
|
+
debug13("using sqlite/react-native migration file");
|
|
7931
|
+
const mig = new CreateIssuanceBranding1685628973231();
|
|
7932
|
+
await mig.down(queryRunner);
|
|
7933
|
+
debug13("Migration statements executed");
|
|
7934
|
+
return;
|
|
7935
|
+
}
|
|
7936
|
+
default:
|
|
7937
|
+
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`);
|
|
7874
7938
|
}
|
|
7875
7939
|
}
|
|
7876
7940
|
};
|
|
7877
7941
|
|
|
7878
|
-
// src/migrations/generic/
|
|
7879
|
-
import
|
|
7942
|
+
// src/migrations/generic/3-CreateContacts.ts
|
|
7943
|
+
import Debug14 from "debug";
|
|
7880
7944
|
|
|
7881
|
-
// src/migrations/sqlite/
|
|
7882
|
-
var
|
|
7945
|
+
// src/migrations/sqlite/1690925872693-CreateContacts.ts
|
|
7946
|
+
var CreateContacts1690925872693 = class {
|
|
7883
7947
|
static {
|
|
7884
|
-
__name(this, "
|
|
7948
|
+
__name(this, "CreateContacts1690925872693");
|
|
7885
7949
|
}
|
|
7886
|
-
name = "
|
|
7950
|
+
name = "CreateContacts1690925872693";
|
|
7887
7951
|
async up(queryRunner) {
|
|
7888
|
-
await queryRunner.query(`CREATE TABLE "
|
|
7889
|
-
|
|
7890
|
-
|
|
7891
|
-
|
|
7892
|
-
|
|
7893
|
-
|
|
7894
|
-
|
|
7895
|
-
|
|
7896
|
-
|
|
7897
|
-
|
|
7898
|
-
|
|
7899
|
-
|
|
7900
|
-
|
|
7901
|
-
|
|
7902
|
-
|
|
7903
|
-
|
|
7904
|
-
|
|
7905
|
-
|
|
7906
|
-
|
|
7907
|
-
|
|
7908
|
-
|
|
7909
|
-
|
|
7910
|
-
|
|
7911
|
-
|
|
7912
|
-
|
|
7913
|
-
|
|
7914
|
-
|
|
7952
|
+
await queryRunner.query(`CREATE TABLE "temporary_CorrelationIdentifier" ("id" varchar PRIMARY KEY NOT NULL, "type" varchar CHECK( "type" IN ('did','url') ) NOT NULL, "correlation_id" text NOT NULL, "identityId" varchar, CONSTRAINT "REL_CorrelationIdentifier_identityId" UNIQUE ("identityId"), CONSTRAINT "UQ_CorrelationIdentifier_correlation_id" UNIQUE ("correlation_id"))`);
|
|
7953
|
+
await queryRunner.query(`INSERT INTO "temporary_CorrelationIdentifier"("id", "type", "correlation_id", "identityId") SELECT "id", "type", "correlation_id", "identityId" FROM "CorrelationIdentifier"`);
|
|
7954
|
+
await queryRunner.query(`DROP TABLE "CorrelationIdentifier"`);
|
|
7955
|
+
await queryRunner.query(`ALTER TABLE "temporary_CorrelationIdentifier" RENAME TO "CorrelationIdentifier"`);
|
|
7956
|
+
await queryRunner.query(`CREATE TABLE "temporary_Identity" ("id" varchar PRIMARY KEY NOT NULL, "alias" varchar(255) NOT NULL, "roles" text NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "contactId" varchar, CONSTRAINT "UQ_Identity_alias" UNIQUE ("alias"))`);
|
|
7957
|
+
await queryRunner.query(`INSERT INTO "temporary_Identity"("id", "alias", "roles", "created_at", "last_updated_at", "contactId") SELECT "id", "alias", "roles", "created_at", "last_updated_at", "contactId" FROM "Identity"`);
|
|
7958
|
+
await queryRunner.query(`DROP TABLE "Identity"`);
|
|
7959
|
+
await queryRunner.query(`ALTER TABLE "temporary_Identity" RENAME TO "Identity"`);
|
|
7960
|
+
await queryRunner.query(`CREATE TABLE "temporary_Connection" ("id" varchar PRIMARY KEY NOT NULL, "type" varchar CHECK( "type" IN ('OIDC','SIOPv2','SIOPv2+OpenID4VP') ) NOT NULL, "identityId" varchar, CONSTRAINT "REL_Connection_identityId" UNIQUE ("identityId"))`);
|
|
7961
|
+
await queryRunner.query(`INSERT INTO "temporary_Connection"("id", "type", "identityId") SELECT "id", "type", "identityId" FROM "Connection"`);
|
|
7962
|
+
await queryRunner.query(`DROP TABLE "Connection"`);
|
|
7963
|
+
await queryRunner.query(`ALTER TABLE "temporary_Connection" RENAME TO "Connection"`);
|
|
7964
|
+
await queryRunner.query(`CREATE TABLE "temporary_CorrelationIdentifier" ("id" varchar PRIMARY KEY NOT NULL, "type" varchar CHECK( "type" IN ('did','url') ) NOT NULL, "correlation_id" text NOT NULL, "identity_id" varchar, CONSTRAINT "REL_CorrelationIdentifier_identityId" UNIQUE ("identity_id"), CONSTRAINT "UQ_CorrelationIdentifier_correlation_id" UNIQUE ("correlation_id"))`);
|
|
7965
|
+
await queryRunner.query(`INSERT INTO "temporary_CorrelationIdentifier"("id", "type", "correlation_id", "identity_id") SELECT "id", "type", "correlation_id", "identityId" FROM "CorrelationIdentifier"`);
|
|
7966
|
+
await queryRunner.query(`DROP TABLE "CorrelationIdentifier"`);
|
|
7967
|
+
await queryRunner.query(`ALTER TABLE "temporary_CorrelationIdentifier" RENAME TO "CorrelationIdentifier"`);
|
|
7968
|
+
await queryRunner.query(`CREATE TABLE "temporary_Identity" ("id" varchar PRIMARY KEY NOT NULL, "alias" varchar(255) NOT NULL, "roles" text NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "partyId" varchar, CONSTRAINT "UQ_Identity_alias" UNIQUE ("alias"))`);
|
|
7969
|
+
await queryRunner.query(`INSERT INTO "temporary_Identity"("id", "alias", "roles", "created_at", "last_updated_at", "partyId") SELECT "id", "alias", "roles", "created_at", "last_updated_at", "contactId" FROM "Identity"`);
|
|
7970
|
+
await queryRunner.query(`DROP TABLE "Identity"`);
|
|
7971
|
+
await queryRunner.query(`ALTER TABLE "temporary_Identity" RENAME TO "Identity"`);
|
|
7972
|
+
await queryRunner.query(`CREATE TABLE "temporary_Connection" ("id" varchar PRIMARY KEY NOT NULL, "type" varchar CHECK( "type" IN ('OIDC','SIOPv2','SIOPv2+OpenID4VP') ) NOT NULL, "identity_id" varchar, CONSTRAINT "REL_Connection_identityId" UNIQUE ("identity_id"))`);
|
|
7973
|
+
await queryRunner.query(`INSERT INTO "temporary_Connection"("id", "type", "identity_id") SELECT "id", "type", "identityId" FROM "Connection"`);
|
|
7974
|
+
await queryRunner.query(`DROP TABLE "Connection"`);
|
|
7975
|
+
await queryRunner.query(`ALTER TABLE "temporary_Connection" RENAME TO "Connection"`);
|
|
7976
|
+
await queryRunner.query(`CREATE TABLE "PartyType" ("id" varchar PRIMARY KEY NOT NULL, "type" varchar CHECK( "type" IN ('naturalPerson','organization') ) NOT NULL, "origin" varchar CHECK( "origin" IN ('INTERNAL', 'EXTERNAL') ) NOT NULL, "name" varchar(255) NOT NULL, "description" varchar(255), "tenant_id" varchar(255) NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), CONSTRAINT "UQ_PartyType_name" UNIQUE ("name"))`);
|
|
7977
|
+
await queryRunner.query(`CREATE UNIQUE INDEX "IDX_PartyType_type_tenant_id" ON "PartyType" ("type", "tenant_id")`);
|
|
7978
|
+
await queryRunner.query(`CREATE TABLE "BaseContact" ("id" varchar PRIMARY KEY NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "legal_name" varchar(255), "display_name" varchar(255), "first_name" varchar(255), "middle_name" varchar(255), "last_name" varchar(255), "type" varchar NOT NULL, "party_id" varchar, CONSTRAINT "UQ_BaseContact_legal_name" UNIQUE ("legal_name"), CONSTRAINT "REL_BaseContact_party_id" UNIQUE ("party_id"))`);
|
|
7979
|
+
await queryRunner.query(`CREATE INDEX "IDX_BaseContact_type" ON "BaseContact" ("type")`);
|
|
7980
|
+
await queryRunner.query(`CREATE TABLE "PartyRelationship" ("id" varchar PRIMARY KEY NOT NULL, "left_id" varchar NOT NULL, "right_id" varchar NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')))`);
|
|
7981
|
+
await queryRunner.query(`CREATE UNIQUE INDEX "IDX_PartyRelationship_left_right" ON "PartyRelationship" ("left_id", "right_id")`);
|
|
7982
|
+
await queryRunner.query(`CREATE TABLE "Party" ("id" varchar PRIMARY KEY NOT NULL, "uri" varchar(255) NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "party_type_id" varchar NOT NULL)`);
|
|
7983
|
+
await queryRunner.query(`CREATE TABLE "BaseConfig" ("id" varchar PRIMARY KEY NOT NULL, "identifier" varchar(255), "redirect_url" varchar(255), "session_id" varchar(255), "client_id" varchar(255), "client_secret" varchar(255), "scopes" text, "issuer" varchar(255), "dangerously_allow_insecure_http_requests" boolean, "client_auth_method" text, "type" varchar NOT NULL, "connection_id" varchar, CONSTRAINT "REL_BaseConfig_connection_id" UNIQUE ("connection_id"))`);
|
|
7984
|
+
await queryRunner.query(`CREATE INDEX "IDX_BaseConfig_type" ON "BaseConfig" ("type")`);
|
|
7985
|
+
await queryRunner.query(`CREATE TABLE "temporary_CorrelationIdentifier" ("id" varchar PRIMARY KEY NOT NULL, "type" varchar CHECK( "type" IN ('did','url') ) NOT NULL, "correlation_id" text NOT NULL, "identity_id" varchar, CONSTRAINT "REL_CorrelationIdentifier_identity_id" UNIQUE ("identity_id"), CONSTRAINT "UQ_CorrelationIdentifier_correlation_id" UNIQUE ("correlation_id"), CONSTRAINT "FK_CorrelationIdentifier_identity_id" FOREIGN KEY ("identity_id") REFERENCES "Identity" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`);
|
|
7986
|
+
await queryRunner.query(`INSERT INTO "temporary_CorrelationIdentifier"("id", "type", "correlation_id", "identity_id") SELECT "id", "type", "correlation_id", "identity_id" FROM "CorrelationIdentifier"`);
|
|
7987
|
+
await queryRunner.query(`DROP TABLE "CorrelationIdentifier"`);
|
|
7988
|
+
await queryRunner.query(`ALTER TABLE "temporary_CorrelationIdentifier" RENAME TO "CorrelationIdentifier"`);
|
|
7989
|
+
await queryRunner.query(`DROP INDEX "IDX_BaseContact_type"`);
|
|
7990
|
+
await queryRunner.query(`CREATE TABLE "temporary_BaseContact" ("id" varchar PRIMARY KEY NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "legal_name" varchar(255), "display_name" varchar(255), "first_name" varchar(255), "middle_name" varchar(255), "last_name" varchar(255), "type" varchar NOT NULL, "party_id" varchar, CONSTRAINT "UQ_BaseContact_legal_name" UNIQUE ("legal_name"), CONSTRAINT "REL_BaseContact_party_id" UNIQUE ("party_id"), CONSTRAINT "FK_BaseContact_party_id" FOREIGN KEY ("party_id") REFERENCES "Party" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`);
|
|
7991
|
+
await queryRunner.query(`INSERT INTO "temporary_BaseContact"("id", "created_at", "last_updated_at", "legal_name", "display_name", "first_name", "middle_name", "last_name", "type", "party_id") SELECT "id", "created_at", "last_updated_at", "legal_name", "display_name", "first_name", "middle_name", "last_name", "type", "party_id" FROM "BaseContact"`);
|
|
7992
|
+
await queryRunner.query(`DROP TABLE "BaseContact"`);
|
|
7993
|
+
await queryRunner.query(`ALTER TABLE "temporary_BaseContact" RENAME TO "BaseContact"`);
|
|
7994
|
+
await queryRunner.query(`CREATE INDEX "IDX_BaseContact_type" ON "BaseContact" ("type")`);
|
|
7995
|
+
await queryRunner.query(`DROP INDEX "IDX_PartyRelationship_left_right"`);
|
|
7996
|
+
await queryRunner.query(`CREATE TABLE "temporary_PartyRelationship" ("id" varchar PRIMARY KEY NOT NULL, "left_id" varchar NOT NULL, "right_id" varchar NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), CONSTRAINT "FK_PartyRelationship_left_id" FOREIGN KEY ("left_id") REFERENCES "Party" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_PartyRelationship_right_id" FOREIGN KEY ("right_id") REFERENCES "Party" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`);
|
|
7997
|
+
await queryRunner.query(`INSERT INTO "temporary_PartyRelationship"("id", "left_id", "right_id", "created_at", "last_updated_at") SELECT "id", "left_id", "right_id", "created_at", "last_updated_at" FROM "PartyRelationship"`);
|
|
7998
|
+
await queryRunner.query(`DROP TABLE "PartyRelationship"`);
|
|
7999
|
+
await queryRunner.query(`ALTER TABLE "temporary_PartyRelationship" RENAME TO "PartyRelationship"`);
|
|
8000
|
+
await queryRunner.query(`CREATE UNIQUE INDEX "IDX_PartyRelationship_left_right" ON "PartyRelationship" ("left_id", "right_id")`);
|
|
8001
|
+
await queryRunner.query(`CREATE TABLE "ElectronicAddress" ("id" varchar PRIMARY KEY NOT NULL, "type" varchar(255) NOT NULL, "electronic_address" varchar(255) NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "partyId" varchar, CONSTRAINT "FK_ElectronicAddress_partyId" FOREIGN KEY ("partyId") REFERENCES "Party" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`);
|
|
8002
|
+
await queryRunner.query(`CREATE TABLE "PhysicalAddress" ("id" varchar PRIMARY KEY NOT NULL, "type" varchar(255) NOT NULL, "street_name" varchar(255) NOT NULL, "street_number" varchar(255) NOT NULL, "postal_code" varchar(255) NOT NULL, "city_name" varchar(255) NOT NULL, "province_name" varchar(255) NOT NULL, "country_code" varchar(2) NOT NULL, "building_name" varchar(255), "partyId" varchar, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), CONSTRAINT "FK_PhysicalAddressEntity_partyId" FOREIGN KEY ("partyId") REFERENCES "Party" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`);
|
|
8003
|
+
await queryRunner.query(`CREATE TABLE "temporary_Party" ("id" varchar PRIMARY KEY NOT NULL, "uri" varchar(255), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "party_type_id" varchar NOT NULL, CONSTRAINT "FK_Party_party_type_id" FOREIGN KEY ("party_type_id") REFERENCES "PartyType" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION)`);
|
|
8004
|
+
await queryRunner.query(`INSERT INTO "temporary_Party"("id", "uri", "created_at", "last_updated_at", "party_type_id") SELECT "id", "uri", "created_at", "last_updated_at", "party_type_id" FROM "Party"`);
|
|
8005
|
+
await queryRunner.query(`DROP TABLE "Party"`);
|
|
8006
|
+
await queryRunner.query(`ALTER TABLE "temporary_Party" RENAME TO "Party"`);
|
|
8007
|
+
await queryRunner.query(`CREATE TABLE "temporary_Identity" ("id" varchar PRIMARY KEY NOT NULL, "alias" varchar(255) NOT NULL, "roles" text NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "partyId" varchar, CONSTRAINT "UQ_Identity_alias" UNIQUE ("alias"), CONSTRAINT "FK_Identity_partyId" FOREIGN KEY ("partyId") REFERENCES "Party" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`);
|
|
8008
|
+
await queryRunner.query(`INSERT INTO "temporary_Identity"("id", "alias", "roles", "created_at", "last_updated_at", "partyId") SELECT "id", "alias", "roles", "created_at", "last_updated_at", "partyId" FROM "Identity"`);
|
|
8009
|
+
await queryRunner.query(`DROP TABLE "Identity"`);
|
|
8010
|
+
await queryRunner.query(`ALTER TABLE "temporary_Identity" RENAME TO "Identity"`);
|
|
8011
|
+
await queryRunner.query(`CREATE TABLE "temporary_Connection" ("id" varchar PRIMARY KEY NOT NULL, "type" varchar CHECK( "type" IN ('OIDC','SIOPv2','SIOPv2+OpenID4VP') ) NOT NULL, "identity_id" varchar, CONSTRAINT "REL_Connection_identity_id" UNIQUE ("identity_id"), CONSTRAINT "FK_Connection_identity_id" FOREIGN KEY ("identity_id") REFERENCES "Identity" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`);
|
|
8012
|
+
await queryRunner.query(`INSERT INTO "temporary_Connection"("id", "type", "identity_id") SELECT "id", "type", "identity_id" FROM "Connection"`);
|
|
8013
|
+
await queryRunner.query(`DROP TABLE "Connection"`);
|
|
8014
|
+
await queryRunner.query(`ALTER TABLE "temporary_Connection" RENAME TO "Connection"`);
|
|
8015
|
+
await queryRunner.query(`DROP INDEX "IDX_BaseConfig_type"`);
|
|
8016
|
+
await queryRunner.query(`CREATE TABLE "temporary_BaseConfig" ("id" varchar PRIMARY KEY NOT NULL, "identifier" varchar(255), "redirect_url" varchar(255), "session_id" varchar(255), "client_id" varchar(255), "client_secret" varchar(255), "scopes" text, "issuer" varchar(255), "dangerously_allow_insecure_http_requests" boolean, "client_auth_method" text, "type" varchar NOT NULL, "connection_id" varchar, CONSTRAINT "REL_BaseConfig_connection_id" UNIQUE ("connection_id"), CONSTRAINT "FK_BaseConfig_connection_id" FOREIGN KEY ("connection_id") REFERENCES "Connection" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`);
|
|
8017
|
+
await queryRunner.query(`INSERT INTO "temporary_BaseConfig"("id", "identifier", "redirect_url", "session_id", "client_id", "client_secret", "scopes", "issuer", "dangerously_allow_insecure_http_requests", "client_auth_method", "type", "connection_id") SELECT "id", "identifier", "redirect_url", "session_id", "client_id", "client_secret", "scopes", "issuer", "dangerously_allow_insecure_http_requests", "client_auth_method", "type", "connection_id" FROM "BaseConfig"`);
|
|
8018
|
+
await queryRunner.query(`DROP TABLE "BaseConfig"`);
|
|
8019
|
+
await queryRunner.query(`ALTER TABLE "temporary_BaseConfig" RENAME TO "BaseConfig"`);
|
|
8020
|
+
await queryRunner.query(`CREATE INDEX "IDX_BaseConfig_type" ON "BaseConfig" ("type")`);
|
|
8021
|
+
await queryRunner.query(`INSERT INTO "BaseConfig"("id", "identifier", "redirect_url", "session_id", "client_id", "client_secret", "scopes", "issuer", "dangerously_allow_insecure_http_requests", "client_auth_method", "type", "connection_id") SELECT "id", "identifier", "redirect_url", "session_id", "client_id", "client_secret", "scopes", "issuer", "dangerously_allow_insecure_http_requests", "client_auth_method", "type", "connectionId" FROM "BaseConfigEntity"`);
|
|
8022
|
+
await queryRunner.query(`DROP TABLE "BaseConfigEntity"`);
|
|
8023
|
+
await queryRunner.query(`INSERT INTO "PartyType"(id, type, origin, name, description, tenant_id, created_at, last_updated_at) VALUES ('3875c12e-fdaa-4ef6-a340-c936e054b627', 'organization', 'INTERNAL', 'Sphereon_default_organization_type', 'sphereon_default_organization', '95e09cfc-c974-4174-86aa-7bf1d5251fb4', datetime('now'), datetime('now'))`);
|
|
8024
|
+
await queryRunner.query(`INSERT INTO "PartyType"(id, type, origin, name, description, tenant_id, created_at, last_updated_at) VALUES ('7d248798-41ca-4fc1-a130-9934b43d532e', 'naturalPerson', 'INTERNAL', 'Sphereon_default_natural_person_type', 'sphereon_default_natural_person', '95e09cfc-c974-4174-86aa-7bf1d5251fb4', datetime('now'), datetime('now'))`);
|
|
8025
|
+
await queryRunner.query(`INSERT INTO "Party"(id, uri, created_at, last_updated_at, party_type_id) SELECT id, uri, created_at, last_updated_at, '3875c12e-fdaa-4ef6-a340-c936e054b627' FROM "Contact"`);
|
|
8026
|
+
await queryRunner.query(`INSERT INTO "BaseContact"(id, legal_name, display_name, party_id, created_at, last_updated_at, type) SELECT id, name, alias, id, created_at, last_updated_at, 'Organization' FROM "Contact"`);
|
|
8027
|
+
await queryRunner.query(`DROP TABLE "Contact"`);
|
|
7915
8028
|
}
|
|
7916
8029
|
async down(queryRunner) {
|
|
7917
|
-
await queryRunner.query(`
|
|
8030
|
+
await queryRunner.query(`CREATE TABLE "Contact" ("id" varchar PRIMARY KEY NOT NULL, "uri" varchar(255), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "name" varchar(255), "alias" varchar(255))`);
|
|
8031
|
+
await queryRunner.query(`INSERT INTO "Contact"(id, uri, created_at, last_updated_at, name, alias) SELECT id, uri, created_at, last_updated_at, (SELECT legal_name FROM "BaseContact" WHERE "BaseContact"."party_id" = "Party"."id"), (SELECT display_name FROM "BaseContact" WHERE "BaseContact"."party_id" = "Party"."id") FROM "Party" WHERE party_type_id = '3875c12e-fdaa-4ef6-a340-c936e054b627'`);
|
|
8032
|
+
await queryRunner.query(`DROP TABLE "BaseContact"`);
|
|
8033
|
+
await queryRunner.query(`DROP TABLE "Party"`);
|
|
8034
|
+
await queryRunner.query(`CREATE TABLE "BaseConfigEntity" ("id" varchar PRIMARY KEY NOT NULL, "identifier" varchar(255), "redirect_url" varchar(255), "session_id" varchar(255), "client_id" varchar(255), "client_secret" varchar(255), "scopes" text, "issuer" varchar(255), "dangerously_allow_insecure_http_requests" boolean, "client_auth_method" text, "type" varchar NOT NULL, "connectionId" varchar)`);
|
|
8035
|
+
await queryRunner.query(`INSERT INTO "BaseConfigEntity"("id", "identifier", "redirect_url", "session_id", "client_id", "client_secret", "scopes", "issuer", "dangerously_allow_insecure_http_requests", "client_auth_method", "type", "connectionId") SELECT "id", "identifier", "redirect_url", "session_id", "client_id", "client_secret", "scopes", "issuer", "dangerously_allow_insecure_http_requests", "client_auth_method", "type", "connection_id" FROM "BaseConfig"`);
|
|
8036
|
+
await queryRunner.query(`DROP TABLE "BaseConfig"`);
|
|
8037
|
+
await queryRunner.query(`CREATE TABLE "temporary_Party" ("id" varchar PRIMARY KEY NOT NULL, "uri" varchar(255), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "party_type_id" varchar NOT NULL, CONSTRAINT "FK_Party_party_type_id" FOREIGN KEY ("party_type_id") REFERENCES "PartyType" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION)`);
|
|
8038
|
+
await queryRunner.query(`INSERT INTO "temporary_Party"("id", "uri", "created_at", "last_updated_at", "party_type_id") SELECT "id", "uri", "created_at", "last_updated_at", "party_type_id" FROM "Party"`);
|
|
8039
|
+
await queryRunner.query(`DROP TABLE "Party"`);
|
|
8040
|
+
await queryRunner.query(`ALTER TABLE "temporary_Party" RENAME TO "Party"`);
|
|
8041
|
+
await queryRunner.query(`DROP INDEX "IDX_PartyRelationship_left_right"`);
|
|
8042
|
+
await queryRunner.query(`CREATE TABLE "temporary_PartyRelationship" ("id" varchar PRIMARY KEY NOT NULL, "left_id" varchar NOT NULL, "right_id" varchar NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), CONSTRAINT "FK_PartyRelationship_left_id" FOREIGN KEY ("left_id") REFERENCES "Party" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_PartyRelationship_right_id" FOREIGN KEY ("right_id") REFERENCES "Party" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`);
|
|
8043
|
+
await queryRunner.query(`INSERT INTO "temporary_PartyRelationship"("id", "left_id", "right_id", "created_at", "last_updated_at") SELECT "id", "left_id", "right_id", "created_at", "last_updated_at" FROM "PartyRelationship"`);
|
|
8044
|
+
await queryRunner.query(`DROP TABLE "PartyRelationship"`);
|
|
8045
|
+
await queryRunner.query(`ALTER TABLE "temporary_PartyRelationship" RENAME TO "PartyRelationship"`);
|
|
8046
|
+
await queryRunner.query(`CREATE UNIQUE INDEX "IDX_PartyRelationship_left_right" ON "PartyRelationship" ("left_id", "right_id")`);
|
|
8047
|
+
await queryRunner.query(`DROP INDEX "IDX_BaseContact_type"`);
|
|
8048
|
+
await queryRunner.query(`CREATE TABLE "temporary_BaseContact" ("id" varchar PRIMARY KEY NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "legal_name" varchar(255), "display_name" varchar(255), "first_name" varchar(255), "middle_name" varchar(255), "last_name" varchar(255), "type" varchar NOT NULL, "party_id" varchar, CONSTRAINT "UQ_BaseContact_legal_name" UNIQUE ("legal_name"), CONSTRAINT "REL_BaseContact_party_id" UNIQUE ("party_id"), CONSTRAINT "FK_BaseContact_party_id" FOREIGN KEY ("party_id") REFERENCES "Party" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`);
|
|
8049
|
+
await queryRunner.query(`INSERT INTO "temporary_BaseContact"("id", "created_at", "last_updated_at", "legal_name", "display_name", "first_name", "middle_name", "last_name", "type", "party_id") SELECT "id", "created_at", "last_updated_at", "legal_name", "display_name", "first_name", "middle_name", "last_name", "type", "party_id" FROM "BaseContact"`);
|
|
8050
|
+
await queryRunner.query(`DROP TABLE "BaseContact"`);
|
|
8051
|
+
await queryRunner.query(`ALTER TABLE "temporary_BaseContact" RENAME TO "BaseContact"`);
|
|
8052
|
+
await queryRunner.query(`CREATE INDEX "IDX_BaseContact_type" ON "BaseContact" ("type")`);
|
|
8053
|
+
await queryRunner.query(`DROP INDEX "IDX_BaseConfig_type"`);
|
|
8054
|
+
await queryRunner.query(`CREATE TABLE "temporary_BaseConfig" ("id" varchar PRIMARY KEY NOT NULL, "identifier" varchar(255), "redirect_url" varchar(255), "session_id" varchar(255), "client_id" varchar(255), "client_secret" varchar(255), "scopes" text, "issuer" varchar(255), "dangerously_allow_insecure_http_requests" boolean, "client_auth_method" text, "type" varchar NOT NULL, "connection_id" varchar, CONSTRAINT "REL_BaseConfig_connection_id" UNIQUE ("connection_id"), CONSTRAINT "FK_BaseConfig_connection_id" FOREIGN KEY ("connection_id") REFERENCES "Connection" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`);
|
|
8055
|
+
await queryRunner.query(`INSERT INTO "temporary_BaseConfig"("id", "identifier", "redirect_url", "session_id", "client_id", "client_secret", "scopes", "issuer", "dangerously_allow_insecure_http_requests", "client_auth_method", "type", "connection_id") SELECT "id", "identifier", "redirect_url", "session_id", "client_id", "client_secret", "scopes", "issuer", "dangerously_allow_insecure_http_requests", "client_auth_method", "type", "connection_id" FROM "BaseConfig"`);
|
|
8056
|
+
await queryRunner.query(`DROP TABLE "BaseConfig"`);
|
|
8057
|
+
await queryRunner.query(`ALTER TABLE "temporary_BaseConfig" RENAME TO "BaseConfig"`);
|
|
8058
|
+
await queryRunner.query(`CREATE INDEX "IDX_BaseConfig_type" ON "BaseConfig" ("type")`);
|
|
8059
|
+
await queryRunner.query(`DROP INDEX "IDX_PartyType_type_tenant_id"`);
|
|
8060
|
+
await queryRunner.query(`DROP TABLE "PartyType"`);
|
|
8061
|
+
await queryRunner.query(`DROP TABLE "Connection"`);
|
|
8062
|
+
await queryRunner.query(`DROP TABLE "Identity"`);
|
|
8063
|
+
await queryRunner.query(`DROP TABLE "CorrelationIdentifier"`);
|
|
8064
|
+
await queryRunner.query(`DROP TABLE "ElectronicAddress"`);
|
|
8065
|
+
await queryRunner.query(`DROP TABLE "PhysicalAddress"`);
|
|
7918
8066
|
}
|
|
7919
8067
|
};
|
|
7920
8068
|
|
|
7921
|
-
// src/migrations/postgres/
|
|
7922
|
-
|
|
8069
|
+
// src/migrations/postgres/1690925872592-CreateContacts.ts
|
|
8070
|
+
import { enablePostgresUuidExtension as enablePostgresUuidExtension3 } from "@sphereon/ssi-sdk.core";
|
|
8071
|
+
var CreateContacts1690925872592 = class {
|
|
7923
8072
|
static {
|
|
7924
|
-
__name(this, "
|
|
7925
|
-
}
|
|
7926
|
-
name = "
|
|
7927
|
-
async up(queryRunner) {
|
|
7928
|
-
await queryRunner
|
|
7929
|
-
await queryRunner.query(`
|
|
7930
|
-
await queryRunner.query(`
|
|
7931
|
-
await queryRunner.query(`
|
|
7932
|
-
await queryRunner.query(`
|
|
7933
|
-
await queryRunner.query(`
|
|
7934
|
-
await queryRunner.query(`
|
|
7935
|
-
await queryRunner.query(`CREATE TYPE "public"."
|
|
7936
|
-
await queryRunner.query(`CREATE TYPE "public"."
|
|
7937
|
-
await queryRunner.query(`CREATE TABLE "
|
|
7938
|
-
|
|
7939
|
-
|
|
7940
|
-
|
|
7941
|
-
|
|
7942
|
-
|
|
7943
|
-
|
|
7944
|
-
|
|
7945
|
-
|
|
7946
|
-
|
|
7947
|
-
|
|
7948
|
-
|
|
7949
|
-
|
|
7950
|
-
|
|
7951
|
-
|
|
7952
|
-
|
|
7953
|
-
|
|
7954
|
-
|
|
7955
|
-
|
|
7956
|
-
|
|
7957
|
-
|
|
7958
|
-
|
|
7959
|
-
|
|
7960
|
-
|
|
7961
|
-
|
|
7962
|
-
|
|
7963
|
-
|
|
8073
|
+
__name(this, "CreateContacts1690925872592");
|
|
8074
|
+
}
|
|
8075
|
+
name = "CreateContacts1690925872592";
|
|
8076
|
+
async up(queryRunner) {
|
|
8077
|
+
await enablePostgresUuidExtension3(queryRunner);
|
|
8078
|
+
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" DROP CONSTRAINT "FK_CorrelationIdentifier_identityId"`);
|
|
8079
|
+
await queryRunner.query(`ALTER TABLE "IdentityMetadata" DROP CONSTRAINT "FK_IdentityMetadata_identityId"`);
|
|
8080
|
+
await queryRunner.query(`ALTER TABLE "Identity" DROP CONSTRAINT "FK_Identity_contactId"`);
|
|
8081
|
+
await queryRunner.query(`ALTER TABLE "Connection" DROP CONSTRAINT "FK_Connection_identityId"`);
|
|
8082
|
+
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" RENAME COLUMN "identityId" TO "identity_id"`);
|
|
8083
|
+
await queryRunner.query(`ALTER TABLE "Connection" RENAME COLUMN "identityId" TO "identity_id"`);
|
|
8084
|
+
await queryRunner.query(`CREATE TYPE "public"."PartyType_type_enum" AS ENUM('naturalPerson', 'organization')`);
|
|
8085
|
+
await queryRunner.query(`CREATE TYPE "public"."PartyOrigin_type_enum" AS ENUM('INTERNAL', 'EXTERNAL')`);
|
|
8086
|
+
await queryRunner.query(`CREATE TABLE "PartyType" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "type" "public"."PartyType_type_enum" NOT NULL, "origin" "public"."PartyOrigin_type_enum" NOT NULL, "name" character varying(255) NOT NULL, "description" character varying(255), "tenant_id" character varying(255) NOT NULL, "created_at" TIMESTAMP NOT NULL DEFAULT now(), "last_updated_at" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "UQ_PartyType_name" UNIQUE ("name"), CONSTRAINT "PK_PartyType_id" PRIMARY KEY ("id"))`);
|
|
8087
|
+
await queryRunner.query(`CREATE UNIQUE INDEX "IDX_PartyType_type_tenant_id" ON "PartyType" ("type", "tenant_id")`);
|
|
8088
|
+
await queryRunner.query(`CREATE TABLE "BaseContact" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "created_at" TIMESTAMP NOT NULL DEFAULT now(), "last_updated_at" TIMESTAMP NOT NULL DEFAULT now(), "legal_name" character varying(255), "display_name" character varying(255), "first_name" character varying(255), "middle_name" character varying(255), "last_name" character varying(255), "type" character varying NOT NULL, "party_id" uuid, CONSTRAINT "UQ_BaseContact_legal_name" UNIQUE ("legal_name"), CONSTRAINT "REL_BaseContact_party_id" UNIQUE ("party_id"), CONSTRAINT "PK_BaseContact_id" PRIMARY KEY ("id"))`);
|
|
8089
|
+
await queryRunner.query(`CREATE INDEX "IDX_BaseContact_type" ON "BaseContact" ("type")`);
|
|
8090
|
+
await queryRunner.query(`CREATE TABLE "PartyRelationship" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "left_id" uuid NOT NULL, "right_id" uuid NOT NULL, "created_at" TIMESTAMP NOT NULL DEFAULT now(), "last_updated_at" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "PK_PartyRelationship_id" PRIMARY KEY ("id"))`);
|
|
8091
|
+
await queryRunner.query(`CREATE UNIQUE INDEX "IDX_PartyRelationship_left_right" ON "PartyRelationship" ("left_id", "right_id")`);
|
|
8092
|
+
await queryRunner.query(`CREATE TABLE "ElectronicAddress" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "type" character varying(255) NOT NULL, "electronic_address" character varying(255) NOT NULL, "created_at" TIMESTAMP NOT NULL DEFAULT now(), "last_updated_at" TIMESTAMP NOT NULL DEFAULT now(), "partyId" uuid, CONSTRAINT "PK_ElectronicAddress_id" PRIMARY KEY ("id"))`);
|
|
8093
|
+
await queryRunner.query(`CREATE TABLE "PhysicalAddress" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "type" character varying(255) NOT NULL, "street_name" character varying(255) NOT NULL, "street_number" character varying(255) NOT NULL, "postal_code" character varying(255) NOT NULL, "city_name" character varying(255) NOT NULL, "province_name" character varying(255) NOT NULL, "country_code" character varying(2) NOT NULL, "building_name" character varying(255), "partyId" uuid, "created_at" TIMESTAMP NOT NULL DEFAULT now(), "last_updated_at" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "PK_PhysicalAddress_id" PRIMARY KEY ("id"))`);
|
|
8094
|
+
await queryRunner.query(`CREATE TABLE "Party" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "uri" character varying(255), "created_at" TIMESTAMP NOT NULL DEFAULT now(), "last_updated_at" TIMESTAMP NOT NULL DEFAULT now(), "party_type_id" uuid NOT NULL, CONSTRAINT "PK_Party_id" PRIMARY KEY ("id"))`);
|
|
8095
|
+
await queryRunner.query(`CREATE TABLE "BaseConfig" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "identifier" character varying(255), "redirect_url" character varying(255), "session_id" character varying(255), "client_id" character varying(255), "client_secret" character varying(255), "scopes" text, "issuer" character varying(255), "dangerously_allow_insecure_http_requests" boolean, "client_auth_method" text, "type" character varying NOT NULL, "connection_id" uuid, CONSTRAINT "REL_BaseConfig_connection_id" UNIQUE ("connection_id"), CONSTRAINT "PK_BaseConfig_id" PRIMARY KEY ("id"))`);
|
|
8096
|
+
await queryRunner.query(`CREATE INDEX "IDX_BaseConfig_type" ON "BaseConfig" ("type")`);
|
|
8097
|
+
await queryRunner.query(`ALTER TABLE "Identity" RENAME COLUMN "contactId" TO "partyId"`);
|
|
8098
|
+
await queryRunner.query(`ALTER TABLE "Identity" ALTER COLUMN "roles" SET NOT NULL`);
|
|
8099
|
+
await queryRunner.query(`CREATE TYPE "public"."IdentityOrigin_type_enum" AS ENUM('INTERNAL', 'EXTERNAL')`);
|
|
8100
|
+
await queryRunner.query(`ALTER TABLE "Identity" ADD COLUMN "origin" "public"."IdentityOrigin_type_enum" DEFAULT 'EXTERNAL' NOT NULL`);
|
|
8101
|
+
await queryRunner.query(`ALTER TABLE "Identity" ALTER COLUMN "origin" DROP DEFAULT`);
|
|
8102
|
+
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" ADD CONSTRAINT "FK_CorrelationIdentifier_identity_id" FOREIGN KEY ("identity_id") REFERENCES "Identity"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
8103
|
+
await queryRunner.query(`ALTER TABLE "IdentityMetadata" ADD CONSTRAINT "FK_IdentityMetadata_identityId" FOREIGN KEY ("identityId") REFERENCES "Identity"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
8104
|
+
await queryRunner.query(`ALTER TABLE "BaseContact" ADD CONSTRAINT "FK_BaseContact_party_id" FOREIGN KEY ("party_id") REFERENCES "Party"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
8105
|
+
await queryRunner.query(`ALTER TABLE "PartyRelationship" ADD CONSTRAINT "FK_PartyRelationship_left_id" FOREIGN KEY ("left_id") REFERENCES "Party"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
8106
|
+
await queryRunner.query(`ALTER TABLE "PartyRelationship" ADD CONSTRAINT "FK_PartyRelationship_right_id" FOREIGN KEY ("right_id") REFERENCES "Party"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
8107
|
+
await queryRunner.query(`ALTER TABLE "ElectronicAddress" ADD CONSTRAINT "FK_ElectronicAddress_partyId" FOREIGN KEY ("partyId") REFERENCES "Party"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
8108
|
+
await queryRunner.query(`ALTER TABLE "PhysicalAddress" ADD CONSTRAINT "FK_PhysicalAddress_partyId" FOREIGN KEY ("partyId") REFERENCES "Party" ("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
8109
|
+
await queryRunner.query(`ALTER TABLE "Party" ADD CONSTRAINT "FK_Party_party_type_id" FOREIGN KEY ("party_type_id") REFERENCES "PartyType"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
8110
|
+
await queryRunner.query(`ALTER TABLE "Identity" ADD CONSTRAINT "FK_Identity_partyId" FOREIGN KEY ("partyId") REFERENCES "Party"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
8111
|
+
await queryRunner.query(`ALTER TABLE "Connection" ADD CONSTRAINT "FK_Connection_identity_id" FOREIGN KEY ("identity_id") REFERENCES "Identity"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
8112
|
+
await queryRunner.query(`ALTER TABLE "BaseConfig" ADD CONSTRAINT "FK_BaseConfig_connection_id" FOREIGN KEY ("connection_id") REFERENCES "Connection"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
8113
|
+
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" RENAME CONSTRAINT "UQ_Correlation_id" TO "UQ_CorrelationIdentifier_correlation_id"`);
|
|
8114
|
+
await queryRunner.query(`ALTER TABLE "Identity" RENAME CONSTRAINT "UQ_Identity_Alias" TO "UQ_Identity_alias"`);
|
|
8115
|
+
await queryRunner.query(`INSERT INTO "BaseConfig"("id", "identifier", "redirect_url", "session_id", "client_id", "client_secret", "scopes", "issuer", "dangerously_allow_insecure_http_requests", "client_auth_method", "type", "connection_id") SELECT "id", "identifier", "redirect_url", "session_id", "client_id", "client_secret", "scopes", "issuer", "dangerously_allow_insecure_http_requests", "client_auth_method", "type", "connectionId" FROM "BaseConfigEntity"`);
|
|
8116
|
+
await queryRunner.query(`DROP TABLE "BaseConfigEntity"`);
|
|
8117
|
+
await queryRunner.query(`INSERT INTO "PartyType"(id, type, origin, name, description, tenant_id, created_at, last_updated_at) VALUES ('3875c12e-fdaa-4ef6-a340-c936e054b627', 'organization', 'INTERNAL', 'Sphereon_default_organization_type', 'sphereon_default_organization', '95e09cfc-c974-4174-86aa-7bf1d5251fb4', now(), now())`);
|
|
8118
|
+
await queryRunner.query(`INSERT INTO "PartyType"(id, type, origin, name, description, tenant_id, created_at, last_updated_at) VALUES ('7d248798-41ca-4fc1-a130-9934b43d532e', 'naturalPerson', 'INTERNAL', 'Sphereon_default_natural_person_type', 'sphereon_default_natural_person', '95e09cfc-c974-4174-86aa-7bf1d5251fb4', now(), now())`);
|
|
8119
|
+
await queryRunner.query(`INSERT INTO "Party"(id, uri, created_at, last_updated_at, party_type_id) SELECT id, uri, created_at, last_updated_at, '3875c12e-fdaa-4ef6-a340-c936e054b627' FROM "Contact"`);
|
|
8120
|
+
await queryRunner.query(`INSERT INTO "BaseContact"(id, legal_name, display_name, party_id, created_at, last_updated_at, type) SELECT id, name, alias, id, created_at, last_updated_at, 'Organization' FROM "Contact"`);
|
|
8121
|
+
await queryRunner.query(`DROP TABLE "Contact"`);
|
|
7964
8122
|
}
|
|
7965
8123
|
async down(queryRunner) {
|
|
7966
|
-
await queryRunner.query(`
|
|
7967
|
-
await queryRunner.query(`
|
|
7968
|
-
await queryRunner.query(`
|
|
7969
|
-
await queryRunner.query(`
|
|
7970
|
-
await queryRunner.query(`
|
|
7971
|
-
await queryRunner.query(`
|
|
7972
|
-
await queryRunner.query(`
|
|
7973
|
-
await queryRunner.query(`
|
|
8124
|
+
await queryRunner.query(`ALTER TABLE "BaseConfig" DROP CONSTRAINT "FK_BaseConfig_connection_id"`);
|
|
8125
|
+
await queryRunner.query(`ALTER TABLE "Connection" DROP CONSTRAINT "FK_Connection_identity_id"`);
|
|
8126
|
+
await queryRunner.query(`ALTER TABLE "Identity" DROP CONSTRAINT "FK_Identity_partyId"`);
|
|
8127
|
+
await queryRunner.query(`ALTER TABLE "Party" DROP CONSTRAINT "FK_Party_party_type_id"`);
|
|
8128
|
+
await queryRunner.query(`ALTER TABLE "PhysicalAddress" DROP CONSTRAINT "FK_PhysicalAddress_partyId"`);
|
|
8129
|
+
await queryRunner.query(`ALTER TABLE "ElectronicAddress" DROP CONSTRAINT "FK_ElectronicAddress_partyId"`);
|
|
8130
|
+
await queryRunner.query(`ALTER TABLE "PartyRelationship" DROP CONSTRAINT "FK_PartyRelationship_right_id"`);
|
|
8131
|
+
await queryRunner.query(`ALTER TABLE "PartyRelationship" DROP CONSTRAINT "FK_PartyRelationship_left_id"`);
|
|
8132
|
+
await queryRunner.query(`ALTER TABLE "BaseContact" DROP CONSTRAINT "FK_BaseContact_party_id"`);
|
|
8133
|
+
await queryRunner.query(`ALTER TABLE "IdentityMetadata" DROP CONSTRAINT "FK_IdentityMetadata_identityId"`);
|
|
8134
|
+
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" DROP CONSTRAINT "FK_CorrelationIdentifier_identity_id"`);
|
|
8135
|
+
await queryRunner.query(`ALTER TABLE "Identity" ALTER COLUMN "roles" DROP NOT NULL`);
|
|
8136
|
+
await queryRunner.query(`ALTER TABLE "Identity" DROP COLUMN "origin"`);
|
|
8137
|
+
await queryRunner.query(`DROP TYPE "public"."IdentityOrigin_type_enum"`);
|
|
8138
|
+
await queryRunner.query(`ALTER TABLE "Identity" RENAME COLUMN "partyId" TO "contactId"`);
|
|
8139
|
+
await queryRunner.query(`ALTER TABLE "Connection" RENAME COLUMN "identity_id" TO "identityId"`);
|
|
8140
|
+
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" RENAME COLUMN "identity_id" TO "identityId"`);
|
|
8141
|
+
await queryRunner.query(`DROP INDEX "IDX_BaseConfig_type"`);
|
|
8142
|
+
await queryRunner.query(`DROP TABLE "BaseConfig"`);
|
|
8143
|
+
await queryRunner.query(`DROP TABLE "Party"`);
|
|
8144
|
+
await queryRunner.query(`DROP INDEX "IDX_PartyRelationship_left_right"`);
|
|
8145
|
+
await queryRunner.query(`DROP TABLE "PartyRelationship"`);
|
|
8146
|
+
await queryRunner.query(`DROP INDEX "IDX_BaseContact_type"`);
|
|
8147
|
+
await queryRunner.query(`DROP TABLE "BaseContact"`);
|
|
8148
|
+
await queryRunner.query(`DROP TABLE "ElectronicAddress"`);
|
|
8149
|
+
await queryRunner.query(`DROP TABLE "PhysicalAddress"`);
|
|
8150
|
+
await queryRunner.query(`DROP INDEX "IDX_PartyType_type_tenant_id"`);
|
|
8151
|
+
await queryRunner.query(`DROP TABLE "PartyType"`);
|
|
8152
|
+
await queryRunner.query(`DROP TYPE "public"."PartyOrigin_type_enum"`);
|
|
8153
|
+
await queryRunner.query(`DROP TYPE "public"."PartyType_type_enum"`);
|
|
8154
|
+
await queryRunner.query(`ALTER TABLE "Connection" ADD CONSTRAINT "FK_Connection_identityId" FOREIGN KEY ("identityId") REFERENCES "Identity"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
8155
|
+
await queryRunner.query(`ALTER TABLE "Identity" ADD CONSTRAINT "FK_Identity_contactId" FOREIGN KEY ("contactId") REFERENCES "Contact"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
8156
|
+
await queryRunner.query(`ALTER TABLE "IdentityMetadata" ADD CONSTRAINT "FK_IdentityMetadata_identityId" FOREIGN KEY ("identityId") REFERENCES "Identity"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
8157
|
+
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" ADD CONSTRAINT "FK_CorrelationIdentifier_identityId" FOREIGN KEY ("identityId") REFERENCES "Identity"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
8158
|
+
await queryRunner.query(`CREATE TABLE "Contact" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "uri" character varying(255), "created_at" TIMESTAMP NOT NULL DEFAULT now(), "last_updated_at" TIMESTAMP NOT NULL DEFAULT now(), "name" character varying(255), "alias" character varying(255), CONSTRAINT "PK_Contact_id" PRIMARY KEY ("id"))`);
|
|
8159
|
+
await queryRunner.query(`INSERT INTO "Contact"(id, uri, created_at, last_updated_at, name, alias) SELECT id, uri, created_at, last_updated_at, (SELECT legal_name FROM "BaseContact" WHERE "BaseContact"."party_id" = "Party"."id"), (SELECT display_name FROM "BaseContact" WHERE "BaseContact"."party_id" = "Party"."id") FROM "Party" WHERE party_type_id = '3875c12e-fdaa-4ef6-a340-c936e054b627'`);
|
|
7974
8160
|
}
|
|
7975
8161
|
};
|
|
7976
8162
|
|
|
7977
|
-
// src/migrations/generic/
|
|
7978
|
-
var
|
|
7979
|
-
var
|
|
8163
|
+
// src/migrations/generic/3-CreateContacts.ts
|
|
8164
|
+
var debug14 = Debug14("sphereon:ssi-sdk:migrations");
|
|
8165
|
+
var CreateContacts1690925872318 = class {
|
|
7980
8166
|
static {
|
|
7981
|
-
__name(this, "
|
|
8167
|
+
__name(this, "CreateContacts1690925872318");
|
|
7982
8168
|
}
|
|
7983
|
-
name = "
|
|
8169
|
+
name = "CreateContacts1690925872318";
|
|
7984
8170
|
async up(queryRunner) {
|
|
7985
|
-
|
|
8171
|
+
debug14("migration: creating contacts tables");
|
|
7986
8172
|
const dbType = queryRunner.connection.driver.options.type;
|
|
7987
8173
|
switch (dbType) {
|
|
7988
8174
|
case "postgres": {
|
|
7989
|
-
|
|
7990
|
-
const mig = new
|
|
8175
|
+
debug14("using postgres migration file");
|
|
8176
|
+
const mig = new CreateContacts1690925872592();
|
|
7991
8177
|
await mig.up(queryRunner);
|
|
7992
|
-
|
|
8178
|
+
debug14("Migration statements executed");
|
|
7993
8179
|
return;
|
|
7994
8180
|
}
|
|
7995
8181
|
case "sqlite":
|
|
7996
8182
|
case "expo":
|
|
7997
8183
|
case "react-native": {
|
|
7998
|
-
|
|
7999
|
-
const mig = new
|
|
8184
|
+
debug14("using sqlite/react-native migration file");
|
|
8185
|
+
const mig = new CreateContacts1690925872693();
|
|
8000
8186
|
await mig.up(queryRunner);
|
|
8001
|
-
|
|
8187
|
+
debug14("Migration statements executed");
|
|
8002
8188
|
return;
|
|
8003
8189
|
}
|
|
8004
8190
|
default:
|
|
@@ -8006,23 +8192,23 @@ var CreateAuditEvents1701635835330 = class {
|
|
|
8006
8192
|
}
|
|
8007
8193
|
}
|
|
8008
8194
|
async down(queryRunner) {
|
|
8009
|
-
|
|
8195
|
+
debug14("migration: reverting contacts tables");
|
|
8010
8196
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8011
8197
|
switch (dbType) {
|
|
8012
8198
|
case "postgres": {
|
|
8013
|
-
|
|
8014
|
-
const mig = new
|
|
8199
|
+
debug14("using postgres migration file");
|
|
8200
|
+
const mig = new CreateContacts1690925872592();
|
|
8015
8201
|
await mig.down(queryRunner);
|
|
8016
|
-
|
|
8202
|
+
debug14("Migration statements executed");
|
|
8017
8203
|
return;
|
|
8018
8204
|
}
|
|
8019
8205
|
case "sqlite":
|
|
8020
8206
|
case "expo":
|
|
8021
8207
|
case "react-native": {
|
|
8022
|
-
|
|
8023
|
-
const mig = new
|
|
8208
|
+
debug14("using sqlite/react-native migration file");
|
|
8209
|
+
const mig = new CreateContacts1690925872693();
|
|
8024
8210
|
await mig.down(queryRunner);
|
|
8025
|
-
|
|
8211
|
+
debug14("Migration statements executed");
|
|
8026
8212
|
return;
|
|
8027
8213
|
}
|
|
8028
8214
|
default:
|
|
@@ -8031,429 +8217,391 @@ var CreateAuditEvents1701635835330 = class {
|
|
|
8031
8217
|
}
|
|
8032
8218
|
};
|
|
8033
8219
|
|
|
8034
|
-
// src/migrations/generic/
|
|
8035
|
-
import
|
|
8036
|
-
|
|
8037
|
-
// src/migrations/postgres/1708525189001-CreateDigitalCredential.ts
|
|
8038
|
-
var CreateDigitalCredential1708525189001 = class {
|
|
8039
|
-
static {
|
|
8040
|
-
__name(this, "CreateDigitalCredential1708525189001");
|
|
8041
|
-
}
|
|
8042
|
-
name = "CreateDigitalCredential1708525189001";
|
|
8043
|
-
async up(queryRunner) {
|
|
8044
|
-
await queryRunner.query(`CREATE TYPE "digital_document_type" AS ENUM('VC', 'VP', 'C', 'P')`);
|
|
8045
|
-
await queryRunner.query(`CREATE TYPE "digital_regulation_type" AS ENUM('PID', 'QEAA', 'EAA', 'NON_REGULATED')`);
|
|
8046
|
-
await queryRunner.query(`CREATE TYPE "digital_credential_document_format" AS ENUM('JSON_LD', 'JWT', 'SD_JWT', 'MSO_MDOC')`);
|
|
8047
|
-
await queryRunner.query(`CREATE TYPE "digital_credential_credential_role" AS ENUM('ISSUER', 'VERIFIER', 'HOLDER', 'FEDERATION_TRUST_ANCHOR')`);
|
|
8048
|
-
await queryRunner.query(`CREATE TYPE "digital_credential_correlation_type" AS ENUM('DID', 'KID', 'URL', 'X509_SAN')`);
|
|
8049
|
-
await queryRunner.query(`CREATE TYPE "digital_credential_state_type" AS ENUM('REVOKED', 'VERIFIED', 'EXPIRED')`);
|
|
8050
|
-
await queryRunner.query(`
|
|
8051
|
-
CREATE TABLE "DigitalCredential" (
|
|
8052
|
-
"id" uuid NOT NULL DEFAULT uuid_generate_v4(),
|
|
8053
|
-
"parent_id" text,
|
|
8054
|
-
"document_type" "digital_document_type" NOT NULL,
|
|
8055
|
-
"regulation_type" "digital_regulation_type" NOT NULL DEFAULT 'NON_REGULATED'::"digital_regulation_type",
|
|
8056
|
-
"document_format" "digital_credential_document_format" NOT NULL,
|
|
8057
|
-
"credential_role" "digital_credential_credential_role" NOT NULL,
|
|
8058
|
-
"raw_document" text NOT NULL,
|
|
8059
|
-
"uniform_document" text NOT NULL,
|
|
8060
|
-
"credential_id" text,
|
|
8061
|
-
"hash" text NOT NULL,
|
|
8062
|
-
"kms_key_ref" text,
|
|
8063
|
-
"identifier_method" text,
|
|
8064
|
-
"issuer_correlation_type" "digital_credential_correlation_type" NOT NULL,
|
|
8065
|
-
"subject_correlation_type" "digital_credential_correlation_type",
|
|
8066
|
-
"issuer_correlation_id" text NOT NULL,
|
|
8067
|
-
"subject_correlation_id" text,
|
|
8068
|
-
"verified_state" "digital_credential_state_type",
|
|
8069
|
-
"issuer_signed" boolean,
|
|
8070
|
-
"rp_correlation_id" text,
|
|
8071
|
-
"rp_correlation_type" "digital_credential_correlation_type",
|
|
8072
|
-
"tenant_id" text,
|
|
8073
|
-
"created_at" TIMESTAMP NOT NULL DEFAULT now(),
|
|
8074
|
-
"last_updated_at" TIMESTAMP NOT NULL DEFAULT now(),
|
|
8075
|
-
"presented_at" DATE,
|
|
8076
|
-
"valid_from" DATE,
|
|
8077
|
-
"valid_until" DATE,
|
|
8078
|
-
"verified_at" DATE,
|
|
8079
|
-
"revoked_at" DATE,
|
|
8080
|
-
PRIMARY KEY ("id"),
|
|
8081
|
-
UNIQUE ("hash", "credential_role")
|
|
8082
|
-
)
|
|
8083
|
-
`);
|
|
8084
|
-
}
|
|
8085
|
-
async down(queryRunner) {
|
|
8086
|
-
await queryRunner.query(`DROP TABLE "DigitalCredential"`);
|
|
8087
|
-
await queryRunner.query(`DROP TYPE "digital_credential_state_type"`);
|
|
8088
|
-
await queryRunner.query(`DROP TYPE "digital_credential_correlation_type"`);
|
|
8089
|
-
await queryRunner.query(`DROP TYPE "digital_credential_document_format"`);
|
|
8090
|
-
await queryRunner.query(`DROP TYPE "digital_credential_credential_role"`);
|
|
8091
|
-
await queryRunner.query(`DROP TYPE "digital_regulation_type"`);
|
|
8092
|
-
await queryRunner.query(`DROP TYPE "digital_document_type"`);
|
|
8093
|
-
}
|
|
8094
|
-
};
|
|
8220
|
+
// src/migrations/generic/4-CreateStatusList.ts
|
|
8221
|
+
import Debug15 from "debug";
|
|
8095
8222
|
|
|
8096
|
-
// src/migrations/
|
|
8097
|
-
var
|
|
8223
|
+
// src/migrations/postgres/1693866470001-CreateStatusList.ts
|
|
8224
|
+
var CreateStatusList1693866470001 = class {
|
|
8098
8225
|
static {
|
|
8099
|
-
__name(this, "
|
|
8226
|
+
__name(this, "CreateStatusList1693866470001");
|
|
8100
8227
|
}
|
|
8101
|
-
name = "
|
|
8228
|
+
name = "CreateStatusList1693866470001";
|
|
8102
8229
|
async up(queryRunner) {
|
|
8103
|
-
await queryRunner.query(`
|
|
8104
|
-
|
|
8105
|
-
|
|
8106
|
-
|
|
8107
|
-
|
|
8108
|
-
|
|
8109
|
-
|
|
8110
|
-
|
|
8111
|
-
|
|
8112
|
-
|
|
8113
|
-
|
|
8114
|
-
|
|
8115
|
-
|
|
8116
|
-
|
|
8117
|
-
|
|
8118
|
-
|
|
8119
|
-
|
|
8120
|
-
|
|
8121
|
-
|
|
8122
|
-
|
|
8123
|
-
|
|
8124
|
-
|
|
8125
|
-
|
|
8126
|
-
|
|
8127
|
-
|
|
8128
|
-
|
|
8129
|
-
|
|
8130
|
-
|
|
8131
|
-
|
|
8132
|
-
|
|
8133
|
-
|
|
8134
|
-
)
|
|
8135
|
-
`);
|
|
8230
|
+
await queryRunner.query(`CREATE TYPE "StatusList_type_enum" AS ENUM('StatusList2021')`);
|
|
8231
|
+
await queryRunner.query(`CREATE TYPE "StatusList_drivertype_enum" AS ENUM('agent_typeorm', 'agent_kv_store', 'github', 'agent_filesystem')`);
|
|
8232
|
+
await queryRunner.query(`CREATE TYPE "StatusList_credentialidmode_enum" AS ENUM('ISSUANCE', 'PERSISTENCE', 'NEVER')`);
|
|
8233
|
+
await queryRunner.query(`CREATE TABLE "StatusListEntry"
|
|
8234
|
+
(
|
|
8235
|
+
"statusListId" character varying NOT NULL,
|
|
8236
|
+
"statusListIndex" integer NOT NULL,
|
|
8237
|
+
"credentialId" character varying,
|
|
8238
|
+
"credentialHash" character varying(128),
|
|
8239
|
+
"correlationId" character varying(255),
|
|
8240
|
+
"value" character varying(50),
|
|
8241
|
+
CONSTRAINT "PK_68704d2d13857360c6b44a3d1d0" PRIMARY KEY ("statusListId", "statusListIndex")
|
|
8242
|
+
)`);
|
|
8243
|
+
await queryRunner.query(`CREATE TABLE "StatusList"
|
|
8244
|
+
(
|
|
8245
|
+
"id" character varying NOT NULL,
|
|
8246
|
+
"correlationId" character varying NOT NULL,
|
|
8247
|
+
"length" integer NOT NULL,
|
|
8248
|
+
"issuer" text NOT NULL,
|
|
8249
|
+
"type" "StatusList_type_enum" NOT NULL DEFAULT 'StatusList2021',
|
|
8250
|
+
"driverType" "StatusList_drivertype_enum" NOT NULL DEFAULT 'agent_typeorm',
|
|
8251
|
+
"credentialIdMode" "StatusList_credentialidmode_enum" NOT NULL DEFAULT 'ISSUANCE',
|
|
8252
|
+
"proofFormat" character varying NOT NULL DEFAULT 'lds',
|
|
8253
|
+
"indexingDirection" character varying NOT NULL DEFAULT 'rightToLeft',
|
|
8254
|
+
"statusPurpose" character varying NOT NULL DEFAULT 'revocation',
|
|
8255
|
+
"statusListCredential" text,
|
|
8256
|
+
CONSTRAINT "UQ_correlationId" UNIQUE ("correlationId"),
|
|
8257
|
+
CONSTRAINT "PK_StatusList_Id" PRIMARY KEY ("id")
|
|
8258
|
+
)`);
|
|
8259
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry"
|
|
8260
|
+
ADD CONSTRAINT "FK_statusListEntry_statusListId" FOREIGN KEY ("statusListId") REFERENCES "StatusList" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
8136
8261
|
}
|
|
8137
8262
|
async down(queryRunner) {
|
|
8138
|
-
await queryRunner.query(`
|
|
8263
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry"
|
|
8264
|
+
DROP CONSTRAINT "FK_statusListEntry_statusListId"`);
|
|
8265
|
+
await queryRunner.query(`DROP TABLE "StatusListEntry"`);
|
|
8266
|
+
await queryRunner.query(`DROP TABLE "StatusList"`);
|
|
8267
|
+
await queryRunner.query(`DROP TYPE "StatusList_credentialidmode_enum"`);
|
|
8268
|
+
await queryRunner.query(`DROP TYPE "StatusList_drivertype_enum"`);
|
|
8269
|
+
await queryRunner.query(`DROP TYPE "StatusList_type_enum"`);
|
|
8139
8270
|
}
|
|
8140
8271
|
};
|
|
8141
8272
|
|
|
8142
|
-
// src/migrations/
|
|
8143
|
-
var
|
|
8144
|
-
var CreateDigitalCredential1708525189000 = class {
|
|
8273
|
+
// src/migrations/sqlite/1693866470000-CreateStatusList.ts
|
|
8274
|
+
var CreateStatusList1693866470002 = class {
|
|
8145
8275
|
static {
|
|
8146
|
-
__name(this, "
|
|
8276
|
+
__name(this, "CreateStatusList1693866470002");
|
|
8147
8277
|
}
|
|
8148
|
-
name = "
|
|
8278
|
+
name = "CreateStatusList1693866470002";
|
|
8149
8279
|
async up(queryRunner) {
|
|
8150
|
-
|
|
8151
|
-
|
|
8152
|
-
|
|
8153
|
-
|
|
8154
|
-
|
|
8155
|
-
|
|
8156
|
-
|
|
8157
|
-
|
|
8158
|
-
|
|
8159
|
-
|
|
8160
|
-
|
|
8161
|
-
|
|
8162
|
-
|
|
8163
|
-
|
|
8164
|
-
|
|
8165
|
-
|
|
8166
|
-
|
|
8167
|
-
|
|
8168
|
-
|
|
8169
|
-
|
|
8170
|
-
|
|
8171
|
-
|
|
8280
|
+
await queryRunner.query(`CREATE TABLE "StatusListEntry"
|
|
8281
|
+
(
|
|
8282
|
+
"statusListId" varchar NOT NULL,
|
|
8283
|
+
"statusListIndex" integer NOT NULL,
|
|
8284
|
+
"credentialId" varchar,
|
|
8285
|
+
"credentialHash" varchar(128),
|
|
8286
|
+
"correlationId" varchar(255),
|
|
8287
|
+
"value" varchar(50),
|
|
8288
|
+
PRIMARY KEY ("statusListId", "statusListIndex")
|
|
8289
|
+
)`);
|
|
8290
|
+
await queryRunner.query(`CREATE TABLE "StatusList"
|
|
8291
|
+
(
|
|
8292
|
+
"id" varchar PRIMARY KEY NOT NULL,
|
|
8293
|
+
"correlationId" varchar NOT NULL,
|
|
8294
|
+
"length" integer NOT NULL,
|
|
8295
|
+
"issuer" text NOT NULL,
|
|
8296
|
+
"type" varchar CHECK ( "type" IN ('StatusList2021') ) NOT NULL DEFAULT ('StatusList2021'),
|
|
8297
|
+
"driverType" varchar CHECK ( "driverType" IN ('agent_typeorm', 'agent_kv_store', 'github',
|
|
8298
|
+
'agent_filesystem') ) NOT NULL DEFAULT ('agent_typeorm'),
|
|
8299
|
+
"credentialIdMode" varchar CHECK ( "credentialIdMode" IN ('ISSUANCE', 'PERSISTENCE', 'NEVER') ) NOT NULL DEFAULT ('ISSUANCE'),
|
|
8300
|
+
"proofFormat" varchar CHECK ( "proofFormat" IN ('lds', 'jwt') ) NOT NULL DEFAULT ('lds'),
|
|
8301
|
+
"indexingDirection" varchar CHECK ( "indexingDirection" IN ('rightToLeft') ) NOT NULL DEFAULT ('rightToLeft'),
|
|
8302
|
+
"statusPurpose" varchar NOT NULL DEFAULT ('revocation'),
|
|
8303
|
+
"statusListCredential" text,
|
|
8304
|
+
CONSTRAINT "UQ_correlationId" UNIQUE ("correlationId")
|
|
8305
|
+
)`);
|
|
8306
|
+
await queryRunner.query(`CREATE TABLE "temporary_StatusListEntry"
|
|
8307
|
+
(
|
|
8308
|
+
"statusListId" varchar NOT NULL,
|
|
8309
|
+
"statusListIndex" integer NOT NULL,
|
|
8310
|
+
"credentialId" varchar,
|
|
8311
|
+
"credentialHash" varchar(128),
|
|
8312
|
+
"correlationId" varchar(255),
|
|
8313
|
+
"value" varchar(50),
|
|
8314
|
+
CONSTRAINT "FK_statusListEntry_statusListId" FOREIGN KEY ("statusListId") REFERENCES "StatusList" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION,
|
|
8315
|
+
PRIMARY KEY ("statusListId", "statusListIndex")
|
|
8316
|
+
)`);
|
|
8317
|
+
await queryRunner.query(`INSERT INTO "temporary_StatusListEntry"("statusListId", "statusListIndex", "credentialId",
|
|
8318
|
+
"credentialHash", "correlationId", "value")
|
|
8319
|
+
SELECT "statusListId", "statusListIndex", "credentialId", "credentialHash", "correlationId", "value"
|
|
8320
|
+
FROM "StatusListEntry"`);
|
|
8321
|
+
await queryRunner.query(`DROP TABLE "StatusListEntry"`);
|
|
8322
|
+
await queryRunner.query(`ALTER TABLE "temporary_StatusListEntry" RENAME TO "StatusListEntry"`);
|
|
8172
8323
|
}
|
|
8173
8324
|
async down(queryRunner) {
|
|
8174
|
-
|
|
8175
|
-
|
|
8176
|
-
switch (dbType) {
|
|
8177
|
-
case "postgres": {
|
|
8178
|
-
debug13("using postgres migration file for DigitalCredential");
|
|
8179
|
-
const mig = new CreateDigitalCredential1708525189001();
|
|
8180
|
-
await mig.down(queryRunner);
|
|
8181
|
-
debug13("Postgres Migration statements for DigitalCredential reverted");
|
|
8182
|
-
return;
|
|
8183
|
-
}
|
|
8184
|
-
case "sqlite":
|
|
8185
|
-
case "expo":
|
|
8186
|
-
case "react-native": {
|
|
8187
|
-
debug13("using sqlite/react-native migration file for DigitalCredential");
|
|
8188
|
-
const mig = new CreateDigitalCredential1708525189002();
|
|
8189
|
-
await mig.down(queryRunner);
|
|
8190
|
-
debug13("SQLite Migration statements for DigitalCredential reverted");
|
|
8191
|
-
return;
|
|
8192
|
-
}
|
|
8193
|
-
default:
|
|
8194
|
-
return Promise.reject(`Migrations are currently only supported for sqlite, react-native, expo, and postgres for DigitalCredential. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`);
|
|
8195
|
-
}
|
|
8325
|
+
await queryRunner.query(`DROP TABLE "StatusListEntry"`);
|
|
8326
|
+
await queryRunner.query(`DROP TABLE "StatusList"`);
|
|
8196
8327
|
}
|
|
8197
8328
|
};
|
|
8198
8329
|
|
|
8199
|
-
// src/migrations/
|
|
8200
|
-
|
|
8201
|
-
|
|
8202
|
-
// src/migrations/postgres/1708797018115-CreateMachineStateStore.ts
|
|
8203
|
-
var CreateMachineStateStore1708797018115 = class {
|
|
8330
|
+
// src/migrations/postgres/1737110469001-UpdateStatusList.ts
|
|
8331
|
+
var UpdateStatusList1737110469001 = class {
|
|
8204
8332
|
static {
|
|
8205
|
-
__name(this, "
|
|
8333
|
+
__name(this, "UpdateStatusList1737110469001");
|
|
8206
8334
|
}
|
|
8207
|
-
name = "
|
|
8335
|
+
name = "UpdateStatusList1737110469001";
|
|
8208
8336
|
async up(queryRunner) {
|
|
8209
|
-
await queryRunner.query(`
|
|
8210
|
-
|
|
8211
|
-
|
|
8212
|
-
|
|
8213
|
-
|
|
8214
|
-
"machine_name" text NOT NULL,
|
|
8215
|
-
"latest_event_type" text NOT NULL,
|
|
8216
|
-
"state" text NOT NULL,
|
|
8217
|
-
"created_at" TIMESTAMP NOT NULL DEFAULT now(),
|
|
8218
|
-
"updated_at" TIMESTAMP NOT NULL DEFAULT now(),
|
|
8219
|
-
"updated_count" integer NOT NULL DEFAULT 0,
|
|
8220
|
-
"expires_at" TIMESTAMP,
|
|
8221
|
-
"completed_at" TIMESTAMP,
|
|
8222
|
-
"tenant_id" text,
|
|
8223
|
-
CONSTRAINT "PK_MachineStateInfoEntity_id" PRIMARY KEY ("instance_id")
|
|
8224
|
-
)
|
|
8225
|
-
`);
|
|
8337
|
+
await queryRunner.query(`ALTER TYPE "StatusList_type_enum" ADD VALUE 'OAuthStatusList'`);
|
|
8338
|
+
await queryRunner.query(`ALTER TABLE "StatusList" ALTER COLUMN "indexingDirection" DROP NOT NULL`);
|
|
8339
|
+
await queryRunner.query(`ALTER TABLE "StatusList" ALTER COLUMN "statusPurpose" DROP NOT NULL`);
|
|
8340
|
+
await queryRunner.query(`ALTER TABLE "StatusList" ADD "bitsPerStatus" integer DEFAULT 1`);
|
|
8341
|
+
await queryRunner.query(`ALTER TABLE "StatusList" ADD "expiresAt" timestamp with time zone`);
|
|
8226
8342
|
}
|
|
8227
8343
|
async down(queryRunner) {
|
|
8228
|
-
await queryRunner.query(`
|
|
8344
|
+
await queryRunner.query(`ALTER TABLE "StatusList" DROP COLUMN "expiresAt"`);
|
|
8345
|
+
await queryRunner.query(`ALTER TABLE "StatusList" DROP COLUMN "bitsPerStatus"`);
|
|
8346
|
+
await queryRunner.query(`ALTER TABLE "StatusList" ALTER COLUMN "statusPurpose" SET NOT NULL`);
|
|
8347
|
+
await queryRunner.query(`ALTER TABLE "StatusList" ALTER COLUMN "indexingDirection" SET NOT NULL`);
|
|
8229
8348
|
}
|
|
8230
8349
|
};
|
|
8231
8350
|
|
|
8232
|
-
// src/migrations/sqlite/
|
|
8233
|
-
var
|
|
8351
|
+
// src/migrations/sqlite/1737110469000-UpdateStatusList.ts
|
|
8352
|
+
var UpdateStatusList1737110469000 = class {
|
|
8234
8353
|
static {
|
|
8235
|
-
__name(this, "
|
|
8354
|
+
__name(this, "UpdateStatusList1737110469000");
|
|
8236
8355
|
}
|
|
8237
|
-
name = "
|
|
8356
|
+
name = "UpdateStatusList1737110469000";
|
|
8238
8357
|
async up(queryRunner) {
|
|
8239
|
-
await queryRunner.query(`
|
|
8240
|
-
|
|
8241
|
-
"
|
|
8242
|
-
"
|
|
8243
|
-
"
|
|
8244
|
-
"
|
|
8245
|
-
"
|
|
8246
|
-
"
|
|
8247
|
-
"
|
|
8248
|
-
"
|
|
8249
|
-
"
|
|
8250
|
-
"
|
|
8251
|
-
"
|
|
8252
|
-
"
|
|
8358
|
+
await queryRunner.query(`CREATE TABLE "temporary_StatusList" (
|
|
8359
|
+
"id" varchar PRIMARY KEY NOT NULL,
|
|
8360
|
+
"correlationId" varchar NOT NULL,
|
|
8361
|
+
"length" integer NOT NULL,
|
|
8362
|
+
"issuer" text NOT NULL,
|
|
8363
|
+
"type" varchar CHECK( "type" IN ('StatusList2021', 'OAuthStatusList') ) NOT NULL DEFAULT ('StatusList2021'),
|
|
8364
|
+
"driverType" varchar CHECK( "driverType" IN ('agent_typeorm','agent_kv_store','github','agent_filesystem') ) NOT NULL DEFAULT ('agent_typeorm'),
|
|
8365
|
+
"credentialIdMode" varchar CHECK( "credentialIdMode" IN ('ISSUANCE','PERSISTENCE','NEVER') ) NOT NULL DEFAULT ('ISSUANCE'),
|
|
8366
|
+
"proofFormat" varchar CHECK( "proofFormat" IN ('lds','jwt') ) NOT NULL DEFAULT ('lds'),
|
|
8367
|
+
"indexingDirection" varchar CHECK( "indexingDirection" IN ('rightToLeft') ),
|
|
8368
|
+
"statusPurpose" varchar,
|
|
8369
|
+
"statusListCredential" text,
|
|
8370
|
+
"bitsPerStatus" integer,
|
|
8371
|
+
"expiresAt" datetime,
|
|
8372
|
+
CONSTRAINT "UQ_correlationId" UNIQUE ("correlationId")
|
|
8373
|
+
)`);
|
|
8374
|
+
await queryRunner.query(`INSERT INTO "temporary_StatusList"(
|
|
8375
|
+
"id", "correlationId", "length", "issuer", "type", "driverType",
|
|
8376
|
+
"credentialIdMode", "proofFormat", "indexingDirection", "statusPurpose",
|
|
8377
|
+
"statusListCredential"
|
|
8253
8378
|
)
|
|
8254
|
-
|
|
8379
|
+
SELECT
|
|
8380
|
+
"id", "correlationId", "length", "issuer", "type", "driverType",
|
|
8381
|
+
"credentialIdMode", "proofFormat", "indexingDirection", "statusPurpose",
|
|
8382
|
+
"statusListCredential"
|
|
8383
|
+
FROM "StatusList"`);
|
|
8384
|
+
await queryRunner.query(`DROP TABLE "StatusList"`);
|
|
8385
|
+
await queryRunner.query(`ALTER TABLE "temporary_StatusList" RENAME TO "StatusList"`);
|
|
8255
8386
|
}
|
|
8256
8387
|
async down(queryRunner) {
|
|
8257
|
-
await queryRunner.query(`
|
|
8388
|
+
await queryRunner.query(`
|
|
8389
|
+
ALTER TABLE "StatusListEntry"
|
|
8390
|
+
RENAME COLUMN "entryCorrelationId" TO "correlationId"
|
|
8391
|
+
`);
|
|
8392
|
+
await queryRunner.query(`
|
|
8393
|
+
ALTER TABLE "StatusListEntry"
|
|
8394
|
+
DROP COLUMN "statusListCorrelationId"
|
|
8395
|
+
`);
|
|
8396
|
+
await queryRunner.query(`CREATE TABLE "temporary_StatusList" (
|
|
8397
|
+
"id" varchar PRIMARY KEY NOT NULL,
|
|
8398
|
+
"correlationId" varchar NOT NULL,
|
|
8399
|
+
"length" integer NOT NULL,
|
|
8400
|
+
"issuer" text NOT NULL,
|
|
8401
|
+
"type" varchar CHECK( "type" IN ('StatusList2021') ) NOT NULL DEFAULT ('StatusList2021'),
|
|
8402
|
+
"driverType" varchar CHECK( "driverType" IN ('agent_typeorm','agent_kv_store','github','agent_filesystem') ) NOT NULL DEFAULT ('agent_typeorm'),
|
|
8403
|
+
"credentialIdMode" varchar CHECK( "credentialIdMode" IN ('ISSUANCE','PERSISTENCE','NEVER') ) NOT NULL DEFAULT ('ISSUANCE'),
|
|
8404
|
+
"proofFormat" varchar CHECK( "proofFormat" IN ('lds','jwt') ) NOT NULL DEFAULT ('lds'),
|
|
8405
|
+
"indexingDirection" varchar CHECK( "indexingDirection" IN ('rightToLeft') ) NOT NULL DEFAULT ('rightToLeft'),
|
|
8406
|
+
"statusPurpose" varchar NOT NULL DEFAULT ('revocation'),
|
|
8407
|
+
"statusListCredential" text,
|
|
8408
|
+
CONSTRAINT "UQ_correlationId" UNIQUE ("correlationId")
|
|
8409
|
+
)`);
|
|
8410
|
+
await queryRunner.query(`INSERT INTO "temporary_StatusList"(
|
|
8411
|
+
"id", "correlationId", "length", "issuer", "type", "driverType",
|
|
8412
|
+
"credentialIdMode", "proofFormat", "indexingDirection", "statusPurpose",
|
|
8413
|
+
"statusListCredential"
|
|
8414
|
+
)
|
|
8415
|
+
SELECT
|
|
8416
|
+
"id", "correlationId", "length", "issuer",
|
|
8417
|
+
CASE WHEN "type" = 'OAuthStatusList' THEN 'StatusList2021' ELSE "type" END,
|
|
8418
|
+
"driverType", "credentialIdMode", "proofFormat", "indexingDirection",
|
|
8419
|
+
COALESCE("statusPurpose", 'revocation'), "statusListCredential"
|
|
8420
|
+
FROM "StatusList"`);
|
|
8421
|
+
await queryRunner.query(`DROP TABLE "StatusList"`);
|
|
8422
|
+
await queryRunner.query(`ALTER TABLE "temporary_StatusList" RENAME TO "StatusList"`);
|
|
8258
8423
|
}
|
|
8259
8424
|
};
|
|
8260
8425
|
|
|
8261
|
-
// src/migrations/generic/
|
|
8262
|
-
var
|
|
8263
|
-
var
|
|
8426
|
+
// src/migrations/generic/4-CreateStatusList.ts
|
|
8427
|
+
var debug15 = Debug15("sphereon:ssi-sdk:migrations");
|
|
8428
|
+
var CreateStatusList1693866470000 = class {
|
|
8264
8429
|
static {
|
|
8265
|
-
__name(this, "
|
|
8266
|
-
}
|
|
8267
|
-
name = "
|
|
8268
|
-
async up(queryRunner) {
|
|
8269
|
-
|
|
8270
|
-
const dbType = queryRunner.connection.driver.options.type;
|
|
8271
|
-
|
|
8272
|
-
|
|
8273
|
-
|
|
8274
|
-
|
|
8275
|
-
|
|
8276
|
-
|
|
8277
|
-
|
|
8278
|
-
|
|
8279
|
-
|
|
8280
|
-
|
|
8281
|
-
|
|
8282
|
-
|
|
8283
|
-
|
|
8284
|
-
|
|
8285
|
-
|
|
8286
|
-
|
|
8287
|
-
|
|
8288
|
-
|
|
8289
|
-
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`);
|
|
8430
|
+
__name(this, "CreateStatusList1693866470000");
|
|
8431
|
+
}
|
|
8432
|
+
name = "CreateStatusList1693866470000";
|
|
8433
|
+
async up(queryRunner) {
|
|
8434
|
+
debug15("migration: creating issuance branding tables");
|
|
8435
|
+
const dbType = queryRunner.connection.driver.options.type;
|
|
8436
|
+
if (dbType === "postgres") {
|
|
8437
|
+
debug15("using postgres migration files");
|
|
8438
|
+
const createMig = new CreateStatusList1693866470001();
|
|
8439
|
+
await createMig.up(queryRunner);
|
|
8440
|
+
const updateMig = new UpdateStatusList1737110469001();
|
|
8441
|
+
const up = await updateMig.up(queryRunner);
|
|
8442
|
+
debug15("Migration statements executed");
|
|
8443
|
+
return up;
|
|
8444
|
+
} else if (dbType === "sqlite" || dbType === "react-native" || dbType === "expo") {
|
|
8445
|
+
debug15("using sqlite/react-native migration files");
|
|
8446
|
+
const createMig = new CreateStatusList1693866470002();
|
|
8447
|
+
await createMig.up(queryRunner);
|
|
8448
|
+
const updateMig = new UpdateStatusList1737110469000();
|
|
8449
|
+
const up = await updateMig.up(queryRunner);
|
|
8450
|
+
debug15("Migration statements executed");
|
|
8451
|
+
return up;
|
|
8452
|
+
} else {
|
|
8453
|
+
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`);
|
|
8290
8454
|
}
|
|
8291
8455
|
}
|
|
8292
8456
|
async down(queryRunner) {
|
|
8293
|
-
|
|
8457
|
+
debug15("migration: reverting issuance branding tables");
|
|
8294
8458
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8295
|
-
|
|
8296
|
-
|
|
8297
|
-
|
|
8298
|
-
|
|
8299
|
-
|
|
8300
|
-
|
|
8301
|
-
|
|
8302
|
-
|
|
8303
|
-
|
|
8304
|
-
|
|
8305
|
-
|
|
8306
|
-
|
|
8307
|
-
|
|
8308
|
-
|
|
8309
|
-
|
|
8310
|
-
|
|
8311
|
-
|
|
8312
|
-
|
|
8313
|
-
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`);
|
|
8459
|
+
if (dbType === "postgres") {
|
|
8460
|
+
debug15("using postgres migration files");
|
|
8461
|
+
const updateMig = new UpdateStatusList1737110469001();
|
|
8462
|
+
await updateMig.down(queryRunner);
|
|
8463
|
+
const createMig = new CreateStatusList1693866470001();
|
|
8464
|
+
const down = await createMig.down(queryRunner);
|
|
8465
|
+
debug15("Migration statements executed");
|
|
8466
|
+
return down;
|
|
8467
|
+
} else if (dbType === "sqlite" || dbType === "react-native" || dbType === "expo") {
|
|
8468
|
+
debug15("using sqlite/react-native migration files");
|
|
8469
|
+
const updateMig = new UpdateStatusList1737110469000();
|
|
8470
|
+
await updateMig.down(queryRunner);
|
|
8471
|
+
const createMig = new CreateStatusList1693866470002();
|
|
8472
|
+
const down = await createMig.down(queryRunner);
|
|
8473
|
+
debug15("Migration statements executed");
|
|
8474
|
+
return down;
|
|
8475
|
+
} else {
|
|
8476
|
+
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`);
|
|
8314
8477
|
}
|
|
8315
8478
|
}
|
|
8316
8479
|
};
|
|
8317
8480
|
|
|
8318
|
-
// src/migrations/generic/
|
|
8319
|
-
import
|
|
8481
|
+
// src/migrations/generic/5-CreateAuditEvents.ts
|
|
8482
|
+
import Debug16 from "debug";
|
|
8320
8483
|
|
|
8321
|
-
// src/migrations/
|
|
8322
|
-
var
|
|
8484
|
+
// src/migrations/sqlite/1701634819487-CreateAuditEvents.ts
|
|
8485
|
+
var CreateAuditEvents1701634819487 = class {
|
|
8323
8486
|
static {
|
|
8324
|
-
__name(this, "
|
|
8487
|
+
__name(this, "CreateAuditEvents1701634819487");
|
|
8325
8488
|
}
|
|
8326
|
-
name = "
|
|
8489
|
+
name = "CreateAuditEvents1701634819487";
|
|
8327
8490
|
async up(queryRunner) {
|
|
8328
|
-
await queryRunner.query(`
|
|
8329
|
-
|
|
8330
|
-
|
|
8331
|
-
|
|
8332
|
-
|
|
8333
|
-
|
|
8334
|
-
|
|
8335
|
-
|
|
8336
|
-
|
|
8337
|
-
|
|
8338
|
-
|
|
8339
|
-
|
|
8340
|
-
|
|
8341
|
-
|
|
8342
|
-
|
|
8343
|
-
|
|
8344
|
-
|
|
8345
|
-
|
|
8491
|
+
await queryRunner.query(`CREATE TABLE "AuditEvents" (
|
|
8492
|
+
"id" varchar PRIMARY KEY NOT NULL,
|
|
8493
|
+
"eventType" varchar CHECK( "eventType" IN ('audit','activity','general') ) NOT NULL,
|
|
8494
|
+
"timestamp" datetime NOT NULL,
|
|
8495
|
+
"level" varchar CHECK( "level" IN ('0','1','2','3','4') ) NOT NULL,
|
|
8496
|
+
"correlationId" varchar NOT NULL,
|
|
8497
|
+
"system" varchar CHECK( "system" IN ('general','kms','identity','oid4vci','oid4vp','siopv2','PE','credentials','web3','profile','contact') ) NOT NULL,
|
|
8498
|
+
"subSystemType" varchar CHECK( "subSystemType" IN ('key','did_provider','did_resolver','oid4vp_op','oid4vci_client','siopv2_op','contact_manager','vc_issuer','vc_verifier','vc_persistence','transport','profile','api') ) NOT NULL,
|
|
8499
|
+
"actionType" varchar CHECK( "actionType" IN ('create','read','update','delete','execute') ) NOT NULL,
|
|
8500
|
+
"actionSubType" varchar NOT NULL,
|
|
8501
|
+
"initiatorType" varchar CHECK( "initiatorType" IN ('user','system','external') ) NOT NULL,
|
|
8502
|
+
"systemCorrelationIdType" varchar CHECK( "systemCorrelationIdType" IN ('did','url','email','hostname','phone','user') ),
|
|
8503
|
+
"systemCorrelationId" varchar,
|
|
8504
|
+
"systemAlias" varchar,
|
|
8505
|
+
"partyCorrelationType" varchar CHECK( "partyCorrelationType" IN ('did','url','email','hostname','phone') ),
|
|
8506
|
+
"partyCorrelationId" varchar,
|
|
8507
|
+
"partyAlias" varchar,
|
|
8508
|
+
"credentialType" varchar CHECK( "credentialType" IN ('JSON_LD','JWT','SD_JWT','MSO_MDOC') ),
|
|
8509
|
+
"credentialHash" varchar,
|
|
8510
|
+
"parentCredentialHash" varchar,
|
|
8511
|
+
"originalCredential" varchar,
|
|
8512
|
+
"sharePurpose" varchar,
|
|
8513
|
+
"description" varchar NOT NULL,
|
|
8514
|
+
"data" varchar,
|
|
8515
|
+
"diagnosticData" varchar,
|
|
8516
|
+
"created_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
8517
|
+
"last_updated_at" datetime NOT NULL DEFAULT (datetime('now')))`);
|
|
8346
8518
|
}
|
|
8347
8519
|
async down(queryRunner) {
|
|
8348
|
-
await queryRunner.query(`
|
|
8349
|
-
await queryRunner.query(`ALTER TABLE "PhysicalAddress" DROP COLUMN "owner_id"`);
|
|
8350
|
-
await queryRunner.query(`ALTER TABLE "ElectronicAddress" DROP COLUMN "tenant_id"`);
|
|
8351
|
-
await queryRunner.query(`ALTER TABLE "ElectronicAddress" DROP COLUMN "owner_id"`);
|
|
8352
|
-
await queryRunner.query(`ALTER TABLE "PartyRelationship" DROP COLUMN "tenant_id"`);
|
|
8353
|
-
await queryRunner.query(`ALTER TABLE "PartyRelationship" DROP COLUMN "owner_id"`);
|
|
8354
|
-
await queryRunner.query(`ALTER TABLE "BaseContact" DROP COLUMN "tenant_id"`);
|
|
8355
|
-
await queryRunner.query(`ALTER TABLE "BaseContact" DROP COLUMN "owner_id"`);
|
|
8356
|
-
await queryRunner.query(`ALTER TABLE "BaseConfig" DROP COLUMN "tenant_id"`);
|
|
8357
|
-
await queryRunner.query(`ALTER TABLE "BaseConfig" DROP COLUMN "owner_id"`);
|
|
8358
|
-
await queryRunner.query(`ALTER TABLE "Connection" DROP COLUMN "tenant_id"`);
|
|
8359
|
-
await queryRunner.query(`ALTER TABLE "Connection" DROP COLUMN "owner_id"`);
|
|
8360
|
-
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" DROP COLUMN "tenant_id"`);
|
|
8361
|
-
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" DROP COLUMN "owner_id"`);
|
|
8362
|
-
await queryRunner.query(`ALTER TABLE "Identity" DROP COLUMN "tenant_id"`);
|
|
8363
|
-
await queryRunner.query(`ALTER TABLE "Identity" DROP COLUMN "owner_id"`);
|
|
8364
|
-
await queryRunner.query(`ALTER TABLE "Party" DROP COLUMN "tenant_id"`);
|
|
8365
|
-
await queryRunner.query(`ALTER TABLE "Party" DROP COLUMN "owner_id"`);
|
|
8520
|
+
await queryRunner.query(`DROP TABLE "AuditEvents"`);
|
|
8366
8521
|
}
|
|
8367
8522
|
};
|
|
8368
8523
|
|
|
8369
|
-
// src/migrations/
|
|
8370
|
-
var
|
|
8524
|
+
// src/migrations/postgres/1701634812183-CreateAuditEvents.ts
|
|
8525
|
+
var CreateAuditEvents1701634812183 = class {
|
|
8371
8526
|
static {
|
|
8372
|
-
__name(this, "
|
|
8527
|
+
__name(this, "CreateAuditEvents1701634812183");
|
|
8373
8528
|
}
|
|
8374
|
-
name = "
|
|
8529
|
+
name = "CreateAuditEvents1701634812183";
|
|
8375
8530
|
async up(queryRunner) {
|
|
8376
|
-
await queryRunner.query(`
|
|
8377
|
-
await queryRunner.query(`
|
|
8378
|
-
await queryRunner.query(`CREATE
|
|
8379
|
-
|
|
8380
|
-
|
|
8381
|
-
|
|
8382
|
-
|
|
8383
|
-
|
|
8384
|
-
|
|
8385
|
-
|
|
8386
|
-
|
|
8387
|
-
|
|
8388
|
-
|
|
8389
|
-
|
|
8390
|
-
|
|
8391
|
-
|
|
8392
|
-
|
|
8393
|
-
|
|
8394
|
-
|
|
8395
|
-
|
|
8396
|
-
|
|
8397
|
-
|
|
8398
|
-
|
|
8399
|
-
|
|
8400
|
-
|
|
8401
|
-
|
|
8402
|
-
|
|
8403
|
-
|
|
8404
|
-
|
|
8405
|
-
|
|
8406
|
-
|
|
8407
|
-
|
|
8408
|
-
|
|
8531
|
+
await queryRunner.query(`CREATE TYPE "public"."Level_enum" AS ENUM('0', '1', '2', '3', '4')`);
|
|
8532
|
+
await queryRunner.query(`CREATE TYPE "public"."System_enum" AS ENUM('general', 'kms', 'identity', 'oid4vci', 'oid4vp', 'siopv2', 'PE', 'credentials', 'web3', 'profile', 'contact')`);
|
|
8533
|
+
await queryRunner.query(`CREATE TYPE "public"."Subsystem_type_enum" AS ENUM('key', 'did_provider', 'did_resolver', 'oid4vp_op', 'oid4vci_client', 'siopv2_op', 'contact_manager', 'vc_issuer', 'vc_verifier', 'vc_persistence', 'transport', 'profile', 'api')`);
|
|
8534
|
+
await queryRunner.query(`CREATE TYPE "public"."Action_type_enum" AS ENUM('create', 'read', 'update', 'delete', 'execute')`);
|
|
8535
|
+
await queryRunner.query(`CREATE TYPE "public"."Initiator_type_enum" AS ENUM('user', 'system', 'external')`);
|
|
8536
|
+
await queryRunner.query(`CREATE TYPE "public"."System_correlation_id_type_enum" AS ENUM('did', 'url', 'email', 'hostname', 'phone', 'user')`);
|
|
8537
|
+
await queryRunner.query(`CREATE TYPE "public"."Party_correlation_type_enum" AS ENUM('did', 'url', 'email', 'hostname', 'phone')`);
|
|
8538
|
+
await queryRunner.query(`CREATE TYPE "public"."Event_type_enum" AS ENUM('audit', 'activity', 'general')`);
|
|
8539
|
+
await queryRunner.query(`CREATE TYPE "public"."Event_credential_type_enum" AS ENUM('JSON_LD', 'JWT', 'SD_JWT', 'MSO_MDOC')`);
|
|
8540
|
+
await queryRunner.query(`CREATE TABLE "AuditEvents" (
|
|
8541
|
+
"id" uuid NOT NULL DEFAULT uuid_generate_v4(),
|
|
8542
|
+
"eventType" "public"."Event_type_enum" NOT NULL,
|
|
8543
|
+
"timestamp" TIMESTAMP NOT NULL,
|
|
8544
|
+
"level" "public"."Level_enum" NOT NULL,
|
|
8545
|
+
"correlationId" TEXT NOT NULL,
|
|
8546
|
+
"system" "public"."System_enum" NOT NULL,
|
|
8547
|
+
"subSystemType" "public"."Subsystem_type_enum" NOT NULL,
|
|
8548
|
+
"actionType" "public"."Action_type_enum" NOT NULL,
|
|
8549
|
+
"actionSubType" TEXT NOT NULL,
|
|
8550
|
+
"initiatorType" "public"."Initiator_type_enum" NOT NULL,
|
|
8551
|
+
"systemCorrelationIdType" "public"."System_correlation_id_type_enum",
|
|
8552
|
+
"systemCorrelationId" TEXT,
|
|
8553
|
+
"systemAlias" TEXT,
|
|
8554
|
+
"partyCorrelationType" "public"."Party_correlation_type_enum",
|
|
8555
|
+
"partyCorrelationId" TEXT,
|
|
8556
|
+
"partyAlias" TEXT,
|
|
8557
|
+
"credentialType" "public"."Event_credential_type_enum",
|
|
8558
|
+
"credentialHash" TEXT,
|
|
8559
|
+
"originalCredential" TEXT,
|
|
8560
|
+
"sharePurpose" TEXT,
|
|
8561
|
+
"description" TEXT NOT NULL,
|
|
8562
|
+
"data" TEXT,
|
|
8563
|
+
"diagnosticData" TEXT,
|
|
8564
|
+
"created_at" TIMESTAMP NOT NULL DEFAULT now(),
|
|
8565
|
+
"last_updated_at" TIMESTAMP NOT NULL DEFAULT now(),
|
|
8566
|
+
CONSTRAINT "PK_AuditEvents_id" PRIMARY KEY ("id"))`);
|
|
8409
8567
|
}
|
|
8410
8568
|
async down(queryRunner) {
|
|
8411
|
-
await queryRunner.query(`
|
|
8412
|
-
await queryRunner.query(`
|
|
8413
|
-
await queryRunner.query(`
|
|
8414
|
-
await queryRunner.query(`
|
|
8415
|
-
await queryRunner.query(`
|
|
8416
|
-
await queryRunner.query(`
|
|
8417
|
-
await queryRunner.query(`
|
|
8418
|
-
await queryRunner.query(`
|
|
8419
|
-
await queryRunner.query(`ALTER TABLE "BaseConfig" DROP COLUMN "tenant_id"`);
|
|
8420
|
-
await queryRunner.query(`ALTER TABLE "BaseConfig" DROP COLUMN "owner_id"`);
|
|
8421
|
-
await queryRunner.query(`ALTER TABLE "Connection" DROP COLUMN "tenant_id"`);
|
|
8422
|
-
await queryRunner.query(`ALTER TABLE "Connection" DROP COLUMN "owner_id"`);
|
|
8423
|
-
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" DROP COLUMN "tenant_id"`);
|
|
8424
|
-
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" DROP COLUMN "owner_id"`);
|
|
8425
|
-
await queryRunner.query(`ALTER TABLE "Identity" DROP COLUMN "tenant_id"`);
|
|
8426
|
-
await queryRunner.query(`ALTER TABLE "Identity" DROP COLUMN "owner_id"`);
|
|
8427
|
-
await queryRunner.query(`ALTER TABLE "Party" DROP COLUMN "tenant_id"`);
|
|
8428
|
-
await queryRunner.query(`ALTER TABLE "Party" DROP COLUMN "owner_id"`);
|
|
8569
|
+
await queryRunner.query(`DROP TABLE "AuditEvents"`);
|
|
8570
|
+
await queryRunner.query(`DROP TYPE "public"."Party_correlation_type_enum"`);
|
|
8571
|
+
await queryRunner.query(`DROP TYPE "public"."System_correlation_id_type_enum"`);
|
|
8572
|
+
await queryRunner.query(`DROP TYPE "public"."Initiator_type_enum"`);
|
|
8573
|
+
await queryRunner.query(`DROP TYPE "public"."Action_type_enum"`);
|
|
8574
|
+
await queryRunner.query(`DROP TYPE "public"."Subsystem_type_enum"`);
|
|
8575
|
+
await queryRunner.query(`DROP TYPE "public"."System_enum"`);
|
|
8576
|
+
await queryRunner.query(`DROP TYPE "public"."Level_enum"`);
|
|
8429
8577
|
}
|
|
8430
8578
|
};
|
|
8431
8579
|
|
|
8432
|
-
// src/migrations/generic/
|
|
8433
|
-
var
|
|
8434
|
-
var
|
|
8580
|
+
// src/migrations/generic/5-CreateAuditEvents.ts
|
|
8581
|
+
var debug16 = Debug16("sphereon:ssi-sdk:migrations");
|
|
8582
|
+
var CreateAuditEvents1701635835330 = class {
|
|
8435
8583
|
static {
|
|
8436
|
-
__name(this, "
|
|
8584
|
+
__name(this, "CreateAuditEvents1701635835330");
|
|
8437
8585
|
}
|
|
8438
|
-
name = "
|
|
8586
|
+
name = "CreateAuditEvents1701635835330";
|
|
8439
8587
|
async up(queryRunner) {
|
|
8440
|
-
|
|
8588
|
+
debug16("migration: creating audit events tables");
|
|
8441
8589
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8442
8590
|
switch (dbType) {
|
|
8443
8591
|
case "postgres": {
|
|
8444
|
-
|
|
8445
|
-
const mig = new
|
|
8592
|
+
debug16("using postgres migration file");
|
|
8593
|
+
const mig = new CreateAuditEvents1701634812183();
|
|
8446
8594
|
await mig.up(queryRunner);
|
|
8447
|
-
|
|
8595
|
+
debug16("Migration statements executed");
|
|
8448
8596
|
return;
|
|
8449
8597
|
}
|
|
8450
8598
|
case "sqlite":
|
|
8451
8599
|
case "expo":
|
|
8452
8600
|
case "react-native": {
|
|
8453
|
-
|
|
8454
|
-
const mig = new
|
|
8601
|
+
debug16("using sqlite/react-native migration file");
|
|
8602
|
+
const mig = new CreateAuditEvents1701634819487();
|
|
8455
8603
|
await mig.up(queryRunner);
|
|
8456
|
-
|
|
8604
|
+
debug16("Migration statements executed");
|
|
8457
8605
|
return;
|
|
8458
8606
|
}
|
|
8459
8607
|
default:
|
|
@@ -8461,23 +8609,23 @@ var CreateContacts1708525189000 = class {
|
|
|
8461
8609
|
}
|
|
8462
8610
|
}
|
|
8463
8611
|
async down(queryRunner) {
|
|
8464
|
-
|
|
8612
|
+
debug16("migration: reverting audit events tables");
|
|
8465
8613
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8466
8614
|
switch (dbType) {
|
|
8467
8615
|
case "postgres": {
|
|
8468
|
-
|
|
8469
|
-
const mig = new
|
|
8616
|
+
debug16("using postgres migration file");
|
|
8617
|
+
const mig = new CreateAuditEvents1701634812183();
|
|
8470
8618
|
await mig.down(queryRunner);
|
|
8471
|
-
|
|
8619
|
+
debug16("Migration statements executed");
|
|
8472
8620
|
return;
|
|
8473
8621
|
}
|
|
8474
8622
|
case "sqlite":
|
|
8475
8623
|
case "expo":
|
|
8476
8624
|
case "react-native": {
|
|
8477
|
-
|
|
8478
|
-
const mig = new
|
|
8625
|
+
debug16("using sqlite/react-native migration file");
|
|
8626
|
+
const mig = new CreateAuditEvents1701634819487();
|
|
8479
8627
|
await mig.down(queryRunner);
|
|
8480
|
-
|
|
8628
|
+
debug16("Migration statements executed");
|
|
8481
8629
|
return;
|
|
8482
8630
|
}
|
|
8483
8631
|
default:
|
|
@@ -8486,254 +8634,258 @@ var CreateContacts1708525189000 = class {
|
|
|
8486
8634
|
}
|
|
8487
8635
|
};
|
|
8488
8636
|
|
|
8489
|
-
// src/migrations/generic/
|
|
8490
|
-
import
|
|
8637
|
+
// src/migrations/generic/6-CreateDigitalCredential.ts
|
|
8638
|
+
import Debug17 from "debug";
|
|
8491
8639
|
|
|
8492
|
-
// src/migrations/postgres/
|
|
8493
|
-
var
|
|
8640
|
+
// src/migrations/postgres/1708525189001-CreateDigitalCredential.ts
|
|
8641
|
+
var CreateDigitalCredential1708525189001 = class {
|
|
8494
8642
|
static {
|
|
8495
|
-
__name(this, "
|
|
8643
|
+
__name(this, "CreateDigitalCredential1708525189001");
|
|
8496
8644
|
}
|
|
8497
|
-
name = "
|
|
8645
|
+
name = "CreateDigitalCredential1708525189001";
|
|
8498
8646
|
async up(queryRunner) {
|
|
8499
|
-
await queryRunner.query(`
|
|
8500
|
-
await queryRunner.query(`CREATE
|
|
8501
|
-
|
|
8502
|
-
|
|
8503
|
-
|
|
8504
|
-
|
|
8505
|
-
|
|
8506
|
-
|
|
8507
|
-
|
|
8508
|
-
|
|
8509
|
-
|
|
8510
|
-
|
|
8511
|
-
|
|
8512
|
-
|
|
8513
|
-
|
|
8514
|
-
|
|
8515
|
-
|
|
8516
|
-
|
|
8517
|
-
|
|
8518
|
-
|
|
8519
|
-
|
|
8520
|
-
|
|
8521
|
-
|
|
8522
|
-
|
|
8523
|
-
|
|
8524
|
-
|
|
8525
|
-
|
|
8526
|
-
|
|
8527
|
-
|
|
8647
|
+
await queryRunner.query(`CREATE TYPE "digital_document_type" AS ENUM('VC', 'VP', 'C', 'P')`);
|
|
8648
|
+
await queryRunner.query(`CREATE TYPE "digital_regulation_type" AS ENUM('PID', 'QEAA', 'EAA', 'NON_REGULATED')`);
|
|
8649
|
+
await queryRunner.query(`CREATE TYPE "digital_credential_document_format" AS ENUM('JSON_LD', 'JWT', 'SD_JWT', 'MSO_MDOC')`);
|
|
8650
|
+
await queryRunner.query(`CREATE TYPE "digital_credential_credential_role" AS ENUM('ISSUER', 'VERIFIER', 'HOLDER', 'FEDERATION_TRUST_ANCHOR')`);
|
|
8651
|
+
await queryRunner.query(`CREATE TYPE "digital_credential_correlation_type" AS ENUM('DID', 'KID', 'URL', 'X509_SAN')`);
|
|
8652
|
+
await queryRunner.query(`CREATE TYPE "digital_credential_state_type" AS ENUM('REVOKED', 'VERIFIED', 'EXPIRED')`);
|
|
8653
|
+
await queryRunner.query(`
|
|
8654
|
+
CREATE TABLE "DigitalCredential" (
|
|
8655
|
+
"id" uuid NOT NULL DEFAULT uuid_generate_v4(),
|
|
8656
|
+
"parent_id" text,
|
|
8657
|
+
"document_type" "digital_document_type" NOT NULL,
|
|
8658
|
+
"regulation_type" "digital_regulation_type" NOT NULL DEFAULT 'NON_REGULATED'::"digital_regulation_type",
|
|
8659
|
+
"document_format" "digital_credential_document_format" NOT NULL,
|
|
8660
|
+
"credential_role" "digital_credential_credential_role" NOT NULL,
|
|
8661
|
+
"raw_document" text NOT NULL,
|
|
8662
|
+
"uniform_document" text NOT NULL,
|
|
8663
|
+
"credential_id" text,
|
|
8664
|
+
"hash" text NOT NULL,
|
|
8665
|
+
"kms_key_ref" text,
|
|
8666
|
+
"identifier_method" text,
|
|
8667
|
+
"issuer_correlation_type" "digital_credential_correlation_type" NOT NULL,
|
|
8668
|
+
"subject_correlation_type" "digital_credential_correlation_type",
|
|
8669
|
+
"issuer_correlation_id" text NOT NULL,
|
|
8670
|
+
"subject_correlation_id" text,
|
|
8671
|
+
"verified_state" "digital_credential_state_type",
|
|
8672
|
+
"issuer_signed" boolean,
|
|
8673
|
+
"rp_correlation_id" text,
|
|
8674
|
+
"rp_correlation_type" "digital_credential_correlation_type",
|
|
8675
|
+
"tenant_id" text,
|
|
8676
|
+
"created_at" TIMESTAMP NOT NULL DEFAULT now(),
|
|
8677
|
+
"last_updated_at" TIMESTAMP NOT NULL DEFAULT now(),
|
|
8678
|
+
"presented_at" DATE,
|
|
8679
|
+
"valid_from" DATE,
|
|
8680
|
+
"valid_until" DATE,
|
|
8681
|
+
"verified_at" DATE,
|
|
8682
|
+
"revoked_at" DATE,
|
|
8683
|
+
PRIMARY KEY ("id"),
|
|
8684
|
+
UNIQUE ("hash", "credential_role")
|
|
8685
|
+
)
|
|
8686
|
+
`);
|
|
8528
8687
|
}
|
|
8529
8688
|
async down(queryRunner) {
|
|
8530
|
-
await queryRunner.query(`DROP TABLE "
|
|
8531
|
-
await queryRunner.query(`
|
|
8532
|
-
await queryRunner.query(`
|
|
8533
|
-
|
|
8534
|
-
|
|
8535
|
-
|
|
8536
|
-
|
|
8537
|
-
"identityId" uuid,
|
|
8538
|
-
CONSTRAINT "FK_Identity_IdentityMetadata" FOREIGN KEY ("identityId") REFERENCES "Identity" ("id") ON DELETE CASCADE
|
|
8539
|
-
)`);
|
|
8540
|
-
await queryRunner.query(`INSERT INTO "IdentityMetadata" ("id", "label", "value", "identityId")
|
|
8541
|
-
SELECT "id", "label", "stringValue", "identityId"
|
|
8542
|
-
FROM "temporary_IdentityMetadata"`);
|
|
8543
|
-
await queryRunner.query(`DROP TABLE "temporary_IdentityMetadata"`);
|
|
8689
|
+
await queryRunner.query(`DROP TABLE "DigitalCredential"`);
|
|
8690
|
+
await queryRunner.query(`DROP TYPE "digital_credential_state_type"`);
|
|
8691
|
+
await queryRunner.query(`DROP TYPE "digital_credential_correlation_type"`);
|
|
8692
|
+
await queryRunner.query(`DROP TYPE "digital_credential_document_format"`);
|
|
8693
|
+
await queryRunner.query(`DROP TYPE "digital_credential_credential_role"`);
|
|
8694
|
+
await queryRunner.query(`DROP TYPE "digital_regulation_type"`);
|
|
8695
|
+
await queryRunner.query(`DROP TYPE "digital_document_type"`);
|
|
8544
8696
|
}
|
|
8545
8697
|
};
|
|
8546
8698
|
|
|
8547
|
-
// src/migrations/sqlite/
|
|
8548
|
-
var
|
|
8699
|
+
// src/migrations/sqlite/1708525189002-CreateDigitalCredential.ts
|
|
8700
|
+
var CreateDigitalCredential1708525189002 = class {
|
|
8549
8701
|
static {
|
|
8550
|
-
__name(this, "
|
|
8702
|
+
__name(this, "CreateDigitalCredential1708525189002");
|
|
8551
8703
|
}
|
|
8552
|
-
name = "
|
|
8704
|
+
name = "CreateDigitalCredential1708525189002";
|
|
8553
8705
|
async up(queryRunner) {
|
|
8554
|
-
await queryRunner.query(`
|
|
8555
|
-
|
|
8556
|
-
|
|
8557
|
-
|
|
8558
|
-
|
|
8559
|
-
|
|
8560
|
-
|
|
8561
|
-
|
|
8562
|
-
|
|
8563
|
-
|
|
8564
|
-
|
|
8565
|
-
|
|
8566
|
-
|
|
8567
|
-
|
|
8568
|
-
|
|
8706
|
+
await queryRunner.query(`
|
|
8707
|
+
CREATE TABLE "DigitalCredential" (
|
|
8708
|
+
"id" varchar PRIMARY KEY NOT NULL,
|
|
8709
|
+
"parent_id" text,
|
|
8710
|
+
"document_type" varchar CHECK( "document_type" IN ('VC', 'VP', 'C', 'P') ) NOT NULL,
|
|
8711
|
+
"regulation_type" varchar CHECK( "regulation_type" IN ('PID', 'QEAA', 'EAA', 'NON_REGULATED') ) NOT NULL DEFAULT 'NON_REGULATED',
|
|
8712
|
+
"document_format" varchar CHECK( "document_format" IN ('JSON_LD', 'JWT', 'SD_JWT', 'MSO_MDOC') ) NOT NULL,
|
|
8713
|
+
"credential_role" varchar CHECK( "credential_role" IN ('ISSUER', 'VERIFIER', 'HOLDER', 'FEDERATION_TRUST_ANCHOR') ) NOT NULL,
|
|
8714
|
+
"raw_document" text NOT NULL,
|
|
8715
|
+
"uniform_document" text NOT NULL,
|
|
8716
|
+
"credential_id" text,
|
|
8717
|
+
"hash" text NOT NULL,
|
|
8718
|
+
"kms_key_ref" text,
|
|
8719
|
+
"identifier_method" text,
|
|
8720
|
+
"issuer_correlation_type" varchar CHECK( "issuer_correlation_type" IN ('DID', 'KID', 'URL', 'X509_SAN') ) NOT NULL,
|
|
8721
|
+
"subject_correlation_type" varchar CHECK( "subject_correlation_type" IN ('DID', 'KID', 'URL', 'X509_SAN') ),
|
|
8722
|
+
"issuer_correlation_id" text NOT NULL,
|
|
8723
|
+
"subject_correlation_id" text,
|
|
8724
|
+
"issuer_signed" boolean,
|
|
8725
|
+
"rp_correlation_id" text,
|
|
8726
|
+
"rp_correlation_type" varchar CHECK( "issuer_correlation_type" IN ('DID', 'KID', 'URL', 'X509_SAN') ),
|
|
8727
|
+
"verified_state" varchar CHECK( "verified_state" IN ('REVOKED', 'VERIFIED', 'EXPIRED') ),
|
|
8728
|
+
"tenant_id" text,
|
|
8729
|
+
"created_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
8730
|
+
"last_updated_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
8731
|
+
"presented_at" datetime,
|
|
8732
|
+
"valid_from" datetime,
|
|
8733
|
+
"valid_until" datetime,
|
|
8734
|
+
"verified_at" datetime,
|
|
8735
|
+
"revoked_at" datetime,
|
|
8736
|
+
UNIQUE ("hash", "credential_role")
|
|
8737
|
+
)
|
|
8569
8738
|
`);
|
|
8570
|
-
await queryRunner.query(`DROP TABLE "temporary_IdentityMetadata"`);
|
|
8571
|
-
await queryRunner.query(`CREATE TABLE "ContactMetadata"
|
|
8572
|
-
(
|
|
8573
|
-
"id" varchar PRIMARY KEY NOT NULL,
|
|
8574
|
-
"label" varchar(255) NOT NULL,
|
|
8575
|
-
"valueType" varchar NOT NULL,
|
|
8576
|
-
"stringValue" text,
|
|
8577
|
-
"numberValue" double,
|
|
8578
|
-
"dateValue" datetime,
|
|
8579
|
-
"boolValue" boolean,
|
|
8580
|
-
"contactId" varchar,
|
|
8581
|
-
FOREIGN KEY ("contactId") REFERENCES "BaseContact" ("id") ON DELETE CASCADE)`);
|
|
8582
8739
|
}
|
|
8583
8740
|
async down(queryRunner) {
|
|
8584
|
-
await queryRunner.query(`DROP TABLE "
|
|
8585
|
-
await queryRunner.query(`ALTER TABLE "IdentityMetadata" RENAME TO "temporary_IdentityMetadata"`);
|
|
8586
|
-
await queryRunner.query(`CREATE TABLE "IdentityMetadata"
|
|
8587
|
-
(
|
|
8588
|
-
"id" varchar PRIMARY KEY NOT NULL,
|
|
8589
|
-
"label" varchar(255) NOT NULL,
|
|
8590
|
-
"value" varchar(255) NOT NULL,
|
|
8591
|
-
"identityId" varchar,
|
|
8592
|
-
FOREIGN KEY ("identityId") REFERENCES "Identity" ("id") ON DELETE CASCADE
|
|
8593
|
-
)`);
|
|
8594
|
-
await queryRunner.query(`INSERT INTO "IdentityMetadata" ("id", "label", "value", "identityId")
|
|
8595
|
-
SELECT "id", "label", "stringValue", "identityId"
|
|
8596
|
-
FROM "temporary_IdentityMetadata"`);
|
|
8597
|
-
await queryRunner.query(`DROP TABLE "temporary_IdentityMetadata"`);
|
|
8741
|
+
await queryRunner.query(`DROP TABLE "DigitalCredential"`);
|
|
8598
8742
|
}
|
|
8599
8743
|
};
|
|
8600
8744
|
|
|
8601
|
-
// src/migrations/generic/
|
|
8602
|
-
var
|
|
8603
|
-
var
|
|
8745
|
+
// src/migrations/generic/6-CreateDigitalCredential.ts
|
|
8746
|
+
var debug17 = Debug17("sphereon:ssi-sdk:migrations");
|
|
8747
|
+
var CreateDigitalCredential1708525189000 = class {
|
|
8604
8748
|
static {
|
|
8605
|
-
__name(this, "
|
|
8749
|
+
__name(this, "CreateDigitalCredential1708525189000");
|
|
8606
8750
|
}
|
|
8607
|
-
name = "
|
|
8751
|
+
name = "CreateDigitalCredential1708525189000";
|
|
8608
8752
|
async up(queryRunner) {
|
|
8609
|
-
|
|
8753
|
+
debug17("migration: creating DigitalCredential tables");
|
|
8610
8754
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8611
8755
|
switch (dbType) {
|
|
8612
8756
|
case "postgres": {
|
|
8613
|
-
|
|
8614
|
-
const mig = new
|
|
8757
|
+
debug17("using postgres migration file for DigitalCredential");
|
|
8758
|
+
const mig = new CreateDigitalCredential1708525189001();
|
|
8615
8759
|
await mig.up(queryRunner);
|
|
8616
|
-
|
|
8760
|
+
debug17("Postgres Migration statements for DigitalCredential executed");
|
|
8617
8761
|
return;
|
|
8618
8762
|
}
|
|
8619
8763
|
case "sqlite":
|
|
8620
8764
|
case "expo":
|
|
8621
8765
|
case "react-native": {
|
|
8622
|
-
|
|
8623
|
-
const mig = new
|
|
8766
|
+
debug17("using sqlite/react-native migration file for DigitalCredential");
|
|
8767
|
+
const mig = new CreateDigitalCredential1708525189002();
|
|
8624
8768
|
await mig.up(queryRunner);
|
|
8625
|
-
|
|
8769
|
+
debug17("SQLite Migration statements for DigitalCredential executed");
|
|
8626
8770
|
return;
|
|
8627
8771
|
}
|
|
8628
8772
|
default:
|
|
8629
|
-
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`);
|
|
8773
|
+
return Promise.reject(`Migrations are currently only supported for sqlite, react-native, expo, and postgres for UniformCredential. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`);
|
|
8630
8774
|
}
|
|
8631
8775
|
}
|
|
8632
8776
|
async down(queryRunner) {
|
|
8633
|
-
|
|
8777
|
+
debug17("migration: reverting DigitalCredential tables");
|
|
8634
8778
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8635
8779
|
switch (dbType) {
|
|
8636
8780
|
case "postgres": {
|
|
8637
|
-
|
|
8638
|
-
const mig = new
|
|
8781
|
+
debug17("using postgres migration file for DigitalCredential");
|
|
8782
|
+
const mig = new CreateDigitalCredential1708525189001();
|
|
8639
8783
|
await mig.down(queryRunner);
|
|
8640
|
-
|
|
8784
|
+
debug17("Postgres Migration statements for DigitalCredential reverted");
|
|
8641
8785
|
return;
|
|
8642
8786
|
}
|
|
8643
8787
|
case "sqlite":
|
|
8644
8788
|
case "expo":
|
|
8645
8789
|
case "react-native": {
|
|
8646
|
-
|
|
8647
|
-
const mig = new
|
|
8790
|
+
debug17("using sqlite/react-native migration file for DigitalCredential");
|
|
8791
|
+
const mig = new CreateDigitalCredential1708525189002();
|
|
8648
8792
|
await mig.down(queryRunner);
|
|
8649
|
-
|
|
8793
|
+
debug17("SQLite Migration statements for DigitalCredential reverted");
|
|
8650
8794
|
return;
|
|
8651
8795
|
}
|
|
8652
8796
|
default:
|
|
8653
|
-
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`);
|
|
8797
|
+
return Promise.reject(`Migrations are currently only supported for sqlite, react-native, expo, and postgres for DigitalCredential. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`);
|
|
8654
8798
|
}
|
|
8655
8799
|
}
|
|
8656
8800
|
};
|
|
8657
8801
|
|
|
8658
|
-
// src/migrations/generic/
|
|
8659
|
-
import
|
|
8802
|
+
// src/migrations/generic/7-CreateMachineStateStore.ts
|
|
8803
|
+
import Debug18 from "debug";
|
|
8660
8804
|
|
|
8661
|
-
// src/migrations/postgres/
|
|
8662
|
-
var
|
|
8805
|
+
// src/migrations/postgres/1708797018115-CreateMachineStateStore.ts
|
|
8806
|
+
var CreateMachineStateStore1708797018115 = class {
|
|
8663
8807
|
static {
|
|
8664
|
-
__name(this, "
|
|
8808
|
+
__name(this, "CreateMachineStateStore1708797018115");
|
|
8665
8809
|
}
|
|
8666
|
-
name = "
|
|
8810
|
+
name = "CreateMachineStateStore1708797018115";
|
|
8667
8811
|
async up(queryRunner) {
|
|
8668
8812
|
await queryRunner.query(`
|
|
8669
|
-
CREATE TABLE "
|
|
8670
|
-
|
|
8671
|
-
|
|
8672
|
-
|
|
8673
|
-
|
|
8674
|
-
|
|
8675
|
-
|
|
8676
|
-
|
|
8677
|
-
|
|
8678
|
-
|
|
8679
|
-
|
|
8680
|
-
|
|
8681
|
-
|
|
8813
|
+
CREATE TABLE "MachineStateInfoEntity" (
|
|
8814
|
+
"instance_id" text NOT NULL,
|
|
8815
|
+
"session_id" text,
|
|
8816
|
+
"latest_state_name" text,
|
|
8817
|
+
"machine_name" text NOT NULL,
|
|
8818
|
+
"latest_event_type" text NOT NULL,
|
|
8819
|
+
"state" text NOT NULL,
|
|
8820
|
+
"created_at" TIMESTAMP NOT NULL DEFAULT now(),
|
|
8821
|
+
"updated_at" TIMESTAMP NOT NULL DEFAULT now(),
|
|
8822
|
+
"updated_count" integer NOT NULL DEFAULT 0,
|
|
8823
|
+
"expires_at" TIMESTAMP,
|
|
8824
|
+
"completed_at" TIMESTAMP,
|
|
8825
|
+
"tenant_id" text,
|
|
8826
|
+
CONSTRAINT "PK_MachineStateInfoEntity_id" PRIMARY KEY ("instance_id")
|
|
8827
|
+
)
|
|
8828
|
+
`);
|
|
8682
8829
|
}
|
|
8683
8830
|
async down(queryRunner) {
|
|
8684
|
-
await queryRunner.query(`DROP TABLE "
|
|
8831
|
+
await queryRunner.query(`DROP TABLE "MachineStateInfoEntity"`);
|
|
8685
8832
|
}
|
|
8686
8833
|
};
|
|
8687
8834
|
|
|
8688
|
-
// src/migrations/sqlite/
|
|
8689
|
-
var
|
|
8835
|
+
// src/migrations/sqlite/1708796002272-CreateMachineStateStore.ts
|
|
8836
|
+
var CreateMachineStateStore1708796002272 = class {
|
|
8690
8837
|
static {
|
|
8691
|
-
__name(this, "
|
|
8838
|
+
__name(this, "CreateMachineStateStore1708796002272");
|
|
8692
8839
|
}
|
|
8693
|
-
name = "
|
|
8840
|
+
name = "CreateMachineStateStore1708796002272";
|
|
8694
8841
|
async up(queryRunner) {
|
|
8695
|
-
await queryRunner.query(`
|
|
8696
|
-
|
|
8697
|
-
|
|
8698
|
-
|
|
8699
|
-
|
|
8700
|
-
|
|
8701
|
-
|
|
8702
|
-
|
|
8703
|
-
|
|
8704
|
-
|
|
8705
|
-
|
|
8842
|
+
await queryRunner.query(`
|
|
8843
|
+
CREATE TABLE "MachineStateInfoEntity" (
|
|
8844
|
+
"instance_id" varchar PRIMARY KEY NOT NULL,
|
|
8845
|
+
"session_id" varchar,
|
|
8846
|
+
"machine_name" varchar NOT NULL,
|
|
8847
|
+
"latest_state_name" varchar,
|
|
8848
|
+
"latest_event_type" varchar NOT NULL,
|
|
8849
|
+
"state" text NOT NULL,
|
|
8850
|
+
"created_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
8851
|
+
"updated_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
8852
|
+
"updated_count" integer NOT NULL DEFAULT 0,
|
|
8853
|
+
"expires_at" datetime,
|
|
8854
|
+
"completed_at" datetime,
|
|
8855
|
+
"tenant_id" varchar
|
|
8856
|
+
)
|
|
8857
|
+
`);
|
|
8706
8858
|
}
|
|
8707
8859
|
async down(queryRunner) {
|
|
8708
|
-
await queryRunner.query(`DROP TABLE "
|
|
8860
|
+
await queryRunner.query(`DROP TABLE "MachineStateInfoEntity"`);
|
|
8709
8861
|
}
|
|
8710
8862
|
};
|
|
8711
8863
|
|
|
8712
|
-
// src/migrations/generic/
|
|
8713
|
-
var
|
|
8714
|
-
var
|
|
8864
|
+
// src/migrations/generic/7-CreateMachineStateStore.ts
|
|
8865
|
+
var debug18 = Debug18("sphereon:ssi-sdk:migrations");
|
|
8866
|
+
var CreateMachineStateStore1708098041262 = class {
|
|
8715
8867
|
static {
|
|
8716
|
-
__name(this, "
|
|
8868
|
+
__name(this, "CreateMachineStateStore1708098041262");
|
|
8717
8869
|
}
|
|
8718
|
-
name = "
|
|
8870
|
+
name = "CreateMachineStateStore1708098041262";
|
|
8719
8871
|
async up(queryRunner) {
|
|
8720
|
-
|
|
8872
|
+
debug18("migration: creating machine state tables");
|
|
8721
8873
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8722
8874
|
switch (dbType) {
|
|
8723
8875
|
case "postgres": {
|
|
8724
|
-
|
|
8725
|
-
const mig = new
|
|
8876
|
+
debug18("using postgres migration file");
|
|
8877
|
+
const mig = new CreateMachineStateStore1708797018115();
|
|
8726
8878
|
await mig.up(queryRunner);
|
|
8727
|
-
|
|
8879
|
+
debug18("Migration statements executed");
|
|
8728
8880
|
return;
|
|
8729
8881
|
}
|
|
8730
8882
|
case "sqlite":
|
|
8731
8883
|
case "expo":
|
|
8732
8884
|
case "react-native": {
|
|
8733
|
-
|
|
8734
|
-
const mig = new
|
|
8885
|
+
debug18("using sqlite/react-native migration file");
|
|
8886
|
+
const mig = new CreateMachineStateStore1708796002272();
|
|
8735
8887
|
await mig.up(queryRunner);
|
|
8736
|
-
|
|
8888
|
+
debug18("Migration statements executed");
|
|
8737
8889
|
return;
|
|
8738
8890
|
}
|
|
8739
8891
|
default:
|
|
@@ -8741,23 +8893,23 @@ var CreatePresentationDefinitions1716533767523 = class {
|
|
|
8741
8893
|
}
|
|
8742
8894
|
}
|
|
8743
8895
|
async down(queryRunner) {
|
|
8744
|
-
|
|
8896
|
+
debug18("migration: reverting machine state tables");
|
|
8745
8897
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8746
8898
|
switch (dbType) {
|
|
8747
8899
|
case "postgres": {
|
|
8748
|
-
|
|
8749
|
-
const mig = new
|
|
8900
|
+
debug18("using postgres migration file");
|
|
8901
|
+
const mig = new CreateMachineStateStore1708797018115();
|
|
8750
8902
|
await mig.down(queryRunner);
|
|
8751
|
-
|
|
8903
|
+
debug18("Migration statements executed");
|
|
8752
8904
|
return;
|
|
8753
8905
|
}
|
|
8754
8906
|
case "sqlite":
|
|
8755
8907
|
case "expo":
|
|
8756
8908
|
case "react-native": {
|
|
8757
|
-
|
|
8758
|
-
const mig = new
|
|
8909
|
+
debug18("using sqlite/react-native migration file");
|
|
8910
|
+
const mig = new CreateMachineStateStore1708796002272();
|
|
8759
8911
|
await mig.down(queryRunner);
|
|
8760
|
-
|
|
8912
|
+
debug18("Migration statements executed");
|
|
8761
8913
|
return;
|
|
8762
8914
|
}
|
|
8763
8915
|
default:
|
|
@@ -8766,108 +8918,145 @@ var CreatePresentationDefinitions1716533767523 = class {
|
|
|
8766
8918
|
}
|
|
8767
8919
|
};
|
|
8768
8920
|
|
|
8769
|
-
// src/migrations/generic/
|
|
8770
|
-
import
|
|
8921
|
+
// src/migrations/generic/8-CreateContacts.ts
|
|
8922
|
+
import Debug19 from "debug";
|
|
8771
8923
|
|
|
8772
|
-
// src/migrations/postgres/
|
|
8773
|
-
var
|
|
8924
|
+
// src/migrations/postgres/1710438363001-CreateContacts.ts
|
|
8925
|
+
var CreateContacts1710438363001 = class {
|
|
8774
8926
|
static {
|
|
8775
|
-
__name(this, "
|
|
8927
|
+
__name(this, "CreateContacts1710438363001");
|
|
8776
8928
|
}
|
|
8777
|
-
name = "
|
|
8929
|
+
name = "CreateContacts1710438363001";
|
|
8778
8930
|
async up(queryRunner) {
|
|
8779
|
-
await queryRunner.query(`
|
|
8780
|
-
|
|
8781
|
-
|
|
8782
|
-
`);
|
|
8931
|
+
await queryRunner.query(`ALTER TABLE "Party" ADD COLUMN "owner_id" uuid`);
|
|
8932
|
+
await queryRunner.query(`ALTER TABLE "Party" ADD COLUMN "tenant_id" uuid`);
|
|
8933
|
+
await queryRunner.query(`ALTER TABLE "Identity" ADD COLUMN "owner_id" uuid`);
|
|
8934
|
+
await queryRunner.query(`ALTER TABLE "Identity" ADD COLUMN "tenant_id" uuid`);
|
|
8935
|
+
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" ADD COLUMN "owner_id" uuid`);
|
|
8936
|
+
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" ADD COLUMN "tenant_id" uuid`);
|
|
8937
|
+
await queryRunner.query(`ALTER TABLE "Connection" ADD COLUMN "owner_id" uuid`);
|
|
8938
|
+
await queryRunner.query(`ALTER TABLE "Connection" ADD COLUMN "tenant_id" uuid`);
|
|
8939
|
+
await queryRunner.query(`ALTER TABLE "BaseConfig" ADD COLUMN "owner_id" uuid`);
|
|
8940
|
+
await queryRunner.query(`ALTER TABLE "BaseConfig" ADD COLUMN "tenant_id" uuid`);
|
|
8941
|
+
await queryRunner.query(`ALTER TABLE "BaseContact" ADD COLUMN "owner_id" uuid`);
|
|
8942
|
+
await queryRunner.query(`ALTER TABLE "BaseContact" ADD COLUMN "tenant_id" uuid`);
|
|
8943
|
+
await queryRunner.query(`ALTER TABLE "PartyRelationship" ADD COLUMN "owner_id" uuid`);
|
|
8944
|
+
await queryRunner.query(`ALTER TABLE "PartyRelationship" ADD COLUMN "tenant_id" uuid`);
|
|
8945
|
+
await queryRunner.query(`ALTER TABLE "ElectronicAddress" ADD COLUMN "owner_id" uuid`);
|
|
8946
|
+
await queryRunner.query(`ALTER TABLE "ElectronicAddress" ADD COLUMN "tenant_id" uuid`);
|
|
8947
|
+
await queryRunner.query(`ALTER TABLE "PhysicalAddress" ADD COLUMN "owner_id" uuid`);
|
|
8948
|
+
await queryRunner.query(`ALTER TABLE "PhysicalAddress" ADD COLUMN "tenant_id" uuid`);
|
|
8783
8949
|
}
|
|
8784
8950
|
async down(queryRunner) {
|
|
8785
|
-
await queryRunner.query(`
|
|
8786
|
-
|
|
8787
|
-
|
|
8788
|
-
`);
|
|
8951
|
+
await queryRunner.query(`ALTER TABLE "PhysicalAddress" DROP COLUMN "tenant_id"`);
|
|
8952
|
+
await queryRunner.query(`ALTER TABLE "PhysicalAddress" DROP COLUMN "owner_id"`);
|
|
8953
|
+
await queryRunner.query(`ALTER TABLE "ElectronicAddress" DROP COLUMN "tenant_id"`);
|
|
8954
|
+
await queryRunner.query(`ALTER TABLE "ElectronicAddress" DROP COLUMN "owner_id"`);
|
|
8955
|
+
await queryRunner.query(`ALTER TABLE "PartyRelationship" DROP COLUMN "tenant_id"`);
|
|
8956
|
+
await queryRunner.query(`ALTER TABLE "PartyRelationship" DROP COLUMN "owner_id"`);
|
|
8957
|
+
await queryRunner.query(`ALTER TABLE "BaseContact" DROP COLUMN "tenant_id"`);
|
|
8958
|
+
await queryRunner.query(`ALTER TABLE "BaseContact" DROP COLUMN "owner_id"`);
|
|
8959
|
+
await queryRunner.query(`ALTER TABLE "BaseConfig" DROP COLUMN "tenant_id"`);
|
|
8960
|
+
await queryRunner.query(`ALTER TABLE "BaseConfig" DROP COLUMN "owner_id"`);
|
|
8961
|
+
await queryRunner.query(`ALTER TABLE "Connection" DROP COLUMN "tenant_id"`);
|
|
8962
|
+
await queryRunner.query(`ALTER TABLE "Connection" DROP COLUMN "owner_id"`);
|
|
8963
|
+
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" DROP COLUMN "tenant_id"`);
|
|
8964
|
+
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" DROP COLUMN "owner_id"`);
|
|
8965
|
+
await queryRunner.query(`ALTER TABLE "Identity" DROP COLUMN "tenant_id"`);
|
|
8966
|
+
await queryRunner.query(`ALTER TABLE "Identity" DROP COLUMN "owner_id"`);
|
|
8967
|
+
await queryRunner.query(`ALTER TABLE "Party" DROP COLUMN "tenant_id"`);
|
|
8968
|
+
await queryRunner.query(`ALTER TABLE "Party" DROP COLUMN "owner_id"`);
|
|
8789
8969
|
}
|
|
8790
8970
|
};
|
|
8791
8971
|
|
|
8792
|
-
// src/migrations/sqlite/
|
|
8793
|
-
var
|
|
8972
|
+
// src/migrations/sqlite/1710438363002-CreateContacts.ts
|
|
8973
|
+
var CreateContacts1710438363002 = class {
|
|
8794
8974
|
static {
|
|
8795
|
-
__name(this, "
|
|
8975
|
+
__name(this, "CreateContacts1710438363002");
|
|
8796
8976
|
}
|
|
8797
|
-
name = "
|
|
8977
|
+
name = "CreateContacts1710438363002";
|
|
8798
8978
|
async up(queryRunner) {
|
|
8799
|
-
await queryRunner.query(`
|
|
8800
|
-
|
|
8801
|
-
|
|
8802
|
-
|
|
8803
|
-
|
|
8804
|
-
|
|
8805
|
-
|
|
8806
|
-
|
|
8807
|
-
|
|
8808
|
-
|
|
8809
|
-
|
|
8810
|
-
|
|
8811
|
-
|
|
8812
|
-
|
|
8813
|
-
|
|
8814
|
-
await queryRunner.query(`
|
|
8815
|
-
|
|
8816
|
-
await queryRunner.query(`
|
|
8817
|
-
|
|
8818
|
-
|
|
8819
|
-
|
|
8979
|
+
await queryRunner.query(`ALTER TABLE "Party" ADD COLUMN "owner_id" text`);
|
|
8980
|
+
await queryRunner.query(`ALTER TABLE "Party" ADD COLUMN "tenant_id" text`);
|
|
8981
|
+
await queryRunner.query(`CREATE TABLE "temporary_Identity" (
|
|
8982
|
+
"id" varchar PRIMARY KEY NOT NULL,
|
|
8983
|
+
"alias" varchar(255) NOT NULL,
|
|
8984
|
+
"roles" text NOT NULL,
|
|
8985
|
+
"origin" text NOT NULL,
|
|
8986
|
+
"created_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
8987
|
+
"last_updated_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
8988
|
+
"partyId" varchar,
|
|
8989
|
+
"owner_id" text,
|
|
8990
|
+
"tenant_id" text,
|
|
8991
|
+
CONSTRAINT "UQ_Identity_alias" UNIQUE ("alias"),
|
|
8992
|
+
CONSTRAINT "FK_Identity_partyId" FOREIGN KEY ("partyId") REFERENCES "Party" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
8993
|
+
)`);
|
|
8994
|
+
await queryRunner.query(`INSERT INTO "temporary_Identity"("id", "alias", "roles", "created_at", "last_updated_at", "partyId", "owner_id", "tenant_id", "origin")
|
|
8995
|
+
SELECT "id", "alias", "roles", 'EXTERNAL' as "origin", "created_at", "last_updated_at", "partyId", NULL as "owner_id", NULL as "tenant_id" FROM "Identity"`);
|
|
8996
|
+
await queryRunner.query(`DROP TABLE "Identity"`);
|
|
8997
|
+
await queryRunner.query(`ALTER TABLE "temporary_Identity" RENAME TO "Identity"`);
|
|
8998
|
+
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" ADD COLUMN "owner_id" text`);
|
|
8999
|
+
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" ADD COLUMN "tenant_id" text`);
|
|
9000
|
+
await queryRunner.query(`ALTER TABLE "Connection" ADD COLUMN "owner_id" text`);
|
|
9001
|
+
await queryRunner.query(`ALTER TABLE "Connection" ADD COLUMN "tenant_id" text`);
|
|
9002
|
+
await queryRunner.query(`ALTER TABLE "BaseConfig" ADD COLUMN "owner_id" text`);
|
|
9003
|
+
await queryRunner.query(`ALTER TABLE "BaseConfig" ADD COLUMN "tenant_id" text`);
|
|
9004
|
+
await queryRunner.query(`ALTER TABLE "BaseContact" ADD COLUMN "owner_id" text`);
|
|
9005
|
+
await queryRunner.query(`ALTER TABLE "BaseContact" ADD COLUMN "tenant_id" text`);
|
|
9006
|
+
await queryRunner.query(`ALTER TABLE "PartyRelationship" ADD COLUMN "owner_id" text`);
|
|
9007
|
+
await queryRunner.query(`ALTER TABLE "PartyRelationship" ADD COLUMN "tenant_id" text`);
|
|
9008
|
+
await queryRunner.query(`ALTER TABLE "ElectronicAddress" ADD COLUMN "owner_id" text`);
|
|
9009
|
+
await queryRunner.query(`ALTER TABLE "ElectronicAddress" ADD COLUMN "tenant_id" text`);
|
|
9010
|
+
await queryRunner.query(`ALTER TABLE "PhysicalAddress" ADD COLUMN "owner_id" text`);
|
|
9011
|
+
await queryRunner.query(`ALTER TABLE "PhysicalAddress" ADD COLUMN "tenant_id" text`);
|
|
8820
9012
|
}
|
|
8821
9013
|
async down(queryRunner) {
|
|
8822
|
-
await queryRunner.query(`
|
|
8823
|
-
|
|
8824
|
-
|
|
8825
|
-
|
|
8826
|
-
|
|
8827
|
-
|
|
8828
|
-
|
|
8829
|
-
|
|
8830
|
-
|
|
8831
|
-
|
|
8832
|
-
await queryRunner.query(`
|
|
8833
|
-
|
|
8834
|
-
|
|
8835
|
-
|
|
8836
|
-
|
|
8837
|
-
await queryRunner.query(`
|
|
8838
|
-
await queryRunner.query(`ALTER TABLE "
|
|
8839
|
-
await queryRunner.query(`
|
|
8840
|
-
CREATE UNIQUE INDEX "IDX_CredentialClaimsEntity_credentialLocaleBranding_locale"
|
|
8841
|
-
ON "CredentialClaims" ("credentialLocaleBrandingId", "key")
|
|
8842
|
-
`);
|
|
9014
|
+
await queryRunner.query(`ALTER TABLE "PhysicalAddress" DROP COLUMN "tenant_id"`);
|
|
9015
|
+
await queryRunner.query(`ALTER TABLE "PhysicalAddress" DROP COLUMN "owner_id"`);
|
|
9016
|
+
await queryRunner.query(`ALTER TABLE "ElectronicAddress" DROP COLUMN "tenant_id"`);
|
|
9017
|
+
await queryRunner.query(`ALTER TABLE "ElectronicAddress" DROP COLUMN "owner_id"`);
|
|
9018
|
+
await queryRunner.query(`ALTER TABLE "PartyRelationship" DROP COLUMN "tenant_id"`);
|
|
9019
|
+
await queryRunner.query(`ALTER TABLE "PartyRelationship" DROP COLUMN "owner_id"`);
|
|
9020
|
+
await queryRunner.query(`ALTER TABLE "BaseContact" DROP COLUMN "tenant_id"`);
|
|
9021
|
+
await queryRunner.query(`ALTER TABLE "BaseContact" DROP COLUMN "owner_id"`);
|
|
9022
|
+
await queryRunner.query(`ALTER TABLE "BaseConfig" DROP COLUMN "tenant_id"`);
|
|
9023
|
+
await queryRunner.query(`ALTER TABLE "BaseConfig" DROP COLUMN "owner_id"`);
|
|
9024
|
+
await queryRunner.query(`ALTER TABLE "Connection" DROP COLUMN "tenant_id"`);
|
|
9025
|
+
await queryRunner.query(`ALTER TABLE "Connection" DROP COLUMN "owner_id"`);
|
|
9026
|
+
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" DROP COLUMN "tenant_id"`);
|
|
9027
|
+
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" DROP COLUMN "owner_id"`);
|
|
9028
|
+
await queryRunner.query(`ALTER TABLE "Identity" DROP COLUMN "tenant_id"`);
|
|
9029
|
+
await queryRunner.query(`ALTER TABLE "Identity" DROP COLUMN "owner_id"`);
|
|
9030
|
+
await queryRunner.query(`ALTER TABLE "Party" DROP COLUMN "tenant_id"`);
|
|
9031
|
+
await queryRunner.query(`ALTER TABLE "Party" DROP COLUMN "owner_id"`);
|
|
8843
9032
|
}
|
|
8844
9033
|
};
|
|
8845
9034
|
|
|
8846
|
-
// src/migrations/generic/
|
|
8847
|
-
var
|
|
8848
|
-
var
|
|
9035
|
+
// src/migrations/generic/8-CreateContacts.ts
|
|
9036
|
+
var debug19 = Debug19("sphereon:ssi-sdk:migrations");
|
|
9037
|
+
var CreateContacts1708525189000 = class {
|
|
8849
9038
|
static {
|
|
8850
|
-
__name(this, "
|
|
9039
|
+
__name(this, "CreateContacts1708525189000");
|
|
8851
9040
|
}
|
|
8852
|
-
name = "
|
|
9041
|
+
name = "CreateContacts1708525189000";
|
|
8853
9042
|
async up(queryRunner) {
|
|
8854
|
-
|
|
9043
|
+
debug19("migration: updating contact tables");
|
|
8855
9044
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8856
9045
|
switch (dbType) {
|
|
8857
9046
|
case "postgres": {
|
|
8858
|
-
|
|
8859
|
-
const mig = new
|
|
9047
|
+
debug19("using postgres migration file");
|
|
9048
|
+
const mig = new CreateContacts1710438363001();
|
|
8860
9049
|
await mig.up(queryRunner);
|
|
8861
|
-
|
|
9050
|
+
debug19("Migration statements executed");
|
|
8862
9051
|
return;
|
|
8863
9052
|
}
|
|
8864
9053
|
case "sqlite":
|
|
8865
9054
|
case "expo":
|
|
8866
9055
|
case "react-native": {
|
|
8867
|
-
|
|
8868
|
-
const mig = new
|
|
9056
|
+
debug19("using sqlite/react-native migration file");
|
|
9057
|
+
const mig = new CreateContacts1710438363002();
|
|
8869
9058
|
await mig.up(queryRunner);
|
|
8870
|
-
|
|
9059
|
+
debug19("Migration statements executed");
|
|
8871
9060
|
return;
|
|
8872
9061
|
}
|
|
8873
9062
|
default:
|
|
@@ -8875,23 +9064,23 @@ var FixCredentialClaimsReferencesUuid1741895822987 = class {
|
|
|
8875
9064
|
}
|
|
8876
9065
|
}
|
|
8877
9066
|
async down(queryRunner) {
|
|
8878
|
-
|
|
9067
|
+
debug19("migration: reverting machine state tables");
|
|
8879
9068
|
const dbType = queryRunner.connection.driver.options.type;
|
|
8880
9069
|
switch (dbType) {
|
|
8881
9070
|
case "postgres": {
|
|
8882
|
-
|
|
8883
|
-
const mig = new
|
|
9071
|
+
debug19("using postgres migration file");
|
|
9072
|
+
const mig = new CreateContacts1710438363001();
|
|
8884
9073
|
await mig.down(queryRunner);
|
|
8885
|
-
|
|
9074
|
+
debug19("Migration statements executed");
|
|
8886
9075
|
return;
|
|
8887
9076
|
}
|
|
8888
9077
|
case "sqlite":
|
|
8889
9078
|
case "expo":
|
|
8890
9079
|
case "react-native": {
|
|
8891
|
-
|
|
8892
|
-
const mig = new
|
|
9080
|
+
debug19("using sqlite/react-native migration file");
|
|
9081
|
+
const mig = new CreateContacts1710438363002();
|
|
8893
9082
|
await mig.down(queryRunner);
|
|
8894
|
-
|
|
9083
|
+
debug19("Migration statements executed");
|
|
8895
9084
|
return;
|
|
8896
9085
|
}
|
|
8897
9086
|
default:
|
|
@@ -8900,222 +9089,171 @@ var FixCredentialClaimsReferencesUuid1741895822987 = class {
|
|
|
8900
9089
|
}
|
|
8901
9090
|
};
|
|
8902
9091
|
|
|
8903
|
-
// src/migrations/generic/
|
|
8904
|
-
import
|
|
9092
|
+
// src/migrations/generic/9-CreateContacts.ts
|
|
9093
|
+
import Debug20 from "debug";
|
|
8905
9094
|
|
|
8906
|
-
// src/migrations/postgres/
|
|
8907
|
-
var
|
|
9095
|
+
// src/migrations/postgres/1715761125001-CreateContacts.ts
|
|
9096
|
+
var CreateContacts1715761125001 = class {
|
|
8908
9097
|
static {
|
|
8909
|
-
__name(this, "
|
|
9098
|
+
__name(this, "CreateContacts1715761125001");
|
|
8910
9099
|
}
|
|
8911
|
-
name = "
|
|
9100
|
+
name = "CreateContacts1715761125001";
|
|
8912
9101
|
async up(queryRunner) {
|
|
8913
|
-
await queryRunner.query(`ALTER TABLE "
|
|
8914
|
-
await queryRunner.query(`
|
|
8915
|
-
|
|
8916
|
-
|
|
8917
|
-
|
|
8918
|
-
|
|
8919
|
-
|
|
8920
|
-
|
|
8921
|
-
|
|
8922
|
-
|
|
8923
|
-
|
|
8924
|
-
|
|
9102
|
+
await queryRunner.query(`ALTER TABLE "IdentityMetadata" RENAME TO "temporary_IdentityMetadata"`);
|
|
9103
|
+
await queryRunner.query(`CREATE TABLE "IdentityMetadata"
|
|
9104
|
+
(
|
|
9105
|
+
"id" uuid PRIMARY KEY NOT NULL DEFAULT uuid_generate_v4(),
|
|
9106
|
+
"label" character varying(255) NOT NULL,
|
|
9107
|
+
"valueType" character varying NOT NULL,
|
|
9108
|
+
"stringValue" text,
|
|
9109
|
+
"numberValue" double precision,
|
|
9110
|
+
"dateValue" TIMESTAMP,
|
|
9111
|
+
"boolValue" boolean,
|
|
9112
|
+
"identityId" uuid,
|
|
9113
|
+
CONSTRAINT "FK_Identity_IdentityMetadata" FOREIGN KEY ("identityId") REFERENCES "Identity" ("id") ON DELETE CASCADE
|
|
9114
|
+
)`);
|
|
9115
|
+
await queryRunner.query(`INSERT INTO "IdentityMetadata" ("id", "label", "valueType", "stringValue", "identityId")
|
|
9116
|
+
SELECT "id", "label", 'string', "value", "identityId"
|
|
9117
|
+
FROM "temporary_IdentityMetadata"`);
|
|
9118
|
+
await queryRunner.query(`DROP TABLE "temporary_IdentityMetadata"`);
|
|
9119
|
+
await queryRunner.query(`CREATE TABLE "ContactMetadata"
|
|
9120
|
+
(
|
|
9121
|
+
"id" uuid PRIMARY KEY NOT NULL DEFAULT uuid_generate_v4(),
|
|
9122
|
+
"label" character varying(255) NOT NULL,
|
|
9123
|
+
"valueType" character varying NOT NULL,
|
|
9124
|
+
"stringValue" text,
|
|
9125
|
+
"numberValue" double precision,
|
|
9126
|
+
"dateValue" TIMESTAMP,
|
|
9127
|
+
"boolValue" boolean,
|
|
9128
|
+
"contactId" uuid,
|
|
9129
|
+
CONSTRAINT "FK_BaseContact_ContactMetadata" FOREIGN KEY ("contactId") REFERENCES "BaseContact" ("id") ON DELETE CASCADE
|
|
9130
|
+
)`);
|
|
8925
9131
|
}
|
|
8926
9132
|
async down(queryRunner) {
|
|
8927
|
-
await queryRunner.query(`
|
|
8928
|
-
await queryRunner.query(`ALTER TABLE "
|
|
8929
|
-
await queryRunner.query(`
|
|
8930
|
-
|
|
8931
|
-
|
|
8932
|
-
|
|
8933
|
-
|
|
8934
|
-
|
|
8935
|
-
|
|
8936
|
-
|
|
8937
|
-
await queryRunner.query(`
|
|
8938
|
-
|
|
9133
|
+
await queryRunner.query(`DROP TABLE "ContactMetadata"`);
|
|
9134
|
+
await queryRunner.query(`ALTER TABLE "IdentityMetadata" RENAME TO "temporary_IdentityMetadata"`);
|
|
9135
|
+
await queryRunner.query(`CREATE TABLE "IdentityMetadata"
|
|
9136
|
+
(
|
|
9137
|
+
"id" uuid PRIMARY KEY NOT NULL DEFAULT uuid_generate_v4(),
|
|
9138
|
+
"label" character varying(255) NOT NULL,
|
|
9139
|
+
"value" character varying(255) NOT NULL,
|
|
9140
|
+
"identityId" uuid,
|
|
9141
|
+
CONSTRAINT "FK_Identity_IdentityMetadata" FOREIGN KEY ("identityId") REFERENCES "Identity" ("id") ON DELETE CASCADE
|
|
9142
|
+
)`);
|
|
9143
|
+
await queryRunner.query(`INSERT INTO "IdentityMetadata" ("id", "label", "value", "identityId")
|
|
9144
|
+
SELECT "id", "label", "stringValue", "identityId"
|
|
9145
|
+
FROM "temporary_IdentityMetadata"`);
|
|
9146
|
+
await queryRunner.query(`DROP TABLE "temporary_IdentityMetadata"`);
|
|
8939
9147
|
}
|
|
8940
9148
|
};
|
|
8941
9149
|
|
|
8942
|
-
// src/migrations/sqlite/
|
|
8943
|
-
var
|
|
9150
|
+
// src/migrations/sqlite/1715761125002-CreateContacts.ts
|
|
9151
|
+
var CreateContacts1715761125002 = class {
|
|
8944
9152
|
static {
|
|
8945
|
-
__name(this, "
|
|
9153
|
+
__name(this, "CreateContacts1715761125002");
|
|
8946
9154
|
}
|
|
8947
|
-
name = "
|
|
9155
|
+
name = "CreateContacts1715761125002";
|
|
8948
9156
|
async up(queryRunner) {
|
|
8949
|
-
await queryRunner.query(`
|
|
8950
|
-
|
|
8951
|
-
|
|
8952
|
-
|
|
8953
|
-
|
|
8954
|
-
|
|
8955
|
-
|
|
8956
|
-
|
|
8957
|
-
|
|
8958
|
-
|
|
8959
|
-
|
|
8960
|
-
|
|
8961
|
-
|
|
8962
|
-
|
|
8963
|
-
|
|
8964
|
-
|
|
8965
|
-
|
|
8966
|
-
|
|
8967
|
-
|
|
8968
|
-
|
|
8969
|
-
|
|
8970
|
-
|
|
8971
|
-
|
|
8972
|
-
|
|
8973
|
-
|
|
8974
|
-
|
|
8975
|
-
|
|
8976
|
-
|
|
8977
|
-
"id", "correlationId", "length", "issuer", "type", "driverType",
|
|
8978
|
-
"credentialIdMode", "proofFormat", "indexingDirection", "statusPurpose",
|
|
8979
|
-
"statusListCredential", "bitsPerStatus", "expiresAt"
|
|
8980
|
-
FROM "StatusList"
|
|
8981
|
-
`);
|
|
8982
|
-
await queryRunner.query(`DROP TABLE "StatusList"`);
|
|
8983
|
-
await queryRunner.query(`ALTER TABLE "temporary_StatusList" RENAME TO "StatusList"`);
|
|
8984
|
-
await queryRunner.query(`
|
|
8985
|
-
CREATE TABLE "temporary_StatusListEntry" (
|
|
8986
|
-
"statusListId" varchar NOT NULL,
|
|
8987
|
-
"statusListIndex" integer NOT NULL,
|
|
8988
|
-
"credentialId" text,
|
|
8989
|
-
"credentialHash" varchar(128),
|
|
8990
|
-
"correlationId" varchar(255),
|
|
8991
|
-
"value" varchar(50),
|
|
8992
|
-
"type" varchar CHECK( "type" IN ('StatusListEntryEntity', 'bitstring') ) NOT NULL DEFAULT ('StatusListEntryEntity'),
|
|
8993
|
-
"statusPurpose" varchar,
|
|
8994
|
-
"bitsPerStatus" integer DEFAULT (1),
|
|
8995
|
-
"statusMessage" text,
|
|
8996
|
-
"statusReference" text,
|
|
8997
|
-
PRIMARY KEY ("statusListId", "statusListIndex")
|
|
8998
|
-
)
|
|
8999
|
-
`);
|
|
9000
|
-
await queryRunner.query(`
|
|
9001
|
-
INSERT INTO "temporary_StatusListEntry"(
|
|
9002
|
-
"statusListId", "statusListIndex", "credentialId", "credentialHash",
|
|
9003
|
-
"correlationId", "value", "type"
|
|
9004
|
-
)
|
|
9005
|
-
SELECT
|
|
9006
|
-
"statusListId", "statusListIndex", "credentialId", "credentialHash",
|
|
9007
|
-
"correlationId", "value", 'StatusListEntryEntity'
|
|
9008
|
-
FROM "StatusListEntry"
|
|
9009
|
-
`);
|
|
9010
|
-
await queryRunner.query(`DROP TABLE "StatusListEntry"`);
|
|
9011
|
-
await queryRunner.query(`ALTER TABLE "temporary_StatusListEntry" RENAME TO "StatusListEntry"`);
|
|
9157
|
+
await queryRunner.query(`ALTER TABLE "IdentityMetadata" RENAME TO "temporary_IdentityMetadata"`);
|
|
9158
|
+
await queryRunner.query(`CREATE TABLE "IdentityMetadata"
|
|
9159
|
+
(
|
|
9160
|
+
"id" varchar PRIMARY KEY NOT NULL,
|
|
9161
|
+
"label" varchar(255) NOT NULL,
|
|
9162
|
+
"valueType" varchar NOT NULL,
|
|
9163
|
+
"stringValue" varchar(255),
|
|
9164
|
+
"numberValue" double,
|
|
9165
|
+
"dateValue" datetime,
|
|
9166
|
+
"boolValue" boolean,
|
|
9167
|
+
"identityId" varchar,
|
|
9168
|
+
FOREIGN KEY ("identityId") REFERENCES "Identity" ("id") ON DELETE CASCADE)`);
|
|
9169
|
+
await queryRunner.query(`INSERT INTO "IdentityMetadata" ("id", "label", "valueType", "stringValue", "identityId")
|
|
9170
|
+
SELECT "id", "label", 'string', "value", "identityId"
|
|
9171
|
+
FROM "temporary_IdentityMetadata"
|
|
9172
|
+
`);
|
|
9173
|
+
await queryRunner.query(`DROP TABLE "temporary_IdentityMetadata"`);
|
|
9174
|
+
await queryRunner.query(`CREATE TABLE "ContactMetadata"
|
|
9175
|
+
(
|
|
9176
|
+
"id" varchar PRIMARY KEY NOT NULL,
|
|
9177
|
+
"label" varchar(255) NOT NULL,
|
|
9178
|
+
"valueType" varchar NOT NULL,
|
|
9179
|
+
"stringValue" text,
|
|
9180
|
+
"numberValue" double,
|
|
9181
|
+
"dateValue" datetime,
|
|
9182
|
+
"boolValue" boolean,
|
|
9183
|
+
"contactId" varchar,
|
|
9184
|
+
FOREIGN KEY ("contactId") REFERENCES "BaseContact" ("id") ON DELETE CASCADE)`);
|
|
9012
9185
|
}
|
|
9013
9186
|
async down(queryRunner) {
|
|
9014
|
-
await queryRunner.query(`
|
|
9015
|
-
|
|
9016
|
-
|
|
9017
|
-
|
|
9018
|
-
|
|
9019
|
-
|
|
9020
|
-
|
|
9021
|
-
|
|
9022
|
-
|
|
9023
|
-
|
|
9024
|
-
`)
|
|
9025
|
-
|
|
9026
|
-
|
|
9027
|
-
|
|
9028
|
-
"correlationId", "value"
|
|
9029
|
-
)
|
|
9030
|
-
SELECT
|
|
9031
|
-
"statusListId", "statusListIndex", "credentialId", "credentialHash",
|
|
9032
|
-
"correlationId", "value"
|
|
9033
|
-
FROM "StatusListEntry"
|
|
9034
|
-
WHERE "type" = 'StatusListEntryEntity'
|
|
9035
|
-
`);
|
|
9036
|
-
await queryRunner.query(`DROP TABLE "StatusListEntry"`);
|
|
9037
|
-
await queryRunner.query(`ALTER TABLE "temporary_StatusListEntry" RENAME TO "StatusListEntry"`);
|
|
9038
|
-
await queryRunner.query(`
|
|
9039
|
-
CREATE TABLE "temporary_StatusList" (
|
|
9040
|
-
"id" varchar PRIMARY KEY NOT NULL,
|
|
9041
|
-
"correlationId" varchar NOT NULL,
|
|
9042
|
-
"length" integer NOT NULL,
|
|
9043
|
-
"issuer" text NOT NULL,
|
|
9044
|
-
"type" varchar CHECK( "type" IN ('StatusList2021', 'OAuthStatusList') ) NOT NULL DEFAULT ('StatusList2021'),
|
|
9045
|
-
"driverType" varchar CHECK( "driverType" IN ('agent_typeorm','agent_kv_store','github','agent_filesystem') ) NOT NULL DEFAULT ('agent_typeorm'),
|
|
9046
|
-
"credentialIdMode" varchar CHECK( "credentialIdMode" IN ('ISSUANCE','PERSISTENCE','NEVER') ) NOT NULL DEFAULT ('ISSUANCE'),
|
|
9047
|
-
"proofFormat" varchar CHECK( "proofFormat" IN ('lds','jwt', 'vc+jwt') ) NOT NULL DEFAULT ('lds'),
|
|
9048
|
-
"indexingDirection" varchar CHECK( "indexingDirection" IN ('rightToLeft') ),
|
|
9049
|
-
"statusPurpose" varchar,
|
|
9050
|
-
"statusListCredential" text,
|
|
9051
|
-
"bitsPerStatus" integer,
|
|
9052
|
-
"expiresAt" datetime,
|
|
9053
|
-
CONSTRAINT "UQ_correlationId" UNIQUE ("correlationId")
|
|
9054
|
-
)
|
|
9055
|
-
`);
|
|
9056
|
-
await queryRunner.query(`
|
|
9057
|
-
INSERT INTO "temporary_StatusList"(
|
|
9058
|
-
"id", "correlationId", "length", "issuer", "type", "driverType",
|
|
9059
|
-
"credentialIdMode", "proofFormat", "indexingDirection", "statusPurpose",
|
|
9060
|
-
"statusListCredential", "bitsPerStatus", "expiresAt"
|
|
9061
|
-
)
|
|
9062
|
-
SELECT
|
|
9063
|
-
"id", "correlationId", "length", "issuer",
|
|
9064
|
-
CASE WHEN "type" = 'BitstringStatusList' THEN 'StatusList2021' ELSE "type" END,
|
|
9065
|
-
"driverType", "credentialIdMode", "proofFormat", "indexingDirection",
|
|
9066
|
-
"statusPurpose", "statusListCredential", "bitsPerStatus", "expiresAt"
|
|
9067
|
-
FROM "StatusList"
|
|
9068
|
-
`);
|
|
9069
|
-
await queryRunner.query(`DROP TABLE "StatusList"`);
|
|
9070
|
-
await queryRunner.query(`ALTER TABLE "temporary_StatusList" RENAME TO "StatusList"`);
|
|
9187
|
+
await queryRunner.query(`DROP TABLE "ContactMetadata"`);
|
|
9188
|
+
await queryRunner.query(`ALTER TABLE "IdentityMetadata" RENAME TO "temporary_IdentityMetadata"`);
|
|
9189
|
+
await queryRunner.query(`CREATE TABLE "IdentityMetadata"
|
|
9190
|
+
(
|
|
9191
|
+
"id" varchar PRIMARY KEY NOT NULL,
|
|
9192
|
+
"label" varchar(255) NOT NULL,
|
|
9193
|
+
"value" varchar(255) NOT NULL,
|
|
9194
|
+
"identityId" varchar,
|
|
9195
|
+
FOREIGN KEY ("identityId") REFERENCES "Identity" ("id") ON DELETE CASCADE
|
|
9196
|
+
)`);
|
|
9197
|
+
await queryRunner.query(`INSERT INTO "IdentityMetadata" ("id", "label", "value", "identityId")
|
|
9198
|
+
SELECT "id", "label", "stringValue", "identityId"
|
|
9199
|
+
FROM "temporary_IdentityMetadata"`);
|
|
9200
|
+
await queryRunner.query(`DROP TABLE "temporary_IdentityMetadata"`);
|
|
9071
9201
|
}
|
|
9072
9202
|
};
|
|
9073
9203
|
|
|
9074
|
-
// src/migrations/generic/
|
|
9075
|
-
var
|
|
9076
|
-
var
|
|
9204
|
+
// src/migrations/generic/9-CreateContacts.ts
|
|
9205
|
+
var debug20 = Debug20("sphereon:ssi-sdk:migrations");
|
|
9206
|
+
var CreateContacts1715761125000 = class {
|
|
9077
9207
|
static {
|
|
9078
|
-
__name(this, "
|
|
9208
|
+
__name(this, "CreateContacts1715761125000");
|
|
9079
9209
|
}
|
|
9080
|
-
name = "
|
|
9210
|
+
name = "CreateContacts1715761125000";
|
|
9081
9211
|
async up(queryRunner) {
|
|
9082
|
-
|
|
9212
|
+
debug20("migration: updating contact tables");
|
|
9083
9213
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9084
9214
|
switch (dbType) {
|
|
9085
9215
|
case "postgres": {
|
|
9086
|
-
|
|
9216
|
+
debug20("using postgres migration file");
|
|
9217
|
+
const mig = new CreateContacts1715761125001();
|
|
9087
9218
|
await mig.up(queryRunner);
|
|
9219
|
+
debug20("Migration statements executed");
|
|
9088
9220
|
return;
|
|
9089
9221
|
}
|
|
9090
9222
|
case "sqlite":
|
|
9091
9223
|
case "expo":
|
|
9092
9224
|
case "react-native": {
|
|
9093
|
-
|
|
9225
|
+
debug20("using sqlite/react-native migration file");
|
|
9226
|
+
const mig = new CreateContacts1715761125002();
|
|
9094
9227
|
await mig.up(queryRunner);
|
|
9228
|
+
debug20("Migration statements executed");
|
|
9095
9229
|
return;
|
|
9096
9230
|
}
|
|
9097
9231
|
default:
|
|
9098
|
-
return Promise.reject(`Migrations only supported for sqlite and postgres. Was ${dbType}`);
|
|
9232
|
+
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`);
|
|
9099
9233
|
}
|
|
9100
9234
|
}
|
|
9101
9235
|
async down(queryRunner) {
|
|
9102
|
-
|
|
9236
|
+
debug20("migration: reverting machine state tables");
|
|
9103
9237
|
const dbType = queryRunner.connection.driver.options.type;
|
|
9104
9238
|
switch (dbType) {
|
|
9105
9239
|
case "postgres": {
|
|
9106
|
-
|
|
9240
|
+
debug20("using postgres migration file");
|
|
9241
|
+
const mig = new CreateContacts1715761125001();
|
|
9107
9242
|
await mig.down(queryRunner);
|
|
9243
|
+
debug20("Migration statements executed");
|
|
9108
9244
|
return;
|
|
9109
9245
|
}
|
|
9110
9246
|
case "sqlite":
|
|
9111
9247
|
case "expo":
|
|
9112
9248
|
case "react-native": {
|
|
9113
|
-
|
|
9249
|
+
debug20("using sqlite/react-native migration file");
|
|
9250
|
+
const mig = new CreateContacts1715761125002();
|
|
9114
9251
|
await mig.down(queryRunner);
|
|
9252
|
+
debug20("Migration statements executed");
|
|
9115
9253
|
return;
|
|
9116
9254
|
}
|
|
9117
9255
|
default:
|
|
9118
|
-
return Promise.reject(`Migrations only supported for sqlite and postgres. Was ${dbType}`);
|
|
9256
|
+
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`);
|
|
9119
9257
|
}
|
|
9120
9258
|
}
|
|
9121
9259
|
};
|
|
@@ -9133,6 +9271,7 @@ var DataStoreIssuanceBrandingMigrations = [
|
|
|
9133
9271
|
];
|
|
9134
9272
|
var DataStoreStatusListMigrations = [
|
|
9135
9273
|
CreateStatusList1693866470000,
|
|
9274
|
+
AddBitstringStatusListEnum1741895823000,
|
|
9136
9275
|
CreateBitstringStatusList1741895823000
|
|
9137
9276
|
];
|
|
9138
9277
|
var DataStoreEventLoggerMigrations = [
|
|
@@ -9145,7 +9284,8 @@ var DataStoreMachineStateMigrations = [
|
|
|
9145
9284
|
CreateMachineStateStore1708098041262
|
|
9146
9285
|
];
|
|
9147
9286
|
var DataStorePresentationDefinitionMigrations = [
|
|
9148
|
-
CreatePresentationDefinitions1716533767523
|
|
9287
|
+
CreatePresentationDefinitions1716533767523,
|
|
9288
|
+
CreateDcqlQueryItem1726617600000
|
|
9149
9289
|
];
|
|
9150
9290
|
var DataStoreMigrations = [
|
|
9151
9291
|
...DataStoreContactMigrations,
|
|
@@ -9332,7 +9472,7 @@ var DataStoreIssuanceBrandingEntities = [
|
|
|
9332
9472
|
CredentialClaimsEntity
|
|
9333
9473
|
];
|
|
9334
9474
|
var DataStorePresentationDefinitionEntities = [
|
|
9335
|
-
|
|
9475
|
+
DcqlQueryItemEntity
|
|
9336
9476
|
];
|
|
9337
9477
|
var DataStoreStatusListEntities = [
|
|
9338
9478
|
StatusListEntity,
|
|
@@ -9384,7 +9524,6 @@ export {
|
|
|
9384
9524
|
CredentialCorrelationType,
|
|
9385
9525
|
CredentialDocumentFormat,
|
|
9386
9526
|
CredentialLocaleBrandingEntity,
|
|
9387
|
-
CredentialRole,
|
|
9388
9527
|
CredentialStateType,
|
|
9389
9528
|
DataStoreContactEntities,
|
|
9390
9529
|
DataStoreContactMigrations,
|
|
@@ -9403,6 +9542,7 @@ export {
|
|
|
9403
9542
|
DataStorePresentationDefinitionMigrations,
|
|
9404
9543
|
DataStoreStatusListEntities,
|
|
9405
9544
|
DataStoreStatusListMigrations,
|
|
9545
|
+
DcqlQueryItemEntity,
|
|
9406
9546
|
DidAuthConfigEntity,
|
|
9407
9547
|
DigitalCredentialEntity,
|
|
9408
9548
|
DigitalCredentialStore,
|
|
@@ -9428,7 +9568,6 @@ export {
|
|
|
9428
9568
|
PartyOrigin,
|
|
9429
9569
|
PartyTypeType,
|
|
9430
9570
|
PhysicalAddressEntity,
|
|
9431
|
-
PresentationDefinitionItemEntity,
|
|
9432
9571
|
RegulationType,
|
|
9433
9572
|
StatusList2021Entity,
|
|
9434
9573
|
StatusListEntity,
|
|
@@ -9452,6 +9591,8 @@ export {
|
|
|
9452
9591
|
credentialBrandingFrom,
|
|
9453
9592
|
credentialClaimsEntityFrom,
|
|
9454
9593
|
credentialLocaleBrandingEntityFrom,
|
|
9594
|
+
dcqlQueryEntityItemFrom,
|
|
9595
|
+
dcqlQueryItemFrom,
|
|
9455
9596
|
didAuthConfigEntityFrom,
|
|
9456
9597
|
didAuthConfigFrom,
|
|
9457
9598
|
digitalCredentialFrom,
|
|
@@ -9491,8 +9632,6 @@ export {
|
|
|
9491
9632
|
partyTypeFrom,
|
|
9492
9633
|
physicalAddressEntityFrom,
|
|
9493
9634
|
physicalAddressFrom,
|
|
9494
|
-
presentationDefinitionEntityItemFrom,
|
|
9495
|
-
presentationDefinitionItemFrom,
|
|
9496
9635
|
textAttributesEntityFrom
|
|
9497
9636
|
};
|
|
9498
9637
|
//# sourceMappingURL=index.js.map
|