Skip to content

Commit

Permalink
fix: enum fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Brummos committed May 1, 2024
1 parent 42dc33a commit dc3fb0d
Show file tree
Hide file tree
Showing 11 changed files with 424 additions and 424 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { TAgent } from '@veramo/core'
import {
CorrelationIdentifierEnum,
CorrelationIdentifierType,
ElectronicAddress,
GetPartiesArgs,
Identity,
IdentityRoleEnum,
IdentityRoleType,
NaturalPerson,
NonPersistedElectronicAddress,
NonPersistedIdentity,
NonPersistedPhysicalAddress,
Party,
PartyOrigin,
PartyRelationship,
PartyTypeEnum,
PartyTypeType,
PhysicalAddress,
} from '../../../data-store/src'
import { AddContactArgs, IContactManager } from '../../src'
Expand All @@ -35,8 +35,8 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
lastName: 'default_last_name',
displayName: 'default_display_name',
contactType: {
type: PartyTypeEnum.NATURAL_PERSON,
origin: PartyOrigin.external,
type: PartyTypeType.NATURAL_PERSON,
origin: PartyOrigin.EXTERNAL,
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d289',
name: 'example_name',
},
Expand All @@ -45,9 +45,9 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
const correlationId = 'default_example_did'
const identity: NonPersistedIdentity = {
alias: correlationId,
roles: [IdentityRoleEnum.ISSUER, IdentityRoleEnum.VERIFIER],
roles: [IdentityRoleType.ISSUER, IdentityRoleType.VERIFIER],
identifier: {
type: CorrelationIdentifierEnum.DID,
type: CorrelationIdentifierType.DID,
correlationId,
},
}
Expand Down Expand Up @@ -80,7 +80,7 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
filter: [
{
partyType: {
type: PartyTypeEnum.NATURAL_PERSON,
type: PartyTypeType.NATURAL_PERSON,
},
},
{
Expand Down Expand Up @@ -143,8 +143,8 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
lastName: 'new_last_name',
displayName: 'new_display_name',
contactType: {
type: PartyTypeEnum.NATURAL_PERSON,
origin: PartyOrigin.internal,
type: PartyTypeType.NATURAL_PERSON,
origin: PartyOrigin.INTERNAL,
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d288',
name: 'new_name',
description: 'new_description',
Expand Down Expand Up @@ -241,9 +241,9 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
const correlationId = 'new_example_did'
const identity: NonPersistedIdentity = {
alias: correlationId,
roles: [IdentityRoleEnum.ISSUER, IdentityRoleEnum.VERIFIER],
roles: [IdentityRoleType.ISSUER, IdentityRoleType.VERIFIER],
identifier: {
type: CorrelationIdentifierEnum.DID,
type: CorrelationIdentifierType.DID,
correlationId,
},
}
Expand All @@ -265,9 +265,9 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
const correlationId = 'missing_connection_add_example'
const identity: NonPersistedIdentity = {
alias: correlationId,
roles: [IdentityRoleEnum.ISSUER, IdentityRoleEnum.VERIFIER],
roles: [IdentityRoleType.ISSUER, IdentityRoleType.VERIFIER],
identifier: {
type: CorrelationIdentifierEnum.URL,
type: CorrelationIdentifierType.URL,
correlationId,
},
}
Expand All @@ -281,14 +281,14 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
const correlationId = 'missing_connection_update_example'
const identity: NonPersistedIdentity = {
alias: correlationId,
roles: [IdentityRoleEnum.ISSUER, IdentityRoleEnum.VERIFIER],
roles: [IdentityRoleType.ISSUER, IdentityRoleType.VERIFIER],
identifier: {
type: CorrelationIdentifierEnum.DID,
type: CorrelationIdentifierType.DID,
correlationId,
},
}
const result: Identity = await agent.cmAddIdentity({ contactId: defaultContact.id, identity })
result.identifier = { ...result.identifier, type: CorrelationIdentifierEnum.URL }
result.identifier = { ...result.identifier, type: CorrelationIdentifierType.URL }

await expect(agent.cmUpdateIdentity({ identity: result })).rejects.toThrow(`Identity with correlation type url should contain a connection`)
})
Expand All @@ -297,9 +297,9 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
const correlationId = 'new_update_example_did'
const identity: NonPersistedIdentity = {
alias: 'update_example_did',
roles: [IdentityRoleEnum.ISSUER, IdentityRoleEnum.VERIFIER],
roles: [IdentityRoleType.ISSUER, IdentityRoleType.VERIFIER],
identifier: {
type: CorrelationIdentifierEnum.DID,
type: CorrelationIdentifierType.DID,
correlationId: 'update_example_did',
},
}
Expand All @@ -320,8 +320,8 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
lastName: 'relation_last_name',
displayName: 'relation_display_name',
contactType: {
type: PartyTypeEnum.NATURAL_PERSON,
origin: PartyOrigin.internal,
type: PartyTypeType.NATURAL_PERSON,
origin: PartyOrigin.INTERNAL,
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d285',
name: 'relation_contact_type_name',
description: 'new_description',
Expand Down Expand Up @@ -365,8 +365,8 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
lastName: 'remove_relation_last_name',
displayName: 'remove_relation_display_name',
contactType: {
type: PartyTypeEnum.NATURAL_PERSON,
origin: PartyOrigin.external,
type: PartyTypeType.NATURAL_PERSON,
origin: PartyOrigin.EXTERNAL,
tenantId: '0605761c-4113-4ce5-a6b2-9cbae2f9d286',
name: 'remove_relation_contact_type_name',
description: 'new_description',
Expand Down Expand Up @@ -415,8 +415,8 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
lastName: 'add_electronic_address_last_name',
displayName: 'add_electronic_address_display_name',
contactType: {
type: PartyTypeEnum.NATURAL_PERSON,
origin: PartyOrigin.internal,
type: PartyTypeType.NATURAL_PERSON,
origin: PartyOrigin.INTERNAL,
tenantId: 'a85a8aa0-fdeb-4c00-b22e-60423f52a873',
name: 'add_electronic_address_name',
description: 'add_electronic_address_description',
Expand Down Expand Up @@ -444,8 +444,8 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
lastName: 'get_electronic_address_last_name',
displayName: 'get_electronic_address_display_name',
contactType: {
type: PartyTypeEnum.NATURAL_PERSON,
origin: PartyOrigin.external,
type: PartyTypeType.NATURAL_PERSON,
origin: PartyOrigin.EXTERNAL,
tenantId: 'f2947075-53eb-4176-b155-ab4b18715288',
name: 'get_electronic_address_name',
description: 'get_electronic_address_description',
Expand All @@ -472,8 +472,8 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
lastName: 'get_all_electronic_address_last_name',
displayName: 'get_all_electronic_address_display_name',
contactType: {
type: PartyTypeEnum.NATURAL_PERSON,
origin: PartyOrigin.internal,
type: PartyTypeType.NATURAL_PERSON,
origin: PartyOrigin.INTERNAL,
tenantId: '5c0157ec-4678-4273-8f53-413bc6435134',
name: 'get_all_electronic_address_name',
description: 'get_all_electronic_address_description',
Expand Down Expand Up @@ -501,8 +501,8 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
lastName: 'update_electronic_address_last_name',
displayName: 'update_electronic_address_display_name',
contactType: {
type: PartyTypeEnum.NATURAL_PERSON,
origin: PartyOrigin.external,
type: PartyTypeType.NATURAL_PERSON,
origin: PartyOrigin.EXTERNAL,
tenantId: '6b64c3dd-cf40-4919-b8b8-2ec3c510c5b7',
name: 'update_electronic_address_name',
description: 'update_electronic_address_description',
Expand Down Expand Up @@ -537,8 +537,8 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
lastName: 'remove_electronic_address_last_name',
displayName: 'remove_electronic_address_display_name',
contactType: {
type: PartyTypeEnum.NATURAL_PERSON,
origin: PartyOrigin.external,
type: PartyTypeType.NATURAL_PERSON,
origin: PartyOrigin.EXTERNAL,
tenantId: '41b45c65-971e-4c26-8115-cb8bc7c67cf3',
name: 'remove_electronic_address_name',
description: 'remove_electronic_address_description',
Expand Down Expand Up @@ -571,8 +571,8 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
lastName: 'add_physical_address_last_name',
displayName: 'add_physical_address_display_name',
contactType: {
type: PartyTypeEnum.NATURAL_PERSON,
origin: PartyOrigin.internal,
type: PartyTypeType.NATURAL_PERSON,
origin: PartyOrigin.INTERNAL,
tenantId: '5aeb828e-16d6-4244-95a7-e12424474eb7',
name: 'add_physical_address_name',
description: 'add_physical_address_description',
Expand Down Expand Up @@ -606,8 +606,8 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
lastName: 'get_physical_address_last_name',
displayName: 'get_physical_address_display_name',
contactType: {
type: PartyTypeEnum.NATURAL_PERSON,
origin: PartyOrigin.external,
type: PartyTypeType.NATURAL_PERSON,
origin: PartyOrigin.EXTERNAL,
tenantId: '7c5dbbd9-1721-4246-b261-44e237560a15',
name: 'get_physical_address_name',
description: 'get_physical_address_description',
Expand Down Expand Up @@ -640,8 +640,8 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
lastName: 'get_all_physical_address_last_name',
displayName: 'get_all_physical_address_display_name',
contactType: {
type: PartyTypeEnum.NATURAL_PERSON,
origin: PartyOrigin.internal,
type: PartyTypeType.NATURAL_PERSON,
origin: PartyOrigin.INTERNAL,
tenantId: '0c0eafd8-1e8c-44bf-8e0d-768fb11a40c3',
name: 'get_all_physical_address_name',
description: 'get_all_physical_address_description',
Expand Down Expand Up @@ -675,8 +675,8 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
lastName: 'update_physical_address_last_name',
displayName: 'update_physical_address_display_name',
contactType: {
type: PartyTypeEnum.NATURAL_PERSON,
origin: PartyOrigin.internal,
type: PartyTypeType.NATURAL_PERSON,
origin: PartyOrigin.INTERNAL,
tenantId: 'f2b4eb1c-e36f-4863-90b3-90720471c397',
name: 'update_physical_address_name',
description: 'update_physical_address_description',
Expand Down Expand Up @@ -729,8 +729,8 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
lastName: 'remove_physical_address_last_name',
displayName: 'remove_physical_address_display_name',
contactType: {
type: PartyTypeEnum.NATURAL_PERSON,
origin: PartyOrigin.internal,
type: PartyTypeType.NATURAL_PERSON,
origin: PartyOrigin.INTERNAL,
tenantId: '20b11d1e-6489-4258-af33-32a2cfa4dc85',
name: 'remove_physical_address_name',
description: 'remove_physical_address_description',
Expand Down
4 changes: 2 additions & 2 deletions packages/contact-manager/src/types/IContactManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
PartyOrigin,
PartyRelationship as ContactRelationship,
PartyType as ContactType,
PartyTypeEnum as ContactTypeEnum,
PartyTypeType as ContactTypeType,
PhysicalAddress,
} from '@sphereon/ssi-sdk.data-store'

Expand Down Expand Up @@ -119,7 +119,7 @@ export type UpdateRelationshipArgs = {
}

export type AddContactTypeArgs = {
type: ContactTypeEnum
type: ContactTypeType
origin: PartyOrigin
name: string
tenantId: string
Expand Down
Loading

0 comments on commit dc3fb0d

Please sign in to comment.