Skip to content
Snippets Groups Projects
Unverified Commit 6098aafc authored by Konstantin Tsabolov's avatar Konstantin Tsabolov
Browse files

Merge branch 'main' into chore/update-dependencies

parents 67a6c1f1 ccb2cd58
No related branches found
No related tags found
2 merge requests!9feat(ssi): Establish a trusted connection with yourself,!8Project house-keeping, refactoring and reorganizing
Showing
with 53 additions and 6698 deletions
...@@ -29,7 +29,7 @@ pnpm-debug.log* ...@@ -29,7 +29,7 @@ pnpm-debug.log*
yarn-debug.log* yarn-debug.log*
yarn-error.log* yarn-error.log*
lerna-debug.log* lerna-debug.log*
apps/**/logs/log.json **/logs/log.json
# OS # OS
.DS_Store .DS_Store
......
...@@ -17,7 +17,7 @@ The Attestation Manager is the microservice responsible for handling the feature ...@@ -17,7 +17,7 @@ The Attestation Manager is the microservice responsible for handling the feature
### Pre-requisite ### Pre-requisite
* yarn * pnpm
* docker * docker
* docker-compose * docker-compose
* PostgreSQL * PostgreSQL
...@@ -54,12 +54,12 @@ to run all the services. ...@@ -54,12 +54,12 @@ to run all the services.
## Build ## Build
``` ```
yarn build pnpm build
``` ```
## Run ## Run
``` ```
yarn start pnpm start
``` ```
### Environment Variables Required ### Environment Variables Required
...@@ -96,13 +96,13 @@ yarn start ...@@ -96,13 +96,13 @@ yarn start
```bash ```bash
# unit tests # unit tests
$ npm run test $ pnpm test
# e2e tests # e2e tests
$ npm run test:e2e $ pnpm test:e2e
# test coverage # test coverage
$ npm run test:cov $ pnpm test:cov
``` ```
......
...@@ -23,7 +23,7 @@ The service implements REST endpoints, events and calls to other services relate ...@@ -23,7 +23,7 @@ The service implements REST endpoints, events and calls to other services relate
### Pre-requisites ### Pre-requisites
* yarn * pnpm
* docker * docker
* docker-compose * docker-compose
* postgres * postgres
...@@ -103,13 +103,13 @@ to run all the services. ...@@ -103,13 +103,13 @@ to run all the services.
```bash ```bash
# unit tests # unit tests
$ npm run test $ pnpm test
# e2e tests # e2e tests
$ npm run test:e2e $ pnpm test:e2e
# test coverage # test coverage
$ npm run test:cov $ pnpm test:cov
``` ```
## GDPR ## GDPR
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
"prisma:migrate": "npx prisma migrate deploy --schema=./src/prisma/schema.prisma", "prisma:migrate": "npx prisma migrate deploy --schema=./src/prisma/schema.prisma",
"prismaStudio": "npx prisma studio", "prismaStudio": "npx prisma studio",
"start": "nest start", "start": "nest start",
"start:docker": "yarn prisma:generate && yarn dbSchema && yarn start", "start:docker": "pnpm prisma:generate && pnpm dbSchema && pnpm start",
"start:docker:prod": "yarn prisma:migrate && node dist/src/main", "start:docker:prod": "pnpm prisma:migrate && node dist/src/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest", "test": "jest",
"test:watch": "jest --watch", "test:watch": "jest --watch",
......
import { existsSync, mkdirSync } from 'fs'; import { existsSync, mkdirSync } from 'fs';
import { Logger } from 'winston'; import winston, { Logger } from 'winston';
import ecsFormat = require('@elastic/ecs-winston-format'); import ecsFormat from '@elastic/ecs-winston-format';
import winston = require('winston');
// import { ElasticsearchTransport } from 'winston-elasticsearch';
import { LoggerConfig } from '@common/constants'; import { LoggerConfig } from '@common/constants';
if (!existsSync(LoggerConfig.lOG_DIR)) { if (!existsSync(LoggerConfig.lOG_DIR)) {
......
...@@ -17,7 +17,7 @@ The Principal Manager is the microservice responsible for handling the authentic ...@@ -17,7 +17,7 @@ The Principal Manager is the microservice responsible for handling the authentic
### Pre-requisite ### Pre-requisite
* yarn * pnpm
* docker * docker
* docker-compose * docker-compose
* Postgres * Postgres
...@@ -55,12 +55,12 @@ to run all the services. ...@@ -55,12 +55,12 @@ to run all the services.
## Build ## Build
``` ```
yarn build pnpm build
``` ```
## Run ## Run
``` ```
yarn start pnpm start
``` ```
### Environment variable required ### Environment variable required
...@@ -91,13 +91,13 @@ yarn start ...@@ -91,13 +91,13 @@ yarn start
```bash ```bash
# unit tests # unit tests
$ yarn test $ pnpm test
# e2e tests # e2e tests
$ yarn test:e2e $ pnpm test:e2e
# test coverage # test coverage
$ yarn test:cov $ pnpm test:cov
``` ```
## GDPR ## GDPR
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
"prisma:migrate": "npx prisma migrate deploy --schema=./src/prisma/schema.prisma", "prisma:migrate": "npx prisma migrate deploy --schema=./src/prisma/schema.prisma",
"prismaStudio": "npx prisma studio", "prismaStudio": "npx prisma studio",
"start": "nest start", "start": "nest start",
"start:docker": "yarn prisma:migrate && yarn start", "start:docker": "pnpm prisma:migrate && pnpm start",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest", "test": "jest",
"test:watch": "jest --watch", "test:watch": "jest --watch",
......
import { existsSync, mkdirSync } from 'fs'; import { existsSync, mkdirSync } from 'fs';
import { Logger } from 'winston'; import winston, { Logger } from 'winston';
import ecsFormat = require('@elastic/ecs-winston-format'); import ecsFormat from '@elastic/ecs-winston-format';
import winston = require('winston');
// import { ElasticsearchTransport } from 'winston-elasticsearch';
import { LoggerConfig } from '@common/constants'; import { LoggerConfig } from '@common/constants';
if (!existsSync(LoggerConfig.lOG_DIR)) { if (!existsSync(LoggerConfig.lOG_DIR)) {
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
"declaration": true, "declaration": true,
"removeComments": true, "removeComments": true,
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"esModuleInterop": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"target": "es6", "target": "es6",
"sourceMap": true, "sourceMap": true,
...@@ -29,4 +30,4 @@ ...@@ -29,4 +30,4 @@
"config", "config",
], ],
"exclude": ["node_modules", "./dist/**/*"] "exclude": ["node_modules", "./dist/**/*"]
} }
\ No newline at end of file
This diff is collapsed.
...@@ -16,7 +16,7 @@ The Proof Manager, is the microservice responsible for handling the features rel ...@@ -16,7 +16,7 @@ The Proof Manager, is the microservice responsible for handling the features rel
### Pre-requisite ### Pre-requisite
* yarn * pnpm
* docker * docker
* docker-compose * docker-compose
* Postgres * Postgres
...@@ -56,12 +56,12 @@ to run all the services. ...@@ -56,12 +56,12 @@ to run all the services.
## Build ## Build
``` ```
yarn build pnpm build
``` ```
## Run ## Run
``` ```
yarn start pnpm start
``` ```
### Environment Variables Required ### Environment Variables Required
...@@ -96,13 +96,13 @@ yarn start ...@@ -96,13 +96,13 @@ yarn start
```bash ```bash
# unit tests # unit tests
$ npm run test $ pnpm test
# e2e tests # e2e tests
$ npm run test:e2e $ pnpm test:e2e
# test coverage # test coverage
$ npm run test:cov $ pnpm test:cov
``` ```
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
"dbSchema": "npx prisma db push --schema=./src/prisma/schema.prisma", "dbSchema": "npx prisma db push --schema=./src/prisma/schema.prisma",
"prismaStudio": "npx prisma studio", "prismaStudio": "npx prisma studio",
"start": "nest start", "start": "nest start",
"start:docker": "yarn prisma:generate && yarn dbSchema && yarn start", "start:docker": "pnpm prisma:generate && pnpm dbSchema && pnpm start",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest", "test": "jest",
"test:watch": "jest --watch", "test:watch": "jest --watch",
......
import { existsSync, mkdirSync } from 'fs'; import { existsSync, mkdirSync } from 'fs';
import { Logger } from 'winston'; import winston, { Logger } from 'winston';
import ecsFormat = require('@elastic/ecs-winston-format'); import ecsFormat from '@elastic/ecs-winston-format';
import winston = require('winston');
// import { ElasticsearchTransport } from 'winston-elasticsearch';
import { LoggerConfig } from '@common/constants'; import { LoggerConfig } from '@common/constants';
if (!existsSync(LoggerConfig.lOG_DIR)) { if (!existsSync(LoggerConfig.lOG_DIR)) {
......
...@@ -26,7 +26,7 @@ with the default exposed ports: ...@@ -26,7 +26,7 @@ with the default exposed ports:
Dependencies: Dependencies:
```bash ```bash
$ yarn $ pnpm install
``` ```
* **If docker is not installed, [Install docker](https://docs.docker.com/engine/install/)**. * **If docker is not installed, [Install docker](https://docs.docker.com/engine/install/)**.
...@@ -85,13 +85,13 @@ $ docker-compose up --build ...@@ -85,13 +85,13 @@ $ docker-compose up --build
```bash ```bash
# unit tests # unit tests
$ yarn test $ pnpm test
# e2e tests # e2e tests
$ yarn test:e2e $ pnpm test:e2e
# test coverage # test coverage
$ yarn test:cov $ pnpm test:cov
``` ```
......
import * as Joi from 'joi'; import Joi from 'joi';
const validationSchema = Joi.object({ const validationSchema = Joi.object({
NATS_URL: Joi.string().required(), NATS_URL: Joi.string().required(),
......
/* eslint-disable */
import { subscribe } from './listener'; import { subscribe } from './listener';
describe('listener', () => { describe('listener', () => {
it('should subscribe agent to available events', async () => { it('should subscribe agent to available events', async () => {
const agent = { const agent = {
events: { events: {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
on: (eventName: string, cb: () => void) => {}, on: (eventName: string, cb: () => void) => {},
}, },
}; };
......
...@@ -9,12 +9,12 @@ import { listenerConfig } from './listenerConfig'; ...@@ -9,12 +9,12 @@ import { listenerConfig } from './listenerConfig';
* @param agent - the agent that has been initialized on startup * @param agent - the agent that has been initialized on startup
* @param natsClient - the client that specifies how events are published * @param natsClient - the client that specifies how events are published
*/ */
export const subscribe = async ( export const subscribe = (
agent: Agent, agent: Agent,
natsClient: NatsClientService, natsClient: NatsClientService,
) => { ) => {
for (let i = 0; i < listenerConfig.length; i += 1) { for (let i = 0; i < listenerConfig.length; i += 1) {
agent.events.on(listenerConfig[i], async ({ payload }: any) => { agent.events.on(listenerConfig[i], ({ payload }) => {
logger.info( logger.info(
`${listenerConfig[i]} called. Payload: ${JSON.stringify(payload)}`, `${listenerConfig[i]} called. Payload: ${JSON.stringify(payload)}`,
); );
......
...@@ -53,18 +53,16 @@ const agentFactory = { ...@@ -53,18 +53,16 @@ const agentFactory = {
} }
const indyLedgers: LedgerInfo[] = ledgerIds.map((id: LedgerIds) => { const indyLedgers: LedgerInfo[] = ledgerIds.map((id: LedgerIds) => {
const ledgerId: LedgerIds = id; if (!LEDGER_GENESIS?.[id]) {
if (!LEDGER_GENESIS?.[ledgerId]) {
throw new Error( throw new Error(
`No pool transaction genesis provided for ledger ${ledgerId}`, `No pool transaction genesis provided for ledger ${id}`,
); );
} }
const ledger: LedgerInfo = { const ledger: LedgerInfo = {
id: `${ledgerId}_Genesis`, id: `${id}_Genesis`,
indyNamespace: `${ledgerNamespaces[ledgerId]}`, indyNamespace: `${ledgerNamespaces[id]}`,
genesisTransactions: LEDGER_GENESIS?.[ledgerId], genesisTransactions: LEDGER_GENESIS?.[id],
isProduction: false, isProduction: false,
}; };
...@@ -95,7 +93,7 @@ const agentFactory = { ...@@ -95,7 +93,7 @@ const agentFactory = {
agent.registerOutboundTransport(new HttpOutboundTransport()); agent.registerOutboundTransport(new HttpOutboundTransport());
await agent.initialize(); await agent.initialize();
await subscribe(agent, natsClient); subscribe(agent, natsClient);
if (agent.isInitialized) { if (agent.isInitialized) {
ledgerIds.map(async (id: LedgerIds) => { ledgerIds.map(async (id: LedgerIds) => {
...@@ -160,7 +158,7 @@ const agentFactory = { ...@@ -160,7 +158,7 @@ const agentFactory = {
name: NATSServices.SERVICE_NAME, name: NATSServices.SERVICE_NAME,
transport: Transport.NATS, transport: Transport.NATS,
options: { options: {
servers: [config().nats.url as string], servers: [config().nats.url],
}, },
}, },
]), ]),
......
...@@ -28,7 +28,7 @@ import { AgentMid } from './middleware/agentMid.middleware'; ...@@ -28,7 +28,7 @@ import { AgentMid } from './middleware/agentMid.middleware';
], ],
}) })
export class AppModule implements NestModule { export class AppModule implements NestModule {
// eslint-disable-next-line // eslint-disable-next-line class-methods-use-this
configure(consumer: MiddlewareConsumer) { configure(consumer: MiddlewareConsumer) {
consumer.apply(AgentMid).forRoutes('agent', '*/agent'); consumer.apply(AgentMid).forRoutes('agent', '*/agent');
} }
......
...@@ -19,9 +19,11 @@ export class NatsClientService { ...@@ -19,9 +19,11 @@ export class NatsClientService {
logger.info( logger.info(
`Publish nats event: ${NATSServices.SERVICE_NAME}/${eventName}`, `Publish nats event: ${NATSServices.SERVICE_NAME}/${eventName}`,
); );
const event = { const event = {
endpoint: `${NATSServices.SERVICE_NAME}/${eventName}`, endpoint: `${NATSServices.SERVICE_NAME}/${eventName}`,
}; };
this.client.emit(event, data); this.client.emit(event, data);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment