@sphereon/ssi-sdk.data-store 0.30.2-feature.SPRIND.77.133 → 0.30.2-feature.SPRIND.84.139
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 +4 -1
- package/dist/entities/eventLogger/AuditEventEntity.d.ts.map +1 -1
- package/dist/entities/eventLogger/AuditEventEntity.js +55 -2
- package/dist/entities/eventLogger/AuditEventEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.d.ts +2 -0
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.js +8 -1
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.d.ts +2 -0
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.js +9 -1
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.d.ts +2 -0
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.js +16 -1
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/ImageAttributesEntity.d.ts +2 -0
- package/dist/entities/issuanceBranding/ImageAttributesEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/ImageAttributesEntity.js +11 -1
- package/dist/entities/issuanceBranding/ImageAttributesEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.d.ts +2 -0
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.js +8 -1
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.d.ts +2 -0
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.js +8 -1
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.d.ts +2 -4
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.js +15 -21
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/TextAttributesEntity.d.ts +2 -0
- package/dist/entities/issuanceBranding/TextAttributesEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/TextAttributesEntity.js +7 -1
- 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 +13 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -6
- 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/issuanceBranding/issuanceBranding.d.ts +2 -7
- package/dist/types/issuanceBranding/issuanceBranding.d.ts.map +1 -1
- package/dist/utils/eventLogger/MappingUtils.d.ts +1 -4
- package/dist/utils/eventLogger/MappingUtils.d.ts.map +1 -1
- package/dist/utils/eventLogger/MappingUtils.js +1 -55
- package/dist/utils/eventLogger/MappingUtils.js.map +1 -1
- package/dist/utils/issuanceBranding/MappingUtils.d.ts +1 -15
- package/dist/utils/issuanceBranding/MappingUtils.d.ts.map +1 -1
- package/dist/utils/issuanceBranding/MappingUtils.js +1 -81
- 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 +0 -8
- package/src/entities/digitalCredential/DigitalCredentialEntity.ts +1 -1
- package/src/entities/eventLogger/AuditEventEntity.ts +57 -1
- package/src/entities/issuanceBranding/BackgroundAttributesEntity.ts +11 -2
- package/src/entities/issuanceBranding/CredentialBrandingEntity.ts +13 -1
- package/src/entities/issuanceBranding/CredentialLocaleBrandingEntity.ts +17 -0
- package/src/entities/issuanceBranding/ImageAttributesEntity.ts +14 -2
- package/src/entities/issuanceBranding/ImageDimensionsEntity.ts +9 -0
- package/src/entities/issuanceBranding/IssuerBrandingEntity.ts +12 -1
- package/src/entities/issuanceBranding/IssuerLocaleBrandingEntity.ts +17 -17
- package/src/entities/issuanceBranding/TextAttributesEntity.ts +9 -1
- package/src/eventLogger/EventLoggerStore.ts +4 -5
- package/src/index.ts +26 -13
- package/src/issuanceBranding/IssuanceBrandingStore.ts +6 -14
- package/src/migrations/postgres/1685628974232-CreateIssuanceBranding.ts +1 -1
- package/src/migrations/sqlite/1685628973231-CreateIssuanceBranding.ts +3 -3
- package/src/types/issuanceBranding/issuanceBranding.ts +3 -9
- package/src/utils/eventLogger/MappingUtils.ts +2 -57
- package/src/utils/issuanceBranding/MappingUtils.ts +2 -105
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { BaseEntity, BeforeInsert, BeforeUpdate, Column, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn } from 'typeorm'
|
|
2
|
-
import {
|
|
2
|
+
import { IBasicImageAttributes } from '../../types'
|
|
3
|
+
import { ImageDimensionsEntity, imageDimensionsEntityFrom } from './ImageDimensionsEntity'
|
|
3
4
|
import { validate, Validate, ValidationError } from 'class-validator'
|
|
4
|
-
import { IsNonEmptyStringConstraint } from '../validators'
|
|
5
|
+
import { isEmptyString, IsNonEmptyStringConstraint } from '../validators'
|
|
5
6
|
|
|
6
7
|
@Entity('ImageAttributes')
|
|
7
8
|
export class ImageAttributesEntity extends BaseEntity {
|
|
@@ -43,3 +44,14 @@ export class ImageAttributesEntity extends BaseEntity {
|
|
|
43
44
|
return
|
|
44
45
|
}
|
|
45
46
|
}
|
|
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,4 +1,5 @@
|
|
|
1
1
|
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
|
2
|
+
import { IBasicImageDimensions } from '../../types'
|
|
2
3
|
|
|
3
4
|
@Entity('ImageDimensions')
|
|
4
5
|
export class ImageDimensionsEntity extends BaseEntity {
|
|
@@ -11,3 +12,11 @@ export class ImageDimensionsEntity extends BaseEntity {
|
|
|
11
12
|
@Column('integer', { name: 'height', nullable: false, unique: false })
|
|
12
13
|
height!: number
|
|
13
14
|
}
|
|
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,7 +12,8 @@ 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 } from './IssuerLocaleBrandingEntity'
|
|
15
|
+
import { IssuerLocaleBrandingEntity, issuerLocaleBrandingEntityFrom } from './IssuerLocaleBrandingEntity'
|
|
16
|
+
import { IBasicIssuerBranding, IBasicIssuerLocaleBranding } from '../../types'
|
|
16
17
|
|
|
17
18
|
@Entity('IssuerBranding')
|
|
18
19
|
@Index('IDX_IssuerBrandingEntity_issuerCorrelationId', ['issuerCorrelationId'])
|
|
@@ -60,3 +61,13 @@ export class IssuerBrandingEntity extends BaseEntity {
|
|
|
60
61
|
return
|
|
61
62
|
}
|
|
62
63
|
}
|
|
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,8 +1,11 @@
|
|
|
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'
|
|
2
5
|
import { IssuerBrandingEntity } from './IssuerBrandingEntity'
|
|
3
6
|
import { BaseLocaleBrandingEntity } from './BaseLocaleBrandingEntity'
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
7
|
+
import { textAttributesEntityFrom } from './TextAttributesEntity'
|
|
8
|
+
import { isEmptyString } from '../validators'
|
|
6
9
|
|
|
7
10
|
@ChildEntity('IssuerLocaleBranding')
|
|
8
11
|
@Index('IDX_IssuerLocaleBrandingEntity_issuerBranding_locale', ['issuerBranding', 'locale'], { unique: true })
|
|
@@ -13,21 +16,18 @@ export class IssuerLocaleBrandingEntity extends BaseLocaleBrandingEntity {
|
|
|
13
16
|
@JoinColumn({ name: 'issuerBrandingId' })
|
|
14
17
|
issuerBranding!: IssuerBrandingEntity
|
|
15
18
|
|
|
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
|
|
23
|
-
|
|
24
|
-
@Column('text', { name: 'policy_uri', nullable: true, unique: false })
|
|
25
|
-
@Validate(IsNonEmptyStringConstraint, { message: 'Blank policy uris are not allowed' })
|
|
26
|
-
policyUri?: string
|
|
27
|
-
|
|
28
|
-
@Column('simple-array', { name: 'contacts', nullable: true, unique: false })
|
|
29
|
-
contacts?: Array<string>
|
|
30
|
-
|
|
31
19
|
@Column('text', { name: 'issuerBrandingId', nullable: false })
|
|
32
20
|
issuerBrandingId!: string
|
|
33
21
|
}
|
|
22
|
+
|
|
23
|
+
export const issuerLocaleBrandingEntityFrom = (args: IBasicIssuerLocaleBranding): IssuerLocaleBrandingEntity => {
|
|
24
|
+
const issuerLocaleBrandingEntity: IssuerLocaleBrandingEntity = new IssuerLocaleBrandingEntity()
|
|
25
|
+
issuerLocaleBrandingEntity.alias = isEmptyString(args.alias) ? undefined : args.alias
|
|
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
|
|
31
|
+
|
|
32
|
+
return issuerLocaleBrandingEntity
|
|
33
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BaseEntity, BeforeInsert, BeforeUpdate, Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
|
2
|
+
import { IBasicTextAttributes } from '../../types'
|
|
2
3
|
import { validate, Validate, ValidationError } from 'class-validator'
|
|
3
|
-
import { IsNonEmptyStringConstraint } from '../validators'
|
|
4
|
+
import { isEmptyString, IsNonEmptyStringConstraint } from '../validators'
|
|
4
5
|
|
|
5
6
|
@Entity('TextAttributes')
|
|
6
7
|
export class TextAttributesEntity extends BaseEntity {
|
|
@@ -21,3 +22,10 @@ export class TextAttributesEntity extends BaseEntity {
|
|
|
21
22
|
return
|
|
22
23
|
}
|
|
23
24
|
}
|
|
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,13 +3,12 @@ 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'
|
|
7
6
|
import {
|
|
8
7
|
activityEventEntityFrom,
|
|
9
|
-
|
|
10
|
-
auditEventEntityFrom
|
|
11
|
-
|
|
12
|
-
} from '../utils/eventLogger/MappingUtils'
|
|
8
|
+
AuditEventEntity,
|
|
9
|
+
auditEventEntityFrom
|
|
10
|
+
} from '../entities/eventLogger/AuditEventEntity'
|
|
11
|
+
import { activityEventFrom, auditEventFrom } from '../utils/eventLogger/MappingUtils'
|
|
13
12
|
import {
|
|
14
13
|
GetActivityEventsArgs,
|
|
15
14
|
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 } 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'
|
|
11
|
+
import { BackgroundAttributesEntity, backgroundAttributesEntityFrom } from './entities/issuanceBranding/BackgroundAttributesEntity'
|
|
12
|
+
import { CredentialBrandingEntity, credentialBrandingEntityFrom } from './entities/issuanceBranding/CredentialBrandingEntity'
|
|
13
|
+
import { CredentialLocaleBrandingEntity, credentialLocaleBrandingEntityFrom } from './entities/issuanceBranding/CredentialLocaleBrandingEntity'
|
|
14
|
+
import { ImageAttributesEntity, imageAttributesEntityFrom } from './entities/issuanceBranding/ImageAttributesEntity'
|
|
15
|
+
import { ImageDimensionsEntity, imageDimensionsEntityFrom } from './entities/issuanceBranding/ImageDimensionsEntity'
|
|
16
|
+
import { IssuerLocaleBrandingEntity, issuerLocaleBrandingEntityFrom } from './entities/issuanceBranding/IssuerLocaleBrandingEntity'
|
|
17
|
+
import { IssuerBrandingEntity, issuerBrandingEntityFrom } from './entities/issuanceBranding/IssuerBrandingEntity'
|
|
18
|
+
import { TextAttributesEntity, textAttributesEntityFrom } 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,8 +33,10 @@ 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 } from './entities/eventLogger/AuditEventEntity'
|
|
36
|
+
import { AuditEventEntity, auditEventEntityFrom } 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'
|
|
38
40
|
import { PresentationDefinitionItemEntity } from './entities/presentationDefinition/PresentationDefinitionItemEntity'
|
|
39
41
|
import { ContactMetadataItemEntity } from './entities/contact/ContactMetadataItemEntity'
|
|
40
42
|
export { AbstractEventLoggerStore } from './eventLogger/AbstractEventLoggerStore'
|
|
@@ -57,10 +59,6 @@ export {
|
|
|
57
59
|
export * from './types'
|
|
58
60
|
export * from './utils/contact/MappingUtils'
|
|
59
61
|
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'
|
|
64
62
|
|
|
65
63
|
export const DataStoreContactEntities = [
|
|
66
64
|
BaseConfigEntity,
|
|
@@ -135,13 +133,28 @@ export {
|
|
|
135
133
|
IssuerLocaleBrandingEntity,
|
|
136
134
|
ElectronicAddressEntity,
|
|
137
135
|
PhysicalAddressEntity,
|
|
136
|
+
backgroundAttributesEntityFrom,
|
|
137
|
+
credentialBrandingEntityFrom,
|
|
138
|
+
imageAttributesEntityFrom,
|
|
139
|
+
imageDimensionsEntityFrom,
|
|
140
|
+
issuerBrandingEntityFrom,
|
|
141
|
+
textAttributesEntityFrom,
|
|
142
|
+
issuerLocaleBrandingEntityFrom,
|
|
143
|
+
credentialLocaleBrandingEntityFrom,
|
|
138
144
|
IStatusListEntity,
|
|
139
145
|
IStatusListEntryEntity,
|
|
140
146
|
StatusListEntity,
|
|
141
147
|
StatusListEntryEntity,
|
|
142
148
|
AuditEventEntity,
|
|
149
|
+
auditEventEntityFrom,
|
|
143
150
|
DigitalCredentialEntity,
|
|
151
|
+
digitalCredentialFrom,
|
|
152
|
+
digitalCredentialsFrom,
|
|
153
|
+
nonPersistedDigitalCredentialEntityFromAddArgs,
|
|
144
154
|
MachineStateInfoEntity,
|
|
145
155
|
PresentationDefinitionItemEntity,
|
|
156
|
+
isPresentationDefinitionEqual,
|
|
146
157
|
ContactMetadataItemEntity,
|
|
147
158
|
}
|
|
159
|
+
|
|
160
|
+
export * from './utils/hasher'
|
|
@@ -1,25 +1,17 @@
|
|
|
1
|
-
import { OrPromise } from '@sphereon/ssi-types'
|
|
2
1
|
import Debug from 'debug'
|
|
3
2
|
import { DataSource, DeleteResult, In, Not, Repository } from 'typeorm'
|
|
4
|
-
import {
|
|
5
|
-
credentialBrandingEntityFrom,
|
|
6
|
-
credentialBrandingFrom,
|
|
7
|
-
credentialLocaleBrandingEntityFrom,
|
|
8
|
-
issuerBrandingEntityFrom,
|
|
9
|
-
issuerBrandingFrom,
|
|
10
|
-
issuerLocaleBrandingEntityFrom,
|
|
11
|
-
localeBrandingFrom
|
|
12
|
-
} from '../utils/issuanceBranding/MappingUtils'
|
|
3
|
+
import { OrPromise } from '@sphereon/ssi-types'
|
|
13
4
|
import { BackgroundAttributesEntity } from '../entities/issuanceBranding/BackgroundAttributesEntity'
|
|
14
5
|
import { ImageAttributesEntity } from '../entities/issuanceBranding/ImageAttributesEntity'
|
|
15
6
|
import { ImageDimensionsEntity } from '../entities/issuanceBranding/ImageDimensionsEntity'
|
|
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'
|
|
7
|
+
import { IssuerBrandingEntity, issuerBrandingEntityFrom } from '../entities/issuanceBranding/IssuerBrandingEntity'
|
|
8
|
+
import { CredentialBrandingEntity, credentialBrandingEntityFrom } from '../entities/issuanceBranding/CredentialBrandingEntity'
|
|
9
|
+
import { CredentialLocaleBrandingEntity, credentialLocaleBrandingEntityFrom } from '../entities/issuanceBranding/CredentialLocaleBrandingEntity'
|
|
10
|
+
import { IssuerLocaleBrandingEntity, issuerLocaleBrandingEntityFrom } from '../entities/issuanceBranding/IssuerLocaleBrandingEntity'
|
|
20
11
|
import { BaseLocaleBrandingEntity } from '../entities/issuanceBranding/BaseLocaleBrandingEntity'
|
|
21
12
|
import { TextAttributesEntity } from '../entities/issuanceBranding/TextAttributesEntity'
|
|
22
13
|
import { AbstractIssuanceBrandingStore } from './AbstractIssuanceBrandingStore'
|
|
14
|
+
import { credentialBrandingFrom, issuerBrandingFrom, localeBrandingFrom } from '../utils/issuanceBranding/MappingUtils'
|
|
23
15
|
import {
|
|
24
16
|
IAddCredentialBrandingArgs,
|
|
25
17
|
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,
|
|
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"))`,
|
|
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,
|
|
16
|
+
`CREATE TABLE "BaseLocaleBranding" ("id" varchar PRIMARY KEY NOT NULL, "alias" varchar(255), "locale" varchar(255) NOT NULL, "description" varchar(255), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "credentialBrandingId" varchar, "issuerBrandingId" varchar, "type" varchar NOT NULL, "logoId" varchar, "backgroundId" varchar, "textId" varchar, CONSTRAINT "UQ_logoId" UNIQUE ("logoId"), CONSTRAINT "UQ_backgroundId" UNIQUE ("backgroundId"), CONSTRAINT "UQ_textId" UNIQUE ("textId"))`,
|
|
17
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,
|
|
54
|
+
`CREATE TABLE "temporary_BaseLocaleBranding" ("id" varchar PRIMARY KEY NOT NULL, "alias" varchar(255), "locale" varchar(255) NOT NULL, "description" varchar(255), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "credentialBrandingId" varchar, "issuerBrandingId" varchar, "type" varchar NOT NULL, "logoId" varchar, "backgroundId" varchar, "textId" varchar, CONSTRAINT "UQ_logoId" UNIQUE ("logoId"), CONSTRAINT "UQ_backgroundId" UNIQUE ("backgroundId"), CONSTRAINT "UQ_textId" UNIQUE ("textId"), CONSTRAINT "FK_BaseLocaleBranding_logoId" FOREIGN KEY ("logoId") REFERENCES "ImageAttributes" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_BaseLocaleBranding_backgroundId" FOREIGN KEY ("backgroundId") REFERENCES "BackgroundAttributes" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_BaseLocaleBranding_textId" FOREIGN KEY ("textId") REFERENCES "TextAttributes" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_BaseLocaleBranding_credentialBrandingId" FOREIGN KEY ("credentialBrandingId") REFERENCES "CredentialBranding" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_BaseLocaleBranding_issuerBrandingId" FOREIGN KEY ("issuerBrandingId") REFERENCES "IssuerBranding" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`,
|
|
55
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,
|
|
76
|
+
`CREATE TABLE "BaseLocaleBranding" ("id" varchar PRIMARY KEY NOT NULL, "alias" varchar(255), "locale" varchar(255) NOT NULL, "description" varchar(255), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "credentialBrandingId" varchar, "issuerBrandingId" varchar, "type" varchar NOT NULL, "logoId" varchar, "backgroundId" varchar, "textId" varchar, CONSTRAINT "UQ_logoId" UNIQUE ("logoId"), CONSTRAINT "UQ_backgroundId" UNIQUE ("backgroundId"), CONSTRAINT "UQ_textId" UNIQUE ("textId"))`,
|
|
77
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"`,
|
|
@@ -80,23 +80,17 @@ export interface IPartialCredentialBranding extends Partial<Omit<ICredentialBran
|
|
|
80
80
|
localeBranding?: IPartialCredentialLocaleBranding
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
export interface IIssuerLocaleBranding extends ILocaleBranding {
|
|
84
|
-
clientUri?: string
|
|
85
|
-
tosUri?: string
|
|
86
|
-
policyUri?: string
|
|
87
|
-
contacts?: Array<string>
|
|
88
|
-
}
|
|
83
|
+
export interface IIssuerLocaleBranding extends ILocaleBranding {}
|
|
89
84
|
export interface IBasicIssuerLocaleBranding
|
|
90
85
|
extends Omit<IIssuerLocaleBranding, 'id' | 'createdAt' | 'lastUpdatedAt' | 'logo' | 'background' | 'text'> {
|
|
91
86
|
logo?: IBasicImageAttributes
|
|
92
87
|
background?: IBasicBackgroundAttributes
|
|
93
88
|
text?: IBasicTextAttributes
|
|
94
89
|
}
|
|
95
|
-
export interface IPartialIssuerLocaleBranding extends Partial<Omit<IIssuerLocaleBranding, 'logo' | 'background' | 'text'
|
|
90
|
+
export interface IPartialIssuerLocaleBranding extends Partial<Omit<IIssuerLocaleBranding, 'logo' | 'background' | 'text'>> {
|
|
96
91
|
logo?: IPartialImageAttributes
|
|
97
92
|
background?: IPartialBackgroundAttributes
|
|
98
93
|
text?: IPartialTextAttributes
|
|
99
|
-
contacts?: string
|
|
100
94
|
}
|
|
101
95
|
|
|
102
96
|
export interface IIssuerBranding {
|
|
@@ -109,7 +103,7 @@ export interface IIssuerBranding {
|
|
|
109
103
|
export interface IBasicIssuerBranding extends Omit<IIssuerBranding, 'id' | 'createdAt' | 'lastUpdatedAt' | 'localeBranding'> {
|
|
110
104
|
localeBranding: Array<IBasicIssuerLocaleBranding>
|
|
111
105
|
}
|
|
112
|
-
export interface IPartialIssuerBranding extends Partial<Omit<
|
|
106
|
+
export interface IPartialIssuerBranding extends Partial<Omit<ICredentialBranding, 'localeBranding'>> {
|
|
113
107
|
localeBranding?: IPartialIssuerLocaleBranding
|
|
114
108
|
}
|
|
115
109
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { AuditEventEntity } from '../../entities/eventLogger/AuditEventEntity'
|
|
1
2
|
import { ActivityLoggingEvent, AuditLoggingEvent } from '@sphereon/ssi-sdk.core'
|
|
2
3
|
import { LoggingEventType } from '@sphereon/ssi-types'
|
|
3
4
|
import { replaceNullWithUndefined } from '../FormattingUtils'
|
|
4
|
-
import { AuditEventEntity } from '../../entities/eventLogger/AuditEventEntity'
|
|
5
|
-
import { NonPersistedActivityLoggingEvent, NonPersistedAuditLoggingEvent } from '../../types'
|
|
6
5
|
|
|
7
6
|
export const auditEventFrom = (event: AuditEventEntity): AuditLoggingEvent => {
|
|
8
7
|
const result: AuditLoggingEvent = {
|
|
@@ -30,32 +29,8 @@ export const auditEventFrom = (event: AuditEventEntity): AuditLoggingEvent => {
|
|
|
30
29
|
return replaceNullWithUndefined(result)
|
|
31
30
|
}
|
|
32
31
|
|
|
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
|
-
}
|
|
57
|
-
|
|
58
32
|
export const activityEventFrom = (event: AuditEventEntity): ActivityLoggingEvent => {
|
|
33
|
+
|
|
59
34
|
const result: ActivityLoggingEvent = {
|
|
60
35
|
id: event.id,
|
|
61
36
|
type: LoggingEventType.ACTIVITY,
|
|
@@ -84,33 +59,3 @@ export const activityEventFrom = (event: AuditEventEntity): ActivityLoggingEvent
|
|
|
84
59
|
|
|
85
60
|
return replaceNullWithUndefined(result)
|
|
86
61
|
}
|
|
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,27 +1,8 @@
|
|
|
1
|
-
import { replaceNullWithUndefined } from '../FormattingUtils'
|
|
2
|
-
import { isEmptyString } from '../../entities/validators'
|
|
3
1
|
import { CredentialBrandingEntity } from '../../entities/issuanceBranding/CredentialBrandingEntity'
|
|
4
2
|
import { BaseLocaleBrandingEntity } from '../../entities/issuanceBranding/BaseLocaleBrandingEntity'
|
|
5
3
|
import { IssuerBrandingEntity } from '../../entities/issuanceBranding/IssuerBrandingEntity'
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
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'
|
|
4
|
+
import { replaceNullWithUndefined } from '../FormattingUtils'
|
|
5
|
+
import { ICredentialBranding, IIssuerBranding, ILocaleBranding } from '../../types'
|
|
25
6
|
|
|
26
7
|
export const credentialBrandingFrom = (credentialBranding: CredentialBrandingEntity): ICredentialBranding => {
|
|
27
8
|
const result: ICredentialBranding = {
|
|
@@ -49,87 +30,3 @@ export const localeBrandingFrom = (localeBranding: BaseLocaleBrandingEntity): IL
|
|
|
49
30
|
|
|
50
31
|
return replaceNullWithUndefined(result)
|
|
51
32
|
}
|
|
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
|
-
}
|