diff --git a/src/entrypoints/extensions.ts b/src/entrypoints/extensions.ts index 50e5beb9b..f25590107 100644 --- a/src/entrypoints/extensions.ts +++ b/src/entrypoints/extensions.ts @@ -1,5 +1,5 @@ -export { Introspection } from '../layers/7_extensions/Introspection/Introspection.js' -export { Opentelemetry } from '../layers/7_extensions/Opentelemetry/Opentelemetry.js' -export { SchemaErrors } from '../layers/7_extensions/SchemaErrors/SchemaErrors.js' -export { Throws } from '../layers/7_extensions/Throws/Throws.js' -export { Upload } from '../layers/7_extensions/Upload/Upload.js' +export { Introspection } from '../extensions/Introspection/Introspection.js' +export { Opentelemetry } from '../extensions/Opentelemetry/Opentelemetry.js' +export { SchemaErrors } from '../extensions/SchemaErrors/SchemaErrors.js' +export { Throws } from '../extensions/Throws/Throws.js' +export { Upload } from '../extensions/Upload/Upload.js' diff --git a/src/entrypoints/utilities-for-generated.ts b/src/entrypoints/utilities-for-generated.ts index 29666e71f..dc7c59c37 100644 --- a/src/entrypoints/utilities-for-generated.ts +++ b/src/entrypoints/utilities-for-generated.ts @@ -1,4 +1,5 @@ export { type Simplify } from 'type-fest' +export { type SchemaDrivenDataMap } from '../extensions/CustomScalars/schemaDrivenDataMap/types.js' export * from '../layers/2_Select/__.js' export { type SchemaIndex as SchemaIndexBase } from '../layers/4_generator/generators/SchemaIndex.js' export type { @@ -8,6 +9,5 @@ export type { } from '../layers/6_client/handleOutput.js' export { type DocumentRunner } from '../layers/6_client/requestMethods/document.js' export type { Config } from '../layers/6_client/Settings/Config.js' -export { type SchemaDrivenDataMap } from '../layers/7_extensions/CustomScalars/schemaDrivenDataMap/types.js' export { type Exact, type ExactNonEmpty, type UnionExpanded } from '../lib/prelude.js' export { TypeFunction } from '../lib/type-function/__.js' diff --git a/src/layers/7_extensions/CustomScalars/CustomScalars.ts b/src/extensions/CustomScalars/CustomScalars.ts similarity index 89% rename from src/layers/7_extensions/CustomScalars/CustomScalars.ts rename to src/extensions/CustomScalars/CustomScalars.ts index 69952851e..7f7f43e81 100644 --- a/src/layers/7_extensions/CustomScalars/CustomScalars.ts +++ b/src/extensions/CustomScalars/CustomScalars.ts @@ -1,5 +1,5 @@ -import { normalizeRequestToNode } from '../../../lib/grafaid/request.js' -import { createExtension } from '../../6_client/extension/extension.js' +import { createExtension } from '../../layers/6_client/extension/extension.js' +import { normalizeRequestToNode } from '../../lib/grafaid/request.js' import { decodeResultData } from './decode.js' import { encodeRequestVariables } from './encode.js' diff --git a/src/layers/7_extensions/CustomScalars/decode.test.ts b/src/extensions/CustomScalars/decode.test.ts similarity index 94% rename from src/layers/7_extensions/CustomScalars/decode.test.ts rename to src/extensions/CustomScalars/decode.test.ts index 23228eb86..0f8f0e17d 100644 --- a/src/layers/7_extensions/CustomScalars/decode.test.ts +++ b/src/extensions/CustomScalars/decode.test.ts @@ -1,10 +1,10 @@ import { describe, expect } from 'vitest' -import { createResponse, test } from '../../../../tests/_/helpers.js' -import { db } from '../../../../tests/_/schemas/db.js' -import type { Graffle } from '../../../../tests/_/schemas/kitchen-sink/graffle/__.js' -import { Grafaid } from '../../../lib/grafaid/__.js' -import { Select } from '../../2_Select/__.js' -import { SelectionSetGraphqlMapper } from '../../3_SelectGraphQLMapper/__.js' +import { createResponse, test } from '../../../tests/_/helpers.js' +import { db } from '../../../tests/_/schemas/db.js' +import type { Graffle } from '../../../tests/_/schemas/kitchen-sink/graffle/__.js' +import { Select } from '../../layers/2_Select/__.js' +import { SelectionSetGraphqlMapper } from '../../layers/3_SelectGraphQLMapper/__.js' +import { Grafaid } from '../../lib/grafaid/__.js' const date0Encoded = db.date0.toISOString() diff --git a/src/layers/7_extensions/CustomScalars/decode.ts b/src/extensions/CustomScalars/decode.ts similarity index 94% rename from src/layers/7_extensions/CustomScalars/decode.ts rename to src/extensions/CustomScalars/decode.ts index 3296ead5c..a3059e8ac 100644 --- a/src/layers/7_extensions/CustomScalars/decode.ts +++ b/src/extensions/CustomScalars/decode.ts @@ -1,6 +1,6 @@ import { Kind } from 'graphql' -import type { Grafaid } from '../../../lib/grafaid/__.js' -import { applyCodec } from '../../1_Schema/Hybrid/types/Scalar/Scalar.js' +import { applyCodec } from '../../layers/1_Schema/Hybrid/types/Scalar/Scalar.js' +import type { Grafaid } from '../../lib/grafaid/__.js' import { SchemaDrivenDataMap } from './schemaDrivenDataMap/types.js' /** diff --git a/src/layers/7_extensions/CustomScalars/encode.test.ts b/src/extensions/CustomScalars/encode.test.ts similarity index 84% rename from src/layers/7_extensions/CustomScalars/encode.test.ts rename to src/extensions/CustomScalars/encode.test.ts index 204391db1..6393c92e9 100644 --- a/src/layers/7_extensions/CustomScalars/encode.test.ts +++ b/src/extensions/CustomScalars/encode.test.ts @@ -1,12 +1,12 @@ import { expect } from 'vitest' -import { test } from '../../../../tests/_/helpers.js' -import { db } from '../../../../tests/_/schemas/db.js' -import type { Graffle } from '../../../../tests/_/schemas/kitchen-sink/graffle/__.js' -import { schemaDrivenDataMap } from '../../../../tests/_/schemas/kitchen-sink/graffle/modules/SchemaDrivenDataMap.js' -import { Spy } from '../../../../tests/_/SpyExtension.js' -import { Grafaid } from '../../../lib/grafaid/__.js' -import { Select } from '../../2_Select/__.js' -import { SelectionSetGraphqlMapper } from '../../3_SelectGraphQLMapper/__.js' +import { test } from '../../../tests/_/helpers.js' +import { db } from '../../../tests/_/schemas/db.js' +import type { Graffle } from '../../../tests/_/schemas/kitchen-sink/graffle/__.js' +import { schemaDrivenDataMap } from '../../../tests/_/schemas/kitchen-sink/graffle/modules/SchemaDrivenDataMap.js' +import { Spy } from '../../../tests/_/SpyExtension.js' +import { Select } from '../../layers/2_Select/__.js' +import { SelectionSetGraphqlMapper } from '../../layers/3_SelectGraphQLMapper/__.js' +import { Grafaid } from '../../lib/grafaid/__.js' const date0Encoded = db.date0.toISOString() const date1Encoded = db.date1.toISOString() diff --git a/src/layers/7_extensions/CustomScalars/encode.ts b/src/extensions/CustomScalars/encode.ts similarity index 94% rename from src/layers/7_extensions/CustomScalars/encode.ts rename to src/extensions/CustomScalars/encode.ts index 6d98be03a..9ca7b58ad 100644 --- a/src/layers/7_extensions/CustomScalars/encode.ts +++ b/src/extensions/CustomScalars/encode.ts @@ -1,5 +1,5 @@ -import { Grafaid } from '../../../lib/grafaid/__.js' -import { applyCodec } from '../../1_Schema/Hybrid/types/Scalar/Scalar.js' +import { applyCodec } from '../../layers/1_Schema/Hybrid/types/Scalar/Scalar.js' +import { Grafaid } from '../../lib/grafaid/__.js' import { SchemaDrivenDataMap } from './schemaDrivenDataMap/types.js' export const encodeRequestVariables = ({ sddm, request }: { diff --git a/src/layers/7_extensions/CustomScalars/schemaDrivenDataMap/generator.ts b/src/extensions/CustomScalars/schemaDrivenDataMap/generator.ts similarity index 95% rename from src/layers/7_extensions/CustomScalars/schemaDrivenDataMap/generator.ts rename to src/extensions/CustomScalars/schemaDrivenDataMap/generator.ts index 891246f85..6e1f8c227 100644 --- a/src/layers/7_extensions/CustomScalars/schemaDrivenDataMap/generator.ts +++ b/src/extensions/CustomScalars/schemaDrivenDataMap/generator.ts @@ -1,11 +1,11 @@ -import { Code } from '../../../../lib/Code.js' -import { Grafaid } from '../../../../lib/grafaid/__.js' -import { entries } from '../../../../lib/prelude.js' -import type { Config } from '../../../4_generator/config.js' -import { ModuleGeneratorScalar } from '../../../4_generator/generators/Scalar.js' -import { createModuleGenerator } from '../../../4_generator/helpers/moduleGenerator.js' -import { createCodeGenerator } from '../../../4_generator/helpers/moduleGeneratorRunner.js' -import { title1 } from '../../../4_generator/helpers/render.js' +import type { Config } from '../../../layers/4_generator/config.js' +import { ModuleGeneratorScalar } from '../../../layers/4_generator/generators/Scalar.js' +import { createModuleGenerator } from '../../../layers/4_generator/helpers/moduleGenerator.js' +import { createCodeGenerator } from '../../../layers/4_generator/helpers/moduleGeneratorRunner.js' +import { title1 } from '../../../layers/4_generator/helpers/render.js' +import { Code } from '../../../lib/Code.js' +import { Grafaid } from '../../../lib/grafaid/__.js' +import { entries } from '../../../lib/prelude.js' import { propertyNames, SchemaDrivenDataMap } from './types.js' const identifiers = { diff --git a/src/layers/7_extensions/CustomScalars/schemaDrivenDataMap/types.ts b/src/extensions/CustomScalars/schemaDrivenDataMap/types.ts similarity index 97% rename from src/layers/7_extensions/CustomScalars/schemaDrivenDataMap/types.ts rename to src/extensions/CustomScalars/schemaDrivenDataMap/types.ts index ddef6411b..101593952 100644 --- a/src/layers/7_extensions/CustomScalars/schemaDrivenDataMap/types.ts +++ b/src/extensions/CustomScalars/schemaDrivenDataMap/types.ts @@ -1,5 +1,5 @@ -import type { Grafaid } from '../../../../lib/grafaid/__.js' -import { Scalar, type Scalar as SchemaScalar } from '../../../1_Schema/_.js' +import { Scalar, type Scalar as SchemaScalar } from '../../../layers/1_Schema/_.js' +import type { Grafaid } from '../../../lib/grafaid/__.js' export const propertyNames = { k: `k`, diff --git a/src/layers/7_extensions/Introspection/Introspection.ts b/src/extensions/Introspection/Introspection.ts similarity index 86% rename from src/layers/7_extensions/Introspection/Introspection.ts rename to src/extensions/Introspection/Introspection.ts index 4d9233da4..669c7f194 100644 --- a/src/layers/7_extensions/Introspection/Introspection.ts +++ b/src/extensions/Introspection/Introspection.ts @@ -1,9 +1,9 @@ import { getIntrospectionQuery, type IntrospectionQuery } from 'graphql' -import type { Extension, SimplifyNullable } from '../../../entrypoints/main.js' -import type { Fluent } from '../../../lib/fluent/__.js' -import { createExtension } from '../../6_client/extension/extension.js' -import type { FnParametersProperty } from '../../6_client/fluent.js' -import type { HandleOutput } from '../../6_client/handleOutput.js' +import type { Extension, SimplifyNullable } from '../../entrypoints/main.js' +import { createExtension } from '../../layers/6_client/extension/extension.js' +import type { FnParametersProperty } from '../../layers/6_client/fluent.js' +import type { HandleOutput } from '../../layers/6_client/handleOutput.js' +import type { Fluent } from '../../lib/fluent/__.js' import { createConfig, type Input } from './config.js' /** diff --git a/src/layers/7_extensions/Introspection/config.ts b/src/extensions/Introspection/config.ts similarity index 100% rename from src/layers/7_extensions/Introspection/config.ts rename to src/extensions/Introspection/config.ts diff --git a/src/layers/7_extensions/Introspection/documentation.md b/src/extensions/Introspection/documentation.md similarity index 100% rename from src/layers/7_extensions/Introspection/documentation.md rename to src/extensions/Introspection/documentation.md diff --git a/src/layers/7_extensions/Opentelemetry/Opentelemetry.ts b/src/extensions/Opentelemetry/Opentelemetry.ts similarity index 93% rename from src/layers/7_extensions/Opentelemetry/Opentelemetry.ts rename to src/extensions/Opentelemetry/Opentelemetry.ts index 30cc5a7e2..74197557b 100644 --- a/src/layers/7_extensions/Opentelemetry/Opentelemetry.ts +++ b/src/extensions/Opentelemetry/Opentelemetry.ts @@ -1,5 +1,5 @@ import { trace, type Tracer } from '@opentelemetry/api' -import { createExtension } from '../../6_client/extension/extension.js' +import { createExtension } from '../../layers/6_client/extension/extension.js' import { createConfig, type Input } from './config.js' export const Opentelemetry = (input?: Input) => { diff --git a/src/layers/7_extensions/Opentelemetry/config.ts b/src/extensions/Opentelemetry/config.ts similarity index 100% rename from src/layers/7_extensions/Opentelemetry/config.ts rename to src/extensions/Opentelemetry/config.ts diff --git a/src/layers/7_extensions/Opentelemetry/documentation.md b/src/extensions/Opentelemetry/documentation.md similarity index 100% rename from src/layers/7_extensions/Opentelemetry/documentation.md rename to src/extensions/Opentelemetry/documentation.md diff --git a/src/layers/7_extensions/SchemaErrors/SchemaError.test-d.ts b/src/extensions/SchemaErrors/SchemaError.test-d.ts similarity index 89% rename from src/layers/7_extensions/SchemaErrors/SchemaError.test-d.ts rename to src/extensions/SchemaErrors/SchemaError.test-d.ts index 64d008f6e..a6f666408 100644 --- a/src/layers/7_extensions/SchemaErrors/SchemaError.test-d.ts +++ b/src/extensions/SchemaErrors/SchemaError.test-d.ts @@ -1,7 +1,7 @@ import { describe, expectTypeOf, test } from 'vitest' -import { Graffle } from '../../../../tests/_/schemas/kitchen-sink/graffle/__.js' -import { schema } from '../../../../tests/_/schemas/kitchen-sink/schema.js' -import { type Extension } from '../../6_client/extension/extension.js' +import { Graffle } from '../../../tests/_/schemas/kitchen-sink/graffle/__.js' +import { schema } from '../../../tests/_/schemas/kitchen-sink/schema.js' +import { type Extension } from '../../layers/6_client/extension/extension.js' import { SchemaErrors } from './SchemaErrors.js' const g = Graffle.create({ schema }).use(SchemaErrors()) diff --git a/src/layers/7_extensions/SchemaErrors/SchemaErrors.test.ts b/src/extensions/SchemaErrors/SchemaErrors.test.ts similarity index 88% rename from src/layers/7_extensions/SchemaErrors/SchemaErrors.test.ts rename to src/extensions/SchemaErrors/SchemaErrors.test.ts index f4a49c8a7..76a880b0f 100644 --- a/src/layers/7_extensions/SchemaErrors/SchemaErrors.test.ts +++ b/src/extensions/SchemaErrors/SchemaErrors.test.ts @@ -1,16 +1,16 @@ import { parse } from 'graphql' import { describe, expect } from 'vitest' -import { test } from '../../../../tests/_/helpers.js' -import { db } from '../../../../tests/_/schemas/db.js' -import { Graffle } from '../../../../tests/_/schemas/kitchen-sink/graffle/__.js' -import { schemaDrivenDataMap } from '../../../../tests/_/schemas/kitchen-sink/graffle/modules/SchemaDrivenDataMap.js' -import type { Query } from '../../../../tests/_/schemas/kitchen-sink/graffle/modules/SelectionSets.js' -import { schema } from '../../../../tests/_/schemas/kitchen-sink/schema.js' -import type { Errors } from '../../../lib/errors/__.js' -import { Select } from '../../2_Select/__.js' -import { SelectionSetGraphqlMapper } from '../../3_SelectGraphQLMapper/__.js' -import { graffleMappedToRequest } from '../../5_request/core.js' -import { injectTypenameOnRootResultFields } from '../../5_request/schemaErrors.js' +import { test } from '../../../tests/_/helpers.js' +import { db } from '../../../tests/_/schemas/db.js' +import { Graffle } from '../../../tests/_/schemas/kitchen-sink/graffle/__.js' +import { schemaDrivenDataMap } from '../../../tests/_/schemas/kitchen-sink/graffle/modules/SchemaDrivenDataMap.js' +import type { Query } from '../../../tests/_/schemas/kitchen-sink/graffle/modules/SelectionSets.js' +import { schema } from '../../../tests/_/schemas/kitchen-sink/schema.js' +import { Select } from '../../layers/2_Select/__.js' +import { SelectionSetGraphqlMapper } from '../../layers/3_SelectGraphQLMapper/__.js' +import { graffleMappedToRequest } from '../../layers/5_request/core.js' +import { injectTypenameOnRootResultFields } from '../../layers/5_request/schemaErrors.js' +import type { Errors } from '../../lib/errors/__.js' import { SchemaErrors } from './SchemaErrors.js' const graffle = Graffle diff --git a/src/layers/7_extensions/SchemaErrors/SchemaErrors.ts b/src/extensions/SchemaErrors/SchemaErrors.ts similarity index 89% rename from src/layers/7_extensions/SchemaErrors/SchemaErrors.ts rename to src/extensions/SchemaErrors/SchemaErrors.ts index 7b0296bf3..bd533a87d 100644 --- a/src/layers/7_extensions/SchemaErrors/SchemaErrors.ts +++ b/src/extensions/SchemaErrors/SchemaErrors.ts @@ -1,9 +1,9 @@ -import { Errors } from '../../../lib/errors/__.js' -import { normalizeRequestToNode } from '../../../lib/grafaid/request.js' -import { type ExcludeNullAndUndefined, isString } from '../../../lib/prelude.js' -import { isRecordLikeObject } from '../../../lib/prelude.js' -import { injectTypenameOnRootResultFields } from '../../5_request/schemaErrors.js' -import { createExtension, type Extension } from '../../6_client/extension/extension.js' +import { injectTypenameOnRootResultFields } from '../../layers/5_request/schemaErrors.js' +import { createExtension, type Extension } from '../../layers/6_client/extension/extension.js' +import { Errors } from '../../lib/errors/__.js' +import { normalizeRequestToNode } from '../../lib/grafaid/request.js' +import { type ExcludeNullAndUndefined, isString } from '../../lib/prelude.js' +import { isRecordLikeObject } from '../../lib/prelude.js' import { SchemaDrivenDataMap } from '../CustomScalars/schemaDrivenDataMap/types.js' export const SchemaErrors = () => { diff --git a/src/layers/7_extensions/SchemaErrors/documentation.md b/src/extensions/SchemaErrors/documentation.md similarity index 100% rename from src/layers/7_extensions/SchemaErrors/documentation.md rename to src/extensions/SchemaErrors/documentation.md diff --git a/src/layers/7_extensions/Throws/Throws.test-d.ts b/src/extensions/Throws/Throws.test-d.ts similarity index 100% rename from src/layers/7_extensions/Throws/Throws.test-d.ts rename to src/extensions/Throws/Throws.test-d.ts diff --git a/src/layers/7_extensions/Throws/Throws.test.ts b/src/extensions/Throws/Throws.test.ts similarity index 75% rename from src/layers/7_extensions/Throws/Throws.test.ts rename to src/extensions/Throws/Throws.test.ts index b43c81d4b..272e19591 100644 --- a/src/layers/7_extensions/Throws/Throws.test.ts +++ b/src/extensions/Throws/Throws.test.ts @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { db } from '../../../../tests/_/schemas/db.js' -import { Graffle } from '../../../../tests/_/schemas/kitchen-sink/graffle/__.js' -import { schema } from '../../../../tests/_/schemas/kitchen-sink/schema.js' +import { db } from '../../../tests/_/schemas/db.js' +import { Graffle } from '../../../tests/_/schemas/kitchen-sink/graffle/__.js' +import { schema } from '../../../tests/_/schemas/kitchen-sink/schema.js' import { Throws } from './Throws.js' const graffle = Graffle.create({ schema }).use(Throws()).throws() diff --git a/src/layers/7_extensions/Throws/Throws.ts b/src/extensions/Throws/Throws.ts similarity index 82% rename from src/layers/7_extensions/Throws/Throws.ts rename to src/extensions/Throws/Throws.ts index 873f40875..0543510a9 100644 --- a/src/layers/7_extensions/Throws/Throws.ts +++ b/src/extensions/Throws/Throws.ts @@ -1,9 +1,9 @@ -import { type BuilderConfig, createExtension, type Extension, type WithInput } from '../../../entrypoints/main.js' -import type { ConfigManager } from '../../../lib/config-manager/__.js' +import { type BuilderConfig, createExtension, type Extension, type WithInput } from '../../entrypoints/main.js' +import type { ConfigManager } from '../../lib/config-manager/__.js' // todo: no deep imports, rethink these utilities and/or how they are exported from the graffle package. -import type { Fluent } from '../../../lib/fluent/__.js' -import type { IncrementWthNewConfig } from '../../6_client/client.js' -import type { FnParametersProperty } from '../../6_client/fluent.js' +import type { IncrementWthNewConfig } from '../../layers/6_client/client.js' +import type { FnParametersProperty } from '../../layers/6_client/fluent.js' +import type { Fluent } from '../../lib/fluent/__.js' export const Throws = () => { return createExtension({ diff --git a/src/layers/7_extensions/Throws/documentation.md b/src/extensions/Throws/documentation.md similarity index 100% rename from src/layers/7_extensions/Throws/documentation.md rename to src/extensions/Throws/documentation.md diff --git a/src/layers/7_extensions/Upload/Upload.test.ts b/src/extensions/Upload/Upload.test.ts similarity index 81% rename from src/layers/7_extensions/Upload/Upload.test.ts rename to src/extensions/Upload/Upload.test.ts index c523a1314..315d2401b 100644 --- a/src/layers/7_extensions/Upload/Upload.test.ts +++ b/src/extensions/Upload/Upload.test.ts @@ -2,13 +2,13 @@ // @vitest-environment node import { afterAll, beforeAll, beforeEach, expect, test } from 'vitest' -import { schema } from '../../../../tests/_/schemas/upload/schema.js' -import { Graffle } from '../../../entrypoints/main.js' +import { schema } from '../../../tests/_/schemas/upload/schema.js' +import { Graffle } from '../../entrypoints/main.js' import { Upload } from './Upload.js' -import { type SchemaService, serveSchema } from '../../../../tests/_/lib/serveSchema.js' -import type { Client } from '../../6_client/client.js' -import type { OutputConfigDefault, TransportConfigHttp } from '../../6_client/Settings/Config.js' +import { type SchemaService, serveSchema } from '../../../tests/_/lib/serveSchema.js' +import type { Client } from '../../layers/6_client/client.js' +import type { OutputConfigDefault, TransportConfigHttp } from '../../layers/6_client/Settings/Config.js' let schemaServer: SchemaService diff --git a/src/layers/7_extensions/Upload/Upload.ts b/src/extensions/Upload/Upload.ts similarity index 93% rename from src/layers/7_extensions/Upload/Upload.ts rename to src/extensions/Upload/Upload.ts index b13020eb4..98d17dd63 100644 --- a/src/layers/7_extensions/Upload/Upload.ts +++ b/src/extensions/Upload/Upload.ts @@ -1,5 +1,5 @@ -import { createExtension } from '../../../entrypoints/main.js' -import type { Variables } from '../../../lib/grafaid/graphql.js' +import { createExtension } from '../../entrypoints/main.js' +import type { Variables } from '../../lib/grafaid/graphql.js' import { createBody } from './createBody.js' /** diff --git a/src/layers/7_extensions/Upload/createBody.ts b/src/extensions/Upload/createBody.ts similarity index 91% rename from src/layers/7_extensions/Upload/createBody.ts rename to src/extensions/Upload/createBody.ts index b46e5c588..d4a068eea 100644 --- a/src/layers/7_extensions/Upload/createBody.ts +++ b/src/extensions/Upload/createBody.ts @@ -1,4 +1,4 @@ -import type { RequestConfig } from '../../../lib/grafaid/http/http.js' +import type { RequestConfig } from '../../lib/grafaid/http/http.js' import extractFiles from './extractFiles.js' export const createBody = (input: RequestConfig): FormData => { diff --git a/src/layers/7_extensions/Upload/documentation.md b/src/extensions/Upload/documentation.md similarity index 100% rename from src/layers/7_extensions/Upload/documentation.md rename to src/extensions/Upload/documentation.md diff --git a/src/layers/7_extensions/Upload/extractFiles.ts b/src/extensions/Upload/extractFiles.ts similarity index 100% rename from src/layers/7_extensions/Upload/extractFiles.ts rename to src/extensions/Upload/extractFiles.ts diff --git a/src/layers/3_SelectGraphQLMapper/context.ts b/src/layers/3_SelectGraphQLMapper/context.ts index 61e9bed05..febad516a 100644 --- a/src/layers/3_SelectGraphQLMapper/context.ts +++ b/src/layers/3_SelectGraphQLMapper/context.ts @@ -1,6 +1,6 @@ +import type { SchemaDrivenDataMap } from '../../extensions/CustomScalars/schemaDrivenDataMap/types.js' import type { Grafaid } from '../../lib/grafaid/__.js' import { Nodes } from '../../lib/grafaid/_Nodes.js' -import type { SchemaDrivenDataMap } from '../7_extensions/CustomScalars/schemaDrivenDataMap/types.js' import { inferVariableType } from './inferVariableType.js' import type { Options } from './nodes/1_Document.js' diff --git a/src/layers/3_SelectGraphQLMapper/inferVariableType.ts b/src/layers/3_SelectGraphQLMapper/inferVariableType.ts index 4b097e34c..563ed10af 100644 --- a/src/layers/3_SelectGraphQLMapper/inferVariableType.ts +++ b/src/layers/3_SelectGraphQLMapper/inferVariableType.ts @@ -1,5 +1,5 @@ -import { isScalar } from '../1_Schema/Hybrid/types/Scalar/Scalar.js' -import type { SchemaDrivenDataMap } from '../7_extensions/CustomScalars/schemaDrivenDataMap/types.js' +import type { SchemaDrivenDataMap } from '../../extensions/CustomScalars/schemaDrivenDataMap/types.js' +import { isScalar } from '../../layers/1_Schema/Hybrid/types/Scalar/Scalar.js' /** * Infer the type of a variable for the given argument. diff --git a/src/layers/3_SelectGraphQLMapper/mapper.ts b/src/layers/3_SelectGraphQLMapper/mapper.ts index 37987a2a7..b5799926a 100644 --- a/src/layers/3_SelectGraphQLMapper/mapper.ts +++ b/src/layers/3_SelectGraphQLMapper/mapper.ts @@ -1,4 +1,4 @@ -import type { SchemaDrivenDataMap } from '../7_extensions/CustomScalars/schemaDrivenDataMap/types.js' +import type { SchemaDrivenDataMap } from '../../extensions/CustomScalars/schemaDrivenDataMap/types.js' import type { OperationContext } from './context.js' export type GraphQLPreOperationMapper< diff --git a/src/layers/3_SelectGraphQLMapper/nodes/2_OperationDefinition.ts b/src/layers/3_SelectGraphQLMapper/nodes/2_OperationDefinition.ts index 21e9c4a90..60701b036 100644 --- a/src/layers/3_SelectGraphQLMapper/nodes/2_OperationDefinition.ts +++ b/src/layers/3_SelectGraphQLMapper/nodes/2_OperationDefinition.ts @@ -1,7 +1,7 @@ +import type { SchemaDrivenDataMap } from '../../../extensions/CustomScalars/schemaDrivenDataMap/types.js' import type { Grafaid } from '../../../lib/grafaid/__.js' import { Nodes } from '../../../lib/grafaid/_Nodes.js' import type { Select } from '../../2_Select/__.js' -import type { SchemaDrivenDataMap } from '../../7_extensions/CustomScalars/schemaDrivenDataMap/types.js' import { createOperationContext } from '../context.js' import { type GraphQLPreOperationMapper } from '../mapper.js' import type { Options } from './1_Document.js' diff --git a/src/layers/3_SelectGraphQLMapper/nodes/3_GraffleSelectionSetRoot.ts b/src/layers/3_SelectGraphQLMapper/nodes/3_GraffleSelectionSetRoot.ts index 4d23d8510..f033b7ece 100644 --- a/src/layers/3_SelectGraphQLMapper/nodes/3_GraffleSelectionSetRoot.ts +++ b/src/layers/3_SelectGraphQLMapper/nodes/3_GraffleSelectionSetRoot.ts @@ -1,6 +1,6 @@ +import type { SchemaDrivenDataMap } from '../../../extensions/CustomScalars/schemaDrivenDataMap/types.js' import { Nodes } from '../../../lib/grafaid/_Nodes.js' import { Select } from '../../2_Select/__.js' -import type { SchemaDrivenDataMap } from '../../7_extensions/CustomScalars/schemaDrivenDataMap/types.js' import { type GraphQLPostOperationMapper } from '../mapper.js' import { fromGraffleSelectionObjectLevel } from './4_GraffleSelectionObjectLevel.js' diff --git a/src/layers/3_SelectGraphQLMapper/nodes/4_GraffleSelectionObjectLevel.ts b/src/layers/3_SelectGraphQLMapper/nodes/4_GraffleSelectionObjectLevel.ts index 90d80c143..07cbe0c10 100644 --- a/src/layers/3_SelectGraphQLMapper/nodes/4_GraffleSelectionObjectLevel.ts +++ b/src/layers/3_SelectGraphQLMapper/nodes/4_GraffleSelectionObjectLevel.ts @@ -1,8 +1,8 @@ +import type { SchemaDrivenDataMap } from '../../../extensions/CustomScalars/schemaDrivenDataMap/types.js' import type { Grafaid } from '../../../lib/grafaid/__.js' import { Nodes } from '../../../lib/grafaid/_Nodes.js' import { casesExhausted, isNonNull } from '../../../lib/prelude.js' import type { ParsedSelectionObjectLevel } from '../../2_Select/_.js' -import type { SchemaDrivenDataMap } from '../../7_extensions/CustomScalars/schemaDrivenDataMap/types.js' import type { GraphQLPostOperationMapper } from '../mapper.js' import { toGraphQLField } from './5_Field.js' import { toGraphQLInlineFragments } from './5_InlineFragments.js' diff --git a/src/layers/3_SelectGraphQLMapper/nodes/5_Field.ts b/src/layers/3_SelectGraphQLMapper/nodes/5_Field.ts index ece3afbf4..b3961c6c2 100644 --- a/src/layers/3_SelectGraphQLMapper/nodes/5_Field.ts +++ b/src/layers/3_SelectGraphQLMapper/nodes/5_Field.ts @@ -1,6 +1,6 @@ +import { SchemaDrivenDataMap } from '../../../extensions/CustomScalars/schemaDrivenDataMap/types.js' import { Nodes } from '../../../lib/grafaid/_Nodes.js' import { Select } from '../../2_Select/__.js' -import { SchemaDrivenDataMap } from '../../7_extensions/CustomScalars/schemaDrivenDataMap/types.js' import type { GraphQLPostOperationMapper } from '../mapper.js' import { collectForInlineFragmentLike } from './_collect.js' import { toGraphQLArgument } from './Argument.js' diff --git a/src/layers/3_SelectGraphQLMapper/nodes/5_InlineFragments.ts b/src/layers/3_SelectGraphQLMapper/nodes/5_InlineFragments.ts index e3879c43c..610e67b9c 100644 --- a/src/layers/3_SelectGraphQLMapper/nodes/5_InlineFragments.ts +++ b/src/layers/3_SelectGraphQLMapper/nodes/5_InlineFragments.ts @@ -1,7 +1,7 @@ +import type { SchemaDrivenDataMap } from '../../../entrypoints/utilities-for-generated.js' import type { Grafaid } from '../../../lib/grafaid/__.js' import { Nodes } from '../../../lib/grafaid/_Nodes.js' import { Select } from '../../2_Select/__.js' -import type { SchemaDrivenDataMap } from '../../7_extensions/CustomScalars/schemaDrivenDataMap/types.js' import type { GraphQLPostOperationMapper } from '../mapper.js' import { collectForInlineFragmentLike } from './_collect.js' diff --git a/src/layers/3_SelectGraphQLMapper/nodes/Argument.ts b/src/layers/3_SelectGraphQLMapper/nodes/Argument.ts index 64779e9ec..32b82edb8 100644 --- a/src/layers/3_SelectGraphQLMapper/nodes/Argument.ts +++ b/src/layers/3_SelectGraphQLMapper/nodes/Argument.ts @@ -1,6 +1,6 @@ +import type { SchemaDrivenDataMap } from '../../../extensions/CustomScalars/schemaDrivenDataMap/types.js' import { Nodes } from '../../../lib/grafaid/_Nodes.js' import { Select } from '../../2_Select/__.js' -import type { SchemaDrivenDataMap } from '../../7_extensions/CustomScalars/schemaDrivenDataMap/types.js' import { type GraphQLPostOperationMapper } from '../mapper.js' import { toGraphQLValue } from './Value.js' diff --git a/src/layers/3_SelectGraphQLMapper/nodes/Value.ts b/src/layers/3_SelectGraphQLMapper/nodes/Value.ts index 79b045ed6..02b15fc66 100644 --- a/src/layers/3_SelectGraphQLMapper/nodes/Value.ts +++ b/src/layers/3_SelectGraphQLMapper/nodes/Value.ts @@ -1,7 +1,7 @@ +import { SchemaDrivenDataMap } from '../../../extensions/CustomScalars/schemaDrivenDataMap/types.js' import type { Grafaid } from '../../../lib/grafaid/__.js' import { Nodes } from '../../../lib/grafaid/_Nodes.js' import type { Scalar } from '../../1_Schema/_.js' -import { SchemaDrivenDataMap } from '../../7_extensions/CustomScalars/schemaDrivenDataMap/types.js' import type { OperationContext } from '../context.js' import { type GraphQLPostOperationMapper } from '../mapper.js' diff --git a/src/layers/3_SelectGraphQLMapper/nodes/_collect.ts b/src/layers/3_SelectGraphQLMapper/nodes/_collect.ts index 81afa78d9..f78975027 100644 --- a/src/layers/3_SelectGraphQLMapper/nodes/_collect.ts +++ b/src/layers/3_SelectGraphQLMapper/nodes/_collect.ts @@ -1,6 +1,6 @@ +import type { SchemaDrivenDataMap } from '../../../extensions/CustomScalars/schemaDrivenDataMap/types.js' import type { Grafaid } from '../../../lib/grafaid/__.js' import type { Select } from '../../2_Select/__.js' -import type { SchemaDrivenDataMap } from '../../7_extensions/CustomScalars/schemaDrivenDataMap/types.js' import type { GraphQLPostOperationMapper } from '../mapper.js' import { fromGraffleSelectionObjectLevel } from './4_GraffleSelectionObjectLevel.js' import { toGraphQLDirective } from './Directive.js' diff --git a/src/layers/4_generator/generate.ts b/src/layers/4_generator/generate.ts index 676e2c56f..0d0f791fe 100644 --- a/src/layers/4_generator/generate.ts +++ b/src/layers/4_generator/generate.ts @@ -1,5 +1,5 @@ import fs from 'node:fs/promises' -import { ModuleGeneratorSchemaDrivenDataMap } from '../7_extensions/CustomScalars/schemaDrivenDataMap/generator.js' +import { ModuleGeneratorSchemaDrivenDataMap } from '../../extensions/CustomScalars/schemaDrivenDataMap/generator.js' import { type Config, createConfig, type Input } from './config.js' import { ModuleGenerator_ } from './generators/_.js' import { ModuleGenerator__ } from './generators/__.js' diff --git a/src/layers/4_generator/generators/Client.ts b/src/layers/4_generator/generators/Client.ts index 3f35ae55e..caab5203c 100644 --- a/src/layers/4_generator/generators/Client.ts +++ b/src/layers/4_generator/generators/Client.ts @@ -1,4 +1,4 @@ -import { ModuleGeneratorSchemaDrivenDataMap } from '../../7_extensions/CustomScalars/schemaDrivenDataMap/generator.js' +import { ModuleGeneratorSchemaDrivenDataMap } from '../../../extensions/CustomScalars/schemaDrivenDataMap/generator.js' import { createModuleGenerator } from '../helpers/moduleGenerator.js' import { ModuleGeneratorData } from './Data.js' diff --git a/src/layers/4_generator/generators/SchemaIndex.ts b/src/layers/4_generator/generators/SchemaIndex.ts index 5431e4ff0..1aa194c4a 100644 --- a/src/layers/4_generator/generators/SchemaIndex.ts +++ b/src/layers/4_generator/generators/SchemaIndex.ts @@ -1,8 +1,8 @@ import { getNamedType, isUnionType } from 'graphql' +import type { SchemaDrivenDataMap } from '../../../extensions/CustomScalars/schemaDrivenDataMap/types.js' import { Code } from '../../../lib/Code.js' import { Grafaid } from '../../../lib/grafaid/__.js' import type { Schema } from '../../1_Schema/__.js' -import type { SchemaDrivenDataMap } from '../../7_extensions/CustomScalars/schemaDrivenDataMap/types.js' import type { GlobalRegistry } from '../globalRegistry.js' import { createModuleGenerator } from '../helpers/moduleGenerator.js' import { ModuleGeneratorData } from './Data.js' diff --git a/src/layers/5_request/schemaErrors.ts b/src/layers/5_request/schemaErrors.ts index 132534799..ec1349b44 100644 --- a/src/layers/5_request/schemaErrors.ts +++ b/src/layers/5_request/schemaErrors.ts @@ -1,6 +1,6 @@ +import type { SchemaDrivenDataMap } from '../../extensions/CustomScalars/schemaDrivenDataMap/types.js' import type { Grafaid } from '../../lib/grafaid/__.js' import { Nodes } from '../../lib/grafaid/graphql.js' -import type { SchemaDrivenDataMap } from '../7_extensions/CustomScalars/schemaDrivenDataMap/types.js' export const injectTypenameOnRootResultFields = ( { request, sddm }: { diff --git a/src/layers/6_client/Settings/Config.ts b/src/layers/6_client/Settings/Config.ts index 9415c9456..3bbe1c42b 100644 --- a/src/layers/6_client/Settings/Config.ts +++ b/src/layers/6_client/Settings/Config.ts @@ -1,8 +1,8 @@ import type { GraphQLSchema } from 'graphql' +import type { SchemaDrivenDataMap } from '../../../extensions/CustomScalars/schemaDrivenDataMap/types.js' import type { RequireProperties } from '../../../lib/prelude.js' import type { GlobalRegistry } from '../../4_generator/globalRegistry.js' import type { TransportHttp, TransportMemory } from '../../5_request/types.js' -import type { SchemaDrivenDataMap } from '../../7_extensions/CustomScalars/schemaDrivenDataMap/types.js' import type { Extension } from '../extension/extension.js' import type { TransportHttpInput } from '../transportHttp/request.js' import type { InputStatic } from './Input.js' diff --git a/src/layers/6_client/Settings/Input.ts b/src/layers/6_client/Settings/Input.ts index 73055289f..be28caba3 100644 --- a/src/layers/6_client/Settings/Input.ts +++ b/src/layers/6_client/Settings/Input.ts @@ -1,6 +1,6 @@ import type { GraphQLSchema } from 'graphql' +import type { SchemaDrivenDataMap } from '../../../extensions/CustomScalars/schemaDrivenDataMap/types.js' import type { GlobalRegistry } from '../../4_generator/globalRegistry.js' -import type { SchemaDrivenDataMap } from '../../7_extensions/CustomScalars/schemaDrivenDataMap/types.js' import type { WithInput } from './inputIncrementable/inputIncrementable.js' export type URLInput = URL | string diff --git a/src/layers/6_client/client.test.ts b/src/layers/6_client/client.test.ts index f9bb0b975..ff72ee9f3 100644 --- a/src/layers/6_client/client.test.ts +++ b/src/layers/6_client/client.test.ts @@ -3,7 +3,7 @@ import { createResponse, test } from '../../../tests/_/helpers.js' import { Graffle as Graffle2 } from '../../../tests/_/schemas/kitchen-sink/graffle/__.js' import { schema } from '../../../tests/_/schemas/kitchen-sink/schema.js' import { Graffle } from '../../entrypoints/main.js' -import { Throws } from '../7_extensions/Throws/Throws.js' +import { Throws } from '../../extensions/Throws/Throws.js' const endpoint = new URL(`https://foo.io/api/graphql`) diff --git a/src/layers/6_client/client.ts b/src/layers/6_client/client.ts index eb04320ce..3c87ce827 100644 --- a/src/layers/6_client/client.ts +++ b/src/layers/6_client/client.ts @@ -1,6 +1,6 @@ +import { CustomScalars } from '../../extensions/CustomScalars/CustomScalars.js' import type { Fluent } from '../../lib/fluent/__.js' import { proxyGet } from '../../lib/prelude.js' -import { CustomScalars } from '../7_extensions/CustomScalars/CustomScalars.js' import { type UseFn, useProperties } from './extension/use.js' import { type ClientContext, createState, type FnParametersProperty, type StateWithoutConfig } from './fluent.js' import { type FnGql, gqlProperties } from './gql/gql.js' diff --git a/src/layers/6_client/extension/use.test.ts b/src/layers/6_client/extension/use.test.ts index e86872d78..e5ed2f0e5 100644 --- a/src/layers/6_client/extension/use.test.ts +++ b/src/layers/6_client/extension/use.test.ts @@ -3,8 +3,8 @@ import { describe, expect } from 'vitest' import { createResponse, test } from '../../../../tests/_/helpers.js' import { db } from '../../../../tests/_/schemas/db.js' import { Graffle } from '../../../../tests/_/schemas/kitchen-sink/graffle/__.js' +import { Throws } from '../../../extensions/Throws/Throws.js' import { oops } from '../../../lib/anyware/specHelpers.js' -import { Throws } from '../../7_extensions/Throws/Throws.js' const client = Graffle.create({ schema: 'https://foo', output: { defaults: { errorChannel: 'return' } } }) const headers = { 'x-foo': 'bar' } diff --git a/src/layers/6_client/prefilled.ts b/src/layers/6_client/prefilled.ts index d553dabc7..0cf3c8f10 100644 --- a/src/layers/6_client/prefilled.ts +++ b/src/layers/6_client/prefilled.ts @@ -1,7 +1,7 @@ import type { HasRequiredKeys } from 'type-fest' +import type { SchemaDrivenDataMap } from '../../extensions/CustomScalars/schemaDrivenDataMap/types.js' import type { Exact } from '../../lib/prelude.js' import type { GlobalRegistry } from '../4_generator/globalRegistry.js' -import type { SchemaDrivenDataMap } from '../7_extensions/CustomScalars/schemaDrivenDataMap/types.js' import { type Client, create } from './client.js' import type { InputBase } from './Settings/Input.js' import type { NormalizeInput } from './Settings/InputToConfig.js' diff --git a/src/layers/6_client/requestMethods/client.rootMethods.test-d.ts b/src/layers/6_client/requestMethods/client.rootMethods.test-d.ts index 323a2433b..5f7fe3fd0 100644 --- a/src/layers/6_client/requestMethods/client.rootMethods.test-d.ts +++ b/src/layers/6_client/requestMethods/client.rootMethods.test-d.ts @@ -8,8 +8,6 @@ const graffle = Graffle.create({ schema: Schema.schema }) const x = await graffle.query.id({ $include: false }) // dprint-ignore test(`query`, async () => { - const x = await graffle.query.idNonNull() - type _x = typeof x // scalar expectTypeOf(await graffle.query.id()).toEqualTypeOf() // scalar none-nullable diff --git a/src/layers/7_extensions/SchemaErrors/Error.ts b/src/layers/7_extensions/SchemaErrors/Error.ts deleted file mode 100644 index 14e3b09f9..000000000 --- a/src/layers/7_extensions/SchemaErrors/Error.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { createModuleGenerator } from '../../4_generator/helpers/moduleGenerator.js' - -export const ModuleGeneratorError = createModuleGenerator( - `Error`, - ({ config, code }) => { - code( - `type Include = Exclude>`, - `type ObjectWithTypeName = { __typename: string }`, - ) - - code(` - const ErrorObjectsTypeNameSelectedEnum = { - ${config.schema.error.objects.map(_ => `${_.name}: { __typename: '${_.name}' }`).join(`,\n`)} - } as ${config.schema.error.objects.length > 0 ? `const` : `Record`} - - const ErrorObjectsTypeNameSelected = Object.values(ErrorObjectsTypeNameSelectedEnum) - - type ErrorObjectsTypeNameSelected = (typeof ErrorObjectsTypeNameSelected)[number] - `) - - code( - `export const isError = <$Value>(value:$Value): value is Include<$Value, ErrorObjectsTypeNameSelected> => { - return typeof value === \`object\` && value !== null && \`__typename\` in value && - ErrorObjectsTypeNameSelected.some(_ => _.__typename === value.__typename) - }`, - ) - - return code - }, -) diff --git a/website/content/guides/60_extensions/introspection.md b/website/content/guides/60_extensions/introspection.md index c20ffc20b..80f4587b3 100644 --- a/website/content/guides/60_extensions/introspection.md +++ b/website/content/guides/60_extensions/introspection.md @@ -1 +1 @@ - + diff --git a/website/content/guides/60_extensions/opentelemetry.md b/website/content/guides/60_extensions/opentelemetry.md index f5a4487b0..49f8bacf1 100644 --- a/website/content/guides/60_extensions/opentelemetry.md +++ b/website/content/guides/60_extensions/opentelemetry.md @@ -1 +1 @@ - + diff --git a/website/content/guides/60_extensions/schema-errors.md b/website/content/guides/60_extensions/schema-errors.md index c5d6ad84d..92b437278 100644 --- a/website/content/guides/60_extensions/schema-errors.md +++ b/website/content/guides/60_extensions/schema-errors.md @@ -1 +1 @@ - + diff --git a/website/content/guides/60_extensions/throws.md b/website/content/guides/60_extensions/throws.md index 4fd48a119..4ffd54a79 100644 --- a/website/content/guides/60_extensions/throws.md +++ b/website/content/guides/60_extensions/throws.md @@ -1 +1 @@ - + diff --git a/website/content/guides/60_extensions/upload.md b/website/content/guides/60_extensions/upload.md index 25b369981..1554135fb 100644 --- a/website/content/guides/60_extensions/upload.md +++ b/website/content/guides/60_extensions/upload.md @@ -1 +1 @@ - +