@jskit-ai/assistant-voice 0.1.1 → 0.1.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/examples/conversation/package.json +8 -8
- package/package.json +1 -1
- package/examples/conversation/dist/assets/error-DOwCrGXH.js +0 -1
- package/examples/conversation/dist/assets/index-Bq1DwQwF.js +0 -90
- package/examples/conversation/dist/assets/index-Bw7_l3Cu.css +0 -1
- package/examples/conversation/dist/assets/placement-CUwf_TAl.js +0 -1
- package/examples/conversation/dist/assets/placementTopology-CUwf_TAl.js +0 -1
- package/examples/conversation/dist/index.html +0 -3
- package/examples/conversation/node_modules/.vite/deps/@jskit-ai_kernel_client_moduleBootstrap.js +0 -824
- package/examples/conversation/node_modules/.vite/deps/@jskit-ai_kernel_client_moduleBootstrap.js.map +0 -1
- package/examples/conversation/node_modules/.vite/deps/@mdi_js.js +0 -7450
- package/examples/conversation/node_modules/.vite/deps/@mdi_js.js.map +0 -1
- package/examples/conversation/node_modules/.vite/deps/@tanstack_vue-query.js +0 -3965
- package/examples/conversation/node_modules/.vite/deps/@tanstack_vue-query.js.map +0 -1
- package/examples/conversation/node_modules/.vite/deps/VTooltip-Nwckus73.js +0 -2311
- package/examples/conversation/node_modules/.vite/deps/VTooltip-Nwckus73.js.map +0 -1
- package/examples/conversation/node_modules/.vite/deps/_metadata.json +0 -110
- package/examples/conversation/node_modules/.vite/deps/defineComponent-Bx_4rnHZ.js +0 -710
- package/examples/conversation/node_modules/.vite/deps/defineComponent-Bx_4rnHZ.js.map +0 -1
- package/examples/conversation/node_modules/.vite/deps/dist-CUIjXXPV.js +0 -3878
- package/examples/conversation/node_modules/.vite/deps/dist-CUIjXXPV.js.map +0 -1
- package/examples/conversation/node_modules/.vite/deps/hotkey-parsing-B5h5TiMG.js +0 -1214
- package/examples/conversation/node_modules/.vite/deps/hotkey-parsing-B5h5TiMG.js.map +0 -1
- package/examples/conversation/node_modules/.vite/deps/icons-DPtxVIU0.js +0 -98
- package/examples/conversation/node_modules/.vite/deps/icons-DPtxVIU0.js.map +0 -1
- package/examples/conversation/node_modules/.vite/deps/json-rest-schema.js +0 -2071
- package/examples/conversation/node_modules/.vite/deps/json-rest-schema.js.map +0 -1
- package/examples/conversation/node_modules/.vite/deps/package.json +0 -3
- package/examples/conversation/node_modules/.vite/deps/pinia.js +0 -1453
- package/examples/conversation/node_modules/.vite/deps/pinia.js.map +0 -1
- package/examples/conversation/node_modules/.vite/deps/socket__io-client.js +0 -3899
- package/examples/conversation/node_modules/.vite/deps/socket__io-client.js.map +0 -1
- package/examples/conversation/node_modules/.vite/deps/theme-BSn2V8xv.js +0 -1301
- package/examples/conversation/node_modules/.vite/deps/theme-BSn2V8xv.js.map +0 -1
- package/examples/conversation/node_modules/.vite/deps/vue-router.js +0 -2989
- package/examples/conversation/node_modules/.vite/deps/vue-router.js.map +0 -1
- package/examples/conversation/node_modules/.vite/deps/vue.js +0 -2
- package/examples/conversation/node_modules/.vite/deps/vue.runtime.esm-bundler-DWdvffrK.js +0 -8890
- package/examples/conversation/node_modules/.vite/deps/vue.runtime.esm-bundler-DWdvffrK.js.map +0 -1
- package/examples/conversation/node_modules/.vite/deps/vuetify.js +0 -413
- package/examples/conversation/node_modules/.vite/deps/vuetify.js.map +0 -1
- package/examples/conversation/node_modules/.vite/deps/vuetify_components.js +0 -25370
- package/examples/conversation/node_modules/.vite/deps/vuetify_components.js.map +0 -1
- package/examples/conversation/node_modules/.vite/deps/vuetify_directives.js +0 -132
- package/examples/conversation/node_modules/.vite/deps/vuetify_directives.js.map +0 -1
- package/examples/conversation/node_modules/.vite/deps/vuetify_iconsets_mdi-svg.js +0 -70
- package/examples/conversation/node_modules/.vite/deps/vuetify_iconsets_mdi-svg.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json-rest-schema.js","names":["buildPathSegments","joinPath","isThenable","buildSafePathSegments","flatted.stringify","joinPath","buildPathSegments"],"sources":["../../../../../../../node_modules/json-rest-schema/src/utils/object-helpers.js","../../../../../../../node_modules/json-rest-schema/src/core/nested-contract.js","../../../../../../../node_modules/json-rest-schema/src/core/definition-helpers.js","../../../../../../../node_modules/json-rest-schema/src/core/temporal.js","../../../../../../../node_modules/json-rest-schema/src/utils/path-helpers.js","../../../../../../../node_modules/json-rest-schema/src/core/transport-schema.js","../../../../../../../node_modules/json-rest-schema/src/core/Schema.js","../../../../../../../node_modules/flatted/esm/index.js","../../../../../../../node_modules/json-rest-schema/src/core/CorePlugin.js","../../../../../../../node_modules/json-rest-schema/src/utils/error-helpers.js","../../../../../../../node_modules/json-rest-schema/src/index.js"],"sourcesContent":["/**\n * @file Shared object-shape helpers.\n */\n\nexport function isPlainObject (value) {\n if (value === null || typeof value !== 'object') return false\n\n const prototype = Object.getPrototypeOf(value)\n return (\n prototype === Object.prototype ||\n prototype === null ||\n isEmptyNullPrototypeRecord(prototype)\n )\n}\n\nfunction isEmptyNullPrototypeRecord (value) {\n return (\n value !== null &&\n typeof value === 'object' &&\n Object.getPrototypeOf(value) === null &&\n Reflect.ownKeys(value).length === 0\n )\n}\n","import { isPlainObject } from '../utils/object-helpers.js'\n\nfunction isSchemaLike (value) {\n return value !== null &&\n typeof value === 'object' &&\n isPlainObject(value.structure) &&\n isPlainObject(value.operations) &&\n typeof value.validateWith === 'function' &&\n typeof value.toJsonSchema === 'function' &&\n typeof value.cleanup === 'function'\n}\n\nexport function resolveArrayItemsConfig (fieldPath, definition) {\n if (!Object.hasOwn(definition, 'items')) return null\n\n const { items } = definition\n\n if (isSchemaLike(items)) {\n return { kind: 'schema', schema: items }\n }\n\n if (!isPlainObject(items) || typeof items.type !== 'string') {\n throw new Error(`Array field \"${fieldPath}\" must define items as either a Schema instance or a field definition object.`)\n }\n\n return { kind: 'definition', definition: items }\n}\n\nexport function resolveObjectValuesConfig (fieldPath, definition) {\n if (!Object.hasOwn(definition, 'values')) return null\n\n const { values } = definition\n\n if (isSchemaLike(values)) {\n return { kind: 'schema', schema: values }\n }\n\n if (!isPlainObject(values) || typeof values.type !== 'string') {\n throw new Error(`Object field \"${fieldPath}\" must define values as either a Schema instance or a field definition object.`)\n }\n\n return { kind: 'definition', definition: values }\n}\n\nexport function resolveObjectFieldMode (fieldPath, definition) {\n const hasNestedSchema = Object.hasOwn(definition, 'schema')\n const hasValues = Object.hasOwn(definition, 'values')\n const hasAdditionalProperties = Object.hasOwn(definition, 'additionalProperties')\n\n if (hasNestedSchema && hasValues) {\n throw new Error(`Object field \"${fieldPath}\" cannot define both schema and values.`)\n }\n\n if (hasAdditionalProperties && definition.additionalProperties !== true) {\n throw new Error(`Object field \"${fieldPath}\" only supports additionalProperties: true.`)\n }\n\n if (hasValues && definition.additionalProperties === true) {\n throw new Error(`Object field \"${fieldPath}\" cannot define both values and additionalProperties: true.`)\n }\n\n if (hasNestedSchema) {\n if (!isSchemaLike(definition.schema)) {\n throw new Error(`Object field \"${fieldPath}\" must define schema as a Schema instance.`)\n }\n\n return {\n kind: 'nested',\n schema: definition.schema,\n allowAdditionalProperties: definition.additionalProperties === true\n }\n }\n\n if (hasValues) {\n return {\n kind: 'map',\n valuesConfig: resolveObjectValuesConfig(fieldPath, definition)\n }\n }\n\n if (definition.additionalProperties === true) {\n return { kind: 'opaque' }\n }\n\n return { kind: 'plain' }\n}\n","/**\n * @file Shared schema-definition predicates used by runtime and transport code.\n */\n\nexport function isNumericDefinition (definition) {\n return definition?.type === 'number' ||\n definition?.type === 'integer' ||\n definition?.type === 'epochMilliseconds' ||\n definition?.type === 'epochSeconds'\n}\n","/**\n * @file Shared validation contracts for JSON-native temporal values.\n */\n\nexport const EPOCH_MILLISECONDS_LIMIT = 8640000000000000\nexport const EPOCH_SECONDS_LIMIT = 8640000000000\n\nexport const EPOCH_INTEGER_STRING_PATTERN = '^(?:0|-?[1-9]\\\\d*)$'\n\nconst YEAR_PATTERN = '\\\\d{4}'\nconst MONTH_PATTERN = '0[1-9]|1[0-2]'\nconst DAY_PATTERN = '0[1-9]|[12]\\\\d|3[01]'\nconst HOUR_PATTERN = '[01]\\\\d|2[0-3]'\nconst MINUTE_OR_SECOND_PATTERN = '[0-5]\\\\d'\nconst HOUR_MINUTE_PATTERN = `(?:${HOUR_PATTERN}):${MINUTE_OR_SECOND_PATTERN}`\nconst TIME_ZONE_PATTERN = `(?:Z|[+-](?:${HOUR_PATTERN}):${MINUTE_OR_SECOND_PATTERN})`\nconst CAPTURED_DATE_PATTERN = `(${YEAR_PATTERN})-(${MONTH_PATTERN})-(${DAY_PATTERN})`\nconst JSON_SCHEMA_DATE_PATTERN = `${YEAR_PATTERN}-(?:${MONTH_PATTERN})-(?:${DAY_PATTERN})`\n\nexport const DATE_JSON_SCHEMA_PATTERN = `^${JSON_SCHEMA_DATE_PATTERN}$`\n\nconst DATE_PATTERN = new RegExp(`^${CAPTURED_DATE_PATTERN}$`)\nconst TIME_PATTERN = new RegExp(`^${HOUR_MINUTE_PATTERN}(?::${MINUTE_OR_SECOND_PATTERN}(?:\\\\.(\\\\d+))?)?$`)\nconst DATE_TIME_PATTERN = new RegExp(`^${CAPTURED_DATE_PATTERN}T${HOUR_MINUTE_PATTERN}:${MINUTE_OR_SECOND_PATTERN}(?:\\\\.(\\\\d+))?${TIME_ZONE_PATTERN}$`)\nconst EPOCH_INTEGER_STRING = new RegExp(EPOCH_INTEGER_STRING_PATTERN)\nconst DAYS_PER_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]\n\nfunction isLeapYear (year) {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0)\n}\n\nfunction daysInMonth (year, month) {\n if (month === 2) return isLeapYear(year) ? 29 : 28\n return DAYS_PER_MONTH[month - 1]\n}\n\nfunction isValidCalendarDateParts (yearText, monthText, dayText) {\n const year = Number(yearText)\n const month = Number(monthText)\n const day = Number(dayText)\n\n return month >= 1 &&\n month <= 12 &&\n day >= 1 &&\n day <= daysInMonth(year, month)\n}\n\nexport function resolveTemporalPrecision (definition, fieldName) {\n const precision = definition.temporalPrecision\n if (precision === undefined) return undefined\n\n if (!Number.isInteger(precision) || precision < 0) {\n throw new Error(`temporalPrecision for \"${fieldName}\" must be a non-negative integer.`)\n }\n\n return precision\n}\n\nfunction hasAllowedFractionalPrecision (fraction, temporalPrecision) {\n if (fraction === undefined) return true\n return temporalPrecision === undefined || fraction.length <= temporalPrecision\n}\n\nexport function isValidDate (value) {\n if (typeof value !== 'string') return false\n const match = DATE_PATTERN.exec(value)\n return match !== null && isValidCalendarDateParts(match[1], match[2], match[3])\n}\n\nexport function isValidTime (value, temporalPrecision) {\n if (typeof value !== 'string') return false\n const match = TIME_PATTERN.exec(value)\n return match !== null && hasAllowedFractionalPrecision(match[1], temporalPrecision)\n}\n\nexport function isValidDateTime (value, temporalPrecision) {\n if (typeof value !== 'string') return false\n const match = DATE_TIME_PATTERN.exec(value)\n if (match === null) return false\n\n return isValidCalendarDateParts(match[1], match[2], match[3]) &&\n hasAllowedFractionalPrecision(match[4], temporalPrecision)\n}\n\nfunction fractionalPattern (temporalPrecision) {\n if (temporalPrecision === undefined) return '(?:\\\\.\\\\d+)?'\n if (temporalPrecision === 0) return ''\n return `(?:\\\\.\\\\d{1,${temporalPrecision}})?`\n}\n\nexport function timeJsonSchemaPattern (definition, fieldName) {\n const precision = resolveTemporalPrecision(definition, fieldName)\n return `^${HOUR_MINUTE_PATTERN}(?::${MINUTE_OR_SECOND_PATTERN}${fractionalPattern(precision)})?$`\n}\n\nexport function dateTimeJsonSchemaPattern (definition, fieldName) {\n const precision = resolveTemporalPrecision(definition, fieldName)\n return `^${JSON_SCHEMA_DATE_PATTERN}T${HOUR_MINUTE_PATTERN}:${MINUTE_OR_SECOND_PATTERN}${fractionalPattern(precision)}${TIME_ZONE_PATTERN}$`\n}\n\nexport function castEpochInteger (value, limit) {\n let integerValue\n\n if (typeof value === 'number') {\n integerValue = value\n } else if (typeof value === 'string' && EPOCH_INTEGER_STRING.test(value)) {\n integerValue = Number(value)\n } else {\n return null\n }\n\n if (\n !Number.isSafeInteger(integerValue) ||\n integerValue < -limit ||\n integerValue > limit\n ) {\n return null\n }\n\n return integerValue === 0 ? 0 : integerValue\n}\n","/**\n * @file Shared dotted-path helpers for schema errors and UI adapters.\n */\n\nconst UNSAFE_PATH_SEGMENTS = new Set(['__proto__', 'prototype', 'constructor'])\n\nexport function isObjectLike (value) {\n return value !== null && typeof value === 'object'\n}\n\nexport function isNumericSegment (segment) {\n return /^[0-9]+$/.test(segment)\n}\n\nexport function setOwnProperty (target, key, value) {\n Object.defineProperty(target, key, {\n value,\n enumerable: true,\n configurable: true,\n writable: true\n })\n}\n\nfunction assertSafePathSegment (segment, helperName) {\n if (UNSAFE_PATH_SEGMENTS.has(segment)) {\n throw new Error(`${helperName}() received unsafe path segment \"${segment}\".`)\n }\n}\n\nexport function normalizeFieldPath (path) {\n if (typeof path !== 'string') return path\n\n return path\n .replace(/\\[(.+?)\\]/g, '.$1')\n .replace(/^\\.+/, '')\n .replace(/\\.+/g, '.')\n .replace(/\\.$/, '')\n}\n\nexport function buildPathSegments (path, helperName, { normalize = false, allowEmpty = false } = {}) {\n const normalizedPath = normalize ? normalizeFieldPath(path) : path\n\n if (typeof normalizedPath !== 'string' || normalizedPath.trim() === '') {\n if (allowEmpty && normalizedPath === '') return []\n throw new Error(`${helperName}() expects a non-empty dotted path string.`)\n }\n\n const segments = normalizedPath.split('.')\n if (segments.some(segment => segment === '')) {\n throw new Error(`${helperName}() received an invalid path \"${normalizedPath}\".`)\n }\n\n for (const segment of segments) {\n assertSafePathSegment(segment, helperName)\n }\n\n return segments\n}\n\nexport function joinPath (basePath, pathSegment) {\n return basePath === '' ? String(pathSegment) : `${basePath}.${String(pathSegment)}`\n}\n\nexport function uniqueNormalizedPaths (paths = []) {\n return [...new Set(\n paths\n .map(path => normalizeFieldPath(path))\n .filter(path => typeof path === 'string' && path !== '')\n .map(path => buildPathSegments(path, 'normalizeFieldPath').join('.'))\n )]\n}\n\nexport function pathToSegments (path) {\n return buildPathSegments(path, 'pathToSegments', { normalize: true, allowEmpty: true })\n .map(segment => (isNumericSegment(segment) ? Number(segment) : segment))\n}\n\nfunction createContainer (nextSegment) {\n return isNumericSegment(nextSegment) ? [] : {}\n}\n\nexport function getNestedValue (target, path) {\n const segments = buildPathSegments(path, 'getNestedValue', { normalize: true, allowEmpty: true })\n\n if (segments.length === 0) return target\n\n let currentNode = target\n\n for (const segment of segments) {\n if (currentNode === null || currentNode === undefined) return undefined\n if (!isObjectLike(currentNode)) return undefined\n if (!Object.hasOwn(currentNode, segment)) return undefined\n currentNode = currentNode[segment]\n }\n\n return currentNode\n}\n\nexport function setNestedValue (target, path, value) {\n const segments = buildPathSegments(path, 'setNestedValue', { normalize: true })\n let currentNode = target\n\n for (let index = 0; index < segments.length; index++) {\n const segment = segments[index]\n const isLast = index === segments.length - 1\n\n if (isLast) {\n setOwnProperty(currentNode, segment, value)\n return\n }\n\n if (!Object.hasOwn(currentNode, segment) || currentNode[segment] === null || !isObjectLike(currentNode[segment])) {\n setOwnProperty(currentNode, segment, createContainer(segments[index + 1]))\n }\n\n currentNode = currentNode[segment]\n }\n}\n","import {\n resolveArrayItemsConfig,\n resolveObjectFieldMode,\n resolveObjectValuesConfig\n} from './nested-contract.js'\nimport { isNumericDefinition } from './definition-helpers.js'\nimport {\n DATE_JSON_SCHEMA_PATTERN,\n dateTimeJsonSchemaPattern,\n EPOCH_INTEGER_STRING_PATTERN,\n EPOCH_MILLISECONDS_LIMIT,\n EPOCH_SECONDS_LIMIT,\n timeJsonSchemaPattern\n} from './temporal.js'\nimport { isPlainObject } from '../utils/object-helpers.js'\nimport { setOwnProperty } from '../utils/path-helpers.js'\n\nconst JSON_SCHEMA_DRAFT_07 = 'http://json-schema.org/draft-07/schema#'\nconst JSON_REST_EXTENSION_KEY = 'x-json-rest-schema'\nconst NON_NULL_JSON_TYPES = ['object', 'array', 'string', 'number', 'boolean']\nconst EXPORT_CONTEXT_KEY = Symbol('json-rest-schema.exportContext')\n\nconst BOOLEAN_TRUE_VALUES = ['true', '1', 'yes', 'y', 'on']\nconst BOOLEAN_FALSE_VALUES = ['false', '0', 'no', 'n', 'off']\n\nfunction epochIntegerSchema (limit) {\n return {\n anyOf: [\n { type: 'integer', minimum: -limit, maximum: limit },\n { type: 'string', pattern: EPOCH_INTEGER_STRING_PATTERN }\n ]\n }\n}\n\nfunction extensionMetadataFragment (section, values) {\n return {\n [JSON_REST_EXTENSION_KEY]: {\n [section]: values\n }\n }\n}\n\nconst BUILTIN_TYPE_EXPORTERS = {\n none: () => ({ type: NON_NULL_JSON_TYPES }),\n blob: () => ({ type: NON_NULL_JSON_TYPES }),\n serialize: () => ({ type: NON_NULL_JSON_TYPES }),\n object: () => ({ type: 'object' }),\n array: () => ({ type: 'array' }),\n file: () => ({ type: 'string' }),\n string: () => ({ type: 'string' }),\n number: () => ({ type: ['number', 'string'] }),\n integer: () => ({ type: ['integer', 'string'] }),\n epochMilliseconds: () => epochIntegerSchema(EPOCH_MILLISECONDS_LIMIT),\n epochSeconds: () => epochIntegerSchema(EPOCH_SECONDS_LIMIT),\n dateTime: ({ definition, fieldName }) => ({\n type: 'string',\n format: 'date-time',\n pattern: dateTimeJsonSchemaPattern(definition, fieldName)\n }),\n date: () => ({\n type: 'string',\n format: 'date',\n pattern: DATE_JSON_SCHEMA_PATTERN\n }),\n time: ({ definition, fieldName }) => ({\n type: 'string',\n pattern: timeJsonSchemaPattern(definition, fieldName)\n }),\n boolean: ({ definition }) => {\n if (definition.strictBoolean === true) {\n return { type: 'boolean' }\n }\n\n const trueValues = new Set([...BOOLEAN_TRUE_VALUES, String(definition.stringTrueWhen || 'true').trim().toLowerCase()])\n const falseValues = new Set([...BOOLEAN_FALSE_VALUES, String(definition.stringFalseWhen || 'false').trim().toLowerCase()])\n\n return {\n anyOf: [\n { type: 'boolean' },\n { type: 'number', enum: [0, 1] },\n { type: 'string', enum: [...falseValues, ...trueValues] }\n ]\n }\n },\n id: () => ({\n type: ['integer', 'string'],\n minimum: 1,\n pattern: '^[1-9][0-9]*$'\n })\n}\n\nconst BUILTIN_VALIDATOR_EXPORTERS = {\n minLength: ({ definition, parameterValue }) => definition.type === 'string' ? { minLength: parameterValue } : null,\n maxLength: ({ definition, parameterValue }) => definition.type === 'string' ? { maxLength: parameterValue } : null,\n min: ({ definition, parameterValue }) => isNumericDefinition(definition) ? { minimum: parameterValue } : null,\n max: ({ definition, parameterValue }) => isNumericDefinition(definition) ? { maximum: parameterValue } : null,\n pattern: ({ definition, parameterValue }) => definition.type === 'string'\n ? { pattern: parameterValue instanceof RegExp ? parameterValue.source : parameterValue }\n : null,\n enum: ({ parameterValue }) => ({ enum: parameterValue }),\n notEmpty: ({ parameterValue, definition }) => {\n if (!parameterValue) return null\n if (definition.type === 'array') return null\n return { minLength: 1 }\n },\n uppercase: ({ parameterValue }) => parameterValue ? extensionMetadataFragment('transforms', { uppercase: true }) : null,\n lowercase: ({ parameterValue }) => parameterValue ? extensionMetadataFragment('transforms', { lowercase: true }) : null,\n length: ({ parameterValue }) => extensionMetadataFragment('transforms', { length: parameterValue }),\n unsigned: ({ parameterValue }) => parameterValue ? extensionMetadataFragment('metadata', { unsigned: true }) : null,\n precision: ({ parameterValue }) => extensionMetadataFragment('metadata', { precision: parameterValue }),\n scale: ({ parameterValue }) => extensionMetadataFragment('metadata', { scale: parameterValue }),\n temporalPrecision: ({ parameterValue }) => extensionMetadataFragment('metadata', { temporalPrecision: parameterValue }),\n strictBoolean: () => null,\n required: () => null,\n nullable: () => null,\n nullOnEmpty: () => null,\n defaultTo: () => null\n}\n\nfunction mergePlainObjects (target, source) {\n for (const key of Object.keys(source)) {\n const sourceValue = source[key]\n const targetValue = target[key]\n\n if (\n sourceValue &&\n targetValue &&\n typeof sourceValue === 'object' &&\n typeof targetValue === 'object' &&\n !Array.isArray(sourceValue) &&\n !Array.isArray(targetValue)\n ) {\n mergePlainObjects(targetValue, sourceValue)\n continue\n }\n\n target[key] = sourceValue\n }\n}\n\nfunction mergeSchemaFragment (target, fragment) {\n if (!fragment || typeof fragment !== 'object' || Array.isArray(fragment)) {\n throw new Error('JSON Schema export hooks must return an object or null.')\n }\n\n for (const key of Object.keys(fragment)) {\n if (\n key === JSON_REST_EXTENSION_KEY &&\n target[key] &&\n typeof target[key] === 'object' &&\n typeof fragment[key] === 'object' &&\n !Array.isArray(target[key]) &&\n !Array.isArray(fragment[key])\n ) {\n mergePlainObjects(target[key], fragment[key])\n continue\n }\n\n target[key] = fragment[key]\n }\n}\n\nfunction buildAnyOfSchema (baseSchema, alternatives) {\n const baseAlternatives = (\n Array.isArray(baseSchema.anyOf) &&\n Object.keys(baseSchema).length === 1\n )\n ? baseSchema.anyOf\n : [baseSchema]\n\n const finalAlternatives = [...baseAlternatives, ...alternatives]\n if (finalAlternatives.length === 1) {\n return baseSchema\n }\n\n return { anyOf: finalAlternatives }\n}\n\nfunction getTypeExporter (schema, definition) {\n if (!Object.hasOwn(schema.types, definition.type)) {\n throw new Error(`No casting function for type: ${definition.type}`)\n }\n const handler = schema.types[definition.type]\n\n if (typeof handler.toJsonSchema === 'function') {\n return handler.toJsonSchema\n }\n\n const exporter = BUILTIN_TYPE_EXPORTERS[definition.type]\n if (!exporter) {\n throw new Error(`Type '${definition.type}' cannot be exported to JSON Schema without a toJsonSchema hook.`)\n }\n\n return exporter\n}\n\nfunction getValidatorExporter (schema, parameterName, fieldName) {\n if (!Object.hasOwn(schema.validators, parameterName)) return null\n const handler = schema.validators[parameterName]\n\n if (typeof handler.toJsonSchema === 'function') {\n return handler.toJsonSchema\n }\n\n const exporter = BUILTIN_VALIDATOR_EXPORTERS[parameterName]\n if (exporter) {\n return exporter\n }\n\n throw new Error(`Validator '${parameterName}' on field '${fieldName}' cannot be exported to JSON Schema without a toJsonSchema hook.`)\n}\n\nfunction normalizeMode (mode) {\n if (mode === undefined) return 'create'\n if (['create', 'replace', 'patch'].includes(mode)) return mode\n throw new Error(`Unsupported JSON Schema export mode '${mode}'. Expected 'create', 'replace', or 'patch'.`)\n}\n\nfunction resolveOperationName (schema, options = {}) {\n if (options.mode !== undefined && options.operation !== undefined) {\n const normalizedMode = normalizeMode(options.mode)\n if (normalizedMode !== options.operation) {\n throw new Error(`Conflicting JSON Schema export options: mode '${normalizedMode}' does not match operation '${options.operation}'.`)\n }\n }\n\n if (options.operation !== undefined) {\n if (!Object.hasOwn(schema.operations, options.operation)) {\n throw new Error(`Unknown JSON Schema export operation '${options.operation}'.`)\n }\n return options.operation\n }\n\n return normalizeMode(options.mode)\n}\n\nfunction resolveExportOperation (schema, options = {}) {\n if (options.operationName !== undefined && options.operationDescriptor !== undefined) {\n return {\n operationName: options.operationName,\n operation: options.operationDescriptor\n }\n }\n\n const operationName = resolveOperationName(schema, options)\n return {\n operationName,\n operation: schema.operations[operationName]\n }\n}\n\nfunction createExportOptions (options = {}) {\n const exportOptions = { ...options }\n Object.defineProperty(exportOptions, EXPORT_CONTEXT_KEY, {\n value: {\n definitions: {},\n nodes: [],\n nextDefinitionId: 1,\n rootNode: null\n },\n enumerable: false\n })\n return exportOptions\n}\n\nfunction getExportContext (options = {}) {\n if (options[EXPORT_CONTEXT_KEY]) {\n return options[EXPORT_CONTEXT_KEY]\n }\n\n return {\n definitions: {},\n nodes: [],\n nextDefinitionId: 1,\n rootNode: null\n }\n}\n\nfunction sanitizeDefinitionNamePart (value) {\n const sanitized = String(value)\n .replace(/[^a-zA-Z0-9]+/g, '_')\n .replace(/^_+|_+$/g, '')\n\n return sanitized || 'operation'\n}\n\nfunction isReferenceOnlySchema (schema) {\n return isPlainObject(schema) &&\n Object.keys(schema).length === 1 &&\n typeof schema.$ref === 'string'\n}\n\nfunction wrapReferenceSchema (schema) {\n if (!isReferenceOnlySchema(schema)) {\n return schema\n }\n\n return {\n allOf: [schema]\n }\n}\n\nfunction findExportNode (exportContext, schema, operationName, operation, additionalProperties) {\n return exportContext.nodes.find((node) => (\n node.schema === schema &&\n node.operationName === operationName &&\n node.operation === operation &&\n node.additionalProperties === additionalProperties\n )) || null\n}\n\nfunction createDefinitionName (exportContext, operationName) {\n const suffix = sanitizeDefinitionNamePart(operationName)\n const definitionName = `SchemaNode_${exportContext.nextDefinitionId}_${suffix}`\n exportContext.nextDefinitionId += 1\n return definitionName\n}\n\nfunction getOrCreateExportNode (schema, options, operationName, operation, additionalProperties, { root = false } = {}) {\n const exportContext = getExportContext(options)\n const existingNode = findExportNode(exportContext, schema, operationName, operation, additionalProperties)\n\n if (existingNode) {\n if (root) {\n existingNode.pointer = '#'\n exportContext.rootNode = existingNode\n }\n return existingNode\n }\n\n const node = {\n schema,\n operationName,\n operation,\n additionalProperties,\n status: 'new',\n definitionName: root ? null : createDefinitionName(exportContext, operationName),\n pointer: root ? '#' : null\n }\n\n if (!root) {\n node.pointer = `#/definitions/${node.definitionName}`\n } else {\n exportContext.rootNode = node\n }\n\n exportContext.nodes.push(node)\n return node\n}\n\nfunction buildExportNodeSchema (node, options) {\n if (node.status === 'built') {\n return {\n $ref: node.pointer\n }\n }\n\n if (node.status === 'building') {\n return {\n $ref: node.pointer\n }\n }\n\n const exportContext = getExportContext(options)\n node.status = 'building'\n if (node.pointer !== '#') {\n exportContext.definitions[node.definitionName] = {}\n }\n\n const objectSchema = buildSchemaObjectFragment(\n node.schema,\n options,\n node.operationName,\n node.operation,\n node.additionalProperties\n )\n\n node.status = 'built'\n\n if (node.pointer === '#') {\n return objectSchema\n }\n\n exportContext.definitions[node.definitionName] = objectSchema\n\n return {\n $ref: node.pointer\n }\n}\n\nfunction buildSchemaReference (schema, options, operationName, operation, additionalProperties = false) {\n const exportContext = getExportContext(options)\n const node = getOrCreateExportNode(schema, options, operationName, operation, additionalProperties)\n\n if (exportContext.rootNode === node) {\n return { $ref: '#' }\n }\n\n return buildExportNodeSchema(node, options)\n}\n\nfunction createFieldSchemaState (schema, { referenceBacked = false } = {}) {\n return {\n schema,\n referenceBacked\n }\n}\n\nfunction buildSchemaObjectFragment (schema, options, operationName, operation, additionalProperties = false) {\n const properties = {}\n const required = []\n\n for (const [fieldName, definition] of Object.entries(schema.structure)) {\n setOwnProperty(properties, fieldName, buildFieldSchema(schema, fieldName, definition, options, operationName, operation))\n if (operation.enforceRequired && definition.required === true) {\n required.push(fieldName)\n }\n }\n\n const objectSchema = {\n type: 'object',\n properties,\n additionalProperties\n }\n\n if (required.length > 0) {\n objectSchema.required = required\n }\n\n return objectSchema\n}\n\nfunction buildArrayItemsSchema (schema, fieldName, definition, options, operationName, operation) {\n const itemsConfig = resolveArrayItemsConfig(fieldName, definition)\n if (!itemsConfig) return null\n\n if (itemsConfig.kind === 'schema') {\n return {\n ...wrapReferenceSchema(buildSchemaReference(\n itemsConfig.schema,\n options,\n 'replace',\n itemsConfig.schema.operations.replace,\n false\n )),\n [JSON_REST_EXTENSION_KEY]: { castType: 'object' }\n }\n }\n\n const itemOperationName = (\n definition.items.type === 'object' && Object.hasOwn(definition.items, 'schema')\n )\n ? 'replace'\n : operationName\n\n const itemOperation = itemOperationName === 'replace'\n ? schema.operations.replace\n : operation\n\n return buildFieldSchema(schema, `${fieldName}[]`, definition.items, options, itemOperationName, itemOperation)\n}\n\nfunction buildObjectValuesSchema (schema, fieldName, definition, options, operationName, operation) {\n const valuesConfig = resolveObjectValuesConfig(fieldName, definition)\n if (!valuesConfig) return null\n\n if (valuesConfig.kind === 'schema') {\n return {\n ...wrapReferenceSchema(buildSchemaReference(\n valuesConfig.schema,\n options,\n 'replace',\n valuesConfig.schema.operations.replace,\n false\n )),\n [JSON_REST_EXTENSION_KEY]: { castType: 'object' }\n }\n }\n\n const valueOperationName = (\n valuesConfig.definition.type === 'object' && Object.hasOwn(valuesConfig.definition, 'schema')\n )\n ? 'replace'\n : operationName\n\n const valueOperation = valueOperationName === 'replace'\n ? schema.operations.replace\n : operation\n\n return buildFieldSchema(schema, `${fieldName}.*`, valuesConfig.definition, options, valueOperationName, valueOperation)\n}\n\nfunction buildBaseFieldSchema (schema, fieldName, definition, options, operationName, operation) {\n if (definition.type === 'object') {\n const objectMode = resolveObjectFieldMode(fieldName, definition)\n\n if (objectMode.kind === 'nested') {\n return createFieldSchemaState(\n buildSchemaReference(\n objectMode.schema,\n options,\n operationName,\n operation,\n objectMode.allowAdditionalProperties === true\n ),\n { referenceBacked: true }\n )\n }\n\n if (objectMode.kind === 'opaque') {\n return createFieldSchemaState({\n type: 'object',\n additionalProperties: true\n })\n }\n\n if (objectMode.kind === 'map') {\n return createFieldSchemaState({\n type: 'object',\n additionalProperties: buildObjectValuesSchema(schema, fieldName, definition, options, operationName, operation)\n })\n }\n }\n\n const baseSchema = getTypeExporter(schema, definition)({\n schema,\n fieldName,\n definition,\n operation: operationName,\n mode: operationName,\n options\n })\n\n if (!baseSchema || typeof baseSchema !== 'object' || Array.isArray(baseSchema)) {\n throw new Error(`Type '${definition.type}' on field '${fieldName}' returned an invalid JSON Schema fragment.`)\n }\n\n if (definition.type === 'array') {\n const itemsSchema = buildArrayItemsSchema(schema, fieldName, definition, options, operationName, operation)\n if (itemsSchema) {\n return createFieldSchemaState({\n ...baseSchema,\n items: itemsSchema\n }, { referenceBacked: isReferenceOnlySchema(baseSchema) })\n }\n }\n\n return createFieldSchemaState(baseSchema, {\n referenceBacked: isReferenceOnlySchema(baseSchema)\n })\n}\n\nfunction buildFieldSchema (schema, fieldName, definition, options, operationName, operation) {\n const exportContext = {\n schema,\n fieldName,\n definition,\n operation: operationName,\n mode: operationName,\n options\n }\n\n const baseFieldSchemaState = buildBaseFieldSchema(schema, fieldName, definition, options, operationName, operation)\n const workingSchema = baseFieldSchemaState.referenceBacked\n ? wrapReferenceSchema(baseFieldSchemaState.schema)\n : { ...baseFieldSchemaState.schema }\n const extensionMetadata = { castType: definition.type }\n\n for (const parameterName of Object.keys(definition)) {\n if (parameterName === 'type') continue\n if (!Object.hasOwn(schema.validators, parameterName)) continue\n\n const exporter = getValidatorExporter(schema, parameterName, fieldName)\n if (!exporter) continue\n\n const fragment = exporter({\n ...exportContext,\n parameterName,\n parameterValue: definition[parameterName],\n fieldSchema: { ...workingSchema }\n })\n\n if (!fragment) continue\n mergeSchemaFragment(workingSchema, fragment)\n }\n\n if (workingSchema[JSON_REST_EXTENSION_KEY]) {\n mergePlainObjects(extensionMetadata, workingSchema[JSON_REST_EXTENSION_KEY])\n delete workingSchema[JSON_REST_EXTENSION_KEY]\n }\n\n const alternatives = []\n\n if (definition.nullable === true) {\n alternatives.push({ type: 'null' })\n }\n\n if (definition.nullOnEmpty === true) {\n alternatives.push({ const: '' })\n }\n\n const finalSchema = wrapReferenceSchema(buildAnyOfSchema(workingSchema, alternatives))\n\n if (definition.defaultTo !== undefined && operation.applyDefaults) {\n if (typeof definition.defaultTo !== 'function') {\n const defaultResult = schema._normalizeDefault(\n definition,\n definition.defaultTo,\n {\n fieldPath: fieldName,\n currentObject: {},\n containerKey: fieldName,\n objectBeforeCast: {},\n options: {},\n settings: schema._buildOperationSettings(operationName, operation, {})\n }\n )\n\n if (Object.keys(defaultResult.errors).length > 0) {\n const firstError = Object.values(defaultResult.errors)[0]\n throw new Error(`defaultTo for \"${fieldName}\" is invalid (${firstError.code}).`)\n }\n\n finalSchema.default = defaultResult.value\n } else {\n extensionMetadata.defaults = { providedByFunction: true }\n }\n }\n\n finalSchema[JSON_REST_EXTENSION_KEY] = extensionMetadata\n return finalSchema\n}\n\nexport function buildJsonSchema (schema, options = {}) {\n const exportOptions = createExportOptions(options)\n const { operationName, operation } = resolveExportOperation(schema, exportOptions)\n const additionalProperties = exportOptions.additionalProperties === undefined ? false : exportOptions.additionalProperties\n const exportContext = getExportContext(exportOptions)\n const rootNode = getOrCreateExportNode(\n schema,\n exportOptions,\n operationName,\n operation,\n additionalProperties,\n { root: true }\n )\n\n const transportSchema = {\n $schema: JSON_SCHEMA_DRAFT_07,\n ...buildExportNodeSchema(rootNode, exportOptions)\n }\n\n if (Object.keys(exportContext.definitions).length > 0) {\n transportSchema.definitions = exportContext.definitions\n }\n\n return transportSchema\n}\n","/**\n * @file Defines the Schema class, which contains the core validation engine.\n */\n\n/**\n * @typedef {object} ValidationError\n * @property {string} field - The name of the field that failed validation.\n * @property {string} code - A stable, machine-readable error code (e.g., 'MIN_LENGTH').\n * @property {string} message - The human-readable error message.\n * @property {object} [params] - A key-value object with context about the error (e.g., { min: 3, actual: 2 }).\n */\n\n/**\n * @typedef {object} ValidationContext\n * @property {Schema} schema - The current schema instance.\n * @property {object} definition - The schema definition for the specific field.\n * @property {any} value - The current value of the field being processed.\n * @property {string} fieldName - The name of the field.\n * @property {object} object - The full object being validated (with modifications).\n * @property {object} objectBeforeCast - The original, unmodified input object.\n * @property {any} valueBeforeCast - The original value of the field.\n * @property {object} options - The global validation options.\n * @property {string} mode - The active validation contract. Preserved as a compatibility alias for `operation`.\n * @property {string} operation - The active validation contract name.\n * @property {boolean} fieldPresent - Whether the field was explicitly present in the input object.\n * @property {{nullable: boolean, nullOnEmpty: boolean}} computedOptions - Calculated options.\n * @property {string} [parameterName] - The name of the validator parameter being processed.\n * @property {any} [parameterValue] - The value of the validator parameter.\n * @property {function(): void} throwTypeError - Throws a standardized type casting error.\n * @property {function(string, string, object=): void} throwParamError - Throws a standardized parameter validation error.\n */\n\nimport { buildJsonSchema } from './transport-schema.js'\nimport {\n resolveArrayItemsConfig,\n resolveObjectFieldMode,\n resolveObjectValuesConfig\n} from './nested-contract.js'\nimport {\n buildPathSegments as buildSafePathSegments,\n setOwnProperty\n} from '../utils/path-helpers.js'\nimport { isPlainObject } from '../utils/object-helpers.js'\n\nfunction isThenable (value) {\n return value !== null &&\n (typeof value === 'object' || typeof value === 'function') &&\n typeof value.then === 'function'\n}\n\nfunction isSchemaInstance (value) {\n return value instanceof Schema\n}\n\nfunction createSelectionNode () {\n return {\n self: false,\n children: {}\n }\n}\n\nfunction hasSelectionChildren (selectionNode) {\n return Object.keys(selectionNode.children).length > 0\n}\n\nfunction joinPath (basePath, pathSegment) {\n return `${basePath}.${String(pathSegment)}`\n}\n\nfunction buildFieldPath (basePath, fieldName) {\n return basePath === '' ? String(fieldName) : joinPath(basePath, fieldName)\n}\n\nfunction stripPathPrefix (path, prefix) {\n if (path === prefix) return ''\n\n const prefixWithDot = `${prefix}.`\n if (!path.startsWith(prefixWithDot)) return null\n\n return path.slice(prefixWithDot.length)\n}\n\nfunction prefixErrorMap (errors, prefix) {\n const prefixedErrors = {}\n\n for (const error of Object.values(errors)) {\n const field = joinPath(prefix, error.field)\n setOwnProperty(prefixedErrors, field, { ...error, field })\n }\n\n return prefixedErrors\n}\n\nfunction buildPathSegments (path) {\n return buildSafePathSegments(path, 'validatePath')\n}\n\nfunction buildSelectionTree (paths) {\n const selectionTree = {}\n\n for (const path of paths) {\n const segments = buildPathSegments(path)\n let currentTree = selectionTree\n\n for (let index = 0; index < segments.length; index++) {\n const segment = segments[index]\n\n if (!Object.hasOwn(currentTree, segment)) {\n setOwnProperty(currentTree, segment, createSelectionNode())\n }\n\n if (index === segments.length - 1) {\n currentTree[segment].self = true\n }\n\n currentTree = currentTree[segment].children\n }\n }\n\n return selectionTree\n}\n\nfunction getValueAtPath (value, pathSegments) {\n let currentValue = value\n\n for (const segment of pathSegments) {\n if (currentValue === null || currentValue === undefined) return undefined\n if (typeof currentValue !== 'object') return undefined\n if (!Object.hasOwn(currentValue, segment)) return undefined\n currentValue = currentValue[segment]\n }\n\n return currentValue\n}\n\nfunction hasSelectedValue (value) {\n if (value === null) return true\n if (Array.isArray(value)) return Object.keys(value).length > 0\n if (isPlainObject(value)) return Object.keys(value).length > 0\n return value !== undefined\n}\n\nfunction sortSelectionKeys (keys) {\n return [...keys].sort((left, right) => {\n const leftIsIndex = /^[0-9]+$/.test(left)\n const rightIsIndex = /^[0-9]+$/.test(right)\n\n if (leftIsIndex && rightIsIndex) return Number(left) - Number(right)\n if (leftIsIndex) return -1\n if (rightIsIndex) return 1\n return left.localeCompare(right)\n })\n}\n\nfunction isNumericPathSegment (segment) {\n return /^[0-9]+$/.test(segment)\n}\n\nfunction cloneSchemaIntrospectionSnapshot (schema, seen = new WeakMap()) {\n if (seen.has(schema)) return seen.get(schema)\n\n const snapshot = Object.create(Schema.prototype)\n seen.set(schema, snapshot)\n\n snapshot.structure = null\n snapshot.types = schema.types\n snapshot.validators = schema.validators\n snapshot.operations = schema.operations\n\n snapshot.structure = freezeIntrospectionValue(cloneIntrospectionValue(schema.structure, seen))\n snapshot._installOperationMethods()\n\n return Object.freeze(snapshot)\n}\n\nfunction cloneIntrospectionValue (value, seen = new WeakMap()) {\n if (value === null || typeof value !== 'object') return value\n if (isSchemaInstance(value)) return cloneSchemaIntrospectionSnapshot(value, seen)\n if (value instanceof Date) return new Date(value.getTime())\n if (value instanceof RegExp) {\n const cloned = new RegExp(value.source, value.flags)\n cloned.lastIndex = value.lastIndex\n return cloned\n }\n if (seen.has(value)) return seen.get(value)\n\n if (Array.isArray(value)) {\n const cloned = []\n seen.set(value, cloned)\n for (const item of value) {\n cloned.push(cloneIntrospectionValue(item, seen))\n }\n return cloned\n }\n\n if (!isPlainObject(value)) return value\n\n const cloned = {}\n seen.set(value, cloned)\n for (const [key, entry] of Object.entries(value)) {\n setOwnProperty(cloned, key, cloneIntrospectionValue(entry, seen))\n }\n return cloned\n}\n\nfunction freezeIntrospectionValue (value, seen = new WeakSet()) {\n if (value === null || typeof value !== 'object' || seen.has(value) || isSchemaInstance(value)) {\n return value\n }\n\n seen.add(value)\n\n if (Array.isArray(value)) {\n for (const item of value) {\n freezeIntrospectionValue(item, seen)\n }\n } else {\n for (const key of Reflect.ownKeys(value)) {\n freezeIntrospectionValue(value[key], seen)\n }\n }\n\n return Object.freeze(value)\n}\n\nfunction createIntrospectionSnapshot (value) {\n return freezeIntrospectionValue(cloneIntrospectionValue(value))\n}\n\nfunction resolveDefinitionFromSchemaPath (schema, pathSegments, basePath = '') {\n if (!isSchemaInstance(schema)) return null\n if (!Array.isArray(pathSegments) || pathSegments.length < 1) return null\n\n const [fieldName, ...rest] = pathSegments\n if (!Object.hasOwn(schema.structure, fieldName)) return null\n const definition = schema.structure[fieldName]\n\n if (rest.length < 1) return definition\n\n const fieldPath = buildFieldPath(basePath, fieldName)\n return resolveNestedDefinitionAtPath(schema, definition, rest, fieldPath)\n}\n\nfunction resolveNestedDefinitionAtPath (schema, definition, pathSegments, fieldPath) {\n if (definition?.type === 'object') {\n const objectMode = schema._resolveObjectFieldMode(fieldPath, definition)\n if (objectMode.kind !== 'nested') return null\n return resolveDefinitionFromSchemaPath(objectMode.schema, pathSegments, fieldPath)\n }\n\n if (definition?.type === 'array') {\n const itemsConfig = schema._resolveArrayItemsConfig(fieldPath, definition)\n if (!itemsConfig || pathSegments.length < 1) return null\n\n const [indexSegment, ...rest] = pathSegments\n if (!isNumericPathSegment(indexSegment)) return null\n\n const itemPath = joinPath(fieldPath, indexSegment)\n if (itemsConfig.kind === 'schema') {\n if (rest.length < 1) return null\n return resolveDefinitionFromSchemaPath(itemsConfig.schema, rest, itemPath)\n }\n\n if (rest.length < 1) return itemsConfig.definition\n return resolveNestedDefinitionAtPath(schema, itemsConfig.definition, rest, itemPath)\n }\n\n return null\n}\n\nfunction buildNestedOptions (options, prefix) {\n const nestedOptions = { ...options }\n\n if (Array.isArray(options.skipFields)) {\n const skipFields = options.skipFields\n .map(fieldPath => stripPathPrefix(fieldPath, prefix))\n .filter(fieldPath => fieldPath !== null && fieldPath !== '')\n\n if (skipFields.length > 0) nestedOptions.skipFields = skipFields\n else delete nestedOptions.skipFields\n }\n\n if (isPlainObject(options.skipParams)) {\n const skipParams = {}\n\n for (const [fieldPath, parameters] of Object.entries(options.skipParams)) {\n const nestedFieldPath = stripPathPrefix(fieldPath, prefix)\n if (nestedFieldPath === null || nestedFieldPath === '') continue\n setOwnProperty(skipParams, nestedFieldPath, parameters)\n }\n\n if (Object.keys(skipParams).length > 0) nestedOptions.skipParams = skipParams\n else delete nestedOptions.skipParams\n }\n\n return nestedOptions\n}\n\nconst DEFAULT_OPERATIONS = Object.freeze({\n create: Object.freeze({\n targetFields: 'schema',\n enforceRequired: true,\n applyDefaults: true,\n outputFields: 'validated',\n rejectExplicitUndefined: true\n }),\n replace: Object.freeze({\n targetFields: 'schema',\n enforceRequired: true,\n applyDefaults: true,\n outputFields: 'validated',\n rejectExplicitUndefined: true\n }),\n patch: Object.freeze({\n targetFields: 'input',\n enforceRequired: false,\n applyDefaults: false,\n outputFields: 'input',\n rejectExplicitUndefined: true\n })\n})\n\nfunction validateOperationOption (operationName, descriptor, key, allowedValues) {\n const value = descriptor[key]\n if (!allowedValues.includes(value)) {\n throw new Error(`Operation \"${operationName}\" must define ${key} as one of: ${allowedValues.join(', ')}.`)\n }\n}\n\nfunction validateBooleanOperationOption (operationName, descriptor, key, required = true) {\n const value = descriptor[key]\n if (value === undefined && !required) return\n if (typeof value !== 'boolean') {\n throw new Error(`Operation \"${operationName}\" must define ${key} as a boolean.`)\n }\n}\n\nfunction normalizeOperationDescriptor (operationName, descriptor) {\n if (typeof descriptor !== 'object' || descriptor === null || Array.isArray(descriptor)) {\n throw new Error(`Operation \"${operationName}\" must be an object.`)\n }\n\n validateOperationOption(operationName, descriptor, 'targetFields', ['schema', 'input'])\n validateBooleanOperationOption(operationName, descriptor, 'enforceRequired')\n validateBooleanOperationOption(operationName, descriptor, 'applyDefaults')\n validateOperationOption(operationName, descriptor, 'outputFields', ['validated', 'input'])\n validateBooleanOperationOption(operationName, descriptor, 'rejectExplicitUndefined', false)\n\n return Object.freeze({\n targetFields: descriptor.targetFields,\n enforceRequired: descriptor.enforceRequired,\n applyDefaults: descriptor.applyDefaults,\n outputFields: descriptor.outputFields,\n rejectExplicitUndefined: descriptor.rejectExplicitUndefined === undefined ? true : descriptor.rejectExplicitUndefined\n })\n}\n\nfunction normalizeOperations (operations = {}) {\n if (typeof operations !== 'object' || operations === null || Array.isArray(operations)) {\n throw new Error('Schema operations must be an object.')\n }\n\n const normalizedOperations = Object.create(null)\n\n for (const [operationName, descriptor] of Object.entries(DEFAULT_OPERATIONS)) {\n setOwnProperty(normalizedOperations, operationName, descriptor)\n }\n\n for (const [operationName, descriptor] of Object.entries(operations)) {\n setOwnProperty(normalizedOperations, operationName, normalizeOperationDescriptor(operationName, descriptor))\n }\n\n return Object.freeze(normalizedOperations)\n}\n\nfunction freezeOwnMap (source) {\n const map = Object.create(null)\n\n for (const [key, value] of Object.entries(source)) {\n setOwnProperty(map, key, value)\n }\n\n return Object.freeze(map)\n}\n\nfunction cloneValidationOptions (options) {\n const validationOptions = { ...options }\n delete validationOptions.operation\n delete validationOptions.mode\n return validationOptions\n}\n\n/**\n * Represents an instance of a schema that can validate objects against a structure.\n * This class is instantiated by the createSchema factory function.\n */\nexport class Schema {\n /**\n * @param {object} structure The schema definition.\n * @param {object} types The globally registered type handlers.\n * @param {object} validators The globally registered validator handlers.\n * @param {object} [operations={}] Per-schema operation descriptors.\n */\n constructor (structure, types, validators, operations = {}) {\n this.structure = structure\n this.types = freezeOwnMap(types)\n this.validators = freezeOwnMap(validators)\n this.operations = normalizeOperations(operations)\n\n this._installOperationMethods()\n }\n\n // --- Private Helpers ---\n\n /** @private */\n _typeError (field) {\n return this._paramError(field, 'TYPE_CAST_FAILED', 'Value could not be cast to the required type.')\n }\n\n /** @private */\n _paramError (field, code, message, params = {}) {\n const e = new Error(message)\n e.errorObject = { field, code, message, params }\n return e\n }\n\n /** @private */\n _paramToBeSkipped (parameterName, skipParams, fieldName) {\n if (typeof skipParams !== 'object' || skipParams === null) return false\n if (Array.isArray(skipParams[fieldName]) && skipParams[fieldName].includes(parameterName)) return true\n return false\n }\n\n /** @private */\n _fieldToBeSkipped (fieldPath, options) {\n return Array.isArray(options.skipFields) && options.skipFields.includes(fieldPath)\n }\n\n /** @private */\n _mergeErrors (target, source) {\n for (const [fieldPath, error] of Object.entries(source)) {\n setOwnProperty(target, fieldPath, error)\n }\n }\n\n /** @private */\n _singleErrorMap (error) {\n const errors = {}\n setOwnProperty(errors, error.field, error)\n return errors\n }\n\n /** @private */\n _assertSupportedOptions (options = {}) {\n if (Object.hasOwn(options, 'onlyObjectValues')) {\n throw new Error('Unsupported validation option `onlyObjectValues`. Call `patch()` directly.')\n }\n if (Object.hasOwn(options, 'mode')) {\n throw new Error('Unsupported validation option `mode`. Call `validateWith()` or an operation method directly.')\n }\n if (Object.hasOwn(options, 'operation')) {\n throw new Error('Unsupported validation option `operation`. Call `validateWith()` or an operation method directly.')\n }\n }\n\n /** @private */\n _buildOperationSettings (operationName, operation, object) {\n return {\n operationName,\n operation,\n targetFieldNames: operation.targetFields === 'input' ? Object.keys(object) : Object.keys(this.structure),\n outputFieldNames: operation.outputFields === 'input' ? Object.keys(object) : Object.keys(this.structure),\n enforceRequired: operation.enforceRequired,\n applyDefaults: operation.applyDefaults,\n rejectExplicitUndefined: operation.rejectExplicitUndefined,\n defaultedFields: new Set(),\n isFieldPresent: (fieldName) => Object.hasOwn(object, fieldName)\n }\n }\n\n /** @private */\n _assertPlainObjectInput (methodName, object) {\n if (!isPlainObject(object)) {\n throw new Error(`${methodName}() expects a plain object input.`)\n }\n }\n\n /** @private */\n _resolvePathValidationRequest (options = {}) {\n const operationName = options.operation ?? options.mode ?? 'patch'\n\n if (Object.hasOwn(options, 'operation') && Object.hasOwn(options, 'mode') && options.operation !== options.mode) {\n throw new Error('Path validation options `operation` and `mode` must match when both are provided.')\n }\n\n if (!Object.hasOwn(this.operations, operationName)) {\n throw new Error(`Unknown operation \"${operationName}\".`)\n }\n const operation = this.operations[operationName]\n\n return {\n operationName,\n operation,\n validationOptions: cloneValidationOptions(options)\n }\n }\n\n /** @private */\n _buildOperationResult (object, workingObject, settings) {\n const validatedObject = {}\n\n for (const fieldName of settings.outputFieldNames) {\n if (!Object.hasOwn(this.structure, fieldName)) continue\n const fieldPresent = settings.isFieldPresent(fieldName)\n const includeField = (\n workingObject[fieldName] !== undefined ||\n (fieldPresent && object[fieldName] === null) ||\n settings.defaultedFields.has(fieldName)\n )\n\n if (!includeField) continue\n if (!fieldPresent && !settings.defaultedFields.has(fieldName)) continue\n\n setOwnProperty(validatedObject, fieldName, workingObject[fieldName])\n }\n\n return validatedObject\n }\n\n /** @private */\n _resolveObjectFieldMode (fieldPath, definition) {\n return resolveObjectFieldMode(fieldPath, definition)\n }\n\n /** @private */\n _resolveArrayItemsConfig (fieldPath, definition) {\n return resolveArrayItemsConfig(fieldPath, definition)\n }\n\n /** @private */\n _resolveObjectValuesConfig (fieldPath, definition) {\n return resolveObjectValuesConfig(fieldPath, definition)\n }\n\n /** @private */\n _buildArrayItemSettings (definition, settings) {\n if (definition.type === 'object' && Object.hasOwn(definition, 'schema')) {\n return {\n ...settings,\n operationName: 'replace',\n operation: this.operations.replace\n }\n }\n\n return settings\n }\n\n /** @private */\n _castValue (definition, rawValue, fieldPath, currentObject, containerKey, objectBeforeCast, options, settings) {\n const nullable = definition.nullable === true || options.nullable === true\n const nullOnEmpty = definition.nullOnEmpty === true || options.nullOnEmpty === true\n\n if (!Object.hasOwn(this.types, definition.type)) {\n throw new Error(`No casting function for type: ${definition.type}`)\n }\n const typeHandler = this.types[definition.type]\n\n if (rawValue === null) {\n if (nullable) {\n setOwnProperty(currentObject, containerKey, null)\n return { errors: {}, shouldContinue: false }\n }\n\n return {\n errors: this._singleErrorMap({\n field: fieldPath,\n code: 'NOT_NULLABLE',\n message: 'Field cannot be null',\n params: {}\n }),\n shouldContinue: false\n }\n }\n\n if (rawValue === '' && nullOnEmpty) {\n setOwnProperty(currentObject, containerKey, null)\n return { errors: {}, shouldContinue: false }\n }\n\n /** @type {ValidationContext} */\n const context = {\n schema: this,\n definition,\n value: rawValue,\n fieldName: fieldPath,\n object: currentObject,\n objectBeforeCast,\n valueBeforeCast: rawValue,\n options,\n mode: settings.operationName,\n operation: settings.operationName,\n fieldPresent: true,\n computedOptions: { nullable: nullable || nullOnEmpty, nullOnEmpty },\n\n throwTypeError: () => {\n throw this._typeError(fieldPath)\n },\n throwParamError: (code, message, params) => {\n throw this._paramError(fieldPath, code, message, params)\n }\n }\n\n try {\n const castResult = typeHandler(context)\n if (isThenable(castResult)) {\n throw new Error(`Type handler for \"${definition.type}\" must be synchronous.`)\n }\n\n if (castResult !== undefined) {\n setOwnProperty(currentObject, containerKey, castResult)\n context.value = castResult\n }\n } catch (e) {\n if (e.errorObject) {\n return {\n errors: this._singleErrorMap(e.errorObject),\n shouldContinue: false\n }\n }\n\n throw e\n }\n\n return {\n errors: {},\n context,\n shouldContinue: true\n }\n }\n\n /** @private */\n _runFieldValidators (definition, fieldPath, currentObject, containerKey, context, options) {\n for (const paramName of Object.keys(definition)) {\n if (paramName === 'type') continue\n if (this._paramToBeSkipped(paramName, options.skipParams, fieldPath)) continue\n\n if (!Object.hasOwn(this.validators, paramName)) continue\n const validatorHandler = this.validators[paramName]\n\n try {\n context.parameterName = paramName\n context.parameterValue = definition[paramName]\n const validatorResult = validatorHandler(context)\n if (isThenable(validatorResult)) {\n throw new Error(`Validator handler for \"${paramName}\" must be synchronous.`)\n }\n if (validatorResult !== undefined) {\n setOwnProperty(currentObject, containerKey, validatorResult)\n context.value = validatorResult\n }\n } catch (e) {\n if (e.errorObject) return this._singleErrorMap(e.errorObject)\n throw e\n }\n }\n\n return {}\n }\n\n /** @private */\n _normalizeAndValidateValue (definition, rawValue, fieldPath, currentObject, containerKey, objectBeforeCast, options, settings) {\n const castResult = this._castValue(definition, rawValue, fieldPath, currentObject, containerKey, objectBeforeCast, options, settings)\n if (Object.keys(castResult.errors).length > 0) return castResult.errors\n if (!castResult.shouldContinue) return {}\n\n const { context } = castResult\n\n const nestedErrors = this._validateNestedValue(definition, fieldPath, currentObject, containerKey, options, settings)\n if (Object.keys(nestedErrors).length > 0) {\n return nestedErrors\n }\n\n context.value = currentObject[containerKey]\n return this._runFieldValidators(definition, fieldPath, currentObject, containerKey, context, options)\n }\n\n /** @private */\n _normalizeDefault (definition, defaultValue, {\n fieldPath,\n currentObject,\n containerKey,\n objectBeforeCast,\n options,\n settings\n }) {\n const defaultObject = { ...currentObject }\n setOwnProperty(defaultObject, containerKey, defaultValue)\n const errors = this._normalizeAndValidateValue(\n definition,\n defaultValue,\n fieldPath,\n defaultObject,\n containerKey,\n objectBeforeCast,\n options,\n settings\n )\n\n return { errors, value: defaultObject[containerKey] }\n }\n\n /** @private */\n _validateNestedValue (definition, fieldPath, currentObject, containerKey, options, settings) {\n if (definition.type === 'object') {\n const objectMode = this._resolveObjectFieldMode(fieldPath, definition)\n if (objectMode.kind === 'nested') {\n return this._validateNestedObjectSchema(\n objectMode,\n fieldPath,\n currentObject,\n containerKey,\n options,\n settings\n )\n }\n\n if (objectMode.kind === 'map') {\n return this._validateObjectValues(\n fieldPath,\n currentObject,\n containerKey,\n objectMode.valuesConfig,\n options,\n settings\n )\n }\n\n return {}\n }\n\n if (definition.type !== 'array') return {}\n\n const itemsConfig = this._resolveArrayItemsConfig(fieldPath, definition)\n if (!itemsConfig) return {}\n\n return this._validateArrayItems(fieldPath, currentObject, containerKey, itemsConfig, options, settings)\n }\n\n /** @private */\n _validateNestedObjectSchema (objectMode, fieldPath, currentObject, containerKey, options, settings) {\n const sourceObject = currentObject[containerKey]\n const nestedInput = objectMode.allowAdditionalProperties\n ? this._extractKnownObjectFields(sourceObject, objectMode.schema)\n : sourceObject\n\n const nestedResult = objectMode.schema._validateWithOperation(\n settings.operationName,\n settings.operation,\n nestedInput,\n buildNestedOptions(options, fieldPath)\n )\n\n setOwnProperty(currentObject, containerKey, objectMode.allowAdditionalProperties\n ? this._mergeKnownAndPassthroughObjectFields(sourceObject, objectMode.schema, nestedResult.validatedObject)\n : nestedResult.validatedObject)\n\n return prefixErrorMap(nestedResult.errors, fieldPath)\n }\n\n /** @private */\n _extractKnownObjectFields (sourceObject, nestedSchema) {\n const knownObject = {}\n\n for (const [key, value] of Object.entries(sourceObject)) {\n if (Object.hasOwn(nestedSchema.structure, key)) {\n setOwnProperty(knownObject, key, value)\n }\n }\n\n return knownObject\n }\n\n /** @private */\n _mergeKnownAndPassthroughObjectFields (sourceObject, nestedSchema, validatedObject) {\n const mergedObject = {}\n\n for (const key of Object.keys(sourceObject)) {\n if (!Object.hasOwn(nestedSchema.structure, key)) {\n setOwnProperty(mergedObject, key, sourceObject[key])\n continue\n }\n\n if (Object.hasOwn(validatedObject, key)) {\n setOwnProperty(mergedObject, key, validatedObject[key])\n }\n }\n\n for (const [key, value] of Object.entries(validatedObject)) {\n if (!Object.hasOwn(mergedObject, key)) {\n setOwnProperty(mergedObject, key, value)\n }\n }\n\n return mergedObject\n }\n\n /** @private */\n _validateObjectValues (fieldPath, currentObject, containerKey, valuesConfig, options, settings) {\n const originalEntries = currentObject[containerKey]\n const normalizedEntries = { ...originalEntries }\n const errors = {}\n\n setOwnProperty(currentObject, containerKey, normalizedEntries)\n\n for (const key of Object.keys(originalEntries)) {\n const valuePath = joinPath(fieldPath, key)\n\n if (this._fieldToBeSkipped(valuePath, options)) continue\n\n const rawValue = normalizedEntries[key]\n\n if (rawValue === undefined) {\n if (settings.rejectExplicitUndefined) {\n this._mergeErrors(errors, this._singleErrorMap(this._typeError(valuePath).errorObject))\n } else {\n delete normalizedEntries[key]\n }\n continue\n }\n\n if (valuesConfig.kind === 'schema') {\n const valueResult = valuesConfig.schema._validateWithOperation(\n 'replace',\n valuesConfig.schema.operations.replace,\n rawValue,\n buildNestedOptions(options, valuePath)\n )\n\n setOwnProperty(normalizedEntries, key, valueResult.validatedObject)\n this._mergeErrors(errors, prefixErrorMap(valueResult.errors, valuePath))\n continue\n }\n\n const valueErrors = this._normalizeAndValidateValue(\n valuesConfig.definition,\n rawValue,\n valuePath,\n normalizedEntries,\n key,\n originalEntries,\n options,\n this._buildArrayItemSettings(valuesConfig.definition, settings)\n )\n\n this._mergeErrors(errors, valueErrors)\n }\n\n return errors\n }\n\n /** @private */\n _validateArrayItems (fieldPath, currentObject, containerKey, itemsConfig, options, settings) {\n const originalItems = currentObject[containerKey]\n const normalizedItems = originalItems.slice()\n const errors = {}\n\n setOwnProperty(currentObject, containerKey, normalizedItems)\n\n for (let index = 0; index < normalizedItems.length; index++) {\n const itemPath = joinPath(fieldPath, index)\n\n if (this._fieldToBeSkipped(itemPath, options)) continue\n\n if (!Object.hasOwn(originalItems, index) || normalizedItems[index] === undefined) {\n if (settings.rejectExplicitUndefined) {\n this._mergeErrors(errors, this._singleErrorMap(this._typeError(itemPath).errorObject))\n } else {\n delete normalizedItems[index]\n }\n continue\n }\n\n if (itemsConfig.kind === 'schema') {\n const itemResult = itemsConfig.schema._validateWithOperation(\n 'replace',\n itemsConfig.schema.operations.replace,\n normalizedItems[index],\n buildNestedOptions(options, itemPath)\n )\n\n setOwnProperty(normalizedItems, index, itemResult.validatedObject)\n this._mergeErrors(errors, prefixErrorMap(itemResult.errors, itemPath))\n continue\n }\n\n const itemErrors = this._normalizeAndValidateValue(\n itemsConfig.definition,\n normalizedItems[index],\n itemPath,\n normalizedItems,\n index,\n originalItems,\n options,\n this._buildArrayItemSettings(itemsConfig.definition, settings)\n )\n\n this._mergeErrors(errors, itemErrors)\n }\n\n return errors\n }\n\n /**\n * Processes a single field through the entire validation pipeline (pre-checks, casting, validators).\n * This is the heart of the validation logic for an individual field.\n * @private\n * @param {string} fieldName - The name of the field to validate.\n * @param {object} object - The original input object.\n * @param {object} validatedObject - The object being built with validated data.\n * @param {object} options - The global validation options.\n * @param {object} settings - Mode-specific validation settings.\n * @returns {ValidationError|null} An error object if validation fails, otherwise null.\n */\n _validateField (fieldName, object, validatedObject, options, settings) {\n if (!Object.hasOwn(this.structure, fieldName)) return {}\n const definition = this.structure[fieldName]\n\n if (this._fieldToBeSkipped(fieldName, options)) return {}\n\n const fieldPresent = settings.isFieldPresent(fieldName)\n const rawValue = object[fieldName]\n const valueMissing = rawValue === undefined\n\n if (settings.enforceRequired && definition.required && (!fieldPresent || valueMissing)) {\n if (!this._paramToBeSkipped('required', options.skipParams, fieldName)) {\n return this._singleErrorMap({\n field: fieldName,\n code: 'REQUIRED',\n message: 'Field is required',\n params: {}\n })\n }\n }\n\n if (!fieldPresent) {\n return {}\n }\n\n if (valueMissing) {\n if (settings.rejectExplicitUndefined) {\n return this._singleErrorMap(this._typeError(fieldName).errorObject)\n }\n return {}\n }\n\n return this._normalizeAndValidateValue(definition, rawValue, fieldName, validatedObject, fieldName, object, options, settings)\n }\n\n /** @private */\n _validateWithOperation (operationName, operation, object, options) {\n this._assertSupportedOptions(options)\n\n const errors = {}\n const workingObject = { ...object }\n const settings = this._buildOperationSettings(operationName, operation, object)\n\n for (const fieldName of Object.keys(object)) {\n if (!Object.hasOwn(this.structure, fieldName)) {\n setOwnProperty(errors, fieldName, { field: fieldName, code: 'FIELD_NOT_ALLOWED', message: 'Field not allowed', params: {} })\n }\n }\n\n for (const fieldName of settings.targetFieldNames) {\n const fieldErrors = this._validateField(fieldName, object, workingObject, options, settings)\n this._mergeErrors(errors, fieldErrors)\n }\n\n if (settings.applyDefaults) {\n for (const fieldName of Object.keys(this.structure)) {\n if (settings.isFieldPresent(fieldName)) continue\n\n if (this.structure[fieldName].defaultTo !== undefined) {\n const definition = this.structure[fieldName]\n const defaultValue = typeof definition.defaultTo === 'function' ? definition.defaultTo() : definition.defaultTo\n const defaultResult = this._normalizeDefault(\n definition,\n defaultValue,\n {\n fieldPath: fieldName,\n currentObject: workingObject,\n containerKey: fieldName,\n objectBeforeCast: object,\n options,\n settings\n }\n )\n\n this._mergeErrors(errors, defaultResult.errors)\n if (Object.keys(defaultResult.errors).length > 0) continue\n\n setOwnProperty(workingObject, fieldName, defaultResult.value)\n settings.defaultedFields.add(fieldName)\n }\n }\n }\n\n return {\n validatedObject: this._buildOperationResult(object, workingObject, settings),\n errors\n }\n }\n\n /** @private */\n _validateSelectedTree (selectionTree, object, options, settings, basePath = '') {\n const errors = {}\n const validatedObject = {}\n\n for (const fieldName of sortSelectionKeys(Object.keys(selectionTree))) {\n const fieldPath = buildFieldPath(basePath, fieldName)\n if (!Object.hasOwn(this.structure, fieldName)) {\n throw new Error(`Unknown schema path \"${fieldPath}\".`)\n }\n\n const fieldErrors = this._validateSelectedField(\n fieldName,\n selectionTree[fieldName],\n object,\n validatedObject,\n options,\n settings,\n fieldPath\n )\n\n this._mergeErrors(errors, fieldErrors)\n }\n\n return { validatedObject, errors }\n }\n\n /** @private */\n _validateSelectedField (fieldName, selectionNode, object, validatedObject, options, settings, fieldPath) {\n if (!Object.hasOwn(this.structure, fieldName)) return {}\n const definition = this.structure[fieldName]\n const exactSelected = selectionNode.self === true\n const hasChildren = hasSelectionChildren(selectionNode)\n\n if (this._fieldToBeSkipped(fieldPath, options)) return {}\n\n const fieldPresent = Object.hasOwn(object, fieldName)\n const rawValue = object[fieldName]\n const errors = {}\n\n if (!fieldPresent) {\n if (exactSelected && settings.enforceRequired && definition.required && !this._paramToBeSkipped('required', options.skipParams, fieldPath)) {\n this._mergeErrors(errors, this._singleErrorMap({\n field: fieldPath,\n code: 'REQUIRED',\n message: 'Field is required',\n params: {}\n }))\n }\n\n if (exactSelected && settings.applyDefaults && definition.defaultTo !== undefined) {\n const defaultValue = typeof definition.defaultTo === 'function' ? definition.defaultTo() : definition.defaultTo\n const defaultResult = this._normalizeDefault(\n definition,\n defaultValue,\n {\n fieldPath,\n currentObject: validatedObject,\n containerKey: fieldName,\n objectBeforeCast: object,\n options,\n settings\n }\n )\n this._mergeErrors(errors, defaultResult.errors)\n if (Object.keys(defaultResult.errors).length === 0) {\n setOwnProperty(validatedObject, fieldName, defaultResult.value)\n }\n }\n\n return errors\n }\n\n if (rawValue === undefined) {\n if (exactSelected && settings.rejectExplicitUndefined) {\n return this._singleErrorMap(this._typeError(fieldPath).errorObject)\n }\n\n return {}\n }\n\n const currentObject = { [fieldName]: rawValue }\n\n if (exactSelected) {\n const fieldErrors = this._normalizeAndValidateValue(\n definition,\n rawValue,\n fieldPath,\n currentObject,\n fieldName,\n object,\n options,\n settings\n )\n\n if (Object.hasOwn(currentObject, fieldName) && currentObject[fieldName] !== undefined) {\n setOwnProperty(validatedObject, fieldName, currentObject[fieldName])\n } else if (currentObject[fieldName] === null) {\n setOwnProperty(validatedObject, fieldName, null)\n }\n\n return fieldErrors\n }\n\n if (!hasChildren) return {}\n\n const castResult = this._castValue(definition, rawValue, fieldPath, currentObject, fieldName, object, options, settings)\n if (Object.keys(castResult.errors).length > 0) {\n return castResult.errors\n }\n\n if (!castResult.shouldContinue) return {}\n\n const nestedResult = this._validateSelectedDescendants(\n definition,\n selectionNode.children,\n fieldPath,\n currentObject,\n fieldName,\n options,\n settings\n )\n\n if (hasSelectedValue(currentObject[fieldName])) {\n setOwnProperty(validatedObject, fieldName, currentObject[fieldName])\n }\n\n return nestedResult\n }\n\n /** @private */\n _validateSelectedDescendants (definition, selectionTree, fieldPath, currentObject, containerKey, options, settings) {\n if (definition.type === 'object') {\n const objectMode = this._resolveObjectFieldMode(fieldPath, definition)\n if (objectMode.kind !== 'nested') {\n throw new Error(`Schema path \"${fieldPath}\" does not support nested field selection.`)\n }\n\n const nestedValue = currentObject[containerKey]\n if (!isPlainObject(nestedValue)) return {}\n\n const nestedResult = objectMode.schema._validateSelectedTree(\n selectionTree,\n nestedValue,\n buildNestedOptions(options, fieldPath),\n {\n ...settings,\n defaultedFields: new Set()\n }\n )\n\n setOwnProperty(currentObject, containerKey, nestedResult.validatedObject)\n return prefixErrorMap(nestedResult.errors, fieldPath)\n }\n\n if (definition.type === 'array') {\n const itemsConfig = this._resolveArrayItemsConfig(fieldPath, definition)\n if (!itemsConfig) {\n throw new Error(`Schema path \"${fieldPath}\" does not define array items for nested selection.`)\n }\n\n return this._validateSelectedArrayItems(fieldPath, currentObject, containerKey, itemsConfig, selectionTree, options, settings)\n }\n\n throw new Error(`Schema path \"${fieldPath}\" does not support nested field selection.`)\n }\n\n /** @private */\n _validateSelectedArrayItems (fieldPath, currentObject, containerKey, itemsConfig, selectionTree, options, settings) {\n const normalizedItems = []\n const sourceItems = currentObject[containerKey]\n const errors = {}\n\n setOwnProperty(currentObject, containerKey, normalizedItems)\n\n for (const indexKey of sortSelectionKeys(Object.keys(selectionTree))) {\n if (!/^[0-9]+$/.test(indexKey)) {\n throw new Error(`Schema path \"${joinPath(fieldPath, indexKey)}\" is invalid because array segments must use numeric indexes.`)\n }\n\n const index = Number(indexKey)\n const itemPath = joinPath(fieldPath, index)\n const selectionNode = selectionTree[indexKey]\n const exactSelected = selectionNode.self === true\n const hasChildren = hasSelectionChildren(selectionNode)\n\n if (this._fieldToBeSkipped(itemPath, options)) continue\n if (!Object.hasOwn(sourceItems, index)) {\n if (exactSelected && settings.rejectExplicitUndefined) {\n setOwnProperty(errors, itemPath, this._typeError(itemPath).errorObject)\n }\n continue\n }\n\n const rawValue = sourceItems[index]\n if (rawValue === undefined) {\n if (exactSelected && settings.rejectExplicitUndefined) {\n setOwnProperty(errors, itemPath, this._typeError(itemPath).errorObject)\n }\n continue\n }\n\n if (itemsConfig.kind === 'schema') {\n if (exactSelected) {\n const itemResult = itemsConfig.schema._validateWithOperation(\n 'replace',\n itemsConfig.schema.operations.replace,\n rawValue,\n buildNestedOptions(options, itemPath)\n )\n\n if (hasSelectedValue(itemResult.validatedObject)) {\n setOwnProperty(normalizedItems, index, itemResult.validatedObject)\n }\n\n this._mergeErrors(errors, prefixErrorMap(itemResult.errors, itemPath))\n continue\n }\n\n if (!hasChildren) continue\n\n const itemResult = itemsConfig.schema._validateSelectedTree(\n selectionNode.children,\n rawValue,\n buildNestedOptions(options, itemPath),\n {\n ...settings,\n operationName: 'replace',\n operation: itemsConfig.schema.operations.replace,\n defaultedFields: new Set()\n }\n )\n\n if (hasSelectedValue(itemResult.validatedObject)) {\n setOwnProperty(normalizedItems, index, itemResult.validatedObject)\n }\n\n this._mergeErrors(errors, prefixErrorMap(itemResult.errors, itemPath))\n continue\n }\n\n const itemSettings = this._buildArrayItemSettings(itemsConfig.definition, settings)\n const itemHolder = [rawValue]\n\n if (exactSelected) {\n const itemErrors = this._normalizeAndValidateValue(\n itemsConfig.definition,\n rawValue,\n itemPath,\n itemHolder,\n 0,\n sourceItems,\n options,\n itemSettings\n )\n\n if (Object.hasOwn(itemHolder, 0) && itemHolder[0] !== undefined) {\n setOwnProperty(normalizedItems, index, itemHolder[0])\n } else if (itemHolder[0] === null) {\n setOwnProperty(normalizedItems, index, null)\n }\n\n this._mergeErrors(errors, itemErrors)\n continue\n }\n\n if (!hasChildren) continue\n\n const castResult = this._castValue(itemsConfig.definition, rawValue, itemPath, itemHolder, 0, sourceItems, options, itemSettings)\n if (Object.keys(castResult.errors).length > 0) {\n this._mergeErrors(errors, castResult.errors)\n continue\n }\n\n if (!castResult.shouldContinue) continue\n\n const itemErrors = this._validateSelectedDescendants(\n itemsConfig.definition,\n selectionNode.children,\n itemPath,\n itemHolder,\n 0,\n options,\n itemSettings\n )\n\n if (hasSelectedValue(itemHolder[0])) {\n setOwnProperty(normalizedItems, index, itemHolder[0])\n }\n\n this._mergeErrors(errors, itemErrors)\n }\n\n return errors\n }\n\n // --- Public API ---\n\n /**\n * Validates an object with a named operation contract.\n * @param {string} operationName - The operation contract to use.\n * @param {object} object - The input object to validate.\n * @param {object} [options={}] - Validation options.\n * @returns {{validatedObject: object, errors: Object.<string, ValidationError>}}\n */\n validateWith (operationName, object, options = {}) {\n if (!Object.hasOwn(this.operations, operationName)) {\n throw new Error(`Unknown operation \"${operationName}\".`)\n }\n const operation = this.operations[operationName]\n\n this._assertPlainObjectInput(operationName, object)\n\n return this._validateWithOperation(operationName, operation, object, options)\n }\n\n /**\n * Validates a single schema path against the selected operation.\n * Defaults to `patch` semantics when no operation is specified.\n * @param {string} path - A dotted schema path such as `email` or `workspace.slug`.\n * @param {object} object - The input object to validate.\n * @param {{operation?: string, mode?: string}} [options={}] - Path validation options.\n * @returns {{validatedValue: any, errors: Object.<string, ValidationError>}}\n */\n validateAt (path, object, options = {}) {\n this._assertPlainObjectInput('validateAt', object)\n\n const pathSegments = buildPathSegments(path)\n const { operationName, operation, validationOptions } = this._resolvePathValidationRequest(options)\n const result = this._validateSelectedTree(\n buildSelectionTree([path]),\n object,\n validationOptions,\n this._buildOperationSettings(operationName, operation, object)\n )\n\n return {\n validatedValue: getValueAtPath(result.validatedObject, pathSegments),\n errors: result.errors\n }\n }\n\n /**\n * Validates a selected set of schema paths against the chosen operation.\n * Defaults to `patch` semantics when no operation is specified.\n * @param {string[]} paths - A list of dotted schema paths.\n * @param {object} object - The input object to validate.\n * @param {{operation?: string, mode?: string}} [options={}] - Path validation options.\n * @returns {{validatedObject: object, errors: Object.<string, ValidationError>}}\n */\n validatePaths (paths, object, options = {}) {\n this._assertPlainObjectInput('validatePaths', object)\n\n if (!Array.isArray(paths) || paths.length === 0) {\n throw new Error('validatePaths() expects a non-empty array of schema paths.')\n }\n\n const { operationName, operation, validationOptions } = this._resolvePathValidationRequest(options)\n return this._validateSelectedTree(\n buildSelectionTree(paths),\n object,\n validationOptions,\n this._buildOperationSettings(operationName, operation, object)\n )\n }\n\n /**\n * Installs operation aliases such as `create`, `replace`, `patch`, or user-defined operations.\n * @private\n */\n _installOperationMethods () {\n for (const operationName of Object.keys(this.operations)) {\n if (operationName in this) {\n throw new Error(`Operation name \"${operationName}\" is reserved and cannot be used as a schema method.`)\n }\n\n this[operationName] = (object, options = {}) => this.validateWith(operationName, object, options)\n }\n }\n\n /**\n * Exports the schema as a transport-facing JSON Schema object.\n * @param {{operation?: string, mode?: 'create'|'replace'|'patch', additionalProperties?: boolean}} [options={}] - Export options.\n * @returns {object} A draft-07 JSON Schema object.\n */\n toJsonSchema (options = {}) {\n return buildJsonSchema(this, options)\n }\n\n /**\n * Returns a frozen snapshot map of the schema's top-level field definitions.\n * @returns {object}\n */\n getFieldDefinitions () {\n return createIntrospectionSnapshot(this.structure)\n }\n\n /**\n * Resolves a field definition by dotted path. Array items use numeric segments such as `roles.0.id`.\n * Returns a frozen snapshot, or `null` when the path does not resolve to a field definition.\n * @param {string} path\n * @returns {object|null}\n */\n getFieldDefinition (path) {\n if (typeof path !== 'string' || path.trim() === '') {\n throw new Error('Field path must be a non-empty string.')\n }\n\n const definition = resolveDefinitionFromSchemaPath(this, buildPathSegments(path.trim()))\n return definition === null ? null : createIntrospectionSnapshot(definition)\n }\n\n /**\n * Resolves the `messages` object for a field definition by dotted path.\n * Returns a frozen snapshot, or an empty frozen object when no messages exist.\n * @param {string} path\n * @returns {object}\n */\n getFieldMessages (path) {\n const definition = this.getFieldDefinition(path)\n if (!definition || typeof definition.messages !== 'object' || definition.messages === null) {\n return Object.freeze({})\n }\n\n return createIntrospectionSnapshot(definition.messages)\n }\n\n /**\n * Utility to filter an object, keeping only fields that have a specific parameter.\n * @param {object} object - The object to clean.\n * @param {string} parameterName - The schema parameter to look for.\n * @returns {object} A new object with only the matching fields.\n */\n cleanup (object, parameterName) {\n const newObject = {}\n for (const k of Object.keys(object)) {\n if (Object.hasOwn(this.structure, k) && this.structure[k][parameterName]) {\n setOwnProperty(newObject, k, object[k])\n }\n }\n return newObject\n }\n}\n","/// <reference types=\"../types/index.d.ts\" />\n\n// (c) 2020-present Andrea Giammarchi\n\nconst {parse: $parse, stringify: $stringify} = JSON;\nconst {keys} = Object;\n\nconst Primitive = String; // it could be Number\nconst primitive = 'string'; // it could be 'number'\n\nconst ignore = {};\nconst object = 'object';\n\nconst noop = (_, value) => value;\n\nconst primitives = value => (\n value instanceof Primitive ? Primitive(value) : value\n);\n\nconst Primitives = (_, value) => (\n typeof value === primitive ? new Primitive(value) : value\n);\n\nconst resolver = (input, lazy, parsed, $) => output => {\n for (let ke = keys(output), {length} = ke, y = 0; y < length; y++) {\n const k = ke[y];\n const value = output[k];\n if (value instanceof Primitive) {\n const tmp = input[+value];\n if (typeof tmp === object && !parsed.has(tmp)) {\n parsed.add(tmp);\n output[k] = ignore;\n lazy.push({ o: output, k, r: tmp });\n }\n else\n output[k] = $.call(output, k, tmp);\n }\n else if (output[k] !== ignore)\n output[k] = $.call(output, k, value);\n }\n return output;\n};\n\nconst set = (known, input, value) => {\n const index = Primitive(input.push(value) - 1);\n known.set(value, index);\n return index;\n};\n\n/**\n * Converts a specialized flatted string into a JS value.\n * @param {string} text\n * @param {(this: any, key: string, value: any) => any} [reviver]\n * @returns {any}\n */\nexport const parse = (text, reviver) => {\n const input = $parse(text, Primitives).map(primitives);\n const $ = reviver || noop;\n\n let value = input[0];\n\n if (typeof value === object && value) {\n const lazy = [];\n const revive = resolver(input, lazy, new Set, $);\n value = revive(value);\n\n let i = 0;\n while (i < lazy.length) {\n // it could be a lazy.shift() but that's costly\n const {o, k, r} = lazy[i++];\n o[k] = $.call(o, k, revive(r));\n }\n }\n\n return $.call({'': value}, '', value);\n};\n\n/**\n * Converts a JS value into a specialized flatted string.\n * @param {any} value\n * @param {((this: any, key: string, value: any) => any) | (string | number)[] | null | undefined} [replacer]\n * @param {string | number | undefined} [space]\n * @returns {string}\n */\nexport const stringify = (value, replacer, space) => {\n const $ = replacer && typeof replacer === object ?\n (k, v) => (k === '' || -1 < replacer.indexOf(k) ? v : void 0) :\n (replacer || noop);\n const known = new Map;\n const input = [];\n const output = [];\n let i = +set(known, input, $.call({'': value}, '', value));\n let firstRun = !i;\n while (i < input.length) {\n firstRun = true;\n output[i] = $stringify(input[i++], replace, space);\n }\n return '[' + output.join(',') + ']';\n function replace(key, value) {\n if (firstRun) {\n firstRun = !firstRun;\n return value;\n }\n const after = $.call(this, key, value);\n switch (typeof after) {\n case object:\n if (after === null) return after;\n case primitive:\n return known.get(after) || set(known, input, after);\n }\n return after;\n }\n};\n\n/**\n * Converts a generic value into a JSON serializable object without losing recursion.\n * @param {any} value\n * @returns {any}\n */\nexport const toJSON = value => $parse(stringify(value));\n\n/**\n * Converts a previously serialized object with recursion into a recursive one.\n * @param {any} value\n * @returns {any}\n */\nexport const fromJSON = value => parse($stringify(value));\n","/**\n * @file Contains all the built-in type and validator handlers for the schema library.\n */\n\nimport * as flatted from 'flatted'\nimport { isNumericDefinition } from './definition-helpers.js'\nimport {\n castEpochInteger,\n EPOCH_MILLISECONDS_LIMIT,\n EPOCH_SECONDS_LIMIT,\n isValidDate,\n isValidDateTime,\n isValidTime,\n resolveTemporalPrecision\n} from './temporal.js'\nimport { isPlainObject } from '../utils/object-helpers.js'\n\n/**\n * @typedef {import('./Schema.js').ValidationContext} ValidationContext\n */\n\nconst DEFAULT_BOOLEAN_TRUE_VALUES = new Set(['true', '1', 'yes', 'y', 'on'])\nconst DEFAULT_BOOLEAN_FALSE_VALUES = new Set(['false', '0', 'no', 'n', 'off'])\n\nfunction isThenable (value) {\n return value !== null &&\n (typeof value === 'object' || typeof value === 'function') &&\n typeof value.then === 'function'\n}\n\nfunction normalizeFiniteNumberInput (value) {\n if (typeof value === 'number') {\n return Number.isFinite(value) ? value : null\n }\n\n if (typeof value === 'bigint') {\n const numberValue = Number(value)\n return Number.isSafeInteger(numberValue) ? numberValue : null\n }\n\n if (typeof value === 'string') {\n const trimmed = value.trim()\n if (trimmed === '') return null\n const numberValue = Number(trimmed)\n return Number.isFinite(numberValue) ? numberValue : null\n }\n\n return null\n}\n\nfunction deepEqual (left, right) {\n if (Object.is(left, right)) return true\n\n if (left instanceof Date && right instanceof Date) {\n return left.getTime() === right.getTime()\n }\n\n if (left instanceof RegExp && right instanceof RegExp) {\n return left.source === right.source && left.flags === right.flags\n }\n\n if (Array.isArray(left) || Array.isArray(right)) {\n if (!Array.isArray(left) || !Array.isArray(right)) return false\n if (left.length !== right.length) return false\n\n for (let index = 0; index < left.length; index++) {\n if (!deepEqual(left[index], right[index])) return false\n }\n\n return true\n }\n\n if (\n left === null ||\n right === null ||\n typeof left !== 'object' ||\n typeof right !== 'object'\n ) {\n return false\n }\n\n if (Object.getPrototypeOf(left) !== Object.getPrototypeOf(right)) {\n return false\n }\n\n const leftKeys = Object.keys(left)\n const rightKeys = Object.keys(right)\n\n if (leftKeys.length !== rightKeys.length) return false\n\n for (const key of leftKeys) {\n if (!Object.hasOwn(right, key)) return false\n if (!deepEqual(left[key], right[key])) return false\n }\n\n return true\n}\n\n/**\n * The CorePlugin provides the default set of types and validators.\n */\nconst CorePlugin = {\n /**\n * Installs the core types and validators.\n * @param {{addType: Function, addValidator: Function}} api - An object containing registration functions.\n */\n install (api) {\n const { addType, addValidator } = api // Destructure the API functions\n\n // --- Type Handlers ---\n\n addType('none', context => context.value)\n\n addType('file', context => {\n const val = context.value\n if (val === undefined || val === null) context.throwTypeError()\n\n // Only attempt to convert primitives. Fail on complex objects/arrays.\n // A file is expected to be just a file handle\n const valType = typeof val\n if (valType === 'string' || valType === 'number' || valType === 'boolean') {\n const s = val.toString()\n return context.definition.noTrim ? s : s.trim()\n }\n\n // If it's not a primitive that can be safely converted, it's a type error.\n context.throwTypeError()\n })\n\n addType('string', context => {\n const val = context.value\n if (val === undefined || val === null) return ''\n\n // Only attempt to convert primitives. Fail on complex objects/arrays.\n const valType = typeof val\n if (valType === 'string' || valType === 'number' || valType === 'boolean') {\n const s = val.toString()\n return context.definition.noTrim ? s : s.trim()\n }\n\n // If it's not a primitive that can be safely converted, it's a type error.\n context.throwTypeError()\n })\n\n addType('blob', context => context.value)\n addType('number', context => {\n const numberValue = normalizeFiniteNumberInput(context.value)\n if (numberValue === null) context.throwTypeError()\n return numberValue\n })\n addType('integer', context => {\n const numberValue = normalizeFiniteNumberInput(context.value)\n if (numberValue === null || !Number.isInteger(numberValue)) context.throwTypeError()\n return numberValue\n })\n addType('epochMilliseconds', context => {\n const epochMilliseconds = castEpochInteger(context.value, EPOCH_MILLISECONDS_LIMIT)\n if (epochMilliseconds === null) context.throwTypeError()\n return epochMilliseconds\n })\n addType('epochSeconds', context => {\n const epochSeconds = castEpochInteger(context.value, EPOCH_SECONDS_LIMIT)\n if (epochSeconds === null) context.throwTypeError()\n return epochSeconds\n })\n addType('dateTime', context => {\n const temporalPrecision = resolveTemporalPrecision(context.definition, context.fieldName)\n if (!isValidDateTime(context.value, temporalPrecision)) context.throwTypeError()\n return context.value\n })\n addType('date', context => {\n if (!isValidDate(context.value)) context.throwTypeError()\n return context.value\n })\n addType('time', context => {\n const temporalPrecision = resolveTemporalPrecision(context.definition, context.fieldName)\n if (!isValidTime(context.value, temporalPrecision)) context.throwTypeError()\n return context.value\n })\n addType('array', context => {\n if (context.definition.type === 'array' && !Array.isArray(context.value)) {\n return [context.value]\n }\n return context.value\n })\n addType('object', context => {\n if (!isPlainObject(context.value)) {\n context.throwTypeError()\n }\n\n return context.value\n })\n addType('serialize', context => {\n try {\n // First try regular JSON.stringify for non-circular objects\n return JSON.stringify(context.value)\n } catch (e) {\n // If that fails (likely circular reference), use flatted\n try {\n return flatted.stringify(context.value)\n } catch (e2) {\n context.throwTypeError()\n }\n }\n })\n addType('boolean', context => {\n if (typeof context.value === 'boolean') {\n return context.value\n }\n\n if (typeof context.value === 'number') {\n if (context.value === 1) return true\n if (context.value === 0) return false\n context.throwTypeError()\n }\n\n if (typeof context.value === 'bigint') {\n if (context.value === 1n) return true\n if (context.value === 0n) return false\n context.throwTypeError()\n }\n\n if (typeof context.value === 'string') {\n const falseVal = String(context.definition.stringFalseWhen || 'false').trim().toLowerCase()\n const trueVal = String(context.definition.stringTrueWhen || 'true').trim().toLowerCase()\n const lowerValue = context.value.trim().toLowerCase()\n const falseValues = new Set([...DEFAULT_BOOLEAN_FALSE_VALUES, falseVal])\n const trueValues = new Set([...DEFAULT_BOOLEAN_TRUE_VALUES, trueVal])\n\n if (falseValues.has(lowerValue)) return false\n if (trueValues.has(lowerValue)) return true\n }\n\n context.throwTypeError()\n })\n addType('id', context => {\n if (typeof context.value === 'number') {\n if (Number.isSafeInteger(context.value) && context.value > 0) {\n return context.value\n }\n context.throwTypeError()\n }\n\n if (typeof context.value === 'bigint') {\n if (context.value > 0n && context.value <= BigInt(Number.MAX_SAFE_INTEGER)) {\n return Number(context.value)\n }\n context.throwTypeError()\n }\n\n if (typeof context.value === 'string') {\n const trimmed = context.value.trim()\n if (!/^[1-9][0-9]*$/.test(trimmed)) {\n context.throwTypeError()\n }\n\n const numberValue = Number(trimmed)\n if (!Number.isSafeInteger(numberValue)) {\n context.throwTypeError()\n }\n\n return numberValue\n }\n\n context.throwTypeError()\n })\n\n // --- Validator Handlers ---\n addValidator('minLength', context => {\n if (context.value === undefined) return\n if (context.definition.type === 'string' && context.value.toString && context.value.toString().length < context.parameterValue) {\n context.throwParamError('MIN_LENGTH', `Length must be at least ${context.parameterValue} characters.`, { min: context.parameterValue, actual: context.value.toString().length })\n }\n })\n\n addValidator('min', context => {\n if (context.value === undefined) return\n if (isNumericDefinition(context.definition) && typeof context.value === 'number' && context.value < context.parameterValue) {\n context.throwParamError('MIN_VALUE', `Value must be at least ${context.parameterValue}.`, { min: context.parameterValue, actual: context.value })\n }\n })\n addValidator('maxLength', context => {\n if (context.value === undefined) return\n if (context.definition.type === 'string' && context.value.toString && context.value.toString().length > context.parameterValue) {\n context.throwParamError('MAX_LENGTH', `Length must be no more than ${context.parameterValue} characters.`, { max: context.parameterValue, actual: context.value.toString().length })\n }\n })\n\n addValidator('max', context => {\n if (context.value === undefined) return\n if (isNumericDefinition(context.definition) && typeof context.value === 'number' && context.value > context.parameterValue) {\n context.throwParamError('MAX_VALUE', `Value must be no more than ${context.parameterValue}.`, { max: context.parameterValue, actual: context.value })\n }\n })\n addValidator('enum', context => {\n if (!Array.isArray(context.parameterValue)) {\n throw new Error(`Enum for ${context.fieldName} must be an array.`)\n }\n\n const matches = context.parameterValue.some(allowedValue => deepEqual(allowedValue, context.value))\n if (!matches) {\n context.throwParamError('ENUM_VALUE', 'Value must match one of the allowed enum values.', {\n allowed: context.parameterValue\n })\n }\n })\n addValidator('pattern', context => {\n if (context.value === undefined) return\n if (context.definition.type !== 'string' || typeof context.value !== 'string') return\n\n const patternValue = context.parameterValue\n const matcher = patternValue instanceof RegExp\n ? new RegExp(patternValue.source, patternValue.flags)\n : typeof patternValue === 'string'\n ? new RegExp(patternValue)\n : null\n\n if (!matcher) {\n throw new Error(`Pattern for ${context.fieldName} must be a string or RegExp.`)\n }\n\n if (!matcher.test(context.value)) {\n context.throwParamError('PATTERN', 'Value does not match the required pattern.', {\n pattern: matcher.source\n })\n }\n })\n addValidator('strictBoolean', context => {\n if (!context.parameterValue) return\n if (context.definition.type !== 'boolean') {\n throw new Error(`strictBoolean can only be used on boolean fields (${context.fieldName}).`)\n }\n if (typeof context.valueBeforeCast !== 'boolean') {\n context.throwParamError('STRICT_BOOLEAN', 'Value must be a boolean.')\n }\n })\n addValidator('validator', context => {\n if (typeof context.parameterValue !== 'function') {\n throw new Error(`Validator for ${context.fieldName} must be a function.`)\n }\n const r = context.parameterValue(context.value, context.object, context)\n if (isThenable(r)) {\n throw new Error(`Custom validator for \"${context.fieldName}\" must be synchronous.`)\n }\n if (typeof r === 'string') {\n context.throwParamError('CUSTOM_VALIDATOR_FAILED', r)\n }\n })\n addValidator('uppercase', context => {\n if (typeof context.value === 'string') return context.value.toUpperCase()\n })\n addValidator('lowercase', context => {\n if (typeof context.value === 'string') return context.value.toLowerCase()\n })\n addValidator('length', context => {\n if (typeof context.value === 'string') {\n return context.value.substr(0, context.parameterValue)\n } else if (Number.isInteger(Number(context.valueBeforeCast)) && String(context.valueBeforeCast).length > context.parameterValue) {\n context.throwParamError('RANGE_EXCEEDED', 'Numeric value is out of the allowed character range.', { max: context.parameterValue, actual: String(context.valueBeforeCast).length })\n }\n })\n addValidator('notEmpty', context => {\n if (context.parameterValue && typeof context.value === 'string' && context.value === '') {\n context.throwParamError('NOT_EMPTY', 'Field cannot be empty.')\n }\n })\n addValidator('required', () => {}) // Stays as a no-op, logic is handled in _validateField\n\n // Add new validators for database alignment\n addValidator('unsigned', () => {}) // No-op, used for schema metadata\n addValidator('precision', () => {}) // No-op, used for schema metadata\n addValidator('scale', () => {}) // No-op, used for schema metadata\n addValidator('temporalPrecision', context => {\n if (context.definition.type !== 'time' && context.definition.type !== 'dateTime') {\n throw new Error(`temporalPrecision can only be used on time or dateTime fields (${context.fieldName}).`)\n }\n })\n addValidator('nullable', () => {}) // No-op, handled in Schema.js\n addValidator('nullOnEmpty', () => {}) // No-op, handled in Schema.js\n addValidator('defaultTo', () => {}) // No-op, handled in Schema.js\n }\n}\n\nexport default CorePlugin\n","/**\n * @file Small helper utilities for working with the flat dotted-path error map.\n */\n\nimport {\n buildPathSegments,\n isNumericSegment,\n isObjectLike,\n joinPath,\n setOwnProperty\n} from './path-helpers.js'\n\nfunction isValidationErrorObject (value) {\n return isObjectLike(value) &&\n typeof value.field === 'string' &&\n typeof value.code === 'string' &&\n typeof value.message === 'string' &&\n Object.hasOwn(value, 'params')\n}\n\nfunction flattenNestedErrorsInto (nestedValue, currentPath, flatErrors) {\n if (!isObjectLike(nestedValue)) {\n throw new Error(`flattenErrors() found an invalid nested error value at \"${currentPath}\".`)\n }\n\n if (isValidationErrorObject(nestedValue)) {\n if (currentPath === '') {\n throw new Error('flattenErrors() cannot flatten a root-level error object without a path.')\n }\n\n buildPathSegments(currentPath, 'flattenErrors')\n setOwnProperty(flatErrors, currentPath, nestedValue)\n return\n }\n\n const entries = Array.isArray(nestedValue)\n ? Object.entries(nestedValue)\n : Object.entries(nestedValue).sort(([left], [right]) => left.localeCompare(right))\n\n for (const [segment, childValue] of entries) {\n flattenNestedErrorsInto(childValue, joinPath(currentPath, segment), flatErrors)\n }\n}\n\n/**\n * Reads one error object from a flat dotted-path error map.\n * @param {Object.<string, object>} errors\n * @param {string} path\n * @returns {object|undefined}\n */\nexport function getError (errors, path) {\n buildPathSegments(path, 'getError')\n if (!isObjectLike(errors)) return undefined\n return Object.hasOwn(errors, path) ? errors[path] : undefined\n}\n\n/**\n * Checks whether a flat dotted-path error map contains a specific path.\n * @param {Object.<string, object>} errors\n * @param {string} path\n * @returns {boolean}\n */\nexport function hasError (errors, path) {\n return getError(errors, path) !== undefined\n}\n\n/**\n * Converts a flat dotted-path error map into a nested object/array structure.\n * @param {Object.<string, object>} errors\n * @returns {object}\n */\nexport function nestErrors (errors) {\n if (!isObjectLike(errors)) return {}\n\n const nestedErrors = {}\n\n for (const [path, error] of Object.entries(errors)) {\n const segments = buildPathSegments(path, 'nestErrors')\n let currentNode = nestedErrors\n\n for (let index = 0; index < segments.length; index++) {\n const segment = segments[index]\n const isLast = index === segments.length - 1\n\n if (isLast) {\n setOwnProperty(currentNode, segment, error)\n continue\n }\n\n const hasExistingNode = Object.hasOwn(currentNode, segment)\n const existingNode = hasExistingNode ? currentNode[segment] : undefined\n if (hasExistingNode && (!isObjectLike(existingNode) || isValidationErrorObject(existingNode))) {\n throw new Error(`nestErrors() cannot nest conflicting path \"${path}\".`)\n }\n\n if (!hasExistingNode) {\n const nextSegment = segments[index + 1]\n setOwnProperty(currentNode, segment, isNumericSegment(nextSegment) ? [] : {})\n }\n\n currentNode = currentNode[segment]\n }\n }\n\n return nestedErrors\n}\n\n/**\n * Converts a nested object/array error structure into the flat dotted-path map.\n * @param {object} nestedErrors\n * @returns {Object.<string, object>}\n */\nexport function flattenErrors (nestedErrors) {\n if (!isObjectLike(nestedErrors)) return {}\n\n const flatErrors = {}\n flattenNestedErrorsInto(nestedErrors, '', flatErrors)\n return flatErrors\n}\n","/**\n * @file Main entry point for the schema library.\n * Assembles and exports the `createSchema` factory function and related utilities.\n */\n\nimport { Schema } from './core/Schema.js'\nimport CorePlugin from './core/CorePlugin.js'\nimport { flattenErrors, getError, hasError, nestErrors } from './utils/error-helpers.js'\nimport { setOwnProperty } from './utils/path-helpers.js'\n\nconst factoryTypesBySource = new WeakMap()\nconst factoryValidatorsBySource = new WeakMap()\nconst registryMetadataSymbol = Symbol.for('json-rest-schema.registry-metadata')\n\nfunction registerTypeHandler (types, name, handler) {\n if (typeof handler !== 'function') {\n throw new Error(`Type handler for '${name}' must be a function.`)\n }\n setOwnProperty(types, name, handler)\n}\n\nfunction registerValidatorHandler (validators, name, handler) {\n if (typeof handler !== 'function') {\n throw new Error(`Validator handler for '${name}' must be a function.`)\n }\n setOwnProperty(validators, name, handler)\n}\n\nfunction createHandlerRegistry (source = {}) {\n const registry = Object.create(null)\n\n for (const [name, handler] of Object.entries(source)) {\n setOwnProperty(registry, name, handler)\n }\n\n return registry\n}\n\nfunction installPlugin (plugin, api) {\n if (typeof plugin.install !== 'function') {\n throw new Error('Plugin must have an install method.')\n }\n plugin.install(api)\n}\n\nfunction attachRegistryMetadata (target, types, validators) {\n factoryTypesBySource.set(target, types)\n factoryValidatorsBySource.set(target, validators)\n\n Object.defineProperty(target, registryMetadataSymbol, {\n value: Object.freeze({\n getTypes: () => types,\n getValidators: () => validators\n }),\n enumerable: false,\n configurable: false,\n writable: false\n })\n}\n\nfunction extractRegistryMetadata (source) {\n if (!source || (typeof source !== 'object' && typeof source !== 'function')) {\n return null\n }\n\n const types = factoryTypesBySource.get(source)\n const validators = factoryValidatorsBySource.get(source)\n if (types && validators) {\n return { types, validators }\n }\n\n const symbolMetadata = source[registryMetadataSymbol]\n if (\n symbolMetadata &&\n typeof symbolMetadata.getTypes === 'function' &&\n typeof symbolMetadata.getValidators === 'function'\n ) {\n return {\n types: symbolMetadata.getTypes(),\n validators: symbolMetadata.getValidators()\n }\n }\n\n if (\n typeof source === 'object' &&\n source.types &&\n typeof source.types === 'object' &&\n source.validators &&\n typeof source.validators === 'object' &&\n typeof source.create === 'function' &&\n typeof source.replace === 'function' &&\n typeof source.patch === 'function' &&\n typeof source.toJsonSchema === 'function'\n ) {\n return {\n types: source.types,\n validators: source.validators\n }\n }\n\n return null\n}\n\nfunction normalizeFactorySources (sources) {\n if (sources.length === 1 && Array.isArray(sources[0])) {\n return sources[0]\n }\n\n return sources\n}\n\nfunction areEquivalentHandlers (left, right) {\n return left === right\n}\n\nfunction mergeRegistryHandlers (target, source, kind) {\n for (const [name, handler] of Object.entries(source)) {\n if (Object.hasOwn(target, name) && !areEquivalentHandlers(target[name], handler)) {\n throw new Error(`Cannot merge schema factories with conflicting ${kind} \"${name}\".`)\n }\n setOwnProperty(target, name, handler)\n }\n}\n\nfunction resolveMergedRegistries (fallbackTypes, fallbackValidators, sources) {\n const normalizedSources = normalizeFactorySources(sources).filter(Boolean)\n if (normalizedSources.length < 1) {\n return {\n types: createHandlerRegistry(fallbackTypes),\n validators: createHandlerRegistry(fallbackValidators)\n }\n }\n\n const mergedTypes = Object.create(null)\n const mergedValidators = Object.create(null)\n for (const source of normalizedSources) {\n const metadata = extractRegistryMetadata(source)\n if (!metadata) {\n throw new Error('Factory sources must be schema instances or schema factories created by json-rest-schema.')\n }\n\n mergeRegistryHandlers(mergedTypes, metadata.types, 'type')\n mergeRegistryHandlers(mergedValidators, metadata.validators, 'validator')\n }\n\n return {\n types: mergedTypes,\n validators: mergedValidators\n }\n}\n\nfunction createSchemaFactory ({\n types = {},\n validators = {},\n installCore = true\n} = {}) {\n const factoryTypes = createHandlerRegistry(types)\n const factoryValidators = createHandlerRegistry(validators)\n\n const factory = (structure, options = {}) => {\n const schema = new Schema(\n structure,\n factoryTypes,\n factoryValidators,\n options.operations\n )\n attachRegistryMetadata(schema, factoryTypes, factoryValidators)\n return schema\n }\n\n attachRegistryMetadata(factory, factoryTypes, factoryValidators)\n\n factory.addType = (name, handler) => {\n registerTypeHandler(factoryTypes, name, handler)\n }\n\n factory.addValidator = (name, handler) => {\n registerValidatorHandler(factoryValidators, name, handler)\n }\n\n factory.use = (plugin) => {\n installPlugin(plugin, {\n addType: factory.addType,\n addValidator: factory.addValidator\n })\n }\n\n factory.createFactory = (...sources) => {\n const mergedRegistries = resolveMergedRegistries(factoryTypes, factoryValidators, sources)\n return createSchemaFactory({\n types: mergedRegistries.types,\n validators: mergedRegistries.validators,\n installCore: false\n })\n }\n\n if (installCore) {\n factory.use(CorePlugin)\n }\n\n return factory\n}\n\nconst createSchema = createSchemaFactory({ installCore: true })\n\nfunction addType (name, handler) {\n createSchema.addType(name, handler)\n}\n\nfunction addValidator (name, handler) {\n createSchema.addValidator(name, handler)\n}\n\nfunction use (plugin) {\n createSchema.use(plugin)\n}\n\nexport { createSchema, createSchemaFactory, addType, addValidator, use, getError, hasError, nestErrors, flattenErrors }\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10],"mappings":";;;;AAIA,SAAgB,cAAe,OAAO;CACpC,IAAI,UAAU,QAAQ,OAAO,UAAU,UAAU,OAAO;CAExD,MAAM,YAAY,OAAO,eAAe,KAAK;CAC7C,OACE,cAAc,OAAO,aACrB,cAAc,QACd,2BAA2B,SAAS;AAExC;AAEA,SAAS,2BAA4B,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