@sphereon/ssi-sdk.data-store 0.28.1-next.5 → 0.28.1-next.51
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/digitalCredential/AbstractDigitalCredentialStore.d.ts +4 -4
- package/dist/digitalCredential/AbstractDigitalCredentialStore.d.ts.map +1 -1
- package/dist/digitalCredential/DigitalCredentialStore.d.ts +4 -4
- package/dist/digitalCredential/DigitalCredentialStore.d.ts.map +1 -1
- package/dist/digitalCredential/DigitalCredentialStore.js +6 -6
- package/dist/digitalCredential/DigitalCredentialStore.js.map +1 -1
- package/dist/entities/contact/ConnectionEntity.js +2 -2
- package/dist/entities/contact/ConnectionEntity.js.map +1 -1
- package/dist/entities/contact/ContactMetadataItemEntity.js +5 -5
- package/dist/entities/contact/ContactMetadataItemEntity.js.map +1 -1
- package/dist/entities/contact/CorrelationIdentifierEntity.js +2 -2
- package/dist/entities/contact/CorrelationIdentifierEntity.js.map +1 -1
- package/dist/entities/contact/DidAuthConfigEntity.js +5 -5
- package/dist/entities/contact/DidAuthConfigEntity.js.map +1 -1
- package/dist/entities/contact/ElectronicAddressEntity.js +5 -5
- package/dist/entities/contact/ElectronicAddressEntity.js.map +1 -1
- package/dist/entities/contact/IdentityEntity.js +4 -4
- package/dist/entities/contact/IdentityEntity.js.map +1 -1
- package/dist/entities/contact/IdentityMetadataItemEntity.js +5 -5
- package/dist/entities/contact/IdentityMetadataItemEntity.js.map +1 -1
- package/dist/entities/contact/NaturalPersonEntity.js +6 -6
- package/dist/entities/contact/NaturalPersonEntity.js.map +1 -1
- package/dist/entities/contact/OpenIdConfigEntity.js +5 -5
- package/dist/entities/contact/OpenIdConfigEntity.js.map +1 -1
- package/dist/entities/contact/OrganizationEntity.js +4 -4
- package/dist/entities/contact/OrganizationEntity.js.map +1 -1
- package/dist/entities/contact/PartyEntity.js +3 -3
- package/dist/entities/contact/PartyEntity.js.map +1 -1
- package/dist/entities/contact/PartyRelationshipEntity.js +4 -4
- package/dist/entities/contact/PartyRelationshipEntity.js.map +1 -1
- package/dist/entities/contact/PartyTypeEntity.js +3 -3
- package/dist/entities/contact/PartyTypeEntity.js.map +1 -1
- package/dist/entities/contact/PhysicalAddressEntity.js +11 -11
- package/dist/entities/contact/PhysicalAddressEntity.js.map +1 -1
- package/dist/entities/digitalCredential/DigitalCredentialEntity.d.ts +3 -0
- package/dist/entities/digitalCredential/DigitalCredentialEntity.d.ts.map +1 -1
- package/dist/entities/digitalCredential/DigitalCredentialEntity.js +9 -0
- package/dist/entities/digitalCredential/DigitalCredentialEntity.js.map +1 -1
- package/dist/entities/eventLogger/AuditEventEntity.js +9 -9
- package/dist/entities/eventLogger/AuditEventEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.js +1 -1
- package/dist/entities/issuanceBranding/BackgroundAttributesEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/BaseLocaleBrandingEntity.js +3 -3
- package/dist/entities/issuanceBranding/BaseLocaleBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.js +2 -2
- package/dist/entities/issuanceBranding/CredentialBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.js +1 -1
- package/dist/entities/issuanceBranding/CredentialLocaleBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/ImageAttributesEntity.js +4 -4
- package/dist/entities/issuanceBranding/ImageAttributesEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.js +2 -2
- package/dist/entities/issuanceBranding/ImageDimensionsEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.js +1 -1
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.js +1 -1
- package/dist/entities/issuanceBranding/IssuerLocaleBrandingEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/TextAttributesEntity.js +1 -1
- package/dist/entities/issuanceBranding/TextAttributesEntity.js.map +1 -1
- package/dist/entities/machineState/MachineStateInfoEntity.js +4 -4
- package/dist/entities/machineState/MachineStateInfoEntity.js.map +1 -1
- package/dist/entities/presentationDefinition/PresentationDefinitionItemEntity.js +5 -5
- package/dist/entities/presentationDefinition/PresentationDefinitionItemEntity.js.map +1 -1
- package/dist/entities/statusList2021/StatusList2021Entity.js +1 -1
- package/dist/entities/statusList2021/StatusList2021Entity.js.map +1 -1
- package/dist/entities/statusList2021/StatusList2021EntryEntity.js +5 -5
- package/dist/entities/statusList2021/StatusList2021EntryEntity.js.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/migrations/postgres/1708525189001-CreateDigitalCredential.d.ts.map +1 -1
- package/dist/migrations/postgres/1708525189001-CreateDigitalCredential.js +4 -0
- package/dist/migrations/postgres/1708525189001-CreateDigitalCredential.js.map +1 -1
- package/dist/migrations/sqlite/1708525189002-CreateDigitalCredential.d.ts.map +1 -1
- package/dist/migrations/sqlite/1708525189002-CreateDigitalCredential.js +2 -0
- package/dist/migrations/sqlite/1708525189002-CreateDigitalCredential.js.map +1 -1
- package/dist/types/contact/contact.d.ts +1 -5
- package/dist/types/contact/contact.d.ts.map +1 -1
- package/dist/types/contact/contact.js +1 -7
- package/dist/types/contact/contact.js.map +1 -1
- package/dist/types/digitalCredential/IAbstractDigitalCredentialStore.d.ts +2 -1
- package/dist/types/digitalCredential/IAbstractDigitalCredentialStore.d.ts.map +1 -1
- package/dist/types/digitalCredential/digitalCredential.d.ts +7 -0
- package/dist/types/digitalCredential/digitalCredential.d.ts.map +1 -1
- package/dist/types/digitalCredential/digitalCredential.js +7 -1
- package/dist/types/digitalCredential/digitalCredential.js.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/dist/utils/digitalCredential/MappingUtils.d.ts.map +1 -1
- package/dist/utils/digitalCredential/MappingUtils.js +1 -1
- package/dist/utils/digitalCredential/MappingUtils.js.map +1 -1
- package/package.json +6 -6
- package/src/__tests__/digitalCredential.entities.test.ts +7 -1
- package/src/__tests__/digitalCredential.store.test.ts +14 -2
- package/src/digitalCredential/AbstractDigitalCredentialStore.ts +4 -4
- package/src/digitalCredential/DigitalCredentialStore.ts +14 -10
- package/src/entities/contact/ConnectionEntity.ts +2 -2
- package/src/entities/contact/ContactMetadataItemEntity.ts +5 -5
- package/src/entities/contact/CorrelationIdentifierEntity.ts +2 -2
- package/src/entities/contact/DidAuthConfigEntity.ts +5 -5
- package/src/entities/contact/ElectronicAddressEntity.ts +5 -5
- package/src/entities/contact/IdentityEntity.ts +4 -4
- package/src/entities/contact/IdentityMetadataItemEntity.ts +5 -5
- package/src/entities/contact/NaturalPersonEntity.ts +6 -6
- package/src/entities/contact/OpenIdConfigEntity.ts +5 -5
- package/src/entities/contact/OrganizationEntity.ts +4 -4
- package/src/entities/contact/PartyEntity.ts +3 -3
- package/src/entities/contact/PartyRelationshipEntity.ts +4 -4
- package/src/entities/contact/PartyTypeEntity.ts +3 -3
- package/src/entities/contact/PhysicalAddressEntity.ts +11 -11
- package/src/entities/digitalCredential/DigitalCredentialEntity.ts +7 -0
- package/src/entities/eventLogger/AuditEventEntity.ts +9 -9
- package/src/entities/issuanceBranding/BackgroundAttributesEntity.ts +1 -1
- package/src/entities/issuanceBranding/BaseLocaleBrandingEntity.ts +3 -3
- package/src/entities/issuanceBranding/CredentialBrandingEntity.ts +2 -2
- package/src/entities/issuanceBranding/CredentialLocaleBrandingEntity.ts +1 -1
- package/src/entities/issuanceBranding/ImageAttributesEntity.ts +4 -4
- package/src/entities/issuanceBranding/ImageDimensionsEntity.ts +2 -2
- package/src/entities/issuanceBranding/IssuerBrandingEntity.ts +1 -1
- package/src/entities/issuanceBranding/IssuerLocaleBrandingEntity.ts +1 -1
- package/src/entities/issuanceBranding/TextAttributesEntity.ts +1 -1
- package/src/entities/machineState/MachineStateInfoEntity.ts +4 -4
- package/src/entities/presentationDefinition/PresentationDefinitionItemEntity.ts +5 -5
- package/src/entities/statusList2021/StatusList2021Entity.ts +1 -1
- package/src/entities/statusList2021/StatusList2021EntryEntity.ts +5 -5
- package/src/index.ts +4 -0
- package/src/migrations/postgres/1708525189001-CreateDigitalCredential.ts +4 -0
- package/src/migrations/sqlite/1708525189002-CreateDigitalCredential.ts +2 -0
- package/src/types/contact/contact.ts +1 -6
- package/src/types/digitalCredential/IAbstractDigitalCredentialStore.ts +2 -1
- package/src/types/digitalCredential/digitalCredential.ts +8 -0
- package/src/types/index.ts +2 -0
- package/src/utils/digitalCredential/MappingUtils.ts +1 -0
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
CredentialStateType,
|
|
6
6
|
DocumentType,
|
|
7
7
|
} from '../../types/digitalCredential/digitalCredential'
|
|
8
|
+
import { CredentialRole } from '../../types'
|
|
8
9
|
|
|
9
10
|
@Entity('DigitalCredential')
|
|
10
11
|
export class DigitalCredentialEntity extends BaseEntity {
|
|
@@ -17,12 +18,18 @@ export class DigitalCredentialEntity extends BaseEntity {
|
|
|
17
18
|
@Column('simple-enum', { name: 'document_format', enum: CredentialDocumentFormat, nullable: false })
|
|
18
19
|
documentFormat!: CredentialDocumentFormat
|
|
19
20
|
|
|
21
|
+
@Column('simple-enum', { name: 'credential_role', enum: CredentialRole, nullable: false })
|
|
22
|
+
credentialRole!: CredentialRole
|
|
23
|
+
|
|
20
24
|
@Column('text', { name: 'raw_document', nullable: false })
|
|
21
25
|
rawDocument!: string
|
|
22
26
|
|
|
23
27
|
@Column('text', { name: 'uniform_document', nullable: false })
|
|
24
28
|
uniformDocument!: string
|
|
25
29
|
|
|
30
|
+
@Column('text', { name: 'credential_id', nullable: true, unique: false })
|
|
31
|
+
credentialId!: string
|
|
32
|
+
|
|
26
33
|
@Column('text', { name: 'hash', nullable: false, unique: true })
|
|
27
34
|
hash!: string
|
|
28
35
|
|
|
@@ -14,7 +14,7 @@ export class AuditEventEntity extends BaseEntity {
|
|
|
14
14
|
@Column('simple-enum', { name: 'level', enum: LogLevel, nullable: false, unique: false })
|
|
15
15
|
level!: LogLevel
|
|
16
16
|
|
|
17
|
-
@Column({ name: 'correlationId', nullable: false, unique: false })
|
|
17
|
+
@Column('text', { name: 'correlationId', nullable: false, unique: false })
|
|
18
18
|
correlationId!: string
|
|
19
19
|
|
|
20
20
|
@Column('simple-enum', { name: 'system', enum: System, nullable: false, unique: false })
|
|
@@ -26,7 +26,7 @@ export class AuditEventEntity extends BaseEntity {
|
|
|
26
26
|
@Column('simple-enum', { name: 'actionType', enum: ActionType, nullable: false, unique: false })
|
|
27
27
|
actionType!: ActionType
|
|
28
28
|
|
|
29
|
-
@Column({ name: 'actionSubType', nullable: false, unique: false })
|
|
29
|
+
@Column({ name: 'actionSubType', type: 'varchar', nullable: false, unique: false })
|
|
30
30
|
actionSubType!: ActionSubType
|
|
31
31
|
|
|
32
32
|
@Column('simple-enum', { name: 'initiatorType', enum: InitiatorType, nullable: false, unique: false })
|
|
@@ -35,28 +35,28 @@ export class AuditEventEntity extends BaseEntity {
|
|
|
35
35
|
@Column('simple-enum', { name: 'systemCorrelationIdType', enum: SystemCorrelationIdType, nullable: true, unique: false })
|
|
36
36
|
systemCorrelationIdType?: SystemCorrelationIdType
|
|
37
37
|
|
|
38
|
-
@Column({ name: 'systemCorrelationId', nullable: true, unique: false })
|
|
38
|
+
@Column('text', { name: 'systemCorrelationId', nullable: true, unique: false })
|
|
39
39
|
systemCorrelationId?: string
|
|
40
40
|
|
|
41
|
-
@Column({ name: 'systemAlias', nullable: true, unique: false })
|
|
41
|
+
@Column('text', { name: 'systemAlias', nullable: true, unique: false })
|
|
42
42
|
systemAlias?: string
|
|
43
43
|
|
|
44
44
|
@Column('simple-enum', { name: 'partyCorrelationType', enum: PartyCorrelationType, nullable: true, unique: false })
|
|
45
45
|
partyCorrelationType?: PartyCorrelationType
|
|
46
46
|
|
|
47
|
-
@Column({ name: 'partyCorrelationId', nullable: true, unique: false })
|
|
47
|
+
@Column('text', { name: 'partyCorrelationId', nullable: true, unique: false })
|
|
48
48
|
partyCorrelationId?: string
|
|
49
49
|
|
|
50
|
-
@Column({ name: 'partyAlias', nullable: true, unique: false })
|
|
50
|
+
@Column('text', { name: 'partyAlias', nullable: true, unique: false })
|
|
51
51
|
partyAlias?: string
|
|
52
52
|
|
|
53
|
-
@Column({ name: 'description', nullable: false, unique: false })
|
|
53
|
+
@Column('text', { name: 'description', nullable: false, unique: false })
|
|
54
54
|
description!: string
|
|
55
55
|
|
|
56
|
-
@Column({ name: 'data', nullable: true, unique: false })
|
|
56
|
+
@Column('text', { name: 'data', nullable: true, unique: false })
|
|
57
57
|
data?: string
|
|
58
58
|
|
|
59
|
-
@Column({ name: 'diagnosticData', nullable: true, unique: false })
|
|
59
|
+
@Column('text', { name: 'diagnosticData', nullable: true, unique: false })
|
|
60
60
|
diagnosticData?: string
|
|
61
61
|
|
|
62
62
|
@CreateDateColumn({ name: 'created_at', nullable: false })
|
|
@@ -9,7 +9,7 @@ export class BackgroundAttributesEntity extends BaseEntity {
|
|
|
9
9
|
@PrimaryGeneratedColumn('uuid')
|
|
10
10
|
id!: string
|
|
11
11
|
|
|
12
|
-
@Column({ name: 'color', length: 255, nullable: true, unique: false })
|
|
12
|
+
@Column('varchar', { name: 'color', length: 255, nullable: true, unique: false })
|
|
13
13
|
@Validate(IsNonEmptyStringConstraint, { message: 'Blank background colors are not allowed' })
|
|
14
14
|
color?: string
|
|
15
15
|
|
|
@@ -23,11 +23,11 @@ export class BaseLocaleBrandingEntity extends BaseEntity {
|
|
|
23
23
|
@PrimaryGeneratedColumn('uuid')
|
|
24
24
|
id!: string
|
|
25
25
|
|
|
26
|
-
@Column({ name: 'alias', length: 255, nullable: true, unique: false })
|
|
26
|
+
@Column('varchar', { name: 'alias', length: 255, nullable: true, unique: false })
|
|
27
27
|
@Validate(IsNonEmptyStringConstraint, { message: 'Blank aliases are not allowed' })
|
|
28
28
|
alias?: string
|
|
29
29
|
|
|
30
|
-
@Column({ name: 'locale', length: 255, nullable: false, unique: false })
|
|
30
|
+
@Column('varchar', { name: 'locale', length: 255, nullable: false, unique: false })
|
|
31
31
|
locale?: string
|
|
32
32
|
|
|
33
33
|
@OneToOne(() => ImageAttributesEntity, {
|
|
@@ -39,7 +39,7 @@ export class BaseLocaleBrandingEntity extends BaseEntity {
|
|
|
39
39
|
@JoinColumn({ name: 'logoId' })
|
|
40
40
|
logo?: ImageAttributesEntity
|
|
41
41
|
|
|
42
|
-
@Column({ name: 'description', length: 255, nullable: true, unique: false })
|
|
42
|
+
@Column('varchar', { name: 'description', length: 255, nullable: true, unique: false })
|
|
43
43
|
@Validate(IsNonEmptyStringConstraint, { message: 'Blank descriptions are not allowed' })
|
|
44
44
|
description?: string
|
|
45
45
|
|
|
@@ -21,11 +21,11 @@ export class CredentialBrandingEntity extends BaseEntity {
|
|
|
21
21
|
@PrimaryGeneratedColumn('uuid')
|
|
22
22
|
id!: string
|
|
23
23
|
|
|
24
|
-
@Column({ name: 'vcHash', length: 255, nullable: false, unique: true })
|
|
24
|
+
@Column('varchar', { name: 'vcHash', length: 255, nullable: false, unique: true })
|
|
25
25
|
@IsNotEmpty({ message: 'Blank vcHashes are not allowed' })
|
|
26
26
|
vcHash!: string
|
|
27
27
|
|
|
28
|
-
@Column({ name: 'issuerCorrelationId', length: 255, nullable: false, unique: false })
|
|
28
|
+
@Column('varchar', { name: 'issuerCorrelationId', length: 255, nullable: false, unique: false })
|
|
29
29
|
@IsNotEmpty({ message: 'Blank issuerCorrelationIds are not allowed' })
|
|
30
30
|
issuerCorrelationId!: string
|
|
31
31
|
|
|
@@ -16,7 +16,7 @@ export class CredentialLocaleBrandingEntity extends BaseLocaleBrandingEntity {
|
|
|
16
16
|
@JoinColumn({ name: 'credentialBrandingId' })
|
|
17
17
|
credentialBranding!: CredentialBrandingEntity
|
|
18
18
|
|
|
19
|
-
@Column({ name: 'credentialBrandingId', nullable: false })
|
|
19
|
+
@Column('text', { name: 'credentialBrandingId', nullable: false })
|
|
20
20
|
credentialBrandingId!: string
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -9,19 +9,19 @@ export class ImageAttributesEntity extends BaseEntity {
|
|
|
9
9
|
@PrimaryGeneratedColumn('uuid')
|
|
10
10
|
id!: string
|
|
11
11
|
|
|
12
|
-
@Column({ name: 'uri', nullable: true, unique: false })
|
|
12
|
+
@Column('text', { name: 'uri', nullable: true, unique: false })
|
|
13
13
|
@Validate(IsNonEmptyStringConstraint, { message: 'Blank image uri are not allowed' })
|
|
14
14
|
uri?: string
|
|
15
15
|
|
|
16
|
-
@Column({ name: 'dataUri', nullable: true, unique: false })
|
|
16
|
+
@Column('text', { name: 'dataUri', nullable: true, unique: false })
|
|
17
17
|
@Validate(IsNonEmptyStringConstraint, { message: 'Blank image data uri are not allowed' })
|
|
18
18
|
dataUri?: string
|
|
19
19
|
|
|
20
|
-
@Column({ name: 'mediaType', length: 255, nullable: true, unique: false })
|
|
20
|
+
@Column('varchar', { name: 'mediaType', length: 255, nullable: true, unique: false })
|
|
21
21
|
@Validate(IsNonEmptyStringConstraint, { message: 'Blank image types are not allowed' })
|
|
22
22
|
mediaType?: string
|
|
23
23
|
|
|
24
|
-
@Column({ name: 'alt', length: 255, nullable: true, unique: false })
|
|
24
|
+
@Column('varchar', { name: 'alt', length: 255, nullable: true, unique: false })
|
|
25
25
|
@Validate(IsNonEmptyStringConstraint, { message: 'Blank image alts are not allowed' })
|
|
26
26
|
alt?: string
|
|
27
27
|
|
|
@@ -6,10 +6,10 @@ export class ImageDimensionsEntity extends BaseEntity {
|
|
|
6
6
|
@PrimaryGeneratedColumn('uuid')
|
|
7
7
|
id!: string
|
|
8
8
|
|
|
9
|
-
@Column({ name: 'width', nullable: false, unique: false })
|
|
9
|
+
@Column('integer', { name: 'width', nullable: false, unique: false })
|
|
10
10
|
width!: number
|
|
11
11
|
|
|
12
|
-
@Column({ name: 'height', nullable: false, unique: false })
|
|
12
|
+
@Column('integer', { name: 'height', nullable: false, unique: false })
|
|
13
13
|
height!: number
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -20,7 +20,7 @@ export class IssuerBrandingEntity extends BaseEntity {
|
|
|
20
20
|
@PrimaryGeneratedColumn('uuid')
|
|
21
21
|
id!: string
|
|
22
22
|
|
|
23
|
-
@Column({ name: 'issuerCorrelationId', length: 255, nullable: false, unique: true })
|
|
23
|
+
@Column('varchar', { name: 'issuerCorrelationId', length: 255, nullable: false, unique: true })
|
|
24
24
|
@IsNotEmpty({ message: 'Blank issuerCorrelationIds are not allowed' })
|
|
25
25
|
issuerCorrelationId!: string
|
|
26
26
|
|
|
@@ -16,7 +16,7 @@ export class IssuerLocaleBrandingEntity extends BaseLocaleBrandingEntity {
|
|
|
16
16
|
@JoinColumn({ name: 'issuerBrandingId' })
|
|
17
17
|
issuerBranding!: IssuerBrandingEntity
|
|
18
18
|
|
|
19
|
-
@Column({ name: 'issuerBrandingId', nullable: false })
|
|
19
|
+
@Column('text', { name: 'issuerBrandingId', nullable: false })
|
|
20
20
|
issuerBrandingId!: string
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -8,7 +8,7 @@ export class TextAttributesEntity extends BaseEntity {
|
|
|
8
8
|
@PrimaryGeneratedColumn('uuid')
|
|
9
9
|
id!: string
|
|
10
10
|
|
|
11
|
-
@Column({ name: 'color', length: 255, nullable: true, unique: false })
|
|
11
|
+
@Column('varchar', { name: 'color', length: 255, nullable: true, unique: false })
|
|
12
12
|
@Validate(IsNonEmptyStringConstraint, { message: 'Blank text colors are not allowed' })
|
|
13
13
|
color?: string
|
|
14
14
|
|
|
@@ -38,19 +38,19 @@ export class MachineStateInfoEntity extends BaseEntity {
|
|
|
38
38
|
@Column({ name: 'state', type: 'text', nullable: false })
|
|
39
39
|
state!: string
|
|
40
40
|
|
|
41
|
-
@CreateDateColumn({ name: 'created_at',
|
|
41
|
+
@CreateDateColumn({ name: 'created_at', nullable: false })
|
|
42
42
|
createdAt!: Date
|
|
43
43
|
|
|
44
|
-
@UpdateDateColumn({ name: 'updated_at',
|
|
44
|
+
@UpdateDateColumn({ name: 'updated_at', nullable: false })
|
|
45
45
|
updatedAt!: Date
|
|
46
46
|
|
|
47
47
|
@Column({ name: 'updated_count', type: 'integer', nullable: false })
|
|
48
48
|
updatedCount!: number
|
|
49
49
|
|
|
50
|
-
@Column({ name: 'expires_at',
|
|
50
|
+
@Column({ name: 'expires_at', nullable: true })
|
|
51
51
|
expiresAt?: Date
|
|
52
52
|
|
|
53
|
-
@Column({ name: 'completed_at',
|
|
53
|
+
@Column({ name: 'completed_at', nullable: true })
|
|
54
54
|
completedAt?: Date
|
|
55
55
|
|
|
56
56
|
@Column({ name: 'tenant_id', type: 'varchar', nullable: true })
|
|
@@ -7,21 +7,21 @@ export class PresentationDefinitionItemEntity extends BaseEntity {
|
|
|
7
7
|
@PrimaryGeneratedColumn('uuid')
|
|
8
8
|
id!: string
|
|
9
9
|
|
|
10
|
-
@Column({ name: 'definition_id', length: 255, nullable: false, unique: false })
|
|
10
|
+
@Column({ name: 'definition_id', length: 255, type: 'varchar', nullable: false, unique: false })
|
|
11
11
|
@IsNotEmpty({ message: 'A blank definition id field is not allowed' })
|
|
12
12
|
definitionId!: string
|
|
13
13
|
|
|
14
|
-
@Column({ name: 'version', length: 255, nullable: false, unique: false })
|
|
14
|
+
@Column({ name: 'version', length: 255, type: 'varchar', nullable: false, unique: false })
|
|
15
15
|
@IsNotEmpty({ message: 'A blank version field is not allowed' })
|
|
16
16
|
version!: string
|
|
17
17
|
|
|
18
|
-
@Column({ name: 'tenant_id', length: 255, nullable: true, unique: false })
|
|
18
|
+
@Column({ name: 'tenant_id', length: 255, type: 'varchar', nullable: true, unique: false })
|
|
19
19
|
tenantId?: string
|
|
20
20
|
|
|
21
|
-
@Column({ name: 'purpose', length: 255, nullable: true, unique: false })
|
|
21
|
+
@Column({ name: 'purpose', length: 255, type: 'varchar', nullable: true, unique: false })
|
|
22
22
|
purpose?: string
|
|
23
23
|
|
|
24
|
-
@Column({ name: 'name', length: 255, nullable: true, unique: false })
|
|
24
|
+
@Column({ name: 'name', length: 255, type: 'varchar', nullable: true, unique: false })
|
|
25
25
|
name?: string
|
|
26
26
|
|
|
27
27
|
@Column({ name: 'definition_payload', type: 'text', nullable: false, unique: false })
|
|
@@ -21,7 +21,7 @@ export class StatusListEntity extends BaseEntity {
|
|
|
21
21
|
@Column({ name: 'correlationId', type: 'varchar', nullable: false })
|
|
22
22
|
correlationId!: string
|
|
23
23
|
|
|
24
|
-
@Column({ name: 'length', nullable: false, unique: false })
|
|
24
|
+
@Column({ name: 'length', type: 'integer', nullable: false, unique: false })
|
|
25
25
|
length!: number
|
|
26
26
|
|
|
27
27
|
@Column({
|
|
@@ -11,19 +11,19 @@ export class StatusListEntryEntity extends BaseEntity {
|
|
|
11
11
|
@ManyToOne(() => StatusListEntity, (statusList) => statusList.statusListEntries)
|
|
12
12
|
statusList!: StatusListEntity
|
|
13
13
|
|
|
14
|
-
@PrimaryColumn({ name: 'statusListIndex', nullable: false, unique: false })
|
|
14
|
+
@PrimaryColumn({ name: 'statusListIndex', type: 'integer', nullable: false, unique: false })
|
|
15
15
|
@Validate(IsNonEmptyStringConstraint, { message: 'Status list index is required' })
|
|
16
16
|
statusListIndex!: number
|
|
17
17
|
|
|
18
|
-
@Column({ name: 'credentialId', nullable: true })
|
|
18
|
+
@Column({ name: 'credentialId', type: 'text', nullable: true })
|
|
19
19
|
credentialId?: string
|
|
20
20
|
|
|
21
|
-
@Column({ name: 'credentialHash', length: 128, nullable: true, unique: false })
|
|
21
|
+
@Column({ name: 'credentialHash', length: 128, type: 'varchar', nullable: true, unique: false })
|
|
22
22
|
credentialHash?: string
|
|
23
23
|
|
|
24
|
-
@Column({ name: 'correlationId', length: 255, nullable: true, unique: false })
|
|
24
|
+
@Column({ name: 'correlationId', length: 255, type: 'varchar', nullable: true, unique: false })
|
|
25
25
|
correlationId?: string
|
|
26
26
|
|
|
27
|
-
@Column({ name: 'value', length: 50, nullable: true, unique: false })
|
|
27
|
+
@Column({ name: 'value', length: 50, type: 'varchar', nullable: true, unique: false })
|
|
28
28
|
value?: string
|
|
29
29
|
}
|
package/src/index.ts
CHANGED
|
@@ -28,6 +28,8 @@ import { ElectronicAddressEntity } from './entities/contact/ElectronicAddressEnt
|
|
|
28
28
|
import { PhysicalAddressEntity } from './entities/contact/PhysicalAddressEntity'
|
|
29
29
|
export { ContactStore } from './contact/ContactStore'
|
|
30
30
|
export { AbstractContactStore } from './contact/AbstractContactStore'
|
|
31
|
+
export { AbstractDigitalCredentialStore } from './digitalCredential/AbstractDigitalCredentialStore'
|
|
32
|
+
export { DigitalCredentialStore } from './digitalCredential/DigitalCredentialStore'
|
|
31
33
|
export { AbstractIssuanceBrandingStore } from './issuanceBranding/AbstractIssuanceBrandingStore'
|
|
32
34
|
export { IssuanceBrandingStore } from './issuanceBranding/IssuanceBrandingStore'
|
|
33
35
|
export { StatusListStore } from './statusList/StatusListStore'
|
|
@@ -48,6 +50,7 @@ export {
|
|
|
48
50
|
DataStoreMigrations,
|
|
49
51
|
DataStoreEventLoggerMigrations,
|
|
50
52
|
DataStoreContactMigrations,
|
|
53
|
+
DataStoreDigitalCredentialMigrations,
|
|
51
54
|
DataStoreIssuanceBrandingMigrations,
|
|
52
55
|
DataStoreStatusListMigrations,
|
|
53
56
|
DataStoreMachineStateMigrations,
|
|
@@ -55,6 +58,7 @@ export {
|
|
|
55
58
|
} from './migrations'
|
|
56
59
|
export * from './types'
|
|
57
60
|
export * from './utils/contact/MappingUtils'
|
|
61
|
+
export * from './utils/digitalCredential/MappingUtils'
|
|
58
62
|
|
|
59
63
|
export const DataStoreContactEntities = [
|
|
60
64
|
BaseConfigEntity,
|
|
@@ -6,6 +6,7 @@ export class CreateDigitalCredential1708525189001 implements MigrationInterface
|
|
|
6
6
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
7
|
await queryRunner.query(`CREATE TYPE "digital_document_type" AS ENUM('VC', 'VP', 'C', 'P')`)
|
|
8
8
|
await queryRunner.query(`CREATE TYPE "digital_credential_document_format" AS ENUM('JSON_LD', 'JWT', 'SD_JWT', 'MDOC')`)
|
|
9
|
+
await queryRunner.query(`CREATE TYPE "digital_credential_credential_role" AS ENUM('ISSUER', 'VERIFIER', 'HOLDER')`)
|
|
9
10
|
await queryRunner.query(`CREATE TYPE "digital_credential_correlation_type" AS ENUM('DID')`)
|
|
10
11
|
await queryRunner.query(`CREATE TYPE "digital_credential_state_type" AS ENUM('REVOKED', 'VERIFIED', 'EXPIRED')`)
|
|
11
12
|
|
|
@@ -14,8 +15,10 @@ export class CreateDigitalCredential1708525189001 implements MigrationInterface
|
|
|
14
15
|
"id" uuid NOT NULL DEFAULT uuid_generate_v4(),
|
|
15
16
|
"document_type" "digital_document_type" NOT NULL,
|
|
16
17
|
"document_format" "digital_credential_document_format" NOT NULL,
|
|
18
|
+
"credential_role" "digital_credential_credential_role" NOT NULL,
|
|
17
19
|
"raw_document" text NOT NULL,
|
|
18
20
|
"uniform_document" text NOT NULL,
|
|
21
|
+
"credential_id" text,
|
|
19
22
|
"hash" text NOT NULL UNIQUE,
|
|
20
23
|
"issuer_correlation_type" "digital_credential_correlation_type" NOT NULL,
|
|
21
24
|
"subject_correlation_type" "digital_credential_correlation_type",
|
|
@@ -39,6 +42,7 @@ export class CreateDigitalCredential1708525189001 implements MigrationInterface
|
|
|
39
42
|
await queryRunner.query(`DROP TYPE "digital_credential_state_type"`)
|
|
40
43
|
await queryRunner.query(`DROP TYPE "digital_credential_correlation_type"`)
|
|
41
44
|
await queryRunner.query(`DROP TYPE "digital_credential_document_format"`)
|
|
45
|
+
await queryRunner.query(`DROP TYPE "digital_credential_credential_role"`)
|
|
42
46
|
await queryRunner.query(`DROP TYPE "digital_document_type"`)
|
|
43
47
|
}
|
|
44
48
|
}
|
|
@@ -9,8 +9,10 @@ export class CreateDigitalCredential1708525189002 implements MigrationInterface
|
|
|
9
9
|
"id" varchar PRIMARY KEY NOT NULL,
|
|
10
10
|
"document_type" varchar CHECK( "document_type" IN ('VC', 'VP', 'C', 'P') ) NOT NULL,
|
|
11
11
|
"document_format" varchar CHECK( "document_format" IN ('JSON_LD', 'JWT', 'SD_JWT', 'MDOC') ) NOT NULL,
|
|
12
|
+
"credential_role" varchar CHECK( "credential_role" IN ('ISSUER', 'VERIFIER', 'HOLDER') ) NOT NULL,
|
|
12
13
|
"raw_document" text NOT NULL,
|
|
13
14
|
"uniform_document" text NOT NULL,
|
|
15
|
+
"credential_id" text,
|
|
14
16
|
"hash" text NOT NULL UNIQUE,
|
|
15
17
|
"issuer_correlation_type" varchar CHECK( "issuer_correlation_type" IN ('DID') ) NOT NULL,
|
|
16
18
|
"subject_correlation_type" varchar CHECK( "subject_correlation_type" IN ('DID') ),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IIdentifierOpts } from '@sphereon/ssi-sdk-ext.did-utils'
|
|
2
2
|
import { IIdentifier } from '@veramo/core'
|
|
3
3
|
import { ILocaleBranding } from '../issuanceBranding/issuanceBranding'
|
|
4
|
+
import { CredentialRole } from '../digitalCredential/digitalCredential'
|
|
4
5
|
|
|
5
6
|
export type MetadataTypes = string | number | Date | boolean | undefined
|
|
6
7
|
|
|
@@ -258,12 +259,6 @@ export type ElectronicAddressType = 'email' | 'phone'
|
|
|
258
259
|
|
|
259
260
|
export type PhysicalAddressType = 'home' | 'visit' | 'postal'
|
|
260
261
|
|
|
261
|
-
export enum CredentialRole {
|
|
262
|
-
ISSUER = 'issuer',
|
|
263
|
-
VERIFIER = 'verifier',
|
|
264
|
-
HOLDER = 'holder',
|
|
265
|
-
}
|
|
266
|
-
|
|
267
262
|
export enum ConnectionType {
|
|
268
263
|
OPENID_CONNECT = 'OIDC',
|
|
269
264
|
SIOPv2 = 'SIOPv2',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CredentialCorrelationType, CredentialStateType, DigitalCredential } from './digitalCredential'
|
|
1
|
+
import { CredentialCorrelationType, CredentialRole, CredentialStateType, DigitalCredential } from './digitalCredential'
|
|
2
2
|
import { Hasher } from '@sphereon/ssi-types'
|
|
3
3
|
import { FindOptionsOrder } from 'typeorm'
|
|
4
4
|
import { DigitalCredentialEntity } from '../../entities/digitalCredential/DigitalCredentialEntity'
|
|
@@ -25,6 +25,7 @@ export type AddCredentialArgs = {
|
|
|
25
25
|
subjectCorrelationType?: CredentialCorrelationType
|
|
26
26
|
issuerCorrelationId: string
|
|
27
27
|
subjectCorrelationId?: string
|
|
28
|
+
credentialRole: CredentialRole
|
|
28
29
|
tenantId?: string
|
|
29
30
|
state?: CredentialStateType
|
|
30
31
|
verifiedAt?: Date
|
|
@@ -4,8 +4,10 @@ export type DigitalCredential = {
|
|
|
4
4
|
id: string
|
|
5
5
|
documentType: DocumentType
|
|
6
6
|
documentFormat: CredentialDocumentFormat
|
|
7
|
+
credentialRole: CredentialRole
|
|
7
8
|
rawDocument: string
|
|
8
9
|
uniformDocument: string
|
|
10
|
+
credentialId?: string
|
|
9
11
|
hash: string
|
|
10
12
|
issuerCorrelationType: CredentialCorrelationType
|
|
11
13
|
subjectCorrelationType?: CredentialCorrelationType
|
|
@@ -39,6 +41,12 @@ export enum CredentialCorrelationType {
|
|
|
39
41
|
DID = 'DID',
|
|
40
42
|
}
|
|
41
43
|
|
|
44
|
+
export enum CredentialRole {
|
|
45
|
+
ISSUER = 'ISSUER',
|
|
46
|
+
VERIFIER = 'VERIFIER',
|
|
47
|
+
HOLDER = 'HOLDER',
|
|
48
|
+
}
|
|
49
|
+
|
|
42
50
|
export enum CredentialStateType {
|
|
43
51
|
REVOKED = 'REVOKED',
|
|
44
52
|
VERIFIED = 'VERIFIED',
|
package/src/types/index.ts
CHANGED
|
@@ -10,3 +10,5 @@ export * from './statusList/IAbstractStatusListStore'
|
|
|
10
10
|
export * from './eventLogger/IAbstractEventLoggerStore'
|
|
11
11
|
export * from './eventLogger/eventLogger'
|
|
12
12
|
export * from './machineState/IAbstractMachineStateStore'
|
|
13
|
+
export * from './digitalCredential/digitalCredential'
|
|
14
|
+
export * from './digitalCredential/IAbstractDigitalCredentialStore'
|
|
@@ -103,6 +103,7 @@ export const nonPersistedDigitalCredentialEntityFromAddArgs = (addCredentialArgs
|
|
|
103
103
|
documentType,
|
|
104
104
|
documentFormat: determineCredentialDocumentFormat(documentFormat),
|
|
105
105
|
createdAt: new Date(),
|
|
106
|
+
credentialId: uniformDocument.id as string | undefined, // uniformDocument.id is being inferred as JsonValue somehow
|
|
106
107
|
hash: computeEntryHash(addCredentialArgs.rawDocument),
|
|
107
108
|
uniformDocument: JSON.stringify(uniformDocument),
|
|
108
109
|
validFrom,
|