@sphereon/ssi-sdk.data-store 0.30.1-unstable.4 → 0.30.1
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/LICENSE +201 -201
- package/README.md +77 -77
- package/dist/contact/ContactStore.d.ts.map +1 -1
- package/dist/digitalCredential/DigitalCredentialStore.d.ts.map +1 -1
- package/dist/eventLogger/EventLoggerStore.d.ts.map +1 -1
- package/dist/issuanceBranding/IssuanceBrandingStore.d.ts.map +1 -1
- package/dist/migrations/internal-migrations-ormconfig.d.ts.map +1 -1
- package/dist/migrations/postgres/1708525189001-CreateDigitalCredential.js +33 -33
- package/dist/migrations/postgres/1708797018115-CreateMachineStateStore.js +16 -16
- package/dist/migrations/postgres/1715761125001-CreateContacts.js +33 -33
- package/dist/migrations/postgres/1716475165345-CreatePresentationDefinitions.js +12 -12
- package/dist/migrations/sqlite/1708525189002-CreateDigitalCredential.js +32 -32
- package/dist/migrations/sqlite/1708796002272-CreateMachineStateStore.js +15 -15
- package/dist/migrations/sqlite/1710438363002-CreateContacts.js +13 -13
- package/dist/migrations/sqlite/1715761125002-CreateContacts.js +32 -32
- package/dist/migrations/sqlite/1716475165344-CreatePresentationDefinitions.js +9 -9
- package/dist/presentationDefinition/PDStore.d.ts.map +1 -1
- package/dist/utils/SortingUtils.d.ts.map +1 -1
- package/dist/utils/contact/MappingUtils.d.ts.map +1 -1
- package/dist/utils/digitalCredential/MappingUtils.d.ts.map +1 -1
- package/dist/utils/digitalCredential/MappingUtils.js +4 -4
- package/dist/utils/digitalCredential/MappingUtils.js.map +1 -1
- package/dist/utils/presentationDefinition/MappingUtils.js +2 -2
- package/dist/utils/presentationDefinition/MappingUtils.js.map +1 -1
- package/package.json +8 -8
- package/src/__tests__/contact.entities.test.ts +2642 -2642
- package/src/__tests__/contact.store.test.ts +2649 -2649
- package/src/__tests__/digitalCredential.entities.test.ts +274 -274
- package/src/__tests__/digitalCredential.store.test.ts +330 -330
- package/src/__tests__/eventLogger.entities.test.ts +76 -76
- package/src/__tests__/eventLogger.store.test.ts +130 -130
- package/src/__tests__/issuanceBranding.entities.test.ts +846 -846
- package/src/__tests__/issuanceBranding.store.test.ts +1886 -1886
- package/src/__tests__/machineState.entities.test.ts +53 -53
- package/src/__tests__/machineState.store.test.ts +176 -176
- package/src/__tests__/pd-manager.entities.test.ts +73 -73
- package/src/__tests__/pd-manager.store.test.ts +193 -193
- package/src/contact/AbstractContactStore.ts +71 -71
- package/src/contact/ContactStore.ts +768 -768
- package/src/digitalCredential/AbstractDigitalCredentialStore.ts +21 -21
- package/src/digitalCredential/DigitalCredentialStore.ts +189 -189
- package/src/entities/contact/BaseContactEntity.ts +51 -51
- package/src/entities/contact/ConnectionEntity.ts +35 -35
- package/src/entities/contact/ContactMetadataItemEntity.ts +51 -51
- package/src/entities/contact/CorrelationIdentifierEntity.ts +43 -43
- package/src/entities/contact/DidAuthConfigEntity.ts +20 -20
- package/src/entities/contact/ElectronicAddressEntity.ts +70 -70
- package/src/entities/contact/IdentityEntity.ts +107 -107
- package/src/entities/contact/IdentityMetadataItemEntity.ts +48 -48
- package/src/entities/contact/NaturalPersonEntity.ts +44 -44
- package/src/entities/contact/OpenIdConfigEntity.ts +32 -32
- package/src/entities/contact/OrganizationEntity.ts +35 -35
- package/src/entities/contact/PartyEntity.ts +117 -117
- package/src/entities/contact/PartyRelationshipEntity.ts +68 -68
- package/src/entities/contact/PartyTypeEntity.ts +63 -63
- package/src/entities/contact/PhysicalAddressEntity.ts +95 -95
- package/src/entities/digitalCredential/DigitalCredentialEntity.ts +98 -98
- package/src/entities/eventLogger/AuditEventEntity.ts +92 -92
- package/src/entities/issuanceBranding/BackgroundAttributesEntity.ts +42 -42
- package/src/entities/issuanceBranding/BaseLocaleBrandingEntity.ts +87 -87
- package/src/entities/issuanceBranding/CredentialBrandingEntity.ts +79 -79
- package/src/entities/issuanceBranding/CredentialLocaleBrandingEntity.ts +33 -33
- package/src/entities/issuanceBranding/ImageAttributesEntity.ts +57 -57
- package/src/entities/issuanceBranding/ImageDimensionsEntity.ts +22 -22
- package/src/entities/issuanceBranding/IssuerBrandingEntity.ts +73 -73
- package/src/entities/issuanceBranding/IssuerLocaleBrandingEntity.ts +33 -33
- package/src/entities/issuanceBranding/TextAttributesEntity.ts +31 -31
- package/src/entities/machineState/MachineStateInfoEntity.ts +59 -59
- package/src/entities/presentationDefinition/PresentationDefinitionItemEntity.ts +44 -44
- package/src/entities/statusList2021/StatusList2021Entity.ts +96 -96
- package/src/entities/statusList2021/StatusList2021EntryEntity.ts +29 -29
- package/src/eventLogger/AbstractEventLoggerStore.ts +7 -7
- package/src/eventLogger/EventLoggerStore.ts +62 -62
- package/src/index.ts +160 -160
- package/src/issuanceBranding/IssuanceBrandingStore.ts +559 -559
- package/src/machineState/IAbstractMachineStateStore.ts +65 -65
- package/src/machineState/MachineStateStore.ts +149 -149
- package/src/migrations/generic/1-CreateContacts.ts +66 -66
- package/src/migrations/generic/10-CreatePresentationDefinitions.ts +66 -66
- package/src/migrations/generic/2-CreateIssuanceBranding.ts +64 -64
- package/src/migrations/generic/3-CreateContacts.ts +66 -66
- package/src/migrations/generic/4-CreateStatusList.ts +54 -54
- package/src/migrations/generic/5-CreateAuditEvents.ts +66 -66
- package/src/migrations/generic/6-CreateDigitalCredential.ts +66 -66
- package/src/migrations/generic/7-CreateMachineStateStore.ts +66 -66
- package/src/migrations/generic/8-CreateContacts.ts +66 -66
- package/src/migrations/generic/9-CreateContacts.ts +66 -66
- package/src/migrations/generic/index.ts +43 -43
- package/src/migrations/index.ts +10 -10
- package/src/migrations/postgres/1659463079428-CreateContacts.ts +63 -63
- package/src/migrations/postgres/1685628974232-CreateIssuanceBranding.ts +85 -85
- package/src/migrations/postgres/1690925872592-CreateContacts.ts +158 -158
- package/src/migrations/postgres/1693866470001-CreateStatusList.ts +24 -24
- package/src/migrations/postgres/1701634812183-CreateAuditEvents.ts +33 -33
- package/src/migrations/postgres/1708525189001-CreateDigitalCredential.ts +61 -61
- package/src/migrations/postgres/1708797018115-CreateMachineStateStore.ts +29 -29
- package/src/migrations/postgres/1710438363001-CreateContacts.ts +63 -63
- package/src/migrations/postgres/1715761125001-CreateContacts.ts +60 -60
- package/src/migrations/postgres/1716475165345-CreatePresentationDefinitions.ts +25 -25
- package/src/migrations/sqlite/1659463069549-CreateContacts.ts +110 -110
- package/src/migrations/sqlite/1685628973231-CreateIssuanceBranding.ts +119 -119
- package/src/migrations/sqlite/1690925872693-CreateContacts.ts +228 -228
- package/src/migrations/sqlite/1693866470000-CreateStatusList.ts +24 -24
- package/src/migrations/sqlite/1701634819487-CreateAuditEvents.ts +15 -15
- package/src/migrations/sqlite/1708525189002-CreateDigitalCredential.ts +46 -46
- package/src/migrations/sqlite/1708796002272-CreateMachineStateStore.ts +28 -28
- package/src/migrations/sqlite/1710438363002-CreateContacts.ts +83 -83
- package/src/migrations/sqlite/1715761125002-CreateContacts.ts +59 -59
- package/src/migrations/sqlite/1716475165344-CreatePresentationDefinitions.ts +24 -24
- package/src/presentationDefinition/AbstractPDStore.ts +20 -20
- package/src/presentationDefinition/PDStore.ts +185 -185
- package/src/statusList/IStatusListStore.ts +44 -44
- package/src/statusList/StatusListStore.ts +236 -236
- package/src/types/contact/IAbstractContactStore.ts +161 -161
- package/src/types/contact/contact.ts +295 -295
- package/src/types/digitalCredential/IAbstractDigitalCredentialStore.ts +42 -42
- package/src/types/digitalCredential/digitalCredential.ts +102 -102
- package/src/types/eventLogger/IAbstractEventLoggerStore.ts +12 -12
- package/src/types/eventLogger/eventLogger.ts +3 -3
- package/src/types/index.ts +14 -14
- package/src/types/machineState/IAbstractMachineStateStore.ts +68 -68
- package/src/types/presentationDefinition/IAbstractPDStore.ts +25 -25
- package/src/types/presentationDefinition/presentationDefinition.ts +17 -17
- package/src/utils/SortingUtils.ts +16 -16
- package/src/utils/contact/MappingUtils.ts +506 -506
- package/src/utils/digitalCredential/MappingUtils.ts +160 -160
- package/src/utils/hasher.ts +19 -19
- package/src/utils/presentationDefinition/MappingUtils.ts +52 -52
- package/dist/entities/contact/IMetadataEntity.d.ts +0 -8
- package/dist/entities/contact/IMetadataEntity.d.ts.map +0 -1
- package/dist/entities/contact/IMetadataEntity.js +0 -2
- package/dist/entities/contact/IMetadataEntity.js.map +0 -1
- package/dist/migrations/generic/8-CreatePresentationDefinitions.d.ts +0 -7
- package/dist/migrations/generic/8-CreatePresentationDefinitions.d.ts.map +0 -1
- package/dist/migrations/generic/8-CreatePresentationDefinitions.js +0 -78
- package/dist/migrations/generic/8-CreatePresentationDefinitions.js.map +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
-
|
|
3
|
-
export class CreateAuditEvents1701634819487 implements MigrationInterface {
|
|
4
|
-
name = 'CreateAuditEvents1701634819487'
|
|
5
|
-
|
|
6
|
-
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
-
await queryRunner.query(
|
|
8
|
-
`CREATE TABLE "AuditEvents" ("id" varchar PRIMARY KEY NOT NULL, "timestamp" datetime NOT NULL, "level" varchar CHECK( "level" IN ('0','1','2','3') ) NOT NULL, "correlationId" varchar NOT NULL, "system" varchar CHECK( "system" IN ('general','kms','identity','oid4vci','credentials','web3','profile','contact') ) NOT NULL, "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') ) NOT NULL, "actionType" varchar CHECK( "actionType" IN ('create','read','update','delete','execute') ) NOT NULL, "actionSubType" varchar NOT NULL, "initiatorType" varchar CHECK( "initiatorType" IN ('user','system','external') ) NOT NULL, "systemCorrelationIdType" varchar CHECK( "systemCorrelationIdType" IN ('did','email','hostname','phone','user') ), "systemCorrelationId" varchar, "systemAlias" varchar, "partyCorrelationType" varchar CHECK( "partyCorrelationType" IN ('did','email','hostname','phone') ), "partyCorrelationId" varchar, "partyAlias" varchar, "description" varchar NOT NULL, "data" varchar, "diagnosticData" varchar, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')))`,
|
|
9
|
-
)
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
13
|
-
await queryRunner.query(`DROP TABLE "AuditEvents"`)
|
|
14
|
-
}
|
|
15
|
-
}
|
|
1
|
+
import { MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
+
|
|
3
|
+
export class CreateAuditEvents1701634819487 implements MigrationInterface {
|
|
4
|
+
name = 'CreateAuditEvents1701634819487'
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(
|
|
8
|
+
`CREATE TABLE "AuditEvents" ("id" varchar PRIMARY KEY NOT NULL, "timestamp" datetime NOT NULL, "level" varchar CHECK( "level" IN ('0','1','2','3') ) NOT NULL, "correlationId" varchar NOT NULL, "system" varchar CHECK( "system" IN ('general','kms','identity','oid4vci','credentials','web3','profile','contact') ) NOT NULL, "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') ) NOT NULL, "actionType" varchar CHECK( "actionType" IN ('create','read','update','delete','execute') ) NOT NULL, "actionSubType" varchar NOT NULL, "initiatorType" varchar CHECK( "initiatorType" IN ('user','system','external') ) NOT NULL, "systemCorrelationIdType" varchar CHECK( "systemCorrelationIdType" IN ('did','email','hostname','phone','user') ), "systemCorrelationId" varchar, "systemAlias" varchar, "partyCorrelationType" varchar CHECK( "partyCorrelationType" IN ('did','email','hostname','phone') ), "partyCorrelationId" varchar, "partyAlias" varchar, "description" varchar NOT NULL, "data" varchar, "diagnosticData" varchar, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')))`,
|
|
9
|
+
)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
13
|
+
await queryRunner.query(`DROP TABLE "AuditEvents"`)
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
-
|
|
3
|
-
export class CreateDigitalCredential1708525189002 implements MigrationInterface {
|
|
4
|
-
name = 'CreateDigitalCredential1708525189002'
|
|
5
|
-
|
|
6
|
-
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
-
// TODO FK for parent
|
|
8
|
-
await queryRunner.query(`
|
|
9
|
-
CREATE TABLE "DigitalCredential" (
|
|
10
|
-
"id" varchar PRIMARY KEY NOT NULL,
|
|
11
|
-
"parent_id" text,
|
|
12
|
-
"document_type" varchar CHECK( "document_type" IN ('VC', 'VP', 'C', 'P') ) NOT NULL,
|
|
13
|
-
"regulation_type" varchar CHECK( "regulation_type" IN ('PID', 'QEAA', 'EAA', 'NON_REGULATED') ) NOT NULL DEFAULT 'NON_REGULATED',
|
|
14
|
-
"document_format" varchar CHECK( "document_format" IN ('JSON_LD', 'JWT', 'SD_JWT', 'MSO_MDOC') ) NOT NULL,
|
|
15
|
-
"credential_role" varchar CHECK( "credential_role" IN ('ISSUER', 'VERIFIER', 'HOLDER') ) NOT NULL,
|
|
16
|
-
"raw_document" text NOT NULL,
|
|
17
|
-
"uniform_document" text NOT NULL,
|
|
18
|
-
"credential_id" text,
|
|
19
|
-
"hash" text NOT NULL,
|
|
20
|
-
"kms_key_ref" text,
|
|
21
|
-
"identifier_method" text,
|
|
22
|
-
"issuer_correlation_type" varchar CHECK( "issuer_correlation_type" IN ('DID', 'KID', 'URL', 'X509_SAN') ) NOT NULL,
|
|
23
|
-
"subject_correlation_type" varchar CHECK( "subject_correlation_type" IN ('DID', 'KID', 'URL', 'X509_SAN') ),
|
|
24
|
-
"issuer_correlation_id" text NOT NULL,
|
|
25
|
-
"subject_correlation_id" text,
|
|
26
|
-
"issuer_signed" boolean,
|
|
27
|
-
"rp_correlation_id" text,
|
|
28
|
-
"rp_correlation_type" varchar CHECK( "issuer_correlation_type" IN ('DID', 'KID', 'URL', 'X509_SAN') ),
|
|
29
|
-
"verified_state" varchar CHECK( "verified_state" IN ('REVOKED', 'VERIFIED', 'EXPIRED') ),
|
|
30
|
-
"tenant_id" text,
|
|
31
|
-
"created_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
32
|
-
"last_updated_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
33
|
-
"presented_at" datetime,
|
|
34
|
-
"valid_from" datetime,
|
|
35
|
-
"valid_until" datetime,
|
|
36
|
-
"verified_at" datetime,
|
|
37
|
-
"revoked_at" datetime,
|
|
38
|
-
UNIQUE ("hash", "credential_role")
|
|
39
|
-
)
|
|
40
|
-
`)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
44
|
-
await queryRunner.query(`DROP TABLE "DigitalCredential"`)
|
|
45
|
-
}
|
|
46
|
-
}
|
|
1
|
+
import { MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
+
|
|
3
|
+
export class CreateDigitalCredential1708525189002 implements MigrationInterface {
|
|
4
|
+
name = 'CreateDigitalCredential1708525189002'
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
// TODO FK for parent
|
|
8
|
+
await queryRunner.query(`
|
|
9
|
+
CREATE TABLE "DigitalCredential" (
|
|
10
|
+
"id" varchar PRIMARY KEY NOT NULL,
|
|
11
|
+
"parent_id" text,
|
|
12
|
+
"document_type" varchar CHECK( "document_type" IN ('VC', 'VP', 'C', 'P') ) NOT NULL,
|
|
13
|
+
"regulation_type" varchar CHECK( "regulation_type" IN ('PID', 'QEAA', 'EAA', 'NON_REGULATED') ) NOT NULL DEFAULT 'NON_REGULATED',
|
|
14
|
+
"document_format" varchar CHECK( "document_format" IN ('JSON_LD', 'JWT', 'SD_JWT', 'MSO_MDOC') ) NOT NULL,
|
|
15
|
+
"credential_role" varchar CHECK( "credential_role" IN ('ISSUER', 'VERIFIER', 'HOLDER') ) NOT NULL,
|
|
16
|
+
"raw_document" text NOT NULL,
|
|
17
|
+
"uniform_document" text NOT NULL,
|
|
18
|
+
"credential_id" text,
|
|
19
|
+
"hash" text NOT NULL,
|
|
20
|
+
"kms_key_ref" text,
|
|
21
|
+
"identifier_method" text,
|
|
22
|
+
"issuer_correlation_type" varchar CHECK( "issuer_correlation_type" IN ('DID', 'KID', 'URL', 'X509_SAN') ) NOT NULL,
|
|
23
|
+
"subject_correlation_type" varchar CHECK( "subject_correlation_type" IN ('DID', 'KID', 'URL', 'X509_SAN') ),
|
|
24
|
+
"issuer_correlation_id" text NOT NULL,
|
|
25
|
+
"subject_correlation_id" text,
|
|
26
|
+
"issuer_signed" boolean,
|
|
27
|
+
"rp_correlation_id" text,
|
|
28
|
+
"rp_correlation_type" varchar CHECK( "issuer_correlation_type" IN ('DID', 'KID', 'URL', 'X509_SAN') ),
|
|
29
|
+
"verified_state" varchar CHECK( "verified_state" IN ('REVOKED', 'VERIFIED', 'EXPIRED') ),
|
|
30
|
+
"tenant_id" text,
|
|
31
|
+
"created_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
32
|
+
"last_updated_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
33
|
+
"presented_at" datetime,
|
|
34
|
+
"valid_from" datetime,
|
|
35
|
+
"valid_until" datetime,
|
|
36
|
+
"verified_at" datetime,
|
|
37
|
+
"revoked_at" datetime,
|
|
38
|
+
UNIQUE ("hash", "credential_role")
|
|
39
|
+
)
|
|
40
|
+
`)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
44
|
+
await queryRunner.query(`DROP TABLE "DigitalCredential"`)
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
-
|
|
3
|
-
export class CreateMachineStateStore1708796002272 implements MigrationInterface {
|
|
4
|
-
name = 'CreateMachineStateStore1708796002272'
|
|
5
|
-
|
|
6
|
-
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
-
await queryRunner.query(`
|
|
8
|
-
CREATE TABLE "MachineStateInfoEntity" (
|
|
9
|
-
"instance_id" varchar PRIMARY KEY NOT NULL,
|
|
10
|
-
"session_id" varchar,
|
|
11
|
-
"machine_name" varchar NOT NULL,
|
|
12
|
-
"latest_state_name" varchar,
|
|
13
|
-
"latest_event_type" varchar NOT NULL,
|
|
14
|
-
"state" text NOT NULL,
|
|
15
|
-
"created_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
16
|
-
"updated_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
17
|
-
"updated_count" integer NOT NULL DEFAULT 0,
|
|
18
|
-
"expires_at" datetime,
|
|
19
|
-
"completed_at" datetime,
|
|
20
|
-
"tenant_id" varchar
|
|
21
|
-
)
|
|
22
|
-
`)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
26
|
-
await queryRunner.query(`DROP TABLE "MachineStateInfoEntity"`)
|
|
27
|
-
}
|
|
28
|
-
}
|
|
1
|
+
import { MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
+
|
|
3
|
+
export class CreateMachineStateStore1708796002272 implements MigrationInterface {
|
|
4
|
+
name = 'CreateMachineStateStore1708796002272'
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(`
|
|
8
|
+
CREATE TABLE "MachineStateInfoEntity" (
|
|
9
|
+
"instance_id" varchar PRIMARY KEY NOT NULL,
|
|
10
|
+
"session_id" varchar,
|
|
11
|
+
"machine_name" varchar NOT NULL,
|
|
12
|
+
"latest_state_name" varchar,
|
|
13
|
+
"latest_event_type" varchar NOT NULL,
|
|
14
|
+
"state" text NOT NULL,
|
|
15
|
+
"created_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
16
|
+
"updated_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
17
|
+
"updated_count" integer NOT NULL DEFAULT 0,
|
|
18
|
+
"expires_at" datetime,
|
|
19
|
+
"completed_at" datetime,
|
|
20
|
+
"tenant_id" varchar
|
|
21
|
+
)
|
|
22
|
+
`)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
26
|
+
await queryRunner.query(`DROP TABLE "MachineStateInfoEntity"`)
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
import { MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
-
|
|
3
|
-
export class CreateContacts1710438363002 implements MigrationInterface {
|
|
4
|
-
name = 'CreateContacts1710438363002'
|
|
5
|
-
|
|
6
|
-
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
-
await queryRunner.query(`ALTER TABLE "Party" ADD COLUMN "owner_id" text`)
|
|
8
|
-
await queryRunner.query(`ALTER TABLE "Party" ADD COLUMN "tenant_id" text`)
|
|
9
|
-
|
|
10
|
-
// Add owner_id, tenant_id & origin
|
|
11
|
-
await queryRunner.query(
|
|
12
|
-
`CREATE TABLE "temporary_Identity" (
|
|
13
|
-
"id" varchar PRIMARY KEY NOT NULL,
|
|
14
|
-
"alias" varchar(255) NOT NULL,
|
|
15
|
-
"roles" text NOT NULL,
|
|
16
|
-
"origin" text NOT NULL,
|
|
17
|
-
"created_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
18
|
-
"last_updated_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
19
|
-
"partyId" varchar,
|
|
20
|
-
"owner_id" text,
|
|
21
|
-
"tenant_id" text,
|
|
22
|
-
CONSTRAINT "UQ_Identity_alias" UNIQUE ("alias"),
|
|
23
|
-
CONSTRAINT "FK_Identity_partyId" FOREIGN KEY ("partyId") REFERENCES "Party" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
24
|
-
)`,
|
|
25
|
-
)
|
|
26
|
-
await queryRunner.query(
|
|
27
|
-
`INSERT INTO "temporary_Identity"("id", "alias", "roles", "created_at", "last_updated_at", "partyId", "owner_id", "tenant_id", "origin")
|
|
28
|
-
SELECT "id", "alias", "roles", 'EXTERNAL' as "origin", "created_at", "last_updated_at", "partyId", NULL as "owner_id", NULL as "tenant_id" FROM "Identity"`,
|
|
29
|
-
)
|
|
30
|
-
await queryRunner.query(`DROP TABLE "Identity"`)
|
|
31
|
-
await queryRunner.query(`ALTER TABLE "temporary_Identity" RENAME TO "Identity"`)
|
|
32
|
-
|
|
33
|
-
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" ADD COLUMN "owner_id" text`)
|
|
34
|
-
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" ADD COLUMN "tenant_id" text`)
|
|
35
|
-
|
|
36
|
-
await queryRunner.query(`ALTER TABLE "Connection" ADD COLUMN "owner_id" text`)
|
|
37
|
-
await queryRunner.query(`ALTER TABLE "Connection" ADD COLUMN "tenant_id" text`)
|
|
38
|
-
|
|
39
|
-
await queryRunner.query(`ALTER TABLE "BaseConfig" ADD COLUMN "owner_id" text`)
|
|
40
|
-
await queryRunner.query(`ALTER TABLE "BaseConfig" ADD COLUMN "tenant_id" text`)
|
|
41
|
-
|
|
42
|
-
await queryRunner.query(`ALTER TABLE "BaseContact" ADD COLUMN "owner_id" text`)
|
|
43
|
-
await queryRunner.query(`ALTER TABLE "BaseContact" ADD COLUMN "tenant_id" text`)
|
|
44
|
-
|
|
45
|
-
await queryRunner.query(`ALTER TABLE "PartyRelationship" ADD COLUMN "owner_id" text`)
|
|
46
|
-
await queryRunner.query(`ALTER TABLE "PartyRelationship" ADD COLUMN "tenant_id" text`)
|
|
47
|
-
|
|
48
|
-
await queryRunner.query(`ALTER TABLE "ElectronicAddress" ADD COLUMN "owner_id" text`)
|
|
49
|
-
await queryRunner.query(`ALTER TABLE "ElectronicAddress" ADD COLUMN "tenant_id" text`)
|
|
50
|
-
|
|
51
|
-
await queryRunner.query(`ALTER TABLE "PhysicalAddress" ADD COLUMN "owner_id" text`)
|
|
52
|
-
await queryRunner.query(`ALTER TABLE "PhysicalAddress" ADD COLUMN "tenant_id" text`)
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
56
|
-
await queryRunner.query(`ALTER TABLE "PhysicalAddress" DROP COLUMN "tenant_id"`)
|
|
57
|
-
await queryRunner.query(`ALTER TABLE "PhysicalAddress" DROP COLUMN "owner_id"`)
|
|
58
|
-
|
|
59
|
-
await queryRunner.query(`ALTER TABLE "ElectronicAddress" DROP COLUMN "tenant_id"`)
|
|
60
|
-
await queryRunner.query(`ALTER TABLE "ElectronicAddress" DROP COLUMN "owner_id"`)
|
|
61
|
-
|
|
62
|
-
await queryRunner.query(`ALTER TABLE "PartyRelationship" DROP COLUMN "tenant_id"`)
|
|
63
|
-
await queryRunner.query(`ALTER TABLE "PartyRelationship" DROP COLUMN "owner_id"`)
|
|
64
|
-
|
|
65
|
-
await queryRunner.query(`ALTER TABLE "BaseContact" DROP COLUMN "tenant_id"`)
|
|
66
|
-
await queryRunner.query(`ALTER TABLE "BaseContact" DROP COLUMN "owner_id"`)
|
|
67
|
-
|
|
68
|
-
await queryRunner.query(`ALTER TABLE "BaseConfig" DROP COLUMN "tenant_id"`)
|
|
69
|
-
await queryRunner.query(`ALTER TABLE "BaseConfig" DROP COLUMN "owner_id"`)
|
|
70
|
-
|
|
71
|
-
await queryRunner.query(`ALTER TABLE "Connection" DROP COLUMN "tenant_id"`)
|
|
72
|
-
await queryRunner.query(`ALTER TABLE "Connection" DROP COLUMN "owner_id"`)
|
|
73
|
-
|
|
74
|
-
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" DROP COLUMN "tenant_id"`)
|
|
75
|
-
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" DROP COLUMN "owner_id"`)
|
|
76
|
-
|
|
77
|
-
await queryRunner.query(`ALTER TABLE "Identity" DROP COLUMN "tenant_id"`)
|
|
78
|
-
await queryRunner.query(`ALTER TABLE "Identity" DROP COLUMN "owner_id"`)
|
|
79
|
-
|
|
80
|
-
await queryRunner.query(`ALTER TABLE "Party" DROP COLUMN "tenant_id"`)
|
|
81
|
-
await queryRunner.query(`ALTER TABLE "Party" DROP COLUMN "owner_id"`)
|
|
82
|
-
}
|
|
83
|
-
}
|
|
1
|
+
import { MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
+
|
|
3
|
+
export class CreateContacts1710438363002 implements MigrationInterface {
|
|
4
|
+
name = 'CreateContacts1710438363002'
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(`ALTER TABLE "Party" ADD COLUMN "owner_id" text`)
|
|
8
|
+
await queryRunner.query(`ALTER TABLE "Party" ADD COLUMN "tenant_id" text`)
|
|
9
|
+
|
|
10
|
+
// Add owner_id, tenant_id & origin
|
|
11
|
+
await queryRunner.query(
|
|
12
|
+
`CREATE TABLE "temporary_Identity" (
|
|
13
|
+
"id" varchar PRIMARY KEY NOT NULL,
|
|
14
|
+
"alias" varchar(255) NOT NULL,
|
|
15
|
+
"roles" text NOT NULL,
|
|
16
|
+
"origin" text NOT NULL,
|
|
17
|
+
"created_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
18
|
+
"last_updated_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
19
|
+
"partyId" varchar,
|
|
20
|
+
"owner_id" text,
|
|
21
|
+
"tenant_id" text,
|
|
22
|
+
CONSTRAINT "UQ_Identity_alias" UNIQUE ("alias"),
|
|
23
|
+
CONSTRAINT "FK_Identity_partyId" FOREIGN KEY ("partyId") REFERENCES "Party" ("id") ON DELETE CASCADE ON UPDATE NO ACTION
|
|
24
|
+
)`,
|
|
25
|
+
)
|
|
26
|
+
await queryRunner.query(
|
|
27
|
+
`INSERT INTO "temporary_Identity"("id", "alias", "roles", "created_at", "last_updated_at", "partyId", "owner_id", "tenant_id", "origin")
|
|
28
|
+
SELECT "id", "alias", "roles", 'EXTERNAL' as "origin", "created_at", "last_updated_at", "partyId", NULL as "owner_id", NULL as "tenant_id" FROM "Identity"`,
|
|
29
|
+
)
|
|
30
|
+
await queryRunner.query(`DROP TABLE "Identity"`)
|
|
31
|
+
await queryRunner.query(`ALTER TABLE "temporary_Identity" RENAME TO "Identity"`)
|
|
32
|
+
|
|
33
|
+
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" ADD COLUMN "owner_id" text`)
|
|
34
|
+
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" ADD COLUMN "tenant_id" text`)
|
|
35
|
+
|
|
36
|
+
await queryRunner.query(`ALTER TABLE "Connection" ADD COLUMN "owner_id" text`)
|
|
37
|
+
await queryRunner.query(`ALTER TABLE "Connection" ADD COLUMN "tenant_id" text`)
|
|
38
|
+
|
|
39
|
+
await queryRunner.query(`ALTER TABLE "BaseConfig" ADD COLUMN "owner_id" text`)
|
|
40
|
+
await queryRunner.query(`ALTER TABLE "BaseConfig" ADD COLUMN "tenant_id" text`)
|
|
41
|
+
|
|
42
|
+
await queryRunner.query(`ALTER TABLE "BaseContact" ADD COLUMN "owner_id" text`)
|
|
43
|
+
await queryRunner.query(`ALTER TABLE "BaseContact" ADD COLUMN "tenant_id" text`)
|
|
44
|
+
|
|
45
|
+
await queryRunner.query(`ALTER TABLE "PartyRelationship" ADD COLUMN "owner_id" text`)
|
|
46
|
+
await queryRunner.query(`ALTER TABLE "PartyRelationship" ADD COLUMN "tenant_id" text`)
|
|
47
|
+
|
|
48
|
+
await queryRunner.query(`ALTER TABLE "ElectronicAddress" ADD COLUMN "owner_id" text`)
|
|
49
|
+
await queryRunner.query(`ALTER TABLE "ElectronicAddress" ADD COLUMN "tenant_id" text`)
|
|
50
|
+
|
|
51
|
+
await queryRunner.query(`ALTER TABLE "PhysicalAddress" ADD COLUMN "owner_id" text`)
|
|
52
|
+
await queryRunner.query(`ALTER TABLE "PhysicalAddress" ADD COLUMN "tenant_id" text`)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
56
|
+
await queryRunner.query(`ALTER TABLE "PhysicalAddress" DROP COLUMN "tenant_id"`)
|
|
57
|
+
await queryRunner.query(`ALTER TABLE "PhysicalAddress" DROP COLUMN "owner_id"`)
|
|
58
|
+
|
|
59
|
+
await queryRunner.query(`ALTER TABLE "ElectronicAddress" DROP COLUMN "tenant_id"`)
|
|
60
|
+
await queryRunner.query(`ALTER TABLE "ElectronicAddress" DROP COLUMN "owner_id"`)
|
|
61
|
+
|
|
62
|
+
await queryRunner.query(`ALTER TABLE "PartyRelationship" DROP COLUMN "tenant_id"`)
|
|
63
|
+
await queryRunner.query(`ALTER TABLE "PartyRelationship" DROP COLUMN "owner_id"`)
|
|
64
|
+
|
|
65
|
+
await queryRunner.query(`ALTER TABLE "BaseContact" DROP COLUMN "tenant_id"`)
|
|
66
|
+
await queryRunner.query(`ALTER TABLE "BaseContact" DROP COLUMN "owner_id"`)
|
|
67
|
+
|
|
68
|
+
await queryRunner.query(`ALTER TABLE "BaseConfig" DROP COLUMN "tenant_id"`)
|
|
69
|
+
await queryRunner.query(`ALTER TABLE "BaseConfig" DROP COLUMN "owner_id"`)
|
|
70
|
+
|
|
71
|
+
await queryRunner.query(`ALTER TABLE "Connection" DROP COLUMN "tenant_id"`)
|
|
72
|
+
await queryRunner.query(`ALTER TABLE "Connection" DROP COLUMN "owner_id"`)
|
|
73
|
+
|
|
74
|
+
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" DROP COLUMN "tenant_id"`)
|
|
75
|
+
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" DROP COLUMN "owner_id"`)
|
|
76
|
+
|
|
77
|
+
await queryRunner.query(`ALTER TABLE "Identity" DROP COLUMN "tenant_id"`)
|
|
78
|
+
await queryRunner.query(`ALTER TABLE "Identity" DROP COLUMN "owner_id"`)
|
|
79
|
+
|
|
80
|
+
await queryRunner.query(`ALTER TABLE "Party" DROP COLUMN "tenant_id"`)
|
|
81
|
+
await queryRunner.query(`ALTER TABLE "Party" DROP COLUMN "owner_id"`)
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import { MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
-
|
|
3
|
-
export class CreateContacts1715761125002 implements MigrationInterface {
|
|
4
|
-
name = 'CreateContacts1715761125002'
|
|
5
|
-
|
|
6
|
-
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
-
// Upgrade IdentityMetadata table
|
|
8
|
-
await queryRunner.query(`ALTER TABLE "IdentityMetadata" RENAME TO "temporary_IdentityMetadata"`)
|
|
9
|
-
await queryRunner.query(`CREATE TABLE "IdentityMetadata"
|
|
10
|
-
(
|
|
11
|
-
"id" varchar PRIMARY KEY NOT NULL,
|
|
12
|
-
"label" varchar(255) NOT NULL,
|
|
13
|
-
"valueType" varchar NOT NULL,
|
|
14
|
-
"stringValue" varchar(255),
|
|
15
|
-
"numberValue" double,
|
|
16
|
-
"dateValue" datetime,
|
|
17
|
-
"boolValue" boolean,
|
|
18
|
-
"identityId" varchar,
|
|
19
|
-
FOREIGN KEY ("identityId") REFERENCES "Identity" ("id") ON DELETE CASCADE)`)
|
|
20
|
-
await queryRunner.query(`INSERT INTO "IdentityMetadata" ("id", "label", "valueType", "stringValue", "identityId")
|
|
21
|
-
SELECT "id", "label", 'string', "value", "identityId"
|
|
22
|
-
FROM "temporary_IdentityMetadata"
|
|
23
|
-
`)
|
|
24
|
-
await queryRunner.query(`DROP TABLE "temporary_IdentityMetadata"`)
|
|
25
|
-
|
|
26
|
-
// Create new ContactMetadata table
|
|
27
|
-
await queryRunner.query(`CREATE TABLE "ContactMetadata"
|
|
28
|
-
(
|
|
29
|
-
"id" varchar PRIMARY KEY NOT NULL,
|
|
30
|
-
"label" varchar(255) NOT NULL,
|
|
31
|
-
"valueType" varchar NOT NULL,
|
|
32
|
-
"stringValue" text,
|
|
33
|
-
"numberValue" double,
|
|
34
|
-
"dateValue" datetime,
|
|
35
|
-
"boolValue" boolean,
|
|
36
|
-
"contactId" varchar,
|
|
37
|
-
FOREIGN KEY ("contactId") REFERENCES "BaseContact" ("id") ON DELETE CASCADE)`)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
41
|
-
// Drop the ContactMetadata table
|
|
42
|
-
await queryRunner.query(`DROP TABLE "ContactMetadata"`)
|
|
43
|
-
|
|
44
|
-
// Restore the IdentityMetadata table
|
|
45
|
-
await queryRunner.query(`ALTER TABLE "IdentityMetadata" RENAME TO "temporary_IdentityMetadata"`)
|
|
46
|
-
await queryRunner.query(`CREATE TABLE "IdentityMetadata"
|
|
47
|
-
(
|
|
48
|
-
"id" varchar PRIMARY KEY NOT NULL,
|
|
49
|
-
"label" varchar(255) NOT NULL,
|
|
50
|
-
"value" varchar(255) NOT NULL,
|
|
51
|
-
"identityId" varchar,
|
|
52
|
-
FOREIGN KEY ("identityId") REFERENCES "Identity" ("id") ON DELETE CASCADE
|
|
53
|
-
)`)
|
|
54
|
-
await queryRunner.query(`INSERT INTO "IdentityMetadata" ("id", "label", "value", "identityId")
|
|
55
|
-
SELECT "id", "label", "stringValue", "identityId"
|
|
56
|
-
FROM "temporary_IdentityMetadata"`)
|
|
57
|
-
await queryRunner.query(`DROP TABLE "temporary_IdentityMetadata"`)
|
|
58
|
-
}
|
|
59
|
-
}
|
|
1
|
+
import { MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
+
|
|
3
|
+
export class CreateContacts1715761125002 implements MigrationInterface {
|
|
4
|
+
name = 'CreateContacts1715761125002'
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
// Upgrade IdentityMetadata table
|
|
8
|
+
await queryRunner.query(`ALTER TABLE "IdentityMetadata" RENAME TO "temporary_IdentityMetadata"`)
|
|
9
|
+
await queryRunner.query(`CREATE TABLE "IdentityMetadata"
|
|
10
|
+
(
|
|
11
|
+
"id" varchar PRIMARY KEY NOT NULL,
|
|
12
|
+
"label" varchar(255) NOT NULL,
|
|
13
|
+
"valueType" varchar NOT NULL,
|
|
14
|
+
"stringValue" varchar(255),
|
|
15
|
+
"numberValue" double,
|
|
16
|
+
"dateValue" datetime,
|
|
17
|
+
"boolValue" boolean,
|
|
18
|
+
"identityId" varchar,
|
|
19
|
+
FOREIGN KEY ("identityId") REFERENCES "Identity" ("id") ON DELETE CASCADE)`)
|
|
20
|
+
await queryRunner.query(`INSERT INTO "IdentityMetadata" ("id", "label", "valueType", "stringValue", "identityId")
|
|
21
|
+
SELECT "id", "label", 'string', "value", "identityId"
|
|
22
|
+
FROM "temporary_IdentityMetadata"
|
|
23
|
+
`)
|
|
24
|
+
await queryRunner.query(`DROP TABLE "temporary_IdentityMetadata"`)
|
|
25
|
+
|
|
26
|
+
// Create new ContactMetadata table
|
|
27
|
+
await queryRunner.query(`CREATE TABLE "ContactMetadata"
|
|
28
|
+
(
|
|
29
|
+
"id" varchar PRIMARY KEY NOT NULL,
|
|
30
|
+
"label" varchar(255) NOT NULL,
|
|
31
|
+
"valueType" varchar NOT NULL,
|
|
32
|
+
"stringValue" text,
|
|
33
|
+
"numberValue" double,
|
|
34
|
+
"dateValue" datetime,
|
|
35
|
+
"boolValue" boolean,
|
|
36
|
+
"contactId" varchar,
|
|
37
|
+
FOREIGN KEY ("contactId") REFERENCES "BaseContact" ("id") ON DELETE CASCADE)`)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
41
|
+
// Drop the ContactMetadata table
|
|
42
|
+
await queryRunner.query(`DROP TABLE "ContactMetadata"`)
|
|
43
|
+
|
|
44
|
+
// Restore the IdentityMetadata table
|
|
45
|
+
await queryRunner.query(`ALTER TABLE "IdentityMetadata" RENAME TO "temporary_IdentityMetadata"`)
|
|
46
|
+
await queryRunner.query(`CREATE TABLE "IdentityMetadata"
|
|
47
|
+
(
|
|
48
|
+
"id" varchar PRIMARY KEY NOT NULL,
|
|
49
|
+
"label" varchar(255) NOT NULL,
|
|
50
|
+
"value" varchar(255) NOT NULL,
|
|
51
|
+
"identityId" varchar,
|
|
52
|
+
FOREIGN KEY ("identityId") REFERENCES "Identity" ("id") ON DELETE CASCADE
|
|
53
|
+
)`)
|
|
54
|
+
await queryRunner.query(`INSERT INTO "IdentityMetadata" ("id", "label", "value", "identityId")
|
|
55
|
+
SELECT "id", "label", "stringValue", "identityId"
|
|
56
|
+
FROM "temporary_IdentityMetadata"`)
|
|
57
|
+
await queryRunner.query(`DROP TABLE "temporary_IdentityMetadata"`)
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
-
|
|
3
|
-
export class CreatePresentationDefinitions1716475165344 implements MigrationInterface {
|
|
4
|
-
name = 'CreatePresentationDefinitions1716475165344'
|
|
5
|
-
|
|
6
|
-
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
-
await queryRunner.query(
|
|
8
|
-
`CREATE TABLE "PresentationDefinitionItem" (
|
|
9
|
-
"id" varchar PRIMARY KEY NOT NULL,
|
|
10
|
-
"tenant_id" varchar,
|
|
11
|
-
"definition_id" varchar NOT NULL,
|
|
12
|
-
"name" varchar,
|
|
13
|
-
"version" varchar NOT NULL,
|
|
14
|
-
"purpose" varchar,
|
|
15
|
-
"definition_payload" varchar NOT NULL,
|
|
16
|
-
"created_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
17
|
-
"last_updated_at" datetime NOT NULL DEFAULT (datetime('now')))`,
|
|
18
|
-
)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
22
|
-
await queryRunner.query(`DROP TABLE "PresentationDefinitionItem"`)
|
|
23
|
-
}
|
|
24
|
-
}
|
|
1
|
+
import { MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
+
|
|
3
|
+
export class CreatePresentationDefinitions1716475165344 implements MigrationInterface {
|
|
4
|
+
name = 'CreatePresentationDefinitions1716475165344'
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(
|
|
8
|
+
`CREATE TABLE "PresentationDefinitionItem" (
|
|
9
|
+
"id" varchar PRIMARY KEY NOT NULL,
|
|
10
|
+
"tenant_id" varchar,
|
|
11
|
+
"definition_id" varchar NOT NULL,
|
|
12
|
+
"name" varchar,
|
|
13
|
+
"version" varchar NOT NULL,
|
|
14
|
+
"purpose" varchar,
|
|
15
|
+
"definition_payload" varchar NOT NULL,
|
|
16
|
+
"created_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
17
|
+
"last_updated_at" datetime NOT NULL DEFAULT (datetime('now')))`,
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
22
|
+
await queryRunner.query(`DROP TABLE "PresentationDefinitionItem"`)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
GetDefinitionArgs,
|
|
3
|
-
GetDefinitionsArgs,
|
|
4
|
-
DeleteDefinitionArgs,
|
|
5
|
-
PresentationDefinitionItem,
|
|
6
|
-
AddDefinitionArgs,
|
|
7
|
-
UpdateDefinitionArgs,
|
|
8
|
-
DeleteDefinitionsArgs,
|
|
9
|
-
} from '../types'
|
|
10
|
-
|
|
11
|
-
export abstract class AbstractPDStore {
|
|
12
|
-
abstract hasDefinition(args: GetDefinitionArgs): Promise<boolean>
|
|
13
|
-
abstract hasDefinitions(args: GetDefinitionsArgs): Promise<boolean>
|
|
14
|
-
abstract getDefinition(args: GetDefinitionArgs): Promise<PresentationDefinitionItem>
|
|
15
|
-
abstract getDefinitions(args: GetDefinitionsArgs): Promise<Array<PresentationDefinitionItem>>
|
|
16
|
-
abstract addDefinition(args: AddDefinitionArgs): Promise<PresentationDefinitionItem>
|
|
17
|
-
abstract updateDefinition(args: UpdateDefinitionArgs): Promise<PresentationDefinitionItem>
|
|
18
|
-
abstract deleteDefinition(args: DeleteDefinitionArgs): Promise<void>
|
|
19
|
-
abstract deleteDefinitions(args: DeleteDefinitionsArgs): Promise<number>
|
|
20
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
GetDefinitionArgs,
|
|
3
|
+
GetDefinitionsArgs,
|
|
4
|
+
DeleteDefinitionArgs,
|
|
5
|
+
PresentationDefinitionItem,
|
|
6
|
+
AddDefinitionArgs,
|
|
7
|
+
UpdateDefinitionArgs,
|
|
8
|
+
DeleteDefinitionsArgs,
|
|
9
|
+
} from '../types'
|
|
10
|
+
|
|
11
|
+
export abstract class AbstractPDStore {
|
|
12
|
+
abstract hasDefinition(args: GetDefinitionArgs): Promise<boolean>
|
|
13
|
+
abstract hasDefinitions(args: GetDefinitionsArgs): Promise<boolean>
|
|
14
|
+
abstract getDefinition(args: GetDefinitionArgs): Promise<PresentationDefinitionItem>
|
|
15
|
+
abstract getDefinitions(args: GetDefinitionsArgs): Promise<Array<PresentationDefinitionItem>>
|
|
16
|
+
abstract addDefinition(args: AddDefinitionArgs): Promise<PresentationDefinitionItem>
|
|
17
|
+
abstract updateDefinition(args: UpdateDefinitionArgs): Promise<PresentationDefinitionItem>
|
|
18
|
+
abstract deleteDefinition(args: DeleteDefinitionArgs): Promise<void>
|
|
19
|
+
abstract deleteDefinitions(args: DeleteDefinitionsArgs): Promise<number>
|
|
20
|
+
}
|