document-model 6.2.3 → 6.3.0-dev.1
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/catalog-B3nJD57s.d.ts +85 -0
- package/dist/catalog-B3nJD57s.d.ts.map +1 -0
- package/dist/index.d.ts +844 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6284 -14
- package/dist/index.js.map +1 -1
- package/dist/model-scalars-BzEq3l83.js +399 -0
- package/dist/model-scalars-BzEq3l83.js.map +1 -0
- package/dist/scalars.d.ts +53 -0
- package/dist/scalars.d.ts.map +1 -0
- package/dist/scalars.js +146 -0
- package/dist/scalars.js.map +1 -0
- package/dist/tooling.d.mts +668 -0
- package/dist/tooling.d.mts.map +1 -0
- package/dist/tooling.mjs +7993 -0
- package/dist/tooling.mjs.map +1 -0
- package/package.json +24 -5
package/dist/scalars.js
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { a as getCatalogScalar, c as SCALAR_DEFINITION_VERSION, i as documentModelScalars, l as isScalarDefinition, o as scalarCatalog, r as storedScalarDefinition, s as defineCatalogScalar, t as modelPackageScalars, u as scalarDefinitionVersion } from "./model-scalars-BzEq3l83.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/scalars/representation.ts
|
|
4
|
+
const shapeOfJsonType = {
|
|
5
|
+
null: "null",
|
|
6
|
+
string: "string",
|
|
7
|
+
number: "number",
|
|
8
|
+
integer: "number",
|
|
9
|
+
boolean: "boolean",
|
|
10
|
+
object: "json-object",
|
|
11
|
+
array: "json"
|
|
12
|
+
};
|
|
13
|
+
function shapeOfValue(value) {
|
|
14
|
+
if (value === null) return "null";
|
|
15
|
+
if (Array.isArray(value)) return "json";
|
|
16
|
+
if (typeof value === "object") return "json-object";
|
|
17
|
+
return shapeOfJsonType[typeof value];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The shapes a value of `node` can have, or `undefined` when zod states none.
|
|
21
|
+
* A union allows each branch's shapes; an intersection only those every
|
|
22
|
+
* stated member allows. `root` holds the `$defs` a local `$ref` names.
|
|
23
|
+
*/
|
|
24
|
+
function jsonShapes(node, root, visiting = /* @__PURE__ */ new Set()) {
|
|
25
|
+
if (typeof node !== "object" || node === null || visiting.has(node)) return;
|
|
26
|
+
const inner = /* @__PURE__ */ new Set([...visiting, node]);
|
|
27
|
+
const record = node;
|
|
28
|
+
const { type, anyOf, oneOf, allOf } = record;
|
|
29
|
+
const stated = [];
|
|
30
|
+
const statedValues = (shapes) => {
|
|
31
|
+
if (!shapes.includes(void 0)) stated.push(new Set(shapes));
|
|
32
|
+
};
|
|
33
|
+
const not = record.not;
|
|
34
|
+
if (typeof not === "object" && not !== null && Object.keys(not).length === 0) stated.push(/* @__PURE__ */ new Set());
|
|
35
|
+
if (typeof type === "string" || Array.isArray(type)) statedValues([type].flat().map((name) => shapeOfJsonType[String(name)]));
|
|
36
|
+
if (Array.isArray(record.enum)) statedValues(record.enum.map(shapeOfValue));
|
|
37
|
+
if ("const" in record) statedValues([shapeOfValue(record.const)]);
|
|
38
|
+
const ref = record.$ref;
|
|
39
|
+
if (typeof ref === "string" && ref.startsWith("#/$defs/")) {
|
|
40
|
+
const defs = root.$defs;
|
|
41
|
+
const name = ref.slice(8).replaceAll("~1", "/").replaceAll("~0", "~");
|
|
42
|
+
const shapes = jsonShapes(defs?.[name], root, inner);
|
|
43
|
+
if (shapes) stated.push(shapes);
|
|
44
|
+
}
|
|
45
|
+
const branches = anyOf ?? oneOf;
|
|
46
|
+
if (Array.isArray(branches)) {
|
|
47
|
+
const shapes = branches.map((branch) => jsonShapes(branch, root, inner));
|
|
48
|
+
if (!shapes.includes(void 0)) stated.push(new Set(shapes.flatMap((set) => [...set ?? []])));
|
|
49
|
+
}
|
|
50
|
+
if (Array.isArray(allOf)) for (const member of allOf) {
|
|
51
|
+
const shapes = jsonShapes(member, root, inner);
|
|
52
|
+
if (shapes) stated.push(shapes);
|
|
53
|
+
}
|
|
54
|
+
if (stated.length === 0) return void 0;
|
|
55
|
+
const [first, ...rest] = stated;
|
|
56
|
+
return new Set([...first].filter((shape) => rest.every((set) => set.has(shape))));
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The representation zod states for every output value of `schema`, or
|
|
60
|
+
* `undefined` when it cannot state one. One shape is that representation;
|
|
61
|
+
* several are `json`.
|
|
62
|
+
*/
|
|
63
|
+
function statedRepresentation(schema) {
|
|
64
|
+
const jsonSchema = outputJsonSchema(schema);
|
|
65
|
+
const stated = jsonShapes(jsonSchema, jsonSchema);
|
|
66
|
+
if (stated === void 0) return void 0;
|
|
67
|
+
const shapes = [...stated].filter((shape) => shape !== "null");
|
|
68
|
+
if (shapes.length === 0) return void 0;
|
|
69
|
+
const [only, ...rest] = shapes;
|
|
70
|
+
return rest.length === 0 ? only : "json";
|
|
71
|
+
}
|
|
72
|
+
function outputJsonSchema(schema) {
|
|
73
|
+
try {
|
|
74
|
+
return z.toJSONSchema(schema, {
|
|
75
|
+
io: "output",
|
|
76
|
+
unrepresentable: "any"
|
|
77
|
+
});
|
|
78
|
+
} catch {
|
|
79
|
+
return {};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/scalars/define-scalar.ts
|
|
84
|
+
const inputKeys = /* @__PURE__ */ new Set([
|
|
85
|
+
"name",
|
|
86
|
+
"schema",
|
|
87
|
+
"description",
|
|
88
|
+
"example",
|
|
89
|
+
"representation"
|
|
90
|
+
]);
|
|
91
|
+
const jsonRepresentations = /* @__PURE__ */ new Set([
|
|
92
|
+
"string",
|
|
93
|
+
"number",
|
|
94
|
+
"boolean",
|
|
95
|
+
"json-object",
|
|
96
|
+
"json"
|
|
97
|
+
]);
|
|
98
|
+
const graphqlBuiltIns = /* @__PURE__ */ new Set([
|
|
99
|
+
"Int",
|
|
100
|
+
"Float",
|
|
101
|
+
"String",
|
|
102
|
+
"Boolean",
|
|
103
|
+
"ID"
|
|
104
|
+
]);
|
|
105
|
+
const catalogNames = new Set(scalarCatalog.map((definition) => definition.name));
|
|
106
|
+
const graphqlName = /^[_A-Za-z][_0-9A-Za-z]*$/;
|
|
107
|
+
const refusals = [
|
|
108
|
+
(input) => {
|
|
109
|
+
const unknownKeys = Object.keys(input).filter((key) => !inputKeys.has(key));
|
|
110
|
+
return unknownKeys.length > 0 ? `unknown input key ${unknownKeys.join(", ")}; defineScalar accepts only name, schema, description, example and representation` : void 0;
|
|
111
|
+
},
|
|
112
|
+
({ name }) => typeof name !== "string" || !graphqlName.test(name) || name.startsWith("__") ? "the name is not a valid GraphQL name" : void 0,
|
|
113
|
+
({ name }) => graphqlBuiltIns.has(name) ? "the name is a GraphQL built-in scalar" : void 0,
|
|
114
|
+
({ name }) => catalogNames.has(name) ? "the name is a catalog scalar" : void 0,
|
|
115
|
+
({ schema }) => schema._zod.optin === "defaulted" || schema._zod.optout === "optional" ? "the schema accepts a missing value; nullability belongs in the SDL" : void 0
|
|
116
|
+
];
|
|
117
|
+
function defineScalar(input) {
|
|
118
|
+
for (const refusal of refusals) {
|
|
119
|
+
const reason = refusal(input);
|
|
120
|
+
if (reason !== void 0) throw new Error(`Cannot define scalar "${String(input.name)}": ${reason}.`);
|
|
121
|
+
}
|
|
122
|
+
const { example, representation, ...definition } = input;
|
|
123
|
+
const schema = input.schema;
|
|
124
|
+
const parsedExample = example === void 0 ? void 0 : schema.safeParse(example);
|
|
125
|
+
if (parsedExample?.success === false) throw new Error(`Cannot define scalar "${input.name}": the example fails the schema: ${z.prettifyError(parsedExample.error)}`);
|
|
126
|
+
return defineCatalogScalar({
|
|
127
|
+
...definition,
|
|
128
|
+
schema,
|
|
129
|
+
...parsedExample && { example: parsedExample.data },
|
|
130
|
+
typescriptType: null,
|
|
131
|
+
zodSource: null,
|
|
132
|
+
representation: scalarRepresentation(input.name, schema, representation)
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
function scalarRepresentation(name, schema, declared) {
|
|
136
|
+
const derived = statedRepresentation(schema);
|
|
137
|
+
if (declared === void 0) return derived ?? "json";
|
|
138
|
+
if (!jsonRepresentations.has(declared)) throw new Error(`Cannot define scalar "${name}": representation must be one of ${[...jsonRepresentations].join(", ")}.`);
|
|
139
|
+
const representation = declared;
|
|
140
|
+
if (derived !== void 0 && derived !== representation) throw new Error(`Cannot define scalar "${name}": the schema's values are ${derived}, so representation cannot be ${representation}.`);
|
|
141
|
+
return representation;
|
|
142
|
+
}
|
|
143
|
+
//#endregion
|
|
144
|
+
export { SCALAR_DEFINITION_VERSION, defineScalar, documentModelScalars, getCatalogScalar, isScalarDefinition, modelPackageScalars, scalarCatalog, scalarDefinitionVersion, storedScalarDefinition };
|
|
145
|
+
|
|
146
|
+
//# sourceMappingURL=scalars.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scalars.js","names":[],"sources":["../src/scalars/representation.ts","../src/scalars/define-scalar.ts"],"sourcesContent":["import { z } from \"zod\";\nimport type { ScalarRepresentation } from \"./types.js\";\n\n// defineScalar refuses a schema whose output is not JSON, so a package\n// scalar's values are never opaque.\nexport type JsonRepresentation = Exclude<ScalarRepresentation, \"opaque\">;\n\n// \"null\" is tracked through intersections and dropped before deciding: the\n// SDL owns nullability, so a null value never decides a representation.\ntype JsonShape = JsonRepresentation | \"null\";\n\nconst shapeOfJsonType: Readonly<Record<string, JsonShape | undefined>> = {\n null: \"null\",\n string: \"string\",\n number: \"number\",\n integer: \"number\",\n boolean: \"boolean\",\n object: \"json-object\",\n array: \"json\",\n};\n\nfunction shapeOfValue(value: unknown): JsonShape | undefined {\n if (value === null) return \"null\";\n if (Array.isArray(value)) return \"json\";\n if (typeof value === \"object\") return \"json-object\";\n return shapeOfJsonType[typeof value];\n}\n\n/**\n * The shapes a value of `node` can have, or `undefined` when zod states none.\n * A union allows each branch's shapes; an intersection only those every\n * stated member allows. `root` holds the `$defs` a local `$ref` names.\n */\nfunction jsonShapes(\n node: unknown,\n root: Readonly<Record<string, unknown>>,\n visiting: ReadonlySet<unknown> = new Set(),\n): ReadonlySet<JsonShape> | undefined {\n if (typeof node !== \"object\" || node === null || visiting.has(node)) {\n return undefined;\n }\n const inner = new Set([...visiting, node]);\n const record = node as Record<string, unknown>;\n const { type, anyOf, oneOf, allOf } = record;\n const stated: ReadonlySet<JsonShape>[] = [];\n const statedValues = (shapes: (JsonShape | undefined)[]) => {\n if (!shapes.includes(undefined)) {\n stated.push(new Set(shapes as JsonShape[]));\n }\n };\n // zod writes z.never() as { not: {} }, which no value matches.\n const not = record.not;\n if (\n typeof not === \"object\" &&\n not !== null &&\n Object.keys(not).length === 0\n ) {\n stated.push(new Set());\n }\n if (typeof type === \"string\" || Array.isArray(type)) {\n statedValues([type].flat().map((name) => shapeOfJsonType[String(name)]));\n }\n if (Array.isArray(record.enum)) statedValues(record.enum.map(shapeOfValue));\n if (\"const\" in record) statedValues([shapeOfValue(record.const)]);\n const ref = record.$ref;\n if (typeof ref === \"string\" && ref.startsWith(\"#/$defs/\")) {\n const defs = root.$defs as Record<string, unknown> | undefined;\n // A JSON Pointer token escapes \"~\" as \"~0\" and \"/\" as \"~1\".\n const name = ref\n .slice(\"#/$defs/\".length)\n .replaceAll(\"~1\", \"/\")\n .replaceAll(\"~0\", \"~\");\n const shapes = jsonShapes(defs?.[name], root, inner);\n if (shapes) stated.push(shapes);\n }\n const branches = anyOf ?? oneOf;\n if (Array.isArray(branches)) {\n const shapes = branches.map((branch) => jsonShapes(branch, root, inner));\n if (!shapes.includes(undefined)) {\n stated.push(new Set(shapes.flatMap((set) => [...(set ?? [])])));\n }\n }\n if (Array.isArray(allOf)) {\n for (const member of allOf) {\n const shapes = jsonShapes(member, root, inner);\n if (shapes) stated.push(shapes);\n }\n }\n if (stated.length === 0) return undefined;\n const [first, ...rest] = stated;\n return new Set(\n [...first].filter((shape) => rest.every((set) => set.has(shape))),\n );\n}\n\n/**\n * The representation zod states for every output value of `schema`, or\n * `undefined` when it cannot state one. One shape is that representation;\n * several are `json`.\n */\nexport function statedRepresentation(\n schema: z.ZodType,\n): JsonRepresentation | undefined {\n const jsonSchema = outputJsonSchema(schema);\n const stated = jsonShapes(jsonSchema, jsonSchema);\n if (stated === undefined) return undefined;\n const shapes = [...stated].filter((shape) => shape !== \"null\");\n if (shapes.length === 0) return undefined;\n const [only, ...rest] = shapes;\n return rest.length === 0 ? only : \"json\";\n}\n\nfunction outputJsonSchema(schema: z.ZodType): Record<string, unknown> {\n try {\n return z.toJSONSchema(schema, { io: \"output\", unrepresentable: \"any\" });\n } catch {\n return {};\n }\n}\n","import { z } from \"zod\";\nimport { scalarCatalog } from \"./catalog.js\";\nimport { defineCatalogScalar } from \"./define-catalog-scalar.js\";\nimport {\n type JsonRepresentation,\n statedRepresentation,\n} from \"./representation.js\";\nimport type { DescribedScalarDefinition } from \"./types.js\";\n\ntype Json = string | number | boolean | null | Json[] | { [key: string]: Json };\n\ntype OutputIsAny = {\n \"defineScalar refuses this schema: its output is any\": never;\n};\ntype AcceptsMissingValue = {\n \"defineScalar refuses this schema: it accepts a missing value; nullability belongs in the SDL\": never;\n};\ntype OutputCanBeNull = {\n \"defineScalar refuses this schema: its output can be null; nullability belongs in the SDL\": never;\n};\ntype OutputIsNotJson = {\n \"defineScalar refuses this schema: its output must be JSON\": never;\n};\ntype OutputFailsSchema = {\n \"defineScalar refuses this schema: its output must pass the schema again\": never;\n};\n\n// zod marks .default() and .prefault() with optin \"defaulted\" and .optional()\n// and .nullish() with optout \"optional\". z.coerce and z.preprocess take\n// `unknown`, which includes undefined, so for them only the markers count.\ntype TakesMissingValue<S extends z.ZodType> =\n S[\"_zod\"][\"optin\"] extends \"defaulted\"\n ? true\n : S[\"_zod\"][\"optout\"] extends \"optional\"\n ? true\n : unknown extends z.input<S>\n ? false\n : undefined extends z.input<S>\n ? true\n : false;\n\ntype CanonicalSchema<S extends z.ZodType> = 0 extends 1 & z.output<S>\n ? OutputIsAny\n : TakesMissingValue<S> extends true\n ? AcceptsMissingValue\n : z.output<S> extends Json\n ? null extends z.output<S>\n ? OutputCanBeNull\n : z.output<S> extends z.input<S>\n ? S\n : OutputFailsSchema\n : OutputIsNotJson;\n\ntype ScalarInput<TName extends string, S extends z.ZodType> = {\n name: TName;\n schema: S & CanonicalSchema<S>;\n description?: string;\n example?: NoInfer<z.input<S>>;\n /** Only for a schema whose JSON shape zod cannot state, such as `z.custom`. */\n representation?: JsonRepresentation;\n};\n\nconst inputKeys = new Set([\n \"name\",\n \"schema\",\n \"description\",\n \"example\",\n \"representation\",\n]);\nconst jsonRepresentations: ReadonlySet<unknown> = new Set<JsonRepresentation>([\n \"string\",\n \"number\",\n \"boolean\",\n \"json-object\",\n \"json\",\n]);\nconst graphqlBuiltIns: ReadonlySet<unknown> = new Set([\n \"Int\",\n \"Float\",\n \"String\",\n \"Boolean\",\n \"ID\",\n]);\nconst catalogNames: ReadonlySet<unknown> = new Set(\n scalarCatalog.map((definition) => definition.name),\n);\nconst graphqlName = /^[_A-Za-z][_0-9A-Za-z]*$/;\n\ntype Refusal = (\n input: Readonly<Record<string, unknown>> & { readonly schema: z.ZodType },\n) => string | undefined;\n\nconst refusals: readonly Refusal[] = [\n (input) => {\n const unknownKeys = Object.keys(input).filter((key) => !inputKeys.has(key));\n return unknownKeys.length > 0\n ? `unknown input key ${unknownKeys.join(\", \")}; defineScalar accepts only name, schema, description, example and representation`\n : undefined;\n },\n ({ name }) =>\n typeof name !== \"string\" || !graphqlName.test(name) || name.startsWith(\"__\")\n ? \"the name is not a valid GraphQL name\"\n : undefined,\n ({ name }) =>\n graphqlBuiltIns.has(name)\n ? \"the name is a GraphQL built-in scalar\"\n : undefined,\n ({ name }) =>\n catalogNames.has(name) ? \"the name is a catalog scalar\" : undefined,\n ({ schema }) =>\n schema._zod.optin === \"defaulted\" || schema._zod.optout === \"optional\"\n ? \"the schema accepts a missing value; nullability belongs in the SDL\"\n : undefined,\n];\n\nexport function defineScalar<TName extends string, S extends z.ZodType>(\n input: ScalarInput<TName, S>,\n): DescribedScalarDefinition<TName, z.output<S>> {\n for (const refusal of refusals) {\n const reason = refusal(input);\n if (reason !== undefined) {\n throw new Error(\n `Cannot define scalar \"${String(input.name)}\": ${reason}.`,\n );\n }\n }\n const { example, representation, ...definition } = input;\n // TypeScript cannot relate a generic S to its own z.output<S>.\n const schema = input.schema as z.ZodType<z.output<S>>;\n const parsedExample =\n example === undefined ? undefined : schema.safeParse(example);\n if (parsedExample?.success === false) {\n throw new Error(\n `Cannot define scalar \"${input.name}\": the example fails the schema: ${z.prettifyError(parsedExample.error)}`,\n );\n }\n return defineCatalogScalar({\n ...definition,\n schema,\n ...(parsedExample && { example: parsedExample.data }),\n typescriptType: null,\n zodSource: null,\n representation: scalarRepresentation(input.name, schema, representation),\n });\n}\n\nfunction scalarRepresentation(\n name: string,\n schema: z.ZodType,\n declared: unknown,\n): JsonRepresentation {\n const derived = statedRepresentation(schema);\n if (declared === undefined) return derived ?? \"json\";\n if (!jsonRepresentations.has(declared)) {\n throw new Error(\n `Cannot define scalar \"${name}\": representation must be one of ${[...jsonRepresentations].join(\", \")}.`,\n );\n }\n const representation = declared as JsonRepresentation;\n if (derived !== undefined && derived !== representation) {\n throw new Error(\n `Cannot define scalar \"${name}\": the schema's values are ${derived}, so representation cannot be ${representation}.`,\n );\n }\n return representation;\n}\n"],"mappings":";;;AAWA,MAAM,kBAAmE;CACvE,MAAM;CACN,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,SAAS;CACT,QAAQ;CACR,OAAO;AACT;AAEA,SAAS,aAAa,OAAuC;CAC3D,IAAI,UAAU,MAAM,OAAO;CAC3B,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO;CACjC,IAAI,OAAO,UAAU,UAAU,OAAO;CACtC,OAAO,gBAAgB,OAAO;AAChC;;;;;;AAOA,SAAS,WACP,MACA,MACA,2BAAiC,IAAI,IAAI,GACL;CACpC,IAAI,OAAO,SAAS,YAAY,SAAS,QAAQ,SAAS,IAAI,IAAI,GAChE;CAEF,MAAM,wBA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