@sphereon/ssi-sdk.data-store 0.30.2-next.133 → 0.30.2-next.145
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/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 +1 -4
- package/dist/entities/eventLogger/AuditEventEntity.d.ts.map +1 -1
- package/dist/entities/eventLogger/AuditEventEntity.js +2 -55
- 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/EventLoggerStore.d.ts.map +1 -1
- package/dist/eventLogger/EventLoggerStore.js +2 -2
- 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/sqlite/1685628973231-CreateIssuanceBranding.js +3 -3
- package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.js.map +1 -1
- package/dist/types/contact/contact.d.ts +3 -3
- package/dist/types/contact/contact.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 +4 -1
- package/dist/utils/eventLogger/MappingUtils.d.ts.map +1 -1
- package/dist/utils/eventLogger/MappingUtils.js +55 -1
- 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 +5 -5
- package/src/__tests__/digitalCredential.entities.test.ts +5 -5
- package/src/__tests__/digitalCredential.store.test.ts +1 -1
- package/src/__tests__/eventLogger.entities.test.ts +24 -24
- package/src/__tests__/issuanceBranding.entities.test.ts +8 -0
- package/src/entities/digitalCredential/DigitalCredentialEntity.ts +1 -1
- package/src/entities/eventLogger/AuditEventEntity.ts +1 -57
- 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/EventLoggerStore.ts +5 -4
- 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/sqlite/1685628973231-CreateIssuanceBranding.ts +3 -3
- package/src/types/contact/contact.ts +3 -3
- package/src/types/issuanceBranding/issuanceBranding.ts +9 -3
- package/src/utils/eventLogger/MappingUtils.ts +57 -2
- package/src/utils/issuanceBranding/MappingUtils.ts +105 -2
|
@@ -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
|
-
}
|
|
@@ -3,12 +3,13 @@ import { LoggingEventType, OrPromise } from '@sphereon/ssi-types'
|
|
|
3
3
|
import Debug, { Debugger } from 'debug'
|
|
4
4
|
import { DataSource } from 'typeorm'
|
|
5
5
|
import { AbstractEventLoggerStore } from './AbstractEventLoggerStore'
|
|
6
|
+
import { AuditEventEntity } from '../entities/eventLogger/AuditEventEntity'
|
|
6
7
|
import {
|
|
7
8
|
activityEventEntityFrom,
|
|
8
|
-
|
|
9
|
-
auditEventEntityFrom
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
activityEventFrom,
|
|
10
|
+
auditEventEntityFrom,
|
|
11
|
+
auditEventFrom
|
|
12
|
+
} from '../utils/eventLogger/MappingUtils'
|
|
12
13
|
import {
|
|
13
14
|
GetActivityEventsArgs,
|
|
14
15
|
GetAuditEventsArgs,
|
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")`,
|
|
@@ -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"`,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ManagedIdentifierOptsOrResult } from '@sphereon/ssi-sdk-ext.identifier-resolution'
|
|
2
2
|
import { IIdentifier } from '@veramo/core'
|
|
3
|
-
import {
|
|
3
|
+
import { IIssuerLocaleBranding } from '../issuanceBranding/issuanceBranding'
|
|
4
4
|
import { CredentialRole } from '../digitalCredential/digitalCredential'
|
|
5
5
|
|
|
6
6
|
export type MetadataTypes = string | number | Date | boolean | undefined
|
|
@@ -26,7 +26,7 @@ export type Party = {
|
|
|
26
26
|
contact: Contact
|
|
27
27
|
partyType: PartyType
|
|
28
28
|
/**
|
|
29
|
-
* TODO: Integrate branding logic here in the future.
|
|
29
|
+
* TODO: Integrate branding logic here in the future. What we should do is make the issuance branding plugin part of the contact-manager and retrieve any branding there is.
|
|
30
30
|
*
|
|
31
31
|
* Currently, we are only defining the branding type within the SDK without implementing the associated logic. This is because:
|
|
32
32
|
* 1. We are combining two types from the SSI-SDK to create a new type that will be used across multiple places in the wallets (web & mobile).
|
|
@@ -35,7 +35,7 @@ export type Party = {
|
|
|
35
35
|
*
|
|
36
36
|
* For now, we are defining the type here and will use it in the mobile wallet has the logic for it. This is a temporary solution until we have the resources to integrate the branding logic fully.
|
|
37
37
|
*/
|
|
38
|
-
branding?:
|
|
38
|
+
branding?: IIssuerLocaleBranding
|
|
39
39
|
relationships: Array<PartyRelationship>
|
|
40
40
|
createdAt: Date
|
|
41
41
|
lastUpdatedAt: Date
|
|
@@ -80,17 +80,23 @@ export interface IPartialCredentialBranding extends Partial<Omit<ICredentialBran
|
|
|
80
80
|
localeBranding?: IPartialCredentialLocaleBranding
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
export interface IIssuerLocaleBranding extends ILocaleBranding {
|
|
83
|
+
export interface IIssuerLocaleBranding extends ILocaleBranding {
|
|
84
|
+
clientUri?: string
|
|
85
|
+
tosUri?: string
|
|
86
|
+
policyUri?: string
|
|
87
|
+
contacts?: Array<string>
|
|
88
|
+
}
|
|
84
89
|
export interface IBasicIssuerLocaleBranding
|
|
85
90
|
extends Omit<IIssuerLocaleBranding, 'id' | 'createdAt' | 'lastUpdatedAt' | 'logo' | 'background' | 'text'> {
|
|
86
91
|
logo?: IBasicImageAttributes
|
|
87
92
|
background?: IBasicBackgroundAttributes
|
|
88
93
|
text?: IBasicTextAttributes
|
|
89
94
|
}
|
|
90
|
-
export interface IPartialIssuerLocaleBranding extends Partial<Omit<IIssuerLocaleBranding, 'logo' | 'background' | 'text'>> {
|
|
95
|
+
export interface IPartialIssuerLocaleBranding extends Partial<Omit<IIssuerLocaleBranding, 'logo' | 'background' | 'text' | 'contacts'>> {
|
|
91
96
|
logo?: IPartialImageAttributes
|
|
92
97
|
background?: IPartialBackgroundAttributes
|
|
93
98
|
text?: IPartialTextAttributes
|
|
99
|
+
contacts?: string
|
|
94
100
|
}
|
|
95
101
|
|
|
96
102
|
export interface IIssuerBranding {
|
|
@@ -103,7 +109,7 @@ export interface IIssuerBranding {
|
|
|
103
109
|
export interface IBasicIssuerBranding extends Omit<IIssuerBranding, 'id' | 'createdAt' | 'lastUpdatedAt' | 'localeBranding'> {
|
|
104
110
|
localeBranding: Array<IBasicIssuerLocaleBranding>
|
|
105
111
|
}
|
|
106
|
-
export interface IPartialIssuerBranding extends Partial<Omit<
|
|
112
|
+
export interface IPartialIssuerBranding extends Partial<Omit<IIssuerBranding, 'localeBranding'>> {
|
|
107
113
|
localeBranding?: IPartialIssuerLocaleBranding
|
|
108
114
|
}
|
|
109
115
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { AuditEventEntity } from '../../entities/eventLogger/AuditEventEntity'
|
|
2
1
|
import { ActivityLoggingEvent, AuditLoggingEvent } from '@sphereon/ssi-sdk.core'
|
|
3
2
|
import { LoggingEventType } from '@sphereon/ssi-types'
|
|
4
3
|
import { replaceNullWithUndefined } from '../FormattingUtils'
|
|
4
|
+
import { AuditEventEntity } from '../../entities/eventLogger/AuditEventEntity'
|
|
5
|
+
import { NonPersistedActivityLoggingEvent, NonPersistedAuditLoggingEvent } from '../../types'
|
|
5
6
|
|
|
6
7
|
export const auditEventFrom = (event: AuditEventEntity): AuditLoggingEvent => {
|
|
7
8
|
const result: AuditLoggingEvent = {
|
|
@@ -29,8 +30,32 @@ export const auditEventFrom = (event: AuditEventEntity): AuditLoggingEvent => {
|
|
|
29
30
|
return replaceNullWithUndefined(result)
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
export const
|
|
33
|
+
export const auditEventEntityFrom = (args: NonPersistedAuditLoggingEvent): AuditEventEntity => {
|
|
34
|
+
const auditEventEntity: AuditEventEntity = new AuditEventEntity()
|
|
35
|
+
auditEventEntity.type = LoggingEventType.AUDIT
|
|
36
|
+
auditEventEntity.timestamp = args.timestamp
|
|
37
|
+
auditEventEntity.level = args.level
|
|
38
|
+
auditEventEntity.correlationId = args.correlationId
|
|
39
|
+
auditEventEntity.system = args.system
|
|
40
|
+
auditEventEntity.subSystemType = args.subSystemType
|
|
41
|
+
auditEventEntity.actionType = args.actionType
|
|
42
|
+
auditEventEntity.actionSubType = args.actionSubType
|
|
43
|
+
auditEventEntity.initiatorType = args.initiatorType
|
|
44
|
+
auditEventEntity.systemCorrelationIdType = args.systemCorrelationIdType
|
|
45
|
+
auditEventEntity.systemCorrelationId = args.systemCorrelationId
|
|
46
|
+
auditEventEntity.systemAlias = args.systemAlias
|
|
47
|
+
auditEventEntity.partyCorrelationType = args.partyCorrelationType
|
|
48
|
+
auditEventEntity.partyCorrelationId = args.partyCorrelationId
|
|
49
|
+
auditEventEntity.partyAlias = args.partyAlias
|
|
50
|
+
auditEventEntity.description = args.description
|
|
51
|
+
auditEventEntity.partyCorrelationType = args.partyCorrelationType
|
|
52
|
+
auditEventEntity.data = JSON.stringify(args.data)
|
|
53
|
+
auditEventEntity.diagnosticData = JSON.stringify(args.diagnosticData)
|
|
54
|
+
|
|
55
|
+
return auditEventEntity
|
|
56
|
+
}
|
|
33
57
|
|
|
58
|
+
export const activityEventFrom = (event: AuditEventEntity): ActivityLoggingEvent => {
|
|
34
59
|
const result: ActivityLoggingEvent = {
|
|
35
60
|
id: event.id,
|
|
36
61
|
type: LoggingEventType.ACTIVITY,
|
|
@@ -59,3 +84,33 @@ export const activityEventFrom = (event: AuditEventEntity): ActivityLoggingEvent
|
|
|
59
84
|
|
|
60
85
|
return replaceNullWithUndefined(result)
|
|
61
86
|
}
|
|
87
|
+
|
|
88
|
+
export const activityEventEntityFrom = (args: NonPersistedActivityLoggingEvent): AuditEventEntity => {
|
|
89
|
+
const activityEventEntity: AuditEventEntity = new AuditEventEntity()
|
|
90
|
+
activityEventEntity.type = LoggingEventType.ACTIVITY
|
|
91
|
+
activityEventEntity.timestamp = args.timestamp
|
|
92
|
+
activityEventEntity.level = args.level
|
|
93
|
+
activityEventEntity.correlationId = args.correlationId
|
|
94
|
+
activityEventEntity.system = args.system
|
|
95
|
+
activityEventEntity.subSystemType = args.subSystemType
|
|
96
|
+
activityEventEntity.actionType = args.actionType
|
|
97
|
+
activityEventEntity.actionSubType = args.actionSubType
|
|
98
|
+
activityEventEntity.initiatorType = args.initiatorType
|
|
99
|
+
activityEventEntity.systemCorrelationIdType = args.systemCorrelationIdType
|
|
100
|
+
activityEventEntity.systemCorrelationId = args.systemCorrelationId
|
|
101
|
+
activityEventEntity.systemAlias = args.systemAlias
|
|
102
|
+
activityEventEntity.partyCorrelationType = args.partyCorrelationType
|
|
103
|
+
activityEventEntity.partyCorrelationId = args.partyCorrelationId
|
|
104
|
+
activityEventEntity.partyAlias = args.partyAlias
|
|
105
|
+
activityEventEntity.description = args.description
|
|
106
|
+
activityEventEntity.partyCorrelationType = args.partyCorrelationType
|
|
107
|
+
activityEventEntity.data = JSON.stringify(args.data)
|
|
108
|
+
activityEventEntity.sharePurpose = args.sharePurpose
|
|
109
|
+
activityEventEntity.credentialType = args.credentialType
|
|
110
|
+
activityEventEntity.originalCredential = args.originalCredential
|
|
111
|
+
activityEventEntity.credentialHash = args.credentialHash
|
|
112
|
+
activityEventEntity.parentCredentialHash = args.parentCredentialHash
|
|
113
|
+
activityEventEntity.diagnosticData = JSON.stringify(args.diagnosticData)
|
|
114
|
+
|
|
115
|
+
return activityEventEntity
|
|
116
|
+
}
|
|
@@ -1,8 +1,27 @@
|
|
|
1
|
+
import { replaceNullWithUndefined } from '../FormattingUtils'
|
|
2
|
+
import { isEmptyString } from '../../entities/validators'
|
|
1
3
|
import { CredentialBrandingEntity } from '../../entities/issuanceBranding/CredentialBrandingEntity'
|
|
2
4
|
import { BaseLocaleBrandingEntity } from '../../entities/issuanceBranding/BaseLocaleBrandingEntity'
|
|
3
5
|
import { IssuerBrandingEntity } from '../../entities/issuanceBranding/IssuerBrandingEntity'
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
+
import { ImageAttributesEntity } from '../../entities/issuanceBranding/ImageAttributesEntity'
|
|
7
|
+
import { BackgroundAttributesEntity } from '../../entities/issuanceBranding/BackgroundAttributesEntity'
|
|
8
|
+
import { TextAttributesEntity } from '../../entities/issuanceBranding/TextAttributesEntity'
|
|
9
|
+
import { IssuerLocaleBrandingEntity } from '../../entities/issuanceBranding/IssuerLocaleBrandingEntity'
|
|
10
|
+
import { CredentialLocaleBrandingEntity } from '../../entities/issuanceBranding/CredentialLocaleBrandingEntity'
|
|
11
|
+
import { ImageDimensionsEntity } from '../../entities/issuanceBranding/ImageDimensionsEntity'
|
|
12
|
+
import {
|
|
13
|
+
IBasicBackgroundAttributes,
|
|
14
|
+
IBasicCredentialBranding,
|
|
15
|
+
IBasicCredentialLocaleBranding,
|
|
16
|
+
IBasicImageAttributes,
|
|
17
|
+
IBasicImageDimensions,
|
|
18
|
+
IBasicIssuerBranding,
|
|
19
|
+
IBasicIssuerLocaleBranding,
|
|
20
|
+
IBasicTextAttributes,
|
|
21
|
+
ICredentialBranding,
|
|
22
|
+
IIssuerBranding,
|
|
23
|
+
ILocaleBranding
|
|
24
|
+
} from '../../types'
|
|
6
25
|
|
|
7
26
|
export const credentialBrandingFrom = (credentialBranding: CredentialBrandingEntity): ICredentialBranding => {
|
|
8
27
|
const result: ICredentialBranding = {
|
|
@@ -30,3 +49,87 @@ export const localeBrandingFrom = (localeBranding: BaseLocaleBrandingEntity): IL
|
|
|
30
49
|
|
|
31
50
|
return replaceNullWithUndefined(result)
|
|
32
51
|
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
export const issuerLocaleBrandingEntityFrom = (args: IBasicIssuerLocaleBranding): IssuerLocaleBrandingEntity => {
|
|
55
|
+
const issuerLocaleBrandingEntity: IssuerLocaleBrandingEntity = new IssuerLocaleBrandingEntity()
|
|
56
|
+
issuerLocaleBrandingEntity.alias = isEmptyString(args.alias) ? undefined : args.alias
|
|
57
|
+
issuerLocaleBrandingEntity.locale = args.locale ? args.locale : ''
|
|
58
|
+
issuerLocaleBrandingEntity.logo = args.logo ? imageAttributesEntityFrom(args.logo) : undefined
|
|
59
|
+
issuerLocaleBrandingEntity.description = isEmptyString(args.description) ? undefined : args.description
|
|
60
|
+
issuerLocaleBrandingEntity.background = args.background ? backgroundAttributesEntityFrom(args.background) : undefined
|
|
61
|
+
issuerLocaleBrandingEntity.text = args.text ? textAttributesEntityFrom(args.text) : undefined
|
|
62
|
+
issuerLocaleBrandingEntity.clientUri = isEmptyString(args.clientUri) ? undefined : args.clientUri
|
|
63
|
+
issuerLocaleBrandingEntity.tosUri = isEmptyString(args.tosUri) ? undefined : args.tosUri
|
|
64
|
+
issuerLocaleBrandingEntity.policyUri = isEmptyString(args.policyUri) ? undefined : args.policyUri
|
|
65
|
+
issuerLocaleBrandingEntity.contacts = args.contacts
|
|
66
|
+
|
|
67
|
+
return issuerLocaleBrandingEntity
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const backgroundAttributesEntityFrom = (args: IBasicBackgroundAttributes): BackgroundAttributesEntity => {
|
|
71
|
+
const backgroundAttributesEntity: BackgroundAttributesEntity = new BackgroundAttributesEntity()
|
|
72
|
+
backgroundAttributesEntity.color = isEmptyString(args.color) ? undefined : args.color
|
|
73
|
+
backgroundAttributesEntity.image = args.image ? imageAttributesEntityFrom(args.image) : undefined
|
|
74
|
+
|
|
75
|
+
return backgroundAttributesEntity
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export const credentialBrandingEntityFrom = (args: IBasicCredentialBranding): CredentialBrandingEntity => {
|
|
79
|
+
const credentialBrandingEntity: CredentialBrandingEntity = new CredentialBrandingEntity()
|
|
80
|
+
credentialBrandingEntity.issuerCorrelationId = args.issuerCorrelationId
|
|
81
|
+
credentialBrandingEntity.vcHash = args.vcHash
|
|
82
|
+
credentialBrandingEntity.localeBranding = args.localeBranding.map((localeBranding: IBasicCredentialLocaleBranding) =>
|
|
83
|
+
credentialLocaleBrandingEntityFrom(localeBranding),
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
return credentialBrandingEntity
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export const credentialLocaleBrandingEntityFrom = (args: IBasicCredentialLocaleBranding): CredentialLocaleBrandingEntity => {
|
|
90
|
+
const credentialLocaleBrandingEntity: CredentialLocaleBrandingEntity = new CredentialLocaleBrandingEntity()
|
|
91
|
+
credentialLocaleBrandingEntity.alias = isEmptyString(args.alias) ? undefined : args.alias
|
|
92
|
+
credentialLocaleBrandingEntity.locale = args.locale ? args.locale : ''
|
|
93
|
+
credentialLocaleBrandingEntity.logo = args.logo ? imageAttributesEntityFrom(args.logo) : undefined
|
|
94
|
+
credentialLocaleBrandingEntity.description = isEmptyString(args.description) ? undefined : args.description
|
|
95
|
+
credentialLocaleBrandingEntity.background = args.background ? backgroundAttributesEntityFrom(args.background) : undefined
|
|
96
|
+
credentialLocaleBrandingEntity.text = args.text ? textAttributesEntityFrom(args.text) : undefined
|
|
97
|
+
|
|
98
|
+
return credentialLocaleBrandingEntity
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export const imageAttributesEntityFrom = (args: IBasicImageAttributes): ImageAttributesEntity => {
|
|
102
|
+
const imageAttributesEntity: ImageAttributesEntity = new ImageAttributesEntity()
|
|
103
|
+
imageAttributesEntity.uri = isEmptyString(args.uri) ? undefined : args.uri
|
|
104
|
+
imageAttributesEntity.dataUri = isEmptyString(args.dataUri) ? undefined : args.dataUri
|
|
105
|
+
imageAttributesEntity.mediaType = isEmptyString(args.mediaType) ? undefined : args.mediaType
|
|
106
|
+
imageAttributesEntity.alt = isEmptyString(args.alt) ? undefined : args.alt
|
|
107
|
+
imageAttributesEntity.dimensions = args.dimensions ? imageDimensionsEntityFrom(args.dimensions) : undefined
|
|
108
|
+
|
|
109
|
+
return imageAttributesEntity
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export const imageDimensionsEntityFrom = (args: IBasicImageDimensions): ImageDimensionsEntity => {
|
|
113
|
+
const imageDimensionsEntity: ImageDimensionsEntity = new ImageDimensionsEntity()
|
|
114
|
+
imageDimensionsEntity.width = args.width
|
|
115
|
+
imageDimensionsEntity.height = args.height
|
|
116
|
+
|
|
117
|
+
return imageDimensionsEntity
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export const issuerBrandingEntityFrom = (args: IBasicIssuerBranding): IssuerBrandingEntity => {
|
|
121
|
+
const issuerBrandingEntity: IssuerBrandingEntity = new IssuerBrandingEntity()
|
|
122
|
+
issuerBrandingEntity.issuerCorrelationId = args.issuerCorrelationId
|
|
123
|
+
issuerBrandingEntity.localeBranding = args.localeBranding.map((localeBranding: IBasicIssuerLocaleBranding) =>
|
|
124
|
+
issuerLocaleBrandingEntityFrom(localeBranding),
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
return issuerBrandingEntity
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export const textAttributesEntityFrom = (args: IBasicTextAttributes): TextAttributesEntity => {
|
|
131
|
+
const textAttributesEntity: TextAttributesEntity = new TextAttributesEntity()
|
|
132
|
+
textAttributesEntity.color = isEmptyString(args.color) ? undefined : args.color
|
|
133
|
+
|
|
134
|
+
return textAttributesEntity
|
|
135
|
+
}
|