Skip to content

Commit

Permalink
Revert "Update tsconfig"
Browse files Browse the repository at this point in the history
This reverts commit 93146a7.
  • Loading branch information
FreePhoenix888 committed Oct 11, 2023
1 parent 1920d50 commit b9984bf
Show file tree
Hide file tree
Showing 15 changed files with 30 additions and 158 deletions.
24 changes: 0 additions & 24 deletions api.d.ts

This file was deleted.

8 changes: 4 additions & 4 deletions api.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ export interface HasuraApiOptions {
path: string;
ssl: boolean;
secret: string;
errorHandler?: (result: any) => any;
errorHandler?: (result) => any;
}
export interface HasuraApiQueryOptions {
route?: string;
}

export class HasuraApi {
options: HasuraApiOptions;
defaultErrorHandler = (result: any) => console.log('error', result?.error, result?.data);
defaultErrorHandler = (result) => console.log('error', result?.error, result?.data);
constructor(options: HasuraApiOptions) {
this.options = { errorHandler: this.defaultErrorHandler, ...options };
}
Expand Down Expand Up @@ -59,8 +59,8 @@ export class HasuraApi {
data,
validateStatus: this.validateStatus,
});
result.error = this.getError(result) ?? undefined;
if (result.error) this.options.errorHandler?.(result);
result.error = this.getError(result);
if (result.error) this.options.errorHandler(result);
return result;
}
async metadata(data: any, options: HasuraApiQueryOptions = { route: '/v1/metadata' }) {
Expand Down
8 changes: 0 additions & 8 deletions auth-webhook.d.ts

This file was deleted.

2 changes: 1 addition & 1 deletion auth-webhook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const generateAuthWebhookNextjs = function generateAuthWebhookNextjs(
options: AuthWebhookOptions,
) {
const cors = Cors({ methods: ['GET', 'HEAD'] });
return async (req: any, res: any) => {
return async (req, res) => {
await corsMiddleware(req, res, cors);
const bearer = req?.headers['Authorization'] || req?.headers['authorization'];
const token = bearer.slice(7);
Expand Down
22 changes: 0 additions & 22 deletions client.d.ts

This file was deleted.

3 changes: 1 addition & 2 deletions client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { debug } from './debug';

const moduleLog = debug.extend('client')

let ws: any;
let ws;
if (typeof(window) !== 'object') {
ws = require('ws');
}
Expand Down Expand Up @@ -96,7 +96,6 @@ export function generateApolloClient(
const def = getMainDefinition(query);
return def?.kind === 'OperationDefinition' && def?.operation === 'subscription';
},
// @ts-ignore
wsLink,
// @ts-ignore
httpLink,
Expand Down
1 change: 0 additions & 1 deletion cors-middleware.d.ts

This file was deleted.

4 changes: 2 additions & 2 deletions cors-middleware.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Cors from 'cors';

export const corsMiddleware = async (req: any, res: any, cors: any) => {
return await new Promise((resolve, reject) => cors(req, res, (result: any) => {
export const corsMiddleware = async (req, res, cors) => {
return await new Promise((resolve, reject) => cors(req, res, (result) => {
if (result instanceof Error) return reject(result);
return resolve(result);
}));
Expand Down
2 changes: 0 additions & 2 deletions debug.d.ts

This file was deleted.

69 changes: 0 additions & 69 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@
"docker": "cross-env JWT_SECRET=\"{\\\"type\\\":\\\"HS256\\\",\\\"key\\\":\\\"3EK6FD+o0+c7tzBNVfjpMkNDi2yARAAKzQlk8O2IKoxQu4nF7EdAh8s3TwpHwrdWT6R\\\"}\" HASURA_GRAPHQL_DATABASE_URL=postgres://postgres:postgrespassword@postgres:5432/postgres HASURA_GRAPHQL_ENABLE_CONSOLE=true HASURA_GRAPHQL_DEV_MODE=true HASURA_GRAPHQL_LOG_LEVEL=debug HASURA_GRAPHQL_ENABLED_LOG_TYPES=\"startup, http-log, webhook-log, websocket-log, query-log\" HASURA_GRAPHQL_ADMIN_SECRET=myadminsecretkey HASURA_GRAPHQL_ENABLE_REMOTE_SCHEMA_PERMISSIONS=true HASURA_GRAPHQL_UNAUTHORIZED_ROLE=undefined POSTGRES_USER=postgres POSTGRES_PASSWORD=postgrespassword PGGSSENCMODE=disable PGSSLMODE=disable PGREQUIRESSL=0 MINIO_ROOT_USER=minioaccesskey MINIO_ROOT_PASSWORD=miniosecretkey HASURA_STORAGE_DEBUG=true HASURA_METADATA=1 HASURA_ENDPOINT=http://host.docker.internal:8080/v1 S3_ENDPOINT=http://host.docker.internal:9000 S3_ACCESS_KEY=minioaccesskey S3_SECRET_KEY=miniosecretkey S3_BUCKET=default S3_ROOT_FOLDER=default POSTGRES_MIGRATIONS=0 POSTGRES_MIGRATIONS_SOURCE=postgres://postgres:[email protected]:5432/postgres?sslmode=disable npm run docker-local"
},
"devDependencies": {
"@tsconfig/recommended": "^1.0.3",
"@types/cors": "^2.8.14",
"@types/debug": "^4.1.9",
"@types/node-fetch": "^2.6.6",
"cross-env": "^7.0.3",
"pre-commit": "^1.2.2",
"typescript": "5.0.4"
Expand Down
12 changes: 0 additions & 12 deletions remote-schema.d.ts

This file was deleted.

2 changes: 1 addition & 1 deletion remote-schema.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const generateRemoteSchema = function generateRemoteSchema(
});
const handler = apolloServer.createHandler({ path });
return {
default: async (req: any, res: any) => {
default: async (req, res) => {
await corsMiddleware(req, res, cors);
return await handler(req, res);
},
Expand Down
1 change: 0 additions & 1 deletion sql.d.ts

This file was deleted.

27 changes: 21 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
{
"extends": "@tsconfig/recommended/tsconfig.json",
"exclude": [
"jest.config.ts",
],
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"experimentalDecorators": true,
"sourceMap": true,
"noImplicitAny": false,
"removeComments": true,
"jsx": "react",
"module": "commonjs",
"moduleResolution": "node",
"target": "es2015",
"skipLibCheck": true,
"lib": [
"dom",
"es6",
"es7"
],
"resolveJsonModule": true,
"esModuleInterop": true,
"isolatedModules": true,
"declaration": true,
"sourceMap": true
"typeRoots": [
"./node_modules/@types"
]
}
}
}

0 comments on commit b9984bf

Please sign in to comment.