schema-truth 0.0.0-stage → 0.7.0

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.
Files changed (45) hide show
  1. package/README.md +143 -2
  2. package/dist/ajv-DTP2FXRr.js +105 -0
  3. package/dist/ajv.d.ts +24 -0
  4. package/dist/ajv.js +1 -0
  5. package/dist/arktype-BdvvaBQX.js +746 -0
  6. package/dist/arktype.d.ts +10 -0
  7. package/dist/arktype.js +1 -0
  8. package/dist/cli/ajv.d.ts +1 -0
  9. package/dist/cli/ajv.js +15 -0
  10. package/dist/cli/arktype.d.ts +1 -0
  11. package/dist/cli/arktype.js +15 -0
  12. package/dist/cli/effect.d.ts +1 -0
  13. package/dist/cli/effect.js +15 -0
  14. package/dist/cli/typebox.d.ts +1 -0
  15. package/dist/cli/typebox.js +15 -0
  16. package/dist/cli/valibot.d.ts +1 -0
  17. package/dist/cli/valibot.js +15 -0
  18. package/dist/cli/yup.d.ts +1 -0
  19. package/dist/cli/yup.js +15 -0
  20. package/dist/cli/zod.d.ts +1 -0
  21. package/dist/cli/zod.js +15 -0
  22. package/dist/cli-CL2mSark.js +124 -0
  23. package/dist/effect-mUknRPv_.js +645 -0
  24. package/dist/effect.d.ts +12 -0
  25. package/dist/effect.js +1 -0
  26. package/dist/helper-Cfvb5UDq.js +1115 -0
  27. package/dist/index-C2L8Ty0-.d.ts +65 -0
  28. package/dist/index-DbV3dEmN.d.ts +551 -0
  29. package/dist/index.d.ts +303 -0
  30. package/dist/index.js +10 -0
  31. package/dist/parser-CyJ2auea.js +36 -0
  32. package/dist/typebox-BdWJv3ND.js +544 -0
  33. package/dist/typebox.d.ts +21 -0
  34. package/dist/typebox.js +1 -0
  35. package/dist/utils-WNBq1HR0.js +1017 -0
  36. package/dist/valibot-CaJIynCH.js +664 -0
  37. package/dist/valibot.d.ts +9 -0
  38. package/dist/valibot.js +1 -0
  39. package/dist/yup-CM2TSFig.js +92 -0
  40. package/dist/yup.d.ts +17 -0
  41. package/dist/yup.js +1 -0
  42. package/dist/zod-BsXLZfwK.js +777 -0
  43. package/dist/zod.d.ts +9 -0
  44. package/dist/zod.js +1 -0
  45. package/package.json +112 -4
@@ -0,0 +1,65 @@
1
+ import { K as PARAM_LOCATIONS, q as PARAM_STYLES } from "./index-DbV3dEmN.js";
2
+ //#region src/parser/x-ext/param.d.ts
3
+ /**
4
+ * OpenAPI parameter location, or `formData` for a field of a form body
5
+ * (`application/x-www-form-urlencoded`, `multipart/form-data`).
6
+ *
7
+ * Every location is string-wire — when a primitive schema is emitted under one of
8
+ * them, generators apply type coercion (e.g. Zod `z.coerce.number()`, Effect
9
+ * `Schema.FiniteFromString`), read a literal, an `enum` and the text `null` from the
10
+ * text, wrap a value sent once into an array of one, and copy an object with an
11
+ * `Object.prototype`-named property onto a null-prototype object before the check.
12
+ *
13
+ * @see https://spec.openapis.org/oas/v3.2.0.html#parameter-object
14
+ */
15
+ type ParamIn = (typeof PARAM_LOCATIONS)[number];
16
+ /**
17
+ * The `style` of an OpenAPI Parameter Object: how its text is serialised. Defaults to
18
+ * `form` for `query` / `cookie` / `formData` and `simple` for `path` / `header`.
19
+ *
20
+ * @see https://spec.openapis.org/oas/v3.2.0.html#style-values
21
+ */
22
+ type ParamStyle = (typeof PARAM_STYLES)[number];
23
+ //#endregion
24
+ //#region src/options/index.d.ts
25
+ /** The options every `schemaTo<Library>` document generator accepts. */
26
+ type GenerateOptions = {
27
+ /** Also export the inferred TypeScript type. Default: `true`. */
28
+ readonly exportType?: boolean;
29
+ /** Name schemas as OpenAPI components are named, and resolve `#/components/schemas/` refs. */
30
+ readonly openapi?: boolean;
31
+ /** Emit readonly arrays and objects. */
32
+ readonly readonly?: boolean;
33
+ /** Honour the code-emitting `x-*` extensions. Unsafe: see `helper/code-extensions.ts`. */
34
+ readonly unsafeCodeExtensions?: boolean;
35
+ /** The OpenAPI parameter location the schema is emitted for; its values are coerced from text. */
36
+ readonly paramIn?: ParamIn;
37
+ /**
38
+ * The parameter's `style`, which decides how its text is split into an array or an
39
+ * object (`form` with `explode: false` reads `1,2,3`, `deepObject` gathers `deep[key]`).
40
+ * Defaults to `form` for `query` / `cookie` / `formData` and `simple` for `path` / `header`.
41
+ * Applies to the root schema only. Honoured by Zod, Valibot, Effect Schema and ArkType; a
42
+ * no-op for TypeBox, Ajv and Yup.
43
+ */
44
+ readonly style?: ParamStyle;
45
+ /**
46
+ * The parameter's `explode`. Defaults to `true` for `style: form`, else `false`. Honoured
47
+ * where `style` is.
48
+ */
49
+ readonly explode?: boolean;
50
+ /**
51
+ * The parameter's `allowEmptyValue` — an empty value reads as an absent one. Honoured
52
+ * where `style` is.
53
+ */
54
+ readonly allowEmptyValue?: boolean;
55
+ /**
56
+ * The media type of the parameter's `content`. A JSON one (`application/json`, `*+json`)
57
+ * reads the text as a JSON document and validates it without coercion. Honoured where
58
+ * `style` is.
59
+ */
60
+ readonly contentType?: string;
61
+ };
62
+ /** The options threaded through every node emitter: `GenerateOptions` without `exportType`. */
63
+ type EmitOptions = Omit<GenerateOptions, 'exportType'>;
64
+ //#endregion
65
+ export { ParamStyle as i, GenerateOptions as n, ParamIn as r, EmitOptions as t };
@@ -0,0 +1,551 @@
1
+ import * as Effect from "effect/Effect";
2
+ //#region src/constants/index.d.ts
3
+ /**
4
+ * The values the generators agree on: every list of literals, every prefix and every
5
+ * pattern that more than one module reads. Types that mirror a list are derived from it in
6
+ * `parser/index.ts`, so adding a member here is the whole change.
7
+ */
8
+ /**
9
+ * The `type` values a JSON Schema node may carry, in the order the specification lists
10
+ * them. `date` is not a JSON Schema type: it is the extension the generators accept for a
11
+ * `Date`-typed value (Zod `z.date()`, Valibot `v.date()`).
12
+ *
13
+ * @see https://json-schema.org/understanding-json-schema/reference/type
14
+ */
15
+ declare const JSON_SCHEMA_TYPES: readonly ['string', 'number', 'integer', 'boolean', 'array', 'object', 'null', 'date'];
16
+ /**
17
+ * The `format` values a string node may carry: the JSON Schema built-ins, the OpenAPI
18
+ * data-type formats, and the names the target libraries add (`uuidv7`, `cuid2`, `jwt`,
19
+ * `hash`, ...). A format a target has no equivalent for is a no-op there.
20
+ *
21
+ * @see https://json-schema.org/understanding-json-schema/reference/string#built-in-formats
22
+ * @see https://zod.dev/api#strings
23
+ */
24
+ declare const STRING_FORMATS: readonly ['date-time', 'date', 'time', 'duration', 'email', 'idn-email', 'hostname', 'idn-hostname', 'ipv4', 'ipv6', 'uri', 'uri-reference', 'iri', 'iri-reference', 'uuid', 'uri-template', 'json-pointer', 'relative-json-pointer', 'regex', 'binary', 'byte', 'password', 'url', 'httpUrl', 'uuidv4', 'uuidv6', 'uuidv7', 'guid', 'emoji', 'base64', 'base64url', 'hex', 'nanoid', 'cuid', 'cuid2', 'ulid', 'ksuid', 'xid', 'ip', 'cidrv4', 'cidrv6', 'mac', 'jwt', 'hash', 'e164', 'creditCard', 'iban', 'currencyCode', 'httpurl', 'creditcard', 'currencycode', 'toLowerCase', 'toUpperCase', 'trim', 'slugify'];
25
+ /**
26
+ * The `format` values a numeric node may carry: the OpenAPI data-type formats plus the
27
+ * widths the target libraries distinguish (`int32`, `float32`, `bigint`, ...).
28
+ *
29
+ * @see https://spec.openapis.org/oas/v3.1.0#data-types
30
+ */
31
+ declare const NUMBER_FORMATS: readonly ['int32', 'uint32', 'int64', 'uint64', 'bigint', 'float', 'float32', 'float64', 'double', 'decimal'];
32
+ /**
33
+ * The `contentEncoding` values of a string node.
34
+ *
35
+ * @see https://json-schema.org/draft/2020-12/json-schema-validation#section-8.3
36
+ */
37
+ declare const CONTENT_ENCODINGS: readonly ['base64', 'base64url', 'binary', '7bit', '8bit', 'quoted-printable'];
38
+ /**
39
+ * The OpenAPI parameter locations, plus `formData` for the fields of an
40
+ * `application/x-www-form-urlencoded` or `multipart/form-data` body. Every one of them is
41
+ * string-wire: a primitive schema emitted under one of them is coerced from a string.
42
+ *
43
+ * @see https://spec.openapis.org/oas/v3.2.0.html#parameter-object
44
+ */
45
+ declare const PARAM_LOCATIONS: readonly ['query', 'path', 'header', 'cookie', 'formData'];
46
+ /** The parameter locations whose values arrive as strings and are coerced. */
47
+ declare const STRING_WIRE_LOCATIONS: readonly ['query', 'path', 'header', 'cookie', 'formData'];
48
+ /**
49
+ * The `type` values a value on the wire is coerced to, in the order a union tries them:
50
+ * the text `1` is an integer before it is a number, and a string last of all.
51
+ */
52
+ declare const WIRE_PRIMITIVE_ORDER: readonly ['integer', 'number', 'boolean', 'string'];
53
+ /**
54
+ * The spellings of a boolean on the wire, as Zod's `z.stringbool()` reads them: `true`,
55
+ * `1`, `yes`, `on`, `y`, `enabled` and their opposites, in any case.
56
+ */
57
+ declare const STRINGBOOL_PATTERN: RegExp;
58
+ /** The spellings of {@link STRINGBOOL_PATTERN} that read as `true`. */
59
+ declare const STRINGBOOL_TRUTHY_PATTERN: RegExp;
60
+ /** The text of a 64-bit integer: a sign and digits, which `BigInt` reads losslessly. */
61
+ declare const INTEGER_TEXT_PATTERN: RegExp;
62
+ /** The range of each fixed-width numeric format, as the literals the generators emit. */
63
+ declare const NUMBER_RANGES: {
64
+ readonly [k: string]: {
65
+ readonly minimum: string;
66
+ readonly maximum: string;
67
+ };
68
+ };
69
+ /**
70
+ * The `style` values of an OpenAPI Parameter Object: how the parameter's text maps onto its
71
+ * schema.
72
+ *
73
+ * @see https://spec.openapis.org/oas/v3.2.0.html#style-values
74
+ */
75
+ declare const PARAM_STYLES: readonly ['matrix', 'label', 'simple', 'form', 'spaceDelimited', 'pipeDelimited', 'deepObject'];
76
+ /**
77
+ * The properties every plain object inherits from `Object.prototype`. A parameter object
78
+ * read from a request answers these even when the request did not send them.
79
+ */
80
+ declare const OBJECT_PROTOTYPE_PROPERTIES: readonly ['__proto__', '__defineGetter__', '__defineSetter__', '__lookupGetter__', '__lookupSetter__', 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf'];
81
+ /**
82
+ * The string formats checked with a regular expression where a target has no validator
83
+ * of its own, keyed by the lower-cased format. The patterns are Zod's, so every target
84
+ * accepts and rejects the same text.
85
+ *
86
+ * @see https://github.com/colinhacks/zod/blob/main/packages/zod/src/v4/core/regexes.ts
87
+ */
88
+ declare const FORMAT_PATTERNS: {
89
+ readonly [k: string]: RegExp;
90
+ };
91
+ /**
92
+ * The source of an RFC 3339 `full-date` that is a real calendar date: the month decides
93
+ * the days, and February 29 needs a leap year.
94
+ */
95
+ declare const DATE_PATTERN_SOURCE: string;
96
+ /** The source of a UTC offset: `Z`, or a signed `hh:mm`. */
97
+ declare const OFFSET_PATTERN_SOURCE: string;
98
+ /** The keywords that only constrain a number: on their own they imply `type: number`. */
99
+ declare const NUMERIC_KEYWORDS: readonly ['minimum', 'maximum', 'exclusiveMinimum', 'exclusiveMaximum', 'multipleOf'];
100
+ /** The keywords that only constrain a string: on their own they imply `type: string`. */
101
+ declare const STRING_KEYWORDS: readonly ['minLength', 'maxLength', 'pattern'];
102
+ /**
103
+ * The keywords that hold a document's named definitions: `$defs` since Draft 2019-09, and
104
+ * `definitions` before it. A document may use both, and the generators read them as one map.
105
+ */
106
+ declare const DEFINITION_KEYWORDS: readonly ['definitions', '$defs'];
107
+ /** The `$ref` spellings of the whole document: the schema being emitted refers to itself. */
108
+ declare const ROOT_REFS: readonly ['#', ''];
109
+ /** The `$ref` prefixes under which a named definition is found. */
110
+ declare const DEFINITION_REF_PREFIXES: readonly ['#/components/schemas/', '#/definitions/', '#/$defs/'];
111
+ /** The `$ref` prefix of an OpenAPI component schema. */
112
+ declare const COMPONENT_SCHEMA_REF_PREFIX = "#/components/schemas/";
113
+ /**
114
+ * The variable-name suffix of each OpenAPI component kind, by its `$ref` prefix.
115
+ *
116
+ * @see https://swagger.io/docs/specification/v3_0/components/
117
+ */
118
+ declare const OPENAPI_COMPONENT_SUFFIX_MAP: readonly {
119
+ readonly prefix: string;
120
+ readonly suffix: string;
121
+ }[];
122
+ /** The name a root schema is exported under when the document has no `title`. */
123
+ declare const DEFAULT_ROOT_NAME = "Schema";
124
+ /** The extensions of an input document: a JSON Schema as JSON or YAML. */
125
+ declare const INPUT_EXTENSIONS: readonly ['.json', '.yaml'];
126
+ /** The extension of the generated file. */
127
+ declare const OUTPUT_EXTENSION = ".ts";
128
+ /** A JavaScript identifier that can be written bare: as a binding, or a key or member access. */
129
+ declare const IDENTIFIER_PATTERN: RegExp;
130
+ /**
131
+ * A message option written as an arrow function, `(issue) => ...`, rather than as text.
132
+ * Such a message is spliced into the generated code as an expression instead of a string.
133
+ */
134
+ declare const ARROW_FUNCTION_PATTERN: RegExp;
135
+ /**
136
+ * A regular expression that needs the `u` flag: Unicode property escapes (`\p{...}`,
137
+ * `\P{...}`) and brace code points (`\u{...}`), which TypeScript rejects without it (TS1530).
138
+ */
139
+ declare const UNICODE_ESCAPE_PATTERN: RegExp;
140
+ /** A non-ASCII character, which an identifier cannot carry as is. */
141
+ declare const NON_IDENTIFIER_CHARACTER_PATTERN: RegExp;
142
+ /** A character that breaks a string-DSL literal and the JS string around it. */
143
+ declare const QUOTE_OR_BACKSLASH_PATTERN: RegExp;
144
+ /** The code-emitting extensions each target honours, in the order they are chained. */
145
+ declare const ZOD_CODE_EXTENSION_KEYS: readonly ['x-refine', 'x-transform', 'x-pipe', 'x-codec', 'x-preprocess'];
146
+ declare const VALIBOT_CODE_EXTENSION_KEYS: readonly ['x-check', 'x-transform', 'x-pipe'];
147
+ declare const EFFECT_CODE_EXTENSION_KEYS: readonly ['x-filter', 'x-transform', 'x-pipe'];
148
+ declare const ARKTYPE_CODE_EXTENSION_KEYS: readonly ['x-narrow', 'x-morph', 'x-pipe'];
149
+ /** Every code-emitting extension any target honours, deduplicated and sorted. */
150
+ declare const ALL_CODE_EXTENSION_KEYS: readonly string[];
151
+ /** The first line of a file that spliced a caller-supplied code extension into its source. */
152
+ declare const UNSAFE_GENERATED_MARKER = "// @generated-with-unsafe-code-extensions";
153
+ /** The first line of a file whose generator dropped `if` / `then` / `else`. */
154
+ declare const IF_THEN_ELSE_UNSUPPORTED_MARKER = "// FIXME: JSON Schema if/then/else is not yet supported by this generator; conditional validation is omitted";
155
+ /** The first line of a TypeBox file whose generator dropped a `not` keyword. */
156
+ declare const NOT_KEYWORD_UNSUPPORTED_MARKER = "// FIXME: JSON Schema `not` is not enforced by this generator; TypeBox v1 has no runtime `Type.Not` and `Value.Check` ignores the keyword (falls back to `Type.Any()`)";
157
+ /** The comment left where a `$ref` names a definition the document does not hold. */
158
+ declare const MISSING_DEFINITION_PREFIX = "// ⚠️ missing definition for ";
159
+ /** A JSON Pointer `$ref` to a named definition: `#/$defs/Name` or `#/definitions/Name`. */
160
+ declare const DEFINITION_POINTER_PATTERN: RegExp;
161
+ /** The Draft-04 anchor shorthand for a named definition: `#Name`. */
162
+ declare const ANCHOR_REF_PATTERN: RegExp;
163
+ /**
164
+ * The ISO 4217 alphabetic codes in current use, funds and precious-metal codes included:
165
+ * what `format: currencyCode` accepts.
166
+ *
167
+ * @see https://www.iso.org/iso-4217-currency-codes.html
168
+ */
169
+ declare const ISO_4217_CURRENCY_CODES: readonly ['AED', 'AFN', 'ALL', 'AMD', 'ANG', 'AOA', 'ARS', 'AUD', 'AWG', 'AZN', 'BAM', 'BBD', 'BDT', 'BGN', 'BHD', 'BIF', 'BMD', 'BND', 'BOB', 'BOV', 'BRL', 'BSD', 'BTN', 'BWP', 'BYN', 'BZD', 'CAD', 'CDF', 'CHE', 'CHF', 'CHW', 'CLF', 'CLP', 'CNY', 'COP', 'COU', 'CRC', 'CUP', 'CVE', 'CZK', 'DJF', 'DKK', 'DOP', 'DZD', 'EGP', 'ERN', 'ETB', 'EUR', 'FJD', 'FKP', 'GBP', 'GEL', 'GHS', 'GIP', 'GMD', 'GNF', 'GTQ', 'GYD', 'HKD', 'HNL', 'HTG', 'HUF', 'IDR', 'ILS', 'INR', 'IQD', 'IRR', 'ISK', 'JMD', 'JOD', 'JPY', 'KES', 'KGS', 'KHR', 'KMF', 'KPW', 'KRW', 'KWD', 'KYD', 'KZT', 'LAK', 'LBP', 'LKR', 'LRD', 'LSL', 'LYD', 'MAD', 'MDL', 'MGA', 'MKD', 'MMK', 'MNT', 'MOP', 'MRU', 'MUR', 'MVR', 'MWK', 'MXN', 'MXV', 'MYR', 'MZN', 'NAD', 'NGN', 'NIO', 'NOK', 'NPR', 'NZD', 'OMR', 'PAB', 'PEN', 'PGK', 'PHP', 'PKR', 'PLN', 'PYG', 'QAR', 'RON', 'RSD', 'RUB', 'RWF', 'SAR', 'SBD', 'SCR', 'SDG', 'SEK', 'SGD', 'SHP', 'SLE', 'SOS', 'SRD', 'SSP', 'STN', 'SVC', 'SYP', 'SZL', 'THB', 'TJS', 'TMT', 'TND', 'TOP', 'TRY', 'TTD', 'TWD', 'TZS', 'UAH', 'UGX', 'USD', 'USN', 'UYI', 'UYU', 'UYW', 'UZS', 'VED', 'VES', 'VND', 'VUV', 'WST', 'XAF', 'XAG', 'XAU', 'XBA', 'XBB', 'XBC', 'XBD', 'XCD', 'XCG', 'XDR', 'XOF', 'XPD', 'XPF', 'XPT', 'XSU', 'XTS', 'XUA', 'XXX', 'YER', 'ZAR', 'ZMW', 'ZWG'];
170
+ //#endregion
171
+ //#region src/parser/json.d.ts
172
+ /**
173
+ * A JSON value, as `enum`, `const`, `default` and `examples` carry one. A document read
174
+ * from disk holds nothing else, so an `undefined` or a function never reaches a generator.
175
+ */
176
+ type JSONValue = string | number | boolean | null | readonly JSONValue[] | {
177
+ readonly [k: string]: JSONValue;
178
+ };
179
+ //#endregion
180
+ //#region src/parser/x-ext/code.d.ts
181
+ /**
182
+ * C 層: Code-emitting vendor extensions (escape hatch).
183
+ *
184
+ * Values are complete validator-specific TS expression fragments that are
185
+ * appended verbatim to the generated schema. **DANGEROUS** — only honored
186
+ * when the programmatic API is called with `{ unsafeCodeExtensions: true }`
187
+ * and the value passes the denylist check in `helper/code-extensions.ts`.
188
+ * Treat untrusted JSON Schemas as unsafe.
189
+ *
190
+ * @see helper/code-extensions.ts for the denylist and `readCodeExtension`.
191
+ */
192
+ type XExtCode = {
193
+ /** Zod-only: `.refine(...)` chain fragment appended verbatim */
194
+ readonly 'x-refine'?: string;
195
+ /** Zod-only: `.superRefine(...)` chain fragment appended verbatim */
196
+ readonly 'x-superRefine'?: string;
197
+ /** Zod-only: complete `z.codec(...)` expression that replaces the base schema */
198
+ readonly 'x-codec'?: string;
199
+ /** Zod-only: complete `z.preprocess(...)` expression that replaces the base schema */
200
+ readonly 'x-preprocess'?: string;
201
+ /** Complete transform expression that replaces the base schema */
202
+ readonly 'x-transform'?: string;
203
+ /** Complete `.pipe(...)` expression appended verbatim */
204
+ readonly 'x-pipe'?: string;
205
+ /** Valibot-only: `.check(...)` fragment appended verbatim */
206
+ readonly 'x-check'?: string;
207
+ /** Effect-only: `.filter(...)` fragment appended verbatim */
208
+ readonly 'x-filter'?: string;
209
+ /** Arktype-only: `.narrow(...)` fragment appended verbatim */
210
+ readonly 'x-narrow'?: string;
211
+ /** Arktype-only: `.morph(...)` fragment appended verbatim */
212
+ readonly 'x-morph'?: string;
213
+ };
214
+ //#endregion
215
+ //#region src/parser/x-ext/messages.d.ts
216
+ type XExtMessages = {
217
+ readonly 'x-error-message'?: string;
218
+ readonly 'x-length-message'?: string;
219
+ readonly 'x-pattern-message'?: string;
220
+ readonly 'x-minimum-message'?: string;
221
+ readonly 'x-maximum-message'?: string;
222
+ readonly 'x-exclusiveMinimum-message'?: string;
223
+ readonly 'x-exclusiveMaximum-message'?: string;
224
+ readonly 'x-multipleOf-message'?: string;
225
+ readonly 'x-dependentRequired-message'?: string;
226
+ /**
227
+ * Overrides the validation message for `dependentSchemas` violations
228
+ * (JSON Schema 2020-12 §10.2.2.4). The inner sub-schema's `code` / `path`
229
+ * / `expected` are preserved; only `message` is replaced. Falls back to
230
+ * `x-error-message`.
231
+ */
232
+ readonly 'x-dependentSchemas-message'?: string;
233
+ readonly 'x-propertyNames-message'?: string;
234
+ readonly 'x-allOf-message'?: string;
235
+ readonly 'x-anyOf-message'?: string;
236
+ readonly 'x-oneOf-message'?: string;
237
+ readonly 'x-not-message'?: string;
238
+ /**
239
+ * Semantic alias for the implication pattern (`A → B`) encoded as
240
+ * `anyOf:[{not:A},{required:B}]`. Takes precedence over `x-anyOf-message`
241
+ * in the anyOf code path, then falls back to `x-error-message`. Acts as a
242
+ * documentation aid — explicitly marking the schema author's intent — and
243
+ * is silently ignored on schemas without `anyOf`.
244
+ */
245
+ readonly 'x-implication-message'?: string;
246
+ readonly 'x-required-message'?: string;
247
+ readonly 'x-additionalProperties-message'?: string;
248
+ readonly 'x-uniqueItems-message'?: string;
249
+ readonly 'x-const-message'?: string;
250
+ readonly 'x-enum-message'?: string;
251
+ readonly 'x-minLength-message'?: string;
252
+ readonly 'x-maxLength-message'?: string;
253
+ readonly 'x-minItems-message'?: string;
254
+ readonly 'x-maxItems-message'?: string;
255
+ readonly 'x-minProperties-message'?: string;
256
+ readonly 'x-maxProperties-message'?: string;
257
+ readonly 'x-patternProperties-message'?: string;
258
+ readonly 'x-contains-message'?: string;
259
+ readonly 'x-minContains-message'?: string;
260
+ readonly 'x-maxContains-message'?: string;
261
+ readonly 'x-properties-message'?: string;
262
+ readonly 'x-prefixItems-message'?: string;
263
+ readonly 'x-items-message'?: string;
264
+ readonly 'x-unevaluatedProperties-message'?: string;
265
+ readonly 'x-unevaluatedItems-message'?: string;
266
+ readonly 'x-if-message'?: string;
267
+ readonly 'x-then-message'?: string;
268
+ readonly 'x-else-message'?: string;
269
+ };
270
+ //#endregion
271
+ //#region src/parser/x-ext/transform.d.ts
272
+ /**
273
+ * B 層: 振る舞い・transform 系 vendor extensions.
274
+ *
275
+ * Declarative knobs that adjust the generated validator's runtime behavior
276
+ * (coercion, normalization, branding) or constrain format APIs without
277
+ * embedding code. Most are validator-portable; format-option fields are
278
+ * tagged Zod-only and become no-ops on validators without an equivalent API.
279
+ */
280
+ type XExtTransform = {
281
+ /** Apply `.trim()` / `v.trim()` etc. before validation */
282
+ readonly 'x-trim'?: boolean;
283
+ /** Apply `.toLowerCase()` before validation */
284
+ readonly 'x-toLowerCase'?: boolean;
285
+ /** Apply `.toUpperCase()` before validation */
286
+ readonly 'x-toUpperCase'?: boolean;
287
+ /** Apply Unicode normalization */
288
+ readonly 'x-normalize'?: 'NFC' | 'NFD' | 'NFKC' | 'NFKD';
289
+ /** Mark schema as readonly (array / object) */
290
+ readonly 'x-readonly'?: boolean;
291
+ /** Require value to start with a literal prefix */
292
+ readonly 'x-startsWith'?: string;
293
+ /** Require value to end with a literal suffix */
294
+ readonly 'x-endsWith'?: string;
295
+ /** Require value to contain a literal substring */
296
+ readonly 'x-includes'?: string;
297
+ /** Zod-only: enable `z.coerce.<type>` for number / integer / boolean / date */
298
+ readonly 'x-coerce'?: boolean;
299
+ /**
300
+ * Zod-only: emit `z.stringbool()` — string-typed input parsed as boolean
301
+ * via a fixed (or custom) truthy/falsy whitelist. Trigger is `type: "string"`;
302
+ * when set, supersedes `format` / `pattern` / `x-coerce` / other string options.
303
+ * `true` enables defaults; an object configures truthy/falsy/case/error.
304
+ * @see https://zod.dev/api?id=stringbools
305
+ */
306
+ readonly 'x-stringbool'?: boolean | {
307
+ readonly truthy?: readonly string[];
308
+ readonly falsy?: readonly string[];
309
+ readonly case?: 'sensitive' | 'insensitive';
310
+ readonly error?: string;
311
+ };
312
+ /** Zod-only: `.prefault(value)` — apply default to input before parse */
313
+ readonly 'x-prefault'?: JSONValue;
314
+ /** Zod-only: `.catch(value)` — fall back to value on parse failure */
315
+ readonly 'x-catch'?: JSONValue;
316
+ /** Valibot-only: `v.fallback(schema, value)` — fall back to value on parse failure */
317
+ readonly 'x-fallback'?: JSONValue;
318
+ /** Zod-only: select the email regex preset for `format: email` */
319
+ readonly 'x-emailPattern'?: 'html5' | 'rfc5322' | 'browser' | 'unicode';
320
+ /** Zod-only: custom email regex source for `format: email` */
321
+ readonly 'x-emailRegex'?: string;
322
+ /** Restrict UUID version on `format: uuid` (Zod, Valibot, Effect Schema, ArkType) */
323
+ readonly 'x-uuidVersion'?: 'v1' | 'v2' | 'v3' | 'v4' | 'v5' | 'v6' | 'v7' | 'v8';
324
+ /** Zod-only: restrict URL hostname on `format: uri` / `format: url` */
325
+ readonly 'x-urlHostname'?: string;
326
+ /** Zod-only: restrict URL protocol on `format: uri` / `format: url` */
327
+ readonly 'x-urlProtocol'?: string;
328
+ /** Zod-only: enable / disable URL normalization */
329
+ readonly 'x-urlNormalize'?: boolean;
330
+ /**
331
+ * ISO `date-time` / `time` sub-second precision: `-1` minutes only, `0` whole seconds, `n`
332
+ * exactly `n` fraction digits (Zod, Valibot, Effect Schema, ArkType)
333
+ */
334
+ readonly 'x-isoPrecision'?: number;
335
+ /**
336
+ * Whether an ISO `date-time` / `time` accepts a numeric UTC offset; RFC 3339 carries one,
337
+ * so `false` is what rules it out (Zod, Valibot, Effect Schema, ArkType)
338
+ */
339
+ readonly 'x-isoOffset'?: boolean;
340
+ /** Allow a local (offset-less) ISO `date-time` (Zod, Valibot, Effect Schema, ArkType) */
341
+ readonly 'x-isoLocal'?: boolean;
342
+ /** Zod-only: allowed algorithm(s) for `format: jwt` */
343
+ readonly 'x-jwtAlg'?: string;
344
+ /** Zod-only: hash algorithm for `format: hash` (required positional arg of `z.hash`) */
345
+ readonly 'x-hashAlg'?: 'sha1' | 'sha256' | 'sha384' | 'sha512' | 'md5';
346
+ /** Zod-only: hash encoding for `format: hash` */
347
+ readonly 'x-hashEnc'?: 'hex' | 'base64' | 'base64url';
348
+ /** Zod-only: delimiter for `format: mac` */
349
+ readonly 'x-macDelimiter'?: string;
350
+ /** Zod-only: enforce lowercase via `.lowercase()` validation */
351
+ readonly 'x-lowercase'?: boolean;
352
+ /** Zod-only: enforce uppercase via `.uppercase()` validation */
353
+ readonly 'x-uppercase'?: boolean;
354
+ /** Branded type tag — emitted as Zod `.brand<"Tag">()` etc. */
355
+ readonly 'x-brand'?: string;
356
+ };
357
+ //#endregion
358
+ //#region src/parser/index.d.ts
359
+ declare const ParseError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
360
+ readonly _tag: "ParseError";
361
+ } & Readonly<A>;
362
+ /** The document could not be bundled as a JSON Schema. */
363
+ declare class ParseError extends ParseError_base<{
364
+ readonly message: string;
365
+ }> {}
366
+ /** The bundled document at `input`. Failures land in the error channel. */
367
+ declare function parseSchemaFile(input: string): Effect.Effect<JSONSchema, ParseError, never>;
368
+ /**
369
+ * A JSON Schema `type` value: the seven of the specification plus the `date` extension.
370
+ *
371
+ * @see https://json-schema.org/understanding-json-schema/reference/type
372
+ */
373
+ type JSONSchemaType = (typeof JSON_SCHEMA_TYPES)[number];
374
+ /** A `format` of a string node. */
375
+ type JSONSchemaStringFormat = (typeof STRING_FORMATS)[number];
376
+ /** A `format` of a numeric node. */
377
+ type JSONSchemaNumberFormat = (typeof NUMBER_FORMATS)[number];
378
+ /**
379
+ * Every `format` a node may carry: the JSON Schema built-ins, the OpenAPI data-type
380
+ * formats and the target libraries' own names. A format without an equivalent in a target
381
+ * is a no-op there, never an error.
382
+ *
383
+ * @see https://json-schema.org/understanding-json-schema/reference/string#built-in-formats
384
+ */
385
+ type JSONSchemaFormat = JSONSchemaStringFormat | JSONSchemaNumberFormat;
386
+ /** A `contentEncoding` of a string node. */
387
+ type ContentEncoding = (typeof CONTENT_ENCODINGS)[number];
388
+ /**
389
+ * A `$ref` into the same document: the whole document (`#`, or the empty string some
390
+ * tools write), a JSON Pointer (`#/$defs/X`, `#/components/schemas/X`), or a plain-name
391
+ * fragment (`#X`, the Draft-04 anchor shorthand).
392
+ */
393
+ type LocalRef = '' | '#' | `#${string}`;
394
+ /**
395
+ * A `$ref` into another document: a relative path, with or without a fragment, or an
396
+ * absolute URL. `parseSchemaFile` bundles these into the document, so a generator only
397
+ * meets one when it is handed an unbundled schema. A bare name (`User`) is none of these:
398
+ * it is the most common misspelling of `#/$defs/User`, and the type says so.
399
+ */
400
+ type ExternalRef = `${string}.json` | `${string}.yaml` | `${string}.yml` | `${string}/${string}` | `${string}#${string}` | `${string}://${string}`;
401
+ /** Every `$ref` form the generators understand. */
402
+ type Ref = LocalRef | ExternalRef;
403
+ /**
404
+ * A `type` as written: one name, or a non-empty list of names (`["string", "null"]`).
405
+ *
406
+ * @see https://json-schema.org/understanding-json-schema/reference/type
407
+ */
408
+ type JSONSchemaTypes = JSONSchemaType | readonly [JSONSchemaType, ...JSONSchemaType[]];
409
+ /**
410
+ * JSON Schema Definition
411
+ *
412
+ * Supports JSON Schema Draft 2020-12, Draft 2019-09, Draft-07, Draft-06, and Draft-04, plus
413
+ * the OpenAPI 3.x additions (`nullable`, `discriminator`, `xml`, `externalDocs`, `example`).
414
+ * There is no index signature: a key the type does not name is a typo, not a keyword, and
415
+ * the vendor extensions are enumerated in `x-ext/`.
416
+ *
417
+ * @see https://json-schema.org/draft/2020-12/json-schema-core
418
+ * @see https://json-schema.org/draft/2020-12/json-schema-validation
419
+ */
420
+ type JSONSchemaCore = {
421
+ readonly $schema?: string;
422
+ readonly $id?: string;
423
+ readonly $ref?: Ref;
424
+ readonly $comment?: string;
425
+ readonly $vocabulary?: {
426
+ readonly [k: string]: boolean;
427
+ };
428
+ readonly $anchor?: string;
429
+ /** Dynamic anchor (Draft 2020-12) */
430
+ readonly $dynamicAnchor?: string;
431
+ /** Dynamic reference (Draft 2020-12) */
432
+ readonly $dynamicRef?: Ref;
433
+ /** Schema definitions (Draft 2020-12 / Draft 2019-09) */
434
+ readonly $defs?: {
435
+ readonly [k: string]: JSONSchema;
436
+ };
437
+ /** Schema definitions (Draft-07 and earlier) */
438
+ readonly definitions?: {
439
+ readonly [k: string]: JSONSchema;
440
+ };
441
+ readonly title?: string;
442
+ readonly description?: string;
443
+ readonly default?: JSONValue;
444
+ /** Example values (Draft 2019-09+) */
445
+ readonly examples?: readonly JSONValue[];
446
+ /** Single example value (OpenAPI) */
447
+ readonly example?: JSONValue;
448
+ readonly deprecated?: boolean;
449
+ readonly readOnly?: boolean;
450
+ readonly writeOnly?: boolean;
451
+ readonly type?: JSONSchemaTypes;
452
+ readonly format?: JSONSchemaFormat;
453
+ readonly const?: JSONValue;
454
+ readonly enum?: readonly JSONValue[];
455
+ readonly minLength?: number;
456
+ readonly maxLength?: number;
457
+ readonly pattern?: string;
458
+ readonly contentMediaType?: string;
459
+ readonly contentEncoding?: ContentEncoding;
460
+ readonly contentSchema?: JSONSchema;
461
+ readonly minimum?: number;
462
+ readonly maximum?: number;
463
+ /** Exclusive minimum (Draft 2020-12: number, Draft-04: boolean) */
464
+ readonly exclusiveMinimum?: number | boolean;
465
+ /** Exclusive maximum (Draft 2020-12: number, Draft-04: boolean) */
466
+ readonly exclusiveMaximum?: number | boolean;
467
+ readonly multipleOf?: number;
468
+ readonly properties?: {
469
+ readonly [k: string]: JSONSchema;
470
+ };
471
+ readonly required?: readonly string[];
472
+ readonly additionalProperties?: boolean | JSONSchema;
473
+ readonly patternProperties?: {
474
+ readonly [k: string]: JSONSchema;
475
+ };
476
+ readonly propertyNames?: JSONSchema;
477
+ readonly minProperties?: number;
478
+ readonly maxProperties?: number;
479
+ /** Dependent required properties (Draft 2019-09+) */
480
+ readonly dependentRequired?: {
481
+ readonly [k: string]: readonly string[];
482
+ };
483
+ /** Dependent schemas (Draft 2019-09+) */
484
+ readonly dependentSchemas?: {
485
+ readonly [k: string]: JSONSchema;
486
+ };
487
+ /**
488
+ * Draft-07 `dependencies`: a list of property names is `dependentRequired`, a schema is
489
+ * `dependentSchemas`. Read for completeness; the generators emit the split keywords.
490
+ */
491
+ readonly dependencies?: {
492
+ readonly [k: string]: readonly string[] | JSONSchema;
493
+ };
494
+ /** Unevaluated properties (Draft 2019-09+) */
495
+ readonly unevaluatedProperties?: boolean | JSONSchema;
496
+ /**
497
+ * JSON Schema 2020-12 §10.3.1.2: `items` may be a schema, a tuple of schemas (Draft-04
498
+ * compat), or a boolean schema (`true` = any item allowed, `false` = no trailing items).
499
+ * The boolean form matters when paired with `prefixItems`.
500
+ */
501
+ readonly items?: JSONSchema | readonly JSONSchema[] | boolean;
502
+ /** Draft-07 `additionalItems`: the schema of the items past a tuple-form `items`. */
503
+ readonly additionalItems?: boolean | JSONSchema;
504
+ /** Positional item schemas (Draft 2020-12) */
505
+ readonly prefixItems?: readonly JSONSchema[];
506
+ readonly contains?: JSONSchema;
507
+ readonly minItems?: number;
508
+ readonly maxItems?: number;
509
+ readonly uniqueItems?: boolean;
510
+ /** Minimum number of contains matches (Draft 2019-09+) */
511
+ readonly minContains?: number;
512
+ /** Maximum number of contains matches (Draft 2019-09+) */
513
+ readonly maxContains?: number;
514
+ /** Unevaluated items (Draft 2019-09+) */
515
+ readonly unevaluatedItems?: boolean | JSONSchema;
516
+ readonly allOf?: readonly JSONSchema[];
517
+ readonly anyOf?: readonly JSONSchema[];
518
+ readonly oneOf?: readonly JSONSchema[];
519
+ readonly not?: JSONSchema;
520
+ readonly if?: JSONSchema;
521
+ readonly then?: JSONSchema;
522
+ readonly else?: JSONSchema;
523
+ /** Whether the value can be null (OpenAPI 3.0) */
524
+ readonly nullable?: boolean;
525
+ readonly discriminator?: {
526
+ readonly propertyName?: string;
527
+ readonly mapping?: {
528
+ readonly [k: string]: string;
529
+ };
530
+ /** The branch an unlisted discriminator value selects (OpenAPI 3.2) */
531
+ readonly defaultMapping?: string;
532
+ };
533
+ readonly xml?: {
534
+ /** How the value is rendered as XML (OpenAPI 3.2) */
535
+ readonly nodeType?: string;
536
+ readonly name?: string;
537
+ readonly namespace?: string;
538
+ readonly prefix?: string;
539
+ readonly attribute?: boolean;
540
+ readonly wrapped?: boolean;
541
+ };
542
+ readonly externalDocs?: {
543
+ readonly url?: string;
544
+ readonly description?: string;
545
+ };
546
+ /** Schema name (non-standard) */
547
+ readonly name?: string;
548
+ };
549
+ type JSONSchema = JSONSchemaCore & XExtMessages & XExtTransform & XExtCode;
550
+ //#endregion
551
+ export { STRING_KEYWORDS as $, IDENTIFIER_PATTERN as A, NUMBER_RANGES as B, DATE_PATTERN_SOURCE as C, DEFINITION_REF_PREFIXES as D, DEFINITION_POINTER_PATTERN as E, JSON_SCHEMA_TYPES as F, OUTPUT_EXTENSION as G, OBJECT_PROTOTYPE_PROPERTIES as H, MISSING_DEFINITION_PREFIX as I, QUOTE_OR_BACKSLASH_PATTERN as J, PARAM_LOCATIONS as K, NON_IDENTIFIER_CHARACTER_PATTERN as L, INPUT_EXTENSIONS as M, INTEGER_TEXT_PATTERN as N, EFFECT_CODE_EXTENSION_KEYS as O, ISO_4217_CURRENCY_CODES as P, STRING_FORMATS as Q, NOT_KEYWORD_UNSUPPORTED_MARKER as R, CONTENT_ENCODINGS as S, DEFINITION_KEYWORDS as T, OFFSET_PATTERN_SOURCE as U, NUMERIC_KEYWORDS as V, OPENAPI_COMPONENT_SUFFIX_MAP as W, STRINGBOOL_PATTERN as X, ROOT_REFS as Y, STRINGBOOL_TRUTHY_PATTERN as Z, ALL_CODE_EXTENSION_KEYS as _, JSONSchemaNumberFormat as a, ZOD_CODE_EXTENSION_KEYS as at, ARROW_FUNCTION_PATTERN as b, JSONSchemaTypes as c, Ref as d, STRING_WIRE_LOCATIONS as et, parseSchemaFile as f, JSONValue as g, XExtCode as h, JSONSchemaFormat as i, WIRE_PRIMITIVE_ORDER as it, IF_THEN_ELSE_UNSUPPORTED_MARKER as j, FORMAT_PATTERNS as k, LocalRef as l, XExtMessages as m, ExternalRef as n, UNSAFE_GENERATED_MARKER as nt, JSONSchemaStringFormat as o, XExtTransform as p, PARAM_STYLES as q, JSONSchema as r, VALIBOT_CODE_EXTENSION_KEYS as rt, JSONSchemaType as s, ContentEncoding as t, UNICODE_ESCAPE_PATTERN as tt, ParseError as u, ANCHOR_REF_PATTERN as v, DEFAULT_ROOT_NAME as w, COMPONENT_SCHEMA_REF_PREFIX as x, ARKTYPE_CODE_EXTENSION_KEYS as y, NUMBER_FORMATS as z };