@sphereon/ssi-sdk.data-store 0.34.1-feature.FIDES.1.274 → 0.34.1-feature.IDK.11.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3844 -3819
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1270 -339
- package/dist/index.d.ts +1270 -339
- package/dist/index.js +3791 -3766
- package/dist/index.js.map +1 -1
- package/package.json +8 -9
- package/src/__tests__/contact.entities.test.ts +10 -4
- package/src/__tests__/contact.store.test.ts +6 -11
- package/src/__tests__/digitalCredential.entities.test.ts +6 -13
- package/src/__tests__/digitalCredential.store.test.ts +6 -6
- package/src/__tests__/eventLogger.entities.test.ts +3 -3
- package/src/__tests__/eventLogger.store.test.ts +4 -9
- package/src/__tests__/issuanceBranding.entities.test.ts +2 -2
- package/src/__tests__/issuanceBranding.store.test.ts +3 -3
- package/src/__tests__/machineState.entities.test.ts +1 -1
- package/src/__tests__/machineState.store.test.ts +1 -1
- package/src/__tests__/pd-manager.entities.test.ts +98 -27
- package/src/__tests__/pd-manager.store.test.ts +101 -151
- package/src/__tests__/statusList.entities.test.ts +4 -4
- package/src/__tests__/statusList.store.test.ts +3 -3
- package/src/contact/AbstractContactStore.ts +71 -0
- package/src/contact/ContactStore.ts +35 -35
- package/src/digitalCredential/AbstractDigitalCredentialStore.ts +21 -0
- package/src/digitalCredential/DigitalCredentialStore.ts +7 -6
- package/src/entities/contact/BaseConfigEntity.ts +2 -2
- package/src/entities/contact/BaseContactEntity.ts +5 -4
- package/src/entities/contact/ConnectionEntity.ts +4 -4
- package/src/entities/contact/ContactMetadataItemEntity.ts +4 -3
- package/src/entities/contact/CorrelationIdentifierEntity.ts +4 -3
- package/src/entities/contact/DidAuthConfigEntity.ts +2 -1
- package/src/entities/contact/ElectronicAddressEntity.ts +5 -15
- package/src/entities/contact/IdentityEntity.ts +11 -12
- package/src/entities/contact/IdentityMetadataItemEntity.ts +3 -3
- package/src/entities/contact/NaturalPersonEntity.ts +5 -5
- package/src/entities/contact/OrganizationEntity.ts +1 -1
- package/src/entities/contact/PartyEntity.ts +7 -7
- package/src/entities/contact/PartyRelationshipEntity.ts +8 -8
- package/src/entities/contact/PartyTypeEntity.ts +4 -4
- package/src/entities/contact/PhysicalAddressEntity.ts +3 -3
- package/src/entities/digitalCredential/DigitalCredentialEntity.ts +3 -4
- package/src/entities/eventLogger/AuditEventEntity.ts +2 -2
- package/src/entities/issuanceBranding/BackgroundAttributesEntity.ts +2 -2
- package/src/entities/issuanceBranding/BaseLocaleBrandingEntity.ts +7 -6
- package/src/entities/issuanceBranding/CredentialBrandingEntity.ts +2 -2
- package/src/entities/issuanceBranding/CredentialClaimsEntity.ts +2 -2
- package/src/entities/issuanceBranding/CredentialLocaleBrandingEntity.ts +2 -2
- package/src/entities/issuanceBranding/ImageAttributesEntity.ts +2 -2
- package/src/entities/issuanceBranding/IssuerBrandingEntity.ts +2 -2
- package/src/entities/issuanceBranding/IssuerLocaleBrandingEntity.ts +3 -3
- package/src/entities/issuanceBranding/TextAttributesEntity.ts +1 -1
- package/src/entities/machineState/MachineStateInfoEntity.ts +1 -1
- package/src/entities/presentationDefinition/{DcqlQueryItemEntity.ts → PresentationDefinitionItemEntity.ts} +14 -10
- package/src/entities/statusList/BitstringStatusListEntryEntity.ts +1 -1
- package/src/entities/statusList/StatusListEntities.ts +4 -3
- package/src/eventLogger/AbstractEventLoggerStore.ts +9 -0
- package/src/eventLogger/EventLoggerStore.ts +2 -2
- package/src/index.ts +26 -21
- package/src/issuanceBranding/AbstractIssuanceBrandingStore.ts +41 -0
- package/src/issuanceBranding/IssuanceBrandingStore.ts +25 -25
- package/src/machineState/IAbstractMachineStateStore.ts +65 -0
- package/src/machineState/MachineStateStore.ts +7 -7
- package/src/migrations/generic/1-CreateContacts.ts +1 -1
- package/src/migrations/generic/10-CreatePresentationDefinitions.ts +1 -1
- package/src/migrations/generic/11-FixCredentialClaimsReferenceUuid.ts +2 -2
- package/src/migrations/generic/12-CreateBitstringStatusList.ts +2 -32
- package/src/migrations/generic/2-CreateIssuanceBranding.ts +1 -1
- package/src/migrations/generic/3-CreateContacts.ts +2 -2
- package/src/migrations/generic/4-CreateStatusList.ts +1 -1
- package/src/migrations/generic/5-CreateAuditEvents.ts +2 -2
- package/src/migrations/generic/6-CreateDigitalCredential.ts +1 -1
- package/src/migrations/generic/7-CreateMachineStateStore.ts +1 -1
- package/src/migrations/generic/8-CreateContacts.ts +1 -1
- package/src/migrations/generic/9-CreateContacts.ts +1 -1
- package/src/migrations/generic/index.ts +5 -10
- package/src/migrations/postgres/1659463079428-CreateContacts.ts +1 -1
- package/src/migrations/postgres/1685628974232-CreateIssuanceBranding.ts +1 -1
- package/src/migrations/postgres/1690925872592-CreateContacts.ts +1 -1
- package/src/migrations/postgres/1716475165345-CreatePresentationDefinitions.ts +1 -1
- package/src/migrations/postgres/1737110469001-UpdateStatusList.ts +1 -1
- package/src/migrations/postgres/1741895823000-CreateBitstringStatusList.ts +2 -15
- package/src/migrations/sqlite/1716475165344-CreatePresentationDefinitions.ts +1 -1
- package/src/presentationDefinition/AbstractPDStore.ts +20 -0
- package/src/presentationDefinition/PDStore.ts +45 -45
- package/src/statusList/IStatusListStore.ts +1 -1
- package/src/statusList/StatusListStore.ts +3 -3
- package/src/types/contact/IAbstractContactStore.ts +161 -0
- package/src/types/contact/contact.ts +295 -0
- package/src/types/contact/index.ts +2 -0
- package/src/types/digitalCredential/IAbstractDigitalCredentialStore.ts +43 -0
- package/src/types/digitalCredential/enums.ts +70 -0
- package/src/types/digitalCredential/index.ts +3 -0
- package/src/types/digitalCredential/types.ts +39 -0
- package/src/types/eventLogger/IAbstractEventLoggerStore.ts +22 -0
- package/src/types/eventLogger/eventLogger.ts +4 -0
- package/src/types/index.ts +12 -0
- package/src/types/issuanceBranding/IAbstractIssuanceBrandingStore.ts +85 -0
- package/src/types/issuanceBranding/issuanceBranding.ts +138 -0
- package/src/types/machineState/IAbstractMachineStateStore.ts +68 -0
- package/src/types/presentationDefinition/IAbstractPDStore.ts +25 -0
- package/src/types/presentationDefinition/presentationDefinition.ts +19 -0
- package/src/types/statusList/IAbstractStatusListStore.ts +9 -9
- package/src/types/validation/validation.ts +3 -0
- package/src/utils/ValidatorUtils.ts +1 -1
- package/src/utils/contact/MappingUtils.ts +10 -10
- package/src/utils/digitalCredential/MappingUtils.ts +21 -3
- package/src/utils/eventLogger/MappingUtils.ts +2 -2
- package/src/utils/issuanceBranding/MappingUtils.ts +13 -13
- package/src/utils/presentationDefinition/MappingUtils.ts +22 -31
- package/src/utils/statusList/MappingUtils.ts +1 -1
- package/src/migrations/generic/13-CreateDcqlQueryItem.ts +0 -67
- package/src/migrations/postgres/1726588800000-CreateDcqlQueryItem.ts +0 -25
- package/src/migrations/sqlite/1726617600000-CreateDcqlQueryItem.ts +0 -24
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ActivityLoggingEvent, AuditLoggingEvent } from '@sphereon/ssi-sdk.core'
|
|
2
|
-
import type { NonPersistedActivityLoggingEvent, NonPersistedAuditLoggingEvent } from '@sphereon/ssi-sdk.data-store-types'
|
|
3
2
|
import { LoggingEventType } from '@sphereon/ssi-types'
|
|
4
|
-
import { AuditEventEntity } from '../../entities/eventLogger/AuditEventEntity'
|
|
5
3
|
import { replaceNullWithUndefined } from '../FormattingUtils'
|
|
4
|
+
import { AuditEventEntity } from '../../entities/eventLogger/AuditEventEntity'
|
|
5
|
+
import type { NonPersistedActivityLoggingEvent, NonPersistedAuditLoggingEvent } from '../../types'
|
|
6
6
|
|
|
7
7
|
export const auditEventFrom = (event: AuditEventEntity): AuditLoggingEvent => {
|
|
8
8
|
const result: AuditLoggingEvent = {
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
import { replaceNullWithUndefined } from '../FormattingUtils'
|
|
2
|
+
import { isEmptyString } from '../../entities/validators'
|
|
3
|
+
import { CredentialBrandingEntity } from '../../entities/issuanceBranding/CredentialBrandingEntity'
|
|
4
|
+
import { BaseLocaleBrandingEntity } from '../../entities/issuanceBranding/BaseLocaleBrandingEntity'
|
|
5
|
+
import { IssuerBrandingEntity } from '../../entities/issuanceBranding/IssuerBrandingEntity'
|
|
6
|
+
import { ImageAttributesEntity } from '../../entities/issuanceBranding/ImageAttributesEntity'
|
|
7
|
+
import { BackgroundAttributesEntity } from '../../entities/issuanceBranding/BackgroundAttributesEntity'
|
|
8
|
+
import { TextAttributesEntity } from '../../entities/issuanceBranding/TextAttributesEntity'
|
|
9
|
+
import { IssuerLocaleBrandingEntity } from '../../entities/issuanceBranding/IssuerLocaleBrandingEntity'
|
|
10
|
+
import { CredentialLocaleBrandingEntity } from '../../entities/issuanceBranding/CredentialLocaleBrandingEntity'
|
|
11
|
+
import { ImageDimensionsEntity } from '../../entities/issuanceBranding/ImageDimensionsEntity'
|
|
12
|
+
import { CredentialClaimsEntity } from '../../entities/issuanceBranding/CredentialClaimsEntity'
|
|
1
13
|
import type {
|
|
2
14
|
IBasicBackgroundAttributes,
|
|
3
15
|
IBasicCredentialBranding,
|
|
@@ -11,19 +23,7 @@ import type {
|
|
|
11
23
|
ICredentialBranding,
|
|
12
24
|
IIssuerBranding,
|
|
13
25
|
ILocaleBranding,
|
|
14
|
-
} from '
|
|
15
|
-
import { BackgroundAttributesEntity } from '../../entities/issuanceBranding/BackgroundAttributesEntity'
|
|
16
|
-
import { BaseLocaleBrandingEntity } from '../../entities/issuanceBranding/BaseLocaleBrandingEntity'
|
|
17
|
-
import { CredentialBrandingEntity } from '../../entities/issuanceBranding/CredentialBrandingEntity'
|
|
18
|
-
import { CredentialClaimsEntity } from '../../entities/issuanceBranding/CredentialClaimsEntity'
|
|
19
|
-
import { CredentialLocaleBrandingEntity } from '../../entities/issuanceBranding/CredentialLocaleBrandingEntity'
|
|
20
|
-
import { ImageAttributesEntity } from '../../entities/issuanceBranding/ImageAttributesEntity'
|
|
21
|
-
import { ImageDimensionsEntity } from '../../entities/issuanceBranding/ImageDimensionsEntity'
|
|
22
|
-
import { IssuerBrandingEntity } from '../../entities/issuanceBranding/IssuerBrandingEntity'
|
|
23
|
-
import { IssuerLocaleBrandingEntity } from '../../entities/issuanceBranding/IssuerLocaleBrandingEntity'
|
|
24
|
-
import { TextAttributesEntity } from '../../entities/issuanceBranding/TextAttributesEntity'
|
|
25
|
-
import { isEmptyString } from '../../entities/validators'
|
|
26
|
-
import { replaceNullWithUndefined } from '../FormattingUtils'
|
|
26
|
+
} from '../../types'
|
|
27
27
|
|
|
28
28
|
export const credentialBrandingFrom = (credentialBranding: CredentialBrandingEntity): ICredentialBranding => {
|
|
29
29
|
const result: ICredentialBranding = {
|
|
@@ -1,67 +1,58 @@
|
|
|
1
|
+
import { PresentationDefinitionItemEntity } from '../../entities/presentationDefinition/PresentationDefinitionItemEntity'
|
|
1
2
|
import type { IPresentationDefinition } from '@sphereon/pex'
|
|
2
|
-
import type {
|
|
3
|
+
import type { NonPersistedPresentationDefinitionItem, PartialPresentationDefinitionItem, PresentationDefinitionItem } from '../../types'
|
|
3
4
|
import * as blakepkg from 'blakejs'
|
|
4
|
-
import { DcqlQuery } from 'dcql'
|
|
5
|
-
import { DcqlQueryItemEntity } from '../../entities/presentationDefinition/DcqlQueryItemEntity'
|
|
6
5
|
import { replaceNullWithUndefined } from '../FormattingUtils'
|
|
6
|
+
import type { DcqlQueryREST } from '@sphereon/ssi-types'
|
|
7
7
|
|
|
8
|
-
export const
|
|
9
|
-
const result:
|
|
8
|
+
export const presentationDefinitionItemFrom = (entity: PresentationDefinitionItemEntity): PresentationDefinitionItem => {
|
|
9
|
+
const result: PresentationDefinitionItem = {
|
|
10
10
|
id: entity.id,
|
|
11
11
|
tenantId: entity.tenantId,
|
|
12
|
-
|
|
12
|
+
definitionId: entity.definitionId,
|
|
13
13
|
version: entity.version,
|
|
14
14
|
name: entity.name,
|
|
15
15
|
purpose: entity.purpose,
|
|
16
|
-
|
|
16
|
+
definitionPayload: JSON.parse(entity.definitionPayload) as IPresentationDefinition,
|
|
17
|
+
dcqlPayload: JSON.parse(entity.dcqlPayload) as DcqlQueryREST,
|
|
17
18
|
createdAt: entity.createdAt,
|
|
18
19
|
lastUpdatedAt: entity.lastUpdatedAt,
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
if (result.query) {
|
|
22
|
-
DcqlQuery.validate(result.query)
|
|
23
|
-
}
|
|
24
22
|
return replaceNullWithUndefined(result)
|
|
25
23
|
}
|
|
26
24
|
|
|
27
|
-
export const
|
|
28
|
-
const entity = new
|
|
25
|
+
export const presentationDefinitionEntityItemFrom = (item: NonPersistedPresentationDefinitionItem): PresentationDefinitionItemEntity => {
|
|
26
|
+
const entity = new PresentationDefinitionItemEntity()
|
|
29
27
|
|
|
30
28
|
entity.tenantId = item.tenantId
|
|
31
|
-
entity.
|
|
29
|
+
entity.definitionId = item.definitionId!
|
|
32
30
|
entity.version = item.version
|
|
33
31
|
entity.name = item.name
|
|
34
32
|
entity.purpose = item.purpose
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
DcqlQuery.validate(dcqlQuery)
|
|
38
|
-
entity.query = JSON.stringify(item.query)
|
|
39
|
-
}
|
|
33
|
+
entity.definitionPayload = JSON.stringify(item.definitionPayload!)
|
|
34
|
+
entity.dcqlPayload = JSON.stringify(item.dcqlPayload!)
|
|
40
35
|
return entity
|
|
41
36
|
}
|
|
42
37
|
|
|
43
|
-
function hashPayload(payload: IPresentationDefinition
|
|
38
|
+
function hashPayload(payload: IPresentationDefinition): string {
|
|
44
39
|
return blakepkg.blake2bHex(JSON.stringify(payload))
|
|
45
40
|
}
|
|
46
41
|
|
|
47
|
-
export function isPresentationDefinitionEqual(base:
|
|
42
|
+
export function isPresentationDefinitionEqual(base: PartialPresentationDefinitionItem, compare: PartialPresentationDefinitionItem): boolean {
|
|
48
43
|
if (
|
|
49
|
-
base.
|
|
50
|
-
base.tenantId
|
|
44
|
+
base.definitionId !== compare.definitionId ||
|
|
45
|
+
base.tenantId != compare.tenantId ||
|
|
51
46
|
base.version !== compare.version ||
|
|
52
|
-
base.name
|
|
53
|
-
base.purpose
|
|
47
|
+
base.name != compare.name ||
|
|
48
|
+
base.purpose != compare.purpose
|
|
54
49
|
) {
|
|
55
50
|
return false
|
|
56
51
|
}
|
|
57
52
|
|
|
58
|
-
if (base.
|
|
59
|
-
|
|
60
|
-
return false
|
|
61
|
-
}
|
|
62
|
-
} else if (base.query || compare.query) {
|
|
63
|
-
return false
|
|
53
|
+
if (base.definitionPayload && compare.definitionPayload) {
|
|
54
|
+
return hashPayload(base.definitionPayload) === hashPayload(compare.definitionPayload)
|
|
64
55
|
}
|
|
65
56
|
|
|
66
|
-
return
|
|
57
|
+
return false
|
|
67
58
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { IBitstringStatusListEntity, IOAuthStatusListEntity, IStatusList2021Entity, IStatusListEntity } from '../../types'
|
|
2
|
-
import { StatusListType } from '@sphereon/ssi-types'
|
|
3
2
|
import {
|
|
4
3
|
BitstringStatusListEntity,
|
|
5
4
|
OAuthStatusListEntity,
|
|
6
5
|
StatusList2021Entity,
|
|
7
6
|
StatusListEntity,
|
|
8
7
|
} from '../../entities/statusList/StatusListEntities'
|
|
8
|
+
import { StatusListType } from '@sphereon/ssi-types'
|
|
9
9
|
import { replaceNullWithUndefined } from '../FormattingUtils'
|
|
10
10
|
|
|
11
11
|
export const statusListEntityFrom = (args: IStatusListEntity): StatusListEntity => {
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import Debug from 'debug'
|
|
2
|
-
import { DatabaseType, MigrationInterface, QueryRunner } from 'typeorm'
|
|
3
|
-
|
|
4
|
-
import { CreateDcqlQueryItemPG1726588800000 } from '../postgres/1726588800000-CreateDcqlQueryItem'
|
|
5
|
-
import { CreateDcqlQueryItemSQlite1726617600000 } from '../sqlite/1726617600000-CreateDcqlQueryItem'
|
|
6
|
-
|
|
7
|
-
const debug: Debug.Debugger = Debug('sphereon:ssi-sdk:migrations')
|
|
8
|
-
|
|
9
|
-
export class CreateDcqlQueryItem1726617600000 implements MigrationInterface {
|
|
10
|
-
name = 'CreateDcqlQueryItem1726617600000'
|
|
11
|
-
|
|
12
|
-
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
13
|
-
debug('migration: updating presentation definition item nullable fields')
|
|
14
|
-
const dbType: DatabaseType = queryRunner.connection.driver.options.type
|
|
15
|
-
|
|
16
|
-
switch (dbType) {
|
|
17
|
-
case 'postgres': {
|
|
18
|
-
debug('using postgres migration file')
|
|
19
|
-
const mig: CreateDcqlQueryItemPG1726588800000 = new CreateDcqlQueryItemPG1726588800000()
|
|
20
|
-
await mig.up(queryRunner)
|
|
21
|
-
debug('Migration statements executed')
|
|
22
|
-
return
|
|
23
|
-
}
|
|
24
|
-
case 'sqlite':
|
|
25
|
-
case 'expo':
|
|
26
|
-
case 'react-native': {
|
|
27
|
-
debug('using sqlite/react-native migration file')
|
|
28
|
-
const mig: CreateDcqlQueryItemSQlite1726617600000 = new CreateDcqlQueryItemSQlite1726617600000()
|
|
29
|
-
await mig.up(queryRunner)
|
|
30
|
-
debug('Migration statements executed')
|
|
31
|
-
return
|
|
32
|
-
}
|
|
33
|
-
default:
|
|
34
|
-
return Promise.reject(
|
|
35
|
-
`Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`,
|
|
36
|
-
)
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
41
|
-
debug('migration: reverting presentation definition item nullable fields')
|
|
42
|
-
const dbType: DatabaseType = queryRunner.connection.driver.options.type
|
|
43
|
-
|
|
44
|
-
switch (dbType) {
|
|
45
|
-
case 'postgres': {
|
|
46
|
-
debug('using postgres migration file')
|
|
47
|
-
const mig: CreateDcqlQueryItemPG1726588800000 = new CreateDcqlQueryItemPG1726588800000()
|
|
48
|
-
await mig.down(queryRunner)
|
|
49
|
-
debug('Migration statements executed')
|
|
50
|
-
return
|
|
51
|
-
}
|
|
52
|
-
case 'sqlite':
|
|
53
|
-
case 'expo':
|
|
54
|
-
case 'react-native': {
|
|
55
|
-
debug('using sqlite/react-native migration file')
|
|
56
|
-
const mig: CreateDcqlQueryItemSQlite1726617600000 = new CreateDcqlQueryItemSQlite1726617600000()
|
|
57
|
-
await mig.down(queryRunner)
|
|
58
|
-
debug('Migration statements executed')
|
|
59
|
-
return
|
|
60
|
-
}
|
|
61
|
-
default:
|
|
62
|
-
return Promise.reject(
|
|
63
|
-
`Migrations are currently only supported for sqlite, react-native, expo and postgres. Was ${dbType}. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now`,
|
|
64
|
-
)
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
-
|
|
3
|
-
export class CreateDcqlQueryItemPG1726588800000 implements MigrationInterface {
|
|
4
|
-
name = 'CreateDcqlQueryItemPG1726588800000'
|
|
5
|
-
|
|
6
|
-
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
-
await queryRunner.query(`
|
|
8
|
-
CREATE TABLE "DcqlQueryItem" (
|
|
9
|
-
"id" uuid NOT NULL DEFAULT uuid_generate_v4(),
|
|
10
|
-
"tenant_id" TEXT,
|
|
11
|
-
"query_id" TEXT NOT NULL,
|
|
12
|
-
"name" TEXT,
|
|
13
|
-
"version" TEXT NOT NULL,
|
|
14
|
-
"purpose" TEXT,
|
|
15
|
-
"query" TEXT NOT NULL,
|
|
16
|
-
"created_at" TIMESTAMP NOT NULL DEFAULT now(),
|
|
17
|
-
"last_updated_at" TIMESTAMP NOT NULL DEFAULT now(),
|
|
18
|
-
CONSTRAINT "PK_DcqlQueryItem_id" PRIMARY KEY ("id"))
|
|
19
|
-
`)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
23
|
-
await queryRunner.query(`DROP TABLE "DcqlQueryItem"`)
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
-
|
|
3
|
-
export class CreateDcqlQueryItemSQlite1726617600000 implements MigrationInterface {
|
|
4
|
-
name = 'CreateDcqlQueryItemSQlite1726617600000'
|
|
5
|
-
|
|
6
|
-
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
-
await queryRunner.query(
|
|
8
|
-
`CREATE TABLE "DcqlQueryItem" (
|
|
9
|
-
"id" varchar PRIMARY KEY NOT NULL,
|
|
10
|
-
"tenant_id" varchar,
|
|
11
|
-
"query_id" varchar NOT NULL,
|
|
12
|
-
"name" varchar,
|
|
13
|
-
"version" varchar NOT NULL,
|
|
14
|
-
"purpose" varchar,
|
|
15
|
-
"query" 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 "DcqlQueryItem"`)
|
|
23
|
-
}
|
|
24
|
-
}
|