@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.
- 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 -4
- package/dist/eventLogger/EventLoggerStore.d.ts.map +1 -1
- package/dist/eventLogger/EventLoggerStore.js +35 -8
- 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 -5
- package/dist/issuanceBranding/IssuanceBrandingStore.d.ts.map +1 -1
- package/dist/issuanceBranding/IssuanceBrandingStore.js +17 -46
- 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/FormattingUtils.d.ts +2 -0
- package/dist/utils/FormattingUtils.d.ts.map +1 -0
- package/dist/utils/FormattingUtils.js +23 -0
- package/dist/utils/FormattingUtils.js.map +1 -0
- 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 +27 -14
- 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 +7 -5
- package/dist/utils/digitalCredential/MappingUtils.js.map +1 -1
- package/dist/utils/eventLogger/MappingUtils.d.ts +8 -0
- package/dist/utils/eventLogger/MappingUtils.d.ts.map +1 -0
- package/dist/utils/eventLogger/MappingUtils.js +70 -0
- package/dist/utils/eventLogger/MappingUtils.js.map +1 -0
- package/dist/utils/issuanceBranding/MappingUtils.d.ts +24 -0
- package/dist/utils/issuanceBranding/MappingUtils.d.ts.map +1 -0
- package/dist/utils/issuanceBranding/MappingUtils.js +109 -0
- package/dist/utils/issuanceBranding/MappingUtils.js.map +1 -0
- package/dist/utils/presentationDefinition/MappingUtils.d.ts.map +1 -1
- package/dist/utils/presentationDefinition/MappingUtils.js +5 -3
- 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 +45 -32
- package/src/index.ts +20 -30
- package/src/issuanceBranding/IssuanceBrandingStore.ts +26 -68
- 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/FormattingUtils.ts +21 -0
- package/src/utils/contact/MappingUtils.ts +39 -13
- package/src/utils/digitalCredential/MappingUtils.ts +4 -1
- package/src/utils/eventLogger/MappingUtils.ts +117 -0
- package/src/utils/issuanceBranding/MappingUtils.ts +145 -0
- package/src/utils/presentationDefinition/MappingUtils.ts +4 -1
|
@@ -74,6 +74,16 @@ describe('Database entities tests', (): void => {
|
|
|
74
74
|
text: {
|
|
75
75
|
color: '#000000',
|
|
76
76
|
},
|
|
77
|
+
claims: [
|
|
78
|
+
{
|
|
79
|
+
key: 'given_name',
|
|
80
|
+
name: 'Given Name',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
key: 'family_name',
|
|
84
|
+
name: 'Surname',
|
|
85
|
+
},
|
|
86
|
+
],
|
|
77
87
|
},
|
|
78
88
|
],
|
|
79
89
|
}
|
|
@@ -112,6 +122,8 @@ describe('Database entities tests', (): void => {
|
|
|
112
122
|
)
|
|
113
123
|
expect(fromDb?.localeBranding[0].text).toBeDefined()
|
|
114
124
|
expect(fromDb?.localeBranding[0].text!.color).toEqual(credentialBranding.localeBranding[0].text!.color)
|
|
125
|
+
expect(fromDb?.localeBranding[0].claims).toBeDefined()
|
|
126
|
+
expect(fromDb?.localeBranding[0].claims.length).toEqual(credentialBranding.localeBranding[0].claims!.length)
|
|
115
127
|
expect(fromDb?.createdAt).toBeDefined()
|
|
116
128
|
expect(fromDb?.lastUpdatedAt).toBeDefined()
|
|
117
129
|
})
|
|
@@ -460,6 +472,115 @@ describe('Database entities tests', (): void => {
|
|
|
460
472
|
expect(result?.lastUpdatedAt).not.toEqual(fromDb?.localeBranding[0].lastUpdatedAt)
|
|
461
473
|
})
|
|
462
474
|
|
|
475
|
+
it('Should save only claims branding to database', async (): Promise<void> => {
|
|
476
|
+
const credentialBranding: IBasicCredentialBranding = {
|
|
477
|
+
issuerCorrelationId: 'issuerCorrelationId',
|
|
478
|
+
vcHash: 'vcHash',
|
|
479
|
+
localeBranding: [
|
|
480
|
+
{
|
|
481
|
+
claims: [
|
|
482
|
+
{
|
|
483
|
+
key: 'given_name',
|
|
484
|
+
name: 'Given Name',
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
key: 'family_name',
|
|
488
|
+
name: 'Surname',
|
|
489
|
+
},
|
|
490
|
+
],
|
|
491
|
+
},
|
|
492
|
+
],
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
const credentialBrandingEntity: CredentialBrandingEntity = credentialBrandingEntityFrom(credentialBranding)
|
|
496
|
+
const fromDb: CredentialBrandingEntity = await dbConnection.getRepository(CredentialBrandingEntity).save(credentialBrandingEntity)
|
|
497
|
+
|
|
498
|
+
expect(fromDb).toBeDefined()
|
|
499
|
+
expect(fromDb?.id).toBeDefined()
|
|
500
|
+
expect(fromDb?.issuerCorrelationId).toEqual(credentialBranding.issuerCorrelationId)
|
|
501
|
+
expect(fromDb?.vcHash).toEqual(credentialBranding.vcHash)
|
|
502
|
+
expect(fromDb?.localeBranding).toBeDefined()
|
|
503
|
+
expect(fromDb?.localeBranding.length).toEqual(1)
|
|
504
|
+
expect(fromDb?.localeBranding[0].claims).toBeDefined()
|
|
505
|
+
expect(fromDb?.localeBranding[0].claims.length).toEqual(credentialBranding.localeBranding[0].claims!.length)
|
|
506
|
+
expect(fromDb?.createdAt).toBeDefined()
|
|
507
|
+
expect(fromDb?.lastUpdatedAt).toBeDefined()
|
|
508
|
+
})
|
|
509
|
+
|
|
510
|
+
it('Should enforce unique locale for a credential claim key', async (): Promise<void> => {
|
|
511
|
+
const credentialBranding: IBasicCredentialBranding = {
|
|
512
|
+
issuerCorrelationId: 'issuerCorrelationId',
|
|
513
|
+
vcHash: 'vcHash',
|
|
514
|
+
localeBranding: [
|
|
515
|
+
{
|
|
516
|
+
locale: 'en-US',
|
|
517
|
+
claims: [
|
|
518
|
+
{
|
|
519
|
+
key: 'given_name',
|
|
520
|
+
name: 'Given Name',
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
key: 'given_name',
|
|
524
|
+
name: 'Given Name',
|
|
525
|
+
},
|
|
526
|
+
],
|
|
527
|
+
},
|
|
528
|
+
],
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
const credentialBrandingEntity: CredentialBrandingEntity = credentialBrandingEntityFrom(credentialBranding)
|
|
532
|
+
|
|
533
|
+
await expect(dbConnection.getRepository(CredentialBrandingEntity).save(credentialBrandingEntity)).rejects.toThrowError(
|
|
534
|
+
'SQLITE_CONSTRAINT: UNIQUE constraint failed: CredentialClaims.credentialLocaleBrandingId, CredentialClaims.key',
|
|
535
|
+
)
|
|
536
|
+
})
|
|
537
|
+
|
|
538
|
+
it('should throw error when saving credential branding with blank claim key', async (): Promise<void> => {
|
|
539
|
+
const credentialBranding: IBasicCredentialBranding = {
|
|
540
|
+
issuerCorrelationId: 'issuerCorrelationId',
|
|
541
|
+
vcHash: 'vcHash',
|
|
542
|
+
localeBranding: [
|
|
543
|
+
{
|
|
544
|
+
claims: [
|
|
545
|
+
{
|
|
546
|
+
key: '',
|
|
547
|
+
name: 'Given Name',
|
|
548
|
+
},
|
|
549
|
+
],
|
|
550
|
+
},
|
|
551
|
+
],
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
const credentialBrandingEntity: CredentialBrandingEntity = credentialBrandingEntityFrom(credentialBranding)
|
|
555
|
+
|
|
556
|
+
await expect(dbConnection.getRepository(CredentialBrandingEntity).save(credentialBrandingEntity)).rejects.toThrowError(
|
|
557
|
+
'Blank claim keys are not allowed',
|
|
558
|
+
)
|
|
559
|
+
})
|
|
560
|
+
|
|
561
|
+
it('should throw error when saving credential branding with blank claim name', async (): Promise<void> => {
|
|
562
|
+
const credentialBranding: IBasicCredentialBranding = {
|
|
563
|
+
issuerCorrelationId: 'issuerCorrelationId',
|
|
564
|
+
vcHash: 'vcHash',
|
|
565
|
+
localeBranding: [
|
|
566
|
+
{
|
|
567
|
+
claims: [
|
|
568
|
+
{
|
|
569
|
+
key: 'given_name',
|
|
570
|
+
name: '',
|
|
571
|
+
},
|
|
572
|
+
],
|
|
573
|
+
},
|
|
574
|
+
],
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
const credentialBrandingEntity: CredentialBrandingEntity = credentialBrandingEntityFrom(credentialBranding)
|
|
578
|
+
|
|
579
|
+
await expect(dbConnection.getRepository(CredentialBrandingEntity).save(credentialBrandingEntity)).rejects.toThrowError(
|
|
580
|
+
'Blank claim names are not allowed',
|
|
581
|
+
)
|
|
582
|
+
})
|
|
583
|
+
|
|
463
584
|
// Issuer tests
|
|
464
585
|
|
|
465
586
|
it('Should save issuer branding to database', async (): Promise<void> => {
|
|
@@ -468,6 +589,10 @@ describe('Database entities tests', (): void => {
|
|
|
468
589
|
localeBranding: [
|
|
469
590
|
{
|
|
470
591
|
alias: 'issuerAlias',
|
|
592
|
+
clientUri: 'test_uri',
|
|
593
|
+
tosUri: 'test_uri',
|
|
594
|
+
policyUri: 'test_uri',
|
|
595
|
+
contacts: ['test_email_address1', 'test_email_address2'],
|
|
471
596
|
locale: 'en-US',
|
|
472
597
|
logo: {
|
|
473
598
|
uri: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/4huQSUNDX1BST0ZJTEUAAQEAABuAYXBwbAIQAABtbnRyUkdCIFhZWiAH4wADAA4ACwAKAAJhY3NwQVBQTAAAAABBUFBMAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWFwcGwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFkZXNjAAABUAAAAGJkc2NtAAABtAAABIRjcHJ0AAAGOAAAACN3dHB0AAAGXAAAABRyWFlaAAAGcAAAABRnWFlaAAAGhAAAABRiWFlaAAAGmAAAABRyVFJDAAAGrAAACAxhYXJnAAAOuAAAACB2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VAzL0mZRHH2u4bl0ekbjlVdZS9PQ6XuHGl5uXmYU3BUePDloVSk3S5unJRs6cRHH2u4bl0ekbjlXFERmR0PLzot5lwjjHSR4gWX7VvaTfGuIjj7XcNyZkpecTrrHXfBmixZls5amOxumBf+ZW1M080HQ40I94I4+13D+uRx9ruG5V9Sxqdh6hlWrUIqtQiq1CKrUIqtQiq1CKrUIqqXqqdNT6I4+13Dcuj0jcdskcfa7huXR6RuO2SOPtdw3K/DzhaFDerKFD91Zr3VmvdWa91Zr3VmvdWa91Zr3VmvdWaiPVlFh2/Dzgl3/kf/xAA4EQAAAgUICQMDBAMAAAAAAAAAAQIDBAUGFjAycYGhscEREzM0UVNikdESVKIUIUEQMUByRFBg/9oACAEDAQE/Af8AcMbuangZkzIerQJNvXk3l5Em3ryby8iTb15N5eRJt68m8vIk29eTeXkSbevJvLyJNvXk3l5Em3ryby8iTb15N5eRJt68m8vIk29eTeXkNjuanfo+pQ9OmdgimvszC+K3irXJoF6dBGf4Er3l09hK95dPYSveXT2Er3l09hK95dPYSveXT2Er3l09hK95dPYSveXT2CiLHimtRQP0/cy/AjakotynYIpr7Mw17wsrPGaZduhWWIjakotynYIpr7Mw17wsrPGaZduhWWIjakotynYIpr7Mw17wsrPGaZduhWWIjakotynYIpr7Mw17wsrPGaZduhWWIjakotynYIpr7Mw17wsrPGaZduhWWIjakotynYIpr7Mw17wsrPGaZduhWWIjakotynYIpr7Mw17wsrPGaZduhWWIjakotynYIpr7Mw17wsrPGaZduhWWIjakotynYIpr7Mw17wsrPGaZduhWWIjakotynYIpr7Mw17wsrPGaZduhWWIjakotynYIpr7Mw17wsrPGaZduhWWIjakotynYIpr7Mw17wsrPGaZduhWWIjakotynVLSuZ9OpTNHTwMGZmek5pl26FZYiNqSi3L+Qy7dCssRG1JRblOw+5lT3SWEtSMvTo/YSSd5f5B3CSbu9wdwkm7vcHcJJu73B3CSbu9wdwkm7vcHcJJu73B3CSbu9wdwfbjZHazktULfUenR+P0ZduhWWIj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|
|
@@ -507,6 +632,10 @@ describe('Database entities tests', (): void => {
|
|
|
507
632
|
expect(fromDb?.localeBranding).toBeDefined()
|
|
508
633
|
expect(fromDb?.localeBranding.length).toEqual(1)
|
|
509
634
|
expect(fromDb?.localeBranding[0].alias).toEqual(issuerBranding.localeBranding[0].alias)
|
|
635
|
+
expect(fromDb?.localeBranding[0].clientUri).toEqual(issuerBranding.localeBranding[0].clientUri)
|
|
636
|
+
expect(fromDb?.localeBranding[0].tosUri).toEqual(issuerBranding.localeBranding[0].tosUri)
|
|
637
|
+
expect(fromDb?.localeBranding[0].policyUri).toEqual(issuerBranding.localeBranding[0].policyUri)
|
|
638
|
+
expect(fromDb?.localeBranding[0].contacts).toEqual(issuerBranding.localeBranding[0].contacts)
|
|
510
639
|
expect(fromDb?.localeBranding[0].locale).toEqual(issuerBranding.localeBranding[0].locale)
|
|
511
640
|
expect(fromDb?.localeBranding[0].description).toEqual(issuerBranding.localeBranding[0].description)
|
|
512
641
|
expect(fromDb?.localeBranding[0].logo).toBeDefined()
|
|
@@ -106,9 +106,7 @@ export class DigitalCredentialStore extends AbstractDigitalCredentialStore {
|
|
|
106
106
|
let affected: number = 0
|
|
107
107
|
const findResult = await dcRepo.findBy(query)
|
|
108
108
|
for (const dc of findResult) {
|
|
109
|
-
|
|
110
|
-
affected += await this.deleteTree(dcRepo, { id: dc.parentId })
|
|
111
|
-
}
|
|
109
|
+
affected += await this.deleteTree(dcRepo, { parentId: dc.id })
|
|
112
110
|
const result = await dcRepo.delete(dc.id)
|
|
113
111
|
if (result.affected) {
|
|
114
112
|
affected += result.affected
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { typeormDate, typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
1
2
|
import { BaseEntity, Column, CreateDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'
|
|
2
3
|
import {
|
|
3
4
|
CredentialCorrelationType,
|
|
@@ -8,7 +9,6 @@ import {
|
|
|
8
9
|
DocumentType,
|
|
9
10
|
RegulationType,
|
|
10
11
|
} from '../../types'
|
|
11
|
-
import { typeormDate, typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
12
12
|
|
|
13
13
|
@Entity('DigitalCredential')
|
|
14
14
|
export class DigitalCredentialEntity extends BaseEntity implements DigitalCredential {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { ActionSubType, ActionType, InitiatorType, LogLevel, SubSystem, System, SystemCorrelationIdType } from '@sphereon/ssi-types'
|
|
2
|
-
import {
|
|
3
|
-
import { PartyCorrelationType } from '@sphereon/ssi-sdk.core'
|
|
4
|
-
import { NonPersistedAuditLoggingEvent } from '../../types'
|
|
1
|
+
import { ActionSubType, ActionType, InitiatorType, LoggingEventType, LogLevel, SubSystem, System, SystemCorrelationIdType } from '@sphereon/ssi-types'
|
|
2
|
+
import { CredentialType, PartyCorrelationType } from '@sphereon/ssi-sdk.core'
|
|
5
3
|
import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
4
|
+
import { BaseEntity, Column, CreateDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'
|
|
6
5
|
|
|
6
|
+
//TODO this entity, also contains some optional fields that are related to another event type (Activity) later we might want to refactor and reorganize this.
|
|
7
|
+
// For now I've added a discriminator value called eventType that can be one of the three types of events: 1. General, 2. Audit, and 3. Activity
|
|
7
8
|
@Entity('AuditEvents')
|
|
8
9
|
export class AuditEventEntity extends BaseEntity {
|
|
9
10
|
@PrimaryGeneratedColumn('uuid')
|
|
@@ -12,6 +13,9 @@ export class AuditEventEntity extends BaseEntity {
|
|
|
12
13
|
@Column({ name: 'timestamp', nullable: false, unique: false, type: typeOrmDateTime() })
|
|
13
14
|
timestamp!: Date
|
|
14
15
|
|
|
16
|
+
@Column('simple-enum', { name: 'eventType', enum: LoggingEventType, nullable: false, unique: false })
|
|
17
|
+
type!: LoggingEventType
|
|
18
|
+
|
|
15
19
|
@Column('simple-enum', { name: 'level', enum: LogLevel, nullable: false, unique: false })
|
|
16
20
|
level!: LogLevel
|
|
17
21
|
|
|
@@ -54,6 +58,21 @@ export class AuditEventEntity extends BaseEntity {
|
|
|
54
58
|
@Column('text', { name: 'description', nullable: false, unique: false })
|
|
55
59
|
description!: string
|
|
56
60
|
|
|
61
|
+
@Column('simple-enum', { name: 'credentialType', enum: CredentialType, nullable: true, unique: false })
|
|
62
|
+
credentialType?: CredentialType
|
|
63
|
+
|
|
64
|
+
@Column('text', { name: 'credentialHash', nullable: true, unique: false })
|
|
65
|
+
credentialHash?: string
|
|
66
|
+
|
|
67
|
+
@Column('text', { name: 'parentCredentialHash', nullable: true, unique: false })
|
|
68
|
+
parentCredentialHash?: string
|
|
69
|
+
|
|
70
|
+
@Column('text', { name: 'originalCredential', nullable: true, unique: false })
|
|
71
|
+
originalCredential?: string
|
|
72
|
+
|
|
73
|
+
@Column('text', { name: 'sharePurpose', nullable: true, unique: false })
|
|
74
|
+
sharePurpose?: string
|
|
75
|
+
|
|
57
76
|
@Column('text', { name: 'data', nullable: true, unique: false })
|
|
58
77
|
data?: string
|
|
59
78
|
|
|
@@ -66,27 +85,3 @@ export class AuditEventEntity extends BaseEntity {
|
|
|
66
85
|
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type: typeOrmDateTime() })
|
|
67
86
|
lastUpdatedAt!: Date
|
|
68
87
|
}
|
|
69
|
-
|
|
70
|
-
export const auditEventEntityFrom = (args: NonPersistedAuditLoggingEvent): AuditEventEntity => {
|
|
71
|
-
const auditEventEntity: AuditEventEntity = new AuditEventEntity()
|
|
72
|
-
auditEventEntity.timestamp = args.timestamp
|
|
73
|
-
auditEventEntity.level = args.level
|
|
74
|
-
auditEventEntity.correlationId = args.correlationId
|
|
75
|
-
auditEventEntity.system = args.system
|
|
76
|
-
auditEventEntity.subSystemType = args.subSystemType
|
|
77
|
-
auditEventEntity.actionType = args.actionType
|
|
78
|
-
auditEventEntity.actionSubType = args.actionSubType
|
|
79
|
-
auditEventEntity.initiatorType = args.initiatorType
|
|
80
|
-
auditEventEntity.systemCorrelationIdType = args.systemCorrelationIdType
|
|
81
|
-
auditEventEntity.systemCorrelationId = args.systemCorrelationId
|
|
82
|
-
auditEventEntity.systemAlias = args.systemAlias
|
|
83
|
-
auditEventEntity.partyCorrelationType = args.partyCorrelationType
|
|
84
|
-
auditEventEntity.partyCorrelationId = args.partyCorrelationId
|
|
85
|
-
auditEventEntity.partyAlias = args.partyAlias
|
|
86
|
-
auditEventEntity.description = args.description
|
|
87
|
-
auditEventEntity.partyCorrelationType = args.partyCorrelationType
|
|
88
|
-
auditEventEntity.data = JSON.stringify(args.data)
|
|
89
|
-
auditEventEntity.diagnosticData = JSON.stringify(args.diagnosticData)
|
|
90
|
-
|
|
91
|
-
return auditEventEntity
|
|
92
|
-
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { BaseEntity, BeforeInsert, BeforeUpdate, Column, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn } from 'typeorm'
|
|
2
|
-
import {
|
|
3
|
-
import { ImageAttributesEntity, imageAttributesEntityFrom } from './ImageAttributesEntity'
|
|
2
|
+
import { ImageAttributesEntity } from './ImageAttributesEntity'
|
|
4
3
|
import { validate, Validate, ValidationError } from 'class-validator'
|
|
5
|
-
import {
|
|
4
|
+
import { IsNonEmptyStringConstraint } from '../validators'
|
|
6
5
|
|
|
7
6
|
@Entity('BackgroundAttributes')
|
|
8
7
|
export class BackgroundAttributesEntity extends BaseEntity {
|
|
@@ -32,11 +31,3 @@ export class BackgroundAttributesEntity extends BaseEntity {
|
|
|
32
31
|
return
|
|
33
32
|
}
|
|
34
33
|
}
|
|
35
|
-
|
|
36
|
-
export const backgroundAttributesEntityFrom = (args: IBasicBackgroundAttributes): BackgroundAttributesEntity => {
|
|
37
|
-
const backgroundAttributesEntity: BackgroundAttributesEntity = new BackgroundAttributesEntity()
|
|
38
|
-
backgroundAttributesEntity.color = isEmptyString(args.color) ? undefined : args.color
|
|
39
|
-
backgroundAttributesEntity.image = args.image ? imageAttributesEntityFrom(args.image) : undefined
|
|
40
|
-
|
|
41
|
-
return backgroundAttributesEntity
|
|
42
|
-
}
|
|
@@ -12,8 +12,7 @@ import {
|
|
|
12
12
|
} from 'typeorm'
|
|
13
13
|
import { ArrayMinSize, IsNotEmpty, validate, ValidationError } from 'class-validator'
|
|
14
14
|
import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
15
|
-
import { CredentialLocaleBrandingEntity
|
|
16
|
-
import { IBasicCredentialBranding, IBasicCredentialLocaleBranding } from '../../types'
|
|
15
|
+
import { CredentialLocaleBrandingEntity } from './CredentialLocaleBrandingEntity'
|
|
17
16
|
|
|
18
17
|
@Entity('CredentialBranding')
|
|
19
18
|
@Index('IDX_CredentialBrandingEntity_vcHash', ['vcHash'])
|
|
@@ -66,14 +65,3 @@ export class CredentialBrandingEntity extends BaseEntity {
|
|
|
66
65
|
return
|
|
67
66
|
}
|
|
68
67
|
}
|
|
69
|
-
|
|
70
|
-
export const credentialBrandingEntityFrom = (args: IBasicCredentialBranding): CredentialBrandingEntity => {
|
|
71
|
-
const credentialBrandingEntity: CredentialBrandingEntity = new CredentialBrandingEntity()
|
|
72
|
-
credentialBrandingEntity.issuerCorrelationId = args.issuerCorrelationId
|
|
73
|
-
credentialBrandingEntity.vcHash = args.vcHash
|
|
74
|
-
credentialBrandingEntity.localeBranding = args.localeBranding.map((localeBranding: IBasicCredentialLocaleBranding) =>
|
|
75
|
-
credentialLocaleBrandingEntityFrom(localeBranding),
|
|
76
|
-
)
|
|
77
|
-
|
|
78
|
-
return credentialBrandingEntity
|
|
79
|
-
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { BaseEntity, BeforeInsert, BeforeUpdate, Column, Entity, Index, ManyToOne, PrimaryGeneratedColumn } from 'typeorm'
|
|
2
|
+
import { CredentialLocaleBrandingEntity } from './CredentialLocaleBrandingEntity'
|
|
3
|
+
import { validate, Validate, ValidationError } from 'class-validator'
|
|
4
|
+
import { IsNonEmptyStringConstraint } from '../validators'
|
|
5
|
+
|
|
6
|
+
@Entity('CredentialClaims')
|
|
7
|
+
@Index('IDX_CredentialClaimsEntity_credentialLocaleBranding_locale', ['credentialLocaleBranding', 'key'], { unique: true })
|
|
8
|
+
export class CredentialClaimsEntity extends BaseEntity {
|
|
9
|
+
@PrimaryGeneratedColumn('uuid')
|
|
10
|
+
id!: string
|
|
11
|
+
|
|
12
|
+
@Column('varchar', { name: 'key', length: 255, nullable: false, unique: false })
|
|
13
|
+
@Validate(IsNonEmptyStringConstraint, { message: 'Blank claim keys are not allowed' })
|
|
14
|
+
key!: string
|
|
15
|
+
|
|
16
|
+
@Column('varchar', { name: 'name', length: 255, nullable: false, unique: false })
|
|
17
|
+
@Validate(IsNonEmptyStringConstraint, { message: 'Blank claim names are not allowed' })
|
|
18
|
+
name!: string
|
|
19
|
+
|
|
20
|
+
@ManyToOne(() => CredentialLocaleBrandingEntity, (credentialLocaleBranding: CredentialLocaleBrandingEntity) => credentialLocaleBranding.claims, {
|
|
21
|
+
cascade: ['insert', 'update'],
|
|
22
|
+
onDelete: 'CASCADE',
|
|
23
|
+
})
|
|
24
|
+
credentialLocaleBranding!: CredentialLocaleBrandingEntity
|
|
25
|
+
|
|
26
|
+
@BeforeInsert()
|
|
27
|
+
@BeforeUpdate()
|
|
28
|
+
async validate(): Promise<undefined> {
|
|
29
|
+
const validation: Array<ValidationError> = await validate(this)
|
|
30
|
+
if (validation.length > 0) {
|
|
31
|
+
return Promise.reject(Error(Object.values(validation[0].constraints!)[0]))
|
|
32
|
+
}
|
|
33
|
+
return
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import { ChildEntity, Column, JoinColumn, ManyToOne, Index } from 'typeorm'
|
|
2
|
-
import { IBasicCredentialLocaleBranding } from '../../types'
|
|
3
|
-
import { backgroundAttributesEntityFrom } from './BackgroundAttributesEntity'
|
|
1
|
+
import { ChildEntity, Column, JoinColumn, ManyToOne, Index, OneToMany } from 'typeorm'
|
|
4
2
|
import { CredentialBrandingEntity } from './CredentialBrandingEntity'
|
|
5
|
-
import { imageAttributesEntityFrom } from './ImageAttributesEntity'
|
|
6
3
|
import { BaseLocaleBrandingEntity } from './BaseLocaleBrandingEntity'
|
|
7
|
-
import {
|
|
8
|
-
import { isEmptyString } from '../validators'
|
|
4
|
+
import { CredentialClaimsEntity } from './CredentialClaimsEntity'
|
|
9
5
|
|
|
10
6
|
@ChildEntity('CredentialLocaleBranding')
|
|
11
7
|
@Index('IDX_CredentialLocaleBrandingEntity_credentialBranding_locale', ['credentialBranding', 'locale'], { unique: true })
|
|
@@ -16,18 +12,15 @@ export class CredentialLocaleBrandingEntity extends BaseLocaleBrandingEntity {
|
|
|
16
12
|
@JoinColumn({ name: 'credentialBrandingId' })
|
|
17
13
|
credentialBranding!: CredentialBrandingEntity
|
|
18
14
|
|
|
15
|
+
@OneToMany(() => CredentialClaimsEntity, (claims: CredentialClaimsEntity) => claims.credentialLocaleBranding, {
|
|
16
|
+
cascade: true,
|
|
17
|
+
onDelete: 'CASCADE',
|
|
18
|
+
eager: true,
|
|
19
|
+
nullable: false,
|
|
20
|
+
})
|
|
21
|
+
@JoinColumn({ name: 'claim_id' })
|
|
22
|
+
claims!: Array<CredentialClaimsEntity>
|
|
23
|
+
|
|
19
24
|
@Column('text', { name: 'credentialBrandingId', nullable: false })
|
|
20
25
|
credentialBrandingId!: string
|
|
21
26
|
}
|
|
22
|
-
|
|
23
|
-
export const credentialLocaleBrandingEntityFrom = (args: IBasicCredentialLocaleBranding): CredentialLocaleBrandingEntity => {
|
|
24
|
-
const credentialLocaleBrandingEntity: CredentialLocaleBrandingEntity = new CredentialLocaleBrandingEntity()
|
|
25
|
-
credentialLocaleBrandingEntity.alias = isEmptyString(args.alias) ? undefined : args.alias
|
|
26
|
-
credentialLocaleBrandingEntity.locale = args.locale ? args.locale : ''
|
|
27
|
-
credentialLocaleBrandingEntity.logo = args.logo ? imageAttributesEntityFrom(args.logo) : undefined
|
|
28
|
-
credentialLocaleBrandingEntity.description = isEmptyString(args.description) ? undefined : args.description
|
|
29
|
-
credentialLocaleBrandingEntity.background = args.background ? backgroundAttributesEntityFrom(args.background) : undefined
|
|
30
|
-
credentialLocaleBrandingEntity.text = args.text ? textAttributesEntityFrom(args.text) : undefined
|
|
31
|
-
|
|
32
|
-
return credentialLocaleBrandingEntity
|
|
33
|
-
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { BaseEntity, BeforeInsert, BeforeUpdate, Column, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn } from 'typeorm'
|
|
2
|
-
import {
|
|
3
|
-
import { ImageDimensionsEntity, imageDimensionsEntityFrom } from './ImageDimensionsEntity'
|
|
2
|
+
import { ImageDimensionsEntity } from './ImageDimensionsEntity'
|
|
4
3
|
import { validate, Validate, ValidationError } from 'class-validator'
|
|
5
|
-
import {
|
|
4
|
+
import { IsNonEmptyStringConstraint } from '../validators'
|
|
6
5
|
|
|
7
6
|
@Entity('ImageAttributes')
|
|
8
7
|
export class ImageAttributesEntity extends BaseEntity {
|
|
@@ -44,14 +43,3 @@ export class ImageAttributesEntity extends BaseEntity {
|
|
|
44
43
|
return
|
|
45
44
|
}
|
|
46
45
|
}
|
|
47
|
-
|
|
48
|
-
export const imageAttributesEntityFrom = (args: IBasicImageAttributes): ImageAttributesEntity => {
|
|
49
|
-
const imageAttributesEntity: ImageAttributesEntity = new ImageAttributesEntity()
|
|
50
|
-
imageAttributesEntity.uri = isEmptyString(args.uri) ? undefined : args.uri
|
|
51
|
-
imageAttributesEntity.dataUri = isEmptyString(args.dataUri) ? undefined : args.dataUri
|
|
52
|
-
imageAttributesEntity.mediaType = isEmptyString(args.mediaType) ? undefined : args.mediaType
|
|
53
|
-
imageAttributesEntity.alt = isEmptyString(args.alt) ? undefined : args.alt
|
|
54
|
-
imageAttributesEntity.dimensions = args.dimensions ? imageDimensionsEntityFrom(args.dimensions) : undefined
|
|
55
|
-
|
|
56
|
-
return imageAttributesEntity
|
|
57
|
-
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
|
2
|
-
import { IBasicImageDimensions } from '../../types'
|
|
3
2
|
|
|
4
3
|
@Entity('ImageDimensions')
|
|
5
4
|
export class ImageDimensionsEntity extends BaseEntity {
|
|
@@ -12,11 +11,3 @@ export class ImageDimensionsEntity extends BaseEntity {
|
|
|
12
11
|
@Column('integer', { name: 'height', nullable: false, unique: false })
|
|
13
12
|
height!: number
|
|
14
13
|
}
|
|
15
|
-
|
|
16
|
-
export const imageDimensionsEntityFrom = (args: IBasicImageDimensions): ImageDimensionsEntity => {
|
|
17
|
-
const imageDimensionsEntity: ImageDimensionsEntity = new ImageDimensionsEntity()
|
|
18
|
-
imageDimensionsEntity.width = args.width
|
|
19
|
-
imageDimensionsEntity.height = args.height
|
|
20
|
-
|
|
21
|
-
return imageDimensionsEntity
|
|
22
|
-
}
|
|
@@ -12,8 +12,7 @@ import {
|
|
|
12
12
|
} from 'typeorm'
|
|
13
13
|
import { ArrayMinSize, IsNotEmpty, validate, ValidationError } from 'class-validator'
|
|
14
14
|
import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
15
|
-
import { IssuerLocaleBrandingEntity
|
|
16
|
-
import { IBasicIssuerBranding, IBasicIssuerLocaleBranding } from '../../types'
|
|
15
|
+
import { IssuerLocaleBrandingEntity } from './IssuerLocaleBrandingEntity'
|
|
17
16
|
|
|
18
17
|
@Entity('IssuerBranding')
|
|
19
18
|
@Index('IDX_IssuerBrandingEntity_issuerCorrelationId', ['issuerCorrelationId'])
|
|
@@ -61,13 +60,3 @@ export class IssuerBrandingEntity extends BaseEntity {
|
|
|
61
60
|
return
|
|
62
61
|
}
|
|
63
62
|
}
|
|
64
|
-
|
|
65
|
-
export const issuerBrandingEntityFrom = (args: IBasicIssuerBranding): IssuerBrandingEntity => {
|
|
66
|
-
const issuerBrandingEntity: IssuerBrandingEntity = new IssuerBrandingEntity()
|
|
67
|
-
issuerBrandingEntity.issuerCorrelationId = args.issuerCorrelationId
|
|
68
|
-
issuerBrandingEntity.localeBranding = args.localeBranding.map((localeBranding: IBasicIssuerLocaleBranding) =>
|
|
69
|
-
issuerLocaleBrandingEntityFrom(localeBranding),
|
|
70
|
-
)
|
|
71
|
-
|
|
72
|
-
return issuerBrandingEntity
|
|
73
|
-
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { ChildEntity, Column, Index, JoinColumn, ManyToOne } from 'typeorm'
|
|
2
|
-
import { IBasicIssuerLocaleBranding } from '../../types'
|
|
3
|
-
import { backgroundAttributesEntityFrom } from './BackgroundAttributesEntity'
|
|
4
|
-
import { imageAttributesEntityFrom } from './ImageAttributesEntity'
|
|
5
2
|
import { IssuerBrandingEntity } from './IssuerBrandingEntity'
|
|
6
3
|
import { BaseLocaleBrandingEntity } from './BaseLocaleBrandingEntity'
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { IsNonEmptyStringConstraint } from '../validators'
|
|
5
|
+
import { Validate } from 'class-validator'
|
|
9
6
|
|
|
10
7
|
@ChildEntity('IssuerLocaleBranding')
|
|
11
8
|
@Index('IDX_IssuerLocaleBrandingEntity_issuerBranding_locale', ['issuerBranding', 'locale'], { unique: true })
|
|
@@ -16,18 +13,21 @@ export class IssuerLocaleBrandingEntity extends BaseLocaleBrandingEntity {
|
|
|
16
13
|
@JoinColumn({ name: 'issuerBrandingId' })
|
|
17
14
|
issuerBranding!: IssuerBrandingEntity
|
|
18
15
|
|
|
19
|
-
@Column('text', { name: '
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
@Column('text', { name: 'client_uri', nullable: true, unique: false })
|
|
17
|
+
@Validate(IsNonEmptyStringConstraint, { message: 'Blank client uris are not allowed' })
|
|
18
|
+
clientUri?: string
|
|
19
|
+
|
|
20
|
+
@Column('text', { name: 'tos_uri', nullable: true, unique: false })
|
|
21
|
+
@Validate(IsNonEmptyStringConstraint, { message: 'Blank tos uris are not allowed' })
|
|
22
|
+
tosUri?: string
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
issuerLocaleBrandingEntity.locale = args.locale ? args.locale : ''
|
|
27
|
-
issuerLocaleBrandingEntity.logo = args.logo ? imageAttributesEntityFrom(args.logo) : undefined
|
|
28
|
-
issuerLocaleBrandingEntity.description = isEmptyString(args.description) ? undefined : args.description
|
|
29
|
-
issuerLocaleBrandingEntity.background = args.background ? backgroundAttributesEntityFrom(args.background) : undefined
|
|
30
|
-
issuerLocaleBrandingEntity.text = args.text ? textAttributesEntityFrom(args.text) : undefined
|
|
24
|
+
@Column('text', { name: 'policy_uri', nullable: true, unique: false })
|
|
25
|
+
@Validate(IsNonEmptyStringConstraint, { message: 'Blank policy uris are not allowed' })
|
|
26
|
+
policyUri?: string
|
|
31
27
|
|
|
32
|
-
|
|
28
|
+
@Column('simple-array', { name: 'contacts', nullable: true, unique: false })
|
|
29
|
+
contacts?: Array<string>
|
|
30
|
+
|
|
31
|
+
@Column('text', { name: 'issuerBrandingId', nullable: false })
|
|
32
|
+
issuerBrandingId!: string
|
|
33
33
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BaseEntity, BeforeInsert, BeforeUpdate, Column, Entity, PrimaryGeneratedColumn } from 'typeorm'
|
|
2
|
-
import { IBasicTextAttributes } from '../../types'
|
|
3
2
|
import { validate, Validate, ValidationError } from 'class-validator'
|
|
4
|
-
import {
|
|
3
|
+
import { IsNonEmptyStringConstraint } from '../validators'
|
|
5
4
|
|
|
6
5
|
@Entity('TextAttributes')
|
|
7
6
|
export class TextAttributesEntity extends BaseEntity {
|
|
@@ -22,10 +21,3 @@ export class TextAttributesEntity extends BaseEntity {
|
|
|
22
21
|
return
|
|
23
22
|
}
|
|
24
23
|
}
|
|
25
|
-
|
|
26
|
-
export const textAttributesEntityFrom = (args: IBasicTextAttributes): TextAttributesEntity => {
|
|
27
|
-
const textAttributesEntity: TextAttributesEntity = new TextAttributesEntity()
|
|
28
|
-
textAttributesEntity.color = isEmptyString(args.color) ? undefined : args.color
|
|
29
|
-
|
|
30
|
-
return textAttributesEntity
|
|
31
|
-
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ActivityLoggingEvent, AuditLoggingEvent } from '@sphereon/ssi-sdk.core'
|
|
2
|
+
import { GetActivityEventsArgs, GetAuditEventsArgs, StoreActivityEventArgs, StoreAuditEventArgs } from '../types'
|
|
3
3
|
|
|
4
4
|
export abstract class AbstractEventLoggerStore {
|
|
5
5
|
abstract getAuditEvents(args: GetAuditEventsArgs): Promise<Array<AuditLoggingEvent>>
|
|
6
|
+
abstract getActivityEvents(args: GetActivityEventsArgs): Promise<Array<ActivityLoggingEvent>>
|
|
6
7
|
abstract storeAuditEvent(args: StoreAuditEventArgs): Promise<AuditLoggingEvent>
|
|
8
|
+
abstract storeActivityEvent(args: StoreActivityEventArgs): Promise<ActivityLoggingEvent>
|
|
7
9
|
}
|