forked from openwallet-foundation/didcomm-mediator-credo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
style: prettier formatting (openwallet-foundation#6)
- Loading branch information
1 parent
b6c55b2
commit b7b1641
Showing
13 changed files
with
865 additions
and
893 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"printWidth": 120, | ||
"semi": false, | ||
"singleQuote": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,21 @@ | ||
import type { Config } from "@jest/types"; | ||
import type { Config } from '@jest/types' | ||
|
||
import packageJson from "./package.json"; | ||
import packageJson from './package.json' | ||
|
||
const config: Config.InitialOptions = { | ||
displayName: packageJson.name, | ||
testTimeout: 120000, | ||
preset: "ts-jest", | ||
testEnvironment: "node", | ||
coveragePathIgnorePatterns: [ | ||
"/build/", | ||
"/node_modules/", | ||
"/__tests__/", | ||
"tests", | ||
], | ||
coverageDirectory: "<rootDir>/coverage/", | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
coveragePathIgnorePatterns: ['/build/', '/node_modules/', '/__tests__/', 'tests'], | ||
coverageDirectory: '<rootDir>/coverage/', | ||
verbose: true, | ||
testMatch: ["**/?(*.)+(spec|test).[tj]s?(x)"], | ||
testMatch: ['**/?(*.)+(spec|test).[tj]s?(x)'], | ||
globals: { | ||
"ts-jest": { | ||
'ts-jest': { | ||
isolatedModules: true, | ||
}, | ||
}, | ||
}; | ||
} | ||
|
||
export default config; | ||
export default config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,25 @@ | ||
import { LogLevel } from "@aries-framework/core"; | ||
import { LogLevel } from '@aries-framework/core' | ||
|
||
export const AGENT_PORT = process.env.AGENT_PORT | ||
? Number(process.env.AGENT_PORT) | ||
: 3000; | ||
export const AGENT_NAME = process.env.AGENT_NAME || "Animo Mediator"; | ||
export const WALLET_NAME = process.env.WALLET_NAME || "animo-mediator-dev"; | ||
export const WALLET_KEY = process.env.WALLET_KEY || "animo-mediator-dev"; | ||
export const AGENT_ENDPOINTS = process.env.AGENT_ENDPOINTS?.split(",") ?? [ | ||
export const AGENT_PORT = process.env.AGENT_PORT ? Number(process.env.AGENT_PORT) : 3000 | ||
export const AGENT_NAME = process.env.AGENT_NAME || 'Animo Mediator' | ||
export const WALLET_NAME = process.env.WALLET_NAME || 'animo-mediator-dev' | ||
export const WALLET_KEY = process.env.WALLET_KEY || 'animo-mediator-dev' | ||
export const AGENT_ENDPOINTS = process.env.AGENT_ENDPOINTS?.split(',') ?? [ | ||
`http://localhost:${AGENT_PORT}`, | ||
`ws://localhost:${AGENT_PORT}`, | ||
]; | ||
] | ||
|
||
export const POSTGRES_DATABASE_URL = process.env.POSTGRES_DATABASE_URL; | ||
export const POSTGRES_USER = process.env.POSTGRES_USER; | ||
export const POSTGRES_PASSWORD = process.env.POSTGRES_PASSWORD; | ||
export const POSTGRES_ADMIN_USER = process.env.POSTGRES_ADMIN_USER; | ||
export const POSTGRES_ADMIN_PASSWORD = process.env.POSTGRES_ADMIN_PASSWORD; | ||
export const POSTGRES_TLS_CA_FILE = process.env.POSTGRES_TLS_CA_FILE; | ||
export const POSTGRES_TLS_CA = process.env.POSTGRES_TLS_CA; | ||
export const POSTGRES_DATABASE_URL = process.env.POSTGRES_DATABASE_URL | ||
export const POSTGRES_USER = process.env.POSTGRES_USER | ||
export const POSTGRES_PASSWORD = process.env.POSTGRES_PASSWORD | ||
export const POSTGRES_ADMIN_USER = process.env.POSTGRES_ADMIN_USER | ||
export const POSTGRES_ADMIN_PASSWORD = process.env.POSTGRES_ADMIN_PASSWORD | ||
export const POSTGRES_TLS_CA_FILE = process.env.POSTGRES_TLS_CA_FILE | ||
export const POSTGRES_TLS_CA = process.env.POSTGRES_TLS_CA | ||
|
||
export const INVITATION_URL = process.env.INVITATION_URL; | ||
export const INVITATION_URL = process.env.INVITATION_URL | ||
|
||
export const LOG_LEVEL = LogLevel.debug; | ||
export const LOG_LEVEL = LogLevel.debug | ||
|
||
export const IS_DEV = process.env.NODE_ENV === "development"; | ||
export const DEBUG_INDY = process.env.DEBUG_INDY === "true"; | ||
export const IS_DEV = process.env.NODE_ENV === 'development' | ||
export const DEBUG_INDY = process.env.DEBUG_INDY === 'true' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,32 @@ | ||
import { | ||
OutOfBandRepository, | ||
OutOfBandRole, | ||
OutOfBandState, | ||
} from "@aries-framework/core"; | ||
import { OutOfBandRepository, OutOfBandRole, OutOfBandState } from '@aries-framework/core' | ||
|
||
import { createAgent } from "./agent"; | ||
import { INVITATION_URL } from "./constants"; | ||
import { createAgent } from './agent' | ||
import { INVITATION_URL } from './constants' | ||
|
||
void createAgent().then(async (agent) => { | ||
agent.config.logger.info("Agent started"); | ||
agent.config.logger.info('Agent started') | ||
|
||
// Try to find existing out of band record | ||
const oobRepo = agent.dependencyManager.resolve(OutOfBandRepository); | ||
const oobRepo = agent.dependencyManager.resolve(OutOfBandRepository) | ||
const outOfBandRecords = await oobRepo.findByQuery(agent.context, { | ||
state: OutOfBandState.AwaitResponse, | ||
role: OutOfBandRole.Sender, | ||
}); | ||
}) | ||
|
||
let outOfBandRecord = outOfBandRecords.find( | ||
(oobRecord) => oobRecord.reusable | ||
); | ||
let outOfBandRecord = outOfBandRecords.find((oobRecord) => oobRecord.reusable) | ||
|
||
// If it does't exist, we create a new one | ||
if (!outOfBandRecord) { | ||
outOfBandRecord = await agent.oob.createInvitation({ | ||
multiUseInvitation: true, | ||
}); | ||
}) | ||
} | ||
|
||
const httpEndpoint = agent.config.endpoints.find((e) => | ||
e.startsWith("http") | ||
) as string; | ||
const invitationEndpoint = INVITATION_URL ?? `${httpEndpoint}/invite`; | ||
const httpEndpoint = agent.config.endpoints.find((e) => e.startsWith('http')) as string | ||
const invitationEndpoint = INVITATION_URL ?? `${httpEndpoint}/invite` | ||
const mediatorInvitationUrlLong = outOfBandRecord.outOfBandInvitation.toUrl({ | ||
domain: invitationEndpoint, | ||
}); | ||
}) | ||
|
||
agent.config.logger.info( | ||
`Out of band invitation url: \n\n\t${mediatorInvitationUrlLong}` | ||
); | ||
}); | ||
agent.config.logger.info(`Out of band invitation url: \n\n\t${mediatorInvitationUrlLong}`) | ||
}) |
Oops, something went wrong.