@sphereon/ssi-sdk.data-store 0.34.1-fix.223 → 0.34.1-fix.247
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/index.cjs +2358 -2522
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +321 -1245
- package/dist/index.d.ts +321 -1245
- package/dist/index.js +2301 -2465
- package/dist/index.js.map +1 -1
- package/package.json +8 -7
- package/src/__tests__/contact.entities.test.ts +2 -8
- package/src/__tests__/contact.store.test.ts +11 -6
- package/src/__tests__/digitalCredential.entities.test.ts +11 -5
- package/src/__tests__/digitalCredential.store.test.ts +1 -1
- package/src/__tests__/eventLogger.entities.test.ts +3 -3
- package/src/__tests__/eventLogger.store.test.ts +9 -4
- package/src/__tests__/issuanceBranding.entities.test.ts +2 -2
- package/src/__tests__/issuanceBranding.store.test.ts +3 -3
- package/src/__tests__/machineState.entities.test.ts +1 -1
- package/src/__tests__/machineState.store.test.ts +1 -1
- package/src/__tests__/pd-manager.store.test.ts +1 -1
- package/src/__tests__/statusList.entities.test.ts +4 -4
- package/src/__tests__/statusList.store.test.ts +3 -3
- package/src/contact/ContactStore.ts +35 -35
- package/src/digitalCredential/DigitalCredentialStore.ts +8 -9
- package/src/entities/contact/BaseConfigEntity.ts +2 -2
- package/src/entities/contact/BaseContactEntity.ts +4 -5
- package/src/entities/contact/ConnectionEntity.ts +4 -4
- package/src/entities/contact/ContactMetadataItemEntity.ts +3 -4
- package/src/entities/contact/CorrelationIdentifierEntity.ts +3 -4
- package/src/entities/contact/DidAuthConfigEntity.ts +1 -2
- package/src/entities/contact/ElectronicAddressEntity.ts +15 -5
- package/src/entities/contact/IdentityEntity.ts +12 -12
- package/src/entities/contact/IdentityMetadataItemEntity.ts +3 -3
- package/src/entities/contact/NaturalPersonEntity.ts +5 -5
- package/src/entities/contact/OrganizationEntity.ts +1 -1
- package/src/entities/contact/PartyEntity.ts +7 -7
- package/src/entities/contact/PartyRelationshipEntity.ts +8 -8
- package/src/entities/contact/PartyTypeEntity.ts +4 -4
- package/src/entities/contact/PhysicalAddressEntity.ts +3 -3
- package/src/entities/digitalCredential/DigitalCredentialEntity.ts +3 -3
- package/src/entities/eventLogger/AuditEventEntity.ts +2 -2
- package/src/entities/issuanceBranding/BackgroundAttributesEntity.ts +2 -2
- package/src/entities/issuanceBranding/BaseLocaleBrandingEntity.ts +6 -7
- package/src/entities/issuanceBranding/CredentialBrandingEntity.ts +2 -2
- package/src/entities/issuanceBranding/CredentialClaimsEntity.ts +2 -2
- package/src/entities/issuanceBranding/CredentialLocaleBrandingEntity.ts +2 -2
- package/src/entities/issuanceBranding/ImageAttributesEntity.ts +2 -2
- package/src/entities/issuanceBranding/IssuerBrandingEntity.ts +2 -2
- package/src/entities/issuanceBranding/IssuerLocaleBrandingEntity.ts +3 -3
- package/src/entities/issuanceBranding/TextAttributesEntity.ts +1 -1
- package/src/entities/machineState/MachineStateInfoEntity.ts +1 -1
- package/src/entities/presentationDefinition/DcqlQueryItemEntity.ts +2 -2
- package/src/entities/statusList/BitstringStatusListEntryEntity.ts +1 -1
- package/src/entities/statusList/StatusListEntities.ts +3 -4
- package/src/eventLogger/EventLoggerStore.ts +2 -2
- package/src/index.ts +19 -24
- package/src/issuanceBranding/IssuanceBrandingStore.ts +25 -25
- package/src/machineState/MachineStateStore.ts +7 -7
- package/src/migrations/generic/1-CreateContacts.ts +1 -1
- package/src/migrations/generic/10-CreatePresentationDefinitions.ts +1 -1
- package/src/migrations/generic/11-FixCredentialClaimsReferenceUuid.ts +2 -2
- package/src/migrations/generic/2-CreateIssuanceBranding.ts +1 -1
- package/src/migrations/generic/3-CreateContacts.ts +2 -2
- package/src/migrations/generic/4-CreateStatusList.ts +1 -1
- package/src/migrations/generic/5-CreateAuditEvents.ts +2 -2
- package/src/migrations/generic/6-CreateDigitalCredential.ts +1 -1
- package/src/migrations/generic/7-CreateMachineStateStore.ts +1 -1
- package/src/migrations/generic/8-CreateContacts.ts +1 -1
- package/src/migrations/generic/9-CreateContacts.ts +1 -1
- package/src/migrations/postgres/1659463079428-CreateContacts.ts +1 -1
- package/src/migrations/postgres/1685628974232-CreateIssuanceBranding.ts +1 -1
- package/src/migrations/postgres/1690925872592-CreateContacts.ts +1 -1
- package/src/presentationDefinition/PDStore.ts +7 -7
- package/src/statusList/IStatusListStore.ts +1 -1
- package/src/statusList/StatusListStore.ts +3 -3
- package/src/types/index.ts +0 -12
- package/src/types/statusList/IAbstractStatusListStore.ts +9 -9
- package/src/utils/ValidatorUtils.ts +1 -1
- package/src/utils/contact/MappingUtils.ts +10 -10
- package/src/utils/digitalCredential/MappingUtils.ts +3 -21
- package/src/utils/eventLogger/MappingUtils.ts +2 -2
- package/src/utils/issuanceBranding/MappingUtils.ts +13 -13
- package/src/utils/presentationDefinition/MappingUtils.ts +1 -1
- package/src/utils/statusList/MappingUtils.ts +1 -1
- package/src/contact/AbstractContactStore.ts +0 -71
- package/src/digitalCredential/AbstractDigitalCredentialStore.ts +0 -21
- package/src/eventLogger/AbstractEventLoggerStore.ts +0 -9
- package/src/issuanceBranding/AbstractIssuanceBrandingStore.ts +0 -41
- package/src/machineState/IAbstractMachineStateStore.ts +0 -65
- package/src/presentationDefinition/AbstractPDStore.ts +0 -20
- package/src/types/contact/IAbstractContactStore.ts +0 -161
- package/src/types/contact/contact.ts +0 -295
- package/src/types/contact/index.ts +0 -2
- package/src/types/digitalCredential/IAbstractDigitalCredentialStore.ts +0 -44
- package/src/types/digitalCredential/enums.ts +0 -63
- package/src/types/digitalCredential/index.ts +0 -3
- package/src/types/digitalCredential/types.ts +0 -40
- package/src/types/eventLogger/IAbstractEventLoggerStore.ts +0 -22
- package/src/types/eventLogger/eventLogger.ts +0 -4
- package/src/types/issuanceBranding/IAbstractIssuanceBrandingStore.ts +0 -85
- package/src/types/issuanceBranding/issuanceBranding.ts +0 -138
- package/src/types/machineState/IAbstractMachineStateStore.ts +0 -68
- package/src/types/presentationDefinition/IAbstractPDStore.ts +0 -25
- package/src/types/presentationDefinition/presentationDefinition.ts +0 -18
- package/src/types/validation/validation.ts +0 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sphereon/ssi-sdk.data-store",
|
|
3
|
-
"version": "0.34.1-fix.
|
|
3
|
+
"version": "0.34.1-fix.247+6c4b1882",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -28,11 +28,12 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@sphereon/kmp-mdoc-core": "0.2.0-SNAPSHOT.26",
|
|
30
30
|
"@sphereon/pex": "5.0.0-unstable.28",
|
|
31
|
-
"@sphereon/ssi-sdk-ext.did-utils": "0.34.1-fix.
|
|
32
|
-
"@sphereon/ssi-sdk-ext.identifier-resolution": "0.34.1-fix.
|
|
33
|
-
"@sphereon/ssi-sdk.agent-config": "0.34.1-fix.
|
|
34
|
-
"@sphereon/ssi-sdk.core": "0.34.1-fix.
|
|
35
|
-
"@sphereon/ssi-types": "0.34.1-fix.
|
|
31
|
+
"@sphereon/ssi-sdk-ext.did-utils": "0.34.1-fix.247+6c4b1882",
|
|
32
|
+
"@sphereon/ssi-sdk-ext.identifier-resolution": "0.34.1-fix.247+6c4b1882",
|
|
33
|
+
"@sphereon/ssi-sdk.agent-config": "0.34.1-fix.247+6c4b1882",
|
|
34
|
+
"@sphereon/ssi-sdk.core": "0.34.1-fix.247+6c4b1882",
|
|
35
|
+
"@sphereon/ssi-sdk.data-store-types": "0.34.1-fix.247+6c4b1882",
|
|
36
|
+
"@sphereon/ssi-types": "0.34.1-fix.247+6c4b1882",
|
|
36
37
|
"@veramo/core": "4.2.0",
|
|
37
38
|
"@veramo/utils": "4.2.0",
|
|
38
39
|
"blakejs": "^1.2.1",
|
|
@@ -65,5 +66,5 @@
|
|
|
65
66
|
"PostgreSQL",
|
|
66
67
|
"Contact Store"
|
|
67
68
|
],
|
|
68
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "6c4b188290980043b16a2aecce8bb0670d6e8ef2"
|
|
69
70
|
}
|
|
@@ -18,17 +18,11 @@ import { PartyEntity } from '../entities/contact/PartyEntity'
|
|
|
18
18
|
import { PartyRelationshipEntity } from '../entities/contact/PartyRelationshipEntity'
|
|
19
19
|
import { PartyTypeEntity } from '../entities/contact/PartyTypeEntity'
|
|
20
20
|
import { PhysicalAddressEntity } from '../entities/contact/PhysicalAddressEntity'
|
|
21
|
+
import { contactMetadataItemEntityFrom, DataStoreContactEntities, DataStoreMigrations, identityMetadataItemEntityFrom, partyTypeFrom } from '../index'
|
|
21
22
|
import {
|
|
22
|
-
contactMetadataItemEntityFrom,
|
|
23
|
-
DataStoreContactEntities,
|
|
24
|
-
DataStoreMigrations,
|
|
25
|
-
identityMetadataItemEntityFrom,
|
|
26
23
|
IdentityOrigin,
|
|
27
24
|
MetadataTypes,
|
|
28
25
|
PartyOrigin,
|
|
29
|
-
partyTypeFrom,
|
|
30
|
-
} from '../index'
|
|
31
|
-
import {
|
|
32
26
|
ConnectionType,
|
|
33
27
|
CorrelationIdentifierType,
|
|
34
28
|
NaturalPerson,
|
|
@@ -44,7 +38,7 @@ import {
|
|
|
44
38
|
NonPersistedPhysicalAddress,
|
|
45
39
|
Organization,
|
|
46
40
|
PartyTypeType,
|
|
47
|
-
} from '
|
|
41
|
+
} from '@sphereon/ssi-sdk.data-store-types'
|
|
48
42
|
import {
|
|
49
43
|
connectionEntityFrom,
|
|
50
44
|
didAuthConfigEntityFrom,
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { DataSources } from '@sphereon/ssi-sdk.agent-config'
|
|
2
|
-
import { DataSource } from 'typeorm'
|
|
3
|
-
import { ConnectionType, DataStoreContactEntities, DataStoreMigrations, IdentityOrigin, MetadataItem, MetadataTypes, PartyOrigin } from '../index'
|
|
4
|
-
import { ContactStore } from '../contact/ContactStore'
|
|
5
2
|
import {
|
|
3
|
+
ConnectionType,
|
|
6
4
|
CorrelationIdentifierType,
|
|
7
5
|
ElectronicAddress,
|
|
8
6
|
GetElectronicAddressesArgs,
|
|
@@ -11,6 +9,9 @@ import {
|
|
|
11
9
|
GetPhysicalAddressesArgs,
|
|
12
10
|
GetRelationshipsArgs,
|
|
13
11
|
Identity,
|
|
12
|
+
IdentityOrigin,
|
|
13
|
+
MetadataItem,
|
|
14
|
+
MetadataTypes,
|
|
14
15
|
NaturalPerson,
|
|
15
16
|
NonPersistedElectronicAddress,
|
|
16
17
|
NonPersistedIdentity,
|
|
@@ -20,13 +21,17 @@ import {
|
|
|
20
21
|
NonPersistedPartyType,
|
|
21
22
|
NonPersistedPhysicalAddress,
|
|
22
23
|
Party,
|
|
24
|
+
PartyOrigin,
|
|
23
25
|
PartyRelationship,
|
|
24
26
|
PartyType,
|
|
25
27
|
PartyTypeType,
|
|
26
28
|
PhysicalAddress,
|
|
27
|
-
} from '
|
|
29
|
+
} from '@sphereon/ssi-sdk.data-store-types'
|
|
30
|
+
import { CredentialRole } from '@sphereon/ssi-types'
|
|
31
|
+
import { DataSource } from 'typeorm'
|
|
28
32
|
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
|
|
29
|
-
import {
|
|
33
|
+
import { ContactStore } from '../contact/ContactStore'
|
|
34
|
+
import { DataStoreContactEntities, DataStoreMigrations } from '../index'
|
|
30
35
|
|
|
31
36
|
describe('Contact store tests', (): void => {
|
|
32
37
|
let dbConnection: DataSource
|
|
@@ -49,7 +54,7 @@ describe('Contact store tests', (): void => {
|
|
|
49
54
|
})
|
|
50
55
|
|
|
51
56
|
afterEach(async (): Promise<void> => {
|
|
52
|
-
await
|
|
57
|
+
await dbConnection.destroy()
|
|
53
58
|
})
|
|
54
59
|
|
|
55
60
|
it('should get party by contact metadata', async (): Promise<void> => {
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { DataSources } from '@sphereon/ssi-sdk.agent-config'
|
|
2
|
+
import { defaultHasher } from '@sphereon/ssi-sdk.core'
|
|
3
|
+
import {
|
|
4
|
+
AddCredentialArgs,
|
|
5
|
+
CredentialCorrelationType,
|
|
6
|
+
CredentialDocumentFormat,
|
|
7
|
+
DocumentType,
|
|
8
|
+
NonPersistedDigitalCredential,
|
|
9
|
+
} from '@sphereon/ssi-sdk.data-store-types'
|
|
2
10
|
import { CredentialRole } from '@sphereon/ssi-types'
|
|
11
|
+
import { computeEntryHash } from '@veramo/utils'
|
|
3
12
|
import { DataSource } from 'typeorm'
|
|
13
|
+
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
|
|
14
|
+
import { DigitalCredentialEntity } from '../entities/digitalCredential/DigitalCredentialEntity'
|
|
4
15
|
import { DataStoreDigitalCredentialEntities } from '../index'
|
|
5
16
|
import { DataStoreDigitalCredentialMigrations } from '../migrations'
|
|
6
|
-
import { DigitalCredentialEntity } from '../entities/digitalCredential/DigitalCredentialEntity'
|
|
7
|
-
import { computeEntryHash } from '@veramo/utils'
|
|
8
17
|
import { nonPersistedDigitalCredentialEntityFromAddArgs } from '../utils/digitalCredential/MappingUtils'
|
|
9
|
-
import { AddCredentialArgs, CredentialCorrelationType, CredentialDocumentFormat, DocumentType, NonPersistedDigitalCredential } from '../types'
|
|
10
|
-
import { defaultHasher } from '@sphereon/ssi-sdk.core'
|
|
11
|
-
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
|
|
12
18
|
|
|
13
19
|
describe('Database entities tests', (): void => {
|
|
14
20
|
let dbConnection: DataSource
|
|
@@ -2,12 +2,12 @@ import { DataSources } from '@sphereon/ssi-sdk.agent-config'
|
|
|
2
2
|
import { CredentialType, PartyCorrelationType } from '@sphereon/ssi-sdk.core'
|
|
3
3
|
import { ActionType, InitiatorType, LoggingEventType, LogLevel, SubSystem, System, SystemCorrelationIdType } from '@sphereon/ssi-types'
|
|
4
4
|
import { DataSource } from 'typeorm'
|
|
5
|
+
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
|
|
6
|
+
import { AuditEventEntity } from '../entities/eventLogger/AuditEventEntity'
|
|
5
7
|
import { DataStoreEventLoggerEntities } from '../index'
|
|
6
8
|
import { DataStoreEventLoggerMigrations } from '../migrations'
|
|
7
|
-
import {
|
|
8
|
-
import { NonPersistedActivityLoggingEvent, NonPersistedAuditLoggingEvent } from '../types'
|
|
9
|
+
import { NonPersistedActivityLoggingEvent, NonPersistedAuditLoggingEvent } from '@sphereon/ssi-sdk.data-store-types'
|
|
9
10
|
import { activityEventEntityFrom, auditEventEntityFrom } from '../utils/eventLogger/MappingUtils'
|
|
10
|
-
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
|
|
11
11
|
|
|
12
12
|
describe('Database entities tests', (): void => {
|
|
13
13
|
let dbConnection: DataSource
|
|
@@ -2,11 +2,16 @@ import { DataSources } from '@sphereon/ssi-sdk.agent-config'
|
|
|
2
2
|
import { ActivityLoggingEvent, AuditLoggingEvent, CredentialType, PartyCorrelationType } from '@sphereon/ssi-sdk.core'
|
|
3
3
|
import { ActionType, InitiatorType, LoggingEventType, LogLevel, SubSystem, System, SystemCorrelationIdType } from '@sphereon/ssi-types'
|
|
4
4
|
import { DataSource } from 'typeorm'
|
|
5
|
-
import { DataStoreEventLoggerMigrations } from '../migrations'
|
|
6
|
-
import { DataStoreEventLoggerEntities } from '../index'
|
|
7
|
-
import { EventLoggerStore } from '../eventLogger/EventLoggerStore'
|
|
8
|
-
import { GetActivityEventsArgs, GetAuditEventsArgs, NonPersistedActivityLoggingEvent, NonPersistedAuditLoggingEvent } from '../types'
|
|
9
5
|
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
|
|
6
|
+
import { EventLoggerStore } from '../eventLogger/EventLoggerStore'
|
|
7
|
+
import { DataStoreEventLoggerEntities } from '../index'
|
|
8
|
+
import { DataStoreEventLoggerMigrations } from '../migrations'
|
|
9
|
+
import {
|
|
10
|
+
GetActivityEventsArgs,
|
|
11
|
+
GetAuditEventsArgs,
|
|
12
|
+
NonPersistedActivityLoggingEvent,
|
|
13
|
+
NonPersistedAuditLoggingEvent,
|
|
14
|
+
} from '@sphereon/ssi-sdk.data-store-types'
|
|
10
15
|
|
|
11
16
|
describe('Database entities tests', (): void => {
|
|
12
17
|
let dbConnection: DataSource
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DataSources } from '@sphereon/ssi-sdk.agent-config'
|
|
2
2
|
import { DataSource, Repository } from 'typeorm'
|
|
3
|
-
import {
|
|
3
|
+
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
|
|
4
4
|
import {
|
|
5
5
|
CredentialBrandingEntity,
|
|
6
6
|
credentialBrandingEntityFrom,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
IssuerLocaleBrandingEntity,
|
|
17
17
|
issuerLocaleBrandingEntityFrom,
|
|
18
18
|
} from '../index'
|
|
19
|
-
import {
|
|
19
|
+
import { DataStoreMigrations } from '../migrations'
|
|
20
20
|
|
|
21
21
|
describe('Database entities tests', (): void => {
|
|
22
22
|
let dbConnection: DataSource
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { DataSources } from '@sphereon/ssi-sdk.agent-config'
|
|
2
2
|
import { DataSource } from 'typeorm'
|
|
3
|
-
import {
|
|
4
|
-
import { DataStoreMigrations } from '../migrations'
|
|
3
|
+
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
|
|
5
4
|
import {
|
|
6
5
|
BackgroundAttributesEntity,
|
|
7
6
|
CredentialLocaleBrandingEntity,
|
|
@@ -26,7 +25,8 @@ import {
|
|
|
26
25
|
IUpdateIssuerLocaleBrandingArgs,
|
|
27
26
|
TextAttributesEntity,
|
|
28
27
|
} from '../index'
|
|
29
|
-
import {
|
|
28
|
+
import { IssuanceBrandingStore } from '../issuanceBranding/IssuanceBrandingStore'
|
|
29
|
+
import { DataStoreMigrations } from '../migrations'
|
|
30
30
|
|
|
31
31
|
describe('Issuance branding store tests', (): void => {
|
|
32
32
|
let dbConnection: DataSource
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DataSources } from '@sphereon/ssi-sdk.agent-config'
|
|
2
2
|
import { DataSource } from 'typeorm'
|
|
3
|
+
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
|
|
3
4
|
import { MachineStateInfoEntity } from '../entities/machineState/MachineStateInfoEntity'
|
|
4
5
|
|
|
5
6
|
import { DataStoreMachineStateEntities, DataStoreMachineStateMigrations, MachineStateStore, StoreMachineStatePersistArgs } from '../index'
|
|
6
|
-
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
|
|
7
7
|
|
|
8
8
|
describe('Machine State Info Database entities tests', (): void => {
|
|
9
9
|
let dbConnection: DataSource
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DataSources } from '@sphereon/ssi-sdk.agent-config'
|
|
2
2
|
import { DataSource } from 'typeorm'
|
|
3
|
+
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
|
|
3
4
|
import { DataStoreMachineStateEntities, MachineStateStore, StoreMachineStatePersistArgs, StoreMachineStatesFindActiveArgs } from '../index'
|
|
4
5
|
import { DataStoreMachineStateMigrations } from '../migrations'
|
|
5
|
-
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
|
|
6
6
|
|
|
7
7
|
describe('Machine State store tests', (): void => {
|
|
8
8
|
let dbConnection: DataSource
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
ImportDcqlQueryItem,
|
|
10
10
|
PDStore,
|
|
11
11
|
} from '../index'
|
|
12
|
-
import { DcqlQueryItem, GetDefinitionsArgs, NonPersistedDcqlQueryItem } from '
|
|
12
|
+
import { DcqlQueryItem, GetDefinitionsArgs, NonPersistedDcqlQueryItem } from '@sphereon/ssi-sdk.data-store-types'
|
|
13
13
|
|
|
14
14
|
export const SAMPLE_DCQL_QUERY_IMPORT: ImportDcqlQueryItem = {
|
|
15
15
|
queryId: 'ajax-club',
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { DataSource } from 'typeorm'
|
|
2
1
|
import { DataSources } from '@sphereon/ssi-sdk.agent-config'
|
|
3
|
-
import { BitstringStatusListEntity, BitstringStatusListEntryEntity, DataStoreStatusListEntities, StatusListEntryEntity } from '../index'
|
|
4
|
-
import { DataStoreStatusListMigrations } from '../migrations'
|
|
5
|
-
import { OAuthStatusListEntity, StatusList2021Entity } from '../entities/statusList/StatusListEntities'
|
|
6
2
|
import { IIssuer, StatusListCredentialIdMode, StatusListDriverType } from '@sphereon/ssi-types'
|
|
3
|
+
import { DataSource } from 'typeorm'
|
|
7
4
|
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
|
|
5
|
+
import { OAuthStatusListEntity, StatusList2021Entity } from '../entities/statusList/StatusListEntities'
|
|
6
|
+
import { BitstringStatusListEntity, BitstringStatusListEntryEntity, DataStoreStatusListEntities, StatusListEntryEntity } from '../index'
|
|
7
|
+
import { DataStoreStatusListMigrations } from '../migrations'
|
|
8
8
|
|
|
9
9
|
describe('Status list entities tests', () => {
|
|
10
10
|
let dbConnection: DataSource
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { DataSource } from 'typeorm'
|
|
2
1
|
import { DataSources } from '@sphereon/ssi-sdk.agent-config'
|
|
2
|
+
import { StatusListCredentialIdMode, StatusListDriverType, StatusListType } from '@sphereon/ssi-types'
|
|
3
|
+
import { DataSource } from 'typeorm'
|
|
4
|
+
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
|
|
3
5
|
import { DataStoreStatusListEntities, IBitstringStatusListEntity } from '../index'
|
|
4
6
|
import { DataStoreStatusListMigrations } from '../migrations'
|
|
5
7
|
import { StatusListStore } from '../statusList/StatusListStore'
|
|
6
8
|
import { IOAuthStatusListEntity, IStatusList2021Entity, IStatusListEntryEntity } from '../types'
|
|
7
|
-
import { StatusListCredentialIdMode, StatusListDriverType, StatusListType } from '@sphereon/ssi-types'
|
|
8
|
-
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
|
|
9
9
|
|
|
10
10
|
describe('Status list store tests', () => {
|
|
11
11
|
let dbConnection: DataSource
|
|
@@ -1,37 +1,5 @@
|
|
|
1
|
-
import { OrPromise } from '@sphereon/ssi-types'
|
|
2
|
-
import { BaseEntity, DataSource, type FindOptionsWhere, In, type Repository } from 'typeorm'
|
|
3
|
-
import Debug from 'debug'
|
|
4
|
-
import { AbstractContactStore } from './AbstractContactStore'
|
|
5
|
-
import { PartyEntity } from '../entities/contact/PartyEntity'
|
|
6
|
-
import { IdentityEntity } from '../entities/contact/IdentityEntity'
|
|
7
|
-
import { IdentityMetadataItemEntity } from '../entities/contact/IdentityMetadataItemEntity'
|
|
8
|
-
import { CorrelationIdentifierEntity } from '../entities/contact/CorrelationIdentifierEntity'
|
|
9
|
-
import { ConnectionEntity } from '../entities/contact/ConnectionEntity'
|
|
10
|
-
import { BaseConfigEntity } from '../entities/contact/BaseConfigEntity'
|
|
11
|
-
import { PartyRelationshipEntity } from '../entities/contact/PartyRelationshipEntity'
|
|
12
|
-
import { PartyTypeEntity } from '../entities/contact/PartyTypeEntity'
|
|
13
|
-
import { BaseContactEntity } from '../entities/contact/BaseContactEntity'
|
|
14
|
-
import { ElectronicAddressEntity } from '../entities/contact/ElectronicAddressEntity'
|
|
15
|
-
import { PhysicalAddressEntity } from '../entities/contact/PhysicalAddressEntity'
|
|
16
|
-
import {
|
|
17
|
-
electronicAddressEntityFrom,
|
|
18
|
-
electronicAddressFrom,
|
|
19
|
-
identityEntityFrom,
|
|
20
|
-
identityFrom,
|
|
21
|
-
isDidAuthConfig,
|
|
22
|
-
isNaturalPerson,
|
|
23
|
-
isOpenIdConfig,
|
|
24
|
-
isOrganization,
|
|
25
|
-
partyEntityFrom,
|
|
26
|
-
partyFrom,
|
|
27
|
-
partyRelationshipEntityFrom,
|
|
28
|
-
partyRelationshipFrom,
|
|
29
|
-
partyTypeEntityFrom,
|
|
30
|
-
partyTypeFrom,
|
|
31
|
-
physicalAddressEntityFrom,
|
|
32
|
-
physicalAddressFrom,
|
|
33
|
-
} from '../utils/contact/MappingUtils'
|
|
34
1
|
import {
|
|
2
|
+
AbstractContactStore,
|
|
35
3
|
AddElectronicAddressArgs,
|
|
36
4
|
AddIdentityArgs,
|
|
37
5
|
AddPartyArgs,
|
|
@@ -53,8 +21,8 @@ import {
|
|
|
53
21
|
GetPhysicalAddressesArgs,
|
|
54
22
|
GetRelationshipArgs,
|
|
55
23
|
GetRelationshipsArgs,
|
|
56
|
-
IMetadataEntity,
|
|
57
24
|
Identity,
|
|
25
|
+
IMetadataEntity,
|
|
58
26
|
MetadataItem,
|
|
59
27
|
MetadataTypes,
|
|
60
28
|
NonPersistedConnectionConfig,
|
|
@@ -76,7 +44,39 @@ import {
|
|
|
76
44
|
UpdatePartyTypeArgs,
|
|
77
45
|
UpdatePhysicalAddressArgs,
|
|
78
46
|
UpdateRelationshipArgs,
|
|
79
|
-
} from '
|
|
47
|
+
} from '@sphereon/ssi-sdk.data-store-types'
|
|
48
|
+
import { OrPromise } from '@sphereon/ssi-types'
|
|
49
|
+
import Debug from 'debug'
|
|
50
|
+
import { BaseEntity, DataSource, type FindOptionsWhere, In, type Repository } from 'typeorm'
|
|
51
|
+
import { BaseConfigEntity } from '../entities/contact/BaseConfigEntity'
|
|
52
|
+
import { BaseContactEntity } from '../entities/contact/BaseContactEntity'
|
|
53
|
+
import { ConnectionEntity } from '../entities/contact/ConnectionEntity'
|
|
54
|
+
import { CorrelationIdentifierEntity } from '../entities/contact/CorrelationIdentifierEntity'
|
|
55
|
+
import { ElectronicAddressEntity } from '../entities/contact/ElectronicAddressEntity'
|
|
56
|
+
import { IdentityEntity } from '../entities/contact/IdentityEntity'
|
|
57
|
+
import { IdentityMetadataItemEntity } from '../entities/contact/IdentityMetadataItemEntity'
|
|
58
|
+
import { PartyEntity } from '../entities/contact/PartyEntity'
|
|
59
|
+
import { PartyRelationshipEntity } from '../entities/contact/PartyRelationshipEntity'
|
|
60
|
+
import { PartyTypeEntity } from '../entities/contact/PartyTypeEntity'
|
|
61
|
+
import { PhysicalAddressEntity } from '../entities/contact/PhysicalAddressEntity'
|
|
62
|
+
import {
|
|
63
|
+
electronicAddressEntityFrom,
|
|
64
|
+
electronicAddressFrom,
|
|
65
|
+
identityEntityFrom,
|
|
66
|
+
identityFrom,
|
|
67
|
+
isDidAuthConfig,
|
|
68
|
+
isNaturalPerson,
|
|
69
|
+
isOpenIdConfig,
|
|
70
|
+
isOrganization,
|
|
71
|
+
partyEntityFrom,
|
|
72
|
+
partyFrom,
|
|
73
|
+
partyRelationshipEntityFrom,
|
|
74
|
+
partyRelationshipFrom,
|
|
75
|
+
partyTypeEntityFrom,
|
|
76
|
+
partyTypeFrom,
|
|
77
|
+
physicalAddressEntityFrom,
|
|
78
|
+
physicalAddressFrom,
|
|
79
|
+
} from '../utils/contact/MappingUtils'
|
|
80
80
|
|
|
81
81
|
const debug: Debug.Debugger = Debug('sphereon:ssi-sdk:contact-store')
|
|
82
82
|
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import { CredentialRole, OrPromise } from '@sphereon/ssi-types'
|
|
2
|
-
import Debug from 'debug'
|
|
3
|
-
import { DataSource, type FindOptionsOrder, type FindOptionsWhere, Repository } from 'typeorm'
|
|
4
|
-
|
|
5
|
-
import { digitalCredentialFrom, digitalCredentialsFrom, nonPersistedDigitalCredentialEntityFromAddArgs } from '../../src'
|
|
6
|
-
import { DigitalCredentialEntity } from '../entities/digitalCredential/DigitalCredentialEntity'
|
|
7
1
|
import {
|
|
2
|
+
AbstractDigitalCredentialStore,
|
|
8
3
|
AddCredentialArgs,
|
|
9
4
|
CredentialStateType,
|
|
10
5
|
DigitalCredential,
|
|
@@ -14,10 +9,14 @@ import {
|
|
|
14
9
|
NonPersistedDigitalCredential,
|
|
15
10
|
RemoveCredentialArgs,
|
|
16
11
|
UpdateCredentialStateArgs,
|
|
17
|
-
} from '
|
|
18
|
-
import {
|
|
12
|
+
} from '@sphereon/ssi-sdk.data-store-types'
|
|
13
|
+
import { CredentialRole, OrPromise } from '@sphereon/ssi-types'
|
|
14
|
+
import Debug from 'debug'
|
|
15
|
+
import { DataSource, type FindOptionsOrder, type FindOptionsWhere, Repository } from 'typeorm'
|
|
19
16
|
|
|
20
|
-
import {
|
|
17
|
+
import { digitalCredentialFrom, digitalCredentialsFrom, nonPersistedDigitalCredentialEntityFromAddArgs } from '../../src'
|
|
18
|
+
import { DigitalCredentialEntity } from '../entities/digitalCredential/DigitalCredentialEntity'
|
|
19
|
+
import { parseAndValidateOrderOptions } from '../utils/SortingUtils'
|
|
21
20
|
|
|
22
21
|
const debug: Debug.Debugger = Debug('sphereon:ssi-sdk:credential-store')
|
|
23
22
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { BaseEntity, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn, TableInheritance } from 'typeorm'
|
|
2
|
+
|
|
3
3
|
import { ConnectionEntity } from './ConnectionEntity'
|
|
4
4
|
|
|
5
5
|
@Entity('BaseConfig')
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
2
|
+
import {
|
|
3
3
|
BaseEntity,
|
|
4
4
|
BeforeInsert,
|
|
5
5
|
BeforeUpdate,
|
|
@@ -11,10 +11,9 @@ const {
|
|
|
11
11
|
PrimaryGeneratedColumn,
|
|
12
12
|
TableInheritance,
|
|
13
13
|
UpdateDateColumn,
|
|
14
|
-
}
|
|
15
|
-
import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
16
|
-
import { PartyEntity } from './PartyEntity'
|
|
14
|
+
} from 'typeorm'
|
|
17
15
|
import { ContactMetadataItemEntity } from './ContactMetadataItemEntity'
|
|
16
|
+
import { PartyEntity } from './PartyEntity'
|
|
18
17
|
|
|
19
18
|
@Entity('BaseContact')
|
|
20
19
|
@TableInheritance({ column: { type: 'varchar', name: 'type' } })
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { ConnectionType } from '@sphereon/ssi-sdk.data-store-types'
|
|
2
|
+
import { BaseEntity, Column, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn } from 'typeorm'
|
|
3
|
+
|
|
3
4
|
import { BaseConfigEntity } from './BaseConfigEntity'
|
|
4
|
-
import {
|
|
5
|
+
import { DidAuthConfigEntity } from './DidAuthConfigEntity'
|
|
5
6
|
import { IdentityEntity } from './IdentityEntity'
|
|
6
7
|
import { OpenIdConfigEntity } from './OpenIdConfigEntity'
|
|
7
|
-
import { DidAuthConfigEntity } from './DidAuthConfigEntity'
|
|
8
8
|
|
|
9
9
|
@Entity('Connection')
|
|
10
10
|
export class ConnectionEntity extends BaseEntity {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import typeorm from 'typeorm'
|
|
2
|
-
const { Entity, Column, PrimaryGeneratedColumn, BaseEntity, ManyToOne, BeforeInsert, BeforeUpdate } = typeorm
|
|
3
|
-
import { IMetadataEntity, ValidationConstraint } from '../../types'
|
|
4
1
|
import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
5
|
-
import {
|
|
2
|
+
import { IMetadataEntity, ValidationConstraint } from '@sphereon/ssi-sdk.data-store-types'
|
|
6
3
|
import { IsNotEmpty, validate, ValidationError } from 'class-validator'
|
|
4
|
+
import { BaseEntity, BeforeInsert, BeforeUpdate, Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm'
|
|
7
5
|
import { getConstraint } from '../../utils/ValidatorUtils'
|
|
6
|
+
import { BaseContactEntity } from './BaseContactEntity'
|
|
8
7
|
|
|
9
8
|
@Entity('ContactMetadata')
|
|
10
9
|
export class ContactMetadataItemEntity extends BaseEntity implements IMetadataEntity {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
const { Entity, Column, PrimaryGeneratedColumn, BaseEntity, OneToOne, JoinColumn, BeforeInsert, BeforeUpdate } = typeorm
|
|
3
|
-
import { CorrelationIdentifierType, ValidationConstraint } from '../../types'
|
|
4
|
-
import { IdentityEntity } from './IdentityEntity'
|
|
1
|
+
import { CorrelationIdentifierType, ValidationConstraint } from '@sphereon/ssi-sdk.data-store-types'
|
|
5
2
|
import { IsNotEmpty, validate, ValidationError } from 'class-validator'
|
|
3
|
+
import { BaseEntity, BeforeInsert, BeforeUpdate, Column, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn } from 'typeorm'
|
|
6
4
|
import { getConstraint } from '../../utils/ValidatorUtils'
|
|
5
|
+
import { IdentityEntity } from './IdentityEntity'
|
|
7
6
|
|
|
8
7
|
@Entity('CorrelationIdentifier')
|
|
9
8
|
export class CorrelationIdentifierEntity extends BaseEntity {
|
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
import { IsNotEmpty, validate, ValidationError } from 'class-validator'
|
|
2
|
-
import typeorm from 'typeorm'
|
|
3
|
-
const { Entity, Column, PrimaryGeneratedColumn, BaseEntity, ManyToOne, BeforeInsert, BeforeUpdate, CreateDateColumn, UpdateDateColumn } = typeorm
|
|
4
1
|
import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
5
|
-
import type { ElectronicAddressType, ValidationConstraint } from '
|
|
6
|
-
import {
|
|
2
|
+
import type { ElectronicAddressType, ValidationConstraint } from '@sphereon/ssi-sdk.data-store-types'
|
|
3
|
+
import { IsNotEmpty, validate, ValidationError } from 'class-validator'
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
BaseEntity,
|
|
7
|
+
BeforeInsert,
|
|
8
|
+
BeforeUpdate,
|
|
9
|
+
Column,
|
|
10
|
+
CreateDateColumn,
|
|
11
|
+
Entity,
|
|
12
|
+
ManyToOne,
|
|
13
|
+
PrimaryGeneratedColumn,
|
|
14
|
+
UpdateDateColumn,
|
|
15
|
+
} from 'typeorm'
|
|
7
16
|
import { getConstraint } from '../../utils/ValidatorUtils'
|
|
17
|
+
import { PartyEntity } from './PartyEntity'
|
|
8
18
|
|
|
9
19
|
@Entity('ElectronicAddress')
|
|
10
20
|
export class ElectronicAddressEntity extends BaseEntity {
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
+
import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
2
|
+
import { IdentityOrigin, ValidationConstraint } from '@sphereon/ssi-sdk.data-store-types'
|
|
3
|
+
import { CredentialRole } from '@sphereon/ssi-types'
|
|
4
|
+
import { IsNotEmpty, validate, ValidationError } from 'class-validator'
|
|
1
5
|
import {
|
|
2
6
|
BaseEntity,
|
|
7
|
+
BeforeInsert,
|
|
8
|
+
BeforeUpdate,
|
|
9
|
+
Column,
|
|
3
10
|
CreateDateColumn,
|
|
4
11
|
Entity,
|
|
5
|
-
PrimaryGeneratedColumn,
|
|
6
|
-
UpdateDateColumn,
|
|
7
|
-
OneToOne,
|
|
8
12
|
JoinColumn,
|
|
9
13
|
ManyToOne,
|
|
10
|
-
Column,
|
|
11
14
|
OneToMany,
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
OneToOne,
|
|
16
|
+
PrimaryGeneratedColumn,
|
|
17
|
+
UpdateDateColumn,
|
|
14
18
|
} from 'typeorm'
|
|
15
|
-
import {
|
|
16
|
-
import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
17
|
-
import { CorrelationIdentifierEntity } from './CorrelationIdentifierEntity'
|
|
19
|
+
import { getConstraint } from '../../utils/ValidatorUtils'
|
|
18
20
|
import { ConnectionEntity } from './ConnectionEntity'
|
|
21
|
+
import { CorrelationIdentifierEntity } from './CorrelationIdentifierEntity'
|
|
19
22
|
import { IdentityMetadataItemEntity } from './IdentityMetadataItemEntity'
|
|
20
|
-
import { IdentityOrigin, ValidationConstraint } from '../../types'
|
|
21
|
-
import { CredentialRole } from '@sphereon/ssi-types'
|
|
22
23
|
import { PartyEntity } from './PartyEntity'
|
|
23
|
-
import { getConstraint } from '../../utils/ValidatorUtils'
|
|
24
24
|
|
|
25
25
|
@Entity('Identity')
|
|
26
26
|
export class IdentityEntity extends BaseEntity {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
2
|
-
import {
|
|
3
|
-
import { IMetadataEntity, ValidationConstraint } from '../../types'
|
|
4
|
-
import { IdentityEntity } from './IdentityEntity'
|
|
2
|
+
import { IMetadataEntity, ValidationConstraint } from '@sphereon/ssi-sdk.data-store-types'
|
|
5
3
|
import { IsNotEmpty, validate, ValidationError } from 'class-validator'
|
|
4
|
+
import { BaseEntity, BeforeInsert, BeforeUpdate, Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm'
|
|
6
5
|
import { getConstraint } from '../../utils/ValidatorUtils'
|
|
6
|
+
import { IdentityEntity } from './IdentityEntity'
|
|
7
7
|
|
|
8
8
|
@Entity('IdentityMetadata')
|
|
9
9
|
export class IdentityMetadataItemEntity extends BaseEntity implements IMetadataEntity {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { validate, IsNotEmpty, ValidationError, Validate } from 'class-validator'
|
|
5
|
-
import { IsNonEmptyStringConstraint } from '../validators'
|
|
1
|
+
import { ValidationConstraint } from '@sphereon/ssi-sdk.data-store-types'
|
|
2
|
+
import { IsNotEmpty, validate, Validate, ValidationError } from 'class-validator'
|
|
3
|
+
import { BeforeInsert, BeforeUpdate, ChildEntity, Column } from 'typeorm'
|
|
6
4
|
import { getConstraint } from '../../utils/ValidatorUtils'
|
|
5
|
+
import { IsNonEmptyStringConstraint } from '../validators'
|
|
6
|
+
import { BaseContactEntity } from './BaseContactEntity'
|
|
7
7
|
|
|
8
8
|
@ChildEntity('NaturalPerson')
|
|
9
9
|
export class NaturalPersonEntity extends BaseContactEntity {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { ValidationConstraint } from '@sphereon/ssi-sdk.data-store-types'
|
|
1
2
|
import { IsNotEmpty, validate, ValidationError } from 'class-validator'
|
|
2
3
|
import { BeforeInsert, BeforeUpdate, ChildEntity, Column } from 'typeorm'
|
|
3
|
-
import { ValidationConstraint } from '../../types'
|
|
4
4
|
import { getConstraint } from '../../utils/ValidatorUtils'
|
|
5
5
|
import { BaseContactEntity } from './BaseContactEntity'
|
|
6
6
|
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
2
|
+
import { ValidationConstraint } from '@sphereon/ssi-sdk.data-store-types'
|
|
3
|
+
import { validate, ValidationError } from 'class-validator'
|
|
1
4
|
import {
|
|
2
5
|
BaseEntity,
|
|
3
6
|
BeforeInsert,
|
|
@@ -12,15 +15,12 @@ import {
|
|
|
12
15
|
PrimaryGeneratedColumn,
|
|
13
16
|
UpdateDateColumn,
|
|
14
17
|
} from 'typeorm'
|
|
15
|
-
import { ValidationConstraint } from '../../types'
|
|
16
|
-
import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
|
|
17
|
-
import { IdentityEntity } from './IdentityEntity'
|
|
18
|
-
import { validate, ValidationError } from 'class-validator'
|
|
19
|
-
import { PartyTypeEntity } from './PartyTypeEntity'
|
|
20
|
-
import { BaseContactEntity } from './BaseContactEntity'
|
|
21
|
-
import { PartyRelationshipEntity } from './PartyRelationshipEntity'
|
|
22
18
|
import { getConstraint } from '../../utils/ValidatorUtils'
|
|
19
|
+
import { BaseContactEntity } from './BaseContactEntity'
|
|
23
20
|
import { ElectronicAddressEntity } from './ElectronicAddressEntity'
|
|
21
|
+
import { IdentityEntity } from './IdentityEntity'
|
|
22
|
+
import { PartyRelationshipEntity } from './PartyRelationshipEntity'
|
|
23
|
+
import { PartyTypeEntity } from './PartyTypeEntity'
|
|
24
24
|
import { PhysicalAddressEntity } from './PhysicalAddressEntity'
|
|
25
25
|
|
|
26
26
|
@Entity('Party')
|