@sphereon/ssi-sdk.data-store 0.23.4 → 0.23.5-unstable.13

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 (35) hide show
  1. package/dist/contact/ContactStore.js +10 -10
  2. package/dist/contact/ContactStore.js.map +1 -1
  3. package/dist/entities/contact/ConnectionEntity.d.ts +2 -2
  4. package/dist/entities/contact/ConnectionEntity.d.ts.map +1 -1
  5. package/dist/entities/contact/ConnectionEntity.js +1 -1
  6. package/dist/entities/contact/ConnectionEntity.js.map +1 -1
  7. package/dist/entities/contact/CorrelationIdentifierEntity.d.ts +2 -2
  8. package/dist/entities/contact/CorrelationIdentifierEntity.js +1 -1
  9. package/dist/entities/contact/IdentityEntity.d.ts +2 -2
  10. package/dist/entities/contact/PartyTypeEntity.d.ts +2 -2
  11. package/dist/entities/contact/PartyTypeEntity.js +1 -1
  12. package/dist/entities/issuanceBranding/ImageAttributesEntity.js +2 -2
  13. package/dist/entities/issuanceBranding/ImageAttributesEntity.js.map +1 -1
  14. package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.js +1 -1
  15. package/dist/migrations/postgres/1685628974232-CreateIssuanceBranding.js.map +1 -1
  16. package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.js +3 -3
  17. package/dist/migrations/sqlite/1685628973231-CreateIssuanceBranding.js.map +1 -1
  18. package/dist/types/contact/IAbstractContactStore.d.ts +2 -2
  19. package/dist/types/contact/contact.d.ts +14 -14
  20. package/dist/types/contact/contact.d.ts.map +1 -1
  21. package/dist/types/contact/contact.js +25 -25
  22. package/dist/types/contact/contact.js.map +1 -1
  23. package/package.json +4 -4
  24. package/src/__tests__/contact.entities.test.ts +141 -141
  25. package/src/__tests__/contact.store.test.ts +195 -195
  26. package/src/contact/ContactStore.ts +15 -15
  27. package/src/entities/contact/ConnectionEntity.ts +3 -3
  28. package/src/entities/contact/CorrelationIdentifierEntity.ts +3 -3
  29. package/src/entities/contact/IdentityEntity.ts +2 -2
  30. package/src/entities/contact/PartyTypeEntity.ts +3 -3
  31. package/src/entities/issuanceBranding/ImageAttributesEntity.ts +2 -2
  32. package/src/migrations/postgres/1685628974232-CreateIssuanceBranding.ts +1 -1
  33. package/src/migrations/sqlite/1685628973231-CreateIssuanceBranding.ts +3 -3
  34. package/src/types/contact/IAbstractContactStore.ts +2 -2
  35. package/src/types/contact/contact.ts +15 -15
@@ -15,9 +15,9 @@ import { PartyRelationshipEntity } from '../entities/contact/PartyRelationshipEn
15
15
  import { PartyTypeEntity } from '../entities/contact/PartyTypeEntity'
16
16
  import { PhysicalAddressEntity } from '../entities/contact/PhysicalAddressEntity'
17
17
  import {
18
- ConnectionTypeEnum,
19
- CorrelationIdentifierEnum,
20
- IdentityRoleEnum,
18
+ ConnectionType,
19
+ CorrelationIdentifierType,
20
+ IdentityRoleType,
21
21
  NaturalPerson,
22
22
  NonPersistedConnection,
23
23
  NonPersistedDidAuthConfig,
@@ -30,7 +30,7 @@ import {
30
30
  NonPersistedPartyType,
31
31
  NonPersistedPhysicalAddress,
32
32
  Organization,
33
- PartyTypeEnum,
33
+ PartyTypeType,
34
34
  } from '../types'
35
35
  import {
36
36
  connectionEntityFrom,
@@ -73,8 +73,8 @@ describe('Database entities tests', (): void => {
73
73
  const party: NonPersistedParty = {
74
74
  uri: 'example.com',
75
75
  partyType: {
76
- type: PartyTypeEnum.NATURAL_PERSON,
77
- origin: PartyOrigin.internal,
76
+ type: PartyTypeType.NATURAL_PERSON,
77
+ origin: PartyOrigin.INTERNAL,
78
78
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
79
79
  name: 'example_name',
80
80
  },
@@ -114,8 +114,8 @@ describe('Database entities tests', (): void => {
114
114
  const party: NonPersistedParty = {
115
115
  uri: 'example.com',
116
116
  partyType: {
117
- type: PartyTypeEnum.ORGANIZATION,
118
- origin: PartyOrigin.internal,
117
+ type: PartyTypeType.ORGANIZATION,
118
+ origin: PartyOrigin.INTERNAL,
119
119
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
120
120
  name: 'example_name',
121
121
  },
@@ -151,8 +151,8 @@ describe('Database entities tests', (): void => {
151
151
  const party1: NonPersistedParty = {
152
152
  uri: 'example1.com',
153
153
  partyType: {
154
- type: PartyTypeEnum.NATURAL_PERSON,
155
- origin: PartyOrigin.internal,
154
+ type: PartyTypeType.NATURAL_PERSON,
155
+ origin: PartyOrigin.INTERNAL,
156
156
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
157
157
  name: 'example_name1',
158
158
  },
@@ -172,8 +172,8 @@ describe('Database entities tests', (): void => {
172
172
  const party2: NonPersistedParty = {
173
173
  uri: 'example2.com',
174
174
  partyType: {
175
- type: PartyTypeEnum.NATURAL_PERSON,
176
- origin: PartyOrigin.internal,
175
+ type: PartyTypeType.NATURAL_PERSON,
176
+ origin: PartyOrigin.INTERNAL,
177
177
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d288',
178
178
  name: 'example_name2',
179
179
  },
@@ -217,8 +217,8 @@ describe('Database entities tests', (): void => {
217
217
  const party: NonPersistedParty = {
218
218
  uri: 'example.com',
219
219
  partyType: {
220
- type: PartyTypeEnum.NATURAL_PERSON,
221
- origin: PartyOrigin.internal,
220
+ type: PartyTypeType.NATURAL_PERSON,
221
+ origin: PartyOrigin.INTERNAL,
222
222
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
223
223
  name: 'example_name',
224
224
  },
@@ -239,8 +239,8 @@ describe('Database entities tests', (): void => {
239
239
  const party: NonPersistedParty = {
240
240
  uri: 'example.com',
241
241
  partyType: {
242
- type: PartyTypeEnum.NATURAL_PERSON,
243
- origin: PartyOrigin.external,
242
+ type: PartyTypeType.NATURAL_PERSON,
243
+ origin: PartyOrigin.EXTERNAL,
244
244
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
245
245
  name: 'example_name',
246
246
  },
@@ -261,8 +261,8 @@ describe('Database entities tests', (): void => {
261
261
  const party: NonPersistedParty = {
262
262
  uri: 'example.com',
263
263
  partyType: {
264
- type: PartyTypeEnum.NATURAL_PERSON,
265
- origin: PartyOrigin.external,
264
+ type: PartyTypeType.NATURAL_PERSON,
265
+ origin: PartyOrigin.EXTERNAL,
266
266
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
267
267
  name: 'example_name',
268
268
  },
@@ -283,8 +283,8 @@ describe('Database entities tests', (): void => {
283
283
  const party: NonPersistedParty = {
284
284
  uri: 'example.com',
285
285
  partyType: {
286
- type: PartyTypeEnum.NATURAL_PERSON,
287
- origin: PartyOrigin.external,
286
+ type: PartyTypeType.NATURAL_PERSON,
287
+ origin: PartyOrigin.EXTERNAL,
288
288
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
289
289
  name: 'example_name',
290
290
  },
@@ -305,8 +305,8 @@ describe('Database entities tests', (): void => {
305
305
  const party: NonPersistedParty = {
306
306
  uri: 'example.com',
307
307
  partyType: {
308
- type: PartyTypeEnum.ORGANIZATION,
309
- origin: PartyOrigin.internal,
308
+ type: PartyTypeType.ORGANIZATION,
309
+ origin: PartyOrigin.INTERNAL,
310
310
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
311
311
  name: 'example_name',
312
312
  },
@@ -325,8 +325,8 @@ describe('Database entities tests', (): void => {
325
325
  const party: NonPersistedParty = {
326
326
  uri: 'example.com',
327
327
  partyType: {
328
- type: PartyTypeEnum.ORGANIZATION,
329
- origin: PartyOrigin.internal,
328
+ type: PartyTypeType.ORGANIZATION,
329
+ origin: PartyOrigin.INTERNAL,
330
330
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
331
331
  name: 'example_name',
332
332
  },
@@ -345,8 +345,8 @@ describe('Database entities tests', (): void => {
345
345
  const party: NonPersistedParty = {
346
346
  uri: 'example.com',
347
347
  partyType: {
348
- type: PartyTypeEnum.NATURAL_PERSON,
349
- origin: PartyOrigin.external,
348
+ type: PartyTypeType.NATURAL_PERSON,
349
+ origin: PartyOrigin.EXTERNAL,
350
350
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
351
351
  name: '',
352
352
  },
@@ -367,8 +367,8 @@ describe('Database entities tests', (): void => {
367
367
  const party: NonPersistedParty = {
368
368
  uri: 'example.com',
369
369
  partyType: {
370
- type: PartyTypeEnum.NATURAL_PERSON,
371
- origin: PartyOrigin.internal,
370
+ type: PartyTypeType.NATURAL_PERSON,
371
+ origin: PartyOrigin.INTERNAL,
372
372
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
373
373
  name: 'example_name',
374
374
  description: '',
@@ -390,8 +390,8 @@ describe('Database entities tests', (): void => {
390
390
  const party: NonPersistedParty = {
391
391
  uri: 'example.com',
392
392
  partyType: {
393
- type: PartyTypeEnum.NATURAL_PERSON,
394
- origin: PartyOrigin.external,
393
+ type: PartyTypeType.NATURAL_PERSON,
394
+ origin: PartyOrigin.EXTERNAL,
395
395
  tenantId: '',
396
396
  name: 'example_name',
397
397
  },
@@ -412,9 +412,9 @@ describe('Database entities tests', (): void => {
412
412
  const alias = 'non_unique_alias'
413
413
  const identity1: NonPersistedIdentity = {
414
414
  alias,
415
- roles: [IdentityRoleEnum.ISSUER, IdentityRoleEnum.VERIFIER],
415
+ roles: [IdentityRoleType.ISSUER, IdentityRoleType.VERIFIER],
416
416
  identifier: {
417
- type: CorrelationIdentifierEnum.DID,
417
+ type: CorrelationIdentifierType.DID,
418
418
  correlationId: 'unique_correlationId1',
419
419
  },
420
420
  }
@@ -423,9 +423,9 @@ describe('Database entities tests', (): void => {
423
423
 
424
424
  const identity2: NonPersistedIdentity = {
425
425
  alias: alias,
426
- roles: [IdentityRoleEnum.ISSUER, IdentityRoleEnum.VERIFIER],
426
+ roles: [IdentityRoleType.ISSUER, IdentityRoleType.VERIFIER],
427
427
  identifier: {
428
- type: CorrelationIdentifierEnum.DID,
428
+ type: CorrelationIdentifierType.DID,
429
429
  correlationId: 'unique_correlationId2',
430
430
  },
431
431
  }
@@ -439,9 +439,9 @@ describe('Database entities tests', (): void => {
439
439
  const correlationId = 'non_unique_correlationId'
440
440
  const identity1: NonPersistedIdentity = {
441
441
  alias: 'unique_alias1',
442
- roles: [IdentityRoleEnum.ISSUER, IdentityRoleEnum.VERIFIER],
442
+ roles: [IdentityRoleType.ISSUER, IdentityRoleType.VERIFIER],
443
443
  identifier: {
444
- type: CorrelationIdentifierEnum.DID,
444
+ type: CorrelationIdentifierType.DID,
445
445
  correlationId,
446
446
  },
447
447
  }
@@ -450,9 +450,9 @@ describe('Database entities tests', (): void => {
450
450
 
451
451
  const identity2: NonPersistedIdentity = {
452
452
  alias: 'unique_alias2',
453
- roles: [IdentityRoleEnum.ISSUER, IdentityRoleEnum.VERIFIER],
453
+ roles: [IdentityRoleType.ISSUER, IdentityRoleType.VERIFIER],
454
454
  identifier: {
455
- type: CorrelationIdentifierEnum.DID,
455
+ type: CorrelationIdentifierType.DID,
456
456
  correlationId,
457
457
  },
458
458
  }
@@ -466,9 +466,9 @@ describe('Database entities tests', (): void => {
466
466
  const correlationId = 'example_did'
467
467
  const identity: NonPersistedIdentity = {
468
468
  alias: correlationId,
469
- roles: [IdentityRoleEnum.ISSUER, IdentityRoleEnum.VERIFIER],
469
+ roles: [IdentityRoleType.ISSUER, IdentityRoleType.VERIFIER],
470
470
  identifier: {
471
- type: CorrelationIdentifierEnum.DID,
471
+ type: CorrelationIdentifierType.DID,
472
472
  correlationId,
473
473
  },
474
474
  }
@@ -495,9 +495,9 @@ describe('Database entities tests', (): void => {
495
495
  it('should throw error when saving identity with blank alias', async (): Promise<void> => {
496
496
  const identity: NonPersistedIdentity = {
497
497
  alias: '',
498
- roles: [IdentityRoleEnum.ISSUER, IdentityRoleEnum.VERIFIER],
498
+ roles: [IdentityRoleType.ISSUER, IdentityRoleType.VERIFIER],
499
499
  identifier: {
500
- type: CorrelationIdentifierEnum.DID,
500
+ type: CorrelationIdentifierType.DID,
501
501
  correlationId: 'example_did',
502
502
  },
503
503
  }
@@ -510,9 +510,9 @@ describe('Database entities tests', (): void => {
510
510
  it('should throw error when saving identity with blank correlation id', async (): Promise<void> => {
511
511
  const identity: NonPersistedIdentity = {
512
512
  alias: 'example_did',
513
- roles: [IdentityRoleEnum.ISSUER, IdentityRoleEnum.VERIFIER],
513
+ roles: [IdentityRoleType.ISSUER, IdentityRoleType.VERIFIER],
514
514
  identifier: {
515
- type: CorrelationIdentifierEnum.DID,
515
+ type: CorrelationIdentifierType.DID,
516
516
  correlationId: '',
517
517
  },
518
518
  }
@@ -526,9 +526,9 @@ describe('Database entities tests', (): void => {
526
526
  const correlationId = 'example_did'
527
527
  const identity: NonPersistedIdentity = {
528
528
  alias: correlationId,
529
- roles: [IdentityRoleEnum.ISSUER, IdentityRoleEnum.VERIFIER],
529
+ roles: [IdentityRoleType.ISSUER, IdentityRoleType.VERIFIER],
530
530
  identifier: {
531
- type: CorrelationIdentifierEnum.DID,
531
+ type: CorrelationIdentifierType.DID,
532
532
  correlationId,
533
533
  },
534
534
  metadata: [
@@ -548,9 +548,9 @@ describe('Database entities tests', (): void => {
548
548
  const correlationId = 'example_did'
549
549
  const identity: NonPersistedIdentity = {
550
550
  alias: correlationId,
551
- roles: [IdentityRoleEnum.ISSUER, IdentityRoleEnum.VERIFIER],
551
+ roles: [IdentityRoleType.ISSUER, IdentityRoleType.VERIFIER],
552
552
  identifier: {
553
- type: CorrelationIdentifierEnum.DID,
553
+ type: CorrelationIdentifierType.DID,
554
554
  correlationId,
555
555
  },
556
556
  metadata: [
@@ -570,13 +570,13 @@ describe('Database entities tests', (): void => {
570
570
  const correlationId = 'example.com'
571
571
  const identity: NonPersistedIdentity = {
572
572
  alias: correlationId,
573
- roles: [IdentityRoleEnum.ISSUER, IdentityRoleEnum.VERIFIER],
573
+ roles: [IdentityRoleType.ISSUER, IdentityRoleType.VERIFIER],
574
574
  identifier: {
575
- type: CorrelationIdentifierEnum.URL,
575
+ type: CorrelationIdentifierType.URL,
576
576
  correlationId,
577
577
  },
578
578
  connection: {
579
- type: ConnectionTypeEnum.OPENID_CONNECT,
579
+ type: ConnectionType.OPENID_CONNECT,
580
580
  config: {
581
581
  clientId: '138d7bf8-c930-4c6e-b928-97d3a4928b01',
582
582
  clientSecret: '03b3955f-d020-4f2a-8a27-4e452d4e27a0',
@@ -615,13 +615,13 @@ describe('Database entities tests', (): void => {
615
615
  const correlationId = 'example.com'
616
616
  const identity: NonPersistedIdentity = {
617
617
  alias: correlationId,
618
- roles: [IdentityRoleEnum.ISSUER, IdentityRoleEnum.VERIFIER],
618
+ roles: [IdentityRoleType.ISSUER, IdentityRoleType.VERIFIER],
619
619
  identifier: {
620
- type: CorrelationIdentifierEnum.URL,
620
+ type: CorrelationIdentifierType.URL,
621
621
  correlationId,
622
622
  },
623
623
  connection: {
624
- type: ConnectionTypeEnum.SIOPv2,
624
+ type: ConnectionType.SIOPv2,
625
625
  config: {
626
626
  identifier: {
627
627
  did: 'did:test:138d7bf8-c930-4c6e-b928-97d3a4928b01',
@@ -662,7 +662,7 @@ describe('Database entities tests', (): void => {
662
662
 
663
663
  it('Should save connection with openid config to database', async (): Promise<void> => {
664
664
  const connection: NonPersistedConnection = {
665
- type: ConnectionTypeEnum.OPENID_CONNECT,
665
+ type: ConnectionType.OPENID_CONNECT,
666
666
  config: {
667
667
  clientId: '138d7bf8-c930-4c6e-b928-97d3a4928b01',
668
668
  clientSecret: '03b3955f-d020-4f2a-8a27-4e452d4e27a0',
@@ -696,7 +696,7 @@ describe('Database entities tests', (): void => {
696
696
 
697
697
  it('Should save connection with didauth config to database', async (): Promise<void> => {
698
698
  const connection: NonPersistedConnection = {
699
- type: ConnectionTypeEnum.SIOPv2,
699
+ type: ConnectionType.SIOPv2,
700
700
  config: {
701
701
  identifier: {
702
702
  did: 'did:test:138d7bf8-c930-4c6e-b928-97d3a4928b01',
@@ -786,8 +786,8 @@ describe('Database entities tests', (): void => {
786
786
  const party1: NonPersistedParty = {
787
787
  uri: 'example.com',
788
788
  partyType: {
789
- type: PartyTypeEnum.NATURAL_PERSON,
790
- origin: PartyOrigin.internal,
789
+ type: PartyTypeType.NATURAL_PERSON,
790
+ origin: PartyOrigin.INTERNAL,
791
791
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
792
792
  name: 'example_name1',
793
793
  },
@@ -807,8 +807,8 @@ describe('Database entities tests', (): void => {
807
807
  const party2: NonPersistedParty = {
808
808
  uri: 'example.com',
809
809
  partyType: {
810
- type: PartyTypeEnum.NATURAL_PERSON,
811
- origin: PartyOrigin.internal,
810
+ type: PartyTypeType.NATURAL_PERSON,
811
+ origin: PartyOrigin.INTERNAL,
812
812
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d288',
813
813
  name: 'example_name2',
814
814
  },
@@ -828,13 +828,13 @@ describe('Database entities tests', (): void => {
828
828
  const correlationId = 'relation_example.com'
829
829
  const identity: NonPersistedIdentity = {
830
830
  alias: correlationId,
831
- roles: [IdentityRoleEnum.ISSUER, IdentityRoleEnum.VERIFIER],
831
+ roles: [IdentityRoleType.ISSUER, IdentityRoleType.VERIFIER],
832
832
  identifier: {
833
- type: CorrelationIdentifierEnum.URL,
833
+ type: CorrelationIdentifierType.URL,
834
834
  correlationId,
835
835
  },
836
836
  connection: {
837
- type: ConnectionTypeEnum.OPENID_CONNECT,
837
+ type: ConnectionType.OPENID_CONNECT,
838
838
  config: {
839
839
  clientId: '138d7bf8-c930-4c6e-b928-97d3a4928b01',
840
840
  clientSecret: '03b3955f-d020-4f2a-8a27-4e452d4e27a0',
@@ -967,8 +967,8 @@ describe('Database entities tests', (): void => {
967
967
  const party: NonPersistedParty = {
968
968
  uri: 'example.com',
969
969
  partyType: {
970
- type: PartyTypeEnum.NATURAL_PERSON,
971
- origin: PartyOrigin.external,
970
+ type: PartyTypeType.NATURAL_PERSON,
971
+ origin: PartyOrigin.EXTERNAL,
972
972
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
973
973
  name: 'example_name',
974
974
  },
@@ -988,13 +988,13 @@ describe('Database entities tests', (): void => {
988
988
  const correlationId = 'relation_example.com'
989
989
  const identity: NonPersistedIdentity = {
990
990
  alias: correlationId,
991
- roles: [IdentityRoleEnum.ISSUER, IdentityRoleEnum.VERIFIER],
991
+ roles: [IdentityRoleType.ISSUER, IdentityRoleType.VERIFIER],
992
992
  identifier: {
993
- type: CorrelationIdentifierEnum.URL,
993
+ type: CorrelationIdentifierType.URL,
994
994
  correlationId,
995
995
  },
996
996
  connection: {
997
- type: ConnectionTypeEnum.SIOPv2,
997
+ type: ConnectionType.SIOPv2,
998
998
  config: {
999
999
  identifier: {
1000
1000
  did: 'did:test:138d7bf8-c930-4c6e-b928-97d3a4928b01',
@@ -1068,8 +1068,8 @@ describe('Database entities tests', (): void => {
1068
1068
  const party: NonPersistedParty = {
1069
1069
  uri: 'example.com',
1070
1070
  partyType: {
1071
- type: PartyTypeEnum.NATURAL_PERSON,
1072
- origin: PartyOrigin.external,
1071
+ type: PartyTypeType.NATURAL_PERSON,
1072
+ origin: PartyOrigin.EXTERNAL,
1073
1073
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
1074
1074
  name: 'example_name',
1075
1075
  },
@@ -1089,13 +1089,13 @@ describe('Database entities tests', (): void => {
1089
1089
  const correlationId = 'relation_example.com'
1090
1090
  const identity: NonPersistedIdentity = {
1091
1091
  alias: correlationId,
1092
- roles: [IdentityRoleEnum.ISSUER, IdentityRoleEnum.VERIFIER],
1092
+ roles: [IdentityRoleType.ISSUER, IdentityRoleType.VERIFIER],
1093
1093
  identifier: {
1094
- type: CorrelationIdentifierEnum.URL,
1094
+ type: CorrelationIdentifierType.URL,
1095
1095
  correlationId,
1096
1096
  },
1097
1097
  connection: {
1098
- type: ConnectionTypeEnum.SIOPv2,
1098
+ type: ConnectionType.SIOPv2,
1099
1099
  config: {
1100
1100
  identifier: {
1101
1101
  did: 'did:test:138d7bf8-c930-4c6e-b928-97d3a4928b01',
@@ -1144,8 +1144,8 @@ describe('Database entities tests', (): void => {
1144
1144
  const party: NonPersistedParty = {
1145
1145
  uri: 'example.com',
1146
1146
  partyType: {
1147
- type: PartyTypeEnum.NATURAL_PERSON,
1148
- origin: PartyOrigin.internal,
1147
+ type: PartyTypeType.NATURAL_PERSON,
1148
+ origin: PartyOrigin.INTERNAL,
1149
1149
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
1150
1150
  name: 'example_name',
1151
1151
  },
@@ -1172,8 +1172,8 @@ describe('Database entities tests', (): void => {
1172
1172
  const party: NonPersistedParty = {
1173
1173
  uri: 'example.com',
1174
1174
  partyType: {
1175
- type: PartyTypeEnum.NATURAL_PERSON,
1176
- origin: PartyOrigin.internal,
1175
+ type: PartyTypeType.NATURAL_PERSON,
1176
+ origin: PartyOrigin.INTERNAL,
1177
1177
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
1178
1178
  name: 'example_name',
1179
1179
  },
@@ -1212,9 +1212,9 @@ describe('Database entities tests', (): void => {
1212
1212
  const correlationId = 'example_did'
1213
1213
  const identity: NonPersistedIdentity = {
1214
1214
  alias: correlationId,
1215
- roles: [IdentityRoleEnum.ISSUER, IdentityRoleEnum.VERIFIER],
1215
+ roles: [IdentityRoleType.ISSUER, IdentityRoleType.VERIFIER],
1216
1216
  identifier: {
1217
- type: CorrelationIdentifierEnum.DID,
1217
+ type: CorrelationIdentifierType.DID,
1218
1218
  correlationId,
1219
1219
  },
1220
1220
  }
@@ -1238,9 +1238,9 @@ describe('Database entities tests', (): void => {
1238
1238
  const correlationId = 'example_did'
1239
1239
  const identity: NonPersistedIdentity = {
1240
1240
  alias: correlationId,
1241
- roles: [IdentityRoleEnum.ISSUER, IdentityRoleEnum.VERIFIER],
1241
+ roles: [IdentityRoleType.ISSUER, IdentityRoleType.VERIFIER],
1242
1242
  identifier: {
1243
- type: CorrelationIdentifierEnum.DID,
1243
+ type: CorrelationIdentifierType.DID,
1244
1244
  correlationId,
1245
1245
  },
1246
1246
  }
@@ -1268,8 +1268,8 @@ describe('Database entities tests', (): void => {
1268
1268
  const party: NonPersistedParty = {
1269
1269
  uri: 'example.com',
1270
1270
  partyType: {
1271
- type: PartyTypeEnum.NATURAL_PERSON,
1272
- origin: PartyOrigin.internal,
1271
+ type: PartyTypeType.NATURAL_PERSON,
1272
+ origin: PartyOrigin.INTERNAL,
1273
1273
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
1274
1274
  name: 'example_name',
1275
1275
  },
@@ -1296,8 +1296,8 @@ describe('Database entities tests', (): void => {
1296
1296
  const party: NonPersistedParty = {
1297
1297
  uri: 'example.com',
1298
1298
  partyType: {
1299
- type: PartyTypeEnum.NATURAL_PERSON,
1300
- origin: PartyOrigin.external,
1299
+ type: PartyTypeType.NATURAL_PERSON,
1300
+ origin: PartyOrigin.EXTERNAL,
1301
1301
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
1302
1302
  name: 'example_name',
1303
1303
  },
@@ -1339,8 +1339,8 @@ describe('Database entities tests', (): void => {
1339
1339
 
1340
1340
  it('Should set last updated date when saving party type', async (): Promise<void> => {
1341
1341
  const partyType: NonPersistedPartyType = {
1342
- type: PartyTypeEnum.NATURAL_PERSON,
1343
- origin: PartyOrigin.external,
1342
+ type: PartyTypeType.NATURAL_PERSON,
1343
+ origin: PartyOrigin.EXTERNAL,
1344
1344
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
1345
1345
  name: 'example_name',
1346
1346
  }
@@ -1358,8 +1358,8 @@ describe('Database entities tests', (): void => {
1358
1358
 
1359
1359
  it('Should set last creation date when saving party type', async (): Promise<void> => {
1360
1360
  const partyType: NonPersistedPartyType = {
1361
- type: PartyTypeEnum.NATURAL_PERSON,
1362
- origin: PartyOrigin.internal,
1361
+ type: PartyTypeType.NATURAL_PERSON,
1362
+ origin: PartyOrigin.INTERNAL,
1363
1363
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
1364
1364
  name: 'example_name',
1365
1365
  }
@@ -1379,9 +1379,9 @@ describe('Database entities tests', (): void => {
1379
1379
  const correlationId = 'example_did'
1380
1380
  const identity: NonPersistedIdentity = {
1381
1381
  alias: correlationId,
1382
- roles: [IdentityRoleEnum.ISSUER, IdentityRoleEnum.VERIFIER],
1382
+ roles: [IdentityRoleType.ISSUER, IdentityRoleType.VERIFIER],
1383
1383
  identifier: {
1384
- type: CorrelationIdentifierEnum.DID,
1384
+ type: CorrelationIdentifierType.DID,
1385
1385
  correlationId,
1386
1386
  },
1387
1387
  }
@@ -1405,8 +1405,8 @@ describe('Database entities tests', (): void => {
1405
1405
  const tenantId = 'non_unique_value'
1406
1406
  const name = 'non_unique_value'
1407
1407
  const partyType1: NonPersistedPartyType = {
1408
- type: PartyTypeEnum.NATURAL_PERSON,
1409
- origin: PartyOrigin.external,
1408
+ type: PartyTypeType.NATURAL_PERSON,
1409
+ origin: PartyOrigin.EXTERNAL,
1410
1410
  tenantId,
1411
1411
  name,
1412
1412
  }
@@ -1417,8 +1417,8 @@ describe('Database entities tests', (): void => {
1417
1417
  expect(savedPartyType1).toBeDefined()
1418
1418
 
1419
1419
  const partyType2: NonPersistedPartyType = {
1420
- type: PartyTypeEnum.NATURAL_PERSON,
1421
- origin: PartyOrigin.internal,
1420
+ type: PartyTypeType.NATURAL_PERSON,
1421
+ origin: PartyOrigin.INTERNAL,
1422
1422
  tenantId,
1423
1423
  name,
1424
1424
  }
@@ -1432,8 +1432,8 @@ describe('Database entities tests', (): void => {
1432
1432
  it('Should enforce unique name when saving party type', async (): Promise<void> => {
1433
1433
  const name = 'non_unique_value'
1434
1434
  const partyType1: NonPersistedPartyType = {
1435
- type: PartyTypeEnum.NATURAL_PERSON,
1436
- origin: PartyOrigin.internal,
1435
+ type: PartyTypeType.NATURAL_PERSON,
1436
+ origin: PartyOrigin.INTERNAL,
1437
1437
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
1438
1438
  name,
1439
1439
  }
@@ -1444,8 +1444,8 @@ describe('Database entities tests', (): void => {
1444
1444
  expect(savedPartyType1).toBeDefined()
1445
1445
 
1446
1446
  const partyType2: NonPersistedPartyType = {
1447
- type: PartyTypeEnum.NATURAL_PERSON,
1448
- origin: PartyOrigin.internal,
1447
+ type: PartyTypeType.NATURAL_PERSON,
1448
+ origin: PartyOrigin.INTERNAL,
1449
1449
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d288',
1450
1450
  name,
1451
1451
  }
@@ -1510,8 +1510,8 @@ describe('Database entities tests', (): void => {
1510
1510
  const party1: NonPersistedParty = {
1511
1511
  uri: 'example1.com',
1512
1512
  partyType: {
1513
- type: PartyTypeEnum.NATURAL_PERSON,
1514
- origin: PartyOrigin.internal,
1513
+ type: PartyTypeType.NATURAL_PERSON,
1514
+ origin: PartyOrigin.INTERNAL,
1515
1515
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
1516
1516
  name: 'example_name1',
1517
1517
  },
@@ -1533,8 +1533,8 @@ describe('Database entities tests', (): void => {
1533
1533
  const party2: NonPersistedParty = {
1534
1534
  uri: 'example2.com',
1535
1535
  partyType: {
1536
- type: PartyTypeEnum.NATURAL_PERSON,
1537
- origin: PartyOrigin.internal,
1536
+ type: PartyTypeType.NATURAL_PERSON,
1537
+ origin: PartyOrigin.INTERNAL,
1538
1538
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d288',
1539
1539
  name: 'example_name2',
1540
1540
  },
@@ -1574,8 +1574,8 @@ describe('Database entities tests', (): void => {
1574
1574
  const party1: NonPersistedParty = {
1575
1575
  uri: 'example1.com',
1576
1576
  partyType: {
1577
- type: PartyTypeEnum.NATURAL_PERSON,
1578
- origin: PartyOrigin.internal,
1577
+ type: PartyTypeType.NATURAL_PERSON,
1578
+ origin: PartyOrigin.INTERNAL,
1579
1579
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
1580
1580
  name: 'example_name1',
1581
1581
  },
@@ -1595,8 +1595,8 @@ describe('Database entities tests', (): void => {
1595
1595
  const party2: NonPersistedParty = {
1596
1596
  uri: 'example2.com',
1597
1597
  partyType: {
1598
- type: PartyTypeEnum.NATURAL_PERSON,
1599
- origin: PartyOrigin.internal,
1598
+ type: PartyTypeType.NATURAL_PERSON,
1599
+ origin: PartyOrigin.INTERNAL,
1600
1600
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d288',
1601
1601
  name: 'example_name2',
1602
1602
  },
@@ -1634,8 +1634,8 @@ describe('Database entities tests', (): void => {
1634
1634
  const party1: NonPersistedParty = {
1635
1635
  uri: 'example1.com',
1636
1636
  partyType: {
1637
- type: PartyTypeEnum.NATURAL_PERSON,
1638
- origin: PartyOrigin.internal,
1637
+ type: PartyTypeType.NATURAL_PERSON,
1638
+ origin: PartyOrigin.INTERNAL,
1639
1639
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
1640
1640
  name: 'example_name1',
1641
1641
  },
@@ -1655,8 +1655,8 @@ describe('Database entities tests', (): void => {
1655
1655
  const party2: NonPersistedParty = {
1656
1656
  uri: 'example2.com',
1657
1657
  partyType: {
1658
- type: PartyTypeEnum.NATURAL_PERSON,
1659
- origin: PartyOrigin.internal,
1658
+ type: PartyTypeType.NATURAL_PERSON,
1659
+ origin: PartyOrigin.INTERNAL,
1660
1660
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d288',
1661
1661
  name: 'example_name2',
1662
1662
  },
@@ -1694,8 +1694,8 @@ describe('Database entities tests', (): void => {
1694
1694
  const party1: NonPersistedParty = {
1695
1695
  uri: 'example1.com',
1696
1696
  partyType: {
1697
- type: PartyTypeEnum.NATURAL_PERSON,
1698
- origin: PartyOrigin.internal,
1697
+ type: PartyTypeType.NATURAL_PERSON,
1698
+ origin: PartyOrigin.INTERNAL,
1699
1699
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
1700
1700
  name: 'example_name1',
1701
1701
  },
@@ -1717,8 +1717,8 @@ describe('Database entities tests', (): void => {
1717
1717
  const party2: NonPersistedParty = {
1718
1718
  uri: 'example2.com',
1719
1719
  partyType: {
1720
- type: PartyTypeEnum.NATURAL_PERSON,
1721
- origin: PartyOrigin.internal,
1720
+ type: PartyTypeType.NATURAL_PERSON,
1721
+ origin: PartyOrigin.INTERNAL,
1722
1722
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d288',
1723
1723
  name: 'example_name2',
1724
1724
  },
@@ -1770,8 +1770,8 @@ describe('Database entities tests', (): void => {
1770
1770
  const party1: NonPersistedParty = {
1771
1771
  uri: 'example1.com',
1772
1772
  partyType: {
1773
- type: PartyTypeEnum.NATURAL_PERSON,
1774
- origin: PartyOrigin.internal,
1773
+ type: PartyTypeType.NATURAL_PERSON,
1774
+ origin: PartyOrigin.INTERNAL,
1775
1775
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
1776
1776
  name: 'example_name1',
1777
1777
  },
@@ -1793,8 +1793,8 @@ describe('Database entities tests', (): void => {
1793
1793
  const party2: NonPersistedParty = {
1794
1794
  uri: 'example2.com',
1795
1795
  partyType: {
1796
- type: PartyTypeEnum.NATURAL_PERSON,
1797
- origin: PartyOrigin.internal,
1796
+ type: PartyTypeType.NATURAL_PERSON,
1797
+ origin: PartyOrigin.INTERNAL,
1798
1798
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d288',
1799
1799
  name: 'example_name2',
1800
1800
  },
@@ -1836,8 +1836,8 @@ describe('Database entities tests', (): void => {
1836
1836
 
1837
1837
  it('Should save party type to database', async (): Promise<void> => {
1838
1838
  const partyType: NonPersistedPartyType = {
1839
- type: PartyTypeEnum.NATURAL_PERSON,
1840
- origin: PartyOrigin.internal,
1839
+ type: PartyTypeType.NATURAL_PERSON,
1840
+ origin: PartyOrigin.INTERNAL,
1841
1841
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
1842
1842
  name: 'example_name',
1843
1843
  }
@@ -1972,8 +1972,8 @@ describe('Database entities tests', (): void => {
1972
1972
  const party: NonPersistedParty = {
1973
1973
  uri: 'example.com',
1974
1974
  partyType: {
1975
- type: PartyTypeEnum.NATURAL_PERSON,
1976
- origin: PartyOrigin.internal,
1975
+ type: PartyTypeType.NATURAL_PERSON,
1976
+ origin: PartyOrigin.INTERNAL,
1977
1977
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
1978
1978
  name: 'example_name',
1979
1979
  },
@@ -2006,8 +2006,8 @@ describe('Database entities tests', (): void => {
2006
2006
  const party: NonPersistedParty = {
2007
2007
  uri: 'example.com',
2008
2008
  partyType: {
2009
- type: PartyTypeEnum.ORGANIZATION,
2010
- origin: PartyOrigin.internal,
2009
+ type: PartyTypeType.ORGANIZATION,
2010
+ origin: PartyOrigin.INTERNAL,
2011
2011
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
2012
2012
  name: 'example_name',
2013
2013
  },
@@ -2037,8 +2037,8 @@ describe('Database entities tests', (): void => {
2037
2037
  const party: NonPersistedParty = {
2038
2038
  uri: 'example.com',
2039
2039
  partyType: {
2040
- type: PartyTypeEnum.NATURAL_PERSON,
2041
- origin: PartyOrigin.internal,
2040
+ type: PartyTypeType.NATURAL_PERSON,
2041
+ origin: PartyOrigin.INTERNAL,
2042
2042
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
2043
2043
  name: 'example_name',
2044
2044
  },
@@ -2071,8 +2071,8 @@ describe('Database entities tests', (): void => {
2071
2071
  const party1: NonPersistedParty = {
2072
2072
  uri: 'example1.com',
2073
2073
  partyType: {
2074
- type: PartyTypeEnum.NATURAL_PERSON,
2075
- origin: PartyOrigin.internal,
2074
+ type: PartyTypeType.NATURAL_PERSON,
2075
+ origin: PartyOrigin.INTERNAL,
2076
2076
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
2077
2077
  name: 'example_name1',
2078
2078
  },
@@ -2094,8 +2094,8 @@ describe('Database entities tests', (): void => {
2094
2094
  const party2: NonPersistedParty = {
2095
2095
  uri: 'example2.com',
2096
2096
  partyType: {
2097
- type: PartyTypeEnum.NATURAL_PERSON,
2098
- origin: PartyOrigin.internal,
2097
+ type: PartyTypeType.NATURAL_PERSON,
2098
+ origin: PartyOrigin.INTERNAL,
2099
2099
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d288',
2100
2100
  name: 'example_name2',
2101
2101
  },
@@ -2136,8 +2136,8 @@ describe('Database entities tests', (): void => {
2136
2136
 
2137
2137
  it('Should delete party type', async (): Promise<void> => {
2138
2138
  const partyType: NonPersistedPartyType = {
2139
- type: PartyTypeEnum.NATURAL_PERSON,
2140
- origin: PartyOrigin.internal,
2139
+ type: PartyTypeType.NATURAL_PERSON,
2140
+ origin: PartyOrigin.INTERNAL,
2141
2141
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
2142
2142
  name: 'example_name',
2143
2143
  }
@@ -2160,8 +2160,8 @@ describe('Database entities tests', (): void => {
2160
2160
  const party: NonPersistedParty = {
2161
2161
  uri: 'example.com',
2162
2162
  partyType: {
2163
- type: PartyTypeEnum.NATURAL_PERSON,
2164
- origin: PartyOrigin.internal,
2163
+ type: PartyTypeType.NATURAL_PERSON,
2164
+ origin: PartyOrigin.INTERNAL,
2165
2165
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
2166
2166
  name: 'example_name',
2167
2167
  },
@@ -2187,8 +2187,8 @@ describe('Database entities tests', (): void => {
2187
2187
 
2188
2188
  it('Should save party with existing party type', async (): Promise<void> => {
2189
2189
  const partyType: NonPersistedPartyType = {
2190
- type: PartyTypeEnum.NATURAL_PERSON,
2191
- origin: PartyOrigin.internal,
2190
+ type: PartyTypeType.NATURAL_PERSON,
2191
+ origin: PartyOrigin.INTERNAL,
2192
2192
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
2193
2193
  name: 'example_name',
2194
2194
  }
@@ -2228,19 +2228,19 @@ describe('Database entities tests', (): void => {
2228
2228
 
2229
2229
  it('Should not update creation date when saving party type', async (): Promise<void> => {
2230
2230
  const partyType: NonPersistedPartyType = {
2231
- type: PartyTypeEnum.NATURAL_PERSON,
2232
- origin: PartyOrigin.internal,
2231
+ type: PartyTypeType.NATURAL_PERSON,
2232
+ origin: PartyOrigin.INTERNAL,
2233
2233
  tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
2234
2234
  name: 'example_name',
2235
2235
  }
2236
2236
 
2237
2237
  const partyTypeEntity: PartyTypeEntity = partyTypeEntityFrom(partyType)
2238
2238
  const savedPartyType: PartyTypeEntity | null = await dbConnection.getRepository(PartyTypeEntity).save(partyTypeEntity)
2239
- await dbConnection.getRepository(PartyTypeEntity).save({ ...savedPartyType, type: PartyTypeEnum.ORGANIZATION })
2239
+ await dbConnection.getRepository(PartyTypeEntity).save({ ...savedPartyType, type: PartyTypeType.ORGANIZATION })
2240
2240
 
2241
2241
  const fromDb: PartyTypeEntity | null = await dbConnection.getRepository(PartyTypeEntity).findOne({
2242
2242
  where: {
2243
- type: PartyTypeEnum.ORGANIZATION,
2243
+ type: PartyTypeType.ORGANIZATION,
2244
2244
  },
2245
2245
  })
2246
2246