@sphereon/ssi-sdk.data-store 0.30.2-feature.CWALL.254.basedon.from.funke.78 → 0.30.2-feature.FIDES.integration.225
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/digitalCredential/DigitalCredentialStore.d.ts.map +1 -1
- package/dist/digitalCredential/DigitalCredentialStore.js +1 -3
- package/dist/digitalCredential/DigitalCredentialStore.js.map +1 -1
- package/dist/entities/digitalCredential/DigitalCredentialEntity.d.ts.map +1 -1
- package/dist/entities/digitalCredential/DigitalCredentialEntity.js +1 -1
- package/dist/entities/digitalCredential/DigitalCredentialEntity.js.map +1 -1
- package/dist/entities/eventLogger/AuditEventEntity.d.ts +8 -4
- package/dist/entities/eventLogger/AuditEventEntity.d.ts.map +1 -1
- package/dist/entities/eventLogger/AuditEventEntity.js +28 -25
- package/dist/entities/eventLogger/AuditEventEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.d.ts +0 -2
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.js +1 -8
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.d.ts +0 -2
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.js +1 -9
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.d.ts +0 -2
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.js +1 -16
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/ImageAttributesEntity.d.ts +0 -2
- package/dist/entities/issuanceBranding/ImageAttributesEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/ImageAttributesEntity.js +1 -11
- package/dist/entities/issuanceBranding/ImageAttributesEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.d.ts +0 -2
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.js +1 -8
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.d.ts +0 -2
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.js +1 -8
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.d.ts +4 -2
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.js +21 -15
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/TextAttributesEntity.d.ts +0 -2
- package/dist/entities/issuanceBranding/TextAttributesEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/TextAttributesEntity.js +1 -7
- package/dist/entities/issuanceBranding/TextAttributesEntity.js.map +1 -1
- package/dist/eventLogger/AbstractEventLoggerStore.d.ts +4 -2
- package/dist/eventLogger/AbstractEventLoggerStore.d.ts.map +1 -1
- package/dist/eventLogger/AbstractEventLoggerStore.js.map +1 -1
- package/dist/eventLogger/EventLoggerStore.d.ts +5 -3
- package/dist/eventLogger/EventLoggerStore.d.ts.map +1 -1
- package/dist/eventLogger/EventLoggerStore.js +32 -3
- package/dist/eventLogger/EventLoggerStore.js.map +1 -1
- package/dist/index.d.ts +14 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -18
- package/dist/index.js.map +1 -1
- package/dist/issuanceBranding/IssuanceBrandingStore.d.ts +1 -1
- package/dist/issuanceBranding/IssuanceBrandingStore.d.ts.map +1 -1
- package/dist/issuanceBranding/IssuanceBrandingStore.js +5 -5
- package/dist/issuanceBranding/IssuanceBrandingStore.js.map +1 -1
- package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.js +1 -1
- package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.js.map +1 -1
- package/dist/migrations/postgres/1701634812183-CreateAuditEvents.d.ts.map +1 -1
- package/dist/migrations/postgres/1701634812183-CreateAuditEvents.js +34 -6
- package/dist/migrations/postgres/1701634812183-CreateAuditEvents.js.map +1 -1
- package/dist/migrations/postgres/1708525189001-CreateDigitalCredential.js +1 -1
- package/dist/migrations/postgres/1708525189001-CreateDigitalCredential.js.map +1 -1
- package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.js +3 -3
- package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.js.map +1 -1
- package/dist/migrations/sqlite/1701634819487-CreateAuditEvents.d.ts.map +1 -1
- package/dist/migrations/sqlite/1701634819487-CreateAuditEvents.js +27 -1
- package/dist/migrations/sqlite/1701634819487-CreateAuditEvents.js.map +1 -1
- package/dist/migrations/sqlite/1708525189002-CreateDigitalCredential.js +1 -1
- package/dist/types/contact/contact.d.ts +3 -3
- package/dist/types/contact/contact.d.ts.map +1 -1
- package/dist/types/digitalCredential/digitalCredential.d.ts +2 -1
- package/dist/types/digitalCredential/digitalCredential.d.ts.map +1 -1
- package/dist/types/digitalCredential/digitalCredential.js +1 -0
- package/dist/types/digitalCredential/digitalCredential.js.map +1 -1
- package/dist/types/eventLogger/IAbstractEventLoggerStore.d.ts +9 -2
- package/dist/types/eventLogger/IAbstractEventLoggerStore.d.ts.map +1 -1
- package/dist/types/eventLogger/eventLogger.d.ts +3 -2
- package/dist/types/eventLogger/eventLogger.d.ts.map +1 -1
- package/dist/types/issuanceBranding/issuanceBranding.d.ts +7 -2
- package/dist/types/issuanceBranding/issuanceBranding.d.ts.map +1 -1
- package/dist/utils/eventLogger/MappingUtils.d.ts +5 -1
- package/dist/utils/eventLogger/MappingUtils.d.ts.map +1 -1
- package/dist/utils/eventLogger/MappingUtils.js +62 -2
- package/dist/utils/eventLogger/MappingUtils.js.map +1 -1
- package/dist/utils/issuanceBranding/MappingUtils.d.ts +15 -1
- package/dist/utils/issuanceBranding/MappingUtils.d.ts.map +1 -1
- package/dist/utils/issuanceBranding/MappingUtils.js +81 -1
- package/dist/utils/issuanceBranding/MappingUtils.js.map +1 -1
- package/package.json +6 -6
- package/src/__tests__/contact.store.test.ts +59 -4
- package/src/__tests__/digitalCredential.entities.test.ts +5 -5
- package/src/__tests__/digitalCredential.store.test.ts +83 -4
- package/src/__tests__/eventLogger.entities.test.ts +60 -5
- package/src/__tests__/eventLogger.store.test.ts +480 -3
- package/src/__tests__/issuanceBranding.entities.test.ts +8 -0
- package/src/digitalCredential/DigitalCredentialStore.ts +1 -3
- package/src/entities/digitalCredential/DigitalCredentialEntity.ts +1 -1
- package/src/entities/eventLogger/AuditEventEntity.ts +23 -28
- package/src/entities/issuanceBranding/BackgroundAttributesEntity.ts +2 -11
- package/src/entities/issuanceBranding/CredentialBrandingEntity.ts +1 -13
- package/src/entities/issuanceBranding/CredentialLocaleBrandingEntity.ts +0 -17
- package/src/entities/issuanceBranding/ImageAttributesEntity.ts +2 -14
- package/src/entities/issuanceBranding/ImageDimensionsEntity.ts +0 -9
- package/src/entities/issuanceBranding/IssuerBrandingEntity.ts +1 -12
- package/src/entities/issuanceBranding/IssuerLocaleBrandingEntity.ts +17 -17
- package/src/entities/issuanceBranding/TextAttributesEntity.ts +1 -9
- package/src/eventLogger/AbstractEventLoggerStore.ts +9 -2
- package/src/eventLogger/EventLoggerStore.ts +56 -11
- package/src/index.ts +13 -26
- package/src/issuanceBranding/IssuanceBrandingStore.ts +14 -6
- package/src/migrations/postgres/1685628974232-CreateIssuanceBranding.ts +1 -1
- package/src/migrations/postgres/1701634812183-CreateAuditEvents.ts +34 -6
- package/src/migrations/postgres/1708525189001-CreateDigitalCredential.ts +1 -1
- package/src/migrations/sqlite/1685628973231-CreateIssuanceBranding.ts +3 -3
- package/src/migrations/sqlite/1701634819487-CreateAuditEvents.ts +27 -1
- package/src/migrations/sqlite/1708525189002-CreateDigitalCredential.ts +1 -1
- package/src/types/contact/contact.ts +3 -3
- package/src/types/digitalCredential/digitalCredential.ts +1 -0
- package/src/types/eventLogger/IAbstractEventLoggerStore.ts +12 -2
- package/src/types/eventLogger/eventLogger.ts +3 -2
- package/src/types/issuanceBranding/issuanceBranding.ts +9 -3
- package/src/utils/eventLogger/MappingUtils.ts +90 -2
- package/src/utils/issuanceBranding/MappingUtils.ts +105 -2
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { BaseEntity, BeforeInsert, BeforeUpdate, Column, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn } from 'typeorm'
|
|
2
|
-
import {
|
|
3
|
-
import { ImageAttributesEntity, imageAttributesEntityFrom } from './ImageAttributesEntity'
|
|
2
|
+
import { ImageAttributesEntity } from './ImageAttributesEntity'
|
|
4
3
|
import { validate, Validate, ValidationError } from 'class-validator'
|
|
5
|
-
import {
|
|
4
|
+
import { IsNonEmptyStringConstraint } from '../validators'
|
|
6
5
|
|
|
7
6
|
@Entity('BackgroundAttributes')
|
|
8
7
|
export class BackgroundAttributesEntity extends BaseEntity {
|
|
@@ -32,11 +31,3 @@ export class BackgroundAttributesEntity extends BaseEntity {
|
|
|
32
31
|
return
|
|
33
32
|
}
|
|
34
33
|
}
|
|
35
|
-
|
|
36
|
-
export const backgroundAttributesEntityFrom = (args: IBasicBackgroundAttributes): BackgroundAttributesEntity => {
|
|
37
|
-
const backgroundAttributesEntity: BackgroundAttributesEntity = new BackgroundAttributesEntity()
|
|
38
|
-
backgroundAttributesEntity.color = isEmptyString(args.color) ? undefined : args.color
|
|
39
|
-
backgroundAttributesEntity.image = args.image ? imageAttributesEntityFrom(args.image) : undefined
|
|
40
|
-
|
|
41
|
-
return backgroundAttributesEntity
|
|
42
|
-
}
|
|
@@ -12,8 +12,7 @@ import {
|
|
|
12
12
|
} from 'typeorm'
|
|
13
13
|
import { ArrayMinSize, IsNotEmpty, validate, ValidationError } from 'class-validator'
|
|
14
14
|
import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
15
|
-
import { CredentialLocaleBrandingEntity
|
|
16
|
-
import { IBasicCredentialBranding, IBasicCredentialLocaleBranding } from '../../types'
|
|
15
|
+
import { CredentialLocaleBrandingEntity } from './CredentialLocaleBrandingEntity'
|
|
17
16
|
|
|
18
17
|
@Entity('CredentialBranding')
|
|
19
18
|
@Index('IDX_CredentialBrandingEntity_vcHash', ['vcHash'])
|
|
@@ -66,14 +65,3 @@ export class CredentialBrandingEntity extends BaseEntity {
|
|
|
66
65
|
return
|
|
67
66
|
}
|
|
68
67
|
}
|
|
69
|
-
|
|
70
|
-
export const credentialBrandingEntityFrom = (args: IBasicCredentialBranding): CredentialBrandingEntity => {
|
|
71
|
-
const credentialBrandingEntity: CredentialBrandingEntity = new CredentialBrandingEntity()
|
|
72
|
-
credentialBrandingEntity.issuerCorrelationId = args.issuerCorrelationId
|
|
73
|
-
credentialBrandingEntity.vcHash = args.vcHash
|
|
74
|
-
credentialBrandingEntity.localeBranding = args.localeBranding.map((localeBranding: IBasicCredentialLocaleBranding) =>
|
|
75
|
-
credentialLocaleBrandingEntityFrom(localeBranding),
|
|
76
|
-
)
|
|
77
|
-
|
|
78
|
-
return credentialBrandingEntity
|
|
79
|
-
}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { ChildEntity, Column, JoinColumn, ManyToOne, Index } from 'typeorm'
|
|
2
|
-
import { IBasicCredentialLocaleBranding } from '../../types'
|
|
3
|
-
import { backgroundAttributesEntityFrom } from './BackgroundAttributesEntity'
|
|
4
2
|
import { CredentialBrandingEntity } from './CredentialBrandingEntity'
|
|
5
|
-
import { imageAttributesEntityFrom } from './ImageAttributesEntity'
|
|
6
3
|
import { BaseLocaleBrandingEntity } from './BaseLocaleBrandingEntity'
|
|
7
|
-
import { textAttributesEntityFrom } from './TextAttributesEntity'
|
|
8
|
-
import { isEmptyString } from '../validators'
|
|
9
4
|
|
|
10
5
|
@ChildEntity('CredentialLocaleBranding')
|
|
11
6
|
@Index('IDX_CredentialLocaleBrandingEntity_credentialBranding_locale', ['credentialBranding', 'locale'], { unique: true })
|
|
@@ -19,15 +14,3 @@ export class CredentialLocaleBrandingEntity extends BaseLocaleBrandingEntity {
|
|
|
19
14
|
@Column('text', { name: 'credentialBrandingId', nullable: false })
|
|
20
15
|
credentialBrandingId!: string
|
|
21
16
|
}
|
|
22
|
-
|
|
23
|
-
export const credentialLocaleBrandingEntityFrom = (args: IBasicCredentialLocaleBranding): CredentialLocaleBrandingEntity => {
|
|
24
|
-
const credentialLocaleBrandingEntity: CredentialLocaleBrandingEntity = new CredentialLocaleBrandingEntity()
|
|
25
|
-
credentialLocaleBrandingEntity.alias = isEmptyString(args.alias) ? undefined : args.alias
|
|
26
|
-
credentialLocaleBrandingEntity.locale = args.locale ? args.locale : ''
|
|
27
|
-
credentialLocaleBrandingEntity.logo = args.logo ? imageAttributesEntityFrom(args.logo) : undefined
|
|
28
|
-
credentialLocaleBrandingEntity.description = isEmptyString(args.description) ? undefined : args.description
|
|
29
|
-
credentialLocaleBrandingEntity.background = args.background ? backgroundAttributesEntityFrom(args.background) : undefined
|
|
30
|
-
credentialLocaleBrandingEntity.text = args.text ? textAttributesEntityFrom(args.text) : undefined
|
|
31
|
-
|
|
32
|
-
return credentialLocaleBrandingEntity
|
|
33
|
-
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { BaseEntity, BeforeInsert, BeforeUpdate, Column, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn } from 'typeorm'
|
|
2
|
-
import {
|
|
3
|
-
import { ImageDimensionsEntity, imageDimensionsEntityFrom } from './ImageDimensionsEntity'
|
|
2
|
+
import { ImageDimensionsEntity } from './ImageDimensionsEntity'
|
|
4
3
|
import { validate, Validate, ValidationError } from 'class-validator'
|
|
5
|
-
import {
|
|
4
|
+
import { IsNonEmptyStringConstraint } from '../validators'
|
|
6
5
|
|
|
7
6
|
@Entity('ImageAttributes')
|
|
8
7
|
export class ImageAttributesEntity extends BaseEntity {
|
|
@@ -44,14 +43,3 @@ export class ImageAttributesEntity extends BaseEntity {
|
|
|
44
43
|
return
|
|
45
44
|
}
|
|
46
45
|
}
|
|
47
|
-
|
|
48
|
-
export const imageAttributesEntityFrom = (args: IBasicImageAttributes): ImageAttributesEntity => {
|
|
49
|
-
const imageAttributesEntity: ImageAttributesEntity = new ImageAttributesEntity()
|
|
50
|
-
imageAttributesEntity.uri = isEmptyString(args.uri) ? undefined : args.uri
|
|
51
|
-
imageAttributesEntity.dataUri = isEmptyString(args.dataUri) ? undefined : args.dataUri
|
|
52
|
-
imageAttributesEntity.mediaType = isEmptyString(args.mediaType) ? undefined : args.mediaType
|
|
53
|
-
imageAttributesEntity.alt = isEmptyString(args.alt) ? undefined : args.alt
|
|
54
|
-
imageAttributesEntity.dimensions = args.dimensions ? imageDimensionsEntityFrom(args.dimensions) : undefined
|
|
55
|
-
|
|
56
|
-
return imageAttributesEntity
|
|
57
|
-
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
|
2
|
-
import { IBasicImageDimensions } from '../../types'
|
|
3
2
|
|
|
4
3
|
@Entity('ImageDimensions')
|
|
5
4
|
export class ImageDimensionsEntity extends BaseEntity {
|
|
@@ -12,11 +11,3 @@ export class ImageDimensionsEntity extends BaseEntity {
|
|
|
12
11
|
@Column('integer', { name: 'height', nullable: false, unique: false })
|
|
13
12
|
height!: number
|
|
14
13
|
}
|
|
15
|
-
|
|
16
|
-
export const imageDimensionsEntityFrom = (args: IBasicImageDimensions): ImageDimensionsEntity => {
|
|
17
|
-
const imageDimensionsEntity: ImageDimensionsEntity = new ImageDimensionsEntity()
|
|
18
|
-
imageDimensionsEntity.width = args.width
|
|
19
|
-
imageDimensionsEntity.height = args.height
|
|
20
|
-
|
|
21
|
-
return imageDimensionsEntity
|
|
22
|
-
}
|
|
@@ -12,8 +12,7 @@ import {
|
|
|
12
12
|
} from 'typeorm'
|
|
13
13
|
import { ArrayMinSize, IsNotEmpty, validate, ValidationError } from 'class-validator'
|
|
14
14
|
import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
15
|
-
import { IssuerLocaleBrandingEntity
|
|
16
|
-
import { IBasicIssuerBranding, IBasicIssuerLocaleBranding } from '../../types'
|
|
15
|
+
import { IssuerLocaleBrandingEntity } from './IssuerLocaleBrandingEntity'
|
|
17
16
|
|
|
18
17
|
@Entity('IssuerBranding')
|
|
19
18
|
@Index('IDX_IssuerBrandingEntity_issuerCorrelationId', ['issuerCorrelationId'])
|
|
@@ -61,13 +60,3 @@ export class IssuerBrandingEntity extends BaseEntity {
|
|
|
61
60
|
return
|
|
62
61
|
}
|
|
63
62
|
}
|
|
64
|
-
|
|
65
|
-
export const issuerBrandingEntityFrom = (args: IBasicIssuerBranding): IssuerBrandingEntity => {
|
|
66
|
-
const issuerBrandingEntity: IssuerBrandingEntity = new IssuerBrandingEntity()
|
|
67
|
-
issuerBrandingEntity.issuerCorrelationId = args.issuerCorrelationId
|
|
68
|
-
issuerBrandingEntity.localeBranding = args.localeBranding.map((localeBranding: IBasicIssuerLocaleBranding) =>
|
|
69
|
-
issuerLocaleBrandingEntityFrom(localeBranding),
|
|
70
|
-
)
|
|
71
|
-
|
|
72
|
-
return issuerBrandingEntity
|
|
73
|
-
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { ChildEntity, Column, Index, JoinColumn, ManyToOne } from 'typeorm'
|
|
2
|
-
import { IBasicIssuerLocaleBranding } from '../../types'
|
|
3
|
-
import { backgroundAttributesEntityFrom } from './BackgroundAttributesEntity'
|
|
4
|
-
import { imageAttributesEntityFrom } from './ImageAttributesEntity'
|
|
5
2
|
import { IssuerBrandingEntity } from './IssuerBrandingEntity'
|
|
6
3
|
import { BaseLocaleBrandingEntity } from './BaseLocaleBrandingEntity'
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { IsNonEmptyStringConstraint } from '../validators'
|
|
5
|
+
import { Validate } from 'class-validator'
|
|
9
6
|
|
|
10
7
|
@ChildEntity('IssuerLocaleBranding')
|
|
11
8
|
@Index('IDX_IssuerLocaleBrandingEntity_issuerBranding_locale', ['issuerBranding', 'locale'], { unique: true })
|
|
@@ -16,18 +13,21 @@ export class IssuerLocaleBrandingEntity extends BaseLocaleBrandingEntity {
|
|
|
16
13
|
@JoinColumn({ name: 'issuerBrandingId' })
|
|
17
14
|
issuerBranding!: IssuerBrandingEntity
|
|
18
15
|
|
|
19
|
-
@Column('text', { name: '
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
@Column('text', { name: 'client_uri', nullable: true, unique: false })
|
|
17
|
+
@Validate(IsNonEmptyStringConstraint, { message: 'Blank client uris are not allowed' })
|
|
18
|
+
clientUri?: string
|
|
19
|
+
|
|
20
|
+
@Column('text', { name: 'tos_uri', nullable: true, unique: false })
|
|
21
|
+
@Validate(IsNonEmptyStringConstraint, { message: 'Blank tos uris are not allowed' })
|
|
22
|
+
tosUri?: string
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
issuerLocaleBrandingEntity.locale = args.locale ? args.locale : ''
|
|
27
|
-
issuerLocaleBrandingEntity.logo = args.logo ? imageAttributesEntityFrom(args.logo) : undefined
|
|
28
|
-
issuerLocaleBrandingEntity.description = isEmptyString(args.description) ? undefined : args.description
|
|
29
|
-
issuerLocaleBrandingEntity.background = args.background ? backgroundAttributesEntityFrom(args.background) : undefined
|
|
30
|
-
issuerLocaleBrandingEntity.text = args.text ? textAttributesEntityFrom(args.text) : undefined
|
|
24
|
+
@Column('text', { name: 'policy_uri', nullable: true, unique: false })
|
|
25
|
+
@Validate(IsNonEmptyStringConstraint, { message: 'Blank policy uris are not allowed' })
|
|
26
|
+
policyUri?: string
|
|
31
27
|
|
|
32
|
-
|
|
28
|
+
@Column('simple-array', { name: 'contacts', nullable: true, unique: false })
|
|
29
|
+
contacts?: Array<string>
|
|
30
|
+
|
|
31
|
+
@Column('text', { name: 'issuerBrandingId', nullable: false })
|
|
32
|
+
issuerBrandingId!: string
|
|
33
33
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BaseEntity, BeforeInsert, BeforeUpdate, Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
|
2
|
-
import { IBasicTextAttributes } from '../../types'
|
|
3
2
|
import { validate, Validate, ValidationError } from 'class-validator'
|
|
4
|
-
import {
|
|
3
|
+
import { IsNonEmptyStringConstraint } from '../validators'
|
|
5
4
|
|
|
6
5
|
@Entity('TextAttributes')
|
|
7
6
|
export class TextAttributesEntity extends BaseEntity {
|
|
@@ -22,10 +21,3 @@ export class TextAttributesEntity extends BaseEntity {
|
|
|
22
21
|
return
|
|
23
22
|
}
|
|
24
23
|
}
|
|
25
|
-
|
|
26
|
-
export const textAttributesEntityFrom = (args: IBasicTextAttributes): TextAttributesEntity => {
|
|
27
|
-
const textAttributesEntity: TextAttributesEntity = new TextAttributesEntity()
|
|
28
|
-
textAttributesEntity.color = isEmptyString(args.color) ? undefined : args.color
|
|
29
|
-
|
|
30
|
-
return textAttributesEntity
|
|
31
|
-
}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ActivityLoggingEvent, AuditLoggingEvent } from '@sphereon/ssi-sdk.core'
|
|
2
|
+
import {
|
|
3
|
+
GetActivityEventsArgs,
|
|
4
|
+
GetAuditEventsArgs,
|
|
5
|
+
StoreActivityEventArgs,
|
|
6
|
+
StoreAuditEventArgs
|
|
7
|
+
} from '../types'
|
|
3
8
|
|
|
4
9
|
export abstract class AbstractEventLoggerStore {
|
|
5
10
|
abstract getAuditEvents(args: GetAuditEventsArgs): Promise<Array<AuditLoggingEvent>>
|
|
11
|
+
abstract getActivityEvents(args: GetActivityEventsArgs): Promise<Array<ActivityLoggingEvent>>
|
|
6
12
|
abstract storeAuditEvent(args: StoreAuditEventArgs): Promise<AuditLoggingEvent>
|
|
13
|
+
abstract storeActivityEvent(args: StoreActivityEventArgs): Promise<ActivityLoggingEvent>
|
|
7
14
|
}
|
|
@@ -1,11 +1,21 @@
|
|
|
1
|
+
import { ActivityLoggingEvent, AuditLoggingEvent } from '@sphereon/ssi-sdk.core'
|
|
2
|
+
import { LoggingEventType, OrPromise } from '@sphereon/ssi-types'
|
|
1
3
|
import Debug, { Debugger } from 'debug'
|
|
2
4
|
import { DataSource } from 'typeorm'
|
|
3
|
-
import { AuditLoggingEvent } from '@sphereon/ssi-sdk.core'
|
|
4
|
-
import { OrPromise } from '@sphereon/ssi-types'
|
|
5
5
|
import { AbstractEventLoggerStore } from './AbstractEventLoggerStore'
|
|
6
|
-
import { AuditEventEntity
|
|
7
|
-
import {
|
|
8
|
-
|
|
6
|
+
import { AuditEventEntity } from '../entities/eventLogger/AuditEventEntity'
|
|
7
|
+
import {
|
|
8
|
+
activityEventEntityFrom,
|
|
9
|
+
activityEventFrom,
|
|
10
|
+
auditEventEntityFrom,
|
|
11
|
+
auditEventFrom
|
|
12
|
+
} from '../utils/eventLogger/MappingUtils'
|
|
13
|
+
import {
|
|
14
|
+
GetActivityEventsArgs,
|
|
15
|
+
GetAuditEventsArgs,
|
|
16
|
+
StoreActivityEventArgs,
|
|
17
|
+
StoreAuditEventArgs
|
|
18
|
+
} from '../types'
|
|
9
19
|
|
|
10
20
|
const debug: Debugger = Debug('sphereon:ssi-sdk:event-store')
|
|
11
21
|
|
|
@@ -18,10 +28,17 @@ export class EventLoggerStore extends AbstractEventLoggerStore {
|
|
|
18
28
|
}
|
|
19
29
|
|
|
20
30
|
getAuditEvents = async (args?: GetAuditEventsArgs): Promise<Array<AuditLoggingEvent>> => {
|
|
21
|
-
const
|
|
31
|
+
const { filter = [] } = args ?? {}
|
|
32
|
+
|
|
33
|
+
const auditEventsFilter = filter.map((item) => ({ ...item, type: LoggingEventType.AUDIT }))
|
|
34
|
+
if (auditEventsFilter.length === 0) {
|
|
35
|
+
auditEventsFilter.push({ type: LoggingEventType.AUDIT })
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const connection = await this.dbConnection
|
|
22
39
|
debug('Getting audit events', args)
|
|
23
|
-
const result
|
|
24
|
-
|
|
40
|
+
const result = await connection.getRepository(AuditEventEntity).find({
|
|
41
|
+
where: auditEventsFilter
|
|
25
42
|
})
|
|
26
43
|
|
|
27
44
|
return result.map((event: AuditEventEntity) => auditEventFrom(event))
|
|
@@ -30,11 +47,39 @@ export class EventLoggerStore extends AbstractEventLoggerStore {
|
|
|
30
47
|
storeAuditEvent = async (args: StoreAuditEventArgs): Promise<AuditLoggingEvent> => {
|
|
31
48
|
const { event } = args
|
|
32
49
|
|
|
33
|
-
const auditEventEntity
|
|
34
|
-
const connection
|
|
50
|
+
const auditEventEntity = auditEventEntityFrom(event)
|
|
51
|
+
const connection = await this.dbConnection
|
|
35
52
|
debug('Storing audit event', auditEventEntity)
|
|
36
|
-
const createdResult
|
|
53
|
+
const createdResult = await connection.getRepository(AuditEventEntity).save(auditEventEntity)
|
|
37
54
|
|
|
38
55
|
return auditEventFrom(createdResult)
|
|
39
56
|
}
|
|
57
|
+
|
|
58
|
+
getActivityEvents = async (args?: GetActivityEventsArgs): Promise<Array<ActivityLoggingEvent>> => {
|
|
59
|
+
const { filter = [] } = args ?? {}
|
|
60
|
+
|
|
61
|
+
const activityEventsFilter = filter.map((item) => ({ ...item, type: LoggingEventType.ACTIVITY }))
|
|
62
|
+
if (activityEventsFilter.length === 0) {
|
|
63
|
+
activityEventsFilter.push({ type: LoggingEventType.ACTIVITY })
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const connection = await this.dbConnection
|
|
67
|
+
debug('Getting activity events', args)
|
|
68
|
+
const result = await connection.getRepository(AuditEventEntity).find({
|
|
69
|
+
where: activityEventsFilter
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
return result.map((event: AuditEventEntity) => activityEventFrom(event))
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
storeActivityEvent = async (args: StoreActivityEventArgs): Promise<ActivityLoggingEvent> => {
|
|
76
|
+
const { event } = args
|
|
77
|
+
|
|
78
|
+
const activityEventEntity = activityEventEntityFrom(event)
|
|
79
|
+
const connection = await this.dbConnection
|
|
80
|
+
debug('Storing activity event', activityEventEntity)
|
|
81
|
+
const createdResult = await connection.getRepository(AuditEventEntity).save(activityEventEntity)
|
|
82
|
+
|
|
83
|
+
return activityEventFrom(createdResult)
|
|
84
|
+
}
|
|
40
85
|
}
|
package/src/index.ts
CHANGED
|
@@ -8,14 +8,14 @@ import { DidAuthConfigEntity } from './entities/contact/DidAuthConfigEntity'
|
|
|
8
8
|
import { IdentityEntity } from './entities/contact/IdentityEntity'
|
|
9
9
|
import { IdentityMetadataItemEntity } from './entities/contact/IdentityMetadataItemEntity'
|
|
10
10
|
import { OpenIdConfigEntity } from './entities/contact/OpenIdConfigEntity'
|
|
11
|
-
import { BackgroundAttributesEntity
|
|
12
|
-
import { CredentialBrandingEntity
|
|
13
|
-
import { CredentialLocaleBrandingEntity
|
|
14
|
-
import { ImageAttributesEntity
|
|
15
|
-
import { ImageDimensionsEntity
|
|
16
|
-
import { IssuerLocaleBrandingEntity
|
|
17
|
-
import { IssuerBrandingEntity
|
|
18
|
-
import { TextAttributesEntity
|
|
11
|
+
import { BackgroundAttributesEntity } from './entities/issuanceBranding/BackgroundAttributesEntity'
|
|
12
|
+
import { CredentialBrandingEntity } from './entities/issuanceBranding/CredentialBrandingEntity'
|
|
13
|
+
import { CredentialLocaleBrandingEntity } from './entities/issuanceBranding/CredentialLocaleBrandingEntity'
|
|
14
|
+
import { ImageAttributesEntity } from './entities/issuanceBranding/ImageAttributesEntity'
|
|
15
|
+
import { ImageDimensionsEntity } from './entities/issuanceBranding/ImageDimensionsEntity'
|
|
16
|
+
import { IssuerLocaleBrandingEntity } from './entities/issuanceBranding/IssuerLocaleBrandingEntity'
|
|
17
|
+
import { IssuerBrandingEntity } from './entities/issuanceBranding/IssuerBrandingEntity'
|
|
18
|
+
import { TextAttributesEntity } from './entities/issuanceBranding/TextAttributesEntity'
|
|
19
19
|
import { StatusListEntity } from './entities/statusList2021/StatusList2021Entity'
|
|
20
20
|
import { StatusListEntryEntity } from './entities/statusList2021/StatusList2021EntryEntity'
|
|
21
21
|
import { MachineStateInfoEntity } from './entities/machineState/MachineStateInfoEntity'
|
|
@@ -33,10 +33,8 @@ export { DigitalCredentialStore } from './digitalCredential/DigitalCredentialSto
|
|
|
33
33
|
export { AbstractIssuanceBrandingStore } from './issuanceBranding/AbstractIssuanceBrandingStore'
|
|
34
34
|
export { IssuanceBrandingStore } from './issuanceBranding/IssuanceBrandingStore'
|
|
35
35
|
export { StatusListStore } from './statusList/StatusListStore'
|
|
36
|
-
import { AuditEventEntity
|
|
36
|
+
import { AuditEventEntity } from './entities/eventLogger/AuditEventEntity'
|
|
37
37
|
import { DigitalCredentialEntity } from './entities/digitalCredential/DigitalCredentialEntity'
|
|
38
|
-
import { digitalCredentialFrom, digitalCredentialsFrom, nonPersistedDigitalCredentialEntityFromAddArgs } from './utils/digitalCredential/MappingUtils'
|
|
39
|
-
import { isPresentationDefinitionEqual } from './utils/presentationDefinition/MappingUtils'
|
|
40
38
|
import { PresentationDefinitionItemEntity } from './entities/presentationDefinition/PresentationDefinitionItemEntity'
|
|
41
39
|
import { ContactMetadataItemEntity } from './entities/contact/ContactMetadataItemEntity'
|
|
42
40
|
export { AbstractEventLoggerStore } from './eventLogger/AbstractEventLoggerStore'
|
|
@@ -59,6 +57,10 @@ export {
|
|
|
59
57
|
export * from './types'
|
|
60
58
|
export * from './utils/contact/MappingUtils'
|
|
61
59
|
export * from './utils/digitalCredential/MappingUtils'
|
|
60
|
+
export * from './utils/eventLogger/MappingUtils'
|
|
61
|
+
export * from './utils/issuanceBranding/MappingUtils'
|
|
62
|
+
export * from './utils/presentationDefinition/MappingUtils'
|
|
63
|
+
export * from './utils/hasher'
|
|
62
64
|
|
|
63
65
|
export const DataStoreContactEntities = [
|
|
64
66
|
BaseConfigEntity,
|
|
@@ -133,28 +135,13 @@ export {
|
|
|
133
135
|
IssuerLocaleBrandingEntity,
|
|
134
136
|
ElectronicAddressEntity,
|
|
135
137
|
PhysicalAddressEntity,
|
|
136
|
-
backgroundAttributesEntityFrom,
|
|
137
|
-
credentialBrandingEntityFrom,
|
|
138
|
-
imageAttributesEntityFrom,
|
|
139
|
-
imageDimensionsEntityFrom,
|
|
140
|
-
issuerBrandingEntityFrom,
|
|
141
|
-
textAttributesEntityFrom,
|
|
142
|
-
issuerLocaleBrandingEntityFrom,
|
|
143
|
-
credentialLocaleBrandingEntityFrom,
|
|
144
138
|
IStatusListEntity,
|
|
145
139
|
IStatusListEntryEntity,
|
|
146
140
|
StatusListEntity,
|
|
147
141
|
StatusListEntryEntity,
|
|
148
142
|
AuditEventEntity,
|
|
149
|
-
auditEventEntityFrom,
|
|
150
143
|
DigitalCredentialEntity,
|
|
151
|
-
digitalCredentialFrom,
|
|
152
|
-
digitalCredentialsFrom,
|
|
153
|
-
nonPersistedDigitalCredentialEntityFromAddArgs,
|
|
154
144
|
MachineStateInfoEntity,
|
|
155
145
|
PresentationDefinitionItemEntity,
|
|
156
|
-
isPresentationDefinitionEqual,
|
|
157
146
|
ContactMetadataItemEntity,
|
|
158
147
|
}
|
|
159
|
-
|
|
160
|
-
export * from './utils/hasher'
|
|
@@ -1,17 +1,25 @@
|
|
|
1
|
+
import { OrPromise } from '@sphereon/ssi-types'
|
|
1
2
|
import Debug from 'debug'
|
|
2
3
|
import { DataSource, DeleteResult, In, Not, Repository } from 'typeorm'
|
|
3
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
credentialBrandingEntityFrom,
|
|
6
|
+
credentialBrandingFrom,
|
|
7
|
+
credentialLocaleBrandingEntityFrom,
|
|
8
|
+
issuerBrandingEntityFrom,
|
|
9
|
+
issuerBrandingFrom,
|
|
10
|
+
issuerLocaleBrandingEntityFrom,
|
|
11
|
+
localeBrandingFrom
|
|
12
|
+
} from '../utils/issuanceBranding/MappingUtils'
|
|
4
13
|
import { BackgroundAttributesEntity } from '../entities/issuanceBranding/BackgroundAttributesEntity'
|
|
5
14
|
import { ImageAttributesEntity } from '../entities/issuanceBranding/ImageAttributesEntity'
|
|
6
15
|
import { ImageDimensionsEntity } from '../entities/issuanceBranding/ImageDimensionsEntity'
|
|
7
|
-
import { IssuerBrandingEntity
|
|
8
|
-
import { CredentialBrandingEntity
|
|
9
|
-
import { CredentialLocaleBrandingEntity
|
|
10
|
-
import { IssuerLocaleBrandingEntity
|
|
16
|
+
import { IssuerBrandingEntity } from '../entities/issuanceBranding/IssuerBrandingEntity'
|
|
17
|
+
import { CredentialBrandingEntity } from '../entities/issuanceBranding/CredentialBrandingEntity'
|
|
18
|
+
import { CredentialLocaleBrandingEntity } from '../entities/issuanceBranding/CredentialLocaleBrandingEntity'
|
|
19
|
+
import { IssuerLocaleBrandingEntity } from '../entities/issuanceBranding/IssuerLocaleBrandingEntity'
|
|
11
20
|
import { BaseLocaleBrandingEntity } from '../entities/issuanceBranding/BaseLocaleBrandingEntity'
|
|
12
21
|
import { TextAttributesEntity } from '../entities/issuanceBranding/TextAttributesEntity'
|
|
13
22
|
import { AbstractIssuanceBrandingStore } from './AbstractIssuanceBrandingStore'
|
|
14
|
-
import { credentialBrandingFrom, issuerBrandingFrom, localeBrandingFrom } from '../utils/issuanceBranding/MappingUtils'
|
|
15
23
|
import {
|
|
16
24
|
IAddCredentialBrandingArgs,
|
|
17
25
|
IAddCredentialLocaleBrandingArgs,
|
|
@@ -19,7 +19,7 @@ export class CreateIssuanceBranding1685628974232 implements MigrationInterface {
|
|
|
19
19
|
`CREATE TABLE "TextAttributes" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "color" character varying(255), CONSTRAINT "PK_TextAttributes_id" PRIMARY KEY ("id"))`,
|
|
20
20
|
)
|
|
21
21
|
await queryRunner.query(
|
|
22
|
-
`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"))`,
|
|
22
|
+
`CREATE TABLE "BaseLocaleBranding" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "alias" character varying(255), "locale" character varying(255) NOT NULL, "description" character varying(255), "created_at" TIMESTAMP NOT NULL DEFAULT now(), "last_updated_at" TIMESTAMP NOT NULL DEFAULT now(), "credentialBrandingId" uuid, "issuerBrandingId" uuid, "type" character varying NOT NULL, "logoId" uuid, "backgroundId" uuid, "textId" uuid, "client_uri" character varying, "tos_uri" character varying, "policy_uri" character varying, "contacts" character varying, CONSTRAINT "UQ_logoId" UNIQUE ("logoId"), CONSTRAINT "UQ_backgroundId" UNIQUE ("backgroundId"), CONSTRAINT "UQ_textId" UNIQUE ("textId"), CONSTRAINT "PK_BaseLocaleBranding_id" PRIMARY KEY ("id"))`,
|
|
23
23
|
)
|
|
24
24
|
await queryRunner.query(
|
|
25
25
|
`CREATE UNIQUE INDEX "IDX_CredentialLocaleBrandingEntity_credentialBranding_locale" ON "BaseLocaleBranding" ("credentialBrandingId", "locale")`,
|
|
@@ -4,19 +4,47 @@ export class CreateAuditEvents1701634812183 implements MigrationInterface {
|
|
|
4
4
|
name = 'CreateAuditEvents1701634812183'
|
|
5
5
|
|
|
6
6
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
-
await queryRunner.query(`CREATE TYPE "public"."Level_enum" AS ENUM('0', '1', '2', '3')`)
|
|
7
|
+
await queryRunner.query(`CREATE TYPE "public"."Level_enum" AS ENUM('0', '1', '2', '3', '4')`)
|
|
8
8
|
await queryRunner.query(
|
|
9
|
-
`CREATE TYPE "public"."System_enum" AS ENUM('general', 'kms', 'identity', 'oid4vci', 'credentials', 'web3', 'profile', 'contact')`,
|
|
9
|
+
`CREATE TYPE "public"."System_enum" AS ENUM('general', 'kms', 'identity', 'oid4vci', 'oid4vp', 'siopv2', 'PE', 'credentials', 'web3', 'profile', 'contact')`,
|
|
10
10
|
)
|
|
11
11
|
await queryRunner.query(
|
|
12
|
-
`CREATE TYPE "public"."Subsystem_type_enum" AS ENUM('key', 'did_provider', 'did_resolver', 'oid4vp_op', 'oid4vci_client', 'siopv2_op', 'contact_manager', 'vc_issuer', 'vc_verifier', 'vc_persistence', 'transport', 'profile')`,
|
|
12
|
+
`CREATE TYPE "public"."Subsystem_type_enum" AS ENUM('key', 'did_provider', 'did_resolver', 'oid4vp_op', 'oid4vci_client', 'siopv2_op', 'contact_manager', 'vc_issuer', 'vc_verifier', 'vc_persistence', 'transport', 'profile', 'api')`,
|
|
13
13
|
)
|
|
14
14
|
await queryRunner.query(`CREATE TYPE "public"."Action_type_enum" AS ENUM('create', 'read', 'update', 'delete', 'execute')`)
|
|
15
15
|
await queryRunner.query(`CREATE TYPE "public"."Initiator_type_enum" AS ENUM('user', 'system', 'external')`)
|
|
16
|
-
await queryRunner.query(`CREATE TYPE "public"."System_correlation_id_type_enum" AS ENUM('did', 'email', 'hostname', 'phone', 'user')`)
|
|
17
|
-
await queryRunner.query(`CREATE TYPE "public"."Party_correlation_type_enum" AS ENUM('did', 'email', 'hostname', 'phone')`)
|
|
16
|
+
await queryRunner.query(`CREATE TYPE "public"."System_correlation_id_type_enum" AS ENUM('did', 'url', 'email', 'hostname', 'phone', 'user')`)
|
|
17
|
+
await queryRunner.query(`CREATE TYPE "public"."Party_correlation_type_enum" AS ENUM('did', 'url', 'email', 'hostname', 'phone')`)
|
|
18
|
+
await queryRunner.query(`CREATE TYPE "public"."Event_type_enum" AS ENUM('audit', 'activity', 'general')`)
|
|
19
|
+
await queryRunner.query(`CREATE TYPE "public"."Event_credential_type_enum" AS ENUM('JSON_LD', 'JWT', 'SD_JWT', 'MSO_MDOC')`)
|
|
18
20
|
await queryRunner.query(
|
|
19
|
-
`CREATE TABLE "AuditEvents" (
|
|
21
|
+
`CREATE TABLE "AuditEvents" (
|
|
22
|
+
"id" uuid NOT NULL DEFAULT uuid_generate_v4(),
|
|
23
|
+
"eventType" "public"."Event_type_enum" NOT NULL,
|
|
24
|
+
"timestamp" TIMESTAMP NOT NULL,
|
|
25
|
+
"level" "public"."Level_enum" NOT NULL,
|
|
26
|
+
"correlationId" TEXT NOT NULL,
|
|
27
|
+
"system" "public"."System_enum" NOT NULL,
|
|
28
|
+
"subSystemType" "public"."Subsystem_type_enum" NOT NULL,
|
|
29
|
+
"actionType" "public"."Action_type_enum" NOT NULL,
|
|
30
|
+
"actionSubType" TEXT NOT NULL,
|
|
31
|
+
"initiatorType" "public"."Initiator_type_enum" NOT NULL,
|
|
32
|
+
"systemCorrelationIdType" "public"."System_correlation_id_type_enum",
|
|
33
|
+
"systemCorrelationId" TEXT,
|
|
34
|
+
"systemAlias" TEXT,
|
|
35
|
+
"partyCorrelationType" "public"."Party_correlation_type_enum",
|
|
36
|
+
"partyCorrelationId" TEXT,
|
|
37
|
+
"partyAlias" TEXT,
|
|
38
|
+
"credentialType" "public"."Event_credential_type_enum",
|
|
39
|
+
"credentialHash" TEXT,
|
|
40
|
+
"originalCredential" TEXT,
|
|
41
|
+
"sharePurpose" TEXT,
|
|
42
|
+
"description" TEXT NOT NULL,
|
|
43
|
+
"data" TEXT,
|
|
44
|
+
"diagnosticData" TEXT,
|
|
45
|
+
"created_at" TIMESTAMP NOT NULL DEFAULT now(),
|
|
46
|
+
"last_updated_at" TIMESTAMP NOT NULL DEFAULT now(),
|
|
47
|
+
CONSTRAINT "PK_AuditEvents_id" PRIMARY KEY ("id"))`,
|
|
20
48
|
)
|
|
21
49
|
}
|
|
22
50
|
|
|
@@ -7,7 +7,7 @@ export class CreateDigitalCredential1708525189001 implements MigrationInterface
|
|
|
7
7
|
await queryRunner.query(`CREATE TYPE "digital_document_type" AS ENUM('VC', 'VP', 'C', 'P')`)
|
|
8
8
|
await queryRunner.query(`CREATE TYPE "digital_regulation_type" AS ENUM('PID', 'QEAA', 'EAA', 'NON_REGULATED')`)
|
|
9
9
|
await queryRunner.query(`CREATE TYPE "digital_credential_document_format" AS ENUM('JSON_LD', 'JWT', 'SD_JWT', 'MSO_MDOC')`)
|
|
10
|
-
await queryRunner.query(`CREATE TYPE "digital_credential_credential_role" AS ENUM('ISSUER', 'VERIFIER', 'HOLDER')`)
|
|
10
|
+
await queryRunner.query(`CREATE TYPE "digital_credential_credential_role" AS ENUM('ISSUER', 'VERIFIER', 'HOLDER', 'FEDERATION_TRUST_ANCHOR')`)
|
|
11
11
|
await queryRunner.query(`CREATE TYPE "digital_credential_correlation_type" AS ENUM('DID', 'KID', 'URL', 'X509_SAN')`)
|
|
12
12
|
await queryRunner.query(`CREATE TYPE "digital_credential_state_type" AS ENUM('REVOKED', 'VERIFIED', 'EXPIRED')`)
|
|
13
13
|
|
|
@@ -13,7 +13,7 @@ export class CreateIssuanceBranding1685628973231 implements MigrationInterface {
|
|
|
13
13
|
)
|
|
14
14
|
await queryRunner.query(`CREATE TABLE "TextAttributes" ("id" varchar PRIMARY KEY NOT NULL, "color" varchar(255))`)
|
|
15
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"))`,
|
|
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, "client_uri" varchar, "tos_uri" varchar, "policy_uri" varchar, "contacts" varchar, CONSTRAINT "UQ_logoId" UNIQUE ("logoId"), CONSTRAINT "UQ_backgroundId" UNIQUE ("backgroundId"), CONSTRAINT "UQ_textId" UNIQUE ("textId"))`,
|
|
17
17
|
)
|
|
18
18
|
await queryRunner.query(
|
|
19
19
|
`CREATE UNIQUE INDEX "IDX_CredentialLocaleBrandingEntity_credentialBranding_locale" ON "BaseLocaleBranding" ("credentialBrandingId", "locale")`,
|
|
@@ -51,7 +51,7 @@ export class CreateIssuanceBranding1685628973231 implements MigrationInterface {
|
|
|
51
51
|
await queryRunner.query(`DROP INDEX "IDX_IssuerLocaleBrandingEntity_issuerBranding_locale"`)
|
|
52
52
|
await queryRunner.query(`DROP INDEX "IDX_BaseLocaleBranding_type"`)
|
|
53
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)`,
|
|
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, "client_uri" varchar, "tos_uri" varchar, "policy_uri" varchar, "contacts" 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
55
|
)
|
|
56
56
|
await queryRunner.query(
|
|
57
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"`,
|
|
@@ -73,7 +73,7 @@ export class CreateIssuanceBranding1685628973231 implements MigrationInterface {
|
|
|
73
73
|
await queryRunner.query(`DROP INDEX "IDX_CredentialLocaleBrandingEntity_credentialBranding_locale"`)
|
|
74
74
|
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" RENAME TO "temporary_BaseLocaleBranding"`)
|
|
75
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"))`,
|
|
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, "client_uri" varchar, "tos_uri" varchar, "policy_uri" varchar, "contacts" varchar, CONSTRAINT "UQ_logoId" UNIQUE ("logoId"), CONSTRAINT "UQ_backgroundId" UNIQUE ("backgroundId"), CONSTRAINT "UQ_textId" UNIQUE ("textId"))`,
|
|
77
77
|
)
|
|
78
78
|
await queryRunner.query(
|
|
79
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"`,
|
|
@@ -5,7 +5,33 @@ export class CreateAuditEvents1701634819487 implements MigrationInterface {
|
|
|
5
5
|
|
|
6
6
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
7
|
await queryRunner.query(
|
|
8
|
-
`CREATE TABLE "AuditEvents" (
|
|
8
|
+
`CREATE TABLE "AuditEvents" (
|
|
9
|
+
"id" varchar PRIMARY KEY NOT NULL,
|
|
10
|
+
"eventType" varchar CHECK( "eventType" IN ('audit','activity','general') ) NOT NULL,
|
|
11
|
+
"timestamp" datetime NOT NULL,
|
|
12
|
+
"level" varchar CHECK( "level" IN ('0','1','2','3','4') ) NOT NULL,
|
|
13
|
+
"correlationId" varchar NOT NULL,
|
|
14
|
+
"system" varchar CHECK( "system" IN ('general','kms','identity','oid4vci','oid4vp','siopv2','PE','credentials','web3','profile','contact') ) NOT NULL,
|
|
15
|
+
"subSystemType" varchar CHECK( "subSystemType" IN ('key','did_provider','did_resolver','oid4vp_op','oid4vci_client','siopv2_op','contact_manager','vc_issuer','vc_verifier','vc_persistence','transport','profile','api') ) NOT NULL,
|
|
16
|
+
"actionType" varchar CHECK( "actionType" IN ('create','read','update','delete','execute') ) NOT NULL,
|
|
17
|
+
"actionSubType" varchar NOT NULL,
|
|
18
|
+
"initiatorType" varchar CHECK( "initiatorType" IN ('user','system','external') ) NOT NULL,
|
|
19
|
+
"systemCorrelationIdType" varchar CHECK( "systemCorrelationIdType" IN ('did','url','email','hostname','phone','user') ),
|
|
20
|
+
"systemCorrelationId" varchar,
|
|
21
|
+
"systemAlias" varchar,
|
|
22
|
+
"partyCorrelationType" varchar CHECK( "partyCorrelationType" IN ('did','url','email','hostname','phone') ),
|
|
23
|
+
"partyCorrelationId" varchar,
|
|
24
|
+
"partyAlias" varchar,
|
|
25
|
+
"credentialType" varchar CHECK( "credentialType" IN ('JSON_LD','JWT','SD_JWT','MSO_MDOC') ),
|
|
26
|
+
"credentialHash" varchar,
|
|
27
|
+
"parentCredentialHash" varchar,
|
|
28
|
+
"originalCredential" varchar,
|
|
29
|
+
"sharePurpose" varchar,
|
|
30
|
+
"description" varchar NOT NULL,
|
|
31
|
+
"data" varchar,
|
|
32
|
+
"diagnosticData" varchar,
|
|
33
|
+
"created_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
34
|
+
"last_updated_at" datetime NOT NULL DEFAULT (datetime('now')))`,
|
|
9
35
|
)
|
|
10
36
|
}
|
|
11
37
|
|
|
@@ -12,7 +12,7 @@ export class CreateDigitalCredential1708525189002 implements MigrationInterface
|
|
|
12
12
|
"document_type" varchar CHECK( "document_type" IN ('VC', 'VP', 'C', 'P') ) NOT NULL,
|
|
13
13
|
"regulation_type" varchar CHECK( "regulation_type" IN ('PID', 'QEAA', 'EAA', 'NON_REGULATED') ) NOT NULL DEFAULT 'NON_REGULATED',
|
|
14
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,
|
|
15
|
+
"credential_role" varchar CHECK( "credential_role" IN ('ISSUER', 'VERIFIER', 'HOLDER', 'FEDERATION_TRUST_ANCHOR') ) NOT NULL,
|
|
16
16
|
"raw_document" text NOT NULL,
|
|
17
17
|
"uniform_document" text NOT NULL,
|
|
18
18
|
"credential_id" text,
|