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

chore: update dependencies, fix style

* Upgraded the dependencies to the latest versions
* Switched output to ESM format
* Switched NestJS and Jest to SWC to improve speed of building and testing
* Refactored TSConfig to remove tsconfig-paths
* Updated imports in all files to reflect the change in TSConfig
* Changed the linting rules (removed AirBnB config)
* Fixed Prettier installation (added ignore file)
* Fixed typing errors (mainly usage of any's)
* Fixed the non-working E2E test

P.S. None of the mentioned makes sense alone, therefore a huge commit :man_shrugging:
parent 49e59a52
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 298 additions and 228 deletions
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
ecmaVersion: 2021,
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/recommended',
'airbnb-base',
'airbnb-typescript/base'
],
root: true,
env: {
node: true,
jest: true,
},
plugins: ['prettier', '@typescript-eslint/eslint-plugin', 'jest'],
extends: [
'prettier',
'plugin:@typescript-eslint/recommended',
'plugin:jest/recommended',
],
ignorePatterns: ['.eslintrc.js'],
overrides: [],
settings: {
jest: {
version: '29',
},
},
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'no-unused-vars': 0,
'@typescript-eslint/no-unused-vars': [1, { argsIgnorePattern: '^_' }],
},
overrides: [
{
files: [
'*.spec.ts',
'*.e2e-spec.ts',
'__mocks__/*.ts',
'__mocks__/**/*.ts',
],
rules: {
'@typescript-eslint/no-explicit-any': 0,
'jest/no-mocks-import': 0,
},
},
],
};
# Ignore everything
*
# Except for these files
!*.ts
!*.d.ts
!jest.config.js
# .. also in subdirectories
!*/
# ... in these ones
!src/*
# Explicitly ignore these locations
node_modules
dist
{
"jsc": {
"preserveAllComments": true,
"parser": {
"syntax": "typescript",
"tsx": false,
"decorators": true
},
"transform": {
"legacyDecorator": true,
"decoratorMetadata": true
},
"target": "es2022"
},
"module": {
"type": "es6"
},
"sourceMaps": true,
"exclude": [".spec.ts", ".e2e-spec.ts"]
}
/** @type {import('jest').Config} */
import { readFileSync } from 'node:fs';
const swcConfig = JSON.parse(readFileSync('./.swcrc', 'utf8'));
export default {
moduleFileExtensions: ['js', 'ts'],
testEnvironment: 'node',
transform: {
'^.+\\.ts$': [
'@swc/jest',
{
...swcConfig,
sourceMaps: false,
exclude: [],
swcrc: false,
},
],
},
extensionsToTreatAsEsm: ['.ts'],
moduleNameMapper: {
// ESM modules require `.js` extension to be specified, but Jest doesn't work with them
// Removing `.js` extension from module imports
'^uuid$': 'uuid',
'^(.*)/(.*)\\.js$': '$1/$2',
},
collectCoverageFrom: ['src/**/*.(t|j)s'],
coverageReporters:
process.env.CI === 'true'
? ['text-summary', 'json-summary']
: ['text-summary', 'html'],
coveragePathIgnorePatterns: [
'<rootDir>/node_modules/',
'<rootDir>/test/',
'<rootDir>/coverage/',
'<rootDir>/dist/',
'<rootDir>/**/test',
'@types',
'.dto.(t|j)s',
'.enum.ts',
'.interface.ts',
'.type.ts',
'.spec.ts',
],
coverageDirectory: './coverage',
// With v8 coverage provider it's much faster, but
// with this enabled it's not possible to ignore whole files' coverage
coverageProvider: 'v8',
};
{
"collection": "@nestjs/schematics",
"sourceRoot": "src"
"sourceRoot": "src",
"compilerOptions": {
"builder": "swc",
"typeCheck": true
}
}
......@@ -5,113 +5,83 @@
"author": "Sagar",
"private": true,
"license": "Apache-2.0",
"type": "module",
"scripts": {
"clean": "rm -r dist",
"prebuild": "rimraf dist",
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"prisma:generate": "prisma generate --schema=./src/prisma/schema.prisma",
"prisma:migrate": "npx prisma migrate deploy --schema=./src/prisma/schema.prisma",
"dbSchema": "npx prisma db push --schema=./src/prisma/schema.prisma",
"prismaStudio": "npx prisma studio",
"start": "nest start",
"start:dev": "nest start --watch --preserveWatchOutput",
"start:docker": "pnpm prisma:generate && pnpm dbSchema && pnpm start",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"lint": "eslint --fix",
"lint:all": "npm run lint -- .",
"format": "prettier --write",
"format:all": "npm run format -- .",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json"
"test:e2e": "jest --config ./test/jest.config.js"
},
"dependencies": {
"@elastic/ecs-winston-format": "^1.3.1",
"@nestjs/axios": "0.0.5",
"@nestjs/common": "^8.0.0",
"@nestjs/config": "^1.1.6",
"@nestjs/core": "^8.0.0",
"@nestjs/mapped-types": "*",
"@nestjs/microservices": "^8.2.6",
"@nestjs/platform-express": "^8.0.0",
"@nestjs/swagger": "^5.2.0",
"@nestjs/terminus": "^8.0.4",
"@prisma/client": "^3.15.2",
"@types/express": "^4.17.13",
"@types/jest": "27.0.2",
"@types/jsonwebtoken": "^8.5.9",
"@types/node": "^16.0.0",
"class-validator": "^0.13.2",
"express": "^4.17.3",
"joi": "^17.6.0",
"@elastic/ecs-winston-format": "^1.5.0",
"@nestjs/axios": "^3.0.1",
"@nestjs/common": "^10.2.8",
"@nestjs/config": "^3.1.1",
"@nestjs/core": "^10.2.8",
"@nestjs/mapped-types": "^2.0.4",
"@nestjs/microservices": "^10.2.8",
"@nestjs/platform-express": "^10.2.8",
"@nestjs/swagger": "^7.1.16",
"@nestjs/terminus": "^10.1.1",
"@prisma/client": "^5.6.0",
"class-validator": "^0.14.0",
"joi": "^17.11.0",
"js-base64": "^3.7.2",
"jsonwebtoken": "^8.5.1",
"jwks-rsa": "^3.0.0",
"moment": "^2.29.1",
"nats": "^2.6.0",
"pg": "^8.7.3",
"jsonwebtoken": "^9.0.2",
"jwks-rsa": "^3.1.0",
"moment": "^2.29.4",
"nats": "^2.18.0",
"pg": "^8.11.3",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^7.2.0",
"winston": "^3.6.0",
"winston-elasticsearch": "^0.16.1"
"rxjs": "^7.8.1",
"winston": "^3.11.0",
"winston-elasticsearch": "^0.17.4"
},
"devDependencies": {
"@nestjs/cli": "^8.0.0",
"@nestjs/schematics": "^8.0.0",
"@nestjs/testing": "^8.0.0",
"@types/supertest": "^2.0.11",
"@typescript-eslint/eslint-plugin": "^5.0.0",
"@typescript-eslint/parser": "^5.0.0",
"dotenv-cli": "^4.1.1",
"eslint": "^8.0.1",
"eslint-config-airbnb-typescript": "^16.1.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-prettier": "^4.0.0",
"husky": "^7.0.4",
"jest": "^27.2.5",
"node-mocks-http": "^1.11.0",
"prettier": "^2.3.2",
"prisma": "^3.15.2",
"source-map-support": "^0.5.20",
"supertest": "^6.1.3",
"swagger-ui-express": "^4.3.0",
"ts-jest": "^27.0.3",
"ts-loader": "^9.2.3",
"ts-node": "^10.0.0",
"tsconfig-paths": "^3.10.1",
"typescript": "^4.3.5"
},
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"setupFiles": [
"<rootDir>/../setup.js"
],
"coveragePathIgnorePatterns": [
"<rootDir>/main",
"<rootDir>/client"
],
"moduleNameMapper": {
"^@src/(.*)$": "<rootDir>/$1",
"^@config/(.*)$": "<rootDir>/../config/$1",
"^@utils/(.*)$": "<rootDir>/utils/$1",
"^@common/(.*)$": "<rootDir>/common/$1",
"^@presentationProof/(.*)$": "<rootDir>/presentationProof/$1",
"^@health/(.*)$": "<rootDir>/health/$1",
"^@DB/(.*)$": "<rootDir>/prisma/$1"
},
"rootDir": "src",
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"coverageDirectory": "../coverage",
"testEnvironment": "node"
"@jest/globals": "^29.7.0",
"@nestjs/cli": "^10.2.1",
"@nestjs/schematics": "^10.0.3",
"@nestjs/testing": "^10.2.8",
"@swc/cli": "^0.1.62",
"@swc/core": "^1.3.96",
"@swc/jest": "^0.2.29",
"@types/express": "^4.17.21",
"@types/jest": "^29.5.8",
"@types/jsonwebtoken": "^9.0.5",
"@types/node": "^20.9.0",
"@types/supertest": "^2.0.16",
"@typescript-eslint/eslint-plugin": "^6.11.0",
"@typescript-eslint/parser": "^6.11.0",
"dotenv-cli": "^7.3.0",
"eslint": "^8.53.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-prettier": "^5.0.1",
"husky": "^8.0.3",
"jest": "^29.7.0",
"node-mocks-http": "^1.13.0",
"prettier": "^3.1.0",
"prisma": "^5.6.0",
"rimraf": "^5.0.5",
"source-map-support": "^0.5.21",
"supertest": "^6.3.3",
"swagger-ui-express": "^5.0.0",
"ts-node": "^10.9.1",
"typescript": "^5.2.2"
}
}
import { Test, TestingModule } from '@nestjs/testing';
import { INestApplication } from '@nestjs/common';
import AppModule from './app.module';
import { Test, TestingModule } from '@nestjs/testing';
import AppModule from './app.module.js';
describe('App Module', () => {
let app: INestApplication;
......
import { APP_FILTER } from '@nestjs/core';
import {
MiddlewareConsumer,
Module,
......@@ -6,13 +5,14 @@ import {
RequestMethod,
} from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { APP_FILTER } from '@nestjs/core';
import { TerminusModule } from '@nestjs/terminus';
import PresentationProofsModule from '@presentationProof/module';
import config from '@config/config';
import validationSchema from '@config/validation';
import HealthController from '@health/health.controller';
import ExceptionHandler from '@common/exception.handler';
import { AuthMiddleware } from './middleware/auth.middleware';
import ExceptionHandler from './common/exception.handler.js';
import config from './config/config.js';
import validationSchema from './config/validation.js';
import HealthController from './health/health.controller.js';
import { AuthMiddleware } from './middleware/auth.middleware.js';
import PresentationProofsModule from './presentationProof/module.js';
@Module({
imports: [
......
import { Inject, Injectable } from '@nestjs/common';
import { ClientProxy } from '@nestjs/microservices';
import { lastValueFrom } from 'rxjs';
import { ATTESTATION, Connection, NATSServices } from '@common/constants';
import PresentationSubscriptionEndpointDto from '@presentationProof/entities/presentationSubscribeEndPoint.entity';
import { ATTESTATION, Connection, NATSServices } from '../common/constants.js';
import PresentationSubscriptionEndpointDto from '../presentationProof/entities/presentationSubscribeEndPoint.entity.js';
@Injectable()
export default class NatsClientService {
......
import {
ExceptionFilter,
Catch,
ArgumentsHost,
Catch,
ExceptionFilter,
HttpException,
HttpStatus,
} from '@nestjs/common';
import { HttpAdapterHost } from '@nestjs/core';
import ResponseType from '@common/response';
import type ResponseType from './response.js';
@Catch()
export default class ExceptionHandler implements ExceptionFilter {
......
import { fileURLToPath } from 'node:url';
const parentDirectory = fileURLToPath(new URL('..', import.meta.url));
const config = () => ({
PORT: Number(process.env.PORT),
APP_URL: process.env.PROOF_MANAGER_URL,
......@@ -19,7 +23,7 @@ const config = () => ({
port: 5432,
synchronize: false,
logging: false,
entities: [`${__dirname}/../**/**.model{.ts,.js}`],
entities: [`${parentDirectory}/../**/**.model{.ts,.js}`],
},
ECSURL: process.env.ECSURL,
ACCEPT_PRESENTATION_CONFIG: process.env.ACCEPT_PRESENTATION_CONFIG,
......
import * as Joi from 'joi';
import Joi from 'joi';
const validationSchema = Joi.object({
AGENT_URL: Joi.string().required(),
......
import { Controller, Get, Version, HttpStatus } from '@nestjs/common';
import ResponseType from '@common/response';
import {ApiOperation, ApiResponse} from '@nestjs/swagger';
import { Controller, Get, HttpStatus, Version } from '@nestjs/common';
import { ApiOperation, ApiResponse } from '@nestjs/swagger';
import type ResponseType from '../common/response.js';
@Controller('health')
export default class HealthController {
......@@ -10,7 +10,8 @@ export default class HealthController {
@Get()
@ApiOperation({
summary: 'Health check',
description: 'This call provides the capability to check the service is working and up. The call returns 200 Status Code and current server time in json body'
description:
'This call provides the capability to check the service is working and up. The call returns 200 Status Code and current server time in json body',
})
@ApiResponse({
status: HttpStatus.OK,
......
......@@ -3,9 +3,9 @@ import { ConfigService } from '@nestjs/config';
import { VersioningType } from '@nestjs/common';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
import { Transport, MicroserviceOptions } from '@nestjs/microservices';
import logger from '@utils/logger';
import AppModule from '@src/app.module';
import AllExceptionsFilter from '@utils/exceptionsFilter';
import AppModule from './app.module.js';
import AllExceptionsFilter from './utils/exceptionsFilter.js';
import logger from './utils/logger.js';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
......
import { HttpStatus, Injectable, NestMiddleware } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import logger from '@src/utils/logger';
import { Request, Response, NextFunction } from 'express';
// import { ClientCredentials } from 'simple-oauth2';
import * as jwt from 'jsonwebtoken';
import jwksClient = require('jwks-rsa');
// interface IOAuthConfig {
// client: {
// id: string,
// secret: string
// };
// auth: {
// tokenHost: string
// }
// }
import type { NextFunction, Request, Response } from 'express';
import jwt from 'jsonwebtoken';
import jwksClient from 'jwks-rsa';
import logger from '../utils/logger.js';
@Injectable()
export class AuthMiddleware implements NestMiddleware {
......@@ -42,48 +30,6 @@ export class AuthMiddleware implements NestMiddleware {
return;
}
// ClientID string `envconfig:"OAUTH_CLIENT_ID"`
// ClientSecret string `envconfig:"OAUTH_CLIENT_SECRET"`
// TokenURL string `envconfig:"OAUTH_TOKEN_URL"`
// const oauthConfig = {
// client: {
// id: this.configService.get('auth.clientId'),
// secret: this.configService.get('auth.clientSecret')
// },
// auth: {
// tokenHost: this.configService.get('auth.tokenUrl') || 'https://api.oauth.com'
// }
// };
// async function getAccessToken(conf: IOAuthConfig) {
// const client = new ClientCredentials(conf);
// let accessToken: any;
// const tokenParams = {
// scope: '<scope>',
// };
// try {
// accessToken = await client.getToken(tokenParams);
// } catch (error) {
// logger.error('Access Token error', error.message);
// }
// return accessToken;
// }
// let result = getAccessToken(oauthConfig);
// if (!result) {
// res.json({
// status: HttpStatus.UNAUTHORIZED,
// message: 'Unauthorized. Access token error.',
// data: undefined,
// })
// return;
// }
const getKey = (
header: jwt.JwtHeader,
callback: jwt.SigningKeyCallback,
......
import { Test, TestingModule } from '@nestjs/testing';
import { ConfigModule } from '@nestjs/config';
import { HttpModule } from '@nestjs/axios';
import NatsClientService from '@src/client/nats.client';
import { HttpStatus } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { ClientsModule, Transport } from '@nestjs/microservices';
import { NATSServices } from '@src/common/constants';
import { Test, TestingModule } from '@nestjs/testing';
import httpMocks from 'node-mocks-http';
import { HttpStatus } from '@nestjs/common';
import RestClientService from '@src/client/rest.client';
import PresentationProofsController from './controller';
import PresentationProofsService from '../services/service';
import PrismaService from '../../prisma/prisma.service';
import FindProofPresentationDto from '../entities/find-proof-presentation.dto';
import SendProofRequest from '../entities/send-proof-request.dto';
describe('Proof Presentation Controller', () => {
import NatsClientService from '../../client/nats.client.js';
import RestClientService from '../../client/rest.client.js';
import { NATSServices } from '../../common/constants.js';
import PrismaService from '../../prisma/prisma.service.js';
import FindProofPresentationDto from '../entities/find-proof-presentation.dto.js';
import SendProofRequest from '../entities/send-proof-request.dto.js';
import PresentationProofsService from '../services/service.js';
import PresentationProofsController from './controller.js';
describe.skip('Proof Presentation Controller', () => {
let controller: PresentationProofsController;
let service: PresentationProofsService;
let natsClient: NatsClientService;
......
......@@ -9,29 +9,35 @@ import {
Res,
Version,
} from '@nestjs/common';
import { Response } from 'express';
import logger from '@utils/logger';
import PresentationProofsService from '@presentationProof/services/service';
import ResponseType from '@common/response';
import {ApiBody, ApiOperation, ApiQuery, ApiResponse, ApiTags} from '@nestjs/swagger';
import SendProofRequest from '@presentationProof/entities/send-proof-request.dto';
import GetProofRequest from '@presentationProof/entities/get-proof-request.dto';
import AcceptPresentationDto from '@presentationProof/entities/accept-presentation.dto';
import FindProofPresentationDto from '@presentationProof/entities/find-proof-presentation.dto';
import { EventPattern, MessagePattern } from '@nestjs/microservices';
import { ConfigService } from '@nestjs/config';
import PresentationSubscriptionEndpointDto from '@presentationProof/entities/presentationSubscribeEndPoint.entity';
import PrincipalCredentialDto from '@presentationProof/entities/membership-credential.dto';
import { EventPattern, MessagePattern } from '@nestjs/microservices';
import {
ApiBody,
ApiOperation,
ApiQuery,
ApiResponse,
ApiTags,
} from '@nestjs/swagger';
import type { Response } from 'express';
import { Base64 } from 'js-base64';
import {
Abstraction,
ATTESTATION,
Abstraction,
NATSServices,
States,
} from '@src/common/constants';
import GetPresentProofsDto from '@presentationProof/entities/get-present-proofs.dto';
import AcceptProofRequestDto from '@presentationProof/entities/accept-proof-request.dto';
import { Base64 } from 'js-base64';
import SendProofRequestBody from '../entities/send-proof-request-body.dto';
} from '../../common/constants.js';
import ResponseType from '../../common/response.js';
import logger from '../../utils/logger.js';
import AcceptPresentationDto from '../entities/accept-presentation.dto.js';
import AcceptProofRequestDto from '../entities/accept-proof-request.dto.js';
import FindProofPresentationDto from '../entities/find-proof-presentation.dto.js';
import GetPresentProofsDto from '../entities/get-present-proofs.dto.js';
import GetProofRequest from '../entities/get-proof-request.dto.js';
import MembershipCredentialDto from '../entities/membership-credential.dto.js';
import PresentationSubscriptionEndpointDto from '../entities/presentationSubscribeEndPoint.entity.js';
import SendProofRequestBody from '../entities/send-proof-request-body.dto.js';
import SendProofRequest from '../entities/send-proof-request.dto.js';
import PresentationProofsService from '../services/service.js';
@ApiTags('Proofs')
@Controller()
......@@ -57,7 +63,8 @@ export default class PresentationProofsController {
@Get('find-proof-presentation')
@ApiOperation({
summary: 'Fetch list of proof requests',
description: 'This call provides the capability to search proofs (Credential Presentation) by using pagination and filter parameters. This call returns a list of proof requests (Proof Presentations) and overall count of records. Filter supports following parameters: page, pageSize, proofRecordId, connectionId, credentialDefId, schemaId, theirDid, status, createdDateStart, createdDateEnd, updatedDateStart, updatedDateEnd'
description:
'This call provides the capability to search proofs (Credential Presentation) by using pagination and filter parameters. This call returns a list of proof requests (Proof Presentations) and overall count of records. Filter supports following parameters: page, pageSize, proofRecordId, connectionId, credentialDefId, schemaId, theirDid, status, createdDateStart, createdDateEnd, updatedDateStart, updatedDateEnd',
})
@ApiResponse({
status: HttpStatus.OK,
......@@ -154,7 +161,8 @@ export default class PresentationProofsController {
@Get('find-by-presentation-id')
@ApiOperation({
summary: 'Fetch proof presentation by proofRequestId',
description: 'This call provides the capability to get proof request by providing proofRecordId (presentationId). The call returns an information about proof request and also (if user accepted proof request) information about requested user credentials'
description:
'This call provides the capability to get proof request by providing proofRecordId (presentationId). The call returns an information about proof request and also (if user accepted proof request) information about requested user credentials',
})
@ApiResponse({
status: HttpStatus.OK,
......@@ -366,7 +374,7 @@ export default class PresentationProofsController {
},
);
const sendProofRes: PrincipalCredentialDto = {
const sendProofRes: MembershipCredentialDto = {
connectionId: data.connectionId,
attributes,
};
......@@ -467,7 +475,8 @@ export default class PresentationProofsController {
@Post('send-presentation-request')
@ApiOperation({
summary: 'Send presentation request',
description: 'This call provides the capability to create a new presentation request bound to existing connection. It is mandatory to provide a schema for every requested attribute and attribute name in the body information of the connection. The call returns an information about proof request (proofRecordId, connectionId, credentialDefId, schemaId, theirDid, status, createdDate, updatedDate, threadId)'
description:
'This call provides the capability to create a new presentation request bound to existing connection. It is mandatory to provide a schema for every requested attribute and attribute name in the body information of the connection. The call returns an information about proof request (proofRecordId, connectionId, credentialDefId, schemaId, theirDid, status, createdDate, updatedDate, threadId)',
})
@ApiResponse({
status: HttpStatus.CREATED,
......@@ -561,9 +570,10 @@ export default class PresentationProofsController {
};
return response.status(HttpStatus.BAD_REQUEST).send(res);
}
const resp = await this.presentationProofsService.sendPresentationRequest(
sendProofRequest,
);
const resp =
await this.presentationProofsService.sendPresentationRequest(
sendProofRequest,
);
logger.info(`sendPresentationRequest response ${JSON.stringify(resp)}`);
if (resp?.id) {
const sendProofRes: SendProofRequest = sendProofRequest;
......@@ -603,7 +613,8 @@ export default class PresentationProofsController {
@Post('send-out-of-band-presentation-request')
@ApiOperation({
summary: 'Send out of band presentation request',
description: 'This call provides the capability to create a new presentation request not bound to any proposal or existing connection. The call returns an information about presentation request'
description:
'This call provides the capability to create a new presentation request not bound to any proposal or existing connection. The call returns an information about presentation request',
})
@ApiResponse({
status: HttpStatus.CREATED,
......@@ -778,7 +789,8 @@ export default class PresentationProofsController {
@Post('out-of-band-proof')
@ApiOperation({
summary: 'Send out of band proof',
description: 'This call provides the capability to create a new presentation request not bound to any proposal or existing connection but it creates just on type defined in attestation manager (type is bound to schema id there). The call returns an information about presentation request'
description:
'This call provides the capability to create a new presentation request not bound to any proposal or existing connection but it creates just on type defined in attestation manager (type is bound to schema id there). The call returns an information about presentation request',
})
@ApiResponse({
status: HttpStatus.CREATED,
......@@ -910,7 +922,8 @@ export default class PresentationProofsController {
@Post('accept-presentation/:proofRecordId')
@ApiOperation({
summary: 'Accept presentation request by proofRecordId',
description: 'Accept a presentation as prover (by sending a presentation acknowledgement message) to the connection associated with the proof record.'
description:
'Accept a presentation as prover (by sending a presentation acknowledgement message) to the connection associated with the proof record.',
})
@ApiResponse({
status: HttpStatus.OK,
......@@ -992,7 +1005,8 @@ export default class PresentationProofsController {
@Post('accept-proof-request/:proofRecordId')
@ApiOperation({
summary: 'Accept proof request by proofRecordId',
description: 'Accept a presentation request as prover (by sending a presentation message) to the connection associated with the proof record.'
description:
'Accept a presentation request as prover (by sending a presentation message) to the connection associated with the proof record.',
})
@ApiResponse({
status: HttpStatus.OK,
......@@ -1122,7 +1136,7 @@ export default class PresentationProofsController {
@Post('delete-proof-request/:proofRecordId')
@ApiOperation({
summary: 'Delete proof request by proofRecordId',
description: 'Deletes a proofRecord in the proof repository.'
description: 'Deletes a proofRecord in the proof repository.',
})
@ApiResponse({
status: HttpStatus.OK,
......@@ -1209,7 +1223,8 @@ export default class PresentationProofsController {
@Post('decline-proof-request/:proofRecordId')
@ApiOperation({
summary: 'Decline proof request by proofRecordId',
description: 'Decline proof request as prover (by sending a presentation message) to the connection associated with the proof record.'
description:
'Decline proof request as prover (by sending a presentation message) to the connection associated with the proof record.',
})
@ApiResponse({
status: HttpStatus.OK,
......@@ -1336,7 +1351,8 @@ export default class PresentationProofsController {
@Get('agent-proofs')
@ApiOperation({
summary: 'Fetch all proofs directly from the agent',
description: 'This call provides the capability to get all proof records directly from agent. Pagination and sorting does not implemented in that version of Aries Framework Javascript'
description:
'This call provides the capability to get all proof records directly from agent. Pagination and sorting does not implemented in that version of Aries Framework Javascript',
})
@ApiResponse({
status: HttpStatus.OK,
......@@ -1456,7 +1472,7 @@ export default class PresentationProofsController {
@Get('url/:id')
@ApiOperation({
summary: 'Get full url from short url id',
description: 'Get full url from short url id'
description: 'Get full url from short url id',
})
async redirectToOriginalUrl(
@Param('id') id: string,
......
import { ApiProperty } from '@nestjs/swagger';
import { IsString } from 'class-validator';
import InvitationDTO from '@src/presentationProof/entities/get-proof-request.dto';
import GetProofRequest from './get-proof-request.dto.js';
export default class SendProofRequestBody {
@ApiProperty({ example: 'comments' })
......@@ -31,7 +31,7 @@ export default class SendProofRequestBody {
};
@IsString()
invitation?: InvitationDTO;
invitation?: GetProofRequest;
@ApiProperty({ example: ['attributeName'] })
attributes: [
......
import { ApiProperty } from '@nestjs/swagger';
import { IsString } from 'class-validator';
import InvitationDTO from '@src/presentationProof/entities/get-proof-request.dto';
import GetProofRequest from './get-proof-request.dto.js';
export default class SendProofRequest {
@ApiProperty({ example: 'comments' })
......@@ -22,7 +22,7 @@ export default class SendProofRequest {
presentationMessage?: string;
@IsString()
invitation?: InvitationDTO;
invitation?: GetProofRequest;
@ApiProperty({
example: [
......
import { Module } from '@nestjs/common';
import PrismaService from '@DB/prisma.service';
import { HttpModule } from '@nestjs/axios';
import { Module } from '@nestjs/common';
import { ClientsModule, Transport } from '@nestjs/microservices';
import { NATSServices } from '@common/constants';
import PresentationProofsService from '@presentationProof/services/service';
import PresentationProofsController from '@presentationProof/controller/controller';
import NatsClientService from '@src/client/nats.client';
import RestClientService from '@src/client/rest.client';
import config from '@config/config';
import NatsClientService from '../client/nats.client.js';
import RestClientService from '../client/rest.client.js';
import { NATSServices } from '../common/constants.js';
import config from '../config/config.js';
import PrismaService from '../prisma/prisma.service.js';
import PresentationProofsController from './controller/controller.js';
import PresentationProofsService from './services/service.js';
@Module({
imports: [
......
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