@sphereon/ssi-sdk.data-store 0.29.0 → 0.29.1-next.104
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/DigitalCredentialStore.js +1 -1
- package/dist/digitalCredential/DigitalCredentialStore.js.map +1 -1
- package/dist/entities/contact/BaseContactEntity.js +2 -2
- package/dist/entities/contact/BaseContactEntity.js.map +1 -1
- package/dist/entities/contact/ContactMetadataItemEntity.js +1 -1
- package/dist/entities/contact/ContactMetadataItemEntity.js.map +1 -1
- package/dist/entities/contact/ElectronicAddressEntity.js +2 -2
- package/dist/entities/contact/ElectronicAddressEntity.js.map +1 -1
- package/dist/entities/contact/IdentityEntity.js +2 -2
- package/dist/entities/contact/IdentityEntity.js.map +1 -1
- package/dist/entities/contact/IdentityMetadataItemEntity.js +1 -1
- package/dist/entities/contact/IdentityMetadataItemEntity.js.map +1 -1
- package/dist/entities/contact/OrganizationEntity.d.ts.map +1 -1
- package/dist/entities/contact/OrganizationEntity.js.map +1 -1
- package/dist/entities/contact/PartyEntity.js +2 -2
- package/dist/entities/contact/PartyEntity.js.map +1 -1
- package/dist/entities/contact/PartyRelationshipEntity.js +2 -2
- package/dist/entities/contact/PartyRelationshipEntity.js.map +1 -1
- package/dist/entities/contact/PartyTypeEntity.js +2 -2
- package/dist/entities/contact/PartyTypeEntity.js.map +1 -1
- package/dist/entities/contact/PhysicalAddressEntity.js +2 -2
- package/dist/entities/contact/PhysicalAddressEntity.js.map +1 -1
- package/dist/entities/digitalCredential/DigitalCredentialEntity.d.ts +2 -2
- package/dist/entities/digitalCredential/DigitalCredentialEntity.d.ts.map +1 -1
- package/dist/entities/digitalCredential/DigitalCredentialEntity.js +6 -6
- package/dist/entities/digitalCredential/DigitalCredentialEntity.js.map +1 -1
- package/dist/entities/eventLogger/AuditEventEntity.js +3 -3
- package/dist/entities/eventLogger/AuditEventEntity.js.map +1 -1
- package/dist/entities/issuanceBranding/BaseLocaleBrandingEntity.js +2 -2
- 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/IssuerBrandingEntity.js +2 -2
- package/dist/entities/issuanceBranding/IssuerBrandingEntity.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 +2 -2
- package/dist/entities/presentationDefinition/PresentationDefinitionItemEntity.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/1708525189002-CreateDigitalCredential.js +2 -2
- package/dist/statusList/IStatusListStore.d.ts +2 -2
- package/dist/statusList/IStatusListStore.d.ts.map +1 -1
- package/dist/types/contact/contact.d.ts +2 -2
- package/dist/types/contact/contact.d.ts.map +1 -1
- package/dist/types/digitalCredential/digitalCredential.d.ts +7 -1
- package/dist/types/digitalCredential/digitalCredential.d.ts.map +1 -1
- package/dist/types/digitalCredential/digitalCredential.js +36 -0
- package/dist/types/digitalCredential/digitalCredential.js.map +1 -1
- package/dist/utils/contact/MappingUtils.d.ts.map +1 -1
- package/dist/utils/contact/MappingUtils.js +13 -1
- package/dist/utils/contact/MappingUtils.js.map +1 -1
- package/dist/utils/digitalCredential/MappingUtils.d.ts +1 -2
- package/dist/utils/digitalCredential/MappingUtils.d.ts.map +1 -1
- package/dist/utils/digitalCredential/MappingUtils.js +21 -22
- package/dist/utils/digitalCredential/MappingUtils.js.map +1 -1
- package/package.json +7 -6
- package/src/__tests__/contact.entities.test.ts +19 -18
- package/src/__tests__/contact.store.test.ts +1 -1
- package/src/__tests__/digitalCredential.entities.test.ts +1 -1
- package/src/__tests__/digitalCredential.store.test.ts +1 -1
- package/src/__tests__/eventLogger.entities.test.ts +1 -1
- package/src/__tests__/eventLogger.store.test.ts +1 -1
- package/src/__tests__/issuanceBranding.entities.test.ts +1 -1
- package/src/__tests__/issuanceBranding.store.test.ts +1 -1
- package/src/__tests__/machineState.entities.test.ts +1 -1
- package/src/__tests__/machineState.store.test.ts +1 -1
- package/src/__tests__/pd-manager.entities.test.ts +1 -1
- package/src/__tests__/pd-manager.store.test.ts +1 -1
- package/src/digitalCredential/DigitalCredentialStore.ts +1 -1
- package/src/entities/contact/BaseContactEntity.ts +3 -3
- package/src/entities/contact/ContactMetadataItemEntity.ts +2 -2
- package/src/entities/contact/ElectronicAddressEntity.ts +3 -3
- package/src/entities/contact/IdentityEntity.ts +3 -3
- package/src/entities/contact/IdentityMetadataItemEntity.ts +2 -2
- package/src/entities/contact/OrganizationEntity.ts +5 -5
- package/src/entities/contact/PartyEntity.ts +3 -3
- package/src/entities/contact/PartyRelationshipEntity.ts +3 -3
- package/src/entities/contact/PartyTypeEntity.ts +3 -3
- package/src/entities/contact/PhysicalAddressEntity.ts +3 -3
- package/src/entities/digitalCredential/DigitalCredentialEntity.ts +16 -9
- package/src/entities/eventLogger/AuditEventEntity.ts +4 -4
- package/src/entities/issuanceBranding/BaseLocaleBrandingEntity.ts +3 -3
- package/src/entities/issuanceBranding/CredentialBrandingEntity.ts +3 -3
- package/src/entities/issuanceBranding/IssuerBrandingEntity.ts +3 -3
- package/src/entities/machineState/MachineStateInfoEntity.ts +5 -5
- package/src/entities/presentationDefinition/PresentationDefinitionItemEntity.ts +3 -3
- package/src/migrations/postgres/1708525189001-CreateDigitalCredential.ts +1 -1
- package/src/migrations/sqlite/1708525189002-CreateDigitalCredential.ts +2 -2
- package/src/statusList/IStatusListStore.ts +2 -2
- package/src/types/contact/contact.ts +2 -2
- package/src/types/digitalCredential/digitalCredential.ts +32 -0
- package/src/utils/contact/MappingUtils.ts +12 -1
- package/src/utils/digitalCredential/MappingUtils.ts +18 -25
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {DataSources} from
|
|
1
|
+
import { DataSources } from '@sphereon/ssi-sdk.agent-config'
|
|
2
2
|
import { PartyCorrelationType } from '@sphereon/ssi-sdk.core'
|
|
3
3
|
import { ActionType, InitiatorType, LogLevel, SubSystem, System, SystemCorrelationIdType } from '@sphereon/ssi-types'
|
|
4
4
|
import { DataSource } from 'typeorm'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {DataSources} from
|
|
1
|
+
import { DataSources } from '@sphereon/ssi-sdk.agent-config'
|
|
2
2
|
import { ActionType, InitiatorType, LogLevel, SubSystem, System, SystemCorrelationIdType } from '@sphereon/ssi-types'
|
|
3
3
|
import { DataSource } from 'typeorm'
|
|
4
4
|
import { DataStoreEventLoggerMigrations } from '../migrations'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {DataSources} from
|
|
1
|
+
import { DataSources } from '@sphereon/ssi-sdk.agent-config'
|
|
2
2
|
import { DataSource } from 'typeorm'
|
|
3
3
|
import { IssuanceBrandingStore } from '../issuanceBranding/IssuanceBrandingStore'
|
|
4
4
|
import { DataStoreMigrations } from '../migrations'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {DataSources} from
|
|
1
|
+
import { DataSources } from '@sphereon/ssi-sdk.agent-config'
|
|
2
2
|
import { DataSource } from 'typeorm'
|
|
3
3
|
import { DataStoreMachineStateEntities, MachineStateStore, StoreMachineStatesFindActiveArgs, StoreMachineStatePersistArgs } from '../index'
|
|
4
4
|
import { DataStoreMachineStateMigrations } from '../migrations'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {DataSources} from
|
|
1
|
+
import { DataSources } from '@sphereon/ssi-sdk.agent-config'
|
|
2
2
|
import { DataSource } from 'typeorm'
|
|
3
3
|
import { PresentationDefinitionItemEntity } from '../entities/presentationDefinition/PresentationDefinitionItemEntity'
|
|
4
4
|
import { DataStorePresentationDefinitionMigrations } from '../migrations'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {DataSources} from
|
|
1
|
+
import { DataSources } from '@sphereon/ssi-sdk.agent-config'
|
|
2
2
|
import { DataSource } from 'typeorm'
|
|
3
3
|
import { DataStorePresentationDefinitionEntities, DataStorePresentationDefinitionMigrations, PDStore } from '../index'
|
|
4
4
|
import { GetDefinitionsArgs, NonPersistedPresentationDefinitionItem, PresentationDefinitionItem } from '../types'
|
|
@@ -52,7 +52,7 @@ export class DigitalCredentialStore extends AbstractDigitalCredentialStore {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
getCredentials = async (args?: GetCredentialsArgs): Promise<GetCredentialsResponse> => {
|
|
55
|
-
const { filter = {}, offset, limit, order = '
|
|
55
|
+
const { filter = {}, offset, limit, order = 'createdAt.asc' } = args ?? {}
|
|
56
56
|
const sortOptions: FindOptionsOrder<DigitalCredentialEntity> =
|
|
57
57
|
order && typeof order === 'string'
|
|
58
58
|
? parseAndValidateOrderOptions<DigitalCredentialEntity>(order)
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
TableInheritance,
|
|
12
12
|
UpdateDateColumn,
|
|
13
13
|
} from 'typeorm'
|
|
14
|
-
import {
|
|
14
|
+
import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
15
15
|
import { PartyEntity } from './PartyEntity'
|
|
16
16
|
import { ContactMetadataItemEntity } from './ContactMetadataItemEntity'
|
|
17
17
|
|
|
@@ -21,10 +21,10 @@ export abstract class BaseContactEntity extends BaseEntity {
|
|
|
21
21
|
@PrimaryGeneratedColumn('uuid')
|
|
22
22
|
id!: string
|
|
23
23
|
|
|
24
|
-
@CreateDateColumn({ name: 'created_at', nullable: false, type:
|
|
24
|
+
@CreateDateColumn({ name: 'created_at', nullable: false, type: typeOrmDateTime() })
|
|
25
25
|
createdAt!: Date
|
|
26
26
|
|
|
27
|
-
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type:
|
|
27
|
+
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type: typeOrmDateTime() })
|
|
28
28
|
lastUpdatedAt!: Date
|
|
29
29
|
|
|
30
30
|
@OneToOne(() => PartyEntity, (party: PartyEntity) => party.contact, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Entity, Column, PrimaryGeneratedColumn, BaseEntity, ManyToOne, BeforeInsert, BeforeUpdate } from 'typeorm'
|
|
2
2
|
import { IMetadataEntity, ValidationConstraint } from '../../types'
|
|
3
|
-
import {
|
|
3
|
+
import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
4
4
|
import { BaseContactEntity } from './BaseContactEntity'
|
|
5
5
|
import { IsNotEmpty, validate, ValidationError } from 'class-validator'
|
|
6
6
|
import { getConstraint } from '../../utils/ValidatorUtils'
|
|
@@ -24,7 +24,7 @@ export class ContactMetadataItemEntity extends BaseEntity implements IMetadataEn
|
|
|
24
24
|
@Column('numeric', { name: 'numberValue', nullable: true })
|
|
25
25
|
numberValue?: number
|
|
26
26
|
|
|
27
|
-
@Column({ name: 'dateValue', nullable: true, type:
|
|
27
|
+
@Column({ name: 'dateValue', nullable: true, type: typeOrmDateTime() })
|
|
28
28
|
dateValue?: Date
|
|
29
29
|
|
|
30
30
|
@Column('boolean', { name: 'boolValue', nullable: true })
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
CreateDateColumn,
|
|
11
11
|
UpdateDateColumn,
|
|
12
12
|
} from 'typeorm'
|
|
13
|
-
import {
|
|
13
|
+
import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
14
14
|
import { PartyEntity } from './PartyEntity'
|
|
15
15
|
import { getConstraint } from '../../utils/ValidatorUtils'
|
|
16
16
|
import { ElectronicAddressType, ValidationConstraint } from '../../types'
|
|
@@ -42,10 +42,10 @@ export class ElectronicAddressEntity extends BaseEntity {
|
|
|
42
42
|
@Column('text', { name: 'tenant_id', nullable: true })
|
|
43
43
|
tenantId?: string
|
|
44
44
|
|
|
45
|
-
@CreateDateColumn({ name: 'created_at', nullable: false, type:
|
|
45
|
+
@CreateDateColumn({ name: 'created_at', nullable: false, type: typeOrmDateTime() })
|
|
46
46
|
createdAt!: Date
|
|
47
47
|
|
|
48
|
-
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type:
|
|
48
|
+
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type: typeOrmDateTime() })
|
|
49
49
|
lastUpdatedAt!: Date
|
|
50
50
|
|
|
51
51
|
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
BeforeUpdate,
|
|
14
14
|
} from 'typeorm'
|
|
15
15
|
import { IsNotEmpty, validate, ValidationError } from 'class-validator'
|
|
16
|
-
import {
|
|
16
|
+
import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
17
17
|
import { CorrelationIdentifierEntity } from './CorrelationIdentifierEntity'
|
|
18
18
|
import { ConnectionEntity } from './ConnectionEntity'
|
|
19
19
|
import { IdentityMetadataItemEntity } from './IdentityMetadataItemEntity'
|
|
@@ -71,10 +71,10 @@ export class IdentityEntity extends BaseEntity {
|
|
|
71
71
|
@JoinColumn({ name: 'metadata_id' }) // TODO check in db file
|
|
72
72
|
metadata!: Array<IdentityMetadataItemEntity>
|
|
73
73
|
|
|
74
|
-
@CreateDateColumn({ name: 'created_at', nullable: false
|
|
74
|
+
@CreateDateColumn({ name: 'created_at', nullable: false, type: typeOrmDateTime() })
|
|
75
75
|
createdAt!: Date
|
|
76
76
|
|
|
77
|
-
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type:
|
|
77
|
+
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type: typeOrmDateTime() })
|
|
78
78
|
lastUpdatedAt!: Date
|
|
79
79
|
|
|
80
80
|
@ManyToOne(() => PartyEntity, (party: PartyEntity) => party.identities, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
2
2
|
import { Entity, Column, PrimaryGeneratedColumn, BaseEntity, ManyToOne, BeforeInsert, BeforeUpdate } from 'typeorm'
|
|
3
3
|
import { IMetadataEntity, ValidationConstraint } from '../../types'
|
|
4
4
|
import { IdentityEntity } from './IdentityEntity'
|
|
@@ -24,7 +24,7 @@ export class IdentityMetadataItemEntity extends BaseEntity implements IMetadataE
|
|
|
24
24
|
@Column('numeric', { name: 'numberValue', nullable: true })
|
|
25
25
|
numberValue?: number
|
|
26
26
|
|
|
27
|
-
@Column({ name: 'dateValue', nullable: true, type:
|
|
27
|
+
@Column({ name: 'dateValue', nullable: true, type: typeOrmDateTime() })
|
|
28
28
|
dateValue?: Date
|
|
29
29
|
|
|
30
30
|
@Column('boolean', { name: 'boolValue', nullable: true })
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {IsNotEmpty, validate, ValidationError} from 'class-validator'
|
|
2
|
-
import {BeforeInsert, BeforeUpdate, ChildEntity, Column} from 'typeorm'
|
|
3
|
-
import {ValidationConstraint} from '../../types'
|
|
4
|
-
import {getConstraint} from '../../utils/ValidatorUtils'
|
|
5
|
-
import {BaseContactEntity} from './BaseContactEntity'
|
|
1
|
+
import { IsNotEmpty, validate, ValidationError } from 'class-validator'
|
|
2
|
+
import { BeforeInsert, BeforeUpdate, ChildEntity, Column } from 'typeorm'
|
|
3
|
+
import { ValidationConstraint } from '../../types'
|
|
4
|
+
import { getConstraint } from '../../utils/ValidatorUtils'
|
|
5
|
+
import { BaseContactEntity } from './BaseContactEntity'
|
|
6
6
|
|
|
7
7
|
@ChildEntity('Organization')
|
|
8
8
|
export class OrganizationEntity extends BaseContactEntity {
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
UpdateDateColumn,
|
|
14
14
|
} from 'typeorm'
|
|
15
15
|
import { ValidationConstraint } from '../../types'
|
|
16
|
-
import {
|
|
16
|
+
import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
17
17
|
import { IdentityEntity } from './IdentityEntity'
|
|
18
18
|
import { validate, ValidationError } from 'class-validator'
|
|
19
19
|
import { PartyTypeEntity } from './PartyTypeEntity'
|
|
@@ -89,10 +89,10 @@ export class PartyEntity extends BaseEntity {
|
|
|
89
89
|
@JoinColumn({ name: 'relationship_id' })
|
|
90
90
|
relationships!: Array<PartyRelationshipEntity>
|
|
91
91
|
|
|
92
|
-
@CreateDateColumn({ name: 'created_at', nullable: false, type:
|
|
92
|
+
@CreateDateColumn({ name: 'created_at', nullable: false, type: typeOrmDateTime() })
|
|
93
93
|
createdAt!: Date
|
|
94
94
|
|
|
95
|
-
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type:
|
|
95
|
+
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type: typeOrmDateTime() })
|
|
96
96
|
lastUpdatedAt!: Date
|
|
97
97
|
|
|
98
98
|
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
BeforeUpdate,
|
|
11
11
|
JoinColumn,
|
|
12
12
|
} from 'typeorm'
|
|
13
|
-
import {
|
|
13
|
+
import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
14
14
|
import { PartyEntity } from './PartyEntity'
|
|
15
15
|
|
|
16
16
|
@Entity('PartyRelationship')
|
|
@@ -45,10 +45,10 @@ export class PartyRelationshipEntity {
|
|
|
45
45
|
@Column('text', { name: 'tenant_id', nullable: true })
|
|
46
46
|
tenantId?: string
|
|
47
47
|
|
|
48
|
-
@CreateDateColumn({ name: 'created_at', nullable: false, type:
|
|
48
|
+
@CreateDateColumn({ name: 'created_at', nullable: false, type: typeOrmDateTime() })
|
|
49
49
|
createdAt!: Date
|
|
50
50
|
|
|
51
|
-
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type:
|
|
51
|
+
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type: typeOrmDateTime() })
|
|
52
52
|
lastUpdatedAt!: Date
|
|
53
53
|
|
|
54
54
|
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BeforeInsert, BeforeUpdate, Column, CreateDateColumn, Entity, Index, OneToMany, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'
|
|
2
|
-
import {
|
|
2
|
+
import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
3
3
|
import { PartyEntity } from './PartyEntity'
|
|
4
4
|
import { PartyOrigin, PartyTypeType, ValidationConstraint } from '../../types'
|
|
5
5
|
import { IsNotEmpty, Validate, validate, ValidationError } from 'class-validator'
|
|
@@ -35,10 +35,10 @@ export class PartyTypeEntity {
|
|
|
35
35
|
})
|
|
36
36
|
parties!: Array<PartyEntity>
|
|
37
37
|
|
|
38
|
-
@CreateDateColumn({ name: 'created_at', nullable: false, type:
|
|
38
|
+
@CreateDateColumn({ name: 'created_at', nullable: false, type: typeOrmDateTime() })
|
|
39
39
|
createdAt!: Date
|
|
40
40
|
|
|
41
|
-
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type:
|
|
41
|
+
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type: typeOrmDateTime() })
|
|
42
42
|
lastUpdatedAt!: Date
|
|
43
43
|
|
|
44
44
|
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
PrimaryGeneratedColumn,
|
|
11
11
|
UpdateDateColumn,
|
|
12
12
|
} from 'typeorm'
|
|
13
|
-
import {
|
|
13
|
+
import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
14
14
|
import { getConstraint } from '../../utils/ValidatorUtils'
|
|
15
15
|
import { PhysicalAddressType, ValidationConstraint } from '../../types'
|
|
16
16
|
import { PartyEntity } from './PartyEntity'
|
|
@@ -67,10 +67,10 @@ export class PhysicalAddressEntity extends BaseEntity {
|
|
|
67
67
|
@Column('text', { name: 'partyId', nullable: true })
|
|
68
68
|
partyId?: string
|
|
69
69
|
|
|
70
|
-
@CreateDateColumn({ name: 'created_at', nullable: false, type:
|
|
70
|
+
@CreateDateColumn({ name: 'created_at', nullable: false, type: typeOrmDateTime() })
|
|
71
71
|
createdAt!: Date
|
|
72
72
|
|
|
73
|
-
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type:
|
|
73
|
+
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type: typeOrmDateTime() })
|
|
74
74
|
lastUpdatedAt!: Date
|
|
75
75
|
|
|
76
76
|
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { BaseEntity, Column, CreateDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
CredentialCorrelationType,
|
|
4
|
+
CredentialDocumentFormat,
|
|
5
|
+
CredentialRole,
|
|
6
|
+
CredentialStateType,
|
|
7
|
+
DigitalCredential,
|
|
8
|
+
DocumentType,
|
|
9
|
+
} from '../../types'
|
|
10
|
+
import { typeormDate, typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
4
11
|
|
|
5
12
|
@Entity('DigitalCredential')
|
|
6
|
-
export class DigitalCredentialEntity extends BaseEntity {
|
|
13
|
+
export class DigitalCredentialEntity extends BaseEntity implements DigitalCredential {
|
|
7
14
|
@PrimaryGeneratedColumn('uuid')
|
|
8
15
|
id!: string
|
|
9
16
|
|
|
@@ -46,21 +53,21 @@ export class DigitalCredentialEntity extends BaseEntity {
|
|
|
46
53
|
@Column('text', { name: 'tenant_id', nullable: true })
|
|
47
54
|
tenantId?: string
|
|
48
55
|
|
|
49
|
-
@CreateDateColumn({ name: 'created_at', nullable: false, type:
|
|
56
|
+
@CreateDateColumn({ name: 'created_at', nullable: false, type: typeOrmDateTime() })
|
|
50
57
|
createdAt!: Date
|
|
51
58
|
|
|
52
|
-
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type:
|
|
59
|
+
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type: typeOrmDateTime() })
|
|
53
60
|
lastUpdatedAt!: Date
|
|
54
61
|
|
|
55
|
-
@Column({ name: 'valid_until', nullable: true, type:
|
|
62
|
+
@Column({ name: 'valid_until', nullable: true, type: typeormDate() })
|
|
56
63
|
validUntil?: Date
|
|
57
64
|
|
|
58
|
-
@Column({ name: 'valid_from', nullable: true, type:
|
|
65
|
+
@Column({ name: 'valid_from', nullable: true, type: typeormDate() })
|
|
59
66
|
validFrom?: Date
|
|
60
67
|
|
|
61
|
-
@Column(
|
|
68
|
+
@Column({ name: 'verified_at', nullable: true, type: typeOrmDateTime() })
|
|
62
69
|
verifiedAt?: Date
|
|
63
70
|
|
|
64
|
-
@Column({ name: 'revoked_at', nullable: true, type:
|
|
71
|
+
@Column({ name: 'revoked_at', nullable: true, type: typeOrmDateTime() })
|
|
65
72
|
revokedAt?: Date
|
|
66
73
|
}
|
|
@@ -2,14 +2,14 @@ import { ActionSubType, ActionType, InitiatorType, LogLevel, SubSystem, System,
|
|
|
2
2
|
import { BaseEntity, Column, CreateDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'
|
|
3
3
|
import { PartyCorrelationType } from '@sphereon/ssi-sdk.core'
|
|
4
4
|
import { NonPersistedAuditLoggingEvent } from '../../types'
|
|
5
|
-
import {
|
|
5
|
+
import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
6
6
|
|
|
7
7
|
@Entity('AuditEvents')
|
|
8
8
|
export class AuditEventEntity extends BaseEntity {
|
|
9
9
|
@PrimaryGeneratedColumn('uuid')
|
|
10
10
|
id!: string
|
|
11
11
|
|
|
12
|
-
@Column({ name: 'timestamp', nullable: false, unique: false, type:
|
|
12
|
+
@Column({ name: 'timestamp', nullable: false, unique: false, type: typeOrmDateTime() })
|
|
13
13
|
timestamp!: Date
|
|
14
14
|
|
|
15
15
|
@Column('simple-enum', { name: 'level', enum: LogLevel, nullable: false, unique: false })
|
|
@@ -60,10 +60,10 @@ export class AuditEventEntity extends BaseEntity {
|
|
|
60
60
|
@Column('text', { name: 'diagnosticData', nullable: true, unique: false })
|
|
61
61
|
diagnosticData?: string
|
|
62
62
|
|
|
63
|
-
@CreateDateColumn({ name: 'created_at', nullable: false, type:
|
|
63
|
+
@CreateDateColumn({ name: 'created_at', nullable: false, type: typeOrmDateTime() })
|
|
64
64
|
createdAt!: Date
|
|
65
65
|
|
|
66
|
-
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type:
|
|
66
|
+
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type: typeOrmDateTime() })
|
|
67
67
|
lastUpdatedAt!: Date
|
|
68
68
|
}
|
|
69
69
|
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
TableInheritance,
|
|
12
12
|
UpdateDateColumn,
|
|
13
13
|
} from 'typeorm'
|
|
14
|
-
import {
|
|
14
|
+
import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
15
15
|
import { ImageAttributesEntity } from './ImageAttributesEntity'
|
|
16
16
|
import { BackgroundAttributesEntity } from './BackgroundAttributesEntity'
|
|
17
17
|
import { TextAttributesEntity } from './TextAttributesEntity'
|
|
@@ -62,10 +62,10 @@ export class BaseLocaleBrandingEntity extends BaseEntity {
|
|
|
62
62
|
@JoinColumn({ name: 'textId' })
|
|
63
63
|
text?: TextAttributesEntity
|
|
64
64
|
|
|
65
|
-
@CreateDateColumn({ name: 'created_at', nullable: false, type:
|
|
65
|
+
@CreateDateColumn({ name: 'created_at', nullable: false, type: typeOrmDateTime() })
|
|
66
66
|
createdAt!: Date
|
|
67
67
|
|
|
68
|
-
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type:
|
|
68
|
+
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type: typeOrmDateTime() })
|
|
69
69
|
lastUpdatedAt!: Date
|
|
70
70
|
|
|
71
71
|
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
UpdateDateColumn,
|
|
12
12
|
} from 'typeorm'
|
|
13
13
|
import { ArrayMinSize, IsNotEmpty, validate, ValidationError } from 'class-validator'
|
|
14
|
-
import {
|
|
14
|
+
import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
15
15
|
import { CredentialLocaleBrandingEntity, credentialLocaleBrandingEntityFrom } from './CredentialLocaleBrandingEntity'
|
|
16
16
|
import { IBasicCredentialBranding, IBasicCredentialLocaleBranding } from '../../types'
|
|
17
17
|
|
|
@@ -43,10 +43,10 @@ export class CredentialBrandingEntity extends BaseEntity {
|
|
|
43
43
|
@ArrayMinSize(1, { message: 'localeBranding cannot be empty' })
|
|
44
44
|
localeBranding!: Array<CredentialLocaleBrandingEntity>
|
|
45
45
|
|
|
46
|
-
@CreateDateColumn({ name: 'created_at', nullable: false, type:
|
|
46
|
+
@CreateDateColumn({ name: 'created_at', nullable: false, type: typeOrmDateTime() })
|
|
47
47
|
createdAt!: Date
|
|
48
48
|
|
|
49
|
-
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type:
|
|
49
|
+
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type: typeOrmDateTime() })
|
|
50
50
|
lastUpdatedAt!: Date
|
|
51
51
|
|
|
52
52
|
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
UpdateDateColumn,
|
|
12
12
|
} from 'typeorm'
|
|
13
13
|
import { ArrayMinSize, IsNotEmpty, validate, ValidationError } from 'class-validator'
|
|
14
|
-
import {
|
|
14
|
+
import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
15
15
|
import { IssuerLocaleBrandingEntity, issuerLocaleBrandingEntityFrom } from './IssuerLocaleBrandingEntity'
|
|
16
16
|
import { IBasicIssuerBranding, IBasicIssuerLocaleBranding } from '../../types'
|
|
17
17
|
|
|
@@ -38,10 +38,10 @@ export class IssuerBrandingEntity extends BaseEntity {
|
|
|
38
38
|
@ArrayMinSize(1, { message: 'localeBranding cannot be empty' })
|
|
39
39
|
localeBranding!: Array<IssuerLocaleBrandingEntity>
|
|
40
40
|
|
|
41
|
-
@CreateDateColumn({ name: 'created_at', nullable: false, type:
|
|
41
|
+
@CreateDateColumn({ name: 'created_at', nullable: false, type: typeOrmDateTime() })
|
|
42
42
|
createdAt!: Date
|
|
43
43
|
|
|
44
|
-
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type:
|
|
44
|
+
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type: typeOrmDateTime() })
|
|
45
45
|
lastUpdatedAt!: Date
|
|
46
46
|
|
|
47
47
|
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseEntity, Column, CreateDateColumn, Entity, PrimaryColumn, UpdateDateColumn } from 'typeorm'
|
|
2
|
-
import {
|
|
2
|
+
import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @class MachineStateInfoEntity
|
|
@@ -39,19 +39,19 @@ export class MachineStateInfoEntity extends BaseEntity {
|
|
|
39
39
|
@Column({ name: 'state', type: 'text', nullable: false })
|
|
40
40
|
state!: string
|
|
41
41
|
|
|
42
|
-
@CreateDateColumn({ name: 'created_at', nullable: false, type:
|
|
42
|
+
@CreateDateColumn({ name: 'created_at', nullable: false, type: typeOrmDateTime() })
|
|
43
43
|
createdAt!: Date
|
|
44
44
|
|
|
45
|
-
@UpdateDateColumn({ name: 'updated_at', nullable: false, type:
|
|
45
|
+
@UpdateDateColumn({ name: 'updated_at', nullable: false, type: typeOrmDateTime() })
|
|
46
46
|
updatedAt!: Date
|
|
47
47
|
|
|
48
48
|
@Column({ name: 'updated_count', type: 'integer', nullable: false })
|
|
49
49
|
updatedCount!: number
|
|
50
50
|
|
|
51
|
-
@Column({ name: 'expires_at', nullable: true
|
|
51
|
+
@Column({ name: 'expires_at', nullable: true, type: typeOrmDateTime() })
|
|
52
52
|
expiresAt?: Date
|
|
53
53
|
|
|
54
|
-
@Column({ name: 'completed_at', nullable: true, type:
|
|
54
|
+
@Column({ name: 'completed_at', nullable: true, type: typeOrmDateTime() })
|
|
55
55
|
completedAt?: Date
|
|
56
56
|
|
|
57
57
|
@Column({ name: 'tenant_id', type: 'varchar', nullable: true })
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseEntity, BeforeInsert, BeforeUpdate, Column, CreateDateColumn, Entity, Index, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'
|
|
2
2
|
import { IsNotEmpty } from 'class-validator'
|
|
3
|
-
import {
|
|
3
|
+
import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
4
4
|
|
|
5
5
|
@Entity('PresentationDefinitionItem')
|
|
6
6
|
@Index(['version'], { unique: false })
|
|
@@ -29,10 +29,10 @@ export class PresentationDefinitionItemEntity extends BaseEntity {
|
|
|
29
29
|
@IsNotEmpty({ message: 'A blank definition payload field is not allowed' })
|
|
30
30
|
definitionPayload!: string
|
|
31
31
|
|
|
32
|
-
@CreateDateColumn({ name: 'created_at', nullable: false, type:
|
|
32
|
+
@CreateDateColumn({ name: 'created_at', nullable: false, type: typeOrmDateTime() })
|
|
33
33
|
createdAt!: Date
|
|
34
34
|
|
|
35
|
-
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type:
|
|
35
|
+
@UpdateDateColumn({ name: 'last_updated_at', nullable: false, type: typeOrmDateTime() })
|
|
36
36
|
lastUpdatedAt!: Date
|
|
37
37
|
|
|
38
38
|
// By default, @UpdateDateColumn in TypeORM updates the timestamp only when the entity's top-level properties change.
|
|
@@ -7,7 +7,7 @@ export class CreateDigitalCredential1708525189001 implements MigrationInterface
|
|
|
7
7
|
await queryRunner.query(`CREATE TYPE "digital_document_type" AS ENUM('VC', 'VP', 'C', 'P')`)
|
|
8
8
|
await queryRunner.query(`CREATE TYPE "digital_credential_document_format" AS ENUM('JSON_LD', 'JWT', 'SD_JWT', 'MDOC')`)
|
|
9
9
|
await queryRunner.query(`CREATE TYPE "digital_credential_credential_role" AS ENUM('ISSUER', 'VERIFIER', 'HOLDER')`)
|
|
10
|
-
await queryRunner.query(`CREATE TYPE "digital_credential_correlation_type" AS ENUM('DID')`)
|
|
10
|
+
await queryRunner.query(`CREATE TYPE "digital_credential_correlation_type" AS ENUM('DID', 'URL', 'X509_CN')`)
|
|
11
11
|
await queryRunner.query(`CREATE TYPE "digital_credential_state_type" AS ENUM('REVOKED', 'VERIFIED', 'EXPIRED')`)
|
|
12
12
|
|
|
13
13
|
await queryRunner.query(`
|
|
@@ -14,8 +14,8 @@ export class CreateDigitalCredential1708525189002 implements MigrationInterface
|
|
|
14
14
|
"uniform_document" text NOT NULL,
|
|
15
15
|
"credential_id" text,
|
|
16
16
|
"hash" text NOT NULL UNIQUE,
|
|
17
|
-
"issuer_correlation_type" varchar CHECK( "issuer_correlation_type" IN ('DID') ) NOT NULL,
|
|
18
|
-
"subject_correlation_type" varchar CHECK( "subject_correlation_type" IN ('DID') ),
|
|
17
|
+
"issuer_correlation_type" varchar CHECK( "issuer_correlation_type" IN ('DID', 'URL', 'X509_CN') ) NOT NULL,
|
|
18
|
+
"subject_correlation_type" varchar CHECK( "subject_correlation_type" IN ('DID', 'URL', 'X509_CN') ),
|
|
19
19
|
"issuer_correlation_id" text NOT NULL,
|
|
20
20
|
"subject_correlation_id" text,
|
|
21
21
|
"verified_state" varchar CHECK( "verified_state" IN ('REVOKED', 'VERIFIED', 'EXPIRED') ),
|
|
@@ -10,8 +10,8 @@ import {
|
|
|
10
10
|
IRemoveStatusListArgs,
|
|
11
11
|
IStatusListEntryAvailableArgs,
|
|
12
12
|
IUpdateStatusListIndexArgs,
|
|
13
|
-
} from '../types
|
|
14
|
-
import { IStatusListEntity, IStatusListEntryEntity } from '../types
|
|
13
|
+
} from '../types'
|
|
14
|
+
import { IStatusListEntity, IStatusListEntryEntity } from '../types'
|
|
15
15
|
|
|
16
16
|
export interface IStatusListStore {
|
|
17
17
|
getStatusList(args: IGetStatusListArgs): Promise<IStatusListEntity>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ManagedIdentifierOpts } from '@sphereon/ssi-sdk-ext.identifier-resolution/dist/types'
|
|
2
2
|
import { IIdentifier } from '@veramo/core'
|
|
3
3
|
import { ILocaleBranding } from '../issuanceBranding/issuanceBranding'
|
|
4
4
|
import { CredentialRole } from '../digitalCredential/digitalCredential'
|
|
@@ -149,7 +149,7 @@ export type PartialOpenIdConfig = Partial<OpenIdConfig>
|
|
|
149
149
|
|
|
150
150
|
export type DidAuthConfig = {
|
|
151
151
|
id: string
|
|
152
|
-
idOpts:
|
|
152
|
+
idOpts: ManagedIdentifierOpts
|
|
153
153
|
stateId: string
|
|
154
154
|
ownerId?: string
|
|
155
155
|
tenantId?: string
|
|
@@ -37,8 +37,40 @@ export enum CredentialDocumentFormat {
|
|
|
37
37
|
MDOC = 'MDOC',
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
export namespace CredentialDocumentFormat {
|
|
41
|
+
export function fromSpecValue(credentialFormat: string) {
|
|
42
|
+
const format = credentialFormat.toLowerCase()
|
|
43
|
+
if (format.includes('sd')) {
|
|
44
|
+
return CredentialDocumentFormat.SD_JWT
|
|
45
|
+
} else if (format.includes('ldp')) {
|
|
46
|
+
return CredentialDocumentFormat.JSON_LD
|
|
47
|
+
} else if (format.includes('mso') || credentialFormat.includes('mdoc')) {
|
|
48
|
+
return CredentialDocumentFormat.MDOC
|
|
49
|
+
} else if (format.includes('jwt_')) {
|
|
50
|
+
return CredentialDocumentFormat.JWT
|
|
51
|
+
} else {
|
|
52
|
+
throw Error(`Could not map format ${format} to known format`)
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function toSpecValue(documentFormat: CredentialDocumentFormat, documentType: DocumentType) {
|
|
57
|
+
switch (documentFormat) {
|
|
58
|
+
case CredentialDocumentFormat.SD_JWT:
|
|
59
|
+
return 'vc+sd-jwt'
|
|
60
|
+
case CredentialDocumentFormat.MDOC:
|
|
61
|
+
return 'mso_mdoc'
|
|
62
|
+
case CredentialDocumentFormat.JSON_LD:
|
|
63
|
+
return documentType === DocumentType.C || documentType === DocumentType.VC ? 'ldp_vc' : 'ldp_vp'
|
|
64
|
+
case CredentialDocumentFormat.JWT:
|
|
65
|
+
return documentType === DocumentType.C || documentType === DocumentType.VC ? 'jwt_vc_json' : 'jwt_vp_json'
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
40
70
|
export enum CredentialCorrelationType {
|
|
41
71
|
DID = 'DID',
|
|
72
|
+
X509_CN = 'X509_CN',
|
|
73
|
+
URL = 'URL',
|
|
42
74
|
}
|
|
43
75
|
|
|
44
76
|
export enum CredentialRole {
|
|
@@ -165,8 +165,19 @@ export const correlationIdentifierFrom = (identifier: CorrelationIdentifierEntit
|
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
export const didAuthConfigEntityFrom = (config: NonPersistedDidAuthConfig): DidAuthConfigEntity => {
|
|
168
|
+
let identifier: string | undefined = undefined
|
|
169
|
+
if (typeof config.idOpts.identifier === 'string') {
|
|
170
|
+
identifier = config.idOpts.identifier
|
|
171
|
+
} else if (typeof config.idOpts.identifier === 'object') {
|
|
172
|
+
if ('did' in config.idOpts.identifier && typeof config.idOpts.identifier.did === 'string') {
|
|
173
|
+
identifier = config.idOpts.identifier.did
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
if (!identifier) {
|
|
177
|
+
throw Error(`Identifier method ${config.idOpts.method} not yet supported`)
|
|
178
|
+
}
|
|
168
179
|
const didAuthConfig: DidAuthConfigEntity = new DidAuthConfigEntity()
|
|
169
|
-
didAuthConfig.identifier =
|
|
180
|
+
didAuthConfig.identifier = identifier
|
|
170
181
|
didAuthConfig.redirectUrl = config.redirectUrl
|
|
171
182
|
didAuthConfig.sessionId = config.sessionId
|
|
172
183
|
didAuthConfig.ownerId = config.ownerId
|