@sphereon/ssi-sdk.data-store 0.33.0 → 0.33.1-feature.vcdm2.4
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/contact/AbstractContactStore.js +1 -5
- package/dist/contact/AbstractContactStore.js.map +1 -1
- package/dist/contact/ContactStore.js +544 -545
- package/dist/contact/ContactStore.js.map +1 -1
- package/dist/digitalCredential/AbstractDigitalCredentialStore.js +1 -5
- package/dist/digitalCredential/AbstractDigitalCredentialStore.js.map +1 -1
- package/dist/digitalCredential/DigitalCredentialStore.js +131 -142
- package/dist/digitalCredential/DigitalCredentialStore.js.map +1 -1
- package/dist/entities/contact/BaseConfigEntity.js +13 -14
- package/dist/entities/contact/BaseConfigEntity.js.map +1 -1
- package/dist/entities/contact/BaseContactEntity.js +24 -22
- package/dist/entities/contact/BaseContactEntity.js.map +1 -1
- package/dist/entities/contact/ConnectionEntity.js +23 -20
- package/dist/entities/contact/ConnectionEntity.js.map +1 -1
- package/dist/entities/contact/ContactMetadataItemEntity.js +38 -44
- package/dist/entities/contact/ContactMetadataItemEntity.js.map +1 -1
- package/dist/entities/contact/CorrelationIdentifierEntity.js +34 -42
- package/dist/entities/contact/CorrelationIdentifierEntity.js.map +1 -1
- package/dist/entities/contact/DidAuthConfigEntity.js +16 -14
- package/dist/entities/contact/DidAuthConfigEntity.js.map +1 -1
- package/dist/entities/contact/ElectronicAddressEntity.js +42 -47
- package/dist/entities/contact/ElectronicAddressEntity.js.map +1 -1
- package/dist/entities/contact/IdentityEntity.js +56 -57
- package/dist/entities/contact/IdentityEntity.js.map +1 -1
- package/dist/entities/contact/IdentityMetadataItemEntity.js +38 -44
- package/dist/entities/contact/IdentityMetadataItemEntity.js.map +1 -1
- package/dist/entities/contact/NaturalPersonEntity.js +35 -43
- package/dist/entities/contact/NaturalPersonEntity.js.map +1 -1
- package/dist/entities/contact/OpenIdConfigEntity.js +24 -18
- package/dist/entities/contact/OpenIdConfigEntity.js.map +1 -1
- package/dist/entities/contact/OrganizationEntity.js +28 -38
- package/dist/entities/contact/OrganizationEntity.js.map +1 -1
- package/dist/entities/contact/PartyEntity.js +57 -59
- package/dist/entities/contact/PartyEntity.js.map +1 -1
- package/dist/entities/contact/PartyRelationshipEntity.js +37 -43
- package/dist/entities/contact/PartyRelationshipEntity.js.map +1 -1
- package/dist/entities/contact/PartyTypeEntity.js +44 -49
- package/dist/entities/contact/PartyTypeEntity.js.map +1 -1
- package/dist/entities/contact/PhysicalAddressEntity.js +61 -60
- package/dist/entities/contact/PhysicalAddressEntity.js.map +1 -1
- package/dist/entities/digitalCredential/DigitalCredentialEntity.js +63 -38
- package/dist/entities/digitalCredential/DigitalCredentialEntity.js.map +1 -1
- package/dist/entities/eventLogger/AuditEventEntity.js +60 -37
- package/dist/entities/eventLogger/AuditEventEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.js +25 -36
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/BaseLocaleBrandingEntity.js +48 -53
- package/dist/entities/issuanceBranding/BaseLocaleBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.js +35 -43
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/CredentialClaimsEntity.js +28 -38
- package/dist/entities/issuanceBranding/CredentialClaimsEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.js +18 -18
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/ImageAttributesEntity.js +34 -42
- package/dist/entities/issuanceBranding/ImageAttributesEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.js +11 -11
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.js +31 -40
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.js +27 -24
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/TextAttributesEntity.js +20 -32
- package/dist/entities/issuanceBranding/TextAttributesEntity.js.map +1 -1
- package/dist/entities/machineState/MachineStateInfoEntity.js +31 -21
- package/dist/entities/machineState/MachineStateInfoEntity.js.map +1 -1
- package/dist/entities/oid4vcState/Oid4vcStateEntity.js +24 -18
- package/dist/entities/oid4vcState/Oid4vcStateEntity.js.map +1 -1
- package/dist/entities/presentationDefinition/PresentationDefinitionItemEntity.js +34 -27
- package/dist/entities/presentationDefinition/PresentationDefinitionItemEntity.js.map +1 -1
- package/dist/entities/statusList/StatusList2021EntryEntity.js +26 -22
- package/dist/entities/statusList/StatusList2021EntryEntity.js.map +1 -1
- package/dist/entities/statusList/StatusListEntities.js +48 -39
- package/dist/entities/statusList/StatusListEntities.js.map +1 -1
- package/dist/entities/validators/index.js +6 -10
- package/dist/entities/validators/index.js.map +1 -1
- package/dist/eventLogger/AbstractEventLoggerStore.js +1 -5
- package/dist/eventLogger/AbstractEventLoggerStore.js.map +1 -1
- package/dist/eventLogger/EventLoggerStore.js +50 -65
- package/dist/eventLogger/EventLoggerStore.js.map +1 -1
- package/dist/index.js +96 -163
- package/dist/index.js.map +1 -1
- package/dist/issuanceBranding/AbstractIssuanceBrandingStore.js +1 -5
- package/dist/issuanceBranding/AbstractIssuanceBrandingStore.js.map +1 -1
- package/dist/issuanceBranding/IssuanceBrandingStore.js +331 -333
- package/dist/issuanceBranding/IssuanceBrandingStore.js.map +1 -1
- package/dist/machineState/IAbstractMachineStateStore.js +1 -5
- package/dist/machineState/IAbstractMachineStateStore.js.map +1 -1
- package/dist/machineState/MachineStateStore.js +102 -122
- package/dist/machineState/MachineStateStore.js.map +1 -1
- package/dist/migrations/generic/1-CreateContacts.js +50 -72
- package/dist/migrations/generic/1-CreateContacts.js.map +1 -1
- package/dist/migrations/generic/10-CreatePresentationDefinitions.js +50 -72
- package/dist/migrations/generic/10-CreatePresentationDefinitions.js.map +1 -1
- package/dist/migrations/generic/11-FixCredentialClaimsReferenceUuid.js +52 -74
- package/dist/migrations/generic/11-FixCredentialClaimsReferenceUuid.js.map +1 -1
- package/dist/migrations/generic/2-CreateIssuanceBranding.js +50 -72
- package/dist/migrations/generic/2-CreateIssuanceBranding.js.map +1 -1
- package/dist/migrations/generic/3-CreateContacts.js +50 -72
- package/dist/migrations/generic/3-CreateContacts.js.map +1 -1
- package/dist/migrations/generic/4-CreateStatusList.js +56 -78
- package/dist/migrations/generic/4-CreateStatusList.js.map +1 -1
- package/dist/migrations/generic/5-CreateAuditEvents.js +50 -72
- package/dist/migrations/generic/5-CreateAuditEvents.js.map +1 -1
- package/dist/migrations/generic/6-CreateDigitalCredential.js +50 -72
- package/dist/migrations/generic/6-CreateDigitalCredential.js.map +1 -1
- package/dist/migrations/generic/7-CreateMachineStateStore.js +50 -72
- package/dist/migrations/generic/7-CreateMachineStateStore.js.map +1 -1
- package/dist/migrations/generic/8-CreateContacts.js +50 -72
- package/dist/migrations/generic/8-CreateContacts.js.map +1 -1
- package/dist/migrations/generic/9-CreateContacts.js +50 -72
- package/dist/migrations/generic/9-CreateContacts.js.map +1 -1
- package/dist/migrations/generic/index.js +30 -33
- package/dist/migrations/generic/index.js.map +1 -1
- package/dist/migrations/index.js +1 -12
- package/dist/migrations/index.js.map +1 -1
- package/dist/migrations/internal-migrations-ormconfig.js +6 -8
- package/dist/migrations/internal-migrations-ormconfig.js.map +1 -1
- package/dist/migrations/postgres/1659463079428-CreateContacts.js +34 -53
- package/dist/migrations/postgres/1659463079428-CreateContacts.js.map +1 -1
- package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.js +50 -69
- package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.js.map +1 -1
- package/dist/migrations/postgres/1690925872592-CreateContacts.js +87 -106
- package/dist/migrations/postgres/1690925872592-CreateContacts.js.map +1 -1
- package/dist/migrations/postgres/1693866470001-CreateStatusList.js +16 -35
- package/dist/migrations/postgres/1693866470001-CreateStatusList.js.map +1 -1
- package/dist/migrations/postgres/1701634812183-CreateAuditEvents.js +22 -41
- package/dist/migrations/postgres/1701634812183-CreateAuditEvents.js.map +1 -1
- package/dist/migrations/postgres/1708525189001-CreateDigitalCredential.js +19 -38
- package/dist/migrations/postgres/1708525189001-CreateDigitalCredential.js.map +1 -1
- package/dist/migrations/postgres/1708797018115-CreateMachineStateStore.js +6 -25
- package/dist/migrations/postgres/1708797018115-CreateMachineStateStore.js.map +1 -1
- package/dist/migrations/postgres/1710438363001-CreateContacts.js +40 -59
- package/dist/migrations/postgres/1710438363001-CreateContacts.js.map +1 -1
- package/dist/migrations/postgres/1715761125001-CreateContacts.js +18 -37
- package/dist/migrations/postgres/1715761125001-CreateContacts.js.map +1 -1
- package/dist/migrations/postgres/1716475165345-CreatePresentationDefinitions.js +6 -25
- package/dist/migrations/postgres/1716475165345-CreatePresentationDefinitions.js.map +1 -1
- package/dist/migrations/postgres/1737110469001-UpdateStatusList.js +16 -35
- package/dist/migrations/postgres/1737110469001-UpdateStatusList.js.map +1 -1
- package/dist/migrations/postgres/1741895822987-FixCredentialClaimsReferencesUuid.js +8 -27
- package/dist/migrations/postgres/1741895822987-FixCredentialClaimsReferencesUuid.js.map +1 -1
- package/dist/migrations/sqlite/1659463069549-CreateContacts.js +56 -75
- package/dist/migrations/sqlite/1659463069549-CreateContacts.js.map +1 -1
- package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.js +70 -89
- package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.js.map +1 -1
- package/dist/migrations/sqlite/1690925872693-CreateContacts.js +120 -139
- package/dist/migrations/sqlite/1690925872693-CreateContacts.js.map +1 -1
- package/dist/migrations/sqlite/1693866470000-CreateStatusList.js +12 -31
- package/dist/migrations/sqlite/1693866470000-CreateStatusList.js.map +1 -1
- package/dist/migrations/sqlite/1701634819487-CreateAuditEvents.js +6 -25
- package/dist/migrations/sqlite/1701634819487-CreateAuditEvents.js.map +1 -1
- package/dist/migrations/sqlite/1708525189002-CreateDigitalCredential.js +7 -26
- package/dist/migrations/sqlite/1708525189002-CreateDigitalCredential.js.map +1 -1
- package/dist/migrations/sqlite/1708796002272-CreateMachineStateStore.js +6 -25
- package/dist/migrations/sqlite/1708796002272-CreateMachineStateStore.js.map +1 -1
- package/dist/migrations/sqlite/1710438363002-CreateContacts.js +43 -62
- package/dist/migrations/sqlite/1710438363002-CreateContacts.js.map +1 -1
- package/dist/migrations/sqlite/1715761125002-CreateContacts.js +18 -37
- package/dist/migrations/sqlite/1715761125002-CreateContacts.js.map +1 -1
- package/dist/migrations/sqlite/1716475165344-CreatePresentationDefinitions.js +6 -25
- package/dist/migrations/sqlite/1716475165344-CreatePresentationDefinitions.js.map +1 -1
- package/dist/migrations/sqlite/1737110469000-UpdateStatusList.js +20 -39
- package/dist/migrations/sqlite/1737110469000-UpdateStatusList.js.map +1 -1
- package/dist/migrations/sqlite/1741895822987-FixCredentialClaimsReferencesUuid.js +25 -44
- package/dist/migrations/sqlite/1741895822987-FixCredentialClaimsReferencesUuid.js.map +1 -1
- package/dist/presentationDefinition/AbstractPDStore.js +1 -5
- package/dist/presentationDefinition/AbstractPDStore.js.map +1 -1
- package/dist/presentationDefinition/PDStore.js +114 -123
- package/dist/presentationDefinition/PDStore.js.map +1 -1
- package/dist/statusList/IStatusListStore.js +1 -2
- package/dist/statusList/StatusListStore.js +196 -225
- package/dist/statusList/StatusListStore.js.map +1 -1
- package/dist/types/contact/IAbstractContactStore.js +1 -2
- package/dist/types/contact/contact.js +10 -13
- package/dist/types/contact/contact.js.map +1 -1
- package/dist/types/digitalCredential/IAbstractDigitalCredentialStore.js +1 -2
- package/dist/types/digitalCredential/digitalCredential.js +13 -16
- package/dist/types/digitalCredential/digitalCredential.js.map +1 -1
- package/dist/types/eventLogger/IAbstractEventLoggerStore.js +1 -2
- package/dist/types/eventLogger/eventLogger.js +1 -2
- package/dist/types/index.js +14 -30
- package/dist/types/index.js.map +1 -1
- package/dist/types/issuanceBranding/IAbstractIssuanceBrandingStore.js +1 -2
- package/dist/types/issuanceBranding/issuanceBranding.js +1 -2
- package/dist/types/machineState/IAbstractMachineStateStore.js +1 -2
- package/dist/types/presentationDefinition/IAbstractPDStore.js +1 -2
- package/dist/types/presentationDefinition/presentationDefinition.js +1 -2
- package/dist/types/statusList/IAbstractStatusListStore.js +1 -2
- package/dist/types/statusList/statusList.js +1 -2
- package/dist/types/validation/validation.js +1 -2
- package/dist/utils/FormattingUtils.js +3 -7
- package/dist/utils/FormattingUtils.js.map +1 -1
- package/dist/utils/SortingUtils.js +1 -5
- package/dist/utils/SortingUtils.js.map +1 -1
- package/dist/utils/ValidatorUtils.js +2 -6
- package/dist/utils/ValidatorUtils.js.map +1 -1
- package/dist/utils/contact/MappingUtils.js +124 -150
- package/dist/utils/contact/MappingUtils.js.map +1 -1
- package/dist/utils/digitalCredential/MappingUtils.js +50 -47
- package/dist/utils/digitalCredential/MappingUtils.js.map +1 -1
- package/dist/utils/eventLogger/MappingUtils.js +60 -22
- package/dist/utils/eventLogger/MappingUtils.js.map +1 -1
- package/dist/utils/issuanceBranding/MappingUtils.js +71 -77
- package/dist/utils/issuanceBranding/MappingUtils.js.map +1 -1
- package/dist/utils/presentationDefinition/MappingUtils.js +9 -15
- package/dist/utils/presentationDefinition/MappingUtils.js.map +1 -1
- package/dist/utils/statusList/MappingUtils.js +27 -22
- package/dist/utils/statusList/MappingUtils.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,73 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { enablePostgresUuidExtension } from '@sphereon/ssi-sdk.core';
|
|
2
|
+
export class CreateIssuanceBranding1685628974232 {
|
|
3
|
+
name = 'CreateIssuanceBranding1685628974232';
|
|
4
|
+
async up(queryRunner) {
|
|
5
|
+
await enablePostgresUuidExtension(queryRunner);
|
|
6
|
+
await queryRunner.query(`CREATE TABLE "ImageDimensions" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "width" integer NOT NULL, "height" integer NOT NULL, CONSTRAINT "PK_ImageDimensions_id" PRIMARY KEY ("id"))`);
|
|
7
|
+
await queryRunner.query(`CREATE TABLE "ImageAttributes" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "uri" character varying, "dataUri" character varying, "mediaType" character varying(255), "alt" character varying(255), "dimensionsId" uuid, CONSTRAINT "UQ_dimensionsId" UNIQUE ("dimensionsId"), CONSTRAINT "PK_ImageAttributes_id" PRIMARY KEY ("id"))`);
|
|
8
|
+
await queryRunner.query(`CREATE TABLE "BackgroundAttributes" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "color" character varying(255), "imageId" uuid, CONSTRAINT "UQ_imageId" UNIQUE ("imageId"), CONSTRAINT "PK_BackgroundAttributes_id" PRIMARY KEY ("id"))`);
|
|
9
|
+
await queryRunner.query(`CREATE TABLE "TextAttributes" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "color" character varying(255), CONSTRAINT "PK_TextAttributes_id" PRIMARY KEY ("id"))`);
|
|
10
|
+
await queryRunner.query(`CREATE TABLE "BaseLocaleBranding" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "alias" character varying(255), "locale" character varying(255) NOT NULL, "description" character varying(255), "created_at" TIMESTAMP NOT NULL DEFAULT now(), "last_updated_at" TIMESTAMP NOT NULL DEFAULT now(), "credentialBrandingId" uuid, "issuerBrandingId" uuid, "type" character varying NOT NULL, "logoId" uuid, "backgroundId" uuid, "textId" uuid, "client_uri" character varying, "tos_uri" character varying, "policy_uri" character varying, "contacts" character varying, CONSTRAINT "UQ_logoId" UNIQUE ("logoId"), CONSTRAINT "UQ_backgroundId" UNIQUE ("backgroundId"), CONSTRAINT "UQ_textId" UNIQUE ("textId"), CONSTRAINT "PK_BaseLocaleBranding_id" PRIMARY KEY ("id"))`);
|
|
11
|
+
await queryRunner.query(`CREATE UNIQUE INDEX "IDX_CredentialLocaleBrandingEntity_credentialBranding_locale" ON "BaseLocaleBranding" ("credentialBrandingId", "locale")`);
|
|
12
|
+
await queryRunner.query(`CREATE UNIQUE INDEX "IDX_IssuerLocaleBrandingEntity_issuerBranding_locale" ON "BaseLocaleBranding" ("issuerBrandingId", "locale")`);
|
|
13
|
+
await queryRunner.query(`CREATE INDEX "IDX_BaseLocaleBranding_type" ON "BaseLocaleBranding" ("type")`);
|
|
14
|
+
await queryRunner.query(`CREATE TABLE "CredentialClaims" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "key" character varying(255) NOT NULL, "name" character varying(255) NOT NULL, "credentialLocaleBrandingId" character varying, CONSTRAINT "PK_CredentialClaims_id" PRIMARY KEY ("id"))`);
|
|
15
|
+
await queryRunner.query(`CREATE UNIQUE INDEX "IDX_CredentialClaimsEntity_credentialLocaleBranding_locale" ON "CredentialClaims" ("credentialLocaleBrandingId", "key")`);
|
|
16
|
+
await queryRunner.query(`CREATE TABLE "CredentialBranding" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "vcHash" character varying(255) NOT NULL, "issuerCorrelationId" character varying(255) NOT NULL, "created_at" TIMESTAMP NOT NULL DEFAULT now(), "last_updated_at" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "UQ_vcHash" UNIQUE ("vcHash"), CONSTRAINT "PK_CredentialBranding_id" PRIMARY KEY ("id"))`);
|
|
17
|
+
await queryRunner.query(`CREATE INDEX "IDX_CredentialBrandingEntity_issuerCorrelationId" ON "CredentialBranding" ("issuerCorrelationId")`);
|
|
18
|
+
await queryRunner.query(`CREATE INDEX "IDX_CredentialBrandingEntity_vcHash" ON "CredentialBranding" ("vcHash")`);
|
|
19
|
+
await queryRunner.query(`CREATE TABLE "IssuerBranding" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "issuerCorrelationId" character varying(255) NOT NULL, "created_at" TIMESTAMP NOT NULL DEFAULT now(), "last_updated_at" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "UQ_issuerCorrelationId" UNIQUE ("issuerCorrelationId"), CONSTRAINT "PK_IssuerBranding_id" PRIMARY KEY ("id"))`);
|
|
20
|
+
await queryRunner.query(`CREATE INDEX "IDX_IssuerBrandingEntity_issuerCorrelationId" ON "IssuerBranding" ("issuerCorrelationId")`);
|
|
21
|
+
await queryRunner.query(`ALTER TABLE "ImageAttributes" ADD CONSTRAINT "FK_ImageAttributes_dimensionsId" FOREIGN KEY ("dimensionsId") REFERENCES "ImageDimensions"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
22
|
+
await queryRunner.query(`ALTER TABLE "BackgroundAttributes" ADD CONSTRAINT "FK_BackgroundAttributes_imageId" FOREIGN KEY ("imageId") REFERENCES "ImageAttributes"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
23
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" ADD CONSTRAINT "FK_BaseLocaleBranding_logoId" FOREIGN KEY ("logoId") REFERENCES "ImageAttributes"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
24
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" ADD CONSTRAINT "FK_BaseLocaleBranding_backgroundId" FOREIGN KEY ("backgroundId") REFERENCES "BackgroundAttributes"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
25
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" ADD CONSTRAINT "FK_BaseLocaleBranding_textId" FOREIGN KEY ("textId") REFERENCES "TextAttributes"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
26
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" ADD CONSTRAINT "FK_BaseLocaleBranding_credentialBrandingId" FOREIGN KEY ("credentialBrandingId") REFERENCES "CredentialBranding"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
27
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" ADD CONSTRAINT "FK_BaseLocaleBranding_issuerBrandingId" FOREIGN KEY ("issuerBrandingId") REFERENCES "IssuerBranding"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
17
28
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
yield queryRunner.query(`ALTER TABLE "BaseLocaleBranding" ADD CONSTRAINT "FK_BaseLocaleBranding_credentialBrandingId" FOREIGN KEY ("credentialBrandingId") REFERENCES "CredentialBranding"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
42
|
-
yield queryRunner.query(`ALTER TABLE "BaseLocaleBranding" ADD CONSTRAINT "FK_BaseLocaleBranding_issuerBrandingId" FOREIGN KEY ("issuerBrandingId") REFERENCES "IssuerBranding"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
down(queryRunner) {
|
|
46
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
-
yield queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP CONSTRAINT "FK_BaseLocaleBranding_issuerBrandingId"`);
|
|
48
|
-
yield queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP CONSTRAINT "FK_BaseLocaleBranding_credentialBrandingId"`);
|
|
49
|
-
yield queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP CONSTRAINT "FK_BaseLocaleBranding_textId"`);
|
|
50
|
-
yield queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP CONSTRAINT "FK_BaseLocaleBranding_backgroundId"`);
|
|
51
|
-
yield queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP CONSTRAINT "FK_BaseLocaleBranding_logoId"`);
|
|
52
|
-
yield queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP CONSTRAINT "FK_BackgroundAttributes_imageId"`);
|
|
53
|
-
yield queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP CONSTRAINT "FK_ImageAttributes_dimensionsId"`);
|
|
54
|
-
yield queryRunner.query(`ALTER TABLE "IssuerBranding" DROP INDEX "IDX_IssuerBrandingEntity_issuerCorrelationId"`);
|
|
55
|
-
yield queryRunner.query(`DROP TABLE "IssuerBranding"`);
|
|
56
|
-
yield queryRunner.query(`ALTER TABLE "CredentialBranding" DROP INDEX "IDX_CredentialBrandingEntity_vcHash"`);
|
|
57
|
-
yield queryRunner.query(`ALTER TABLE "CredentialBranding" DROP INDEX "IDX_CredentialBrandingEntity_issuerCorrelationId"`);
|
|
58
|
-
yield queryRunner.query(`DROP TABLE "CredentialBranding"`);
|
|
59
|
-
yield queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP INDEX "IDX_BaseLocaleBranding_type"`);
|
|
60
|
-
yield queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP INDEX "IDX_IssuerLocaleBrandingEntity_issuerBranding_locale"`);
|
|
61
|
-
yield queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP INDEX "IDX_CredentialLocaleBrandingEntity_credentialBranding_locale"`);
|
|
62
|
-
yield queryRunner.query(`ALTER TABLE "CredentialClaims" DROP INDEX "IDX_CredentialClaimsEntity_credentialLocaleBranding_locale"`);
|
|
63
|
-
yield queryRunner.query(`DROP TABLE "CredentialClaims"`);
|
|
64
|
-
yield queryRunner.query(`DROP TABLE "BaseLocaleBranding"`);
|
|
65
|
-
yield queryRunner.query(`DROP TABLE "TextAttributes"`);
|
|
66
|
-
yield queryRunner.query(`DROP TABLE "BackgroundAttributes"`);
|
|
67
|
-
yield queryRunner.query(`DROP TABLE "ImageAttributes"`);
|
|
68
|
-
yield queryRunner.query(`DROP TABLE "ImageDimensions"`);
|
|
69
|
-
});
|
|
29
|
+
async down(queryRunner) {
|
|
30
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP CONSTRAINT "FK_BaseLocaleBranding_issuerBrandingId"`);
|
|
31
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP CONSTRAINT "FK_BaseLocaleBranding_credentialBrandingId"`);
|
|
32
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP CONSTRAINT "FK_BaseLocaleBranding_textId"`);
|
|
33
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP CONSTRAINT "FK_BaseLocaleBranding_backgroundId"`);
|
|
34
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP CONSTRAINT "FK_BaseLocaleBranding_logoId"`);
|
|
35
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP CONSTRAINT "FK_BackgroundAttributes_imageId"`);
|
|
36
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP CONSTRAINT "FK_ImageAttributes_dimensionsId"`);
|
|
37
|
+
await queryRunner.query(`ALTER TABLE "IssuerBranding" DROP INDEX "IDX_IssuerBrandingEntity_issuerCorrelationId"`);
|
|
38
|
+
await queryRunner.query(`DROP TABLE "IssuerBranding"`);
|
|
39
|
+
await queryRunner.query(`ALTER TABLE "CredentialBranding" DROP INDEX "IDX_CredentialBrandingEntity_vcHash"`);
|
|
40
|
+
await queryRunner.query(`ALTER TABLE "CredentialBranding" DROP INDEX "IDX_CredentialBrandingEntity_issuerCorrelationId"`);
|
|
41
|
+
await queryRunner.query(`DROP TABLE "CredentialBranding"`);
|
|
42
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP INDEX "IDX_BaseLocaleBranding_type"`);
|
|
43
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP INDEX "IDX_IssuerLocaleBrandingEntity_issuerBranding_locale"`);
|
|
44
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP INDEX "IDX_CredentialLocaleBrandingEntity_credentialBranding_locale"`);
|
|
45
|
+
await queryRunner.query(`ALTER TABLE "CredentialClaims" DROP INDEX "IDX_CredentialClaimsEntity_credentialLocaleBranding_locale"`);
|
|
46
|
+
await queryRunner.query(`DROP TABLE "CredentialClaims"`);
|
|
47
|
+
await queryRunner.query(`DROP TABLE "BaseLocaleBranding"`);
|
|
48
|
+
await queryRunner.query(`DROP TABLE "TextAttributes"`);
|
|
49
|
+
await queryRunner.query(`DROP TABLE "BackgroundAttributes"`);
|
|
50
|
+
await queryRunner.query(`DROP TABLE "ImageAttributes"`);
|
|
51
|
+
await queryRunner.query(`DROP TABLE "ImageDimensions"`);
|
|
70
52
|
}
|
|
71
53
|
}
|
|
72
|
-
exports.CreateIssuanceBranding1685628974232 = CreateIssuanceBranding1685628974232;
|
|
73
54
|
//# sourceMappingURL=1685628974232-CreateIssuanceBranding.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"1685628974232-CreateIssuanceBranding.js","sourceRoot":"","sources":["../../../src/migrations/postgres/1685628974232-CreateIssuanceBranding.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"1685628974232-CreateIssuanceBranding.js","sourceRoot":"","sources":["../../../src/migrations/postgres/1685628974232-CreateIssuanceBranding.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAA;AAEpE,MAAM,OAAO,mCAAmC;IAC9C,IAAI,GAAG,qCAAqC,CAAA;IAErC,KAAK,CAAC,EAAE,CAAC,WAAwB;QACtC,MAAM,2BAA2B,CAAC,WAAW,CAA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AK,CAAC,8BAA8B,CAAC,CAAA;QACvD,MAAM,WAAW,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAA;IACzD,CAAC;CACF"}
|
|
@@ -1,110 +1,91 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { enablePostgresUuidExtension } from '@sphereon/ssi-sdk.core';
|
|
2
|
+
export class CreateContacts1690925872592 {
|
|
3
|
+
name = 'CreateContacts1690925872592';
|
|
4
|
+
async up(queryRunner) {
|
|
5
|
+
await enablePostgresUuidExtension(queryRunner);
|
|
6
|
+
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" DROP CONSTRAINT "FK_CorrelationIdentifier_identityId"`);
|
|
7
|
+
await queryRunner.query(`ALTER TABLE "IdentityMetadata" DROP CONSTRAINT "FK_IdentityMetadata_identityId"`);
|
|
8
|
+
await queryRunner.query(`ALTER TABLE "Identity" DROP CONSTRAINT "FK_Identity_contactId"`);
|
|
9
|
+
await queryRunner.query(`ALTER TABLE "Connection" DROP CONSTRAINT "FK_Connection_identityId"`);
|
|
10
|
+
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" RENAME COLUMN "identityId" TO "identity_id"`);
|
|
11
|
+
await queryRunner.query(`ALTER TABLE "Connection" RENAME COLUMN "identityId" TO "identity_id"`);
|
|
12
|
+
await queryRunner.query(`CREATE TYPE "public"."PartyType_type_enum" AS ENUM('naturalPerson', 'organization')`);
|
|
13
|
+
await queryRunner.query(`CREATE TYPE "public"."PartyOrigin_type_enum" AS ENUM('INTERNAL', 'EXTERNAL')`);
|
|
14
|
+
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"))`);
|
|
15
|
+
await queryRunner.query(`CREATE UNIQUE INDEX "IDX_PartyType_type_tenant_id" ON "PartyType" ("type", "tenant_id")`);
|
|
16
|
+
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"))`);
|
|
17
|
+
await queryRunner.query(`CREATE INDEX "IDX_BaseContact_type" ON "BaseContact" ("type")`);
|
|
18
|
+
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"))`);
|
|
19
|
+
await queryRunner.query(`CREATE UNIQUE INDEX "IDX_PartyRelationship_left_right" ON "PartyRelationship" ("left_id", "right_id")`);
|
|
20
|
+
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"))`);
|
|
21
|
+
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"))`);
|
|
22
|
+
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"))`);
|
|
23
|
+
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"))`);
|
|
24
|
+
await queryRunner.query(`CREATE INDEX "IDX_BaseConfig_type" ON "BaseConfig" ("type")`);
|
|
25
|
+
await queryRunner.query(`ALTER TABLE "Identity" RENAME COLUMN "contactId" TO "partyId"`);
|
|
26
|
+
await queryRunner.query(`ALTER TABLE "Identity" ALTER COLUMN "roles" SET NOT NULL`);
|
|
27
|
+
await queryRunner.query(`CREATE TYPE "public"."IdentityOrigin_type_enum" AS ENUM('INTERNAL', 'EXTERNAL')`);
|
|
28
|
+
await queryRunner.query(`ALTER TABLE "Identity" ADD COLUMN "origin" "public"."IdentityOrigin_type_enum" DEFAULT 'EXTERNAL' NOT NULL`);
|
|
29
|
+
await queryRunner.query(`ALTER TABLE "Identity" ALTER COLUMN "origin" DROP DEFAULT`);
|
|
30
|
+
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`);
|
|
31
|
+
await queryRunner.query(`ALTER TABLE "IdentityMetadata" ADD CONSTRAINT "FK_IdentityMetadata_identityId" FOREIGN KEY ("identityId") REFERENCES "Identity"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
32
|
+
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`);
|
|
33
|
+
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`);
|
|
34
|
+
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`);
|
|
35
|
+
await queryRunner.query(`ALTER TABLE "ElectronicAddress" ADD CONSTRAINT "FK_ElectronicAddress_partyId" FOREIGN KEY ("partyId") REFERENCES "Party"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
36
|
+
await queryRunner.query(`ALTER TABLE "PhysicalAddress" ADD CONSTRAINT "FK_PhysicalAddress_partyId" FOREIGN KEY ("partyId") REFERENCES "Party" ("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
37
|
+
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`);
|
|
38
|
+
await queryRunner.query(`ALTER TABLE "Identity" ADD CONSTRAINT "FK_Identity_partyId" FOREIGN KEY ("partyId") REFERENCES "Party"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
39
|
+
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`);
|
|
40
|
+
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`);
|
|
41
|
+
// migrate existing data
|
|
42
|
+
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" RENAME CONSTRAINT "UQ_Correlation_id" TO "UQ_CorrelationIdentifier_correlation_id"`);
|
|
43
|
+
await queryRunner.query(`ALTER TABLE "Identity" RENAME CONSTRAINT "UQ_Identity_Alias" TO "UQ_Identity_alias"`);
|
|
44
|
+
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"`);
|
|
45
|
+
await queryRunner.query(`DROP TABLE "BaseConfigEntity"`);
|
|
46
|
+
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())`);
|
|
47
|
+
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())`);
|
|
48
|
+
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"`);
|
|
49
|
+
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"`);
|
|
50
|
+
await queryRunner.query(`DROP TABLE "Contact"`);
|
|
17
51
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
yield 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`);
|
|
56
|
-
// migrate existing data
|
|
57
|
-
yield queryRunner.query(`ALTER TABLE "CorrelationIdentifier" RENAME CONSTRAINT "UQ_Correlation_id" TO "UQ_CorrelationIdentifier_correlation_id"`);
|
|
58
|
-
yield queryRunner.query(`ALTER TABLE "Identity" RENAME CONSTRAINT "UQ_Identity_Alias" TO "UQ_Identity_alias"`);
|
|
59
|
-
yield 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"`);
|
|
60
|
-
yield queryRunner.query(`DROP TABLE "BaseConfigEntity"`);
|
|
61
|
-
yield 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())`);
|
|
62
|
-
yield 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())`);
|
|
63
|
-
yield 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"`);
|
|
64
|
-
yield 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"`);
|
|
65
|
-
yield queryRunner.query(`DROP TABLE "Contact"`);
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
down(queryRunner) {
|
|
69
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
-
yield queryRunner.query(`ALTER TABLE "BaseConfig" DROP CONSTRAINT "FK_BaseConfig_connection_id"`);
|
|
71
|
-
yield queryRunner.query(`ALTER TABLE "Connection" DROP CONSTRAINT "FK_Connection_identity_id"`);
|
|
72
|
-
yield queryRunner.query(`ALTER TABLE "Identity" DROP CONSTRAINT "FK_Identity_partyId"`);
|
|
73
|
-
yield queryRunner.query(`ALTER TABLE "Party" DROP CONSTRAINT "FK_Party_party_type_id"`);
|
|
74
|
-
yield queryRunner.query(`ALTER TABLE "PhysicalAddress" DROP CONSTRAINT "FK_PhysicalAddress_partyId"`);
|
|
75
|
-
yield queryRunner.query(`ALTER TABLE "ElectronicAddress" DROP CONSTRAINT "FK_ElectronicAddress_partyId"`);
|
|
76
|
-
yield queryRunner.query(`ALTER TABLE "PartyRelationship" DROP CONSTRAINT "FK_PartyRelationship_right_id"`);
|
|
77
|
-
yield queryRunner.query(`ALTER TABLE "PartyRelationship" DROP CONSTRAINT "FK_PartyRelationship_left_id"`);
|
|
78
|
-
yield queryRunner.query(`ALTER TABLE "BaseContact" DROP CONSTRAINT "FK_BaseContact_party_id"`);
|
|
79
|
-
yield queryRunner.query(`ALTER TABLE "IdentityMetadata" DROP CONSTRAINT "FK_IdentityMetadata_identityId"`);
|
|
80
|
-
yield queryRunner.query(`ALTER TABLE "CorrelationIdentifier" DROP CONSTRAINT "FK_CorrelationIdentifier_identity_id"`);
|
|
81
|
-
yield queryRunner.query(`ALTER TABLE "Identity" ALTER COLUMN "roles" DROP NOT NULL`);
|
|
82
|
-
yield queryRunner.query(`ALTER TABLE "Identity" DROP COLUMN "origin"`);
|
|
83
|
-
yield queryRunner.query(`DROP TYPE "public"."IdentityOrigin_type_enum"`);
|
|
84
|
-
yield queryRunner.query(`ALTER TABLE "Identity" RENAME COLUMN "partyId" TO "contactId"`);
|
|
85
|
-
yield queryRunner.query(`ALTER TABLE "Connection" RENAME COLUMN "identity_id" TO "identityId"`);
|
|
86
|
-
yield queryRunner.query(`ALTER TABLE "CorrelationIdentifier" RENAME COLUMN "identity_id" TO "identityId"`);
|
|
87
|
-
yield queryRunner.query(`DROP INDEX "IDX_BaseConfig_type"`);
|
|
88
|
-
yield queryRunner.query(`DROP TABLE "BaseConfig"`);
|
|
89
|
-
yield queryRunner.query(`DROP TABLE "Party"`);
|
|
90
|
-
yield queryRunner.query(`DROP INDEX "IDX_PartyRelationship_left_right"`);
|
|
91
|
-
yield queryRunner.query(`DROP TABLE "PartyRelationship"`);
|
|
92
|
-
yield queryRunner.query(`DROP INDEX "IDX_BaseContact_type"`);
|
|
93
|
-
yield queryRunner.query(`DROP TABLE "BaseContact"`);
|
|
94
|
-
yield queryRunner.query(`DROP TABLE "ElectronicAddress"`);
|
|
95
|
-
yield queryRunner.query(`DROP TABLE "PhysicalAddress"`);
|
|
96
|
-
yield queryRunner.query(`DROP INDEX "IDX_PartyType_type_tenant_id"`);
|
|
97
|
-
yield queryRunner.query(`DROP TABLE "PartyType"`);
|
|
98
|
-
yield queryRunner.query(`DROP TYPE "public"."PartyOrigin_type_enum"`);
|
|
99
|
-
yield queryRunner.query(`DROP TYPE "public"."PartyType_type_enum"`);
|
|
100
|
-
yield queryRunner.query(`ALTER TABLE "Connection" ADD CONSTRAINT "FK_Connection_identityId" FOREIGN KEY ("identityId") REFERENCES "Identity"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
101
|
-
yield queryRunner.query(`ALTER TABLE "Identity" ADD CONSTRAINT "FK_Identity_contactId" FOREIGN KEY ("contactId") REFERENCES "Contact"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
102
|
-
yield queryRunner.query(`ALTER TABLE "IdentityMetadata" ADD CONSTRAINT "FK_IdentityMetadata_identityId" FOREIGN KEY ("identityId") REFERENCES "Identity"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
103
|
-
yield queryRunner.query(`ALTER TABLE "CorrelationIdentifier" ADD CONSTRAINT "FK_CorrelationIdentifier_identityId" FOREIGN KEY ("identityId") REFERENCES "Identity"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
104
|
-
yield 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"))`);
|
|
105
|
-
yield 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'`);
|
|
106
|
-
});
|
|
52
|
+
async down(queryRunner) {
|
|
53
|
+
await queryRunner.query(`ALTER TABLE "BaseConfig" DROP CONSTRAINT "FK_BaseConfig_connection_id"`);
|
|
54
|
+
await queryRunner.query(`ALTER TABLE "Connection" DROP CONSTRAINT "FK_Connection_identity_id"`);
|
|
55
|
+
await queryRunner.query(`ALTER TABLE "Identity" DROP CONSTRAINT "FK_Identity_partyId"`);
|
|
56
|
+
await queryRunner.query(`ALTER TABLE "Party" DROP CONSTRAINT "FK_Party_party_type_id"`);
|
|
57
|
+
await queryRunner.query(`ALTER TABLE "PhysicalAddress" DROP CONSTRAINT "FK_PhysicalAddress_partyId"`);
|
|
58
|
+
await queryRunner.query(`ALTER TABLE "ElectronicAddress" DROP CONSTRAINT "FK_ElectronicAddress_partyId"`);
|
|
59
|
+
await queryRunner.query(`ALTER TABLE "PartyRelationship" DROP CONSTRAINT "FK_PartyRelationship_right_id"`);
|
|
60
|
+
await queryRunner.query(`ALTER TABLE "PartyRelationship" DROP CONSTRAINT "FK_PartyRelationship_left_id"`);
|
|
61
|
+
await queryRunner.query(`ALTER TABLE "BaseContact" DROP CONSTRAINT "FK_BaseContact_party_id"`);
|
|
62
|
+
await queryRunner.query(`ALTER TABLE "IdentityMetadata" DROP CONSTRAINT "FK_IdentityMetadata_identityId"`);
|
|
63
|
+
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" DROP CONSTRAINT "FK_CorrelationIdentifier_identity_id"`);
|
|
64
|
+
await queryRunner.query(`ALTER TABLE "Identity" ALTER COLUMN "roles" DROP NOT NULL`);
|
|
65
|
+
await queryRunner.query(`ALTER TABLE "Identity" DROP COLUMN "origin"`);
|
|
66
|
+
await queryRunner.query(`DROP TYPE "public"."IdentityOrigin_type_enum"`);
|
|
67
|
+
await queryRunner.query(`ALTER TABLE "Identity" RENAME COLUMN "partyId" TO "contactId"`);
|
|
68
|
+
await queryRunner.query(`ALTER TABLE "Connection" RENAME COLUMN "identity_id" TO "identityId"`);
|
|
69
|
+
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" RENAME COLUMN "identity_id" TO "identityId"`);
|
|
70
|
+
await queryRunner.query(`DROP INDEX "IDX_BaseConfig_type"`);
|
|
71
|
+
await queryRunner.query(`DROP TABLE "BaseConfig"`);
|
|
72
|
+
await queryRunner.query(`DROP TABLE "Party"`);
|
|
73
|
+
await queryRunner.query(`DROP INDEX "IDX_PartyRelationship_left_right"`);
|
|
74
|
+
await queryRunner.query(`DROP TABLE "PartyRelationship"`);
|
|
75
|
+
await queryRunner.query(`DROP INDEX "IDX_BaseContact_type"`);
|
|
76
|
+
await queryRunner.query(`DROP TABLE "BaseContact"`);
|
|
77
|
+
await queryRunner.query(`DROP TABLE "ElectronicAddress"`);
|
|
78
|
+
await queryRunner.query(`DROP TABLE "PhysicalAddress"`);
|
|
79
|
+
await queryRunner.query(`DROP INDEX "IDX_PartyType_type_tenant_id"`);
|
|
80
|
+
await queryRunner.query(`DROP TABLE "PartyType"`);
|
|
81
|
+
await queryRunner.query(`DROP TYPE "public"."PartyOrigin_type_enum"`);
|
|
82
|
+
await queryRunner.query(`DROP TYPE "public"."PartyType_type_enum"`);
|
|
83
|
+
await queryRunner.query(`ALTER TABLE "Connection" ADD CONSTRAINT "FK_Connection_identityId" FOREIGN KEY ("identityId") REFERENCES "Identity"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
84
|
+
await queryRunner.query(`ALTER TABLE "Identity" ADD CONSTRAINT "FK_Identity_contactId" FOREIGN KEY ("contactId") REFERENCES "Contact"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
85
|
+
await queryRunner.query(`ALTER TABLE "IdentityMetadata" ADD CONSTRAINT "FK_IdentityMetadata_identityId" FOREIGN KEY ("identityId") REFERENCES "Identity"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
86
|
+
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" ADD CONSTRAINT "FK_CorrelationIdentifier_identityId" FOREIGN KEY ("identityId") REFERENCES "Identity"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
|
|
87
|
+
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"))`);
|
|
88
|
+
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'`);
|
|
107
89
|
}
|
|
108
90
|
}
|
|
109
|
-
exports.CreateContacts1690925872592 = CreateContacts1690925872592;
|
|
110
91
|
//# sourceMappingURL=1690925872592-CreateContacts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"1690925872592-CreateContacts.js","sourceRoot":"","sources":["../../../src/migrations/postgres/1690925872592-CreateContacts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"1690925872592-CreateContacts.js","sourceRoot":"","sources":["../../../src/migrations/postgres/1690925872592-CreateContacts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAA;AAEpE,MAAM,OAAO,2BAA2B;IACtC,IAAI,GAAG,6BAA6B,CAAA;IAE7B,KAAK,CAAC,EAAE,CAAC,WAAwB;QACtC,MAAM,2BAA2B,CAAC,WAAW,CAAC,CAAA;QAC9C,MAAM,WAAW,CAAC,KAAK,CAAC,2FAA2F,CAAC,CAAA;QACpH,MAAM,WAAW,CAAC,KAAK,CAAC,iFAAiF,CAAC,CAAA;QAC1G,MAAM,WAAW,CAAC,KAAK,CAAC,gEAAgE,CAAC,CAAA;QACzF,MAAM,WAAW,CAAC,KAAK,CAAC,qEAAqE,CAAC,CAAA;QAC9F,MAAM,WAAW,CAAC,KAAK,CAAC,iFAAiF,CAAC,CAAA;QAC1G,MAAM,WAAW,CAAC,KAAK,CAAC,sEAAsE,CAAC,CAAA;QAC/F,MAAM,WAAW,CAAC,KAAK,CAAC,qFAAqF,CAAC,CAAA;QAC9G,MAAM,WAAW,CAAC,KAAK,CAAC,8EAA8E,CAAC,CAAA;QACvG,MAAM,WAAW,CAAC,KAAK,CACrB,6eAA6e,CAC9e,CAAA;QACD,MAAM,WAAW,CAAC,KAAK,CAAC,yFAAyF,CAAC,CAAA;QAClH,MAAM,WAAW,CAAC,KAAK,CACrB,0kBAA0kB,CAC3kB,CAAA;QACD,MAAM,WAAW,CAAC,KAAK,CAAC,+DAA+D,CAAC,CAAA;QACxF,MAAM,WAAW,CAA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AK,CACrB,6KAA6K,CAC9K,CAAA;QACD,MAAM,WAAW,CAAC,KAAK,CACrB,uLAAuL,CACxL,CAAA;QAED,MAAM,WAAW,CAAC,KAAK,CACrB,uTAAuT,CACxT,CAAA;QACD,MAAM,WAAW,CAAC,KAAK,CACrB,8WAA8W,CAC/W,CAAA;IACH,CAAC;CACF"}
|
|
@@ -1,25 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.CreateStatusList1693866470001 = void 0;
|
|
13
|
-
class CreateStatusList1693866470001 {
|
|
14
|
-
constructor() {
|
|
15
|
-
this.name = 'CreateStatusList1693866470001';
|
|
16
|
-
}
|
|
17
|
-
up(queryRunner) {
|
|
18
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
-
yield queryRunner.query(`CREATE TYPE "StatusList_type_enum" AS ENUM('StatusList2021')`);
|
|
20
|
-
yield queryRunner.query(`CREATE TYPE "StatusList_drivertype_enum" AS ENUM('agent_typeorm', 'agent_kv_store', 'github', 'agent_filesystem')`);
|
|
21
|
-
yield queryRunner.query(`CREATE TYPE "StatusList_credentialidmode_enum" AS ENUM('ISSUANCE', 'PERSISTENCE', 'NEVER')`);
|
|
22
|
-
yield queryRunner.query(`CREATE TABLE "StatusListEntry"
|
|
1
|
+
export class CreateStatusList1693866470001 {
|
|
2
|
+
name = 'CreateStatusList1693866470001';
|
|
3
|
+
async up(queryRunner) {
|
|
4
|
+
await queryRunner.query(`CREATE TYPE "StatusList_type_enum" AS ENUM('StatusList2021')`);
|
|
5
|
+
await queryRunner.query(`CREATE TYPE "StatusList_drivertype_enum" AS ENUM('agent_typeorm', 'agent_kv_store', 'github', 'agent_filesystem')`);
|
|
6
|
+
await queryRunner.query(`CREATE TYPE "StatusList_credentialidmode_enum" AS ENUM('ISSUANCE', 'PERSISTENCE', 'NEVER')`);
|
|
7
|
+
await queryRunner.query(`CREATE TABLE "StatusListEntry"
|
|
23
8
|
(
|
|
24
9
|
"statusListId" character varying NOT NULL,
|
|
25
10
|
"statusListIndex" integer NOT NULL,
|
|
@@ -29,7 +14,7 @@ class CreateStatusList1693866470001 {
|
|
|
29
14
|
"value" character varying(50),
|
|
30
15
|
CONSTRAINT "PK_68704d2d13857360c6b44a3d1d0" PRIMARY KEY ("statusListId", "statusListIndex")
|
|
31
16
|
)`);
|
|
32
|
-
|
|
17
|
+
await queryRunner.query(`CREATE TABLE "StatusList"
|
|
33
18
|
(
|
|
34
19
|
"id" character varying NOT NULL,
|
|
35
20
|
"correlationId" character varying NOT NULL,
|
|
@@ -45,21 +30,17 @@ class CreateStatusList1693866470001 {
|
|
|
45
30
|
CONSTRAINT "UQ_correlationId" UNIQUE ("correlationId"),
|
|
46
31
|
CONSTRAINT "PK_StatusList_Id" PRIMARY KEY ("id")
|
|
47
32
|
)`);
|
|
48
|
-
|
|
33
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry"
|
|
49
34
|
ADD CONSTRAINT "FK_statusListEntry_statusListId" FOREIGN KEY ("statusListId") REFERENCES "StatusList" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
50
|
-
});
|
|
51
35
|
}
|
|
52
|
-
down(queryRunner) {
|
|
53
|
-
|
|
54
|
-
yield queryRunner.query(`ALTER TABLE "StatusListEntry"
|
|
36
|
+
async down(queryRunner) {
|
|
37
|
+
await queryRunner.query(`ALTER TABLE "StatusListEntry"
|
|
55
38
|
DROP CONSTRAINT "FK_statusListEntry_statusListId"`);
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
});
|
|
39
|
+
await queryRunner.query(`DROP TABLE "StatusListEntry"`);
|
|
40
|
+
await queryRunner.query(`DROP TABLE "StatusList"`);
|
|
41
|
+
await queryRunner.query(`DROP TYPE "StatusList_credentialidmode_enum"`);
|
|
42
|
+
await queryRunner.query(`DROP TYPE "StatusList_drivertype_enum"`);
|
|
43
|
+
await queryRunner.query(`DROP TYPE "StatusList_type_enum"`);
|
|
62
44
|
}
|
|
63
45
|
}
|
|
64
|
-
exports.CreateStatusList1693866470001 = CreateStatusList1693866470001;
|
|
65
46
|
//# sourceMappingURL=1693866470001-CreateStatusList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"1693866470001-CreateStatusList.js","sourceRoot":"","sources":["../../../src/migrations/postgres/1693866470001-CreateStatusList.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"1693866470001-CreateStatusList.js","sourceRoot":"","sources":["../../../src/migrations/postgres/1693866470001-CreateStatusList.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,6BAA6B;IACxC,IAAI,GAAG,+BAA+B,CAAA;IAE/B,KAAK,CAAC,EAAE,CAAC,WAAwB;QACtC,MAAM,WAAW,CAAC,KAAK,CAAC,8DAA8D,CAAC,CAAA;QACvF,MAAM,WAAW,CAAC,KAAK,CAAC,mHAAmH,CAAC,CAAA;QAC5I,MAAM,WAAW,CAAC,KAAK,CAAC,4FAA4F,CAAC,CAAA;QAErH,MAAM,WAAW,CAAC,KAAK,CACrB;;;;;;;;;eASS,CACV,CAAA;QACD,MAAM,WAAW,CAAC,KAAK,CACrB;;;;;;;;;;;;;;;eAeS,CACV,CAAA;QACD,MAAM,WAAW,CAAC,KAAK,CACrB;qKAC+J,CAChK,CAAA;IACH,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,WAAwB;QACxC,MAAM,WAAW,CAAC,KAAK,CAAC;8DACkC,CAAC,CAAA;QAC3D,MAAM,WAAW,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAA;QACvD,MAAM,WAAW,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAA;QAClD,MAAM,WAAW,CAAC,KAAK,CAAC,8CAA8C,CAAC,CAAA;QACvE,MAAM,WAAW,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAAA;QACjE,MAAM,WAAW,CAAC,KAAK,CAAC,kCAAkC,CAAC,CAAA;IAC7D,CAAC;CACF"}
|