@sphereon/ssi-sdk.data-store 0.30.2-unstable.8 → 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.
- package/dist/contact/ContactStore.d.ts.map +1 -1
- package/dist/digitalCredential/DigitalCredentialStore.d.ts.map +1 -1
- package/dist/digitalCredential/DigitalCredentialStore.js +1 -3
- package/dist/digitalCredential/DigitalCredentialStore.js.map +1 -1
- package/dist/entities/digitalCredential/DigitalCredentialEntity.d.ts.map +1 -1
- package/dist/entities/digitalCredential/DigitalCredentialEntity.js +1 -1
- package/dist/entities/digitalCredential/DigitalCredentialEntity.js.map +1 -1
- package/dist/entities/eventLogger/AuditEventEntity.d.ts +8 -4
- package/dist/entities/eventLogger/AuditEventEntity.d.ts.map +1 -1
- package/dist/entities/eventLogger/AuditEventEntity.js +28 -25
- package/dist/entities/eventLogger/AuditEventEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.d.ts +0 -2
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.js +1 -8
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.d.ts +0 -2
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.js +1 -9
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/CredentialClaimsEntity.d.ts +10 -0
- package/dist/entities/issuanceBranding/CredentialClaimsEntity.d.ts.map +1 -0
- package/dist/entities/issuanceBranding/CredentialClaimsEntity.js +70 -0
- package/dist/entities/issuanceBranding/CredentialClaimsEntity.js.map +1 -0
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.d.ts +2 -2
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.js +12 -16
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/ImageAttributesEntity.d.ts +0 -2
- package/dist/entities/issuanceBranding/ImageAttributesEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/ImageAttributesEntity.js +1 -11
- package/dist/entities/issuanceBranding/ImageAttributesEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.d.ts +0 -2
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.js +1 -8
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.d.ts +0 -2
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.js +1 -8
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.d.ts +4 -2
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.js +21 -15
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/TextAttributesEntity.d.ts +0 -2
- package/dist/entities/issuanceBranding/TextAttributesEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/TextAttributesEntity.js +1 -7
- package/dist/entities/issuanceBranding/TextAttributesEntity.js.map +1 -1
- package/dist/eventLogger/AbstractEventLoggerStore.d.ts +4 -2
- package/dist/eventLogger/AbstractEventLoggerStore.d.ts.map +1 -1
- package/dist/eventLogger/AbstractEventLoggerStore.js.map +1 -1
- package/dist/eventLogger/EventLoggerStore.d.ts +5 -3
- package/dist/eventLogger/EventLoggerStore.d.ts.map +1 -1
- package/dist/eventLogger/EventLoggerStore.js +32 -3
- package/dist/eventLogger/EventLoggerStore.js.map +1 -1
- package/dist/index.d.ts +20 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -26
- 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/internal-migrations-ormconfig.d.ts.map +1 -1
- package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.d.ts.map +1 -1
- package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.js +5 -1
- package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.js.map +1 -1
- package/dist/migrations/postgres/1701634812183-CreateAuditEvents.d.ts.map +1 -1
- package/dist/migrations/postgres/1701634812183-CreateAuditEvents.js +34 -6
- package/dist/migrations/postgres/1701634812183-CreateAuditEvents.js.map +1 -1
- package/dist/migrations/postgres/1708525189001-CreateDigitalCredential.js +1 -1
- package/dist/migrations/postgres/1708525189001-CreateDigitalCredential.js.map +1 -1
- package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.d.ts.map +1 -1
- package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.js +7 -3
- package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.js.map +1 -1
- package/dist/migrations/sqlite/1701634819487-CreateAuditEvents.d.ts.map +1 -1
- package/dist/migrations/sqlite/1701634819487-CreateAuditEvents.js +27 -1
- package/dist/migrations/sqlite/1701634819487-CreateAuditEvents.js.map +1 -1
- package/dist/migrations/sqlite/1708525189002-CreateDigitalCredential.js +1 -1
- package/dist/presentationDefinition/PDStore.d.ts.map +1 -1
- package/dist/statusList/StatusListStore.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/digitalCredential/digitalCredential.d.ts +2 -1
- package/dist/types/digitalCredential/digitalCredential.d.ts.map +1 -1
- package/dist/types/digitalCredential/digitalCredential.js +1 -0
- package/dist/types/digitalCredential/digitalCredential.js.map +1 -1
- package/dist/types/eventLogger/IAbstractEventLoggerStore.d.ts +9 -2
- package/dist/types/eventLogger/IAbstractEventLoggerStore.d.ts.map +1 -1
- package/dist/types/eventLogger/eventLogger.d.ts +3 -2
- package/dist/types/eventLogger/eventLogger.d.ts.map +1 -1
- package/dist/types/issuanceBranding/issuanceBranding.d.ts +21 -4
- package/dist/types/issuanceBranding/issuanceBranding.d.ts.map +1 -1
- package/dist/utils/SortingUtils.d.ts.map +1 -1
- package/dist/utils/contact/MappingUtils.d.ts.map +1 -1
- package/dist/utils/contact/MappingUtils.js +2 -2
- package/dist/utils/contact/MappingUtils.js.map +1 -1
- package/dist/utils/digitalCredential/MappingUtils.d.ts.map +1 -1
- package/dist/utils/digitalCredential/MappingUtils.js +4 -4
- package/dist/utils/digitalCredential/MappingUtils.js.map +1 -1
- package/dist/utils/eventLogger/MappingUtils.d.ts +5 -1
- package/dist/utils/eventLogger/MappingUtils.d.ts.map +1 -1
- package/dist/utils/eventLogger/MappingUtils.js +62 -2
- package/dist/utils/eventLogger/MappingUtils.js.map +1 -1
- package/dist/utils/issuanceBranding/MappingUtils.d.ts +17 -1
- package/dist/utils/issuanceBranding/MappingUtils.d.ts.map +1 -1
- package/dist/utils/issuanceBranding/MappingUtils.js +90 -1
- package/dist/utils/issuanceBranding/MappingUtils.js.map +1 -1
- package/dist/utils/presentationDefinition/MappingUtils.js +2 -2
- package/dist/utils/presentationDefinition/MappingUtils.js.map +1 -1
- package/package.json +10 -9
- package/src/__tests__/contact.store.test.ts +46 -4
- package/src/__tests__/digitalCredential.entities.test.ts +1 -7
- package/src/__tests__/digitalCredential.store.test.ts +85 -4
- package/src/__tests__/eventLogger.entities.test.ts +60 -5
- package/src/__tests__/eventLogger.store.test.ts +461 -3
- package/src/__tests__/issuanceBranding.entities.test.ts +129 -0
- package/src/digitalCredential/DigitalCredentialStore.ts +1 -3
- package/src/entities/digitalCredential/DigitalCredentialEntity.ts +1 -1
- package/src/entities/eventLogger/AuditEventEntity.ts +23 -28
- package/src/entities/issuanceBranding/BackgroundAttributesEntity.ts +2 -11
- package/src/entities/issuanceBranding/CredentialBrandingEntity.ts +1 -13
- package/src/entities/issuanceBranding/CredentialClaimsEntity.ts +35 -0
- package/src/entities/issuanceBranding/CredentialLocaleBrandingEntity.ts +11 -18
- package/src/entities/issuanceBranding/ImageAttributesEntity.ts +2 -14
- package/src/entities/issuanceBranding/ImageDimensionsEntity.ts +0 -9
- package/src/entities/issuanceBranding/IssuerBrandingEntity.ts +1 -12
- package/src/entities/issuanceBranding/IssuerLocaleBrandingEntity.ts +17 -17
- package/src/entities/issuanceBranding/TextAttributesEntity.ts +1 -9
- package/src/eventLogger/AbstractEventLoggerStore.ts +4 -2
- package/src/eventLogger/EventLoggerStore.ts +46 -11
- package/src/index.ts +20 -30
- package/src/issuanceBranding/IssuanceBrandingStore.ts +15 -9
- package/src/migrations/postgres/1685628974232-CreateIssuanceBranding.ts +11 -1
- package/src/migrations/postgres/1701634812183-CreateAuditEvents.ts +34 -6
- package/src/migrations/postgres/1708525189001-CreateDigitalCredential.ts +1 -1
- package/src/migrations/sqlite/1685628973231-CreateIssuanceBranding.ts +11 -3
- package/src/migrations/sqlite/1701634819487-CreateAuditEvents.ts +27 -1
- package/src/migrations/sqlite/1708525189002-CreateDigitalCredential.ts +1 -1
- package/src/statusList/StatusListStore.ts +1 -1
- package/src/types/contact/contact.ts +3 -3
- package/src/types/digitalCredential/digitalCredential.ts +1 -0
- package/src/types/eventLogger/IAbstractEventLoggerStore.ts +12 -2
- package/src/types/eventLogger/eventLogger.ts +3 -2
- package/src/types/issuanceBranding/issuanceBranding.ts +24 -6
- package/src/utils/contact/MappingUtils.ts +5 -2
- package/src/utils/eventLogger/MappingUtils.ts +91 -2
- package/src/utils/issuanceBranding/MappingUtils.ts +115 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { ActivityLoggingEvent, AuditLoggingEvent } from '@sphereon/ssi-sdk.core'
|
|
2
|
+
import { LoggingEventType, OrPromise } from '@sphereon/ssi-types'
|
|
1
3
|
import Debug, { Debugger } from 'debug'
|
|
2
4
|
import { DataSource } from 'typeorm'
|
|
3
|
-
import { AuditLoggingEvent } from '@sphereon/ssi-sdk.core'
|
|
4
|
-
import { OrPromise } from '@sphereon/ssi-types'
|
|
5
5
|
import { AbstractEventLoggerStore } from './AbstractEventLoggerStore'
|
|
6
|
-
import { AuditEventEntity
|
|
7
|
-
import { auditEventFrom } from '../utils/eventLogger/MappingUtils'
|
|
8
|
-
import { GetAuditEventsArgs, StoreAuditEventArgs } from '../types'
|
|
6
|
+
import { AuditEventEntity } from '../entities/eventLogger/AuditEventEntity'
|
|
7
|
+
import { activityEventEntityFrom, activityEventFrom, auditEventEntityFrom, auditEventFrom } from '../utils/eventLogger/MappingUtils'
|
|
8
|
+
import { GetActivityEventsArgs, GetAuditEventsArgs, StoreActivityEventArgs, StoreAuditEventArgs } from '../types'
|
|
9
9
|
|
|
10
10
|
const debug: Debugger = Debug('sphereon:ssi-sdk:event-store')
|
|
11
11
|
|
|
@@ -18,10 +18,17 @@ export class EventLoggerStore extends AbstractEventLoggerStore {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
getAuditEvents = async (args?: GetAuditEventsArgs): Promise<Array<AuditLoggingEvent>> => {
|
|
21
|
-
const
|
|
21
|
+
const { filter = [] } = args ?? {}
|
|
22
|
+
|
|
23
|
+
const auditEventsFilter = filter.map((item) => ({ ...item, type: LoggingEventType.AUDIT }))
|
|
24
|
+
if (auditEventsFilter.length === 0) {
|
|
25
|
+
auditEventsFilter.push({ type: LoggingEventType.AUDIT })
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const connection = await this.dbConnection
|
|
22
29
|
debug('Getting audit events', args)
|
|
23
|
-
const result
|
|
24
|
-
|
|
30
|
+
const result = await connection.getRepository(AuditEventEntity).find({
|
|
31
|
+
where: auditEventsFilter,
|
|
25
32
|
})
|
|
26
33
|
|
|
27
34
|
return result.map((event: AuditEventEntity) => auditEventFrom(event))
|
|
@@ -30,11 +37,39 @@ export class EventLoggerStore extends AbstractEventLoggerStore {
|
|
|
30
37
|
storeAuditEvent = async (args: StoreAuditEventArgs): Promise<AuditLoggingEvent> => {
|
|
31
38
|
const { event } = args
|
|
32
39
|
|
|
33
|
-
const auditEventEntity
|
|
34
|
-
const connection
|
|
40
|
+
const auditEventEntity = auditEventEntityFrom(event)
|
|
41
|
+
const connection = await this.dbConnection
|
|
35
42
|
debug('Storing audit event', auditEventEntity)
|
|
36
|
-
const createdResult
|
|
43
|
+
const createdResult = await connection.getRepository(AuditEventEntity).save(auditEventEntity)
|
|
37
44
|
|
|
38
45
|
return auditEventFrom(createdResult)
|
|
39
46
|
}
|
|
47
|
+
|
|
48
|
+
getActivityEvents = async (args?: GetActivityEventsArgs): Promise<Array<ActivityLoggingEvent>> => {
|
|
49
|
+
const { filter = [] } = args ?? {}
|
|
50
|
+
|
|
51
|
+
const activityEventsFilter = filter.map((item) => ({ ...item, type: LoggingEventType.ACTIVITY }))
|
|
52
|
+
if (activityEventsFilter.length === 0) {
|
|
53
|
+
activityEventsFilter.push({ type: LoggingEventType.ACTIVITY })
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const connection = await this.dbConnection
|
|
57
|
+
debug('Getting activity events', args)
|
|
58
|
+
const result = await connection.getRepository(AuditEventEntity).find({
|
|
59
|
+
where: activityEventsFilter,
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
return result.map((event: AuditEventEntity) => activityEventFrom(event))
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
storeActivityEvent = async (args: StoreActivityEventArgs): Promise<ActivityLoggingEvent> => {
|
|
66
|
+
const { event } = args
|
|
67
|
+
|
|
68
|
+
const activityEventEntity = activityEventEntityFrom(event)
|
|
69
|
+
const connection = await this.dbConnection
|
|
70
|
+
debug('Storing activity event', activityEventEntity)
|
|
71
|
+
const createdResult = await connection.getRepository(AuditEventEntity).save(activityEventEntity)
|
|
72
|
+
|
|
73
|
+
return activityEventFrom(createdResult)
|
|
74
|
+
}
|
|
40
75
|
}
|
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'
|
|
@@ -26,6 +26,12 @@ import { OrganizationEntity } from './entities/contact/OrganizationEntity'
|
|
|
26
26
|
import { NaturalPersonEntity } from './entities/contact/NaturalPersonEntity'
|
|
27
27
|
import { ElectronicAddressEntity } from './entities/contact/ElectronicAddressEntity'
|
|
28
28
|
import { PhysicalAddressEntity } from './entities/contact/PhysicalAddressEntity'
|
|
29
|
+
import { AuditEventEntity } from './entities/eventLogger/AuditEventEntity'
|
|
30
|
+
import { DigitalCredentialEntity } from './entities/digitalCredential/DigitalCredentialEntity'
|
|
31
|
+
import { PresentationDefinitionItemEntity } from './entities/presentationDefinition/PresentationDefinitionItemEntity'
|
|
32
|
+
import { ContactMetadataItemEntity } from './entities/contact/ContactMetadataItemEntity'
|
|
33
|
+
import { CredentialClaimsEntity } from './entities/issuanceBranding/CredentialClaimsEntity'
|
|
34
|
+
|
|
29
35
|
export { ContactStore } from './contact/ContactStore'
|
|
30
36
|
export { AbstractContactStore } from './contact/AbstractContactStore'
|
|
31
37
|
export { AbstractDigitalCredentialStore } from './digitalCredential/AbstractDigitalCredentialStore'
|
|
@@ -33,19 +39,12 @@ export { DigitalCredentialStore } from './digitalCredential/DigitalCredentialSto
|
|
|
33
39
|
export { AbstractIssuanceBrandingStore } from './issuanceBranding/AbstractIssuanceBrandingStore'
|
|
34
40
|
export { IssuanceBrandingStore } from './issuanceBranding/IssuanceBrandingStore'
|
|
35
41
|
export { StatusListStore } from './statusList/StatusListStore'
|
|
36
|
-
import { AuditEventEntity, auditEventEntityFrom } from './entities/eventLogger/AuditEventEntity'
|
|
37
|
-
import { DigitalCredentialEntity } from './entities/digitalCredential/DigitalCredentialEntity'
|
|
38
|
-
import { digitalCredentialFrom, digitalCredentialsFrom, nonPersistedDigitalCredentialEntityFromAddArgs } from './utils/digitalCredential/MappingUtils'
|
|
39
|
-
import { isPresentationDefinitionEqual } from './utils/presentationDefinition/MappingUtils'
|
|
40
|
-
import { PresentationDefinitionItemEntity } from './entities/presentationDefinition/PresentationDefinitionItemEntity'
|
|
41
|
-
import { ContactMetadataItemEntity } from './entities/contact/ContactMetadataItemEntity'
|
|
42
42
|
export { AbstractEventLoggerStore } from './eventLogger/AbstractEventLoggerStore'
|
|
43
43
|
export { EventLoggerStore } from './eventLogger/EventLoggerStore'
|
|
44
44
|
export { IAbstractMachineStateStore } from './machineState/IAbstractMachineStateStore'
|
|
45
45
|
export { MachineStateStore } from './machineState/MachineStateStore'
|
|
46
46
|
export { AbstractPDStore } from './presentationDefinition/AbstractPDStore'
|
|
47
47
|
export { PDStore } from './presentationDefinition/PDStore'
|
|
48
|
-
|
|
49
48
|
export {
|
|
50
49
|
DataStoreMigrations,
|
|
51
50
|
DataStoreEventLoggerMigrations,
|
|
@@ -59,6 +58,10 @@ export {
|
|
|
59
58
|
export * from './types'
|
|
60
59
|
export * from './utils/contact/MappingUtils'
|
|
61
60
|
export * from './utils/digitalCredential/MappingUtils'
|
|
61
|
+
export * from './utils/eventLogger/MappingUtils'
|
|
62
|
+
export * from './utils/issuanceBranding/MappingUtils'
|
|
63
|
+
export * from './utils/presentationDefinition/MappingUtils'
|
|
64
|
+
export * from './utils/hasher'
|
|
62
65
|
|
|
63
66
|
export const DataStoreContactEntities = [
|
|
64
67
|
BaseConfigEntity,
|
|
@@ -89,6 +92,7 @@ export const DataStoreIssuanceBrandingEntities = [
|
|
|
89
92
|
TextAttributesEntity,
|
|
90
93
|
CredentialLocaleBrandingEntity,
|
|
91
94
|
IssuerLocaleBrandingEntity,
|
|
95
|
+
CredentialClaimsEntity,
|
|
92
96
|
]
|
|
93
97
|
|
|
94
98
|
export const DataStorePresentationDefinitionEntities = [PresentationDefinitionItemEntity]
|
|
@@ -133,28 +137,14 @@ export {
|
|
|
133
137
|
IssuerLocaleBrandingEntity,
|
|
134
138
|
ElectronicAddressEntity,
|
|
135
139
|
PhysicalAddressEntity,
|
|
136
|
-
backgroundAttributesEntityFrom,
|
|
137
|
-
credentialBrandingEntityFrom,
|
|
138
|
-
imageAttributesEntityFrom,
|
|
139
|
-
imageDimensionsEntityFrom,
|
|
140
|
-
issuerBrandingEntityFrom,
|
|
141
|
-
textAttributesEntityFrom,
|
|
142
|
-
issuerLocaleBrandingEntityFrom,
|
|
143
|
-
credentialLocaleBrandingEntityFrom,
|
|
144
140
|
IStatusListEntity,
|
|
145
141
|
IStatusListEntryEntity,
|
|
146
142
|
StatusListEntity,
|
|
147
143
|
StatusListEntryEntity,
|
|
148
144
|
AuditEventEntity,
|
|
149
|
-
auditEventEntityFrom,
|
|
150
145
|
DigitalCredentialEntity,
|
|
151
|
-
digitalCredentialFrom,
|
|
152
|
-
digitalCredentialsFrom,
|
|
153
|
-
nonPersistedDigitalCredentialEntityFromAddArgs,
|
|
154
146
|
MachineStateInfoEntity,
|
|
155
147
|
PresentationDefinitionItemEntity,
|
|
156
|
-
isPresentationDefinitionEqual,
|
|
157
148
|
ContactMetadataItemEntity,
|
|
149
|
+
CredentialClaimsEntity,
|
|
158
150
|
}
|
|
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,
|
|
@@ -42,7 +50,6 @@ import {
|
|
|
42
50
|
ICredentialBrandingFilter,
|
|
43
51
|
} from '../types'
|
|
44
52
|
|
|
45
|
-
|
|
46
53
|
const debug: Debug.Debugger = Debug('sphereon:ssi-sdk:issuance-branding-store')
|
|
47
54
|
|
|
48
55
|
export class IssuanceBrandingStore extends AbstractIssuanceBrandingStore {
|
|
@@ -211,8 +218,7 @@ export class IssuanceBrandingStore extends AbstractIssuanceBrandingStore {
|
|
|
211
218
|
|
|
212
219
|
return credentialBrandingLocale
|
|
213
220
|
? credentialBrandingLocale.map(
|
|
214
|
-
(credentialLocaleBranding: CredentialLocaleBrandingEntity) =>
|
|
215
|
-
localeBrandingFrom(credentialLocaleBranding) as ICredentialLocaleBranding,
|
|
221
|
+
(credentialLocaleBranding: CredentialLocaleBrandingEntity) => localeBrandingFrom(credentialLocaleBranding) as ICredentialLocaleBranding,
|
|
216
222
|
)
|
|
217
223
|
: []
|
|
218
224
|
}
|
|
@@ -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")`,
|
|
@@ -28,6 +28,14 @@ export class CreateIssuanceBranding1685628974232 implements MigrationInterface {
|
|
|
28
28
|
`CREATE UNIQUE INDEX "IDX_IssuerLocaleBrandingEntity_issuerBranding_locale" ON "BaseLocaleBranding" ("issuerBrandingId", "locale")`,
|
|
29
29
|
)
|
|
30
30
|
await queryRunner.query(`CREATE INDEX "IDX_BaseLocaleBranding_type" ON "BaseLocaleBranding" ("type")`)
|
|
31
|
+
|
|
32
|
+
await queryRunner.query(
|
|
33
|
+
`CREATE TABLE "CredentialClaims" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "key" character varying(255) NOT NULL, "name" character varying(255) NOT NULL, "credentialLocaleBrandingId" character varying, CONSTRAINT "PK_CredentialClaims_id" PRIMARY KEY ("id"))`,
|
|
34
|
+
)
|
|
35
|
+
await queryRunner.query(
|
|
36
|
+
`CREATE UNIQUE INDEX "IDX_CredentialClaimsEntity_credentialLocaleBranding_locale" ON "CredentialClaims" ("credentialLocaleBrandingId", "key")`,
|
|
37
|
+
)
|
|
38
|
+
|
|
31
39
|
await queryRunner.query(
|
|
32
40
|
`CREATE TABLE "CredentialBranding" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "vcHash" character varying(255) NOT NULL, "issuerCorrelationId" character varying(255) NOT NULL, "created_at" TIMESTAMP NOT NULL DEFAULT now(), "last_updated_at" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "UQ_vcHash" UNIQUE ("vcHash"), CONSTRAINT "PK_CredentialBranding_id" PRIMARY KEY ("id"))`,
|
|
33
41
|
)
|
|
@@ -76,6 +84,8 @@ export class CreateIssuanceBranding1685628974232 implements MigrationInterface {
|
|
|
76
84
|
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP INDEX "IDX_BaseLocaleBranding_type"`)
|
|
77
85
|
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP INDEX "IDX_IssuerLocaleBrandingEntity_issuerBranding_locale"`)
|
|
78
86
|
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" DROP INDEX "IDX_CredentialLocaleBrandingEntity_credentialBranding_locale"`)
|
|
87
|
+
await queryRunner.query(`ALTER TABLE "CredentialClaims" DROP INDEX "IDX_CredentialClaimsEntity_credentialLocaleBranding_locale"`)
|
|
88
|
+
await queryRunner.query(`DROP TABLE "CredentialClaims"`)
|
|
79
89
|
await queryRunner.query(`DROP TABLE "BaseLocaleBranding"`)
|
|
80
90
|
await queryRunner.query(`DROP TABLE "TextAttributes"`)
|
|
81
91
|
await queryRunner.query(`DROP TABLE "BackgroundAttributes"`)
|
|
@@ -4,19 +4,47 @@ export class CreateAuditEvents1701634812183 implements MigrationInterface {
|
|
|
4
4
|
name = 'CreateAuditEvents1701634812183'
|
|
5
5
|
|
|
6
6
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
-
await queryRunner.query(`CREATE TYPE "public"."Level_enum" AS ENUM('0', '1', '2', '3')`)
|
|
7
|
+
await queryRunner.query(`CREATE TYPE "public"."Level_enum" AS ENUM('0', '1', '2', '3', '4')`)
|
|
8
8
|
await queryRunner.query(
|
|
9
|
-
`CREATE TYPE "public"."System_enum" AS ENUM('general', 'kms', 'identity', 'oid4vci', 'credentials', 'web3', 'profile', 'contact')`,
|
|
9
|
+
`CREATE TYPE "public"."System_enum" AS ENUM('general', 'kms', 'identity', 'oid4vci', 'oid4vp', 'siopv2', 'PE', 'credentials', 'web3', 'profile', 'contact')`,
|
|
10
10
|
)
|
|
11
11
|
await queryRunner.query(
|
|
12
|
-
`CREATE TYPE "public"."Subsystem_type_enum" AS ENUM('key', 'did_provider', 'did_resolver', 'oid4vp_op', 'oid4vci_client', 'siopv2_op', 'contact_manager', 'vc_issuer', 'vc_verifier', 'vc_persistence', 'transport', 'profile')`,
|
|
12
|
+
`CREATE TYPE "public"."Subsystem_type_enum" AS ENUM('key', 'did_provider', 'did_resolver', 'oid4vp_op', 'oid4vci_client', 'siopv2_op', 'contact_manager', 'vc_issuer', 'vc_verifier', 'vc_persistence', 'transport', 'profile', 'api')`,
|
|
13
13
|
)
|
|
14
14
|
await queryRunner.query(`CREATE TYPE "public"."Action_type_enum" AS ENUM('create', 'read', 'update', 'delete', 'execute')`)
|
|
15
15
|
await queryRunner.query(`CREATE TYPE "public"."Initiator_type_enum" AS ENUM('user', 'system', 'external')`)
|
|
16
|
-
await queryRunner.query(`CREATE TYPE "public"."System_correlation_id_type_enum" AS ENUM('did', 'email', 'hostname', 'phone', 'user')`)
|
|
17
|
-
await queryRunner.query(`CREATE TYPE "public"."Party_correlation_type_enum" AS ENUM('did', 'email', 'hostname', 'phone')`)
|
|
16
|
+
await queryRunner.query(`CREATE TYPE "public"."System_correlation_id_type_enum" AS ENUM('did', 'url', 'email', 'hostname', 'phone', 'user')`)
|
|
17
|
+
await queryRunner.query(`CREATE TYPE "public"."Party_correlation_type_enum" AS ENUM('did', 'url', 'email', 'hostname', 'phone')`)
|
|
18
|
+
await queryRunner.query(`CREATE TYPE "public"."Event_type_enum" AS ENUM('audit', 'activity', 'general')`)
|
|
19
|
+
await queryRunner.query(`CREATE TYPE "public"."Event_credential_type_enum" AS ENUM('JSON_LD', 'JWT', 'SD_JWT', 'MSO_MDOC')`)
|
|
18
20
|
await queryRunner.query(
|
|
19
|
-
`CREATE TABLE "AuditEvents" (
|
|
21
|
+
`CREATE TABLE "AuditEvents" (
|
|
22
|
+
"id" uuid NOT NULL DEFAULT uuid_generate_v4(),
|
|
23
|
+
"eventType" "public"."Event_type_enum" NOT NULL,
|
|
24
|
+
"timestamp" TIMESTAMP NOT NULL,
|
|
25
|
+
"level" "public"."Level_enum" NOT NULL,
|
|
26
|
+
"correlationId" TEXT NOT NULL,
|
|
27
|
+
"system" "public"."System_enum" NOT NULL,
|
|
28
|
+
"subSystemType" "public"."Subsystem_type_enum" NOT NULL,
|
|
29
|
+
"actionType" "public"."Action_type_enum" NOT NULL,
|
|
30
|
+
"actionSubType" TEXT NOT NULL,
|
|
31
|
+
"initiatorType" "public"."Initiator_type_enum" NOT NULL,
|
|
32
|
+
"systemCorrelationIdType" "public"."System_correlation_id_type_enum",
|
|
33
|
+
"systemCorrelationId" TEXT,
|
|
34
|
+
"systemAlias" TEXT,
|
|
35
|
+
"partyCorrelationType" "public"."Party_correlation_type_enum",
|
|
36
|
+
"partyCorrelationId" TEXT,
|
|
37
|
+
"partyAlias" TEXT,
|
|
38
|
+
"credentialType" "public"."Event_credential_type_enum",
|
|
39
|
+
"credentialHash" TEXT,
|
|
40
|
+
"originalCredential" TEXT,
|
|
41
|
+
"sharePurpose" TEXT,
|
|
42
|
+
"description" TEXT NOT NULL,
|
|
43
|
+
"data" TEXT,
|
|
44
|
+
"diagnosticData" TEXT,
|
|
45
|
+
"created_at" TIMESTAMP NOT NULL DEFAULT now(),
|
|
46
|
+
"last_updated_at" TIMESTAMP NOT NULL DEFAULT now(),
|
|
47
|
+
CONSTRAINT "PK_AuditEvents_id" PRIMARY KEY ("id"))`,
|
|
20
48
|
)
|
|
21
49
|
}
|
|
22
50
|
|
|
@@ -7,7 +7,7 @@ export class CreateDigitalCredential1708525189001 implements MigrationInterface
|
|
|
7
7
|
await queryRunner.query(`CREATE TYPE "digital_document_type" AS ENUM('VC', 'VP', 'C', 'P')`)
|
|
8
8
|
await queryRunner.query(`CREATE TYPE "digital_regulation_type" AS ENUM('PID', 'QEAA', 'EAA', 'NON_REGULATED')`)
|
|
9
9
|
await queryRunner.query(`CREATE TYPE "digital_credential_document_format" AS ENUM('JSON_LD', 'JWT', 'SD_JWT', 'MSO_MDOC')`)
|
|
10
|
-
await queryRunner.query(`CREATE TYPE "digital_credential_credential_role" AS ENUM('ISSUER', 'VERIFIER', 'HOLDER')`)
|
|
10
|
+
await queryRunner.query(`CREATE TYPE "digital_credential_credential_role" AS ENUM('ISSUER', 'VERIFIER', 'HOLDER', 'FEDERATION_TRUST_ANCHOR')`)
|
|
11
11
|
await queryRunner.query(`CREATE TYPE "digital_credential_correlation_type" AS ENUM('DID', 'KID', 'URL', 'X509_SAN')`)
|
|
12
12
|
await queryRunner.query(`CREATE TYPE "digital_credential_state_type" AS ENUM('REVOKED', 'VERIFIED', 'EXPIRED')`)
|
|
13
13
|
|
|
@@ -13,7 +13,7 @@ export class CreateIssuanceBranding1685628973231 implements MigrationInterface {
|
|
|
13
13
|
)
|
|
14
14
|
await queryRunner.query(`CREATE TABLE "TextAttributes" ("id" varchar PRIMARY KEY NOT NULL, "color" varchar(255))`)
|
|
15
15
|
await queryRunner.query(
|
|
16
|
-
`CREATE TABLE "BaseLocaleBranding" ("id" varchar PRIMARY KEY NOT NULL, "alias" varchar(255), "locale" varchar(255) NOT NULL, "description" varchar(255), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "credentialBrandingId" varchar, "issuerBrandingId" varchar, "type" varchar NOT NULL, "logoId" varchar, "backgroundId" varchar, "textId" varchar, CONSTRAINT "UQ_logoId" UNIQUE ("logoId"), CONSTRAINT "UQ_backgroundId" UNIQUE ("backgroundId"), CONSTRAINT "UQ_textId" UNIQUE ("textId"))`,
|
|
16
|
+
`CREATE TABLE "BaseLocaleBranding" ("id" varchar PRIMARY KEY NOT NULL, "alias" varchar(255), "locale" varchar(255) NOT NULL, "description" varchar(255), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "credentialBrandingId" varchar, "issuerBrandingId" varchar, "type" varchar NOT NULL, "logoId" varchar, "backgroundId" varchar, "textId" varchar, "client_uri" varchar, "tos_uri" varchar, "policy_uri" varchar, "contacts" varchar, CONSTRAINT "UQ_logoId" UNIQUE ("logoId"), CONSTRAINT "UQ_backgroundId" UNIQUE ("backgroundId"), CONSTRAINT "UQ_textId" UNIQUE ("textId"))`,
|
|
17
17
|
)
|
|
18
18
|
await queryRunner.query(
|
|
19
19
|
`CREATE UNIQUE INDEX "IDX_CredentialLocaleBrandingEntity_credentialBranding_locale" ON "BaseLocaleBranding" ("credentialBrandingId", "locale")`,
|
|
@@ -22,6 +22,12 @@ export class CreateIssuanceBranding1685628973231 implements MigrationInterface {
|
|
|
22
22
|
`CREATE UNIQUE INDEX "IDX_IssuerLocaleBrandingEntity_issuerBranding_locale" ON "BaseLocaleBranding" ("issuerBrandingId", "locale")`,
|
|
23
23
|
)
|
|
24
24
|
await queryRunner.query(`CREATE INDEX "IDX_BaseLocaleBranding_type" ON "BaseLocaleBranding" ("type")`)
|
|
25
|
+
await queryRunner.query(
|
|
26
|
+
`CREATE TABLE "CredentialClaims" ("id" varchar PRIMARY KEY NOT NULL, "key" varchar(255) NOT NULL, "name" varchar(255) NOT NULL, "credentialLocaleBrandingId" varchar)`,
|
|
27
|
+
)
|
|
28
|
+
await queryRunner.query(
|
|
29
|
+
`CREATE UNIQUE INDEX "IDX_CredentialClaimsEntity_credentialLocaleBranding_locale" ON "CredentialClaims" ("credentialLocaleBrandingId", "key")`,
|
|
30
|
+
)
|
|
25
31
|
await queryRunner.query(
|
|
26
32
|
`CREATE TABLE "CredentialBranding" ("id" varchar PRIMARY KEY NOT NULL, "vcHash" varchar(255) NOT NULL, "issuerCorrelationId" varchar(255) NOT NULL, "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), CONSTRAINT "UQ_vcHash" UNIQUE ("vcHash"))`,
|
|
27
33
|
)
|
|
@@ -51,7 +57,7 @@ export class CreateIssuanceBranding1685628973231 implements MigrationInterface {
|
|
|
51
57
|
await queryRunner.query(`DROP INDEX "IDX_IssuerLocaleBrandingEntity_issuerBranding_locale"`)
|
|
52
58
|
await queryRunner.query(`DROP INDEX "IDX_BaseLocaleBranding_type"`)
|
|
53
59
|
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)`,
|
|
60
|
+
`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
61
|
)
|
|
56
62
|
await queryRunner.query(
|
|
57
63
|
`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 +79,7 @@ export class CreateIssuanceBranding1685628973231 implements MigrationInterface {
|
|
|
73
79
|
await queryRunner.query(`DROP INDEX "IDX_CredentialLocaleBrandingEntity_credentialBranding_locale"`)
|
|
74
80
|
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" RENAME TO "temporary_BaseLocaleBranding"`)
|
|
75
81
|
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"))`,
|
|
82
|
+
`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
83
|
)
|
|
78
84
|
await queryRunner.query(
|
|
79
85
|
`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"`,
|
|
@@ -108,6 +114,8 @@ export class CreateIssuanceBranding1685628973231 implements MigrationInterface {
|
|
|
108
114
|
await queryRunner.query(`DROP INDEX "IDX_CredentialBrandingEntity_issuerCorrelationId"`)
|
|
109
115
|
await queryRunner.query(`DROP TABLE "CredentialBranding"`)
|
|
110
116
|
await queryRunner.query(`DROP INDEX "IDX_BaseLocaleBranding_type"`)
|
|
117
|
+
await queryRunner.query(`DROP INDEX "IDX_CredentialClaimsEntity_credentialLocaleBranding_locale"`)
|
|
118
|
+
await queryRunner.query(`DROP TABLE "CredentialClaims"`)
|
|
111
119
|
await queryRunner.query(`DROP INDEX "IDX_IssuerLocaleBrandingEntity_issuerBranding_locale"`)
|
|
112
120
|
await queryRunner.query(`DROP INDEX "IDX_CredentialLocaleBrandingEntity_credentialBranding_locale"`)
|
|
113
121
|
await queryRunner.query(`DROP TABLE "BaseLocaleBranding"`)
|
|
@@ -5,7 +5,33 @@ export class CreateAuditEvents1701634819487 implements MigrationInterface {
|
|
|
5
5
|
|
|
6
6
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
7
|
await queryRunner.query(
|
|
8
|
-
`CREATE TABLE "AuditEvents" (
|
|
8
|
+
`CREATE TABLE "AuditEvents" (
|
|
9
|
+
"id" varchar PRIMARY KEY NOT NULL,
|
|
10
|
+
"eventType" varchar CHECK( "eventType" IN ('audit','activity','general') ) NOT NULL,
|
|
11
|
+
"timestamp" datetime NOT NULL,
|
|
12
|
+
"level" varchar CHECK( "level" IN ('0','1','2','3','4') ) NOT NULL,
|
|
13
|
+
"correlationId" varchar NOT NULL,
|
|
14
|
+
"system" varchar CHECK( "system" IN ('general','kms','identity','oid4vci','oid4vp','siopv2','PE','credentials','web3','profile','contact') ) NOT NULL,
|
|
15
|
+
"subSystemType" varchar CHECK( "subSystemType" IN ('key','did_provider','did_resolver','oid4vp_op','oid4vci_client','siopv2_op','contact_manager','vc_issuer','vc_verifier','vc_persistence','transport','profile','api') ) NOT NULL,
|
|
16
|
+
"actionType" varchar CHECK( "actionType" IN ('create','read','update','delete','execute') ) NOT NULL,
|
|
17
|
+
"actionSubType" varchar NOT NULL,
|
|
18
|
+
"initiatorType" varchar CHECK( "initiatorType" IN ('user','system','external') ) NOT NULL,
|
|
19
|
+
"systemCorrelationIdType" varchar CHECK( "systemCorrelationIdType" IN ('did','url','email','hostname','phone','user') ),
|
|
20
|
+
"systemCorrelationId" varchar,
|
|
21
|
+
"systemAlias" varchar,
|
|
22
|
+
"partyCorrelationType" varchar CHECK( "partyCorrelationType" IN ('did','url','email','hostname','phone') ),
|
|
23
|
+
"partyCorrelationId" varchar,
|
|
24
|
+
"partyAlias" varchar,
|
|
25
|
+
"credentialType" varchar CHECK( "credentialType" IN ('JSON_LD','JWT','SD_JWT','MSO_MDOC') ),
|
|
26
|
+
"credentialHash" varchar,
|
|
27
|
+
"parentCredentialHash" varchar,
|
|
28
|
+
"originalCredential" varchar,
|
|
29
|
+
"sharePurpose" varchar,
|
|
30
|
+
"description" varchar NOT NULL,
|
|
31
|
+
"data" varchar,
|
|
32
|
+
"diagnosticData" varchar,
|
|
33
|
+
"created_at" datetime NOT NULL DEFAULT (datetime('now')),
|
|
34
|
+
"last_updated_at" datetime NOT NULL DEFAULT (datetime('now')))`,
|
|
9
35
|
)
|
|
10
36
|
}
|
|
11
37
|
|
|
@@ -12,7 +12,7 @@ export class CreateDigitalCredential1708525189002 implements MigrationInterface
|
|
|
12
12
|
"document_type" varchar CHECK( "document_type" IN ('VC', 'VP', 'C', 'P') ) NOT NULL,
|
|
13
13
|
"regulation_type" varchar CHECK( "regulation_type" IN ('PID', 'QEAA', 'EAA', 'NON_REGULATED') ) NOT NULL DEFAULT 'NON_REGULATED',
|
|
14
14
|
"document_format" varchar CHECK( "document_format" IN ('JSON_LD', 'JWT', 'SD_JWT', 'MSO_MDOC') ) NOT NULL,
|
|
15
|
-
"credential_role" varchar CHECK( "credential_role" IN ('ISSUER', 'VERIFIER', 'HOLDER') ) NOT NULL,
|
|
15
|
+
"credential_role" varchar CHECK( "credential_role" IN ('ISSUER', 'VERIFIER', 'HOLDER', 'FEDERATION_TRUST_ANCHOR') ) NOT NULL,
|
|
16
16
|
"raw_document" text NOT NULL,
|
|
17
17
|
"uniform_document" text NOT NULL,
|
|
18
18
|
"credential_id" text,
|
|
@@ -172,7 +172,7 @@ export class StatusListStore implements IStatusListStore {
|
|
|
172
172
|
} else if (args.correlationId) {
|
|
173
173
|
where.push({ correlationId: args.correlationId })
|
|
174
174
|
}
|
|
175
|
-
const result = await (await this.getStatusListRepo()).findOne({where})
|
|
175
|
+
const result = await (await this.getStatusListRepo()).findOne({ where })
|
|
176
176
|
if (!result) {
|
|
177
177
|
throw Error(`No status list found for id ${args.id}`)
|
|
178
178
|
}
|
|
@@ -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
|
|
@@ -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
|
|
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<
|
|
124
|
+
export interface IPartialIssuerBranding extends Partial<Omit<IIssuerBranding, 'localeBranding'>> {
|
|
107
125
|
localeBranding?: IPartialIssuerLocaleBranding
|
|
108
126
|
}
|
|
109
127
|
|