@drzl/validation-core 3.22.5 → 3.22.6

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/index.cjs CHANGED
@@ -44,6 +44,8 @@ __export(index_exports, {
44
44
  DEFAULT_SCHEMA_SUFFIX: () => DEFAULT_SCHEMA_SUFFIX,
45
45
  DEFAULT_TYPE_SUFFIX: () => DEFAULT_TYPE_SUFFIX,
46
46
  IMPORT_EXTENSIONS: () => IMPORT_EXTENSIONS,
47
+ JSON_VALUE_TS_CONST: () => JSON_VALUE_TS_CONST,
48
+ JSON_VALUE_TS_SOURCE: () => JSON_VALUE_TS_SOURCE,
47
49
  MAX_NESTED_DEPTH: () => MAX_NESTED_DEPTH,
48
50
  NAME_MODES: () => NAME_MODES,
49
51
  NESTED_PREFIX: () => NESTED_PREFIX,
@@ -1802,6 +1804,15 @@ function parsesToADate(expr) {
1802
1804
  }
1803
1805
  var CODEPOINT_LENGTH = "[...v].length";
1804
1806
  var BIGINT_DIGITS_PATTERN = String.raw`/^-?\d+$/`;
1807
+ var JSON_VALUE_TS_CONST = "DrzlJsonValue";
1808
+ var JSON_VALUE_TS_SOURCE = `type ${JSON_VALUE_TS_CONST} =
1809
+ | string
1810
+ | number
1811
+ | boolean
1812
+ | null
1813
+ | ${JSON_VALUE_TS_CONST}[]
1814
+ | { [key: string]: ${JSON_VALUE_TS_CONST} };
1815
+ `;
1805
1816
  var VALIBOT_JSON_CONST = "DrzlJsonValue";
1806
1817
  var VALIBOT_JSON_SOURCE = `type ${VALIBOT_JSON_CONST}Type =
1807
1818
  | string
@@ -2005,6 +2016,8 @@ async function formatCode(code, filePath, fmt) {
2005
2016
  DEFAULT_SCHEMA_SUFFIX,
2006
2017
  DEFAULT_TYPE_SUFFIX,
2007
2018
  IMPORT_EXTENSIONS,
2019
+ JSON_VALUE_TS_CONST,
2020
+ JSON_VALUE_TS_SOURCE,
2008
2021
  MAX_NESTED_DEPTH,
2009
2022
  NAME_MODES,
2010
2023
  NESTED_PREFIX,
package/dist/index.d.cts CHANGED
@@ -1575,6 +1575,22 @@ declare const CODEPOINT_LENGTH = "[...v].length";
1575
1575
  * it as its decimal digits, and they all spell it the same way from here.
1576
1576
  */
1577
1577
  declare const BIGINT_DIGITS_PATTERN: string;
1578
+ /** The name of the TypeScript alias a module declares for the json value space. */
1579
+ declare const JSON_VALUE_TS_CONST = "DrzlJsonValue";
1580
+ /**
1581
+ * The json value space as a TypeScript type, for the generators that emit types rather than
1582
+ * schemas: the service classes, the Fastify row types, the GraphQL resolver types and the NestJS
1583
+ * DTO fields.
1584
+ *
1585
+ * They all used to say `unknown` for a json column, or `any` in one case, while every validator
1586
+ * generator described the same column properly. A row type that says `unknown` makes the caller
1587
+ * cast to read a value the database guarantees is json, and one that says `any` is worse: it turns
1588
+ * the check off silently.
1589
+ *
1590
+ * Verified mutually assignable with zod's own `z.json()` output type, so a DTO field declared with
1591
+ * this satisfies a `StandardSchema<Dto>` static built from that schema.
1592
+ */
1593
+ declare const JSON_VALUE_TS_SOURCE = "type DrzlJsonValue =\n | string\n | number\n | boolean\n | null\n | DrzlJsonValue[]\n | { [key: string]: DrzlJsonValue };\n";
1578
1594
  /** The name of the recursive JSON schema a valibot module defines when it has a json column. */
1579
1595
  declare const VALIBOT_JSON_CONST = "DrzlJsonValue";
1580
1596
  /**
@@ -1720,4 +1736,4 @@ declare function isProjectInstallPath(manifestPath: string): boolean;
1720
1736
  */
1721
1737
  declare function formatCode(code: string, filePath: string, fmt?: FormatOptions): Promise<any>;
1722
1738
 
1723
- export { AFFIX_PREFIX_PATTERN, AFFIX_PROBE_TABLE, AFFIX_SUFFIX_PATTERN, type AffixIssue, type AffixOptions, type AffixValue, BIGINT_DIGITS_PATTERN, type BrandAlias, type BrandPlan, type BrandingOption, type BrandingOptions, CODEPOINT_LENGTH, COERCIBLE_DATE_STRING, COLUMN_FORMATS, CONSTRAINTS_MODULE, type CardinalityCheck, type CheckPart, type CheckPartPlace, type ClassifiedCheck, type ColumnCheck, type ColumnMetaFacts, type ColumnSet, type ComparisonWire, type ConstraintFacts, type ConstraintKind, type ConstraintsModuleOptions, type ConstraintsOption, DEFAULT_IMPORT_EXTENSION, DEFAULT_MODE_PREFIX, DEFAULT_NESTED_DEPTH, DEFAULT_SCHEMA_SUFFIX, DEFAULT_TYPE_SUFFIX, type FileSink, type FormatOptions, type GeneratorFs, IMPORT_EXTENSIONS, type ImportExtension, type LengthCheck, type LengthMeasure, MAX_NESTED_DEPTH, type MetaFactOptions, NAME_MODES, NESTED_PREFIX, NUMERIC_CANON_NAME, NUMERIC_CANON_SOURCE, type NameMode, type NestedArm, type NestedMode, type NestedNode, type NullCheck, type ParsedCheck, type ResolvedAffix, type ResolvedBranding, type RowCheck, type Table, type TableCase, type TableConstraints, type TableMetaFacts, type TableMetaOptions, type UnenforcedLiteral, type UnenforcedPart, VALIBOT_JSON_CONST, VALIBOT_JSON_SOURCE, type ValidationGenerateOptions, type ValidationLibrary, type ValidationRenderer, type WireLiteralFit, type WireLiteralQuestion, applyTableCase, applyWirePolicy, buildBrandPlan, buildNestedPlan, canonicalMembers, canonicalNumericText, classifyTableChecks, codePointCompare, columnMetaFacts, comparisonWire, describeSet, fileWriter, formatCode, importSpecifier, insertColumns, isGeneratedColumn, isIntegerColumn, isProjectInstallPath, lengthCheckLabel, lengthMeasure, measureCompare, measureExpression, moduleFileName, moduleSpecifier, needsNumericCanon, nestedArmNotes, nestedNodeColumns, nestedSchemaName, nestedTypeName, nonFiniteAccepted, nonFiniteRefused, parseCheck, parsesToADate, pascalCase, renderConstraintsModule, renderDuplicateFinder, resolveAffix, resolveBranding, resolveConfiguredImport, resolveConstraints, resolveNestedDepth, schemaName, selectColumns, tableConstraints, tableMetaFacts, typeName, updateColumns, validateAffix, wireLiteralFit, wireNumberLiteral };
1739
+ export { AFFIX_PREFIX_PATTERN, AFFIX_PROBE_TABLE, AFFIX_SUFFIX_PATTERN, type AffixIssue, type AffixOptions, type AffixValue, BIGINT_DIGITS_PATTERN, type BrandAlias, type BrandPlan, type BrandingOption, type BrandingOptions, CODEPOINT_LENGTH, COERCIBLE_DATE_STRING, COLUMN_FORMATS, CONSTRAINTS_MODULE, type CardinalityCheck, type CheckPart, type CheckPartPlace, type ClassifiedCheck, type ColumnCheck, type ColumnMetaFacts, type ColumnSet, type ComparisonWire, type ConstraintFacts, type ConstraintKind, type ConstraintsModuleOptions, type ConstraintsOption, DEFAULT_IMPORT_EXTENSION, DEFAULT_MODE_PREFIX, DEFAULT_NESTED_DEPTH, DEFAULT_SCHEMA_SUFFIX, DEFAULT_TYPE_SUFFIX, type FileSink, type FormatOptions, type GeneratorFs, IMPORT_EXTENSIONS, type ImportExtension, JSON_VALUE_TS_CONST, JSON_VALUE_TS_SOURCE, type LengthCheck, type LengthMeasure, MAX_NESTED_DEPTH, type MetaFactOptions, NAME_MODES, NESTED_PREFIX, NUMERIC_CANON_NAME, NUMERIC_CANON_SOURCE, type NameMode, type NestedArm, type NestedMode, type NestedNode, type NullCheck, type ParsedCheck, type ResolvedAffix, type ResolvedBranding, type RowCheck, type Table, type TableCase, type TableConstraints, type TableMetaFacts, type TableMetaOptions, type UnenforcedLiteral, type UnenforcedPart, VALIBOT_JSON_CONST, VALIBOT_JSON_SOURCE, type ValidationGenerateOptions, type ValidationLibrary, type ValidationRenderer, type WireLiteralFit, type WireLiteralQuestion, applyTableCase, applyWirePolicy, buildBrandPlan, buildNestedPlan, canonicalMembers, canonicalNumericText, classifyTableChecks, codePointCompare, columnMetaFacts, comparisonWire, describeSet, fileWriter, formatCode, importSpecifier, insertColumns, isGeneratedColumn, isIntegerColumn, isProjectInstallPath, lengthCheckLabel, lengthMeasure, measureCompare, measureExpression, moduleFileName, moduleSpecifier, needsNumericCanon, nestedArmNotes, nestedNodeColumns, nestedSchemaName, nestedTypeName, nonFiniteAccepted, nonFiniteRefused, parseCheck, parsesToADate, pascalCase, renderConstraintsModule, renderDuplicateFinder, resolveAffix, resolveBranding, resolveConfiguredImport, resolveConstraints, resolveNestedDepth, schemaName, selectColumns, tableConstraints, tableMetaFacts, typeName, updateColumns, validateAffix, wireLiteralFit, wireNumberLiteral };
package/dist/index.d.ts CHANGED
@@ -1575,6 +1575,22 @@ declare const CODEPOINT_LENGTH = "[...v].length";
1575
1575
  * it as its decimal digits, and they all spell it the same way from here.
1576
1576
  */
1577
1577
  declare const BIGINT_DIGITS_PATTERN: string;
1578
+ /** The name of the TypeScript alias a module declares for the json value space. */
1579
+ declare const JSON_VALUE_TS_CONST = "DrzlJsonValue";
1580
+ /**
1581
+ * The json value space as a TypeScript type, for the generators that emit types rather than
1582
+ * schemas: the service classes, the Fastify row types, the GraphQL resolver types and the NestJS
1583
+ * DTO fields.
1584
+ *
1585
+ * They all used to say `unknown` for a json column, or `any` in one case, while every validator
1586
+ * generator described the same column properly. A row type that says `unknown` makes the caller
1587
+ * cast to read a value the database guarantees is json, and one that says `any` is worse: it turns
1588
+ * the check off silently.
1589
+ *
1590
+ * Verified mutually assignable with zod's own `z.json()` output type, so a DTO field declared with
1591
+ * this satisfies a `StandardSchema<Dto>` static built from that schema.
1592
+ */
1593
+ declare const JSON_VALUE_TS_SOURCE = "type DrzlJsonValue =\n | string\n | number\n | boolean\n | null\n | DrzlJsonValue[]\n | { [key: string]: DrzlJsonValue };\n";
1578
1594
  /** The name of the recursive JSON schema a valibot module defines when it has a json column. */
1579
1595
  declare const VALIBOT_JSON_CONST = "DrzlJsonValue";
1580
1596
  /**
@@ -1720,4 +1736,4 @@ declare function isProjectInstallPath(manifestPath: string): boolean;
1720
1736
  */
1721
1737
  declare function formatCode(code: string, filePath: string, fmt?: FormatOptions): Promise<any>;
1722
1738
 
1723
- export { AFFIX_PREFIX_PATTERN, AFFIX_PROBE_TABLE, AFFIX_SUFFIX_PATTERN, type AffixIssue, type AffixOptions, type AffixValue, BIGINT_DIGITS_PATTERN, type BrandAlias, type BrandPlan, type BrandingOption, type BrandingOptions, CODEPOINT_LENGTH, COERCIBLE_DATE_STRING, COLUMN_FORMATS, CONSTRAINTS_MODULE, type CardinalityCheck, type CheckPart, type CheckPartPlace, type ClassifiedCheck, type ColumnCheck, type ColumnMetaFacts, type ColumnSet, type ComparisonWire, type ConstraintFacts, type ConstraintKind, type ConstraintsModuleOptions, type ConstraintsOption, DEFAULT_IMPORT_EXTENSION, DEFAULT_MODE_PREFIX, DEFAULT_NESTED_DEPTH, DEFAULT_SCHEMA_SUFFIX, DEFAULT_TYPE_SUFFIX, type FileSink, type FormatOptions, type GeneratorFs, IMPORT_EXTENSIONS, type ImportExtension, type LengthCheck, type LengthMeasure, MAX_NESTED_DEPTH, type MetaFactOptions, NAME_MODES, NESTED_PREFIX, NUMERIC_CANON_NAME, NUMERIC_CANON_SOURCE, type NameMode, type NestedArm, type NestedMode, type NestedNode, type NullCheck, type ParsedCheck, type ResolvedAffix, type ResolvedBranding, type RowCheck, type Table, type TableCase, type TableConstraints, type TableMetaFacts, type TableMetaOptions, type UnenforcedLiteral, type UnenforcedPart, VALIBOT_JSON_CONST, VALIBOT_JSON_SOURCE, type ValidationGenerateOptions, type ValidationLibrary, type ValidationRenderer, type WireLiteralFit, type WireLiteralQuestion, applyTableCase, applyWirePolicy, buildBrandPlan, buildNestedPlan, canonicalMembers, canonicalNumericText, classifyTableChecks, codePointCompare, columnMetaFacts, comparisonWire, describeSet, fileWriter, formatCode, importSpecifier, insertColumns, isGeneratedColumn, isIntegerColumn, isProjectInstallPath, lengthCheckLabel, lengthMeasure, measureCompare, measureExpression, moduleFileName, moduleSpecifier, needsNumericCanon, nestedArmNotes, nestedNodeColumns, nestedSchemaName, nestedTypeName, nonFiniteAccepted, nonFiniteRefused, parseCheck, parsesToADate, pascalCase, renderConstraintsModule, renderDuplicateFinder, resolveAffix, resolveBranding, resolveConfiguredImport, resolveConstraints, resolveNestedDepth, schemaName, selectColumns, tableConstraints, tableMetaFacts, typeName, updateColumns, validateAffix, wireLiteralFit, wireNumberLiteral };
1739
+ export { AFFIX_PREFIX_PATTERN, AFFIX_PROBE_TABLE, AFFIX_SUFFIX_PATTERN, type AffixIssue, type AffixOptions, type AffixValue, BIGINT_DIGITS_PATTERN, type BrandAlias, type BrandPlan, type BrandingOption, type BrandingOptions, CODEPOINT_LENGTH, COERCIBLE_DATE_STRING, COLUMN_FORMATS, CONSTRAINTS_MODULE, type CardinalityCheck, type CheckPart, type CheckPartPlace, type ClassifiedCheck, type ColumnCheck, type ColumnMetaFacts, type ColumnSet, type ComparisonWire, type ConstraintFacts, type ConstraintKind, type ConstraintsModuleOptions, type ConstraintsOption, DEFAULT_IMPORT_EXTENSION, DEFAULT_MODE_PREFIX, DEFAULT_NESTED_DEPTH, DEFAULT_SCHEMA_SUFFIX, DEFAULT_TYPE_SUFFIX, type FileSink, type FormatOptions, type GeneratorFs, IMPORT_EXTENSIONS, type ImportExtension, JSON_VALUE_TS_CONST, JSON_VALUE_TS_SOURCE, type LengthCheck, type LengthMeasure, MAX_NESTED_DEPTH, type MetaFactOptions, NAME_MODES, NESTED_PREFIX, NUMERIC_CANON_NAME, NUMERIC_CANON_SOURCE, type NameMode, type NestedArm, type NestedMode, type NestedNode, type NullCheck, type ParsedCheck, type ResolvedAffix, type ResolvedBranding, type RowCheck, type Table, type TableCase, type TableConstraints, type TableMetaFacts, type TableMetaOptions, type UnenforcedLiteral, type UnenforcedPart, VALIBOT_JSON_CONST, VALIBOT_JSON_SOURCE, type ValidationGenerateOptions, type ValidationLibrary, type ValidationRenderer, type WireLiteralFit, type WireLiteralQuestion, applyTableCase, applyWirePolicy, buildBrandPlan, buildNestedPlan, canonicalMembers, canonicalNumericText, classifyTableChecks, codePointCompare, columnMetaFacts, comparisonWire, describeSet, fileWriter, formatCode, importSpecifier, insertColumns, isGeneratedColumn, isIntegerColumn, isProjectInstallPath, lengthCheckLabel, lengthMeasure, measureCompare, measureExpression, moduleFileName, moduleSpecifier, needsNumericCanon, nestedArmNotes, nestedNodeColumns, nestedSchemaName, nestedTypeName, nonFiniteAccepted, nonFiniteRefused, parseCheck, parsesToADate, pascalCase, renderConstraintsModule, renderDuplicateFinder, resolveAffix, resolveBranding, resolveConfiguredImport, resolveConstraints, resolveNestedDepth, schemaName, selectColumns, tableConstraints, tableMetaFacts, typeName, updateColumns, validateAffix, wireLiteralFit, wireNumberLiteral };
package/dist/index.js CHANGED
@@ -1698,6 +1698,15 @@ function parsesToADate(expr) {
1698
1698
  }
1699
1699
  var CODEPOINT_LENGTH = "[...v].length";
1700
1700
  var BIGINT_DIGITS_PATTERN = String.raw`/^-?\d+$/`;
1701
+ var JSON_VALUE_TS_CONST = "DrzlJsonValue";
1702
+ var JSON_VALUE_TS_SOURCE = `type ${JSON_VALUE_TS_CONST} =
1703
+ | string
1704
+ | number
1705
+ | boolean
1706
+ | null
1707
+ | ${JSON_VALUE_TS_CONST}[]
1708
+ | { [key: string]: ${JSON_VALUE_TS_CONST} };
1709
+ `;
1701
1710
  var VALIBOT_JSON_CONST = "DrzlJsonValue";
1702
1711
  var VALIBOT_JSON_SOURCE = `type ${VALIBOT_JSON_CONST}Type =
1703
1712
  | string
@@ -1900,6 +1909,8 @@ export {
1900
1909
  DEFAULT_SCHEMA_SUFFIX,
1901
1910
  DEFAULT_TYPE_SUFFIX,
1902
1911
  IMPORT_EXTENSIONS,
1912
+ JSON_VALUE_TS_CONST,
1913
+ JSON_VALUE_TS_SOURCE,
1903
1914
  MAX_NESTED_DEPTH,
1904
1915
  NAME_MODES,
1905
1916
  NESTED_PREFIX,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drzl/validation-core",
3
- "version": "3.22.5",
3
+ "version": "3.22.6",
4
4
  "private": false,
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",