diff --git a/.yarn/cache/@blockfrost-openapi-npm-0.1.61-beta.0-32e9de66b5-d8041d9159.zip b/.yarn/cache/@blockfrost-openapi-npm-0.1.61-beta.0-32e9de66b5-d8041d9159.zip deleted file mode 100644 index dac2c54e..00000000 Binary files a/.yarn/cache/@blockfrost-openapi-npm-0.1.61-beta.0-32e9de66b5-d8041d9159.zip and /dev/null differ diff --git a/.yarn/cache/@blockfrost-openapi-npm-0.1.61-beta.3-df13aa2be1-2ad49b931a.zip b/.yarn/cache/@blockfrost-openapi-npm-0.1.61-beta.3-df13aa2be1-2ad49b931a.zip new file mode 100644 index 00000000..9c03ce09 Binary files /dev/null and b/.yarn/cache/@blockfrost-openapi-npm-0.1.61-beta.3-df13aa2be1-2ad49b931a.zip differ diff --git a/package.json b/package.json index 31445807..43e8ce37 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "dependencies": { "@blockfrost/blockfrost-js": "5.4.0", "@blockfrost/blockfrost-utils": "2.8.0", - "@blockfrost/openapi": "0.1.61-beta.0", + "@blockfrost/openapi": "0.1.61-beta.3", "@emurgo/cardano-serialization-lib-nodejs": "11.5.0", "@emurgo/cip14-js": "^3.0.1", "@fastify/cors": "^8.3.0", diff --git a/src/routes/governance/dreps/drep-id/delegators.ts b/src/routes/governance/dreps/drep-id/delegators.ts index 9246212f..e53c18fe 100644 --- a/src/routes/governance/dreps/drep-id/delegators.ts +++ b/src/routes/governance/dreps/drep-id/delegators.ts @@ -3,14 +3,13 @@ import * as QueryTypes from '../../../../types/queries/governance.js'; import * as ResponseTypes from '../../../../types/responses/governance.js'; import { getDbSync } from '../../../../utils/database.js'; import { SQLQuery } from '../../../../sql/index.js'; -//import { getSchemaForEndpoint } from '@blockfrost/openapi'; +import { getSchemaForEndpoint } from '@blockfrost/openapi'; async function route(fastify: FastifyInstance) { fastify.route({ url: '/governance/dreps/:drep_id/delegators', method: 'GET', - // TODO: SCHEMA - // schema: getSchemaForEndpoint('/governance/dreps/{drep_id}/delegators'), + schema: getSchemaForEndpoint('/governance/dreps/{drep_id}/delegators'), handler: async (request: FastifyRequest, reply) => { const clientDbSync = await getDbSync(fastify); diff --git a/src/routes/governance/dreps/drep-id/index.ts b/src/routes/governance/dreps/drep-id/index.ts index 4977068b..f80b4d66 100644 --- a/src/routes/governance/dreps/drep-id/index.ts +++ b/src/routes/governance/dreps/drep-id/index.ts @@ -4,14 +4,14 @@ import * as ResponseTypes from '../../../../types/responses/governance.js'; import { getDbSync } from '../../../../utils/database.js'; import { handle404 } from '../../../../utils/error-handler.js'; import { SQLQuery } from '../../../../sql/index.js'; -//import { getSchemaForEndpoint } from '@blockfrost/openapi'; +import { getSchemaForEndpoint } from '@blockfrost/openapi'; async function route(fastify: FastifyInstance) { fastify.route({ url: '/governance/dreps/:drep_id', method: 'GET', - // TODO: SCHEMA - //schema: getSchemaForEndpoint('/governance/dreps/{drep_id}'), + schema: getSchemaForEndpoint('/governance/dreps/{drep_id}'), + handler: async (request: FastifyRequest, reply) => { const clientDbSync = await getDbSync(fastify); diff --git a/src/routes/governance/dreps/drep-id/metadata.ts b/src/routes/governance/dreps/drep-id/metadata.ts index 2c4a1bf4..f64a1525 100644 --- a/src/routes/governance/dreps/drep-id/metadata.ts +++ b/src/routes/governance/dreps/drep-id/metadata.ts @@ -4,14 +4,14 @@ import * as ResponseTypes from '../../../../types/responses/governance.js'; import { getDbSync } from '../../../../utils/database.js'; import { handle404 } from '../../../../utils/error-handler.js'; import { SQLQuery } from '../../../../sql/index.js'; -//import { getSchemaForEndpoint } from '@blockfrost/openapi'; +import { getSchemaForEndpoint } from '@blockfrost/openapi'; async function route(fastify: FastifyInstance) { fastify.route({ url: '/governance/dreps/:drep_id/metadata', method: 'GET', - // TODO: SCHEMA - // schema: getSchemaForEndpoint('/governance/dreps/{drep_id}/metadata'), + schema: getSchemaForEndpoint('/governance/dreps/{drep_id}/metadata'), + handler: async (request: FastifyRequest, reply) => { const clientDbSync = await getDbSync(fastify); diff --git a/src/routes/governance/dreps/drep-id/updates.ts b/src/routes/governance/dreps/drep-id/updates.ts index 3e13ca1a..2dfdab50 100644 --- a/src/routes/governance/dreps/drep-id/updates.ts +++ b/src/routes/governance/dreps/drep-id/updates.ts @@ -3,14 +3,13 @@ import * as QueryTypes from '../../../../types/queries/governance.js'; import * as ResponseTypes from '../../../../types/responses/governance.js'; import { getDbSync } from '../../../../utils/database.js'; import { SQLQuery } from '../../../../sql/index.js'; -//import { getSchemaForEndpoint } from '@blockfrost/openapi'; +import { getSchemaForEndpoint } from '@blockfrost/openapi'; async function route(fastify: FastifyInstance) { fastify.route({ url: '/governance/dreps/:drep_id/updates', method: 'GET', - // TODO: SCHEMA - // schema: getSchemaForEndpoint('/governance/dreps/{drep_id}/updates'), + schema: getSchemaForEndpoint('/governance/dreps/{drep_id}/updates'), handler: async (request: FastifyRequest, reply) => { const clientDbSync = await getDbSync(fastify); @@ -18,7 +17,7 @@ async function route(fastify: FastifyInstance) { const { rows }: { rows: ResponseTypes.DRepsDrepIDUpdates } = await clientDbSync.query( SQLQuery.get('governance_dreps_drep_id_updates'), - [request.query.order, request.query.count, request.query.page, request.params.drep_id], + [(request.query.order, request.query.count, request.query.page, request.params.drep_id)], ); clientDbSync.release(); diff --git a/yarn-project.nix b/yarn-project.nix index 46c5b4c5..48a8e8b1 100644 --- a/yarn-project.nix +++ b/yarn-project.nix @@ -144,7 +144,7 @@ cacheEntries = { "JSONStream@npm:1.3.5" = { filename = "JSONStream-npm-1.3.5-1987f2e6dd-2605fa1242.zip"; sha512 = "2605fa124260c61bad38bb65eba30d2f72216a78e94d0ab19b11b4e0327d572b8d530c0c9cc3b0764f727ad26d39e00bf7ebad57781ca6368394d73169c59e46"; }; "eslint-plugin-prettier@npm:5.0.0" = { filename = "eslint-plugin-prettier-npm-5.0.0-2f21113cba-84e88744b9.zip"; sha512 = "84e88744b9050f2d5ef31b94e85294dda16f3a53c2449f9d33eac8ae6264889b459bf35a68e438fb6b329c2a1d6491aac4bfa00d86317e7009de3dad0311bec6"; }; "supertest@npm:6.3.3" = { filename = "supertest-npm-6.3.3-2e2b5bc83a-38239e517f.zip"; sha512 = "38239e517f7ba62b7a139a79c5c48d55f8d67b5ff4b6e51d5b07732ca8bbc4a28ffa1b10916fbb403dd013a054dbf028edc5850057d9a43aecbff439d494673e"; }; -"@blockfrost/openapi@npm:0.1.61-beta.0" = { filename = "@blockfrost-openapi-npm-0.1.61-beta.0-32e9de66b5-d8041d9159.zip"; sha512 = "d8041d9159784111a639810d8297f5787608eabd6dcdf0d9b3648f8f8c7ce0598ca3cc6afb0a8fa99ce51e5176ca187f264839a4fdf7a2fa0d888a796d8a7064"; }; +"@blockfrost/openapi@npm:0.1.61-beta.3" = { filename = "@blockfrost-openapi-npm-0.1.61-beta.3-df13aa2be1-2ad49b931a.zip"; sha512 = "2ad49b931a6f91fc17ca7f1c5d651f4272ced90e4d46e370a4f6c86eb69e39ffb1aee29deca80382d47cde575e1176113f090f88ad49df7400b7345bed1ea169"; }; "@types/pg@npm:8.10.2" = { filename = "@types-pg-npm-8.10.2-de8ade0e64-49da89f64c.zip"; sha512 = "49da89f64cec1bd12a3fbc0c72b17d685c2fee579726a529f62fcab395dbc5696d80455073409947a577164b3c53a90181a331e4a5d9357679f724d4ce37f4b9"; }; "axios@npm:1.5.0" = { filename = "axios-npm-1.5.0-35a845e191-e7405a5dbb.zip"; sha512 = "e7405a5dbbea97760d0e6cd58fecba311b0401ddb4a8efbc4108f5537da9b3f278bde566deb777935a960beec4fa18e7b8353881f2f465e4f2c0e949fead35be"; }; "@types/express@npm:4.17.17" = { filename = "@types-express-npm-4.17.17-46fe8173db-0196dacc27.zip"; sha512 = "0196dacc275ac3ce89d7364885cb08e7fb61f53ca101f65886dbf1daf9b7eb05c0943e2e4bbd01b0cc5e50f37e0eea7e4cbe97d0304094411ac73e1b7998f4da"; }; diff --git a/yarn.lock b/yarn.lock index 086895e2..da553797 100644 --- a/yarn.lock +++ b/yarn.lock @@ -136,14 +136,14 @@ __metadata: languageName: node linkType: hard -"@blockfrost/openapi@npm:0.1.61-beta.0": - version: 0.1.61-beta.0 - resolution: "@blockfrost/openapi@npm:0.1.61-beta.0" +"@blockfrost/openapi@npm:0.1.61-beta.3": + version: 0.1.61-beta.3 + resolution: "@blockfrost/openapi@npm:0.1.61-beta.3" dependencies: ajv: ^8.12.0 cbor: ^9.0.1 yaml: ^2.3.4 - checksum: d8041d9159784111a639810d8297f5787608eabd6dcdf0d9b3648f8f8c7ce0598ca3cc6afb0a8fa99ce51e5176ca187f264839a4fdf7a2fa0d888a796d8a7064 + checksum: 2ad49b931a6f91fc17ca7f1c5d651f4272ced90e4d46e370a4f6c86eb69e39ffb1aee29deca80382d47cde575e1176113f090f88ad49df7400b7345bed1ea169 languageName: node linkType: hard @@ -1956,7 +1956,7 @@ __metadata: "@blockfrost/blockfrost-js": 5.4.0 "@blockfrost/blockfrost-tests": 1.10.0 "@blockfrost/blockfrost-utils": 2.8.0 - "@blockfrost/openapi": 0.1.61-beta.0 + "@blockfrost/openapi": 0.1.61-beta.3 "@emurgo/cardano-serialization-lib-nodejs": 11.5.0 "@emurgo/cip14-js": ^3.0.1 "@esbuild/darwin-x64": "npm:0.16.17"