@sphereon/ssi-sdk.data-store 0.34.1-feature.SSISDK.62.219 → 0.34.1-feature.SSISDK.62.224

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.
Files changed (100) hide show
  1. package/dist/index.cjs +2358 -2522
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +321 -1245
  4. package/dist/index.d.ts +321 -1245
  5. package/dist/index.js +2301 -2465
  6. package/dist/index.js.map +1 -1
  7. package/package.json +8 -7
  8. package/src/__tests__/contact.store.test.ts +3 -3
  9. package/src/__tests__/digitalCredential.entities.test.ts +5 -5
  10. package/src/__tests__/eventLogger.entities.test.ts +2 -2
  11. package/src/__tests__/eventLogger.store.test.ts +3 -3
  12. package/src/__tests__/issuanceBranding.entities.test.ts +2 -2
  13. package/src/__tests__/issuanceBranding.store.test.ts +3 -3
  14. package/src/__tests__/machineState.entities.test.ts +1 -1
  15. package/src/__tests__/machineState.store.test.ts +1 -1
  16. package/src/__tests__/statusList.entities.test.ts +4 -4
  17. package/src/__tests__/statusList.store.test.ts +3 -3
  18. package/src/contact/ContactStore.ts +35 -35
  19. package/src/digitalCredential/DigitalCredentialStore.ts +8 -9
  20. package/src/entities/contact/BaseConfigEntity.ts +2 -2
  21. package/src/entities/contact/BaseContactEntity.ts +4 -5
  22. package/src/entities/contact/ConnectionEntity.ts +4 -4
  23. package/src/entities/contact/ContactMetadataItemEntity.ts +3 -4
  24. package/src/entities/contact/CorrelationIdentifierEntity.ts +3 -4
  25. package/src/entities/contact/DidAuthConfigEntity.ts +1 -2
  26. package/src/entities/contact/ElectronicAddressEntity.ts +15 -5
  27. package/src/entities/contact/IdentityEntity.ts +12 -12
  28. package/src/entities/contact/IdentityMetadataItemEntity.ts +3 -3
  29. package/src/entities/contact/NaturalPersonEntity.ts +5 -5
  30. package/src/entities/contact/OrganizationEntity.ts +1 -1
  31. package/src/entities/contact/PartyEntity.ts +7 -7
  32. package/src/entities/contact/PartyRelationshipEntity.ts +8 -8
  33. package/src/entities/contact/PartyTypeEntity.ts +4 -4
  34. package/src/entities/contact/PhysicalAddressEntity.ts +3 -3
  35. package/src/entities/digitalCredential/DigitalCredentialEntity.ts +3 -3
  36. package/src/entities/eventLogger/AuditEventEntity.ts +2 -2
  37. package/src/entities/issuanceBranding/BackgroundAttributesEntity.ts +2 -2
  38. package/src/entities/issuanceBranding/BaseLocaleBrandingEntity.ts +6 -7
  39. package/src/entities/issuanceBranding/CredentialBrandingEntity.ts +2 -2
  40. package/src/entities/issuanceBranding/CredentialClaimsEntity.ts +2 -2
  41. package/src/entities/issuanceBranding/CredentialLocaleBrandingEntity.ts +2 -2
  42. package/src/entities/issuanceBranding/ImageAttributesEntity.ts +2 -2
  43. package/src/entities/issuanceBranding/IssuerBrandingEntity.ts +2 -2
  44. package/src/entities/issuanceBranding/IssuerLocaleBrandingEntity.ts +3 -3
  45. package/src/entities/issuanceBranding/TextAttributesEntity.ts +1 -1
  46. package/src/entities/machineState/MachineStateInfoEntity.ts +1 -1
  47. package/src/entities/presentationDefinition/DcqlQueryItemEntity.ts +2 -2
  48. package/src/entities/statusList/BitstringStatusListEntryEntity.ts +1 -1
  49. package/src/entities/statusList/StatusListEntities.ts +3 -4
  50. package/src/eventLogger/EventLoggerStore.ts +2 -2
  51. package/src/index.ts +19 -24
  52. package/src/issuanceBranding/IssuanceBrandingStore.ts +25 -25
  53. package/src/machineState/MachineStateStore.ts +7 -7
  54. package/src/migrations/generic/1-CreateContacts.ts +1 -1
  55. package/src/migrations/generic/10-CreatePresentationDefinitions.ts +1 -1
  56. package/src/migrations/generic/11-FixCredentialClaimsReferenceUuid.ts +2 -2
  57. package/src/migrations/generic/2-CreateIssuanceBranding.ts +1 -1
  58. package/src/migrations/generic/3-CreateContacts.ts +2 -2
  59. package/src/migrations/generic/4-CreateStatusList.ts +1 -1
  60. package/src/migrations/generic/5-CreateAuditEvents.ts +2 -2
  61. package/src/migrations/generic/6-CreateDigitalCredential.ts +1 -1
  62. package/src/migrations/generic/7-CreateMachineStateStore.ts +1 -1
  63. package/src/migrations/generic/8-CreateContacts.ts +1 -1
  64. package/src/migrations/generic/9-CreateContacts.ts +1 -1
  65. package/src/migrations/postgres/1659463079428-CreateContacts.ts +1 -1
  66. package/src/migrations/postgres/1685628974232-CreateIssuanceBranding.ts +1 -1
  67. package/src/migrations/postgres/1690925872592-CreateContacts.ts +1 -1
  68. package/src/presentationDefinition/PDStore.ts +7 -7
  69. package/src/statusList/IStatusListStore.ts +1 -1
  70. package/src/statusList/StatusListStore.ts +3 -3
  71. package/src/types/index.ts +0 -11
  72. package/src/types/statusList/IAbstractStatusListStore.ts +9 -9
  73. package/src/utils/ValidatorUtils.ts +1 -1
  74. package/src/utils/contact/MappingUtils.ts +10 -10
  75. package/src/utils/digitalCredential/MappingUtils.ts +3 -21
  76. package/src/utils/eventLogger/MappingUtils.ts +2 -2
  77. package/src/utils/issuanceBranding/MappingUtils.ts +13 -13
  78. package/src/utils/presentationDefinition/MappingUtils.ts +1 -1
  79. package/src/utils/statusList/MappingUtils.ts +1 -1
  80. package/src/contact/AbstractContactStore.ts +0 -71
  81. package/src/digitalCredential/AbstractDigitalCredentialStore.ts +0 -21
  82. package/src/eventLogger/AbstractEventLoggerStore.ts +0 -9
  83. package/src/issuanceBranding/AbstractIssuanceBrandingStore.ts +0 -41
  84. package/src/machineState/IAbstractMachineStateStore.ts +0 -65
  85. package/src/presentationDefinition/AbstractPDStore.ts +0 -20
  86. package/src/types/contact/IAbstractContactStore.ts +0 -161
  87. package/src/types/contact/contact.ts +0 -295
  88. package/src/types/contact/index.ts +0 -2
  89. package/src/types/digitalCredential/IAbstractDigitalCredentialStore.ts +0 -44
  90. package/src/types/digitalCredential/enums.ts +0 -63
  91. package/src/types/digitalCredential/index.ts +0 -3
  92. package/src/types/digitalCredential/types.ts +0 -40
  93. package/src/types/eventLogger/IAbstractEventLoggerStore.ts +0 -22
  94. package/src/types/eventLogger/eventLogger.ts +0 -4
  95. package/src/types/issuanceBranding/IAbstractIssuanceBrandingStore.ts +0 -85
  96. package/src/types/issuanceBranding/issuanceBranding.ts +0 -138
  97. package/src/types/machineState/IAbstractMachineStateStore.ts +0 -68
  98. package/src/types/presentationDefinition/IAbstractPDStore.ts +0 -25
  99. package/src/types/presentationDefinition/presentationDefinition.ts +0 -18
  100. 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-feature.SSISDK.62.219+f3e005e9",
3
+ "version": "0.34.1-feature.SSISDK.62.224+06f4a658",
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-feature.SSISDK.62.219+f3e005e9",
32
- "@sphereon/ssi-sdk-ext.identifier-resolution": "0.34.1-feature.SSISDK.62.219+f3e005e9",
33
- "@sphereon/ssi-sdk.agent-config": "0.34.1-feature.SSISDK.62.219+f3e005e9",
34
- "@sphereon/ssi-sdk.core": "0.34.1-feature.SSISDK.62.219+f3e005e9",
35
- "@sphereon/ssi-types": "0.34.1-feature.SSISDK.62.219+f3e005e9",
31
+ "@sphereon/ssi-sdk-ext.did-utils": "0.34.1-feature.SSISDK.62.224+06f4a658",
32
+ "@sphereon/ssi-sdk-ext.identifier-resolution": "0.34.1-feature.SSISDK.62.224+06f4a658",
33
+ "@sphereon/ssi-sdk.agent-config": "0.34.1-feature.SSISDK.62.224+06f4a658",
34
+ "@sphereon/ssi-sdk.core": "0.34.1-feature.SSISDK.62.224+06f4a658",
35
+ "@sphereon/ssi-sdk.data-store-types": "0.34.1-feature.SSISDK.62.224+06f4a658",
36
+ "@sphereon/ssi-types": "0.34.1-feature.SSISDK.62.224+06f4a658",
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": "f3e005e98495aaa97478b4448b86fa2a40ecc4de"
69
+ "gitHead": "06f4a658d4c8d144fe6d287d485a9d5ee282287b"
69
70
  }
@@ -1,7 +1,9 @@
1
1
  import { DataSources } from '@sphereon/ssi-sdk.agent-config'
2
+ import { CredentialRole } from '@sphereon/ssi-types'
2
3
  import { DataSource } from 'typeorm'
3
- import { ConnectionType, DataStoreContactEntities, DataStoreMigrations, IdentityOrigin, MetadataItem, MetadataTypes, PartyOrigin } from '../index'
4
+ import { afterEach, beforeEach, describe, expect, it } from 'vitest'
4
5
  import { ContactStore } from '../contact/ContactStore'
6
+ import { ConnectionType, DataStoreContactEntities, DataStoreMigrations, IdentityOrigin, MetadataItem, MetadataTypes, PartyOrigin } from '../index'
5
7
  import {
6
8
  CorrelationIdentifierType,
7
9
  ElectronicAddress,
@@ -25,8 +27,6 @@ import {
25
27
  PartyTypeType,
26
28
  PhysicalAddress,
27
29
  } from '../types'
28
- import { afterEach, beforeEach, describe, expect, it } from 'vitest'
29
- import { CredentialRole } from "@sphereon/ssi-types"
30
30
 
31
31
  describe('Contact store tests', (): void => {
32
32
  let dbConnection: DataSource
@@ -1,14 +1,14 @@
1
1
  import { DataSources } from '@sphereon/ssi-sdk.agent-config'
2
+ import { defaultHasher } from '@sphereon/ssi-sdk.core'
2
3
  import { CredentialRole } from '@sphereon/ssi-types'
4
+ import { computeEntryHash } from '@veramo/utils'
3
5
  import { DataSource } from 'typeorm'
6
+ import { afterEach, beforeEach, describe, expect, it } from 'vitest'
7
+ import { DigitalCredentialEntity } from '../entities/digitalCredential/DigitalCredentialEntity'
4
8
  import { DataStoreDigitalCredentialEntities } from '../index'
5
9
  import { DataStoreDigitalCredentialMigrations } from '../migrations'
6
- import { DigitalCredentialEntity } from '../entities/digitalCredential/DigitalCredentialEntity'
7
- import { computeEntryHash } from '@veramo/utils'
8
- import { nonPersistedDigitalCredentialEntityFromAddArgs } from '../utils/digitalCredential/MappingUtils'
9
10
  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'
11
+ import { nonPersistedDigitalCredentialEntityFromAddArgs } from '../utils/digitalCredential/MappingUtils'
12
12
 
13
13
  describe('Database entities tests', (): void => {
14
14
  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 { AuditEventEntity } from '../entities/eventLogger/AuditEventEntity'
8
9
  import { NonPersistedActivityLoggingEvent, NonPersistedAuditLoggingEvent } from '../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,11 @@ 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'
5
+ import { afterEach, beforeEach, describe, expect, it } from 'vitest'
7
6
  import { EventLoggerStore } from '../eventLogger/EventLoggerStore'
7
+ import { DataStoreEventLoggerEntities } from '../index'
8
+ import { DataStoreEventLoggerMigrations } from '../migrations'
8
9
  import { GetActivityEventsArgs, GetAuditEventsArgs, NonPersistedActivityLoggingEvent, NonPersistedAuditLoggingEvent } from '../types'
9
- import { afterEach, beforeEach, describe, expect, it } from 'vitest'
10
10
 
11
11
  describe('Database entities tests', (): void => {
12
12
  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 { DataStoreMigrations } from '../migrations'
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 { afterEach, beforeEach, describe, expect, it } from 'vitest'
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 { IssuanceBrandingStore } from '../issuanceBranding/IssuanceBrandingStore'
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 { afterEach, beforeEach, describe, expect, it } from 'vitest'
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
@@ -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 '../types'
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 '../types'
18
- import { parseAndValidateOrderOptions } from '../utils/SortingUtils'
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 { AbstractDigitalCredentialStore } from './AbstractDigitalCredentialStore'
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 typeorm from 'typeorm'
2
- const { BaseEntity, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn, TableInheritance } = typeorm
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 typeorm from 'typeorm'
2
- const {
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
- } = typeorm
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 typeorm from 'typeorm'
2
- const { Entity, Column, PrimaryGeneratedColumn, OneToOne, JoinColumn, BaseEntity } = typeorm
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 { ConnectionType } from '../../types'
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 { BaseContactEntity } from './BaseContactEntity'
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 typeorm from 'typeorm'
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,5 +1,4 @@
1
- import typeorm from 'typeorm'
2
- const { ChildEntity, Column } = typeorm
1
+ import { ChildEntity, Column } from 'typeorm'
3
2
  import { BaseConfigEntity } from './BaseConfigEntity'
4
3
 
5
4
  @ChildEntity('DidAuthConfig')
@@ -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 '../../types/index'
6
- import { PartyEntity } from './PartyEntity'
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
- BeforeInsert,
13
- BeforeUpdate,
15
+ OneToOne,
16
+ PrimaryGeneratedColumn,
17
+ UpdateDateColumn,
14
18
  } from 'typeorm'
15
- import { IsNotEmpty, validate, ValidationError } from 'class-validator'
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 { Entity, Column, PrimaryGeneratedColumn, BaseEntity, ManyToOne, BeforeInsert, BeforeUpdate } from 'typeorm'
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 { Column, ChildEntity, BeforeInsert, BeforeUpdate } from 'typeorm'
2
- import { BaseContactEntity } from './BaseContactEntity'
3
- import { ValidationConstraint } from '../../types'
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')
@@ -1,16 +1,16 @@
1
+ import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
1
2
  import {
2
- Entity,
3
- PrimaryGeneratedColumn,
4
- CreateDateColumn,
5
- UpdateDateColumn,
6
- ManyToOne,
7
- Column,
8
- Index,
9
3
  BeforeInsert,
10
4
  BeforeUpdate,
5
+ Column,
6
+ CreateDateColumn,
7
+ Entity,
8
+ Index,
11
9
  JoinColumn,
10
+ ManyToOne,
11
+ PrimaryGeneratedColumn,
12
+ UpdateDateColumn,
12
13
  } from 'typeorm'
13
- import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
14
14
  import { PartyEntity } from './PartyEntity'
15
15
 
16
16
  @Entity('PartyRelationship')
@@ -1,10 +1,10 @@
1
- import { BeforeInsert, BeforeUpdate, Column, CreateDateColumn, Entity, Index, OneToMany, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'
2
1
  import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
3
- import { PartyEntity } from './PartyEntity'
4
- import { PartyOrigin, PartyTypeType, ValidationConstraint } from '../../types'
2
+ import { PartyOrigin, PartyTypeType, ValidationConstraint } from '@sphereon/ssi-sdk.data-store-types'
5
3
  import { IsNotEmpty, Validate, validate, ValidationError } from 'class-validator'
6
- import { IsNonEmptyStringConstraint } from '../validators'
4
+ import { BeforeInsert, BeforeUpdate, Column, CreateDateColumn, Entity, Index, OneToMany, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'
7
5
  import { getConstraint } from '../../utils/ValidatorUtils'
6
+ import { IsNonEmptyStringConstraint } from '../validators'
7
+ import { PartyEntity } from './PartyEntity'
8
8
 
9
9
  @Entity('PartyType')
10
10
  @Index('IDX_PartyType_type_tenant_id', ['type', 'tenantId'], { unique: true })
@@ -1,3 +1,5 @@
1
+ import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
2
+ import type { PhysicalAddressType, ValidationConstraint } from '@sphereon/ssi-sdk.data-store-types'
1
3
  import { IsNotEmpty, Validate, validate, ValidationError } from 'class-validator'
2
4
  import {
3
5
  BaseEntity,
@@ -10,11 +12,9 @@ import {
10
12
  PrimaryGeneratedColumn,
11
13
  UpdateDateColumn,
12
14
  } from 'typeorm'
13
- import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
14
15
  import { getConstraint } from '../../utils/ValidatorUtils'
15
- import type { PhysicalAddressType, ValidationConstraint } from '../../types/index'
16
- import { PartyEntity } from './PartyEntity'
17
16
  import { IsNonEmptyStringConstraint } from '../validators'
17
+ import { PartyEntity } from './PartyEntity'
18
18
 
19
19
  @Entity('PhysicalAddress')
20
20
  export class PhysicalAddressEntity extends BaseEntity {
@@ -1,6 +1,4 @@
1
1
  import { typeormDate, typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
2
- import { CredentialRole } from '@sphereon/ssi-types'
3
- import { BaseEntity, Column, CreateDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'
4
2
 
5
3
  import {
6
4
  CredentialCorrelationType,
@@ -9,7 +7,9 @@ import {
9
7
  type DigitalCredential,
10
8
  DocumentType,
11
9
  RegulationType,
12
- } from '../../types'
10
+ } from '@sphereon/ssi-sdk.data-store-types'
11
+ import { CredentialRole } from '@sphereon/ssi-types'
12
+ import { BaseEntity, Column, CreateDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'
13
13
 
14
14
  @Entity('DigitalCredential')
15
15
  export class DigitalCredentialEntity extends BaseEntity implements DigitalCredential {
@@ -1,3 +1,5 @@
1
+ import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
2
+ import { CredentialType, PartyCorrelationType } from '@sphereon/ssi-sdk.core'
1
3
  import {
2
4
  type ActionSubType,
3
5
  ActionType,
@@ -8,8 +10,6 @@ import {
8
10
  System,
9
11
  SystemCorrelationIdType,
10
12
  } from '@sphereon/ssi-types'
11
- import { CredentialType, PartyCorrelationType } from '@sphereon/ssi-sdk.core'
12
- import { typeOrmDateTime } from '@sphereon/ssi-sdk.agent-config'
13
13
  import { BaseEntity, Column, CreateDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'
14
14
 
15
15
  //TODO this entity, also contains some optional fields that are related to another event type (Activity) later we might want to refactor and reorganize this.