From 25802bfa528234dcc65cd2e30937f7e7df0908e1 Mon Sep 17 00:00:00 2001 From: Ignacio Date: Wed, 22 Nov 2023 17:50:43 +0800 Subject: [PATCH 1/2] chore: update query url --- .env.defaults | 2 +- src/graphql/routes/cosmos-api.ts | 2 +- src/graphql/routes/elrond-api.ts | 2 +- src/graphql/routes/oasis-api.ts | 2 +- src/graphql/routes/radix-prom-api.ts | 2 +- src/graphql/routes/solana-api.ts | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.env.defaults b/.env.defaults index 6daf176..ece14e5 100644 --- a/.env.defaults +++ b/.env.defaults @@ -1,4 +1,4 @@ MAX_OVER_TIME_DURATION=2d NODE_ENV=development -PROMETHEUS_URL=... +PROM_QUERY_URL=http://localhost:9090 RADIX_URL=... diff --git a/src/graphql/routes/cosmos-api.ts b/src/graphql/routes/cosmos-api.ts index c214a9f..726455e 100644 --- a/src/graphql/routes/cosmos-api.ts +++ b/src/graphql/routes/cosmos-api.ts @@ -4,7 +4,7 @@ import type { KeyValueCache } from "@apollo/utils.keyvaluecache"; require("dotenv").config(); export class CosmosAPI extends RESTDataSource { - override baseURL = `http://${process.env.PROMETHEUS_URL}/prometheus/api/v1/`; + override baseURL = `${process.env.PROM_QUERY_URL}/prometheus/api/v1/`; constructor(options: { cache: KeyValueCache }) { super(options); // this sends our server's `cache` through diff --git a/src/graphql/routes/elrond-api.ts b/src/graphql/routes/elrond-api.ts index 2710317..1e7f949 100644 --- a/src/graphql/routes/elrond-api.ts +++ b/src/graphql/routes/elrond-api.ts @@ -4,7 +4,7 @@ import type { KeyValueCache } from "@apollo/utils.keyvaluecache"; require("dotenv").config(); export class ElrondAPI extends RESTDataSource { - override baseURL = `http://${process.env.PROMETHEUS_URL}/prometheus/api/v1/`; + override baseURL = `${process.env.PROM_QUERY_URL}/prometheus/api/v1/`; constructor(options: { cache: KeyValueCache }) { super(options); // this sends our server's `cache` through diff --git a/src/graphql/routes/oasis-api.ts b/src/graphql/routes/oasis-api.ts index 759de78..b3960e0 100644 --- a/src/graphql/routes/oasis-api.ts +++ b/src/graphql/routes/oasis-api.ts @@ -4,7 +4,7 @@ import type { KeyValueCache } from "@apollo/utils.keyvaluecache"; require("dotenv").config(); export class OasisAPI extends RESTDataSource { - override baseURL = `http://${process.env.PROMETHEUS_URL}/prometheus/api/v1/`; + override baseURL = `${process.env.PROM_QUERY_URL}/prometheus/api/v1/`; constructor(options: { cache: KeyValueCache }) { super(options); // this sends our server's `cache` through diff --git a/src/graphql/routes/radix-prom-api.ts b/src/graphql/routes/radix-prom-api.ts index 78e95cb..d5b4d14 100644 --- a/src/graphql/routes/radix-prom-api.ts +++ b/src/graphql/routes/radix-prom-api.ts @@ -4,7 +4,7 @@ import type { KeyValueCache } from "@apollo/utils.keyvaluecache"; require("dotenv").config(); export class RadixPromAPI extends RESTDataSource { - override baseURL = `http://${process.env.PROMETHEUS_URL}/prometheus/api/v1/`; + override baseURL = `${process.env.PROM_QUERY_URL}/prometheus/api/v1/`; constructor(options: { cache: KeyValueCache }) { super(options); diff --git a/src/graphql/routes/solana-api.ts b/src/graphql/routes/solana-api.ts index 5d4361b..7b08a3e 100644 --- a/src/graphql/routes/solana-api.ts +++ b/src/graphql/routes/solana-api.ts @@ -6,7 +6,7 @@ import type { KeyValueCache } from "@apollo/utils.keyvaluecache"; require("dotenv").config(); export class SolanaAPI extends RESTDataSource { - override baseURL = `http://${process.env.PROMETHEUS_URL}/prometheus/api/v1/`; + override baseURL = `${process.env.PROM_QUERY_URL}/prometheus/api/v1/`; constructor(options: { cache: KeyValueCache }) { super(options); // this sends our server's `cache` through From 06ab74cea79bebd1336af49db745cc1457a5d4d3 Mon Sep 17 00:00:00 2001 From: Ignacio Date: Wed, 22 Nov 2023 18:10:46 +0800 Subject: [PATCH 2/2] chore: upgrade deps after testing --- package-lock.json | 105 ++++++++++++++++++++++++++++++++++------------ package.json | 2 +- 2 files changed, 80 insertions(+), 27 deletions(-) diff --git a/package-lock.json b/package-lock.json index 429fc9d..b20e99c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "ISC", "dependencies": { - "@apollo/datasource-rest": "^4.3.2", + "@apollo/datasource-rest": "^6.2.2", "@apollo/server": "^4.0.2", "body-parser": "^1.20.1", "cors": "^2.8.5", @@ -54,22 +54,43 @@ } }, "node_modules/@apollo/datasource-rest": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/@apollo/datasource-rest/-/datasource-rest-4.3.2.tgz", - "integrity": "sha512-qTilJGy5CnqVOvyhkK8hzcCY+Hr8UaY3EgCbKQqlxO1yxp75qGtGapLhQMC/h578V8MYR773t/kLYnQe5eJg/w==", - "dependencies": { - "@apollo/utils.fetcher": "^1.0.0", - "@apollo/utils.keyvaluecache": "1.0.1", - "http-cache-semantics": "^4.1.0", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/@apollo/datasource-rest/-/datasource-rest-6.2.2.tgz", + "integrity": "sha512-0rxlyAdlZ5n4zoPsME5TCzxZiyu/4m5dawatclr2ckwAewnGARcqdhFnckrhlOIgLQTtcl9lCmUit4DGoK47lw==", + "dependencies": { + "@apollo/utils.fetcher": "^3.0.0", + "@apollo/utils.keyvaluecache": "^3.1.0", + "@apollo/utils.logger": "^3.0.0", + "@apollo/utils.withrequired": "^3.0.0", + "@types/http-cache-semantics": "^4.0.1", + "http-cache-semantics": "^4.1.1", + "lodash.clonedeep": "^4.5.0", + "lodash.isplainobject": "^4.0.6", "node-fetch": "^2.6.7" }, "engines": { - "node": ">=14.0" + "node": ">=16.14" }, "peerDependencies": { "graphql": "^16.5.0" } }, + "node_modules/@apollo/datasource-rest/node_modules/@apollo/utils.logger": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@apollo/utils.logger/-/utils.logger-3.0.0.tgz", + "integrity": "sha512-M8V8JOTH0F2qEi+ktPfw4RL7MvUycDfKp7aEap2eWXfL5SqWHN6jTLbj5f5fj1cceHpyaUSOZlvlaaryaxZAmg==", + "engines": { + "node": ">=16" + } + }, + "node_modules/@apollo/datasource-rest/node_modules/@apollo/utils.withrequired": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@apollo/utils.withrequired/-/utils.withrequired-3.0.0.tgz", + "integrity": "sha512-aaxeavfJ+RHboh7c2ofO5HHtQobGX4AgUujXP4CXpREHp9fQ9jPi6K9T1jrAKe7HIipoP0OJ1gd6JamSkFIpvA==", + "engines": { + "node": ">=16" + } + }, "node_modules/@apollo/protobufjs": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/@apollo/protobufjs/-/protobufjs-1.2.7.tgz", @@ -219,9 +240,12 @@ } }, "node_modules/@apollo/utils.fetcher": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@apollo/utils.fetcher/-/utils.fetcher-1.1.1.tgz", - "integrity": "sha512-0vXVznO7kw5VWwxyV5wsDvYEwjDpyZ7vYQAXCseLXqBn2eWEIDViM7qRzi/Hnv4zzAQ05phdimSED99K+lg+SQ==" + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@apollo/utils.fetcher/-/utils.fetcher-3.1.0.tgz", + "integrity": "sha512-Z3QAyrsQkvrdTuHAFwWDNd+0l50guwoQUoaDQssLOjkmnmVuvXlJykqlEJolio+4rFwBnWdoY1ByFdKaQEcm7A==", + "engines": { + "node": ">=16" + } }, "node_modules/@apollo/utils.isnodelike": { "version": "2.0.1", @@ -232,18 +256,32 @@ } }, "node_modules/@apollo/utils.keyvaluecache": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@apollo/utils.keyvaluecache/-/utils.keyvaluecache-1.0.1.tgz", - "integrity": "sha512-nLgYLomqjVimEzQ4cdvVQkcryi970NDvcRVPfd0OPeXhBfda38WjBq+WhQFk+czSHrmrSp34YHBxpat0EtiowA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@apollo/utils.keyvaluecache/-/utils.keyvaluecache-3.1.0.tgz", + "integrity": "sha512-MM/DKIqpQQbuNG1gNPAlGc45THdWkroTmN8o/J09merFwf/LlZ7+lAfcHFDXIYIknwKmUjJrOMS3OxYbjrz2hA==", "dependencies": { - "@apollo/utils.logger": "^1.0.0", - "lru-cache": "^7.10.1" + "@apollo/utils.logger": "^3.0.0", + "lru-cache": "^10.0.0" + }, + "engines": { + "node": ">=16.14" } }, "node_modules/@apollo/utils.keyvaluecache/node_modules/@apollo/utils.logger": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@apollo/utils.logger/-/utils.logger-1.0.1.tgz", - "integrity": "sha512-XdlzoY7fYNK4OIcvMD2G94RoFZbzTQaNP0jozmqqMudmaGo2I/2Jx71xlDJ801mWA/mbYRihyaw6KJii7k5RVA==" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@apollo/utils.logger/-/utils.logger-3.0.0.tgz", + "integrity": "sha512-M8V8JOTH0F2qEi+ktPfw4RL7MvUycDfKp7aEap2eWXfL5SqWHN6jTLbj5f5fj1cceHpyaUSOZlvlaaryaxZAmg==", + "engines": { + "node": ">=16" + } + }, + "node_modules/@apollo/utils.keyvaluecache/node_modules/lru-cache": { + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.3.tgz", + "integrity": "sha512-B7gr+F6MkqB3uzINHXNctGieGsRTMwIBgxkp0yq/5BwcuDzD4A8wQpHQW6vDAm1uKSLQghmRdD9sKqf2vJ1cEg==", + "engines": { + "node": "14 || >=16.14" + } }, "node_modules/@apollo/utils.logger": { "version": "2.0.1", @@ -1006,6 +1044,11 @@ "@types/send": "*" } }, + "node_modules/@types/http-cache-semantics": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", + "integrity": "sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==" + }, "node_modules/@types/http-errors": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", @@ -1034,9 +1077,9 @@ "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==" }, "node_modules/@types/node": { - "version": "20.9.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.3.tgz", - "integrity": "sha512-nk5wXLAXGBKfrhLB0cyHGbSqopS+nz0BUgZkUQqSHSSgdee0kssp1IAqlQOu333bW+gMNs2QREx7iynm19Abxw==", + "version": "20.9.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.4.tgz", + "integrity": "sha512-wmyg8HUhcn6ACjsn8oKYjkN/zUzQeNtMy44weTJSM6p4MMzEOuKbA3OjJ267uPCOW7Xex9dyrNTful8XTQYoDA==", "dependencies": { "undici-types": "~5.26.4" } @@ -1544,9 +1587,9 @@ "dev": true }, "node_modules/big-integer": { - "version": "1.6.51", - "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", - "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==", + "version": "1.6.52", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.52.tgz", + "integrity": "sha512-QxD8cf2eVqJOOz63z6JIN9BzvVs/dlySa5HGSBH5xtR8dPteIRQnBxxKqkNTiT6jbDTF6jAfrd4oMcND9RGbQg==", "dev": true, "engines": { "node": ">=0.6" @@ -3730,6 +3773,16 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, + "node_modules/lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==" + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" + }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", diff --git a/package.json b/package.json index 306af61..c766e40 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "author": "", "license": "ISC", "dependencies": { - "@apollo/datasource-rest": "^4.3.2", + "@apollo/datasource-rest": "^6.2.2", "@apollo/server": "^4.0.2", "body-parser": "^1.20.1", "cors": "^2.8.5",