From f70d03de84b201026394c0f4477812823d39c252 Mon Sep 17 00:00:00 2001 From: Alejandro Lembke Barrientos Date: Mon, 6 Mar 2023 22:37:37 +0000 Subject: [PATCH] PR-780243: Adding strict to types. --- package-lock.json | 254 ++++++++++++++++++++- package.json | 8 +- src/GraphQL/resolvers/index.ts | 8 +- src/GraphQL/schema/index.ts | 2 +- src/GraphQL/server.ts | 5 +- src/controllers/controllerGraphQL/index.ts | 8 +- src/index.ts | 6 +- src/models/index.ts | 2 +- src/tests/server/index.test.ts | 2 +- tsconfig.json | 2 + 10 files changed, 280 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3256926..fbef140 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@aleleba/create-node-ts-graphql-server", - "version": "1.2.11", + "version": "1.2.12", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@aleleba/create-node-ts-graphql-server", - "version": "1.2.11", + "version": "1.2.12", "license": "MIT", "dependencies": { "@graphql-tools/schema": "^9.0.16", @@ -32,10 +32,16 @@ "@babel/preset-env": "^7.20.2", "@babel/preset-typescript": "^7.21.0", "@babel/register": "^7.21.0", + "@types/body-parser": "^1.19.2", + "@types/cookie-parser": "^1.4.3", + "@types/cors": "^2.8.13", + "@types/express": "^4.17.17", "@types/jest": "^29.4.0", "@types/node": "^18.14.6", + "@types/supertest": "^2.0.12", "@types/webpack": "^5.28.0", "@types/webpack-node-externals": "^3.0.0", + "@types/ws": "^8.5.4", "@typescript-eslint/eslint-plugin": "^5.54.0", "@typescript-eslint/parser": "^5.54.0", "babel-loader": "^9.1.2", @@ -3057,6 +3063,49 @@ "@babel/types": "^7.3.0" } }, + "node_modules/@types/body-parser": { + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", + "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", + "dev": true, + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/@types/connect": { + "version": "3.4.35", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", + "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/cookie-parser": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/@types/cookie-parser/-/cookie-parser-1.4.3.tgz", + "integrity": "sha512-CqSKwFwefj4PzZ5n/iwad/bow2hTCh0FlNAeWLtQM3JA/NX/iYagIpWG2cf1bQKQ2c9gU2log5VUCrn7LDOs0w==", + "dev": true, + "dependencies": { + "@types/express": "*" + } + }, + "node_modules/@types/cookiejar": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@types/cookiejar/-/cookiejar-2.1.2.tgz", + "integrity": "sha512-t73xJJrvdTjXrn4jLS9VSGRbz0nUY3cl2DMGDU48lKl+HR9dbbjW2A9r3g40VA++mQpy6uuHg33gy7du2BKpog==", + "dev": true + }, + "node_modules/@types/cors": { + "version": "2.8.13", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.13.tgz", + "integrity": "sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/eslint": { "version": "8.21.0", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.21.0.tgz", @@ -3083,6 +3132,29 @@ "integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==", "dev": true }, + "node_modules/@types/express": { + "version": "4.17.17", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.17.tgz", + "integrity": "sha512-Q4FmmuLGBG58btUnfS1c1r/NQdlp3DMfGDGig8WhfpA2YRUtEkxAjkZb0yvplJGYdF1fsQ81iMDcH24sSCNC/Q==", + "dev": true, + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.33", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "4.17.33", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.33.tgz", + "integrity": "sha512-TPBqmR/HRYI3eC2E5hmiivIzv+bidAfXofM+sbonAGvyDhySGw9/PQZFt2BLOrjUUR++4eJVpx6KnLQK1Fk9tA==", + "dev": true, + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*" + } + }, "node_modules/@types/glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", @@ -3142,6 +3214,12 @@ "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", "dev": true }, + "node_modules/@types/mime": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-3.0.1.tgz", + "integrity": "sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==", + "dev": true + }, "node_modules/@types/minimatch": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", @@ -3160,18 +3238,59 @@ "integrity": "sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg==", "dev": true }, + "node_modules/@types/qs": { + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==", + "dev": true + }, + "node_modules/@types/range-parser": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", + "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==", + "dev": true + }, "node_modules/@types/semver": { "version": "7.3.13", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz", "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", "dev": true }, + "node_modules/@types/serve-static": { + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.1.tgz", + "integrity": "sha512-NUo5XNiAdULrJENtJXZZ3fHtfMolzZwczzBbnAeBbqBwG+LaG6YaJtuwzwGSQZ2wsCrxjEhNNjAkKigy3n8teQ==", + "dev": true, + "dependencies": { + "@types/mime": "*", + "@types/node": "*" + } + }, "node_modules/@types/stack-utils": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", "dev": true }, + "node_modules/@types/superagent": { + "version": "4.1.16", + "resolved": "https://registry.npmjs.org/@types/superagent/-/superagent-4.1.16.tgz", + "integrity": "sha512-tLfnlJf6A5mB6ddqF159GqcDizfzbMUB1/DeT59/wBNqzRTNNKsaw79A/1TZ84X+f/EwWH8FeuSkjlCLyqS/zQ==", + "dev": true, + "dependencies": { + "@types/cookiejar": "*", + "@types/node": "*" + } + }, + "node_modules/@types/supertest": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@types/supertest/-/supertest-2.0.12.tgz", + "integrity": "sha512-X3HPWTwXRerBZS7Mo1k6vMVR1Z6zmJcDVn5O/31whe0tnjE4te6ZJSJGq1RiqHPjzPdMTfjCFogDJmwng9xHaQ==", + "dev": true, + "dependencies": { + "@types/superagent": "*" + } + }, "node_modules/@types/webpack": { "version": "5.28.0", "resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-5.28.0.tgz", @@ -3193,6 +3312,15 @@ "webpack": "^5" } }, + "node_modules/@types/ws": { + "version": "8.5.4", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.4.tgz", + "integrity": "sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/yargs": { "version": "17.0.10", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.10.tgz", @@ -13134,6 +13262,49 @@ "@babel/types": "^7.3.0" } }, + "@types/body-parser": { + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", + "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", + "dev": true, + "requires": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "@types/connect": { + "version": "3.4.35", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", + "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/cookie-parser": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/@types/cookie-parser/-/cookie-parser-1.4.3.tgz", + "integrity": "sha512-CqSKwFwefj4PzZ5n/iwad/bow2hTCh0FlNAeWLtQM3JA/NX/iYagIpWG2cf1bQKQ2c9gU2log5VUCrn7LDOs0w==", + "dev": true, + "requires": { + "@types/express": "*" + } + }, + "@types/cookiejar": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@types/cookiejar/-/cookiejar-2.1.2.tgz", + "integrity": "sha512-t73xJJrvdTjXrn4jLS9VSGRbz0nUY3cl2DMGDU48lKl+HR9dbbjW2A9r3g40VA++mQpy6uuHg33gy7du2BKpog==", + "dev": true + }, + "@types/cors": { + "version": "2.8.13", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.13.tgz", + "integrity": "sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/eslint": { "version": "8.21.0", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.21.0.tgz", @@ -13160,6 +13331,29 @@ "integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==", "dev": true }, + "@types/express": { + "version": "4.17.17", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.17.tgz", + "integrity": "sha512-Q4FmmuLGBG58btUnfS1c1r/NQdlp3DMfGDGig8WhfpA2YRUtEkxAjkZb0yvplJGYdF1fsQ81iMDcH24sSCNC/Q==", + "dev": true, + "requires": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.33", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "@types/express-serve-static-core": { + "version": "4.17.33", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.33.tgz", + "integrity": "sha512-TPBqmR/HRYI3eC2E5hmiivIzv+bidAfXofM+sbonAGvyDhySGw9/PQZFt2BLOrjUUR++4eJVpx6KnLQK1Fk9tA==", + "dev": true, + "requires": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*" + } + }, "@types/glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", @@ -13219,6 +13413,12 @@ "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", "dev": true }, + "@types/mime": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-3.0.1.tgz", + "integrity": "sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==", + "dev": true + }, "@types/minimatch": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", @@ -13237,18 +13437,59 @@ "integrity": "sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg==", "dev": true }, + "@types/qs": { + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==", + "dev": true + }, + "@types/range-parser": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", + "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==", + "dev": true + }, "@types/semver": { "version": "7.3.13", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz", "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", "dev": true }, + "@types/serve-static": { + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.1.tgz", + "integrity": "sha512-NUo5XNiAdULrJENtJXZZ3fHtfMolzZwczzBbnAeBbqBwG+LaG6YaJtuwzwGSQZ2wsCrxjEhNNjAkKigy3n8teQ==", + "dev": true, + "requires": { + "@types/mime": "*", + "@types/node": "*" + } + }, "@types/stack-utils": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", "dev": true }, + "@types/superagent": { + "version": "4.1.16", + "resolved": "https://registry.npmjs.org/@types/superagent/-/superagent-4.1.16.tgz", + "integrity": "sha512-tLfnlJf6A5mB6ddqF159GqcDizfzbMUB1/DeT59/wBNqzRTNNKsaw79A/1TZ84X+f/EwWH8FeuSkjlCLyqS/zQ==", + "dev": true, + "requires": { + "@types/cookiejar": "*", + "@types/node": "*" + } + }, + "@types/supertest": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@types/supertest/-/supertest-2.0.12.tgz", + "integrity": "sha512-X3HPWTwXRerBZS7Mo1k6vMVR1Z6zmJcDVn5O/31whe0tnjE4te6ZJSJGq1RiqHPjzPdMTfjCFogDJmwng9xHaQ==", + "dev": true, + "requires": { + "@types/superagent": "*" + } + }, "@types/webpack": { "version": "5.28.0", "resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-5.28.0.tgz", @@ -13270,6 +13511,15 @@ "webpack": "^5" } }, + "@types/ws": { + "version": "8.5.4", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.4.tgz", + "integrity": "sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, "@types/yargs": { "version": "17.0.10", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.10.tgz", diff --git a/package.json b/package.json index 29fb58a..052d878 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@aleleba/create-node-ts-graphql-server", - "version": "1.2.11", + "version": "1.3.0", "description": "Node with Typescript and GraphQL Server", "bin": "./bin/cli.js", "main": "index.js", @@ -53,10 +53,16 @@ "@babel/preset-env": "^7.20.2", "@babel/preset-typescript": "^7.21.0", "@babel/register": "^7.21.0", + "@types/body-parser": "^1.19.2", + "@types/cookie-parser": "^1.4.3", + "@types/cors": "^2.8.13", + "@types/express": "^4.17.17", "@types/jest": "^29.4.0", "@types/node": "^18.14.6", + "@types/supertest": "^2.0.12", "@types/webpack": "^5.28.0", "@types/webpack-node-externals": "^3.0.0", + "@types/ws": "^8.5.4", "@typescript-eslint/eslint-plugin": "^5.54.0", "@typescript-eslint/parser": "^5.54.0", "babel-loader": "^9.1.2", diff --git a/src/GraphQL/resolvers/index.ts b/src/GraphQL/resolvers/index.ts index f298795..24031bb 100644 --- a/src/GraphQL/resolvers/index.ts +++ b/src/GraphQL/resolvers/index.ts @@ -6,17 +6,17 @@ import { getTest, addText } from '@controllerGraphQL'; const resolvers = { Query: { // eslint-disable-next-line - test: (rootValue, args, context) => ({}), + test: (rootValue: any, args: any, context: any) => ({}), }, Mutation: { // eslint-disable-next-line - testMutation: (rootValue, args, context) => ({}), + testMutation: (rootValue: any, args: any, context: any) => ({}), }, Test: { - test: (rootValue, args, context) => getTest({rootValue, args, context}) + test: (rootValue: any, args: any, context: any) => getTest({rootValue, args, context}) }, TestMutation: { - testMutation: (rootValue, args, context) => addText({rootValue, args, context}) + testMutation: (rootValue: any, args: any, context: any) => addText({rootValue, args, context}) } }; diff --git a/src/GraphQL/schema/index.ts b/src/GraphQL/schema/index.ts index 6189687..030c001 100644 --- a/src/GraphQL/schema/index.ts +++ b/src/GraphQL/schema/index.ts @@ -1,6 +1,6 @@ import { makeExecutableSchema } from '@graphql-tools/schema'; import resolvers from'@GraphQL/resolvers'; -import Test from './Test.gql'; +import Test from '@GraphQL/schema/Test.gql'; // The GraphQL schema const rootTypes = ` diff --git a/src/GraphQL/server.ts b/src/GraphQL/server.ts index 2aa604d..c0148af 100644 --- a/src/GraphQL/server.ts +++ b/src/GraphQL/server.ts @@ -21,8 +21,9 @@ server.use( // DO NOT DO app.listen() unless we're testing this directly if (require.main === module) { - server.listen((process.env.PORT || 4000), () => { - console.log(`Iniciando Express en el puerto 4000${server.graphqlPath}`); /*${app.get('port')}*/ + const app = express(); + app.listen((process.env.PORT || 4000), () => { + console.log(`Iniciando Express en el puerto 4000`); /*${app.get('port')}*/ }); } diff --git a/src/controllers/controllerGraphQL/index.ts b/src/controllers/controllerGraphQL/index.ts index a0d11d4..dd6d684 100644 --- a/src/controllers/controllerGraphQL/index.ts +++ b/src/controllers/controllerGraphQL/index.ts @@ -3,12 +3,16 @@ import { getTestModel, addTextModel } from '@models'; // eslint-disable-next-line -export const getTest = async ({rootValue, args, context}) => { +export const getTest = async ({}) => { return getTestModel(); }; // eslint-disable-next-line -export const addText = async ({rootValue, args, context}) => { +export const addText = async ({args}: { + rootValue: any + args: { text: string } + context: any +}) => { const text = args.text; return addTextModel({ text }); }; \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 1052054..077bf64 100644 --- a/src/index.ts +++ b/src/index.ts @@ -15,8 +15,8 @@ import apiRouter from '@routes'; const app = express(), //creating app whitelist = config.WHITELIST_URLS, corsOptions = { - origin: function (origin, callback) { - if (whitelist.indexOf(origin) !== -1 || !origin) { + origin: function (origin: string | undefined, callback: (arg0: Error | null, arg1?: boolean) => void) { + if (whitelist.indexOf(origin as string) !== -1 || !origin) { callback(null, true); } else { callback(new Error('Not allowed by CORS')); @@ -29,7 +29,7 @@ const app = express(), //creating app app .use(cookieParser()) .use(express.urlencoded({limit: '500mb', extended: true})) - .use(express.json({limit: '500mb', extended: true})) + .use(express.json({limit: '500mb'})) .use(cors(corsOptions)) .use(apiRouter)//Routes de App .use('/graphql', GraphQLserver);//Server of Graphql diff --git a/src/models/index.ts b/src/models/index.ts index ae93f18..44f39bb 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -4,6 +4,6 @@ export const getTestModel = async () => { return 'This is the text response for Test Query from a model'; }; -export const addTextModel = async ({ text }) => { +export const addTextModel = async ({ text }: {text: string}) => { return `Simulate to insert some text: ${text} from a model`; }; \ No newline at end of file diff --git a/src/tests/server/index.test.ts b/src/tests/server/index.test.ts index dd72e18..28b4921 100644 --- a/src/tests/server/index.test.ts +++ b/src/tests/server/index.test.ts @@ -1,7 +1,7 @@ import server from '@src'; import supertest from 'supertest'; describe('global server tests', () => { - let request; + let request: supertest.SuperTest; beforeEach(() => { request = supertest(server); }); diff --git a/tsconfig.json b/tsconfig.json index 414c425..5e5b434 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,6 +6,8 @@ "moduleResolution": "node", "sourceMap": true, "typeRoots" : ["./src/@types", "./node_modules/@types"], + "strict": true, + "forceConsistentCasingInFileNames": true, "baseUrl": ".", "paths": { "@src/*": ["src/*"],