diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 76e2f233..d5f94d7a 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -98,8 +98,17 @@ jobs: - name: Install dependencies run: yarn install - - name: Run tests - run: TEST_AGENT_PUBLIC_DID_SEED=${TEST_AGENT_PUBLIC_DID_SEED} GENESIS_TXN_PATH=${GENESIS_TXN_PATH} yarn test --coverage + - name: Run tests for Push notifications + run: TEST_AGENT_PUBLIC_DID_SEED=${TEST_AGENT_PUBLIC_DID_SEED} GENESIS_TXN_PATH=${GENESIS_TXN_PATH} yarn test push-notifications --coverage + + - name: Run tests for React hooks + run: TEST_AGENT_PUBLIC_DID_SEED=${TEST_AGENT_PUBLIC_DID_SEED} GENESIS_TXN_PATH=${GENESIS_TXN_PATH} yarn test react-hooks --coverage + + - name: Run tests for Redux store + run: TEST_AGENT_PUBLIC_DID_SEED=${TEST_AGENT_PUBLIC_DID_SEED} GENESIS_TXN_PATH=${GENESIS_TXN_PATH} yarn test redux-store --coverage + + - name: Run tests for Rest + run: TEST_AGENT_PUBLIC_DID_SEED=${TEST_AGENT_PUBLIC_DID_SEED} GENESIS_TXN_PATH=${GENESIS_TXN_PATH} yarn test rest --coverage - uses: codecov/codecov-action@v1 if: always() diff --git a/.prettierignore b/.prettierignore index 6b7d9052..223829f1 100644 --- a/.prettierignore +++ b/.prettierignore @@ -3,4 +3,5 @@ build .vscode .idea coverage -CHANGELOG.md \ No newline at end of file +CHANGELOG.md +routes \ No newline at end of file diff --git a/packages/rest/package.json b/packages/rest/package.json index 9053b8a7..ffdb528f 100644 --- a/packages/rest/package.json +++ b/packages/rest/package.json @@ -21,34 +21,36 @@ "afj-rest": "bin/afj-rest.js" }, "scripts": { - "dev": "tsnd --respawn samples/sampleWithApp.ts", + "tsoa": "tsoa spec-and-routes", + "dev": "tsoa spec-and-routes && tsnd --respawn samples/sampleWithApp.ts", "build": "yarn run clean && yarn run compile", "clean": "rimraf -rf ./build", "compile": "tsc -p tsconfig.build.json", "prepublishOnly": "yarn run build", - "test": "jest" + "test": "jest", + "postinstall": "tsoa spec-and-routes" }, "dependencies": { - "@aries-framework/core": "^0.1.0", - "@aries-framework/node": "^0.1.0", - "class-transformer": "0.5.1", - "class-validator": "0.13.1", - "class-validator-jsonschema": "^3.1.1", + "@aries-framework/core": "^0.2.3", + "@aries-framework/node": "^0.2.3", + "body-parser": "^1.20.0", "cors": "^2.8.5", "express": "^4.18.1", "node-fetch": "^2.6.7", "reflect-metadata": "^0.1.13", - "routing-controllers": "^0.9.0", - "routing-controllers-openapi": "^3.1.0", "swagger-ui-express": "^4.4.0", "tslog": "^3.3.3", + "tsoa": "^4.1.2", "tsyringe": "^4.7.0", "yargs": "^17.3.1" }, "devDependencies": { + "@types/body-parser": "^1.19.2", + "@types/cors": "^2.8.12", "@types/express": "^4.17.13", "@types/jest": "^27.0.3", - "@types/node": "^17.0.41", + "@types/multer": "^1.4.7", + "@types/node": "^16.7.10", "@types/supertest": "^2.0.12", "@types/swagger-ui-express": "^4.1.3", "@types/uuid": "^8.3.4", diff --git a/packages/rest/samples/sample.ts b/packages/rest/samples/sample.ts index 00d770bc..9cb09840 100644 --- a/packages/rest/samples/sample.ts +++ b/packages/rest/samples/sample.ts @@ -3,7 +3,7 @@ import type { ServerConfig } from '../src/utils/ServerConfig' import { connect } from 'ngrok' import { startServer } from '../src/index' -import { setupAgent } from '../tests/utils/agent' +import { setupAgent } from '../src/utils/agent' const run = async () => { const endpoint = await connect(3001) diff --git a/packages/rest/samples/sampleWithApp.ts b/packages/rest/samples/sampleWithApp.ts index 1c391405..52453124 100644 --- a/packages/rest/samples/sampleWithApp.ts +++ b/packages/rest/samples/sampleWithApp.ts @@ -1,13 +1,12 @@ import type { ServerConfig } from '../src/utils/ServerConfig' -import type { Express } from 'express' +import { AgentConfig } from '@aries-framework/core' +import bodyParser from 'body-parser' +import express from 'express' import { connect } from 'ngrok' -import { createExpressServer } from 'routing-controllers' import { startServer } from '../src/index' -import { setupAgent } from '../tests/utils/agent' - -import { GreetingController } from './utils/GreetingController' +import { setupAgent } from '../src/utils/agent' const run = async () => { const endpoint = await connect(3001) @@ -19,14 +18,19 @@ const run = async () => { name: 'Aries Test Agent', }) - const app: Express = createExpressServer({ - controllers: [GreetingController], + const app = express() + const jsonParser = bodyParser.json() + + app.post('/greeting', jsonParser, (req, res) => { + const config = agent.injectionContainer.resolve(AgentConfig) + + res.send(`Hello, ${config.label}!`) }) const conf: ServerConfig = { port: 3000, - app: app, webhookUrl: 'http://localhost:5000/agent-events', + app: app, } await startServer(agent, conf) diff --git a/packages/rest/samples/utils/GreetingController.ts b/packages/rest/samples/utils/GreetingController.ts deleted file mode 100644 index 7d47fb47..00000000 --- a/packages/rest/samples/utils/GreetingController.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Agent, AgentConfig } from '@aries-framework/core' -import { Get, JsonController } from 'routing-controllers' -import { injectable } from 'tsyringe' - -@JsonController('/greeting') -@injectable() -export class GreetingController { - private agent: Agent - - public constructor(agent: Agent) { - this.agent = agent - } - - /** - * Greet agent - */ - @Get('/') - public async greeting() { - const config = this.agent.injectionContainer.resolve(AgentConfig) - - return `Hello, ${config.label}!` - } -} diff --git a/packages/rest/src/controllers/agent/AgentController.ts b/packages/rest/src/controllers/agent/AgentController.ts index 38cff75c..c7b00407 100644 --- a/packages/rest/src/controllers/agent/AgentController.ts +++ b/packages/rest/src/controllers/agent/AgentController.ts @@ -1,13 +1,17 @@ +import type { AgentInfo } from '../types' + import { Agent } from '@aries-framework/core' -import { Get, JsonController } from 'routing-controllers' +import { Controller, Get, Route, Tags } from 'tsoa' import { injectable } from 'tsyringe' -@JsonController('/agent') +@Tags('Agent') +@Route('/agent') @injectable() -export class AgentController { +export class AgentController extends Controller { private agent: Agent public constructor(agent: Agent) { + super() this.agent = agent } @@ -15,7 +19,7 @@ export class AgentController { * Retrieve basic agent information */ @Get('/') - public async getAgentInfo() { + public async getAgentInfo(): Promise { return { label: this.agent.config.label, endpoints: this.agent.config.endpoints, diff --git a/packages/rest/src/controllers/basic-messages/BasicMessageController.ts b/packages/rest/src/controllers/basic-messages/BasicMessageController.ts index 0bc15f4d..c2b652bb 100644 --- a/packages/rest/src/controllers/basic-messages/BasicMessageController.ts +++ b/packages/rest/src/controllers/basic-messages/BasicMessageController.ts @@ -1,53 +1,55 @@ +import type { BasicMessageRecord, BasicMessageStorageProps } from '@aries-framework/core' + import { Agent, RecordNotFoundError } from '@aries-framework/core' -import { - Body, - Get, - InternalServerError, - JsonController, - NotFoundError, - OnUndefined, - Param, - Post, -} from 'routing-controllers' +import { Body, Controller, Example, Get, Path, Post, Res, Route, Tags, TsoaResponse } from 'tsoa' import { injectable } from 'tsyringe' -import { BasicMessageRequest } from '../../schemas/BasicMessageRequest' +import { BasicMessageRecordExample, RecordId } from '../examples' -@JsonController('/basic-messages') +@Tags('Basic Messages') +@Route('/basic-messages') @injectable() -export class BasicMessageController { +export class BasicMessageController extends Controller { private agent: Agent public constructor(agent: Agent) { + super() this.agent = agent } /** - * Retrieve basic messages by connectionId + * Retrieve basic messages by connection id + * + * @param connectionId Connection identifier + * @returns BasicMessageRecord[] */ + @Example([BasicMessageRecordExample]) @Get('/:connectionId') - public async getBasicMessages(@Param('connectionId') connectionId: string) { - const basicMessages = await this.agent.basicMessages.findAllByQuery({ connectionId: connectionId }) - return basicMessages.map((m) => m.toJSON()) + public async getBasicMessages(@Path('connectionId') connectionId: RecordId): Promise { + return await this.agent.basicMessages.findAllByQuery({ connectionId }) } /** * Send a basic message to a connection + * + * @param connectionId Connection identifier + * @param content The content of the message */ @Post('/:connectionId') - @OnUndefined(204) public async sendMessage( - @Param('connectionId') connectionId: string, - @Body() - basicMessage: BasicMessageRequest + @Path('connectionId') connectionId: RecordId, + @Body() request: Record<'content', string>, + @Res() notFoundError: TsoaResponse<404, { reason: string }>, + @Res() internalServerError: TsoaResponse<500, { message: string }> ) { try { - await this.agent.basicMessages.sendMessage(connectionId, basicMessage.content) + this.setStatus(204) + await this.agent.basicMessages.sendMessage(connectionId, request.content) } catch (error) { if (error instanceof RecordNotFoundError) { - throw new NotFoundError(`connection with connectionId "${connectionId}" not found.`) + return notFoundError(404, { reason: `connection with connection id "${connectionId}" not found.` }) } - throw new InternalServerError(`something went wrong: ${error}`) + return internalServerError(500, { message: `something went wrong: ${error}` }) } } } diff --git a/packages/rest/src/controllers/connections/ConnectionController.ts b/packages/rest/src/controllers/connections/ConnectionController.ts index f24b2dda..964108bc 100644 --- a/packages/rest/src/controllers/connections/ConnectionController.ts +++ b/packages/rest/src/controllers/connections/ConnectionController.ts @@ -1,184 +1,149 @@ -import { Agent, ConnectionInvitationMessage, JsonTransformer, RecordNotFoundError } from '@aries-framework/core' -import { - Body, - Delete, - Get, - InternalServerError, - JsonController, - NotFoundError, - OnUndefined, - Param, - Post, -} from 'routing-controllers' +import type { ConnectionRecordProps } from '@aries-framework/core' + +import { Agent, AriesFrameworkError, RecordNotFoundError } from '@aries-framework/core' +import { Controller, Delete, Example, Get, Path, Post, Query, Res, Route, Tags, TsoaResponse } from 'tsoa' import { injectable } from 'tsyringe' -import { InvitationConfigRequest } from '../../schemas/InvitationConfigRequest' -import { ReceiveInvitationByUrlRequest } from '../../schemas/ReceiveInvitationByUrlRequest' -import { ReceiveInvitationRequest } from '../../schemas/ReceiveInvitationRequest' +import { ConnectionRecordExample, RecordId } from '../examples' -@JsonController('/connections') +@Tags('Connections') +@Route('/connections') @injectable() -export class ConnectionController { +export class ConnectionController extends Controller { private agent: Agent public constructor(agent: Agent) { + super() this.agent = agent } - /** - * Retrieve connection record by connectionId - */ - @Get('/:connectionId') - public async getConnectionById(@Param('connectionId') connectionId: string) { - const connection = await this.agent.connections.findById(connectionId) - - if (!connection) { - throw new NotFoundError(`connection with connectionId "${connectionId}" not found.`) - } - - return connection.toJSON() - } - /** * Retrieve all connections records + * @param alias Alias + * @param state Connection state + * @param myDid My DID + * @param theirDid Their DID + * @param theirLabel Their label + * @returns ConnectionRecord[] */ + @Example([ConnectionRecordExample]) @Get('/') - public async getAllConnections() { - const connections = await this.agent.connections.getAll() - return connections.map((c) => c.toJSON()) - } - - /** - * Creates a new ConnectionRecord and InvitationMessage. - * Returns ConnectionRecord with invitation and invitation_url - */ - @Post('/create-invitation') - public async createInvitation( - @Body() - invitationConfig?: InvitationConfigRequest + public async getAllConnections( + @Query('outOfBandId') outOfBandId?: string, + @Query('alias') alias?: string, + @Query('state') state?: string, + @Query('myDid') myDid?: string, + @Query('theirDid') theirDid?: string, + @Query('theirLabel') theirLabel?: string ) { - try { - const { invitation, connectionRecord } = await this.agent.connections.createConnection(invitationConfig) + let connections - return { - invitationUrl: invitation.toUrl({ - domain: this.agent.config.endpoints[0], - useLegacyDidSovPrefix: this.agent.config.useLegacyDidSovPrefix, - }), - invitation: invitation.toJSON({ useLegacyDidSovPrefix: this.agent.config.useLegacyDidSovPrefix }), - connection: connectionRecord.toJSON(), - } - } catch (error) { - if (error instanceof RecordNotFoundError) { - throw new NotFoundError(`mediator with mediatorId ${invitationConfig?.mediatorId} not found`) - } - throw new InternalServerError(`something went wrong: ${error}`) + if (outOfBandId) { + connections = await this.agent.connections.findAllByOutOfBandId(outOfBandId) + } else { + connections = await this.agent.connections.getAll() } - } - /** - * Receive connection invitation as invitee and create connection. If auto accepting is enabled - * via either the config passed in the function or the global agent config, a connection - * request message will be send. - */ - @Post('/receive-invitation') - public async receiveInvitation(@Body() invitationRequest: ReceiveInvitationRequest) { - const { invitation, ...config } = invitationRequest - try { - const inv = JsonTransformer.fromJSON(invitation, ConnectionInvitationMessage) - const connection = await this.agent.connections.receiveInvitation(inv, config) + if (alias) connections = connections.filter((c) => c.alias === alias) + if (state) connections = connections.filter((c) => c.state === state) + if (myDid) connections = connections.filter((c) => c.did === myDid) + if (theirDid) connections = connections.filter((c) => c.theirDid === theirDid) + if (theirLabel) connections = connections.filter((c) => c.theirLabel === theirLabel) - return connection.toJSON() - } catch (error) { - throw new InternalServerError(`something went wrong: ${error}`) - } + return connections.map((c) => c.toJSON()) } /** - * Receive connection invitation as invitee by invitationUrl and create connection. If auto accepting is enabled - * via either the config passed in the function or the global agent config, a connection - * request message will be send. + * Retrieve connection record by connection id + * @param connectionId Connection identifier + * @returns ConnectionRecord */ - @Post('/receive-invitation-url') - public async receiveInvitationByUrl(@Body() invitationByUrlRequest: ReceiveInvitationByUrlRequest) { - const { invitationUrl, ...config } = invitationByUrlRequest + @Example(ConnectionRecordExample) + @Get('/:connectionId') + public async getConnectionById( + @Path('connectionId') connectionId: RecordId, + @Res() notFoundError: TsoaResponse<404, { reason: string }> + ) { + const connection = await this.agent.connections.findById(connectionId) - try { - const connection = await this.agent.connections.receiveInvitationFromUrl(invitationUrl, config) + if (!connection) return notFoundError(404, { reason: `connection with connection id "${connectionId}" not found.` }) - return connection.toJSON() - } catch (error) { - throw new InternalServerError(`something went wrong: ${error}`) - } + return connection.toJSON() } /** - * Accept a connection invitation as invitee (by sending a connection request message) for the connection with the specified connection id. - * This is not needed when auto accepting of connections is enabled. + * Deletes a connection record from the connection repository. + * + * @param connectionId Connection identifier */ - @Post('/:connectionId/accept-invitation') - public async acceptInvitation(@Param('connectionId') connectionId: string) { + @Delete('/:connectionId') + public async deleteConnection( + @Path('connectionId') connectionId: RecordId, + @Res() notFoundError: TsoaResponse<404, { reason: string }>, + @Res() internalServerError: TsoaResponse<500, { message: string }> + ) { try { - const connection = await this.agent.connections.acceptInvitation(connectionId) - - return connection.toJSON() + this.setStatus(204) + await this.agent.connections.deleteById(connectionId) } catch (error) { if (error instanceof RecordNotFoundError) { - throw new NotFoundError(`connection with connectionId "${connectionId}" not found.`) + return notFoundError(404, { reason: `connection with connection id "${connectionId}" not found.` }) } - throw new InternalServerError(`something went wrong: ${error}`) + return internalServerError(500, { message: `something went wrong: ${error}` }) } } /** - * Accept a connection request as inviter (by sending a connection response message) for the connection with the specified connection id. + * Accept a connection request as inviter by sending a connection response message + * for the connection with the specified connection id. + * * This is not needed when auto accepting of connection is enabled. + * + * @param connectionId Connection identifier + * @returns ConnectionRecord */ + @Example(ConnectionRecordExample) @Post('/:connectionId/accept-request') - public async acceptRequest(@Param('connectionId') connectionId: string) { + public async acceptRequest( + @Path('connectionId') connectionId: RecordId, + @Res() notFoundError: TsoaResponse<404, { reason: string }>, + @Res() internalServerError: TsoaResponse<500, { message: string }> + ) { try { const connection = await this.agent.connections.acceptRequest(connectionId) - return connection.toJSON() } catch (error) { - if (error instanceof RecordNotFoundError) { - throw new NotFoundError(`connection with connectionId "${connectionId}" not found.`) + if (error instanceof AriesFrameworkError) { + return notFoundError(404, { reason: `connection with connection id "${connectionId}" not found.` }) } - throw new InternalServerError(`something went wrong: ${error}`) + return internalServerError(500, { message: `something went wrong: ${error}` }) } } /** - * Accept a connection response as invitee (by sending a trust ping message) for the connection with the specified connection id. + * Accept a connection response as invitee by sending a trust ping message + * for the connection with the specified connection id. + * * This is not needed when auto accepting of connection is enabled. + * + * @param connectionId Connection identifier + * @returns ConnectionRecord */ + @Example(ConnectionRecordExample) @Post('/:connectionId/accept-response') - public async acceptResponse(@Param('connectionId') connectionId: string) { + public async acceptResponse( + @Path('connectionId') connectionId: RecordId, + @Res() notFoundError: TsoaResponse<404, { reason: string }>, + @Res() internalServerError: TsoaResponse<500, { message: string }> + ) { try { const connection = await this.agent.connections.acceptResponse(connectionId) - return connection.toJSON() } catch (error) { if (error instanceof RecordNotFoundError) { - throw new NotFoundError(`connection with connectionId "${connectionId}" not found.`) - } - throw new InternalServerError(`something went wrong: ${error}`) - } - } - - /** - * Deletes a connectionRecord in the connectionRepository. - */ - @Delete('/:connectionId') - @OnUndefined(204) - public async deleteConnection(@Param('connectionId') connectionId: string) { - try { - await this.agent.connections.deleteById(connectionId) - } catch (error) { - if (error instanceof RecordNotFoundError) { - throw new NotFoundError(`connection with connectionId "${connectionId}" not found.`) + return notFoundError(404, { reason: `connection with connection id "${connectionId}" not found.` }) } - throw new InternalServerError(`something went wrong: ${error}`) + return internalServerError(500, { message: `something went wrong: ${error}` }) } } } diff --git a/packages/rest/src/controllers/credentials/CredentialController.ts b/packages/rest/src/controllers/credentials/CredentialController.ts index 86c2da97..d5055075 100644 --- a/packages/rest/src/controllers/credentials/CredentialController.ts +++ b/packages/rest/src/controllers/credentials/CredentialController.ts @@ -1,53 +1,35 @@ -import { IndySdkError, Agent, RecordNotFoundError } from '@aries-framework/core' -import { JsonEncoder } from '@aries-framework/core/build/utils/JsonEncoder' -import { isIndyError } from '@aries-framework/core/build/utils/indyError' -import { - Get, - Post, - JsonController, - Body, - InternalServerError, - Param, - NotFoundError, - Delete, - OnUndefined, -} from 'routing-controllers' +import type { CredentialExchangeRecordProps } from '@aries-framework/core' + +import { Agent, RecordNotFoundError } from '@aries-framework/core' +import { Body, Controller, Delete, Get, Path, Post, Res, Route, Tags, TsoaResponse, Example } from 'tsoa' import { injectable } from 'tsyringe' -import { AcceptCredentialProposalRequest } from '../../schemas/AcceptCredentialProposalRequest' -import { CredentialOfferRequest } from '../../schemas/CredentialOfferRequest' -import { CredentialOfferTemp } from '../../schemas/CredentialOfferTemplate' -import { CredentialProposalRequest } from '../../schemas/CredentialProposalRequest' +import { CredentialExchangeRecordExample, RecordId } from '../examples' +import { + AcceptCredentialRequestOptions, + OfferCredentialOptions, + ProposeCredentialOptions, + AcceptCredentialProposalOptions, + AcceptCredentialOfferOptions, +} from '../types' -@JsonController('/credentials') +@Tags('Credentials') +@Route('/credentials') @injectable() -export class CredentialController { +export class CredentialController extends Controller { private agent: Agent public constructor(agent: Agent) { + super() this.agent = agent } /** - * Retrieve credential record by credentialId - */ - @Get('/:credentialId') - public async getCredentialById(@Param('credentialId') credentialId: string) { - try { - const credential = await this.agent.credentials.getById(credentialId) - - return credential.toJSON() - } catch (error) { - if (error instanceof RecordNotFoundError) { - throw new NotFoundError(`credential with credentialId "${credentialId}" not found.`) - } - throw new InternalServerError(`something went wrong: ${error}`) - } - } - - /** - * Retrieve all credential records + * Retrieve all credential exchange records + * + * @returns CredentialExchangeRecord[] */ + @Example([CredentialExchangeRecordExample]) @Get('/') public async getAllCredentials() { const credentials = await this.agent.credentials.getAll() @@ -55,163 +37,230 @@ export class CredentialController { } /** - * Initiate a new credential exchange as holder by sending a credential proposal message - * to the connection with the specified connection id. + * Retrieve credential exchange record by credential record id + * + * @param credentialRecordId + * @returns CredentialExchangeRecord */ - @Post('/propose-credential') - public async proposeCredential( - @Body() - proposal: CredentialProposalRequest + @Example(CredentialExchangeRecordExample) + @Get('/:credentialRecordId') + public async getCredentialById( + @Path('credentialRecordId') credentialRecordId: RecordId, + @Res() notFoundError: TsoaResponse<404, { reason: string }>, + @Res() internalServerError: TsoaResponse<500, { message: string }> ) { - const { connectionId, ...proposalRequest } = proposal try { - const credential = await this.agent.credentials.proposeCredential(connectionId, proposalRequest) - + const credential = await this.agent.credentials.getById(credentialRecordId) return credential.toJSON() } catch (error) { if (error instanceof RecordNotFoundError) { - throw new NotFoundError(`Connection with connection id "${connectionId}" not found.`) + return notFoundError(404, { + reason: `credential with credential record id "${credentialRecordId}" not found.`, + }) } - throw new InternalServerError(`Something went wrong: ${error}`) + return internalServerError(500, { message: `something went wrong: ${error}` }) } } /** - * Accept a credential proposal as issuer (by sending a credential offer message) to the connection - * associated with the credential record. + * Deletes a credential exchange record in the credential repository. + * + * @param credentialRecordId */ - @Post('/:credentialId/accept-proposal') - public async acceptProposal( - @Param('credentialId') credentialId: string, - @Body() - proposal: AcceptCredentialProposalRequest + @Delete('/:credentialRecordId') + public async deleteCredential( + @Path('credentialRecordId') credentialRecordId: RecordId, + @Res() notFoundError: TsoaResponse<404, { reason: string }>, + @Res() internalServerError: TsoaResponse<500, { message: string }> ) { try { - const credential = await this.agent.credentials.acceptProposal(credentialId, proposal) - - return credential.toJSON() + this.setStatus(204) + await this.agent.credentials.deleteById(credentialRecordId) } catch (error) { if (error instanceof RecordNotFoundError) { - throw new NotFoundError(`Credential with credential id "${credentialId}" not found.`) + return notFoundError(404, { + reason: `credential with credential record id "${credentialRecordId}" not found.`, + }) } - throw new InternalServerError(`Something went wrong: ${error}`) + return internalServerError(500, { message: `something went wrong: ${error}` }) } } /** - * Creates a credential offer not bound to any existing connection + * Initiate a new credential exchange as holder by sending a propose credential message + * to the connection with a specified connection id. + * + * @param options + * @returns CredentialExchangeRecord */ - @Post('/offer-outofband-credential') - public async offerCredentialOutOfBand( - @Body() - offer: CredentialOfferTemp + @Example(CredentialExchangeRecordExample) + @Post('/propose-credential') + public async proposeCredential( + @Body() options: ProposeCredentialOptions, + @Res() notFoundError: TsoaResponse<404, { reason: string }>, + @Res() internalServerError: TsoaResponse<500, { message: string }> ) { - const credential = await this.agent.credentials.createOutOfBandOffer(offer) - - return { - message: `${this.agent.config.endpoints[0]}/?d_m=${JsonEncoder.toBase64URL( - credential.offerMessage.toJSON({ useLegacyDidSovPrefix: this.agent.config.useLegacyDidSovPrefix }) - )}`, - credentialRecord: credential.credentialRecord, + try { + const credential = await this.agent.credentials.proposeCredential(options) + return credential.toJSON() + } catch (error) { + if (error instanceof RecordNotFoundError) { + return notFoundError(404, { + reason: `connection with connection record id "${options.connectionId}" not found.`, + }) + } + return internalServerError(500, { message: `something went wrong: ${error}` }) } } /** - * Initiate a new credential exchange as issuer by sending a credential offer message - * to the connection with the specified connection id. + * Accept a credential proposal as issuer by sending an accept proposal message + * to the connection associated with the credential exchange record. + * + * @param credentialRecordId credential identifier + * @param options + * @returns CredentialExchangeRecord */ - @Post('/offer-credential') - public async offerCredential( - @Body() - offer: CredentialOfferRequest + @Example(CredentialExchangeRecordExample) + @Post('/:credentialRecordId/accept-proposal') + public async acceptProposal( + @Path('credentialRecordId') credentialRecordId: RecordId, + @Res() notFoundError: TsoaResponse<404, { reason: string }>, + @Res() internalServerError: TsoaResponse<500, { message: string }>, + @Body() options?: AcceptCredentialProposalOptions ) { - const { connectionId, ...offerRequest } = offer try { - const credential = await this.agent.credentials.offerCredential(connectionId, offerRequest) + const credential = await this.agent.credentials.acceptProposal({ + ...options, + credentialRecordId: credentialRecordId, + }) return credential.toJSON() } catch (error) { - if (error instanceof IndySdkError) { - if (isIndyError(error.cause, 'WalletItemNotFound')) { - throw new NotFoundError( - `credential definition with credentialDefinitionId "${offer.credentialDefinitionId}" not found.` - ) - } - } if (error instanceof RecordNotFoundError) { - throw new NotFoundError(`Connection with connection id "${connectionId}" not found.`) + return notFoundError(404, { + reason: `credential with credential record id "${credentialRecordId}" not found.`, + }) } - throw new InternalServerError(`Something went wrong: ${error}`) + return internalServerError(500, { message: `something went wrong: ${error}` }) } } /** - * Accept a credential offer as holder (by sending a credential request message) to the connection - * associated with the credential record. + * Initiate a new credential exchange as issuer by sending a offer credential message + * to the connection with the specified connection id. + * + * @param options + * @returns CredentialExchangeRecord */ - @Post('/:credentialId/accept-offer') - public async acceptOffer(@Param('credentialId') credentialId: string) { + @Example(CredentialExchangeRecordExample) + @Post('/offer-credential') + public async offerCredential( + @Body() options: OfferCredentialOptions, + @Res() notFoundError: TsoaResponse<404, { reason: string }>, + @Res() internalServerError: TsoaResponse<500, { message: string }> + ) { try { - const credential = await this.agent.credentials.acceptOffer(credentialId) - + const credential = await this.agent.credentials.offerCredential(options) return credential.toJSON() } catch (error) { if (error instanceof RecordNotFoundError) { - throw new NotFoundError(`Credential with credential id "${credentialId}" not found.`) + return notFoundError(404, { + reason: `connection with connection record id "${options.connectionId}" not found.`, + }) } - throw new InternalServerError(`Something went wrong: ${error}`) + return internalServerError(500, { message: `something went wrong: ${error}` }) } } /** - * Accept a credential request as issuer (by sending a credential message) to the connection - * associated with the credential record. + * Accept a credential offer as holder by sending an accept offer message + * to the connection associated with the credential exchange record. + * + * @param credentialRecordId credential identifier + * @param options + * @returns CredentialExchangeRecord */ - @Post('/:credentialId/accept-request') - public async acceptRequest(@Param('credentialId') credentialId: string) { + @Example(CredentialExchangeRecordExample) + @Post('/:credentialRecordId/accept-offer') + public async acceptOffer( + @Path('credentialRecordId') credentialRecordId: RecordId, + @Res() notFoundError: TsoaResponse<404, { reason: string }>, + @Res() internalServerError: TsoaResponse<500, { message: string }>, + @Body() options?: AcceptCredentialOfferOptions + ) { try { - const credential = await this.agent.credentials.acceptRequest(credentialId) - + const credential = await this.agent.credentials.acceptOffer({ + ...options, + credentialRecordId: credentialRecordId, + }) return credential.toJSON() } catch (error) { if (error instanceof RecordNotFoundError) { - throw new NotFoundError(`Credential with credential id "${credentialId}" not found.`) + return notFoundError(404, { + reason: `credential with credential record id "${credentialRecordId}" not found.`, + }) } - throw new InternalServerError(`Something went wrong: ${error}`) + return internalServerError(500, { message: `something went wrong: ${error}` }) } } /** - * Accept a credential as holder (by sending a credential acknowledgement message) to the connection - * associated with the credential record. + * Accept a credential request as issuer by sending an accept request message + * to the connection associated with the credential exchange record. + * + * @param credentialRecordId credential identifier + * @param options + * @returns CredentialExchangeRecord */ - @Post('/:credentialId/accept-credential') - public async acceptCredential(@Param('credentialId') credentialId: string) { + @Example(CredentialExchangeRecordExample) + @Post('/:credentialRecordId/accept-request') + public async acceptRequest( + @Path('credentialRecordId') credentialRecordId: RecordId, + @Res() notFoundError: TsoaResponse<404, { reason: string }>, + @Res() internalServerError: TsoaResponse<500, { message: string }>, + @Body() options?: AcceptCredentialRequestOptions + ) { try { - const credential = await this.agent.credentials.acceptCredential(credentialId) - + const credential = await this.agent.credentials.acceptRequest({ + ...options, + credentialRecordId: credentialRecordId, + }) return credential.toJSON() } catch (error) { if (error instanceof RecordNotFoundError) { - throw new NotFoundError(`Credential with credential id "${credentialId}" not found.`) + return notFoundError(404, { + reason: `credential with credential record id "${credentialRecordId}" not found.`, + }) } - throw new InternalServerError(`Something went wrong: ${error}`) + return internalServerError(500, { message: `something went wrong: ${error}` }) } } /** - * Deletes a credentialRecord in the credential repository. + * Accept a credential as holder by sending an accept credential message + * to the connection associated with the credential exchange record. + * + * @param options + * @returns CredentialExchangeRecord */ - @Delete('/:credentialId') - @OnUndefined(204) - public async deleteCredential(@Param('credentialId') credentialId: string): Promise { + @Example(CredentialExchangeRecordExample) + @Post('/:credentialRecordId/accept-credential') + public async acceptCredential( + @Path('credentialRecordId') credentialRecordId: RecordId, + @Res() notFoundError: TsoaResponse<404, { reason: string }>, + @Res() internalServerError: TsoaResponse<500, { message: string }> + ) { try { - await this.agent.credentials.deleteById(credentialId) + const credential = await this.agent.credentials.acceptCredential({ credentialRecordId: credentialRecordId }) + return credential.toJSON() } catch (error) { if (error instanceof RecordNotFoundError) { - throw new NotFoundError(`Credential with credential id "${credentialId}" not found.`) + return notFoundError(404, { + reason: `credential with credential record id "${credentialRecordId}" not found.`, + }) } - throw new InternalServerError(`Something went wrong: ${error}`) + return internalServerError(500, { message: `something went wrong: ${error}` }) } } } diff --git a/packages/rest/src/controllers/credentials/CredentialDefinitionController.ts b/packages/rest/src/controllers/credentials/CredentialDefinitionController.ts index 39fb1820..f3d40253 100644 --- a/packages/rest/src/controllers/credentials/CredentialDefinitionController.ts +++ b/packages/rest/src/controllers/credentials/CredentialDefinitionController.ts @@ -1,57 +1,76 @@ +import type { SchemaId } from '../examples' +import type { CredDef } from 'indy-sdk' + import { Agent, IndySdkError } from '@aries-framework/core' import { LedgerError } from '@aries-framework/core/build/modules/ledger/error/LedgerError' import { LedgerNotFoundError } from '@aries-framework/core/build/modules/ledger/error/LedgerNotFoundError' import { isIndyError } from '@aries-framework/core/build/utils/indyError' -import { - BadRequestError, - Body, - Get, - InternalServerError, - JsonController, - NotFoundError, - Param, - Post, -} from 'routing-controllers' +import { Body, Controller, Example, Get, Path, Post, Res, Route, Tags, TsoaResponse } from 'tsoa' import { injectable } from 'tsyringe' -import { CredentialDefinitionRequest } from '../../schemas/CredentialDefinitionRequest' +import { CredentialDefinitionExample, CredentialDefinitionId } from '../examples' -@JsonController('/credential-definitions') +@Tags('Credential Definitions') +@Route('/credential-definitions') @injectable() -export class CredentialDefinitionController { +export class CredentialDefinitionController extends Controller { private agent: Agent public constructor(agent: Agent) { + super() this.agent = agent } /** - * Retrieve credentialDefinition by credentialDefinitionId + * Retrieve credential definition by credential definition id + * + * @param credentialDefinitionId + * @returns CredDef */ + @Example(CredentialDefinitionExample) @Get('/:credentialDefinitionId') - public async getCredentialDefinitionById(@Param('credentialDefinitionId') credentialDefinitionId: string) { + public async getCredentialDefinitionById( + @Path('credentialDefinitionId') credentialDefinitionId: CredentialDefinitionId, + @Res() badRequestError: TsoaResponse<400, { reason: string }>, + @Res() notFoundError: TsoaResponse<404, { reason: string }>, + @Res() internalServerError: TsoaResponse<500, { message: string }> + ) { try { return await this.agent.ledger.getCredentialDefinition(credentialDefinitionId) } catch (error) { - if (error instanceof LedgerNotFoundError) { - throw new NotFoundError( - `credential definition with credentialDefinitionId "${credentialDefinitionId}" not found.` - ) + if (error instanceof IndySdkError && error.message === 'IndyError(LedgerNotFound): LedgerNotFound') { + return notFoundError(404, { + reason: `credential definition with credentialDefinitionId "${credentialDefinitionId}" not found.`, + }) } else if (error instanceof LedgerError && error.cause instanceof IndySdkError) { if (isIndyError(error.cause.cause, 'CommonInvalidStructure')) { - throw new BadRequestError(`credentialDefinitionId "${credentialDefinitionId}" has invalid structure.`) + return badRequestError(400, { + reason: `credentialDefinitionId "${credentialDefinitionId}" has invalid structure.`, + }) } } - throw new InternalServerError(`something went wrong: ${error}`) + return internalServerError(500, { message: `something went wrong: ${error}` }) } } /** - * Creates a new CredentialDefinition. - * Returns CredentialDefinitionId and CredentialDefinition + * Creates a new credential definition. + * + * @param credentialDefinitionRequest + * @returns CredDef */ + @Example(CredentialDefinitionExample) @Post('/') - public async createCredentialDefinition(@Body() credentialDefinitionRequest: CredentialDefinitionRequest) { + public async createCredentialDefinition( + @Body() + credentialDefinitionRequest: { + schemaId: SchemaId + supportRevocation: boolean + tag: string + }, + @Res() notFoundError: TsoaResponse<404, { reason: string }>, + @Res() internalServerError: TsoaResponse<500, { message: string }> + ) { try { const schema = await this.agent.ledger.getSchema(credentialDefinitionRequest.schemaId) @@ -62,10 +81,12 @@ export class CredentialDefinitionController { }) } catch (error) { if (error instanceof LedgerNotFoundError) { - throw new NotFoundError(`schema with schemaId "${credentialDefinitionRequest.schemaId}" not found.`) + return notFoundError(404, { + reason: `schema with schemaId "${credentialDefinitionRequest.schemaId}" not found.`, + }) } - throw new InternalServerError(`something went wrong: ${error}`) + return internalServerError(500, { message: `something went wrong: ${error}` }) } } } diff --git a/packages/rest/src/controllers/credentials/SchemaController.ts b/packages/rest/src/controllers/credentials/SchemaController.ts index 6ae3a8e0..d260e43b 100644 --- a/packages/rest/src/controllers/credentials/SchemaController.ts +++ b/packages/rest/src/controllers/credentials/SchemaController.ts @@ -1,23 +1,16 @@ +import type { Version } from '../examples' +import type { Schema } from 'indy-sdk' + import { Agent, AriesFrameworkError, IndySdkError } from '@aries-framework/core' import { LedgerError } from '@aries-framework/core/build/modules/ledger/error/LedgerError' -import { LedgerNotFoundError } from '@aries-framework/core/build/modules/ledger/error/LedgerNotFoundError' import { isIndyError } from '@aries-framework/core/build/utils/indyError' -import { - InternalServerError, - ForbiddenError, - NotFoundError, - JsonController, - BadRequestError, - Get, - Post, - Param, - Body, -} from 'routing-controllers' +import { Body, Example, Get, Path, Post, Res, Route, Tags, TsoaResponse } from 'tsoa' import { injectable } from 'tsyringe' -import { SchemaTemplate } from '../../schemas/SchemaRequest' +import { SchemaId, SchemaExample } from '../examples' -@JsonController('/schemas') +@Tags('Schemas') +@Route('/schemas') @injectable() export class SchemaController { private agent: Agent @@ -27,34 +20,62 @@ export class SchemaController { } /** - * Retrieve schema by schemaId + * Retrieve schema by schema id + * + * @param schemaId + * @returns Schema */ + @Example(SchemaExample) @Get('/:schemaId') - public async getSchemaById(@Param('schemaId') schemaId: string) { + public async getSchemaById( + @Path('schemaId') schemaId: SchemaId, + @Res() notFoundError: TsoaResponse<404, { reason: string }>, + @Res() forbiddenError: TsoaResponse<403, { reason: string }>, + @Res() badRequestError: TsoaResponse<400, { reason: string }>, + @Res() internalServerError: TsoaResponse<500, { message: string }> + ) { try { return await this.agent.ledger.getSchema(schemaId) } catch (error) { - if (error instanceof LedgerNotFoundError) { - throw new NotFoundError(`schema definition with schemaId "${schemaId}" not found.`) + if (error instanceof IndySdkError && error.message === 'IndyError(LedgerNotFound): LedgerNotFound') { + return notFoundError(404, { + reason: `schema definition with schemaId "${schemaId}" not found.`, + }) } else if (error instanceof LedgerError && error.cause instanceof IndySdkError) { if (isIndyError(error.cause.cause, 'LedgerInvalidTransaction')) { - throw new ForbiddenError(`schema definition with schemaId "${schemaId}" can not be returned.`) + return forbiddenError(403, { + reason: `schema definition with schemaId "${schemaId}" can not be returned.`, + }) } if (isIndyError(error.cause.cause, 'CommonInvalidStructure')) { - throw new BadRequestError(`schemaId "${schemaId}" has invalid structure.`) + return badRequestError(400, { + reason: `schemaId "${schemaId}" has invalid structure.`, + }) } } - throw new InternalServerError(`something went wrong: ${error}`) + return internalServerError(500, { message: `something went wrong: ${error}` }) } } /** * Creates a new schema and registers schema on ledger - * Returns created schema + * + * @param schema + * @returns schema */ + @Example(SchemaExample) @Post('/') - public async createSchema(@Body() schema: SchemaTemplate) { + public async createSchema( + @Body() + schema: { + name: string + version: Version + attributes: string[] + }, + @Res() forbiddenError: TsoaResponse<400, { reason: string }>, + @Res() internalServerError: TsoaResponse<500, { message: string }> + ) { try { return await this.agent.ledger.registerSchema({ name: schema.name, @@ -64,10 +85,12 @@ export class SchemaController { } catch (error) { if (error instanceof AriesFrameworkError) { if (error.message.includes('UnauthorizedClientRequest')) { - throw new ForbiddenError(`this action is not allowed.`) + return forbiddenError(400, { + reason: 'this action is not allowed.', + }) } } - throw new InternalServerError(`something went wrong: ${error}`) + return internalServerError(500, { message: `something went wrong: ${error}` }) } } } diff --git a/packages/rest/src/controllers/examples.ts b/packages/rest/src/controllers/examples.ts new file mode 100644 index 00000000..d8a1df28 --- /dev/null +++ b/packages/rest/src/controllers/examples.ts @@ -0,0 +1,191 @@ +import type { + AutoAcceptProof, + BasicMessageRole, + CredentialState, + DidExchangeRole, + DidExchangeState, + OutOfBandInvitationOptions, + OutOfBandRecordProps, + ProofRecordProps, + ProofState, + OutOfBandRole, + OutOfBandState, +} from '@aries-framework/core' + +/** + * @example "821f9b26-ad04-4f56-89b6-e2ef9c72b36e" + */ +export type RecordId = string + +/** + * @example "1.0.0" + */ +export type Version = string + +/** + * @example "WgWxqztrNooG92RXvxSTWv:3:CL:20:tag" + */ +export type CredentialDefinitionId = string + +/** + * @example "WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0" + */ +export type SchemaId = string + +export const BasicMessageRecordExample = { + _tags: { + role: 'sender', + connectionId: '2aecf74c-3073-4f98-9acb-92415d096834', + }, + metadata: {}, + id: '74bcf865-1fdc-45b4-b517-9def02dfd25f', + createdAt: new Date('2022-08-18T08:38:40.216Z'), + content: 'string', + sentTime: '2022-08-18T08:38:40.216Z', + connectionId: '2aecf74c-3073-4f98-9acb-92415d096834', + role: 'sender' as BasicMessageRole, +} + +export const ConnectionRecordExample = { + _tags: { + invitationDid: + 'did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119', + did: 'did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv', + state: 'invitation-sent' as DidExchangeState, + invitationKey: '9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz', + outOfBandId: 'edbc89fe-785f-4774-a288-46012486881d', + verkey: '9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz', + role: 'responder' as DidExchangeRole, + }, + metadata: {}, + id: '821f9b26-ad04-4f56-89b6-e2ef9c72b36e', + createdAt: new Date('2022-01-01T00:00:00.000Z'), + did: 'did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv', + state: 'invitation-sent' as DidExchangeState, + role: 'responder' as DidExchangeRole, + invitationDid: + 'did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119', + outOfBandId: 'edbc89fe-785f-4774-a288-46012486881d', +} + +type OutOfBandRecordProperties = Omit +export type OutOfBandInvitationProps = Omit< + OutOfBandInvitationOptions, + 'handshakeProtocols' | 'services' | 'appendedAttachments' +> + +export interface OutOfBandRecordWithInvitationProps extends OutOfBandRecordProperties { + outOfBandInvitation: OutOfBandInvitationProps +} + +export const outOfBandInvitationExample = { + '@type': 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/invitation', + '@id': 'd6472943-e5d0-4d95-8b48-790ed5a41931', + label: 'Aries Test Agent', + accept: ['didcomm/aip1', 'didcomm/aip2;env=rfc19'], + handshake_protocols: ['https://didcomm.org/didexchange/1.0', 'https://didcomm.org/connections/1.0'], + services: [ + { + id: '#inline-0', + serviceEndpoint: 'https://6b77-89-20-162-146.ngrok.io', + type: 'did-communication', + recipientKeys: ['did:key:z6MkmTBHTWrvLPN8pBmUj7Ye5ww9GiacXCYMNVvpScSpf1DM'], + routingKeys: [], + }, + ], +} + +export const outOfBandRecordExample = { + _tags: { + invitationId: '1cbd22e4-1906-41e9-8807-83d84437f978', + state: 'await-response', + role: 'sender', + recipientKeyFingerprints: ['z6MktUCPZjfRJXD4GMcYuXiqX2qZ8vBw6UAYpDFiHEUfwuLj'], + }, + outOfBandInvitation: outOfBandInvitationExample, + metadata: {}, + id: '42a95528-0e30-4f86-a462-0efb02178b53', + createdAt: new Date('2022-01-01T00:00:00.000Z'), + role: 'sender' as OutOfBandRole, + state: 'await-response' as OutOfBandState, + reusable: false, +} + +export const CredentialExchangeRecordExample = { + _tags: { + state: 'offer-sent', + threadId: '82701488-b43c-4d7b-9244-4bb204a7ae26', + connectionId: 'ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b', + }, + metadata: { + '_internal/indyCredential': { + credentialDefinitionId: 'q7ATwTYbQDgiigVijUAej:3:CL:318187:latest', + schemaId: 'q7ATwTYbQDgiigVijUAej:2:Employee Badge:1.0', + }, + }, + credentials: [], + id: '821f9b26-ad04-4f56-89b6-e2ef9c72b36e', + createdAt: new Date('2022-01-01T00:00:00.000Z'), + state: 'offer-sent' as CredentialState, + connectionId: 'ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b', + threadId: '82701488-b43c-4d7b-9244-4bb204a7ae26', + credentialAttributes: [], + protocolVersion: 'v1', +} + +export const ProofRecordExample = { + _tags: { + state: 'proposal-sent' as ProofState, + threadId: '0019d466-5eea-4269-8c40-031b4896c5b7', + connectionId: '2aecf74c-3073-4f98-9acb-92415d096834', + } as ProofRecordProps, + metadata: {}, + id: '821f9b26-ad04-4f56-89b6-e2ef9c72b36e', + createdAt: new Date('2022-01-01T00:00:00.000Z'), + state: 'proposal-sent' as ProofState, + connectionId: '2aecf74c-3073-4f98-9acb-92415d096834', + threadId: '0019d466-5eea-4269-8c40-031b4896c5b7', + autoAcceptProof: 'always' as AutoAcceptProof, +} + +export const SchemaExample = { + ver: '1.0', + id: 'WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0', + name: 'schema', + version: '1.0', + attrNames: ['string'], + seqNo: 351936, +} + +export const CredentialDefinitionExample = { + ver: '1.0', + id: 'WgWxqztrNooG92RXvxSTWv:3:CL:20:tag', + schemaId: '351936', + type: 'CL', + tag: 'definition', + value: { + primary: { + n: 'string', + s: 'string', + r: { + master_secret: 'string', + string: 'string', + }, + rctxt: 'string', + z: 'string', + }, + revocation: { + g: '1 string', + g_dash: 'string', + h: 'string', + h0: 'string', + h1: 'string', + h2: 'string', + htilde: 'string', + h_cap: 'string', + u: 'string', + pk: 'string', + y: 'string', + }, + }, +} diff --git a/packages/rest/src/controllers/outofband/OutOfBandController.ts b/packages/rest/src/controllers/outofband/OutOfBandController.ts new file mode 100644 index 00000000..254b0d24 --- /dev/null +++ b/packages/rest/src/controllers/outofband/OutOfBandController.ts @@ -0,0 +1,289 @@ +import type { OutOfBandInvitationProps, OutOfBandRecordWithInvitationProps } from '../examples' +import type { AgentMessageType } from '../types' +import type { + ConnectionRecordProps, + CreateOutOfBandInvitationConfig, + CreateLegacyInvitationConfig, +} from '@aries-framework/core' + +import { AgentMessage, JsonTransformer, OutOfBandInvitation, Agent, RecordNotFoundError } from '@aries-framework/core' +import { Body, Controller, Delete, Example, Get, Path, Post, Query, Res, Route, Tags, TsoaResponse } from 'tsoa' +import { injectable } from 'tsyringe' + +import { ConnectionRecordExample, outOfBandInvitationExample, outOfBandRecordExample, RecordId } from '../examples' +import { AcceptInvitationConfig, ReceiveInvitationByUrlProps, ReceiveInvitationProps } from '../types' + +@Tags('Out Of Band') +@Route('/oob') +@injectable() +export class OutOfBandController extends Controller { + private agent: Agent + + public constructor(agent: Agent) { + super() + this.agent = agent + } + + /** + * Retrieve all out of band records + * @param invitationId invitation identifier + * @returns OutOfBandRecord[] + */ + @Example([outOfBandRecordExample]) + @Get() + public async getAllOutOfBandRecords(@Query('invitationId') invitationId?: RecordId) { + let outOfBandRecords = await this.agent.oob.getAll() + + if (invitationId) outOfBandRecords = outOfBandRecords.filter((o) => o.outOfBandInvitation.id === invitationId) + + return outOfBandRecords.map((c) => c.toJSON()) + } + + /** + * Retrieve an out of band record by id + * @param recordId record identifier + * @returns OutOfBandRecord + */ + @Example(outOfBandRecordExample) + @Get('/:outOfBandId') + public async getOutOfBandRecordById( + @Path('outOfBandId') outOfBandId: RecordId, + @Res() notFoundError: TsoaResponse<404, { reason: string }> + ) { + const outOfBandRecord = await this.agent.oob.findById(outOfBandId) + + if (!outOfBandRecord) + return notFoundError(404, { reason: `Out of band record with id "${outOfBandId}" not found.` }) + + return outOfBandRecord.toJSON() + } + + /** + * Creates an outbound out-of-band record containing out-of-band invitation message defined in + * Aries RFC 0434: Out-of-Band Protocol 1.1. + * @param config configuration of how out-of-band invitation should be created + * @returns Out of band record + */ + @Example<{ + invitationUrl: string + invitation: OutOfBandInvitationProps + outOfBandRecord: OutOfBandRecordWithInvitationProps + }>({ + invitationUrl: 'string', + invitation: outOfBandInvitationExample, + outOfBandRecord: outOfBandRecordExample, + }) + @Post('/create-invitation') + public async createInvitation( + @Res() internalServerError: TsoaResponse<500, { message: string }>, + @Body() config?: Omit // props removed because of issues with serialization + ) { + try { + const outOfBandRecord = await this.agent.oob.createInvitation(config) + return { + invitationUrl: outOfBandRecord.outOfBandInvitation.toUrl({ + domain: this.agent.config.endpoints[0], + }), + invitation: outOfBandRecord.outOfBandInvitation.toJSON({ + useLegacyDidSovPrefix: this.agent.config.useLegacyDidSovPrefix, + }), + outOfBandRecord: outOfBandRecord.toJSON(), + } + } catch (error) { + return internalServerError(500, { message: `something went wrong: ${error}` }) + } + } + + /** + * Creates an outbound out-of-band record in the same way how `createInvitation` method does it, + * but it also converts out-of-band invitation message to an "legacy" invitation message defined + * in RFC 0160: Connection Protocol and returns it together with out-of-band record. + * + * @param config configuration of how a invitation should be created + * @returns out-of-band record and invitation + */ + @Example<{ invitation: OutOfBandInvitationProps; outOfBandRecord: OutOfBandRecordWithInvitationProps }>({ + invitation: outOfBandInvitationExample, + outOfBandRecord: outOfBandRecordExample, + }) + @Post('/create-legacy-invitation') + public async createLegacyInvitation( + @Res() internalServerError: TsoaResponse<500, { message: string }>, + @Body() config?: Omit // routing prop removed because of issues with public key serialization + ) { + try { + const { outOfBandRecord, invitation } = await this.agent.oob.createLegacyInvitation(config) + + return { + invitationUrl: invitation.toUrl({ + domain: this.agent.config.endpoints[0], + useLegacyDidSovPrefix: this.agent.config.useLegacyDidSovPrefix, + }), + invitation: invitation.toJSON({ + useLegacyDidSovPrefix: this.agent.config.useLegacyDidSovPrefix, + }), + outOfBandRecord: outOfBandRecord.toJSON(), + } + } catch (error) { + return internalServerError(500, { message: `something went wrong: ${error}` }) + } + } + + /** + * Creates a new connectionless legacy invitation. + * + * @param config configuration of how a connection invitation should be created + * @returns a message and a invitationUrl + */ + @Example<{ message: AgentMessageType; invitationUrl: string }>({ + message: { + '@id': 'eac4ff4e-b4fb-4c1d-aef3-b29c89d1cc00', + '@type': 'https://didcomm.org/connections/1.0/invitation', + }, + invitationUrl: 'http://example.com/invitation_url', + }) + @Post('/create-legacy-connectionless-invitation') + public async createLegacyConnectionlessInvitation( + @Body() + config: { + recordId: string + message: AgentMessageType + domain: string + }, + @Res() notFoundError: TsoaResponse<404, { reason: string }>, + @Res() internalServerError: TsoaResponse<500, { message: string }> + ) { + try { + const agentMessage = JsonTransformer.fromJSON(config.message, AgentMessage) + + return await this.agent.oob.createLegacyConnectionlessInvitation({ + ...config, + message: agentMessage, + }) + } catch (error) { + if (error instanceof RecordNotFoundError) { + return notFoundError(404, { reason: `connection with connection id "${config.recordId}" not found.` }) + } + return internalServerError(500, { message: `something went wrong: ${error}` }) + } + } + + /** + * Creates inbound out-of-band record and assigns out-of-band invitation message to it if the + * message is valid. + * + * @param invitation either OutOfBandInvitation or ConnectionInvitationMessage + * @param config config for handling of invitation + * @returns out-of-band record and connection record if one has been created. + */ + @Example<{ outOfBandRecord: OutOfBandRecordWithInvitationProps; connectionRecord: ConnectionRecordProps }>({ + outOfBandRecord: outOfBandRecordExample, + connectionRecord: ConnectionRecordExample, + }) + @Post('/receive-invitation') + public async receiveInvitation( + @Body() invitationRequest: ReceiveInvitationProps, + @Res() internalServerError: TsoaResponse<500, { message: string }> + ) { + const { invitation, ...config } = invitationRequest + + try { + const invite = new OutOfBandInvitation({ ...invitation, handshakeProtocols: invitation.handshake_protocols }) + const { outOfBandRecord, connectionRecord } = await this.agent.oob.receiveInvitation(invite, config) + + return { + outOfBandRecord: outOfBandRecord.toJSON(), + connectionRecord: connectionRecord?.toJSON(), + } + } catch (error) { + return internalServerError(500, { message: `something went wrong: ${error}` }) + } + } + + /** + * Creates inbound out-of-band record and assigns out-of-band invitation message to it if the + * message is valid. + * + * @param invitationUrl invitation url + * @param config config for handling of invitation + * @returns out-of-band record and connection record if one has been created. + */ + @Example<{ outOfBandRecord: OutOfBandRecordWithInvitationProps; connectionRecord: ConnectionRecordProps }>({ + outOfBandRecord: outOfBandRecordExample, + connectionRecord: ConnectionRecordExample, + }) + @Post('/receive-invitation-url') + public async receiveInvitationFromUrl( + @Body() invitationRequest: ReceiveInvitationByUrlProps, + @Res() internalServerError: TsoaResponse<500, { message: string }> + ) { + const { invitationUrl, ...config } = invitationRequest + + try { + const { outOfBandRecord, connectionRecord } = await this.agent.oob.receiveInvitationFromUrl(invitationUrl, config) + return { + outOfBandRecord: outOfBandRecord.toJSON(), + connectionRecord: connectionRecord?.toJSON(), + } + } catch (error) { + return internalServerError(500, { message: `something went wrong: ${error}` }) + } + } + + /** + * Accept a connection invitation as invitee (by sending a connection request message) for the connection with the specified connection id. + * This is not needed when auto accepting of connections is enabled. + */ + @Example<{ outOfBandRecord: OutOfBandRecordWithInvitationProps; connectionRecord: ConnectionRecordProps }>({ + outOfBandRecord: outOfBandRecordExample, + connectionRecord: ConnectionRecordExample, + }) + @Post('/:outOfBandId/accept-invitation') + public async acceptInvitation( + @Path('outOfBandId') outOfBandId: RecordId, + @Body() acceptInvitationConfig: AcceptInvitationConfig, + @Res() notFoundError: TsoaResponse<404, { reason: string }>, + @Res() internalServerError: TsoaResponse<500, { message: string }> + ) { + try { + const { outOfBandRecord, connectionRecord } = await this.agent.oob.acceptInvitation( + outOfBandId, + acceptInvitationConfig + ) + + return { + outOfBandRecord: outOfBandRecord.toJSON(), + connectionRecord: connectionRecord?.toJSON(), + } + } catch (error) { + if (error instanceof RecordNotFoundError) { + return notFoundError(404, { + reason: `mediator with mediatorId ${acceptInvitationConfig?.mediatorId} not found`, + }) + } + return internalServerError(500, { message: `something went wrong: ${error}` }) + } + } + + /** + * Deletes an out of band record from the repository. + * + * @param outOfBandId Record identifier + */ + @Delete('/:outOfBandId') + public async deleteOutOfBandRecord( + @Path('outOfBandId') outOfBandId: RecordId, + @Res() notFoundError: TsoaResponse<404, { reason: string }>, + @Res() internalServerError: TsoaResponse<500, { message: string }> + ) { + try { + this.setStatus(204) + await this.agent.oob.deleteById(outOfBandId) + } catch (error) { + if (error instanceof RecordNotFoundError) { + return notFoundError(404, { reason: `Out of band record with id "${outOfBandId}" not found.` }) + } + return internalServerError(500, { message: `something went wrong: ${error}` }) + } + } +} diff --git a/packages/rest/src/controllers/proofs/ProofController.ts b/packages/rest/src/controllers/proofs/ProofController.ts index 44e4d32a..63d1b25f 100644 --- a/packages/rest/src/controllers/proofs/ProofController.ts +++ b/packages/rest/src/controllers/proofs/ProofController.ts @@ -1,97 +1,142 @@ -import { Agent, PresentationPreview, RecordNotFoundError } from '@aries-framework/core' +import type { ProofRecordProps } from '@aries-framework/core' + +import { Agent, JsonTransformer, PresentationPreview, RecordNotFoundError } from '@aries-framework/core' import { JsonEncoder } from '@aries-framework/core/build/utils/JsonEncoder' -import { - Body, - Delete, - Get, - InternalServerError, - JsonController, - NotFoundError, - OnUndefined, - Param, - Post, - QueryParam, -} from 'routing-controllers' +import { Body, Controller, Delete, Example, Get, Path, Post, Query, Res, Route, Tags, TsoaResponse } from 'tsoa' import { injectable } from 'tsyringe' -import { AcceptProofProposalRequest } from '../../schemas/AcceptProofProposalRequest' -import { PresentationProofRequest } from '../../schemas/PresentationProofRequest' -import { ProofPresentationRequest } from '../../schemas/ProofPresentationRequest' -import { ProofProposalRequest } from '../../schemas/ProofProposalRequest' -import { ProofRequestTemplate } from '../../schemas/ProofRequestTemplate' +import { ProofRecordExample, RecordId } from '../examples' +import { RequestProofOptions, RequestProofProposalOptions } from '../types' -@JsonController('/proofs') +@Tags('Proofs') +@Route('/proofs') @injectable() -export class ProofController { +export class ProofController extends Controller { private agent: Agent public constructor(agent: Agent) { + super() this.agent = agent } /** - * Retrieve proof record by proofRecordId + * Retrieve all proof records + * + * @param threadId + * @returns ProofRecord[] + */ + @Example([ProofRecordExample]) + @Get('/') + public async getAllProofs(@Query('threadId') threadId?: string) { + let proofs = await this.agent.proofs.getAll() + + if (threadId) proofs = proofs.filter((p) => p.threadId === threadId) + + return proofs.map((proof) => proof.toJSON()) + } + + /** + * Retrieve proof record by proof record id + * + * @param proofRecordId + * @returns ProofRecord */ @Get('/:proofRecordId') - public async getProofById(@Param('proofRecordId') proofRecordId: string) { + @Example(ProofRecordExample) + public async getProofById( + @Path('proofRecordId') proofRecordId: RecordId, + @Res() notFoundError: TsoaResponse<404, { reason: string }>, + @Res() internalServerError: TsoaResponse<500, { message: string }> + ) { try { const proof = await this.agent.proofs.getById(proofRecordId) return proof.toJSON() } catch (error) { if (error instanceof RecordNotFoundError) { - throw new NotFoundError(`proof with proofRecordId "${proofRecordId}" not found.`) + return notFoundError(404, { + reason: `proof with proofRecordId "${proofRecordId}" not found.`, + }) } - throw new InternalServerError(`something went wrong: ${error}`) + return internalServerError(500, { message: `something went wrong: ${error}` }) } } /** - * Retrieve all ProofRecords + * Deletes a proof record in the proof repository. + * + * @param proofRecordId */ - @Get('/') - public async getAllProofs(@QueryParam('threadId') threadId?: string) { - const proofs = await this.agent.proofs.getAll() - - if (threadId) { - return proofs.flatMap((proof) => (proof.threadId === threadId ? proof.toJSON() : [])) + @Delete('/:proofRecordId') + public async deleteProof( + @Path('proofRecordId') proofRecordId: RecordId, + @Res() notFoundError: TsoaResponse<404, { reason: string }>, + @Res() internalServerError: TsoaResponse<500, { message: string }> + ) { + try { + this.setStatus(204) + await this.agent.proofs.deleteById(proofRecordId) + } catch (error) { + if (error instanceof RecordNotFoundError) { + return notFoundError(404, { + reason: `proof with proofRecordId "${proofRecordId}" not found.`, + }) + } + return internalServerError(500, { message: `something went wrong: ${error}` }) } - return proofs.map((proof) => proof.toJSON()) } /** - * Initiate a new presentation exchange as prover by sending a presentation proposal message + * Initiate a new presentation exchange as prover by sending a presentation proposal request * to the connection with the specified connection id. + * + * @param proposal + * @returns ProofRecord */ @Post('/propose-proof') - public async proposeProof(@Body() proposal: ProofProposalRequest) { + @Example(ProofRecordExample) + public async proposeProof( + @Body() proposal: RequestProofProposalOptions, + @Res() notFoundError: TsoaResponse<404, { reason: string }>, + @Res() internalServerError: TsoaResponse<500, { message: string }> + ) { const { attributes, predicates, connectionId, ...proposalOptions } = proposal try { - const presentationPreview = new PresentationPreview({ - attributes, - predicates, - }) + const presentationPreview = JsonTransformer.fromJSON({ attributes, predicates }, PresentationPreview) const proof = await this.agent.proofs.proposeProof(connectionId, presentationPreview, proposalOptions) return proof.toJSON() } catch (error) { if (error instanceof RecordNotFoundError) { - throw new NotFoundError(`connection with connectionId "${connectionId}" not found.`) + return notFoundError(404, { + reason: `connection with connectionId "${connectionId}" not found.`, + }) } - throw new InternalServerError(`something went wrong: ${error}`) + return internalServerError(500, { message: `something went wrong: ${error}` }) } } /** - * Accept a presentation proposal as verifier (by sending a presentation request message) to the connection - * associated with the proof record. + * Accept a presentation proposal as verifier by sending an accept proposal message + * to the connection associated with the proof record. + * + * @param proofRecordId + * @param proposal + * @returns ProofRecord */ @Post('/:proofRecordId/accept-proposal') + @Example(ProofRecordExample) public async acceptProposal( - @Param('proofRecordId') proofRecordId: string, - @Body() proposal: AcceptProofProposalRequest + @Path('proofRecordId') proofRecordId: string, + @Body() + proposal: { + request: { name?: string; version?: string; nonce?: string } + comment?: string + }, + @Res() notFoundError: TsoaResponse<404, { reason: string }>, + @Res() internalServerError: TsoaResponse<500, { message: string }> ) { try { const proof = await this.agent.proofs.acceptProposal(proofRecordId, proposal) @@ -99,26 +144,31 @@ export class ProofController { return proof.toJSON() } catch (error) { if (error instanceof RecordNotFoundError) { - throw new NotFoundError(`proof with proofRecordId "${proofRecordId}" not found.`) + return notFoundError(404, { + reason: `proof with proofRecordId "${proofRecordId}" not found.`, + }) } - throw new InternalServerError(`something went wrong: ${error}`) + return internalServerError(500, { message: `something went wrong: ${error}` }) } } /** * Creates a presentation request not bound to any proposal or existing connection + * + * @param request + * @returns ProofRequestMessageResponse */ @Post('/request-outofband-proof') - public async requestProofOutOfBand( - @Body() - request: ProofRequestTemplate - ) { - const { proofRequest, ...requestOptions } = request - - const proof = await this.agent.proofs.createOutOfBandRequest(proofRequest, requestOptions) + @Example<{ proofUrl: string; proofRecord: ProofRecordProps }>({ + proofUrl: 'https://example.com/proof-url', + proofRecord: ProofRecordExample, + }) + public async requestProofOutOfBand(@Body() request: Omit) { + const { proofRequestOptions, ...requestOptions } = request + const proof = await this.agent.proofs.createOutOfBandRequest(proofRequestOptions, requestOptions) return { - message: `${this.agent.config.endpoints[0]}/?d_m=${JsonEncoder.toBase64URL( + proofUrl: `${this.agent.config.endpoints[0]}/?d_m=${JsonEncoder.toBase64URL( proof.requestMessage.toJSON({ useLegacyDidSovPrefix: this.agent.config.useLegacyDidSovPrefix }) )}`, proofRecord: proof.proofRecord, @@ -127,31 +177,53 @@ export class ProofController { /** * Creates a presentation request bound to existing connection + * + * @param request + * @returns ProofRecord */ @Post('/request-proof') + @Example(ProofRecordExample) public async requestProof( - @Body() - request: ProofPresentationRequest + @Body() request: RequestProofOptions, + @Res() notFoundError: TsoaResponse<404, { reason: string }>, + @Res() internalServerError: TsoaResponse<500, { message: string }> ) { - const { connectionId, proofRequest, ...requestOptions } = request + const { connectionId, proofRequestOptions, ...config } = request + try { - const proof = await this.agent.proofs.requestProof(connectionId, proofRequest, requestOptions) + const proof = await this.agent.proofs.requestProof(connectionId, proofRequestOptions, config) return proof.toJSON() } catch (error) { if (error instanceof RecordNotFoundError) { - throw new NotFoundError(`connection with connectionId "${connectionId}" not found.`) + return notFoundError(404, { + reason: `connection with connectionId "${connectionId}" not found.`, + }) } - throw new InternalServerError(`something went wrong: ${error}`) + return internalServerError(500, { message: `something went wrong: ${error}` }) } } /** - * Accept a presentation request as prover (by sending a presentation message) to the connection - * associated with the proof record. + * Accept a presentation request as prover by sending an accept request message + * to the connection associated with the proof record. + * + * @param proofRecordId + * @param request + * @returns ProofRecord */ @Post('/:proofRecordId/accept-request') - public async acceptRequest(@Param('proofRecordId') proofRecordId: string, @Body() request: PresentationProofRequest) { + @Example(ProofRecordExample) + public async acceptRequest( + @Path('proofRecordId') proofRecordId: string, + @Body() + request: { + filterByPresentationPreview: boolean + comment: string + }, + @Res() notFoundError: TsoaResponse<404, { reason: string }>, + @Res() internalServerError: TsoaResponse<500, { message: string }> + ) { try { const { filterByPresentationPreview, comment } = request @@ -168,43 +240,39 @@ export class ProofController { return proof.toJSON() } catch (error) { if (error instanceof RecordNotFoundError) { - throw new NotFoundError(`Proof with proofRecordId "${proofRecordId}" not found.`) + return notFoundError(404, { + reason: `proof with proofRecordId "${proofRecordId}" not found.`, + }) } - throw new InternalServerError(`Something went wrong: ${error}`) + return internalServerError(500, { message: `something went wrong: ${error}` }) } } /** - * Accept a presentation as prover (by sending a presentation acknowledgement message) to the connection - * associated with the proof record. + * Accept a presentation as prover by sending an accept presentation message + * to the connection associated with the proof record. + * + * @param proofRecordId + * @returns ProofRecord */ @Post('/:proofRecordId/accept-presentation') - public async acceptPresentation(@Param('proofRecordId') proofRecordId: string) { + @Example(ProofRecordExample) + public async acceptPresentation( + @Path('proofRecordId') proofRecordId: string, + @Res() notFoundError: TsoaResponse<404, { reason: string }>, + @Res() internalServerError: TsoaResponse<500, { message: string }> + ) { try { const proof = await this.agent.proofs.acceptPresentation(proofRecordId) return proof.toJSON() } catch (error) { if (error instanceof RecordNotFoundError) { - throw new NotFoundError(`Proof with proofRecordId "${proofRecordId}" not found.`) - } - throw new InternalServerError(`Something went wrong: ${error}`) - } - } - - /** - * Deletes a proofRecord in the proof repository. - */ - @Delete('/:proofRecordId') - @OnUndefined(204) - public async deleteProof(@Param('proofRecordId') proofRecordId: string) { - try { - await this.agent.proofs.deleteById(proofRecordId) - } catch (error) { - if (error instanceof RecordNotFoundError) { - throw new NotFoundError(`Proof with proofRecordId "${proofRecordId}" not found.`) + return notFoundError(404, { + reason: `proof with proofRecordId "${proofRecordId}" not found.`, + }) } - throw new InternalServerError(`Something went wrong: ${error}`) + return internalServerError(500, { message: `something went wrong: ${error}` }) } } } diff --git a/packages/rest/src/controllers/types.ts b/packages/rest/src/controllers/types.ts new file mode 100644 index 00000000..04ae55f4 --- /dev/null +++ b/packages/rest/src/controllers/types.ts @@ -0,0 +1,170 @@ +import type { + AutoAcceptCredential, + AutoAcceptProof, + CredentialFormatPayload, + HandshakeProtocol, + IndyCredentialFormat, + PresentationPreviewAttributeOptions, + PresentationPreviewPredicateOptions, + ProofAttributeInfo, + ProofPredicateInfo, + ProofRecord, + ProofRequestConfig, + ProtocolVersionType, + ReceiveOutOfBandInvitationConfig, + V1CredentialService, + V2CredentialService, + OutOfBandDidCommService, +} from '@aries-framework/core' + +export interface AgentInfo { + label: string + endpoints: string[] + isInitialized: boolean + publicDid?: { + did: string + verkey: string + } +} + +export interface AgentMessageType { + '@id': string + '@type': string + [key: string]: unknown +} + +export interface ProofRequestMessageResponse { + message: string + proofRecord: ProofRecord +} + +type CredentialFormats = [IndyCredentialFormat] +type CredentialServices = [V1CredentialService, V2CredentialService] + +export interface ProposeCredentialOptions { + protocolVersion: ProtocolVersionType + credentialFormats: { + indy: { + schemaIssuerDid: string + schemaId: string + schemaName: string + schemaVersion: string + credentialDefinitionId: string + issuerDid: string + attributes: { + name: string + value: string + }[] + } + } + autoAcceptCredential?: AutoAcceptCredential + comment?: string + connectionId: string +} + +export interface AcceptCredentialProposalOptions { + credentialFormats?: { + indy: { + schemaIssuerDid: string + schemaId: string + schemaName: string + schemaVersion: string + credentialDefinitionId: string + issuerDid: string + attributes: { + name: string + value: string + }[] + } + } + autoAcceptCredential?: AutoAcceptCredential + comment?: string +} + +export interface OfferCredentialOptions { + protocolVersion: ProtocolVersionType + credentialFormats: { + indy: { + credentialDefinitionId: string + attributes: { + name: string + value: string + }[] + } + } + autoAcceptCredential?: AutoAcceptCredential + comment?: string + connectionId: string +} + +export interface AcceptCredentialOfferOptions { + credentialFormats?: CredentialFormatPayload + autoAcceptCredential?: AutoAcceptCredential + comment?: string +} + +export interface AcceptCredentialRequestOptions { + credentialFormats?: CredentialFormatPayload + autoAcceptCredential?: AutoAcceptCredential + comment?: string +} + +type ReceiveOutOfBandInvitationProps = Omit + +export interface ReceiveInvitationProps extends ReceiveOutOfBandInvitationProps { + invitation: Omit +} + +export interface ReceiveInvitationByUrlProps extends ReceiveOutOfBandInvitationProps { + invitationUrl: string +} + +export interface AcceptInvitationConfig { + autoAcceptConnection?: boolean + reuseConnection?: boolean + label?: string + alias?: string + imageUrl?: string + mediatorId?: string +} + +export interface OutOfBandInvitationSchema { + '@id'?: string + '@type': string + label: string + goalCode?: string + goal?: string + accept?: string[] + handshake_protocols?: HandshakeProtocol[] + services: Array + imageUrl?: string +} + +export interface ConnectionInvitationSchema { + id?: string + '@type': string + label: string + did?: string + recipientKeys?: string[] + serviceEndpoint?: string + routingKeys?: string[] + imageUrl?: string +} + +export interface RequestProofOptions extends ProofRequestConfig { + connectionId: string + proofRequestOptions: { + name: string + version: string + requestedAttributes?: { [key: string]: ProofAttributeInfo } + requestedPredicates?: { [key: string]: ProofPredicateInfo } + } +} + +export interface RequestProofProposalOptions { + connectionId: string + attributes: PresentationPreviewAttributeOptions[] + predicates: PresentationPreviewPredicateOptions[] + comment?: string + autoAcceptProof?: AutoAcceptProof +} diff --git a/packages/rest/src/routes/routes.ts b/packages/rest/src/routes/routes.ts new file mode 100644 index 00000000..07181198 --- /dev/null +++ b/packages/rest/src/routes/routes.ts @@ -0,0 +1,1742 @@ +/* tslint:disable */ +/* eslint-disable */ +// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa +import { Controller, ValidationService, FieldErrors, ValidateError, TsoaRoute, HttpStatusCodeLiteral, TsoaResponse, fetchMiddlewares } from '@tsoa/runtime'; +// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa +import { AgentController } from './../controllers/agent/AgentController'; +// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa +import { BasicMessageController } from './../controllers/basic-messages/BasicMessageController'; +// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa +import { ConnectionController } from './../controllers/connections/ConnectionController'; +// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa +import { CredentialController } from './../controllers/credentials/CredentialController'; +// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa +import { CredentialDefinitionController } from './../controllers/credentials/CredentialDefinitionController'; +// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa +import { SchemaController } from './../controllers/credentials/SchemaController'; +// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa +import { OutOfBandController } from './../controllers/outofband/OutOfBandController'; +// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa +import { ProofController } from './../controllers/proofs/ProofController'; +import { iocContainer } from './../utils/tsyringeTsoaIocContainer'; +import { IocContainer, IocContainerFactory } from '@tsoa/runtime'; +import type { RequestHandler } from 'express'; +import * as express from 'express'; + +// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + +const models: TsoaRoute.Models = { + "AgentInfo": { + "dataType": "refObject", + "properties": { + "label": {"dataType":"string","required":true}, + "endpoints": {"dataType":"array","array":{"dataType":"string"},"required":true}, + "isInitialized": {"dataType":"boolean","required":true}, + "publicDid": {"dataType":"nestedObjectLiteral","nestedProperties":{"verkey":{"dataType":"string","required":true},"did":{"dataType":"string","required":true}}}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "Record_string.unknown_": { + "dataType": "refAlias", + "type": {"dataType":"nestedObjectLiteral","nestedProperties":{},"validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "BasicMessageRecord": { + "dataType": "refAlias", + "type": {"ref":"Record_string.unknown_","validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "RecordId": { + "dataType": "refAlias", + "type": {"dataType":"string","validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "Record_content.string_": { + "dataType": "refAlias", + "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"content":{"dataType":"string"}},"validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "Record_string.any_": { + "dataType": "refAlias", + "type": {"dataType":"nestedObjectLiteral","nestedProperties":{},"validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "ProtocolVersionType_CredentialServices_": { + "dataType": "refAlias", + "type": {"dataType":"string","validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "AutoAcceptCredential": { + "dataType": "refEnum", + "enums": ["always","contentApproved","never"], + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "ProposeCredentialOptions": { + "dataType": "refObject", + "properties": { + "protocolVersion": {"ref":"ProtocolVersionType_CredentialServices_","required":true}, + "credentialFormats": {"dataType":"nestedObjectLiteral","nestedProperties":{"indy":{"dataType":"nestedObjectLiteral","nestedProperties":{"attributes":{"dataType":"array","array":{"dataType":"nestedObjectLiteral","nestedProperties":{"value":{"dataType":"string","required":true},"name":{"dataType":"string","required":true}}},"required":true},"issuerDid":{"dataType":"string","required":true},"credentialDefinitionId":{"dataType":"string","required":true},"schemaVersion":{"dataType":"string","required":true},"schemaName":{"dataType":"string","required":true},"schemaId":{"dataType":"string","required":true},"schemaIssuerDid":{"dataType":"string","required":true}},"required":true}},"required":true}, + "autoAcceptCredential": {"ref":"AutoAcceptCredential"}, + "comment": {"dataType":"string"}, + "connectionId": {"dataType":"string","required":true}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "AcceptCredentialProposalOptions": { + "dataType": "refObject", + "properties": { + "credentialFormats": {"dataType":"nestedObjectLiteral","nestedProperties":{"indy":{"dataType":"nestedObjectLiteral","nestedProperties":{"attributes":{"dataType":"array","array":{"dataType":"nestedObjectLiteral","nestedProperties":{"value":{"dataType":"string","required":true},"name":{"dataType":"string","required":true}}},"required":true},"issuerDid":{"dataType":"string","required":true},"credentialDefinitionId":{"dataType":"string","required":true},"schemaVersion":{"dataType":"string","required":true},"schemaName":{"dataType":"string","required":true},"schemaId":{"dataType":"string","required":true},"schemaIssuerDid":{"dataType":"string","required":true}},"required":true}}}, + "autoAcceptCredential": {"ref":"AutoAcceptCredential"}, + "comment": {"dataType":"string"}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "OfferCredentialOptions": { + "dataType": "refObject", + "properties": { + "protocolVersion": {"ref":"ProtocolVersionType_CredentialServices_","required":true}, + "credentialFormats": {"dataType":"nestedObjectLiteral","nestedProperties":{"indy":{"dataType":"nestedObjectLiteral","nestedProperties":{"attributes":{"dataType":"array","array":{"dataType":"nestedObjectLiteral","nestedProperties":{"value":{"dataType":"string","required":true},"name":{"dataType":"string","required":true}}},"required":true},"credentialDefinitionId":{"dataType":"string","required":true}},"required":true}},"required":true}, + "autoAcceptCredential": {"ref":"AutoAcceptCredential"}, + "comment": {"dataType":"string"}, + "connectionId": {"dataType":"string","required":true}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "IndyAcceptOfferFormat": { + "dataType": "refObject", + "properties": { + "holderDid": {"dataType":"string"}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "CredentialFormatPayload_CredentialFormats.acceptOffer_": { + "dataType": "refAlias", + "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"indy":{"ref":"IndyAcceptOfferFormat"}},"validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "AcceptCredentialOfferOptions": { + "dataType": "refObject", + "properties": { + "credentialFormats": {"ref":"CredentialFormatPayload_CredentialFormats.acceptOffer_"}, + "autoAcceptCredential": {"ref":"AutoAcceptCredential"}, + "comment": {"dataType":"string"}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "CredentialFormatPayload_CredentialFormats.acceptRequest_": { + "dataType": "refAlias", + "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"indy":{"ref":"Record_string.any_"}},"validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "AcceptCredentialRequestOptions": { + "dataType": "refObject", + "properties": { + "credentialFormats": {"ref":"CredentialFormatPayload_CredentialFormats.acceptRequest_"}, + "autoAcceptCredential": {"ref":"AutoAcceptCredential"}, + "comment": {"dataType":"string"}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "CredentialDefinitionId": { + "dataType": "refAlias", + "type": {"dataType":"string","validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "SchemaId": { + "dataType": "refAlias", + "type": {"dataType":"string","validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "Version": { + "dataType": "refAlias", + "type": {"dataType":"string","validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "HandshakeProtocol": { + "dataType": "refEnum", + "enums": ["https://didcomm.org/connections/1.0","https://didcomm.org/didexchange/1.0"], + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "Pick_CreateOutOfBandInvitationConfig.Exclude_keyofCreateOutOfBandInvitationConfig.routing-or-appendedAttachments-or-messages__": { + "dataType": "refAlias", + "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"label":{"dataType":"string"},"alias":{"dataType":"string"},"imageUrl":{"dataType":"string"},"goalCode":{"dataType":"string"},"goal":{"dataType":"string"},"handshake":{"dataType":"boolean"},"handshakeProtocols":{"dataType":"array","array":{"dataType":"refEnum","ref":"HandshakeProtocol"}},"multiUseInvitation":{"dataType":"boolean"},"autoAcceptConnection":{"dataType":"boolean"}},"validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "Omit_CreateOutOfBandInvitationConfig.routing-or-appendedAttachments-or-messages_": { + "dataType": "refAlias", + "type": {"ref":"Pick_CreateOutOfBandInvitationConfig.Exclude_keyofCreateOutOfBandInvitationConfig.routing-or-appendedAttachments-or-messages__","validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "Pick_CreateLegacyInvitationConfig.Exclude_keyofCreateLegacyInvitationConfig.routing__": { + "dataType": "refAlias", + "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"label":{"dataType":"string"},"alias":{"dataType":"string"},"imageUrl":{"dataType":"string"},"multiUseInvitation":{"dataType":"boolean"},"autoAcceptConnection":{"dataType":"boolean"}},"validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "Omit_CreateLegacyInvitationConfig.routing_": { + "dataType": "refAlias", + "type": {"ref":"Pick_CreateLegacyInvitationConfig.Exclude_keyofCreateLegacyInvitationConfig.routing__","validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "AgentMessageType": { + "dataType": "refObject", + "properties": { + "@id": {"dataType":"string","required":true}, + "@type": {"dataType":"string","required":true}, + }, + "additionalProperties": {"dataType":"any"}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "OutOfBandDidCommService": { + "dataType": "refObject", + "properties": { + "id": {"dataType":"string","required":true}, + "serviceEndpoint": {"dataType":"string","required":true}, + "type": {"dataType":"string","required":true}, + "recipientKeys": {"dataType":"array","array":{"dataType":"string"},"required":true}, + "routingKeys": {"dataType":"array","array":{"dataType":"string"}}, + "accept": {"dataType":"array","array":{"dataType":"string"}}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "Pick_OutOfBandInvitationSchema.Exclude_keyofOutOfBandInvitationSchema.appendedAttachments__": { + "dataType": "refAlias", + "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"label":{"dataType":"string","required":true},"imageUrl":{"dataType":"string"},"goalCode":{"dataType":"string"},"goal":{"dataType":"string"},"@id":{"dataType":"string"},"@type":{"dataType":"string","required":true},"accept":{"dataType":"array","array":{"dataType":"string"}},"handshake_protocols":{"dataType":"array","array":{"dataType":"refEnum","ref":"HandshakeProtocol"}},"services":{"dataType":"array","array":{"dataType":"union","subSchemas":[{"ref":"OutOfBandDidCommService"},{"dataType":"string"}]},"required":true}},"validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "Omit_OutOfBandInvitationSchema.appendedAttachments_": { + "dataType": "refAlias", + "type": {"ref":"Pick_OutOfBandInvitationSchema.Exclude_keyofOutOfBandInvitationSchema.appendedAttachments__","validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "Pick_ReceiveOutOfBandInvitationConfig.Exclude_keyofReceiveOutOfBandInvitationConfig.routing__": { + "dataType": "refAlias", + "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"label":{"dataType":"string"},"alias":{"dataType":"string"},"imageUrl":{"dataType":"string"},"autoAcceptConnection":{"dataType":"boolean"},"autoAcceptInvitation":{"dataType":"boolean"},"reuseConnection":{"dataType":"boolean"}},"validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "Omit_ReceiveOutOfBandInvitationConfig.routing_": { + "dataType": "refAlias", + "type": {"ref":"Pick_ReceiveOutOfBandInvitationConfig.Exclude_keyofReceiveOutOfBandInvitationConfig.routing__","validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "ReceiveInvitationProps": { + "dataType": "refObject", + "properties": { + "label": {"dataType":"string"}, + "alias": {"dataType":"string"}, + "imageUrl": {"dataType":"string"}, + "autoAcceptConnection": {"dataType":"boolean"}, + "autoAcceptInvitation": {"dataType":"boolean"}, + "reuseConnection": {"dataType":"boolean"}, + "invitation": {"ref":"Omit_OutOfBandInvitationSchema.appendedAttachments_","required":true}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "ReceiveInvitationByUrlProps": { + "dataType": "refObject", + "properties": { + "label": {"dataType":"string"}, + "alias": {"dataType":"string"}, + "imageUrl": {"dataType":"string"}, + "autoAcceptConnection": {"dataType":"boolean"}, + "autoAcceptInvitation": {"dataType":"boolean"}, + "reuseConnection": {"dataType":"boolean"}, + "invitationUrl": {"dataType":"string","required":true}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "AcceptInvitationConfig": { + "dataType": "refObject", + "properties": { + "autoAcceptConnection": {"dataType":"boolean"}, + "reuseConnection": {"dataType":"boolean"}, + "label": {"dataType":"string"}, + "alias": {"dataType":"string"}, + "imageUrl": {"dataType":"string"}, + "mediatorId": {"dataType":"string"}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "PresentationPreviewAttributeOptions": { + "dataType": "refObject", + "properties": { + "name": {"dataType":"string","required":true}, + "credentialDefinitionId": {"dataType":"string"}, + "mimeType": {"dataType":"string"}, + "value": {"dataType":"string"}, + "referent": {"dataType":"string"}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "PredicateType": { + "dataType": "refEnum", + "enums": ["<","<=",">",">="], + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "PresentationPreviewPredicateOptions": { + "dataType": "refObject", + "properties": { + "name": {"dataType":"string","required":true}, + "credentialDefinitionId": {"dataType":"string","required":true}, + "predicate": {"ref":"PredicateType","required":true}, + "threshold": {"dataType":"double","required":true}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "AutoAcceptProof": { + "dataType": "refEnum", + "enums": ["always","contentApproved","never"], + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "RequestProofProposalOptions": { + "dataType": "refObject", + "properties": { + "connectionId": {"dataType":"string","required":true}, + "attributes": {"dataType":"array","array":{"dataType":"refObject","ref":"PresentationPreviewAttributeOptions"},"required":true}, + "predicates": {"dataType":"array","array":{"dataType":"refObject","ref":"PresentationPreviewPredicateOptions"},"required":true}, + "comment": {"dataType":"string"}, + "autoAcceptProof": {"ref":"AutoAcceptProof"}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "ProofRecord": { + "dataType": "refAlias", + "type": {"ref":"Record_string.unknown_","validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "IndyRevocationInterval": { + "dataType": "refObject", + "properties": { + "from": {"dataType":"double"}, + "to": {"dataType":"double"}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "AttributeValue": { + "dataType": "refObject", + "properties": { + "name": {"dataType":"string","required":true}, + "value": {"dataType":"string","required":true}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "AttributeFilter": { + "dataType": "refObject", + "properties": { + "schemaId": {"dataType":"string"}, + "schemaIssuerDid": {"dataType":"string"}, + "schemaName": {"dataType":"string"}, + "schemaVersion": {"dataType":"string"}, + "issuerDid": {"dataType":"string"}, + "credentialDefinitionId": {"dataType":"string"}, + "attributeValue": {"ref":"AttributeValue"}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "ProofAttributeInfo": { + "dataType": "refObject", + "properties": { + "name": {"dataType":"string"}, + "names": {"dataType":"array","array":{"dataType":"string"}}, + "nonRevoked": {"ref":"IndyRevocationInterval"}, + "restrictions": {"dataType":"array","array":{"dataType":"refObject","ref":"AttributeFilter"}}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "ProofPredicateInfo": { + "dataType": "refObject", + "properties": { + "name": {"dataType":"string","required":true}, + "predicateType": {"ref":"PredicateType","required":true}, + "predicateValue": {"dataType":"double","required":true}, + "nonRevoked": {"ref":"IndyRevocationInterval"}, + "restrictions": {"dataType":"array","array":{"dataType":"refObject","ref":"AttributeFilter"}}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "Pick_RequestProofOptions.Exclude_keyofRequestProofOptions.connectionId__": { + "dataType": "refAlias", + "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"comment":{"dataType":"string"},"autoAcceptProof":{"ref":"AutoAcceptProof"},"proofRequestOptions":{"dataType":"nestedObjectLiteral","nestedProperties":{"requestedPredicates":{"dataType":"nestedObjectLiteral","nestedProperties":{},"additionalProperties":{"ref":"ProofPredicateInfo"}},"requestedAttributes":{"dataType":"nestedObjectLiteral","nestedProperties":{},"additionalProperties":{"ref":"ProofAttributeInfo"}},"version":{"dataType":"string","required":true},"name":{"dataType":"string","required":true}},"required":true},"parentThreadId":{"dataType":"string"}},"validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "Omit_RequestProofOptions.connectionId_": { + "dataType": "refAlias", + "type": {"ref":"Pick_RequestProofOptions.Exclude_keyofRequestProofOptions.connectionId__","validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "RequestProofOptions": { + "dataType": "refObject", + "properties": { + "comment": {"dataType":"string"}, + "autoAcceptProof": {"ref":"AutoAcceptProof"}, + "parentThreadId": {"dataType":"string"}, + "connectionId": {"dataType":"string","required":true}, + "proofRequestOptions": {"dataType":"nestedObjectLiteral","nestedProperties":{"requestedPredicates":{"dataType":"nestedObjectLiteral","nestedProperties":{},"additionalProperties":{"ref":"ProofPredicateInfo"}},"requestedAttributes":{"dataType":"nestedObjectLiteral","nestedProperties":{},"additionalProperties":{"ref":"ProofAttributeInfo"}},"version":{"dataType":"string","required":true},"name":{"dataType":"string","required":true}},"required":true}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa +}; +const validationService = new ValidationService(models); + +// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + +export function RegisterRoutes(app: express.Router) { + // ########################################################################################################### + // NOTE: If you do not see routes for all of your controllers in this file, then you might not have informed tsoa of where to look + // Please look into the "controllerPathGlobs" config option described in the readme: https://github.com/lukeautry/tsoa + // ########################################################################################################### + app.get('/agent', + ...(fetchMiddlewares(AgentController)), + ...(fetchMiddlewares(AgentController.prototype.getAgentInfo)), + + async function AgentController_getAgentInfo(request: any, response: any, next: any) { + const args = { + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(AgentController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.getAgentInfo.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.get('/basic-messages/:connectionId', + ...(fetchMiddlewares(BasicMessageController)), + ...(fetchMiddlewares(BasicMessageController.prototype.getBasicMessages)), + + async function BasicMessageController_getBasicMessages(request: any, response: any, next: any) { + const args = { + connectionId: {"in":"path","name":"connectionId","required":true,"ref":"RecordId"}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(BasicMessageController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.getBasicMessages.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.post('/basic-messages/:connectionId', + ...(fetchMiddlewares(BasicMessageController)), + ...(fetchMiddlewares(BasicMessageController.prototype.sendMessage)), + + async function BasicMessageController_sendMessage(request: any, response: any, next: any) { + const args = { + connectionId: {"in":"path","name":"connectionId","required":true,"ref":"RecordId"}, + request: {"in":"body","name":"request","required":true,"ref":"Record_content.string_"}, + notFoundError: {"in":"res","name":"404","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, + internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(BasicMessageController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.sendMessage.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.get('/connections', + ...(fetchMiddlewares(ConnectionController)), + ...(fetchMiddlewares(ConnectionController.prototype.getAllConnections)), + + async function ConnectionController_getAllConnections(request: any, response: any, next: any) { + const args = { + outOfBandId: {"in":"query","name":"outOfBandId","dataType":"string"}, + alias: {"in":"query","name":"alias","dataType":"string"}, + state: {"in":"query","name":"state","dataType":"string"}, + myDid: {"in":"query","name":"myDid","dataType":"string"}, + theirDid: {"in":"query","name":"theirDid","dataType":"string"}, + theirLabel: {"in":"query","name":"theirLabel","dataType":"string"}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(ConnectionController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.getAllConnections.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.get('/connections/:connectionId', + ...(fetchMiddlewares(ConnectionController)), + ...(fetchMiddlewares(ConnectionController.prototype.getConnectionById)), + + async function ConnectionController_getConnectionById(request: any, response: any, next: any) { + const args = { + connectionId: {"in":"path","name":"connectionId","required":true,"ref":"RecordId"}, + notFoundError: {"in":"res","name":"404","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(ConnectionController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.getConnectionById.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.delete('/connections/:connectionId', + ...(fetchMiddlewares(ConnectionController)), + ...(fetchMiddlewares(ConnectionController.prototype.deleteConnection)), + + async function ConnectionController_deleteConnection(request: any, response: any, next: any) { + const args = { + connectionId: {"in":"path","name":"connectionId","required":true,"ref":"RecordId"}, + notFoundError: {"in":"res","name":"404","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, + internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(ConnectionController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.deleteConnection.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.post('/connections/:connectionId/accept-request', + ...(fetchMiddlewares(ConnectionController)), + ...(fetchMiddlewares(ConnectionController.prototype.acceptRequest)), + + async function ConnectionController_acceptRequest(request: any, response: any, next: any) { + const args = { + connectionId: {"in":"path","name":"connectionId","required":true,"ref":"RecordId"}, + notFoundError: {"in":"res","name":"404","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, + internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(ConnectionController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.acceptRequest.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.post('/connections/:connectionId/accept-response', + ...(fetchMiddlewares(ConnectionController)), + ...(fetchMiddlewares(ConnectionController.prototype.acceptResponse)), + + async function ConnectionController_acceptResponse(request: any, response: any, next: any) { + const args = { + connectionId: {"in":"path","name":"connectionId","required":true,"ref":"RecordId"}, + notFoundError: {"in":"res","name":"404","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, + internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(ConnectionController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.acceptResponse.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.get('/credentials', + ...(fetchMiddlewares(CredentialController)), + ...(fetchMiddlewares(CredentialController.prototype.getAllCredentials)), + + async function CredentialController_getAllCredentials(request: any, response: any, next: any) { + const args = { + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(CredentialController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.getAllCredentials.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.get('/credentials/:credentialRecordId', + ...(fetchMiddlewares(CredentialController)), + ...(fetchMiddlewares(CredentialController.prototype.getCredentialById)), + + async function CredentialController_getCredentialById(request: any, response: any, next: any) { + const args = { + credentialRecordId: {"in":"path","name":"credentialRecordId","required":true,"ref":"RecordId"}, + notFoundError: {"in":"res","name":"404","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, + internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(CredentialController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.getCredentialById.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.delete('/credentials/:credentialRecordId', + ...(fetchMiddlewares(CredentialController)), + ...(fetchMiddlewares(CredentialController.prototype.deleteCredential)), + + async function CredentialController_deleteCredential(request: any, response: any, next: any) { + const args = { + credentialRecordId: {"in":"path","name":"credentialRecordId","required":true,"ref":"RecordId"}, + notFoundError: {"in":"res","name":"404","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, + internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(CredentialController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.deleteCredential.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.post('/credentials/propose-credential', + ...(fetchMiddlewares(CredentialController)), + ...(fetchMiddlewares(CredentialController.prototype.proposeCredential)), + + async function CredentialController_proposeCredential(request: any, response: any, next: any) { + const args = { + options: {"in":"body","name":"options","required":true,"ref":"ProposeCredentialOptions"}, + notFoundError: {"in":"res","name":"404","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, + internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(CredentialController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.proposeCredential.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.post('/credentials/:credentialRecordId/accept-proposal', + ...(fetchMiddlewares(CredentialController)), + ...(fetchMiddlewares(CredentialController.prototype.acceptProposal)), + + async function CredentialController_acceptProposal(request: any, response: any, next: any) { + const args = { + credentialRecordId: {"in":"path","name":"credentialRecordId","required":true,"ref":"RecordId"}, + notFoundError: {"in":"res","name":"404","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, + internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, + options: {"in":"body","name":"options","ref":"AcceptCredentialProposalOptions"}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(CredentialController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.acceptProposal.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.post('/credentials/offer-credential', + ...(fetchMiddlewares(CredentialController)), + ...(fetchMiddlewares(CredentialController.prototype.offerCredential)), + + async function CredentialController_offerCredential(request: any, response: any, next: any) { + const args = { + options: {"in":"body","name":"options","required":true,"ref":"OfferCredentialOptions"}, + notFoundError: {"in":"res","name":"404","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, + internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(CredentialController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.offerCredential.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.post('/credentials/:credentialRecordId/accept-offer', + ...(fetchMiddlewares(CredentialController)), + ...(fetchMiddlewares(CredentialController.prototype.acceptOffer)), + + async function CredentialController_acceptOffer(request: any, response: any, next: any) { + const args = { + credentialRecordId: {"in":"path","name":"credentialRecordId","required":true,"ref":"RecordId"}, + notFoundError: {"in":"res","name":"404","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, + internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, + options: {"in":"body","name":"options","ref":"AcceptCredentialOfferOptions"}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(CredentialController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.acceptOffer.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.post('/credentials/:credentialRecordId/accept-request', + ...(fetchMiddlewares(CredentialController)), + ...(fetchMiddlewares(CredentialController.prototype.acceptRequest)), + + async function CredentialController_acceptRequest(request: any, response: any, next: any) { + const args = { + credentialRecordId: {"in":"path","name":"credentialRecordId","required":true,"ref":"RecordId"}, + notFoundError: {"in":"res","name":"404","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, + internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, + options: {"in":"body","name":"options","ref":"AcceptCredentialRequestOptions"}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(CredentialController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.acceptRequest.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.post('/credentials/:credentialRecordId/accept-credential', + ...(fetchMiddlewares(CredentialController)), + ...(fetchMiddlewares(CredentialController.prototype.acceptCredential)), + + async function CredentialController_acceptCredential(request: any, response: any, next: any) { + const args = { + credentialRecordId: {"in":"path","name":"credentialRecordId","required":true,"ref":"RecordId"}, + notFoundError: {"in":"res","name":"404","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, + internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(CredentialController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.acceptCredential.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.get('/credential-definitions/:credentialDefinitionId', + ...(fetchMiddlewares(CredentialDefinitionController)), + ...(fetchMiddlewares(CredentialDefinitionController.prototype.getCredentialDefinitionById)), + + async function CredentialDefinitionController_getCredentialDefinitionById(request: any, response: any, next: any) { + const args = { + credentialDefinitionId: {"in":"path","name":"credentialDefinitionId","required":true,"ref":"CredentialDefinitionId"}, + badRequestError: {"in":"res","name":"400","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, + notFoundError: {"in":"res","name":"404","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, + internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(CredentialDefinitionController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.getCredentialDefinitionById.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.post('/credential-definitions', + ...(fetchMiddlewares(CredentialDefinitionController)), + ...(fetchMiddlewares(CredentialDefinitionController.prototype.createCredentialDefinition)), + + async function CredentialDefinitionController_createCredentialDefinition(request: any, response: any, next: any) { + const args = { + credentialDefinitionRequest: {"in":"body","name":"credentialDefinitionRequest","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"tag":{"dataType":"string","required":true},"supportRevocation":{"dataType":"boolean","required":true},"schemaId":{"ref":"SchemaId","required":true}}}, + notFoundError: {"in":"res","name":"404","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, + internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(CredentialDefinitionController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.createCredentialDefinition.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.get('/schemas/:schemaId', + ...(fetchMiddlewares(SchemaController)), + ...(fetchMiddlewares(SchemaController.prototype.getSchemaById)), + + async function SchemaController_getSchemaById(request: any, response: any, next: any) { + const args = { + schemaId: {"in":"path","name":"schemaId","required":true,"ref":"SchemaId"}, + notFoundError: {"in":"res","name":"404","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, + forbiddenError: {"in":"res","name":"403","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, + badRequestError: {"in":"res","name":"400","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, + internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(SchemaController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.getSchemaById.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.post('/schemas', + ...(fetchMiddlewares(SchemaController)), + ...(fetchMiddlewares(SchemaController.prototype.createSchema)), + + async function SchemaController_createSchema(request: any, response: any, next: any) { + const args = { + schema: {"in":"body","name":"schema","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"attributes":{"dataType":"array","array":{"dataType":"string"},"required":true},"version":{"ref":"Version","required":true},"name":{"dataType":"string","required":true}}}, + forbiddenError: {"in":"res","name":"400","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, + internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(SchemaController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.createSchema.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.get('/oob', + ...(fetchMiddlewares(OutOfBandController)), + ...(fetchMiddlewares(OutOfBandController.prototype.getAllOutOfBandRecords)), + + async function OutOfBandController_getAllOutOfBandRecords(request: any, response: any, next: any) { + const args = { + invitationId: {"in":"query","name":"invitationId","ref":"RecordId"}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(OutOfBandController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.getAllOutOfBandRecords.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.get('/oob/:outOfBandId', + ...(fetchMiddlewares(OutOfBandController)), + ...(fetchMiddlewares(OutOfBandController.prototype.getOutOfBandRecordById)), + + async function OutOfBandController_getOutOfBandRecordById(request: any, response: any, next: any) { + const args = { + outOfBandId: {"in":"path","name":"outOfBandId","required":true,"ref":"RecordId"}, + notFoundError: {"in":"res","name":"404","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(OutOfBandController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.getOutOfBandRecordById.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.post('/oob/create-invitation', + ...(fetchMiddlewares(OutOfBandController)), + ...(fetchMiddlewares(OutOfBandController.prototype.createInvitation)), + + async function OutOfBandController_createInvitation(request: any, response: any, next: any) { + const args = { + internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, + config: {"in":"body","name":"config","ref":"Omit_CreateOutOfBandInvitationConfig.routing-or-appendedAttachments-or-messages_"}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(OutOfBandController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.createInvitation.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.post('/oob/create-legacy-invitation', + ...(fetchMiddlewares(OutOfBandController)), + ...(fetchMiddlewares(OutOfBandController.prototype.createLegacyInvitation)), + + async function OutOfBandController_createLegacyInvitation(request: any, response: any, next: any) { + const args = { + internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, + config: {"in":"body","name":"config","ref":"Omit_CreateLegacyInvitationConfig.routing_"}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(OutOfBandController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.createLegacyInvitation.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.post('/oob/create-legacy-connectionless-invitation', + ...(fetchMiddlewares(OutOfBandController)), + ...(fetchMiddlewares(OutOfBandController.prototype.createLegacyConnectionlessInvitation)), + + async function OutOfBandController_createLegacyConnectionlessInvitation(request: any, response: any, next: any) { + const args = { + config: {"in":"body","name":"config","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"domain":{"dataType":"string","required":true},"message":{"ref":"AgentMessageType","required":true},"recordId":{"dataType":"string","required":true}}}, + notFoundError: {"in":"res","name":"404","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, + internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(OutOfBandController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.createLegacyConnectionlessInvitation.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.post('/oob/receive-invitation', + ...(fetchMiddlewares(OutOfBandController)), + ...(fetchMiddlewares(OutOfBandController.prototype.receiveInvitation)), + + async function OutOfBandController_receiveInvitation(request: any, response: any, next: any) { + const args = { + invitationRequest: {"in":"body","name":"invitationRequest","required":true,"ref":"ReceiveInvitationProps"}, + internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(OutOfBandController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.receiveInvitation.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.post('/oob/receive-invitation-url', + ...(fetchMiddlewares(OutOfBandController)), + ...(fetchMiddlewares(OutOfBandController.prototype.receiveInvitationFromUrl)), + + async function OutOfBandController_receiveInvitationFromUrl(request: any, response: any, next: any) { + const args = { + invitationRequest: {"in":"body","name":"invitationRequest","required":true,"ref":"ReceiveInvitationByUrlProps"}, + internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(OutOfBandController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.receiveInvitationFromUrl.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.post('/oob/:outOfBandId/accept-invitation', + ...(fetchMiddlewares(OutOfBandController)), + ...(fetchMiddlewares(OutOfBandController.prototype.acceptInvitation)), + + async function OutOfBandController_acceptInvitation(request: any, response: any, next: any) { + const args = { + outOfBandId: {"in":"path","name":"outOfBandId","required":true,"ref":"RecordId"}, + acceptInvitationConfig: {"in":"body","name":"acceptInvitationConfig","required":true,"ref":"AcceptInvitationConfig"}, + notFoundError: {"in":"res","name":"404","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, + internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(OutOfBandController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.acceptInvitation.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.delete('/oob/:outOfBandId', + ...(fetchMiddlewares(OutOfBandController)), + ...(fetchMiddlewares(OutOfBandController.prototype.deleteOutOfBandRecord)), + + async function OutOfBandController_deleteOutOfBandRecord(request: any, response: any, next: any) { + const args = { + outOfBandId: {"in":"path","name":"outOfBandId","required":true,"ref":"RecordId"}, + notFoundError: {"in":"res","name":"404","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, + internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(OutOfBandController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.deleteOutOfBandRecord.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.get('/proofs', + ...(fetchMiddlewares(ProofController)), + ...(fetchMiddlewares(ProofController.prototype.getAllProofs)), + + async function ProofController_getAllProofs(request: any, response: any, next: any) { + const args = { + threadId: {"in":"query","name":"threadId","dataType":"string"}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(ProofController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.getAllProofs.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.get('/proofs/:proofRecordId', + ...(fetchMiddlewares(ProofController)), + ...(fetchMiddlewares(ProofController.prototype.getProofById)), + + async function ProofController_getProofById(request: any, response: any, next: any) { + const args = { + proofRecordId: {"in":"path","name":"proofRecordId","required":true,"ref":"RecordId"}, + notFoundError: {"in":"res","name":"404","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, + internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(ProofController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.getProofById.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.delete('/proofs/:proofRecordId', + ...(fetchMiddlewares(ProofController)), + ...(fetchMiddlewares(ProofController.prototype.deleteProof)), + + async function ProofController_deleteProof(request: any, response: any, next: any) { + const args = { + proofRecordId: {"in":"path","name":"proofRecordId","required":true,"ref":"RecordId"}, + notFoundError: {"in":"res","name":"404","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, + internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(ProofController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.deleteProof.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.post('/proofs/propose-proof', + ...(fetchMiddlewares(ProofController)), + ...(fetchMiddlewares(ProofController.prototype.proposeProof)), + + async function ProofController_proposeProof(request: any, response: any, next: any) { + const args = { + proposal: {"in":"body","name":"proposal","required":true,"ref":"RequestProofProposalOptions"}, + notFoundError: {"in":"res","name":"404","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, + internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(ProofController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.proposeProof.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.post('/proofs/:proofRecordId/accept-proposal', + ...(fetchMiddlewares(ProofController)), + ...(fetchMiddlewares(ProofController.prototype.acceptProposal)), + + async function ProofController_acceptProposal(request: any, response: any, next: any) { + const args = { + proofRecordId: {"in":"path","name":"proofRecordId","required":true,"dataType":"string"}, + proposal: {"in":"body","name":"proposal","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"comment":{"dataType":"string"},"request":{"dataType":"nestedObjectLiteral","nestedProperties":{"nonce":{"dataType":"string"},"version":{"dataType":"string"},"name":{"dataType":"string"}},"required":true}}}, + notFoundError: {"in":"res","name":"404","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, + internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(ProofController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.acceptProposal.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.post('/proofs/request-outofband-proof', + ...(fetchMiddlewares(ProofController)), + ...(fetchMiddlewares(ProofController.prototype.requestProofOutOfBand)), + + async function ProofController_requestProofOutOfBand(request: any, response: any, next: any) { + const args = { + request: {"in":"body","name":"request","required":true,"ref":"Omit_RequestProofOptions.connectionId_"}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(ProofController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.requestProofOutOfBand.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.post('/proofs/request-proof', + ...(fetchMiddlewares(ProofController)), + ...(fetchMiddlewares(ProofController.prototype.requestProof)), + + async function ProofController_requestProof(request: any, response: any, next: any) { + const args = { + request: {"in":"body","name":"request","required":true,"ref":"RequestProofOptions"}, + notFoundError: {"in":"res","name":"404","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, + internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(ProofController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.requestProof.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.post('/proofs/:proofRecordId/accept-request', + ...(fetchMiddlewares(ProofController)), + ...(fetchMiddlewares(ProofController.prototype.acceptRequest)), + + async function ProofController_acceptRequest(request: any, response: any, next: any) { + const args = { + proofRecordId: {"in":"path","name":"proofRecordId","required":true,"dataType":"string"}, + request: {"in":"body","name":"request","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"comment":{"dataType":"string","required":true},"filterByPresentationPreview":{"dataType":"boolean","required":true}}}, + notFoundError: {"in":"res","name":"404","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, + internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(ProofController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.acceptRequest.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.post('/proofs/:proofRecordId/accept-presentation', + ...(fetchMiddlewares(ProofController)), + ...(fetchMiddlewares(ProofController.prototype.acceptPresentation)), + + async function ProofController_acceptPresentation(request: any, response: any, next: any) { + const args = { + proofRecordId: {"in":"path","name":"proofRecordId","required":true,"dataType":"string"}, + notFoundError: {"in":"res","name":"404","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"reason":{"dataType":"string","required":true}}}, + internalServerError: {"in":"res","name":"500","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"message":{"dataType":"string","required":true}}}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = getValidatedArgs(args, request, response); + + const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer; + + const controller: any = await container.get(ProofController); + if (typeof controller['setStatus'] === 'function') { + controller.setStatus(undefined); + } + + + const promise = controller.acceptPresentation.apply(controller, validatedArgs as any); + promiseHandler(controller, promise, response, undefined, next); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + function isController(object: any): object is Controller { + return 'getHeaders' in object && 'getStatus' in object && 'setStatus' in object; + } + + function promiseHandler(controllerObj: any, promise: any, response: any, successStatus: any, next: any) { + return Promise.resolve(promise) + .then((data: any) => { + let statusCode = successStatus; + let headers; + if (isController(controllerObj)) { + headers = controllerObj.getHeaders(); + statusCode = controllerObj.getStatus() || statusCode; + } + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + returnHandler(response, statusCode, data, headers) + }) + .catch((error: any) => next(error)); + } + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + function returnHandler(response: any, statusCode?: number, data?: any, headers: any = {}) { + if (response.headersSent) { + return; + } + Object.keys(headers).forEach((name: string) => { + response.set(name, headers[name]); + }); + if (data && typeof data.pipe === 'function' && data.readable && typeof data._read === 'function') { + data.pipe(response); + } else if (data !== null && data !== undefined) { + response.status(statusCode || 200).json(data); + } else { + response.status(statusCode || 204).end(); + } + } + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + function responder(response: any): TsoaResponse { + return function(status, data, headers) { + returnHandler(response, status, data, headers); + }; + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + function getValidatedArgs(args: any, request: any, response: any): any[] { + const fieldErrors: FieldErrors = {}; + const values = Object.keys(args).map((key) => { + const name = args[key].name; + switch (args[key].in) { + case 'request': + return request; + case 'query': + return validationService.ValidateParam(args[key], request.query[name], name, fieldErrors, undefined, {"noImplicitAdditionalProperties":"throw-on-extras"}); + case 'path': + return validationService.ValidateParam(args[key], request.params[name], name, fieldErrors, undefined, {"noImplicitAdditionalProperties":"throw-on-extras"}); + case 'header': + return validationService.ValidateParam(args[key], request.header(name), name, fieldErrors, undefined, {"noImplicitAdditionalProperties":"throw-on-extras"}); + case 'body': + return validationService.ValidateParam(args[key], request.body, name, fieldErrors, undefined, {"noImplicitAdditionalProperties":"throw-on-extras"}); + case 'body-prop': + return validationService.ValidateParam(args[key], request.body[name], name, fieldErrors, 'body.', {"noImplicitAdditionalProperties":"throw-on-extras"}); + case 'formData': + if (args[key].dataType === 'file') { + return validationService.ValidateParam(args[key], request.file, name, fieldErrors, undefined, {"noImplicitAdditionalProperties":"throw-on-extras"}); + } else if (args[key].dataType === 'array' && args[key].array.dataType === 'file') { + return validationService.ValidateParam(args[key], request.files, name, fieldErrors, undefined, {"noImplicitAdditionalProperties":"throw-on-extras"}); + } else { + return validationService.ValidateParam(args[key], request.body[name], name, fieldErrors, undefined, {"noImplicitAdditionalProperties":"throw-on-extras"}); + } + case 'res': + return responder(response); + } + }); + + if (Object.keys(fieldErrors).length > 0) { + throw new ValidateError(fieldErrors, ''); + } + return values; + } + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa +} + +// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa diff --git a/packages/rest/src/routes/swagger.json b/packages/rest/src/routes/swagger.json new file mode 100644 index 00000000..db9a5bf6 --- /dev/null +++ b/packages/rest/src/routes/swagger.json @@ -0,0 +1,4398 @@ +{ + "components": { + "examples": {}, + "headers": {}, + "parameters": {}, + "requestBodies": {}, + "responses": {}, + "schemas": { + "AgentInfo": { + "properties": { + "label": { + "type": "string" + }, + "endpoints": { + "items": { + "type": "string" + }, + "type": "array" + }, + "isInitialized": { + "type": "boolean" + }, + "publicDid": { + "properties": { + "verkey": { + "type": "string" + }, + "did": { + "type": "string" + } + }, + "required": [ + "verkey", + "did" + ], + "type": "object" + } + }, + "required": [ + "label", + "endpoints", + "isInitialized" + ], + "type": "object", + "additionalProperties": false + }, + "Record_string.unknown_": { + "properties": {}, + "type": "object", + "description": "Construct a type with a set of properties K of type T" + }, + "BasicMessageRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "RecordId": { + "type": "string", + "example": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e" + }, + "Record_content.string_": { + "properties": { + "content": { + "type": "string" + } + }, + "type": "object", + "description": "Construct a type with a set of properties K of type T" + }, + "Record_string.any_": { + "properties": {}, + "type": "object", + "description": "Construct a type with a set of properties K of type T" + }, + "ProtocolVersionType_CredentialServices_": { + "type": "string", + "description": "Get the supported protocol versions based on the provided credential services." + }, + "AutoAcceptCredential": { + "description": "Typing of the state for auto acceptance", + "enum": [ + "always", + "contentApproved", + "never" + ], + "type": "string" + }, + "ProposeCredentialOptions": { + "properties": { + "protocolVersion": { + "$ref": "#/components/schemas/ProtocolVersionType_CredentialServices_" + }, + "credentialFormats": { + "properties": { + "indy": { + "properties": { + "attributes": { + "items": { + "properties": { + "value": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "value", + "name" + ], + "type": "object" + }, + "type": "array" + }, + "issuerDid": { + "type": "string" + }, + "credentialDefinitionId": { + "type": "string" + }, + "schemaVersion": { + "type": "string" + }, + "schemaName": { + "type": "string" + }, + "schemaId": { + "type": "string" + }, + "schemaIssuerDid": { + "type": "string" + } + }, + "required": [ + "attributes", + "issuerDid", + "credentialDefinitionId", + "schemaVersion", + "schemaName", + "schemaId", + "schemaIssuerDid" + ], + "type": "object" + } + }, + "required": [ + "indy" + ], + "type": "object" + }, + "autoAcceptCredential": { + "$ref": "#/components/schemas/AutoAcceptCredential" + }, + "comment": { + "type": "string" + }, + "connectionId": { + "type": "string" + } + }, + "required": [ + "protocolVersion", + "credentialFormats", + "connectionId" + ], + "type": "object", + "additionalProperties": false + }, + "AcceptCredentialProposalOptions": { + "properties": { + "credentialFormats": { + "properties": { + "indy": { + "properties": { + "attributes": { + "items": { + "properties": { + "value": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "value", + "name" + ], + "type": "object" + }, + "type": "array" + }, + "issuerDid": { + "type": "string" + }, + "credentialDefinitionId": { + "type": "string" + }, + "schemaVersion": { + "type": "string" + }, + "schemaName": { + "type": "string" + }, + "schemaId": { + "type": "string" + }, + "schemaIssuerDid": { + "type": "string" + } + }, + "required": [ + "attributes", + "issuerDid", + "credentialDefinitionId", + "schemaVersion", + "schemaName", + "schemaId", + "schemaIssuerDid" + ], + "type": "object" + } + }, + "required": [ + "indy" + ], + "type": "object" + }, + "autoAcceptCredential": { + "$ref": "#/components/schemas/AutoAcceptCredential" + }, + "comment": { + "type": "string" + } + }, + "type": "object", + "additionalProperties": false + }, + "OfferCredentialOptions": { + "properties": { + "protocolVersion": { + "$ref": "#/components/schemas/ProtocolVersionType_CredentialServices_" + }, + "credentialFormats": { + "properties": { + "indy": { + "properties": { + "attributes": { + "items": { + "properties": { + "value": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "value", + "name" + ], + "type": "object" + }, + "type": "array" + }, + "credentialDefinitionId": { + "type": "string" + } + }, + "required": [ + "attributes", + "credentialDefinitionId" + ], + "type": "object" + } + }, + "required": [ + "indy" + ], + "type": "object" + }, + "autoAcceptCredential": { + "$ref": "#/components/schemas/AutoAcceptCredential" + }, + "comment": { + "type": "string" + }, + "connectionId": { + "type": "string" + } + }, + "required": [ + "protocolVersion", + "credentialFormats", + "connectionId" + ], + "type": "object", + "additionalProperties": false + }, + "IndyAcceptOfferFormat": { + "properties": { + "holderDid": { + "type": "string" + } + }, + "type": "object", + "additionalProperties": false + }, + "CredentialFormatPayload_CredentialFormats.acceptOffer_": { + "properties": { + "indy": { + "$ref": "#/components/schemas/IndyAcceptOfferFormat" + } + }, + "type": "object", + "description": "Get the payload for a specific method from a list of CredentialFormat interfaces and a method" + }, + "AcceptCredentialOfferOptions": { + "properties": { + "credentialFormats": { + "$ref": "#/components/schemas/CredentialFormatPayload_CredentialFormats.acceptOffer_" + }, + "autoAcceptCredential": { + "$ref": "#/components/schemas/AutoAcceptCredential" + }, + "comment": { + "type": "string" + } + }, + "type": "object", + "additionalProperties": false + }, + "CredentialFormatPayload_CredentialFormats.acceptRequest_": { + "properties": { + "indy": { + "$ref": "#/components/schemas/Record_string.any_" + } + }, + "type": "object", + "description": "Get the payload for a specific method from a list of CredentialFormat interfaces and a method" + }, + "AcceptCredentialRequestOptions": { + "properties": { + "credentialFormats": { + "$ref": "#/components/schemas/CredentialFormatPayload_CredentialFormats.acceptRequest_" + }, + "autoAcceptCredential": { + "$ref": "#/components/schemas/AutoAcceptCredential" + }, + "comment": { + "type": "string" + } + }, + "type": "object", + "additionalProperties": false + }, + "CredentialDefinitionId": { + "type": "string", + "example": "WgWxqztrNooG92RXvxSTWv:3:CL:20:tag" + }, + "SchemaId": { + "type": "string", + "example": "WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0" + }, + "Version": { + "type": "string", + "example": "1.0.0" + }, + "HandshakeProtocol": { + "enum": [ + "https://didcomm.org/connections/1.0", + "https://didcomm.org/didexchange/1.0" + ], + "type": "string" + }, + "Pick_CreateOutOfBandInvitationConfig.Exclude_keyofCreateOutOfBandInvitationConfig.routing-or-appendedAttachments-or-messages__": { + "properties": { + "label": { + "type": "string" + }, + "alias": { + "type": "string" + }, + "imageUrl": { + "type": "string" + }, + "goalCode": { + "type": "string" + }, + "goal": { + "type": "string" + }, + "handshake": { + "type": "boolean" + }, + "handshakeProtocols": { + "items": { + "$ref": "#/components/schemas/HandshakeProtocol" + }, + "type": "array" + }, + "multiUseInvitation": { + "type": "boolean" + }, + "autoAcceptConnection": { + "type": "boolean" + } + }, + "type": "object", + "description": "From T, pick a set of properties whose keys are in the union K" + }, + "Omit_CreateOutOfBandInvitationConfig.routing-or-appendedAttachments-or-messages_": { + "$ref": "#/components/schemas/Pick_CreateOutOfBandInvitationConfig.Exclude_keyofCreateOutOfBandInvitationConfig.routing-or-appendedAttachments-or-messages__", + "description": "Construct a type with the properties of T except for those in type K." + }, + "Pick_CreateLegacyInvitationConfig.Exclude_keyofCreateLegacyInvitationConfig.routing__": { + "properties": { + "label": { + "type": "string" + }, + "alias": { + "type": "string" + }, + "imageUrl": { + "type": "string" + }, + "multiUseInvitation": { + "type": "boolean" + }, + "autoAcceptConnection": { + "type": "boolean" + } + }, + "type": "object", + "description": "From T, pick a set of properties whose keys are in the union K" + }, + "Omit_CreateLegacyInvitationConfig.routing_": { + "$ref": "#/components/schemas/Pick_CreateLegacyInvitationConfig.Exclude_keyofCreateLegacyInvitationConfig.routing__", + "description": "Construct a type with the properties of T except for those in type K." + }, + "AgentMessageType": { + "properties": { + "@id": { + "type": "string" + }, + "@type": { + "type": "string" + } + }, + "required": [ + "@id", + "@type" + ], + "type": "object", + "additionalProperties": {} + }, + "OutOfBandDidCommService": { + "properties": { + "id": { + "type": "string" + }, + "serviceEndpoint": { + "type": "string" + }, + "type": { + "type": "string" + }, + "recipientKeys": { + "items": { + "type": "string" + }, + "type": "array" + }, + "routingKeys": { + "items": { + "type": "string" + }, + "type": "array" + }, + "accept": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "id", + "serviceEndpoint", + "type", + "recipientKeys" + ], + "type": "object", + "additionalProperties": false + }, + "Pick_OutOfBandInvitationSchema.Exclude_keyofOutOfBandInvitationSchema.appendedAttachments__": { + "properties": { + "label": { + "type": "string" + }, + "imageUrl": { + "type": "string" + }, + "goalCode": { + "type": "string" + }, + "goal": { + "type": "string" + }, + "@id": { + "type": "string" + }, + "@type": { + "type": "string" + }, + "accept": { + "items": { + "type": "string" + }, + "type": "array" + }, + "handshake_protocols": { + "items": { + "$ref": "#/components/schemas/HandshakeProtocol" + }, + "type": "array" + }, + "services": { + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/OutOfBandDidCommService" + }, + { + "type": "string" + } + ] + }, + "type": "array" + } + }, + "required": [ + "label", + "@type", + "services" + ], + "type": "object", + "description": "From T, pick a set of properties whose keys are in the union K" + }, + "Omit_OutOfBandInvitationSchema.appendedAttachments_": { + "$ref": "#/components/schemas/Pick_OutOfBandInvitationSchema.Exclude_keyofOutOfBandInvitationSchema.appendedAttachments__", + "description": "Construct a type with the properties of T except for those in type K." + }, + "Pick_ReceiveOutOfBandInvitationConfig.Exclude_keyofReceiveOutOfBandInvitationConfig.routing__": { + "properties": { + "label": { + "type": "string" + }, + "alias": { + "type": "string" + }, + "imageUrl": { + "type": "string" + }, + "autoAcceptConnection": { + "type": "boolean" + }, + "autoAcceptInvitation": { + "type": "boolean" + }, + "reuseConnection": { + "type": "boolean" + } + }, + "type": "object", + "description": "From T, pick a set of properties whose keys are in the union K" + }, + "Omit_ReceiveOutOfBandInvitationConfig.routing_": { + "$ref": "#/components/schemas/Pick_ReceiveOutOfBandInvitationConfig.Exclude_keyofReceiveOutOfBandInvitationConfig.routing__", + "description": "Construct a type with the properties of T except for those in type K." + }, + "ReceiveInvitationProps": { + "properties": { + "label": { + "type": "string" + }, + "alias": { + "type": "string" + }, + "imageUrl": { + "type": "string" + }, + "autoAcceptConnection": { + "type": "boolean" + }, + "autoAcceptInvitation": { + "type": "boolean" + }, + "reuseConnection": { + "type": "boolean" + }, + "invitation": { + "$ref": "#/components/schemas/Omit_OutOfBandInvitationSchema.appendedAttachments_" + } + }, + "required": [ + "invitation" + ], + "type": "object", + "additionalProperties": false + }, + "ReceiveInvitationByUrlProps": { + "properties": { + "label": { + "type": "string" + }, + "alias": { + "type": "string" + }, + "imageUrl": { + "type": "string" + }, + "autoAcceptConnection": { + "type": "boolean" + }, + "autoAcceptInvitation": { + "type": "boolean" + }, + "reuseConnection": { + "type": "boolean" + }, + "invitationUrl": { + "type": "string" + } + }, + "required": [ + "invitationUrl" + ], + "type": "object", + "additionalProperties": false + }, + "AcceptInvitationConfig": { + "properties": { + "autoAcceptConnection": { + "type": "boolean" + }, + "reuseConnection": { + "type": "boolean" + }, + "label": { + "type": "string" + }, + "alias": { + "type": "string" + }, + "imageUrl": { + "type": "string" + }, + "mediatorId": { + "type": "string" + } + }, + "type": "object", + "additionalProperties": false + }, + "PresentationPreviewAttributeOptions": { + "properties": { + "name": { + "type": "string" + }, + "credentialDefinitionId": { + "type": "string" + }, + "mimeType": { + "type": "string" + }, + "value": { + "type": "string" + }, + "referent": { + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object", + "additionalProperties": false + }, + "PredicateType": { + "enum": [ + "<", + "<=", + ">", + ">=" + ], + "type": "string" + }, + "PresentationPreviewPredicateOptions": { + "properties": { + "name": { + "type": "string" + }, + "credentialDefinitionId": { + "type": "string" + }, + "predicate": { + "$ref": "#/components/schemas/PredicateType" + }, + "threshold": { + "type": "number", + "format": "double" + } + }, + "required": [ + "name", + "credentialDefinitionId", + "predicate", + "threshold" + ], + "type": "object", + "additionalProperties": false + }, + "AutoAcceptProof": { + "description": "Typing of the state for auto acceptance", + "enum": [ + "always", + "contentApproved", + "never" + ], + "type": "string" + }, + "RequestProofProposalOptions": { + "properties": { + "connectionId": { + "type": "string" + }, + "attributes": { + "items": { + "$ref": "#/components/schemas/PresentationPreviewAttributeOptions" + }, + "type": "array" + }, + "predicates": { + "items": { + "$ref": "#/components/schemas/PresentationPreviewPredicateOptions" + }, + "type": "array" + }, + "comment": { + "type": "string" + }, + "autoAcceptProof": { + "$ref": "#/components/schemas/AutoAcceptProof" + } + }, + "required": [ + "connectionId", + "attributes", + "predicates" + ], + "type": "object", + "additionalProperties": false + }, + "ProofRecord": { + "$ref": "#/components/schemas/Record_string.unknown_" + }, + "IndyRevocationInterval": { + "properties": { + "from": { + "type": "number", + "format": "double" + }, + "to": { + "type": "number", + "format": "double" + } + }, + "type": "object", + "additionalProperties": false + }, + "AttributeValue": { + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "name", + "value" + ], + "type": "object", + "additionalProperties": false + }, + "AttributeFilter": { + "properties": { + "schemaId": { + "type": "string" + }, + "schemaIssuerDid": { + "type": "string" + }, + "schemaName": { + "type": "string" + }, + "schemaVersion": { + "type": "string" + }, + "issuerDid": { + "type": "string" + }, + "credentialDefinitionId": { + "type": "string" + }, + "attributeValue": { + "$ref": "#/components/schemas/AttributeValue" + } + }, + "type": "object", + "additionalProperties": false + }, + "ProofAttributeInfo": { + "properties": { + "name": { + "type": "string" + }, + "names": { + "items": { + "type": "string" + }, + "type": "array" + }, + "nonRevoked": { + "$ref": "#/components/schemas/IndyRevocationInterval" + }, + "restrictions": { + "items": { + "$ref": "#/components/schemas/AttributeFilter" + }, + "type": "array" + } + }, + "type": "object", + "additionalProperties": false + }, + "ProofPredicateInfo": { + "properties": { + "name": { + "type": "string" + }, + "predicateType": { + "$ref": "#/components/schemas/PredicateType" + }, + "predicateValue": { + "type": "number", + "format": "double" + }, + "nonRevoked": { + "$ref": "#/components/schemas/IndyRevocationInterval" + }, + "restrictions": { + "items": { + "$ref": "#/components/schemas/AttributeFilter" + }, + "type": "array" + } + }, + "required": [ + "name", + "predicateType", + "predicateValue" + ], + "type": "object", + "additionalProperties": false + }, + "Pick_RequestProofOptions.Exclude_keyofRequestProofOptions.connectionId__": { + "properties": { + "comment": { + "type": "string" + }, + "autoAcceptProof": { + "$ref": "#/components/schemas/AutoAcceptProof" + }, + "proofRequestOptions": { + "properties": { + "requestedPredicates": { + "properties": {}, + "additionalProperties": { + "$ref": "#/components/schemas/ProofPredicateInfo" + }, + "type": "object" + }, + "requestedAttributes": { + "properties": {}, + "additionalProperties": { + "$ref": "#/components/schemas/ProofAttributeInfo" + }, + "type": "object" + }, + "version": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "version", + "name" + ], + "type": "object" + }, + "parentThreadId": { + "type": "string" + } + }, + "required": [ + "proofRequestOptions" + ], + "type": "object", + "description": "From T, pick a set of properties whose keys are in the union K" + }, + "Omit_RequestProofOptions.connectionId_": { + "$ref": "#/components/schemas/Pick_RequestProofOptions.Exclude_keyofRequestProofOptions.connectionId__", + "description": "Construct a type with the properties of T except for those in type K." + }, + "RequestProofOptions": { + "properties": { + "comment": { + "type": "string" + }, + "autoAcceptProof": { + "$ref": "#/components/schemas/AutoAcceptProof" + }, + "parentThreadId": { + "type": "string" + }, + "connectionId": { + "type": "string" + }, + "proofRequestOptions": { + "properties": { + "requestedPredicates": { + "properties": {}, + "additionalProperties": { + "$ref": "#/components/schemas/ProofPredicateInfo" + }, + "type": "object" + }, + "requestedAttributes": { + "properties": {}, + "additionalProperties": { + "$ref": "#/components/schemas/ProofAttributeInfo" + }, + "type": "object" + }, + "version": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "version", + "name" + ], + "type": "object" + } + }, + "required": [ + "connectionId", + "proofRequestOptions" + ], + "type": "object", + "additionalProperties": false + } + }, + "securitySchemes": {} + }, + "info": { + "title": "@aries-framework/rest", + "version": "0.8.1", + "description": "Rest endpoint wrapper for using your agent over HTTP", + "license": { + "name": "Apache-2.0" + }, + "contact": {} + }, + "openapi": "3.0.0", + "paths": { + "/agent": { + "get": { + "operationId": "GetAgentInfo", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AgentInfo" + } + } + } + } + }, + "description": "Retrieve basic agent information", + "tags": [ + "Agent" + ], + "security": [], + "parameters": [] + } + }, + "/basic-messages/{connectionId}": { + "get": { + "operationId": "GetBasicMessages", + "responses": { + "200": { + "description": "BasicMessageRecord[]", + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/BasicMessageRecord" + }, + "type": "array" + }, + "examples": { + "Example 1": { + "value": [ + { + "_tags": { + "role": "sender", + "connectionId": "2aecf74c-3073-4f98-9acb-92415d096834" + }, + "metadata": {}, + "id": "74bcf865-1fdc-45b4-b517-9def02dfd25f", + "createdAt": "2022-08-18T08:38:40.216Z", + "content": "string", + "sentTime": "2022-08-18T08:38:40.216Z", + "connectionId": "2aecf74c-3073-4f98-9acb-92415d096834" + } + ] + } + } + } + } + } + }, + "description": "Retrieve basic messages by connection id", + "tags": [ + "Basic Messages" + ], + "security": [], + "parameters": [ + { + "description": "Connection identifier", + "in": "path", + "name": "connectionId", + "required": true, + "schema": { + "$ref": "#/components/schemas/RecordId" + } + } + ] + }, + "post": { + "operationId": "SendMessage", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Send a basic message to a connection", + "tags": [ + "Basic Messages" + ], + "security": [], + "parameters": [ + { + "description": "Connection identifier", + "in": "path", + "name": "connectionId", + "required": true, + "schema": { + "$ref": "#/components/schemas/RecordId" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Record_content.string_" + } + } + } + } + } + }, + "/connections": { + "get": { + "operationId": "GetAllConnections", + "responses": { + "200": { + "description": "ConnectionRecord[]", + "content": { + "application/json": { + "schema": {}, + "examples": { + "Example 1": { + "value": [ + { + "_tags": { + "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", + "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", + "invitationKey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz", + "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d", + "verkey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz" + }, + "metadata": {}, + "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", + "createdAt": "2022-01-01T00:00:00.000Z", + "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", + "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", + "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d" + } + ] + } + } + } + } + } + }, + "description": "Retrieve all connections records", + "tags": [ + "Connections" + ], + "security": [], + "parameters": [ + { + "in": "query", + "name": "outOfBandId", + "required": false, + "schema": { + "type": "string" + } + }, + { + "description": "Alias", + "in": "query", + "name": "alias", + "required": false, + "schema": { + "type": "string" + } + }, + { + "description": "Connection state", + "in": "query", + "name": "state", + "required": false, + "schema": { + "type": "string" + } + }, + { + "description": "My DID", + "in": "query", + "name": "myDid", + "required": false, + "schema": { + "type": "string" + } + }, + { + "description": "Their DID", + "in": "query", + "name": "theirDid", + "required": false, + "schema": { + "type": "string" + } + }, + { + "description": "Their label", + "in": "query", + "name": "theirLabel", + "required": false, + "schema": { + "type": "string" + } + } + ] + } + }, + "/connections/{connectionId}": { + "get": { + "operationId": "GetConnectionById", + "responses": { + "200": { + "description": "ConnectionRecord", + "content": { + "application/json": { + "schema": {}, + "examples": { + "Example 1": { + "value": { + "_tags": { + "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", + "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", + "invitationKey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz", + "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d", + "verkey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz" + }, + "metadata": {}, + "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", + "createdAt": "2022-01-01T00:00:00.000Z", + "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", + "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", + "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d" + } + } + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + } + }, + "description": "Retrieve connection record by connection id", + "tags": [ + "Connections" + ], + "security": [], + "parameters": [ + { + "description": "Connection identifier", + "in": "path", + "name": "connectionId", + "required": true, + "schema": { + "$ref": "#/components/schemas/RecordId" + } + } + ] + }, + "delete": { + "operationId": "DeleteConnection", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Deletes a connection record from the connection repository.", + "tags": [ + "Connections" + ], + "security": [], + "parameters": [ + { + "description": "Connection identifier", + "in": "path", + "name": "connectionId", + "required": true, + "schema": { + "$ref": "#/components/schemas/RecordId" + } + } + ] + } + }, + "/connections/{connectionId}/accept-request": { + "post": { + "operationId": "AcceptRequest", + "responses": { + "200": { + "description": "ConnectionRecord", + "content": { + "application/json": { + "schema": {}, + "examples": { + "Example 1": { + "value": { + "_tags": { + "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", + "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", + "invitationKey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz", + "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d", + "verkey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz" + }, + "metadata": {}, + "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", + "createdAt": "2022-01-01T00:00:00.000Z", + "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", + "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", + "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d" + } + } + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Accept a connection request as inviter by sending a connection response message\nfor the connection with the specified connection id.\n\nThis is not needed when auto accepting of connection is enabled.", + "tags": [ + "Connections" + ], + "security": [], + "parameters": [ + { + "description": "Connection identifier", + "in": "path", + "name": "connectionId", + "required": true, + "schema": { + "$ref": "#/components/schemas/RecordId" + } + } + ] + } + }, + "/connections/{connectionId}/accept-response": { + "post": { + "operationId": "AcceptResponse", + "responses": { + "200": { + "description": "ConnectionRecord", + "content": { + "application/json": { + "schema": {}, + "examples": { + "Example 1": { + "value": { + "_tags": { + "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", + "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", + "invitationKey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz", + "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d", + "verkey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz" + }, + "metadata": {}, + "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", + "createdAt": "2022-01-01T00:00:00.000Z", + "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", + "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", + "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d" + } + } + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Accept a connection response as invitee by sending a trust ping message\nfor the connection with the specified connection id.\n\nThis is not needed when auto accepting of connection is enabled.", + "tags": [ + "Connections" + ], + "security": [], + "parameters": [ + { + "description": "Connection identifier", + "in": "path", + "name": "connectionId", + "required": true, + "schema": { + "$ref": "#/components/schemas/RecordId" + } + } + ] + } + }, + "/credentials": { + "get": { + "operationId": "GetAllCredentials", + "responses": { + "200": { + "description": "CredentialExchangeRecord[]", + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/Record_string.any_" + }, + "type": "array" + }, + "examples": { + "Example 1": { + "value": [ + { + "_tags": { + "state": "offer-sent", + "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", + "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b" + }, + "metadata": { + "_internal/indyCredential": { + "credentialDefinitionId": "q7ATwTYbQDgiigVijUAej:3:CL:318187:latest", + "schemaId": "q7ATwTYbQDgiigVijUAej:2:Employee Badge:1.0" + } + }, + "credentials": [], + "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", + "createdAt": "2022-01-01T00:00:00.000Z", + "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b", + "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", + "credentialAttributes": [], + "protocolVersion": "v1" + } + ] + } + } + } + } + } + }, + "description": "Retrieve all credential exchange records", + "tags": [ + "Credentials" + ], + "security": [], + "parameters": [] + } + }, + "/credentials/{credentialRecordId}": { + "get": { + "operationId": "GetCredentialById", + "responses": { + "200": { + "description": "CredentialExchangeRecord", + "content": { + "application/json": { + "schema": {}, + "examples": { + "Example 1": { + "value": { + "_tags": { + "state": "offer-sent", + "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", + "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b" + }, + "metadata": { + "_internal/indyCredential": { + "credentialDefinitionId": "q7ATwTYbQDgiigVijUAej:3:CL:318187:latest", + "schemaId": "q7ATwTYbQDgiigVijUAej:2:Employee Badge:1.0" + } + }, + "credentials": [], + "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", + "createdAt": "2022-01-01T00:00:00.000Z", + "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b", + "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", + "credentialAttributes": [], + "protocolVersion": "v1" + } + } + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Retrieve credential exchange record by credential record id", + "tags": [ + "Credentials" + ], + "security": [], + "parameters": [ + { + "in": "path", + "name": "credentialRecordId", + "required": true, + "schema": { + "$ref": "#/components/schemas/RecordId" + } + } + ] + }, + "delete": { + "operationId": "DeleteCredential", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Deletes a credential exchange record in the credential repository.", + "tags": [ + "Credentials" + ], + "security": [], + "parameters": [ + { + "in": "path", + "name": "credentialRecordId", + "required": true, + "schema": { + "$ref": "#/components/schemas/RecordId" + } + } + ] + } + }, + "/credentials/propose-credential": { + "post": { + "operationId": "ProposeCredential", + "responses": { + "200": { + "description": "CredentialExchangeRecord", + "content": { + "application/json": { + "schema": {}, + "examples": { + "Example 1": { + "value": { + "_tags": { + "state": "offer-sent", + "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", + "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b" + }, + "metadata": { + "_internal/indyCredential": { + "credentialDefinitionId": "q7ATwTYbQDgiigVijUAej:3:CL:318187:latest", + "schemaId": "q7ATwTYbQDgiigVijUAej:2:Employee Badge:1.0" + } + }, + "credentials": [], + "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", + "createdAt": "2022-01-01T00:00:00.000Z", + "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b", + "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", + "credentialAttributes": [], + "protocolVersion": "v1" + } + } + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Initiate a new credential exchange as holder by sending a propose credential message\nto the connection with a specified connection id.", + "tags": [ + "Credentials" + ], + "security": [], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProposeCredentialOptions" + } + } + } + } + } + }, + "/credentials/{credentialRecordId}/accept-proposal": { + "post": { + "operationId": "AcceptProposal", + "responses": { + "200": { + "description": "CredentialExchangeRecord", + "content": { + "application/json": { + "schema": {}, + "examples": { + "Example 1": { + "value": { + "_tags": { + "state": "offer-sent", + "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", + "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b" + }, + "metadata": { + "_internal/indyCredential": { + "credentialDefinitionId": "q7ATwTYbQDgiigVijUAej:3:CL:318187:latest", + "schemaId": "q7ATwTYbQDgiigVijUAej:2:Employee Badge:1.0" + } + }, + "credentials": [], + "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", + "createdAt": "2022-01-01T00:00:00.000Z", + "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b", + "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", + "credentialAttributes": [], + "protocolVersion": "v1" + } + } + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Accept a credential proposal as issuer by sending an accept proposal message\nto the connection associated with the credential exchange record.", + "tags": [ + "Credentials" + ], + "security": [], + "parameters": [ + { + "description": "credential identifier", + "in": "path", + "name": "credentialRecordId", + "required": true, + "schema": { + "$ref": "#/components/schemas/RecordId" + } + } + ], + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AcceptCredentialProposalOptions" + } + } + } + } + } + }, + "/credentials/offer-credential": { + "post": { + "operationId": "OfferCredential", + "responses": { + "200": { + "description": "CredentialExchangeRecord", + "content": { + "application/json": { + "schema": {}, + "examples": { + "Example 1": { + "value": { + "_tags": { + "state": "offer-sent", + "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", + "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b" + }, + "metadata": { + "_internal/indyCredential": { + "credentialDefinitionId": "q7ATwTYbQDgiigVijUAej:3:CL:318187:latest", + "schemaId": "q7ATwTYbQDgiigVijUAej:2:Employee Badge:1.0" + } + }, + "credentials": [], + "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", + "createdAt": "2022-01-01T00:00:00.000Z", + "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b", + "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", + "credentialAttributes": [], + "protocolVersion": "v1" + } + } + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Initiate a new credential exchange as issuer by sending a offer credential message\nto the connection with the specified connection id.", + "tags": [ + "Credentials" + ], + "security": [], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OfferCredentialOptions" + } + } + } + } + } + }, + "/credentials/{credentialRecordId}/accept-offer": { + "post": { + "operationId": "AcceptOffer", + "responses": { + "200": { + "description": "CredentialExchangeRecord", + "content": { + "application/json": { + "schema": {}, + "examples": { + "Example 1": { + "value": { + "_tags": { + "state": "offer-sent", + "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", + "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b" + }, + "metadata": { + "_internal/indyCredential": { + "credentialDefinitionId": "q7ATwTYbQDgiigVijUAej:3:CL:318187:latest", + "schemaId": "q7ATwTYbQDgiigVijUAej:2:Employee Badge:1.0" + } + }, + "credentials": [], + "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", + "createdAt": "2022-01-01T00:00:00.000Z", + "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b", + "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", + "credentialAttributes": [], + "protocolVersion": "v1" + } + } + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Accept a credential offer as holder by sending an accept offer message\nto the connection associated with the credential exchange record.", + "tags": [ + "Credentials" + ], + "security": [], + "parameters": [ + { + "description": "credential identifier", + "in": "path", + "name": "credentialRecordId", + "required": true, + "schema": { + "$ref": "#/components/schemas/RecordId" + } + } + ], + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AcceptCredentialOfferOptions" + } + } + } + } + } + }, + "/credentials/{credentialRecordId}/accept-request": { + "post": { + "operationId": "AcceptRequest", + "responses": { + "200": { + "description": "CredentialExchangeRecord", + "content": { + "application/json": { + "schema": {}, + "examples": { + "Example 1": { + "value": { + "_tags": { + "state": "offer-sent", + "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", + "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b" + }, + "metadata": { + "_internal/indyCredential": { + "credentialDefinitionId": "q7ATwTYbQDgiigVijUAej:3:CL:318187:latest", + "schemaId": "q7ATwTYbQDgiigVijUAej:2:Employee Badge:1.0" + } + }, + "credentials": [], + "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", + "createdAt": "2022-01-01T00:00:00.000Z", + "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b", + "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", + "credentialAttributes": [], + "protocolVersion": "v1" + } + } + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Accept a credential request as issuer by sending an accept request message\nto the connection associated with the credential exchange record.", + "tags": [ + "Credentials" + ], + "security": [], + "parameters": [ + { + "description": "credential identifier", + "in": "path", + "name": "credentialRecordId", + "required": true, + "schema": { + "$ref": "#/components/schemas/RecordId" + } + } + ], + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AcceptCredentialRequestOptions" + } + } + } + } + } + }, + "/credentials/{credentialRecordId}/accept-credential": { + "post": { + "operationId": "AcceptCredential", + "responses": { + "200": { + "description": "CredentialExchangeRecord", + "content": { + "application/json": { + "schema": {}, + "examples": { + "Example 1": { + "value": { + "_tags": { + "state": "offer-sent", + "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", + "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b" + }, + "metadata": { + "_internal/indyCredential": { + "credentialDefinitionId": "q7ATwTYbQDgiigVijUAej:3:CL:318187:latest", + "schemaId": "q7ATwTYbQDgiigVijUAej:2:Employee Badge:1.0" + } + }, + "credentials": [], + "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", + "createdAt": "2022-01-01T00:00:00.000Z", + "connectionId": "ac6d0fdd-0db8-4f52-8a3d-de7ff8ddc14b", + "threadId": "82701488-b43c-4d7b-9244-4bb204a7ae26", + "credentialAttributes": [], + "protocolVersion": "v1" + } + } + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Accept a credential as holder by sending an accept credential message\nto the connection associated with the credential exchange record.", + "tags": [ + "Credentials" + ], + "security": [], + "parameters": [ + { + "in": "path", + "name": "credentialRecordId", + "required": true, + "schema": { + "$ref": "#/components/schemas/RecordId" + } + } + ] + } + }, + "/credential-definitions/{credentialDefinitionId}": { + "get": { + "operationId": "GetCredentialDefinitionById", + "responses": { + "200": { + "description": "CredDef", + "content": { + "application/json": { + "schema": {}, + "examples": { + "Example 1": { + "value": { + "ver": "1.0", + "id": "WgWxqztrNooG92RXvxSTWv:3:CL:20:tag", + "schemaId": "351936", + "type": "CL", + "tag": "definition", + "value": { + "primary": { + "n": "string", + "s": "string", + "r": { + "master_secret": "string", + "string": "string" + }, + "rctxt": "string", + "z": "string" + }, + "revocation": { + "g": "1 string", + "g_dash": "string", + "h": "string", + "h0": "string", + "h1": "string", + "h2": "string", + "htilde": "string", + "h_cap": "string", + "u": "string", + "pk": "string", + "y": "string" + } + } + } + } + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Retrieve credential definition by credential definition id", + "tags": [ + "Credential Definitions" + ], + "security": [], + "parameters": [ + { + "in": "path", + "name": "credentialDefinitionId", + "required": true, + "schema": { + "$ref": "#/components/schemas/CredentialDefinitionId" + } + } + ] + } + }, + "/credential-definitions": { + "post": { + "operationId": "CreateCredentialDefinition", + "responses": { + "200": { + "description": "CredDef", + "content": { + "application/json": { + "schema": {}, + "examples": { + "Example 1": { + "value": { + "ver": "1.0", + "id": "WgWxqztrNooG92RXvxSTWv:3:CL:20:tag", + "schemaId": "351936", + "type": "CL", + "tag": "definition", + "value": { + "primary": { + "n": "string", + "s": "string", + "r": { + "master_secret": "string", + "string": "string" + }, + "rctxt": "string", + "z": "string" + }, + "revocation": { + "g": "1 string", + "g_dash": "string", + "h": "string", + "h0": "string", + "h1": "string", + "h2": "string", + "htilde": "string", + "h_cap": "string", + "u": "string", + "pk": "string", + "y": "string" + } + } + } + } + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Creates a new credential definition.", + "tags": [ + "Credential Definitions" + ], + "security": [], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "tag": { + "type": "string" + }, + "supportRevocation": { + "type": "boolean" + }, + "schemaId": { + "$ref": "#/components/schemas/SchemaId" + } + }, + "required": [ + "tag", + "supportRevocation", + "schemaId" + ], + "type": "object" + } + } + } + } + } + }, + "/schemas/{schemaId}": { + "get": { + "operationId": "GetSchemaById", + "responses": { + "200": { + "description": "Schema", + "content": { + "application/json": { + "schema": {}, + "examples": { + "Example 1": { + "value": { + "ver": "1.0", + "id": "WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0", + "name": "schema", + "version": "1.0", + "attrNames": [ + "string" + ], + "seqNo": 351936 + } + } + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Retrieve schema by schema id", + "tags": [ + "Schemas" + ], + "security": [], + "parameters": [ + { + "in": "path", + "name": "schemaId", + "required": true, + "schema": { + "$ref": "#/components/schemas/SchemaId" + } + } + ] + } + }, + "/schemas": { + "post": { + "operationId": "CreateSchema", + "responses": { + "200": { + "description": "schema", + "content": { + "application/json": { + "schema": {}, + "examples": { + "Example 1": { + "value": { + "ver": "1.0", + "id": "WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0", + "name": "schema", + "version": "1.0", + "attrNames": [ + "string" + ], + "seqNo": 351936 + } + } + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Creates a new schema and registers schema on ledger", + "tags": [ + "Schemas" + ], + "security": [], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "attributes": { + "items": { + "type": "string" + }, + "type": "array" + }, + "version": { + "$ref": "#/components/schemas/Version" + }, + "name": { + "type": "string" + } + }, + "required": [ + "attributes", + "version", + "name" + ], + "type": "object" + } + } + } + } + } + }, + "/oob": { + "get": { + "operationId": "GetAllOutOfBandRecords", + "responses": { + "200": { + "description": "OutOfBandRecord[]", + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/Record_string.any_" + }, + "type": "array" + }, + "examples": { + "Example 1": { + "value": [ + { + "_tags": { + "invitationId": "1cbd22e4-1906-41e9-8807-83d84437f978", + "state": "await-response", + "role": "sender", + "recipientKeyFingerprints": [ + "z6MktUCPZjfRJXD4GMcYuXiqX2qZ8vBw6UAYpDFiHEUfwuLj" + ] + }, + "outOfBandInvitation": { + "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/invitation", + "@id": "d6472943-e5d0-4d95-8b48-790ed5a41931", + "label": "Aries Test Agent", + "accept": [ + "didcomm/aip1", + "didcomm/aip2;env=rfc19" + ], + "handshake_protocols": [ + "https://didcomm.org/didexchange/1.0", + "https://didcomm.org/connections/1.0" + ], + "services": [ + { + "id": "#inline-0", + "serviceEndpoint": "https://6b77-89-20-162-146.ngrok.io", + "type": "did-communication", + "recipientKeys": [ + "did:key:z6MkmTBHTWrvLPN8pBmUj7Ye5ww9GiacXCYMNVvpScSpf1DM" + ], + "routingKeys": [] + } + ] + }, + "metadata": {}, + "id": "42a95528-0e30-4f86-a462-0efb02178b53", + "createdAt": "2022-01-01T00:00:00.000Z", + "reusable": false + } + ] + } + } + } + } + } + }, + "description": "Retrieve all out of band records", + "tags": [ + "Out Of Band" + ], + "security": [], + "parameters": [ + { + "description": "invitation identifier", + "in": "query", + "name": "invitationId", + "required": false, + "schema": { + "$ref": "#/components/schemas/RecordId" + } + } + ] + } + }, + "/oob/{outOfBandId}": { + "get": { + "operationId": "GetOutOfBandRecordById", + "responses": { + "200": { + "description": "OutOfBandRecord", + "content": { + "application/json": { + "schema": {}, + "examples": { + "Example 1": { + "value": { + "_tags": { + "invitationId": "1cbd22e4-1906-41e9-8807-83d84437f978", + "state": "await-response", + "role": "sender", + "recipientKeyFingerprints": [ + "z6MktUCPZjfRJXD4GMcYuXiqX2qZ8vBw6UAYpDFiHEUfwuLj" + ] + }, + "outOfBandInvitation": { + "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/invitation", + "@id": "d6472943-e5d0-4d95-8b48-790ed5a41931", + "label": "Aries Test Agent", + "accept": [ + "didcomm/aip1", + "didcomm/aip2;env=rfc19" + ], + "handshake_protocols": [ + "https://didcomm.org/didexchange/1.0", + "https://didcomm.org/connections/1.0" + ], + "services": [ + { + "id": "#inline-0", + "serviceEndpoint": "https://6b77-89-20-162-146.ngrok.io", + "type": "did-communication", + "recipientKeys": [ + "did:key:z6MkmTBHTWrvLPN8pBmUj7Ye5ww9GiacXCYMNVvpScSpf1DM" + ], + "routingKeys": [] + } + ] + }, + "metadata": {}, + "id": "42a95528-0e30-4f86-a462-0efb02178b53", + "createdAt": "2022-01-01T00:00:00.000Z", + "reusable": false + } + } + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + } + }, + "description": "Retrieve an out of band record by id", + "tags": [ + "Out Of Band" + ], + "security": [], + "parameters": [ + { + "in": "path", + "name": "outOfBandId", + "required": true, + "schema": { + "$ref": "#/components/schemas/RecordId" + } + } + ] + }, + "delete": { + "operationId": "DeleteOutOfBandRecord", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Deletes an out of band record from the repository.", + "tags": [ + "Out Of Band" + ], + "security": [], + "parameters": [ + { + "description": "Record identifier", + "in": "path", + "name": "outOfBandId", + "required": true, + "schema": { + "$ref": "#/components/schemas/RecordId" + } + } + ] + } + }, + "/oob/create-invitation": { + "post": { + "operationId": "CreateInvitation", + "responses": { + "200": { + "description": "Out of band record", + "content": { + "application/json": { + "schema": {}, + "examples": { + "Example 1": { + "value": { + "invitationUrl": "string", + "invitation": { + "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/invitation", + "@id": "d6472943-e5d0-4d95-8b48-790ed5a41931", + "label": "Aries Test Agent", + "accept": [ + "didcomm/aip1", + "didcomm/aip2;env=rfc19" + ], + "handshake_protocols": [ + "https://didcomm.org/didexchange/1.0", + "https://didcomm.org/connections/1.0" + ], + "services": [ + { + "id": "#inline-0", + "serviceEndpoint": "https://6b77-89-20-162-146.ngrok.io", + "type": "did-communication", + "recipientKeys": [ + "did:key:z6MkmTBHTWrvLPN8pBmUj7Ye5ww9GiacXCYMNVvpScSpf1DM" + ], + "routingKeys": [] + } + ] + }, + "outOfBandRecord": { + "_tags": { + "invitationId": "1cbd22e4-1906-41e9-8807-83d84437f978", + "state": "await-response", + "role": "sender", + "recipientKeyFingerprints": [ + "z6MktUCPZjfRJXD4GMcYuXiqX2qZ8vBw6UAYpDFiHEUfwuLj" + ] + }, + "outOfBandInvitation": { + "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/invitation", + "@id": "d6472943-e5d0-4d95-8b48-790ed5a41931", + "label": "Aries Test Agent", + "accept": [ + "didcomm/aip1", + "didcomm/aip2;env=rfc19" + ], + "handshake_protocols": [ + "https://didcomm.org/didexchange/1.0", + "https://didcomm.org/connections/1.0" + ], + "services": [ + { + "id": "#inline-0", + "serviceEndpoint": "https://6b77-89-20-162-146.ngrok.io", + "type": "did-communication", + "recipientKeys": [ + "did:key:z6MkmTBHTWrvLPN8pBmUj7Ye5ww9GiacXCYMNVvpScSpf1DM" + ], + "routingKeys": [] + } + ] + }, + "metadata": {}, + "id": "42a95528-0e30-4f86-a462-0efb02178b53", + "createdAt": "2022-01-01T00:00:00.000Z", + "reusable": false + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Creates an outbound out-of-band record containing out-of-band invitation message defined in\nAries RFC 0434: Out-of-Band Protocol 1.1.", + "tags": [ + "Out Of Band" + ], + "security": [], + "parameters": [], + "requestBody": { + "description": "configuration of how out-of-band invitation should be created", + "required": false, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Omit_CreateOutOfBandInvitationConfig.routing-or-appendedAttachments-or-messages_", + "description": "configuration of how out-of-band invitation should be created" + } + } + } + } + } + }, + "/oob/create-legacy-invitation": { + "post": { + "operationId": "CreateLegacyInvitation", + "responses": { + "200": { + "description": "out-of-band record and invitation", + "content": { + "application/json": { + "schema": {}, + "examples": { + "Example 1": { + "value": { + "invitation": { + "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/invitation", + "@id": "d6472943-e5d0-4d95-8b48-790ed5a41931", + "label": "Aries Test Agent", + "accept": [ + "didcomm/aip1", + "didcomm/aip2;env=rfc19" + ], + "handshake_protocols": [ + "https://didcomm.org/didexchange/1.0", + "https://didcomm.org/connections/1.0" + ], + "services": [ + { + "id": "#inline-0", + "serviceEndpoint": "https://6b77-89-20-162-146.ngrok.io", + "type": "did-communication", + "recipientKeys": [ + "did:key:z6MkmTBHTWrvLPN8pBmUj7Ye5ww9GiacXCYMNVvpScSpf1DM" + ], + "routingKeys": [] + } + ] + }, + "outOfBandRecord": { + "_tags": { + "invitationId": "1cbd22e4-1906-41e9-8807-83d84437f978", + "state": "await-response", + "role": "sender", + "recipientKeyFingerprints": [ + "z6MktUCPZjfRJXD4GMcYuXiqX2qZ8vBw6UAYpDFiHEUfwuLj" + ] + }, + "outOfBandInvitation": { + "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/invitation", + "@id": "d6472943-e5d0-4d95-8b48-790ed5a41931", + "label": "Aries Test Agent", + "accept": [ + "didcomm/aip1", + "didcomm/aip2;env=rfc19" + ], + "handshake_protocols": [ + "https://didcomm.org/didexchange/1.0", + "https://didcomm.org/connections/1.0" + ], + "services": [ + { + "id": "#inline-0", + "serviceEndpoint": "https://6b77-89-20-162-146.ngrok.io", + "type": "did-communication", + "recipientKeys": [ + "did:key:z6MkmTBHTWrvLPN8pBmUj7Ye5ww9GiacXCYMNVvpScSpf1DM" + ], + "routingKeys": [] + } + ] + }, + "metadata": {}, + "id": "42a95528-0e30-4f86-a462-0efb02178b53", + "createdAt": "2022-01-01T00:00:00.000Z", + "reusable": false + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Creates an outbound out-of-band record in the same way how `createInvitation` method does it,\nbut it also converts out-of-band invitation message to an \"legacy\" invitation message defined\nin RFC 0160: Connection Protocol and returns it together with out-of-band record.", + "tags": [ + "Out Of Band" + ], + "security": [], + "parameters": [], + "requestBody": { + "description": "configuration of how a invitation should be created", + "required": false, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Omit_CreateLegacyInvitationConfig.routing_", + "description": "configuration of how a invitation should be created" + } + } + } + } + } + }, + "/oob/create-legacy-connectionless-invitation": { + "post": { + "operationId": "CreateLegacyConnectionlessInvitation", + "responses": { + "200": { + "description": "a message and a invitationUrl", + "content": { + "application/json": { + "schema": {}, + "examples": { + "Example 1": { + "value": { + "message": { + "@id": "eac4ff4e-b4fb-4c1d-aef3-b29c89d1cc00", + "@type": "https://didcomm.org/connections/1.0/invitation" + }, + "invitationUrl": "http://example.com/invitation_url" + } + } + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Creates a new connectionless legacy invitation.", + "tags": [ + "Out Of Band" + ], + "security": [], + "parameters": [], + "requestBody": { + "description": "configuration of how a connection invitation should be created", + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "domain": { + "type": "string" + }, + "message": { + "$ref": "#/components/schemas/AgentMessageType" + }, + "recordId": { + "type": "string" + } + }, + "required": [ + "domain", + "message", + "recordId" + ], + "type": "object", + "description": "configuration of how a connection invitation should be created" + } + } + } + } + } + }, + "/oob/receive-invitation": { + "post": { + "operationId": "ReceiveInvitation", + "responses": { + "200": { + "description": "out-of-band record and connection record if one has been created.", + "content": { + "application/json": { + "schema": {}, + "examples": { + "Example 1": { + "value": { + "outOfBandRecord": { + "_tags": { + "invitationId": "1cbd22e4-1906-41e9-8807-83d84437f978", + "state": "await-response", + "role": "sender", + "recipientKeyFingerprints": [ + "z6MktUCPZjfRJXD4GMcYuXiqX2qZ8vBw6UAYpDFiHEUfwuLj" + ] + }, + "outOfBandInvitation": { + "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/invitation", + "@id": "d6472943-e5d0-4d95-8b48-790ed5a41931", + "label": "Aries Test Agent", + "accept": [ + "didcomm/aip1", + "didcomm/aip2;env=rfc19" + ], + "handshake_protocols": [ + "https://didcomm.org/didexchange/1.0", + "https://didcomm.org/connections/1.0" + ], + "services": [ + { + "id": "#inline-0", + "serviceEndpoint": "https://6b77-89-20-162-146.ngrok.io", + "type": "did-communication", + "recipientKeys": [ + "did:key:z6MkmTBHTWrvLPN8pBmUj7Ye5ww9GiacXCYMNVvpScSpf1DM" + ], + "routingKeys": [] + } + ] + }, + "metadata": {}, + "id": "42a95528-0e30-4f86-a462-0efb02178b53", + "createdAt": "2022-01-01T00:00:00.000Z", + "reusable": false + }, + "connectionRecord": { + "_tags": { + "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", + "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", + "invitationKey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz", + "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d", + "verkey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz" + }, + "metadata": {}, + "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", + "createdAt": "2022-01-01T00:00:00.000Z", + "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", + "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", + "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d" + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Creates inbound out-of-band record and assigns out-of-band invitation message to it if the\nmessage is valid.", + "tags": [ + "Out Of Band" + ], + "security": [], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReceiveInvitationProps" + } + } + } + } + } + }, + "/oob/receive-invitation-url": { + "post": { + "operationId": "ReceiveInvitationFromUrl", + "responses": { + "200": { + "description": "out-of-band record and connection record if one has been created.", + "content": { + "application/json": { + "schema": {}, + "examples": { + "Example 1": { + "value": { + "outOfBandRecord": { + "_tags": { + "invitationId": "1cbd22e4-1906-41e9-8807-83d84437f978", + "state": "await-response", + "role": "sender", + "recipientKeyFingerprints": [ + "z6MktUCPZjfRJXD4GMcYuXiqX2qZ8vBw6UAYpDFiHEUfwuLj" + ] + }, + "outOfBandInvitation": { + "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/invitation", + "@id": "d6472943-e5d0-4d95-8b48-790ed5a41931", + "label": "Aries Test Agent", + "accept": [ + "didcomm/aip1", + "didcomm/aip2;env=rfc19" + ], + "handshake_protocols": [ + "https://didcomm.org/didexchange/1.0", + "https://didcomm.org/connections/1.0" + ], + "services": [ + { + "id": "#inline-0", + "serviceEndpoint": "https://6b77-89-20-162-146.ngrok.io", + "type": "did-communication", + "recipientKeys": [ + "did:key:z6MkmTBHTWrvLPN8pBmUj7Ye5ww9GiacXCYMNVvpScSpf1DM" + ], + "routingKeys": [] + } + ] + }, + "metadata": {}, + "id": "42a95528-0e30-4f86-a462-0efb02178b53", + "createdAt": "2022-01-01T00:00:00.000Z", + "reusable": false + }, + "connectionRecord": { + "_tags": { + "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", + "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", + "invitationKey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz", + "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d", + "verkey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz" + }, + "metadata": {}, + "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", + "createdAt": "2022-01-01T00:00:00.000Z", + "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", + "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", + "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d" + } + } + } + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Creates inbound out-of-band record and assigns out-of-band invitation message to it if the\nmessage is valid.", + "tags": [ + "Out Of Band" + ], + "security": [], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReceiveInvitationByUrlProps" + } + } + } + } + } + }, + "/oob/{outOfBandId}/accept-invitation": { + "post": { + "operationId": "AcceptInvitation", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {}, + "examples": { + "Example 1": { + "value": { + "outOfBandRecord": { + "_tags": { + "invitationId": "1cbd22e4-1906-41e9-8807-83d84437f978", + "state": "await-response", + "role": "sender", + "recipientKeyFingerprints": [ + "z6MktUCPZjfRJXD4GMcYuXiqX2qZ8vBw6UAYpDFiHEUfwuLj" + ] + }, + "outOfBandInvitation": { + "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/invitation", + "@id": "d6472943-e5d0-4d95-8b48-790ed5a41931", + "label": "Aries Test Agent", + "accept": [ + "didcomm/aip1", + "didcomm/aip2;env=rfc19" + ], + "handshake_protocols": [ + "https://didcomm.org/didexchange/1.0", + "https://didcomm.org/connections/1.0" + ], + "services": [ + { + "id": "#inline-0", + "serviceEndpoint": "https://6b77-89-20-162-146.ngrok.io", + "type": "did-communication", + "recipientKeys": [ + "did:key:z6MkmTBHTWrvLPN8pBmUj7Ye5ww9GiacXCYMNVvpScSpf1DM" + ], + "routingKeys": [] + } + ] + }, + "metadata": {}, + "id": "42a95528-0e30-4f86-a462-0efb02178b53", + "createdAt": "2022-01-01T00:00:00.000Z", + "reusable": false + }, + "connectionRecord": { + "_tags": { + "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", + "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", + "invitationKey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz", + "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d", + "verkey": "9HG4rJFpLiWf56MWxHj9rgdpErFzim2zEpHuxy1dw7oz" + }, + "metadata": {}, + "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", + "createdAt": "2022-01-01T00:00:00.000Z", + "did": "did:peer:1zQmfQh1T3rSqarP2FZ37uKjdQHPKFdVyo2mGiAPHZ8Ep7hv", + "invitationDid": "did:peer:2.SeyJzIjoiaHR0cHM6Ly9kYTIzLTg5LTIwLTE2Mi0xNDYubmdyb2suaW8iLCJ0IjoiZGlkLWNvbW11bmljYXRpb24iLCJwcmlvcml0eSI6MCwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtualg3U1lXRmdHMThCYkNEZHJnemhuQnA0UlhyOGVITHZxQ3FvRXllckxiTiN6Nk1rbmpYN1NZV0ZnRzE4QmJDRGRyZ3pobkJwNFJYcjhlSEx2cUNxb0V5ZXJMYk4iXSwiciI6W119", + "outOfBandId": "edbc89fe-785f-4774-a288-46012486881d" + } + } + } + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Accept a connection invitation as invitee (by sending a connection request message) for the connection with the specified connection id.\nThis is not needed when auto accepting of connections is enabled.", + "tags": [ + "Out Of Band" + ], + "security": [], + "parameters": [ + { + "in": "path", + "name": "outOfBandId", + "required": true, + "schema": { + "$ref": "#/components/schemas/RecordId" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AcceptInvitationConfig" + } + } + } + } + } + }, + "/proofs": { + "get": { + "operationId": "GetAllProofs", + "responses": { + "200": { + "description": "ProofRecord[]", + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/Record_string.any_" + }, + "type": "array" + }, + "examples": { + "Example 1": { + "value": [ + { + "metadata": {}, + "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", + "createdAt": "2022-01-01T00:00:00.000Z", + "connectionId": "2aecf74c-3073-4f98-9acb-92415d096834", + "threadId": "0019d466-5eea-4269-8c40-031b4896c5b7" + } + ] + } + } + } + } + } + }, + "description": "Retrieve all proof records", + "tags": [ + "Proofs" + ], + "security": [], + "parameters": [ + { + "in": "query", + "name": "threadId", + "required": false, + "schema": { + "type": "string" + } + } + ] + } + }, + "/proofs/{proofRecordId}": { + "get": { + "operationId": "GetProofById", + "responses": { + "200": { + "description": "ProofRecord", + "content": { + "application/json": { + "schema": {}, + "examples": { + "Example 1": { + "value": { + "metadata": {}, + "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", + "createdAt": "2022-01-01T00:00:00.000Z", + "connectionId": "2aecf74c-3073-4f98-9acb-92415d096834", + "threadId": "0019d466-5eea-4269-8c40-031b4896c5b7" + } + } + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Retrieve proof record by proof record id", + "tags": [ + "Proofs" + ], + "security": [], + "parameters": [ + { + "in": "path", + "name": "proofRecordId", + "required": true, + "schema": { + "$ref": "#/components/schemas/RecordId" + } + } + ] + }, + "delete": { + "operationId": "DeleteProof", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": {} + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Deletes a proof record in the proof repository.", + "tags": [ + "Proofs" + ], + "security": [], + "parameters": [ + { + "in": "path", + "name": "proofRecordId", + "required": true, + "schema": { + "$ref": "#/components/schemas/RecordId" + } + } + ] + } + }, + "/proofs/propose-proof": { + "post": { + "operationId": "ProposeProof", + "responses": { + "200": { + "description": "ProofRecord", + "content": { + "application/json": { + "schema": {}, + "examples": { + "Example 1": { + "value": { + "metadata": {}, + "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", + "createdAt": "2022-01-01T00:00:00.000Z", + "connectionId": "2aecf74c-3073-4f98-9acb-92415d096834", + "threadId": "0019d466-5eea-4269-8c40-031b4896c5b7" + } + } + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Initiate a new presentation exchange as prover by sending a presentation proposal request\nto the connection with the specified connection id.", + "tags": [ + "Proofs" + ], + "security": [], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RequestProofProposalOptions" + } + } + } + } + } + }, + "/proofs/{proofRecordId}/accept-proposal": { + "post": { + "operationId": "AcceptProposal", + "responses": { + "200": { + "description": "ProofRecord", + "content": { + "application/json": { + "schema": {}, + "examples": { + "Example 1": { + "value": { + "metadata": {}, + "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", + "createdAt": "2022-01-01T00:00:00.000Z", + "connectionId": "2aecf74c-3073-4f98-9acb-92415d096834", + "threadId": "0019d466-5eea-4269-8c40-031b4896c5b7" + } + } + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Accept a presentation proposal as verifier by sending an accept proposal message\nto the connection associated with the proof record.", + "tags": [ + "Proofs" + ], + "security": [], + "parameters": [ + { + "in": "path", + "name": "proofRecordId", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "comment": { + "type": "string" + }, + "request": { + "properties": { + "nonce": { + "type": "string" + }, + "version": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "type": "object" + } + }, + "required": [ + "request" + ], + "type": "object" + } + } + } + } + } + }, + "/proofs/request-outofband-proof": { + "post": { + "operationId": "RequestProofOutOfBand", + "responses": { + "200": { + "description": "ProofRequestMessageResponse", + "content": { + "application/json": { + "schema": { + "properties": { + "proofRecord": { + "$ref": "#/components/schemas/ProofRecord" + }, + "proofUrl": { + "type": "string" + } + }, + "required": [ + "proofRecord", + "proofUrl" + ], + "type": "object" + }, + "examples": { + "Example 1": { + "value": { + "proofUrl": "https://example.com/proof-url", + "proofRecord": { + "metadata": {}, + "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", + "createdAt": "2022-01-01T00:00:00.000Z", + "connectionId": "2aecf74c-3073-4f98-9acb-92415d096834", + "threadId": "0019d466-5eea-4269-8c40-031b4896c5b7" + } + } + } + } + } + } + } + }, + "description": "Creates a presentation request not bound to any proposal or existing connection", + "tags": [ + "Proofs" + ], + "security": [], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Omit_RequestProofOptions.connectionId_" + } + } + } + } + } + }, + "/proofs/request-proof": { + "post": { + "operationId": "RequestProof", + "responses": { + "200": { + "description": "ProofRecord", + "content": { + "application/json": { + "schema": {}, + "examples": { + "Example 1": { + "value": { + "metadata": {}, + "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", + "createdAt": "2022-01-01T00:00:00.000Z", + "connectionId": "2aecf74c-3073-4f98-9acb-92415d096834", + "threadId": "0019d466-5eea-4269-8c40-031b4896c5b7" + } + } + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Creates a presentation request bound to existing connection", + "tags": [ + "Proofs" + ], + "security": [], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RequestProofOptions" + } + } + } + } + } + }, + "/proofs/{proofRecordId}/accept-request": { + "post": { + "operationId": "AcceptRequest", + "responses": { + "200": { + "description": "ProofRecord", + "content": { + "application/json": { + "schema": {}, + "examples": { + "Example 1": { + "value": { + "metadata": {}, + "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", + "createdAt": "2022-01-01T00:00:00.000Z", + "connectionId": "2aecf74c-3073-4f98-9acb-92415d096834", + "threadId": "0019d466-5eea-4269-8c40-031b4896c5b7" + } + } + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Accept a presentation request as prover by sending an accept request message\nto the connection associated with the proof record.", + "tags": [ + "Proofs" + ], + "security": [], + "parameters": [ + { + "in": "path", + "name": "proofRecordId", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "comment": { + "type": "string" + }, + "filterByPresentationPreview": { + "type": "boolean" + } + }, + "required": [ + "comment", + "filterByPresentationPreview" + ], + "type": "object" + } + } + } + } + } + }, + "/proofs/{proofRecordId}/accept-presentation": { + "post": { + "operationId": "AcceptPresentation", + "responses": { + "200": { + "description": "ProofRecord", + "content": { + "application/json": { + "schema": {}, + "examples": { + "Example 1": { + "value": { + "metadata": {}, + "id": "821f9b26-ad04-4f56-89b6-e2ef9c72b36e", + "createdAt": "2022-01-01T00:00:00.000Z", + "connectionId": "2aecf74c-3073-4f98-9acb-92415d096834", + "threadId": "0019d466-5eea-4269-8c40-031b4896c5b7" + } + } + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "reason": { + "type": "string" + } + }, + "required": [ + "reason" + ], + "type": "object" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "description": "Accept a presentation as prover by sending an accept presentation message\nto the connection associated with the proof record.", + "tags": [ + "Proofs" + ], + "security": [], + "parameters": [ + { + "in": "path", + "name": "proofRecordId", + "required": true, + "schema": { + "type": "string" + } + } + ] + } + } + }, + "servers": [ + { + "url": "/" + } + ] +} \ No newline at end of file diff --git a/packages/rest/src/schemas/AcceptCredentialProposalRequest.ts b/packages/rest/src/schemas/AcceptCredentialProposalRequest.ts deleted file mode 100644 index 328331ac..00000000 --- a/packages/rest/src/schemas/AcceptCredentialProposalRequest.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { AutoAcceptCredential } from '@aries-framework/core' -import { IsOptional, IsString, IsEnum } from 'class-validator' - -export class AcceptCredentialProposalRequest { - @IsOptional() - @IsString() - public comment?: string - - @IsOptional() - @IsString() - public credentialDefinitionId?: string - - @IsOptional() - @IsEnum(AutoAcceptCredential) - public autoAcceptCredential?: AutoAcceptCredential -} diff --git a/packages/rest/src/schemas/AcceptProofProposalRequest.ts b/packages/rest/src/schemas/AcceptProofProposalRequest.ts deleted file mode 100644 index dc9b8c04..00000000 --- a/packages/rest/src/schemas/AcceptProofProposalRequest.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { IsOptional, IsString } from 'class-validator' - -export class AcceptProofProposalRequest { - @IsOptional() - public request?: { - name?: string - version?: string - nonce?: string - } - - @IsOptional() - @IsString() - public comment?: string -} diff --git a/packages/rest/src/schemas/BasicMessageRequest.ts b/packages/rest/src/schemas/BasicMessageRequest.ts deleted file mode 100644 index d115fc19..00000000 --- a/packages/rest/src/schemas/BasicMessageRequest.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IsString } from 'class-validator' - -export class BasicMessageRequest { - @IsString() - public content!: string -} diff --git a/packages/rest/src/schemas/CredentialDefinitionRequest.ts b/packages/rest/src/schemas/CredentialDefinitionRequest.ts deleted file mode 100644 index 63d4e65e..00000000 --- a/packages/rest/src/schemas/CredentialDefinitionRequest.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { IsString, IsBoolean, Matches } from 'class-validator' - -export class CredentialDefinitionRequest { - @IsString() - public tag!: string - - @IsBoolean() - public supportRevocation!: boolean - - @IsString() - @Matches(/^[a-zA-Z0-9]{21,22}:2:.+:[0-9.]+$/) - public schemaId!: string -} diff --git a/packages/rest/src/schemas/CredentialOfferRequest.ts b/packages/rest/src/schemas/CredentialOfferRequest.ts deleted file mode 100644 index 82d47552..00000000 --- a/packages/rest/src/schemas/CredentialOfferRequest.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { IsString } from 'class-validator' - -import { CredentialOfferTemp } from './CredentialOfferTemplate' - -export class CredentialOfferRequest extends CredentialOfferTemp { - @IsString() - public connectionId!: string -} diff --git a/packages/rest/src/schemas/CredentialOfferTemplate.ts b/packages/rest/src/schemas/CredentialOfferTemplate.ts deleted file mode 100644 index ea75bf6e..00000000 --- a/packages/rest/src/schemas/CredentialOfferTemplate.ts +++ /dev/null @@ -1,38 +0,0 @@ -import type { CredentialOfferTemplate } from '@aries-framework/core' - -import { CredentialPreview, AutoAcceptCredential } from '@aries-framework/core' -import { Attachment } from '@aries-framework/core/build/decorators/attachment/Attachment' -import { LinkedAttachment } from '@aries-framework/core/build/utils/LinkedAttachment' -import { Type } from 'class-transformer' -import { IsString, IsOptional, ValidateNested, IsEnum, Matches, IsInstance } from 'class-validator' - -export class CredentialOfferTemp implements CredentialOfferTemplate { - @IsString() - @Matches(/^([a-zA-Z0-9]{21,22}):3:CL:(([1-9][0-9]*)|([a-zA-Z0-9]{21,22}:2:.+:[0-9.]+)):(.+)?$/) - public credentialDefinitionId!: string - - @IsOptional() - @IsString() - public comment?: string - - @ValidateNested() - @Type(() => CredentialPreview) - @IsInstance(CredentialPreview) - public preview!: CredentialPreview - - @IsEnum(AutoAcceptCredential) - @IsOptional() - public autoAcceptCredential?: AutoAcceptCredential - - @ValidateNested({ each: true }) - @Type(() => Attachment) - @IsInstance(Attachment, { each: true }) - @IsOptional() - public attachments?: Attachment[] - - @ValidateNested({ each: true }) - @Type(() => LinkedAttachment) - @IsInstance(LinkedAttachment, { each: true }) - @IsOptional() - public linkedAttachments?: LinkedAttachment[] -} diff --git a/packages/rest/src/schemas/CredentialProposalRequest.ts b/packages/rest/src/schemas/CredentialProposalRequest.ts deleted file mode 100644 index aa9e0e40..00000000 --- a/packages/rest/src/schemas/CredentialProposalRequest.ts +++ /dev/null @@ -1,68 +0,0 @@ -import type { CredentialProposeOptions } from '@aries-framework/core' - -import { AutoAcceptCredential, CredentialPreview } from '@aries-framework/core' -import { Attachment } from '@aries-framework/core/build/decorators/attachment/Attachment' -import { LinkedAttachment } from '@aries-framework/core/build/utils/LinkedAttachment' -import { Type } from 'class-transformer' -import { IsString, ValidateNested, IsOptional, Matches, IsEnum, IsInstance } from 'class-validator' - -export class CredentialProposalRequest implements CredentialProposeOptions { - @IsString() - public connectionId!: string - - @IsOptional() - @IsString() - public comment?: string - - @ValidateNested() - @Type(() => CredentialPreview) - @IsInstance(CredentialPreview) - public credentialProposal?: CredentialPreview - - @IsOptional() - @IsString() - @Matches(/^(did:sov:)?[a-zA-Z0-9]{21,22}$/) - public schemaIssuerDid?: string - - @IsOptional() - @IsString() - @Matches(/^[a-zA-Z0-9]{21,22}:2:.+:[0-9.]+$/) - public schemaId?: string - - @IsOptional() - @IsString() - public schemaName?: string - - @IsOptional() - @IsString() - @Matches(/^(\d+\.)?(\d+\.)?(\*|\d+)$/, { - message: 'Version must be X.X or X.X.X', - }) - public schemaVersion?: string - - @IsOptional() - @IsString() - @Matches(/^([a-zA-Z0-9]{21,22}):3:CL:(([1-9][0-9]*)|([a-zA-Z0-9]{21,22}:2:.+:[0-9.]+)):(.+)?$/) - public credentialDefinitionId?: string - - @IsOptional() - @IsString() - @Matches(/^(did:sov:)?[a-zA-Z0-9]{21,22}$/) - public issuerDid?: string - - @ValidateNested({ each: true }) - @Type(() => Attachment) - @IsInstance(Attachment, { each: true }) - @IsOptional() - public attachments?: Attachment[] - - @ValidateNested({ each: true }) - @Type(() => LinkedAttachment) - @IsInstance(LinkedAttachment, { each: true }) - @IsOptional() - public linkedAttachments?: LinkedAttachment[] - - @IsEnum(AutoAcceptCredential) - @IsOptional() - public autoAcceptCredential?: AutoAcceptCredential -} diff --git a/packages/rest/src/schemas/InvitationConfigRequest.ts b/packages/rest/src/schemas/InvitationConfigRequest.ts deleted file mode 100644 index a7bd43cd..00000000 --- a/packages/rest/src/schemas/InvitationConfigRequest.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { IsBoolean, IsString, IsOptional } from 'class-validator' - -export class InvitationConfigRequest { - @IsOptional() - @IsBoolean() - public autoAcceptConnection?: boolean - - @IsOptional() - @IsString() - public alias?: string - - @IsOptional() - @IsString() - public mediatorId?: string - - @IsOptional() - @IsBoolean() - public multiUseInvitation?: boolean - - @IsOptional() - @IsString() - public myLabel?: string - - @IsOptional() - @IsString() - public myImageUrl?: string -} diff --git a/packages/rest/src/schemas/InvitationRequest.ts b/packages/rest/src/schemas/InvitationRequest.ts deleted file mode 100644 index 7ab36ec2..00000000 --- a/packages/rest/src/schemas/InvitationRequest.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Expose } from 'class-transformer' -import { IsString, IsArray, IsOptional } from 'class-validator' - -export class InvitationRequest { - @Expose({ name: '@Id' }) - public id!: string - - @Expose({ name: '@Type' }) - public type!: string - - @IsString() - public label!: string - - @IsString() - @IsOptional() - public did?: string - - @IsArray() - @IsOptional() - public recipientKeys?: string[] - - @IsString() - @IsOptional() - public serviceEndpoint?: string - - @IsArray() - @IsOptional() - public routingKeys?: string[] -} diff --git a/packages/rest/src/schemas/PresentationProofRequest.ts b/packages/rest/src/schemas/PresentationProofRequest.ts deleted file mode 100644 index c437dcc4..00000000 --- a/packages/rest/src/schemas/PresentationProofRequest.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { IsBoolean, IsOptional, IsString } from 'class-validator' - -export class PresentationProofRequest { - @IsOptional() - @IsBoolean() - public filterByPresentationPreview?: boolean - - @IsOptional() - @IsString() - public comment?: string -} diff --git a/packages/rest/src/schemas/ProofPresentationRequest.ts b/packages/rest/src/schemas/ProofPresentationRequest.ts deleted file mode 100644 index b426f3e9..00000000 --- a/packages/rest/src/schemas/ProofPresentationRequest.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { IsString } from 'class-validator' - -import { ProofRequestTemplate } from './ProofRequestTemplate' - -export class ProofPresentationRequest extends ProofRequestTemplate { - @IsString() - public connectionId!: string -} diff --git a/packages/rest/src/schemas/ProofProposalRequest.ts b/packages/rest/src/schemas/ProofProposalRequest.ts deleted file mode 100644 index 72ef18ea..00000000 --- a/packages/rest/src/schemas/ProofProposalRequest.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { AutoAcceptProof, PresentationPreviewAttribute, PresentationPreviewPredicate } from '@aries-framework/core' -import { Type } from 'class-transformer' -import { IsString, IsOptional, ValidateNested, IsEnum, IsInstance } from 'class-validator' - -export class ProofProposalRequest { - @IsString() - public connectionId!: string - - @ValidateNested({ each: true }) - @Type(() => PresentationPreviewAttribute) - @IsInstance(PresentationPreviewAttribute, { each: true }) - @IsOptional() - public attributes!: PresentationPreviewAttribute[] - - @ValidateNested({ each: true }) - @Type(() => PresentationPreviewPredicate) - @IsInstance(PresentationPreviewPredicate, { each: true }) - @IsOptional() - public predicates!: PresentationPreviewPredicate[] - - @IsOptional() - @IsEnum(AutoAcceptProof) - public autoAcceptProof?: AutoAcceptProof - - @IsOptional() - @IsString() - public comment?: string -} diff --git a/packages/rest/src/schemas/ProofRequestTemplate.ts b/packages/rest/src/schemas/ProofRequestTemplate.ts deleted file mode 100644 index 9c3b25b5..00000000 --- a/packages/rest/src/schemas/ProofRequestTemplate.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { AutoAcceptProof } from '@aries-framework/core' -import { Type } from 'class-transformer' -import { IsString, IsOptional, ValidateNested, IsEnum, IsInstance } from 'class-validator' - -import { ProofRequest } from '../utils/ProofRequest' - -export class ProofRequestTemplate { - @ValidateNested() - @Type(() => ProofRequest) - @IsInstance(ProofRequest) - public proofRequest!: ProofRequest - - @IsOptional() - @IsString() - public comment?: string - - @IsOptional() - @IsEnum(AutoAcceptProof) - public autoAcceptProof?: AutoAcceptProof -} diff --git a/packages/rest/src/schemas/ReceiveInvitationByUrlRequest.ts b/packages/rest/src/schemas/ReceiveInvitationByUrlRequest.ts deleted file mode 100644 index acb97339..00000000 --- a/packages/rest/src/schemas/ReceiveInvitationByUrlRequest.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { IsString } from 'class-validator' - -import { InvitationConfigRequest } from './InvitationConfigRequest' - -export class ReceiveInvitationByUrlRequest extends InvitationConfigRequest { - @IsString() - public invitationUrl!: string -} diff --git a/packages/rest/src/schemas/ReceiveInvitationRequest.ts b/packages/rest/src/schemas/ReceiveInvitationRequest.ts deleted file mode 100644 index 4acdf333..00000000 --- a/packages/rest/src/schemas/ReceiveInvitationRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Type } from 'class-transformer' -import { IsInstance, ValidateNested } from 'class-validator' - -import { InvitationConfigRequest } from './InvitationConfigRequest' -import { InvitationRequest } from './InvitationRequest' - -export class ReceiveInvitationRequest extends InvitationConfigRequest { - @ValidateNested() - @Type(() => InvitationRequest) - @IsInstance(InvitationRequest) - public invitation!: InvitationRequest -} diff --git a/packages/rest/src/schemas/SchemaRequest.ts b/packages/rest/src/schemas/SchemaRequest.ts deleted file mode 100644 index 0c368f3d..00000000 --- a/packages/rest/src/schemas/SchemaRequest.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { IsString, IsArray, Matches } from 'class-validator' - -export class SchemaTemplate { - @IsString() - public name!: string - - @Matches(/^(\d+\.)?(\d+\.)?(\*|\d+)$/, { - message: 'Version must be X.X or X.X.X', - }) - public version!: string - - @IsArray() - public attributes!: string[] -} diff --git a/packages/rest/src/server.ts b/packages/rest/src/server.ts index 8b4e37d7..91f2567f 100644 --- a/packages/rest/src/server.ts +++ b/packages/rest/src/server.ts @@ -1,42 +1,28 @@ import 'reflect-metadata' import type { ServerConfig } from './utils/ServerConfig' -import type { Express } from 'express' +import type { Response as ExResponse, Request as ExRequest, NextFunction } from 'express' +import type { Exception } from 'tsoa' import { Agent } from '@aries-framework/core' -import { validationMetadatasToSchemas } from 'class-validator-jsonschema' -import { createExpressServer, getMetadataArgsStorage, useContainer, useExpressServer } from 'routing-controllers' -import { routingControllersToSpec } from 'routing-controllers-openapi' -import * as swaggerUiExpress from 'swagger-ui-express' +import bodyParser from 'body-parser' +import cors from 'cors' +import express from 'express' +import { serve, generateHTML } from 'swagger-ui-express' +import { ValidateError } from 'tsoa' import { container } from 'tsyringe' import { basicMessageEvents } from './events/BasicMessageEvents' import { connectionEvents } from './events/ConnectionEvents' import { credentialEvents } from './events/CredentialEvents' import { proofEvents } from './events/ProofEvents' -import TsyringeAdapter from './utils/TsyringeAdapter' - -// eslint-disable-next-line @typescript-eslint/no-var-requires -const packageJson = require('../package.json') +import { RegisterRoutes } from './routes/routes' export const setupServer = async (agent: Agent, config: ServerConfig) => { container.registerInstance(Agent, agent) - useContainer(new TsyringeAdapter(container)) - - // eslint-disable-next-line @typescript-eslint/ban-types - const controllers = [__dirname + '/controllers/**/*.ts', __dirname + '/controllers/**/*.js'] - - let server: Express - if (config.app) { - server = useExpressServer(config.app, { - controllers: controllers, - }) - } else { - server = createExpressServer({ - controllers: controllers, - cors: config.cors ?? true, - }) - } + let server = express() + if (config.app) server = config.app + if (config.cors) server.use(cors()) if (config.webhookUrl) { basicMessageEvents(agent, config) @@ -45,27 +31,62 @@ export const setupServer = async (agent: Agent, config: ServerConfig) => { proofEvents(agent, config) } - const schemas = validationMetadatasToSchemas({ - refPointerPrefix: '#/components/schemas/', + // Use body parser to read sent json payloads + server.use( + bodyParser.urlencoded({ + extended: true, + }) + ) + server.use(bodyParser.json()) + server.use('/docs', serve, async (_req: ExRequest, res: ExResponse) => { + return res.send(generateHTML(await import('./routes/swagger.json'))) }) - const storage = getMetadataArgsStorage() - const spec = routingControllersToSpec(storage, undefined, { - components: { - schemas, - }, - info: { - description: packageJson.description, - title: agent.config.label, - version: packageJson.version, - }, + RegisterRoutes(server) + + server.use((req, res, next) => { + if (req.url == '/') { + res.redirect('/docs') + return + } + next() }) - server.use('/docs', swaggerUiExpress.serve, swaggerUiExpress.setup(spec)) + server.use(function errorHandler( + err: unknown, + req: ExRequest, + res: ExResponse, + next: NextFunction + ): ExResponse | void { + if (err instanceof ValidateError) { + agent.config.logger.warn(`Caught Validation Error for ${req.path}:`, err.fields) + return res.status(422).json({ + message: 'Validation Failed', + details: err?.fields, + }) + } + + if (err instanceof Error) { + const exceptionError = err as Exception + if (exceptionError.status === 400) { + return res.status(400).json({ + message: `Bad Request`, + details: err.message, + }) + } - server.get('/', (_req, res) => { - res.header('Access-Control-Allow-Origin', '*') - res.json(spec) + agent.config.logger.error('Internal Server Error.', err) + return res.status(500).json({ + message: 'Internal Server Error. Check server logging.', + }) + } + next() + }) + + server.use(function notFoundHandler(_req, res: ExResponse) { + res.status(404).send({ + message: 'Not Found', + }) }) return server diff --git a/packages/rest/src/utils/ProofRequest.ts b/packages/rest/src/utils/ProofRequest.ts deleted file mode 100644 index 1e8e850d..00000000 --- a/packages/rest/src/utils/ProofRequest.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { ProofAttributeInfo, ProofPredicateInfo, RevocationInterval } from '@aries-framework/core' -import { IsMap } from '@aries-framework/core/build/utils/transformers' -import { Expose, Type } from 'class-transformer' -import { IsString, ValidateNested, IsInstance, IsOptional, IsIn } from 'class-validator' - -export class ProofRequest { - @IsString() - public name!: string - - @IsString() - public version!: string - - @IsString() - @IsOptional() - public nonce?: string - - @Expose({ name: 'requested_attributes' }) - @IsMap() - @ValidateNested({ each: true }) - @Type(() => ProofAttributeInfo) - @IsInstance(ProofAttributeInfo, { each: true }) - public requestedAttributes!: Map - - @Expose({ name: 'requested_predicates' }) - @IsMap() - @ValidateNested({ each: true }) - @Type(() => ProofPredicateInfo) - @IsInstance(ProofPredicateInfo, { each: true }) - public requestedPredicates!: Map - - @Expose({ name: 'non_revoked' }) - @ValidateNested() - @Type(() => RevocationInterval) - @IsOptional() - @IsInstance(RevocationInterval) - public nonRevoked?: RevocationInterval - - @IsIn(['1.0', '2.0']) - @IsOptional() - public ver?: '1.0' | '2.0' -} diff --git a/packages/rest/src/utils/TsyringeAdapter.ts b/packages/rest/src/utils/TsyringeAdapter.ts index 0bdcb4b0..d1e1efde 100644 --- a/packages/rest/src/utils/TsyringeAdapter.ts +++ b/packages/rest/src/utils/TsyringeAdapter.ts @@ -1,12 +1,9 @@ -import type { ClassConstructor, IocAdapter } from 'routing-controllers' -import type { DependencyContainer } from 'tsyringe' +import type { IocContainer } from '@tsoa/runtime' -class TsyringeAdapter implements IocAdapter { - public constructor(private readonly TsyringeContainer: DependencyContainer) {} +import { container } from 'tsyringe' - public get(someClass: ClassConstructor): T { - return this.TsyringeContainer.resolve(someClass) - } +export const iocContainer: IocContainer = { + get: (controller: { prototype: T }): T => { + return container.resolve(controller as never) + }, } - -export default TsyringeAdapter diff --git a/packages/rest/tests/utils/agent.ts b/packages/rest/src/utils/agent.ts similarity index 83% rename from packages/rest/tests/utils/agent.ts rename to packages/rest/src/utils/agent.ts index 7b7af85d..e2f0f416 100644 --- a/packages/rest/tests/utils/agent.ts +++ b/packages/rest/src/utils/agent.ts @@ -9,7 +9,8 @@ import { import { agentDependencies, HttpInboundTransport } from '@aries-framework/node' import path from 'path' -import { TsLogger } from '../../src/utils/logger' +import { TsLogger } from './logger' +import { BCOVRIN_TEST_GENESIS } from './util' export const genesisPath = process.env.GENESIS_TXN_PATH ? path.resolve(process.env.GENESIS_TXN_PATH) @@ -41,8 +42,8 @@ export const setupAgent = async ({ logger: logger, indyLedgers: [ { - id: 'LocalLedger', - genesisPath, + id: 'TestLedger', + genesisTransactions: BCOVRIN_TEST_GENESIS, isProduction: false, }, ], @@ -67,14 +68,9 @@ export const setupAgent = async ({ const invitation = await ConnectionInvitationMessage.fromUrl(req.url) res.send(invitation.toJSON()) } else { - const { invitation } = await agent.connections.createConnection() + const { outOfBandInvitation } = await agent.oob.createInvitation() - res.send( - invitation.toUrl({ - domain: endpoints + '/invitation', - useLegacyDidSovPrefix: agent.config.useLegacyDidSovPrefix, - }) - ) + res.send(outOfBandInvitation.toUrl({ domain: endpoints + '/invitation' })) } }) diff --git a/packages/rest/src/utils/tsyringeTsoaIocContainer.ts b/packages/rest/src/utils/tsyringeTsoaIocContainer.ts new file mode 100644 index 00000000..d1e1efde --- /dev/null +++ b/packages/rest/src/utils/tsyringeTsoaIocContainer.ts @@ -0,0 +1,9 @@ +import type { IocContainer } from '@tsoa/runtime' + +import { container } from 'tsyringe' + +export const iocContainer: IocContainer = { + get: (controller: { prototype: T }): T => { + return container.resolve(controller as never) + }, +} diff --git a/packages/rest/tests/utils/util.ts b/packages/rest/src/utils/util.ts similarity index 100% rename from packages/rest/tests/utils/util.ts rename to packages/rest/src/utils/util.ts diff --git a/packages/rest/tests/utils/webhook.ts b/packages/rest/src/utils/webhook.ts similarity index 100% rename from packages/rest/tests/utils/webhook.ts rename to packages/rest/src/utils/webhook.ts diff --git a/packages/rest/tests/agent.test.ts b/packages/rest/tests/agent.test.ts index dc00ec86..41667b3c 100644 --- a/packages/rest/tests/agent.test.ts +++ b/packages/rest/tests/agent.test.ts @@ -12,7 +12,7 @@ describe('AgentController', () => { let agent: Agent beforeAll(async () => { - agent = await getTestAgent('rest agent test', 3001) + agent = await getTestAgent('Agent REST Agent Test', 3001) app = await setupServer(agent, { port: 3000 }) }) diff --git a/packages/rest/tests/basicMessage.test.ts b/packages/rest/tests/basicMessage.test.ts index 4fbd60b6..535171cb 100644 --- a/packages/rest/tests/basicMessage.test.ts +++ b/packages/rest/tests/basicMessage.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-non-null-assertion */ import type { Agent, BasicMessageRecord, ConnectionRecord } from '@aries-framework/core' import type { Express } from 'express' @@ -9,35 +10,35 @@ import { getTestAgent, objectToJson } from './utils/helpers' describe('BasicMessageController', () => { let app: Express - let agent: Agent - let connection: ConnectionRecord + let aliceAgent: Agent + let bobAgent: Agent + let bobConnectionToAlice: ConnectionRecord beforeAll(async () => { - agent = await getTestAgent('rest agent basic message test', 3011) - app = await setupServer(agent, { port: 3000 }) - const { invitation } = await agent.connections.createConnection() - connection = await agent.connections.receiveInvitation(invitation) - }) + aliceAgent = await getTestAgent('Basic Message REST Agent Test Alice', 3002) + bobAgent = await getTestAgent('Basic Message REST Agent Test Bob', 3003) + app = await setupServer(bobAgent, { port: 3000 }) - describe('get basic messages', () => { - test('should return list of basic messages filtered by connectionId', async () => { - const spy = jest.spyOn(agent.basicMessages, 'findAllByQuery') - const getResult = (): Promise => spy.mock.results[0].value + const { outOfBandInvitation } = await aliceAgent.oob.createInvitation() + const { outOfBandRecord: bobOOBRecord } = await bobAgent.oob.receiveInvitation(outOfBandInvitation) - const response = await request(app).get(`/basic-messages/${connection.id}`) - const result = await getResult() + const [bobConnectionAtBobAlice] = await bobAgent.connections.findAllByOutOfBandId(bobOOBRecord.id) + bobConnectionToAlice = await bobAgent.connections.returnWhenIsConnected(bobConnectionAtBobAlice!.id) + }) - expect(response.statusCode).toBe(200) - expect(response.body).toEqual(result.map(objectToJson)) - }) + afterEach(() => { + jest.clearAllMocks() }) - describe('send basic message to connection', () => { - test('should give 204 no content when message is send', async () => { - const response = await request(app).post(`/basic-messages/${connection.id}`).send({ content: 'Hello!' }) + describe('Send basic message to connection', () => { + test('should give 204 no content when message is sent', async () => { + const response = await request(app) + .post(`/basic-messages/${bobConnectionToAlice?.id}`) + .send({ content: 'Hello!' }) expect(response.statusCode).toBe(204) }) + test('should give 404 not found when connection is not found', async () => { const response = await request(app) .post(`/basic-messages/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa`) @@ -47,8 +48,23 @@ describe('BasicMessageController', () => { }) }) + describe('Get basic messages', () => { + test('should return list of basic messages filtered by connection id', async () => { + const spy = jest.spyOn(bobAgent.basicMessages, 'findAllByQuery') + const getResult = (): Promise => spy.mock.results[0].value + + const response = await request(app).get(`/basic-messages/${bobConnectionToAlice.id}`) + const result = await getResult() + + expect(response.statusCode).toBe(200) + expect(response.body).toEqual(result.map(objectToJson)) + }) + }) + afterAll(async () => { - await agent.shutdown() - await agent.wallet.delete() + await aliceAgent.shutdown() + await aliceAgent.wallet.delete() + await bobAgent.shutdown() + await bobAgent.wallet.delete() }) }) diff --git a/packages/rest/tests/connection.test.ts b/packages/rest/tests/connection.test.ts index 57d35f94..eb521829 100644 --- a/packages/rest/tests/connection.test.ts +++ b/packages/rest/tests/connection.test.ts @@ -1,24 +1,23 @@ import type { Agent, ConnectionRecord } from '@aries-framework/core' import type { Express } from 'express' -import { JsonTransformer, ConnectionInvitationMessage } from '@aries-framework/core' import request from 'supertest' import { setupServer } from '../src/server' -import { getTestAgent, objectToJson } from './utils/helpers' +import { getTestConnection, getTestAgent, objectToJson } from './utils/helpers' describe('ConnectionController', () => { let app: Express let aliceAgent: Agent let bobAgent: Agent + let connection: ConnectionRecord beforeAll(async () => { - aliceAgent = await getTestAgent('Rest Connection Test Alice', 3002) - bobAgent = await getTestAgent('Rest Connection Test Bob', 3003) + aliceAgent = await getTestAgent('Connection REST Agent Test Alice', 3012) + bobAgent = await getTestAgent('Connection REST Agent Test Bob', 3013) app = await setupServer(bobAgent, { port: 3000 }) - - await bobAgent.connections.createConnection() + connection = getTestConnection() }) afterEach(() => { @@ -40,14 +39,13 @@ describe('ConnectionController', () => { describe('Get connection by id', () => { test('should return connection record', async () => { - const spy = jest.spyOn(bobAgent.connections, 'findById') + const spy = jest.spyOn(bobAgent.connections, 'findById').mockResolvedValueOnce(connection) const getResult = (): Promise => spy.mock.results[0].value - const { connectionRecord } = await bobAgent.connections.createConnection() - - const response = await request(app).get(`/connections/${connectionRecord.id}`) + const response = await request(app).get(`/connections/${connection.id}`) expect(response.statusCode).toBe(200) + expect(spy).toHaveBeenCalledWith(connection.id) expect(response.body).toEqual(objectToJson(await getResult())) }) @@ -58,176 +56,19 @@ describe('ConnectionController', () => { }) }) - describe('create invitation', () => { - test('should return invitation', async () => { - const spy = jest.spyOn(bobAgent.connections, 'createConnection') - const getResult = (): Promise => spy.mock.results[0].value - - const response = await request(app).post('/connections/create-invitation') - - const result = await getResult() - const instance = JsonTransformer.fromJSON(result.invitation, ConnectionInvitationMessage) // i do this because i need to add useLegacyDidSov - - expect(response.statusCode).toBe(200) - expect(response.body.invitationUrl).toBeDefined() - expect(response.body.invitation).toEqual(instance.toJSON({ useLegacyDidSovPrefix: true })) - }) - - test('should accept optional parameters', async () => { - const spy = jest.spyOn(bobAgent.connections, 'createConnection') - - const params = { - autoAcceptConnection: false, - alias: 'test', - } - - const response = await request(app).post('/connections/create-invitation').send(params) - - expect(response.statusCode).toBe(200) - expect(spy).toBeCalledWith(params) - expect(response.body.connection.alias).toEqual('test') - expect(response.body.connection.autoAcceptConnection).toEqual(false) - expect(response.body.connection.multiUseInvitation).toEqual(false) - }) - - test('should accept custom label and imageUrl', async () => { - const spy = jest.spyOn(bobAgent.connections, 'createConnection') - - const params = { - myLabel: 'custom-label', - myImageUrl: 'https://example.com/image.png', - } - - const response = await request(app).post('/connections/create-invitation').send(params) - - expect(response.statusCode).toBe(200) - expect(spy).toBeCalledWith(params) - expect(response.body.invitation.label).toEqual('custom-label') - expect(response.body.invitation.imageUrl).toEqual('https://example.com/image.png') - }) - - test('should accept multiUseInvitation parameter', async () => { - const spy = jest.spyOn(bobAgent.connections, 'createConnection') - - const params = { - multiUseInvitation: true, - } - - const response = await request(app).post('/connections/create-invitation').send(params) - - expect(response.statusCode).toBe(200) - expect(spy).toBeCalledWith(params) - expect(response.body.connection.multiUseInvitation).toBeTruthy() - }) - }) - - describe('receive invitation', () => { - test('should return connection record from received invitation', async () => { - const { invitation } = await bobAgent.connections.createConnection() - - const spy = jest.spyOn(bobAgent.connections, 'receiveInvitation') - const getResult = (): Promise => spy.mock.results[0].value - - const req = { - invitation: invitation.toJSON({ useLegacyDidSovPrefix: true }), - } - const response = await request(app).post('/connections/receive-invitation').send(req) - - expect(response.statusCode).toBe(200) - expect(response.body).toEqual(objectToJson(await getResult())) - }) - - test('should overwrite agent options with request options', async () => { - const { invitation } = await bobAgent.connections.createConnection() - - const req = { - invitation: invitation.toJSON({ useLegacyDidSovPrefix: true }), - autoAcceptConnection: false, - } - const response = await request(app).post('/connections/receive-invitation').send(req) - - expect(response.statusCode).toBe(200) - expect(response.body.autoAcceptConnection).toBeFalsy() - }) - }) - - describe('receive invitation by url', () => { - test('should return connection record from received invitation', async () => { - const { invitation } = await aliceAgent.connections.createConnection() - const req = { - invitationUrl: invitation.toUrl({ - domain: aliceAgent.config.endpoints[0], - useLegacyDidSovPrefix: aliceAgent.config.useLegacyDidSovPrefix, - }), - } - - const spy = jest.spyOn(bobAgent.connections, 'receiveInvitation') - const getResult = (): Promise => spy.mock.results[0].value - - const response = await request(app).post('/connections/receive-invitation-url').send(req) - - expect(response.statusCode).toBe(200) - expect(response.body).toEqual(objectToJson(await getResult())) - }) - - test('should overwrite agent options with request options', async () => { - const { invitation } = await aliceAgent.connections.createConnection() - - const req = { - invitationUrl: invitation.toUrl({ - domain: aliceAgent.config.endpoints[0], - useLegacyDidSovPrefix: aliceAgent.config.useLegacyDidSovPrefix, - }), - autoAcceptConnection: false, - } - const response = await request(app).post('/connections/receive-invitation-url').send(req) - - expect(response.statusCode).toBe(200) - expect(response.body.autoAcceptConnection).toBeFalsy() - }) - }) - - describe('Accept invitation', () => { - test('should return connection record from accepted invitation', async () => { - const { invitation } = await aliceAgent.connections.createConnection({ - autoAcceptConnection: false, - }) - const connection = await bobAgent.connections.receiveInvitation(invitation, { autoAcceptConnection: false }) - - const spy = jest.spyOn(bobAgent.connections, 'acceptInvitation') - const getResult = (): Promise => spy.mock.results[0].value - - const response = await request(app).post(`/connections/${connection.id}/accept-invitation`) - - expect(response.statusCode) - expect(response.body).toEqual(objectToJson(await getResult())) - }) - - test('should throw error when connectionId is not found', async () => { - const response = await request(app).post(`/connections/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/accept-invitation`) - - expect(response.statusCode).toBe(404) - }) - }) - describe('Accept request', () => { test('should return accepted connection record', async () => { - const { connectionRecord, invitation } = await bobAgent.connections.createConnection({ - autoAcceptConnection: false, - }) - const connection = await aliceAgent.connections.receiveInvitation(invitation, { autoAcceptConnection: false }) - await aliceAgent.connections.acceptInvitation(connection.id) - - const spy = jest.spyOn(bobAgent.connections, 'acceptRequest') + const spy = jest.spyOn(bobAgent.connections, 'acceptRequest').mockResolvedValueOnce(connection) const getResult = (): Promise => spy.mock.results[0].value - const response = await request(app).post(`/connections/${connectionRecord.id}/accept-request`) + const response = await request(app).post(`/connections/${connection.id}/accept-request`) expect(response.statusCode) + expect(spy).toHaveBeenCalledWith(connection.id) expect(response.body).toEqual(objectToJson(await getResult())) }) - test('should throw error when connectionId is not found', async () => { + test('should throw error when connection id is not found', async () => { const response = await request(app).post(`/connections/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/accept-request`) expect(response.statusCode).toBe(404) @@ -236,19 +77,13 @@ describe('ConnectionController', () => { describe('Accept response', () => { test('should return accepted connection record', async () => { - const { connectionRecord, invitation } = await aliceAgent.connections.createConnection({ - autoAcceptConnection: false, - }) - const connection = await bobAgent.connections.receiveInvitation(invitation, { autoAcceptConnection: false }) - await bobAgent.connections.acceptInvitation(connection.id) - await aliceAgent.connections.acceptRequest(connectionRecord.id) - - const spy = jest.spyOn(bobAgent.connections, 'acceptResponse') + const spy = jest.spyOn(bobAgent.connections, 'acceptResponse').mockResolvedValueOnce(connection) const getResult = (): Promise => spy.mock.results[0].value const response = await request(app).post(`/connections/${connection.id}/accept-response`) expect(response.statusCode) + expect(spy).toHaveBeenCalledWith(connection.id) expect(response.body).toEqual(objectToJson(await getResult())) }) diff --git a/packages/rest/tests/credential.test.ts b/packages/rest/tests/credential.test.ts index 205760ed..fee9776a 100644 --- a/packages/rest/tests/credential.test.ts +++ b/packages/rest/tests/credential.test.ts @@ -1,26 +1,24 @@ -import type { Agent, CredentialRecord, OfferCredentialMessage } from '@aries-framework/core' +import type { Agent, CredentialExchangeRecord } from '@aries-framework/core' import type { Express } from 'express' import request from 'supertest' import { setupServer } from '../src/server' -import { objectToJson, getTestCredential, getTestAgent, getTestCredentialOfferMsg } from './utils/helpers' +import { objectToJson, getTestCredential, getTestAgent } from './utils/helpers' describe('CredentialController', () => { let app: Express let aliceAgent: Agent let bobAgent: Agent - let testCredential: CredentialRecord - let testCredentialOfferMsg: OfferCredentialMessage + let testCredential: CredentialExchangeRecord beforeAll(async () => { - aliceAgent = await getTestAgent('Rest Credential Test Alice', 3005) - bobAgent = await getTestAgent('Rest Credential Test Bob', 3006) + aliceAgent = await getTestAgent('Credential REST Agent Test Alice', 3022) + bobAgent = await getTestAgent('Credential REST Agent Test Bob', 3023) app = await setupServer(bobAgent, { port: 3000 }) - testCredential = getTestCredential() - testCredentialOfferMsg = getTestCredentialOfferMsg() + testCredential = getTestCredential() as CredentialExchangeRecord }) afterEach(() => { @@ -31,7 +29,7 @@ describe('CredentialController', () => { test('should return all credentials', async () => { const spy = jest.spyOn(bobAgent.credentials, 'getAll').mockResolvedValueOnce([testCredential]) - const getResult = (): Promise => spy.mock.results[0].value + const getResult = (): Promise => spy.mock.results[0].value const response = await request(app).get('/credentials') const result = await getResult() @@ -45,7 +43,7 @@ describe('CredentialController', () => { test('should return credential', async () => { const spy = jest.spyOn(bobAgent.credentials, 'getById').mockResolvedValueOnce(testCredential) - const getResult = (): Promise => spy.mock.results[0].value + const getResult = (): Promise => spy.mock.results[0].value const response = await request(app).get(`/credentials/${testCredential.id}`) const result = await getResult() @@ -54,6 +52,7 @@ describe('CredentialController', () => { expect(spy).toHaveBeenCalledWith(testCredential.id) expect(response.body).toEqual(objectToJson(result)) }) + test('should give 404 not found when connection is not found', async () => { const response = await request(app).get(`/credentials/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa`) @@ -72,35 +71,36 @@ describe('CredentialController', () => { describe('Propose a credential', () => { test('should return credential record', async () => { const spy = jest.spyOn(bobAgent.credentials, 'proposeCredential').mockResolvedValueOnce(testCredential) - const getResult = (): Promise => spy.mock.results[0].value + const getResult = (): Promise => spy.mock.results[0].value - const proposalReq = { + const proposalRequest = { connectionId: '000000aa-aa00-00a0-aa00-000a0aa00000', - credentialDefinitionId: 'WghBqNdoFjaYh6F5N9eBF:3:CL:3210:test', - issuerDid: 'WghBqNdoFjaYh6F5N9eBF', - schemaId: 'WgWxqztrNooG92RXvxSTWv:2:test:1.0', - schemaIssuerDid: 'WghBqNdoFjaYh6F5N9eBF', - schemaName: 'test', - schemaVersion: '1.0', - credentialProposal: { - '@type': 'https://didcomm.org/issue-credential/1.0/credential-preview', - attributes: [ - { - 'mime-type': 'text/plain', - name: 'name', - value: 'test', - }, - ], + protocolVersion: 'v1', + credentialFormats: { + indy: { + credentialDefinitionId: 'WghBqNdoFjaYh6F5N9eBF:3:CL:3210:test', + issuerDid: 'WghBqNdoFjaYh6F5N9eBF', + schemaId: 'WgWxqztrNooG92RXvxSTWv:2:test:1.0', + schemaIssuerDid: 'WghBqNdoFjaYh6F5N9eBF', + schemaName: 'test', + schemaVersion: '1.0', + attributes: [ + { + name: 'name', + value: 'test', + }, + ], + }, }, } - const response = await request(app).post(`/credentials/propose-credential`).send(proposalReq) + const response = await request(app).post(`/credentials/propose-credential`).send(proposalRequest) const result = await getResult() expect(response.statusCode).toBe(200) - // TODO: Fix -> expect(spy).toHaveBeenCalledWith(conId, proposalReq) expect(response.body).toEqual(objectToJson(result)) }) + test('should give 404 not found when connection is not found', async () => { const response = await request(app).post('/credentials/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/accept-offer') @@ -111,113 +111,109 @@ describe('CredentialController', () => { describe('Accept a credential proposal', () => { test('should return credential record', async () => { const spy = jest.spyOn(bobAgent.credentials, 'acceptProposal').mockResolvedValueOnce(testCredential) - const getResult = (): Promise => spy.mock.results[0].value - - const proposalReq = { - credentialDefinitionId: 'WghBqNdoFjaYh6F5N9eBF:3:CL:3210:test', + const getResult = (): Promise => spy.mock.results[0].value + + const proposalRequest = { + credentialFormats: { + indy: { + credentialDefinitionId: 'WghBqNdoFjaYh6F5N9eBF:3:CL:3210:test', + issuerDid: 'WghBqNdoFjaYh6F5N9eBF', + schemaId: 'WgWxqztrNooG92RXvxSTWv:2:test:1.0', + schemaIssuerDid: 'WghBqNdoFjaYh6F5N9eBF', + schemaName: 'test', + schemaVersion: '1.0', + attributes: [ + { + name: 'name', + value: 'test', + }, + ], + }, + }, autoAcceptCredential: 'always', comment: 'test', } - const response = await request(app).post(`/credentials/${testCredential.id}/accept-proposal`).send(proposalReq) + + const response = await request(app) + .post(`/credentials/${testCredential.id}/accept-proposal`) + .send(proposalRequest) + const result = await getResult() expect(response.statusCode).toBe(200) - expect(spy).toHaveBeenCalledWith(testCredential.id, proposalReq) + expect(spy).toHaveBeenCalledWith({ ...proposalRequest, credentialRecordId: testCredential.id }) expect(response.body).toEqual(objectToJson(result)) }) + test('should work without optional parameters', async () => { const spy = jest.spyOn(bobAgent.credentials, 'acceptProposal').mockResolvedValueOnce(testCredential) - const getResult = (): Promise => spy.mock.results[0].value + const getResult = (): Promise => spy.mock.results[0].value const response = await request(app).post(`/credentials/${testCredential.id}/accept-proposal`) + const result = await getResult() expect(response.statusCode).toBe(200) expect(response.body).toEqual(objectToJson(result)) }) + test('should give 404 not found when credential is not found', async () => { - const response = await request(app).post(`/credentials/${testCredential.id}/accept-proposal`) + const response = await request(app).post(`/credentials/000000aa-aa00-00a0-aa00-000a0aa00000/accept-proposal`) expect(response.statusCode).toBe(404) }) }) describe('Offer a credential', () => { - const proposalReq = { + const offerRequest = { connectionId: '000000aa-aa00-00a0-aa00-000a0aa00000', - credentialDefinitionId: 'WghBqNdoFjaYh6F5N9eBF:3:CL:3210:test', - preview: { - '@type': 'https://didcomm.org/issue-credential/1.0/credential-preview', - attributes: [ - { - 'mime-type': 'text/plain', - name: 'name', - value: 'test', - }, - ], + protocolVersion: 'v1', + credentialFormats: { + indy: { + credentialDefinitionId: 'WghBqNdoFjaYh6F5N9eBF:3:CL:3210:test', + attributes: [ + { + name: 'name', + value: 'test', + }, + ], + }, }, } + test('should return credential record', async () => { const spy = jest.spyOn(bobAgent.credentials, 'offerCredential').mockResolvedValueOnce(testCredential) - const getResult = (): Promise => spy.mock.results[0].value + const getResult = (): Promise => spy.mock.results[0].value - const response = await request(app).post(`/credentials/offer-credential`).send(proposalReq) + const response = await request(app).post(`/credentials/offer-credential`).send(offerRequest) const result = await getResult() expect(response.statusCode).toBe(200) expect(response.body).toEqual(objectToJson(result)) }) + test('should give 404 not found when connection is not found', async () => { const response = await request(app) - .post('/credentials/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/accept-offer') - .send(proposalReq) + .post('/credentials/accept-offer') + .send({ credentialRecordId: 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' }) expect(response.statusCode).toBe(404) }) }) - describe('Offer out of band credential', () => { - const offerReq = { - credentialDefinitionId: 'WghBqNdoFjaYh6F5N9eBF:3:CL:3210:test', - preview: { - '@type': 'https://didcomm.org/issue-credential/1.0/credential-preview', - attributes: [ - { - 'mime-type': 'text/plain', - name: 'name', - value: 'test', - }, - ], - }, - } - - test('should return credential record', async () => { - const spy = jest - .spyOn(bobAgent.credentials, 'createOutOfBandOffer') - .mockResolvedValueOnce({ offerMessage: testCredentialOfferMsg, credentialRecord: testCredential }) - const getResult = () => spy.mock.results[0].value - - const response = await request(app).post(`/credentials/offer-outofband-credential`).send(offerReq) - const result = await getResult() - - expect(response.statusCode).toBe(200) - expect(response.body.message).toBeDefined() - expect(response.body.credentialRecord).toEqual(objectToJson(result.credentialRecord)) - }) - }) - describe('Accept a credential offer', () => { test('should return credential record', async () => { const spy = jest.spyOn(bobAgent.credentials, 'acceptOffer').mockResolvedValueOnce(testCredential) - const getResult = (): Promise => spy.mock.results[0].value + const getResult = (): Promise => spy.mock.results[0].value const response = await request(app).post(`/credentials/${testCredential.id}/accept-offer`) const result = await getResult() expect(response.statusCode).toBe(200) - expect(spy).toHaveBeenCalledWith(testCredential.id) + expect(spy).toHaveBeenCalledWith({ credentialRecordId: testCredential.id }) expect(response.body).toEqual(objectToJson(result)) }) + test('should give 404 not found when credential is not found', async () => { const response = await request(app).post('/credentials/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/accept-offer') @@ -228,15 +224,16 @@ describe('CredentialController', () => { describe('Accept a credential request', () => { test('should return credential record', async () => { const spy = jest.spyOn(bobAgent.credentials, 'acceptRequest').mockResolvedValueOnce(testCredential) - const getResult = (): Promise => spy.mock.results[0].value + const getResult = (): Promise => spy.mock.results[0].value const response = await request(app).post(`/credentials/${testCredential.id}/accept-request`) const result = await getResult() expect(response.statusCode).toBe(200) - expect(spy).toHaveBeenCalledWith(testCredential.id) + expect(spy).toHaveBeenCalledWith({ credentialRecordId: testCredential.id }) expect(response.body).toEqual(objectToJson(result)) }) + test('should give 404 not found when credential is not found', async () => { const response = await request(app).post('/credentials/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/accept-request') @@ -247,15 +244,16 @@ describe('CredentialController', () => { describe('Accept a credential', () => { test('should return credential record', async () => { const spy = jest.spyOn(bobAgent.credentials, 'acceptCredential').mockResolvedValueOnce(testCredential) - const getResult = (): Promise => spy.mock.results[0].value + const getResult = (): Promise => spy.mock.results[0].value const response = await request(app).post(`/credentials/${testCredential.id}/accept-credential`) const result = await getResult() expect(response.statusCode).toBe(200) - expect(spy).toHaveBeenCalledWith(testCredential.id) + expect(spy).toHaveBeenCalledWith({ credentialRecordId: testCredential.id }) expect(response.body).toEqual(objectToJson(result)) }) + test('should give 404 not found when credential is not found', async () => { const response = await request(app).post('/credentials/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/accept-credential') diff --git a/packages/rest/tests/credentialDefinition.test.ts b/packages/rest/tests/credentialDefinition.test.ts index 3d1b44d6..fac94c7e 100644 --- a/packages/rest/tests/credentialDefinition.test.ts +++ b/packages/rest/tests/credentialDefinition.test.ts @@ -14,7 +14,7 @@ describe('CredentialDefinitionController', () => { let testCredDef: CredDef beforeAll(async () => { - agent = await getTestAgent('Rest CredentialDefinition Test', 3007) + agent = await getTestAgent('CredentialDefinition REST Agent Test', 3011) app = await setupServer(agent, { port: 3000 }) testCredDef = getTestCredDef() }) @@ -86,7 +86,7 @@ describe('CredentialDefinitionController', () => { tag: 'latest', supportRevocation: false, }) - expect(response.statusCode).toBe(400) + expect(response.statusCode).toBe(422) }) }) diff --git a/packages/rest/tests/outofband.test.ts b/packages/rest/tests/outofband.test.ts new file mode 100644 index 00000000..6c35c802 --- /dev/null +++ b/packages/rest/tests/outofband.test.ts @@ -0,0 +1,376 @@ +import type { Agent, OutOfBandRecord, ConnectionRecord, OutOfBandInvitation } from '@aries-framework/core' +import type { Express } from 'express' + +import { JsonTransformer, AgentMessage } from '@aries-framework/core' +import request from 'supertest' + +import { setupServer } from '../src/server' + +import { + getTestAgent, + getTestConnection, + getTestOutOfBandInvitation, + getTestOutOfBandRecord, + objectToJson, +} from './utils/helpers' + +describe('OutOfBandController', () => { + let app: Express + let aliceAgent: Agent + let bobAgent: Agent + let outOfBandRecord: OutOfBandRecord + let outOfBandInvitation: OutOfBandInvitation + let connectionRecord: ConnectionRecord + + beforeAll(async () => { + aliceAgent = await getTestAgent('OutOfBand REST Agent Test Alice', 3014) + bobAgent = await getTestAgent('OutOfBand REST Agent Test Bob', 3015) + app = await setupServer(bobAgent, { port: 3000 }) + outOfBandRecord = getTestOutOfBandRecord() + outOfBandInvitation = getTestOutOfBandInvitation() + connectionRecord = getTestConnection() + }) + + afterEach(() => { + jest.clearAllMocks() + }) + + describe('Get all out of band records', () => { + test('should return all out of band records', async () => { + const spy = jest.spyOn(bobAgent.oob, 'getAll') + const getResult = (): Promise => spy.mock.results[0].value + + const response = await request(app).get('/oob') + const result = await getResult() + + expect(response.statusCode).toBe(200) + expect(response.body).toEqual(result.map(objectToJson)) + }) + test('should return filtered out of band records if query is passed', async () => { + jest.spyOn(bobAgent.oob, 'getAll').mockResolvedValueOnce([outOfBandRecord]) + const response = await request(app).get('/oob?invitationId=test') + + expect(response.statusCode).toBe(200) + expect(response.body).toEqual([]) + }) + }) + + describe('Get out of band record by id', () => { + test('should return out of band record with correct id', async () => { + const spy = jest.spyOn(bobAgent.oob, 'findById').mockResolvedValueOnce(outOfBandRecord) + const getResult = (): Promise => spy.mock.results[0].value + + const response = await request(app).get(`/oob/${outOfBandRecord.id}`) + + expect(response.statusCode).toBe(200) + expect(spy).toHaveBeenCalledWith(outOfBandRecord.id) + expect(response.body).toEqual(objectToJson(await getResult())) + }) + test('should return 404 if out of band record is not found', async () => { + const response = await request(app).get(`/oob/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa`) + + expect(response.statusCode).toBe(404) + }) + }) + + describe('Create out of band invitation', () => { + test('should return out of band invitation', async () => { + jest.spyOn(bobAgent.oob, 'createInvitation').mockResolvedValueOnce(outOfBandRecord) + + const response = await request(app).post('/oob/create-invitation') + + expect(response.statusCode).toBe(200) + expect(response.body).toEqual({ + invitationUrl: outOfBandRecord.outOfBandInvitation.toUrl({ + domain: bobAgent.config.endpoints[0], + }), + invitation: outOfBandRecord.outOfBandInvitation.toJSON({ + useLegacyDidSovPrefix: bobAgent.config.useLegacyDidSovPrefix, + }), + outOfBandRecord: outOfBandRecord.toJSON(), + }) + }) + test('should use parameters', async () => { + const spy = jest.spyOn(bobAgent.oob, 'createInvitation').mockResolvedValueOnce(outOfBandRecord) + + // todo: add tests for routing param + const params = { + label: 'string', + alias: 'string', + imageUrl: 'string', + goalCode: 'string', + goal: 'string', + handshake: true, + handshakeProtocols: ['https://didcomm.org/connections/1.0'], + multiUseInvitation: true, + autoAcceptConnection: true, + } + const response = await request(app).post('/oob/create-invitation').send(params) + + expect(response.statusCode).toBe(200) + expect(spy).toHaveBeenCalledWith(params) + }) + }) + + describe('Create legacy invitation', () => { + test('should return out of band invitation', async () => { + jest.spyOn(bobAgent.oob, 'createLegacyInvitation').mockResolvedValueOnce({ + outOfBandRecord: outOfBandRecord, + invitation: outOfBandInvitation, + }) + + const response = await request(app).post('/oob/create-legacy-invitation') + + expect(response.statusCode).toBe(200) + expect(response.body).toEqual({ + invitationUrl: outOfBandInvitation.toUrl({ + domain: bobAgent.config.endpoints[0], + }), + invitation: outOfBandInvitation.toJSON({ + useLegacyDidSovPrefix: bobAgent.config.useLegacyDidSovPrefix, + }), + outOfBandRecord: outOfBandRecord.toJSON(), + }) + }) + test('should use parameters', async () => { + const spy = jest.spyOn(bobAgent.oob, 'createLegacyInvitation').mockResolvedValueOnce({ + outOfBandRecord: outOfBandRecord, + invitation: outOfBandInvitation, + }) + + const params = { + label: 'string', + alias: 'string', + imageUrl: 'string', + multiUseInvitation: true, + autoAcceptConnection: true, + } + const response = await request(app).post('/oob/create-legacy-invitation').send(params) + + expect(response.statusCode).toBe(200) + expect(spy).toHaveBeenCalledWith(params) + }) + }) + + describe('Create legacy connectionless invitation', () => { + const msg = JsonTransformer.fromJSON( + { + '@id': 'eac4ff4e-b4fb-4c1d-aef3-b29c89d1cc00', + '@type': 'https://didcomm.org/connections/1.0/invitation', + }, + AgentMessage + ) + + const inputParams = { + domain: 'string', + message: { + '@id': 'eac4ff4e-b4fb-4c1d-aef3-b29c89d1cc00', + '@type': 'https://didcomm.org/connections/1.0/invitation', + }, + recordId: 'string', + } + + test('should return out of band invitation', async () => { + const spy = jest.spyOn(bobAgent.oob, 'createLegacyConnectionlessInvitation').mockResolvedValueOnce({ + message: msg, + invitationUrl: 'https://example.com/invitation', + }) + + const getResult = (): Promise => spy.mock.results[0].value + + const response = await request(app).post('/oob/create-legacy-connectionless-invitation').send(inputParams) + + expect(response.statusCode).toBe(200) + expect(response.body).toEqual(objectToJson(await getResult())) + }) + test('should use parameters', async () => { + const spy = jest.spyOn(bobAgent.oob, 'createLegacyConnectionlessInvitation').mockResolvedValueOnce({ + message: msg, + invitationUrl: 'https://example.com/invitation', + }) + + const response = await request(app).post('/oob/create-legacy-connectionless-invitation').send(inputParams) + + expect(response.statusCode).toBe(200) + expect(spy).toHaveBeenCalledWith({ + ...inputParams, + message: msg, + }) + }) + }) + + describe('Receive out of band invitation', () => { + test('should return out of band invitation', async () => { + const spy = jest.spyOn(bobAgent.oob, 'receiveInvitation').mockResolvedValueOnce({ + outOfBandRecord: outOfBandRecord, + connectionRecord: connectionRecord, + }) + const getResult = (): Promise => spy.mock.results[0].value + + const response = await request(app) + .post('/oob/receive-invitation') + .send({ invitation: outOfBandRecord.outOfBandInvitation }) + + expect(response.statusCode).toBe(200) + expect(response.body).toEqual(objectToJson(await getResult())) + }) + test('should use parameters', async () => { + const spy = jest.spyOn(bobAgent.oob, 'receiveInvitation').mockResolvedValueOnce({ + outOfBandRecord: outOfBandRecord, + connectionRecord: connectionRecord, + }) + + // todo: add tests for routing param + const params = { + label: 'test', + alias: 'test', + imageUrl: 'test', + autoAcceptInvitation: false, + autoAcceptConnection: false, + reuseConnection: false, + } + + const response = await request(app) + .post('/oob/receive-invitation') + .send({ + invitation: outOfBandInvitation, + ...params, + }) + + expect(response.statusCode).toBe(200) + expect(spy).toHaveBeenCalledWith( + expect.anything(), + expect.objectContaining({ + label: params.label, + alias: params.alias, + imageUrl: params.imageUrl, + autoAcceptInvitation: params.autoAcceptInvitation, + autoAcceptConnection: params.autoAcceptConnection, + reuseConnection: params.reuseConnection, + }) + ) + }) + }) + + describe('Receive out of band invitation by url', () => { + test('should return out of band invitation', async () => { + const spy = jest.spyOn(bobAgent.oob, 'receiveInvitationFromUrl').mockResolvedValueOnce({ + outOfBandRecord: outOfBandRecord, + connectionRecord: connectionRecord, + }) + const getResult = (): Promise => spy.mock.results[0].value + + const response = await request(app) + .post('/oob/receive-invitation-url') + .send({ invitationUrl: 'https://example.com/test' }) + + expect(response.statusCode).toBe(200) + expect(response.body).toEqual(objectToJson(await getResult())) + }) + test('should use parameters', async () => { + const spy = jest.spyOn(bobAgent.oob, 'receiveInvitationFromUrl').mockResolvedValueOnce({ + outOfBandRecord: outOfBandRecord, + connectionRecord: connectionRecord, + }) + + // todo: add tests for routing param + const params = { + label: 'test', + alias: 'test', + imageUrl: 'test', + autoAcceptInvitation: false, + autoAcceptConnection: false, + reuseConnection: false, + } + + const response = await request(app) + .post('/oob/receive-invitation-url') + .send({ invitationUrl: 'https://example.com/test', ...params }) + + expect(response.statusCode).toBe(200) + expect(spy).toHaveBeenCalledWith( + expect.stringMatching('https://example.com/test'), + expect.objectContaining({ + label: params.label, + alias: params.alias, + imageUrl: params.imageUrl, + autoAcceptInvitation: params.autoAcceptInvitation, + autoAcceptConnection: params.autoAcceptConnection, + reuseConnection: params.reuseConnection, + }) + ) + }) + }) + + describe('Accept out of band invitation', () => { + test('should return record from accepted invitation', async () => { + const spy = jest.spyOn(bobAgent.oob, 'acceptInvitation').mockResolvedValueOnce({ + outOfBandRecord: outOfBandRecord, + connectionRecord: connectionRecord, + }) + const getResult = (): Promise => spy.mock.results[0].value + + // todo: add tests for routing param + const params = { + autoAcceptConnection: false, + reuseConnection: false, + label: 'test', + alias: 'test', + imageUrl: 'test', + mediatorId: 'test', + } + + const response = await request(app) + .post('/oob/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/accept-invitation') + .send(params) + + expect(response.statusCode).toBe(200) + expect(response.body).toEqual(objectToJson(await getResult())) + }) + test('should use parameters', async () => { + const spy = jest.spyOn(bobAgent.oob, 'acceptInvitation').mockResolvedValueOnce({ + outOfBandRecord: outOfBandRecord, + connectionRecord: connectionRecord, + }) + + // todo: add tests for routing param + const params = { + autoAcceptConnection: false, + reuseConnection: false, + label: 'test', + alias: 'test', + imageUrl: 'test', + mediatorId: 'test', + } + + const response = await request(app) + .post('/oob/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/accept-invitation') + .send(params) + + expect(response.statusCode).toBe(200) + expect(spy).toHaveBeenCalledWith('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', params) + }) + test('should throw 404 if out of band record is not found', async () => { + const response = await request(app).post('/oob/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/accept-invitation') + + expect(response.statusCode).toBe(404) + }) + }) + + describe('Delete out of band record', () => { + test('should return 204 if record is successfully deleted', async () => { + jest.spyOn(bobAgent.oob, 'deleteById').mockResolvedValueOnce() + + const response = await request(app).delete('/oob/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa') + + expect(response.statusCode).toBe(204) + }) + }) + + afterAll(async () => { + await aliceAgent.shutdown() + await aliceAgent.wallet.delete() + await bobAgent.shutdown() + await bobAgent.wallet.delete() + }) +}) diff --git a/packages/rest/tests/proof.test.ts b/packages/rest/tests/proof.test.ts index d23c2fbc..acccbf5e 100644 --- a/packages/rest/tests/proof.test.ts +++ b/packages/rest/tests/proof.test.ts @@ -1,27 +1,24 @@ -import type { Agent, ProofRecord, ProofRequest } from '@aries-framework/core' +import type { Agent, ProofRecord } from '@aries-framework/core' import type { Express } from 'express' import request from 'supertest' import { setupServer } from '../src/server' -import { getTestAgent, getTestProof, getTestProofRequest, objectToJson } from './utils/helpers' +import { getTestAgent, getTestProof, objectToJson } from './utils/helpers' describe('ProofController', () => { let app: Express - let bobAgent: Agent let aliceAgent: Agent + let bobAgent: Agent let testProof: ProofRecord - let testRequest: ProofRequest beforeAll(async () => { - aliceAgent = await getTestAgent('Rest Proof Test Alice', 3008) - bobAgent = await getTestAgent('Rest Proof Test Bob', 3009) - + aliceAgent = await getTestAgent('Proof REST Agent Test Alice', 3032) + bobAgent = await getTestAgent('Proof REST Agent Test Bob', 3912) app = await setupServer(bobAgent, { port: 3000 }) testProof = getTestProof() - testRequest = getTestProofRequest() }) afterEach(() => { @@ -39,6 +36,7 @@ describe('ProofController', () => { expect(response.statusCode).toBe(200) expect(response.body).toEqual(result.map(objectToJson)) }) + test('should optionally filter on threadId', async () => { const spy = jest.spyOn(bobAgent.proofs, 'getAll').mockResolvedValueOnce([testProof]) const getResult = (): Promise => spy.mock.results[0].value @@ -49,6 +47,7 @@ describe('ProofController', () => { expect(response.statusCode).toBe(200) expect(response.body).toEqual(result.map(objectToJson)) }) + test('should return empty array if nothing found', async () => { jest.spyOn(bobAgent.proofs, 'getAll').mockResolvedValueOnce([testProof]) @@ -70,6 +69,7 @@ describe('ProofController', () => { expect(spy).toHaveBeenCalledWith(testProof.id) expect(response.body).toEqual(objectToJson(await getResult())) }) + test('should return 404 not found when proof record not found', async () => { const response = await request(app).get(`/proofs/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa`) @@ -86,47 +86,45 @@ describe('ProofController', () => { }) describe('Propose proof', () => { - const proposalReq = { + const proposalRequest = { connectionId: '123456aa-aa78-90a1-aa23-456a7da89010', - attributes: { - additionalProp1: { + attributes: [ + { name: 'test', - restrictions: [ - { - credentialDefinitionId: 'WghBqNdoFjaYh6F5N9eBF:3:CL:3210:test', - }, - ], + credentialDefinitionId: 'WghBqNdoFjaYh6F5N9eBF:3:CL:3210:test', }, - }, + ], + predicates: [], comment: 'test', } test('should return proof record', async () => { const spy = jest.spyOn(bobAgent.proofs, 'proposeProof').mockResolvedValueOnce(testProof) const getResult = (): Promise => spy.mock.results[0].value - const response = await request(app).post('/proofs/propose-proof').send(proposalReq) + const response = await request(app).post('/proofs/propose-proof').send(proposalRequest) expect(spy).toHaveBeenCalledWith( - expect.stringContaining(proposalReq.connectionId), + expect.stringContaining(proposalRequest.connectionId), expect.objectContaining({ - attributes: proposalReq.attributes, + attributes: proposalRequest.attributes, }), expect.objectContaining({ - comment: proposalReq.comment, + comment: proposalRequest.comment, }) ) expect(response.statusCode).toBe(200) expect(response.body).toEqual(objectToJson(await getResult())) }) + test('should give 404 not found when connection is not found', async () => { - const response = await request(app).post('/proofs/propose-proof').send(proposalReq) + const response = await request(app).post('/proofs/propose-proof').send(proposalRequest) expect(response.statusCode).toBe(404) }) }) describe('Accept proof proposal', () => { - const acceptReq = { + const acceptRequest = { request: { name: 'string', version: 'string', @@ -139,14 +137,15 @@ describe('ProofController', () => { const spy = jest.spyOn(bobAgent.proofs, 'acceptProposal').mockResolvedValueOnce(testProof) const getResult = (): Promise => spy.mock.results[0].value - const response = await request(app).post(`/proofs/${testProof.id}/accept-proposal`).send(acceptReq) + const response = await request(app).post(`/proofs/${testProof.id}/accept-proposal`).send(acceptRequest) - expect(spy).toHaveBeenCalledWith(testProof.id, acceptReq) + expect(spy).toHaveBeenCalledWith(testProof.id, acceptRequest) expect(response.statusCode).toBe(200) expect(response.body).toEqual(objectToJson(await getResult())) }) + test('should give 404 not found when proof is not found', async () => { - const response = await request(app).post(`/proofs/${testProof.id}/accept-proposal`).send(acceptReq) + const response = await request(app).post(`/proofs/${testProof.id}/accept-proposal`).send(acceptRequest) expect(response.statusCode).toBe(404) }) @@ -156,10 +155,20 @@ describe('ProofController', () => { test('should return proof record', async () => { const response = await request(app) .post(`/proofs/request-outofband-proof`) - .send({ connectionId: 'string', proofRequest: testRequest }) + .send({ + proofRequestOptions: { + name: 'string', + version: '1.0', + requestedAttributes: { + additionalProp1: { + name: 'string', + }, + }, + }, + }) expect(response.statusCode).toBe(200) - expect(response.body.message).toBeDefined() + expect(response.body.proofUrl).toBeDefined() expect(response.body.proofRecord).toBeDefined() }) }) @@ -171,15 +180,40 @@ describe('ProofController', () => { const response = await request(app) .post(`/proofs/request-proof`) - .send({ connectionId: 'string', proofRequest: testRequest }) + .send({ + connectionId: 'string', + proofRequestOptions: { + name: 'string', + version: '1.0', + requestedAttributes: { + additionalProp1: { + name: 'string', + }, + }, + requestedPredicates: {}, + }, + }) expect(response.statusCode).toBe(200) expect(response.body).toEqual(objectToJson(await getResult())) }) + test('should give 404 not found when connection is not found', async () => { const response = await request(app) .post(`/proofs/request-proof`) - .send({ connectionId: 'string', proofRequest: testRequest }) + .send({ + connectionId: 'string', + proofRequestOptions: { + name: 'string', + version: '1.0', + requestedAttributes: { + additionalProp1: { + name: 'string', + }, + }, + requestedPredicates: {}, + }, + }) expect(response.statusCode).toBe(404) }) @@ -196,6 +230,7 @@ describe('ProofController', () => { expect(response.statusCode).toBe(200) expect(response.body).toEqual(objectToJson(await getResult())) }) + test('should give 404 not found when proof is not found', async () => { const response = await request(app).post('/proofs/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/accept-presentation') diff --git a/packages/rest/tests/schema.test.ts b/packages/rest/tests/schema.test.ts index 58482fcd..9e080118 100644 --- a/packages/rest/tests/schema.test.ts +++ b/packages/rest/tests/schema.test.ts @@ -12,7 +12,7 @@ describe('AgentController', () => { let agent: Agent beforeAll(async () => { - agent = await getTestAgent('Rest Schema Test', 3010) + agent = await getTestAgent('Schema REST Agent Test', 3021) app = await setupServer(agent, { port: 3000 }) }) @@ -82,7 +82,7 @@ describe('AgentController', () => { version: '1.0', }) - expect(response.statusCode).toBe(400) + expect(response.statusCode).toBe(422) }) }) diff --git a/packages/rest/tests/utils/helpers.ts b/packages/rest/tests/utils/helpers.ts index cfa519a6..91bc0cb5 100644 --- a/packages/rest/tests/utils/helpers.ts +++ b/packages/rest/tests/utils/helpers.ts @@ -1,18 +1,23 @@ +import type { ConnectionRecordProps } from '@aries-framework/core' + import { - CredentialRecord, + OutOfBandInvitation, + OutOfBandRecord, + ConnectionRecord, + CredentialExchangeRecord, + DidExchangeRole, + DidExchangeState, JsonTransformer, - OfferCredentialMessage, ProofRecord, - ProofRequest, } from '@aries-framework/core' import { JsonEncoder } from '@aries-framework/core/build/utils/JsonEncoder' -import { setupAgent } from './agent' +import { setupAgent } from '../../src/utils/agent' export async function getTestAgent(name: string, port: number) { return await setupAgent({ port: port, - publicDidSeed: 'testtesttesttesttesttesttesttest', + publicDidSeed: '00000000000000000000000000000000', endpoints: [`http://localhost:${port}`], name: name, }) @@ -23,6 +28,62 @@ export function objectToJson(result: T) { return JsonEncoder.fromString(serialized) } +export function getTestOutOfBandInvitation() { + const json = { + '@type': 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/invitation', + '@id': 'd6472943-e5d0-4d95-8b48-790ed5a41931', + label: 'Aries Test Agent', + goal: 'string', + imageUrl: 'https://example.com/image-url', + accept: ['didcomm/aip1', 'didcomm/aip2;env=rfc19'], + handshake_protocols: ['https://didcomm.org/didexchange/1.0', 'https://didcomm.org/connections/1.0'], + services: [ + { + id: '#inline-0', + serviceEndpoint: 'https://6b77-89-20-162-146.ngrok.io', + type: 'did-communication', + recipientKeys: ['did:key:z6MkmTBHTWrvLPN8pBmUj7Ye5ww9GiacXCYMNVvpScSpf1DM'], + routingKeys: [], + }, + ], + } + return JsonTransformer.fromJSON(json, OutOfBandInvitation) +} + +export function getTestOutOfBandRecord() { + const json = { + _tags: { + invitationId: '1cbd22e4-1906-41e9-8807-83d84437f978', + state: 'await-response', + role: 'sender', + recipientKeyFingerprints: ['z6MktUCPZjfRJXD4GMcYuXiqX2qZ8vBw6UAYpDFiHEUfwuLj'], + }, + metadata: {}, + id: '42a95528-0e30-4f86-a462-0efb02178b53', + createdAt: new Date('2022-01-01T00:00:00.000Z'), + outOfBandInvitation: { + '@type': 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/out-of-band/1.1/invitation', + '@id': 'd6472943-e5d0-4d95-8b48-790ed5a41931', + label: 'Aries Test Agent', + accept: ['didcomm/aip1', 'didcomm/aip2;env=rfc19'], + handshake_protocols: ['https://didcomm.org/didexchange/1.0', 'https://didcomm.org/connections/1.0'], + services: [ + { + id: '#inline-0', + serviceEndpoint: 'https://6b77-89-20-162-146.ngrok.io', + type: 'did-communication', + recipientKeys: ['did:key:z6MkmTBHTWrvLPN8pBmUj7Ye5ww9GiacXCYMNVvpScSpf1DM'], + routingKeys: [], + }, + ], + }, + role: 'sender', + state: 'await-response', + reusable: false, + } + return JsonTransformer.fromJSON(json, OutOfBandRecord) +} + export function getTestCredential() { const json = { _tags: { @@ -32,7 +93,7 @@ export function getTestCredential() { }, type: 'CredentialRecord', id: '222222aa-aa22-22a2-aa22-222a2aa22222', - createdAt: '2021-01-01T00:0:00.000Z', + createdAt: '2021-01-01T00:00:00.000Z', state: 'string', connectionId: '000000aa-aa00-00a0-aa00-000a0aa00000', metadata: { @@ -73,26 +134,7 @@ export function getTestCredential() { ], } - return JsonTransformer.fromJSON(json, CredentialRecord) -} - -export function getTestCredentialOfferMsg() { - const offerMsg = { - '@type': 'https://didcomm.org/issue-credential/1.0/offer-credential', - id: 'string', - credentialPreview: { - '@type': 'https://didcomm.org/issue-credential/1.0/credential-preview', - attributes: [ - { - 'mime-type': 'text/plain', - name: 'name', - value: 'test', - }, - ], - }, - } - - return JsonTransformer.fromJSON(offerMsg, OfferCredentialMessage) + return JsonTransformer.fromJSON(json, CredentialExchangeRecord) } export function getTestCredDef() { @@ -127,7 +169,7 @@ export function getTestProof() { }, type: 'ProofRecord', id: '222222aa-aa22-22a2-aa22-222a2aa22222', - createdAt: '2021-01-01T00:0:00.000Z', + createdAt: '2021-01-01T00:00:00.000Z', requestMessage: { type: 'https://didcomm.org/present-proof/1.0/request-presentation', id: '333333aa-aa33-33a3-aa33-333a3aa33333', @@ -168,18 +210,24 @@ export function getTestProof() { return JsonTransformer.fromJSON(json, ProofRecord) } -export function getTestProofRequest() { - const json = { - name: 'string', - version: 'string', - nonce: 'string', - requestedAttributes: { - additionalProp1: { - name: 'string', - }, - }, - requestedPredicates: {}, - ver: '1.0', - } - return JsonTransformer.fromJSON(json, ProofRequest) +export function getTestConnection({ + state = DidExchangeState.InvitationReceived, + role = DidExchangeRole.Requester, + id = 'test', + did = 'test-did', + threadId = 'threadId', + tags = {}, + theirLabel, + theirDid = 'their-did', +}: Partial = {}) { + return new ConnectionRecord({ + did, + threadId, + theirDid, + id, + role, + state, + tags, + theirLabel, + }) } diff --git a/packages/rest/tests/webhook.test.ts b/packages/rest/tests/webhook.test.ts index b4c8db6f..9ee61ba9 100644 --- a/packages/rest/tests/webhook.test.ts +++ b/packages/rest/tests/webhook.test.ts @@ -1,47 +1,45 @@ -import type { WebhookData } from './utils/webhook' +/* eslint-disable @typescript-eslint/no-non-null-assertion */ +import type { WebhookData } from '../src/utils/webhook' import type { Agent, CredentialStateChangedEvent, ProofStateChangedEvent } from '@aries-framework/core' import type { Server } from 'http' import { + CredentialExchangeRecord, ProofEventTypes, ProofState, ProofRecord, CredentialState, - CredentialRecord, CredentialEventTypes, } from '@aries-framework/core' import { EventEmitter } from '@aries-framework/core/build/agent/EventEmitter' import { setupServer } from '../src/server' +import { sleep, webhookListener } from '../src/utils/webhook' import { getTestAgent } from './utils/helpers' -import { sleep, webhookListener } from './utils/webhook' describe('WebhookTest', () => { - let agent: Agent + let aliceAgent: Agent + let bobAgent: Agent let server: Server const webhooks: WebhookData[] = [] - beforeEach(async () => { - agent = await getTestAgent('Rest Webhook Test Bob', 3012) - server = await webhookListener(3000, webhooks) - await setupServer(agent, { webhookUrl: 'http://localhost:3000', port: 3013 }) - }) - - afterEach(async () => { - await agent.shutdown() - await agent.wallet.delete() - server.close() + beforeAll(async () => { + aliceAgent = await getTestAgent('Webhook REST Agent Test Alice', 3042) + bobAgent = await getTestAgent('Webhook REST Agent Bob', 3043) + server = await webhookListener(3044, webhooks) + await setupServer(bobAgent, { webhookUrl: 'http://localhost:3044', port: 3000 }) }) test('should return a webhook event when basic message state changed', async () => { - const { invitation } = await agent.connections.createConnection() - const { id } = await agent.connections.receiveInvitation(invitation) + const { outOfBandInvitation } = await aliceAgent.oob.createInvitation() + const { connectionRecord } = await bobAgent.oob.receiveInvitation(outOfBandInvitation) + const connection = await bobAgent.connections.returnWhenIsConnected(connectionRecord!.id) - await agent.basicMessages.sendMessage(id, 'Hello') + await bobAgent.basicMessages.sendMessage(connection.id, 'Hello') /* - * we sleep here to wait for the event to have processed and sent out + * A sleep is placed here to wait for the event to have processed and sent out * an webhook first before searching for the webhook */ await sleep(100) @@ -52,34 +50,33 @@ describe('WebhookTest', () => { }) test('should return a webhook event when connection state changed', async () => { - const { connectionRecord } = await agent.connections.createConnection() + const { outOfBandInvitation } = await aliceAgent.oob.createInvitation() + const { connectionRecord } = await bobAgent.oob.receiveInvitation(outOfBandInvitation) + const connection = await bobAgent.connections.returnWhenIsConnected(connectionRecord!.id) /* - * we sleep here to wait for the event to have processed and sent out + * A sleep is placed here to wait for the event to have processed and sent out * an webhook first before searching for the webhook */ await sleep(100) const webhook = webhooks.find( (webhook) => - webhook.topic === 'connections' && - webhook.body.id === connectionRecord.id && - webhook.body.state === connectionRecord.state + webhook.topic === 'connections' && webhook.body.id === connection.id && webhook.body.state === connection.state ) - expect(JSON.parse(JSON.stringify(connectionRecord.toJSON()))).toMatchObject( - webhook?.body as Record - ) + expect(JSON.parse(JSON.stringify(connection.toJSON()))).toMatchObject(webhook?.body as Record) }) test('should return a webhook event when credential state changed', async () => { - const credentialRecord = new CredentialRecord({ + const credentialRecord = new CredentialExchangeRecord({ id: 'testest', state: CredentialState.OfferSent, threadId: 'random', + protocolVersion: 'v1', }) - const eventEmitter = agent.injectionContainer.resolve(EventEmitter) + const eventEmitter = bobAgent.injectionContainer.resolve(EventEmitter) eventEmitter.emit({ type: CredentialEventTypes.CredentialStateChanged, payload: { @@ -89,7 +86,7 @@ describe('WebhookTest', () => { }) /* - * we sleep here to wait for the event to have processed and sent out + * A sleep is placed here to wait for the event to have processed and sent out * an webhook first before searching for the webhook */ await sleep(100) @@ -113,7 +110,7 @@ describe('WebhookTest', () => { threadId: 'random', }) - const eventEmitter = agent.injectionContainer.resolve(EventEmitter) + const eventEmitter = bobAgent.injectionContainer.resolve(EventEmitter) eventEmitter.emit({ type: ProofEventTypes.ProofStateChanged, payload: { @@ -123,7 +120,7 @@ describe('WebhookTest', () => { }) /* - * we sleep here to wait for the event to have processed and sent out + * A sleep is placed here to wait for the event to have processed and sent out * an webhook first before searching for the webhook */ await sleep(100) @@ -135,4 +132,12 @@ describe('WebhookTest', () => { expect(JSON.parse(JSON.stringify(proofRecord.toJSON()))).toMatchObject(webhook?.body as Record) }) + + afterAll(async () => { + await aliceAgent.shutdown() + await aliceAgent.wallet.delete() + await bobAgent.shutdown() + await bobAgent.wallet.delete() + server.close() + }) }) diff --git a/packages/rest/tsconfig.build.json b/packages/rest/tsconfig.build.json index fceaaf90..cc459f84 100644 --- a/packages/rest/tsconfig.build.json +++ b/packages/rest/tsconfig.build.json @@ -6,5 +6,5 @@ "types": [] }, - "include": ["src/**/*"] + "include": ["src/**/*", "src/routes", "tsoa.json"] } diff --git a/packages/rest/tsoa.json b/packages/rest/tsoa.json new file mode 100644 index 00000000..098f7e42 --- /dev/null +++ b/packages/rest/tsoa.json @@ -0,0 +1,13 @@ +{ + "entryFile": "src/index.ts", + "noImplicitAdditionalProperties": "throw-on-extras", + "controllerPathGlobs": ["src/**/*Controller.ts"], + "spec": { + "outputDirectory": "src/routes", + "specVersion": 3 + }, + "routes": { + "routesDir": "src/routes", + "iocModule": "./src/utils/tsyringeTsoaIocContainer" + } +} diff --git a/yarn.lock b/yarn.lock index bd110d90..27d7f7ea 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10,38 +10,40 @@ "@jridgewell/gen-mapping" "^0.1.0" "@jridgewell/trace-mapping" "^0.3.9" -"@aries-framework/core@0.1.0", "@aries-framework/core@^0.1.0": - version "0.1.0" - resolved "https://registry.yarnpkg.com/@aries-framework/core/-/core-0.1.0.tgz#704e349be6df42bff9c177438b08c03acb8e1611" - integrity sha512-NwlPgDKh7f6N0wVB6SvDh7Vr2nZJKGR4+v+8OJCB/Wx7sIAfL8MyLCMEhxkdRF+uIB1QjTzHQ2k9ID0K/NNQQQ== +"@aries-framework/core@0.2.1", "@aries-framework/core@^0.2.0": + version "0.2.1" + resolved "https://registry.yarnpkg.com/@aries-framework/core/-/core-0.2.1.tgz#67b78558ff3cc71d7fac3036154238a225f2d890" + integrity sha512-FI1IEfaDxYt2w1pfbqpyEvukyOQOmL82T6Bl89FsYyzT8/00cfPSNDlNV3DnKgpyqT3IpdjaQnDqUtnefwNAOg== dependencies: "@multiformats/base-x" "^4.0.1" - "@types/indy-sdk" "^1.16.6" + "@stablelib/ed25519" "^1.0.2" + "@stablelib/sha256" "^1.0.1" + "@types/indy-sdk" "^1.16.19" "@types/node-fetch" "^2.5.10" - "@types/ws" "^7.4.4" + "@types/ws" "^7.4.6" abort-controller "^3.0.0" bn.js "^5.2.0" borc "^3.0.0" buffer "^6.0.3" class-transformer "0.5.1" class-validator "0.13.1" - js-sha256 "^0.9.0" + did-resolver "^3.1.3" lru_map "^0.4.1" luxon "^1.27.0" make-error "^1.3.6" - multibase "^4.0.4" - multihashes "^4.0.2" object-inspect "^1.10.3" query-string "^7.0.1" reflect-metadata "^0.1.13" - rxjs "^7.1.0" + rxjs "^7.2.0" tsyringe "^4.5.0" uuid "^8.3.2" + varint "^6.0.0" + web-did-resolver "^2.0.8" -"@aries-framework/core@0.2.1", "@aries-framework/core@^0.2.0": - version "0.2.1" - resolved "https://registry.yarnpkg.com/@aries-framework/core/-/core-0.2.1.tgz#67b78558ff3cc71d7fac3036154238a225f2d890" - integrity sha512-FI1IEfaDxYt2w1pfbqpyEvukyOQOmL82T6Bl89FsYyzT8/00cfPSNDlNV3DnKgpyqT3IpdjaQnDqUtnefwNAOg== +"@aries-framework/core@0.2.3", "@aries-framework/core@^0.2.3": + version "0.2.3" + resolved "https://registry.yarnpkg.com/@aries-framework/core/-/core-0.2.3.tgz#c7bfef6ed82c4bf462e1f02e11e0c3144e345a1d" + integrity sha512-0HtxidljOFhBMdXCx0p/rkO285d8tMreJYBHlNyVXYnPNAYw/OBDqfSxloMYf13kJfq/3AL0XZkoQOepuLZdrw== dependencies: "@multiformats/base-x" "^4.0.1" "@stablelib/ed25519" "^1.0.2" @@ -68,23 +70,25 @@ varint "^6.0.0" web-did-resolver "^2.0.8" -"@aries-framework/node@^0.1.0": - version "0.1.0" - resolved "https://registry.yarnpkg.com/@aries-framework/node/-/node-0.1.0.tgz#07cd29ba1ac0703d9dae64b6eaf9c1ce642e35d8" - integrity sha512-ejqmIiTiIOo1xCH826ZHOUtIUB9ysvHZQuXgNc6FNqnmN2p50Z+xBJEtzz8qD4GJ1E4v3woXUG1FE8IOOQKf9A== +"@aries-framework/node@^0.2.0": + version "0.2.1" + resolved "https://registry.yarnpkg.com/@aries-framework/node/-/node-0.2.1.tgz#fdebbbf82dde618ababb064a009cde2769d1a591" + integrity sha512-hxPIvcUtIsM5n0U0KOWwscKSX3bzZkC9EpsIJBnDljL4xMbu2SF7GV/+xwvLAGTeeJ4o03ZOyTyk5DDEYnSwBg== dependencies: - "@aries-framework/core" "0.1.0" + "@aries-framework/core" "0.2.1" express "^4.17.1" + ffi-napi "^4.0.3" indy-sdk "^1.16.0-dev-1636" node-fetch "^2.6.1" + ref-napi "^3.0.3" ws "^7.5.3" -"@aries-framework/node@^0.2.0": - version "0.2.1" - resolved "https://registry.yarnpkg.com/@aries-framework/node/-/node-0.2.1.tgz#fdebbbf82dde618ababb064a009cde2769d1a591" - integrity sha512-hxPIvcUtIsM5n0U0KOWwscKSX3bzZkC9EpsIJBnDljL4xMbu2SF7GV/+xwvLAGTeeJ4o03ZOyTyk5DDEYnSwBg== +"@aries-framework/node@^0.2.3": + version "0.2.3" + resolved "https://registry.yarnpkg.com/@aries-framework/node/-/node-0.2.3.tgz#9ad0d1b2ed52bb5ae3139e8911af9e3f7b8667f3" + integrity sha512-l1AZi/jAM/THyTPn3HlddYo+aj4uiIuxrzR0Vx3dBPA3dqmuzkCEOOjR4HlqheTMaxY+pkxZ1v865nwcBPo44A== dependencies: - "@aries-framework/core" "0.2.1" + "@aries-framework/core" "0.2.3" express "^4.17.1" ffi-napi "^4.0.3" indy-sdk "^1.16.0-dev-1636" @@ -812,6 +816,32 @@ resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.3.tgz#472eaab5f15c1ffdd7f8628bd4c4f753995ec79e" integrity sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ== +"@tsoa/cli@^4.1.2": + version "4.1.2" + resolved "https://registry.yarnpkg.com/@tsoa/cli/-/cli-4.1.2.tgz#5ee5231a6661cb23a6d3a6882e3ccf294e4105f7" + integrity sha512-0Q7c0oygbmzksPAqtXTlc8Ta8oj8Zo5VjOtQA9SvHFkWwgtJ0rpm+S0Ia90G6lFznLO/3vuxjfxMIvRYQ5JiGA== + dependencies: + "@tsoa/runtime" "^4.1.2" + deepmerge "^4.2.2" + fs-extra "^8.1.0" + glob "^7.1.6" + handlebars "^4.7.7" + merge "^2.1.0" + minimatch "^3.0.4" + typescript "<4.8.0" + validator "^13.6.0" + yamljs "^0.3.0" + yargs "^15.4.1" + +"@tsoa/runtime@^4.1.2": + version "4.1.2" + resolved "https://registry.yarnpkg.com/@tsoa/runtime/-/runtime-4.1.2.tgz#6e9872cb8da12e690b997c59f17842ef2f2c30f0" + integrity sha512-vOQkh9ujvUsR5Orwho9FZbXIAXLUKRFyIygU6t2kdrMcNiOHYemKGAJjyHcgJrpAGix3cmTF1RwsyCDbZEtP4g== + dependencies: + promise.any "^2.0.2" + reflect-metadata "^0.1.13" + validator "^13.6.0" + "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.14": version "7.1.19" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.19.tgz#7b497495b7d1b4812bdb9d02804d0576f43ee460" @@ -845,7 +875,7 @@ dependencies: "@babel/types" "^7.3.0" -"@types/body-parser@*": +"@types/body-parser@*", "@types/body-parser@^1.19.2": version "1.19.2" resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.2.tgz#aea2059e28b7658639081347ac4fab3de166e6f0" integrity sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g== @@ -875,6 +905,11 @@ resolved "https://registry.yarnpkg.com/@types/cookiejar/-/cookiejar-2.1.2.tgz#66ad9331f63fe8a3d3d9d8c6e3906dd10f6446e8" integrity sha512-t73xJJrvdTjXrn4jLS9VSGRbz0nUY3cl2DMGDU48lKl+HR9dbbjW2A9r3g40VA++mQpy6uuHg33gy7du2BKpog== +"@types/cors@^2.8.12": + version "2.8.12" + resolved "https://registry.yarnpkg.com/@types/cors/-/cors-2.8.12.tgz#6b2c510a7ad7039e98e7b8d3d6598f4359e5c080" + integrity sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw== + "@types/eslint@^8.2.1": version "8.4.5" resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.4.5.tgz#acdfb7dd36b91cc5d812d7c093811a8f3d9b31e4" @@ -927,7 +962,7 @@ resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz#0ea7b61496902b95890dc4c3a116b60cb8dae812" integrity sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ== -"@types/indy-sdk@1.16.9", "@types/indy-sdk@^1.16.19", "@types/indy-sdk@^1.16.6": +"@types/indy-sdk@1.16.9", "@types/indy-sdk@^1.16.19": version "1.16.9" resolved "https://registry.yarnpkg.com/@types/indy-sdk/-/indy-sdk-1.16.9.tgz#647a77ead1e93c77b2b0ef5f2c399ba2ea461b89" integrity sha512-X8fdwcGaXfCxayBOb4NUny37JDd9Q3ZDKnm7WBhPRcdOXw3kmsy+WX52751nJQRBcltu883rbqYAIzcZE83XRA== @@ -988,6 +1023,13 @@ resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.2.tgz#93e25bf9ee75fe0fd80b594bc4feb0e862111b5a" integrity sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw== +"@types/multer@^1.4.7": + version "1.4.7" + resolved "https://registry.yarnpkg.com/@types/multer/-/multer-1.4.7.tgz#89cf03547c28c7bbcc726f029e2a76a7232cc79e" + integrity sha512-/SNsDidUFCvqqcWDwxv2feww/yqhNeTRL5CVoL3jU4Goc4kKEL10T7Eye65ZqPNi4HRx8sAEX59pV1aEH7drNA== + dependencies: + "@types/express" "*" + "@types/node-fetch@^2.5.10": version "2.6.2" resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.2.tgz#d1a9c5fd049d9415dce61571557104dec3ec81da" @@ -1006,11 +1048,6 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.43.tgz#555e5a743f76b6b897d47f945305b618525ddbe6" integrity sha512-GqWykok+3uocgfAJM8imbozrqLnPyTrpFlrryURQlw1EesPUCx5XxTiucWDSFF9/NUEXDuD4bnvHm8xfVGWTpQ== -"@types/node@^17.0.41": - version "17.0.45" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.45.tgz#2c0fafd78705e7a18b7906b5201a522719dc5190" - integrity sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw== - "@types/node@^8.10.50": version "8.10.66" resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.66.tgz#dd035d409df322acc83dff62a602f12a5783bbb3" @@ -1123,7 +1160,7 @@ resolved "https://registry.yarnpkg.com/@types/validator/-/validator-13.7.4.tgz#33cc949ee87dd47c63e35ba4ad94f6888852be04" integrity sha512-uAaSWegu2lymY18l+s5nmcXu3sFeeTOl1zhSGoYzcr6T3wz1M+3OcW4UjfPhIhHGd13tIMRDsEpR+d8w/MexwQ== -"@types/ws@^7.4.4", "@types/ws@^7.4.6": +"@types/ws@^7.4.6": version "7.4.7" resolved "https://registry.yarnpkg.com/@types/ws/-/ws-7.4.7.tgz#f7c390a36f7a0679aa69de2d501319f4f8d9b702" integrity sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww== @@ -1253,7 +1290,7 @@ abort-controller@^3.0.0: dependencies: event-target-shim "^5.0.0" -accepts@^1.3.5, accepts@~1.3.8: +accepts@~1.3.8: version "1.3.8" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" integrity sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw== @@ -1359,11 +1396,6 @@ ansi-styles@^5.0.0: resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== -any-promise@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" - integrity sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A== - anymatch@^3.0.3, anymatch@~3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" @@ -1372,16 +1404,6 @@ anymatch@^3.0.3, anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" -append-field@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/append-field/-/append-field-0.1.0.tgz#6ddc58fa083c7bc545d3c5995b2830cc2366d44a" - integrity sha512-8BgHoIwbQZaAQgDZLBu2vQoXHgUpSx4vQK1qv7e6R8YfbiSf4fCaBPJRtM1BaxVn1rIHc5ftv0cklsJ78BkouQ== - -append-field@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/append-field/-/append-field-1.0.0.tgz#1e3440e915f0b1203d23748e78edd7b9b5b43e56" - integrity sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw== - "aproba@^1.0.3 || ^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-2.0.0.tgz#52520b8ae5b569215b354efc0caa3fe1e45a8adc" @@ -1448,6 +1470,17 @@ array.prototype.flat@^1.2.5: es-abstract "^1.19.2" es-shim-unscopables "^1.0.0" +array.prototype.map@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/array.prototype.map/-/array.prototype.map-1.0.4.tgz#0d97b640cfdd036c1b41cfe706a5e699aa0711f2" + integrity sha512-Qds9QnX7A0qISY7JT5WuJO0NJPE9CMlC6JzHQfhpqAAQQzufVRoeH7EzUY5GcPTx72voG8LV/5eo+b8Qi8hmhA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.0" + es-array-method-boxes-properly "^1.0.0" + is-string "^1.0.7" + asap@^2.0.0: version "2.0.6" resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" @@ -1551,7 +1584,7 @@ bn.js@^5.2.0: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== -body-parser@1.20.0, body-parser@^1.19.0: +body-parser@1.20.0, body-parser@^1.20.0: version "1.20.0" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.0.tgz#3de69bd89011c11573d7bfee6a64f11b6bd27cc5" integrity sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg== @@ -1644,14 +1677,6 @@ buffer@^6.0.0, buffer@^6.0.3: base64-js "^1.3.1" ieee754 "^1.2.1" -busboy@^0.2.11: - version "0.2.14" - resolved "https://registry.yarnpkg.com/busboy/-/busboy-0.2.14.tgz#6c2a622efcf47c57bbbe1e2a9c37ad36c7925453" - integrity sha512-InWFDomvlkEj+xWLBfU3AvnbVYqeTWmQopiW0tWWEy5yehYm2YkGEc59sUmw/4ty5Zj/b0WHGs1LgecuBSBGrg== - dependencies: - dicer "0.2.5" - readable-stream "1.1.x" - bytes@3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" @@ -1681,14 +1706,6 @@ cacache@^15.2.0: tar "^6.0.2" unique-filename "^1.1.1" -cache-content-type@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cache-content-type/-/cache-content-type-1.0.1.tgz#035cde2b08ee2129f4a8315ea8f00a00dba1453c" - integrity sha512-IKufZ1o4Ut42YUrZSo8+qnMTrFuKkvyoLXUywKz9GJ5BrhOFGhLdkx9sG4KAnVvbY6kEcSFjLQul+DVmBm2bgA== - dependencies: - mime-types "^2.1.18" - ylru "^1.2.0" - cacheable-lookup@^5.0.3: version "5.0.4" resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz#5a6b865b2c44357be3d5ebc2a467b032719a7005" @@ -1720,7 +1737,7 @@ callsites@^3.0.0: resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== -camelcase@^5.3.1: +camelcase@^5.0.0, camelcase@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== @@ -1792,17 +1809,6 @@ class-transformer@0.5.1: resolved "https://registry.yarnpkg.com/class-transformer/-/class-transformer-0.5.1.tgz#24147d5dffd2a6cea930a3250a677addf96ab336" integrity sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw== -class-validator-jsonschema@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/class-validator-jsonschema/-/class-validator-jsonschema-3.1.1.tgz#5d2dd61428a2382f7d6571e8250b1aa7f9e0e8d3" - integrity sha512-xga/5rTDKaYysivdX6OWaVllAS2OGeXgRRaXRo5QAW+mSDOpbjrf5JhmdPvUKMEkGyQer0gCoferB3COl170Rg== - dependencies: - lodash.groupby "^4.6.0" - lodash.merge "^4.6.2" - openapi3-ts "^2.0.0" - reflect-metadata "^0.1.13" - tslib "^2.0.3" - class-validator@0.13.1: version "0.13.1" resolved "https://registry.yarnpkg.com/class-validator/-/class-validator-0.13.1.tgz#381b2001ee6b9e05afd133671fbdf760da7dec67" @@ -1817,6 +1823,15 @@ clean-stack@^2.0.0: resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== +cliui@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" + integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^6.2.0" + cliui@^7.0.2: version "7.0.4" resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" @@ -1833,16 +1848,6 @@ clone-response@^1.0.2: dependencies: mimic-response "^1.0.0" -co-body@^6.0.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/co-body/-/co-body-6.1.0.tgz#d87a8efc3564f9bfe3aced8ef5cd04c7a8766547" - integrity sha512-m7pOT6CdLN7FuXUcpuz/8lfQ/L77x8SchHCF4G0RBTJO20Wzmhn5Sp4/5WsKy8OSpifBSUrmg83qEqaDHdyFuQ== - dependencies: - inflation "^2.0.0" - qs "^6.5.2" - raw-body "^2.3.3" - type-is "^1.6.16" - co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" @@ -1920,29 +1925,19 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== -concat-stream@^1.5.0, concat-stream@^1.5.2: - version "1.6.2" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" - integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== - dependencies: - buffer-from "^1.0.0" - inherits "^2.0.3" - readable-stream "^2.2.2" - typedarray "^0.0.6" - console-control-strings@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" integrity sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ== -content-disposition@0.5.4, content-disposition@~0.5.2: +content-disposition@0.5.4: version "0.5.4" resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe" integrity sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ== dependencies: safe-buffer "5.2.1" -content-type@^1.0.4, content-type@~1.0.4: +content-type@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== @@ -1968,11 +1963,6 @@ cookie-signature@1.0.6: resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ== -cookie@0.4.2, cookie@^0.4.0: - version "0.4.2" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.2.tgz#0e41f24de5ecf317947c82fc789e06a884824432" - integrity sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA== - cookie@0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" @@ -1983,24 +1973,6 @@ cookiejar@^2.1.3: resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.3.tgz#fc7a6216e408e74414b90230050842dacda75acc" integrity sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ== -cookies@~0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/cookies/-/cookies-0.8.0.tgz#1293ce4b391740a8406e3c9870e828c4b54f3f90" - integrity sha512-8aPsApQfebXnuI+537McwYsDtjVxGm8gTIzQI3FDW6t5t/DAhERxtnbEPN/8RX+uZthoz4eCOgloXaE5cYyNow== - dependencies: - depd "~2.0.0" - keygrip "~1.1.0" - -copy-to@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/copy-to/-/copy-to-2.0.1.tgz#2680fbb8068a48d08656b6098092bdafc906f4a5" - integrity sha512-3DdaFaU/Zf1AnpLiFDeNCD4TOWe3Zl2RZaTzUvWiIk5ERzcCodOE20Vqq4fzCbNoHURFHT4/us/Lfq+S2zyY4w== - -core-util-is@~1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" - integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== - cors@^2.8.5: version "2.8.5" resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.5.tgz#eac11da51592dd86b9f06f6e7ac293b3df875d29" @@ -2082,6 +2054,11 @@ debug@^3.1.0, debug@^3.2.7: dependencies: ms "^2.1.1" +decamelize@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== + decimal.js@^10.2.1: version "10.3.1" resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.3.1.tgz#d8c3a444a9c6774ba60ca6ad7261c3a94fd5e783" @@ -2104,11 +2081,6 @@ dedent@^0.7.0: resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" integrity sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA== -deep-equal@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" - integrity sha512-bHtC0iYvWhyaTzvV3CZgPeZQqCOBGyGsVV7v4eevpdkLHfiSrXUdBG+qAuSz4RI70sszvjQ1QSZ98An1yNwpSw== - deep-is@^0.1.3, deep-is@~0.1.3: version "0.1.4" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" @@ -2142,17 +2114,17 @@ delegates@^1.0.0: resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" integrity sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ== -depd@2.0.0, depd@^2.0.0, depd@~2.0.0: +depd@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== -depd@^1.1.2, depd@~1.1.2: +depd@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" integrity sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ== -destroy@1.2.0, destroy@^1.0.4: +destroy@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg== @@ -2170,14 +2142,6 @@ dezalgo@1.0.3: asap "^2.0.0" wrappy "1" -dicer@0.2.5: - version "0.2.5" - resolved "https://registry.yarnpkg.com/dicer/-/dicer-0.2.5.tgz#5996c086bb33218c812c090bddc09cd12facb70f" - integrity sha512-FDvbtnq7dzlPz0wyYlOExifDEZcu8h+rErEXgfxqmLfRfC/kJidEFh4+effJRO3P0xmfqyPbSMG0LveNRfTKVg== - dependencies: - readable-stream "1.1.x" - streamsearch "0.1.2" - did-resolver@^3.1.3, did-resolver@^3.2.2: version "3.2.2" resolved "https://registry.yarnpkg.com/did-resolver/-/did-resolver-3.2.2.tgz#6f4e252a810f785d1b28a10265fad6dffee25158" @@ -2255,7 +2219,7 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== -encodeurl@^1.0.2, encodeurl@~1.0.2: +encodeurl@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w== @@ -2320,6 +2284,38 @@ es-abstract@^1.19.0, es-abstract@^1.19.1, es-abstract@^1.19.2, es-abstract@^1.19 string.prototype.trimstart "^1.0.5" unbox-primitive "^1.0.2" +es-aggregate-error@^1.0.7: + version "1.0.8" + resolved "https://registry.yarnpkg.com/es-aggregate-error/-/es-aggregate-error-1.0.8.tgz#bc9475174f5c8012b7f7c39d2af415b72ef1e89e" + integrity sha512-AKUb5MKLWMozPlFRHOKqWD7yta5uaEhH21qwtnf6FlKjNjTJOoqFi0/G14+FfSkIQhhu6X68Af4xgRC6y8qG4A== + dependencies: + define-properties "^1.1.4" + es-abstract "^1.19.5" + function-bind "^1.1.1" + functions-have-names "^1.2.3" + get-intrinsic "^1.1.1" + globalthis "^1.0.2" + has-property-descriptors "^1.0.0" + +es-array-method-boxes-properly@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz#873f3e84418de4ee19c5be752990b2e44718d09e" + integrity sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA== + +es-get-iterator@^1.0.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/es-get-iterator/-/es-get-iterator-1.1.2.tgz#9234c54aba713486d7ebde0220864af5e2b283f7" + integrity sha512-+DTO8GYwbMCwbywjimwZMHp8AuYXOS2JZFWoi2AlPOS3ebnII9w/NLpNZtA7A0YLaVDw+O7KFCeoIV7OPvM7hQ== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.0" + has-symbols "^1.0.1" + is-arguments "^1.1.0" + is-map "^2.0.2" + is-set "^2.0.2" + is-string "^1.0.5" + isarray "^2.0.5" + es-shim-unscopables@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz#702e632193201e3edf8713635d083d378e510241" @@ -2341,7 +2337,7 @@ escalade@^3.1.1: resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== -escape-html@^1.0.3, escape-html@~1.0.3: +escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow== @@ -2588,20 +2584,6 @@ expect@^27.5.1: jest-matcher-utils "^27.5.1" jest-message-util "^27.5.1" -express-session@^1.17.1: - version "1.17.3" - resolved "https://registry.yarnpkg.com/express-session/-/express-session-1.17.3.tgz#14b997a15ed43e5949cb1d073725675dd2777f36" - integrity sha512-4+otWXlShYlG1Ma+2Jnn+xgKUZTMJ5QD3YvfilX3AcocOAbIkVylSWEklzALe/+Pu4qV6TYBj5GwOBFfdKqLBw== - dependencies: - cookie "0.4.2" - cookie-signature "1.0.6" - debug "2.6.9" - depd "~2.0.0" - on-headers "~1.0.2" - parseurl "~1.3.3" - safe-buffer "5.2.1" - uid-safe "~2.1.5" - express@^4.17.1, express@^4.18.1: version "4.18.1" resolved "https://registry.yarnpkg.com/express/-/express-4.18.1.tgz#7797de8b9c72c857b9cd0e14a5eea80666267caf" @@ -2817,11 +2799,20 @@ forwarded@0.2.0: resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow== -fresh@0.5.2, fresh@~0.5.2: +fresh@0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q== +fs-extra@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" + integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^4.0.0" + universalify "^0.1.0" + fs-minipass@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" @@ -2859,7 +2850,7 @@ functional-red-black-tree@^1.0.1: resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" integrity sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g== -functions-have-names@^1.2.2: +functions-have-names@^1.2.2, functions-have-names@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== @@ -2883,7 +2874,7 @@ gensync@^1.0.0-beta.2: resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== -get-caller-file@^2.0.5: +get-caller-file@^2.0.1, get-caller-file@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== @@ -2948,7 +2939,7 @@ glob-parent@^6.0.1: dependencies: is-glob "^4.0.3" -glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.2.0: +glob@^7.0.5, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@^7.2.0: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== @@ -2972,6 +2963,13 @@ globals@^13.15.0: dependencies: type-fest "^0.20.2" +globalthis@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.3.tgz#5852882a52b80dc301b0660273e1ed082f0b6ccf" + integrity sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA== + dependencies: + define-properties "^1.1.3" + globby@^11.1.0: version "11.1.0" resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" @@ -3001,11 +2999,23 @@ got@^11.5.1: p-cancelable "^2.0.0" responselike "^2.0.0" -graceful-fs@^4.2.6, graceful-fs@^4.2.9: +graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.6, graceful-fs@^4.2.9: version "4.2.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== +handlebars@^4.7.7: + version "4.7.7" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1" + integrity sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA== + dependencies: + minimist "^1.2.5" + neo-async "^2.6.0" + source-map "^0.6.1" + wordwrap "^1.0.0" + optionalDependencies: + uglify-js "^3.1.4" + has-bigints@^1.0.1, has-bigints@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" @@ -3081,14 +3091,6 @@ html-escaper@^2.0.0: resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== -http-assert@^1.3.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/http-assert/-/http-assert-1.5.0.tgz#c389ccd87ac16ed2dfa6246fd73b926aa00e6b8f" - integrity sha512-uPpH7OKX4H25hBmU6G1jWNaqJGpTXxey+YOUizJUAgu0AjLUeC8D73hTrhvDS5D+GJN1DN1+hhc/eF/wpxtp0w== - dependencies: - deep-equal "~1.0.1" - http-errors "~1.8.0" - http-cache-semantics@^4.0.0, http-cache-semantics@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" @@ -3105,17 +3107,6 @@ http-errors@2.0.0: statuses "2.0.1" toidentifier "1.0.1" -http-errors@^1.3.1, http-errors@^1.6.3, http-errors@~1.8.0: - version "1.8.1" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.1.tgz#7c3f28577cbc8a207388455dbd62295ed07bd68c" - integrity sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g== - dependencies: - depd "~1.1.2" - inherits "2.0.4" - setprototypeof "1.2.0" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.1" - http-proxy-agent@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz#8a8c8ef7f5932ccf953c296ca8291b95aa74aa3a" @@ -3227,11 +3218,6 @@ infer-owner@^1.0.4: resolved "https://registry.yarnpkg.com/infer-owner/-/infer-owner-1.0.4.tgz#c4cefcaa8e51051c2a40ba2ce8a3d27295af9467" integrity sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A== -inflation@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/inflation/-/inflation-2.0.0.tgz#8b417e47c28f925a45133d914ca1fd389107f30f" - integrity sha512-m3xv4hJYR2oXw4o4Y5l6P5P16WYmazYof+el6Al3f+YlggGj6qT9kImBAnzDelRALnP5d3h4jGBPKzYCizjZZw== - inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -3240,7 +3226,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.4, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: +inherits@2, inherits@2.0.4, inherits@^2.0.3: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -3264,6 +3250,14 @@ ipaddr.js@1.9.1: resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== +is-arguments@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.1.tgz#15b3f88fda01f2a97fec84ca761a560f123efa9b" + integrity sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" @@ -3325,13 +3319,6 @@ is-generator-fn@^2.0.0: resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== -is-generator-function@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.0.10.tgz#f1558baf1ac17e0deea7c0415c438351ff2b3c72" - integrity sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A== - dependencies: - has-tostringtag "^1.0.0" - is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" @@ -3344,6 +3331,11 @@ is-lambda@^1.0.1: resolved "https://registry.yarnpkg.com/is-lambda/-/is-lambda-1.0.1.tgz#3d9877899e6a53efc0160504cde15f82e6f061d5" integrity sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ== +is-map@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.2.tgz#00922db8c9bf73e81b7a335827bc2a43f2b91127" + integrity sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg== + is-negative-zero@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" @@ -3379,6 +3371,11 @@ is-regex@^1.1.4: call-bind "^1.0.2" has-tostringtag "^1.0.0" +is-set@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-set/-/is-set-2.0.2.tgz#90755fa4c2562dc1c5d4024760d6119b94ca18ec" + integrity sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g== + is-shared-array-buffer@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz#8f259c573b60b6a32d4058a1a07430c0a7344c79" @@ -3417,15 +3414,10 @@ is-weakref@^1.0.2: dependencies: call-bind "^1.0.2" -isarray@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" - integrity sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ== - -isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== +isarray@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" + integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== isexe@^2.0.0: version "2.0.0" @@ -3479,6 +3471,19 @@ istanbul-reports@^3.1.3: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" +iterate-iterator@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/iterate-iterator/-/iterate-iterator-1.0.2.tgz#551b804c9eaa15b847ea6a7cdc2f5bf1ec150f91" + integrity sha512-t91HubM4ZDQ70M9wqp+pcNpu8OyJ9UAtXntT/Bcsvp5tZMnz9vRa+IunKXeI8AnfZMTv0jNuVEmGeLSMjVvfPw== + +iterate-value@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/iterate-value/-/iterate-value-1.0.2.tgz#935115bd37d006a52046535ebc8d07e9c9337f57" + integrity sha512-A6fMAio4D2ot2r/TYzr4yUWrmwNdsN5xL7+HUiyACE4DXm+q8HtPcnFTp+NnW3k4N05tZ7FVYFFb2CR13NxyHQ== + dependencies: + es-get-iterator "^1.0.2" + iterate-iterator "^1.0.1" + jest-changed-files@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-27.5.1.tgz#a348aed00ec9bf671cc58a66fcbe7c3dfd6a68f5" @@ -3884,11 +3889,6 @@ jest@^27.0.4, jest@^27.3.1: import-local "^3.0.2" jest-cli "^27.5.1" -js-sha256@^0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.9.0.tgz#0b89ac166583e91ef9123644bd3c5334ce9d0966" - integrity sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA== - "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -3986,12 +3986,12 @@ json5@^1.0.1: dependencies: minimist "^1.2.0" -keygrip@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/keygrip/-/keygrip-1.1.0.tgz#871b1681d5e159c62a445b0c74b615e0917e7226" - integrity sha512-iYSchDJ+liQ8iwbSI2QqsQOvqv58eJCEanyJPJi+Khyu8smkcKSFUCbPwzFcL7YVtZ6eONjqRX/38caJ7QjRAQ== - dependencies: - tsscmp "1.0.6" +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + integrity sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg== + optionalDependencies: + graceful-fs "^4.1.6" keyv@^4.0.0: version "4.3.2" @@ -4006,82 +4006,6 @@ kleur@^3.0.3: resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== -koa-bodyparser@^4.2.1: - version "4.3.0" - resolved "https://registry.yarnpkg.com/koa-bodyparser/-/koa-bodyparser-4.3.0.tgz#274c778555ff48fa221ee7f36a9fbdbace22759a" - integrity sha512-uyV8G29KAGwZc4q/0WUAjH+Tsmuv9ImfBUF2oZVyZtaeo0husInagyn/JH85xMSxM0hEk/mbCII5ubLDuqW/Rw== - dependencies: - co-body "^6.0.0" - copy-to "^2.0.1" - -koa-compose@^3.0.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/koa-compose/-/koa-compose-3.2.1.tgz#a85ccb40b7d986d8e5a345b3a1ace8eabcf54de7" - integrity sha512-8gen2cvKHIZ35eDEik5WOo8zbVp9t4cP8p4hW4uE55waxolLRexKKrqfCpwhGVppnB40jWeF8bZeTVg99eZgPw== - dependencies: - any-promise "^1.1.0" - -koa-compose@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/koa-compose/-/koa-compose-4.1.0.tgz#507306b9371901db41121c812e923d0d67d3e877" - integrity sha512-8ODW8TrDuMYvXRwra/Kh7/rJo9BtOfPc6qO8eAfC80CnCvSjSl0bkRM24X6/XBBEyj0v1nRUQ1LyOy3dbqOWXw== - -koa-convert@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/koa-convert/-/koa-convert-2.0.0.tgz#86a0c44d81d40551bae22fee6709904573eea4f5" - integrity sha512-asOvN6bFlSnxewce2e/DK3p4tltyfC4VM7ZwuTuepI7dEQVcvpyFuBcEARu1+Hxg8DIwytce2n7jrZtRlPrARA== - dependencies: - co "^4.6.0" - koa-compose "^4.1.0" - -koa-multer@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/koa-multer/-/koa-multer-1.0.2.tgz#d38f7ffd1db97b1aad33e7774732f000ebd67259" - integrity sha512-0kFzN4atVd+9oiG+4fYxQ9S2T3dPhKNvmhITIY606Qn9wLEmfhW0DhSpOzRYhddN//4rh/TCK95TMtflmFa5lA== - dependencies: - multer "1.3.0" - -koa-router@^7.4.0: - version "7.4.0" - resolved "https://registry.yarnpkg.com/koa-router/-/koa-router-7.4.0.tgz#aee1f7adc02d5cb31d7d67465c9eacc825e8c5e0" - integrity sha512-IWhaDXeAnfDBEpWS6hkGdZ1ablgr6Q6pGdXCyK38RbzuH4LkUOpPqPw+3f8l8aTDrQmBQ7xJc0bs2yV4dzcO+g== - dependencies: - debug "^3.1.0" - http-errors "^1.3.1" - koa-compose "^3.0.0" - methods "^1.0.1" - path-to-regexp "^1.1.1" - urijs "^1.19.0" - -koa@^2.8.2: - version "2.13.4" - resolved "https://registry.yarnpkg.com/koa/-/koa-2.13.4.tgz#ee5b0cb39e0b8069c38d115139c774833d32462e" - integrity sha512-43zkIKubNbnrULWlHdN5h1g3SEKXOEzoAlRsHOTFpnlDu8JlAOZSMJBLULusuXRequboiwJcj5vtYXKB3k7+2g== - dependencies: - accepts "^1.3.5" - cache-content-type "^1.0.0" - content-disposition "~0.5.2" - content-type "^1.0.4" - cookies "~0.8.0" - debug "^4.3.2" - delegates "^1.0.0" - depd "^2.0.0" - destroy "^1.0.4" - encodeurl "^1.0.2" - escape-html "^1.0.3" - fresh "~0.5.2" - http-assert "^1.3.0" - http-errors "^1.6.3" - is-generator-function "^1.0.7" - koa-compose "^4.1.0" - koa-convert "^2.0.0" - on-finished "^2.3.0" - only "~0.0.2" - parseurl "^1.3.2" - statuses "^1.5.0" - type-is "^1.6.16" - vary "^1.1.2" - leven@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" @@ -4128,21 +4052,11 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" -lodash.capitalize@^4.2.1: - version "4.2.1" - resolved "https://registry.yarnpkg.com/lodash.capitalize/-/lodash.capitalize-4.2.1.tgz#f826c9b4e2a8511d84e3aca29db05e1a4f3b72a9" - integrity sha512-kZzYOKspf8XVX5AvmQF94gQW0lejFVgb80G85bU4ZWzoJ6C03PQg3coYAUpSTpQWelrZELd3XWgHzw4Ck5kaIw== - lodash.clonedeep@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" integrity sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ== -lodash.groupby@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.groupby/-/lodash.groupby-4.6.0.tgz#0b08a1dcf68397c397855c3239783832df7403d1" - integrity sha512-5dcWxm23+VAoz+awKmBaiBvzox8+RqMgFhi7UvX9DHZr2HdxHXM/Wrf8cfKpsW37RNrvtPn6hSwNqurSILbmJw== - lodash.memoize@4.x: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" @@ -4153,11 +4067,6 @@ lodash.merge@^4.6.2: resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== -lodash.startcase@^4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/lodash.startcase/-/lodash.startcase-4.4.0.tgz#9436e34ed26093ed7ffae1936144350915d9add8" - integrity sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg== - lodash@^4.17.15, lodash@^4.7.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" @@ -4253,7 +4162,12 @@ merge2@^1.3.0, merge2@^1.4.1: resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== -methods@^1.0.1, methods@^1.1.2, methods@~1.1.2: +merge@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/merge/-/merge-2.1.1.tgz#59ef4bf7e0b3e879186436e8481c06a6c162ca98" + integrity sha512-jz+Cfrg9GWOZbQAnDQ4hlVnQky+341Yk5ru8bZSe6sIDTCIg8n9i/u7hSQGSVOF3C7lH6mGtqjkiT9G4wFLL0w== + +methods@^1.1.2, methods@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== @@ -4271,7 +4185,7 @@ mime-db@1.52.0: resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== -mime-types@^2.1.12, mime-types@^2.1.18, mime-types@~2.1.24, mime-types@~2.1.34: +mime-types@^2.1.12, mime-types@~2.1.24, mime-types@~2.1.34: version "2.1.35" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== @@ -4369,13 +4283,6 @@ minizlib@^2.0.0, minizlib@^2.1.1: minipass "^3.0.0" yallist "^4.0.0" -mkdirp@^0.5.1, mkdirp@^0.5.4: - version "0.5.6" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" - integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== - dependencies: - minimist "^1.2.6" - mkdirp@^1.0.3, mkdirp@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" @@ -4396,55 +4303,6 @@ ms@2.1.3, ms@^2.0.0, ms@^2.1.1: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== -multer@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/multer/-/multer-1.3.0.tgz#092b2670f6846fa4914965efc8cf94c20fec6cd2" - integrity sha512-wbAkTsh0QXkvqvHCU2qSLEXLuRN7IKMEe80+JrXfJzANniPNgrNcDOMKfGgR1EhL7y7MHIbODVwT7uaVY20ggw== - dependencies: - append-field "^0.1.0" - busboy "^0.2.11" - concat-stream "^1.5.0" - mkdirp "^0.5.1" - object-assign "^3.0.0" - on-finished "^2.3.0" - type-is "^1.6.4" - xtend "^4.0.0" - -multer@^1.4.2: - version "1.4.4" - resolved "https://registry.yarnpkg.com/multer/-/multer-1.4.4.tgz#e2bc6cac0df57a8832b858d7418ccaa8ebaf7d8c" - integrity sha512-2wY2+xD4udX612aMqMcB8Ws2Voq6NIUPEtD1be6m411T4uDH/VtL9i//xvcyFlTVfRdaBsk7hV5tgrGQqhuBiw== - dependencies: - append-field "^1.0.0" - busboy "^0.2.11" - concat-stream "^1.5.2" - mkdirp "^0.5.4" - object-assign "^4.1.1" - on-finished "^2.3.0" - type-is "^1.6.4" - xtend "^4.0.0" - -multibase@^4.0.1, multibase@^4.0.4: - version "4.0.6" - resolved "https://registry.yarnpkg.com/multibase/-/multibase-4.0.6.tgz#6e624341483d6123ca1ede956208cb821b440559" - integrity sha512-x23pDe5+svdLz/k5JPGCVdfn7Q5mZVMBETiC+ORfO+sor9Sgs0smJzAjfTbM5tckeCqnaUuMYoz+k3RXMmJClQ== - dependencies: - "@multiformats/base-x" "^4.0.1" - -multiformats@^9.4.2: - version "9.7.0" - resolved "https://registry.yarnpkg.com/multiformats/-/multiformats-9.7.0.tgz#845799e8df70fbb6b15922500e45cb87cf12f7e5" - integrity sha512-uv/tcgwk0yN4DStopnBN4GTgvaAlYdy6KnZpuzEPFOYQd71DYFJjs0MN1ERElAflrZaYyGBWXyGxL5GgrxIx0Q== - -multihashes@^4.0.2: - version "4.0.3" - resolved "https://registry.yarnpkg.com/multihashes/-/multihashes-4.0.3.tgz#426610539cd2551edbf533adeac4c06b3b90fb05" - integrity sha512-0AhMH7Iu95XjDLxIeuCOOE4t9+vQZsACyKZ9Fxw2pcsRmlX4iCn1mby0hS0bb+nQOVpdQYWPpnyusw4da5RPhA== - dependencies: - multibase "^4.0.1" - uint8arrays "^3.0.0" - varint "^5.0.2" - nan@^2.11.1: version "2.16.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.16.0.tgz#664f43e45460fb98faf00edca0bb0d7b8dce7916" @@ -4460,6 +4318,11 @@ negotiator@0.6.3, negotiator@^0.6.2: resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== +neo-async@^2.6.0: + version "2.6.2" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" + integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== + ngrok@^4.3.1: version "4.3.1" resolved "https://registry.yarnpkg.com/ngrok/-/ngrok-4.3.1.tgz#d9e77b6d647bb1f49659601f89b31efac8478523" @@ -4556,11 +4419,6 @@ nwsapi@^2.2.0: resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.1.tgz#10a9f268fbf4c461249ebcfe38e359aa36e2577c" integrity sha512-JYOWTeFoS0Z93587vRJgASD5Ut11fYl5NyihP3KrYBvMe1FRRs6RN7m20SA/16GM4P6hTnZjT+UmDOt38UeXNg== -object-assign@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-3.0.0.tgz#9bedd5ca0897949bca47e7ff408062d549f587f2" - integrity sha512-jHP15vXVGeVh1HuaA2wY6lxk+whK/x4KBG88VXeRma7CCun7iGD5qPc4eYykQ9sdQvg8jkwFKsSxHln2ybW3xQ== - object-assign@^4, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -4595,18 +4453,13 @@ object.values@^1.1.5: define-properties "^1.1.3" es-abstract "^1.19.1" -on-finished@2.4.1, on-finished@^2.3.0: +on-finished@2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" integrity sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg== dependencies: ee-first "1.1.1" -on-headers@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/on-headers/-/on-headers-1.0.2.tgz#772b0ae6aaa525c399e489adfad90c403eb3c28f" - integrity sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA== - once@1.4.0, once@^1.3.0, once@^1.3.1, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" @@ -4621,18 +4474,6 @@ onetime@^5.1.2: dependencies: mimic-fn "^2.1.0" -only@~0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/only/-/only-0.0.2.tgz#2afde84d03e50b9a8edc444e30610a70295edfb4" - integrity sha512-Fvw+Jemq5fjjyWz6CpKx6w9s7xxqo3+JCyM0WXWeCSOboZ8ABkyvP8ID4CZuChA/wxSx+XSJmdOm8rGVyJ1hdQ== - -openapi3-ts@^2.0.0, openapi3-ts@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/openapi3-ts/-/openapi3-ts-2.0.2.tgz#a200dd838bf24c9086c8eedcfeb380b7eb31e82a" - integrity sha512-TxhYBMoqx9frXyOgnRHufjQfPXomTIHYKhSKJ6jHfj13kS8OEIhvmE8CTuQyKtjjWttAjX5DPxM1vmalEpo8Qw== - dependencies: - yaml "^1.10.2" - optionator@^0.8.1: version "0.8.3" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" @@ -4729,7 +4570,7 @@ parse5@6.0.1: resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== -parseurl@^1.3.2, parseurl@~1.3.3: +parseurl@~1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== @@ -4764,18 +4605,6 @@ path-to-regexp@0.1.7: resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" integrity sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ== -path-to-regexp@^1.1.1: - version "1.8.0" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.8.0.tgz#887b3ba9d84393e87a0a0b9f4cb756198b53548a" - integrity sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA== - dependencies: - isarray "0.0.1" - -path-to-regexp@^2.2.1: - version "2.4.0" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-2.4.0.tgz#35ce7f333d5616f1c1e1bfe266c3aba2e5b2e704" - integrity sha512-G6zHoVqC6GGTQkZwF4lkuEyMbVOjoBKAEybQUypI1WTkqinCOrq2x6U2+phkJ1XsEMTy4LjtwPI7HW+NVrRR2w== - path-type@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" @@ -4839,11 +4668,6 @@ pretty-format@^27.0.0, pretty-format@^27.5.1: ansi-styles "^5.0.0" react-is "^17.0.1" -process-nextick-args@~2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" - integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== - promise-inflight@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" @@ -4857,6 +4681,19 @@ promise-retry@^2.0.1: err-code "^2.0.2" retry "^0.12.0" +promise.any@^2.0.2: + version "2.0.4" + resolved "https://registry.yarnpkg.com/promise.any/-/promise.any-2.0.4.tgz#beef570a04db537d022b395d776af2aef9b64f00" + integrity sha512-Yyl7jstFInFv/eIjm8Sj+pyyzHKZJPMr6yOdxxls1xdVatc3kVyVOvMPmqDaKC5kzxjwuMCkn41isweIUf8DPw== + dependencies: + array.prototype.map "^1.0.4" + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.2" + es-aggregate-error "^1.0.7" + get-intrinsic "^1.1.1" + iterate-value "^1.0.2" + prompts@^2.0.1: version "2.4.2" resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069" @@ -4917,7 +4754,7 @@ qs@6.9.3: resolved "https://registry.yarnpkg.com/qs/-/qs-6.9.3.tgz#bfadcd296c2d549f1dffa560619132c977f5008e" integrity sha512-EbZYNarm6138UKKq46tdx08Yo/q9ZhFoAXAI1meAFd2GtbRDhbZY2WQSICskT0c5q99aFzLG1D4nvTk9tqfXIw== -qs@^6.10.3, qs@^6.5.2: +qs@^6.10.3: version "6.11.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== @@ -4944,17 +4781,12 @@ quick-lru@^5.1.1: resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== -random-bytes@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/random-bytes/-/random-bytes-1.0.0.tgz#4f68a1dc0ae58bd3fb95848c30324db75d64360b" - integrity sha512-iv7LhNVO047HzYR3InF6pUcUsPQiHTM1Qal51DcGSuZFBil1aBBWG5eHPNek7bvILMaYJ/8RU1e8w1AMdHmLQQ== - range-parser@~1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== -raw-body@2.5.1, raw-body@^2.3.3: +raw-body@2.5.1: version "2.5.1" resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.1.tgz#fe1b1628b181b700215e5fd42389f98b71392857" integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig== @@ -4994,28 +4826,12 @@ react@^17.0.2: loose-envify "^1.1.0" object-assign "^4.1.1" -readable-stream@1.1.x: - version "1.1.14" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" - integrity sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" - -readable-stream@^2.2.2: - version "2.3.7" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" - integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" +react@^18.0.0: + version "18.2.0" + resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" + integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ== + dependencies: + loose-envify "^1.1.0" readable-stream@^3.6.0: version "3.6.0" @@ -5091,6 +4907,11 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== +require-main-filename@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" + integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== + reselect@^4.1.5: version "4.1.6" resolved "https://registry.yarnpkg.com/reselect/-/reselect-4.1.6.tgz#19ca2d3d0b35373a74dc1c98692cdaffb6602656" @@ -5163,38 +4984,6 @@ rimraf@^3.0.0, rimraf@^3.0.2, rimraf@~3.0.2: dependencies: glob "^7.1.3" -routing-controllers-openapi@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/routing-controllers-openapi/-/routing-controllers-openapi-3.1.0.tgz#90898a46c2490b203242e64bc08b536ba1228118" - integrity sha512-FnTYnbNfsCN+vTDAc7rhCm5u0nLAH+p+UpbJXZT10cgo2t7xiZ23BrrzsR5nnqMGwe/iwsDUEEr8lxs6KarscQ== - dependencies: - lodash.capitalize "^4.2.1" - lodash.merge "^4.6.2" - lodash.startcase "^4.4.0" - openapi3-ts "^2.0.1" - path-to-regexp "^2.2.1" - reflect-metadata "^0.1.13" - tslib "^2.1.0" - -routing-controllers@^0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/routing-controllers/-/routing-controllers-0.9.0.tgz#979016523db37832d4c9a23c33b2654a89a563de" - integrity sha512-OtARLKA6j8enNgGqi/hoRqBsTjVo2hbxc1+MeKi8mvelNn18+LXUdHpzY3z4GbCERBtaj8CwVjcsiQR+2w6ZFg== - dependencies: - cookie "^0.4.0" - express-session "^1.17.1" - glob "^7.1.4" - reflect-metadata "^0.1.13" - template-url "^1.0.0" - optionalDependencies: - body-parser "^1.19.0" - express "^4.17.1" - koa "^2.8.2" - koa-bodyparser "^4.2.1" - koa-multer "^1.0.2" - koa-router "^7.4.0" - multer "^1.4.2" - run-parallel@^1.1.9: version "1.2.0" resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" @@ -5202,7 +4991,7 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -rxjs@^7.1.0, rxjs@^7.2.0: +rxjs@^7.2.0: version "7.5.6" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.5.6.tgz#0446577557862afd6903517ce7cae79ecb9662bc" integrity sha512-dnyv2/YsXhnm461G+R/Pe5bWP41Nm6LBXEYWI6eiFP4fiwx6WRI/CD0zbdVAudd9xwLEF2IDcKXLHit0FYjUzw== @@ -5214,7 +5003,7 @@ safe-buffer@5.2.1, safe-buffer@~5.2.0: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== -safe-buffer@~5.1.0, safe-buffer@~5.1.1: +safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== @@ -5387,16 +5176,6 @@ statuses@2.0.1: resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== -"statuses@>= 1.5.0 < 2", statuses@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA== - -streamsearch@0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-0.1.2.tgz#808b9d0e56fc273d809ba57338e929919a1a9f1a" - integrity sha512-jos8u++JKm0ARcSUTAZXOVC0mSox7Bhn6sBgty73P1f3JGf7yG2clTbBNHUdde/kdvP2FESam+vM6l8jBrNxHA== - strict-uri-encode@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" @@ -5444,18 +5223,6 @@ string_decoder@^1.1.1: dependencies: safe-buffer "~5.2.0" -string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" - integrity sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ== - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" @@ -5576,11 +5343,6 @@ tar@^6.0.2, tar@^6.1.2: mkdirp "^1.0.3" yallist "^4.0.0" -template-url@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/template-url/-/template-url-1.0.0.tgz#d9456bee70cac6617b462a7b08db29fb813a0b09" - integrity sha512-QUjZNE7yTdIzB91sITTSYcSX5GRF5FulKvIYCqV5350NfSNfiuuCYQIJZ5PIN7k/uJ+kpurEEv9hFqRRc+JilA== - terminal-link@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/terminal-link/-/terminal-link-2.1.1.tgz#14a64a27ab3c0df933ea546fba55f2d078edc994" @@ -5758,7 +5520,7 @@ tslib@^1.8.1, tslib@^1.9.3: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.3, tslib@^2.1.0: +tslib@^2.1.0: version "2.4.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== @@ -5770,10 +5532,13 @@ tslog@^3.2.2, tslog@^3.3.3: dependencies: source-map-support "^0.5.21" -tsscmp@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/tsscmp/-/tsscmp-1.0.6.tgz#85b99583ac3589ec4bfef825b5000aa911d605eb" - integrity sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA== +tsoa@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/tsoa/-/tsoa-4.1.2.tgz#abd0575eedbb8c836909fa5baea9505970e7d42e" + integrity sha512-7U6ecH4iLhdIyYDBNyR7IufInMlCcIt3mZA5cmII1QcTV1K9Xr/I33PLijXCujzx21lQVUwLBWjZlvPikKJcPw== + dependencies: + "@tsoa/cli" "^4.1.2" + "@tsoa/runtime" "^4.1.2" tsutils@^3.21.0: version "3.21.0" @@ -5818,7 +5583,7 @@ type-fest@^0.21.3: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== -type-is@^1.6.16, type-is@^1.6.4, type-is@~1.6.18: +type-is@~1.6.18: version "1.6.18" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== @@ -5833,12 +5598,7 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" -typedarray@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" - integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== - -typescript@^4.7.3: +typescript@<4.8.0, typescript@^4.7.3: version "4.7.4" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235" integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ== @@ -5848,19 +5608,10 @@ typescript@~4.4.0, typescript@~4.4.2: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.4.tgz#2cd01a1a1f160704d3101fd5a58ff0f9fcb8030c" integrity sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA== -uid-safe@~2.1.5: - version "2.1.5" - resolved "https://registry.yarnpkg.com/uid-safe/-/uid-safe-2.1.5.tgz#2b3d5c7240e8fc2e58f8aa269e5ee49c0857bd3a" - integrity sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA== - dependencies: - random-bytes "~1.0.0" - -uint8arrays@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/uint8arrays/-/uint8arrays-3.0.0.tgz#260869efb8422418b6f04e3fac73a3908175c63b" - integrity sha512-HRCx0q6O9Bfbp+HHSfQQKD7wU70+lydKVt4EghkdOvlK/NlrF90z+eXV34mUd48rNvVJXwkrMSPpCATkct8fJA== - dependencies: - multiformats "^9.4.2" +uglify-js@^3.1.4: + version "3.17.0" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.17.0.tgz#55bd6e9d19ce5eef0d5ad17cd1f587d85b180a85" + integrity sha512-aTeNPVmgIMPpm1cxXr2Q/nEbvkmV8yq66F3om7X3P/cvOXQ0TMQ64Wk63iyT1gPlmdmGzjGpyLh1f3y8MZWXGg== unbox-primitive@^1.0.2: version "1.0.2" @@ -5886,7 +5637,7 @@ unique-slug@^2.0.0: dependencies: imurmurhash "^0.1.4" -universalify@^0.1.2: +universalify@^0.1.0, universalify@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== @@ -5911,12 +5662,7 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" -urijs@^1.19.0: - version "1.19.11" - resolved "https://registry.yarnpkg.com/urijs/-/urijs-1.19.11.tgz#204b0d6b605ae80bea54bea39280cdb7c9f923cc" - integrity sha512-HXgFDgDommxn5/bIv0cnQZsPhHDA90NPHD6+c/v21U5+Sx5hoP8+dP9IZXBU1gIfvdRfhG8cel9QNPeionfcCQ== - -util-deprecate@^1.0.1, util-deprecate@~1.0.1: +util-deprecate@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== @@ -5950,22 +5696,17 @@ v8-to-istanbul@^8.1.0: convert-source-map "^1.6.0" source-map "^0.7.3" -validator@^13.5.2: +validator@^13.5.2, validator@^13.6.0: version "13.7.0" resolved "https://registry.yarnpkg.com/validator/-/validator-13.7.0.tgz#4f9658ba13ba8f3d82ee881d3516489ea85c0857" integrity sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw== -varint@^5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/varint/-/varint-5.0.2.tgz#5b47f8a947eb668b848e034dcfa87d0ff8a7f7a4" - integrity sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow== - varint@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/varint/-/varint-6.0.0.tgz#9881eb0ce8feaea6512439d19ddf84bf551661d0" integrity sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg== -vary@^1, vary@^1.1.2, vary@~1.1.2: +vary@^1, vary@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== @@ -6054,6 +5795,11 @@ which-boxed-primitive@^1.0.2: is-string "^1.0.5" is-symbol "^1.0.3" +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + integrity sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q== + which@^2.0.1, which@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" @@ -6073,6 +5819,20 @@ word-wrap@^1.2.3, word-wrap@~1.2.3: resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== +wordwrap@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== + +wrap-ansi@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" + integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" @@ -6117,6 +5877,11 @@ xtend@^4.0.0: resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== +y18n@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf" + integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ== + y18n@^5.0.5: version "5.0.8" resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" @@ -6127,21 +5892,54 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== -yaml@^1.10.0, yaml@^1.10.2: +yaml@^1.10.0: version "1.10.2" resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== +yamljs@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/yamljs/-/yamljs-0.3.0.tgz#dc060bf267447b39f7304e9b2bfbe8b5a7ddb03b" + integrity sha512-C/FsVVhht4iPQYXOInoxUM/1ELSf9EsgKH34FofQOp6hwCPrW4vG4w5++TED3xRUo8gD7l0P1J1dLlDYzODsTQ== + dependencies: + argparse "^1.0.7" + glob "^7.0.5" + yargs-parser@20.x, yargs-parser@^20.2.2: version "20.2.9" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== +yargs-parser@^18.1.2: + version "18.1.3" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" + integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + yargs-parser@^21.0.0: version "21.0.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.0.1.tgz#0267f286c877a4f0f728fceb6f8a3e4cb95c6e35" integrity sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg== +yargs@^15.4.1: + version "15.4.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" + integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== + dependencies: + cliui "^6.0.0" + decamelize "^1.2.0" + find-up "^4.1.0" + get-caller-file "^2.0.1" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^4.2.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^18.1.2" + yargs@^16.2.0: version "16.2.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" @@ -6176,11 +5974,6 @@ yauzl@^2.10.0: buffer-crc32 "~0.2.3" fd-slicer "~1.1.0" -ylru@^1.2.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/ylru/-/ylru-1.3.2.tgz#0de48017473275a4cbdfc83a1eaf67c01af8a785" - integrity sha512-RXRJzMiK6U2ye0BlGGZnmpwJDPgakn6aNQ0A7gHRbD4I0uvK4TW6UqkK1V0pp9jskjJBAXd3dRrbzWkqJ+6cxA== - yn@3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"