Skip to content

Commit

Permalink
Merge 28a0d20 into b977f3c
Browse files Browse the repository at this point in the history
  • Loading branch information
zoemaas authored May 29, 2024
2 parents b977f3c + 28a0d20 commit c4d749c
Show file tree
Hide file tree
Showing 39 changed files with 12,693 additions and 8,278 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-test-on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
fetch-depth: 0
- uses: pnpm/action-setup@v3
with:
version: 8
version: 9
- name: Use Node.js
uses: actions/setup-node@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-test-publish-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
fetch-depth: 0
- uses: pnpm/action-setup@v3
with:
version: 8
version: 9
- name: Use Node.js
uses: actions/setup-node@v4
with:
Expand Down
19 changes: 14 additions & 5 deletions packages/contact-manager-rest-api/__tests__/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ import { DataStore, DataStoreORM, DIDStore } from '@veramo/data-store'
import { IRequiredPlugins } from '../src'
import { DB_CONNECTION_NAME, sqliteConfig } from './database'
import { AddContactArgs, ContactManager } from '@sphereon/ssi-sdk.contact-manager'
import { ContactStore, CorrelationIdentifierEnum, IdentityRoleEnum, NonPersistedIdentity, PartyTypeEnum } from '@sphereon/ssi-sdk.data-store'
import {
ContactStore,
CorrelationIdentifierType,
CredentialRole,
NonPersistedIdentity,
PartyOrigin,
PartyTypeType,
} from '@sphereon/ssi-sdk.data-store'
import { DataSources } from '@sphereon/ssi-sdk.agent-config'
import { v4 } from 'uuid'
import { DIDManager } from '@veramo/did-manager'
Expand Down Expand Up @@ -60,9 +67,9 @@ const toContactIdentityDTO = (contact: Record<string, any>, identifier: IIdentif
console.log(`Contact received did ${identifier.did}, contact: ${JSON.stringify(contact)}`)
return {
alias: identifier.alias,
roles: [IdentityRoleEnum.ISSUER],
roles: [CredentialRole.ISSUER],
identifier: {
type: CorrelationIdentifierEnum.DID,
type: CorrelationIdentifierType.DID,
correlationId: identifier.did,
},
} as NonPersistedIdentity
Expand All @@ -72,13 +79,15 @@ async function addContacts() {
try {
const personContactType = await agent.cmAddContactType({
name: 'people',
type: PartyTypeEnum.NATURAL_PERSON,
origin: PartyOrigin.EXTERNAL,
type: PartyTypeType.NATURAL_PERSON,
tenantId: v4(),
})

const organizationalContactType = await agent.cmAddContactType({
name: 'organizations',
type: PartyTypeEnum.ORGANIZATION,
origin: PartyOrigin.EXTERNAL,
type: PartyTypeType.ORGANIZATION,
tenantId: v4(),
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
ElectronicAddress,
GetPartiesArgs,
Identity,
IdentityRole,
CredentialRole,
IdentityOrigin,
NaturalPerson,
NonPersistedElectronicAddress,
NonPersistedIdentity,
Expand Down Expand Up @@ -45,7 +46,8 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
const correlationId = 'default_example_did'
const identity: NonPersistedIdentity = {
alias: correlationId,
roles: [IdentityRole.ISSUER, IdentityRole.VERIFIER],
origin: IdentityOrigin.EXTERNAL,
roles: [CredentialRole.ISSUER, CredentialRole.VERIFIER],
identifier: {
type: CorrelationIdentifierType.DID,
correlationId,
Expand Down Expand Up @@ -241,7 +243,8 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
const correlationId = 'new_example_did'
const identity: NonPersistedIdentity = {
alias: correlationId,
roles: [IdentityRole.ISSUER, IdentityRole.VERIFIER],
origin: IdentityOrigin.EXTERNAL,
roles: [CredentialRole.ISSUER, CredentialRole.VERIFIER],
identifier: {
type: CorrelationIdentifierType.DID,
correlationId,
Expand All @@ -265,7 +268,8 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
const correlationId = 'missing_connection_add_example'
const identity: NonPersistedIdentity = {
alias: correlationId,
roles: [IdentityRole.ISSUER, IdentityRole.VERIFIER],
origin: IdentityOrigin.EXTERNAL,
roles: [CredentialRole.ISSUER, CredentialRole.VERIFIER],
identifier: {
type: CorrelationIdentifierType.URL,
correlationId,
Expand All @@ -281,7 +285,8 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
const correlationId = 'missing_connection_update_example'
const identity: NonPersistedIdentity = {
alias: correlationId,
roles: [IdentityRole.ISSUER, IdentityRole.VERIFIER],
origin: IdentityOrigin.EXTERNAL,
roles: [CredentialRole.ISSUER, CredentialRole.VERIFIER],
identifier: {
type: CorrelationIdentifierType.DID,
correlationId,
Expand All @@ -297,7 +302,8 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro
const correlationId = 'new_update_example_did'
const identity: NonPersistedIdentity = {
alias: 'update_example_did',
roles: [IdentityRole.ISSUER, IdentityRole.VERIFIER],
origin: IdentityOrigin.EXTERNAL,
roles: [CredentialRole.ISSUER, CredentialRole.VERIFIER],
identifier: {
type: CorrelationIdentifierType.DID,
correlationId: 'update_example_did',
Expand Down
Loading

0 comments on commit c4d749c

Please sign in to comment.