@sphereon/ssi-sdk.data-store 0.30.2-feature.SPRIND.84.146 → 0.30.2-feature.SPRIND.84.182
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entities/digitalCredential/DigitalCredentialEntity.d.ts.map +1 -1
- package/dist/entities/digitalCredential/DigitalCredentialEntity.js +1 -1
- package/dist/entities/digitalCredential/DigitalCredentialEntity.js.map +1 -1
- package/dist/entities/eventLogger/AuditEventEntity.d.ts +1 -4
- package/dist/entities/eventLogger/AuditEventEntity.d.ts.map +1 -1
- package/dist/entities/eventLogger/AuditEventEntity.js +2 -55
- package/dist/entities/eventLogger/AuditEventEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.d.ts +0 -2
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.js +1 -8
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.d.ts +0 -2
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.js +1 -9
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.d.ts +0 -2
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.js +1 -16
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/ImageAttributesEntity.d.ts +0 -2
- package/dist/entities/issuanceBranding/ImageAttributesEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/ImageAttributesEntity.js +1 -11
- package/dist/entities/issuanceBranding/ImageAttributesEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.d.ts +0 -2
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.js +1 -8
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.d.ts +0 -2
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.js +1 -8
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.d.ts +4 -2
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.js +21 -15
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/TextAttributesEntity.d.ts +0 -2
- package/dist/entities/issuanceBranding/TextAttributesEntity.d.ts.map +1 -1
- package/dist/entities/issuanceBranding/TextAttributesEntity.js +1 -7
- package/dist/entities/issuanceBranding/TextAttributesEntity.js.map +1 -1
- package/dist/eventLogger/EventLoggerStore.d.ts.map +1 -1
- package/dist/eventLogger/EventLoggerStore.js +2 -2
- package/dist/eventLogger/EventLoggerStore.js.map +1 -1
- package/dist/index.d.ts +14 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -18
- package/dist/index.js.map +1 -1
- package/dist/issuanceBranding/IssuanceBrandingStore.d.ts +1 -1
- package/dist/issuanceBranding/IssuanceBrandingStore.d.ts.map +1 -1
- package/dist/issuanceBranding/IssuanceBrandingStore.js +5 -5
- package/dist/issuanceBranding/IssuanceBrandingStore.js.map +1 -1
- package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.js +1 -1
- package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.js.map +1 -1
- package/dist/migrations/postgres/1708525189001-CreateDigitalCredential.js +1 -1
- package/dist/migrations/postgres/1708525189001-CreateDigitalCredential.js.map +1 -1
- package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.js +3 -3
- package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.js.map +1 -1
- package/dist/migrations/sqlite/1708525189002-CreateDigitalCredential.js +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/issuanceBranding/issuanceBranding.d.ts +7 -2
- package/dist/types/issuanceBranding/issuanceBranding.d.ts.map +1 -1
- package/dist/utils/eventLogger/MappingUtils.d.ts +4 -1
- package/dist/utils/eventLogger/MappingUtils.d.ts.map +1 -1
- package/dist/utils/eventLogger/MappingUtils.js +55 -1
- package/dist/utils/eventLogger/MappingUtils.js.map +1 -1
- package/dist/utils/issuanceBranding/MappingUtils.d.ts +15 -1
- package/dist/utils/issuanceBranding/MappingUtils.d.ts.map +1 -1
- package/dist/utils/issuanceBranding/MappingUtils.js +81 -1
- package/dist/utils/issuanceBranding/MappingUtils.js.map +1 -1
- package/package.json +5 -5
- package/src/__tests__/contact.store.test.ts +59 -4
- package/src/__tests__/digitalCredential.entities.test.ts +5 -5
- package/src/__tests__/digitalCredential.store.test.ts +1 -1
- package/src/__tests__/eventLogger.entities.test.ts +24 -24
- package/src/__tests__/issuanceBranding.entities.test.ts +8 -0
- package/src/entities/digitalCredential/DigitalCredentialEntity.ts +1 -1
- package/src/entities/eventLogger/AuditEventEntity.ts +1 -57
- package/src/entities/issuanceBranding/BackgroundAttributesEntity.ts +2 -11
- package/src/entities/issuanceBranding/CredentialBrandingEntity.ts +1 -13
- package/src/entities/issuanceBranding/CredentialLocaleBrandingEntity.ts +0 -17
- package/src/entities/issuanceBranding/ImageAttributesEntity.ts +2 -14
- package/src/entities/issuanceBranding/ImageDimensionsEntity.ts +0 -9
- package/src/entities/issuanceBranding/IssuerBrandingEntity.ts +1 -12
- package/src/entities/issuanceBranding/IssuerLocaleBrandingEntity.ts +17 -17
- package/src/entities/issuanceBranding/TextAttributesEntity.ts +1 -9
- package/src/eventLogger/EventLoggerStore.ts +5 -4
- package/src/index.ts +13 -26
- package/src/issuanceBranding/IssuanceBrandingStore.ts +14 -6
- package/src/migrations/postgres/1685628974232-CreateIssuanceBranding.ts +1 -1
- package/src/migrations/postgres/1708525189001-CreateDigitalCredential.ts +1 -1
- package/src/migrations/sqlite/1685628973231-CreateIssuanceBranding.ts +3 -3
- package/src/migrations/sqlite/1708525189002-CreateDigitalCredential.ts +1 -1
- package/src/types/contact/contact.ts +3 -3
- package/src/types/digitalCredential/digitalCredential.ts +1 -0
- package/src/types/issuanceBranding/issuanceBranding.ts +9 -3
- package/src/utils/eventLogger/MappingUtils.ts +57 -2
- package/src/utils/issuanceBranding/MappingUtils.ts +105 -2
|
@@ -13,7 +13,7 @@ export class CreateIssuanceBranding1685628973231 implements MigrationInterface {
|
|
|
13
13
|
)
|
|
14
14
|
await queryRunner.query(`CREATE TABLE "TextAttributes" ("id" varchar PRIMARY KEY NOT NULL, "color" varchar(255))`)
|
|
15
15
|
await queryRunner.query(
|
|
16
|
-
`CREATE TABLE "BaseLocaleBranding" ("id" varchar PRIMARY KEY NOT NULL, "alias" varchar(255), "locale" varchar(255) NOT NULL, "description" varchar(255), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "credentialBrandingId" varchar, "issuerBrandingId" varchar, "type" varchar NOT NULL, "logoId" varchar, "backgroundId" varchar, "textId" varchar, CONSTRAINT "UQ_logoId" UNIQUE ("logoId"), CONSTRAINT "UQ_backgroundId" UNIQUE ("backgroundId"), CONSTRAINT "UQ_textId" UNIQUE ("textId"))`,
|
|
16
|
+
`CREATE TABLE "BaseLocaleBranding" ("id" varchar PRIMARY KEY NOT NULL, "alias" varchar(255), "locale" varchar(255) NOT NULL, "description" varchar(255), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "credentialBrandingId" varchar, "issuerBrandingId" varchar, "type" varchar NOT NULL, "logoId" varchar, "backgroundId" varchar, "textId" varchar, "client_uri" varchar, "tos_uri" varchar, "policy_uri" varchar, "contacts" varchar, CONSTRAINT "UQ_logoId" UNIQUE ("logoId"), CONSTRAINT "UQ_backgroundId" UNIQUE ("backgroundId"), CONSTRAINT "UQ_textId" UNIQUE ("textId"))`,
|
|
17
17
|
)
|
|
18
18
|
await queryRunner.query(
|
|
19
19
|
`CREATE UNIQUE INDEX "IDX_CredentialLocaleBrandingEntity_credentialBranding_locale" ON "BaseLocaleBranding" ("credentialBrandingId", "locale")`,
|
|
@@ -51,7 +51,7 @@ export class CreateIssuanceBranding1685628973231 implements MigrationInterface {
|
|
|
51
51
|
await queryRunner.query(`DROP INDEX "IDX_IssuerLocaleBrandingEntity_issuerBranding_locale"`)
|
|
52
52
|
await queryRunner.query(`DROP INDEX "IDX_BaseLocaleBranding_type"`)
|
|
53
53
|
await queryRunner.query(
|
|
54
|
-
`CREATE TABLE "temporary_BaseLocaleBranding" ("id" varchar PRIMARY KEY NOT NULL, "alias" varchar(255), "locale" varchar(255) NOT NULL, "description" varchar(255), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "credentialBrandingId" varchar, "issuerBrandingId" varchar, "type" varchar NOT NULL, "logoId" varchar, "backgroundId" varchar, "textId" varchar, CONSTRAINT "UQ_logoId" UNIQUE ("logoId"), CONSTRAINT "UQ_backgroundId" UNIQUE ("backgroundId"), CONSTRAINT "UQ_textId" UNIQUE ("textId"), CONSTRAINT "FK_BaseLocaleBranding_logoId" FOREIGN KEY ("logoId") REFERENCES "ImageAttributes" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_BaseLocaleBranding_backgroundId" FOREIGN KEY ("backgroundId") REFERENCES "BackgroundAttributes" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_BaseLocaleBranding_textId" FOREIGN KEY ("textId") REFERENCES "TextAttributes" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_BaseLocaleBranding_credentialBrandingId" FOREIGN KEY ("credentialBrandingId") REFERENCES "CredentialBranding" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_BaseLocaleBranding_issuerBrandingId" FOREIGN KEY ("issuerBrandingId") REFERENCES "IssuerBranding" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`,
|
|
54
|
+
`CREATE TABLE "temporary_BaseLocaleBranding" ("id" varchar PRIMARY KEY NOT NULL, "alias" varchar(255), "locale" varchar(255) NOT NULL, "description" varchar(255), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "credentialBrandingId" varchar, "issuerBrandingId" varchar, "type" varchar NOT NULL, "logoId" varchar, "backgroundId" varchar, "textId" varchar, "client_uri" varchar, "tos_uri" varchar, "policy_uri" varchar, "contacts" varchar, CONSTRAINT "UQ_logoId" UNIQUE ("logoId"), CONSTRAINT "UQ_backgroundId" UNIQUE ("backgroundId"), CONSTRAINT "UQ_textId" UNIQUE ("textId"), CONSTRAINT "FK_BaseLocaleBranding_logoId" FOREIGN KEY ("logoId") REFERENCES "ImageAttributes" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_BaseLocaleBranding_backgroundId" FOREIGN KEY ("backgroundId") REFERENCES "BackgroundAttributes" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_BaseLocaleBranding_textId" FOREIGN KEY ("textId") REFERENCES "TextAttributes" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_BaseLocaleBranding_credentialBrandingId" FOREIGN KEY ("credentialBrandingId") REFERENCES "CredentialBranding" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_BaseLocaleBranding_issuerBrandingId" FOREIGN KEY ("issuerBrandingId") REFERENCES "IssuerBranding" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`,
|
|
55
55
|
)
|
|
56
56
|
await queryRunner.query(
|
|
57
57
|
`INSERT INTO "temporary_BaseLocaleBranding"("id", "alias", "locale", "description", "created_at", "last_updated_at", "credentialBrandingId", "issuerBrandingId", "type", "logoId", "backgroundId", "textId") SELECT "id", "alias", "locale", "description", "created_at", "last_updated_at", "credentialBrandingId", "issuerBrandingId", "type", "logoId", "backgroundId", "textId" FROM "BaseLocaleBranding"`,
|
|
@@ -73,7 +73,7 @@ export class CreateIssuanceBranding1685628973231 implements MigrationInterface {
|
|
|
73
73
|
await queryRunner.query(`DROP INDEX "IDX_CredentialLocaleBrandingEntity_credentialBranding_locale"`)
|
|
74
74
|
await queryRunner.query(`ALTER TABLE "BaseLocaleBranding" RENAME TO "temporary_BaseLocaleBranding"`)
|
|
75
75
|
await queryRunner.query(
|
|
76
|
-
`CREATE TABLE "BaseLocaleBranding" ("id" varchar PRIMARY KEY NOT NULL, "alias" varchar(255), "locale" varchar(255) NOT NULL, "description" varchar(255), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "credentialBrandingId" varchar, "issuerBrandingId" varchar, "type" varchar NOT NULL, "logoId" varchar, "backgroundId" varchar, "textId" varchar, CONSTRAINT "UQ_logoId" UNIQUE ("logoId"), CONSTRAINT "UQ_backgroundId" UNIQUE ("backgroundId"), CONSTRAINT "UQ_textId" UNIQUE ("textId"))`,
|
|
76
|
+
`CREATE TABLE "BaseLocaleBranding" ("id" varchar PRIMARY KEY NOT NULL, "alias" varchar(255), "locale" varchar(255) NOT NULL, "description" varchar(255), "created_at" datetime NOT NULL DEFAULT (datetime('now')), "last_updated_at" datetime NOT NULL DEFAULT (datetime('now')), "credentialBrandingId" varchar, "issuerBrandingId" varchar, "type" varchar NOT NULL, "logoId" varchar, "backgroundId" varchar, "textId" varchar, "client_uri" varchar, "tos_uri" varchar, "policy_uri" varchar, "contacts" varchar, CONSTRAINT "UQ_logoId" UNIQUE ("logoId"), CONSTRAINT "UQ_backgroundId" UNIQUE ("backgroundId"), CONSTRAINT "UQ_textId" UNIQUE ("textId"))`,
|
|
77
77
|
)
|
|
78
78
|
await queryRunner.query(
|
|
79
79
|
`INSERT INTO "BaseLocaleBranding"("id", "alias", "locale", "description", "created_at", "last_updated_at", "credentialBrandingId", "issuerBrandingId", "type", "logoId", "backgroundId", "textId") SELECT "id", "alias", "locale", "description", "created_at", "last_updated_at", "credentialBrandingId", "issuerBrandingId", "type", "logoId", "backgroundId", "textId" FROM "BaseLocaleBranding"`,
|
|
@@ -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,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ManagedIdentifierOptsOrResult } from '@sphereon/ssi-sdk-ext.identifier-resolution'
|
|
2
2
|
import { IIdentifier } from '@veramo/core'
|
|
3
|
-
import {
|
|
3
|
+
import { IIssuerLocaleBranding } from '../issuanceBranding/issuanceBranding'
|
|
4
4
|
import { CredentialRole } from '../digitalCredential/digitalCredential'
|
|
5
5
|
|
|
6
6
|
export type MetadataTypes = string | number | Date | boolean | undefined
|
|
@@ -26,7 +26,7 @@ export type Party = {
|
|
|
26
26
|
contact: Contact
|
|
27
27
|
partyType: PartyType
|
|
28
28
|
/**
|
|
29
|
-
* TODO: Integrate branding logic here in the future.
|
|
29
|
+
* TODO: Integrate branding logic here in the future. What we should do is make the issuance branding plugin part of the contact-manager and retrieve any branding there is.
|
|
30
30
|
*
|
|
31
31
|
* Currently, we are only defining the branding type within the SDK without implementing the associated logic. This is because:
|
|
32
32
|
* 1. We are combining two types from the SSI-SDK to create a new type that will be used across multiple places in the wallets (web & mobile).
|
|
@@ -35,7 +35,7 @@ export type Party = {
|
|
|
35
35
|
*
|
|
36
36
|
* For now, we are defining the type here and will use it in the mobile wallet has the logic for it. This is a temporary solution until we have the resources to integrate the branding logic fully.
|
|
37
37
|
*/
|
|
38
|
-
branding?:
|
|
38
|
+
branding?: IIssuerLocaleBranding
|
|
39
39
|
relationships: Array<PartyRelationship>
|
|
40
40
|
createdAt: Date
|
|
41
41
|
lastUpdatedAt: Date
|
|
@@ -80,17 +80,23 @@ export interface IPartialCredentialBranding extends Partial<Omit<ICredentialBran
|
|
|
80
80
|
localeBranding?: IPartialCredentialLocaleBranding
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
export interface IIssuerLocaleBranding extends ILocaleBranding {
|
|
83
|
+
export interface IIssuerLocaleBranding extends ILocaleBranding {
|
|
84
|
+
clientUri?: string
|
|
85
|
+
tosUri?: string
|
|
86
|
+
policyUri?: string
|
|
87
|
+
contacts?: Array<string>
|
|
88
|
+
}
|
|
84
89
|
export interface IBasicIssuerLocaleBranding
|
|
85
90
|
extends Omit<IIssuerLocaleBranding, 'id' | 'createdAt' | 'lastUpdatedAt' | 'logo' | 'background' | 'text'> {
|
|
86
91
|
logo?: IBasicImageAttributes
|
|
87
92
|
background?: IBasicBackgroundAttributes
|
|
88
93
|
text?: IBasicTextAttributes
|
|
89
94
|
}
|
|
90
|
-
export interface IPartialIssuerLocaleBranding extends Partial<Omit<IIssuerLocaleBranding, 'logo' | 'background' | 'text'>> {
|
|
95
|
+
export interface IPartialIssuerLocaleBranding extends Partial<Omit<IIssuerLocaleBranding, 'logo' | 'background' | 'text' | 'contacts'>> {
|
|
91
96
|
logo?: IPartialImageAttributes
|
|
92
97
|
background?: IPartialBackgroundAttributes
|
|
93
98
|
text?: IPartialTextAttributes
|
|
99
|
+
contacts?: string
|
|
94
100
|
}
|
|
95
101
|
|
|
96
102
|
export interface IIssuerBranding {
|
|
@@ -103,7 +109,7 @@ export interface IIssuerBranding {
|
|
|
103
109
|
export interface IBasicIssuerBranding extends Omit<IIssuerBranding, 'id' | 'createdAt' | 'lastUpdatedAt' | 'localeBranding'> {
|
|
104
110
|
localeBranding: Array<IBasicIssuerLocaleBranding>
|
|
105
111
|
}
|
|
106
|
-
export interface IPartialIssuerBranding extends Partial<Omit<
|
|
112
|
+
export interface IPartialIssuerBranding extends Partial<Omit<IIssuerBranding, 'localeBranding'>> {
|
|
107
113
|
localeBranding?: IPartialIssuerLocaleBranding
|
|
108
114
|
}
|
|
109
115
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { AuditEventEntity } from '../../entities/eventLogger/AuditEventEntity'
|
|
2
1
|
import { ActivityLoggingEvent, AuditLoggingEvent } from '@sphereon/ssi-sdk.core'
|
|
3
2
|
import { LoggingEventType } from '@sphereon/ssi-types'
|
|
4
3
|
import { replaceNullWithUndefined } from '../FormattingUtils'
|
|
4
|
+
import { AuditEventEntity } from '../../entities/eventLogger/AuditEventEntity'
|
|
5
|
+
import { NonPersistedActivityLoggingEvent, NonPersistedAuditLoggingEvent } from '../../types'
|
|
5
6
|
|
|
6
7
|
export const auditEventFrom = (event: AuditEventEntity): AuditLoggingEvent => {
|
|
7
8
|
const result: AuditLoggingEvent = {
|
|
@@ -29,8 +30,32 @@ export const auditEventFrom = (event: AuditEventEntity): AuditLoggingEvent => {
|
|
|
29
30
|
return replaceNullWithUndefined(result)
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
export const
|
|
33
|
+
export const auditEventEntityFrom = (args: NonPersistedAuditLoggingEvent): AuditEventEntity => {
|
|
34
|
+
const auditEventEntity: AuditEventEntity = new AuditEventEntity()
|
|
35
|
+
auditEventEntity.type = LoggingEventType.AUDIT
|
|
36
|
+
auditEventEntity.timestamp = args.timestamp
|
|
37
|
+
auditEventEntity.level = args.level
|
|
38
|
+
auditEventEntity.correlationId = args.correlationId
|
|
39
|
+
auditEventEntity.system = args.system
|
|
40
|
+
auditEventEntity.subSystemType = args.subSystemType
|
|
41
|
+
auditEventEntity.actionType = args.actionType
|
|
42
|
+
auditEventEntity.actionSubType = args.actionSubType
|
|
43
|
+
auditEventEntity.initiatorType = args.initiatorType
|
|
44
|
+
auditEventEntity.systemCorrelationIdType = args.systemCorrelationIdType
|
|
45
|
+
auditEventEntity.systemCorrelationId = args.systemCorrelationId
|
|
46
|
+
auditEventEntity.systemAlias = args.systemAlias
|
|
47
|
+
auditEventEntity.partyCorrelationType = args.partyCorrelationType
|
|
48
|
+
auditEventEntity.partyCorrelationId = args.partyCorrelationId
|
|
49
|
+
auditEventEntity.partyAlias = args.partyAlias
|
|
50
|
+
auditEventEntity.description = args.description
|
|
51
|
+
auditEventEntity.partyCorrelationType = args.partyCorrelationType
|
|
52
|
+
auditEventEntity.data = JSON.stringify(args.data)
|
|
53
|
+
auditEventEntity.diagnosticData = JSON.stringify(args.diagnosticData)
|
|
54
|
+
|
|
55
|
+
return auditEventEntity
|
|
56
|
+
}
|
|
33
57
|
|
|
58
|
+
export const activityEventFrom = (event: AuditEventEntity): ActivityLoggingEvent => {
|
|
34
59
|
const result: ActivityLoggingEvent = {
|
|
35
60
|
id: event.id,
|
|
36
61
|
type: LoggingEventType.ACTIVITY,
|
|
@@ -59,3 +84,33 @@ export const activityEventFrom = (event: AuditEventEntity): ActivityLoggingEvent
|
|
|
59
84
|
|
|
60
85
|
return replaceNullWithUndefined(result)
|
|
61
86
|
}
|
|
87
|
+
|
|
88
|
+
export const activityEventEntityFrom = (args: NonPersistedActivityLoggingEvent): AuditEventEntity => {
|
|
89
|
+
const activityEventEntity: AuditEventEntity = new AuditEventEntity()
|
|
90
|
+
activityEventEntity.type = LoggingEventType.ACTIVITY
|
|
91
|
+
activityEventEntity.timestamp = args.timestamp
|
|
92
|
+
activityEventEntity.level = args.level
|
|
93
|
+
activityEventEntity.correlationId = args.correlationId
|
|
94
|
+
activityEventEntity.system = args.system
|
|
95
|
+
activityEventEntity.subSystemType = args.subSystemType
|
|
96
|
+
activityEventEntity.actionType = args.actionType
|
|
97
|
+
activityEventEntity.actionSubType = args.actionSubType
|
|
98
|
+
activityEventEntity.initiatorType = args.initiatorType
|
|
99
|
+
activityEventEntity.systemCorrelationIdType = args.systemCorrelationIdType
|
|
100
|
+
activityEventEntity.systemCorrelationId = args.systemCorrelationId
|
|
101
|
+
activityEventEntity.systemAlias = args.systemAlias
|
|
102
|
+
activityEventEntity.partyCorrelationType = args.partyCorrelationType
|
|
103
|
+
activityEventEntity.partyCorrelationId = args.partyCorrelationId
|
|
104
|
+
activityEventEntity.partyAlias = args.partyAlias
|
|
105
|
+
activityEventEntity.description = args.description
|
|
106
|
+
activityEventEntity.partyCorrelationType = args.partyCorrelationType
|
|
107
|
+
activityEventEntity.data = JSON.stringify(args.data)
|
|
108
|
+
activityEventEntity.sharePurpose = args.sharePurpose
|
|
109
|
+
activityEventEntity.credentialType = args.credentialType
|
|
110
|
+
activityEventEntity.originalCredential = args.originalCredential
|
|
111
|
+
activityEventEntity.credentialHash = args.credentialHash
|
|
112
|
+
activityEventEntity.parentCredentialHash = args.parentCredentialHash
|
|
113
|
+
activityEventEntity.diagnosticData = JSON.stringify(args.diagnosticData)
|
|
114
|
+
|
|
115
|
+
return activityEventEntity
|
|
116
|
+
}
|
|
@@ -1,8 +1,27 @@
|
|
|
1
|
+
import { replaceNullWithUndefined } from '../FormattingUtils'
|
|
2
|
+
import { isEmptyString } from '../../entities/validators'
|
|
1
3
|
import { CredentialBrandingEntity } from '../../entities/issuanceBranding/CredentialBrandingEntity'
|
|
2
4
|
import { BaseLocaleBrandingEntity } from '../../entities/issuanceBranding/BaseLocaleBrandingEntity'
|
|
3
5
|
import { IssuerBrandingEntity } from '../../entities/issuanceBranding/IssuerBrandingEntity'
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
+
import { ImageAttributesEntity } from '../../entities/issuanceBranding/ImageAttributesEntity'
|
|
7
|
+
import { BackgroundAttributesEntity } from '../../entities/issuanceBranding/BackgroundAttributesEntity'
|
|
8
|
+
import { TextAttributesEntity } from '../../entities/issuanceBranding/TextAttributesEntity'
|
|
9
|
+
import { IssuerLocaleBrandingEntity } from '../../entities/issuanceBranding/IssuerLocaleBrandingEntity'
|
|
10
|
+
import { CredentialLocaleBrandingEntity } from '../../entities/issuanceBranding/CredentialLocaleBrandingEntity'
|
|
11
|
+
import { ImageDimensionsEntity } from '../../entities/issuanceBranding/ImageDimensionsEntity'
|
|
12
|
+
import {
|
|
13
|
+
IBasicBackgroundAttributes,
|
|
14
|
+
IBasicCredentialBranding,
|
|
15
|
+
IBasicCredentialLocaleBranding,
|
|
16
|
+
IBasicImageAttributes,
|
|
17
|
+
IBasicImageDimensions,
|
|
18
|
+
IBasicIssuerBranding,
|
|
19
|
+
IBasicIssuerLocaleBranding,
|
|
20
|
+
IBasicTextAttributes,
|
|
21
|
+
ICredentialBranding,
|
|
22
|
+
IIssuerBranding,
|
|
23
|
+
ILocaleBranding
|
|
24
|
+
} from '../../types'
|
|
6
25
|
|
|
7
26
|
export const credentialBrandingFrom = (credentialBranding: CredentialBrandingEntity): ICredentialBranding => {
|
|
8
27
|
const result: ICredentialBranding = {
|
|
@@ -30,3 +49,87 @@ export const localeBrandingFrom = (localeBranding: BaseLocaleBrandingEntity): IL
|
|
|
30
49
|
|
|
31
50
|
return replaceNullWithUndefined(result)
|
|
32
51
|
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
export const issuerLocaleBrandingEntityFrom = (args: IBasicIssuerLocaleBranding): IssuerLocaleBrandingEntity => {
|
|
55
|
+
const issuerLocaleBrandingEntity: IssuerLocaleBrandingEntity = new IssuerLocaleBrandingEntity()
|
|
56
|
+
issuerLocaleBrandingEntity.alias = isEmptyString(args.alias) ? undefined : args.alias
|
|
57
|
+
issuerLocaleBrandingEntity.locale = args.locale ? args.locale : ''
|
|
58
|
+
issuerLocaleBrandingEntity.logo = args.logo ? imageAttributesEntityFrom(args.logo) : undefined
|
|
59
|
+
issuerLocaleBrandingEntity.description = isEmptyString(args.description) ? undefined : args.description
|
|
60
|
+
issuerLocaleBrandingEntity.background = args.background ? backgroundAttributesEntityFrom(args.background) : undefined
|
|
61
|
+
issuerLocaleBrandingEntity.text = args.text ? textAttributesEntityFrom(args.text) : undefined
|
|
62
|
+
issuerLocaleBrandingEntity.clientUri = isEmptyString(args.clientUri) ? undefined : args.clientUri
|
|
63
|
+
issuerLocaleBrandingEntity.tosUri = isEmptyString(args.tosUri) ? undefined : args.tosUri
|
|
64
|
+
issuerLocaleBrandingEntity.policyUri = isEmptyString(args.policyUri) ? undefined : args.policyUri
|
|
65
|
+
issuerLocaleBrandingEntity.contacts = args.contacts
|
|
66
|
+
|
|
67
|
+
return issuerLocaleBrandingEntity
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const backgroundAttributesEntityFrom = (args: IBasicBackgroundAttributes): BackgroundAttributesEntity => {
|
|
71
|
+
const backgroundAttributesEntity: BackgroundAttributesEntity = new BackgroundAttributesEntity()
|
|
72
|
+
backgroundAttributesEntity.color = isEmptyString(args.color) ? undefined : args.color
|
|
73
|
+
backgroundAttributesEntity.image = args.image ? imageAttributesEntityFrom(args.image) : undefined
|
|
74
|
+
|
|
75
|
+
return backgroundAttributesEntity
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export const credentialBrandingEntityFrom = (args: IBasicCredentialBranding): CredentialBrandingEntity => {
|
|
79
|
+
const credentialBrandingEntity: CredentialBrandingEntity = new CredentialBrandingEntity()
|
|
80
|
+
credentialBrandingEntity.issuerCorrelationId = args.issuerCorrelationId
|
|
81
|
+
credentialBrandingEntity.vcHash = args.vcHash
|
|
82
|
+
credentialBrandingEntity.localeBranding = args.localeBranding.map((localeBranding: IBasicCredentialLocaleBranding) =>
|
|
83
|
+
credentialLocaleBrandingEntityFrom(localeBranding),
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
return credentialBrandingEntity
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export const credentialLocaleBrandingEntityFrom = (args: IBasicCredentialLocaleBranding): CredentialLocaleBrandingEntity => {
|
|
90
|
+
const credentialLocaleBrandingEntity: CredentialLocaleBrandingEntity = new CredentialLocaleBrandingEntity()
|
|
91
|
+
credentialLocaleBrandingEntity.alias = isEmptyString(args.alias) ? undefined : args.alias
|
|
92
|
+
credentialLocaleBrandingEntity.locale = args.locale ? args.locale : ''
|
|
93
|
+
credentialLocaleBrandingEntity.logo = args.logo ? imageAttributesEntityFrom(args.logo) : undefined
|
|
94
|
+
credentialLocaleBrandingEntity.description = isEmptyString(args.description) ? undefined : args.description
|
|
95
|
+
credentialLocaleBrandingEntity.background = args.background ? backgroundAttributesEntityFrom(args.background) : undefined
|
|
96
|
+
credentialLocaleBrandingEntity.text = args.text ? textAttributesEntityFrom(args.text) : undefined
|
|
97
|
+
|
|
98
|
+
return credentialLocaleBrandingEntity
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export const imageAttributesEntityFrom = (args: IBasicImageAttributes): ImageAttributesEntity => {
|
|
102
|
+
const imageAttributesEntity: ImageAttributesEntity = new ImageAttributesEntity()
|
|
103
|
+
imageAttributesEntity.uri = isEmptyString(args.uri) ? undefined : args.uri
|
|
104
|
+
imageAttributesEntity.dataUri = isEmptyString(args.dataUri) ? undefined : args.dataUri
|
|
105
|
+
imageAttributesEntity.mediaType = isEmptyString(args.mediaType) ? undefined : args.mediaType
|
|
106
|
+
imageAttributesEntity.alt = isEmptyString(args.alt) ? undefined : args.alt
|
|
107
|
+
imageAttributesEntity.dimensions = args.dimensions ? imageDimensionsEntityFrom(args.dimensions) : undefined
|
|
108
|
+
|
|
109
|
+
return imageAttributesEntity
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export const imageDimensionsEntityFrom = (args: IBasicImageDimensions): ImageDimensionsEntity => {
|
|
113
|
+
const imageDimensionsEntity: ImageDimensionsEntity = new ImageDimensionsEntity()
|
|
114
|
+
imageDimensionsEntity.width = args.width
|
|
115
|
+
imageDimensionsEntity.height = args.height
|
|
116
|
+
|
|
117
|
+
return imageDimensionsEntity
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export const issuerBrandingEntityFrom = (args: IBasicIssuerBranding): IssuerBrandingEntity => {
|
|
121
|
+
const issuerBrandingEntity: IssuerBrandingEntity = new IssuerBrandingEntity()
|
|
122
|
+
issuerBrandingEntity.issuerCorrelationId = args.issuerCorrelationId
|
|
123
|
+
issuerBrandingEntity.localeBranding = args.localeBranding.map((localeBranding: IBasicIssuerLocaleBranding) =>
|
|
124
|
+
issuerLocaleBrandingEntityFrom(localeBranding),
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
return issuerBrandingEntity
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export const textAttributesEntityFrom = (args: IBasicTextAttributes): TextAttributesEntity => {
|
|
131
|
+
const textAttributesEntity: TextAttributesEntity = new TextAttributesEntity()
|
|
132
|
+
textAttributesEntity.color = isEmptyString(args.color) ? undefined : args.color
|
|
133
|
+
|
|
134
|
+
return textAttributesEntity
|
|
135
|
+
}
|