From a2b8b9d3bdaf84d5062219fbe79865ea3523ecf3 Mon Sep 17 00:00:00 2001 From: Ignacio <142767109+icfor@users.noreply.github.com> Date: Thu, 28 Dec 2023 23:12:15 +0800 Subject: [PATCH] chore: upgrade deps (#36) --- .eslintrc.cjs | 22 +- package.json | 7 +- src/graphql/resolvers/index.ts | 388 ++++++++++++------------ src/graphql/routes/archway-api.ts | 10 +- src/graphql/routes/radix-api.ts | 16 +- src/graphql/routes/sui-api.ts | 8 +- src/graphql/types.ts | 14 +- src/server.ts | 6 +- yarn.lock | 484 +++++++----------------------- 9 files changed, 352 insertions(+), 603 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 089cc15..f33ae44 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,6 +1,6 @@ const paddingLineBetweenStatements = [ "error", - { blankLine: "always", prev: "*", next: "return" }, + { blankLine: "always", next: "return", prev: "*" }, ] .concat( [ @@ -13,16 +13,16 @@ const paddingLineBetweenStatements = [ "if", ] .map((item) => [ - { blankLine: "always", prev: item, next: "*" }, - { blankLine: "always", prev: "*", next: item }, + { blankLine: "always", next: "*", prev: item }, + { blankLine: "always", next: item, prev: "*" }, ]) .flat(), ) .concat([ { blankLine: "any", - prev: ["singleline-const"], next: ["singleline-const"], + prev: ["singleline-const"], }, ]); @@ -39,8 +39,10 @@ module.exports = { ecmaVersion: "latest", sourceType: "module", }, - plugins: ["@typescript-eslint", "prettier", "@stylistic"], + plugins: ["@typescript-eslint", "prettier", "@stylistic", "perfectionist"], rules: { + "@stylistic/padding-line-between-statements": paddingLineBetweenStatements, + "@typescript-eslint/consistent-type-imports": "error", "@typescript-eslint/no-shadow": "error", "@typescript-eslint/no-unused-vars": "error", @@ -55,12 +57,18 @@ module.exports = { "no-useless-return": "error", "object-shorthand": "error", "operator-assignment": "error", + + "perfectionist/sort-enums": "error", + "perfectionist/sort-exports": "error", + "perfectionist/sort-interfaces": "error", + "perfectionist/sort-object-types": "error", + "perfectionist/sort-objects": "error", + "perfectionist/sort-union-types": "error", + "prefer-const": "error", "prefer-destructuring": ["error"], "prefer-spread": "error", "prefer-template": "error", "quote-props": ["error", "consistent-as-needed"], - - "@stylistic/padding-line-between-statements": paddingLineBetweenStatements, }, }; diff --git a/package.json b/package.json index 65f4dba..e5c8828 100644 --- a/package.json +++ b/package.json @@ -29,13 +29,14 @@ "@types/cors": "^2.8.17", "@types/express": "^4.17.21", "@types/node": "^20.10.5", - "@typescript-eslint/eslint-plugin": "^6.15.0", - "@typescript-eslint/parser": "^6.15.0", + "@typescript-eslint/eslint-plugin": "^6.16.0", + "@typescript-eslint/parser": "^6.16.0", "eslint": "^8.56.0", "eslint-config-prettier": "^9.1.0", "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-prettier": "^5.1.1", + "eslint-plugin-perfectionist": "^2.5.0", + "eslint-plugin-prettier": "^5.1.2", "graphql": "^16.8.1", "nodemon": "^3.0.2", "prettier": "^3.1.1", diff --git a/src/graphql/resolvers/index.ts b/src/graphql/resolvers/index.ts index c0e0b71..1af1922 100644 --- a/src/graphql/resolvers/index.ts +++ b/src/graphql/resolvers/index.ts @@ -1,7 +1,7 @@ import type { ContextValue, Response } from "../types"; const commonHandler = (response: Response) => { - const { status, data } = response; + const { data, status } = response; if (status === "error") { console.log(response.error); @@ -14,6 +14,43 @@ const commonHandler = (response: Response) => { export const resolvers = { Query: { + allCosmosTVL: async (...params: unknown[]) => { + const { dataSources } = params[2] as ContextValue; + + const result = commonHandler( + await dataSources.cosmosAPI.getAllCosmosTVL(), + ); + + if (!result) return; + + return result.map((res) => ({ cosmosTVL: res.value[1] })); + }, + allRadixStakedTokens: async (...params: unknown[]) => { + const { dataSources } = params[2] as ContextValue; + + const result = commonHandler( + (await dataSources.radixPromAPI.getStakedRadix()) as Response, + ); + + if (!result) return; + + return result.map((res) => ({ + bondedToken: res.value[1], + metric: { instance: "radix", validator_address: res.metric.address }, + })); + }, + allRadixTotalSupply: async (...params: unknown[]) => { + const { dataSources } = params[2] as ContextValue; + const result = await dataSources.radixAPI.getTotalRadixSupply(); + + const { token } = result; + const { token_supply } = token; + + return { + metric: { instance: "radix" }, + supply: token_supply?.value, + }; + }, archwayAPY: async (...params: unknown[]) => { const { dataSources } = params[2] as ContextValue; const response = await dataSources.archwayAPI.getAPY(); @@ -51,34 +88,18 @@ export const resolvers = { usersCount: res.value[1], })); }, - allCosmosTVL: async (...params: unknown[]) => { - const { dataSources } = params[2] as ContextValue; - - const result = commonHandler( - await dataSources.cosmosAPI.getAllCosmosTVL(), - ); - - if (!result) return; - - return result.map((res) => ({ cosmosTVL: res.value[1] })); - }, - eachCosmosTVL: async (...params: unknown[]) => { + eachCosmosAPY: async (...params: unknown[]) => { const { dataSources } = params[2] as ContextValue; const result = commonHandler( - (await dataSources.cosmosAPI.getEachCosmosChainTVL()) as Response, + (await dataSources.cosmosAPI.getEachCosmosAPY()) as Response, ); if (!result) return; return result.map((res) => ({ - metric: { - chain_id: res.metric.chain_id, - denom: res.metric.denom, - instance: res.metric.chain, - validator_address: res.metric.validator_address, - }, - TVL: res.value[1], + APY: res.value[1], + metric: { chain_id: res.metric.chain_id, instance: res.metric.chain }, })); }, eachCosmosBondedToken: async (...params: unknown[]) => { @@ -91,8 +112,8 @@ export const resolvers = { if (!result) return; return result.map((res) => ({ - metric: { chain_id: res.metric.chain_id, instance: res.metric.chain }, bondedToken: res.value[1], + metric: { chain_id: res.metric.chain_id, instance: res.metric.chain }, })); }, eachCosmosCommission: async (...params: unknown[]) => { @@ -105,117 +126,152 @@ export const resolvers = { if (!result) return; return result.map((res) => ({ + commissionRate: res.value[1], metric: { chain_id: res.metric.chain_id, instance: res.metric.chain, validator_address: res.metric.validator_address, }, - commissionRate: res.value[1], })); }, - eachCosmosUnbondingTime: async (...params: unknown[]) => { + eachCosmosInflationRate: async (...params: unknown[]) => { const { dataSources } = params[2] as ContextValue; const result = commonHandler( - (await dataSources.cosmosAPI.getEachCosmosUnbondingTime()) as Response, + (await dataSources.cosmosAPI.getEachCosmosInflationRate()) as Response, ); if (!result) return; return result.map((res) => ({ + inflationRate: res.value[1], metric: { chain_id: res.metric.chain_id, instance: res.metric.chain }, - unbondingTime: `${Math.floor(Number(res.value[1]) / 86400)} days`, })); }, - eachCosmosAPY: async (...params: unknown[]) => { + eachCosmosTokenSupply: async (...params: unknown[]) => { const { dataSources } = params[2] as ContextValue; const result = commonHandler( - (await dataSources.cosmosAPI.getEachCosmosAPY()) as Response, + (await dataSources.cosmosAPI.getEachCosmosTokenSupply()) as Response, ); if (!result) return; return result.map((res) => ({ metric: { chain_id: res.metric.chain_id, instance: res.metric.chain }, - APY: res.value[1], + supply: res.value[1], })); }, - eachCosmosTokenSupply: async (...params: unknown[]) => { + eachCosmosTVL: async (...params: unknown[]) => { const { dataSources } = params[2] as ContextValue; const result = commonHandler( - (await dataSources.cosmosAPI.getEachCosmosTokenSupply()) as Response, + (await dataSources.cosmosAPI.getEachCosmosChainTVL()) as Response, ); if (!result) return; return result.map((res) => ({ - metric: { chain_id: res.metric.chain_id, instance: res.metric.chain }, - supply: res.value[1], + metric: { + chain_id: res.metric.chain_id, + denom: res.metric.denom, + instance: res.metric.chain, + validator_address: res.metric.validator_address, + }, + TVL: res.value[1], })); }, - eachCosmosInflationRate: async (...params: unknown[]) => { + eachCosmosUnbondingTime: async (...params: unknown[]) => { const { dataSources } = params[2] as ContextValue; const result = commonHandler( - (await dataSources.cosmosAPI.getEachCosmosInflationRate()) as Response, + (await dataSources.cosmosAPI.getEachCosmosUnbondingTime()) as Response, ); if (!result) return; return result.map((res) => ({ metric: { chain_id: res.metric.chain_id, instance: res.metric.chain }, - inflationRate: res.value[1], + unbondingTime: `${Math.floor(Number(res.value[1]) / 86400)} days`, })); }, - allRadixStakedTokens: async (...params: unknown[]) => { + elrondAPY: async (...params: unknown[]) => { const { dataSources } = params[2] as ContextValue; const result = commonHandler( - (await dataSources.radixPromAPI.getStakedRadix()) as Response, + (await dataSources.elrondAPI.getElrondAPY()) as Response, ); if (!result) return; return result.map((res) => ({ - metric: { instance: "radix", validator_address: res.metric.address }, - bondedToken: res.value[1], + APY: Number(res.value[1]) * 100, + metric: { + instance: "elrond", + validator_address: res.metric.provider_address, + }, })); }, - allRadixTotalSupply: async (...params: unknown[]) => { + elrondBondedToken: async (...params: unknown[]) => { const { dataSources } = params[2] as ContextValue; - const result = await dataSources.radixAPI.getTotalRadixSupply(); - const { token } = result; - const { token_supply } = token; + const result = commonHandler( + (await dataSources.elrondAPI.getElrondBondedToken()) as Response, + ); - return { - metric: { instance: "radix" }, - supply: token_supply?.value, - }; + if (!result) return; + + return result.map((res) => ({ + bondedToken: res.value[1], + metric: { + instance: "elrond", + validator_address: res.metric.provider_address, + }, + })); }, - radixUnbondingTime: async (...params: unknown[]) => { + elrondCirculatingSupply: async (...params: unknown[]) => { const { dataSources } = params[2] as ContextValue; - const unbondingTime = await dataSources.radixAPI.getRadixUnbondingTime(); - return { metric: { instance: "radix" }, unbondingTime }; + const result = commonHandler( + (await dataSources.elrondAPI.getElrondCirculatingSupply()) as Response, + ); + + if (!result) return; + + return result.map((res) => ({ + circulatingSupply: res.value[1], + metric: { instance: "elrond" }, + })); }, - elrondAPY: async (...params: unknown[]) => { + elrondCommission: async (...params: unknown[]) => { const { dataSources } = params[2] as ContextValue; const result = commonHandler( - (await dataSources.elrondAPI.getElrondAPY()) as Response, + (await dataSources.elrondAPI.getElrondCommission()) as Response, ); if (!result) return; return result.map((res) => ({ + commissionRate: res.value[1], metric: { - validator_address: res.metric.provider_address, instance: "elrond", + validator_address: res.metric.provider_address, }, - APY: Number(res.value[1]) * 100, + })); + }, + elrondTotalSupply: async (...params: unknown[]) => { + const { dataSources } = params[2] as ContextValue; + + const result = commonHandler( + (await dataSources.elrondAPI.getElrondTotalSupply()) as Response, + ); + + if (!result) return; + + return result.map((res) => ({ + metric: { instance: "elrond" }, + totalSupply: res.value[1], })); }, elrondTVL: async (...params: unknown[]) => { @@ -232,115 +288,119 @@ export const resolvers = { TVL: res.value[1], })); }, - elrondCommission: async (...params: unknown[]) => { + elrondUnbondingTime: async (...params: unknown[]) => { + const { dataSources } = params[2] as ContextValue; + const response = await dataSources.elrondAPI.getElrondUnbondingTime(); + + return { + metric: { instance: "elrond" }, + unbondingTime: `${response} days`, + }; + }, + elrondUsers: async (...params: unknown[]) => { const { dataSources } = params[2] as ContextValue; const result = commonHandler( - (await dataSources.elrondAPI.getElrondCommission()) as Response, + (await dataSources.elrondAPI.getElrondUsers()) as Response, ); if (!result) return; return result.map((res) => ({ - metric: { - validator_address: res.metric.provider_address, - instance: "elrond", - }, - commissionRate: res.value[1], + metric: { instance: "elrond" }, + usersCount: res.value[1], })); }, - elrondBondedToken: async (...params: unknown[]) => { + oasisBondedToken: async (...params: unknown[]) => { const { dataSources } = params[2] as ContextValue; const result = commonHandler( - (await dataSources.elrondAPI.getElrondBondedToken()) as Response, + (await dataSources.oasisAPI.getOasisBondedToken()) as Response, ); if (!result) return; return result.map((res) => ({ - metric: { - validator_address: res.metric.provider_address, - instance: "elrond", - }, bondedToken: res.value[1], + metric: { instance: "oasis", validator_address: res.metric.identity }, })); }, - elrondTotalSupply: async (...params: unknown[]) => { + oasisCommission: async (...params: unknown[]) => { const { dataSources } = params[2] as ContextValue; const result = commonHandler( - (await dataSources.elrondAPI.getElrondTotalSupply()) as Response, + (await dataSources.oasisAPI.getOasisCommission()) as Response, ); if (!result) return; return result.map((res) => ({ - metric: { instance: "elrond" }, - totalSupply: res.value[1], + commissionRate: res.value[1], + metric: { instance: "oasis", validator_address: res.metric.identity }, })); }, - elrondCirculatingSupply: async (...params: unknown[]) => { + oasisTVL: async (...params: unknown[]) => { const { dataSources } = params[2] as ContextValue; const result = commonHandler( - (await dataSources.elrondAPI.getElrondCirculatingSupply()) as Response, + (await dataSources.oasisAPI.getOasisTVL()) as Response, ); if (!result) return; return result.map((res) => ({ - metric: { instance: "elrond" }, - circulatingSupply: res.value[1], + metric: { instance: "oasis" }, + TVL: res.value[1], })); }, - elrondUsers: async (...params: unknown[]) => { + oasisUsers: async (...params: unknown[]) => { const { dataSources } = params[2] as ContextValue; const result = commonHandler( - (await dataSources.elrondAPI.getElrondUsers()) as Response, + (await dataSources.oasisAPI.getOasisUsers()) as Response, ); if (!result) return; return result.map((res) => ({ - metric: { instance: "elrond" }, + metric: { instance: "oasis", validator_address: res.metric.identity }, usersCount: res.value[1], })); }, - elrondUnbondingTime: async (...params: unknown[]) => { + radixTVL: async (...params: unknown[]) => { const { dataSources } = params[2] as ContextValue; - const response = await dataSources.elrondAPI.getElrondUnbondingTime(); + const { data, status } = await dataSources.radixAPI.getRadixTVL(); - return { - metric: { instance: "elrond" }, - unbondingTime: `${response} days`, - }; + if (status === "error" || !data) return; + + const { address, TVL } = data; + + return [ + { + metric: { instance: "radix", validator_address: address }, + TVL, + }, + ]; }, - solanaUsers: async (...params: unknown[]) => { + radixUnbondingTime: async (...params: unknown[]) => { + const { dataSources } = params[2] as ContextValue; + const unbondingTime = await dataSources.radixAPI.getRadixUnbondingTime(); + + return { metric: { instance: "radix" }, unbondingTime }; + }, + radixUsers: async (...params: unknown[]) => { const { dataSources } = params[2] as ContextValue; const result = commonHandler( - (await dataSources.solanaAPI.getSolanaUsers()) as Response, + (await dataSources.radixPromAPI.getRadixUsers()) as Response, ); if (!result) return; - let validator_address: string | undefined = ""; - let usersCount = 0; - - result.map((res, i: number) => { - usersCount += parseInt(res.value[1]); - - if (i === 1) ({ validator_address } = res.metric); - - return { validator_address, usersCount }; - }); - - return { - metric: { validator_address, instance: "solana" }, - usersCount, - }; + return result.map((res) => ({ + metric: { instance: "radix", validator_address: res.metric.address }, + usersCount: res.value[1], + })); }, solanaBondedToken: async (...params: unknown[]) => { const { dataSources } = params[2] as ContextValue; @@ -359,34 +419,14 @@ export const resolvers = { if (i === 1) ({ validator_address } = res.metric); - return { validator_address, bondedToken }; + return { bondedToken, validator_address }; }); return { - metric: { validator_address, instance: "solana" }, bondedToken, + metric: { instance: "solana", validator_address }, }; }, - solanaTVL: async (...params: unknown[]) => { - const { dataSources } = params[2] as ContextValue; - - const result = commonHandler( - (await dataSources.solanaAPI.getSolanaTVL()) as Response, - ); - - if (!result) return; - - let validator_address: string | undefined = ""; - let TVL = 0; - - result.forEach((res, i: number) => { - TVL += parseInt(res.value[1]); - - if (i === 1) ({ validator_address } = res.metric); - }); - - return { metric: { validator_address, instance: "solana" }, TVL }; - }, solanaCommission: async (...params: unknown[]) => { const { dataSources } = params[2] as ContextValue; @@ -405,107 +445,67 @@ export const resolvers = { ({ validator_address } = res.metric); } - return { validator_address, commissionRate }; + return { commissionRate, validator_address }; }); return { - metric: { validator_address, instance: "solana" }, commissionRate, + metric: { instance: "solana", validator_address }, }; }, - solanaUnbondingTime: async (...params: unknown[]) => { - const { dataSources } = params[2] as ContextValue; - const response = await dataSources.solanaAPI.getSolanaUnbondingTime(); - - return { - metric: { instance: "solana" }, - unbondingTime: `${response} days`, - }; - }, - oasisUsers: async (...params: unknown[]) => { + solanaTVL: async (...params: unknown[]) => { const { dataSources } = params[2] as ContextValue; const result = commonHandler( - (await dataSources.oasisAPI.getOasisUsers()) as Response, + (await dataSources.solanaAPI.getSolanaTVL()) as Response, ); if (!result) return; - return result.map((res) => ({ - metric: { instance: "oasis", validator_address: res.metric.identity }, - usersCount: res.value[1], - })); - }, - oasisBondedToken: async (...params: unknown[]) => { - const { dataSources } = params[2] as ContextValue; + let validator_address: string | undefined = ""; + let TVL = 0; - const result = commonHandler( - (await dataSources.oasisAPI.getOasisBondedToken()) as Response, - ); + result.forEach((res, i: number) => { + TVL += parseInt(res.value[1]); - if (!result) return; + if (i === 1) ({ validator_address } = res.metric); + }); - return result.map((res) => ({ - metric: { instance: "oasis", validator_address: res.metric.identity }, - bondedToken: res.value[1], - })); + return { metric: { instance: "solana", validator_address }, TVL }; }, - oasisCommission: async (...params: unknown[]) => { + solanaUnbondingTime: async (...params: unknown[]) => { const { dataSources } = params[2] as ContextValue; + const response = await dataSources.solanaAPI.getSolanaUnbondingTime(); - const result = commonHandler( - (await dataSources.oasisAPI.getOasisCommission()) as Response, - ); - - if (!result) return; - - return result.map((res) => ({ - metric: { instance: "oasis", validator_address: res.metric.identity }, - commissionRate: res.value[1], - })); + return { + metric: { instance: "solana" }, + unbondingTime: `${response} days`, + }; }, - oasisTVL: async (...params: unknown[]) => { + solanaUsers: async (...params: unknown[]) => { const { dataSources } = params[2] as ContextValue; const result = commonHandler( - (await dataSources.oasisAPI.getOasisTVL()) as Response, + (await dataSources.solanaAPI.getSolanaUsers()) as Response, ); if (!result) return; - return result.map((res) => ({ - metric: { instance: "oasis" }, - TVL: res.value[1], - })); - }, - radixTVL: async (...params: unknown[]) => { - const { dataSources } = params[2] as ContextValue; - const { status, data } = await dataSources.radixAPI.getRadixTVL(); - - if (status === "error" || !data) return; - - const { address, TVL } = data; + let validator_address: string | undefined = ""; + let usersCount = 0; - return [ - { - metric: { instance: "radix", validator_address: address }, - TVL, - }, - ]; - }, - radixUsers: async (...params: unknown[]) => { - const { dataSources } = params[2] as ContextValue; + result.map((res, i: number) => { + usersCount += parseInt(res.value[1]); - const result = commonHandler( - (await dataSources.radixPromAPI.getRadixUsers()) as Response, - ); + if (i === 1) ({ validator_address } = res.metric); - if (!result) return; + return { usersCount, validator_address }; + }); - return result.map((res) => ({ - metric: { instance: "radix", validator_address: res.metric.address }, - usersCount: res.value[1], - })); + return { + metric: { instance: "solana", validator_address }, + usersCount, + }; }, suiAPY: async (...params: unknown[]) => { const { dataSources } = params[2] as ContextValue; diff --git a/src/graphql/routes/archway-api.ts b/src/graphql/routes/archway-api.ts index 70cd709..eab01e0 100644 --- a/src/graphql/routes/archway-api.ts +++ b/src/graphql/routes/archway-api.ts @@ -37,10 +37,10 @@ export class ArchwayAPI extends RESTDataSource { const TVL = tokens * Number(coinPrice); return { - status: "ok", data: { TVL, }, + status: "ok", }; } @@ -82,18 +82,18 @@ export class ArchwayAPI extends RESTDataSource { Number.isNaN(supplyNormalized) ) { return { - status: "error", error: "inflation, bondedToken or supplyNormalized is not a number", + status: "error", }; } const APY = (Number(inflation) * 0.01) / (bondedToken / supplyNormalized); return { - status: "ok", data: { APY, }, + status: "ok", }; } @@ -112,16 +112,16 @@ export class ArchwayAPI extends RESTDataSource { if (!bondedToken || Number.isNaN(bondedToken)) { return { - status: "error", error: "bondedToken is not a number", + status: "error", }; } return { - status: "ok", data: { bondedToken: bondedToken.toFixed(0), }, + status: "ok", }; } } diff --git a/src/graphql/routes/radix-api.ts b/src/graphql/routes/radix-api.ts index 42326c8..194acb9 100644 --- a/src/graphql/routes/radix-api.ts +++ b/src/graphql/routes/radix-api.ts @@ -34,23 +34,20 @@ export class RadixAPI extends RESTDataSource { async getTotalRadixSupply(): Promise { return this.post("token/native", { - headers: { - "Content-Type": "application/json", - }, body: JSON.stringify({ network_identifier: { network: "mainnet", }, }), + headers: { + "Content-Type": "application/json", + }, }); } async getRadixTVL() { const [radixResponse, coinPrice] = await Promise.all([ this.post(`${this.baseGatewayURL}state/validators/list`, { - headers: { - "Content-Type": "application/json", - }, body: JSON.stringify({ network_identifier: { network: "mainnet", @@ -59,6 +56,9 @@ export class RadixAPI extends RESTDataSource { address: radixValidatorAddress, }, }), + headers: { + "Content-Type": "application/json", + }, }), this.gecko.getCoinPrice("radix"), ]); @@ -84,11 +84,11 @@ export class RadixAPI extends RESTDataSource { } return { - status: "ok", data: { - TVL, address: radixValidatorAddress, + TVL, }, + status: "ok", }; } diff --git a/src/graphql/routes/sui-api.ts b/src/graphql/routes/sui-api.ts index 7382875..be27d10 100644 --- a/src/graphql/routes/sui-api.ts +++ b/src/graphql/routes/sui-api.ts @@ -23,11 +23,11 @@ export class SuiAPI extends RESTDataSource { private getRequestContent(body: unknown) { return { + body: JSON.stringify(body), headers: { "apikey": `${process.env.DEVTOOLS_API_KEY}`, "content-type": "application/json", }, - body: JSON.stringify(body), }; } @@ -72,10 +72,10 @@ export class SuiAPI extends RESTDataSource { } return { - status: "ok", data: { APY: validatorItem.apy, }, + status: "ok", }; } @@ -86,10 +86,10 @@ export class SuiAPI extends RESTDataSource { const bondedToken = validator?.stakingPoolSuiBalance / 10 ** coinDecimals; return { - status: "ok", data: { bondedToken, }, + status: "ok", }; } @@ -102,10 +102,10 @@ export class SuiAPI extends RESTDataSource { const tokens = validator?.poolTokenBalance / 10 ** coinDecimals; return { - status: "ok", data: { TVL: tokens * Number(coinPrice), }, + status: "ok", }; } } diff --git a/src/graphql/types.ts b/src/graphql/types.ts index de6f871..643242d 100644 --- a/src/graphql/types.ts +++ b/src/graphql/types.ts @@ -23,7 +23,6 @@ export interface ContextValue { } type ResultCommon = { - value: [number, string]; metric: { address?: string; chain?: string; @@ -34,17 +33,18 @@ type ResultCommon = { provider_address?: string; validator_address?: string; }; + value: [number, string]; }; export type Response = | { - data: unknown; - error: string; - status: "error"; - } - | { - status: "ok"; data: { result: ResultCommon[]; }; + status: "ok"; + } + | { + data: unknown; + error: string; + status: "error"; }; diff --git a/src/server.ts b/src/server.ts index cd32011..65882d4 100644 --- a/src/server.ts +++ b/src/server.ts @@ -26,12 +26,12 @@ export const setupServer = async () => { const port = process.env.PORT || 4000; const server = new ApolloServer({ - typeDefs, - resolvers, plugins: [ ApolloServerPluginDrainHttpServer({ httpServer }), responseCachePlugin(), ], + resolvers, + typeDefs, }); await server.start(); @@ -94,8 +94,8 @@ export const setupServer = async () => { ) => { res.status(error.status || 500).send({ error: { - status: error.status || 500, message: error.message || "Internal Server Error", + status: error.status || 500, }, }); }, diff --git a/yarn.lock b/yarn.lock index 4a237af..9f1b96c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -681,17 +681,10 @@ __metadata: languageName: node linkType: hard -"@pkgr/utils@npm:^2.4.2": - version: 2.4.2 - resolution: "@pkgr/utils@npm:2.4.2" - dependencies: - cross-spawn: "npm:^7.0.3" - fast-glob: "npm:^3.3.0" - is-glob: "npm:^4.0.3" - open: "npm:^9.1.0" - picocolors: "npm:^1.0.0" - tslib: "npm:^2.6.0" - checksum: 7c3e68f6405a1d4c51f418d8d580e71d7bade2683d5db07e8413d8e57f7e389047eda44a2341f77a1b3085895fca7676a9d45e8812a58312524f8c4c65d501be +"@pkgr/core@npm:^0.1.0": + version: 0.1.0 + resolution: "@pkgr/core@npm:0.1.0" + checksum: 8f4a0aa6cc1c445fec4f5f12157047e8a05e30b5c03441156f40203d6430f84d15135e8f1a6886e6c9800ff0e4a75d9d3419a43dbcd7490683f2882375a3b99a languageName: node linkType: hard @@ -1050,15 +1043,15 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:^6.15.0": - version: 6.15.0 - resolution: "@typescript-eslint/eslint-plugin@npm:6.15.0" +"@typescript-eslint/eslint-plugin@npm:^6.16.0": + version: 6.16.0 + resolution: "@typescript-eslint/eslint-plugin@npm:6.16.0" dependencies: "@eslint-community/regexpp": "npm:^4.5.1" - "@typescript-eslint/scope-manager": "npm:6.15.0" - "@typescript-eslint/type-utils": "npm:6.15.0" - "@typescript-eslint/utils": "npm:6.15.0" - "@typescript-eslint/visitor-keys": "npm:6.15.0" + "@typescript-eslint/scope-manager": "npm:6.16.0" + "@typescript-eslint/type-utils": "npm:6.16.0" + "@typescript-eslint/utils": "npm:6.16.0" + "@typescript-eslint/visitor-keys": "npm:6.16.0" debug: "npm:^4.3.4" graphemer: "npm:^1.4.0" ignore: "npm:^5.2.4" @@ -1071,25 +1064,25 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 78054afb0d4ab12d82db7a9cb005dfa2be42962341728abf4a81802e1f4c0f5b23de4870287f4b7e32aa4a4bc900bbc218f2d4d0c02aa77452e8e8e0b71fe3de + checksum: c8a68e0953d8b94f6b85d3a82090e61e670bcb0945cbee4d741321c56db727429ad47c48b8403ad1dab3b0842689bd2d4b85c99b76c51ac4f5be7f5f61c4c314 languageName: node linkType: hard -"@typescript-eslint/parser@npm:^6.15.0": - version: 6.15.0 - resolution: "@typescript-eslint/parser@npm:6.15.0" +"@typescript-eslint/parser@npm:^6.16.0": + version: 6.16.0 + resolution: "@typescript-eslint/parser@npm:6.16.0" dependencies: - "@typescript-eslint/scope-manager": "npm:6.15.0" - "@typescript-eslint/types": "npm:6.15.0" - "@typescript-eslint/typescript-estree": "npm:6.15.0" - "@typescript-eslint/visitor-keys": "npm:6.15.0" + "@typescript-eslint/scope-manager": "npm:6.16.0" + "@typescript-eslint/types": "npm:6.16.0" + "@typescript-eslint/typescript-estree": "npm:6.16.0" + "@typescript-eslint/visitor-keys": "npm:6.16.0" debug: "npm:^4.3.4" peerDependencies: eslint: ^7.0.0 || ^8.0.0 peerDependenciesMeta: typescript: optional: true - checksum: e7f265fd4abd3bc49fa5b304cd4b9c22801ac5a9da4ee342bbab0c117d629ac4aad6998555b61a8c5a0b279c443a44ae99f16669e24e3ef17ccec20c8b7019e7 + checksum: 9d573d14df4ec661dccaca785223a8a330d64f50a9279ff9170b1da22198ff91b9afa3ee7d3d7127c0cbc148c86831e76b33fc5b47d630799e98940ef666bfe0 languageName: node linkType: hard @@ -1103,22 +1096,22 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:6.15.0": - version: 6.15.0 - resolution: "@typescript-eslint/scope-manager@npm:6.15.0" +"@typescript-eslint/scope-manager@npm:6.16.0": + version: 6.16.0 + resolution: "@typescript-eslint/scope-manager@npm:6.16.0" dependencies: - "@typescript-eslint/types": "npm:6.15.0" - "@typescript-eslint/visitor-keys": "npm:6.15.0" - checksum: 3428d99de440f227cbc2afb44cdcb25e44c4b49c5f490392f83e21d2048210a6ec2f2f68133376c842034f5b5ba4ec9721da7caa18e631e23b57e20927b5b6f0 + "@typescript-eslint/types": "npm:6.16.0" + "@typescript-eslint/visitor-keys": "npm:6.16.0" + checksum: 3b275e528d19f4f36c4acd6cb872b5f004175512dce30cef0ac7a9121bb23d21e5e0f4b62658dbfea2b15851e7fa930372696f25a6c87492f863171ab56f5364 languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:6.15.0": - version: 6.15.0 - resolution: "@typescript-eslint/type-utils@npm:6.15.0" +"@typescript-eslint/type-utils@npm:6.16.0": + version: 6.16.0 + resolution: "@typescript-eslint/type-utils@npm:6.16.0" dependencies: - "@typescript-eslint/typescript-estree": "npm:6.15.0" - "@typescript-eslint/utils": "npm:6.15.0" + "@typescript-eslint/typescript-estree": "npm:6.16.0" + "@typescript-eslint/utils": "npm:6.16.0" debug: "npm:^4.3.4" ts-api-utils: "npm:^1.0.1" peerDependencies: @@ -1126,7 +1119,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 32cb531a4b5e0ccd431cba553ec73b87d4453b48af288a33e359ba4f5278126390d82799b61d3f0fbf135cfde1ac6c2275c2cf37a676e8a2a2811e774e660f16 + checksum: a5339cc1375d12411fcb242249143b28401fb18890bb2a1cff5275ba946affb4a2066cd8203e83ac383bd9d791a79ea6ee1cbf7a30deed5c832ed002897bbf82 languageName: node linkType: hard @@ -1137,10 +1130,10 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/types@npm:6.15.0": - version: 6.15.0 - resolution: "@typescript-eslint/types@npm:6.15.0" - checksum: 6e33529ea301c8c4b8c1f589dadd5d2a66c1b24ec87a577524fbc996d4c7b65d4f4fdfa4a3937b691efee6a10a6b16f7bfcabe98a15e0fc0c0c57aa0d80dcc25 +"@typescript-eslint/types@npm:6.16.0": + version: 6.16.0 + resolution: "@typescript-eslint/types@npm:6.16.0" + checksum: 74d9a8b7fd1b85fd1824295c92bc2f506148e450c9897f65ddaa089091017df4e25676c5b098b75c8f00529b84492f303a6b1870bb0ffee83997081325891d53 languageName: node linkType: hard @@ -1162,38 +1155,39 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:6.15.0": - version: 6.15.0 - resolution: "@typescript-eslint/typescript-estree@npm:6.15.0" +"@typescript-eslint/typescript-estree@npm:6.16.0": + version: 6.16.0 + resolution: "@typescript-eslint/typescript-estree@npm:6.16.0" dependencies: - "@typescript-eslint/types": "npm:6.15.0" - "@typescript-eslint/visitor-keys": "npm:6.15.0" + "@typescript-eslint/types": "npm:6.16.0" + "@typescript-eslint/visitor-keys": "npm:6.16.0" debug: "npm:^4.3.4" globby: "npm:^11.1.0" is-glob: "npm:^4.0.3" + minimatch: "npm:9.0.3" semver: "npm:^7.5.4" ts-api-utils: "npm:^1.0.1" peerDependenciesMeta: typescript: optional: true - checksum: 08955f6e84b8edb855a6769671e85889e52b15b82e00a64f595da867b21ad060e5342787c436d77702b2a1f39d411ac79b81a8d2e2006e9b1886eadb08b626df + checksum: c7109e90b40b3c8f1042beb7f1a7a97eeba3b6a903acd82df4947900d68bd31d04b530a190c099666c5ca4886efc162de7b42de754a44b189e41237210797d9e languageName: node linkType: hard -"@typescript-eslint/utils@npm:6.15.0": - version: 6.15.0 - resolution: "@typescript-eslint/utils@npm:6.15.0" +"@typescript-eslint/utils@npm:6.16.0, @typescript-eslint/utils@npm:^6.13.0": + version: 6.16.0 + resolution: "@typescript-eslint/utils@npm:6.16.0" dependencies: "@eslint-community/eslint-utils": "npm:^4.4.0" "@types/json-schema": "npm:^7.0.12" "@types/semver": "npm:^7.5.0" - "@typescript-eslint/scope-manager": "npm:6.15.0" - "@typescript-eslint/types": "npm:6.15.0" - "@typescript-eslint/typescript-estree": "npm:6.15.0" + "@typescript-eslint/scope-manager": "npm:6.16.0" + "@typescript-eslint/types": "npm:6.16.0" + "@typescript-eslint/typescript-estree": "npm:6.16.0" semver: "npm:^7.5.4" peerDependencies: eslint: ^7.0.0 || ^8.0.0 - checksum: 53519a2027681bdc8f028f9421c65f193f91b5bb1659465fedb8043376c693c2391211f1c01d8ba25bfaa7f7b3a102263d7123f9dfade12032159f4b4490f0fb + checksum: 586c4c0e1ca249daf9958f0d88df3af010a7592a19db1a7dc198754542b584314896536fe56ea9c93dd0ddd531154e7697002643d46e24a8d3a459721a626e91 languageName: node linkType: hard @@ -1224,13 +1218,13 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:6.15.0": - version: 6.15.0 - resolution: "@typescript-eslint/visitor-keys@npm:6.15.0" +"@typescript-eslint/visitor-keys@npm:6.16.0": + version: 6.16.0 + resolution: "@typescript-eslint/visitor-keys@npm:6.16.0" dependencies: - "@typescript-eslint/types": "npm:6.15.0" + "@typescript-eslint/types": "npm:6.16.0" eslint-visitor-keys: "npm:^3.4.1" - checksum: bf9f71af60bd63d1073900e75c5a0aa6eddd672f6c3ac6092c765d67deb7a0c32d2a5f6f3aee9e95f93a93d58563a76da209bd8487aadafd4d013100ffe38520 + checksum: 13c4d90355e288eac432d2845e37bb2acc03dab6d8568564558c1914a9aa44352f2a7ff29d0f50e0b3e68d66cca5f27b2732af5ff193b82571b4366309842880 languageName: node linkType: hard @@ -1503,13 +1497,6 @@ __metadata: languageName: node linkType: hard -"big-integer@npm:^1.6.44": - version: 1.6.52 - resolution: "big-integer@npm:1.6.52" - checksum: 9604224b4c2ab3c43c075d92da15863077a9f59e5d4205f4e7e76acd0cd47e8d469ec5e5dba8d9b32aa233951893b29329ca56ac80c20ce094b4a647a66abae0 - languageName: node - linkType: hard - "binary-extensions@npm:^2.0.0": version: 2.2.0 resolution: "binary-extensions@npm:2.2.0" @@ -1557,15 +1544,6 @@ __metadata: languageName: node linkType: hard -"bplist-parser@npm:^0.2.0": - version: 0.2.0 - resolution: "bplist-parser@npm:0.2.0" - dependencies: - big-integer: "npm:^1.6.44" - checksum: ce79c69e0f6efe506281e7c84e3712f7d12978991675b6e3a58a295b16f13ca81aa9b845c335614a545e0af728c8311b6aa3142af76ba1cb616af9bbac5c4a9f - languageName: node - linkType: hard - "brace-expansion@npm:^1.1.7": version: 1.1.11 resolution: "brace-expansion@npm:1.1.11" @@ -1594,15 +1572,6 @@ __metadata: languageName: node linkType: hard -"bundle-name@npm:^3.0.0": - version: 3.0.0 - resolution: "bundle-name@npm:3.0.0" - dependencies: - run-applescript: "npm:^5.0.0" - checksum: 57bc7f8b025d83961b04db2f1eff6a87f2363c2891f3542a4b82471ff8ebb5d484af48e9784fcdb28ef1d48bb01f03d891966dc3ef58758e46ea32d750ce40f8 - languageName: node - linkType: hard - "bytes@npm:3.1.2": version: 3.1.2 resolution: "bytes@npm:3.1.2" @@ -1797,7 +1766,7 @@ __metadata: languageName: node linkType: hard -"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3": +"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.2": version: 7.0.3 resolution: "cross-spawn@npm:7.0.3" dependencies: @@ -1845,28 +1814,6 @@ __metadata: languageName: node linkType: hard -"default-browser-id@npm:^3.0.0": - version: 3.0.0 - resolution: "default-browser-id@npm:3.0.0" - dependencies: - bplist-parser: "npm:^0.2.0" - untildify: "npm:^4.0.0" - checksum: 8db3ab882eb3e1e8b59d84c8641320e6c66d8eeb17eb4bb848b7dd549b1e6fd313988e4a13542e95fbaeff03f6e9dedc5ad191ad4df7996187753eb0d45c00b7 - languageName: node - linkType: hard - -"default-browser@npm:^4.0.0": - version: 4.0.0 - resolution: "default-browser@npm:4.0.0" - dependencies: - bundle-name: "npm:^3.0.0" - default-browser-id: "npm:^3.0.0" - execa: "npm:^7.1.1" - titleize: "npm:^3.0.0" - checksum: 7c8848badc139ecf9d878e562bc4e7ab4301e51ba120b24d8dcb14739c30152115cc612065ac3ab73c02aace4afa29db5a044257b2f0cf234f16e3a58f6c925e - languageName: node - linkType: hard - "define-data-property@npm:^1.0.1, define-data-property@npm:^1.1.1": version: 1.1.1 resolution: "define-data-property@npm:1.1.1" @@ -1878,13 +1825,6 @@ __metadata: languageName: node linkType: hard -"define-lazy-prop@npm:^3.0.0": - version: 3.0.0 - resolution: "define-lazy-prop@npm:3.0.0" - checksum: 5ab0b2bf3fa58b3a443140bbd4cd3db1f91b985cc8a246d330b9ac3fc0b6a325a6d82bddc0b055123d745b3f9931afeea74a5ec545439a1630b9c8512b0eeb49 - languageName: node - linkType: hard - "define-properties@npm:^1.1.3, define-properties@npm:^1.2.0, define-properties@npm:^1.2.1": version: 1.2.1 resolution: "define-properties@npm:1.2.1" @@ -2204,12 +2144,38 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-prettier@npm:^5.1.1": - version: 5.1.1 - resolution: "eslint-plugin-prettier@npm:5.1.1" +"eslint-plugin-perfectionist@npm:^2.5.0": + version: 2.5.0 + resolution: "eslint-plugin-perfectionist@npm:2.5.0" + dependencies: + "@typescript-eslint/utils": "npm:^6.13.0" + minimatch: "npm:^9.0.3" + natural-compare-lite: "npm:^1.4.0" + peerDependencies: + astro-eslint-parser: ^0.16.0 + eslint: ">=8.0.0" + svelte: ">=3.0.0" + svelte-eslint-parser: ^0.33.0 + vue-eslint-parser: ">=9.0.0" + peerDependenciesMeta: + astro-eslint-parser: + optional: true + svelte: + optional: true + svelte-eslint-parser: + optional: true + vue-eslint-parser: + optional: true + checksum: 61814512b26fd856e3f0d06ad77fe502a00e3109b33f39651fbbf5e0b233caa8f8732a8363b8948107318839083f4bf87400c90bc5d0ced475d9d56ea3bb4892 + languageName: node + linkType: hard + +"eslint-plugin-prettier@npm:^5.1.2": + version: 5.1.2 + resolution: "eslint-plugin-prettier@npm:5.1.2" dependencies: prettier-linter-helpers: "npm:^1.0.0" - synckit: "npm:^0.8.5" + synckit: "npm:^0.8.6" peerDependencies: "@types/eslint": ">=8.0.0" eslint: ">=8.0.0" @@ -2220,7 +2186,7 @@ __metadata: optional: true eslint-config-prettier: optional: true - checksum: cb9fb797e3b872864d9bd4a6154cc0aeccdd9b3d7add510b2077f6d5149fb4b681abd180dacb5dafda603defb6089824a7c6f97faf1f099dba4f4e77f86c46c3 + checksum: e16c9fbb0e9f8da45bdbb1cf6e4a190266235c3686deede3815196d2604bbe2bac531d1fc9adc3c0b9a03d88b55bd3bfaa4f9d85e34e73dc040d545a1931fab9 languageName: node linkType: hard @@ -2339,40 +2305,6 @@ __metadata: languageName: node linkType: hard -"execa@npm:^5.0.0": - version: 5.1.1 - resolution: "execa@npm:5.1.1" - dependencies: - cross-spawn: "npm:^7.0.3" - get-stream: "npm:^6.0.0" - human-signals: "npm:^2.1.0" - is-stream: "npm:^2.0.0" - merge-stream: "npm:^2.0.0" - npm-run-path: "npm:^4.0.1" - onetime: "npm:^5.1.2" - signal-exit: "npm:^3.0.3" - strip-final-newline: "npm:^2.0.0" - checksum: c8e615235e8de4c5addf2fa4c3da3e3aa59ce975a3e83533b4f6a71750fb816a2e79610dc5f1799b6e28976c9ae86747a36a606655bf8cb414a74d8d507b304f - languageName: node - linkType: hard - -"execa@npm:^7.1.1": - version: 7.2.0 - resolution: "execa@npm:7.2.0" - dependencies: - cross-spawn: "npm:^7.0.3" - get-stream: "npm:^6.0.1" - human-signals: "npm:^4.3.0" - is-stream: "npm:^3.0.0" - merge-stream: "npm:^2.0.0" - npm-run-path: "npm:^5.1.0" - onetime: "npm:^6.0.0" - signal-exit: "npm:^3.0.7" - strip-final-newline: "npm:^3.0.0" - checksum: 098cd6a1bc26d509e5402c43f4971736450b84d058391820c6f237aeec6436963e006fd8423c9722f148c53da86aa50045929c7278b5522197dff802d10f9885 - languageName: node - linkType: hard - "exponential-backoff@npm:^3.1.1": version: 3.1.1 resolution: "exponential-backoff@npm:3.1.1" @@ -2433,7 +2365,7 @@ __metadata: languageName: node linkType: hard -"fast-glob@npm:^3.2.9, fast-glob@npm:^3.3.0, fast-glob@npm:^3.3.1": +"fast-glob@npm:^3.2.9, fast-glob@npm:^3.3.1": version: 3.3.2 resolution: "fast-glob@npm:3.3.2" dependencies: @@ -2656,13 +2588,6 @@ __metadata: languageName: node linkType: hard -"get-stream@npm:^6.0.0, get-stream@npm:^6.0.1": - version: 6.0.1 - resolution: "get-stream@npm:6.0.1" - checksum: 49825d57d3fd6964228e6200a58169464b8e8970489b3acdc24906c782fb7f01f9f56f8e6653c4a50713771d6658f7cfe051e5eb8c12e334138c9c918b296341 - languageName: node - linkType: hard - "get-symbol-description@npm:^1.0.0": version: 1.0.0 resolution: "get-symbol-description@npm:1.0.0" @@ -2900,20 +2825,6 @@ __metadata: languageName: node linkType: hard -"human-signals@npm:^2.1.0": - version: 2.1.0 - resolution: "human-signals@npm:2.1.0" - checksum: 695edb3edfcfe9c8b52a76926cd31b36978782062c0ed9b1192b36bebc75c4c87c82e178dfcb0ed0fc27ca59d434198aac0bd0be18f5781ded775604db22304a - languageName: node - linkType: hard - -"human-signals@npm:^4.3.0": - version: 4.3.1 - resolution: "human-signals@npm:4.3.1" - checksum: 40498b33fe139f5cc4ef5d2f95eb1803d6318ac1b1c63eaf14eeed5484d26332c828de4a5a05676b6c83d7b9e57727c59addb4b1dea19cb8d71e83689e5b336c - languageName: node - linkType: hard - "iconv-lite@npm:0.4.24": version: 0.4.24 resolution: "iconv-lite@npm:0.4.24" @@ -3076,24 +2987,6 @@ __metadata: languageName: node linkType: hard -"is-docker@npm:^2.0.0": - version: 2.2.1 - resolution: "is-docker@npm:2.2.1" - bin: - is-docker: cli.js - checksum: e828365958d155f90c409cdbe958f64051d99e8aedc2c8c4cd7c89dcf35329daed42f7b99346f7828df013e27deb8f721cf9408ba878c76eb9e8290235fbcdcc - languageName: node - linkType: hard - -"is-docker@npm:^3.0.0": - version: 3.0.0 - resolution: "is-docker@npm:3.0.0" - bin: - is-docker: cli.js - checksum: d2c4f8e6d3e34df75a5defd44991b6068afad4835bb783b902fa12d13ebdb8f41b2a199dcb0b5ed2cb78bfee9e4c0bbdb69c2d9646f4106464674d3e697a5856 - languageName: node - linkType: hard - "is-extglob@npm:^2.1.1": version: 2.1.1 resolution: "is-extglob@npm:2.1.1" @@ -3117,17 +3010,6 @@ __metadata: languageName: node linkType: hard -"is-inside-container@npm:^1.0.0": - version: 1.0.0 - resolution: "is-inside-container@npm:1.0.0" - dependencies: - is-docker: "npm:^3.0.0" - bin: - is-inside-container: cli.js - checksum: a8efb0e84f6197e6ff5c64c52890fa9acb49b7b74fed4da7c95383965da6f0fa592b4dbd5e38a79f87fc108196937acdbcd758fcefc9b140e479b39ce1fcd1cd - languageName: node - linkType: hard - "is-lambda@npm:^1.0.1": version: 1.0.1 resolution: "is-lambda@npm:1.0.1" @@ -3184,20 +3066,6 @@ __metadata: languageName: node linkType: hard -"is-stream@npm:^2.0.0": - version: 2.0.1 - resolution: "is-stream@npm:2.0.1" - checksum: 7c284241313fc6efc329b8d7f08e16c0efeb6baab1b4cd0ba579eb78e5af1aa5da11e68559896a2067cd6c526bd29241dda4eb1225e627d5aa1a89a76d4635a5 - languageName: node - linkType: hard - -"is-stream@npm:^3.0.0": - version: 3.0.0 - resolution: "is-stream@npm:3.0.0" - checksum: eb2f7127af02ee9aa2a0237b730e47ac2de0d4e76a4a905a50a11557f2339df5765eaea4ceb8029f1efa978586abe776908720bfcb1900c20c6ec5145f6f29d8 - languageName: node - linkType: hard - "is-string@npm:^1.0.5, is-string@npm:^1.0.7": version: 1.0.7 resolution: "is-string@npm:1.0.7" @@ -3234,15 +3102,6 @@ __metadata: languageName: node linkType: hard -"is-wsl@npm:^2.2.0": - version: 2.2.0 - resolution: "is-wsl@npm:2.2.0" - dependencies: - is-docker: "npm:^2.0.0" - checksum: a6fa2d370d21be487c0165c7a440d567274fbba1a817f2f0bfa41cc5e3af25041d84267baa22df66696956038a43973e72fca117918c91431920bdef490fa25e - languageName: node - linkType: hard - "isarray@npm:^2.0.5": version: 2.0.5 resolution: "isarray@npm:2.0.5" @@ -3483,13 +3342,6 @@ __metadata: languageName: node linkType: hard -"merge-stream@npm:^2.0.0": - version: 2.0.0 - resolution: "merge-stream@npm:2.0.0" - checksum: 867fdbb30a6d58b011449b8885601ec1690c3e41c759ecd5a9d609094f7aed0096c37823ff4a7190ef0b8f22cc86beb7049196ff68c016e3b3c671d0dac91ce5 - languageName: node - linkType: hard - "merge2@npm:^1.3.0, merge2@npm:^1.4.1": version: 1.4.1 resolution: "merge2@npm:1.4.1" @@ -3539,17 +3391,12 @@ __metadata: languageName: node linkType: hard -"mimic-fn@npm:^2.1.0": - version: 2.1.0 - resolution: "mimic-fn@npm:2.1.0" - checksum: b26f5479d7ec6cc2bce275a08f146cf78f5e7b661b18114e2506dd91ec7ec47e7a25bf4360e5438094db0560bcc868079fb3b1fb3892b833c1ecbf63f80c95a4 - languageName: node - linkType: hard - -"mimic-fn@npm:^4.0.0": - version: 4.0.0 - resolution: "mimic-fn@npm:4.0.0" - checksum: de9cc32be9996fd941e512248338e43407f63f6d497abe8441fa33447d922e927de54d4cc3c1a3c6d652857acd770389d5a3823f311a744132760ce2be15ccbf +"minimatch@npm:9.0.3, minimatch@npm:^9.0.1, minimatch@npm:^9.0.3": + version: 9.0.3 + resolution: "minimatch@npm:9.0.3" + dependencies: + brace-expansion: "npm:^2.0.1" + checksum: 85f407dcd38ac3e180f425e86553911d101455ca3ad5544d6a7cec16286657e4f8a9aa6695803025c55e31e35a91a2252b5dc8e7d527211278b8b65b4dbd5eac languageName: node linkType: hard @@ -3562,15 +3409,6 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^9.0.1": - version: 9.0.3 - resolution: "minimatch@npm:9.0.3" - dependencies: - brace-expansion: "npm:^2.0.1" - checksum: 85f407dcd38ac3e180f425e86553911d101455ca3ad5544d6a7cec16286657e4f8a9aa6695803025c55e31e35a91a2252b5dc8e7d527211278b8b65b4dbd5eac - languageName: node - linkType: hard - "minimist@npm:^1.2.0, minimist@npm:^1.2.6": version: 1.2.8 resolution: "minimist@npm:1.2.8" @@ -3692,6 +3530,13 @@ __metadata: languageName: node linkType: hard +"natural-compare-lite@npm:^1.4.0": + version: 1.4.0 + resolution: "natural-compare-lite@npm:1.4.0" + checksum: f6cef26f5044515754802c0fc475d81426f3b90fe88c20fabe08771ce1f736ce46e0397c10acb569a4dd0acb84c7f1ee70676122f95d5bfdd747af3a6c6bbaa8 + languageName: node + linkType: hard + "natural-compare@npm:^1.4.0": version: 1.4.0 resolution: "natural-compare@npm:1.4.0" @@ -3796,24 +3641,6 @@ __metadata: languageName: node linkType: hard -"npm-run-path@npm:^4.0.1": - version: 4.0.1 - resolution: "npm-run-path@npm:4.0.1" - dependencies: - path-key: "npm:^3.0.0" - checksum: 6f9353a95288f8455cf64cbeb707b28826a7f29690244c1e4bb61ec573256e021b6ad6651b394eb1ccfd00d6ec50147253aba2c5fe58a57ceb111fad62c519ac - languageName: node - linkType: hard - -"npm-run-path@npm:^5.1.0": - version: 5.1.0 - resolution: "npm-run-path@npm:5.1.0" - dependencies: - path-key: "npm:^4.0.0" - checksum: ff6d77514489f47fa1c3b1311d09cd4b6d09a874cc1866260f9dea12cbaabda0436ed7f8c2ee44d147bf99a3af29307c6f63b0f83d242b0b6b0ab25dff2629e3 - languageName: node - linkType: hard - "object-assign@npm:^4": version: 4.1.1 resolution: "object-assign@npm:4.1.1" @@ -3899,36 +3726,6 @@ __metadata: languageName: node linkType: hard -"onetime@npm:^5.1.2": - version: 5.1.2 - resolution: "onetime@npm:5.1.2" - dependencies: - mimic-fn: "npm:^2.1.0" - checksum: ffcef6fbb2692c3c40749f31ea2e22677a876daea92959b8a80b521d95cca7a668c884d8b2045d1d8ee7d56796aa405c405462af112a1477594cc63531baeb8f - languageName: node - linkType: hard - -"onetime@npm:^6.0.0": - version: 6.0.0 - resolution: "onetime@npm:6.0.0" - dependencies: - mimic-fn: "npm:^4.0.0" - checksum: 4eef7c6abfef697dd4479345a4100c382d73c149d2d56170a54a07418c50816937ad09500e1ed1e79d235989d073a9bade8557122aee24f0576ecde0f392bb6c - languageName: node - linkType: hard - -"open@npm:^9.1.0": - version: 9.1.0 - resolution: "open@npm:9.1.0" - dependencies: - default-browser: "npm:^4.0.0" - define-lazy-prop: "npm:^3.0.0" - is-inside-container: "npm:^1.0.0" - is-wsl: "npm:^2.2.0" - checksum: 8073ec0dd8994a7a7d9bac208bd17d093993a65ce10f2eb9b62b6d3a91c9366ae903938a237c275493c130171d339f6dcbdd2a2de7e32953452c0867b97825af - languageName: node - linkType: hard - "optionator@npm:^0.9.3": version: 0.9.3 resolution: "optionator@npm:0.9.3" @@ -4000,20 +3797,13 @@ __metadata: languageName: node linkType: hard -"path-key@npm:^3.0.0, path-key@npm:^3.1.0": +"path-key@npm:^3.1.0": version: 3.1.1 resolution: "path-key@npm:3.1.1" checksum: 748c43efd5a569c039d7a00a03b58eecd1d75f3999f5a28303d75f521288df4823bc057d8784eb72358b2895a05f29a070bc9f1f17d28226cc4e62494cc58c4c languageName: node linkType: hard -"path-key@npm:^4.0.0": - version: 4.0.0 - resolution: "path-key@npm:4.0.0" - checksum: 794efeef32863a65ac312f3c0b0a99f921f3e827ff63afa5cb09a377e202c262b671f7b3832a4e64731003fa94af0263713962d317b9887bd1e0c48a342efba3 - languageName: node - linkType: hard - "path-parse@npm:^1.0.7": version: 1.0.7 resolution: "path-parse@npm:1.0.7" @@ -4045,13 +3835,6 @@ __metadata: languageName: node linkType: hard -"picocolors@npm:^1.0.0": - version: 1.0.0 - resolution: "picocolors@npm:1.0.0" - checksum: 20a5b249e331c14479d94ec6817a182fd7a5680debae82705747b2db7ec50009a5f6648d0621c561b0572703f84dbef0858abcbd5856d3c5511426afcb1961f7 - languageName: node - linkType: hard - "picomatch@npm:^2.0.4, picomatch@npm:^2.2.1, picomatch@npm:^2.3.1": version: 2.3.1 resolution: "picomatch@npm:2.3.1" @@ -4264,15 +4047,6 @@ __metadata: languageName: node linkType: hard -"run-applescript@npm:^5.0.0": - version: 5.0.0 - resolution: "run-applescript@npm:5.0.0" - dependencies: - execa: "npm:^5.0.0" - checksum: f9977db5770929f3f0db434b8e6aa266498c70dec913c84320c0a06add510cf44e3a048c44da088abee312006f9cbf572fd065cdc8f15d7682afda8755f4114c - languageName: node - linkType: hard - "run-parallel@npm:^1.1.9": version: 1.2.0 resolution: "run-parallel@npm:1.2.0" @@ -4441,13 +4215,6 @@ __metadata: languageName: node linkType: hard -"signal-exit@npm:^3.0.3, signal-exit@npm:^3.0.7": - version: 3.0.7 - resolution: "signal-exit@npm:3.0.7" - checksum: 25d272fa73e146048565e08f3309d5b942c1979a6f4a58a8c59d5fa299728e9c2fcd1a759ec870863b1fd38653670240cd420dad2ad9330c71f36608a6a1c912 - languageName: node - linkType: hard - "signal-exit@npm:^4.0.1": version: 4.1.0 resolution: "signal-exit@npm:4.1.0" @@ -4602,20 +4369,6 @@ __metadata: languageName: node linkType: hard -"strip-final-newline@npm:^2.0.0": - version: 2.0.0 - resolution: "strip-final-newline@npm:2.0.0" - checksum: bddf8ccd47acd85c0e09ad7375409d81653f645fda13227a9d459642277c253d877b68f2e5e4d819fe75733b0e626bac7e954c04f3236f6d196f79c94fa4a96f - languageName: node - linkType: hard - -"strip-final-newline@npm:^3.0.0": - version: 3.0.0 - resolution: "strip-final-newline@npm:3.0.0" - checksum: a771a17901427bac6293fd416db7577e2bc1c34a19d38351e9d5478c3c415f523f391003b42ed475f27e33a78233035df183525395f731d3bfb8cdcbd4da08ce - languageName: node - linkType: hard - "strip-json-comments@npm:^3.1.1": version: 3.1.1 resolution: "strip-json-comments@npm:3.1.1" @@ -4648,13 +4401,13 @@ __metadata: languageName: node linkType: hard -"synckit@npm:^0.8.5": - version: 0.8.6 - resolution: "synckit@npm:0.8.6" +"synckit@npm:^0.8.6": + version: 0.8.8 + resolution: "synckit@npm:0.8.8" dependencies: - "@pkgr/utils": "npm:^2.4.2" + "@pkgr/core": "npm:^0.1.0" tslib: "npm:^2.6.2" - checksum: 200528062e3915a0190a4c6b1e01436fcfdf812e2e8d977746746f3998bb4182d758af760e51b06a64f8323e705735aff7b4b3efc4a0ab5f75eaccc044a8cfcc + checksum: c3d3aa8e284f3f84f2f868b960c9f49239b364e35f6d20825a448449a3e9c8f49fe36cdd5196b30615682f007830d46f2ea354003954c7336723cb821e4b6519 languageName: node linkType: hard @@ -4686,13 +4439,6 @@ __metadata: languageName: node linkType: hard -"titleize@npm:^3.0.0": - version: 3.0.0 - resolution: "titleize@npm:3.0.0" - checksum: 5ae6084ba299b5782f95e3fe85ea9f0fa4d74b8ae722b6b3208157e975589fbb27733aeba4e5080fa9314a856044ef52caa61b87caea4b1baade951a55c06336 - languageName: node - linkType: hard - "to-fast-properties@npm:^2.0.0": version: 2.0.0 resolution: "to-fast-properties@npm:2.0.0" @@ -4793,7 +4539,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^2.4.0, tslib@npm:^2.6.0, tslib@npm:^2.6.2": +"tslib@npm:^2.4.0, tslib@npm:^2.6.2": version: 2.6.2 resolution: "tslib@npm:2.6.2" checksum: e03a8a4271152c8b26604ed45535954c0a45296e32445b4b87f8a5abdb2421f40b59b4ca437c4346af0f28179780d604094eb64546bee2019d903d01c6c19bdb @@ -4944,13 +4690,6 @@ __metadata: languageName: node linkType: hard -"untildify@npm:^4.0.0": - version: 4.0.0 - resolution: "untildify@npm:4.0.0" - checksum: d758e624c707d49f76f7511d75d09a8eda7f2020d231ec52b67ff4896bcf7013be3f9522d8375f57e586e9a2e827f5641c7e06ee46ab9c435fc2b2b2e9de517a - languageName: node - linkType: hard - "uri-js@npm:^4.2.2": version: 4.4.1 resolution: "uri-js@npm:4.4.1" @@ -5009,8 +4748,8 @@ __metadata: "@types/cors": "npm:^2.8.17" "@types/express": "npm:^4.17.21" "@types/node": "npm:^20.10.5" - "@typescript-eslint/eslint-plugin": "npm:^6.15.0" - "@typescript-eslint/parser": "npm:^6.15.0" + "@typescript-eslint/eslint-plugin": "npm:^6.16.0" + "@typescript-eslint/parser": "npm:^6.16.0" body-parser: "npm:^1.20.2" cors: "npm:^2.8.5" dotenv: "npm:^16.3.1" @@ -5018,7 +4757,8 @@ __metadata: eslint-config-prettier: "npm:^9.1.0" eslint-import-resolver-typescript: "npm:^3.6.1" eslint-plugin-import: "npm:^2.29.1" - eslint-plugin-prettier: "npm:^5.1.1" + eslint-plugin-perfectionist: "npm:^2.5.0" + eslint-plugin-prettier: "npm:^5.1.2" express: "npm:^4.18.2" graphql: "npm:^16.8.1" nodemon: "npm:^3.0.2"