@sphereon/ssi-sdk.data-store 0.11.1-next.106
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 -0
- package/README.md +72 -0
- package/dist/contact/AbstractContactStore.d.ts +14 -0
- package/dist/contact/AbstractContactStore.d.ts.map +1 -0
- package/dist/contact/AbstractContactStore.js +7 -0
- package/dist/contact/AbstractContactStore.js.map +1 -0
- package/dist/contact/ContactStore.d.ts +29 -0
- package/dist/contact/ContactStore.d.ts.map +1 -0
- package/dist/contact/ContactStore.js +281 -0
- package/dist/contact/ContactStore.js.map +1 -0
- package/dist/entities/contact/BaseConfigEntity.d.ts +5 -0
- package/dist/entities/contact/BaseConfigEntity.d.ts.map +1 -0
- package/dist/entities/contact/BaseConfigEntity.js +26 -0
- package/dist/entities/contact/BaseConfigEntity.js.map +1 -0
- package/dist/entities/contact/ConnectionEntity.d.ts +12 -0
- package/dist/entities/contact/ConnectionEntity.d.ts.map +1 -0
- package/dist/entities/contact/ConnectionEntity.js +66 -0
- package/dist/entities/contact/ConnectionEntity.js.map +1 -0
- package/dist/entities/contact/ContactEntity.d.ts +16 -0
- package/dist/entities/contact/ContactEntity.d.ts.map +1 -0
- package/dist/entities/contact/ContactEntity.js +105 -0
- package/dist/entities/contact/ContactEntity.js.map +1 -0
- package/dist/entities/contact/CorrelationIdentifierEntity.d.ts +12 -0
- package/dist/entities/contact/CorrelationIdentifierEntity.d.ts.map +1 -0
- package/dist/entities/contact/CorrelationIdentifierEntity.js +75 -0
- package/dist/entities/contact/CorrelationIdentifierEntity.js.map +1 -0
- package/dist/entities/contact/DidAuthConfigEntity.d.ts +11 -0
- package/dist/entities/contact/DidAuthConfigEntity.d.ts.map +1 -0
- package/dist/entities/contact/DidAuthConfigEntity.js +49 -0
- package/dist/entities/contact/DidAuthConfigEntity.js.map +1 -0
- package/dist/entities/contact/IdentityEntity.d.ts +22 -0
- package/dist/entities/contact/IdentityEntity.d.ts.map +1 -0
- package/dist/entities/contact/IdentityEntity.js +134 -0
- package/dist/entities/contact/IdentityEntity.js.map +1 -0
- package/dist/entities/contact/IdentityMetadataItemEntity.d.ts +12 -0
- package/dist/entities/contact/IdentityMetadataItemEntity.d.ts.map +1 -0
- package/dist/entities/contact/IdentityMetadataItemEntity.js +72 -0
- package/dist/entities/contact/IdentityMetadataItemEntity.js.map +1 -0
- package/dist/entities/contact/OpenIdConfigEntity.d.ts +15 -0
- package/dist/entities/contact/OpenIdConfigEntity.d.ts.map +1 -0
- package/dist/entities/contact/OpenIdConfigEntity.js +70 -0
- package/dist/entities/contact/OpenIdConfigEntity.js.map +1 -0
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.d.ts +11 -0
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.d.ts.map +1 -0
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.js +74 -0
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.js.map +1 -0
- package/dist/entities/issuanceBranding/BaseLocaleBrandingEntity.d.ts +18 -0
- package/dist/entities/issuanceBranding/BaseLocaleBrandingEntity.d.ts.map +1 -0
- package/dist/entities/issuanceBranding/BaseLocaleBrandingEntity.js +120 -0
- package/dist/entities/issuanceBranding/BaseLocaleBrandingEntity.js.map +1 -0
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.d.ts +15 -0
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.d.ts.map +1 -0
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.js +102 -0
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.js.map +1 -0
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.d.ts +9 -0
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.d.ts.map +1 -0
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.js +49 -0
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.js.map +1 -0
- package/dist/entities/issuanceBranding/ImageAttributesEntity.d.ts +14 -0
- package/dist/entities/issuanceBranding/ImageAttributesEntity.d.ts.map +1 -0
- package/dist/entities/issuanceBranding/ImageAttributesEntity.js +92 -0
- package/dist/entities/issuanceBranding/ImageAttributesEntity.js.map +1 -0
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.d.ts +9 -0
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.d.ts.map +1 -0
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.js +39 -0
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.js.map +1 -0
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.d.ts +14 -0
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.d.ts.map +1 -0
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.js +95 -0
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.js.map +1 -0
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.d.ts +9 -0
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.d.ts.map +1 -0
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.js +49 -0
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.js.map +1 -0
- package/dist/entities/issuanceBranding/TextAttributesEntity.d.ts +9 -0
- package/dist/entities/issuanceBranding/TextAttributesEntity.d.ts.map +1 -0
- package/dist/entities/issuanceBranding/TextAttributesEntity.js +62 -0
- package/dist/entities/issuanceBranding/TextAttributesEntity.js.map +1 -0
- package/dist/entities/validators/index.d.ts +7 -0
- package/dist/entities/validators/index.d.ts.map +1 -0
- package/dist/entities/validators/index.js +27 -0
- package/dist/entities/validators/index.js.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +99 -0
- package/dist/index.js.map +1 -0
- package/dist/issuanceBranding/AbstractIssuanceBrandingStore.d.ts +20 -0
- package/dist/issuanceBranding/AbstractIssuanceBrandingStore.d.ts.map +1 -0
- package/dist/issuanceBranding/AbstractIssuanceBrandingStore.js +7 -0
- package/dist/issuanceBranding/AbstractIssuanceBrandingStore.js.map +1 -0
- package/dist/issuanceBranding/IssuanceBrandingStore.d.ts +31 -0
- package/dist/issuanceBranding/IssuanceBrandingStore.d.ts.map +1 -0
- package/dist/issuanceBranding/IssuanceBrandingStore.js +375 -0
- package/dist/issuanceBranding/IssuanceBrandingStore.js.map +1 -0
- package/dist/migrations/generic/1-CreateContacts.d.ts +7 -0
- package/dist/migrations/generic/1-CreateContacts.d.ts.map +1 -0
- package/dist/migrations/generic/1-CreateContacts.js +72 -0
- package/dist/migrations/generic/1-CreateContacts.js.map +1 -0
- package/dist/migrations/generic/1-CreateIssuanceBranding.d.ts +7 -0
- package/dist/migrations/generic/1-CreateIssuanceBranding.d.ts.map +1 -0
- package/dist/migrations/generic/1-CreateIssuanceBranding.js +72 -0
- package/dist/migrations/generic/1-CreateIssuanceBranding.js.map +1 -0
- package/dist/migrations/generic/index.d.ts +10 -0
- package/dist/migrations/generic/index.d.ts.map +1 -0
- package/dist/migrations/generic/index.js +14 -0
- package/dist/migrations/generic/index.js.map +1 -0
- package/dist/migrations/index.d.ts +2 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/index.js +6 -0
- package/dist/migrations/index.js.map +1 -0
- package/dist/migrations/internal-migrations-ormconfig.d.ts +6 -0
- package/dist/migrations/internal-migrations-ormconfig.d.ts.map +1 -0
- package/dist/migrations/internal-migrations-ormconfig.js +29 -0
- package/dist/migrations/internal-migrations-ormconfig.js.map +1 -0
- package/dist/migrations/postgres/1659463079428-CreateContacts.d.ts +7 -0
- package/dist/migrations/postgres/1659463079428-CreateContacts.d.ts.map +1 -0
- package/dist/migrations/postgres/1659463079428-CreateContacts.js +55 -0
- package/dist/migrations/postgres/1659463079428-CreateContacts.js.map +1 -0
- package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.d.ts +7 -0
- package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.d.ts.map +1 -0
- package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.js +67 -0
- package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.js.map +1 -0
- package/dist/migrations/sqlite/1659463069549-CreateContacts.d.ts +7 -0
- package/dist/migrations/sqlite/1659463069549-CreateContacts.d.ts.map +1 -0
- package/dist/migrations/sqlite/1659463069549-CreateContacts.js +79 -0
- package/dist/migrations/sqlite/1659463069549-CreateContacts.js.map +1 -0
- package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.d.ts +7 -0
- package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.d.ts.map +1 -0
- package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.js +89 -0
- package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.js.map +1 -0
- package/dist/types/contact/IAbstractContactStore.d.ts +41 -0
- package/dist/types/contact/IAbstractContactStore.d.ts.map +1 -0
- package/dist/types/contact/IAbstractContactStore.js +3 -0
- package/dist/types/contact/IAbstractContactStore.js.map +1 -0
- package/dist/types/contact/contact.d.ts +91 -0
- package/dist/types/contact/contact.d.ts.map +1 -0
- package/dist/types/contact/contact.js +21 -0
- package/dist/types/contact/contact.js.map +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +21 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/issuanceBranding/IAbstractIssuanceBrandingStore.d.ts +59 -0
- package/dist/types/issuanceBranding/IAbstractIssuanceBrandingStore.d.ts.map +1 -0
- package/dist/types/issuanceBranding/IAbstractIssuanceBrandingStore.js +3 -0
- package/dist/types/issuanceBranding/IAbstractIssuanceBrandingStore.js.map +1 -0
- package/dist/types/issuanceBranding/issuanceBranding.d.ts +115 -0
- package/dist/types/issuanceBranding/issuanceBranding.d.ts.map +1 -0
- package/dist/types/issuanceBranding/issuanceBranding.js +3 -0
- package/dist/types/issuanceBranding/issuanceBranding.js.map +1 -0
- package/package.json +45 -0
- package/src/__tests__/contact.entities.test.ts +911 -0
- package/src/__tests__/contact.store.test.ts +743 -0
- package/src/__tests__/issuanceBranding.entities.test.ts +844 -0
- package/src/__tests__/issuanceBranding.store.test.ts +1884 -0
- package/src/contact/AbstractContactStore.ts +27 -0
- package/src/contact/ContactStore.ts +371 -0
- package/src/entities/contact/BaseConfigEntity.ts +8 -0
- package/src/entities/contact/ConnectionEntity.ts +48 -0
- package/src/entities/contact/ContactEntity.ts +74 -0
- package/src/entities/contact/CorrelationIdentifierEntity.ts +41 -0
- package/src/entities/contact/DidAuthConfigEntity.ts +31 -0
- package/src/entities/contact/IdentityEntity.ts +104 -0
- package/src/entities/contact/IdentityMetadataItemEntity.ts +39 -0
- package/src/entities/contact/OpenIdConfigEntity.ts +48 -0
- package/src/entities/issuanceBranding/BackgroundAttributesEntity.ts +42 -0
- package/src/entities/issuanceBranding/BaseLocaleBrandingEntity.ts +86 -0
- package/src/entities/issuanceBranding/CredentialBrandingEntity.ts +78 -0
- package/src/entities/issuanceBranding/CredentialLocaleBrandingEntity.ts +33 -0
- package/src/entities/issuanceBranding/ImageAttributesEntity.ts +57 -0
- package/src/entities/issuanceBranding/ImageDimensionsEntity.ts +22 -0
- package/src/entities/issuanceBranding/IssuerBrandingEntity.ts +72 -0
- package/src/entities/issuanceBranding/IssuerLocaleBrandingEntity.ts +33 -0
- package/src/entities/issuanceBranding/TextAttributesEntity.ts +31 -0
- package/src/entities/validators/index.ts +16 -0
- package/src/index.ts +82 -0
- package/src/issuanceBranding/AbstractIssuanceBrandingStore.ts +41 -0
- package/src/issuanceBranding/IssuanceBrandingStore.ts +544 -0
- package/src/migrations/generic/1-CreateContacts.ts +54 -0
- package/src/migrations/generic/1-CreateIssuanceBranding.ts +54 -0
- package/src/migrations/generic/index.ts +11 -0
- package/src/migrations/index.ts +1 -0
- package/src/migrations/internal-migrations-ormconfig.ts +28 -0
- package/src/migrations/postgres/1659463079428-CreateContacts.ts +61 -0
- package/src/migrations/postgres/1685628974232-CreateIssuanceBranding.ts +83 -0
- package/src/migrations/sqlite/1659463069549-CreateContacts.ts +110 -0
- package/src/migrations/sqlite/1685628973231-CreateIssuanceBranding.ts +119 -0
- package/src/types/contact/IAbstractContactStore.ts +52 -0
- package/src/types/contact/contact.ts +101 -0
- package/src/types/index.ts +4 -0
- package/src/types/issuanceBranding/IAbstractIssuanceBrandingStore.ts +85 -0
- package/src/types/issuanceBranding/issuanceBranding.ts +120 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
+
import Debug from 'debug'
|
|
3
|
+
import { CreateContacts1659463079428 } from '../postgres/1659463079428-CreateContacts'
|
|
4
|
+
import { CreateContacts1659463069549 } from '../sqlite/1659463069549-CreateContacts'
|
|
5
|
+
|
|
6
|
+
const debug = Debug('sphereon:ssi-sdk:migrations')
|
|
7
|
+
|
|
8
|
+
export class CreateContacts1659463079429 implements MigrationInterface {
|
|
9
|
+
name = 'CreateContacts1659463079429'
|
|
10
|
+
|
|
11
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
12
|
+
debug('migration: creating contacts tables')
|
|
13
|
+
const dbType = queryRunner.connection.driver.options.type
|
|
14
|
+
if (dbType === 'postgres') {
|
|
15
|
+
debug('using postgres migration file')
|
|
16
|
+
const mig = new CreateContacts1659463079428()
|
|
17
|
+
const up = await mig.up(queryRunner)
|
|
18
|
+
debug('Migration statements executed')
|
|
19
|
+
return up
|
|
20
|
+
} else if (dbType === 'sqlite' || 'react-native') {
|
|
21
|
+
debug('using sqlite/react-native migration file')
|
|
22
|
+
const mig = new CreateContacts1659463069549()
|
|
23
|
+
const up = await mig.up(queryRunner)
|
|
24
|
+
debug('Migration statements executed')
|
|
25
|
+
return up
|
|
26
|
+
} else {
|
|
27
|
+
return Promise.reject(
|
|
28
|
+
"Migrations are currently only supported for sqlite, react-native and postgres. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now"
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
34
|
+
debug('migration: reverting contacts tables')
|
|
35
|
+
const dbType = queryRunner.connection.driver.options.type
|
|
36
|
+
if (dbType === 'postgres') {
|
|
37
|
+
debug('using postgres migration file')
|
|
38
|
+
const mig = new CreateContacts1659463079428()
|
|
39
|
+
const down = await mig.down(queryRunner)
|
|
40
|
+
debug('Migration statements executed')
|
|
41
|
+
return down
|
|
42
|
+
} else if (dbType === 'sqlite' || 'react-native') {
|
|
43
|
+
debug('using sqlite/react-native migration file')
|
|
44
|
+
const mig = new CreateContacts1659463069549()
|
|
45
|
+
const down = await mig.down(queryRunner)
|
|
46
|
+
debug('Migration statements executed')
|
|
47
|
+
return down
|
|
48
|
+
} else {
|
|
49
|
+
return Promise.reject(
|
|
50
|
+
"Migrations are currently only supported for sqlite, react-native and postgres. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now"
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
+
import Debug from 'debug'
|
|
3
|
+
import { CreateIssuanceBranding1685628974232 } from '../postgres/1685628974232-CreateIssuanceBranding'
|
|
4
|
+
import { CreateIssuanceBranding1685628973231 } from '../sqlite/1685628973231-CreateIssuanceBranding'
|
|
5
|
+
|
|
6
|
+
const debug = Debug('sphereon:ssi-sdk:migrations')
|
|
7
|
+
|
|
8
|
+
export class CreateIssuanceBranding1659463079429 implements MigrationInterface {
|
|
9
|
+
name = 'CreateIssuanceBranding1659463079429'
|
|
10
|
+
|
|
11
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
12
|
+
debug('migration: creating issuance branding tables')
|
|
13
|
+
const dbType = queryRunner.connection.driver.options.type
|
|
14
|
+
if (dbType === 'postgres') {
|
|
15
|
+
debug('using postgres migration file')
|
|
16
|
+
const mig = new CreateIssuanceBranding1685628974232()
|
|
17
|
+
const up = await mig.up(queryRunner)
|
|
18
|
+
debug('Migration statements executed')
|
|
19
|
+
return up
|
|
20
|
+
} else if (dbType === 'sqlite' || 'react-native') {
|
|
21
|
+
debug('using sqlite/react-native migration file')
|
|
22
|
+
const mig = new CreateIssuanceBranding1685628973231()
|
|
23
|
+
const up = await mig.up(queryRunner)
|
|
24
|
+
debug('Migration statements executed')
|
|
25
|
+
return up
|
|
26
|
+
} else {
|
|
27
|
+
return Promise.reject(
|
|
28
|
+
"Migrations are currently only supported for sqlite, react-native and postgres. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now"
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
34
|
+
debug('migration: reverting issuance branding tables')
|
|
35
|
+
const dbType = queryRunner.connection.driver.options.type
|
|
36
|
+
if (dbType === 'postgres') {
|
|
37
|
+
debug('using postgres migration file')
|
|
38
|
+
const mig = new CreateIssuanceBranding1685628974232()
|
|
39
|
+
const down = await mig.down(queryRunner)
|
|
40
|
+
debug('Migration statements executed')
|
|
41
|
+
return down
|
|
42
|
+
} else if (dbType === 'sqlite' || 'react-native') {
|
|
43
|
+
debug('using sqlite/react-native migration file')
|
|
44
|
+
const mig = new CreateIssuanceBranding1685628973231()
|
|
45
|
+
const down = await mig.down(queryRunner)
|
|
46
|
+
debug('Migration statements executed')
|
|
47
|
+
return down
|
|
48
|
+
} else {
|
|
49
|
+
return Promise.reject(
|
|
50
|
+
"Migrations are currently only supported for sqlite, react-native and postgres. Please run your database without migrations and with 'migrationsRun: false' and 'synchronize: true' for now"
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CreateContacts1659463079429 } from './1-CreateContacts'
|
|
2
|
+
import { CreateIssuanceBranding1659463079429 } from './1-CreateIssuanceBranding'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The migrations array that SHOULD be used when initializing a TypeORM database connection.
|
|
6
|
+
*
|
|
7
|
+
* These ensure the correct creation of tables and the proper migrations of data when tables change between versions.
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export const DataStoreMigrations = [CreateContacts1659463079429, CreateIssuanceBranding1659463079429]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DataStoreMigrations } from './generic'
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ConnectionOptions } from 'typeorm'
|
|
2
|
+
import { DataStoreContactEntities, DataStoreMigrations } from '../index'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Do Not use these connections in production!. They are only here to create/test migration files!
|
|
6
|
+
*/
|
|
7
|
+
export default [
|
|
8
|
+
{
|
|
9
|
+
type: 'sqlite',
|
|
10
|
+
name: 'migration-sqlite',
|
|
11
|
+
database: 'migration.sqlite',
|
|
12
|
+
migrationsRun: false,
|
|
13
|
+
synchronize: false,
|
|
14
|
+
logging: ['error', 'info', 'warn', 'log'],
|
|
15
|
+
entities: [...DataStoreContactEntities],
|
|
16
|
+
migrations: [...DataStoreMigrations],
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
type: 'postgres',
|
|
20
|
+
name: 'migration-postgres',
|
|
21
|
+
database: 'migration-postgres',
|
|
22
|
+
migrationsRun: false,
|
|
23
|
+
synchronize: false,
|
|
24
|
+
logging: ['error', 'info', 'warn', 'log'],
|
|
25
|
+
entities: [...DataStoreContactEntities],
|
|
26
|
+
migrations: [...DataStoreMigrations],
|
|
27
|
+
},
|
|
28
|
+
] as ConnectionOptions[]
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
+
|
|
3
|
+
export class CreateContacts1659463079428 implements MigrationInterface {
|
|
4
|
+
name = 'CreateContacts1659463079428'
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(
|
|
8
|
+
`CREATE TABLE "BaseConfigEntity" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "client_id" character varying(255), "client_secret" character varying(255), "scopes" text, "issuer" character varying(255), "redirect_url" text, "dangerously_allow_insecure_http_requests" boolean, "client_auth_method" text, "identifier" character varying(255), "session_id" character varying(255), "type" character varying NOT NULL, "connectionId" uuid, CONSTRAINT "REL_BaseConfig_connectionId" UNIQUE ("connectionId"), CONSTRAINT "PK_BaseConfigEntity_id" PRIMARY KEY ("id"))`
|
|
9
|
+
)
|
|
10
|
+
await queryRunner.query(`CREATE INDEX "IDX_BaseConfigEntity_type" ON "BaseConfigEntity" ("type")`)
|
|
11
|
+
await queryRunner.query(`CREATE TYPE "public"."CorrelationIdentifier_type_enum" AS ENUM('did', 'url')`)
|
|
12
|
+
await queryRunner.query(
|
|
13
|
+
`CREATE TABLE "CorrelationIdentifier" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "type" "public"."CorrelationIdentifier_type_enum" NOT NULL, "correlation_id" text NOT NULL, "identityId" uuid, CONSTRAINT "UQ_Correlation_id" UNIQUE ("correlation_id"), CONSTRAINT "REL_CorrelationIdentifier_identityId" UNIQUE ("identityId"), CONSTRAINT "PK_CorrelationIdentifier_id" PRIMARY KEY ("id"))`
|
|
14
|
+
)
|
|
15
|
+
await queryRunner.query(
|
|
16
|
+
`CREATE TABLE "Contact" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "name" character varying(255) NOT NULL, "alias" character varying(255) NOT NULL, "uri" character varying(255) NOT NULL, "created_at" TIMESTAMP NOT NULL DEFAULT now(), "last_updated_at" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "UQ_Name" UNIQUE ("name"), CONSTRAINT "UQ_Alias" UNIQUE ("alias"), CONSTRAINT "PK_Contact_id" PRIMARY KEY ("id"))`
|
|
17
|
+
)
|
|
18
|
+
await queryRunner.query(
|
|
19
|
+
`CREATE TABLE "IdentityMetadata" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "label" character varying(255) NOT NULL, "value" character varying(255) NOT NULL, "identityId" uuid, CONSTRAINT "PK_IdentityMetadata_id" PRIMARY KEY ("id"))`
|
|
20
|
+
)
|
|
21
|
+
await queryRunner.query(
|
|
22
|
+
`CREATE TABLE "Identity" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "alias" character varying(255) NOT NULL, "roles" text, "created_at" TIMESTAMP NOT NULL DEFAULT now(), "last_updated_at" TIMESTAMP NOT NULL DEFAULT now(), "contactId" uuid, CONSTRAINT "UQ_Alias" UNIQUE ("alias"), CONSTRAINT "PK_Identity_id" PRIMARY KEY ("id"))`
|
|
23
|
+
)
|
|
24
|
+
await queryRunner.query(`CREATE TYPE "public"."Connection_type_enum" AS ENUM('OIDC', 'SIOPv2', 'SIOPv2+OpenID4VP')`)
|
|
25
|
+
await queryRunner.query(
|
|
26
|
+
`CREATE TABLE "Connection" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "type" "public"."Connection_type_enum" NOT NULL, "identityId" uuid, CONSTRAINT "REL_Connection_identityId" UNIQUE ("identityId"), CONSTRAINT "PK_Connection_id" PRIMARY KEY ("id"))`
|
|
27
|
+
)
|
|
28
|
+
await queryRunner.query(
|
|
29
|
+
`ALTER TABLE "BaseConfigEntity" ADD CONSTRAINT "FK_BaseConfig_connectionId" FOREIGN KEY ("connectionId") REFERENCES "Connection"("id") ON DELETE CASCADE ON UPDATE NO ACTION`
|
|
30
|
+
)
|
|
31
|
+
await queryRunner.query(
|
|
32
|
+
`ALTER TABLE "CorrelationIdentifier" ADD CONSTRAINT "FK_CorrelationIdentifier_identityId" FOREIGN KEY ("identityId") REFERENCES "Identity"("id") ON DELETE CASCADE ON UPDATE NO ACTION`
|
|
33
|
+
)
|
|
34
|
+
await queryRunner.query(
|
|
35
|
+
`ALTER TABLE "IdentityMetadata" ADD CONSTRAINT "FK_IdentityMetadata_identityId" FOREIGN KEY ("identityId") REFERENCES "Identity"("id") ON DELETE CASCADE ON UPDATE NO ACTION`
|
|
36
|
+
)
|
|
37
|
+
await queryRunner.query(
|
|
38
|
+
`ALTER TABLE "Identity" ADD CONSTRAINT "FK_Identity_contactId" FOREIGN KEY ("contactId") REFERENCES "Contact"("id") ON DELETE CASCADE ON UPDATE NO ACTION`
|
|
39
|
+
)
|
|
40
|
+
await queryRunner.query(
|
|
41
|
+
`ALTER TABLE "Connection" ADD CONSTRAINT "FK_Connection_identityId" FOREIGN KEY ("identityId") REFERENCES "Identity"("id") ON DELETE CASCADE ON UPDATE NO ACTION`
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
46
|
+
await queryRunner.query(`ALTER TABLE "Connection" DROP CONSTRAINT "FK_Connection_identityId"`)
|
|
47
|
+
await queryRunner.query(`ALTER TABLE "Identity" DROP CONSTRAINT "FK_Identity_contactId"`)
|
|
48
|
+
await queryRunner.query(`ALTER TABLE "IdentityMetadata" DROP CONSTRAINT "FK_IdentityMetadata_identityId"`)
|
|
49
|
+
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" DROP CONSTRAINT "FK_CorrelationIdentifier_identityId"`)
|
|
50
|
+
await queryRunner.query(`ALTER TABLE "BaseConfigEntity" DROP CONSTRAINT "FK_BaseConfig_connectionId"`)
|
|
51
|
+
await queryRunner.query(`DROP TABLE "Connection"`)
|
|
52
|
+
await queryRunner.query(`DROP TYPE "public"."Connection_type_enum"`)
|
|
53
|
+
await queryRunner.query(`DROP TABLE "Identity"`)
|
|
54
|
+
await queryRunner.query(`DROP TABLE "IdentityMetadata"`)
|
|
55
|
+
await queryRunner.query(`DROP TABLE "Contact"`)
|
|
56
|
+
await queryRunner.query(`DROP TABLE "CorrelationIdentifier"`)
|
|
57
|
+
await queryRunner.query(`DROP TYPE "public"."CorrelationIdentifier_type_enum"`)
|
|
58
|
+
await queryRunner.query(`DROP INDEX "public"."IDX_BaseConfigEntity_type"`)
|
|
59
|
+
await queryRunner.query(`DROP TABLE "BaseConfigEntity"`)
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
+
|
|
3
|
+
export class CreateIssuanceBranding1685628974232 implements MigrationInterface {
|
|
4
|
+
name = 'CreateIssuanceBranding1685628974232'
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(
|
|
8
|
+
`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"))`
|
|
9
|
+
)
|
|
10
|
+
await queryRunner.query(
|
|
11
|
+
`CREATE TABLE "ImageAttributes" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "uri" character varying(255), "dataUri" character varying(255), "mediaType" character varying(255), "alt" character varying(255), "dimensionsId" uuid, CONSTRAINT "UQ_dimensionsId" UNIQUE ("dimensionsId"), CONSTRAINT "PK_ImageAttributes_id" PRIMARY KEY ("id"))`
|
|
12
|
+
)
|
|
13
|
+
await queryRunner.query(
|
|
14
|
+
`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"))`
|
|
15
|
+
)
|
|
16
|
+
await queryRunner.query(
|
|
17
|
+
`CREATE TABLE "TextAttributes" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "color" character varying(255), CONSTRAINT "PK_TextAttributes_id" PRIMARY KEY ("id"))`
|
|
18
|
+
)
|
|
19
|
+
await queryRunner.query(
|
|
20
|
+
`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, CONSTRAINT "UQ_logoId" UNIQUE ("logoId"), CONSTRAINT "UQ_backgroundId" UNIQUE ("backgroundId"), CONSTRAINT "UQ_textId" UNIQUE ("textId"), CONSTRAINT "PK_BaseLocaleBranding_id" PRIMARY KEY ("id"))`
|
|
21
|
+
)
|
|
22
|
+
await queryRunner.query(
|
|
23
|
+
`CREATE UNIQUE INDEX "IDX_CredentialLocaleBrandingEntity_credentialBranding_locale" ON "BaseLocaleBranding" ("credentialBrandingId", "locale")`
|
|
24
|
+
)
|
|
25
|
+
await queryRunner.query(
|
|
26
|
+
`CREATE UNIQUE INDEX "IDX_IssuerLocaleBrandingEntity_issuerBranding_locale" ON "BaseLocaleBranding" ("issuerBrandingId", "locale")`
|
|
27
|
+
)
|
|
28
|
+
await queryRunner.query(`CREATE INDEX "IDX_BaseLocaleBranding_type" ON "BaseLocaleBranding" ("type")`)
|
|
29
|
+
await queryRunner.query(
|
|
30
|
+
`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"))`
|
|
31
|
+
)
|
|
32
|
+
await queryRunner.query(`CREATE INDEX "IDX_CredentialBrandingEntity_issuerCorrelationId" ON "CredentialBranding" ("issuerCorrelationId")`)
|
|
33
|
+
await queryRunner.query(`CREATE INDEX "IDX_CredentialBrandingEntity_vcHash" ON "CredentialBranding" ("vcHash")`)
|
|
34
|
+
await queryRunner.query(
|
|
35
|
+
`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"))`
|
|
36
|
+
)
|
|
37
|
+
await queryRunner.query(`CREATE INDEX "IDX_IssuerBrandingEntity_issuerCorrelationId" ON "IssuerBranding" ("issuerCorrelationId")`)
|
|
38
|
+
await queryRunner.query(
|
|
39
|
+
`ALTER TABLE "ImageAttributes" ADD CONSTRAINT "FK_ImageAttributes_dimensionsId" FOREIGN KEY ("dimensionsId") REFERENCES "ImageDimensions"("id") ON DELETE CASCADE ON UPDATE NO ACTION`
|
|
40
|
+
)
|
|
41
|
+
await queryRunner.query(
|
|
42
|
+
`ALTER TABLE "BackgroundAttributes" ADD CONSTRAINT "FK_BackgroundAttributes_imageId" FOREIGN KEY ("imageId") REFERENCES "ImageAttributes"("id") ON DELETE CASCADE ON UPDATE NO ACTION`
|
|
43
|
+
)
|
|
44
|
+
await queryRunner.query(
|
|
45
|
+
`ALTER TABLE "BaseLocaleBranding" ADD CONSTRAINT "FK_BaseLocaleBranding_logoId" FOREIGN KEY ("logoId") REFERENCES "ImageAttributes"("id") ON DELETE CASCADE ON UPDATE NO ACTION`
|
|
46
|
+
)
|
|
47
|
+
await queryRunner.query(
|
|
48
|
+
`ALTER TABLE "BaseLocaleBranding" ADD CONSTRAINT "FK_BaseLocaleBranding_backgroundId" FOREIGN KEY ("backgroundId") REFERENCES "BackgroundAttributes"("id") ON DELETE CASCADE ON UPDATE NO ACTION`
|
|
49
|
+
)
|
|
50
|
+
await queryRunner.query(
|
|
51
|
+
`ALTER TABLE "BaseLocaleBranding" ADD CONSTRAINT "FK_BaseLocaleBranding_textId" FOREIGN KEY ("textId") REFERENCES "TextAttributes"("id") ON DELETE CASCADE ON UPDATE NO ACTION`
|
|
52
|
+
)
|
|
53
|
+
await queryRunner.query(
|
|
54
|
+
`ALTER TABLE "BaseLocaleBranding" ADD CONSTRAINT "FK_BaseLocaleBranding_credentialBrandingId" FOREIGN KEY ("credentialBrandingId") REFERENCES "CredentialBranding"("id") ON DELETE CASCADE ON UPDATE NO ACTION`
|
|
55
|
+
)
|
|
56
|
+
await queryRunner.query(
|
|
57
|
+
`ALTER TABLE "BaseLocaleBranding" ADD CONSTRAINT "FK_BaseLocaleBranding_issuerBrandingId" FOREIGN KEY ("issuerBrandingId") REFERENCES "IssuerBranding"("id") ON DELETE CASCADE ON UPDATE NO ACTION`
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
62
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP CONSTRAINT "FK_BaseLocaleBranding_issuerBrandingId"`)
|
|
63
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP CONSTRAINT "FK_BaseLocaleBranding_credentialBrandingId"`)
|
|
64
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP CONSTRAINT "FK_BaseLocaleBranding_textId"`)
|
|
65
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP CONSTRAINT "FK_BaseLocaleBranding_backgroundId"`)
|
|
66
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP CONSTRAINT "FK_BaseLocaleBranding_logoId"`)
|
|
67
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP CONSTRAINT "FK_BackgroundAttributes_imageId"`)
|
|
68
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP CONSTRAINT "FK_ImageAttributes_dimensionsId"`)
|
|
69
|
+
await queryRunner.query(`ALTER TABLE "IssuerBranding" DROP INDEX "IDX_IssuerBrandingEntity_issuerCorrelationId"`)
|
|
70
|
+
await queryRunner.query(`DROP TABLE "IssuerBranding"`)
|
|
71
|
+
await queryRunner.query(`ALTER TABLE "CredentialBranding" DROP INDEX "IDX_CredentialBrandingEntity_vcHash"`)
|
|
72
|
+
await queryRunner.query(`ALTER TABLE "CredentialBranding" DROP INDEX "IDX_CredentialBrandingEntity_issuerCorrelationId"`)
|
|
73
|
+
await queryRunner.query(`DROP TABLE "CredentialBranding"`)
|
|
74
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP INDEX "IDX_BaseLocaleBranding_type"`)
|
|
75
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP INDEX "IDX_IssuerLocaleBrandingEntity_issuerBranding_locale"`)
|
|
76
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP INDEX "IDX_CredentialLocaleBrandingEntity_credentialBranding_locale"`)
|
|
77
|
+
await queryRunner.query(`DROP TABLE "BaseLocaleBranding"`)
|
|
78
|
+
await queryRunner.query(`DROP TABLE "TextAttributes"`)
|
|
79
|
+
await queryRunner.query(`DROP TABLE "BackgroundAttributes"`)
|
|
80
|
+
await queryRunner.query(`DROP TABLE "ImageAttributes"`)
|
|
81
|
+
await queryRunner.query(`DROP TABLE "ImageDimensions"`)
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
+
|
|
3
|
+
export class CreateContacts1659463069549 implements MigrationInterface {
|
|
4
|
+
name = 'CreateContacts1659463069549'
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(
|
|
8
|
+
`CREATE TABLE "BaseConfigEntity" ("id" varchar PRIMARY KEY NOT NULL, "client_id" varchar(255), "client_secret" varchar(255), "scopes" text, "issuer" varchar(255), "redirect_url" text, "dangerously_allow_insecure_http_requests" boolean, "client_auth_method" text, "identifier" varchar(255), "session_id" varchar(255), "type" varchar NOT NULL, "connectionId" varchar, CONSTRAINT "REL_BaseConfig_connectionId" UNIQUE ("connectionId"))`
|
|
9
|
+
)
|
|
10
|
+
await queryRunner.query(`CREATE INDEX "IDX_BaseConfigEntity_type" ON "BaseConfigEntity" ("type")`)
|
|
11
|
+
await queryRunner.query(
|
|
12
|
+
`CREATE TABLE "CorrelationIdentifier" ("id" varchar PRIMARY KEY NOT NULL, "type" varchar CHECK( "type" IN ('did','url') ) NOT NULL, "correlation_id" text NOT NULL, "identityId" varchar, CONSTRAINT "UQ_Correlation_id" UNIQUE ("correlation_id"), CONSTRAINT "REL_CorrelationIdentifier_identityId" UNIQUE ("identityId"))`
|
|
13
|
+
)
|
|
14
|
+
await queryRunner.query(
|
|
15
|
+
`CREATE TABLE "Contact" ("id" varchar PRIMARY KEY NOT NULL, "name" varchar(255) NOT NULL, "alias" varchar(255) NOT NULL, "uri" varchar(255) NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), CONSTRAINT "UQ_Name" UNIQUE ("name"), CONSTRAINT "UQ_Alias" UNIQUE ("alias"))`
|
|
16
|
+
)
|
|
17
|
+
await queryRunner.query(
|
|
18
|
+
`CREATE TABLE "IdentityMetadata" ("id" varchar PRIMARY KEY NOT NULL, "label" varchar(255) NOT NULL, "value" varchar(255) NOT NULL, "identityId" varchar)`
|
|
19
|
+
)
|
|
20
|
+
await queryRunner.query(
|
|
21
|
+
`CREATE TABLE "Identity" ("id" varchar PRIMARY KEY NOT NULL, "alias" varchar(255) NOT NULL, "roles" text, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "contactId" varchar, CONSTRAINT "UQ_Alias" UNIQUE ("alias"))`
|
|
22
|
+
)
|
|
23
|
+
await queryRunner.query(
|
|
24
|
+
`CREATE TABLE "Connection" ("id" varchar PRIMARY KEY NOT NULL, "type" varchar CHECK( "type" IN ('OIDC','SIOPv2','SIOPv2+OpenID4VP') ) NOT NULL, "identityId" varchar, CONSTRAINT "REL_Connection_identityId" UNIQUE ("identityId"))`
|
|
25
|
+
)
|
|
26
|
+
await queryRunner.query(`DROP INDEX "IDX_BaseConfigEntity_type"`)
|
|
27
|
+
await queryRunner.query(
|
|
28
|
+
`CREATE TABLE "temporary_BaseConfigEntity" ("id" varchar PRIMARY KEY NOT NULL, "client_id" varchar(255), "client_secret" varchar(255), "scopes" text, "issuer" varchar(255), "redirect_url" text, "dangerously_allow_insecure_http_requests" boolean, "client_auth_method" text, "identifier" varchar(255), "session_id" varchar(255), "type" varchar NOT NULL, "connectionId" varchar, CONSTRAINT "REL_BaseConfig_connectionId" UNIQUE ("connectionId"), CONSTRAINT "FK_BaseConfig_connectionId" FOREIGN KEY ("connectionId") REFERENCES "Connection" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`
|
|
29
|
+
)
|
|
30
|
+
await queryRunner.query(
|
|
31
|
+
`INSERT INTO "temporary_BaseConfigEntity"("id", "client_id", "client_secret", "scopes", "issuer", "redirect_url", "dangerously_allow_insecure_http_requests", "client_auth_method", "identifier", "session_id", "type", "connectionId") SELECT "id", "client_id", "client_secret", "scopes", "issuer", "redirect_url", "dangerously_allow_insecure_http_requests", "client_auth_method", "identifier", "session_id", "type", "connectionId" FROM "BaseConfigEntity"`
|
|
32
|
+
)
|
|
33
|
+
await queryRunner.query(`DROP TABLE "BaseConfigEntity"`)
|
|
34
|
+
await queryRunner.query(`ALTER TABLE "temporary_BaseConfigEntity" RENAME TO "BaseConfigEntity"`)
|
|
35
|
+
await queryRunner.query(`CREATE INDEX "IDX_BaseConfigEntity_type" ON "BaseConfigEntity" ("type")`)
|
|
36
|
+
await queryRunner.query(
|
|
37
|
+
`CREATE TABLE "temporary_CorrelationIdentifier" ("id" varchar PRIMARY KEY NOT NULL, "type" varchar CHECK( "type" IN ('did','url') ) NOT NULL, "correlation_id" text NOT NULL, "identityId" varchar, CONSTRAINT "UQ_Correlation_id" UNIQUE ("correlation_id"), CONSTRAINT "REL_CorrelationIdentifier_identityId" UNIQUE ("identityId"), CONSTRAINT "FK_CorrelationIdentifier_identityId" FOREIGN KEY ("identityId") REFERENCES "Identity" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`
|
|
38
|
+
)
|
|
39
|
+
await queryRunner.query(
|
|
40
|
+
`INSERT INTO "temporary_CorrelationIdentifier"("id", "type", "correlation_id", "identityId") SELECT "id", "type", "correlation_id", "identityId" FROM "CorrelationIdentifier"`
|
|
41
|
+
)
|
|
42
|
+
await queryRunner.query(`DROP TABLE "CorrelationIdentifier"`)
|
|
43
|
+
await queryRunner.query(`ALTER TABLE "temporary_CorrelationIdentifier" RENAME TO "CorrelationIdentifier"`)
|
|
44
|
+
await queryRunner.query(
|
|
45
|
+
`CREATE TABLE "temporary_IdentityMetadata" ("id" varchar PRIMARY KEY NOT NULL, "label" varchar(255) NOT NULL, "value" varchar(255) NOT NULL, "identityId" varchar, CONSTRAINT "FK_IdentityMetadata_identityId" FOREIGN KEY ("identityId") REFERENCES "Identity" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`
|
|
46
|
+
)
|
|
47
|
+
await queryRunner.query(
|
|
48
|
+
`INSERT INTO "temporary_IdentityMetadata"("id", "label", "value", "identityId") SELECT "id", "label", "value", "identityId" FROM "IdentityMetadata"`
|
|
49
|
+
)
|
|
50
|
+
await queryRunner.query(`DROP TABLE "IdentityMetadata"`)
|
|
51
|
+
await queryRunner.query(`ALTER TABLE "temporary_IdentityMetadata" RENAME TO "IdentityMetadata"`)
|
|
52
|
+
await queryRunner.query(
|
|
53
|
+
`CREATE TABLE "temporary_Identity" ("id" varchar PRIMARY KEY NOT NULL, "alias" varchar(255) NOT NULL, "roles" text, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "contactId" varchar, CONSTRAINT "UQ_Alias" UNIQUE ("alias"), CONSTRAINT "FK_Identity_contactId" FOREIGN KEY ("contactId") REFERENCES "Contact" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`
|
|
54
|
+
)
|
|
55
|
+
await queryRunner.query(
|
|
56
|
+
`INSERT INTO "temporary_Identity"("id", "alias", "roles", "created_at", "last_updated_at", "contactId") SELECT "id", "alias", "roles", "created_at", "last_updated_at", "contactId" FROM "Identity"`
|
|
57
|
+
)
|
|
58
|
+
await queryRunner.query(`DROP TABLE "Identity"`)
|
|
59
|
+
await queryRunner.query(`ALTER TABLE "temporary_Identity" RENAME TO "Identity"`)
|
|
60
|
+
await queryRunner.query(
|
|
61
|
+
`CREATE TABLE "temporary_Connection" ("id" varchar PRIMARY KEY NOT NULL, "type" varchar CHECK( "type" IN ('OIDC','SIOPv2','SIOPv2+OpenID4VP') ) NOT NULL, "identityId" varchar, CONSTRAINT "REL_Connection_identityId" UNIQUE ("identityId"), CONSTRAINT "FK_Connection_identityId" FOREIGN KEY ("identityId") REFERENCES "Identity" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`
|
|
62
|
+
)
|
|
63
|
+
await queryRunner.query(`INSERT INTO "temporary_Connection"("id", "type", "identityId") SELECT "id", "type", "identityId" FROM "Connection"`)
|
|
64
|
+
await queryRunner.query(`DROP TABLE "Connection"`)
|
|
65
|
+
await queryRunner.query(`ALTER TABLE "temporary_Connection" RENAME TO "Connection"`)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
69
|
+
await queryRunner.query(`ALTER TABLE "Connection" RENAME TO "temporary_Connection"`)
|
|
70
|
+
await queryRunner.query(
|
|
71
|
+
`CREATE TABLE "Connection" ("id" varchar PRIMARY KEY NOT NULL, "type" varchar CHECK( "type" IN ('OIDC','SIOPv2','SIOPv2+OpenID4VP') ) NOT NULL, "identityId" varchar, CONSTRAINT "REL_Connection_identityId" UNIQUE ("identityId"))`
|
|
72
|
+
)
|
|
73
|
+
await queryRunner.query(`INSERT INTO "Connection"("id", "type", "identityId") SELECT "id", "type", "identityId" FROM "Connection"`)
|
|
74
|
+
await queryRunner.query(`DROP TABLE "temporary_Connection"`)
|
|
75
|
+
|
|
76
|
+
await queryRunner.query(`ALTER TABLE "Identity" RENAME TO "temporary_Identity"`)
|
|
77
|
+
await queryRunner.query(
|
|
78
|
+
`CREATE TABLE "Identity" ("id" varchar PRIMARY KEY NOT NULL, "alias" varchar(255) NOT NULL, "roles" text, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "contactId" varchar, CONSTRAINT "UQ_Alias" UNIQUE ("alias"))`
|
|
79
|
+
)
|
|
80
|
+
await queryRunner.query(
|
|
81
|
+
`INSERT INTO "Identity"("id", "alias", "roles","created_at", "last_updated_at", "contactId") SELECT "id", "alias", "roles","created_at", "last_updated_at", "contactId" FROM "Identity"`
|
|
82
|
+
)
|
|
83
|
+
await queryRunner.query(`DROP TABLE "temporary_Identity"`)
|
|
84
|
+
|
|
85
|
+
await queryRunner.query(`ALTER TABLE "IdentityMetadata" RENAME TO "temporary_IdentityMetadata"`)
|
|
86
|
+
await queryRunner.query(
|
|
87
|
+
`CREATE TABLE "IdentityMetadata" ("id" varchar PRIMARY KEY NOT NULL, "label" varchar(255) NOT NULL, "value" varchar(255) NOT NULL, "identityId" varchar)`
|
|
88
|
+
)
|
|
89
|
+
await queryRunner.query(
|
|
90
|
+
`INSERT INTO "IdentityMetadata"("id", "label", "value", "identityId") SELECT "id", "label", "value", "identityId" FROM "IdentityMetadata"`
|
|
91
|
+
)
|
|
92
|
+
await queryRunner.query(`DROP TABLE "temporary_IdentityMetadata"`)
|
|
93
|
+
|
|
94
|
+
await queryRunner.query(`ALTER TABLE "CorrelationIdentifier" RENAME TO "temporary_CorrelationIdentifier"`)
|
|
95
|
+
await queryRunner.query(
|
|
96
|
+
`CREATE TABLE "CorrelationIdentifier" ("id" varchar PRIMARY KEY NOT NULL, "type" varchar CHECK( "type" IN ('did','url') ) NOT NULL, "correlation_id" text NOT NULL, "identityId" varchar, CONSTRAINT "UQ_Correlation_id" UNIQUE ("correlation_id"), CONSTRAINT "REL_CorrelationIdentifier_identityId" UNIQUE ("identityId"))`
|
|
97
|
+
)
|
|
98
|
+
await queryRunner.query(
|
|
99
|
+
`INSERT INTO "CorrelationIdentifier"("id", "type", "correlation_id", "identityId") SELECT "id", "type", "correlation_id", "identityId" FROM "CorrelationIdentifier"`
|
|
100
|
+
)
|
|
101
|
+
await queryRunner.query(`DROP TABLE "temporary_CorrelationIdentifier"`)
|
|
102
|
+
await queryRunner.query(`DROP TABLE "Connection"`)
|
|
103
|
+
await queryRunner.query(`DROP TABLE "Identity"`)
|
|
104
|
+
await queryRunner.query(`DROP TABLE "IdentityMetadata"`)
|
|
105
|
+
await queryRunner.query(`DROP TABLE "Contact"`)
|
|
106
|
+
await queryRunner.query(`DROP TABLE "CorrelationIdentifier"`)
|
|
107
|
+
await queryRunner.query(`DROP INDEX "IDX_BaseConfigEntity_type"`)
|
|
108
|
+
await queryRunner.query(`DROP TABLE "BaseConfigEntity"`)
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from 'typeorm'
|
|
2
|
+
|
|
3
|
+
export class CreateIssuanceBranding1685628973231 implements MigrationInterface {
|
|
4
|
+
name = 'CreateIssuanceBranding1685628973231'
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(`CREATE TABLE "ImageDimensions" ("id" varchar PRIMARY KEY NOT NULL, "width" integer NOT NULL, "height" integer NOT NULL)`)
|
|
8
|
+
await queryRunner.query(
|
|
9
|
+
`CREATE TABLE "ImageAttributes" ("id" varchar PRIMARY KEY NOT NULL, "uri" varchar(255), "dataUri" varchar(255), "mediaType" varchar(255), "alt" varchar(255), "dimensionsId" varchar, CONSTRAINT "UQ_dimensionsId" UNIQUE ("dimensionsId"))`
|
|
10
|
+
)
|
|
11
|
+
await queryRunner.query(
|
|
12
|
+
`CREATE TABLE "BackgroundAttributes" ("id" varchar PRIMARY KEY NOT NULL, "color" varchar(255), "imageId" varchar, CONSTRAINT "UQ_imageId" UNIQUE ("imageId"))`
|
|
13
|
+
)
|
|
14
|
+
await queryRunner.query(`CREATE TABLE "TextAttributes" ("id" varchar PRIMARY KEY NOT NULL, "color" varchar(255))`)
|
|
15
|
+
await queryRunner.query(
|
|
16
|
+
`CREATE TABLE "BaseLocaleBranding" ("id" varchar PRIMARY KEY NOT NULL, "alias" varchar(255), "locale" varchar(255) NOT NULL, "description" varchar(255), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "credentialBrandingId" varchar, "issuerBrandingId" varchar, "type" varchar NOT NULL, "logoId" varchar, "backgroundId" varchar, "textId" varchar, CONSTRAINT "UQ_logoId" UNIQUE ("logoId"), CONSTRAINT "UQ_backgroundId" UNIQUE ("backgroundId"), CONSTRAINT "UQ_textId" UNIQUE ("textId"))`
|
|
17
|
+
)
|
|
18
|
+
await queryRunner.query(
|
|
19
|
+
`CREATE UNIQUE INDEX "IDX_CredentialLocaleBrandingEntity_credentialBranding_locale" ON "BaseLocaleBranding" ("credentialBrandingId", "locale")`
|
|
20
|
+
)
|
|
21
|
+
await queryRunner.query(
|
|
22
|
+
`CREATE UNIQUE INDEX "IDX_IssuerLocaleBrandingEntity_issuerBranding_locale" ON "BaseLocaleBranding" ("issuerBrandingId", "locale")`
|
|
23
|
+
)
|
|
24
|
+
await queryRunner.query(`CREATE INDEX "IDX_BaseLocaleBranding_type" ON "BaseLocaleBranding" ("type")`)
|
|
25
|
+
await queryRunner.query(
|
|
26
|
+
`CREATE TABLE "CredentialBranding" ("id" varchar PRIMARY KEY NOT NULL, "vcHash" varchar(255) NOT NULL, "issuerCorrelationId" varchar(255) NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), CONSTRAINT "UQ_vcHash" UNIQUE ("vcHash"))`
|
|
27
|
+
)
|
|
28
|
+
await queryRunner.query(`CREATE INDEX "IDX_CredentialBrandingEntity_issuerCorrelationId" ON "CredentialBranding" ("issuerCorrelationId")`)
|
|
29
|
+
await queryRunner.query(`CREATE INDEX "IDX_CredentialBrandingEntity_vcHash" ON "CredentialBranding" ("vcHash")`)
|
|
30
|
+
await queryRunner.query(
|
|
31
|
+
`CREATE TABLE "IssuerBranding" ("id" varchar PRIMARY KEY NOT NULL, "issuerCorrelationId" varchar(255) NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), CONSTRAINT "UQ_issuerCorrelationId" UNIQUE ("issuerCorrelationId"))`
|
|
32
|
+
)
|
|
33
|
+
await queryRunner.query(`CREATE INDEX "IDX_IssuerBrandingEntity_issuerCorrelationId" ON "IssuerBranding" ("issuerCorrelationId")`)
|
|
34
|
+
await queryRunner.query(
|
|
35
|
+
`CREATE TABLE "temporary_ImageAttributes" ("id" varchar PRIMARY KEY NOT NULL, "uri" varchar(255), "dataUri" varchar(255), "mediaType" varchar(255), "alt" varchar(255), "dimensionsId" varchar, CONSTRAINT "UQ_dimensionsId" UNIQUE ("dimensionsId"), CONSTRAINT "FK_ImageAttributes_dimensionsId" FOREIGN KEY ("dimensionsId") REFERENCES "ImageDimensions" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`
|
|
36
|
+
)
|
|
37
|
+
await queryRunner.query(
|
|
38
|
+
`INSERT INTO "temporary_ImageAttributes"("id", "uri", "dataUri", "mediaType", "alt", "dimensionsId") SELECT "id", "uri", "dataUri", "mediaType", "alt", "dimensionsId" FROM "ImageAttributes"`
|
|
39
|
+
)
|
|
40
|
+
await queryRunner.query(`DROP TABLE "ImageAttributes"`)
|
|
41
|
+
await queryRunner.query(`ALTER TABLE "temporary_ImageAttributes" RENAME TO "ImageAttributes"`)
|
|
42
|
+
await queryRunner.query(
|
|
43
|
+
`CREATE TABLE "temporary_BackgroundAttributes" ("id" varchar PRIMARY KEY NOT NULL, "color" varchar(255), "imageId" varchar, CONSTRAINT "UQ_imageId" UNIQUE ("imageId"), CONSTRAINT "FK_BackgroundAttributes_imageId" FOREIGN KEY ("imageId") REFERENCES "ImageAttributes" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`
|
|
44
|
+
)
|
|
45
|
+
await queryRunner.query(
|
|
46
|
+
`INSERT INTO "temporary_BackgroundAttributes"("id", "color", "imageId") SELECT "id", "color", "imageId" FROM "BackgroundAttributes"`
|
|
47
|
+
)
|
|
48
|
+
await queryRunner.query(`DROP TABLE "BackgroundAttributes"`)
|
|
49
|
+
await queryRunner.query(`ALTER TABLE "temporary_BackgroundAttributes" RENAME TO "BackgroundAttributes"`)
|
|
50
|
+
await queryRunner.query(`DROP INDEX "IDX_CredentialLocaleBrandingEntity_credentialBranding_locale"`)
|
|
51
|
+
await queryRunner.query(`DROP INDEX "IDX_IssuerLocaleBrandingEntity_issuerBranding_locale"`)
|
|
52
|
+
await queryRunner.query(`DROP INDEX "IDX_BaseLocaleBranding_type"`)
|
|
53
|
+
await queryRunner.query(
|
|
54
|
+
`CREATE TABLE "temporary_BaseLocaleBranding" ("id" varchar PRIMARY KEY NOT NULL, "alias" varchar(255), "locale" varchar(255) NOT NULL, "description" varchar(255), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "credentialBrandingId" varchar, "issuerBrandingId" varchar, "type" varchar NOT NULL, "logoId" varchar, "backgroundId" varchar, "textId" varchar, CONSTRAINT "UQ_logoId" UNIQUE ("logoId"), CONSTRAINT "UQ_backgroundId" UNIQUE ("backgroundId"), CONSTRAINT "UQ_textId" UNIQUE ("textId"), CONSTRAINT "FK_BaseLocaleBranding_logoId" FOREIGN KEY ("logoId") REFERENCES "ImageAttributes" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_BaseLocaleBranding_backgroundId" FOREIGN KEY ("backgroundId") REFERENCES "BackgroundAttributes" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_BaseLocaleBranding_textId" FOREIGN KEY ("textId") REFERENCES "TextAttributes" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_BaseLocaleBranding_credentialBrandingId" FOREIGN KEY ("credentialBrandingId") REFERENCES "CredentialBranding" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_BaseLocaleBranding_issuerBrandingId" FOREIGN KEY ("issuerBrandingId") REFERENCES "IssuerBranding" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`
|
|
55
|
+
)
|
|
56
|
+
await queryRunner.query(
|
|
57
|
+
`INSERT INTO "temporary_BaseLocaleBranding"("id", "alias", "locale", "description", "created_at", "last_updated_at", "credentialBrandingId", "issuerBrandingId", "type", "logoId", "backgroundId", "textId") SELECT "id", "alias", "locale", "description", "created_at", "last_updated_at", "credentialBrandingId", "issuerBrandingId", "type", "logoId", "backgroundId", "textId" FROM "BaseLocaleBranding"`
|
|
58
|
+
)
|
|
59
|
+
await queryRunner.query(`DROP TABLE "BaseLocaleBranding"`)
|
|
60
|
+
await queryRunner.query(`ALTER TABLE "temporary_BaseLocaleBranding" RENAME TO "BaseLocaleBranding"`)
|
|
61
|
+
await queryRunner.query(
|
|
62
|
+
`CREATE UNIQUE INDEX "IDX_CredentialLocaleBrandingEntity_credentialBranding_locale" ON "BaseLocaleBranding" ("credentialBrandingId", "locale")`
|
|
63
|
+
)
|
|
64
|
+
await queryRunner.query(
|
|
65
|
+
`CREATE UNIQUE INDEX "IDX_IssuerLocaleBrandingEntity_issuerBranding_locale" ON "BaseLocaleBranding" ("issuerBrandingId", "locale")`
|
|
66
|
+
)
|
|
67
|
+
await queryRunner.query(`CREATE INDEX "IDX_BaseLocaleBranding_type" ON "BaseLocaleBranding" ("type")`)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
71
|
+
await queryRunner.query(`DROP INDEX "IDX_BaseLocaleBranding_type"`)
|
|
72
|
+
await queryRunner.query(`DROP INDEX "IDX_IssuerLocaleBrandingEntity_issuerBranding_locale"`)
|
|
73
|
+
await queryRunner.query(`DROP INDEX "IDX_CredentialLocaleBrandingEntity_credentialBranding_locale"`)
|
|
74
|
+
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" RENAME TO "temporary_BaseLocaleBranding"`)
|
|
75
|
+
await queryRunner.query(
|
|
76
|
+
`CREATE TABLE "BaseLocaleBranding" ("id" varchar PRIMARY KEY NOT NULL, "alias" varchar(255), "locale" varchar(255) NOT NULL, "description" varchar(255), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "credentialBrandingId" varchar, "issuerBrandingId" varchar, "type" varchar NOT NULL, "logoId" varchar, "backgroundId" varchar, "textId" varchar, CONSTRAINT "UQ_logoId" UNIQUE ("logoId"), CONSTRAINT "UQ_backgroundId" UNIQUE ("backgroundId"), CONSTRAINT "UQ_textId" UNIQUE ("textId"))`
|
|
77
|
+
)
|
|
78
|
+
await queryRunner.query(
|
|
79
|
+
`INSERT INTO "BaseLocaleBranding"("id", "alias", "locale", "description", "created_at", "last_updated_at", "credentialBrandingId", "issuerBrandingId", "type", "logoId", "backgroundId", "textId") SELECT "id", "alias", "locale", "description", "created_at", "last_updated_at", "credentialBrandingId", "issuerBrandingId", "type", "logoId", "backgroundId", "textId" FROM "BaseLocaleBranding"`
|
|
80
|
+
)
|
|
81
|
+
await queryRunner.query(`DROP TABLE "temporary_BaseLocaleBranding"`)
|
|
82
|
+
await queryRunner.query(`CREATE INDEX "IDX_BaseLocaleBranding_type" ON "BaseLocaleBranding" ("type")`)
|
|
83
|
+
await queryRunner.query(
|
|
84
|
+
`CREATE UNIQUE INDEX "IDX_IssuerLocaleBrandingEntity_issuerBranding_locale" ON "BaseLocaleBranding" ("issuerBrandingId", "locale")`
|
|
85
|
+
)
|
|
86
|
+
await queryRunner.query(
|
|
87
|
+
`CREATE UNIQUE INDEX "IDX_CredentialLocaleBrandingEntity_credentialBranding_locale" ON "BaseLocaleBranding" ("credentialBrandingId", "locale")`
|
|
88
|
+
)
|
|
89
|
+
await queryRunner.query(`ALTER TABLE "BackgroundAttributes" RENAME TO "temporary_BackgroundAttributes"`)
|
|
90
|
+
await queryRunner.query(
|
|
91
|
+
`CREATE TABLE "BackgroundAttributes" ("id" varchar PRIMARY KEY NOT NULL, "color" varchar(255), "imageId" varchar, CONSTRAINT "UQ_imageId" UNIQUE ("imageId"))`
|
|
92
|
+
)
|
|
93
|
+
await queryRunner.query(
|
|
94
|
+
`INSERT INTO "BackgroundAttributes"("id", "color", "imageId") SELECT "id", "color", "imageId" FROM "BackgroundAttributes"`
|
|
95
|
+
)
|
|
96
|
+
await queryRunner.query(`DROP TABLE "temporary_BackgroundAttributes"`)
|
|
97
|
+
await queryRunner.query(`ALTER TABLE "ImageAttributes" RENAME TO "temporary_ImageAttributes"`)
|
|
98
|
+
await queryRunner.query(
|
|
99
|
+
`CREATE TABLE "ImageAttributes" ("id" varchar PRIMARY KEY NOT NULL, "uri" varchar(255), "dataUri" varchar(255), "mediaType" varchar(255), "alt" varchar(255), "dimensionsId" varchar, CONSTRAINT "UQ_dimensionsId" UNIQUE ("dimensionsId"))`
|
|
100
|
+
)
|
|
101
|
+
await queryRunner.query(
|
|
102
|
+
`INSERT INTO "ImageAttributes"("id", "uri", "dataUri", "mediaType", "alt", "dimensionsId") SELECT "id", "uri", "dataUri", "mediaType", "alt", "dimensionsId" FROM "ImageAttributes"`
|
|
103
|
+
)
|
|
104
|
+
await queryRunner.query(`DROP TABLE "temporary_ImageAttributes"`)
|
|
105
|
+
await queryRunner.query(`DROP INDEX "IDX_IssuerBrandingEntity_issuerCorrelationId"`)
|
|
106
|
+
await queryRunner.query(`DROP TABLE "IssuerBranding"`)
|
|
107
|
+
await queryRunner.query(`DROP INDEX "IDX_CredentialBrandingEntity_vcHash"`)
|
|
108
|
+
await queryRunner.query(`DROP INDEX "IDX_CredentialBrandingEntity_issuerCorrelationId"`)
|
|
109
|
+
await queryRunner.query(`DROP TABLE "CredentialBranding"`)
|
|
110
|
+
await queryRunner.query(`DROP INDEX "IDX_BaseLocaleBranding_type"`)
|
|
111
|
+
await queryRunner.query(`DROP INDEX "IDX_IssuerLocaleBrandingEntity_issuerBranding_locale"`)
|
|
112
|
+
await queryRunner.query(`DROP INDEX "IDX_CredentialLocaleBrandingEntity_credentialBranding_locale"`)
|
|
113
|
+
await queryRunner.query(`DROP TABLE "BaseLocaleBranding"`)
|
|
114
|
+
await queryRunner.query(`DROP TABLE "TextAttributes"`)
|
|
115
|
+
await queryRunner.query(`DROP TABLE "BackgroundAttributes"`)
|
|
116
|
+
await queryRunner.query(`DROP TABLE "ImageAttributes"`)
|
|
117
|
+
await queryRunner.query(`DROP TABLE "ImageDimensions"`)
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { FindOptionsWhere } from 'typeorm'
|
|
2
|
+
import { ContactEntity } from '../../entities/contact/ContactEntity'
|
|
3
|
+
import { IdentityEntity } from '../../entities/contact/IdentityEntity'
|
|
4
|
+
import { IBasicIdentity, IContact, IIdentity } from './contact'
|
|
5
|
+
|
|
6
|
+
// TODO WAL-625 refactor types to use interfaces and not the entities as the store should be replaceable
|
|
7
|
+
export type FindContactArgs = FindOptionsWhere<ContactEntity>[]
|
|
8
|
+
export type FindIdentityArgs = FindOptionsWhere<IdentityEntity>[]
|
|
9
|
+
|
|
10
|
+
export interface IGetContactArgs {
|
|
11
|
+
contactId: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface IGetContactsArgs {
|
|
15
|
+
filter?: FindContactArgs
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface IAddContactArgs {
|
|
19
|
+
name: string
|
|
20
|
+
alias: string
|
|
21
|
+
uri?: string
|
|
22
|
+
identities?: Array<IBasicIdentity>
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface IUpdateContactArgs {
|
|
26
|
+
contact: Omit<IContact, 'identities' | 'createdAt' | 'lastUpdatedAt'>
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface IRemoveContactArgs {
|
|
30
|
+
contactId: string
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface IGetIdentityArgs {
|
|
34
|
+
identityId: string
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface IGetIdentitiesArgs {
|
|
38
|
+
filter?: FindIdentityArgs
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface IAddIdentityArgs {
|
|
42
|
+
contactId: string
|
|
43
|
+
identity: IBasicIdentity
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface IUpdateIdentityArgs {
|
|
47
|
+
identity: IIdentity
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface IRemoveIdentityArgs {
|
|
51
|
+
identityId: string
|
|
52
|
+
}
|