@sphereon/ssi-sdk.data-store 0.30.2-unstable.9 → 0.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/dist/contact/ContactStore.d.ts.map +1 -1
  2. package/dist/digitalCredential/DigitalCredentialStore.d.ts.map +1 -1
  3. package/dist/digitalCredential/DigitalCredentialStore.js +1 -3
  4. package/dist/digitalCredential/DigitalCredentialStore.js.map +1 -1
  5. package/dist/entities/digitalCredential/DigitalCredentialEntity.d.ts.map +1 -1
  6. package/dist/entities/digitalCredential/DigitalCredentialEntity.js +1 -1
  7. package/dist/entities/digitalCredential/DigitalCredentialEntity.js.map +1 -1
  8. package/dist/entities/eventLogger/AuditEventEntity.d.ts +8 -4
  9. package/dist/entities/eventLogger/AuditEventEntity.d.ts.map +1 -1
  10. package/dist/entities/eventLogger/AuditEventEntity.js +28 -25
  11. package/dist/entities/eventLogger/AuditEventEntity.js.map +1 -1
  12. package/dist/entities/issuanceBranding/BackgroundAttributesEntity.d.ts +0 -2
  13. package/dist/entities/issuanceBranding/BackgroundAttributesEntity.d.ts.map +1 -1
  14. package/dist/entities/issuanceBranding/BackgroundAttributesEntity.js +1 -8
  15. package/dist/entities/issuanceBranding/BackgroundAttributesEntity.js.map +1 -1
  16. package/dist/entities/issuanceBranding/CredentialBrandingEntity.d.ts +0 -2
  17. package/dist/entities/issuanceBranding/CredentialBrandingEntity.d.ts.map +1 -1
  18. package/dist/entities/issuanceBranding/CredentialBrandingEntity.js +1 -9
  19. package/dist/entities/issuanceBranding/CredentialBrandingEntity.js.map +1 -1
  20. package/dist/entities/issuanceBranding/CredentialClaimsEntity.d.ts +10 -0
  21. package/dist/entities/issuanceBranding/CredentialClaimsEntity.d.ts.map +1 -0
  22. package/dist/entities/issuanceBranding/CredentialClaimsEntity.js +70 -0
  23. package/dist/entities/issuanceBranding/CredentialClaimsEntity.js.map +1 -0
  24. package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.d.ts +2 -2
  25. package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.d.ts.map +1 -1
  26. package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.js +12 -16
  27. package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.js.map +1 -1
  28. package/dist/entities/issuanceBranding/ImageAttributesEntity.d.ts +0 -2
  29. package/dist/entities/issuanceBranding/ImageAttributesEntity.d.ts.map +1 -1
  30. package/dist/entities/issuanceBranding/ImageAttributesEntity.js +1 -11
  31. package/dist/entities/issuanceBranding/ImageAttributesEntity.js.map +1 -1
  32. package/dist/entities/issuanceBranding/ImageDimensionsEntity.d.ts +0 -2
  33. package/dist/entities/issuanceBranding/ImageDimensionsEntity.d.ts.map +1 -1
  34. package/dist/entities/issuanceBranding/ImageDimensionsEntity.js +1 -8
  35. package/dist/entities/issuanceBranding/ImageDimensionsEntity.js.map +1 -1
  36. package/dist/entities/issuanceBranding/IssuerBrandingEntity.d.ts +0 -2
  37. package/dist/entities/issuanceBranding/IssuerBrandingEntity.d.ts.map +1 -1
  38. package/dist/entities/issuanceBranding/IssuerBrandingEntity.js +1 -8
  39. package/dist/entities/issuanceBranding/IssuerBrandingEntity.js.map +1 -1
  40. package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.d.ts +4 -2
  41. package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.d.ts.map +1 -1
  42. package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.js +21 -15
  43. package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.js.map +1 -1
  44. package/dist/entities/issuanceBranding/TextAttributesEntity.d.ts +0 -2
  45. package/dist/entities/issuanceBranding/TextAttributesEntity.d.ts.map +1 -1
  46. package/dist/entities/issuanceBranding/TextAttributesEntity.js +1 -7
  47. package/dist/entities/issuanceBranding/TextAttributesEntity.js.map +1 -1
  48. package/dist/eventLogger/AbstractEventLoggerStore.d.ts +4 -2
  49. package/dist/eventLogger/AbstractEventLoggerStore.d.ts.map +1 -1
  50. package/dist/eventLogger/AbstractEventLoggerStore.js.map +1 -1
  51. package/dist/eventLogger/EventLoggerStore.d.ts +5 -4
  52. package/dist/eventLogger/EventLoggerStore.d.ts.map +1 -1
  53. package/dist/eventLogger/EventLoggerStore.js +35 -8
  54. package/dist/eventLogger/EventLoggerStore.js.map +1 -1
  55. package/dist/index.d.ts +20 -18
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js +17 -26
  58. package/dist/index.js.map +1 -1
  59. package/dist/issuanceBranding/IssuanceBrandingStore.d.ts +1 -5
  60. package/dist/issuanceBranding/IssuanceBrandingStore.d.ts.map +1 -1
  61. package/dist/issuanceBranding/IssuanceBrandingStore.js +17 -46
  62. package/dist/issuanceBranding/IssuanceBrandingStore.js.map +1 -1
  63. package/dist/migrations/internal-migrations-ormconfig.d.ts.map +1 -1
  64. package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.d.ts.map +1 -1
  65. package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.js +5 -1
  66. package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.js.map +1 -1
  67. package/dist/migrations/postgres/1701634812183-CreateAuditEvents.d.ts.map +1 -1
  68. package/dist/migrations/postgres/1701634812183-CreateAuditEvents.js +34 -6
  69. package/dist/migrations/postgres/1701634812183-CreateAuditEvents.js.map +1 -1
  70. package/dist/migrations/postgres/1708525189001-CreateDigitalCredential.js +1 -1
  71. package/dist/migrations/postgres/1708525189001-CreateDigitalCredential.js.map +1 -1
  72. package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.d.ts.map +1 -1
  73. package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.js +7 -3
  74. package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.js.map +1 -1
  75. package/dist/migrations/sqlite/1701634819487-CreateAuditEvents.d.ts.map +1 -1
  76. package/dist/migrations/sqlite/1701634819487-CreateAuditEvents.js +27 -1
  77. package/dist/migrations/sqlite/1701634819487-CreateAuditEvents.js.map +1 -1
  78. package/dist/migrations/sqlite/1708525189002-CreateDigitalCredential.js +1 -1
  79. package/dist/presentationDefinition/PDStore.d.ts.map +1 -1
  80. package/dist/statusList/StatusListStore.js.map +1 -1
  81. package/dist/types/contact/contact.d.ts +3 -3
  82. package/dist/types/contact/contact.d.ts.map +1 -1
  83. package/dist/types/digitalCredential/digitalCredential.d.ts +2 -1
  84. package/dist/types/digitalCredential/digitalCredential.d.ts.map +1 -1
  85. package/dist/types/digitalCredential/digitalCredential.js +1 -0
  86. package/dist/types/digitalCredential/digitalCredential.js.map +1 -1
  87. package/dist/types/eventLogger/IAbstractEventLoggerStore.d.ts +9 -2
  88. package/dist/types/eventLogger/IAbstractEventLoggerStore.d.ts.map +1 -1
  89. package/dist/types/eventLogger/eventLogger.d.ts +3 -2
  90. package/dist/types/eventLogger/eventLogger.d.ts.map +1 -1
  91. package/dist/types/issuanceBranding/issuanceBranding.d.ts +21 -4
  92. package/dist/types/issuanceBranding/issuanceBranding.d.ts.map +1 -1
  93. package/dist/utils/FormattingUtils.d.ts +2 -0
  94. package/dist/utils/FormattingUtils.d.ts.map +1 -0
  95. package/dist/utils/FormattingUtils.js +23 -0
  96. package/dist/utils/FormattingUtils.js.map +1 -0
  97. package/dist/utils/SortingUtils.d.ts.map +1 -1
  98. package/dist/utils/contact/MappingUtils.d.ts.map +1 -1
  99. package/dist/utils/contact/MappingUtils.js +27 -14
  100. package/dist/utils/contact/MappingUtils.js.map +1 -1
  101. package/dist/utils/digitalCredential/MappingUtils.d.ts.map +1 -1
  102. package/dist/utils/digitalCredential/MappingUtils.js +7 -5
  103. package/dist/utils/digitalCredential/MappingUtils.js.map +1 -1
  104. package/dist/utils/eventLogger/MappingUtils.d.ts +8 -0
  105. package/dist/utils/eventLogger/MappingUtils.d.ts.map +1 -0
  106. package/dist/utils/eventLogger/MappingUtils.js +70 -0
  107. package/dist/utils/eventLogger/MappingUtils.js.map +1 -0
  108. package/dist/utils/issuanceBranding/MappingUtils.d.ts +24 -0
  109. package/dist/utils/issuanceBranding/MappingUtils.d.ts.map +1 -0
  110. package/dist/utils/issuanceBranding/MappingUtils.js +109 -0
  111. package/dist/utils/issuanceBranding/MappingUtils.js.map +1 -0
  112. package/dist/utils/presentationDefinition/MappingUtils.d.ts.map +1 -1
  113. package/dist/utils/presentationDefinition/MappingUtils.js +5 -3
  114. package/dist/utils/presentationDefinition/MappingUtils.js.map +1 -1
  115. package/package.json +10 -9
  116. package/src/__tests__/contact.store.test.ts +46 -4
  117. package/src/__tests__/digitalCredential.entities.test.ts +1 -7
  118. package/src/__tests__/digitalCredential.store.test.ts +85 -4
  119. package/src/__tests__/eventLogger.entities.test.ts +60 -5
  120. package/src/__tests__/eventLogger.store.test.ts +461 -3
  121. package/src/__tests__/issuanceBranding.entities.test.ts +129 -0
  122. package/src/digitalCredential/DigitalCredentialStore.ts +1 -3
  123. package/src/entities/digitalCredential/DigitalCredentialEntity.ts +1 -1
  124. package/src/entities/eventLogger/AuditEventEntity.ts +23 -28
  125. package/src/entities/issuanceBranding/BackgroundAttributesEntity.ts +2 -11
  126. package/src/entities/issuanceBranding/CredentialBrandingEntity.ts +1 -13
  127. package/src/entities/issuanceBranding/CredentialClaimsEntity.ts +35 -0
  128. package/src/entities/issuanceBranding/CredentialLocaleBrandingEntity.ts +11 -18
  129. package/src/entities/issuanceBranding/ImageAttributesEntity.ts +2 -14
  130. package/src/entities/issuanceBranding/ImageDimensionsEntity.ts +0 -9
  131. package/src/entities/issuanceBranding/IssuerBrandingEntity.ts +1 -12
  132. package/src/entities/issuanceBranding/IssuerLocaleBrandingEntity.ts +17 -17
  133. package/src/entities/issuanceBranding/TextAttributesEntity.ts +1 -9
  134. package/src/eventLogger/AbstractEventLoggerStore.ts +4 -2
  135. package/src/eventLogger/EventLoggerStore.ts +45 -32
  136. package/src/index.ts +20 -30
  137. package/src/issuanceBranding/IssuanceBrandingStore.ts +26 -68
  138. package/src/migrations/postgres/1685628974232-CreateIssuanceBranding.ts +11 -1
  139. package/src/migrations/postgres/1701634812183-CreateAuditEvents.ts +34 -6
  140. package/src/migrations/postgres/1708525189001-CreateDigitalCredential.ts +1 -1
  141. package/src/migrations/sqlite/1685628973231-CreateIssuanceBranding.ts +11 -3
  142. package/src/migrations/sqlite/1701634819487-CreateAuditEvents.ts +27 -1
  143. package/src/migrations/sqlite/1708525189002-CreateDigitalCredential.ts +1 -1
  144. package/src/statusList/StatusListStore.ts +1 -1
  145. package/src/types/contact/contact.ts +3 -3
  146. package/src/types/digitalCredential/digitalCredential.ts +1 -0
  147. package/src/types/eventLogger/IAbstractEventLoggerStore.ts +12 -2
  148. package/src/types/eventLogger/eventLogger.ts +3 -2
  149. package/src/types/issuanceBranding/issuanceBranding.ts +24 -6
  150. package/src/utils/FormattingUtils.ts +21 -0
  151. package/src/utils/contact/MappingUtils.ts +39 -13
  152. package/src/utils/digitalCredential/MappingUtils.ts +4 -1
  153. package/src/utils/eventLogger/MappingUtils.ts +117 -0
  154. package/src/utils/issuanceBranding/MappingUtils.ts +145 -0
  155. package/src/utils/presentationDefinition/MappingUtils.ts +4 -1
@@ -1,6 +1,6 @@
1
1
  import { ManagedIdentifierOptsOrResult } from '@sphereon/ssi-sdk-ext.identifier-resolution'
2
2
  import { IIdentifier } from '@veramo/core'
3
- import { ILocaleBranding } from '../issuanceBranding/issuanceBranding'
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?: ILocaleBranding
38
+ branding?: IIssuerLocaleBranding
39
39
  relationships: Array<PartyRelationship>
40
40
  createdAt: Date
41
41
  lastUpdatedAt: Date
@@ -93,6 +93,7 @@ export enum CredentialRole {
93
93
  ISSUER = 'ISSUER',
94
94
  VERIFIER = 'VERIFIER',
95
95
  HOLDER = 'HOLDER',
96
+ FEDERATION_TRUST_ANCHOR = 'FEDERATION_TRUST_ANCHOR',
96
97
  }
97
98
 
98
99
  export enum CredentialStateType {
@@ -1,12 +1,22 @@
1
- import { PartialAuditLoggingEvent } from '@sphereon/ssi-sdk.core'
2
- import { NonPersistedAuditLoggingEvent } from './eventLogger'
1
+ import { PartialActivityLoggingEvent, PartialAuditLoggingEvent } from '@sphereon/ssi-sdk.core'
2
+ import { NonPersistedActivityLoggingEvent, NonPersistedAuditLoggingEvent } from './eventLogger'
3
3
 
4
4
  export type FindAuditLoggingEventArgs = Array<PartialAuditLoggingEvent>
5
5
 
6
+ export type FindActivityLoggingEventArgs = Array<PartialActivityLoggingEvent>
7
+
6
8
  export type StoreAuditEventArgs = {
7
9
  event: NonPersistedAuditLoggingEvent
8
10
  }
9
11
 
12
+ export type StoreActivityEventArgs = {
13
+ event: NonPersistedActivityLoggingEvent
14
+ }
15
+
10
16
  export type GetAuditEventsArgs = {
11
17
  filter?: FindAuditLoggingEventArgs
12
18
  }
19
+
20
+ export type GetActivityEventsArgs = {
21
+ filter?: FindActivityLoggingEventArgs
22
+ }
@@ -1,3 +1,4 @@
1
- import { AuditLoggingEvent } from '@sphereon/ssi-sdk.core'
1
+ import { ActivityLoggingEvent, AuditLoggingEvent } from '@sphereon/ssi-sdk.core'
2
2
 
3
- export type NonPersistedAuditLoggingEvent = Omit<AuditLoggingEvent, 'id'>
3
+ export type NonPersistedAuditLoggingEvent = Omit<AuditLoggingEvent, 'id' | 'type'>
4
+ export type NonPersistedActivityLoggingEvent = Omit<ActivityLoggingEvent, 'id' | 'type'>
@@ -52,17 +52,29 @@ export interface IImageDimensions {
52
52
  export interface IBasicImageDimensions extends Omit<IImageDimensions, 'id'> {}
53
53
  export interface IPartialImageDimensions extends Partial<IImageDimensions> {}
54
54
 
55
- export interface ICredentialLocaleBranding extends ILocaleBranding {}
55
+ export interface ICredentialClaim {
56
+ id: string
57
+ key: string
58
+ name: string
59
+ }
60
+ export interface IBasicCredentialClaim extends Omit<ICredentialClaim, 'id'> {}
61
+ export interface IPartialCredentialClaim extends Partial<ICredentialClaim> {}
62
+
63
+ export interface ICredentialLocaleBranding extends ILocaleBranding {
64
+ claims?: Array<ICredentialClaim>
65
+ }
56
66
  export interface IBasicCredentialLocaleBranding
57
- extends Omit<ICredentialLocaleBranding, 'id' | 'createdAt' | 'lastUpdatedAt' | 'logo' | 'background' | 'text'> {
67
+ extends Omit<ICredentialLocaleBranding, 'id' | 'createdAt' | 'lastUpdatedAt' | 'logo' | 'background' | 'text' | 'claims'> {
58
68
  logo?: IBasicImageAttributes
59
69
  background?: IBasicBackgroundAttributes
60
70
  text?: IBasicTextAttributes
71
+ claims?: Array<IBasicCredentialClaim>
61
72
  }
62
- export interface IPartialCredentialLocaleBranding extends Partial<Omit<ICredentialLocaleBranding, 'logo' | 'background' | 'text'>> {
73
+ export interface IPartialCredentialLocaleBranding extends Partial<Omit<ICredentialLocaleBranding, 'logo' | 'background' | 'text' | 'claims'>> {
63
74
  logo?: IPartialImageAttributes
64
75
  background?: IPartialBackgroundAttributes
65
76
  text?: IPartialTextAttributes
77
+ claims?: IPartialCredentialClaim
66
78
  }
67
79
 
68
80
  export interface ICredentialBranding {
@@ -80,17 +92,23 @@ export interface IPartialCredentialBranding extends Partial<Omit<ICredentialBran
80
92
  localeBranding?: IPartialCredentialLocaleBranding
81
93
  }
82
94
 
83
- export interface IIssuerLocaleBranding extends ILocaleBranding {}
95
+ export interface IIssuerLocaleBranding extends ILocaleBranding {
96
+ clientUri?: string
97
+ tosUri?: string
98
+ policyUri?: string
99
+ contacts?: Array<string>
100
+ }
84
101
  export interface IBasicIssuerLocaleBranding
85
102
  extends Omit<IIssuerLocaleBranding, 'id' | 'createdAt' | 'lastUpdatedAt' | 'logo' | 'background' | 'text'> {
86
103
  logo?: IBasicImageAttributes
87
104
  background?: IBasicBackgroundAttributes
88
105
  text?: IBasicTextAttributes
89
106
  }
90
- export interface IPartialIssuerLocaleBranding extends Partial<Omit<IIssuerLocaleBranding, 'logo' | 'background' | 'text'>> {
107
+ export interface IPartialIssuerLocaleBranding extends Partial<Omit<IIssuerLocaleBranding, 'logo' | 'background' | 'text' | 'contacts'>> {
91
108
  logo?: IPartialImageAttributes
92
109
  background?: IPartialBackgroundAttributes
93
110
  text?: IPartialTextAttributes
111
+ contacts?: string
94
112
  }
95
113
 
96
114
  export interface IIssuerBranding {
@@ -103,7 +121,7 @@ export interface IIssuerBranding {
103
121
  export interface IBasicIssuerBranding extends Omit<IIssuerBranding, 'id' | 'createdAt' | 'lastUpdatedAt' | 'localeBranding'> {
104
122
  localeBranding: Array<IBasicIssuerLocaleBranding>
105
123
  }
106
- export interface IPartialIssuerBranding extends Partial<Omit<ICredentialBranding, 'localeBranding'>> {
124
+ export interface IPartialIssuerBranding extends Partial<Omit<IIssuerBranding, 'localeBranding'>> {
107
125
  localeBranding?: IPartialIssuerLocaleBranding
108
126
  }
109
127
 
@@ -0,0 +1,21 @@
1
+ export const replaceNullWithUndefined = (obj: any): any => {
2
+ if (obj === null) {
3
+ return undefined
4
+ }
5
+
6
+ if (typeof obj !== 'object' || obj instanceof Date) {
7
+ return obj
8
+ }
9
+
10
+ if (Array.isArray(obj)) {
11
+ return obj.map((value: any) => replaceNullWithUndefined(value))
12
+ }
13
+
14
+ const result: any = {}
15
+ for (const key in obj) {
16
+ if (obj.hasOwnProperty(key)) {
17
+ result[key] = replaceNullWithUndefined(obj[key])
18
+ }
19
+ }
20
+ return result
21
+ }
@@ -47,6 +47,7 @@ import { OpenIdConfigEntity } from '../../entities/contact/OpenIdConfigEntity'
47
47
  import { PartyTypeEntity } from '../../entities/contact/PartyTypeEntity'
48
48
  import { PhysicalAddressEntity } from '../../entities/contact/PhysicalAddressEntity'
49
49
  import { ContactMetadataItemEntity } from '../../entities/contact/ContactMetadataItemEntity'
50
+ import { replaceNullWithUndefined } from '../FormattingUtils'
50
51
 
51
52
  export const partyEntityFrom = (party: NonPersistedParty): PartyEntity => {
52
53
  const partyEntity: PartyEntity = new PartyEntity()
@@ -67,10 +68,10 @@ export const partyEntityFrom = (party: NonPersistedParty): PartyEntity => {
67
68
  }
68
69
 
69
70
  export const partyFrom = (party: PartyEntity): Party => {
70
- return {
71
+ const result: Party = {
71
72
  id: party.id,
72
73
  uri: party.uri,
73
- roles: [...new Set(party.identities?.flatMap((identity: IdentityEntity) => identity.roles))] ?? [],
74
+ roles: [...new Set(party.identities?.flatMap((identity: IdentityEntity) => identity.roles))],
74
75
  identities: party.identities ? party.identities.map((identity: IdentityEntity) => identityFrom(identity)) : [],
75
76
  electronicAddresses: party.electronicAddresses
76
77
  ? party.electronicAddresses.map((electronicAddress: ElectronicAddressEntity) => electronicAddressFrom(electronicAddress))
@@ -86,6 +87,8 @@ export const partyFrom = (party: PartyEntity): Party => {
86
87
  createdAt: party.createdAt,
87
88
  lastUpdatedAt: party.lastUpdatedAt,
88
89
  }
90
+
91
+ return replaceNullWithUndefined(result)
89
92
  }
90
93
 
91
94
  export const contactEntityFrom = (contact: NonPersistedContact): BaseContactEntity => {
@@ -125,13 +128,15 @@ export const connectionEntityFrom = (connection: NonPersistedConnection): Connec
125
128
  }
126
129
 
127
130
  export const connectionFrom = (connection: ConnectionEntity): Connection => {
128
- return {
131
+ const result: Connection = {
129
132
  id: connection.id,
130
133
  type: connection.type,
131
134
  ownerId: connection.ownerId,
132
135
  tenantId: connection.tenantId,
133
136
  config: configFrom(connection.config),
134
137
  }
138
+
139
+ return replaceNullWithUndefined(result)
135
140
  }
136
141
 
137
142
  const configEntityFrom = (config: NonPersistedConnectionConfig): BaseConfigEntity => {
@@ -155,13 +160,15 @@ export const correlationIdentifierEntityFrom = (identifier: NonPersistedCorrelat
155
160
  }
156
161
 
157
162
  export const correlationIdentifierFrom = (identifier: CorrelationIdentifierEntity): CorrelationIdentifier => {
158
- return {
163
+ const result: CorrelationIdentifier = {
159
164
  id: identifier.id,
160
165
  type: identifier.type,
161
166
  correlationId: identifier.correlationId,
162
167
  ownerId: identifier.ownerId,
163
168
  tenantId: identifier.tenantId,
164
169
  }
170
+
171
+ return replaceNullWithUndefined(result)
165
172
  }
166
173
 
167
174
  export const didAuthConfigEntityFrom = (config: NonPersistedDidAuthConfig): DidAuthConfigEntity => {
@@ -196,7 +203,7 @@ export const electronicAddressEntityFrom = (electronicAddress: NonPersistedElect
196
203
  }
197
204
 
198
205
  export const electronicAddressFrom = (electronicAddress: ElectronicAddressEntity): ElectronicAddress => {
199
- return {
206
+ const result: ElectronicAddress = {
200
207
  id: electronicAddress.id,
201
208
  type: electronicAddress.type,
202
209
  electronicAddress: electronicAddress.electronicAddress,
@@ -205,6 +212,8 @@ export const electronicAddressFrom = (electronicAddress: ElectronicAddressEntity
205
212
  createdAt: electronicAddress.createdAt,
206
213
  lastUpdatedAt: electronicAddress.lastUpdatedAt,
207
214
  }
215
+
216
+ return replaceNullWithUndefined(result)
208
217
  }
209
218
 
210
219
  export const physicalAddressEntityFrom = (physicalAddress: NonPersistedPhysicalAddress): PhysicalAddressEntity => {
@@ -224,7 +233,7 @@ export const physicalAddressEntityFrom = (physicalAddress: NonPersistedPhysicalA
224
233
  }
225
234
 
226
235
  export const physicalAddressFrom = (physicalAddress: PhysicalAddressEntity): PhysicalAddress => {
227
- return {
236
+ const result: PhysicalAddress = {
228
237
  id: physicalAddress.id,
229
238
  type: physicalAddress.type,
230
239
  streetName: physicalAddress.streetName,
@@ -239,6 +248,8 @@ export const physicalAddressFrom = (physicalAddress: PhysicalAddressEntity): Phy
239
248
  createdAt: physicalAddress.createdAt,
240
249
  lastUpdatedAt: physicalAddress.lastUpdatedAt,
241
250
  }
251
+
252
+ return replaceNullWithUndefined(result)
242
253
  }
243
254
 
244
255
  export const identityEntityFrom = (entity: NonPersistedIdentity): IdentityEntity => {
@@ -257,7 +268,7 @@ export const identityEntityFrom = (entity: NonPersistedIdentity): IdentityEntity
257
268
  }
258
269
 
259
270
  export const identityFrom = (identity: IdentityEntity): Identity => {
260
- return {
271
+ const result: Identity = {
261
272
  id: identity.id,
262
273
  alias: identity.alias,
263
274
  origin: identity.origin,
@@ -270,6 +281,8 @@ export const identityFrom = (identity: IdentityEntity): Identity => {
270
281
  createdAt: identity.createdAt,
271
282
  lastUpdatedAt: identity.createdAt,
272
283
  }
284
+
285
+ return replaceNullWithUndefined(result)
273
286
  }
274
287
 
275
288
  const metadataItemEntityFrom = <T extends MetadataTypes, U extends { new (): any }>(
@@ -359,7 +372,7 @@ export const naturalPersonEntityFrom = (naturalPerson: NonPersistedNaturalPerson
359
372
  }
360
373
 
361
374
  export const naturalPersonFrom = (naturalPerson: NaturalPersonEntity): NaturalPerson => {
362
- return {
375
+ const result: NaturalPerson = {
363
376
  id: naturalPerson.id,
364
377
  firstName: naturalPerson.firstName,
365
378
  middleName: naturalPerson.middleName,
@@ -371,6 +384,8 @@ export const naturalPersonFrom = (naturalPerson: NaturalPersonEntity): NaturalPe
371
384
  createdAt: naturalPerson.createdAt,
372
385
  lastUpdatedAt: naturalPerson.lastUpdatedAt,
373
386
  }
387
+
388
+ return replaceNullWithUndefined(result)
374
389
  }
375
390
 
376
391
  export const openIdConfigEntityFrom = (config: NonPersistedOpenIdConfig): OpenIdConfigEntity => {
@@ -402,7 +417,7 @@ export const organizationEntityFrom = (organization: NonPersistedOrganization):
402
417
  }
403
418
 
404
419
  export const organizationFrom = (organization: OrganizationEntity): Organization => {
405
- return {
420
+ const result: Organization = {
406
421
  id: organization.id,
407
422
  legalName: organization.legalName,
408
423
  displayName: organization.displayName,
@@ -412,6 +427,8 @@ export const organizationFrom = (organization: OrganizationEntity): Organization
412
427
  createdAt: organization.createdAt,
413
428
  lastUpdatedAt: organization.lastUpdatedAt,
414
429
  }
430
+
431
+ return replaceNullWithUndefined(result)
415
432
  }
416
433
 
417
434
  export const partyRelationshipEntityFrom = (relationship: NonPersistedPartyRelationship): PartyRelationshipEntity => {
@@ -420,11 +437,12 @@ export const partyRelationshipEntityFrom = (relationship: NonPersistedPartyRelat
420
437
  partyRelationshipEntity.rightId = relationship.rightId
421
438
  partyRelationshipEntity.ownerId = relationship.ownerId
422
439
  partyRelationshipEntity.tenantId = relationship.tenantId
440
+
423
441
  return partyRelationshipEntity
424
442
  }
425
443
 
426
444
  export const partyRelationshipFrom = (relationship: PartyRelationshipEntity): PartyRelationship => {
427
- return {
445
+ const result: PartyRelationship = {
428
446
  id: relationship.id,
429
447
  leftId: relationship.leftId,
430
448
  rightId: relationship.rightId,
@@ -433,6 +451,8 @@ export const partyRelationshipFrom = (relationship: PartyRelationshipEntity): Pa
433
451
  createdAt: relationship.createdAt,
434
452
  lastUpdatedAt: relationship.lastUpdatedAt,
435
453
  }
454
+
455
+ return replaceNullWithUndefined(result)
436
456
  }
437
457
 
438
458
  export const partyTypeEntityFrom = (args: NonPersistedPartyType): PartyTypeEntity => {
@@ -450,7 +470,7 @@ export const partyTypeEntityFrom = (args: NonPersistedPartyType): PartyTypeEntit
450
470
  }
451
471
 
452
472
  export const partyTypeFrom = (partyType: PartyTypeEntity): PartyType => {
453
- return {
473
+ const result: PartyType = {
454
474
  id: partyType.id,
455
475
  type: partyType.type,
456
476
  origin: partyType.origin,
@@ -460,6 +480,8 @@ export const partyTypeFrom = (partyType: PartyTypeEntity): PartyType => {
460
480
  createdAt: partyType.createdAt,
461
481
  lastUpdatedAt: partyType.lastUpdatedAt,
462
482
  }
483
+
484
+ return replaceNullWithUndefined(result)
463
485
  }
464
486
 
465
487
  export const configFrom = (config: BaseConfigEntity): ConnectionConfig => {
@@ -473,7 +495,7 @@ export const configFrom = (config: BaseConfigEntity): ConnectionConfig => {
473
495
  }
474
496
 
475
497
  export const openIdConfigFrom = (config: OpenIdConfigEntity): OpenIdConfig => {
476
- return {
498
+ const result: OpenIdConfig = {
477
499
  id: config.id,
478
500
  clientId: config.clientId,
479
501
  clientSecret: config.clientSecret,
@@ -485,10 +507,12 @@ export const openIdConfigFrom = (config: OpenIdConfigEntity): OpenIdConfig => {
485
507
  ownerId: config.ownerId,
486
508
  tenantId: config.tenantId,
487
509
  }
510
+
511
+ return replaceNullWithUndefined(result)
488
512
  }
489
513
 
490
514
  export const didAuthConfigFrom = (config: DidAuthConfigEntity): DidAuthConfig => {
491
- return {
515
+ const result: DidAuthConfig = {
492
516
  id: config.id,
493
517
  idOpts: { identifier: config.identifier },
494
518
  stateId: '', // FIXME
@@ -497,6 +521,8 @@ export const didAuthConfigFrom = (config: DidAuthConfigEntity): DidAuthConfig =>
497
521
  ownerId: config.ownerId,
498
522
  tenantId: config.tenantId,
499
523
  }
524
+
525
+ return replaceNullWithUndefined(result)
500
526
  }
501
527
 
502
528
  export const isOpenIdConfig = (config: NonPersistedConnectionConfig | BaseConfigEntity): config is OpenIdConfig | OpenIdConfigEntity =>
@@ -18,6 +18,7 @@ import {
18
18
  NonPersistedDigitalCredential,
19
19
  RegulationType,
20
20
  } from '../../types'
21
+ import { replaceNullWithUndefined } from '../FormattingUtils'
21
22
 
22
23
  function determineDocumentType(raw: string): DocumentType {
23
24
  const rawDocument = parseRawDocument(raw)
@@ -150,9 +151,11 @@ export const nonPersistedDigitalCredentialEntityFromAddArgs = (addCredentialArgs
150
151
  }
151
152
 
152
153
  export const digitalCredentialFrom = (credentialEntity: DigitalCredentialEntity): DigitalCredential => {
153
- return {
154
+ const result: DigitalCredential = {
154
155
  ...credentialEntity,
155
156
  }
157
+
158
+ return replaceNullWithUndefined(result)
156
159
  }
157
160
 
158
161
  export const digitalCredentialsFrom = (credentialEntities: Array<DigitalCredentialEntity>): DigitalCredential[] => {
@@ -0,0 +1,117 @@
1
+ import { ActivityLoggingEvent, AuditLoggingEvent } from '@sphereon/ssi-sdk.core'
2
+ import { LoggingEventType } from '@sphereon/ssi-types'
3
+ import { replaceNullWithUndefined } from '../FormattingUtils'
4
+ import { AuditEventEntity } from '../../entities/eventLogger/AuditEventEntity'
5
+ import { NonPersistedActivityLoggingEvent, NonPersistedAuditLoggingEvent } from '../../types'
6
+
7
+ export const auditEventFrom = (event: AuditEventEntity): AuditLoggingEvent => {
8
+ const result: AuditLoggingEvent = {
9
+ id: event.id,
10
+ type: LoggingEventType.AUDIT,
11
+ description: event.description,
12
+ timestamp: event.timestamp,
13
+ level: event.level,
14
+ correlationId: event.correlationId,
15
+ actionType: event.actionType,
16
+ actionSubType: event.actionSubType,
17
+ initiatorType: event.initiatorType,
18
+ partyAlias: event.partyAlias,
19
+ partyCorrelationId: event.partyCorrelationId,
20
+ partyCorrelationType: event.partyCorrelationType,
21
+ subSystemType: event.subSystemType,
22
+ system: event.system,
23
+ systemAlias: event.systemAlias,
24
+ systemCorrelationId: event.systemCorrelationId,
25
+ systemCorrelationIdType: event.systemCorrelationIdType,
26
+ ...(event.data && { data: JSON.parse(event.data) }),
27
+ ...(event.diagnosticData && { diagnosticData: JSON.parse(event.diagnosticData) }),
28
+ }
29
+
30
+ return replaceNullWithUndefined(result)
31
+ }
32
+
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
+ export const activityEventFrom = (event: AuditEventEntity): ActivityLoggingEvent => {
59
+ const result: ActivityLoggingEvent = {
60
+ id: event.id,
61
+ type: LoggingEventType.ACTIVITY,
62
+ credentialType: event.credentialType!,
63
+ originalCredential: event.originalCredential,
64
+ credentialHash: event.credentialHash,
65
+ parentCredentialHash: event.parentCredentialHash,
66
+ sharePurpose: event.sharePurpose,
67
+ description: event.description,
68
+ timestamp: event.timestamp,
69
+ level: event.level,
70
+ correlationId: event.correlationId,
71
+ actionType: event.actionType,
72
+ actionSubType: event.actionSubType,
73
+ initiatorType: event.initiatorType,
74
+ partyAlias: event.partyAlias,
75
+ partyCorrelationId: event.partyCorrelationId,
76
+ partyCorrelationType: event.partyCorrelationType,
77
+ subSystemType: event.subSystemType,
78
+ system: event.system,
79
+ systemAlias: event.systemAlias,
80
+ systemCorrelationId: event.systemCorrelationId,
81
+ systemCorrelationIdType: event.systemCorrelationIdType,
82
+ ...(event.data && { data: JSON.parse(event.data) }),
83
+ ...(event.diagnosticData && { diagnosticData: JSON.parse(event.diagnosticData) }),
84
+ }
85
+
86
+ return replaceNullWithUndefined(result)
87
+ }
88
+
89
+ export const activityEventEntityFrom = (args: NonPersistedActivityLoggingEvent): AuditEventEntity => {
90
+ const activityEventEntity: AuditEventEntity = new AuditEventEntity()
91
+ activityEventEntity.type = LoggingEventType.ACTIVITY
92
+ activityEventEntity.timestamp = args.timestamp
93
+ activityEventEntity.level = args.level
94
+ activityEventEntity.correlationId = args.correlationId
95
+ activityEventEntity.system = args.system
96
+ activityEventEntity.subSystemType = args.subSystemType
97
+ activityEventEntity.actionType = args.actionType
98
+ activityEventEntity.actionSubType = args.actionSubType
99
+ activityEventEntity.initiatorType = args.initiatorType
100
+ activityEventEntity.systemCorrelationIdType = args.systemCorrelationIdType
101
+ activityEventEntity.systemCorrelationId = args.systemCorrelationId
102
+ activityEventEntity.systemAlias = args.systemAlias
103
+ activityEventEntity.partyCorrelationType = args.partyCorrelationType
104
+ activityEventEntity.partyCorrelationId = args.partyCorrelationId
105
+ activityEventEntity.partyAlias = args.partyAlias
106
+ activityEventEntity.description = args.description
107
+ activityEventEntity.partyCorrelationType = args.partyCorrelationType
108
+ activityEventEntity.data = JSON.stringify(args.data)
109
+ activityEventEntity.sharePurpose = args.sharePurpose
110
+ activityEventEntity.credentialType = args.credentialType
111
+ activityEventEntity.originalCredential = args.originalCredential
112
+ activityEventEntity.credentialHash = args.credentialHash
113
+ activityEventEntity.parentCredentialHash = args.parentCredentialHash
114
+ activityEventEntity.diagnosticData = JSON.stringify(args.diagnosticData)
115
+
116
+ return activityEventEntity
117
+ }
@@ -0,0 +1,145 @@
1
+ import { replaceNullWithUndefined } from '../FormattingUtils'
2
+ import { isEmptyString } from '../../entities/validators'
3
+ import { CredentialBrandingEntity } from '../../entities/issuanceBranding/CredentialBrandingEntity'
4
+ import { BaseLocaleBrandingEntity } from '../../entities/issuanceBranding/BaseLocaleBrandingEntity'
5
+ import { IssuerBrandingEntity } from '../../entities/issuanceBranding/IssuerBrandingEntity'
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 { CredentialClaimsEntity } from '../../entities/issuanceBranding/CredentialClaimsEntity'
13
+ import {
14
+ IBasicBackgroundAttributes,
15
+ IBasicCredentialBranding,
16
+ IBasicCredentialClaim,
17
+ IBasicCredentialLocaleBranding,
18
+ IBasicImageAttributes,
19
+ IBasicImageDimensions,
20
+ IBasicIssuerBranding,
21
+ IBasicIssuerLocaleBranding,
22
+ IBasicTextAttributes,
23
+ ICredentialBranding,
24
+ IIssuerBranding,
25
+ ILocaleBranding,
26
+ } from '../../types'
27
+
28
+ export const credentialBrandingFrom = (credentialBranding: CredentialBrandingEntity): ICredentialBranding => {
29
+ const result: ICredentialBranding = {
30
+ ...credentialBranding,
31
+ localeBranding: credentialBranding.localeBranding.map((localeBranding: BaseLocaleBrandingEntity) => localeBrandingFrom(localeBranding)),
32
+ }
33
+
34
+ return replaceNullWithUndefined(result)
35
+ }
36
+
37
+ export const issuerBrandingFrom = (issuerBranding: IssuerBrandingEntity): IIssuerBranding => {
38
+ const result: IIssuerBranding = {
39
+ ...issuerBranding,
40
+ localeBranding: issuerBranding.localeBranding.map((localeBranding: BaseLocaleBrandingEntity) => localeBrandingFrom(localeBranding)),
41
+ }
42
+
43
+ return replaceNullWithUndefined(result)
44
+ }
45
+
46
+ export const localeBrandingFrom = (localeBranding: BaseLocaleBrandingEntity): ILocaleBranding => {
47
+ const result: ILocaleBranding = {
48
+ ...localeBranding,
49
+ locale: localeBranding.locale === '' ? undefined : localeBranding.locale,
50
+ }
51
+
52
+ return replaceNullWithUndefined(result)
53
+ }
54
+
55
+ export const issuerLocaleBrandingEntityFrom = (args: IBasicIssuerLocaleBranding): IssuerLocaleBrandingEntity => {
56
+ const issuerLocaleBrandingEntity: IssuerLocaleBrandingEntity = new IssuerLocaleBrandingEntity()
57
+ issuerLocaleBrandingEntity.alias = isEmptyString(args.alias) ? undefined : args.alias
58
+ issuerLocaleBrandingEntity.locale = args.locale ? args.locale : ''
59
+ issuerLocaleBrandingEntity.logo = args.logo ? imageAttributesEntityFrom(args.logo) : undefined
60
+ issuerLocaleBrandingEntity.description = isEmptyString(args.description) ? undefined : args.description
61
+ issuerLocaleBrandingEntity.background = args.background ? backgroundAttributesEntityFrom(args.background) : undefined
62
+ issuerLocaleBrandingEntity.text = args.text ? textAttributesEntityFrom(args.text) : undefined
63
+ issuerLocaleBrandingEntity.clientUri = isEmptyString(args.clientUri) ? undefined : args.clientUri
64
+ issuerLocaleBrandingEntity.tosUri = isEmptyString(args.tosUri) ? undefined : args.tosUri
65
+ issuerLocaleBrandingEntity.policyUri = isEmptyString(args.policyUri) ? undefined : args.policyUri
66
+ issuerLocaleBrandingEntity.contacts = args.contacts
67
+
68
+ return issuerLocaleBrandingEntity
69
+ }
70
+
71
+ export const backgroundAttributesEntityFrom = (args: IBasicBackgroundAttributes): BackgroundAttributesEntity => {
72
+ const backgroundAttributesEntity: BackgroundAttributesEntity = new BackgroundAttributesEntity()
73
+ backgroundAttributesEntity.color = isEmptyString(args.color) ? undefined : args.color
74
+ backgroundAttributesEntity.image = args.image ? imageAttributesEntityFrom(args.image) : undefined
75
+
76
+ return backgroundAttributesEntity
77
+ }
78
+
79
+ export const credentialBrandingEntityFrom = (args: IBasicCredentialBranding): CredentialBrandingEntity => {
80
+ const credentialBrandingEntity: CredentialBrandingEntity = new CredentialBrandingEntity()
81
+ credentialBrandingEntity.issuerCorrelationId = args.issuerCorrelationId
82
+ credentialBrandingEntity.vcHash = args.vcHash
83
+ credentialBrandingEntity.localeBranding = args.localeBranding.map((localeBranding: IBasicCredentialLocaleBranding) =>
84
+ credentialLocaleBrandingEntityFrom(localeBranding),
85
+ )
86
+
87
+ return credentialBrandingEntity
88
+ }
89
+
90
+ export const credentialLocaleBrandingEntityFrom = (args: IBasicCredentialLocaleBranding): CredentialLocaleBrandingEntity => {
91
+ const credentialLocaleBrandingEntity: CredentialLocaleBrandingEntity = new CredentialLocaleBrandingEntity()
92
+ credentialLocaleBrandingEntity.alias = isEmptyString(args.alias) ? undefined : args.alias
93
+ credentialLocaleBrandingEntity.locale = args.locale ? args.locale : ''
94
+ credentialLocaleBrandingEntity.logo = args.logo ? imageAttributesEntityFrom(args.logo) : undefined
95
+ credentialLocaleBrandingEntity.description = isEmptyString(args.description) ? undefined : args.description
96
+ credentialLocaleBrandingEntity.background = args.background ? backgroundAttributesEntityFrom(args.background) : undefined
97
+ credentialLocaleBrandingEntity.text = args.text ? textAttributesEntityFrom(args.text) : undefined
98
+ credentialLocaleBrandingEntity.claims = args.claims ? args.claims.map((claim) => credentialClaimsEntityFrom(claim)) : []
99
+
100
+ return credentialLocaleBrandingEntity
101
+ }
102
+
103
+ export const imageAttributesEntityFrom = (args: IBasicImageAttributes): ImageAttributesEntity => {
104
+ const imageAttributesEntity: ImageAttributesEntity = new ImageAttributesEntity()
105
+ imageAttributesEntity.uri = isEmptyString(args.uri) ? undefined : args.uri
106
+ imageAttributesEntity.dataUri = isEmptyString(args.dataUri) ? undefined : args.dataUri
107
+ imageAttributesEntity.mediaType = isEmptyString(args.mediaType) ? undefined : args.mediaType
108
+ imageAttributesEntity.alt = isEmptyString(args.alt) ? undefined : args.alt
109
+ imageAttributesEntity.dimensions = args.dimensions ? imageDimensionsEntityFrom(args.dimensions) : undefined
110
+
111
+ return imageAttributesEntity
112
+ }
113
+
114
+ export const imageDimensionsEntityFrom = (args: IBasicImageDimensions): ImageDimensionsEntity => {
115
+ const imageDimensionsEntity: ImageDimensionsEntity = new ImageDimensionsEntity()
116
+ imageDimensionsEntity.width = args.width
117
+ imageDimensionsEntity.height = args.height
118
+
119
+ return imageDimensionsEntity
120
+ }
121
+
122
+ export const issuerBrandingEntityFrom = (args: IBasicIssuerBranding): IssuerBrandingEntity => {
123
+ const issuerBrandingEntity: IssuerBrandingEntity = new IssuerBrandingEntity()
124
+ issuerBrandingEntity.issuerCorrelationId = args.issuerCorrelationId
125
+ issuerBrandingEntity.localeBranding = args.localeBranding.map((localeBranding: IBasicIssuerLocaleBranding) =>
126
+ issuerLocaleBrandingEntityFrom(localeBranding),
127
+ )
128
+
129
+ return issuerBrandingEntity
130
+ }
131
+
132
+ export const textAttributesEntityFrom = (args: IBasicTextAttributes): TextAttributesEntity => {
133
+ const textAttributesEntity: TextAttributesEntity = new TextAttributesEntity()
134
+ textAttributesEntity.color = isEmptyString(args.color) ? undefined : args.color
135
+
136
+ return textAttributesEntity
137
+ }
138
+
139
+ export const credentialClaimsEntityFrom = (args: IBasicCredentialClaim): CredentialClaimsEntity => {
140
+ const credentialClaimsEntity: CredentialClaimsEntity = new CredentialClaimsEntity()
141
+ credentialClaimsEntity.key = args.key
142
+ credentialClaimsEntity.name = args.name
143
+
144
+ return credentialClaimsEntity
145
+ }