@sphereon/ssi-sdk.data-store 0.28.1-unstable.73 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contact/ContactStore.d.ts.map +1 -1
- package/dist/contact/ContactStore.js.map +1 -1
- package/dist/digitalCredential/AbstractDigitalCredentialStore.d.ts +1 -2
- package/dist/digitalCredential/AbstractDigitalCredentialStore.d.ts.map +1 -1
- package/dist/digitalCredential/AbstractDigitalCredentialStore.js.map +1 -1
- package/dist/digitalCredential/DigitalCredentialStore.d.ts +1 -2
- package/dist/digitalCredential/DigitalCredentialStore.d.ts.map +1 -1
- package/dist/digitalCredential/DigitalCredentialStore.js +4 -4
- package/dist/digitalCredential/DigitalCredentialStore.js.map +1 -1
- package/dist/entities/contact/BaseContactEntity.d.ts.map +1 -1
- package/dist/entities/contact/BaseContactEntity.js +3 -2
- package/dist/entities/contact/BaseContactEntity.js.map +1 -1
- package/dist/entities/contact/ConnectionEntity.js +2 -2
- package/dist/entities/contact/ConnectionEntity.js.map +1 -1
- package/dist/entities/contact/ContactMetadataItemEntity.d.ts +1 -0
- package/dist/entities/contact/ContactMetadataItemEntity.d.ts.map +1 -1
- package/dist/entities/contact/ContactMetadataItemEntity.js +7 -6
- package/dist/entities/contact/ContactMetadataItemEntity.js.map +1 -1
- package/dist/entities/contact/CorrelationIdentifierEntity.js +2 -2
- package/dist/entities/contact/CorrelationIdentifierEntity.js.map +1 -1
- package/dist/entities/contact/DidAuthConfigEntity.js +5 -5
- package/dist/entities/contact/DidAuthConfigEntity.js.map +1 -1
- package/dist/entities/contact/ElectronicAddressEntity.d.ts.map +1 -1
- package/dist/entities/contact/ElectronicAddressEntity.js +8 -7
- package/dist/entities/contact/ElectronicAddressEntity.js.map +1 -1
- package/dist/entities/contact/IdentityEntity.d.ts.map +1 -1
- package/dist/entities/contact/IdentityEntity.js +7 -6
- package/dist/entities/contact/IdentityEntity.js.map +1 -1
- package/dist/entities/contact/IdentityMetadataItemEntity.d.ts +1 -0
- package/dist/entities/contact/IdentityMetadataItemEntity.d.ts.map +1 -1
- package/dist/entities/contact/IdentityMetadataItemEntity.js +7 -6
- package/dist/entities/contact/IdentityMetadataItemEntity.js.map +1 -1
- package/dist/entities/contact/NaturalPersonEntity.js +6 -6
- package/dist/entities/contact/NaturalPersonEntity.js.map +1 -1
- package/dist/entities/contact/OpenIdConfigEntity.js +5 -5
- package/dist/entities/contact/OpenIdConfigEntity.js.map +1 -1
- package/dist/entities/contact/OrganizationEntity.d.ts +0 -2
- package/dist/entities/contact/OrganizationEntity.d.ts.map +1 -1
- package/dist/entities/contact/OrganizationEntity.js +6 -12
- package/dist/entities/contact/OrganizationEntity.js.map +1 -1
- package/dist/entities/contact/PartyEntity.d.ts.map +1 -1
- package/dist/entities/contact/PartyEntity.js +6 -5
- package/dist/entities/contact/PartyEntity.js.map +1 -1
- package/dist/entities/contact/PartyRelationshipEntity.d.ts.map +1 -1
- package/dist/entities/contact/PartyRelationshipEntity.js +7 -6
- package/dist/entities/contact/PartyRelationshipEntity.js.map +1 -1
- package/dist/entities/contact/PartyTypeEntity.d.ts.map +1 -1
- package/dist/entities/contact/PartyTypeEntity.js +6 -5
- package/dist/entities/contact/PartyTypeEntity.js.map +1 -1
- package/dist/entities/contact/PhysicalAddressEntity.d.ts.map +1 -1
- package/dist/entities/contact/PhysicalAddressEntity.js +14 -13
- package/dist/entities/contact/PhysicalAddressEntity.js.map +1 -1
- package/dist/entities/digitalCredential/DigitalCredentialEntity.d.ts +1 -2
- package/dist/entities/digitalCredential/DigitalCredentialEntity.d.ts.map +1 -1
- package/dist/entities/digitalCredential/DigitalCredentialEntity.js +12 -12
- package/dist/entities/digitalCredential/DigitalCredentialEntity.js.map +1 -1
- package/dist/entities/eventLogger/AuditEventEntity.d.ts.map +1 -1
- package/dist/entities/eventLogger/AuditEventEntity.js +13 -12
- package/dist/entities/eventLogger/AuditEventEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.js +1 -1
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/BaseLocaleBrandingEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/BaseLocaleBrandingEntity.js +6 -5
- package/dist/entities/issuanceBranding/BaseLocaleBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.js +5 -4
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.js +1 -1
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/ImageAttributesEntity.js +4 -4
- package/dist/entities/issuanceBranding/ImageAttributesEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.js +2 -2
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.js +4 -3
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.js +1 -1
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/TextAttributesEntity.js +1 -1
- package/dist/entities/issuanceBranding/TextAttributesEntity.js.map +1 -1
- package/dist/entities/machineState/MachineStateInfoEntity.d.ts.map +1 -1
- package/dist/entities/machineState/MachineStateInfoEntity.js +5 -4
- package/dist/entities/machineState/MachineStateInfoEntity.js.map +1 -1
- package/dist/entities/presentationDefinition/PresentationDefinitionItemEntity.d.ts.map +1 -1
- package/dist/entities/presentationDefinition/PresentationDefinitionItemEntity.js +8 -7
- package/dist/entities/presentationDefinition/PresentationDefinitionItemEntity.js.map +1 -1
- package/dist/entities/statusList2021/StatusList2021Entity.js +1 -1
- package/dist/entities/statusList2021/StatusList2021Entity.js.map +1 -1
- package/dist/entities/statusList2021/StatusList2021EntryEntity.js +5 -5
- package/dist/entities/statusList2021/StatusList2021EntryEntity.js.map +1 -1
- package/dist/types/contact/contact.d.ts +7 -0
- package/dist/types/contact/contact.d.ts.map +1 -1
- package/dist/types/contact/contact.js.map +1 -1
- package/package.json +6 -5
- package/src/__tests__/contact.entities.test.ts +3 -0
- package/src/__tests__/contact.store.test.ts +2 -0
- package/src/__tests__/digitalCredential.entities.test.ts +2 -0
- package/src/__tests__/digitalCredential.store.test.ts +2 -0
- package/src/__tests__/eventLogger.entities.test.ts +2 -0
- package/src/__tests__/eventLogger.store.test.ts +3 -1
- package/src/__tests__/issuanceBranding.entities.test.ts +2 -0
- package/src/__tests__/issuanceBranding.store.test.ts +2 -0
- package/src/__tests__/machineState.entities.test.ts +2 -0
- package/src/__tests__/machineState.store.test.ts +2 -0
- package/src/__tests__/pd-manager.entities.test.ts +2 -0
- package/src/__tests__/pd-manager.store.test.ts +2 -0
- package/src/contact/ContactStore.ts +1 -0
- package/src/digitalCredential/AbstractDigitalCredentialStore.ts +6 -2
- package/src/digitalCredential/DigitalCredentialStore.ts +4 -2
- package/src/entities/contact/BaseContactEntity.ts +3 -2
- package/src/entities/contact/ConnectionEntity.ts +2 -2
- package/src/entities/contact/ContactMetadataItemEntity.ts +8 -7
- package/src/entities/contact/CorrelationIdentifierEntity.ts +2 -2
- package/src/entities/contact/DidAuthConfigEntity.ts +5 -5
- package/src/entities/contact/ElectronicAddressEntity.ts +8 -7
- package/src/entities/contact/IdentityEntity.ts +7 -6
- package/src/entities/contact/IdentityMetadataItemEntity.ts +8 -7
- package/src/entities/contact/NaturalPersonEntity.ts +6 -6
- package/src/entities/contact/OpenIdConfigEntity.ts +5 -5
- package/src/entities/contact/OrganizationEntity.ts +9 -14
- package/src/entities/contact/PartyEntity.ts +6 -5
- package/src/entities/contact/PartyRelationshipEntity.ts +7 -6
- package/src/entities/contact/PartyTypeEntity.ts +6 -5
- package/src/entities/contact/PhysicalAddressEntity.ts +14 -13
- package/src/entities/digitalCredential/DigitalCredentialEntity.ts +8 -13
- package/src/entities/eventLogger/AuditEventEntity.ts +13 -12
- package/src/entities/issuanceBranding/BackgroundAttributesEntity.ts +1 -1
- package/src/entities/issuanceBranding/BaseLocaleBrandingEntity.ts +6 -5
- package/src/entities/issuanceBranding/CredentialBrandingEntity.ts +5 -4
- package/src/entities/issuanceBranding/CredentialLocaleBrandingEntity.ts +1 -1
- package/src/entities/issuanceBranding/ImageAttributesEntity.ts +4 -4
- package/src/entities/issuanceBranding/ImageDimensionsEntity.ts +2 -2
- package/src/entities/issuanceBranding/IssuerBrandingEntity.ts +4 -3
- package/src/entities/issuanceBranding/IssuerLocaleBrandingEntity.ts +1 -1
- package/src/entities/issuanceBranding/TextAttributesEntity.ts +1 -1
- package/src/entities/machineState/MachineStateInfoEntity.ts +5 -4
- package/src/entities/presentationDefinition/PresentationDefinitionItemEntity.ts +8 -7
- package/src/entities/statusList2021/StatusList2021Entity.ts +1 -1
- package/src/entities/statusList2021/StatusList2021EntryEntity.ts +5 -5
- package/src/types/contact/contact.ts +9 -0
- package/dist/entities/contact/IMetadataEntity.d.ts +0 -8
- package/dist/entities/contact/IMetadataEntity.d.ts.map +0 -1
- package/dist/entities/contact/IMetadataEntity.js +0 -2
- package/dist/entities/contact/IMetadataEntity.js.map +0 -1
- package/src/entities/contact/IMetadataEntity.ts +0 -8
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
CreateDateColumn,
|
|
11
11
|
UpdateDateColumn,
|
|
12
12
|
} from 'typeorm'
|
|
13
|
+
import {TYPEORM_DATE_TIME_TYPE} from "@sphereon/ssi-sdk.agent-config";
|
|
13
14
|
import { PartyEntity } from './PartyEntity'
|
|
14
15
|
import { getConstraint } from '../../utils/ValidatorUtils'
|
|
15
16
|
import { ElectronicAddressType, ValidationConstraint } from '../../types'
|
|
@@ -19,11 +20,11 @@ export class ElectronicAddressEntity extends BaseEntity {
|
|
|
19
20
|
@PrimaryGeneratedColumn('uuid')
|
|
20
21
|
id!: string
|
|
21
22
|
|
|
22
|
-
@Column({ name: 'type', length: 255, nullable: false })
|
|
23
|
+
@Column('varchar', { name: 'type', length: 255, nullable: false })
|
|
23
24
|
@IsNotEmpty({ message: 'Blank electronic address types are not allowed' })
|
|
24
25
|
type!: ElectronicAddressType
|
|
25
26
|
|
|
26
|
-
@Column({ name: 'electronic_address', length: 255, nullable: false })
|
|
27
|
+
@Column('varchar', { name: 'electronic_address', length: 255, nullable: false })
|
|
27
28
|
@IsNotEmpty({ message: 'Blank electronic addresses are not allowed' })
|
|
28
29
|
electronicAddress!: string
|
|
29
30
|
|
|
@@ -32,19 +33,19 @@ export class ElectronicAddressEntity extends BaseEntity {
|
|
|
32
33
|
})
|
|
33
34
|
party!: PartyEntity
|
|
34
35
|
|
|
35
|
-
@Column({ name: 'partyId', nullable: true })
|
|
36
|
+
@Column('text', { name: 'partyId', nullable: true })
|
|
36
37
|
partyId?: string
|
|
37
38
|
|
|
38
|
-
@Column({ name: 'owner_id', nullable: true })
|
|
39
|
+
@Column('text', { name: 'owner_id', nullable: true })
|
|
39
40
|
ownerId?: string
|
|
40
41
|
|
|
41
|
-
@Column({ name: 'tenant_id', nullable: true })
|
|
42
|
+
@Column('text', { name: 'tenant_id', nullable: true })
|
|
42
43
|
tenantId?: string
|
|
43
44
|
|
|
44
|
-
@CreateDateColumn({ name: 'created_at', nullable: false })
|
|
45
|
+
@CreateDateColumn({ name: 'created_at', nullable: false, type: TYPEORM_DATE_TIME_TYPE })
|
|
45
46
|
createdAt!: Date
|
|
46
47
|
|
|
47
|
-
@UpdateDateColumn({ name: 'last_updated_at', nullable: false })
|
|
48
|
+
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type: TYPEORM_DATE_TIME_TYPE })
|
|
48
49
|
lastUpdatedAt!: Date
|
|
49
50
|
|
|
50
51
|
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
BeforeUpdate,
|
|
14
14
|
} from 'typeorm'
|
|
15
15
|
import { IsNotEmpty, validate, ValidationError } from 'class-validator'
|
|
16
|
+
import {TYPEORM_DATE_TIME_TYPE} from "@sphereon/ssi-sdk.agent-config";
|
|
16
17
|
import { CorrelationIdentifierEntity } from './CorrelationIdentifierEntity'
|
|
17
18
|
import { ConnectionEntity } from './ConnectionEntity'
|
|
18
19
|
import { IdentityMetadataItemEntity } from './IdentityMetadataItemEntity'
|
|
@@ -25,7 +26,7 @@ export class IdentityEntity extends BaseEntity {
|
|
|
25
26
|
@PrimaryGeneratedColumn('uuid')
|
|
26
27
|
id!: string
|
|
27
28
|
|
|
28
|
-
@Column({
|
|
29
|
+
@Column('varchar', {
|
|
29
30
|
name: 'alias',
|
|
30
31
|
length: 255,
|
|
31
32
|
nullable: false,
|
|
@@ -37,10 +38,10 @@ export class IdentityEntity extends BaseEntity {
|
|
|
37
38
|
@Column('simple-enum', { name: 'origin', enum: IdentityOrigin, nullable: false })
|
|
38
39
|
origin!: IdentityOrigin
|
|
39
40
|
|
|
40
|
-
@Column({ name: 'owner_id', nullable: true })
|
|
41
|
+
@Column('text', { name: 'owner_id', nullable: true })
|
|
41
42
|
ownerId?: string
|
|
42
43
|
|
|
43
|
-
@Column({ name: 'tenant_id', nullable: true })
|
|
44
|
+
@Column('text', { name: 'tenant_id', nullable: true })
|
|
44
45
|
tenantId?: string
|
|
45
46
|
|
|
46
47
|
@Column('simple-array', { name: 'roles', nullable: false })
|
|
@@ -70,10 +71,10 @@ export class IdentityEntity extends BaseEntity {
|
|
|
70
71
|
@JoinColumn({ name: 'metadata_id' }) // TODO check in db file
|
|
71
72
|
metadata!: Array<IdentityMetadataItemEntity>
|
|
72
73
|
|
|
73
|
-
@CreateDateColumn({ name: 'created_at', nullable: false })
|
|
74
|
+
@CreateDateColumn({ name: 'created_at', nullable: false , type: TYPEORM_DATE_TIME_TYPE})
|
|
74
75
|
createdAt!: Date
|
|
75
76
|
|
|
76
|
-
@UpdateDateColumn({ name: 'last_updated_at', nullable: false })
|
|
77
|
+
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type: TYPEORM_DATE_TIME_TYPE })
|
|
77
78
|
lastUpdatedAt!: Date
|
|
78
79
|
|
|
79
80
|
@ManyToOne(() => PartyEntity, (party: PartyEntity) => party.identities, {
|
|
@@ -81,7 +82,7 @@ export class IdentityEntity extends BaseEntity {
|
|
|
81
82
|
})
|
|
82
83
|
party!: PartyEntity
|
|
83
84
|
|
|
84
|
-
@Column({ name: 'partyId', nullable: true })
|
|
85
|
+
@Column('text', { name: 'partyId', nullable: true })
|
|
85
86
|
partyId?: string
|
|
86
87
|
|
|
87
88
|
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import {TYPEORM_DATE_TIME_TYPE} from "@sphereon/ssi-sdk.agent-config";
|
|
1
2
|
import { Entity, Column, PrimaryGeneratedColumn, BaseEntity, ManyToOne, BeforeInsert, BeforeUpdate } from 'typeorm'
|
|
2
|
-
import { ValidationConstraint } from '../../types'
|
|
3
|
+
import { IMetadataEntity, ValidationConstraint } from '../../types'
|
|
3
4
|
import { IdentityEntity } from './IdentityEntity'
|
|
4
5
|
import { IsNotEmpty, validate, ValidationError } from 'class-validator'
|
|
5
6
|
import { getConstraint } from '../../utils/ValidatorUtils'
|
|
@@ -9,24 +10,24 @@ export class IdentityMetadataItemEntity extends BaseEntity implements IMetadataE
|
|
|
9
10
|
@PrimaryGeneratedColumn('uuid')
|
|
10
11
|
id!: string
|
|
11
12
|
|
|
12
|
-
@Column({ name: 'label', length: 255, nullable: false })
|
|
13
|
+
@Column('varchar', { name: 'label', length: 255, nullable: false })
|
|
13
14
|
@IsNotEmpty({ message: 'Blank metadata labels are not allowed' })
|
|
14
15
|
label!: string
|
|
15
16
|
|
|
16
|
-
@Column({ name: 'valueType', nullable: false })
|
|
17
|
+
@Column('varchar', { name: 'valueType', nullable: false })
|
|
17
18
|
@IsNotEmpty({ message: 'valueType must not be empty' })
|
|
18
19
|
valueType!: string
|
|
19
20
|
|
|
20
|
-
@Column({ name: 'stringValue', length: 255, nullable: true })
|
|
21
|
+
@Column('varchar', { name: 'stringValue', length: 255, nullable: true })
|
|
21
22
|
stringValue?: string
|
|
22
23
|
|
|
23
|
-
@Column({ name: 'numberValue', nullable: true })
|
|
24
|
+
@Column('numeric', { name: 'numberValue', nullable: true })
|
|
24
25
|
numberValue?: number
|
|
25
26
|
|
|
26
|
-
@Column({ name: 'dateValue', nullable: true })
|
|
27
|
+
@Column({ name: 'dateValue', nullable: true, type: TYPEORM_DATE_TIME_TYPE })
|
|
27
28
|
dateValue?: Date
|
|
28
29
|
|
|
29
|
-
@Column({ name: 'boolValue', nullable: true })
|
|
30
|
+
@Column('boolean', { name: 'boolValue', nullable: true })
|
|
30
31
|
boolValue?: boolean
|
|
31
32
|
|
|
32
33
|
@ManyToOne(() => IdentityEntity, (identity: IdentityEntity) => identity.metadata, { cascade: ['insert', 'update'], onDelete: 'CASCADE' })
|
|
@@ -7,26 +7,26 @@ import { getConstraint } from '../../utils/ValidatorUtils'
|
|
|
7
7
|
|
|
8
8
|
@ChildEntity('NaturalPerson')
|
|
9
9
|
export class NaturalPersonEntity extends BaseContactEntity {
|
|
10
|
-
@Column({ name: 'first_name', length: 255, nullable: false, unique: false })
|
|
10
|
+
@Column('varchar', { name: 'first_name', length: 255, nullable: false, unique: false })
|
|
11
11
|
@IsNotEmpty({ message: 'Blank first names are not allowed' })
|
|
12
12
|
firstName!: string
|
|
13
13
|
|
|
14
|
-
@Column({ name: 'middle_name', length: 255, nullable: true, unique: false })
|
|
14
|
+
@Column('varchar', { name: 'middle_name', length: 255, nullable: true, unique: false })
|
|
15
15
|
@Validate(IsNonEmptyStringConstraint, { message: 'Blank middle names are not allowed' })
|
|
16
16
|
middleName?: string
|
|
17
17
|
|
|
18
|
-
@Column({ name: 'last_name', length: 255, nullable: false, unique: false })
|
|
18
|
+
@Column('varchar', { name: 'last_name', length: 255, nullable: false, unique: false })
|
|
19
19
|
@IsNotEmpty({ message: 'Blank last names are not allowed' })
|
|
20
20
|
lastName!: string
|
|
21
21
|
|
|
22
|
-
@Column({ name: 'display_name', length: 255, nullable: false, unique: false })
|
|
22
|
+
@Column('varchar', { name: 'display_name', length: 255, nullable: false, unique: false })
|
|
23
23
|
@IsNotEmpty({ message: 'Blank display names are not allowed' })
|
|
24
24
|
displayName!: string
|
|
25
25
|
|
|
26
|
-
@Column({ name: 'owner_id', nullable: true })
|
|
26
|
+
@Column('text', { name: 'owner_id', nullable: true })
|
|
27
27
|
ownerId?: string
|
|
28
28
|
|
|
29
|
-
@Column({ name: 'tenant_id', nullable: true })
|
|
29
|
+
@Column('text', { name: 'tenant_id', nullable: true })
|
|
30
30
|
tenantId?: string
|
|
31
31
|
|
|
32
32
|
@BeforeInsert()
|
|
@@ -3,16 +3,16 @@ import { BaseConfigEntity } from './BaseConfigEntity'
|
|
|
3
3
|
|
|
4
4
|
@ChildEntity('OpenIdConfig')
|
|
5
5
|
export class OpenIdConfigEntity extends BaseConfigEntity {
|
|
6
|
-
@Column({ name: 'client_id', length: 255, nullable: false })
|
|
6
|
+
@Column('varchar', { name: 'client_id', length: 255, nullable: false })
|
|
7
7
|
clientId!: string
|
|
8
8
|
|
|
9
|
-
@Column({ name: 'client_secret', length: 255, nullable: false })
|
|
9
|
+
@Column('varchar', { name: 'client_secret', length: 255, nullable: false })
|
|
10
10
|
clientSecret!: string
|
|
11
11
|
|
|
12
12
|
@Column('simple-array', { name: 'scopes', nullable: false })
|
|
13
13
|
scopes!: Array<string>
|
|
14
14
|
|
|
15
|
-
@Column({ name: 'issuer', length: 255, nullable: false })
|
|
15
|
+
@Column('varchar', { name: 'issuer', length: 255, nullable: false })
|
|
16
16
|
issuer!: string
|
|
17
17
|
|
|
18
18
|
@Column('text', { name: 'redirect_url', nullable: false })
|
|
@@ -24,9 +24,9 @@ export class OpenIdConfigEntity extends BaseConfigEntity {
|
|
|
24
24
|
@Column('text', { name: 'client_auth_method', nullable: false })
|
|
25
25
|
clientAuthMethod!: 'basic' | 'post' | undefined
|
|
26
26
|
|
|
27
|
-
@Column({ name: 'owner_id', nullable: true })
|
|
27
|
+
@Column('text', { name: 'owner_id', nullable: true })
|
|
28
28
|
ownerId?: string
|
|
29
29
|
|
|
30
|
-
@Column({ name: 'tenant_id', nullable: true })
|
|
30
|
+
@Column('text', { name: 'tenant_id', nullable: true })
|
|
31
31
|
tenantId?: string
|
|
32
32
|
}
|
|
@@ -1,30 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { getConstraint } from '../../utils/ValidatorUtils'
|
|
1
|
+
import {IsNotEmpty, validate, ValidationError} from 'class-validator'
|
|
2
|
+
import {BeforeInsert, BeforeUpdate, ChildEntity, Column} from 'typeorm'
|
|
3
|
+
import {ValidationConstraint} from '../../types'
|
|
4
|
+
import {getConstraint} from '../../utils/ValidatorUtils'
|
|
5
|
+
import {BaseContactEntity} from './BaseContactEntity'
|
|
7
6
|
|
|
8
7
|
@ChildEntity('Organization')
|
|
9
8
|
export class OrganizationEntity extends BaseContactEntity {
|
|
10
|
-
@Column({ name: 'legal_name', length: 255, nullable: false, unique: true })
|
|
9
|
+
@Column('varchar', { name: 'legal_name', length: 255, nullable: false, unique: true })
|
|
11
10
|
@IsNotEmpty({ message: 'Blank legal names are not allowed' })
|
|
12
11
|
legalName!: string
|
|
13
12
|
|
|
14
|
-
@Column({ name: 'display_name', length: 255, nullable: false, unique: false })
|
|
13
|
+
@Column('varchar', { name: 'display_name', length: 255, nullable: false, unique: false })
|
|
15
14
|
@IsNotEmpty({ message: 'Blank display names are not allowed' })
|
|
16
15
|
displayName!: string
|
|
17
16
|
|
|
18
|
-
@Column({ name: 'owner_id', nullable: true })
|
|
17
|
+
@Column('text', { name: 'owner_id', nullable: true })
|
|
19
18
|
ownerId?: string
|
|
20
19
|
|
|
21
|
-
@Column({ name: 'tenant_id', nullable: true })
|
|
20
|
+
@Column('text', { name: 'tenant_id', nullable: true })
|
|
22
21
|
tenantId?: string
|
|
23
22
|
|
|
24
|
-
@OneToOne(() => PartyEntity)
|
|
25
|
-
@JoinColumn({ name: 'party_id' })
|
|
26
|
-
party!: PartyEntity
|
|
27
|
-
|
|
28
23
|
@BeforeInsert()
|
|
29
24
|
@BeforeUpdate()
|
|
30
25
|
async validate(): Promise<void> {
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
UpdateDateColumn,
|
|
14
14
|
} from 'typeorm'
|
|
15
15
|
import { ValidationConstraint } from '../../types'
|
|
16
|
+
import {TYPEORM_DATE_TIME_TYPE} from "@sphereon/ssi-sdk.agent-config";
|
|
16
17
|
import { IdentityEntity } from './IdentityEntity'
|
|
17
18
|
import { validate, ValidationError } from 'class-validator'
|
|
18
19
|
import { PartyTypeEntity } from './PartyTypeEntity'
|
|
@@ -27,13 +28,13 @@ export class PartyEntity extends BaseEntity {
|
|
|
27
28
|
@PrimaryGeneratedColumn('uuid')
|
|
28
29
|
id!: string
|
|
29
30
|
|
|
30
|
-
@Column({ name: 'uri', length: 255, nullable: true })
|
|
31
|
+
@Column('varchar', { name: 'uri', length: 255, nullable: true })
|
|
31
32
|
uri?: string
|
|
32
33
|
|
|
33
|
-
@Column({ name: 'owner_id', nullable: true })
|
|
34
|
+
@Column('text', { name: 'owner_id', nullable: true })
|
|
34
35
|
ownerId?: string
|
|
35
36
|
|
|
36
|
-
@Column({ name: 'tenant_id', nullable: true })
|
|
37
|
+
@Column('text', { name: 'tenant_id', nullable: true })
|
|
37
38
|
tenantId?: string
|
|
38
39
|
|
|
39
40
|
@OneToMany(() => IdentityEntity, (identity: IdentityEntity) => identity.party, {
|
|
@@ -88,10 +89,10 @@ export class PartyEntity extends BaseEntity {
|
|
|
88
89
|
@JoinColumn({ name: 'relationship_id' })
|
|
89
90
|
relationships!: Array<PartyRelationshipEntity>
|
|
90
91
|
|
|
91
|
-
@CreateDateColumn({ name: 'created_at', nullable: false })
|
|
92
|
+
@CreateDateColumn({ name: 'created_at', nullable: false, type: TYPEORM_DATE_TIME_TYPE })
|
|
92
93
|
createdAt!: Date
|
|
93
94
|
|
|
94
|
-
@UpdateDateColumn({ name: 'last_updated_at', nullable: false })
|
|
95
|
+
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type: TYPEORM_DATE_TIME_TYPE })
|
|
95
96
|
lastUpdatedAt!: Date
|
|
96
97
|
|
|
97
98
|
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
BeforeUpdate,
|
|
11
11
|
JoinColumn,
|
|
12
12
|
} from 'typeorm'
|
|
13
|
+
import {TYPEORM_DATE_TIME_TYPE} from "@sphereon/ssi-sdk.agent-config";
|
|
13
14
|
import { PartyEntity } from './PartyEntity'
|
|
14
15
|
|
|
15
16
|
@Entity('PartyRelationship')
|
|
@@ -25,7 +26,7 @@ export class PartyRelationshipEntity {
|
|
|
25
26
|
@JoinColumn({ name: 'left_id' })
|
|
26
27
|
left!: PartyEntity
|
|
27
28
|
|
|
28
|
-
@Column({ name: 'left_id', nullable: false })
|
|
29
|
+
@Column('text', { name: 'left_id', nullable: false })
|
|
29
30
|
leftId!: string
|
|
30
31
|
|
|
31
32
|
@ManyToOne(() => PartyEntity, {
|
|
@@ -35,19 +36,19 @@ export class PartyRelationshipEntity {
|
|
|
35
36
|
@JoinColumn({ name: 'right_id' })
|
|
36
37
|
right!: PartyEntity
|
|
37
38
|
|
|
38
|
-
@Column({ name: 'right_id', nullable: false })
|
|
39
|
+
@Column('text', { name: 'right_id', nullable: false })
|
|
39
40
|
rightId!: string
|
|
40
41
|
|
|
41
|
-
@Column({ name: 'owner_id', nullable: true })
|
|
42
|
+
@Column('text', { name: 'owner_id', nullable: true })
|
|
42
43
|
ownerId?: string
|
|
43
44
|
|
|
44
|
-
@Column({ name: 'tenant_id', nullable: true })
|
|
45
|
+
@Column('text', { name: 'tenant_id', nullable: true })
|
|
45
46
|
tenantId?: string
|
|
46
47
|
|
|
47
|
-
@CreateDateColumn({ name: 'created_at', nullable: false })
|
|
48
|
+
@CreateDateColumn({ name: 'created_at', nullable: false, type: TYPEORM_DATE_TIME_TYPE })
|
|
48
49
|
createdAt!: Date
|
|
49
50
|
|
|
50
|
-
@UpdateDateColumn({ name: 'last_updated_at', nullable: false })
|
|
51
|
+
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type: TYPEORM_DATE_TIME_TYPE })
|
|
51
52
|
lastUpdatedAt!: Date
|
|
52
53
|
|
|
53
54
|
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BeforeInsert, BeforeUpdate, Column, CreateDateColumn, Entity, Index, OneToMany, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'
|
|
2
|
+
import {TYPEORM_DATE_TIME_TYPE} from "@sphereon/ssi-sdk.agent-config";
|
|
2
3
|
import { PartyEntity } from './PartyEntity'
|
|
3
4
|
import { PartyOrigin, PartyTypeType, ValidationConstraint } from '../../types'
|
|
4
5
|
import { IsNotEmpty, Validate, validate, ValidationError } from 'class-validator'
|
|
@@ -17,15 +18,15 @@ export class PartyTypeEntity {
|
|
|
17
18
|
@Column('simple-enum', { name: 'origin', enum: PartyOrigin, nullable: false, unique: false })
|
|
18
19
|
origin!: PartyOrigin
|
|
19
20
|
|
|
20
|
-
@Column({ name: 'name', length: 255, nullable: false, unique: true })
|
|
21
|
+
@Column('varchar', { name: 'name', length: 255, nullable: false, unique: true })
|
|
21
22
|
@IsNotEmpty({ message: 'Blank names are not allowed' })
|
|
22
23
|
name!: string
|
|
23
24
|
|
|
24
|
-
@Column({ name: 'description', length: 255, nullable: true })
|
|
25
|
+
@Column('varchar', { name: 'description', length: 255, nullable: true })
|
|
25
26
|
@Validate(IsNonEmptyStringConstraint, { message: 'Blank descriptions are not allowed' })
|
|
26
27
|
description?: string
|
|
27
28
|
|
|
28
|
-
@Column({ name: 'tenant_id', length: 255, nullable: true })
|
|
29
|
+
@Column({ name: 'tenant_id', type: 'varchar', length: 255, nullable: true })
|
|
29
30
|
@IsNotEmpty({ message: "Blank tenant id's are not allowed" })
|
|
30
31
|
tenantId!: string
|
|
31
32
|
|
|
@@ -34,10 +35,10 @@ export class PartyTypeEntity {
|
|
|
34
35
|
})
|
|
35
36
|
parties!: Array<PartyEntity>
|
|
36
37
|
|
|
37
|
-
@CreateDateColumn({ name: 'created_at', nullable: false })
|
|
38
|
+
@CreateDateColumn({ name: 'created_at', nullable: false, type: TYPEORM_DATE_TIME_TYPE })
|
|
38
39
|
createdAt!: Date
|
|
39
40
|
|
|
40
|
-
@UpdateDateColumn({ name: 'last_updated_at', nullable: false })
|
|
41
|
+
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type: TYPEORM_DATE_TIME_TYPE })
|
|
41
42
|
lastUpdatedAt!: Date
|
|
42
43
|
|
|
43
44
|
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
PrimaryGeneratedColumn,
|
|
11
11
|
UpdateDateColumn,
|
|
12
12
|
} from 'typeorm'
|
|
13
|
+
import {TYPEORM_DATE_TIME_TYPE} from "@sphereon/ssi-sdk.agent-config";
|
|
13
14
|
import { getConstraint } from '../../utils/ValidatorUtils'
|
|
14
15
|
import { PhysicalAddressType, ValidationConstraint } from '../../types'
|
|
15
16
|
import { PartyEntity } from './PartyEntity'
|
|
@@ -20,42 +21,42 @@ export class PhysicalAddressEntity extends BaseEntity {
|
|
|
20
21
|
@PrimaryGeneratedColumn('uuid')
|
|
21
22
|
id!: string
|
|
22
23
|
|
|
23
|
-
@Column({ name: 'type', length: 255, nullable: false })
|
|
24
|
+
@Column('varchar', { name: 'type', length: 255, nullable: false })
|
|
24
25
|
@IsNotEmpty({ message: 'Blank physical address types are not allowed' })
|
|
25
26
|
type!: PhysicalAddressType
|
|
26
27
|
|
|
27
|
-
@Column({ name: 'street_name', length: 255, nullable: false })
|
|
28
|
+
@Column('varchar', { name: 'street_name', length: 255, nullable: false })
|
|
28
29
|
@IsNotEmpty({ message: 'Blank street names are not allowed' })
|
|
29
30
|
streetName!: string
|
|
30
31
|
|
|
31
|
-
@Column({ name: 'street_number', length: 255, nullable: false })
|
|
32
|
+
@Column('varchar', { name: 'street_number', length: 255, nullable: false })
|
|
32
33
|
@IsNotEmpty({ message: 'Blank street numbers are not allowed' })
|
|
33
34
|
streetNumber!: string
|
|
34
35
|
|
|
35
|
-
@Column({ name: 'postal_code', length: 255, nullable: false })
|
|
36
|
+
@Column('varchar', { name: 'postal_code', length: 255, nullable: false })
|
|
36
37
|
@IsNotEmpty({ message: 'Blank postal codes are not allowed' })
|
|
37
38
|
postalCode!: string
|
|
38
39
|
|
|
39
|
-
@Column({ name: 'city_name', length: 255, nullable: false })
|
|
40
|
+
@Column('varchar', { name: 'city_name', length: 255, nullable: false })
|
|
40
41
|
@IsNotEmpty({ message: 'Blank city names are not allowed' })
|
|
41
42
|
cityName!: string
|
|
42
43
|
|
|
43
|
-
@Column({ name: 'province_name', length: 255, nullable: false })
|
|
44
|
+
@Column('varchar', { name: 'province_name', length: 255, nullable: false })
|
|
44
45
|
@IsNotEmpty({ message: 'Blank province names are not allowed' })
|
|
45
46
|
provinceName!: string
|
|
46
47
|
|
|
47
|
-
@Column({ name: 'country_code', length: 2, nullable: false })
|
|
48
|
+
@Column('varchar', { name: 'country_code', length: 2, nullable: false })
|
|
48
49
|
@IsNotEmpty({ message: 'Blank country codes are not allowed' })
|
|
49
50
|
countryCode!: string
|
|
50
51
|
|
|
51
|
-
@Column({ name: 'building_name', length: 255, nullable: true })
|
|
52
|
+
@Column('varchar', { name: 'building_name', length: 255, nullable: true })
|
|
52
53
|
@Validate(IsNonEmptyStringConstraint, { message: 'Blank building names are not allowed' })
|
|
53
54
|
buildingName?: string
|
|
54
55
|
|
|
55
|
-
@Column({ name: 'owner_id', nullable: true })
|
|
56
|
+
@Column('text', { name: 'owner_id', nullable: true })
|
|
56
57
|
ownerId?: string
|
|
57
58
|
|
|
58
|
-
@Column({ name: 'tenant_id', nullable: true })
|
|
59
|
+
@Column('text', { name: 'tenant_id', nullable: true })
|
|
59
60
|
tenantId?: string
|
|
60
61
|
|
|
61
62
|
@ManyToOne(() => PartyEntity, (party: PartyEntity) => party.physicalAddresses, {
|
|
@@ -63,13 +64,13 @@ export class PhysicalAddressEntity extends BaseEntity {
|
|
|
63
64
|
})
|
|
64
65
|
party!: PartyEntity
|
|
65
66
|
|
|
66
|
-
@Column({ name: 'partyId', nullable: true })
|
|
67
|
+
@Column('text', { name: 'partyId', nullable: true })
|
|
67
68
|
partyId?: string
|
|
68
69
|
|
|
69
|
-
@CreateDateColumn({ name: 'created_at', nullable: false })
|
|
70
|
+
@CreateDateColumn({ name: 'created_at', nullable: false, type: TYPEORM_DATE_TIME_TYPE })
|
|
70
71
|
createdAt!: Date
|
|
71
72
|
|
|
72
|
-
@UpdateDateColumn({ name: 'last_updated_at', nullable: false })
|
|
73
|
+
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type: TYPEORM_DATE_TIME_TYPE })
|
|
73
74
|
lastUpdatedAt!: Date
|
|
74
75
|
|
|
75
76
|
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { BaseEntity, Column, CreateDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
CredentialDocumentFormat,
|
|
5
|
-
CredentialStateType,
|
|
6
|
-
DocumentType,
|
|
7
|
-
} from '../../types/digitalCredential/digitalCredential'
|
|
8
|
-
import { CredentialRole } from '../../types'
|
|
2
|
+
import { CredentialCorrelationType, CredentialDocumentFormat, CredentialRole, CredentialStateType, DocumentType } from '../../types'
|
|
3
|
+
import {TYPEORM_DATE_TIME_TYPE, TYPEORM_DATE_TYPE} from "@sphereon/ssi-sdk.agent-config";
|
|
9
4
|
|
|
10
5
|
@Entity('DigitalCredential')
|
|
11
6
|
export class DigitalCredentialEntity extends BaseEntity {
|
|
@@ -51,21 +46,21 @@ export class DigitalCredentialEntity extends BaseEntity {
|
|
|
51
46
|
@Column('text', { name: 'tenant_id', nullable: true })
|
|
52
47
|
tenantId?: string
|
|
53
48
|
|
|
54
|
-
@CreateDateColumn({ name: 'created_at', nullable: false })
|
|
49
|
+
@CreateDateColumn({ name: 'created_at', nullable: false, type: TYPEORM_DATE_TIME_TYPE })
|
|
55
50
|
createdAt!: Date
|
|
56
51
|
|
|
57
|
-
@UpdateDateColumn({ name: 'last_updated_at', nullable: false })
|
|
52
|
+
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type: TYPEORM_DATE_TIME_TYPE })
|
|
58
53
|
lastUpdatedAt!: Date
|
|
59
54
|
|
|
60
|
-
@Column(
|
|
55
|
+
@Column({ name: 'valid_until', nullable: true, type: TYPEORM_DATE_TYPE })
|
|
61
56
|
validUntil?: Date
|
|
62
57
|
|
|
63
|
-
@Column(
|
|
58
|
+
@Column({ name: 'valid_from', nullable: true, type: TYPEORM_DATE_TYPE })
|
|
64
59
|
validFrom?: Date
|
|
65
60
|
|
|
66
|
-
@Column(
|
|
61
|
+
@Column( { name: 'verified_at', nullable: true, type: TYPEORM_DATE_TIME_TYPE })
|
|
67
62
|
verifiedAt?: Date
|
|
68
63
|
|
|
69
|
-
@Column(
|
|
64
|
+
@Column({ name: 'revoked_at', nullable: true, type: TYPEORM_DATE_TIME_TYPE })
|
|
70
65
|
revokedAt?: Date
|
|
71
66
|
}
|
|
@@ -2,19 +2,20 @@ import { ActionSubType, ActionType, InitiatorType, LogLevel, SubSystem, System,
|
|
|
2
2
|
import { BaseEntity, Column, CreateDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'
|
|
3
3
|
import { PartyCorrelationType } from '@sphereon/ssi-sdk.core'
|
|
4
4
|
import { NonPersistedAuditLoggingEvent } from '../../types'
|
|
5
|
+
import {TYPEORM_DATE_TIME_TYPE} from "@sphereon/ssi-sdk.agent-config";
|
|
5
6
|
|
|
6
7
|
@Entity('AuditEvents')
|
|
7
8
|
export class AuditEventEntity extends BaseEntity {
|
|
8
9
|
@PrimaryGeneratedColumn('uuid')
|
|
9
10
|
id!: string
|
|
10
11
|
|
|
11
|
-
@Column({ name: 'timestamp', nullable: false, unique: false })
|
|
12
|
+
@Column({ name: 'timestamp', nullable: false, unique: false, type: TYPEORM_DATE_TIME_TYPE })
|
|
12
13
|
timestamp!: Date
|
|
13
14
|
|
|
14
15
|
@Column('simple-enum', { name: 'level', enum: LogLevel, nullable: false, unique: false })
|
|
15
16
|
level!: LogLevel
|
|
16
17
|
|
|
17
|
-
@Column({ name: 'correlationId', nullable: false, unique: false })
|
|
18
|
+
@Column('text', { name: 'correlationId', nullable: false, unique: false })
|
|
18
19
|
correlationId!: string
|
|
19
20
|
|
|
20
21
|
@Column('simple-enum', { name: 'system', enum: System, nullable: false, unique: false })
|
|
@@ -26,7 +27,7 @@ export class AuditEventEntity extends BaseEntity {
|
|
|
26
27
|
@Column('simple-enum', { name: 'actionType', enum: ActionType, nullable: false, unique: false })
|
|
27
28
|
actionType!: ActionType
|
|
28
29
|
|
|
29
|
-
@Column({ name: 'actionSubType', nullable: false, unique: false })
|
|
30
|
+
@Column({ name: 'actionSubType', type: 'varchar', nullable: false, unique: false })
|
|
30
31
|
actionSubType!: ActionSubType
|
|
31
32
|
|
|
32
33
|
@Column('simple-enum', { name: 'initiatorType', enum: InitiatorType, nullable: false, unique: false })
|
|
@@ -35,34 +36,34 @@ export class AuditEventEntity extends BaseEntity {
|
|
|
35
36
|
@Column('simple-enum', { name: 'systemCorrelationIdType', enum: SystemCorrelationIdType, nullable: true, unique: false })
|
|
36
37
|
systemCorrelationIdType?: SystemCorrelationIdType
|
|
37
38
|
|
|
38
|
-
@Column({ name: 'systemCorrelationId', nullable: true, unique: false })
|
|
39
|
+
@Column('text', { name: 'systemCorrelationId', nullable: true, unique: false })
|
|
39
40
|
systemCorrelationId?: string
|
|
40
41
|
|
|
41
|
-
@Column({ name: 'systemAlias', nullable: true, unique: false })
|
|
42
|
+
@Column('text', { name: 'systemAlias', nullable: true, unique: false })
|
|
42
43
|
systemAlias?: string
|
|
43
44
|
|
|
44
45
|
@Column('simple-enum', { name: 'partyCorrelationType', enum: PartyCorrelationType, nullable: true, unique: false })
|
|
45
46
|
partyCorrelationType?: PartyCorrelationType
|
|
46
47
|
|
|
47
|
-
@Column({ name: 'partyCorrelationId', nullable: true, unique: false })
|
|
48
|
+
@Column('text', { name: 'partyCorrelationId', nullable: true, unique: false })
|
|
48
49
|
partyCorrelationId?: string
|
|
49
50
|
|
|
50
|
-
@Column({ name: 'partyAlias', nullable: true, unique: false })
|
|
51
|
+
@Column('text', { name: 'partyAlias', nullable: true, unique: false })
|
|
51
52
|
partyAlias?: string
|
|
52
53
|
|
|
53
|
-
@Column({ name: 'description', nullable: false, unique: false })
|
|
54
|
+
@Column('text', { name: 'description', nullable: false, unique: false })
|
|
54
55
|
description!: string
|
|
55
56
|
|
|
56
|
-
@Column({ name: 'data', nullable: true, unique: false })
|
|
57
|
+
@Column('text', { name: 'data', nullable: true, unique: false })
|
|
57
58
|
data?: string
|
|
58
59
|
|
|
59
|
-
@Column({ name: 'diagnosticData', nullable: true, unique: false })
|
|
60
|
+
@Column('text', { name: 'diagnosticData', nullable: true, unique: false })
|
|
60
61
|
diagnosticData?: string
|
|
61
62
|
|
|
62
|
-
@CreateDateColumn({ name: 'created_at', nullable: false })
|
|
63
|
+
@CreateDateColumn({ name: 'created_at', nullable: false, type: TYPEORM_DATE_TIME_TYPE })
|
|
63
64
|
createdAt!: Date
|
|
64
65
|
|
|
65
|
-
@UpdateDateColumn({ name: 'last_updated_at', nullable: false })
|
|
66
|
+
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type: TYPEORM_DATE_TIME_TYPE })
|
|
66
67
|
lastUpdatedAt!: Date
|
|
67
68
|
}
|
|
68
69
|
|
|
@@ -9,7 +9,7 @@ export class BackgroundAttributesEntity extends BaseEntity {
|
|
|
9
9
|
@PrimaryGeneratedColumn('uuid')
|
|
10
10
|
id!: string
|
|
11
11
|
|
|
12
|
-
@Column({ name: 'color', length: 255, nullable: true, unique: false })
|
|
12
|
+
@Column('varchar', { name: 'color', length: 255, nullable: true, unique: false })
|
|
13
13
|
@Validate(IsNonEmptyStringConstraint, { message: 'Blank background colors are not allowed' })
|
|
14
14
|
color?: string
|
|
15
15
|
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
TableInheritance,
|
|
12
12
|
UpdateDateColumn,
|
|
13
13
|
} from 'typeorm'
|
|
14
|
+
import {TYPEORM_DATE_TIME_TYPE} from "@sphereon/ssi-sdk.agent-config";
|
|
14
15
|
import { ImageAttributesEntity } from './ImageAttributesEntity'
|
|
15
16
|
import { BackgroundAttributesEntity } from './BackgroundAttributesEntity'
|
|
16
17
|
import { TextAttributesEntity } from './TextAttributesEntity'
|
|
@@ -23,11 +24,11 @@ export class BaseLocaleBrandingEntity extends BaseEntity {
|
|
|
23
24
|
@PrimaryGeneratedColumn('uuid')
|
|
24
25
|
id!: string
|
|
25
26
|
|
|
26
|
-
@Column({ name: 'alias', length: 255, nullable: true, unique: false })
|
|
27
|
+
@Column('varchar', { name: 'alias', length: 255, nullable: true, unique: false })
|
|
27
28
|
@Validate(IsNonEmptyStringConstraint, { message: 'Blank aliases are not allowed' })
|
|
28
29
|
alias?: string
|
|
29
30
|
|
|
30
|
-
@Column({ name: 'locale', length: 255, nullable: false, unique: false })
|
|
31
|
+
@Column('varchar', { name: 'locale', length: 255, nullable: false, unique: false })
|
|
31
32
|
locale?: string
|
|
32
33
|
|
|
33
34
|
@OneToOne(() => ImageAttributesEntity, {
|
|
@@ -39,7 +40,7 @@ export class BaseLocaleBrandingEntity extends BaseEntity {
|
|
|
39
40
|
@JoinColumn({ name: 'logoId' })
|
|
40
41
|
logo?: ImageAttributesEntity
|
|
41
42
|
|
|
42
|
-
@Column({ name: 'description', length: 255, nullable: true, unique: false })
|
|
43
|
+
@Column('varchar', { name: 'description', length: 255, nullable: true, unique: false })
|
|
43
44
|
@Validate(IsNonEmptyStringConstraint, { message: 'Blank descriptions are not allowed' })
|
|
44
45
|
description?: string
|
|
45
46
|
|
|
@@ -61,10 +62,10 @@ export class BaseLocaleBrandingEntity extends BaseEntity {
|
|
|
61
62
|
@JoinColumn({ name: 'textId' })
|
|
62
63
|
text?: TextAttributesEntity
|
|
63
64
|
|
|
64
|
-
@CreateDateColumn({ name: 'created_at', nullable: false })
|
|
65
|
+
@CreateDateColumn({ name: 'created_at', nullable: false, type: TYPEORM_DATE_TIME_TYPE })
|
|
65
66
|
createdAt!: Date
|
|
66
67
|
|
|
67
|
-
@UpdateDateColumn({ name: 'last_updated_at', nullable: false })
|
|
68
|
+
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type: TYPEORM_DATE_TIME_TYPE })
|
|
68
69
|
lastUpdatedAt!: Date
|
|
69
70
|
|
|
70
71
|
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
UpdateDateColumn,
|
|
12
12
|
} from 'typeorm'
|
|
13
13
|
import { ArrayMinSize, IsNotEmpty, validate, ValidationError } from 'class-validator'
|
|
14
|
+
import {TYPEORM_DATE_TIME_TYPE} from "@sphereon/ssi-sdk.agent-config";
|
|
14
15
|
import { CredentialLocaleBrandingEntity, credentialLocaleBrandingEntityFrom } from './CredentialLocaleBrandingEntity'
|
|
15
16
|
import { IBasicCredentialBranding, IBasicCredentialLocaleBranding } from '../../types'
|
|
16
17
|
|
|
@@ -21,11 +22,11 @@ export class CredentialBrandingEntity extends BaseEntity {
|
|
|
21
22
|
@PrimaryGeneratedColumn('uuid')
|
|
22
23
|
id!: string
|
|
23
24
|
|
|
24
|
-
@Column({ name: 'vcHash', length: 255, nullable: false, unique: true })
|
|
25
|
+
@Column('varchar', { name: 'vcHash', length: 255, nullable: false, unique: true })
|
|
25
26
|
@IsNotEmpty({ message: 'Blank vcHashes are not allowed' })
|
|
26
27
|
vcHash!: string
|
|
27
28
|
|
|
28
|
-
@Column({ name: 'issuerCorrelationId', length: 255, nullable: false, unique: false })
|
|
29
|
+
@Column('varchar', { name: 'issuerCorrelationId', length: 255, nullable: false, unique: false })
|
|
29
30
|
@IsNotEmpty({ message: 'Blank issuerCorrelationIds are not allowed' })
|
|
30
31
|
issuerCorrelationId!: string
|
|
31
32
|
|
|
@@ -42,10 +43,10 @@ export class CredentialBrandingEntity extends BaseEntity {
|
|
|
42
43
|
@ArrayMinSize(1, { message: 'localeBranding cannot be empty' })
|
|
43
44
|
localeBranding!: Array<CredentialLocaleBrandingEntity>
|
|
44
45
|
|
|
45
|
-
@CreateDateColumn({ name: 'created_at', nullable: false })
|
|
46
|
+
@CreateDateColumn({ name: 'created_at', nullable: false, type: TYPEORM_DATE_TIME_TYPE })
|
|
46
47
|
createdAt!: Date
|
|
47
48
|
|
|
48
|
-
@UpdateDateColumn({ name: 'last_updated_at', nullable: false })
|
|
49
|
+
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type: TYPEORM_DATE_TIME_TYPE })
|
|
49
50
|
lastUpdatedAt!: Date
|
|
50
51
|
|
|
51
52
|
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|