@soda-gql/core 0.10.1 → 0.10.2
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/dist/_internal.cjs +5 -0
- package/dist/_internal.d.cts +28 -0
- package/dist/_internal.d.cts.map +1 -0
- package/dist/_internal.d.ts +28 -0
- package/dist/_internal.d.ts.map +1 -0
- package/dist/_internal.js +3 -0
- package/dist/adapter.cjs +1 -1
- package/dist/adapter.d.cts +2 -2
- package/dist/adapter.d.ts +2 -2
- package/dist/adapter.js +1 -1
- package/dist/context-transformer-CYVYoqXM.cjs +58 -0
- package/dist/context-transformer-CYVYoqXM.cjs.map +1 -0
- package/dist/context-transformer-sAzKGoyJ.js +34 -0
- package/dist/context-transformer-sAzKGoyJ.js.map +1 -0
- package/dist/{index-DnLzk2bC.d.cts → index-Bj60NxMb.d.cts} +1 -1
- package/dist/{index-DnLzk2bC.d.cts.map → index-Bj60NxMb.d.cts.map} +1 -1
- package/dist/{index-ChwPP6wc.d.cts → index-Cbo0WJHs.d.ts} +60 -6
- package/dist/{index-DaREzuQm.d.ts.map → index-Cbo0WJHs.d.ts.map} +1 -1
- package/dist/{index-CnQ5XVCf.d.ts → index-DbANHktR.d.ts} +1 -1
- package/dist/{index-CnQ5XVCf.d.ts.map → index-DbANHktR.d.ts.map} +1 -1
- package/dist/{index-DaREzuQm.d.ts → index-gHe-Lwi7.d.cts} +60 -6
- package/dist/{index-ChwPP6wc.d.cts.map → index-gHe-Lwi7.d.cts.map} +1 -1
- package/dist/index.cjs +5 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/dist/runtime.d.cts +2 -2
- package/dist/runtime.d.ts +2 -2
- package/dist/{schema-builder-CJe30s_R.d.ts → schema-builder-B5zSZzZO.d.ts} +2 -2
- package/dist/{schema-builder-CJe30s_R.d.ts.map → schema-builder-B5zSZzZO.d.ts.map} +1 -1
- package/dist/{schema-builder-D2ay11cE.cjs → schema-builder-DGxUr6K-.cjs} +1 -1
- package/dist/{schema-builder-D2ay11cE.cjs.map → schema-builder-DGxUr6K-.cjs.map} +1 -1
- package/dist/{schema-builder-CwRmtxHx.d.cts → schema-builder-YC3vPw7X.d.cts} +2 -2
- package/dist/{schema-builder-CwRmtxHx.d.cts.map → schema-builder-YC3vPw7X.d.cts.map} +1 -1
- package/dist/{schema-builder-C9Qj5zQg.js → schema-builder-oVVErGOB.js} +1 -1
- package/dist/{schema-builder-C9Qj5zQg.js.map → schema-builder-oVVErGOB.js.map} +1 -1
- package/package.json +8 -1
package/dist/runtime.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as OperationType, P as OperationRoots } from "./index-
|
|
2
|
-
import {
|
|
1
|
+
import { F as OperationType, P as OperationRoots } from "./index-Bj60NxMb.cjs";
|
|
2
|
+
import { Yt as StripFunctions, it as AnyOperationOf, st as AnyFragment } from "./index-gHe-Lwi7.cjs";
|
|
3
3
|
|
|
4
4
|
//#region packages/core/src/runtime/fragment.d.ts
|
|
5
5
|
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as OperationType, P as OperationRoots } from "./index-
|
|
2
|
-
import {
|
|
1
|
+
import { F as OperationType, P as OperationRoots } from "./index-DbANHktR.js";
|
|
2
|
+
import { Yt as StripFunctions, it as AnyOperationOf, st as AnyFragment } from "./index-Cbo0WJHs.js";
|
|
3
3
|
|
|
4
4
|
//#region packages/core/src/runtime/fragment.d.ts
|
|
5
5
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as EnumDefinition, P as OperationRoots, R as ScalarDefinition } from "./index-
|
|
1
|
+
import { E as EnumDefinition, P as OperationRoots, R as ScalarDefinition } from "./index-DbANHktR.js";
|
|
2
2
|
|
|
3
3
|
//#region packages/core/src/schema/schema-builder.d.ts
|
|
4
4
|
|
|
@@ -60,4 +60,4 @@ declare function defineEnum<TName extends string, TValues extends string>(name:
|
|
|
60
60
|
declare const defineOperationRoots: <const TOperationRoots extends OperationRoots>(operationRoots: TOperationRoots) => TOperationRoots;
|
|
61
61
|
//#endregion
|
|
62
62
|
export { defineOperationRoots as n, defineScalar as r, defineEnum as t };
|
|
63
|
-
//# sourceMappingURL=schema-builder-
|
|
63
|
+
//# sourceMappingURL=schema-builder-B5zSZzZO.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-builder-
|
|
1
|
+
{"version":3,"file":"schema-builder-B5zSZzZO.d.ts","names":[],"sources":["../src/schema/schema-builder.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;AAqDA;;;;;;;AAuBA;AAAmE,cApDtD,YAoDsD,EAAA,CAAA,oBAAA,MAAA,EAAA,MAAA,EAAA,OAAA,CAAA,CAAA,IAAA,EApDa,OAoDb,CApDqB,KAoDrB,CAAA,EAAA,GAAA,QApD2B,KAoD3B,GApD2B,gBAoD3B,CAAA;EAAgC,IAAA,EAhDvF,KAgDuF;EAAe,KAAA,EA/CrG,MA+CqG;EAClG,MAAA,EA/CF,OA+CE;;;;;;;;;;;;;;;;;;;;;iBAxBA,+DACR,gCACmB,mBACxB;QAAuB;UAAe;;;;;;;;;;;;;;cAoB5B,qDAAsD,gCAAgC,oBAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-builder-
|
|
1
|
+
{"version":3,"file":"schema-builder-DGxUr6K-.cjs","names":[],"sources":["../src/utils/type-meta.ts","../src/utils/wrap-by-key.ts","../src/schema/schema-builder.ts"],"sourcesContent":["export interface WithTypeMeta<T extends object> {\n readonly $type: T;\n}\n\nexport const withTypeMeta = <TTarget extends WithTypeMeta<TTypeMeta>, TTypeMeta extends object>(\n target: Omit<NoInfer<TTarget>, \"$type\">,\n): TTarget => {\n if (process.env.NODE_ENV !== \"production\") {\n if ((typeof target !== \"object\" && typeof target !== \"function\") || target === null) {\n throw new Error(\"Target must be an object or a function.\");\n }\n\n Object.defineProperty(target, \"$type\", {\n get() {\n throw new Error(\"This property is only for type inference. Do not access this property directly.\");\n },\n });\n }\n\n return target as TTarget;\n};\n","export function wrapByKey<TName extends string, TValue>(name: TName, value: TValue) {\n return {\n [name]: value,\n } as {\n [K in TName]: TValue;\n };\n}\n","/**\n * Schema definition builders for GraphQL types.\n * @module\n */\n\nimport type { EnumDefinition, OperationRoots, ScalarDefinition } from \"../types/schema\";\nimport { withTypeMeta } from \"../utils/type-meta\";\nimport { wrapByKey } from \"../utils/wrap-by-key\";\n\n/**\n * Defines a custom scalar type with input/output type mappings.\n *\n * @template TName - The scalar name (e.g., \"DateTime\", \"JSON\")\n * @template TInput - TypeScript type for input values\n * @template TOutput - TypeScript type for output values\n *\n * @example\n * ```typescript\n * const scalar = {\n * ...defineScalar<\"DateTime\", string, Date>(\"DateTime\"),\n * ...defineScalar<\"JSON\", unknown, unknown>(\"JSON\"),\n * };\n * ```\n */\nexport const defineScalar = <const TName extends string, TInput, TOutput>(name: NoInfer<TName>) =>\n wrapByKey(\n name,\n withTypeMeta({ name }) satisfies ScalarDefinition<{\n name: TName;\n input: TInput;\n output: TOutput;\n }>,\n );\n\n/**\n * Creates an enum type definition for codegen.\n * Uses function overload to declare return type explicitly,\n * reducing structural type comparison cost.\n *\n * @template TName - The enum name\n * @template TValues - Union type of enum values\n * @param name - The enum name (runtime value)\n * @param values - Object with enum values as keys\n * @returns EnumDefinition with proper type metadata\n *\n * @example\n * ```typescript\n * const status = defineEnum<\"Status\", \"ACTIVE\" | \"INACTIVE\">(\n * \"Status\",\n * { ACTIVE: true, INACTIVE: true }\n * );\n * ```\n */\nexport function defineEnum<TName extends string, TValues extends string>(\n name: TName,\n values: { readonly [_ in TValues]: true },\n): EnumDefinition<{ name: TName; values: TValues }>;\nexport function defineEnum<TName extends string, TValues extends string>(\n name: TName,\n values: { readonly [_ in TValues]: true },\n): EnumDefinition<{ name: TName; values: TValues }> {\n return withTypeMeta({ name, values }) as EnumDefinition<{ name: TName; values: TValues }>;\n}\n\n/**\n * Defines the root operation types for the schema.\n *\n * @example\n * ```typescript\n * const operations = defineOperationRoots({\n * query: \"Query\",\n * mutation: \"Mutation\",\n * subscription: null, // or \"Subscription\"\n * });\n * ```\n */\nexport const defineOperationRoots = <const TOperationRoots extends OperationRoots>(operationRoots: TOperationRoots) =>\n operationRoots;\n"],"mappings":";;AAIA,MAAa,gBACX,WACY;AACZ,KAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,MAAK,OAAO,WAAW,YAAY,OAAO,WAAW,cAAe,WAAW,KAC7E,OAAM,IAAI,MAAM,0CAA0C;AAG5D,SAAO,eAAe,QAAQ,SAAS,EACrC,MAAM;AACJ,SAAM,IAAI,MAAM,kFAAkF;KAErG,CAAC;;AAGJ,QAAO;;;;;ACnBT,SAAgB,UAAwC,MAAa,OAAe;AAClF,QAAO,GACJ,OAAO,OACT;;;;;;;;;;;;;;;;;;;;ACqBH,MAAa,gBAA6D,SACxE,UACE,MACA,aAAa,EAAE,MAAM,CAAC,CAKvB;AAyBH,SAAgB,WACd,MACA,QACkD;AAClD,QAAO,aAAa;EAAE;EAAM;EAAQ,CAAC;;;;;;;;;;;;;;AAevC,MAAa,wBAAsE,mBACjF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as EnumDefinition, P as OperationRoots, R as ScalarDefinition } from "./index-
|
|
1
|
+
import { E as EnumDefinition, P as OperationRoots, R as ScalarDefinition } from "./index-Bj60NxMb.cjs";
|
|
2
2
|
|
|
3
3
|
//#region packages/core/src/schema/schema-builder.d.ts
|
|
4
4
|
|
|
@@ -60,4 +60,4 @@ declare function defineEnum<TName extends string, TValues extends string>(name:
|
|
|
60
60
|
declare const defineOperationRoots: <const TOperationRoots extends OperationRoots>(operationRoots: TOperationRoots) => TOperationRoots;
|
|
61
61
|
//#endregion
|
|
62
62
|
export { defineOperationRoots as n, defineScalar as r, defineEnum as t };
|
|
63
|
-
//# sourceMappingURL=schema-builder-
|
|
63
|
+
//# sourceMappingURL=schema-builder-YC3vPw7X.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-builder-
|
|
1
|
+
{"version":3,"file":"schema-builder-YC3vPw7X.d.cts","names":[],"sources":["../src/schema/schema-builder.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;AAqDA;;;;;;;AAuBA;AAAmE,cApDtD,YAoDsD,EAAA,CAAA,oBAAA,MAAA,EAAA,MAAA,EAAA,OAAA,CAAA,CAAA,IAAA,EApDa,OAoDb,CApDqB,KAoDrB,CAAA,EAAA,GAAA,QApD2B,KAoD3B,GApD2B,gBAoD3B,CAAA;EAAgC,IAAA,EAhDvF,KAgDuF;EAAe,KAAA,EA/CrG,MA+CqG;EAClG,MAAA,EA/CF,OA+CE;;;;;;;;;;;;;;;;;;;;;iBAxBA,+DACR,gCACmB,mBACxB;QAAuB;UAAe;;;;;;;;;;;;;;cAoB5B,qDAAsD,gCAAgC,oBAAe"}
|
|
@@ -55,4 +55,4 @@ const defineOperationRoots = (operationRoots) => operationRoots;
|
|
|
55
55
|
|
|
56
56
|
//#endregion
|
|
57
57
|
export { wrapByKey as i, defineOperationRoots as n, defineScalar as r, defineEnum as t };
|
|
58
|
-
//# sourceMappingURL=schema-builder-
|
|
58
|
+
//# sourceMappingURL=schema-builder-oVVErGOB.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-builder-
|
|
1
|
+
{"version":3,"file":"schema-builder-oVVErGOB.js","names":[],"sources":["../src/utils/type-meta.ts","../src/utils/wrap-by-key.ts","../src/schema/schema-builder.ts"],"sourcesContent":["export interface WithTypeMeta<T extends object> {\n readonly $type: T;\n}\n\nexport const withTypeMeta = <TTarget extends WithTypeMeta<TTypeMeta>, TTypeMeta extends object>(\n target: Omit<NoInfer<TTarget>, \"$type\">,\n): TTarget => {\n if (process.env.NODE_ENV !== \"production\") {\n if ((typeof target !== \"object\" && typeof target !== \"function\") || target === null) {\n throw new Error(\"Target must be an object or a function.\");\n }\n\n Object.defineProperty(target, \"$type\", {\n get() {\n throw new Error(\"This property is only for type inference. Do not access this property directly.\");\n },\n });\n }\n\n return target as TTarget;\n};\n","export function wrapByKey<TName extends string, TValue>(name: TName, value: TValue) {\n return {\n [name]: value,\n } as {\n [K in TName]: TValue;\n };\n}\n","/**\n * Schema definition builders for GraphQL types.\n * @module\n */\n\nimport type { EnumDefinition, OperationRoots, ScalarDefinition } from \"../types/schema\";\nimport { withTypeMeta } from \"../utils/type-meta\";\nimport { wrapByKey } from \"../utils/wrap-by-key\";\n\n/**\n * Defines a custom scalar type with input/output type mappings.\n *\n * @template TName - The scalar name (e.g., \"DateTime\", \"JSON\")\n * @template TInput - TypeScript type for input values\n * @template TOutput - TypeScript type for output values\n *\n * @example\n * ```typescript\n * const scalar = {\n * ...defineScalar<\"DateTime\", string, Date>(\"DateTime\"),\n * ...defineScalar<\"JSON\", unknown, unknown>(\"JSON\"),\n * };\n * ```\n */\nexport const defineScalar = <const TName extends string, TInput, TOutput>(name: NoInfer<TName>) =>\n wrapByKey(\n name,\n withTypeMeta({ name }) satisfies ScalarDefinition<{\n name: TName;\n input: TInput;\n output: TOutput;\n }>,\n );\n\n/**\n * Creates an enum type definition for codegen.\n * Uses function overload to declare return type explicitly,\n * reducing structural type comparison cost.\n *\n * @template TName - The enum name\n * @template TValues - Union type of enum values\n * @param name - The enum name (runtime value)\n * @param values - Object with enum values as keys\n * @returns EnumDefinition with proper type metadata\n *\n * @example\n * ```typescript\n * const status = defineEnum<\"Status\", \"ACTIVE\" | \"INACTIVE\">(\n * \"Status\",\n * { ACTIVE: true, INACTIVE: true }\n * );\n * ```\n */\nexport function defineEnum<TName extends string, TValues extends string>(\n name: TName,\n values: { readonly [_ in TValues]: true },\n): EnumDefinition<{ name: TName; values: TValues }>;\nexport function defineEnum<TName extends string, TValues extends string>(\n name: TName,\n values: { readonly [_ in TValues]: true },\n): EnumDefinition<{ name: TName; values: TValues }> {\n return withTypeMeta({ name, values }) as EnumDefinition<{ name: TName; values: TValues }>;\n}\n\n/**\n * Defines the root operation types for the schema.\n *\n * @example\n * ```typescript\n * const operations = defineOperationRoots({\n * query: \"Query\",\n * mutation: \"Mutation\",\n * subscription: null, // or \"Subscription\"\n * });\n * ```\n */\nexport const defineOperationRoots = <const TOperationRoots extends OperationRoots>(operationRoots: TOperationRoots) =>\n operationRoots;\n"],"mappings":";AAIA,MAAa,gBACX,WACY;AACZ,KAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,MAAK,OAAO,WAAW,YAAY,OAAO,WAAW,cAAe,WAAW,KAC7E,OAAM,IAAI,MAAM,0CAA0C;AAG5D,SAAO,eAAe,QAAQ,SAAS,EACrC,MAAM;AACJ,SAAM,IAAI,MAAM,kFAAkF;KAErG,CAAC;;AAGJ,QAAO;;;;;ACnBT,SAAgB,UAAwC,MAAa,OAAe;AAClF,QAAO,GACJ,OAAO,OACT;;;;;;;;;;;;;;;;;;;;ACqBH,MAAa,gBAA6D,SACxE,UACE,MACA,aAAa,EAAE,MAAM,CAAC,CAKvB;AAyBH,SAAgB,WACd,MACA,QACkD;AAClD,QAAO,aAAa;EAAE;EAAM;EAAQ,CAAC;;;;;;;;;;;;;;AAevC,MAAa,wBAAsE,mBACjF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soda-gql/core",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2",
|
|
4
4
|
"description": "Core types and utilities for zero-runtime GraphQL query generation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -43,6 +43,13 @@
|
|
|
43
43
|
"require": "./dist/index.cjs",
|
|
44
44
|
"default": "./dist/index.js"
|
|
45
45
|
},
|
|
46
|
+
"./_internal": {
|
|
47
|
+
"@soda-gql": "./@x-_internal.ts",
|
|
48
|
+
"types": "./dist/_internal.d.ts",
|
|
49
|
+
"import": "./dist/_internal.js",
|
|
50
|
+
"require": "./dist/_internal.cjs",
|
|
51
|
+
"default": "./dist/_internal.js"
|
|
52
|
+
},
|
|
46
53
|
"./adapter": {
|
|
47
54
|
"@soda-gql": "./@x-adapter.ts",
|
|
48
55
|
"types": "./dist/adapter.d.ts",
|