@orieljs/validation 0.1.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../errors.ts","../FormRequest.ts","../messages.ts","../MessageBag.ts","../rules/database.ts","../parse.ts","../rules/file.ts","../rules/format.ts","../rules/presence.ts","../rules/type.ts","../rules/size.ts","../registry.ts","../Rule.ts","../Validator.ts","../ValidationFactory.ts","../facade.ts","../ValidationServiceProvider.ts"],"sourcesContent":["import type { OrielError, ValidationError } from '@orieljs/contracts'\n\nexport class ValidationErrorImpl extends Error implements ValidationError {\n readonly kind = 'Validation' as const\n readonly status = 422\n override readonly name = 'ValidationError'\n constructor(\n readonly errors: Record<string, string[]>,\n readonly errorBag = 'default',\n readonly redirectTo?: string,\n ) {\n super('The given data was invalid.')\n }\n}\n\nexport class AuthorizationErrorImpl extends Error implements OrielError {\n readonly kind = 'Authorization' as const\n readonly status = 403\n override readonly name = 'AuthorizationError'\n constructor(message = 'This action is unauthorized.') {\n super(message)\n }\n}\n\nexport class UnknownValidationRuleError extends Error implements OrielError {\n readonly kind = 'Server' as const\n readonly status = 500\n override readonly name = 'UnknownValidationRuleError'\n constructor(name: string) {\n super(`Validation rule \"${name}\" is not registered. Register it with ValidationFactory.extend() first.`)\n }\n}\n\n/** A rule was written with a parameter it can't use (a bad regex, an unparseable date). A developer error, not a user one. */\nexport class InvalidRuleParameterError extends Error implements OrielError {\n readonly kind = 'Server' as const\n readonly status = 500\n override readonly name = 'InvalidRuleParameterError'\n constructor(rule: string, parameter: string, reason: string) {\n super(`Validation rule \"${rule}\" has an invalid parameter \"${parameter}\": ${reason}`)\n }\n}\n","import type { Rules } from '@orieljs/contracts'\nimport { HttpRequest, ValidationFactory } from '@orieljs/contracts'\nimport { inject } from '@orieljs/container'\nimport { AuthorizationErrorImpl } from './errors'\n\n/**\n * Mirrors Illuminate\\Foundation\\Http\\FormRequest, minus dependency injection by type (Oriel resolves the current\n * request and the ValidationFactory through inject(), never through constructor parameters — see spec §3 rule 5).\n * A subclass only has to implement rules(); authorize()/messages()/attributes() default to Laravel's own defaults.\n */\nexport abstract class FormRequest {\n abstract rules(): Rules\n\n authorize(): boolean | Promise<boolean> {\n return true\n }\n\n messages(): Record<string, string> {\n return {}\n }\n\n attributes(): Record<string, string> {\n return {}\n }\n\n /**\n * `const data = await StorePostRequest.validate()` (spec §4.3). Resolves the current request and the\n * ValidationFactory from the active container, runs authorize() first (throwing AuthorizationErrorImpl if it\n * returns false), then validates request.all() against rules()/messages()/attributes() and returns the typed\n * validated data (or throws the 422 ValidationError — see ValidatorImpl.validated()).\n */\n static async validate<T = Record<string, unknown>>(this: new () => FormRequest): Promise<T> {\n const instance = new this()\n if (!(await instance.authorize())) throw new AuthorizationErrorImpl()\n\n const request = inject(HttpRequest)\n const factory = inject(ValidationFactory)\n const validator = factory.make(request.all(), instance.rules(), instance.messages(), instance.attributes())\n return validator.validated<T>()\n }\n}\n","import { Str } from '@orieljs/support'\n\n/** Humanizes a (possibly dotted) attribute key, e.g. \"items.0.product_name\" -> \"items.0.product name\". */\nexport function defaultAttributeName(key: string): string {\n return key\n .split('.')\n .map((segment) => Str.snake(segment).replace(/_/g, ' '))\n .join('.')\n}\n\nexport function applyReplacements(template: string, replacements: Record<string, string>): string {\n return Object.entries(replacements).reduce((message, [key, value]) => message.replaceAll(`:${key}`, value), template)\n}\n\n/** Laravel's English lang/en/validation.php, reproduced as closely as possible (see plan Notes/assumptions). */\nexport const DEFAULT_MESSAGES: Record<string, string> = {\n required: 'The :attribute field is required.',\n required_if: 'The :attribute field is required when :other is :value.',\n required_unless: 'The :attribute field is required unless :other is in :values.',\n required_with: 'The :attribute field is required when :values is present.',\n required_with_all: 'The :attribute field is required when :values are present.',\n required_without: 'The :attribute field is required when :values is not present.',\n required_without_all: 'The :attribute field is required when none of :values are present.',\n string: 'The :attribute field must be a string.',\n integer: 'The :attribute field must be an integer.',\n numeric: 'The :attribute field must be a number.',\n boolean: 'The :attribute field must be true or false.',\n array: 'The :attribute field must be an array.',\n email: 'The :attribute field must be a valid email address.',\n url: 'The :attribute field must be a valid URL.',\n uuid: 'The :attribute field must be a valid UUID.',\n alpha: 'The :attribute field must only contain letters.',\n alpha_num: 'The :attribute field must only contain letters and numbers.',\n alpha_dash: 'The :attribute field must only contain letters, numbers, dashes and underscores.',\n regex: 'The :attribute field format is invalid.',\n confirmed: 'The :attribute field confirmation does not match.',\n same: 'The :attribute field must match :other.',\n different: 'The :attribute field must be different from :other.',\n accepted: 'The :attribute field must be accepted.',\n digits: 'The :attribute field must be :digits digits.',\n date: 'The :attribute field must be a valid date.',\n before: 'The :attribute field must be a date before :date.',\n after: 'The :attribute field must be a date after :date.',\n in: 'The selected :attribute is invalid.',\n not_in: 'The selected :attribute is invalid.',\n unique: 'The :attribute has already been taken.',\n exists: 'The selected :attribute is invalid.',\n file: 'The :attribute field must be a file.',\n image: 'The :attribute field must be an image.',\n mimes: 'The :attribute field must be a file of type: :values.',\n 'max.string': 'The :attribute field must not be greater than :max characters.',\n 'max.numeric': 'The :attribute field must not be greater than :max.',\n 'max.array': 'The :attribute field must not have more than :max items.',\n 'max.file': 'The :attribute field must not be greater than :max kilobytes.',\n 'min.string': 'The :attribute field must be at least :min characters.',\n 'min.numeric': 'The :attribute field must be at least :min.',\n 'min.array': 'The :attribute field must have at least :min items.',\n 'min.file': 'The :attribute field must be at least :min kilobytes.',\n 'between.string': 'The :attribute field must be between :min and :max characters.',\n 'between.numeric': 'The :attribute field must be between :min and :max.',\n 'between.array': 'The :attribute field must have between :min and :max items.',\n 'between.file': 'The :attribute field must be between :min and :max kilobytes.',\n 'size.string': 'The :attribute field must be :size characters.',\n 'size.numeric': 'The :attribute field must be :size.',\n 'size.array': 'The :attribute field must contain :size items.',\n 'size.file': 'The :attribute field must be :size kilobytes.',\n}\n","import type { MessageBag } from '@orieljs/contracts'\n\nexport class MessageBagImpl implements MessageBag {\n private readonly items: Record<string, string[]> = {}\n\n /** Not part of the MessageBag contract — used internally by ValidatorImpl and by after() hooks. */\n add(key: string, message: string): void {\n ;(this.items[key] ??= []).push(message)\n }\n\n has(key: string): boolean {\n return (this.items[key]?.length ?? 0) > 0\n }\n\n first(key?: string): string | undefined {\n if (key !== undefined) return this.items[key]?.[0]\n for (const messages of Object.values(this.items)) {\n if (messages[0] !== undefined) return messages[0]\n }\n return undefined\n }\n\n get(key: string): string[] {\n return this.items[key] ?? []\n }\n\n all(): string[] {\n return Object.values(this.items).flat()\n }\n\n isEmpty(): boolean {\n return Object.keys(this.items).length === 0\n }\n\n count(): number {\n return this.all().length\n }\n\n toObject(): Record<string, string[]> {\n return structuredClone(this.items)\n }\n}\n","import { DatabaseManager } from '@orieljs/contracts'\nimport { inject } from '@orieljs/container'\nimport type { BuiltinRule } from '../parse'\n\n/**\n * The column to query when a unique/exists rule doesn't name one: the attribute itself, except for a\n * wildcard-expanded field like \"items.0.email\", which checks the last non-numeric segment (\"email\") rather than a\n * column literally named after the path (Laravel's guessColumnForQuery).\n */\nexport function guessColumn(attribute: string, expandedFromWildcard = false): string {\n if (!expandedFromWildcard) return attribute\n return attribute.split('.').filter((segment) => !/^\\d+$/.test(segment)).at(-1) ?? attribute\n}\n\n/** Laravel's idiom `unique:users,email,NULL,id` (and an empty or null ignore) means \"exclude nothing\". */\nfunction isNoExcept(except: unknown): boolean {\n return except === undefined || except === null || except === '' || except === 'NULL'\n}\n\n/**\n * Shared query shape behind both `unique`/`exists` string rules and `Rule.unique()`/`Rule.exists()` (Review Focus\n * #2): resolve DatabaseManager, filter table/column on value, optionally exclude a record by idColumn/except, and\n * report whether any row matches. Kept in one place so a future fix to this path can't miss one of the two callers.\n */\nexport async function matchingRecordExists(\n table: string,\n column: string,\n value: unknown,\n except?: unknown,\n idColumn = 'id',\n): Promise<boolean> {\n const db = inject(DatabaseManager)\n let query = db.connection().table(table).where(column, value)\n if (!isNoExcept(except)) query = query.where(idColumn, '!=', except)\n return query.exists()\n}\n\nexport const databaseRules: Record<string, BuiltinRule> = {\n unique: {\n validate: async (ctx) => {\n const [table, column, except, idColumn] = ctx.parameters\n return !(await matchingRecordExists(table!, column || guessColumn(ctx.attribute, ctx.expandedFromWildcard), ctx.value, except, idColumn || 'id'))\n },\n messageKey: () => 'unique',\n },\n exists: {\n validate: async (ctx) => {\n const [table, column] = ctx.parameters\n return matchingRecordExists(table!, column || guessColumn(ctx.attribute, ctx.expandedFromWildcard), ctx.value)\n },\n messageKey: () => 'exists',\n },\n}\n","import type { ValidationRule } from '@orieljs/contracts'\nimport { Arr } from '@orieljs/support'\n\n/** Everything a single rule needs to validate one concrete field. */\nexport interface RuleContext {\n /** The concrete, wildcard-expanded field path, e.g. \"items.1.name\". */\n attribute: string\n /** True when `attribute` came from expanding a wildcard pattern such as \"items.*.email\". */\n expandedFromWildcard?: boolean\n value: unknown\n parameters: string[]\n data: Record<string, unknown>\n /** Every named rule attached to this field (for size-type resolution: numeric/array/file/string). */\n ruleNames: string[]\n}\n\nexport interface BuiltinRule {\n validate(ctx: RuleContext): boolean | Promise<boolean>\n /** Which DEFAULT_MESSAGES key to use, e.g. `max.${sizeType}`. Most rules return a constant name. */\n messageKey(ctx: RuleContext): string\n /** Extra :placeholder substitutions beyond :attribute (e.g. :max, :other, :values). */\n replacements?(ctx: RuleContext): Record<string, string>\n /** Used when messageKey() isn't in DEFAULT_MESSAGES (e.g. an extend()ed rule with a custom message). */\n defaultMessage?: string\n /** Runs even when the value is missing, blank, or null under nullable (the required* family, and accepted); a failure stops the field. */\n implicit?: boolean\n}\n\nexport type ParsedRule =\n | { kind: 'named'; name: string; parameters: string[] }\n | { kind: 'object'; rule: ValidationRule }\n\nfunction splitParameters(name: string, raw: string): string[] {\n // regex/not_regex parameters are never comma-split, so a pattern containing a comma survives intact.\n return name === 'regex' || name === 'not_regex' ? [raw] : raw.split(',')\n}\n\nfunction splitOnce(value: string, separator: string): [string, string | undefined] {\n const index = value.indexOf(separator)\n return index === -1 ? [value, undefined] : [value.slice(0, index), value.slice(index + 1)]\n}\n\nexport function parseRuleSpec(spec: string | ReadonlyArray<string | ValidationRule>): ParsedRule[] {\n const items = typeof spec === 'string' ? spec.split('|') : spec\n return items\n .filter((item) => item !== '')\n .map((item): ParsedRule => {\n if (typeof item !== 'string') return { kind: 'object', rule: item }\n const [name, raw] = splitOnce(item, ':')\n return { kind: 'named', name, parameters: raw === undefined ? [] : splitParameters(name, raw) }\n })\n}\n\n/** Laravel's definition of \"empty\" for the required family: null, undefined, '' and []. false and 0 are NOT empty. */\nexport function isEmptyValue(value: unknown): boolean {\n if (value === null || value === undefined) return true\n if (typeof value === 'string') return value === ''\n if (Array.isArray(value)) return value.length === 0\n return false\n}\n\n/** Duck-types Contracts/Http's UploadedFile without importing @orieljs/http. */\nexport function isUploadedFileLike(value: unknown): value is {\n clientName: string\n mimeType: string\n size: number\n extension(): string\n arrayBuffer(): Promise<ArrayBuffer>\n} {\n return (\n typeof value === 'object' &&\n value !== null &&\n typeof (value as Record<string, unknown>).clientName === 'string' &&\n typeof (value as Record<string, unknown>).arrayBuffer === 'function'\n )\n}\n\n/**\n * Keys that must never be followed or written when walking user input: assigning through them reaches\n * Object.prototype (or a constructor) instead of a plain data slot. Mirrors the guard in Arr.set.\n */\nexport const UNSAFE_KEYS: ReadonlySet<string> = new Set(['__proto__', 'prototype', 'constructor'])\n\n/**\n * Expands a `*`-wildcard rule pattern (e.g. \"items.*.name\") into every concrete path present in `data`\n * (e.g. [\"items.0.name\", \"items.1.name\"]). A pattern with no `*` is returned unchanged. A `*` segment whose\n * container is missing, not an array and not a plain object expands to nothing for that branch (Review Focus #4:\n * every reported error is keyed by a concrete path, never the literal pattern). Object keys in UNSAFE_KEYS are\n * treated as absent, so a JSON body like {\"items\":{\"__proto__\":{...}}} never yields a path through the prototype.\n */\nexport function expandWildcardKeys(pattern: string, data: Record<string, unknown>): string[] {\n const segments = pattern.split('.')\n let paths = ['']\n for (const segment of segments) {\n const next: string[] = []\n for (const base of paths) {\n const prefix = base === '' ? '' : `${base}.`\n if (segment !== '*') {\n next.push(`${prefix}${segment}`)\n continue\n }\n const container = Arr.get<unknown>(data, base === '' ? undefined : base)\n if (Array.isArray(container)) {\n container.forEach((_, index) => next.push(`${prefix}${index}`))\n } else if (container !== null && typeof container === 'object') {\n Object.keys(container)\n .filter((key) => !UNSAFE_KEYS.has(key))\n .forEach((key) => next.push(`${prefix}${key}`))\n }\n }\n paths = next\n }\n return paths\n}\n","import type { BuiltinRule } from '../parse'\nimport { isUploadedFileLike } from '../parse'\n\nconst IMAGE_EXTENSIONS = new Set(['jpg', 'jpeg', 'png', 'bmp', 'gif', 'svg', 'webp'])\n\nexport const fileRules: Record<string, BuiltinRule> = {\n file: { validate: (ctx) => isUploadedFileLike(ctx.value), messageKey: () => 'file' },\n image: {\n validate: (ctx) => {\n if (!isUploadedFileLike(ctx.value)) return false\n if (ctx.value.mimeType.startsWith('image/')) return true\n return IMAGE_EXTENSIONS.has(ctx.value.extension().toLowerCase())\n },\n messageKey: () => 'image',\n },\n mimes: {\n validate: (ctx) => {\n if (!isUploadedFileLike(ctx.value)) return false\n const allowed = ctx.parameters.map((p) => p.toLowerCase())\n return allowed.includes(ctx.value.extension().toLowerCase())\n },\n messageKey: () => 'mimes',\n replacements: (ctx) => ({ values: ctx.parameters.join(', ') }),\n },\n}\n","import { Arr } from '@orieljs/support'\nimport type { BuiltinRule, RuleContext } from '../parse'\nimport { InvalidRuleParameterError } from '../errors'\nimport { defaultAttributeName } from '../messages'\n\nconst EMAIL_RE = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/\nconst UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i\nconst ALPHA_RE = /^[A-Za-z]+$/\nconst ALPHA_NUM_RE = /^[A-Za-z0-9]+$/\nconst ALPHA_DASH_RE = /^[A-Za-z0-9_-]+$/\nconst ACCEPTED_VALUES: unknown[] = ['yes', 'on', 1, '1', true, 'true']\n\nfunction compileRegex(raw: string): RegExp {\n const match = /^\\/(.*)\\/([a-z]*)$/.exec(raw)\n try {\n return match ? new RegExp(match[1]!, match[2]) : new RegExp(raw)\n } catch (error) {\n throw new InvalidRuleParameterError('regex', raw, error instanceof Error ? error.message : String(error))\n }\n}\n\n/**\n * Shapes a string must have before it counts as a date. Date.parse alone is far too lenient (V8 reads \"1\" as the\n * year 2001), so a value needs an ISO date, a slashed/dotted/dashed day-month-year, or a month name with a number.\n */\nconst DATE_SHAPES = [\n /^\\d{4}-\\d{1,2}-\\d{1,2}(?:[T\\s].*)?$/,\n /^\\d{1,2}[/.-]\\d{1,2}[/.-]\\d{2,4}(?:\\s.*)?$/,\n /^(?=.*\\d).*\\b(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)[a-z]*\\b/i,\n]\nconst DATE_ONLY_RE = /^(\\d{4})-(\\d{2})-(\\d{2})$/\n\n/**\n * Parses a user-supplied date string to epoch milliseconds, or NaN. A bare YYYY-MM-DD means local midnight, like\n * PHP's strtotime, so it compares sensibly against `today`/`tomorrow`.\n */\nfunction parseDate(value: string): number {\n const trimmed = value.trim()\n if (!DATE_SHAPES.some((shape) => shape.test(trimmed))) return Number.NaN\n const dateOnly = DATE_ONLY_RE.exec(trimmed)\n if (dateOnly) {\n const [, y, m, d] = dateOnly.map(Number) as [number, number, number, number]\n const local = new Date(y, m - 1, d)\n return local.getMonth() === m - 1 && local.getDate() === d ? local.getTime() : Number.NaN\n }\n return Date.parse(trimmed)\n}\n\nfunction startOfDay(offsetDays: number): number {\n const date = new Date()\n date.setHours(0, 0, 0, 0)\n date.setDate(date.getDate() + offsetDays)\n return date.getTime()\n}\n\nconst RELATIVE_RE = /^([+-]\\d+)\\s*(second|minute|hour|day|week|month|year)s?$/i\n\n/** strtotime's keywords (today, tomorrow, yesterday, now) and \"+N unit\"/\"-N unit\" offsets from now, or undefined. */\nfunction relativeDate(param: string): number | undefined {\n switch (param.trim().toLowerCase()) {\n case 'now':\n return Date.now()\n case 'today':\n return startOfDay(0)\n case 'tomorrow':\n return startOfDay(1)\n case 'yesterday':\n return startOfDay(-1)\n }\n const match = RELATIVE_RE.exec(param.trim())\n if (!match) return undefined\n const amount = Number(match[1])\n const date = new Date()\n switch (match[2]!.toLowerCase()) {\n case 'second':\n date.setSeconds(date.getSeconds() + amount)\n break\n case 'minute':\n date.setMinutes(date.getMinutes() + amount)\n break\n case 'hour':\n date.setHours(date.getHours() + amount)\n break\n case 'day':\n date.setDate(date.getDate() + amount)\n break\n case 'week':\n date.setDate(date.getDate() + amount * 7)\n break\n case 'month':\n date.setMonth(date.getMonth() + amount)\n break\n case 'year':\n date.setFullYear(date.getFullYear() + amount)\n break\n }\n return date.getTime()\n}\n\n/** An attribute path such as \"starts_at\" or \"event.starts_at\". */\nconst FIELD_REFERENCE_RE = /^[A-Za-z_][\\w-]*(?:\\.[\\w-]+)*$/\n\n/**\n * Resolves a before/after parameter, in order: another field's date value, a relative keyword/offset, a literal\n * date. A parameter shaped like a field name whose field is missing or not a date gives NaN (the user's value\n * fails). Anything else that can't be parsed is a mistake in the rule itself, so it throws a 'Server' error\n * instead of blaming the user's input.\n */\nfunction resolveDateParam(rule: string, param: string, data: Record<string, unknown>): number {\n const fieldValue = Arr.get<unknown>(data, param)\n if (typeof fieldValue === 'string') {\n const parsed = parseDate(fieldValue)\n if (!Number.isNaN(parsed)) return parsed\n }\n const relative = relativeDate(param)\n if (relative !== undefined) return relative\n const literal = parseDate(param)\n if (!Number.isNaN(literal)) return literal\n if (FIELD_REFERENCE_RE.test(param)) return Number.NaN\n throw new InvalidRuleParameterError(rule, param, 'expected a date, today/tomorrow/yesterday/now, \"+N unit\", or a field name')\n}\n\nfunction compareDate(ctx: RuleContext, rule: 'before' | 'after'): boolean {\n const target = resolveDateParam(rule, ctx.parameters[0] ?? '', ctx.data)\n if (typeof ctx.value !== 'string') return false\n const value = parseDate(ctx.value)\n if (Number.isNaN(value) || Number.isNaN(target)) return false\n return rule === 'before' ? value < target : value > target\n}\n\nexport const formatRules: Record<string, BuiltinRule> = {\n email: { validate: (ctx) => typeof ctx.value === 'string' && EMAIL_RE.test(ctx.value), messageKey: () => 'email' },\n url: {\n validate: (ctx) => {\n if (typeof ctx.value !== 'string') return false\n try {\n new URL(ctx.value)\n return true\n } catch {\n return false\n }\n },\n messageKey: () => 'url',\n },\n uuid: { validate: (ctx) => typeof ctx.value === 'string' && UUID_RE.test(ctx.value), messageKey: () => 'uuid' },\n alpha: { validate: (ctx) => typeof ctx.value === 'string' && ALPHA_RE.test(ctx.value), messageKey: () => 'alpha' },\n alpha_num: {\n validate: (ctx) => typeof ctx.value === 'string' && ALPHA_NUM_RE.test(ctx.value),\n messageKey: () => 'alpha_num',\n },\n alpha_dash: {\n validate: (ctx) => typeof ctx.value === 'string' && ALPHA_DASH_RE.test(ctx.value),\n messageKey: () => 'alpha_dash',\n },\n regex: {\n validate: (ctx) => typeof ctx.value === 'string' && compileRegex(ctx.parameters[0] ?? '').test(ctx.value),\n messageKey: () => 'regex',\n },\n confirmed: {\n validate: (ctx: RuleContext) => ctx.value === Arr.get(ctx.data, `${ctx.attribute}_confirmation`),\n messageKey: () => 'confirmed',\n },\n same: {\n validate: (ctx) => ctx.value === Arr.get(ctx.data, ctx.parameters[0] ?? ''),\n messageKey: () => 'same',\n replacements: (ctx) => ({ other: defaultAttributeName(ctx.parameters[0] ?? '') }),\n },\n different: {\n validate: (ctx) => ctx.value !== Arr.get(ctx.data, ctx.parameters[0] ?? ''),\n messageKey: () => 'different',\n replacements: (ctx) => ({ other: defaultAttributeName(ctx.parameters[0] ?? '') }),\n },\n accepted: { implicit: true, validate: (ctx) => ACCEPTED_VALUES.includes(ctx.value), messageKey: () => 'accepted' },\n digits: {\n validate: (ctx) =>\n typeof ctx.value !== 'object' && new RegExp(`^\\\\d{${ctx.parameters[0]}}$`).test(String(ctx.value)),\n messageKey: () => 'digits',\n replacements: (ctx) => ({ digits: ctx.parameters[0] ?? '' }),\n },\n date: {\n validate: (ctx) => typeof ctx.value === 'string' && !Number.isNaN(parseDate(ctx.value)),\n messageKey: () => 'date',\n },\n before: {\n validate: (ctx) => compareDate(ctx, 'before'),\n messageKey: () => 'before',\n replacements: (ctx) => ({ date: ctx.parameters[0] ?? '' }),\n },\n after: {\n validate: (ctx) => compareDate(ctx, 'after'),\n messageKey: () => 'after',\n replacements: (ctx) => ({ date: ctx.parameters[0] ?? '' }),\n },\n}\n","import { Arr } from '@orieljs/support'\nimport type { BuiltinRule, RuleContext } from '../parse'\nimport { isEmptyValue } from '../parse'\n\nfunction isFieldPresent(field: string, data: Record<string, unknown>): boolean {\n return Arr.has(data, field) && !isEmptyValue(Arr.get(data, field))\n}\n\nfunction anyPresent(fields: string[], data: Record<string, unknown>): boolean {\n return fields.some((field) => isFieldPresent(field, data))\n}\n\nfunction allPresent(fields: string[], data: Record<string, unknown>): boolean {\n return fields.every((field) => isFieldPresent(field, data))\n}\n\nexport const presenceRules: Record<string, BuiltinRule> = {\n required: {\n implicit: true,\n validate: (ctx: RuleContext) => !isEmptyValue(ctx.value),\n messageKey: () => 'required',\n },\n required_if: {\n implicit: true,\n validate: (ctx: RuleContext) => {\n const [other, ...values] = ctx.parameters\n const applies = values.includes(String(Arr.get(ctx.data, other)))\n return !applies || !isEmptyValue(ctx.value)\n },\n messageKey: () => 'required_if',\n replacements: (ctx) => ({ other: ctx.parameters[0] ?? '', value: ctx.parameters.slice(1).join(', ') }),\n },\n required_unless: {\n implicit: true,\n validate: (ctx: RuleContext) => {\n const [other, ...values] = ctx.parameters\n const applies = !values.includes(String(Arr.get(ctx.data, other)))\n return !applies || !isEmptyValue(ctx.value)\n },\n messageKey: () => 'required_unless',\n replacements: (ctx) => ({ other: ctx.parameters[0] ?? '', values: ctx.parameters.slice(1).join(', ') }),\n },\n required_with: {\n implicit: true,\n validate: (ctx: RuleContext) => !anyPresent(ctx.parameters, ctx.data) || !isEmptyValue(ctx.value),\n messageKey: () => 'required_with',\n replacements: (ctx) => ({ values: ctx.parameters.join(' / ') }),\n },\n required_with_all: {\n implicit: true,\n validate: (ctx: RuleContext) => !allPresent(ctx.parameters, ctx.data) || !isEmptyValue(ctx.value),\n messageKey: () => 'required_with_all',\n replacements: (ctx) => ({ values: ctx.parameters.join(' / ') }),\n },\n required_without: {\n implicit: true,\n validate: (ctx: RuleContext) => ctx.parameters.every((f) => isFieldPresent(f, ctx.data)) || !isEmptyValue(ctx.value),\n messageKey: () => 'required_without',\n replacements: (ctx) => ({ values: ctx.parameters.join(' / ') }),\n },\n required_without_all: {\n implicit: true,\n validate: (ctx: RuleContext) => anyPresent(ctx.parameters, ctx.data) || !isEmptyValue(ctx.value),\n messageKey: () => 'required_without_all',\n replacements: (ctx) => ({ values: ctx.parameters.join(' / ') }),\n },\n}\n","import type { BuiltinRule } from '../parse'\n\nconst BOOLEAN_VALUES: unknown[] = [true, false, 0, 1, '0', '1']\n\n/** PHP's is_numeric for strings: optional surrounding whitespace and sign, decimal digits, optional exponent. */\nconst NUMERIC_STRING_RE = /^\\s*[+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+-]?\\d+)?\\s*$/\n\n/**\n * Laravel's `numeric` (PHP is_numeric): a finite number, or a decimal string. Unlike `Number()`, it rejects\n * \"Infinity\", hex/binary/octal literals (\"0x1F\", \"0b101\", \"0o7\") and the empty string.\n */\nexport function isNumeric(value: unknown): boolean {\n if (typeof value === 'number') return Number.isFinite(value)\n return typeof value === 'string' && NUMERIC_STRING_RE.test(value)\n}\n\nexport const typeRules: Record<string, BuiltinRule> = {\n string: { validate: (ctx) => typeof ctx.value === 'string', messageKey: () => 'string' },\n integer: {\n validate: (ctx) => typeof ctx.value !== 'object' && /^-?\\d+$/.test(String(ctx.value).trim()),\n messageKey: () => 'integer',\n },\n numeric: {\n validate: (ctx) => isNumeric(ctx.value),\n messageKey: () => 'numeric',\n },\n boolean: { validate: (ctx) => BOOLEAN_VALUES.includes(ctx.value), messageKey: () => 'boolean' },\n array: { validate: (ctx) => Array.isArray(ctx.value), messageKey: () => 'array' },\n}\n","import type { BuiltinRule, RuleContext } from '../parse'\nimport { isUploadedFileLike } from '../parse'\nimport { isNumeric } from './type'\n\ntype SizeType = 'numeric' | 'array' | 'file' | 'string'\n\nfunction hasAny(ctx: RuleContext, names: string[]): boolean {\n return names.some((name) => ctx.ruleNames.includes(name))\n}\n\n/** A JSON object is a PHP associative array, so it's counted like one. */\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n if (typeof value !== 'object' || value === null) return false\n const proto: unknown = Object.getPrototypeOf(value)\n return proto === Object.prototype || proto === null\n}\n\n/**\n * What a size rule measures and which message family it reports, decided in one place so the check and the\n * message always agree (Laravel's getSize + getAttributeType):\n * - numeric/integer rule: the number itself (a non-numeric value falls back to its string length, which the\n * numeric rule rejects anyway);\n * - an array (or plain object): its item count;\n * - an uploaded file: its size in fractional kilobytes;\n * - a file/image rule on something that isn't a file: NaN, so every size comparison fails;\n * - anything else: the length of its string form (a number without a numeric rule counts its digits).\n */\nfunction measure(ctx: RuleContext): { type: SizeType; size: number } {\n const { value } = ctx\n if (hasAny(ctx, ['numeric', 'integer'])) {\n return { type: 'numeric', size: isNumeric(value) ? Number(value) : stringLength(value) }\n }\n if (Array.isArray(value)) return { type: 'array', size: value.length }\n if (isUploadedFileLike(value)) return { type: 'file', size: value.size / 1024 }\n if (hasAny(ctx, ['file', 'image'])) return { type: 'file', size: Number.NaN }\n if (isPlainObject(value)) return { type: 'array', size: Object.keys(value).length }\n if (hasAny(ctx, ['array'])) return { type: 'array', size: stringLength(value) }\n return { type: 'string', size: stringLength(value) }\n}\n\nfunction stringLength(value: unknown): number {\n if (value === null || value === undefined) return 0\n return [...String(value)].length\n}\n\nfunction sizeOf(ctx: RuleContext): number {\n return measure(ctx).size\n}\n\nfunction sizeType(ctx: RuleContext): SizeType {\n return measure(ctx).type\n}\n\nexport const sizeRules: Record<string, BuiltinRule> = {\n max: {\n validate: (ctx) => sizeOf(ctx) <= Number(ctx.parameters[0]),\n messageKey: (ctx) => `max.${sizeType(ctx)}`,\n replacements: (ctx) => ({ max: ctx.parameters[0] ?? '' }),\n },\n min: {\n validate: (ctx) => sizeOf(ctx) >= Number(ctx.parameters[0]),\n messageKey: (ctx) => `min.${sizeType(ctx)}`,\n replacements: (ctx) => ({ min: ctx.parameters[0] ?? '' }),\n },\n between: {\n validate: (ctx) => {\n const size = sizeOf(ctx)\n return size >= Number(ctx.parameters[0]) && size <= Number(ctx.parameters[1])\n },\n messageKey: (ctx) => `between.${sizeType(ctx)}`,\n replacements: (ctx) => ({ min: ctx.parameters[0] ?? '', max: ctx.parameters[1] ?? '' }),\n },\n size: {\n validate: (ctx) => sizeOf(ctx) === Number(ctx.parameters[0]),\n messageKey: (ctx) => `size.${sizeType(ctx)}`,\n replacements: (ctx) => ({ size: ctx.parameters[0] ?? '' }),\n },\n in: { validate: (ctx) => ctx.parameters.includes(String(ctx.value)), messageKey: () => 'in' },\n not_in: { validate: (ctx) => !ctx.parameters.includes(String(ctx.value)), messageKey: () => 'not_in' },\n}\n","import type { BuiltinRule } from './parse'\nimport { databaseRules } from './rules/database'\nimport { fileRules } from './rules/file'\nimport { formatRules } from './rules/format'\nimport { presenceRules } from './rules/presence'\nimport { sizeRules } from './rules/size'\nimport { typeRules } from './rules/type'\n\n/** Every built-in rule, merged. Later tasks (database rules) add their own spread here. */\nexport const builtinRules: Record<string, BuiltinRule> = {\n ...presenceRules,\n ...typeRules,\n ...formatRules,\n ...sizeRules,\n ...fileRules,\n ...databaseRules,\n}\n","import type { ValidationRule } from '@orieljs/contracts'\nimport { applyReplacements, DEFAULT_MESSAGES, defaultAttributeName } from './messages'\nimport { guessColumn, matchingRecordExists } from './rules/database'\n\n/**\n * Base for the fluent builders. Each one reports under a built-in rule name (`in`, `unique`, `exists`), so when it\n * runs inside a Validator its failure goes through exactly the same lookup as the string rule: custom messages\n * (\"email.unique\", \"items.*.email.unique\", \"unique\"), custom attributes, then the default text. Called directly\n * as a plain ValidationRule, validate() fails with the default English message.\n */\nexport abstract class BuiltinRuleObject implements ValidationRule {\n abstract readonly ruleName: string\n\n abstract passes(attribute: string, value: unknown, data: Record<string, unknown>, expandedFromWildcard?: boolean): boolean | Promise<boolean>\n\n // Declares all 4 contract parameters so a subclass's inferred type (from `Rule.in(...)` etc.) still accepts a\n // call with the full 4-arg ValidationRule.validate signature, as Rule.test.ts makes.\n async validate(attribute: string, value: unknown, fail: (message: string) => void, data: Record<string, unknown>, expandedFromWildcard = false): Promise<void> {\n if (await this.passes(attribute, value, data, expandedFromWildcard)) return\n fail(applyReplacements(DEFAULT_MESSAGES[this.ruleName]!, { attribute: defaultAttributeName(attribute) }))\n }\n}\n\nclass InRule extends BuiltinRuleObject {\n readonly ruleName = 'in'\n\n constructor(private readonly values: readonly unknown[]) {\n super()\n }\n\n passes(_attribute: string, value: unknown): boolean {\n return this.values.map(String).includes(String(value))\n }\n}\n\n/** Structural shape of Database's Model — duck-typed so this package never imports `@orieljs/database` (B27). */\ninterface ModelInstanceLike {\n getKey(): unknown\n getKeyName(): string\n}\n\nfunction isModelInstance(value: unknown): value is ModelInstanceLike {\n return (\n typeof value === 'object' &&\n value !== null &&\n typeof (value as ModelInstanceLike).getKey === 'function' &&\n typeof (value as ModelInstanceLike).getKeyName === 'function'\n )\n}\n\nclass UniqueRule extends BuiltinRuleObject {\n readonly ruleName = 'unique'\n private exceptId: unknown\n private idColumnName: string | undefined\n\n constructor(\n private readonly table: string,\n private readonly column?: string,\n ) {\n super()\n }\n\n /**\n * Excludes the current record from the uniqueness check. Laravel's `Rule::unique('users')->ignore($user)` accepts\n * a model directly (the common case: \"update your profile without changing your email\"), so a model instance is\n * bound by its key (`getKey()`/`getKeyName()`), not the object itself — the object would reach the query builder\n * as an opaque value and either be rejected by the driver or stringified (B27). A plain id still works as before;\n * null (or \"NULL\") excludes nothing.\n */\n ignore(id: unknown, idColumn?: string): this {\n if (isModelInstance(id)) {\n this.exceptId = id.getKey()\n this.idColumnName = idColumn ?? id.getKeyName()\n } else {\n this.exceptId = id\n this.idColumnName = idColumn ?? 'id'\n }\n return this\n }\n\n async passes(attribute: string, value: unknown, _data?: Record<string, unknown>, expandedFromWildcard = false): Promise<boolean> {\n const column = this.column ?? guessColumn(attribute, expandedFromWildcard)\n return !(await matchingRecordExists(this.table, column, value, this.exceptId, this.idColumnName ?? 'id'))\n }\n}\n\nclass ExistsRule extends BuiltinRuleObject {\n readonly ruleName = 'exists'\n\n constructor(\n private readonly table: string,\n private readonly column?: string,\n ) {\n super()\n }\n\n passes(attribute: string, value: unknown, _data?: Record<string, unknown>, expandedFromWildcard = false): Promise<boolean> {\n return matchingRecordExists(this.table, this.column ?? guessColumn(attribute, expandedFromWildcard), value)\n }\n}\n\n/** Fluent rule-object builders, for when a plain string rule can't express what's needed (e.g. .ignore()). */\nexport const Rule = {\n in: (values: readonly unknown[]): InRule => new InRule(values),\n unique: (table: string, column?: string): UniqueRule => new UniqueRule(table, column),\n exists: (table: string, column?: string): ExistsRule => new ExistsRule(table, column),\n}\n","import type { Rules, Validator } from '@orieljs/contracts'\nimport { Arr } from '@orieljs/support'\nimport { UnknownValidationRuleError, ValidationErrorImpl } from './errors'\nimport { MessageBagImpl } from './MessageBag'\nimport { BuiltinRuleObject } from './Rule'\nimport { applyReplacements, DEFAULT_MESSAGES, defaultAttributeName } from './messages'\nimport type { BuiltinRule, ParsedRule, RuleContext } from './parse'\nimport { expandWildcardKeys, parseRuleSpec, UNSAFE_KEYS } from './parse'\n\nconst SKIPPED_MODIFIERS = new Set(['bail', 'nullable', 'sometimes'])\n\n/**\n * Rebuilds a nested structure from flat dot-paths, the way Laravel's validated() does for wildcard fields.\n * `Arr.undot` (from @orieljs/support) always builds plain objects; it can't know \"items.0\"/\"items.1\" should\n * become an array. This walks the same way, then promotes any container it created itself whose keys are exactly\n * \"0\", \"1\", \"2\", … in order into a real array. Leaf values copied from the input (a Date, an uploaded file, an\n * object that happens to have \"0\"/\"1\" keys) are returned untouched, by identity. A path with a segment in\n * UNSAFE_KEYS is dropped, so nothing can be written through to Object.prototype. The input is never mutated.\n */\nfunction buildNested(flat: Record<string, unknown>): Record<string, unknown> {\n const root: Record<string, unknown> = {}\n const created = new Set<object>([root])\n for (const [path, value] of Object.entries(flat)) {\n const parts = path.split('.')\n if (parts.some((part) => UNSAFE_KEYS.has(part))) continue\n let current = root\n for (const part of parts.slice(0, -1)) {\n const existing = Object.hasOwn(current, part) ? current[part] : undefined\n if (typeof existing === 'object' && existing !== null && created.has(existing)) {\n current = existing as Record<string, unknown>\n continue\n }\n const container = cloneContainer(existing)\n created.add(container)\n current[part] = container\n current = container\n }\n current[parts.at(-1)!] = value\n }\n return arrayify(root, created) as Record<string, unknown>\n}\n\nfunction isPlainContainer(value: unknown): value is Record<string, unknown> {\n if (Array.isArray(value)) return true\n if (typeof value !== 'object' || value === null) return false\n const proto: unknown = Object.getPrototypeOf(value)\n return proto === Object.prototype || proto === null\n}\n\n/**\n * A fresh container to write a child path into. When a parent key was already copied from the input (rules on both\n * \"user\" and \"user.name\"), its plain contents are kept (Laravel returns the whole parent) but copied, so the input\n * is never mutated. Anything else (missing, a scalar, a class instance) starts empty.\n */\nfunction cloneContainer(existing: unknown): Record<string, unknown> {\n const container: Record<string, unknown> = {}\n if (!isPlainContainer(existing)) return container\n for (const [key, value] of Object.entries(existing)) {\n if (!UNSAFE_KEYS.has(key)) container[key] = value\n }\n return container\n}\n\nfunction arrayify(node: unknown, created: ReadonlySet<object>): unknown {\n if (node === null || typeof node !== 'object' || !created.has(node)) return node\n const entries = Object.entries(node as Record<string, unknown>).map(([k, v]) => [k, arrayify(v, created)] as const)\n const keys = entries.map(([k]) => k)\n const isArrayLike = keys.length > 0 && keys.every((k, i) => k === String(i))\n return isArrayLike ? entries.map(([, v]) => v) : Object.fromEntries(entries)\n}\n\n/**\n * Runs each field's rules the way Laravel's Validator does:\n * - a missing key, or a string that is blank after trimming, only runs implicit rules (the required* family and\n * accepted); every other rule, including ValidationRule objects, is skipped for it;\n * - an explicit null runs every rule unless the field is `nullable` (then only implicit rules run), so\n * `{ age: null }` still fails `integer`;\n * - `sometimes` skips a missing field entirely;\n * - a field stops validating after its first failure under `bail`, or after any implicit rule fails.\n */\nexport class ValidatorImpl implements Validator {\n private bag: MessageBagImpl | undefined\n private ranPromise: Promise<boolean> | undefined\n private readonly afterCallbacks: Array<(validator: Validator) => void | Promise<void>> = []\n\n constructor(\n private readonly data: Record<string, unknown>,\n private readonly rules: Rules,\n private readonly customMessages: Record<string, string>,\n private readonly customAttributes: Record<string, string>,\n private readonly registry: Record<string, BuiltinRule>,\n private readonly errorBagName = 'default',\n ) {}\n\n after(callback: (validator: Validator) => void | Promise<void>): this {\n this.afterCallbacks.push(callback)\n return this\n }\n\n /** Not part of the Validator contract — lets an after() hook add a failure (MessageBag itself is read-only). */\n fail(field: string, message: string): void {\n this.bag ??= new MessageBagImpl()\n this.bag.add(field, message)\n }\n\n async passes(): Promise<boolean> {\n this.ranPromise ??= this.run()\n return this.ranPromise\n }\n\n async fails(): Promise<boolean> {\n return !(await this.passes())\n }\n\n errors(): MessageBagImpl {\n return this.bag ?? new MessageBagImpl()\n }\n\n async validated<T = Record<string, unknown>>(): Promise<T> {\n if (!(await this.passes())) throw new ValidationErrorImpl(this.bag!.toObject(), this.errorBagName)\n const flat: Record<string, unknown> = {}\n for (const pattern of Object.keys(this.rules)) {\n for (const field of this.fieldsFor(pattern)) {\n if (Arr.has(this.data, field)) flat[field] = Arr.get(this.data, field)\n }\n }\n return buildNested(flat) as T\n }\n\n private fieldsFor(pattern: string): string[] {\n return pattern.includes('*') ? expandWildcardKeys(pattern, this.data) : [pattern]\n }\n\n private async run(): Promise<boolean> {\n this.bag = new MessageBagImpl()\n\n for (const [pattern, spec] of Object.entries(this.rules)) {\n const parsed = parseRuleSpec(spec)\n const names = parsed.filter((r): r is Extract<ParsedRule, { kind: 'named' }> => r.kind === 'named').map((r) => r.name)\n const bail = names.includes('bail')\n const nullable = names.includes('nullable')\n const sometimes = names.includes('sometimes')\n\n for (const field of this.fieldsFor(pattern)) {\n const present = Arr.has(this.data, field)\n if (sometimes && !present) continue\n\n const value = Arr.get(this.data, field)\n const isNull = value === null || value === undefined\n const isBlank = typeof value === 'string' && value.trim() === ''\n\n for (const rule of parsed) {\n if (rule.kind === 'named' && SKIPPED_MODIFIERS.has(rule.name)) continue\n const implicit = rule.kind === 'named' && (this.registry[rule.name]?.implicit ?? false)\n // Laravel's presentOrRuleIsImplicit: a missing key or a blank string only runs implicit rules.\n if (!implicit && (!present || isBlank)) continue\n // Laravel's isNotNullIfMarkedAsNullable: nullable + null only runs implicit rules.\n if (!implicit && nullable && isNull) continue\n\n const message = await this.runRule(rule, field, pattern, value, names)\n if (message !== undefined) {\n this.bag.add(field, message)\n // Laravel's shouldStopValidating: bail stops at the first failure; a failed implicit rule always stops.\n if (bail || implicit) break\n }\n }\n }\n }\n\n for (const callback of this.afterCallbacks) await callback(this)\n return this.bag.isEmpty()\n }\n\n private async runRule(\n rule: ParsedRule,\n field: string,\n pattern: string,\n value: unknown,\n ruleNames: string[],\n ): Promise<string | undefined> {\n const expanded = pattern.includes('*')\n if (rule.kind === 'object') {\n if (rule.rule instanceof BuiltinRuleObject) {\n if (await rule.rule.passes(field, value, this.data, expanded)) return undefined\n const ctx = { attribute: field, expandedFromWildcard: expanded, value, parameters: [], data: this.data, ruleNames }\n return this.failureMessage(rule.rule.ruleName, this.registry[rule.rule.ruleName], ctx, pattern)\n }\n let failure: string | undefined\n await rule.rule.validate(field, value, (message) => { failure = message }, this.data)\n return failure\n }\n\n const builtin = this.registry[rule.name]\n if (!builtin) throw new UnknownValidationRuleError(rule.name)\n\n const ctx = { attribute: field, expandedFromWildcard: expanded, value, parameters: rule.parameters, data: this.data, ruleNames }\n if (await builtin.validate(ctx)) return undefined\n return this.failureMessage(rule.name, builtin, ctx, pattern)\n }\n\n /** Custom message (concrete field, then wildcard pattern, then rule name) or the default, with :attribute filled. */\n private failureMessage(name: string, builtin: BuiltinRule | undefined, ctx: RuleContext, pattern: string): string {\n const field = ctx.attribute\n const template =\n this.customMessages[`${field}.${name}`] ??\n this.customMessages[`${pattern}.${name}`] ??\n this.customMessages[name] ??\n DEFAULT_MESSAGES[builtin?.messageKey(ctx) ?? name] ??\n builtin?.defaultMessage ??\n 'The :attribute field is invalid.'\n\n const display = this.customAttributes[field] ?? this.customAttributes[pattern] ?? defaultAttributeName(field)\n return applyReplacements(template, { attribute: display, ...(builtin?.replacements?.(ctx) ?? {}) })\n }\n}\n","import type { RuleCallback, Rules, ValidationFactory } from '@orieljs/contracts'\nimport type { BuiltinRule } from './parse'\nimport { builtinRules } from './registry'\nimport { ValidatorImpl } from './Validator'\n\nexport class ValidationFactoryImpl implements ValidationFactory {\n private readonly extended: Record<string, BuiltinRule> = {}\n\n make(\n data: Record<string, unknown>,\n rules: Rules,\n messages: Record<string, string> = {},\n attributes: Record<string, string> = {},\n ): ValidatorImpl {\n return new ValidatorImpl(data, rules, messages, attributes, { ...builtinRules, ...this.extended })\n }\n\n extend(name: string, callback: RuleCallback, message?: string): void {\n this.extended[name] = {\n validate: (ctx) => callback(ctx.attribute, ctx.value, ctx.parameters, ctx.data),\n messageKey: () => name,\n defaultMessage: message ?? 'The :attribute field is invalid.',\n }\n }\n}\n","import type { ValidationFactory } from '@orieljs/contracts'\nimport { ValidationFactory as ValidationFactoryToken } from '@orieljs/contracts'\nimport { facade } from '@orieljs/support'\n\n/** Laravel's Validator facade: Validator.make(...)/Validator.extend(...), proxied to the resolved ValidationFactory. */\nexport const Validator = facade<ValidationFactory>(ValidationFactoryToken)\n","import { ValidationFactory as ValidationFactoryToken } from '@orieljs/contracts'\nimport { ServiceProvider } from '@orieljs/support'\nimport { ValidationFactoryImpl } from './ValidationFactory'\n\nexport class ValidationServiceProvider extends ServiceProvider {\n override register(): void {\n this.app.singleton(ValidationFactoryToken, () => new ValidationFactoryImpl())\n }\n}\n"],"mappings":";AAEO,IAAM,sBAA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AO,UAAU,YAAY,EAAE,GAAG,cAAc,GAAG,KAAK,SAAS,CAAC;AAAA,EACnG;AAAA,EAEA,OAAO,MAAc,UAAwB,SAAwB;AACnE,SAAK,SAAS,IAAI,IAAI;AAAA,MACpB,UAAU,CAAC,QAAQ,SAAS,IAAI,WAAW,IAAI,OAAO,IAAI,YAAY,IAAI,IAAI;AAAA,MAC9E,YAAY,MAAM;AAAA,MAClB,gBAAgB,WAAW;AAAA,IAC7B;AAAA,EACF;AACF;;;ACvBA,SAAS,qBAAqB,8BAA8B;AAC5D,SAAS,cAAc;AAGhB,IAAM,YAAY,OAA0B,sBAAsB;;;ACLzE,SAAS,qBAAqBC,+BAA8B;AAC5D,SAAS,uBAAuB;AAGzB,IAAM,4BAAN,cAAwC,gBAAgB;AAAA,EACpD,WAAiB;AACxB,SAAK,IAAI,UAAUC,yBAAwB,MAAM,IAAI,sBAAsB,CAAC;AAAA,EAC9E;AACF;","names":["inject","Arr","Arr","Arr","Arr","Arr","Arr","ctx","ValidationFactoryToken","ValidationFactoryToken"]}
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "@orieljs/validation",
3
+ "version": "0.1.0-alpha.1",
4
+ "description": "The Oriel Validation component.",
5
+ "type": "module",
6
+ "license": "Apache-2.0",
7
+ "sideEffects": false,
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/orieljs/framework.git",
11
+ "directory": "src/Oriel/Validation"
12
+ },
13
+ "engines": {
14
+ "node": ">=22"
15
+ },
16
+ "types": "./dist/index.d.ts",
17
+ "exports": {
18
+ ".": {
19
+ "types": "./dist/index.d.ts",
20
+ "import": "./dist/index.js"
21
+ }
22
+ },
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
26
+ "files": [
27
+ "dist",
28
+ "LICENSE",
29
+ "NOTICE"
30
+ ],
31
+ "dependencies": {
32
+ "@orieljs/contracts": "0.1.0-alpha.1",
33
+ "@orieljs/container": "0.1.0-alpha.1",
34
+ "@orieljs/support": "0.1.0-alpha.1"
35
+ },
36
+ "scripts": {
37
+ "build": "tsup && node ../../../scripts/copy-license.mjs"
38
+ }
39
+ }