@vladimirdev635/gql-client 0.0.16 → 0.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.gitignore ADDED
@@ -0,0 +1,5 @@
1
+ node_modules
2
+ dist
3
+ gql-codegen.mts
4
+ check
5
+ schema.json
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@vladimirdev635/gql-client",
3
+ "version": "0.0.1",
4
+ "type": "module",
5
+ "main": "./index.js",
6
+ "types": "./index.d.ts",
7
+ "files": ["./"],
8
+ "homepage": "https://github.com/Voldemat/graphql-plus-plus#readme",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/Voldemat/graphql-plus-plus.git"
12
+ },
13
+ "scripts": {
14
+ "lint": "eslint .",
15
+ "lint:fix": "eslint --fix .",
16
+ "lint:ci": "npm run lint",
17
+ "test": "vitest",
18
+ "build": "tsc && cp package.json ./dist/"
19
+ },
20
+ "keywords": [],
21
+ "author": "",
22
+ "license": "ISC",
23
+ "description": "",
24
+ "devDependencies": {
25
+ "@eslint/compat": "^1.3.0",
26
+ "@types/node": "^24.0.1",
27
+ "@typescript-eslint/eslint-plugin": "^8.34.0",
28
+ "eslint": "^9.28.0",
29
+ "jiti": "^2.4.2",
30
+ "vitest": "^3.2.4"
31
+ },
32
+ "dependencies": {
33
+ "zod": "^3.25.76"
34
+ }
35
+ }
@@ -0,0 +1,89 @@
1
+ /* eslint-disable max-lines */
2
+ import { dirname, resolve } from "path";
3
+ import { fileURLToPath } from "url";
4
+ import { FlatCompat } from "@eslint/eslintrc";
5
+ import { includeIgnoreFile } from "@eslint/compat";
6
+
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = dirname(__filename);
9
+ const gitignorePath = resolve(__dirname, ".gitignore");
10
+
11
+ const compat = new FlatCompat({
12
+ baseDirectory: __dirname,
13
+ });
14
+ const eslintConfig = [
15
+ includeIgnoreFile(gitignorePath),
16
+ ...compat.config({
17
+ rules: {
18
+ "max-lines": [
19
+ "error",
20
+ 100
21
+ ],
22
+ "max-len": [
23
+ "error",
24
+ 80
25
+ ],
26
+ "quotes": [
27
+ "error",
28
+ "single"
29
+ ],
30
+ "array-callback-return": "error",
31
+ "no-duplicate-imports": "error",
32
+ "no-dupe-else-if": "error",
33
+ "no-use-before-define": "error",
34
+ "max-depth": [
35
+ "error",
36
+ 3
37
+ ],
38
+ "no-shadow": "error",
39
+ "no-extra-parens": [
40
+ "error",
41
+ "all"
42
+ ],
43
+ "indent": [
44
+ "error",
45
+ 4
46
+ ],
47
+ "function-call-argument-newline": [
48
+ "error",
49
+ "consistent"
50
+ ],
51
+ "function-paren-newline": [
52
+ "error",
53
+ "consistent"
54
+ ],
55
+ "object-curly-spacing": [
56
+ "error",
57
+ "always"
58
+ ],
59
+ "no-console": "error",
60
+ },
61
+ "overrides": [
62
+ {
63
+ "files": [
64
+ "**/*.ts",
65
+ "**/*.tsx"
66
+ ],
67
+ "plugins": [
68
+ "@typescript-eslint",
69
+ ],
70
+ "extends": [
71
+ "plugin:@typescript-eslint/recommended"
72
+ ],
73
+ "parser": "@typescript-eslint/parser",
74
+ "parserOptions": {
75
+ "project": [
76
+ "./tsconfig.json"
77
+ ]
78
+ },
79
+ "rules": {
80
+ "@typescript-eslint/no-unused-vars": "error",
81
+ "@typescript-eslint/no-deprecated": "error",
82
+ "@typescript-eslint/indent": "off",
83
+ }
84
+ }
85
+ ]
86
+ })
87
+ ];
88
+
89
+ export default eslintConfig;
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@vladimirdev635/gql-client",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "type": "module",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
5
+ "main": "./index.js",
6
+ "types": "./index.d.ts",
7
7
  "files": [
8
- "/dist"
8
+ "./"
9
9
  ],
10
10
  "homepage": "https://github.com/Voldemat/graphql-plus-plus#readme",
11
11
  "repository": {
@@ -17,7 +17,7 @@
17
17
  "lint:fix": "eslint --fix .",
18
18
  "lint:ci": "npm run lint",
19
19
  "test": "vitest",
20
- "build": "tsc"
20
+ "build": "tsc && cp package.json ./dist/"
21
21
  },
22
22
  "keywords": [],
23
23
  "author": "",
package/src/execute.ts ADDED
@@ -0,0 +1,57 @@
1
+ import { z } from 'zod/v4'
2
+ import { ClientConfig, Operation } from './types.js'
3
+
4
+ export interface ExecuteResult<T extends Operation> {
5
+ result: z.infer<T['resultSchema']>
6
+ response: Response
7
+ }
8
+
9
+ export async function execute<TContext, T extends Operation>(
10
+ config: ClientConfig<TContext>,
11
+ operation: T,
12
+ variables: z.infer<T['variablesSchema']>,
13
+ ): Promise<ExecuteResult<T>> {
14
+ for (const middleware of config.middlewares.beforeSerialization) {
15
+ [operation, variables] = await middleware(
16
+ config.context,
17
+ operation,
18
+ variables
19
+ )
20
+ }
21
+ let init = await config.serializer.serializeRequest(
22
+ config.context, operation, variables
23
+ )
24
+ for (const middleware of config.middlewares.afterSerialization) {
25
+ init = await middleware(config.context, operation, variables, init)
26
+ }
27
+ let response = await config.fetcher(init)
28
+ for (const middleware of config.middlewares.beforeParsing) {
29
+ response = await middleware(
30
+ config.context, operation, variables, init, response
31
+ )
32
+ }
33
+ let result = await config.parser.parseBody(
34
+ config.context, operation, response
35
+ )
36
+ for (const middleware of config.middlewares.afterParsing) {
37
+ result = await middleware(
38
+ config.context,
39
+ operation,
40
+ variables,
41
+ init,
42
+ response,
43
+ result
44
+ )
45
+ }
46
+ return { result, response }
47
+ }
48
+
49
+ export type Executor = <T extends Operation>(
50
+ operation: T,
51
+ variables: z.infer<T['variablesSchema']>
52
+ ) => Promise<ExecuteResult<T>>
53
+ export function bindConfigToExecute<TContext>(
54
+ config: ClientConfig<TContext>
55
+ ): Executor {
56
+ return (operation, variables) => execute(config, operation, variables)
57
+ }
package/src/index.ts ADDED
@@ -0,0 +1,13 @@
1
+ export { createParser } from './parser.js'
2
+ export {
3
+ execute,
4
+ bindConfigToExecute,
5
+ type Executor,
6
+ type ExecuteResult
7
+ } from './execute.js'
8
+ export type {
9
+ Operation,
10
+ ClientParser,
11
+ ClientSerializer,
12
+ ClientConfig
13
+ } from './types.js'
package/src/parser.ts ADDED
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod/v4';
2
+ import { ClientParser, Operation } from './types.js';
3
+
4
+ export function createParser<TContext>(): ClientParser<TContext> {
5
+ return {
6
+ parseBody: async <T extends Operation>(
7
+ _: TContext,
8
+ operation: T,
9
+ response: Response
10
+ ) => {
11
+ return operation.resultSchema.parse(
12
+ await response.json()
13
+ ) as z.infer<T['resultSchema']>
14
+ },
15
+ }
16
+ }
@@ -0,0 +1,4 @@
1
+ export { createJSONSerializer } from './json.js'
2
+ export { createMultipartSerializer } from './multipart.js'
3
+ export { createSerializer, hasBlobValue } from './serializer.js'
4
+
@@ -0,0 +1,25 @@
1
+ import { ClientSerializer } from '@/types.js'
2
+ import assert from 'assert'
3
+
4
+ export function createJSONSerializer<TContext>(): ClientSerializer<TContext> {
5
+ return {
6
+ serializeRequest: (_, operation, variables) => {
7
+ return {
8
+ headers: {
9
+ 'Content-Type': 'application/json'
10
+ },
11
+ body: JSON.stringify({
12
+ query: operation.document,
13
+ variables
14
+ }, (key, value) => {
15
+ assert(
16
+ !(value instanceof File),
17
+ 'jsonSerializer cannot encode File objects, ' +
18
+ `key: "${key}"`
19
+ )
20
+ return value
21
+ })
22
+ }
23
+ },
24
+ }
25
+ }
@@ -0,0 +1,95 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import { ClientSerializer, Operation } from '@/types.js'
3
+ import assert from 'assert';
4
+
5
+ function getFilesKeysAndPayload (
6
+ variables: Record<string, any> | Array<any>,
7
+ initialPath: string = '',
8
+ shouldTreatAsObject?: (v: any) => boolean,
9
+ ): [string[], Record<string, any> | Array<any>] {
10
+ const filesKeys: string[] = []
11
+ const newObject: any = Array.isArray(variables) ? [] : {}
12
+ for (const [key, value] of Object.entries(variables)) {
13
+ if (value instanceof Blob) {
14
+ filesKeys.push(initialPath + key);
15
+ newObject[key] = null
16
+ continue
17
+ }
18
+ if (typeof value === 'object' && value !== null && (
19
+ shouldTreatAsObject === undefined ||
20
+ shouldTreatAsObject(value)
21
+ )) {
22
+ const [valueFilesKeys, valueObj] = getFilesKeysAndPayload(
23
+ value, initialPath + key + '.', shouldTreatAsObject
24
+ )
25
+ filesKeys.push(...valueFilesKeys);
26
+ newObject[key] = valueObj
27
+ continue
28
+ }
29
+ newObject[key] = value
30
+ }
31
+
32
+ return [filesKeys, newObject]
33
+ }
34
+
35
+ function getNestedValue (obj: Record<string, any>, key: string): any {
36
+ const subkeys = key.split('.')
37
+ while (subkeys.length > 0) {
38
+ const currentKey = subkeys.shift()
39
+ if (currentKey === undefined) throw new Error()
40
+ obj = obj[currentKey]
41
+ }
42
+ return obj
43
+ }
44
+
45
+ function buildFormData<T extends Operation> (
46
+ operation: T,
47
+ variables: Record<string, any> | Array<any>,
48
+ shouldTreatAsObject?: (v: any) => boolean
49
+ ): FormData {
50
+ const formData = new FormData()
51
+ const [filesKeys, finalVariables] = getFilesKeysAndPayload(
52
+ variables, '', shouldTreatAsObject
53
+ )
54
+ assert(
55
+ filesKeys.length !== 0,
56
+ 'Dont use multipartSerializer for regular bodies'
57
+ )
58
+ formData.append(
59
+ 'operations',
60
+ JSON.stringify({
61
+ query: operation.document,
62
+ variables: finalVariables
63
+ })
64
+ )
65
+ const properties: Array<[string, string]> = filesKeys
66
+ .map((key, index) => [String(index), key])
67
+ const finalMap = Object.fromEntries(
68
+ properties
69
+ .map(([index, key]) => {
70
+ return [index, ['variables.' + key]]
71
+ })
72
+ )
73
+ formData.append('map', JSON.stringify(finalMap))
74
+ for (const [index, key] of properties) {
75
+ const value: Blob | File = getNestedValue(variables, key)
76
+ let filename: string | undefined = undefined
77
+ if (value instanceof File) filename = value.name
78
+ formData.append(index, value, filename)
79
+ }
80
+ return formData
81
+ }
82
+
83
+ export function createMultipartSerializer<TContext>(
84
+ ): ClientSerializer<TContext> {
85
+ return {
86
+ serializeRequest: (_, operation, variables) => {
87
+ return {
88
+ headers: {
89
+ 'Content-Type': 'multipart/form-data'
90
+ },
91
+ body: buildFormData(operation, variables as any)
92
+ }
93
+ },
94
+ }
95
+ }
@@ -0,0 +1,33 @@
1
+ import { ClientSerializer } from '../types.js';
2
+
3
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4
+ export function hasBlobValue (data: any): boolean {
5
+ if (typeof data !== 'object') return false
6
+ for (const value of Object.values(data)) {
7
+ if (typeof value !== 'object' || value === null) continue
8
+ if (value instanceof Blob) return true
9
+ const hasBlob = hasBlobValue(value)
10
+ if (hasBlob) return true
11
+ }
12
+ return false
13
+ }
14
+
15
+ export function createSerializer<TContext>(
16
+ jsonSerializer: ClientSerializer<TContext>,
17
+ multipartSerializer: ClientSerializer<TContext>,
18
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
19
+ shouldUseMultipartSerializer: (variables: any) => boolean = hasBlobValue
20
+ ): ClientSerializer<TContext> {
21
+ return {
22
+ serializeRequest: (context, operation, variables) => {
23
+ if (!shouldUseMultipartSerializer(variables)) {
24
+ return jsonSerializer.serializeRequest(
25
+ context, operation, variables
26
+ )
27
+ }
28
+ return multipartSerializer.serializeRequest(
29
+ context, operation, variables
30
+ )
31
+ },
32
+ }
33
+ }
@@ -0,0 +1,52 @@
1
+ import { describe, expect, it } from 'vitest'
2
+ import { Operation } from '@/types.js'
3
+ import { z } from 'zod/v4'
4
+ import { createJSONSerializer } from '../json.js'
5
+
6
+ describe('Json serializer', () => {
7
+ const jsonSerializer = createJSONSerializer()
8
+
9
+ it('Should crush if files are present', async () => {
10
+ const operation = {
11
+ document: 'test-document',
12
+ variablesSchema: z.object({
13
+ name: z.string(),
14
+ file: z.file(),
15
+ }),
16
+ resultSchema: z.void()
17
+ } satisfies Operation
18
+ const variables: z.infer<(typeof operation)['variablesSchema']> = {
19
+ name: 'test-name',
20
+ file: new File([], '')
21
+ }
22
+ expect(
23
+ () => jsonSerializer.serializeRequest({}, operation, variables)
24
+ ).toThrowError('jsonSerializer cannot encode File objects, key: "file"')
25
+ })
26
+
27
+ it('Should json stringify variables', async () => {
28
+ const operation = {
29
+ document: 'test-document',
30
+ variablesSchema: z.object({
31
+ name: z.string(),
32
+ }),
33
+ resultSchema: z.void()
34
+ } satisfies Operation
35
+ const variables: z.infer<(typeof operation)['variablesSchema']> = {
36
+ name: 'test-name',
37
+ }
38
+ const init = await jsonSerializer.serializeRequest(
39
+ {},
40
+ operation,
41
+ variables
42
+ )
43
+ const headers = new Headers(init.headers)
44
+ expect(headers.get('Content-Type')).toBe('application/json')
45
+ expect(init.body).toBe(JSON.stringify({
46
+ query: operation.document,
47
+ variables: {
48
+ name: 'test-name',
49
+ }
50
+ }))
51
+ })
52
+ })
@@ -0,0 +1,60 @@
1
+ import { describe, expect, it } from 'vitest'
2
+ import { createMultipartSerializer } from '../multipart.js'
3
+ import { Operation } from '@/types.js'
4
+ import { z } from 'zod/v4'
5
+ import assert from 'assert'
6
+
7
+ describe('Multipart serializer', () => {
8
+ const multipartSerializer = createMultipartSerializer()
9
+
10
+ it('Should crush if no files present', () => {
11
+ const operation = {
12
+ document: 'test-document',
13
+ variablesSchema: z.object({
14
+ name: z.string()
15
+ }),
16
+ resultSchema: z.void()
17
+ } satisfies Operation
18
+ const variables: z.infer<(typeof operation)['variablesSchema']> = {
19
+ name: 'test-name'
20
+ }
21
+ expect(
22
+ () => multipartSerializer.serializeRequest({}, operation, variables)
23
+ ).toThrowError('Dont use multipartSerializer for regular bodies')
24
+ })
25
+
26
+ it('Should build proper form data', async () => {
27
+ const operation = {
28
+ document: 'test-document',
29
+ variablesSchema: z.object({
30
+ name: z.string(),
31
+ file: z.file()
32
+ }),
33
+ resultSchema: z.void()
34
+ } satisfies Operation
35
+ const variables: z.infer<(typeof operation)['variablesSchema']> = {
36
+ name: 'test-name',
37
+ file: new File([], 'check.txt')
38
+ }
39
+ const init = await multipartSerializer.serializeRequest(
40
+ {},
41
+ operation,
42
+ variables
43
+ )
44
+ const headers = new Headers(init.headers)
45
+ expect(headers.get('Content-Type')).toBe('multipart/form-data')
46
+ assert(init.body != null)
47
+ assert(init.body instanceof FormData)
48
+ expect(init.body.get('operations')).toBe(JSON.stringify({
49
+ query: operation.document,
50
+ variables: {
51
+ name: 'test-name',
52
+ file: null
53
+ }
54
+ }))
55
+ expect(init.body.get('map')).toBe(JSON.stringify({
56
+ '0': ['variables.file']
57
+ }))
58
+ expect(init.body.get('0')).toStrictEqual(variables.file)
59
+ })
60
+ })
package/src/types.ts ADDED
@@ -0,0 +1,71 @@
1
+ import { z } from 'zod/v4'
2
+
3
+ export interface Operation {
4
+ document: string
5
+ variablesSchema: z.ZodType
6
+ resultSchema: z.ZodType
7
+ }
8
+
9
+ export interface ClientParser<TContext> {
10
+ parseBody: <T extends Operation>(
11
+ context: TContext,
12
+ operation: T,
13
+ response: Response
14
+ ) => Promise<z.infer<T['resultSchema']>> |
15
+ z.infer<T['resultSchema']>
16
+ }
17
+
18
+ export interface ClientSerializer<TContext> {
19
+ serializeRequest: <T extends Operation>(
20
+ context: TContext,
21
+ operation: T,
22
+ variables: z.infer<T['variablesSchema']>
23
+ ) => Promise<RequestInit> | RequestInit
24
+ }
25
+
26
+ export type BeforeSerializationMiddleware<TContext> = <T extends Operation>(
27
+ context: TContext,
28
+ operation: T,
29
+ variables: z.infer<T['variablesSchema']>
30
+ ) => Promise<[T, z.infer<T['variablesSchema']>]> |
31
+ [T, z.infer<T['variablesSchema']>]
32
+
33
+ export type AfterSerializationMiddleware<TContext> = <T extends Operation>(
34
+ context: TContext,
35
+ operation: T,
36
+ variables: z.infer<T['variablesSchema']>,
37
+ init: RequestInit
38
+ ) => Promise<RequestInit> | RequestInit
39
+
40
+ export type BeforeParsingMiddleware<TContext> = <T extends Operation>(
41
+ context: TContext,
42
+ operation: T,
43
+ variables: z.infer<T['variablesSchema']>,
44
+ init: RequestInit,
45
+ response: Response
46
+ ) => Promise<Response> | Response
47
+
48
+ export type AfterParsingMiddleware<TContext> = <T extends Operation>(
49
+ context: TContext,
50
+ operation: T,
51
+ variables: z.infer<T['variablesSchema']>,
52
+ init: RequestInit,
53
+ response: Response,
54
+ result: z.infer<T['resultSchema']>
55
+ ) => Promise<z.infer<T['resultSchema']>> |
56
+ z.infer<T['resultSchema']>
57
+
58
+ export interface ClientMiddlewaresConfig<TContext> {
59
+ beforeSerialization: BeforeSerializationMiddleware<TContext>[]
60
+ afterSerialization: AfterSerializationMiddleware<TContext>[]
61
+ beforeParsing: BeforeParsingMiddleware<TContext>[]
62
+ afterParsing: AfterParsingMiddleware<TContext>[]
63
+ }
64
+
65
+ export interface ClientConfig<TContext> {
66
+ parser: ClientParser<TContext>
67
+ serializer: ClientSerializer<TContext>
68
+ middlewares: ClientMiddlewaresConfig<TContext>
69
+ context: TContext
70
+ fetcher: (init: RequestInit) => Promise<Response>
71
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,118 @@
1
+ {
2
+ "compilerOptions": {
3
+ /* Visit https://aka.ms/tsconfig to read more about this file */
4
+
5
+ /* Projects */
6
+ // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
7
+ // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
8
+ // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
9
+ // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
10
+ // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
11
+ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
12
+
13
+ /* Language and Environment */
14
+ "target": "es2024", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
15
+ // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
16
+ // "jsx": "preserve", /* Specify what JSX code is generated. */
17
+ // "libReplacement": true, /* Enable lib replacement. */
18
+ // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
19
+ // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
20
+ // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
21
+ // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
22
+ // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
23
+ // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
24
+ // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
25
+ // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
26
+ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
27
+
28
+ /* Modules */
29
+ "module": "nodenext", /* Specify what module code is generated. */
30
+ // "rootDir": "./", /* Specify the root folder within your source files. */
31
+ "moduleResolution": "nodenext", /* Specify how TypeScript looks up a file from a given module specifier. */
32
+ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
33
+ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
34
+ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
35
+ // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
36
+ // "types": [], /* Specify type package names to be included without being referenced in a source file. */
37
+ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
38
+ // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
39
+ // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
40
+ // "rewriteRelativeImportExtensions": true, /* Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files. */
41
+ // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
42
+ // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
43
+ // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
44
+ // "noUncheckedSideEffectImports": true, /* Check side effect imports. */
45
+ "resolveJsonModule": true, /* Enable importing .json files. */
46
+ // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
47
+ // "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
48
+
49
+ /* JavaScript Support */
50
+ // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
51
+ // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
52
+ // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
53
+
54
+ /* Emit */
55
+ "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
56
+ // "declarationMap": true, /* Create sourcemaps for d.ts files. */
57
+ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
58
+ // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
59
+ // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
60
+ // "noEmit": true, /* Disable emitting files from a compilation. */
61
+ // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
62
+ "outDir": "./dist", /* Specify an output folder for all emitted files. */
63
+ // "removeComments": true, /* Disable emitting comments. */
64
+ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
65
+ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
66
+ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
67
+ // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
68
+ // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
69
+ // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
70
+ // "newLine": "crlf", /* Set the newline character for emitting files. */
71
+ // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
72
+ // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
73
+ // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
74
+ // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
75
+ // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
76
+
77
+ /* Interop Constraints */
78
+ // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
79
+ // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
80
+ // "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */
81
+ // "erasableSyntaxOnly": true, /* Do not allow runtime constructs that are not part of ECMAScript. */
82
+ // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
83
+ "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
84
+ // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
85
+ "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
86
+
87
+ /* Type Checking */
88
+ "strict": true, /* Enable all strict type-checking options. */
89
+ // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
90
+ // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
91
+ // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
92
+ // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
93
+ // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
94
+ // "strictBuiltinIteratorReturn": true, /* Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'. */
95
+ // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
96
+ // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
97
+ // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
98
+ // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
99
+ // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
100
+ // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
101
+ // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
102
+ // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
103
+ // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
104
+ // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
105
+ // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
106
+ // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
107
+ // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
108
+
109
+ /* Completeness */
110
+ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
111
+ "skipLibCheck": true, /* Skip type checking all .d.ts files. */
112
+ "paths": {
113
+ "@/*": ["./src/*"]
114
+ }
115
+ },
116
+ "include": ["src/**/*.ts"],
117
+ "exclude": ["eslint.config.mts", "gql-codegen.mts", "check/**/*.ts"]
118
+ }