diff --git a/.eslintrc.json b/.eslintrc.json index 0c1e3fe07..eb3e30417 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -4,7 +4,7 @@ "es2021": true, "node": true }, - "extends": "standard-with-typescript", + "extends": ["standard-with-typescript", "plugin:import/typescript"], "parserOptions": { "ecmaVersion": "latest", "sourceType": "module" @@ -24,6 +24,13 @@ "@typescript-eslint/strict-boolean-expressions": "off", "@typescript-eslint/no-non-null-assertion": "off", "no-proto": "off", - "valid-typeof": "off" + "valid-typeof": "off", + "import/no-cycle": [ + "error", + { + "maxDepth": 10, + "ignoreExternal": true + } + ] } } diff --git a/.prettierrc b/.prettierrc index 48ce394fc..3dac0e95a 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,7 +1,7 @@ { "arrowParens": "avoid", "jsxSingleQuote": false, - "printWidth": 100, + "printWidth": 120, "semi": true, "singleQuote": false, "tabWidth": 2 diff --git a/package.json b/package.json index 42c890651..0acd78771 100644 --- a/package.json +++ b/package.json @@ -5,10 +5,14 @@ "version": "1.0.0", "description": "TypeScript form validation using Decorators", "license": "MIT", + "workspaces": [ + "packages/*" + ], "scripts": { "lint": "eslint 'packages/*/src/**/*.ts' --fix", "clean": "rm -rf docs dist packages/core/dist packages/react/dist", "build": "tsc --build", + "typedoc": "typedoc", "docs": "bash scripts/generate-docs.sh", "core/test": "npm run test --prefix=packages/core", "core/build": "npm run build --prefix=packages/core", @@ -21,20 +25,17 @@ "react/deploy:patch": "npm run deploy:patch --prefix=packages/react", "react/test": "npm run test --prefix=packages/react", "react/build": "npm run build --prefix=packages/react", + "react/build:noTest": "npm run build:noTest --prefix=packages/react", "pushAll": "git add . && bash scripts/commit.sh --group=chore --message=\"Automated commit\" && git push" }, - "husky": { - "hooks": { - "pre-commit": "npm run lint" - } - }, "devDependencies": { "@mxssfd/typedoc-theme": "^1.1.3", "@types/jest": "^29.5.2", "@typescript-eslint/eslint-plugin": "^6.7.5", - "eslint": "^8.51.0", + "circular-dependency-plugin": "^5.2.2", + "eslint": "^8.56.0", "eslint-config-standard-with-typescript": "^39.1.1", - "eslint-plugin-import": "^2.28.1", + "eslint-plugin-import": "^2.29.1", "eslint-plugin-n": "^16.1.0", "eslint-plugin-promise": "^6.1.1", "eslint-plugin-react-hooks": "^4.6.0", @@ -44,10 +45,8 @@ "jest": "^29.5.0", "ts-jest": "^29.1.0", "ts-node": "^10.9.1", + "tsc-alias": "^1.8.8", "typedoc": "^0.25.1", "typescript": "^5.2.2" - }, - "workspaces": [ - "packages/*" - ] + } } diff --git a/packages/core/index.ts b/packages/core/index.ts index a24023313..f4729241a 100644 --- a/packages/core/index.ts +++ b/packages/core/index.ts @@ -1,120 +1,19 @@ -import * as Decorators from "./src/decorators"; -import { - createClassDecorator, - createClassValidator, - createFieldDecorator, - createFieldValidator, -} from "./src/decorators"; -import { attribute } from "./src/decorators/data/structural/attribute"; -import TdvCoreApi from "./src/index"; -import * as Localization from "./src/localization"; -import * as Reflection from "./src/reflection"; -import * as Strategy from "./src/strategy"; -import * as Utilities from "./src/utilities"; -import * as Validation from "./src/validation"; -import { Form } from "./src/validation/models/Form"; +import * as Decorators from "@decorators"; +import * as Localization from "@localization"; +import * as Reflection from "@reflection"; +import * as Strategy from "@strategy"; +import * as Utilities from "@utilities"; +import * as Validation from "@validation"; +export { Decorators, Localization, Reflection, Strategy, Utilities, Validation }; + +export import PrimitiveSet = Utilities.PrimitiveSet; +export import createClassDecorator = Decorators.createClassDecorator; +export import createClassValidator = Decorators.createClassValidator; +export import createFieldDecorator = Decorators.createFieldDecorator; +export import createFieldValidator = Decorators.createFieldValidator; +export import Form = Validation.Form; +export import attribute = Decorators.attribute; export import Class = Utilities.Types.Class; export import UnwrapClass = Utilities.Types.UnwrapClass; export import ValidationResult = Validation.ValidationResult; - -export { - Form, - attribute, - createClassDecorator, - createClassValidator, - createFieldDecorator, - createFieldValidator, -}; - -export { Decorators, Localization, Reflection, Strategy, Utilities, Validation }; - -/** - * An overridable interface designed for disabling nested validation on custom object types. - * - when specified ***(example 1)***: an object type is considered primitive and it's simplified errors render as `string[]` - * - when not specified ***(example 2)***: an object type is considered as is and it's simplified errors are evaluated by {@link Strategy.Impl.Errors evaluate}) - * - * @example - * 1: Disabling nested form validation for `Coordinate` class by augmenting the `PrimitiveSet` interface from `tdv-core`. This is a way of treating custom object types as primitives and avoiding recursive field validation - * ```ts - * // coordinate.ts - model class which is considered primitive - * export class Coordinate { - * x: number; - * y: number; - * } - * ``` - * - *
- * - * ```ts - * // index.ts - entry point of the app - * declare module "tdv-core" { - * interface PrimitiveSet { - * // Specify object types as primitives here - * values: [Coordinate]; - * } - * } - * ``` - * - *
- * - * ```ts - * // consumer.ts - model class which holds Coordinate property - * import { createFieldValidator } from "tdv-core"; - * - * // custom Coordinate validator - * function MinX(minX: number) { - * return createFieldValidator(coordinate => ({ - * key: "MinX", - * valid: coordinate.x >= minX, - * message: `Minimum X is ${minX}` - * })) - * } - * - * // Coordinate class definition - * class Consumer { - * \@MinX(10) - * coordinate: Coordinate; // primitive, doesn't validate recursively - * } - * - * const engine = new ValidationEngine(Consumer); - * const payload = { coordinate: { x: 9, y: 23 } }; - * const { errors } = engine.validate(payload); - * const coordinateErrors = errors.coordinate; - * console.log(coordinateErrors); // ["Minimum X is 10"] - * ``` - * - * @example - * 2: Default behavior - nested field validation is enabled for `Coordinate` class. It uses `\@attribute` for supplying validation engine with the runtime schema representation of the decorated field (if \@attribute is not defined then a type mismatch occurs between runtime type and compiled type) - * ```ts - * // coordinate.ts - * import { collection } from "tdv-core"; - * - * export class Coordinate { - * \@collection.number.ValueMin(10, { message: "Minimum X is 10" }) - * x: number; - * y: number; - * } - * ``` - * - *
- * - * ```ts - * // consumer.ts - model class which holds Coordinate property - * import { attribute, Localization, Form, Utilities } from "tdv-core"; - * - * class Consumer { - * \@attribute(Coordinate) // enables deep validation - * coordinate: Coordinate; // non-primitive - * } - * - * const engine = new ValidationEngine(Consumer); - * const payload = { coordinate: { x: 9, y: 23 } }; - * const { errors } = engine.validate(payload); - * const coordinateErrors = errors.coordinate; - * console.log(coordinateErrors); // { root: [], data: { x: ["Minimum X is 10"], y: [] } } - * ``` - */ -export interface PrimitiveSet {} - -export default TdvCoreApi; diff --git a/packages/core/package-lock.json b/packages/core/package-lock.json index 366f7a532..02438c5c1 100644 --- a/packages/core/package-lock.json +++ b/packages/core/package-lock.json @@ -14,15 +14,27 @@ "@types/react": "^18.0.26", "@types/react-dom": "^18.0.10", "auto-i18n": "^1.0.0", + "eslint-plugin-import": "^2.29.1", "esm": "^3.2.25", "jest": "^29.5.0", "ts-jest": "^29.1.0", - "ts-node": "^10.9.1" + "ts-node": "^10.9.1", + "tsc-alias": "^1.8.8" }, "peerDependencies": { "typescript": "^5.2.2" } }, + "node_modules/@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/@ampproject/remapping": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", @@ -632,6 +644,115 @@ "node": ">=12" } }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "peer": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "dev": true, + "peer": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dev": true, + "peer": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "peer": true + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "peer": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/eslintrc/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "peer": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/@eslint/eslintrc/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/js": { + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz", + "integrity": "sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==", + "dev": true, + "peer": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, "node_modules/@google-cloud/common": { "version": "0.31.1", "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-0.31.1.tgz", @@ -684,6 +805,42 @@ "node": ">=6.0.0" } }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", + "dev": true, + "peer": true, + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", + "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", + "dev": true, + "peer": true + }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -1110,6 +1267,41 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/@sinclair/typebox": { "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", @@ -1257,6 +1449,12 @@ "pretty-format": "^29.0.0" } }, + "node_modules/@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "dev": true + }, "node_modules/@types/node": { "version": "20.3.1", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.3.1.tgz", @@ -1340,6 +1538,13 @@ "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", "dev": true }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true, + "peer": true + }, "node_modules/abort-controller": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", @@ -1364,6 +1569,16 @@ "node": ">=0.4.0" } }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peer": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, "node_modules/acorn-walk": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", @@ -1385,6 +1600,23 @@ "node": ">= 4.0.0" } }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -1452,6 +1684,123 @@ "sprintf-js": "~1.0.2" } }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", + "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "is-array-buffer": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-includes": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.7.tgz", + "integrity": "sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/array.prototype.findlastindex": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.3.tgz", + "integrity": "sha512-LzLoiOMAxvy+Gd3BAq3B7VeIgPdo+Q8hthvKtXybMvRV0jrXfJM/t8mw7nNlpEcVlVUnCnM2KSX4XU5HmpodOA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0", + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flat": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", + "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flatmap": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz", + "integrity": "sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.2.tgz", + "integrity": "sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1", + "is-array-buffer": "^3.0.2", + "is-shared-array-buffer": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", @@ -1479,6 +1828,18 @@ "fs-extra": "^7.0.1" } }, + "node_modules/available-typed-arrays": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/babel-jest": { "version": "29.6.0", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.6.0.tgz", @@ -1605,6 +1966,15 @@ "node": "*" } }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", @@ -1698,6 +2068,20 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, + "node_modules/call-bind": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz", + "integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.1", + "set-function-length": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -1761,6 +2145,33 @@ "node": ">=10" } }, + "node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, "node_modules/ci-info": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", @@ -1924,6 +2335,13 @@ "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", "dev": true }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "peer": true + }, "node_modules/deepmerge": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", @@ -1933,6 +2351,37 @@ "node": ">=0.10.0" } }, + "node_modules/define-data-property": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", + "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -1969,16 +2418,41 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/dot-object": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/dot-object/-/dot-object-1.9.0.tgz", - "integrity": "sha512-7MPN6y7XhAO4vM4eguj5+5HNKLjJYfkVG1ZR1Aput4Q4TR6SYeSjhpVQ77IzJHoSHffKbDxBC+48aCiiRurDPw==", + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "dev": true, "dependencies": { - "commander": "^2.20.0", - "glob": "^7.1.4" + "path-type": "^4.0.0" }, - "bin": { + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "peer": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/dot-object": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/dot-object/-/dot-object-1.9.0.tgz", + "integrity": "sha512-7MPN6y7XhAO4vM4eguj5+5HNKLjJYfkVG1ZR1Aput4Q4TR6SYeSjhpVQ77IzJHoSHffKbDxBC+48aCiiRurDPw==", + "dev": true, + "dependencies": { + "commander": "^2.20.0", + "glob": "^7.1.4" + }, + "bin": { "dot-object": "bin/dot-object" } }, @@ -2051,6 +2525,99 @@ "is-arrayish": "^0.2.1" } }, + "node_modules/es-abstract": { + "version": "1.22.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.3.tgz", + "integrity": "sha512-eiiY8HQeYfYH2Con2berK+To6GrK2RxbPawDkGq4UiCQQfZHb6wX9qQqkbpPqaxQFcl8d9QzZqo0tGE0VcrdwA==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "arraybuffer.prototype.slice": "^1.0.2", + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.5", + "es-set-tostringtag": "^2.0.1", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.2", + "get-symbol-description": "^1.0.0", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0", + "internal-slot": "^1.0.5", + "is-array-buffer": "^3.0.2", + "is-callable": "^1.2.7", + "is-negative-zero": "^2.0.2", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.12", + "is-weakref": "^1.0.2", + "object-inspect": "^1.13.1", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.5.1", + "safe-array-concat": "^1.0.1", + "safe-regex-test": "^1.0.0", + "string.prototype.trim": "^1.2.8", + "string.prototype.trimend": "^1.0.7", + "string.prototype.trimstart": "^1.0.7", + "typed-array-buffer": "^1.0.0", + "typed-array-byte-length": "^1.0.0", + "typed-array-byte-offset": "^1.0.0", + "typed-array-length": "^1.0.4", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.2.tgz", + "integrity": "sha512-BuDyupZt65P9D2D2vA/zqcI3G5xRsklm5N3xCwuiy+/vKy8i0ifdsQP1sLgO4tZDSCaQUSnmC48khknGMV3D2Q==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.2", + "has-tostringtag": "^1.0.0", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-shim-unscopables": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", + "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", + "dev": true, + "dependencies": { + "hasown": "^2.0.0" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/es6-promise": { "version": "4.2.8", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", @@ -2084,6 +2651,314 @@ "node": ">=8" } }, + "node_modules/eslint": { + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.56.0.tgz", + "integrity": "sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==", + "dev": true, + "peer": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.56.0", + "@humanwhocodes/config-array": "^0.11.13", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-import-resolver-node": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", + "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", + "dev": true, + "dependencies": { + "debug": "^3.2.7", + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-module-utils": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", + "integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==", + "dev": true, + "dependencies": { + "debug": "^3.2.7" + }, + "engines": { + "node": ">=4" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/eslint-module-utils/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import": { + "version": "2.29.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz", + "integrity": "sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==", + "dev": true, + "dependencies": { + "array-includes": "^3.1.7", + "array.prototype.findlastindex": "^1.2.3", + "array.prototype.flat": "^1.3.2", + "array.prototype.flatmap": "^1.3.2", + "debug": "^3.2.7", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.9", + "eslint-module-utils": "^2.8.0", + "hasown": "^2.0.0", + "is-core-module": "^2.13.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.fromentries": "^2.0.7", + "object.groupby": "^1.0.1", + "object.values": "^1.1.7", + "semver": "^6.3.1", + "tsconfig-paths": "^3.15.0" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" + } + }, + "node_modules/eslint-plugin-import/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "peer": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "peer": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "peer": true + }, + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "peer": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "peer": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/eslint/node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "peer": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "peer": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/eslint/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "peer": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "peer": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/esm": { "version": "3.2.25", "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz", @@ -2093,6 +2968,24 @@ "node": ">=6" } }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "peer": true, + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", @@ -2103,7 +2996,52 @@ "esvalidate": "bin/esvalidate.js" }, "engines": { - "node": ">=4" + "node": ">=4" + } + }, + "node_modules/esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, + "peer": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "peer": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" } }, "node_modules/event-target-shim": { @@ -2170,18 +3108,57 @@ "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", "dev": true }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "peer": true + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "peer": true + }, "node_modules/fast-text-encoding": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.6.tgz", "integrity": "sha512-VhXlQgj9ioXCqGstD37E/HBeqEGV/qOD/kmbVG8h5xKBYvM1L3lR1Zn4555cQ8GkYbJa8aJSipLPndE1k6zK2w==", "dev": true }, + "node_modules/fastq": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.16.0.tgz", + "integrity": "sha512-ifCoaXsDrsdkWTtiNJX5uzHDsrck5TzfKKDcuFFTIrrc/BS076qgEIfoIy1VeZqViznfKiysPYTh/QeHtnIsYA==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, "node_modules/fb-watchman": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", @@ -2191,6 +3168,19 @@ "bser": "2.1.1" } }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "peer": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, "node_modules/fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -2216,6 +3206,37 @@ "node": ">=8" } }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "peer": true, + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.2.9", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz", + "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==", + "dev": true, + "peer": true + }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.3" + } + }, "node_modules/form-data": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", @@ -2275,10 +3296,40 @@ } }, "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/function.prototype.name": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/gaxios": { "version": "1.8.4", @@ -2323,6 +3374,21 @@ "node": "6.* || 8.* || >= 10.*" } }, + "node_modules/get-intrinsic": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", + "integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/get-package-type": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", @@ -2344,6 +3410,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-symbol-description": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", + "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -2364,6 +3446,18 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", @@ -2373,6 +3467,41 @@ "node": ">=4" } }, + "node_modules/globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dev": true, + "dependencies": { + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/google-auth-library": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-3.1.2.tgz", @@ -2415,12 +3544,31 @@ "gp12-pem": "build/src/bin/gp12-pem.js" } }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true, + "peer": true + }, "node_modules/gtoken": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-2.3.3.tgz", @@ -2437,16 +3585,13 @@ "node": ">=6.0.0" } }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "node_modules/has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-flag": { @@ -2458,6 +3603,69 @@ "node": ">=8" } }, + "node_modules/has-property-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz", + "integrity": "sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", + "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", @@ -2504,6 +3712,42 @@ "node": ">=10.17.0" } }, + "node_modules/ignore": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.0.tgz", + "integrity": "sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "peer": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-fresh/node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" + } + }, "node_modules/import-local": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", @@ -2548,6 +3792,20 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, + "node_modules/internal-slot": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.6.tgz", + "integrity": "sha512-Xj6dv+PsbtwyPpEflsejS+oIZxmMlV44zAhG479uYu89MsjcYOhCFnNyKrkJrihbsiasQyY0afoCl/9BLR65bg==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.2", + "hasown": "^2.0.0", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/is": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/is/-/is-3.3.0.tgz", @@ -2557,24 +3815,114 @@ "node": "*" } }, + "node_modules/is-array-buffer": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", + "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.0", + "is-typed-array": "^1.1.10" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", "dev": true }, - "node_modules/is-core-module": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz", - "integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==", + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "dev": true, + "dependencies": { + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", "dev": true, "dependencies": { - "has": "^1.0.3" + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -2593,6 +3941,18 @@ "node": ">=6" } }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-html": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-html/-/is-html-1.1.0.tgz", @@ -2605,6 +3965,18 @@ "node": ">=0.10.0" } }, + "node_modules/is-negative-zero": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", + "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -2614,6 +3986,59 @@ "node": ">=0.12.0" } }, + "node_modules/is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", @@ -2626,6 +4051,63 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", + "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", + "dev": true, + "dependencies": { + "which-typed-array": "^1.1.11" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -3333,12 +4815,33 @@ "bignumber.js": "^9.0.0" } }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "peer": true + }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "peer": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "peer": true + }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", @@ -3381,6 +4884,16 @@ "safe-buffer": "^5.0.1" } }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "peer": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, "node_modules/kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -3399,6 +4912,20 @@ "node": ">=6" } }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "peer": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", @@ -3429,6 +4956,13 @@ "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", "dev": true }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "peer": true + }, "node_modules/lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", @@ -3474,6 +5008,15 @@ "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, "node_modules/micromatch": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", @@ -3541,12 +5084,34 @@ "node": "*" } }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, + "node_modules/mylas": { + "version": "2.1.13", + "resolved": "https://registry.npmjs.org/mylas/-/mylas-2.1.13.tgz", + "integrity": "sha512-+MrqnJRtxdF+xngFfUUkIMQrUUL0KsxbADUkn23Z/4ibGg192Q+z+CQyiYwvWTsYjJygmMR8+w3ZDa98Zh6ESg==", + "dev": true, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/raouldeheer" + } + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -3628,6 +5193,88 @@ "node": ">=8" } }, + "node_modules/object-inspect": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.fromentries": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.7.tgz", + "integrity": "sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.groupby": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.1.tgz", + "integrity": "sha512-HqaQtqLnp/8Bn4GL16cj+CUYbnpe1bh0TtEaWvybszDG4tgxCJuRpV8VGuvNaI1fAnI4lUJzDG55MXcOH4JZcQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1" + } + }, + "node_modules/object.values": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.7.tgz", + "integrity": "sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -3652,6 +5299,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/optionator": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "dev": true, + "peer": true, + "dependencies": { + "@aashutoshrathi/word-wrap": "^1.2.3", + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -3703,6 +5368,19 @@ "node": ">=6" } }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "peer": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -3754,6 +5432,15 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", @@ -3802,6 +5489,28 @@ "node": ">=8" } }, + "node_modules/plimit-lit": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/plimit-lit/-/plimit-lit-1.6.1.tgz", + "integrity": "sha512-B7+VDyb8Tl6oMJT9oSO2CW8XC/T4UcJGrwOVoNGwOQsQYhlpfajmrMj5xeejqaASq3V/EqThyOeATEOMuSEXiA==", + "dev": true, + "dependencies": { + "queue-lit": "^1.5.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/pretty-format": { "version": "29.6.0", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.0.tgz", @@ -3856,19 +5565,58 @@ "node": ">= 6" } }, - "node_modules/pure-rand": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.2.tgz", - "integrity": "sha512-6Yg0ekpKICSjPswYOuC5sku/TSWaRYlA0qsXqJgM/d/4pLPHPuTxK7Nbf7jFKzAeedUhR8C7K9Uv63FBsSo8xQ==", + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/pure-rand": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.2.tgz", + "integrity": "sha512-6Yg0ekpKICSjPswYOuC5sku/TSWaRYlA0qsXqJgM/d/4pLPHPuTxK7Nbf7jFKzAeedUhR8C7K9Uv63FBsSo8xQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ] + }, + "node_modules/queue-lit": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/queue-lit/-/queue-lit-1.5.2.tgz", + "integrity": "sha512-tLc36IOPeMAubu8BkW8YDBV+WyIgKlYU7zUNs0J5Vk9skSZ4JfGlPOqplP0aHdfv7HL0B2Pg6nwiq60Qc6M2Hw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true, "funding": [ { - "type": "individual", - "url": "https://github.com/sponsors/dubzzz" + "type": "github", + "url": "https://github.com/sponsors/feross" }, { - "type": "opencollective", - "url": "https://opencollective.com/fast-check" + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" } ] }, @@ -3893,6 +5641,35 @@ "util-deprecate": "~1.0.1" } }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz", + "integrity": "sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "set-function-name": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -3903,12 +5680,12 @@ } }, "node_modules/resolve": { - "version": "1.22.2", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", - "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dev": true, "dependencies": { - "is-core-module": "^2.11.0", + "is-core-module": "^2.13.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, @@ -3962,21 +5739,140 @@ "node": ">=8.10.0" } }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "peer": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-array-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.1.tgz", + "integrity": "sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-array-concat/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, "node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, + "node_modules/safe-regex-test": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.1.tgz", + "integrity": "sha512-Y5NejJTTliTyY4H7sipGqY+RX5P87i3F7c4Rcepy72nq+mNLhIsD0W4c7kEmduMDQCSqtPsXPlSTsFhh2LQv+g==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.5", + "get-intrinsic": "^1.2.2", + "is-regex": "^1.1.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" } }, + "node_modules/set-function-length": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.1.1.tgz", + "integrity": "sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.1", + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.1.tgz", + "integrity": "sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==", + "dev": true, + "dependencies": { + "define-data-property": "^1.0.1", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -3998,6 +5894,20 @@ "node": ">=8" } }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", @@ -4098,6 +6008,51 @@ "node": ">=8" } }, + "node_modules/string.prototype.trim": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz", + "integrity": "sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz", + "integrity": "sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz", + "integrity": "sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -4189,6 +6144,13 @@ "node": ">=8" } }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true, + "peer": true + }, "node_modules/tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", @@ -4341,6 +6303,78 @@ } } }, + "node_modules/tsc-alias": { + "version": "1.8.8", + "resolved": "https://registry.npmjs.org/tsc-alias/-/tsc-alias-1.8.8.tgz", + "integrity": "sha512-OYUOd2wl0H858NvABWr/BoSKNERw3N9GTi3rHPK8Iv4O1UyUXIrTTOAZNHsjlVpXFOhpJBVARI1s+rzwLivN3Q==", + "dev": true, + "dependencies": { + "chokidar": "^3.5.3", + "commander": "^9.0.0", + "globby": "^11.0.4", + "mylas": "^2.1.9", + "normalize-path": "^3.0.0", + "plimit-lit": "^1.2.6" + }, + "bin": { + "tsc-alias": "dist/bin/index.js" + } + }, + "node_modules/tsc-alias/node_modules/commander": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", + "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || >=14" + } + }, + "node_modules/tsconfig-paths": { + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", + "dev": true, + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, + "node_modules/tsconfig-paths/node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/tsconfig-paths/node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "peer": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -4362,6 +6396,71 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/typed-array-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz", + "integrity": "sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz", + "integrity": "sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz", + "integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", + "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "is-typed-array": "^1.1.9" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/typescript": { "version": "5.3.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", @@ -4375,6 +6474,21 @@ "node": ">=14.17" } }, + "node_modules/unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", @@ -4414,6 +6528,16 @@ "browserslist": ">= 4.21.0" } }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "peer": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -4521,6 +6645,41 @@ "node": ">= 8" } }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.13.tgz", + "integrity": "sha512-P5Nra0qjSncduVPEAr7xhoF5guty49ArDTwzJ/yNuPIbZppyRxFQsRCWrocxIY+CnMVG+qfbU2FmDKyvSGClow==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.4", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", diff --git a/packages/core/package.json b/packages/core/package.json index acaf93fb0..7e89bc243 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -13,7 +13,7 @@ "lint": "echo \"No linting configured\"", "clean": "rm -rf dist", "build": "npm run clean && npm run test && tsc", - "build:noTest": "npm run clean && tsc", + "build:noTest": "npm run clean && tsc && npx tsc-alias", "deploy:minor": "bash ../../scripts/deploy.sh core minor", "deploy:major": "bash ../../scripts/deploy.sh core major", "deploy:patch": "bash ../../scripts/deploy.sh core patch", @@ -44,9 +44,11 @@ "@types/react": "^18.0.26", "@types/react-dom": "^18.0.10", "auto-i18n": "^1.0.0", + "eslint-plugin-import": "^2.29.1", "esm": "^3.2.25", "jest": "^29.5.0", "ts-jest": "^29.1.0", - "ts-node": "^10.9.1" + "ts-node": "^10.9.1", + "tsc-alias": "^1.8.8" } } diff --git a/packages/core/src/decorators/data/structural/attribute.ts b/packages/core/src/decorators/data/structural/attribute.ts index 1fa48c2ec..e271d5fa2 100644 --- a/packages/core/src/decorators/data/structural/attribute.ts +++ b/packages/core/src/decorators/data/structural/attribute.ts @@ -1,11 +1,10 @@ -import type API from "../../../../index"; -import { PrimitiveSet } from "../../../../index"; -import { type FieldDecorator, createFieldDecorator } from "./../../index"; +import { FieldDecorator, createFieldDecorator } from "@decorators/factory/forField/createFieldDecorator"; +import { Objects, PrimitiveSet, Types } from "@utilities"; /** * Creates a decorator which flags the given field as a non-primitive (will validate inner fields of `T`). * - * If a field which is being decorated is not a {@link API.Utilities.Types.PrimitiveType primitive} + * If a field which is being decorated is not a {@link Types.PrimitiveType primitive} * (`string`, `number`, `boolean`, `bigint`, `Date`) and isn't marked as a primitive in {@link PrimitiveSet overrides} interface * then the framework treats it as a custom, client-defined validable class. That having in mind, you will always want to apply `@attribute` * to those types of fields so the runtime evaluation matches the TypeScript compiler type evaluation. For more clarity check examples below. @@ -59,9 +58,7 @@ import { type FieldDecorator, createFieldDecorator } from "./../../index"; * } * } */ -export function attribute>( - clazz: API.Utilities.Types.Class -): FieldDecorator { +export function attribute>(clazz: Types.Class): FieldDecorator { return createFieldDecorator((meta, name) => { meta.getUntypedDescriptor(name).thisClass = clazz; }); diff --git a/packages/core/src/decorators/data/structural/foreach.ts b/packages/core/src/decorators/data/structural/foreach.ts index 7a89c161f..1655bcb71 100644 --- a/packages/core/src/decorators/data/structural/foreach.ts +++ b/packages/core/src/decorators/data/structural/foreach.ts @@ -1,13 +1,11 @@ -import type API from "../../../../index"; -import { createFieldDecorator, type FieldDecorator } from "./../../../decorators"; +import { FieldDecorator, createFieldDecorator } from "@decorators/factory/forField/createFieldDecorator"; +import { Arrays, Types } from "@utilities"; /** * Creates a validator decorator which applies multiple validators to each element in array field. - * * @typeParam T - The type of the array property. * @param validators - An array of validators to apply to each element in the array. * @returns A decorator function to use with class array fields. - * * @example * 1: Applies the `MinLength` and `MaxLength` validators to each element in the `names` array property. * ```ts @@ -17,9 +15,9 @@ import { createFieldDecorator, type FieldDecorator } from "./../../../decorators * } * ``` */ -export function foreach< - T extends NonNullable API.Utilities.Types.ArrayType)> ->(...validators: Array>>): FieldDecorator { +export function foreach Types.ArrayType)>>( + ...validators: Array>> +): FieldDecorator { return createFieldDecorator((meta, property, context) => { const validationProcessor = meta.getUntypedDescriptor(property); validationProcessor.thisDefault = []; diff --git a/packages/core/src/decorators/data/validators/any/Required.ts b/packages/core/src/decorators/data/validators/any/Required.ts index 0639dee1d..44fa5016d 100644 --- a/packages/core/src/decorators/data/validators/any/Required.ts +++ b/packages/core/src/decorators/data/validators/any/Required.ts @@ -1,13 +1,7 @@ -import { - DecoratorOptions, - FieldDecorator, - buildGroupsProp, - buildKeyProp, - buildMessageProp, - createFieldValidator, -} from "../../../../decorators/index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { Optional } from "../../../../utilities/impl/Objects"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization/service/TranslationService"; +import { Objects } from "@utilities"; /** `@Required` key. */ export const REQUIRED = "Required"; @@ -66,7 +60,7 @@ function isRequiredValid(value: T | undefined): value is NonNullable(options?: DecoratorOptions): FieldDecorator { +export function Required(options?: DecoratorOptions): FieldDecorator { return createFieldValidator( (value, _context, locale) => ({ key: buildKeyProp(options, REQUIRED), diff --git a/packages/core/src/decorators/data/validators/array/ArrayContains.ts b/packages/core/src/decorators/data/validators/array/ArrayContains.ts index 5acf971ee..2bfa34c94 100644 --- a/packages/core/src/decorators/data/validators/array/ArrayContains.ts +++ b/packages/core/src/decorators/data/validators/array/ArrayContains.ts @@ -1,20 +1,14 @@ -import { translate } from "../../../../localization/service/TranslationService"; -import { assertType } from "../../../../utilities/impl/Objects"; -import { - buildGroupsProp, - buildKeyProp, - buildMessageProp, - createFieldValidator, - DecoratorOptions, - FieldDecorator, -} from "../../../index"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@ArrayContains` key. */ export const ARRAY_CONTAINS = "ArrayContains"; /** Internal validation function for {@link ArrayContains} validator. */ function isArrayContainsValid(value: T, contains: K): boolean { - assertType("array", value); + Objects.assertType("array", value); return (value ?? []).includes(contains); } @@ -67,10 +61,7 @@ function isArrayContainsValid(value: T, contains: K): boolean * } * ``` */ -export function ArrayContains( - contains: K, - options?: DecoratorOptions -): FieldDecorator { +export function ArrayContains(contains: K, options?: DecoratorOptions): FieldDecorator { return createFieldValidator( (array, _context, locale) => ({ key: buildKeyProp(options, ARRAY_CONTAINS), diff --git a/packages/core/src/decorators/data/validators/array/ArrayEmpty.ts b/packages/core/src/decorators/data/validators/array/ArrayEmpty.ts index d4526bb6f..2c1119cc8 100644 --- a/packages/core/src/decorators/data/validators/array/ArrayEmpty.ts +++ b/packages/core/src/decorators/data/validators/array/ArrayEmpty.ts @@ -1,13 +1,14 @@ -import * as API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator, type FieldDecorator } from "../../../index"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@ArrayEmpty` key. */ export const ARRAY_EMPTY = "ArrayEmpty"; /** Internal validation function for {@link ArrayEmpty} validator. */ function isArrayEmptyValid(array: any[]): boolean { - API.Utilities.Objects.assertType("array", array); + Objects.assertType("array", array); return (array ?? []).length === 0; } @@ -59,15 +60,13 @@ function isArrayEmptyValid(array: any[]): boolean { * } * ``` */ -export function ArrayEmpty( - options?: API.Decorators.DecoratorOptions -): FieldDecorator { +export function ArrayEmpty(options?: DecoratorOptions): FieldDecorator { return createFieldValidator( (array, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, ARRAY_EMPTY), + key: buildKeyProp(options, ARRAY_EMPTY), valid: isArrayEmptyValid(array), - message: API.Decorators.buildMessageProp(options, locale, translate(locale, ARRAY_EMPTY)), + message: buildMessageProp(options, locale, translate(locale, ARRAY_EMPTY)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/array/ArrayEvery.ts b/packages/core/src/decorators/data/validators/array/ArrayEvery.ts index da5c8d3d1..e4a0e7b9b 100644 --- a/packages/core/src/decorators/data/validators/array/ArrayEvery.ts +++ b/packages/core/src/decorators/data/validators/array/ArrayEvery.ts @@ -1,16 +1,14 @@ -import * as API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator, type FieldDecorator } from "../../../index"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@ArrayEvery` key. */ export const ARRAY_EVERY = "ArrayEvery"; /** Internal validation function for {@link ArrayEvery} validator. */ -function isArrayEveryValid( - array: T, - predicate: API.Utilities.Objects.ArrayPredicate -): boolean { - API.Utilities.Objects.assertType("array", array); +function isArrayEveryValid(array: T, predicate: Objects.ArrayPredicate): boolean { + Objects.assertType("array", array); return (array ?? []).every(predicate); } @@ -64,15 +62,15 @@ function isArrayEveryValid( * ``` **/ export function ArrayEvery( - predicate: API.Utilities.Objects.ArrayPredicate, - options?: API.Decorators.DecoratorOptions + predicate: Objects.ArrayPredicate, + options?: DecoratorOptions ): FieldDecorator { return createFieldValidator( (array, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, ARRAY_EVERY), + key: buildKeyProp(options, ARRAY_EVERY), valid: isArrayEveryValid(array, predicate), - message: API.Decorators.buildMessageProp(options, locale, translate(locale, ARRAY_EVERY)), + message: buildMessageProp(options, locale, translate(locale, ARRAY_EVERY)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/array/ArrayNone.ts b/packages/core/src/decorators/data/validators/array/ArrayNone.ts index cb6b4380e..6bf907fa2 100644 --- a/packages/core/src/decorators/data/validators/array/ArrayNone.ts +++ b/packages/core/src/decorators/data/validators/array/ArrayNone.ts @@ -1,16 +1,14 @@ -import * as API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator, type FieldDecorator } from "../../../index"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@ArrayNone` key. */ export const ARRAY_NONE = "ArrayNone"; /** Internal validation function for {@link ArrayNone} validator. */ -function isArrayNoneValid( - array: T, - predicate: API.Utilities.Objects.ArrayPredicate -): boolean { - API.Utilities.Objects.assertType("array", array); +function isArrayNoneValid(array: T, predicate: Objects.ArrayPredicate): boolean { + Objects.assertType("array", array); return !(array ?? []).some(predicate); } @@ -64,15 +62,15 @@ function isArrayNoneValid( * ``` **/ export function ArrayNone( - predicate: API.Utilities.Objects.ArrayPredicate, - options?: API.Decorators.DecoratorOptions + predicate: Objects.ArrayPredicate, + options?: DecoratorOptions ): FieldDecorator { return createFieldValidator( (array, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, ARRAY_NONE), + key: buildKeyProp(options, ARRAY_NONE), valid: isArrayNoneValid(array, predicate), - message: API.Decorators.buildMessageProp(options, locale, translate(locale, ARRAY_NONE)), + message: buildMessageProp(options, locale, translate(locale, ARRAY_NONE)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/array/ArrayOne.ts b/packages/core/src/decorators/data/validators/array/ArrayOne.ts index 06f08e5ce..f2a36a447 100644 --- a/packages/core/src/decorators/data/validators/array/ArrayOne.ts +++ b/packages/core/src/decorators/data/validators/array/ArrayOne.ts @@ -1,16 +1,14 @@ -import * as API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator, type FieldDecorator } from "../../../index"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@ArrayOne` key. */ export const ARRAY_ONE = "ArrayOne"; /** Internal validation function for {@link ArrayOne} validator. */ -function isArrayOneValid( - array: T, - predicate: API.Utilities.Objects.ArrayPredicate -): boolean { - API.Utilities.Objects.assertType("array", array); +function isArrayOneValid(array: T, predicate: Objects.ArrayPredicate): boolean { + Objects.assertType("array", array); return (array ?? []).filter(predicate).length === 1; } @@ -64,15 +62,15 @@ function isArrayOneValid( * ``` **/ export function ArrayOne( - predicate: API.Utilities.Objects.ArrayPredicate, - options?: API.Decorators.DecoratorOptions + predicate: Objects.ArrayPredicate, + options?: DecoratorOptions ): FieldDecorator { return createFieldValidator( (array, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, ARRAY_ONE), + key: buildKeyProp(options, ARRAY_ONE), valid: isArrayOneValid(array, predicate), - message: API.Decorators.buildMessageProp(options, locale, translate(locale, ARRAY_ONE)), + message: buildMessageProp(options, locale, translate(locale, ARRAY_ONE)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/array/ArraySizeExact.ts b/packages/core/src/decorators/data/validators/array/ArraySizeExact.ts index a3be650d4..bed286372 100644 --- a/packages/core/src/decorators/data/validators/array/ArraySizeExact.ts +++ b/packages/core/src/decorators/data/validators/array/ArraySizeExact.ts @@ -1,13 +1,14 @@ -import * as API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator, type FieldDecorator } from "../../../index"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@ArraySizeExact` key. */ export const ARRAY_SIZE_EXACT = "ArraySizeExact"; /** Internal validation function for {@link ArraySizeExact} validator. */ function isArraySizeExactValid(array: any[]): boolean { - API.Utilities.Objects.assertType("array", array); + Objects.assertType("array", array); return (array ?? []).length === 0; } @@ -60,20 +61,13 @@ function isArraySizeExactValid(array: any[]): boolean { * } * ``` */ -export function ArraySizeExact( - exact: number, - options?: API.Decorators.DecoratorOptions -): FieldDecorator { +export function ArraySizeExact(exact: number, options?: DecoratorOptions): FieldDecorator { return createFieldValidator( (array, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, ARRAY_SIZE_EXACT), - valid: (array ?? []).length === exact, - message: API.Decorators.buildMessageProp( - options, - locale, - translate(locale, ARRAY_SIZE_EXACT, exact, (array ?? []).length) - ), + key: buildKeyProp(options, ARRAY_SIZE_EXACT), + valid: isArraySizeExactValid(array), + message: buildMessageProp(options, locale, translate(locale, ARRAY_SIZE_EXACT, exact, (array ?? []).length)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/array/ArraySizeMax.ts b/packages/core/src/decorators/data/validators/array/ArraySizeMax.ts index 9854024dc..9be26c0af 100644 --- a/packages/core/src/decorators/data/validators/array/ArraySizeMax.ts +++ b/packages/core/src/decorators/data/validators/array/ArraySizeMax.ts @@ -1,13 +1,14 @@ -import * as API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator, type FieldDecorator } from "../../../index"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@ArraySizeMax` key. */ export const ARRAY_SIZE_MAX = "ArraySizeMax"; /** Internal validation function for {@link ArraySizeMax} validator. */ function isArraySizeMaxValid(array: any[], max: number): boolean { - API.Utilities.Objects.assertType("array", array); + Objects.assertType("array", array); return (array ?? []).length <= max; } @@ -60,20 +61,13 @@ function isArraySizeMaxValid(array: any[], max: number): boolean { * } * ``` */ -export function ArraySizeMax( - max: number, - options?: API.Decorators.DecoratorOptions -): FieldDecorator { +export function ArraySizeMax(max: number, options?: DecoratorOptions): FieldDecorator { return createFieldValidator( (array, _, locale) => ({ - key: API.Decorators.buildKeyProp(options, ARRAY_SIZE_MAX), + key: buildKeyProp(options, ARRAY_SIZE_MAX), valid: isArraySizeMaxValid(array, max), - message: API.Decorators.buildMessageProp( - options, - locale, - translate(locale, ARRAY_SIZE_MAX, max, (array ?? []).length) - ), + message: buildMessageProp(options, locale, translate(locale, ARRAY_SIZE_MAX, max, (array ?? []).length)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/array/ArraySizeMin.ts b/packages/core/src/decorators/data/validators/array/ArraySizeMin.ts index c1f670d58..748919d9a 100644 --- a/packages/core/src/decorators/data/validators/array/ArraySizeMin.ts +++ b/packages/core/src/decorators/data/validators/array/ArraySizeMin.ts @@ -1,13 +1,14 @@ -import * as API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator, type FieldDecorator } from "../../../index"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@ArraySizeMin` key. */ export const ARRAY_SIZE_MIN = "ArraySizeMin"; /** Internal validation function for {@link ArraySizeMin} validator. */ function isArraySizeMinValid(array: any[], min: number): boolean { - API.Utilities.Objects.assertType("array", array); + Objects.assertType("array", array); return (array ?? []).length >= min; } @@ -60,20 +61,13 @@ function isArraySizeMinValid(array: any[], min: number): boolean { * } * ``` */ -export function ArraySizeMin( - min: number, - options?: API.Decorators.DecoratorOptions -): FieldDecorator { +export function ArraySizeMin(min: number, options?: DecoratorOptions): FieldDecorator { return createFieldValidator( (array, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, ARRAY_SIZE_MIN), + key: buildKeyProp(options, ARRAY_SIZE_MIN), valid: isArraySizeMinValid(array, min), - message: API.Decorators.buildMessageProp( - options, - locale, - translate(locale, ARRAY_SIZE_MIN, min, (array ?? []).length) - ), + message: buildMessageProp(options, locale, translate(locale, ARRAY_SIZE_MIN, min, (array ?? []).length)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/array/ArraySizeRange.ts b/packages/core/src/decorators/data/validators/array/ArraySizeRange.ts index b3c9cffdc..a5162a687 100644 --- a/packages/core/src/decorators/data/validators/array/ArraySizeRange.ts +++ b/packages/core/src/decorators/data/validators/array/ArraySizeRange.ts @@ -1,13 +1,14 @@ -import * as API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator, type FieldDecorator } from "../../../index"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@ArraySizeRange` key. */ export const ARRAY_SIZE_RANGE = "ArraySizeRange"; /** Internal validation function for {@link ArraySizeRange} validator. */ function isArraySizeRangeValid(array: any[], min: number, max: number): boolean { - API.Utilities.Objects.assertType("array", array); + Objects.assertType("array", array); return (array ?? []).length >= min && (array ?? []).length <= max; } @@ -64,18 +65,14 @@ function isArraySizeRangeValid(array: any[], min: number, max: number): boolean export function ArraySizeRange( min: number, max: number, - options?: API.Decorators.DecoratorOptions + options?: DecoratorOptions ): FieldDecorator { return createFieldValidator( (array, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, ARRAY_SIZE_RANGE), + key: buildKeyProp(options, ARRAY_SIZE_RANGE), valid: isArraySizeRangeValid(array, min, max), - message: API.Decorators.buildMessageProp( - options, - locale, - translate(locale, ARRAY_SIZE_RANGE, min, max, (array ?? []).length) - ), + message: buildMessageProp(options, locale, translate(locale, ARRAY_SIZE_RANGE, min, max, (array ?? []).length)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/array/ArraySome.ts b/packages/core/src/decorators/data/validators/array/ArraySome.ts index cdd9d9cbf..064c81692 100644 --- a/packages/core/src/decorators/data/validators/array/ArraySome.ts +++ b/packages/core/src/decorators/data/validators/array/ArraySome.ts @@ -1,16 +1,14 @@ -import * as API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator, type FieldDecorator } from "../../../index"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@ArraySome` key. */ export const ARRAY_SOME = "ArraySome"; /** Internal validation function for {@link ArraySome} validator. */ -function isArraySomeValid( - array: T, - predicate: API.Utilities.Objects.ArrayPredicate -): boolean { - API.Utilities.Objects.assertType("array", array); +function isArraySomeValid(array: T, predicate: Objects.ArrayPredicate): boolean { + Objects.assertType("array", array); return (array ?? []).some(predicate); } @@ -64,15 +62,15 @@ function isArraySomeValid( * ``` **/ export function ArraySome( - predicate: API.Utilities.Objects.ArrayPredicate, - options?: API.Decorators.DecoratorOptions + predicate: Objects.ArrayPredicate, + options?: DecoratorOptions ): FieldDecorator { return createFieldValidator( (array, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, ARRAY_SOME), + key: buildKeyProp(options, ARRAY_SOME), valid: isArraySomeValid(array, predicate), - message: API.Decorators.buildMessageProp(options, locale, translate(locale, ARRAY_SOME)), + message: buildMessageProp(options, locale, translate(locale, ARRAY_SOME)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/array/ArrayUnique.ts b/packages/core/src/decorators/data/validators/array/ArrayUnique.ts index 6c2e0b22b..f09a03a8d 100644 --- a/packages/core/src/decorators/data/validators/array/ArrayUnique.ts +++ b/packages/core/src/decorators/data/validators/array/ArrayUnique.ts @@ -1,14 +1,15 @@ -import * as API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator, type FieldDecorator } from "../../../index"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@ArrayUnique` key. */ export const ARRAY_UNIQUE = "ArrayUnique"; /** Internal validation function for {@link ArrayUnique} validator. */ function isArrayUniqueValid(array: any[]): boolean { - API.Utilities.Objects.assertType("array", array); - const hashFn = API.Utilities.Objects.hash; + Objects.assertType("array", array); + const hashFn = Objects.hash; function isArrayUnique(arr: T[], equals: (a: T, b: T) => boolean): boolean { const set = new Set(); for (const val of arr) { @@ -72,15 +73,13 @@ function isArrayUniqueValid(array: any[]): boolean { * } * ``` */ -export function ArrayUnique( - options?: API.Decorators.DecoratorOptions -): FieldDecorator { +export function ArrayUnique(options?: DecoratorOptions): FieldDecorator { return createFieldValidator( (array, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, ARRAY_UNIQUE), + key: buildKeyProp(options, ARRAY_UNIQUE), valid: isArrayUniqueValid(array), - message: API.Decorators.buildMessageProp(options, locale, translate(locale, ARRAY_UNIQUE)), + message: buildMessageProp(options, locale, translate(locale, ARRAY_UNIQUE)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/boolean/AssertFalse.ts b/packages/core/src/decorators/data/validators/boolean/AssertFalse.ts index 292a8d753..102d394be 100644 --- a/packages/core/src/decorators/data/validators/boolean/AssertFalse.ts +++ b/packages/core/src/decorators/data/validators/boolean/AssertFalse.ts @@ -1,13 +1,14 @@ -import * as API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator, type FieldDecorator } from "../../../index"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@AssertFalse` key. */ export const ASSERT_FALSE = "AssertFalse"; /** Internal validation function for {@link AssertFalse} validator. */ function isAssertFalseValid(value: boolean): boolean { - API.Utilities.Objects.assertType("boolean", value); + Objects.assertType("boolean", value); return !value; } @@ -58,15 +59,13 @@ function isAssertFalseValid(value: boolean): boolean { * } * ``` */ -export function AssertFalse( - options?: API.Decorators.DecoratorOptions -): FieldDecorator { +export function AssertFalse(options?: DecoratorOptions): FieldDecorator { return createFieldValidator( (value, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, ASSERT_FALSE), + key: buildKeyProp(options, ASSERT_FALSE), valid: isAssertFalseValid(value), - message: API.Decorators.buildMessageProp(options, locale, translate(locale, ASSERT_FALSE)), + message: buildMessageProp(options, locale, translate(locale, ASSERT_FALSE)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/boolean/AssertTrue.ts b/packages/core/src/decorators/data/validators/boolean/AssertTrue.ts index 3a7fc5365..60371c25f 100644 --- a/packages/core/src/decorators/data/validators/boolean/AssertTrue.ts +++ b/packages/core/src/decorators/data/validators/boolean/AssertTrue.ts @@ -1,13 +1,14 @@ -import * as API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator, type FieldDecorator } from "../../../index"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@AssertTrue` key. */ export const ASSERT_TRUE = "AssertTrue"; /** Internal validation function for {@link AssertTrue} validator. */ function isAssertTrueValid(value: boolean): boolean { - API.Utilities.Objects.assertType("boolean", value); + Objects.assertType("boolean", value); return !!value; } @@ -58,15 +59,13 @@ function isAssertTrueValid(value: boolean): boolean { * } * ``` */ -export function AssertTrue( - options?: API.Decorators.DecoratorOptions -): FieldDecorator { +export function AssertTrue(options?: DecoratorOptions): FieldDecorator { return createFieldValidator( (value, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, ASSERT_TRUE), + key: buildKeyProp(options, ASSERT_TRUE), valid: isAssertTrueValid(value), - message: API.Decorators.buildMessageProp(options, locale, translate(locale, ASSERT_TRUE)), + message: buildMessageProp(options, locale, translate(locale, ASSERT_TRUE)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/class/ValidDateRange.ts b/packages/core/src/decorators/data/validators/class/ValidDateRange.ts index c1fa179e2..967872de2 100644 --- a/packages/core/src/decorators/data/validators/class/ValidDateRange.ts +++ b/packages/core/src/decorators/data/validators/class/ValidDateRange.ts @@ -1,13 +1,14 @@ -import * as API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createClassValidator, type ClassDecorator } from "../../../index"; +import { ClassDecorator, createClassValidator } from "@decorators/factory/forClass"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects, Types } from "@utilities"; /** `@ValidDateRange` key. */ export const VALID_DATE_RANGE = "ValidDateRange"; /** Internal validation function for {@link ValidDateRange} validator. */ function isValidDateRangeValid(value: any, startDateField: string, endDateField: string): boolean { - API.Utilities.Objects.assertType("object", value); + Objects.assertType("object", value); return value[startDateField].getTime() < value[endDateField].getTime(); } @@ -61,16 +62,16 @@ function isValidDateRangeValid(value: any, startDateField: string, endDateField: * } * ``` */ -export function ValidDateRange( +export function ValidDateRange( startDateField: string, endDateField: string, - options?: API.Decorators.DecoratorOptions + options?: DecoratorOptions ): ClassDecorator { return createClassValidator( (value, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, VALID_DATE_RANGE), + key: buildKeyProp(options, VALID_DATE_RANGE), valid: isValidDateRangeValid(value, startDateField, endDateField), - message: API.Decorators.buildMessageProp( + message: buildMessageProp( options, locale, translate( @@ -81,7 +82,7 @@ export function ValidDateRange( ) ), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } @@ -90,9 +91,7 @@ function convertCamelCaseToText(camelCase: string, capitalizeFirstLetter: boolea return camelCase; } - const result = camelCase - .replace(/([a-z0-9])([A-Z])/g, "$1 $2") - .replace(/ (\w)/g, str => str.toLowerCase()); + const result = camelCase.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/ (\w)/g, str => str.toLowerCase()); return capitalizeFirstLetter ? result.replace(/^./, str => str.toUpperCase()) : result; } diff --git a/packages/core/src/decorators/data/validators/date/FutureDate.ts b/packages/core/src/decorators/data/validators/date/FutureDate.ts index eea6db26b..ff49589e1 100644 --- a/packages/core/src/decorators/data/validators/date/FutureDate.ts +++ b/packages/core/src/decorators/data/validators/date/FutureDate.ts @@ -1,13 +1,14 @@ -import * as API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator, type FieldDecorator } from "../../../index"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@FutureDate` key. */ export const FUTURE_DATE = "FutureDate"; /** Internal validation function for {@link FutureDate} validator. */ -function isFutureDateValid>(date: T): boolean { - API.Utilities.Objects.assertType("date", date); +function isFutureDateValid>(date: T): boolean { + Objects.assertType("date", date); return date && date.getTime() > new Date().getTime(); } @@ -58,19 +59,13 @@ function isFutureDateValid>(date: * } * ``` */ -export function FutureDate>( - options?: API.Decorators.DecoratorOptions -): FieldDecorator { +export function FutureDate>(options?: DecoratorOptions): FieldDecorator { return createFieldValidator( (date, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, FUTURE_DATE), + key: buildKeyProp(options, FUTURE_DATE), valid: isFutureDateValid(date), - message: API.Decorators.buildMessageProp( - options, - locale, - translate(locale, FUTURE_DATE, date) - ), + message: buildMessageProp(options, locale, translate(locale, FUTURE_DATE, date)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/date/PastDate.ts b/packages/core/src/decorators/data/validators/date/PastDate.ts index 967daee16..cc300fe20 100644 --- a/packages/core/src/decorators/data/validators/date/PastDate.ts +++ b/packages/core/src/decorators/data/validators/date/PastDate.ts @@ -1,13 +1,14 @@ -import * as API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator, type FieldDecorator } from "../../../index"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@PastDate` key. */ export const PAST_DATE = "PastDate"; /** Internal validation function for {@link PastDate} validator. */ -function isPastDateValid>(date: T): boolean { - API.Utilities.Objects.assertType("date", date); +function isPastDateValid>(date: T): boolean { + Objects.assertType("date", date); return date && date.getTime() < new Date().getTime(); } @@ -58,15 +59,13 @@ function isPastDateValid>(date: T * } * ``` */ -export function PastDate>( - options?: API.Decorators.DecoratorOptions -): FieldDecorator { +export function PastDate>(options?: DecoratorOptions): FieldDecorator { return createFieldValidator( (date, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, PAST_DATE), + key: buildKeyProp(options, PAST_DATE), valid: isPastDateValid(date), - message: API.Decorators.buildMessageProp(options, locale, translate(locale, PAST_DATE, date)), + message: buildMessageProp(options, locale, translate(locale, PAST_DATE, date)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/date/TodayDate.ts b/packages/core/src/decorators/data/validators/date/TodayDate.ts index 2d3d9d30e..9c25746d4 100644 --- a/packages/core/src/decorators/data/validators/date/TodayDate.ts +++ b/packages/core/src/decorators/data/validators/date/TodayDate.ts @@ -1,13 +1,14 @@ -import * as API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator, type FieldDecorator } from "../../../index"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@TodayDate` key. */ export const TODAY_DATE = "TodayDate"; /** Internal validation function for {@link TodayDate} validator. */ -function isTodayDateValid>(date: T): boolean { - API.Utilities.Objects.assertType("date", date); +function isTodayDateValid>(date: T): boolean { + Objects.assertType("date", date); const currentDate = new Date(); return ( date && @@ -64,19 +65,13 @@ function isTodayDateValid>(date: * } * ``` */ -export function TodayDate>( - options?: API.Decorators.DecoratorOptions -): FieldDecorator { +export function TodayDate>(options?: DecoratorOptions): FieldDecorator { return createFieldValidator( (date, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, TODAY_DATE), + key: buildKeyProp(options, TODAY_DATE), valid: isTodayDateValid(date), - message: API.Decorators.buildMessageProp( - options, - locale, - translate(locale, TODAY_DATE, date) - ), + message: buildMessageProp(options, locale, translate(locale, TODAY_DATE, date)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/index.ts b/packages/core/src/decorators/data/validators/index.ts index 472367913..40cd58b96 100644 --- a/packages/core/src/decorators/data/validators/index.ts +++ b/packages/core/src/decorators/data/validators/index.ts @@ -40,3 +40,4 @@ export * from "./string/regex/impl/Lowercase"; export * from "./string/regex/impl/Numeric"; export * from "./string/regex/impl/URL"; export * from "./string/regex/impl/Uppercase"; +export * from "./string/regex/shared/regex.constants"; diff --git a/packages/core/src/decorators/data/validators/number/Decimal.ts b/packages/core/src/decorators/data/validators/number/Decimal.ts index 34dafafe4..084ee0544 100644 --- a/packages/core/src/decorators/data/validators/number/Decimal.ts +++ b/packages/core/src/decorators/data/validators/number/Decimal.ts @@ -1,13 +1,14 @@ -import * as API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator, type FieldDecorator } from "../../../index"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@Decimal` key. */ export const DECIMAL = "Decimal"; /** Internal validation function for {@link Decimal} validator. */ -function isDecimalValid>(value: T): boolean { - API.Utilities.Objects.assertType("number", value); +function isDecimalValid>(value: T): boolean { + Objects.assertType("number", value); return value !== undefined && value !== null && !Number.isInteger(value); } @@ -58,15 +59,13 @@ function isDecimalValid>(value: * } * ``` */ -export function Decimal>( - options?: API.Decorators.DecoratorOptions -): FieldDecorator { +export function Decimal>(options?: DecoratorOptions): FieldDecorator { return createFieldValidator( (value, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, DECIMAL), + key: buildKeyProp(options, DECIMAL), valid: isDecimalValid(value), - message: API.Decorators.buildMessageProp(options, locale, translate(locale, DECIMAL, value)), + message: buildMessageProp(options, locale, translate(locale, DECIMAL, value)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/number/Digits.ts b/packages/core/src/decorators/data/validators/number/Digits.ts index 984958bc5..a762bddba 100644 --- a/packages/core/src/decorators/data/validators/number/Digits.ts +++ b/packages/core/src/decorators/data/validators/number/Digits.ts @@ -1,16 +1,13 @@ -import * as API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator, type FieldDecorator } from "../../../index"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@Digits` key. */ export const DIGITS = "Digits"; /** Internal validation function for {@link Digits} validator. */ -function isDigitsValid( - number: API.Utilities.Objects.Optional, - ints: number, - decs: number -): boolean { +function isDigitsValid(number: Objects.Optional, ints: number, decs: number): boolean { const assertValidInputs = () => { const isMaxIntegersValid = ints !== Infinity && ints % 1 === 0 && ints >= 0; const isMaxDecimalsValid = decs !== Infinity && decs % 1 === 0 && decs >= 0; @@ -75,21 +72,17 @@ function isDigitsValid( * } * ``` */ -export function Digits>( +export function Digits>( intsLimit: number, decimalsLimit: number, - options?: API.Decorators.DecoratorOptions + options?: DecoratorOptions ): FieldDecorator { return createFieldValidator( (value, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, DIGITS), + key: buildKeyProp(options, DIGITS), valid: isDigitsValid(value, intsLimit, decimalsLimit), - message: API.Decorators.buildMessageProp( - options, - locale, - translate(locale, DIGITS, intsLimit, decimalsLimit) - ), + message: buildMessageProp(options, locale, translate(locale, DIGITS, intsLimit, decimalsLimit)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/number/Integer.ts b/packages/core/src/decorators/data/validators/number/Integer.ts index 39a1a1fbd..3d645acf1 100644 --- a/packages/core/src/decorators/data/validators/number/Integer.ts +++ b/packages/core/src/decorators/data/validators/number/Integer.ts @@ -1,13 +1,14 @@ -import * as API from "../../../../../index"; -import { createFieldValidator, type FieldDecorator } from "../../../../decorators"; -import { translate } from "../../../../localization/service/TranslationService"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@Integer` key. */ export const INTEGER = "Integer"; /** Internal validation function for {@link Integer} validator. */ -function isIntegerValid(num: API.Utilities.Objects.Optional): boolean { - API.Utilities.Objects.assertType("number", num); +function isIntegerValid(num: Objects.Optional): boolean { + Objects.assertType("number", num); return num !== undefined && num !== null && Number.isInteger(num); } @@ -58,15 +59,13 @@ function isIntegerValid(num: API.Utilities.Objects.Optional): boolean { * } * ``` */ -export function Integer>( - options?: API.Decorators.DecoratorOptions -): FieldDecorator { +export function Integer>(options?: DecoratorOptions): FieldDecorator { return createFieldValidator( (num, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, INTEGER), + key: buildKeyProp(options, INTEGER), valid: isIntegerValid(num), - message: API.Decorators.buildMessageProp(options, locale, translate(locale, INTEGER, num)), + message: buildMessageProp(options, locale, translate(locale, INTEGER, num)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/number/Negative.ts b/packages/core/src/decorators/data/validators/number/Negative.ts index 727255ad7..9e0792185 100644 --- a/packages/core/src/decorators/data/validators/number/Negative.ts +++ b/packages/core/src/decorators/data/validators/number/Negative.ts @@ -1,13 +1,14 @@ -import * as API from "../../../../../index"; -import { createFieldValidator, type FieldDecorator } from "../../../../decorators"; -import { translate } from "../../../../localization/service/TranslationService"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@Negative` key. */ export const NEGATIVE = "Negative"; /** Internal validation function for {@link Negative} validator. */ -function isNegativeValid(num: API.Utilities.Objects.Optional): boolean { - API.Utilities.Objects.assertType("number", num); +function isNegativeValid(num: Objects.Optional): boolean { + Objects.assertType("number", num); return num !== undefined && num !== null && num < 0; } @@ -58,15 +59,13 @@ function isNegativeValid(num: API.Utilities.Objects.Optional): boolean { * } * ``` */ -export function Negative>( - options?: API.Decorators.DecoratorOptions -): FieldDecorator { +export function Negative>(options?: DecoratorOptions): FieldDecorator { return createFieldValidator( (num, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, NEGATIVE), + key: buildKeyProp(options, NEGATIVE), valid: isNegativeValid(num), - message: API.Decorators.buildMessageProp(options, locale, translate(locale, NEGATIVE, num)), + message: buildMessageProp(options, locale, translate(locale, NEGATIVE, num)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/number/NonNegative.ts b/packages/core/src/decorators/data/validators/number/NonNegative.ts index 33015d051..af77c8a80 100644 --- a/packages/core/src/decorators/data/validators/number/NonNegative.ts +++ b/packages/core/src/decorators/data/validators/number/NonNegative.ts @@ -1,13 +1,14 @@ -import * as API from "../../../../../index"; -import { createFieldValidator, type FieldDecorator } from "../../../../decorators"; -import { translate } from "../../../../localization/service/TranslationService"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@NonNegative` key. */ export const NON_NEGATIVE = "NonNegative"; /** Internal validation function for {@link NonNegative} validator. */ -function isNonNegativeValid(num: API.Utilities.Objects.Optional): boolean { - API.Utilities.Objects.assertType("number", num); +function isNonNegativeValid(num: Objects.Optional): boolean { + Objects.assertType("number", num); return num !== undefined && num !== null && num >= 0; } @@ -58,19 +59,13 @@ function isNonNegativeValid(num: API.Utilities.Objects.Optional): boolea * } * ``` */ -export function NonNegative>( - options?: API.Decorators.DecoratorOptions -): FieldDecorator { +export function NonNegative>(options?: DecoratorOptions): FieldDecorator { return createFieldValidator( (num, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, NON_NEGATIVE), + key: buildKeyProp(options, NON_NEGATIVE), valid: isNonNegativeValid(num), - message: API.Decorators.buildMessageProp( - options, - locale, - translate(locale, NON_NEGATIVE, num) - ), + message: buildMessageProp(options, locale, translate(locale, NON_NEGATIVE, num)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/number/NonPositive.ts b/packages/core/src/decorators/data/validators/number/NonPositive.ts index 08742f9ba..98cc82536 100644 --- a/packages/core/src/decorators/data/validators/number/NonPositive.ts +++ b/packages/core/src/decorators/data/validators/number/NonPositive.ts @@ -1,13 +1,14 @@ -import * as API from "../../../../../index"; -import { createFieldValidator, type FieldDecorator } from "../../../../decorators"; -import { translate } from "../../../../localization/service/TranslationService"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@NonPositive` key. */ export const NON_POSITIVE = "NonPositive"; /** Internal validation function for {@link NonPositive} validator. */ -function isNonPositiveValid(num: API.Utilities.Objects.Optional): boolean { - API.Utilities.Objects.assertType("number", num); +function isNonPositiveValid(num: Objects.Optional): boolean { + Objects.assertType("number", num); return num !== undefined && num !== null && num <= 0; } @@ -58,19 +59,13 @@ function isNonPositiveValid(num: API.Utilities.Objects.Optional): boolea * } * ``` */ -export function NonPositive>( - options?: API.Decorators.DecoratorOptions -): FieldDecorator { +export function NonPositive>(options?: DecoratorOptions): FieldDecorator { return createFieldValidator( (num, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, NON_POSITIVE), + key: buildKeyProp(options, NON_POSITIVE), valid: isNonPositiveValid(num), - message: API.Decorators.buildMessageProp( - options, - locale, - translate(locale, NON_POSITIVE, num) - ), + message: buildMessageProp(options, locale, translate(locale, NON_POSITIVE, num)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/number/Positive.ts b/packages/core/src/decorators/data/validators/number/Positive.ts index 8c5276a7b..41fe3e0f2 100644 --- a/packages/core/src/decorators/data/validators/number/Positive.ts +++ b/packages/core/src/decorators/data/validators/number/Positive.ts @@ -1,13 +1,14 @@ -import * as API from "../../../../../index"; -import { createFieldValidator, type FieldDecorator } from "../../../../decorators"; -import { translate } from "../../../../localization/service/TranslationService"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@Positive` key. */ export const POSITIVE = "Positive"; /** Internal validation function for {@link Positive} validator. */ -function isPositiveValid(num: API.Utilities.Objects.Optional): boolean { - API.Utilities.Objects.assertType("number", num); +function isPositiveValid(num: Objects.Optional): boolean { + Objects.assertType("number", num); return num !== undefined && num !== null && num > 0; } @@ -58,15 +59,13 @@ function isPositiveValid(num: API.Utilities.Objects.Optional): boolean { * } * ``` */ -export function Positive>( - options?: API.Decorators.DecoratorOptions -): FieldDecorator { +export function Positive>(options?: DecoratorOptions): FieldDecorator { return createFieldValidator( (num, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, POSITIVE), + key: buildKeyProp(options, POSITIVE), valid: isPositiveValid(num), - message: API.Decorators.buildMessageProp(options, locale, translate(locale, POSITIVE, num)), + message: buildMessageProp(options, locale, translate(locale, POSITIVE, num)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/number/ValueMax.ts b/packages/core/src/decorators/data/validators/number/ValueMax.ts index c29131775..8b7700de5 100644 --- a/packages/core/src/decorators/data/validators/number/ValueMax.ts +++ b/packages/core/src/decorators/data/validators/number/ValueMax.ts @@ -1,13 +1,14 @@ -import * as API from "../../../../../index"; -import { createFieldValidator, type FieldDecorator } from "../../../../decorators"; -import { translate } from "../../../../localization/service/TranslationService"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@ValueMax` key. */ export const VALUE_MAX = "ValueMax"; /** Internal validation function for {@link ValueMax} validator. */ -function isValueMaxValid(num: API.Utilities.Objects.Optional, max: number): boolean { - API.Utilities.Objects.assertType("number", num); +function isValueMaxValid(num: Objects.Optional, max: number): boolean { + Objects.assertType("number", num); return num == null ? true : num <= max; } @@ -59,20 +60,16 @@ function isValueMaxValid(num: API.Utilities.Objects.Optional, max: numbe * } * ``` */ -export function ValueMax>( +export function ValueMax>( max: number, - options?: API.Decorators.DecoratorOptions + options?: DecoratorOptions ): FieldDecorator { return createFieldValidator( (value, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, VALUE_MAX), + key: buildKeyProp(options, VALUE_MAX), valid: isValueMaxValid(value, max), - message: API.Decorators.buildMessageProp( - options, - locale, - translate(locale, VALUE_MAX, max, value) - ), + message: buildMessageProp(options, locale, translate(locale, VALUE_MAX, max, value)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/number/ValueMin.ts b/packages/core/src/decorators/data/validators/number/ValueMin.ts index 75c177bed..5dc6cfdca 100644 --- a/packages/core/src/decorators/data/validators/number/ValueMin.ts +++ b/packages/core/src/decorators/data/validators/number/ValueMin.ts @@ -1,13 +1,14 @@ -import * as API from "../../../../../index"; -import { createFieldValidator, type FieldDecorator } from "../../../../decorators"; -import { translate } from "../../../../localization/service/TranslationService"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@ValueMin` key. */ export const VALUE_MIN = "ValueMin"; /** Internal validation function for {@link ValueMin} validator. */ -function isValueMinValid(num: API.Utilities.Objects.Optional, min: number): boolean { - API.Utilities.Objects.assertType("number", num); +function isValueMinValid(num: Objects.Optional, min: number): boolean { + Objects.assertType("number", num); return num == null ? true : num >= min; } @@ -59,20 +60,16 @@ function isValueMinValid(num: API.Utilities.Objects.Optional, min: numbe * } * ``` */ -export function ValueMin>( +export function ValueMin>( min: number, - options?: API.Decorators.DecoratorOptions + options?: DecoratorOptions ): FieldDecorator { return createFieldValidator( (value, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, VALUE_MIN), + key: buildKeyProp(options, VALUE_MIN), valid: isValueMinValid(value, min), - message: API.Decorators.buildMessageProp( - options, - locale, - translate(locale, VALUE_MIN, min, value) - ), + message: buildMessageProp(options, locale, translate(locale, VALUE_MIN, min, value)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/number/ValueRange.ts b/packages/core/src/decorators/data/validators/number/ValueRange.ts index eb312c0f0..77b87b864 100644 --- a/packages/core/src/decorators/data/validators/number/ValueRange.ts +++ b/packages/core/src/decorators/data/validators/number/ValueRange.ts @@ -1,17 +1,14 @@ -import * as API from "../../../../../index"; -import { createFieldValidator, type FieldDecorator } from "../../../../decorators"; -import { translate } from "../../../../localization/service/TranslationService"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@ValueRange` key. */ export const VALUE_RANGE = "ValueRange"; /** Internal validation function for {@link ValueRange} validator. */ -function isValueRangeValid( - num: API.Utilities.Objects.Optional, - min: number, - max: number -): boolean { - API.Utilities.Objects.assertType("number", num); +function isValueRangeValid(num: Objects.Optional, min: number, max: number): boolean { + Objects.assertType("number", num); return num == null ? true : num >= min && num <= max; } @@ -64,21 +61,17 @@ function isValueRangeValid( * } * ``` */ -export function ValueRange>( +export function ValueRange>( min: number, max: number, - options?: API.Decorators.DecoratorOptions + options?: DecoratorOptions ): FieldDecorator { return createFieldValidator( (num, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, VALUE_RANGE), + key: buildKeyProp(options, VALUE_RANGE), valid: isValueRangeValid(num, min, max), - message: API.Decorators.buildMessageProp( - options, - locale, - translate(locale, VALUE_RANGE, min, max, num) - ), + message: buildMessageProp(options, locale, translate(locale, VALUE_RANGE, min, max, num)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/string/ExactLength.ts b/packages/core/src/decorators/data/validators/string/ExactLength.ts index 8102a0336..3d7833339 100644 --- a/packages/core/src/decorators/data/validators/string/ExactLength.ts +++ b/packages/core/src/decorators/data/validators/string/ExactLength.ts @@ -1,13 +1,14 @@ -import * as API from "../../../../../index"; -import { createFieldValidator, type FieldDecorator } from "../../../../decorators"; -import { translate } from "../../../../localization/service/TranslationService"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@ExactLength` key. */ export const EXACT_LENGTH = "ExactLength"; /** Internal validation function for {@link ExactLength} validator. */ -function isExactLengthValid(value: API.Utilities.Objects.Optional, exact: number): boolean { - API.Utilities.Objects.assertType("string", value); +function isExactLengthValid(value: Objects.Optional, exact: number): boolean { + Objects.assertType("string", value); return (value ?? "").length === exact; } @@ -56,20 +57,16 @@ function isExactLengthValid(value: API.Utilities.Objects.Optional, exact * } * ``` */ -export function ExactLength>( +export function ExactLength>( exact: number, - options?: API.Decorators.DecoratorOptions + options?: DecoratorOptions ): FieldDecorator { return createFieldValidator( (value, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, EXACT_LENGTH), + key: buildKeyProp(options, EXACT_LENGTH), valid: isExactLengthValid(value, exact), - message: API.Decorators.buildMessageProp( - options, - locale, - translate(locale, EXACT_LENGTH, exact) - ), + message: buildMessageProp(options, locale, translate(locale, EXACT_LENGTH, exact)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/string/MaxLength.ts b/packages/core/src/decorators/data/validators/string/MaxLength.ts index 042780739..b5f996b06 100644 --- a/packages/core/src/decorators/data/validators/string/MaxLength.ts +++ b/packages/core/src/decorators/data/validators/string/MaxLength.ts @@ -1,13 +1,14 @@ -import * as API from "../../../../../index"; -import { createFieldValidator, type FieldDecorator } from "../../../../decorators"; -import { translate } from "../../../../localization/service/TranslationService"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@MaxLength` key. */ export const MAX_LENGTH = "MaxLength"; /** Internal validation function for {@link MaxLength} validator. */ -function isMaxLengthValid(value: API.Utilities.Objects.Optional, max: number): boolean { - API.Utilities.Objects.assertType("string", value); +function isMaxLengthValid(value: Objects.Optional, max: number): boolean { + Objects.assertType("string", value); return (value ?? "").length <= max; } @@ -56,16 +57,16 @@ function isMaxLengthValid(value: API.Utilities.Objects.Optional, max: nu * } * ``` */ -export function MaxLength>( +export function MaxLength>( max: number, - options?: API.Decorators.DecoratorOptions + options?: DecoratorOptions ): FieldDecorator { return createFieldValidator( (value, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, MAX_LENGTH), + key: buildKeyProp(options, MAX_LENGTH), valid: isMaxLengthValid(value, max), - message: API.Decorators.buildMessageProp(options, locale, translate(locale, MAX_LENGTH, max)), + message: buildMessageProp(options, locale, translate(locale, MAX_LENGTH, max)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/string/MinLength.ts b/packages/core/src/decorators/data/validators/string/MinLength.ts index 1c5dda781..8b77cf26d 100644 --- a/packages/core/src/decorators/data/validators/string/MinLength.ts +++ b/packages/core/src/decorators/data/validators/string/MinLength.ts @@ -1,13 +1,14 @@ -import * as API from "../../../../../index"; -import { createFieldValidator } from "../../../../decorators"; -import { translate } from "../../../../localization/service/TranslationService"; +import { createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@MinLength` key. */ export const MIN_LENGTH = "MinLength"; /** Internal validation function for {@link MinLength} validator. */ -function isMinLengthValid(value: API.Utilities.Objects.Optional, min: number): boolean { - API.Utilities.Objects.assertType("string", value); +function isMinLengthValid(value: Objects.Optional, min: number): boolean { + Objects.assertType("string", value); return (value ?? "").length >= min; } @@ -56,16 +57,13 @@ function isMinLengthValid(value: API.Utilities.Objects.Optional, min: nu * } * ``` */ -export function MinLength>( - min: number, - options?: API.Decorators.DecoratorOptions -) { +export function MinLength>(min: number, options?: DecoratorOptions) { return createFieldValidator( (value, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, MIN_LENGTH), + key: buildKeyProp(options, MIN_LENGTH), valid: isMinLengthValid(value, min), - message: API.Decorators.buildMessageProp(options, locale, translate(locale, MIN_LENGTH, min)), + message: buildMessageProp(options, locale, translate(locale, MIN_LENGTH, min)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/string/Password.ts b/packages/core/src/decorators/data/validators/string/Password.ts index 857327bf2..ecd745c25 100644 --- a/packages/core/src/decorators/data/validators/string/Password.ts +++ b/packages/core/src/decorators/data/validators/string/Password.ts @@ -1,7 +1,8 @@ -import * as API from "../../../../../index"; -import { createFieldValidator } from "../../../../decorators"; -import { translate } from "../../../../localization/service/TranslationService"; -import RegexConst from "./regex/shared/regex.constants"; +import { RegexConst } from "@decorators/data/validators/string/regex/shared/regex.constants"; +import { createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp } from "@decorators/helper"; +import { Locale, translate } from "@localization"; +import { Objects } from "@utilities"; /** `@Password` key. */ export const PASSWORD = "Password"; @@ -17,10 +18,10 @@ export type PasswordRules = { /** Internal validation function for {@link Password} validator. */ function isPasswordValid( - input: API.Utilities.Objects.Optional, + input: Objects.Optional, rules: PasswordRules | undefined, definedMessage?: string, - locale?: API.Localization.Locale + locale?: Locale ) { const PASSWORD_REGEXES = { uppercase: RegexConst.UPPERCASE_ANYWHERE, @@ -47,24 +48,15 @@ function isPasswordValid( const length = rules?.length ?? 8; const str = input ?? ""; if (str.length < length) { - return buildConstraintViolation( - definedMessage ?? translate(locale, "PasswordLength", length), - false - ); + return buildConstraintViolation(definedMessage ?? translate(locale, "PasswordLength", length), false); } if (uppercase && isInvalid(str, "uppercase")) { - return buildConstraintViolation( - definedMessage ?? translate(locale, "PasswordUppercase"), - false - ); + return buildConstraintViolation(definedMessage ?? translate(locale, "PasswordUppercase"), false); } if (lowercase && isInvalid(str, "lowercase")) { - return buildConstraintViolation( - definedMessage ?? translate(locale, "PasswordLowercase"), - false - ); + return buildConstraintViolation(definedMessage ?? translate(locale, "PasswordLowercase"), false); } if (numbers && isInvalid(str, "numbers")) { @@ -132,12 +124,9 @@ function isPasswordValid( * } * ``` */ -export function Password>( - rules?: PasswordRules, - options?: API.Decorators.DecoratorOptions -) { +export function Password>(rules?: PasswordRules, options?: DecoratorOptions) { return createFieldValidator( (value, _context, locale) => isPasswordValid(value, rules, options?.message, locale), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/string/regex/Pattern.ts b/packages/core/src/decorators/data/validators/string/regex/Pattern.ts index 3c1de8bf9..833633236 100644 --- a/packages/core/src/decorators/data/validators/string/regex/Pattern.ts +++ b/packages/core/src/decorators/data/validators/string/regex/Pattern.ts @@ -1,6 +1,7 @@ -import * as API from "../../../../../../index"; -import { createFieldValidator } from "../../../../../decorators"; -import { translate } from "../../../../../localization/service/TranslationService"; +import { createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** * Tests if a value matches a regular expression pattern. @@ -9,10 +10,7 @@ import { translate } from "../../../../../localization/service/TranslationServic * @param value - The value to test. * @returns A boolean indicating whether the value matches the pattern. */ -export function testRegex>( - regex: RegExp, - value: T -): boolean { +export function testRegex>(regex: RegExp, value: T): boolean { return (value ?? "").length === 0 || regex.test(value!); } @@ -45,20 +43,13 @@ export function testRegex>( * } * ``` */ -export function Pattern>( - regex: RegExp, - options?: API.Decorators.DecoratorOptions -) { +export function Pattern>(regex: RegExp, options?: DecoratorOptions) { return createFieldValidator( (value, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, "Pattern"), + key: buildKeyProp(options, "Pattern"), valid: testRegex(regex, value), - message: API.Decorators.buildMessageProp( - options, - locale, - translate(locale, "Pattern", regex.toString()) - ), + message: buildMessageProp(options, locale, translate(locale, "Pattern", regex.toString())), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/string/regex/impl/Alpha.ts b/packages/core/src/decorators/data/validators/string/regex/impl/Alpha.ts index f6324ac68..0d5846cdb 100644 --- a/packages/core/src/decorators/data/validators/string/regex/impl/Alpha.ts +++ b/packages/core/src/decorators/data/validators/string/regex/impl/Alpha.ts @@ -1,15 +1,16 @@ -import * as API from "../../../../../../../index"; -import { createFieldValidator, type FieldDecorator } from "../../../../../../decorators"; -import { translate } from "../../../../../../localization/service/TranslationService"; -import { testRegex } from "../Pattern"; -import RegexConst from "../shared/regex.constants"; +import { testRegex } from "@decorators/data/validators/string/regex/Pattern"; +import { RegexConst } from "@decorators/data/validators/string/regex/shared/regex.constants"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@Alpha` key. */ export const ALPHA = "Alpha"; /** Internal validation function for {@link Alpha} validator. */ -function isAlphaValid>(value: T): boolean { - API.Utilities.Objects.assertType("string", value); +function isAlphaValid>(value: T): boolean { + Objects.assertType("string", value); return testRegex(RegexConst.ALPHA, value); } @@ -60,15 +61,13 @@ function isAlphaValid>(value: T * } * ``` */ -export function Alpha>( - options?: API.Decorators.DecoratorOptions -): FieldDecorator { +export function Alpha>(options?: DecoratorOptions): FieldDecorator { return createFieldValidator( (value, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, ALPHA), - valid: testRegex(RegexConst.ALPHA, value), - message: API.Decorators.buildMessageProp(options, locale, translate(locale, ALPHA)), + key: buildKeyProp(options, ALPHA), + valid: isAlphaValid(value), + message: buildMessageProp(options, locale, translate(locale, ALPHA)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/string/regex/impl/Alphanumeric.ts b/packages/core/src/decorators/data/validators/string/regex/impl/Alphanumeric.ts index 4599e08d0..1f02d98de 100644 --- a/packages/core/src/decorators/data/validators/string/regex/impl/Alphanumeric.ts +++ b/packages/core/src/decorators/data/validators/string/regex/impl/Alphanumeric.ts @@ -1,15 +1,16 @@ -import * as API from "../../../../../../../index"; -import { createFieldValidator, type FieldDecorator } from "../../../../../../decorators"; -import { translate } from "../../../../../../localization/service/TranslationService"; -import { testRegex } from "../Pattern"; -import RegexConst from "../shared/regex.constants"; +import { testRegex } from "@decorators/data/validators/string/regex/Pattern"; +import { RegexConst } from "@decorators/data/validators/string/regex/shared/regex.constants"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@Alphanumeric` key. */ export const ALPHANUMERIC = "Alphanumeric"; /** Internal validation function for {@link Alphanumeric} validator. */ -function isAlphanumericValid>(value: T): boolean { - API.Utilities.Objects.assertType("string", value); +function isAlphanumericValid>(value: T): boolean { + Objects.assertType("string", value); return testRegex(RegexConst.ALPHANUMERIC, value); } @@ -60,15 +61,13 @@ function isAlphanumericValid>(v * } * ``` */ -export function Alphanumeric>( - options?: API.Decorators.DecoratorOptions -): FieldDecorator { +export function Alphanumeric>(options?: DecoratorOptions): FieldDecorator { return createFieldValidator( (value, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, ALPHANUMERIC), - valid: testRegex(RegexConst.ALPHANUMERIC, value), - message: API.Decorators.buildMessageProp(options, locale, translate(locale, ALPHANUMERIC)), + key: buildKeyProp(options, ALPHANUMERIC), + valid: isAlphanumericValid(value), + message: buildMessageProp(options, locale, translate(locale, ALPHANUMERIC)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/string/regex/impl/Email.ts b/packages/core/src/decorators/data/validators/string/regex/impl/Email.ts index bce711ba2..23bef0365 100644 --- a/packages/core/src/decorators/data/validators/string/regex/impl/Email.ts +++ b/packages/core/src/decorators/data/validators/string/regex/impl/Email.ts @@ -1,15 +1,16 @@ -import * as API from "../../../../../../../index"; -import { createFieldValidator, type FieldDecorator } from "../../../../../../decorators"; -import { translate } from "../../../../../../localization/service/TranslationService"; -import { testRegex } from "../Pattern"; -import RegexConst from "../shared/regex.constants"; +import { testRegex } from "@decorators/data/validators/string/regex/Pattern"; +import { RegexConst } from "@decorators/data/validators/string/regex/shared/regex.constants"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@Email` key. */ export const EMAIL = "Email"; /** Internal validation function for {@link Email} validator. */ -function isEmailValid>(value: T): boolean { - API.Utilities.Objects.assertType("string", value); +function isEmailValid>(value: T): boolean { + Objects.assertType("string", value); return testRegex(RegexConst.EMAIL, value); } @@ -60,15 +61,13 @@ function isEmailValid>(value: T * } * ``` */ -export function Email>( - options?: API.Decorators.DecoratorOptions -): FieldDecorator { +export function Email>(options?: DecoratorOptions): FieldDecorator { return createFieldValidator( (value, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, EMAIL), - valid: testRegex(RegexConst.EMAIL, value), - message: API.Decorators.buildMessageProp(options, locale, translate(locale, EMAIL)), + key: buildKeyProp(options, EMAIL), + valid: isEmailValid(value), + message: buildMessageProp(options, locale, translate(locale, EMAIL)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/string/regex/impl/IPAddress.ts b/packages/core/src/decorators/data/validators/string/regex/impl/IPAddress.ts index 60e95dc36..98db94162 100644 --- a/packages/core/src/decorators/data/validators/string/regex/impl/IPAddress.ts +++ b/packages/core/src/decorators/data/validators/string/regex/impl/IPAddress.ts @@ -1,15 +1,16 @@ -import * as API from "../../../../../../../index"; -import { createFieldValidator, type FieldDecorator } from "../../../../../../decorators"; -import { translate } from "../../../../../../localization/service/TranslationService"; -import { testRegex } from "../Pattern"; -import RegexConst from "../shared/regex.constants"; +import { testRegex } from "@decorators/data/validators/string/regex/Pattern"; +import { RegexConst } from "@decorators/data/validators/string/regex/shared/regex.constants"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@IPAddress` key. */ export const IP_ADDRESS = "IPAddress"; /** Internal validation function for {@link IPAddress} validator. */ -function isIPAddressValid>(value: T): boolean { - API.Utilities.Objects.assertType("string", value); +function isIPAddressValid>(value: T): boolean { + Objects.assertType("string", value); return testRegex(RegexConst.IP_ADDRESS, value); } @@ -60,15 +61,13 @@ function isIPAddressValid>(valu * } * ``` */ -export function IPAddress>( - options?: API.Decorators.DecoratorOptions -): FieldDecorator { +export function IPAddress>(options?: DecoratorOptions): FieldDecorator { return createFieldValidator( (value, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, IP_ADDRESS), - valid: testRegex(RegexConst.IP_ADDRESS, value), - message: API.Decorators.buildMessageProp(options, locale, translate(locale, IP_ADDRESS)), + key: buildKeyProp(options, IP_ADDRESS), + valid: isIPAddressValid(value), + message: buildMessageProp(options, locale, translate(locale, IP_ADDRESS)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/string/regex/impl/Lowercase.ts b/packages/core/src/decorators/data/validators/string/regex/impl/Lowercase.ts index 21b0d1ac3..d01ff509a 100644 --- a/packages/core/src/decorators/data/validators/string/regex/impl/Lowercase.ts +++ b/packages/core/src/decorators/data/validators/string/regex/impl/Lowercase.ts @@ -1,15 +1,16 @@ -import * as API from "../../../../../../../index"; -import { createFieldValidator, type FieldDecorator } from "../../../../../../decorators"; -import { translate } from "../../../../../../localization/service/TranslationService"; -import { testRegex } from "../Pattern"; -import RegexConst from "../shared/regex.constants"; +import { testRegex } from "@decorators/data/validators/string/regex/Pattern"; +import { RegexConst } from "@decorators/data/validators/string/regex/shared/regex.constants"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@Lowercase` key. */ export const LOWERCASE = "Lowercase"; /** Internal validation function for {@link Lowercase} validator. */ -function isLowercaseValid>(value: T): boolean { - API.Utilities.Objects.assertType("string", value); +function isLowercaseValid>(value: T): boolean { + Objects.assertType("string", value); return testRegex(RegexConst.LOWERCASE, value); } @@ -60,15 +61,13 @@ function isLowercaseValid>(valu * } * ``` */ -export function Lowercase>( - options?: API.Decorators.DecoratorOptions -): FieldDecorator { +export function Lowercase>(options?: DecoratorOptions): FieldDecorator { return createFieldValidator( (value, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, LOWERCASE), - valid: testRegex(RegexConst.LOWERCASE, value), - message: API.Decorators.buildMessageProp(options, locale, translate(locale, LOWERCASE)), + key: buildKeyProp(options, LOWERCASE), + valid: isLowercaseValid(value), + message: buildMessageProp(options, locale, translate(locale, LOWERCASE)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/string/regex/impl/Numeric.ts b/packages/core/src/decorators/data/validators/string/regex/impl/Numeric.ts index 0e359f47c..ca71d686a 100644 --- a/packages/core/src/decorators/data/validators/string/regex/impl/Numeric.ts +++ b/packages/core/src/decorators/data/validators/string/regex/impl/Numeric.ts @@ -1,15 +1,16 @@ -import * as API from "../../../../../../../index"; -import { createFieldValidator, type FieldDecorator } from "../../../../../../decorators"; -import { translate } from "../../../../../../localization/service/TranslationService"; -import { testRegex } from "../Pattern"; -import RegexConst from "../shared/regex.constants"; +import { testRegex } from "@decorators/data/validators/string/regex/Pattern"; +import { RegexConst } from "@decorators/data/validators/string/regex/shared/regex.constants"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@Numeric` key. */ export const NUMERIC = "Numeric"; /** Internal validation function for {@link Numeric} validator. */ -function isNumericValid>(value: T): boolean { - API.Utilities.Objects.assertType("string", value); +function isNumericValid>(value: T): boolean { + Objects.assertType("string", value); return testRegex(RegexConst.NUMERIC, value); } @@ -60,15 +61,13 @@ function isNumericValid>(value: * } * ``` */ -export function Numeric>( - options?: API.Decorators.DecoratorOptions -): FieldDecorator { +export function Numeric>(options?: DecoratorOptions): FieldDecorator { return createFieldValidator( (value, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, NUMERIC), + key: buildKeyProp(options, NUMERIC), valid: testRegex(RegexConst.NUMERIC, value), - message: API.Decorators.buildMessageProp(options, locale, translate(locale, NUMERIC)), + message: buildMessageProp(options, locale, translate(locale, NUMERIC)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/string/regex/impl/URL.ts b/packages/core/src/decorators/data/validators/string/regex/impl/URL.ts index 17155c623..ba17d0455 100644 --- a/packages/core/src/decorators/data/validators/string/regex/impl/URL.ts +++ b/packages/core/src/decorators/data/validators/string/regex/impl/URL.ts @@ -1,15 +1,16 @@ -import * as API from "../../../../../../../index"; -import { createFieldValidator, type FieldDecorator } from "../../../../../../decorators"; -import { translate } from "../../../../../../localization/service/TranslationService"; -import { testRegex } from "../Pattern"; -import RegexConst from "../shared/regex.constants"; +import { testRegex } from "@decorators/data/validators/string/regex/Pattern"; +import { RegexConst } from "@decorators/data/validators/string/regex/shared/regex.constants"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@URL` key. */ export const URL_KEY = "URL"; /** Internal validation function for {@link URL} validator. */ -function isURLValid>(value: T): boolean { - API.Utilities.Objects.assertType("string", value); +function isURLValid>(value: T): boolean { + Objects.assertType("string", value); return testRegex(RegexConst.URL, value); } @@ -60,15 +61,13 @@ function isURLValid>(value: T): * } * ``` */ -export function URL>( - options?: API.Decorators.DecoratorOptions -): FieldDecorator { +export function URL>(options?: DecoratorOptions): FieldDecorator { return createFieldValidator( (value, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, URL_KEY), - valid: testRegex(RegexConst.URL, value), - message: API.Decorators.buildMessageProp(options, locale, translate(locale, URL_KEY)), + key: buildKeyProp(options, URL_KEY), + valid: isURLValid(value), + message: buildMessageProp(options, locale, translate(locale, URL_KEY)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/string/regex/impl/Uppercase.ts b/packages/core/src/decorators/data/validators/string/regex/impl/Uppercase.ts index 4b1b4d2d4..3a168d864 100644 --- a/packages/core/src/decorators/data/validators/string/regex/impl/Uppercase.ts +++ b/packages/core/src/decorators/data/validators/string/regex/impl/Uppercase.ts @@ -1,15 +1,16 @@ -import * as API from "../../../../../../../index"; -import { createFieldValidator, type FieldDecorator } from "../../../../../../decorators"; -import { translate } from "../../../../../../localization/service/TranslationService"; -import { testRegex } from "../Pattern"; -import RegexConst from "../shared/regex.constants"; +import { testRegex } from "@decorators/data/validators/string/regex/Pattern"; +import { RegexConst } from "@decorators/data/validators/string/regex/shared/regex.constants"; +import { FieldDecorator, createFieldValidator } from "@decorators/factory/forField"; +import { DecoratorOptions, buildGroupsProp, buildKeyProp, buildMessageProp } from "@decorators/helper"; +import { translate } from "@localization"; +import { Objects } from "@utilities"; /** `@Uppercase` key. */ export const UPPERCASE = "Uppercase"; /** Internal validation function for {@link Uppercase} validator. */ -function isUppercaseValid>(value: T): boolean { - API.Utilities.Objects.assertType("string", value); +function isUppercaseValid>(value: T): boolean { + Objects.assertType("string", value); return testRegex(RegexConst.UPPERCASE, value); } @@ -60,15 +61,13 @@ function isUppercaseValid>(valu * } * ``` */ -export function Uppercase>( - options?: API.Decorators.DecoratorOptions -): FieldDecorator { +export function Uppercase>(options?: DecoratorOptions): FieldDecorator { return createFieldValidator( (value, _context, locale) => ({ - key: API.Decorators.buildKeyProp(options, UPPERCASE), - valid: testRegex(RegexConst.UPPERCASE, value), - message: API.Decorators.buildMessageProp(options, locale, translate(locale, UPPERCASE)), + key: buildKeyProp(options, UPPERCASE), + valid: isUppercaseValid(value), + message: buildMessageProp(options, locale, translate(locale, UPPERCASE)), }), - API.Decorators.buildGroupsProp(options) + buildGroupsProp(options) ); } diff --git a/packages/core/src/decorators/data/validators/string/regex/shared/regex.constants.ts b/packages/core/src/decorators/data/validators/string/regex/shared/regex.constants.ts index 8ba92a6ec..a6c91c9fe 100644 --- a/packages/core/src/decorators/data/validators/string/regex/shared/regex.constants.ts +++ b/packages/core/src/decorators/data/validators/string/regex/shared/regex.constants.ts @@ -1,16 +1,14 @@ /** * A collection of commonly used regular expressions. - * - * @remarks - * This object provides regular expressions for various validation scenarios. - * + * @remarks This object provides regular expressions for various validation scenarios. * @example - * ```typescript + * 1: Validating URLs + * ```ts * const isURL = RegexConst.URL.test("https://example.com"); * ``` */ // prettier-ignore -const RegexConst = { +export const RegexConst = { /** Regular expression for validating URLs. */ URL: /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/, @@ -47,5 +45,3 @@ const RegexConst = { /** Regular expression for validating alphanumeric strings. */ ALPHANUMERIC: /^[a-zA-Z0-9]+$/ } as const; - -export default RegexConst; diff --git a/packages/core/src/decorators/factory/forClass/createClassDecorator.ts b/packages/core/src/decorators/factory/forClass/createClassDecorator.ts index ea22c13d6..743a34e55 100644 --- a/packages/core/src/decorators/factory/forClass/createClassDecorator.ts +++ b/packages/core/src/decorators/factory/forClass/createClassDecorator.ts @@ -1,5 +1,5 @@ -import API from "../../../index"; -import { EventEmitter } from "../../../utilities/misc/EventEmitter"; +import { ClassValidatorMetaService } from "@reflection"; +import { EventEmitter, Types } from "@utilities"; /** * Represents a class decorator function. @@ -8,7 +8,7 @@ import { EventEmitter } from "../../../utilities/misc/EventEmitter"; * @param context - The context object for the class decorator. * @returns The decorated class or undefined/void. */ -export type ClassDecorator = (( +export type ClassDecorator = (( baseClass: TClass, context: ClassDecoratorCtx // eslint-disable-next-line @typescript-eslint/no-invalid-void-type @@ -24,8 +24,8 @@ export type ClassDecorator = (( * @param context - The context object for the class decorator. * @returns The modified class or undefined/void. */ -export type ClassDecoratorSupplier = (( - meta: API.Reflection.ClassValidatorMetaService, +export type ClassDecoratorSupplier = (( + meta: ClassValidatorMetaService, baseClass: TClass, context: ClassDecoratorCtx // eslint-disable-next-line @typescript-eslint/no-invalid-void-type @@ -35,7 +35,7 @@ export type ClassDecoratorSupplier = ( * Type definition for the context of a class decorator. * @typeParam T - The type of the class being decorated. */ -export type ClassDecoratorCtx = ClassDecoratorContext; +export type ClassDecoratorCtx = ClassDecoratorContext; /** * Creates a new class decorator function using the provided supplier. @@ -44,14 +44,10 @@ export type ClassDecoratorCtx = ClassDecora * @param supplier - A callback that defines the basic class decorator behavior and returns the modified class. * @returns A basic class decorator factory. */ -export function createClassDecorator( +export function createClassDecorator( supplier: ClassDecoratorSupplier ): ClassDecorator { return function (baseClass, context) { - return supplier( - API.Reflection.ClassValidatorMetaService.inject(baseClass ?? context, EventEmitter.EMPTY), - baseClass, - context - ); + return supplier(ClassValidatorMetaService.inject(baseClass ?? context, EventEmitter.EMPTY), baseClass, context); }; } diff --git a/packages/core/src/decorators/factory/forClass/createClassValidator.ts b/packages/core/src/decorators/factory/forClass/createClassValidator.ts index ab19b46aa..01872dd7f 100644 --- a/packages/core/src/decorators/factory/forClass/createClassValidator.ts +++ b/packages/core/src/decorators/factory/forClass/createClassValidator.ts @@ -1,9 +1,9 @@ -import type API from "../../../index"; -import { type ClassDecorator, createClassDecorator } from "./createClassDecorator"; +import { Types } from "@utilities"; +import type { ValidationEvaluator } from "@validation/types"; +import { ClassDecorator, createClassDecorator } from "./createClassDecorator"; /** * Creates validation decorators for classes. - * * @typeParam T - The type of class being validated. * @param validate - The callback that defines the validation logic. * @param groups - Validation groups. @@ -17,7 +17,7 @@ import { type ClassDecorator, createClassDecorator } from "./createClassDecorato * } * * function PropGreaterThan(prop: keyof MyClass, value: number) { - * return API.Decorator.ForClass.Validator.build(instance => ({ + * return Decorators.ForClass.Validator.build(instance => ({ * key: "PropGreaterThan", * valid: instance[prop] > value, * message: `${prop} must be greater than ${value}` @@ -25,8 +25,8 @@ import { type ClassDecorator, createClassDecorator } from "./createClassDecorato * } * ``` */ -export function createClassValidator( - validate: API.Validation.ValidationEvaluator>, +export function createClassValidator( + validate: ValidationEvaluator>, groups: string[] = [] ): ClassDecorator { return createClassDecorator(meta => { diff --git a/packages/core/src/decorators/factory/forField/createFieldDecorator.ts b/packages/core/src/decorators/factory/forField/createFieldDecorator.ts index 5693ef016..5de9cba66 100644 --- a/packages/core/src/decorators/factory/forField/createFieldDecorator.ts +++ b/packages/core/src/decorators/factory/forField/createFieldDecorator.ts @@ -1,5 +1,6 @@ -import API from "../../../index"; -import { EventEmitter } from "../../../utilities/misc/EventEmitter"; +import { DecoratorArgs } from "@decorators/helper"; +import { FieldValidatorMetaService } from "@reflection"; +import { EventEmitter } from "@utilities"; /** * Represents a field decorator function that is used to decorate fields in a class. @@ -8,10 +9,7 @@ import { EventEmitter } from "../../../utilities/misc/EventEmitter"; * The context object provides additional information about the field being decorated. * @typeParam T - The type of the field being decorated. */ -export type FieldDecorator = (( - target: any, - context: FieldDecoratorCtx -) => void) & {}; +export type FieldDecorator = ((target: any, context: FieldDecoratorCtx) => void) & {}; /** * Type definition for the FieldDecoratorSupplier function. @@ -23,10 +21,10 @@ export type FieldDecorator = (( * @param args The decorator arguments. */ export type FieldDecoratorSupplier = (( - meta: API.Reflection.FieldValidatorMetaService, + meta: FieldValidatorMetaService, name: string, context: FieldDecoratorCtx, - args: API.Decorator.DecoratorArgs + args: DecoratorArgs ) => void) & {}; /** Represents the context of a field decorator. */ @@ -47,18 +45,13 @@ export type FieldDecoratorCtx = Readonly<{ * @param supplier - A callback that defines the basic field decorator behavior. * @returns A basic field decorator factory. */ -export function createFieldDecorator( - supplier: FieldDecoratorSupplier -): FieldDecorator { +export function createFieldDecorator(supplier: FieldDecoratorSupplier): FieldDecorator { return function (target, context) { const isStage2 = typeof context === "string"; const nameEval = isStage2 ? context : context.name; const strategyEval = isStage2 ? target.constructor : context; const contextEval = isStage2 ? { name: context, metadata: {} } : context; - const metaService = API.Reflection.FieldValidatorMetaService.inject( - strategyEval, - EventEmitter.EMPTY - ); + const metaService = FieldValidatorMetaService.inject(strategyEval, EventEmitter.EMPTY); supplier(metaService, String(nameEval), contextEval as any, {}); }; } diff --git a/packages/core/src/decorators/factory/forField/createFieldValidator.ts b/packages/core/src/decorators/factory/forField/createFieldValidator.ts index 95fe03756..f6b91e74a 100644 --- a/packages/core/src/decorators/factory/forField/createFieldValidator.ts +++ b/packages/core/src/decorators/factory/forField/createFieldValidator.ts @@ -1,5 +1,5 @@ -import type API from "../../../index"; -import { type FieldDecorator, createFieldDecorator } from "./createFieldDecorator"; +import type { ValidationEvaluator } from "@validation/types"; +import { FieldDecorator, createFieldDecorator } from "./createFieldDecorator"; /** * Creates validation decorators for fields. @@ -26,7 +26,7 @@ import { type FieldDecorator, createFieldDecorator } from "./createFieldDecorato * ``` */ export function createFieldValidator( - validate: API.Validation.ValidationEvaluator, + validate: ValidationEvaluator, groups?: string[] ): FieldDecorator { return createFieldDecorator((meta, key) => { diff --git a/packages/core/src/decorators/factory/index.ts b/packages/core/src/decorators/factory/index.ts index cf8989886..e18b7f818 100644 --- a/packages/core/src/decorators/factory/index.ts +++ b/packages/core/src/decorators/factory/index.ts @@ -1,2 +1,2 @@ -export * from "./forClass/index"; -export * from "./forField/index"; +export * from "./forClass"; +export * from "./forField"; diff --git a/packages/core/src/decorators/helper.ts b/packages/core/src/decorators/helper.ts new file mode 100644 index 000000000..bd9cf3970 --- /dev/null +++ b/packages/core/src/decorators/helper.ts @@ -0,0 +1,54 @@ +import { Locale, parseMessage } from "@localization"; +import { Objects } from "@utilities"; + +/** Represents decorator external dependency arguments. */ +export type DecoratorArgs = Record; + +/** Generic validator decorator configurable options. */ +export type DecoratorOptions = { + /** Identifier of the validator decorator. */ + key?: string; + /** Error message to be evaluated through a preprocessor, which can have a custom or default implementation based on library setup. */ + message?: string; + /** Unique list of groups for conditional validation. Validator triggers only if the form is applied on a listed group. */ + groups?: string[]; +}; + +/** + * Retrieves the localized message based on the provided options, locale, and default message. + * If the options contain a custom message, it will be resolved using the provided locale. + * If no custom message is provided, the default message will be returned. + * + * @param options - The options object that may contain a custom message. + * @param locale - The locale resolver used to resolve the custom message. + * @param defaultMessage - The default message to be returned if no custom message is provided. + * @returns The localized message. + */ +export function buildMessageProp( + options: DecoratorOptions | undefined, + locale: Locale, + defaultMessage: string +): string { + const msg = options?.message ?? ""; + return msg.length > 0 ? parseMessage(locale, msg) : defaultMessage ?? ""; +} + +/** + * Retrieves the unique groups from the provided options or returns the default groups. + * @param options - The options object. + * @param defaultGroups - The default groups. + * @returns An array of unique groups. + */ +export function buildGroupsProp(options?: DecoratorOptions, defaultGroups: string[] = []): string[] { + return Array.isArray(options?.groups) ? Objects.unique(options!.groups) : Objects.unique(defaultGroups); +} + +/** + * Returns the key based on the provided options or the default key. + * @param options - The options object. + * @param defaultKey - The default key. + * @returns The key. + */ +export function buildKeyProp(options: DecoratorOptions | undefined, defaultKey: string): string { + return options?.key ?? defaultKey; +} diff --git a/packages/core/src/decorators/index.ts b/packages/core/src/decorators/index.ts index d30f8ba3d..d985ba9af 100644 --- a/packages/core/src/decorators/index.ts +++ b/packages/core/src/decorators/index.ts @@ -1,60 +1,3 @@ -import API from "../../index"; export * from "./data"; export * from "./factory"; - -/** Represents decorator external dependency arguments. */ -export type DecoratorArgs = Record; - -/** Generic validator decorator configurable options. */ -export type DecoratorOptions = { - /** Identifier of the validator decorator. */ - key?: string; - /** Error message to be evaluated through a preprocessor, which can have a custom or default implementation based on library setup. */ - message?: string; - /** Unique list of groups for conditional validation. Validator triggers only if the form is applied on a listed group. */ - groups?: string[]; -}; - -/** - * Retrieves the localized message based on the provided options, locale, and default message. - * If the options contain a custom message, it will be resolved using the provided locale. - * If no custom message is provided, the default message will be returned. - * - * @param options - The options object that may contain a custom message. - * @param locale - The locale resolver used to resolve the custom message. - * @param defaultMessage - The default message to be returned if no custom message is provided. - * @returns The localized message. - */ -export function buildMessageProp( - options: DecoratorOptions | undefined, - locale: API.Localization.Locale, - defaultMessage: string -): string { - const msg = options?.message ?? ""; - return msg.length > 0 ? API.Localization.parseMessage(locale, msg) : defaultMessage ?? ""; -} - -/** - * Retrieves the unique groups from the provided options or returns the default groups. - * @param options - The options object. - * @param defaultGroups - The default groups. - * @returns An array of unique groups. - */ -export function buildGroupsProp( - options?: DecoratorOptions, - defaultGroups: string[] = [] -): string[] { - return Array.isArray(options?.groups) - ? API.Utilities.Objects.unique(options!.groups) - : API.Utilities.Objects.unique(defaultGroups); -} - -/** - * Returns the key based on the provided options or the default key. - * @param options - The options object. - * @param defaultKey - The default key. - * @returns The key. - */ -export function buildKeyProp(options: DecoratorOptions | undefined, defaultKey: string): string { - return options?.key ?? defaultKey; -} +export * from "./helper"; diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 10871a99f..e0c628c1f 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -1,31 +1,13 @@ -import * as _Decorator from "./decorators"; -import * as _collection from "./decorators/data"; -import * as _attribute from "./decorators/data/structural/attribute"; -import * as _Localization from "./localization"; -import * as _Reflection from "./reflection"; -import * as _Strategy from "./strategy"; -import * as _Utilities from "./utilities"; -import * as _Validation from "./validation"; +// samo prati redoslijed -/** `tdv-core` API entry-point. */ -namespace API { - export import Localization = _Localization; - export import Validation = _Validation; - export import Decorator = _Decorator; - export import Utilities = _Utilities; - export import Reflection = _Reflection; - export import collection = _collection; - export import attribute = _attribute.attribute; - export import Strategy = _Strategy; - /** - * Configuration object for the `tdv-core` package. - */ - export const Configuration = { - /** - * The delay in milliseconds for async validation. Defaults to `500 ms` - */ - asyncValidationDelay: 500, - }; -} +export * from "./utilities"; -export default API; +export * from "./localization"; + +export * from "./decorators"; + +export * from "./reflection"; + +export * from "./strategy"; + +export * from "./validation"; diff --git a/packages/core/src/localization/index.ts b/packages/core/src/localization/index.ts index 15b6647e9..599d92c8c 100644 --- a/packages/core/src/localization/index.ts +++ b/packages/core/src/localization/index.ts @@ -1,2 +1,2 @@ -export * from "./resolver/LocaleResolver"; -export * from "./resolver/MessageResolver"; +export * from "./resolver"; +export * from "./service"; diff --git a/packages/core/src/localization/resolver/MessageResolver.ts b/packages/core/src/localization/resolver/MessageResolver.ts index 3da778ea5..aa2b01b5b 100644 --- a/packages/core/src/localization/resolver/MessageResolver.ts +++ b/packages/core/src/localization/resolver/MessageResolver.ts @@ -1,9 +1,7 @@ -import type * as LocaleResolver from "./LocaleResolver"; +import { Locale } from "@localization/resolver/LocaleResolver"; -/** - * Message parser definition. - */ -export type MessageParser = ((locale: LocaleResolver.Locale, message: string) => string) & {}; +/** Message parser definition. */ +export type MessageParser = ((locale: Locale, message: string) => string) & {}; const DEFAULT_CONFIGURER: MessageParser = (_, message) => message; @@ -19,7 +17,7 @@ export function configureParser(handler?: MessageParser): void { /** * Internal handler for the customized message parser */ -export function parseMessage(locale: LocaleResolver.Locale, message: string): string { +export function parseMessage(locale: Locale, message: string): string { try { return configurer(locale, message); } catch (error) { diff --git a/packages/core/src/localization/resolver/index.ts b/packages/core/src/localization/resolver/index.ts new file mode 100644 index 000000000..b93e66dd9 --- /dev/null +++ b/packages/core/src/localization/resolver/index.ts @@ -0,0 +1,2 @@ +export * from "./LocaleResolver"; +export * from "./MessageResolver"; diff --git a/packages/core/src/localization/service/MessageReaderService.ts b/packages/core/src/localization/service/MessageReaderService.ts index c83e78bf4..c1d7fb347 100644 --- a/packages/core/src/localization/service/MessageReaderService.ts +++ b/packages/core/src/localization/service/MessageReaderService.ts @@ -1,4 +1,5 @@ -import * as LocaleResolver from "../resolver/LocaleResolver"; +import { Locale, getLocale } from "@localization/resolver/LocaleResolver"; + import * as de from "../translations/de.json"; import * as en from "../translations/en.json"; import * as es from "../translations/es.json"; @@ -33,7 +34,7 @@ export type LocalizedMessages = typeof en; * in which the key represents a translation identifier while the value * corresponds to the identifier's localized string. */ -export type Messages = Record; +export type Messages = Record; export type MessageKey = keyof LocalizedMessages; @@ -43,11 +44,8 @@ export type MessageKey = keyof LocalizedMessages; * @param locale Locale to translate by * @returns Localized message by key. */ -export function getMessage( - key: keyof LocalizedMessages, - locale?: LocaleResolver.Locale | null -): string { - const computedLocale = locale ?? LocaleResolver.getLocale(); +export function getMessage(key: keyof LocalizedMessages, locale?: Locale | null): string { + const computedLocale = locale ?? getLocale(); const computedLocaleMessages = messages[computedLocale]; return computedLocaleMessages[key]; } diff --git a/packages/core/src/localization/service/TranslationService.ts b/packages/core/src/localization/service/TranslationService.ts index c7f587ea3..5e0a3059c 100644 --- a/packages/core/src/localization/service/TranslationService.ts +++ b/packages/core/src/localization/service/TranslationService.ts @@ -1,5 +1,23 @@ -import API from "../../../index"; -import { type LocalizedMessages, getMessage } from "./MessageReaderService"; +import { Locale } from "@localization/resolver/LocaleResolver"; +import { LocalizedMessages, getMessage } from "@localization/service/MessageReaderService"; + +/** + * Formats a string by replacing placeholders with provided arguments. + * @param str - The string containing placeholders in the form of `{0}`, `{1}`, etc. + * @param args - The values to replace the placeholders with. + * @returns The formatted string with placeholders replaced by the corresponding values from `args`. + * @remarks If a placeholder's corresponding value is not provided in `args`, the placeholder will remain unchanged in the output string. + * @example + * 1: Basic usage + * ```ts + * const formatted = sprintf("Hello, {0}!", "World"); // Output: "Hello, World!" + * ``` + */ +function sprintf(str: string, ...args: any[]): string { + return str.replace(/{(\d+)}/g, function (match, number) { + return typeof args[number] !== "undefined" ? args[number] : match; + }); +} /** * Localizes a string based on a corresponding key and optional arguments mapped by indices. (ex: `"Hello {0}! How are you?"`) @@ -27,12 +45,8 @@ import { type LocalizedMessages, getMessage } from "./MessageReaderService"; * const greeting = translate("en", "Hello", "John Doe"); // "Hello John Doe! How are you?" * ``` */ -export function translate( - locale: API.Localization.Locale | null | undefined, - key: keyof LocalizedMessages, - ...args: any[] -): string { +export function translate(locale: Locale | null | undefined, key: keyof LocalizedMessages, ...args: any[]): string { const message = getMessage(key, locale); - const translatedMessage = API.Utilities.Strings.sprintf(message, ...args); + const translatedMessage = sprintf(message, ...args); return translatedMessage; } diff --git a/packages/core/src/localization/service/index.ts b/packages/core/src/localization/service/index.ts new file mode 100644 index 000000000..6e10ab30a --- /dev/null +++ b/packages/core/src/localization/service/index.ts @@ -0,0 +1,2 @@ +export * from "./MessageReaderService"; +export * from "./TranslationService"; diff --git a/packages/core/src/reflection/index.ts b/packages/core/src/reflection/index.ts index 042db08ed..6261f8963 100644 --- a/packages/core/src/reflection/index.ts +++ b/packages/core/src/reflection/index.ts @@ -1,82 +1 @@ -import type API from "../../index"; -import { type FieldDecoratorCtx } from "./../decorators"; - -export * from "./models"; export * from "./service"; - -/** - * Retrieves the names of all fields in a class. - * - * @param constructor - The class constructor. - * @returns An array of field names. - */ -export function getClassFieldNames( - constructor: API.Utilities.Types.Class -): Array { - function getPropertyNames(classInstance: any): string[] { - return Object.getOwnPropertyNames(classInstance ?? {}).filter( - property => property !== "constructor" - ); - } - const instance: any = new constructor(); - const prototype = instance.__proto__; - const instanceProps = getPropertyNames(instance); - const prototypeProps = getPropertyNames(prototype); - const uniquePropsSet = new Set([...instanceProps, ...prototypeProps]); - const uniquePropsArray = [...uniquePropsSet]; - return uniquePropsArray as Array; -} - -/** - * Retrieves the property descriptor for a specific field in a class. - * - * @param constructor - The class constructor. - * @param name - The name of the field. - * @returns The property descriptor for the field. - */ -export function getClassFieldDescriptor( - constructor: API.Utilities.Types.Class, - name: keyof TClass -): PropertyDescriptor | undefined { - const instance: any = new constructor(); - const prototype = instance.__proto__; - return Object.getOwnPropertyDescriptor(prototype, name); -} - -/** - * Retrieves or initializes metadata for a given strategy. - * - * @param strategy - The strategy to get metadata for. - * @returns The metadata object. - */ -export function getMetadata(strategy: MetaStrategy): DecoratorMetadataObject { - if (isClass(strategy)) { - (Symbol as any).metadata ??= Symbol("Symbol.metadata"); - // @ts-ignore Don't delete - strategy[Symbol.metadata] ??= {}; - // @ts-ignore Don't delete - return strategy[Symbol.metadata]!; - } - if (strategy && !strategy.metadata) { - (strategy as any).metadata = {}; - } - return strategy?.metadata ?? {}; -} - -/** - * Checks if a given strategy is a class. - * - * @param strategy - The strategy to check. - * @returns True if the strategy is a class, false otherwise. - */ -export function isClass(strategy: MetaStrategy): strategy is API.Utilities.Types.Class { - return typeof strategy === "function"; -} - -/** - * Type alias for strategies that can either be a decorator context or a class. - */ -export type MetaStrategy = - | FieldDecoratorCtx - | API.Utilities.Types.Class - | DecoratorContext; diff --git a/packages/core/src/reflection/models/ControlDescriptor.ts b/packages/core/src/reflection/models/ControlDescriptor.ts deleted file mode 100644 index bf83895a1..000000000 --- a/packages/core/src/reflection/models/ControlDescriptor.ts +++ /dev/null @@ -1,158 +0,0 @@ -import API from "../../../index"; -import { type EventEmitter } from "../../utilities/misc/EventEmitter"; -import * as StrategyMapper from "./../../strategy/models/StrategyMapper"; -import { ValidationMetadata } from "./ValidationMetadata"; - -/** - * Describes the reflection rules for a specific field within a class. - * @typeParam FieldType - The type of the field. - */ -export type ControlDescriptorValidationMetadata = { - root: ValidationMetadata; - foreach: ValidationMetadata; -}; - -/** - * Properties for constructing a `ReflectionDescriptor`. - * @typeParam This - The type of the current class. - * @typeParam HostClass - The type of the host class. - * @typeParam Name - The name of the descriptor within the host class. - */ -export type ControlDescriptorType< - HostClass, - Name extends keyof HostClass | undefined = undefined -> = Name extends keyof HostClass ? HostClass[Name] : HostClass; - -/** - * Properties for constructing a `ReflectionDescriptor`. - * @typeParam This - The type of the current class. - * @typeParam HostClass - The type of the host class. - * @typeParam Name - The name of the descriptor within the host class. - */ -export type ControlDescriptorProps< - This, - HostClass, - Name extends keyof HostClass | undefined = undefined -> = { - hostClass?: API.Utilities.Types.Class; - hostDefault?: HostClass; - thisClass?: API.Utilities.Types.Class; - thisName?: Name; - thisDefault?: ControlDescriptorType; - validations?: ControlDescriptorValidationMetadata>; - eventEmitter: EventEmitter; -}; - -/** - * A class responsible for describing reflection metadata for a specific field within a class. - * @typeParam This - The type of the current class. - * @typeParam HostClass - The type of the host class. - * @typeParam Name - The name of the descriptor within the host class. - * @remarks This class is used to store metadata about a specific field, including its validation rules and default values. - */ -export class ControlDescriptor< - This, - HostClass, - Name extends keyof HostClass | undefined = undefined -> { - hostClass?: API.Utilities.Types.Class; - hostDefault?: HostClass; - thisClass?: API.Utilities.Types.Class; - thisName?: Name; - thisDefault?: ControlDescriptorType; - validations: ControlDescriptorValidationMetadata>; - eventEmitter: EventEmitter; - - constructor(props: ControlDescriptorProps) { - this.hostClass = props.hostClass; - this.thisName = props.thisName; - this.thisClass = props.thisClass; - this.hostDefault = props.hostDefault ?? props.hostClass ? new props.hostClass!() : undefined; - this.thisDefault = props.thisDefault; - this.eventEmitter = props.eventEmitter; - this.validations = props.validations ?? { - root: new ValidationMetadata(), - foreach: new ValidationMetadata(), - }; - } - - /** - * Gets the implementation of the reflection strategy. - * @throws {Error} If the strategy is not implemented. - */ - public get StrategyImpl(): API.Utilities.Types.Class { - const strategy = this.strategy; - if (!(strategy in StrategyMapper.data)) { - const error = `Validation strategy not implemented for field type '${strategy}'`; - throw new Error(error); - } - return StrategyMapper.data[strategy]; - } - - /** - * Determines the reflection strategy type for the descriptor. - * @returns The type of the reflection strategy. - * @remarks - * This method performs the following steps: - * 1. Checks if the host class is defined. - * 2. Checks if the field name is defined. - * 3. Determines the strategy based on the field type and its metadata. - */ - public get strategy(): StrategyMapper.Key { - if (!this.hostClass) { - return "unknown"; - } - if (!this.thisName) { - return API.Strategy.Object.Name; - } - const instance = new this.hostClass(); - const fieldName = this.thisName; - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - const getNativeStrategy = (value: any) => { - const meta = API.Reflection.FieldValidatorMetaService.inject( - this.hostClass!, - this.eventEmitter - ); - const descriptor = meta.getTypedDescriptor(this.thisName!); - - if ( - value instanceof Promise || - (value && - typeof value === "object" && - "key" in value && - typeof value.key === "string" && - "valid" in value && - typeof value.valid === "boolean" && - "message" in value && - typeof value.message === "string") - ) { - return API.Strategy.Function.Name; - } - - return Array.isArray(value) - ? descriptor.thisClass - ? API.Strategy.ObjectArray.Name - : API.Strategy.PrimitiveArray.Name - : descriptor.thisClass - ? API.Strategy.Object.Name - : API.Strategy.Primitive.Name; - }; - - const descriptor = API.Reflection.getClassFieldDescriptor(this.hostClass, fieldName); - const isGetter = descriptor?.get && !descriptor.set; - - if (isGetter) { - const value = descriptor.get!.call(instance); - return `get (): ${getNativeStrategy(value)}` as any; - } - - const value = instance[fieldName]; - - if (typeof value === "function") { - return getNativeStrategy(value.bind(this.hostDefault ?? new this.hostClass())()); - } - - return getNativeStrategy(value); - } -} diff --git a/packages/core/src/reflection/models/index.ts b/packages/core/src/reflection/models/index.ts deleted file mode 100644 index 8a6680c3a..000000000 --- a/packages/core/src/reflection/models/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./ControlDescriptor"; -export * from "./ValidationMetadata"; diff --git a/packages/core/src/reflection/service/AbstractMetaService.ts b/packages/core/src/reflection/service/AbstractMetaService.ts index 37735bea0..e7b54185d 100644 --- a/packages/core/src/reflection/service/AbstractMetaService.ts +++ b/packages/core/src/reflection/service/AbstractMetaService.ts @@ -1,5 +1,18 @@ -import API from "../../../index"; -import { type FieldDecoratorCtx } from "./../../decorators"; +import { Classes, Types } from "@utilities"; + +type FieldDecoratorCtx = Readonly<{ + kind: "getter" | "method" | "field"; + static: boolean; + private: boolean; + name: string; + metadata?: globalThis.DecoratorMetadataObject; + access: { + get: (object: any) => T; + }; +}>; + +/** Type alias for strategies that can either be a decorator context or a class. */ +export type MetaStrategy = FieldDecoratorCtx | Types.Class | DecoratorContext; /** * Abstract class for managing metadata. @@ -9,7 +22,7 @@ export abstract class AbstractMetaService { #metadata: DecoratorMetadataObject; #injectionKey: string; #initial: () => Entry; - #class?: API.Utilities.Types.Class; + #class?: Types.Class; protected context?: FieldDecoratorCtx; /** @@ -18,11 +31,11 @@ export abstract class AbstractMetaService { * @param strategy - The strategy for which metadata is managed. * @param initial - A function that returns the initial value for the metadata entry. */ - constructor(injectionKey: string, strategy: API.Reflection.MetaStrategy, initial: () => Entry) { - this.#metadata = API.Reflection.getMetadata(strategy); + constructor(injectionKey: string, strategy: MetaStrategy, initial: () => Entry) { + this.#metadata = Classes.getMetadata(strategy); this.#injectionKey = injectionKey; this.#initial = initial; - if (API.Reflection.isClass(strategy)) { + if (Classes.isClass(strategy)) { this.class = strategy; } else { this.context = strategy as any; @@ -32,14 +45,14 @@ export abstract class AbstractMetaService { /** * Gets the class associated with this AbstractMetaService. */ - get class(): API.Utilities.Types.Class { + get class(): Types.Class { return this.#class!; } /** * Sets the class associated with this AbstractMetaService. */ - set class(clazz: API.Utilities.Types.Class) { + set class(clazz: Types.Class) { this.#class = clazz; } diff --git a/packages/core/src/reflection/service/impl/ClassValidatorMetaService.ts b/packages/core/src/reflection/service/impl/ClassValidatorMetaService.ts index 1e14fef90..aa636025f 100644 --- a/packages/core/src/reflection/service/impl/ClassValidatorMetaService.ts +++ b/packages/core/src/reflection/service/impl/ClassValidatorMetaService.ts @@ -1,33 +1,38 @@ -import type API from "../../../../index"; -import { type EventEmitter } from "../../../utilities/misc/EventEmitter"; -import { ValidationMetadata } from "../../models/ValidationMetadata"; -import { AbstractMetaService } from "../AbstractMetaService"; +import { AbstractMetaService, MetaStrategy } from "@reflection/service/AbstractMetaService"; +import { EventEmitter, Types } from "@utilities"; +import { ValidationMetadata } from "@validation/models/ValidationMetadata"; +import type { ValidationEvaluator } from "@validation/types"; + +/** + * Unwraps a MetaStrategy type to its inferred class. + * @typeParam TStrategy - The MetaStrategy type to unwrap. + */ +export type UnwrapMetaStrategy = TStrategy extends Types.Class + ? TInferredClass + : any; /** * A configurer class which allows for easier manipulation of decorated class validators and corresponding metadata * @remarks This class is responsible for managing metadata related to validation (at class level). It provides methods to add validators and read them. */ -export class ClassValidatorMetaService< - TStrategy extends API.Reflection.MetaStrategy -> extends AbstractMetaService> { +export class ClassValidatorMetaService extends AbstractMetaService< + ValidationMetadata +> { /** * Static method to create a new instance of ClassValidatorMetaService. * @param strategy - The strategy to inject. * @returns A new instance of ClassValidatorMetaService. */ - public static inject( + public static inject( strategy: T, eventEmitter: EventEmitter - ): ClassValidatorMetaService> { - return new ClassValidatorMetaService>( - strategy, - eventEmitter - ); + ): ClassValidatorMetaService> { + return new ClassValidatorMetaService>(strategy, eventEmitter); } eventEmitter!: EventEmitter; - private constructor(strategy: API.Reflection.MetaStrategy, eventEmitter: EventEmitter) { + private constructor(strategy: MetaStrategy, eventEmitter: EventEmitter) { super(ClassValidatorMetaService.name, strategy, () => new ValidationMetadata()); this.eventEmitter = eventEmitter; } @@ -37,10 +42,7 @@ export class ClassValidatorMetaService< * @param isValid - The validation function. * @param groups - Optional validation groups. */ - addValidator( - isValid: API.Validation.ValidationEvaluator>, - groups: string[] - ): void { + addValidator(isValid: ValidationEvaluator>, groups: string[]): void { this.data.add({ validate: isValid, groups, diff --git a/packages/core/src/reflection/service/impl/FieldValidatorMetaService.ts b/packages/core/src/reflection/service/impl/FieldValidatorMetaService.ts index d108bf4c5..7d6b2dedb 100644 --- a/packages/core/src/reflection/service/impl/FieldValidatorMetaService.ts +++ b/packages/core/src/reflection/service/impl/FieldValidatorMetaService.ts @@ -1,37 +1,186 @@ -import API from "../../../../index"; -import { type EventEmitter } from "../../../utilities/misc/EventEmitter"; -import { AbstractMetaService } from "../AbstractMetaService"; -import { type FieldDecoratorCtx } from "./../../../decorators"; -import { ControlDescriptor } from "./../../models/ControlDescriptor"; +import { AbstractMetaService, MetaStrategy } from "@reflection/service/AbstractMetaService"; +import { type AbstractValidationStrategyService } from "@strategy"; +import { StrategyData } from "@strategy/models/StrategyMapper"; +import * as Strategies from "@strategy/service/impl"; +import { Classes, EventEmitter, Types } from "@utilities"; +import { ValidationMetadata } from "@validation/models/ValidationMetadata"; +import type { ValidationEvaluator } from "@validation/types"; + +/** + * Describes the reflection rules for a specific field within a class. + * @typeParam FieldType - The type of the field. + */ +export type ControlDescriptorValidationMetadata = { + root: ValidationMetadata; + foreach: ValidationMetadata; +}; + +/** + * Properties for constructing a `ReflectionDescriptor`. + * @typeParam This - The type of the current class. + * @typeParam HostClass - The type of the host class. + * @typeParam Name - The name of the descriptor within the host class. + */ +export type ControlDescriptorType< + HostClass, + Name extends keyof HostClass | undefined = undefined +> = Name extends keyof HostClass ? HostClass[Name] : HostClass; + +/** + * Properties for constructing a `ReflectionDescriptor`. + * @typeParam This - The type of the current class. + * @typeParam HostClass - The type of the host class. + * @typeParam Name - The name of the descriptor within the host class. + */ +export type ControlDescriptorProps = { + hostClass?: Types.Class; + hostDefault?: HostClass; + thisClass?: Types.Class; + thisName?: Name; + thisDefault?: ControlDescriptorType; + validations?: ControlDescriptorValidationMetadata>; + eventEmitter: EventEmitter; +}; + +/** + * A class responsible for describing reflection metadata for a specific field within a class. + * @typeParam This - The type of the current class. + * @typeParam HostClass - The type of the host class. + * @typeParam Name - The name of the descriptor within the host class. + * @remarks This class is used to store metadata about a specific field, including its validation rules and default values. + */ +export class ControlDescriptor { + hostClass?: Types.Class; + hostDefault?: HostClass; + thisClass?: Types.Class; + thisName?: Name; + thisDefault?: ControlDescriptorType; + validations: ControlDescriptorValidationMetadata>; + eventEmitter: EventEmitter; + + constructor(props: ControlDescriptorProps) { + this.hostClass = props.hostClass; + this.thisName = props.thisName; + this.thisClass = props.thisClass; + this.hostDefault = props.hostDefault ?? props.hostClass ? new props.hostClass!() : undefined; + this.thisDefault = props.thisDefault; + this.eventEmitter = props.eventEmitter; + this.validations = props.validations ?? { + root: new ValidationMetadata(), + foreach: new ValidationMetadata(), + }; + } + + /** + * Gets the implementation of the reflection strategy. + * @throws {Error} If the strategy is not implemented. + */ + public get StrategyImpl(): Types.Class { + const strategy = this.strategy; + if (!(strategy in StrategyData)) { + const error = `Validation strategy not implemented for field type '${strategy}'`; + throw new Error(error); + } + return StrategyData[strategy]; + } + + /** + * Determines the reflection strategy type for the descriptor. + * @returns The type of the reflection strategy. + * @remarks + * This method performs the following steps: + * 1. Checks if the host class is defined. + * 2. Checks if the field name is defined. + * 3. Determines the strategy based on the field type and its metadata. + */ + public get strategy(): string { + if (!this.hostClass) { + return "unknown"; + } + if (!this.thisName) { + return Strategies["ObjectStrategy"].Name; + } + const instance = new this.hostClass(); + const fieldName = this.thisName; + + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + const getNativeStrategy = (value: any) => { + const meta = FieldValidatorMetaService.inject(this.hostClass!, this.eventEmitter); + const descriptor = meta.getTypedDescriptor(this.thisName!); + + if ( + value instanceof Promise || + (value && + typeof value === "object" && + "key" in value && + typeof value.key === "string" && + "valid" in value && + typeof value.valid === "boolean" && + "message" in value && + typeof value.message === "string") + ) { + return Strategies["FunctionStrategy"].Name; + } + + return Array.isArray(value) + ? descriptor.thisClass + ? Strategies["ObjectArrayStrategy"].Name + : Strategies["PrimitiveArrayStrategy"].Name + : descriptor.thisClass + ? Strategies["ObjectStrategy"].Name + : Strategies["PrimitiveStrategy"].Name; + }; + + const descriptor = Classes.getClassFieldDescriptor(this.hostClass, fieldName); + const isGetter = descriptor?.get && !descriptor.set; + + if (isGetter) { + const value = descriptor.get!.call(instance); + return `get (): ${getNativeStrategy(value)}` as any; + } + + const value = instance[fieldName]; + + if (typeof value === "function") { + return getNativeStrategy(value.bind(this.hostDefault ?? new this.hostClass())()); + } + + return getNativeStrategy(value); + } +} + +type FieldDecoratorCtx = Readonly<{ + kind: "getter" | "method" | "field"; + static: boolean; + private: boolean; + name: string; + metadata?: globalThis.DecoratorMetadataObject; + access: { + get: (object: any) => T; + }; +}>; /** * A configurer class which allows for easier manipulation of decorated fields and corresponding metadata * @remarks This class is responsible for managing metadata related to validation. It provides methods to add validators, get field names, and manage descriptors. */ -export class FieldValidatorMetaService extends AbstractMetaService< - Map> -> { +export class FieldValidatorMetaService extends AbstractMetaService>> { /** * Static method to create a new instance of FieldValidatorMetaService. * @param strategy - The strategy to inject. * @returns A new instance of FieldValidatorMetaService. */ - public static inject( - strategy: API.Reflection.MetaStrategy, - eventEmitter: EventEmitter - ): FieldValidatorMetaService { + public static inject(strategy: MetaStrategy, eventEmitter: EventEmitter): FieldValidatorMetaService { return new FieldValidatorMetaService(strategy, eventEmitter); } eventEmitter!: EventEmitter; #fields!: string[]; - private constructor(strategy: API.Reflection.MetaStrategy, eventEmitter: EventEmitter) { + private constructor(strategy: MetaStrategy, eventEmitter: EventEmitter) { super(FieldValidatorMetaService.name, strategy, () => new Map()); this.eventEmitter = eventEmitter; - API.Reflection.isClass(strategy) - ? this.#handleClassInit(strategy) - : this.#handleContextInit(strategy as any); + Classes.isClass(strategy) ? this.#handleClassInit(strategy) : this.#handleContextInit(strategy as any); } /** @@ -41,11 +190,7 @@ export class FieldValidatorMetaService extends AbstractMetaService< * @param isValid - The validation function. * @param groups - Optional validation groups. */ - addValidator( - field: string, - isValid: API.Validation.ValidationEvaluator, - groups: string[] - ): void { + addValidator(field: string, isValid: ValidationEvaluator, groups: string[]): void { this.getUntypedDescriptor(field).validations.root.add({ validate: isValid, groups, @@ -78,14 +223,8 @@ export class FieldValidatorMetaService extends AbstractMetaService< * @param thisName - The name of the field. * @returns The typed descriptor. */ - getTypedDescriptor( - thisName: TName - ): ControlDescriptor { - return this.getUntypedDescriptor(thisName as string) as ControlDescriptor< - unknown, - TClass, - TName - >; + getTypedDescriptor(thisName: TName): ControlDescriptor { + return this.getUntypedDescriptor(thisName as string) as ControlDescriptor; } /** @@ -94,14 +233,11 @@ export class FieldValidatorMetaService extends AbstractMetaService< * @param fieldKey - The key of the field. * @returns The untyped descriptor. */ - getUntypedDescriptor( - fieldKey: any, - eventEmitter?: EventEmitter - ): ControlDescriptor { + getUntypedDescriptor(fieldKey: any, eventEmitter?: EventEmitter): ControlDescriptor { this.eventEmitter = eventEmitter ?? this.eventEmitter; if (!this.hasDescriptor(fieldKey)) { const cfg = { thisName: fieldKey, eventEmitter: this.eventEmitter }; - const fieldValue = new ControlDescriptor(cfg); + const fieldValue = new ControlDescriptor(cfg); this.data.set(fieldKey, fieldValue); } const descriptor = this.data.get(fieldKey); @@ -119,8 +255,8 @@ export class FieldValidatorMetaService extends AbstractMetaService< * This method populates the `#fields` array with the names of the class fields. * It also ensures that untyped descriptors are created for each field. */ - #handleClassInit(clazz: API.Utilities.Types.Class): void { - this.#fields = API.Reflection.getClassFieldNames(clazz) as string[]; + #handleClassInit(clazz: Types.Class): void { + this.#fields = Classes.getClassFieldNames(clazz) as string[]; this.#fields.forEach(name => this.getUntypedDescriptor(name)); } diff --git a/packages/core/src/reflection/service/impl/index.ts b/packages/core/src/reflection/service/impl/index.ts new file mode 100644 index 000000000..98ba7a0cd --- /dev/null +++ b/packages/core/src/reflection/service/impl/index.ts @@ -0,0 +1,2 @@ +export * from "./ClassValidatorMetaService"; +export * from "./FieldValidatorMetaService"; diff --git a/packages/core/src/reflection/service/index.ts b/packages/core/src/reflection/service/index.ts index 090e07a0b..94677f17c 100644 --- a/packages/core/src/reflection/service/index.ts +++ b/packages/core/src/reflection/service/index.ts @@ -1,3 +1,2 @@ export * from "./AbstractMetaService"; -export * from "./impl/ClassValidatorMetaService"; -export * from "./impl/FieldValidatorMetaService"; +export * from "./impl"; diff --git a/packages/core/src/strategy/models/StrategyFactory.ts b/packages/core/src/strategy/models/StrategyFactory.ts index 15e33788a..ac8bf6a4f 100644 --- a/packages/core/src/strategy/models/StrategyFactory.ts +++ b/packages/core/src/strategy/models/StrategyFactory.ts @@ -1,24 +1,25 @@ -import type API from "../../../index"; -import { type FunctionStrat } from "../service/impl/FunctionStrategy"; -import { type ObjectArrayGetterStrat } from "../service/impl/ObjectArrayGetterStrategy"; -import { type ObjectArrayStrat } from "../service/impl/ObjectArrayStrategy"; -import { type ObjectGetterStrat } from "../service/impl/ObjectGetterStrategy"; -import { type ObjectStrat } from "../service/impl/ObjectStrategy"; -import { type PrimitiveArrayGetterStrat } from "../service/impl/PrimitiveArrayGetterStrategy"; -import { type PrimitiveArrayStrat } from "../service/impl/PrimitiveArrayStrategy"; -import { type PrimitiveGetterStrat } from "../service/impl/PrimitiveGetterStrategy"; -import { type PrimitiveStrat } from "../service/impl/PrimitiveStrategy"; -import type * as StrategyTypes from "./StrategyTypes"; +import { + FunctionStrategy, + ObjectArrayGetterStrategy, + ObjectArrayStrategy, + ObjectGetterStrategy, + ObjectStrategy, + PrimitiveArrayGetterStrategy, + PrimitiveArrayStrategy, + PrimitiveGetterStrategy, + PrimitiveStrategy, +} from "@strategy/service/impl"; +import { Booleans, Objects, Types } from "@utilities"; +import type { ValidationResult } from "@validation/types"; /** * Evaluates a type, returning either an optional or mandatory evaluation based on the second type parameter. * @typeParam T - The type to evaluate. * @typeParam R - The result type. Determines if the evaluation is optional or mandatory. */ -// prettier-ignore -export type evaluate = true extends API.Utilities.Booleans.isUndefined - ? API.Utilities.Types.Prettify>> - : API.Utilities.Types.Prettify>>; +export type evaluate = true extends Booleans.isUndefined + ? Types.Prettify>> + : Types.Prettify>>; /** * Type for optional evaluation of each field in a type. @@ -46,32 +47,32 @@ export type evaluateMandatory = { */ // prettier-ignore export type fieldEvaluation = - true extends StrategyTypes.Function.matches - ? StrategyTypes.Function.handler + true extends FunctionStrategy.matches + ? FunctionStrategy.handler - : true extends StrategyTypes.PrimitiveArray.matches - ? StrategyTypes.PrimitiveArray.handler + : true extends PrimitiveArrayStrategy.matches + ? PrimitiveArrayStrategy.handler - : true extends StrategyTypes.PrimitiveGetter.matches - ? StrategyTypes.PrimitiveGetter.handler + : true extends PrimitiveGetterStrategy.matches + ? PrimitiveGetterStrategy.handler - : true extends StrategyTypes.PrimitiveArrayGetter.matches - ? StrategyTypes.PrimitiveArrayGetter.handler + : true extends PrimitiveArrayGetterStrategy.matches + ? PrimitiveArrayGetterStrategy.handler - : true extends StrategyTypes.Primitive.matches - ? StrategyTypes.Primitive.handler + : true extends PrimitiveStrategy.matches + ? PrimitiveStrategy.handler - : true extends StrategyTypes.ObjectArray.matches - ? StrategyTypes.ObjectArray.handler + : true extends ObjectArrayStrategy.matches + ? ObjectArrayStrategy.handler - : true extends StrategyTypes.ObjectArrayGetter.matches - ? StrategyTypes.ObjectArrayGetter.handler + : true extends ObjectArrayGetterStrategy.matches + ? ObjectArrayGetterStrategy.handler - : true extends StrategyTypes.ObjectGetter.matches - ? StrategyTypes.ObjectGetter.handler + : true extends ObjectGetterStrategy.matches + ? ObjectGetterStrategy.handler - : true extends StrategyTypes.Object.matches - ? StrategyTypes.Object.handler + : true extends ObjectStrategy.matches + ? ObjectStrategy.handler : never; /** @@ -88,47 +89,42 @@ export type getStrategyResult = ReturnType = - true extends StrategyTypes.Function.matches - ? FunctionStrat + true extends FunctionStrategy.matches + ? FunctionStrategy.StrategyResolver - : true extends StrategyTypes.PrimitiveArray.matches - ? PrimitiveArrayStrat + : true extends PrimitiveArrayStrategy.matches + ? PrimitiveArrayStrategy.StrategyResolver - : true extends StrategyTypes.PrimitiveGetter.matches - ? PrimitiveGetterStrat + : true extends PrimitiveGetterStrategy.matches + ? PrimitiveGetterStrategy.StrategyResolver - : true extends StrategyTypes.PrimitiveArrayGetter.matches - ? PrimitiveArrayGetterStrat + : true extends PrimitiveArrayGetterStrategy.matches + ? PrimitiveArrayGetterStrategy.StrategyResolver - : true extends StrategyTypes.Primitive.matches - ? PrimitiveStrat + : true extends PrimitiveStrategy.matches + ? PrimitiveStrategy.StrategyResolver - : true extends StrategyTypes.ObjectArray.matches - ? ObjectArrayStrat + : true extends ObjectArrayStrategy.matches + ? ObjectArrayStrategy.StrategyResolver - : true extends StrategyTypes.ObjectArrayGetter.matches - ? ObjectArrayGetterStrat + : true extends ObjectArrayGetterStrategy.matches + ? ObjectArrayGetterStrategy.StrategyResolver - : true extends StrategyTypes.ObjectGetter.matches - ? ObjectGetterStrat + : true extends ObjectGetterStrategy.matches + ? ObjectGetterStrategy.StrategyResolver - : true extends StrategyTypes.Object.matches - ? ObjectStrat + : true extends ObjectStrategy.matches + ? ObjectStrategy.StrategyResolver : never; /** - * Namespace for Strategy Factory Implementations. + * Type for detailed errors during validation. + * @typeParam T - The type being validated. + */ +export type DetailedErrorsResponse = evaluate; + +/** + * Type for basic errors during validation. + * @typeParam T - The type being validated. */ -export namespace Impl { - /** - * Type for detailed errors during validation. - * @typeParam T - The type being validated. - */ - export type DetailedErrors = evaluate; - - /** - * Type for basic errors during validation. - * @typeParam T - The type being validated. - */ - export type Errors = evaluate; -} +export type SimpleErrorsResponse = evaluate; diff --git a/packages/core/src/strategy/models/StrategyMapper.ts b/packages/core/src/strategy/models/StrategyMapper.ts index 151c6a0b5..4f897fa5a 100644 --- a/packages/core/src/strategy/models/StrategyMapper.ts +++ b/packages/core/src/strategy/models/StrategyMapper.ts @@ -1,51 +1,20 @@ -import type * as Types from "../../utilities/impl/Types"; -import { type AbstractValidationStrategyService } from "../service/AbstractValidationStrategyService"; -import { FunctionStrat } from "../service/impl/FunctionStrategy"; -import { ObjectArrayGetterStrat } from "../service/impl/ObjectArrayGetterStrategy"; -import { ObjectArrayStrat } from "../service/impl/ObjectArrayStrategy"; -import { ObjectGetterStrat } from "../service/impl/ObjectGetterStrategy"; -import { ObjectStrat } from "../service/impl/ObjectStrategy"; -import { PrimitiveArrayGetterStrat } from "../service/impl/PrimitiveArrayGetterStrategy"; -import { PrimitiveArrayStrat } from "../service/impl/PrimitiveArrayStrategy"; -import { PrimitiveGetterStrat } from "../service/impl/PrimitiveGetterStrategy"; -import { PrimitiveStrat } from "../service/impl/PrimitiveStrategy"; -import * as StrategyTypes from "./StrategyTypes"; - -/** - * The type of a reflection strategy. - * - * @remarks - * This type is derived from the keys of the `ReflectionStrategy` object. - */ -export type Key = - | "unknown" - | typeof StrategyTypes.Primitive.Name - | typeof StrategyTypes.Object.Name - | typeof StrategyTypes.PrimitiveArray.Name - | typeof StrategyTypes.ObjectArray.Name - | typeof StrategyTypes.PrimitiveGetter.Name - | typeof StrategyTypes.ObjectGetter.Name - | typeof StrategyTypes.PrimitiveArrayGetter.Name - | typeof StrategyTypes.ObjectArrayGetter.Name - | typeof StrategyTypes.Function.Name; +import { AbstractValidationStrategyService } from "@strategy/service/AbstractValidationStrategyService"; +import * as Strategies from "@strategy/service/impl"; +import { Types } from "@utilities"; /** * A mapping of reflection strategy types to their corresponding `ValidationStrategy` classes. - * - * @remarks - * This object provides a way to look up the `ValidationStrategy` class that should be used for a given - * reflection strategy type. + * @remarks This object provides a way to look up the `ValidationStrategy` class that should be used for a given reflection strategy type. */ -// prettier-ignore -export const data: Record> = { - unknown: (() => {}) as any, - [StrategyTypes.Primitive.Name]: PrimitiveStrat, - [StrategyTypes.Object.Name]: ObjectStrat, - [StrategyTypes.PrimitiveArray.Name]: PrimitiveArrayStrat, - [StrategyTypes.ObjectArray.Name]: ObjectArrayStrat, - [StrategyTypes.PrimitiveGetter.Name]: PrimitiveGetterStrat, - [StrategyTypes.ObjectGetter.Name]: ObjectGetterStrat, - [StrategyTypes.PrimitiveArrayGetter.Name]: PrimitiveArrayGetterStrat, - [StrategyTypes.ObjectArrayGetter.Name]: ObjectArrayGetterStrat, - [StrategyTypes.Function.Name]: FunctionStrat - }; +export const StrategyData: Record> = { + unknown: (() => {}) as any, + [Strategies["PrimitiveStrategy"].Name]: Strategies.PrimitiveStrategy.StrategyResolver, + [Strategies["ObjectStrategy"].Name]: Strategies.ObjectStrategy.StrategyResolver, + [Strategies["PrimitiveArrayStrategy"].Name]: Strategies.PrimitiveArrayStrategy.StrategyResolver, + [Strategies["ObjectArrayStrategy"].Name]: Strategies.ObjectArrayStrategy.StrategyResolver, + [Strategies["PrimitiveGetterStrategy"].Name]: Strategies.PrimitiveGetterStrategy.StrategyResolver, + [Strategies["ObjectGetterStrategy"].Name]: Strategies.ObjectGetterStrategy.StrategyResolver, + [Strategies["PrimitiveArrayGetterStrategy"].Name]: Strategies.PrimitiveArrayGetterStrategy.StrategyResolver, + [Strategies["ObjectArrayGetterStrategy"].Name]: Strategies.ObjectArrayGetterStrategy.StrategyResolver, + [Strategies["FunctionStrategy"].Name]: Strategies.FunctionStrategy.StrategyResolver, +}; diff --git a/packages/core/src/strategy/models/StrategyTypes.ts b/packages/core/src/strategy/models/StrategyTypes.ts deleted file mode 100644 index b946489c7..000000000 --- a/packages/core/src/strategy/models/StrategyTypes.ts +++ /dev/null @@ -1,19 +0,0 @@ -import FunctionStrategyType from "../service/impl/FunctionStrategy/types"; -import ObjectArrayGetterStrategyType from "../service/impl/ObjectArrayGetterStrategy/types"; -import ObjectArrayStrategyType from "../service/impl/ObjectArrayStrategy/types"; -import ObjectGetterStrategyType from "../service/impl/ObjectGetterStrategy/types"; -import ObjectStrategyType from "../service/impl/ObjectStrategy/types"; -import PrimitiveArrayGetterStrategyType from "../service/impl/PrimitiveArrayGetterStrategy/types"; -import PrimitiveArrayStrategyType from "../service/impl/PrimitiveArrayStrategy/types"; -import PrimitiveGetterStrategyType from "../service/impl/PrimitiveGetterStrategy/types"; -import PrimitiveStrategyType from "../service/impl/PrimitiveStrategy/types"; - -export import ObjectArray = ObjectArrayStrategyType; -export import Object = ObjectStrategyType; -export import ObjectGetter = ObjectGetterStrategyType; -export import PrimitiveArray = PrimitiveArrayStrategyType; -export import Primitive = PrimitiveStrategyType; -export import PrimitiveGetter = PrimitiveGetterStrategyType; -export import Function = FunctionStrategyType; -export import ObjectArrayGetter = ObjectArrayGetterStrategyType; -export import PrimitiveArrayGetter = PrimitiveArrayGetterStrategyType; diff --git a/packages/core/src/strategy/models/index.ts b/packages/core/src/strategy/models/index.ts index 745c5fcda..c834a4e8d 100644 --- a/packages/core/src/strategy/models/index.ts +++ b/packages/core/src/strategy/models/index.ts @@ -1,3 +1,2 @@ export * from "./StrategyFactory"; export * from "./StrategyMapper"; -export * from "./StrategyTypes"; diff --git a/packages/core/src/strategy/package.json b/packages/core/src/strategy/package.json deleted file mode 100644 index c358b318e..000000000 --- a/packages/core/src/strategy/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "author": "Bruno Tot", - "name": "tdv-strategy", - "private": true, - "version": "1.0.0", - "main": "dist/strategy/index.js", - "types": "dist/types/strategy/index.d.ts" -} diff --git a/packages/core/src/strategy/service/AbstractValidationStrategyService.ts b/packages/core/src/strategy/service/AbstractValidationStrategyService.ts index ea84c7d88..65cebe89d 100644 --- a/packages/core/src/strategy/service/AbstractValidationStrategyService.ts +++ b/packages/core/src/strategy/service/AbstractValidationStrategyService.ts @@ -1,8 +1,11 @@ -import API from "../../index"; -import { type ControlDescriptor } from "../../reflection/models/ControlDescriptor"; -import { type ValidationMetadata } from "../../reflection/models/ValidationMetadata"; -import { type EventEmitter } from "../../utilities/misc/EventEmitter"; -import { Form } from "../../validation/models/Form"; +import { DecoratorArgs } from "@decorators"; +import { Locale } from "@localization"; +import { ClassValidatorMetaService } from "@reflection/service/impl/ClassValidatorMetaService"; +import { ControlDescriptor, FieldValidatorMetaService } from "@reflection/service/impl/FieldValidatorMetaService"; +import { EventEmitter } from "@utilities"; +import { Form } from "@validation/models/Form"; +import { ValidationMetadata } from "@validation/models/ValidationMetadata"; +import type { FormConfig, ValidationResult } from "@validation/types"; /** * The `AbstractValidationStrategyService` class serves as an abstract base class for implementing various validation strategies. It provides essential utility methods and properties to facilitate the validation process. @@ -11,14 +14,10 @@ import { Form } from "../../validation/models/Form"; * @typeParam TDetailedResult The detailed result of the validation. * @typeParam TSimpleResult A simplified version of the validation result. */ -export abstract class AbstractValidationStrategyService< - TClass = any, - TDetailedResult = any, - TSimpleResult = any -> { - #locale: API.Localization.Locale; +export abstract class AbstractValidationStrategyService { + #locale: Locale; #groups: string[]; - #engineCfg: API.Validation.FormConfig; + #engineCfg: FormConfig; #classRules: ValidationMetadata; #descriptor: ControlDescriptor; #defaultParent: TClass; @@ -35,7 +34,7 @@ export abstract class AbstractValidationStrategyService< descriptor: ControlDescriptor, defaultValue: TClass, groups: string[], - locale: API.Localization.Locale, + locale: Locale, eventEmitter: EventEmitter, asyncDelay: number ) { @@ -49,8 +48,7 @@ export abstract class AbstractValidationStrategyService< groups: this.groups, asyncDelay, }; - const host = descriptor.hostClass!; - this.#classRules = API.Reflection.ClassValidatorMetaService.inject(host, eventEmitter).data; + this.#classRules = ClassValidatorMetaService.inject(this.#descriptor.hostClass!, this.eventEmitter).data; } public set eventEmitter(v: EventEmitter) { @@ -65,7 +63,7 @@ export abstract class AbstractValidationStrategyService< return new Form(this.#descriptor.thisClass!, this.engineCfg); } - protected get engineCfg(): API.Validation.FormConfig { + protected get engineCfg(): FormConfig { return this.#engineCfg; } @@ -77,7 +75,7 @@ export abstract class AbstractValidationStrategyService< return this.#groups; } - protected get locale(): API.Localization.Locale { + protected get locale(): Locale { return this.#locale; } @@ -90,7 +88,7 @@ export abstract class AbstractValidationStrategyService< */ protected get fieldDescriptor(): ControlDescriptor { if (this.#fieldDescriptor) return this.#fieldDescriptor; - this.#fieldDescriptor = API.Reflection.FieldValidatorMetaService.inject( + this.#fieldDescriptor = FieldValidatorMetaService.inject( this.#descriptor.hostClass!, this.#eventEmitter ).getUntypedDescriptor(this.fieldName, this.eventEmitter); @@ -115,20 +113,16 @@ export abstract class AbstractValidationStrategyService< return (this.#defaultParent as any)?.[this.fieldName]; } - protected getErrorMessages(validations: API.Validation.ValidationResult[] = []): string[] { + protected getErrorMessages(validations: ValidationResult[] = []): string[] { const nonNullableValidations = validations ?? []; return Array.isArray(nonNullableValidations) ? nonNullableValidations.map(e => e.message) : []; } - protected getClassErrors(fieldValue: any, parentValue: any): API.Validation.ValidationResult[] { + protected getClassErrors(fieldValue: any, parentValue: any): ValidationResult[] { return this.classRules.validate(fieldValue, parentValue, this.groups, this.locale); } - protected getRootErrors( - fieldValue: any, - parentValue: any, - args: API.Decorator.DecoratorArgs - ): API.Validation.ValidationResult[] { + protected getRootErrors(fieldValue: any, parentValue: any, args: DecoratorArgs): ValidationResult[] { return this.fieldDescriptor.validations.root.validate( fieldValue, parentValue, @@ -140,16 +134,8 @@ export abstract class AbstractValidationStrategyService< ); } - protected getArrayItemErrors( - arrayItem: any, - parentValue: any - ): API.Validation.ValidationResult[] { - return this.fieldDescriptor.validations.foreach.validate( - arrayItem, - parentValue, - this.groups, - this.locale - ); + protected getArrayItemErrors(arrayItem: any, parentValue: any): ValidationResult[] { + return this.fieldDescriptor.validations.foreach.validate(arrayItem, parentValue, this.groups, this.locale); } /** @@ -165,9 +151,5 @@ export abstract class AbstractValidationStrategyService< * It returns a tuple where the first element is the detailed validation result and the second element is * the simplified validation result. */ - abstract test( - value: any, - context: any, - args: API.Decorator.DecoratorArgs - ): [TDetailedResult, TSimpleResult]; + abstract test(value: any, context: any, args: DecoratorArgs): [TDetailedResult, TSimpleResult]; } diff --git a/packages/core/src/strategy/service/impl/FunctionStrategy.ts b/packages/core/src/strategy/service/impl/FunctionStrategy.ts new file mode 100644 index 000000000..066b9fb3e --- /dev/null +++ b/packages/core/src/strategy/service/impl/FunctionStrategy.ts @@ -0,0 +1,80 @@ +import { Arrays, Booleans, Types } from "@utilities"; +import { Events } from "@validation/models/Events"; +import type { ValidationResult } from "@validation/types"; +import { AbstractValidationStrategyService } from "../AbstractValidationStrategyService"; + +export namespace FunctionStrategy { + /** + * Constant name identifier for this strategy. + */ + export const Name = "function" as const; + + /** + * Type definition for simple errors in this strategy. + */ + export type SimpleErrors = string | null; + + /** + * Type definition for detailed errors in this strategy. + */ + export type DetailedErrors = ValidationResult | null; + + /** + * Type guard to check if a certain field in a type matches this strategy. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + */ + // prettier-ignore + export type matches = Booleans.isFunction + + /** + * Type for the handler function based on the field and result types. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + * @typeParam R - The result type. + */ + // prettier-ignore + export type handler = + true extends Booleans.isUndefined + ? T[K] + : Arrays.getArrayType | null; + + /** + * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating primitive types like numbers, strings, etc. + * + * @typeParam F - The type of the field being validated. + * + * @extends AbstractValidationStrategyService + */ + export class StrategyResolver extends AbstractValidationStrategyService { + private static readonly EMPTY: [DetailedErrors, SimpleErrors] = [null, null]; + + /** + * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for primitive types by invoking the root rule's `validate` method and then building simplified error messages. + * + * @param value - The value to be validated. + * @param context - The context in which the validation is taking place. + * + * @returns A tuple containing an array of detailed validation results (`ValidationResult[]`) and an array of simplified error messages (`string[]`). + */ + test(value: Types.FunctionType, _context: any): [DetailedErrors, SimpleErrors] { + const result: ValidationResult | Promise = value.bind(_context)(); + if (result instanceof Promise) { + result.then( + validationResult => { + this.eventEmitter.emit(Events.ASYNC_VALIDATION_COMPLETE, { + key: this.fieldName, + value: validationResult, + }); + }, + reason => { + throw new Error(reason); + } + ); + return StrategyResolver.EMPTY; + } + + return result.valid ? StrategyResolver.EMPTY : [result, result.message]; + } + } +} diff --git a/packages/core/src/strategy/service/impl/FunctionStrategy/index.ts b/packages/core/src/strategy/service/impl/FunctionStrategy/index.ts deleted file mode 100644 index b3a648f7e..000000000 --- a/packages/core/src/strategy/service/impl/FunctionStrategy/index.ts +++ /dev/null @@ -1,51 +0,0 @@ -import type API from "../../../../../index"; -import { Events } from "../../../../validation/models/Events"; -import { AbstractValidationStrategyService } from "../../../service/AbstractValidationStrategyService"; -import type ns from "./types"; - -/** - * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating primitive types like numbers, strings, etc. - * - * @typeParam F - The type of the field being validated. - * - * @extends AbstractValidationStrategyService - */ -export class FunctionStrat extends AbstractValidationStrategyService< - F, - ns.DetailedErrors, - ns.SimpleErrors -> { - private static readonly EMPTY: [ns.DetailedErrors, ns.SimpleErrors] = [null, null]; - - /** - * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for primitive types by invoking the root rule's `validate` method and then building simplified error messages. - * - * @param value - The value to be validated. - * @param context - The context in which the validation is taking place. - * - * @returns A tuple containing an array of detailed validation results (`ValidationResult[]`) and an array of simplified error messages (`string[]`). - */ - test( - value: API.Utilities.Types.FunctionType, - _context: any - ): [ns.DetailedErrors, ns.SimpleErrors] { - const result: API.Validation.ValidationResult | Promise = - value.bind(_context)(); - if (result instanceof Promise) { - result.then( - validationResult => { - this.eventEmitter.emit(Events.ASYNC_VALIDATION_COMPLETE, { - key: this.fieldName, - value: validationResult, - }); - }, - reason => { - throw new Error(reason); - } - ); - return FunctionStrat.EMPTY; - } - - return result.valid ? FunctionStrat.EMPTY : [result, result.message]; - } -} diff --git a/packages/core/src/strategy/service/impl/FunctionStrategy/types.ts b/packages/core/src/strategy/service/impl/FunctionStrategy/types.ts deleted file mode 100644 index 00364c4eb..000000000 --- a/packages/core/src/strategy/service/impl/FunctionStrategy/types.ts +++ /dev/null @@ -1,43 +0,0 @@ -import type API from "../../../../../index"; - -/** - * Namespace for Function Strategy Types. - */ -namespace FunctionStrategyType { - /** - * Constant name identifier for this strategy. - */ - export const Name = "function" as const; - - /** - * Type definition for simple errors in this strategy. - */ - export type SimpleErrors = string | null; - - /** - * Type definition for detailed errors in this strategy. - */ - export type DetailedErrors = API.Validation.ValidationResult | null; - - /** - * Type guard to check if a certain field in a type matches this strategy. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - */ - // prettier-ignore - export type matches = API.Utilities.Booleans.isFunction - - /** - * Type for the handler function based on the field and result types. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - * @typeParam R - The result type. - */ - // prettier-ignore - export type handler = - true extends API.Utilities.Booleans.isUndefined - ? T[K] - : API.Utilities.Arrays.getArrayType | null; -} - -export default FunctionStrategyType; diff --git a/packages/core/src/strategy/service/impl/ObjectArrayGetterStrategy.ts b/packages/core/src/strategy/service/impl/ObjectArrayGetterStrategy.ts new file mode 100644 index 000000000..8e594e4fe --- /dev/null +++ b/packages/core/src/strategy/service/impl/ObjectArrayGetterStrategy.ts @@ -0,0 +1,121 @@ +import { DecoratorArgs } from "@decorators"; +import { DetailedErrorsResponse, SimpleErrorsResponse } from "@strategy/models/StrategyFactory"; +import { Arrays, Booleans } from "@utilities"; +import type { ValidationResult } from "@validation/types"; +import { AbstractValidationStrategyService } from "../AbstractValidationStrategyService"; +import { ObjectStrategy } from "./ObjectStrategy"; + +export namespace ObjectArrayGetterStrategy { + /** + * Constant name identifier for this strategy. + */ + export const Name = `() => ${ObjectStrategy.Name}[]` as const; + + /** + * Represents the simplified error structure for validating arrays of object types. + * + * @typeParam F - The type of the field being validated. + * + * - `field`: An array of string messages that represent validation errors at the array level. + * - `data`: An array of `Errors` objects that represent validation errors for each object in the array. + */ + export type SimpleErrors = { + root: string[]; + data: Array>; + }; + + /** + * Represents the detailed error structure for validating arrays of object types. + * + * @typeParam F - The type of the field being validated. + * + * - `field`: An array of `ValidationResult` objects that represent detailed validation errors at the array level. + * - `data`: An array of `DetailedErrors` objects that represent detailed validation errors for each object in the array. + */ + export type DetailedErrors = { + root: ValidationResult[]; + data: Array>; + }; + + /** + * Type guard to check if a certain field in a type matches this strategy. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + */ + // prettier-ignore + export type matches = + true extends Booleans.isGetter + ? Arrays.getArrayType> extends never + ? false + : Booleans.isObject>> + : false; + + /** + * Type for the handler function based on the field and result types. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + * @typeParam R - The result type. + */ + // prettier-ignore + export type handler = Array> + + /** + * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating arrays of object types. + * + * @typeParam F - The type of the field being validated, which is expected to be an array of objects. + * + * @extends AbstractValidationStrategyService, ObjectArrayGetterSimpleErrors> + */ + export class StrategyResolver extends AbstractValidationStrategyService, SimpleErrors> { + /** + * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for arrays of object types. + * + * @param value - The array of object values to be validated. + * @param context - The context in which the validation is taking place. + * @param groups - Optional validation groups to consider during validation. + * + * @returns A tuple containing `ObjectArrayGetterDetailedErrors` and `ObjectArrayGetterSimpleErrors`. + * + * @remarks + * The method validates both the array as a whole (`field`) and each individual object (`data`) + * using the appropriate validation rules. + */ + test(value: any[], context: any, args: DecoratorArgs): [DetailedErrors, SimpleErrors] { + const _value = value ?? []; + const rootResult = this.getRootErrors(value, context, args); + + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + const getData = (element: any) => { + const [errors, detailedErrors] = new ObjectStrategy.StrategyResolver( + this.fieldDescriptor, + this.defaultValue, + this.groups, + this.locale, + this.eventEmitter, + this.engineCfg.asyncDelay! + ).test(element, context, args); + return { + detailedErrors, + errors, + }; + }; + + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + const getErrors = (element: any) => getData(element).errors; + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + const getDetailedErrors = (element: any) => getData(element).detailedErrors; + + const details = { + root: rootResult, + data: _value.map(getDetailedErrors), + }; + + const simple = { + root: this.getErrorMessages(rootResult), + data: _value.map(getErrors), + }; + + return [details as any, simple as any]; + } + } +} diff --git a/packages/core/src/strategy/service/impl/ObjectArrayGetterStrategy/index.ts b/packages/core/src/strategy/service/impl/ObjectArrayGetterStrategy/index.ts deleted file mode 100644 index a07a6eb24..000000000 --- a/packages/core/src/strategy/service/impl/ObjectArrayGetterStrategy/index.ts +++ /dev/null @@ -1,72 +0,0 @@ -import type API from "../../../../index"; -import { AbstractValidationStrategyService } from "../../../service/AbstractValidationStrategyService"; -import { ObjectStrat } from "../ObjectStrategy"; -import type ns from "./types"; - -/** - * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating arrays of object types. - * - * @typeParam F - The type of the field being validated, which is expected to be an array of objects. - * - * @extends AbstractValidationStrategyService, ObjectArrayGetterSimpleErrors> - */ -export class ObjectArrayGetterStrat extends AbstractValidationStrategyService< - F, - ns.DetailedErrors, - ns.SimpleErrors -> { - /** - * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for arrays of object types. - * - * @param value - The array of object values to be validated. - * @param context - The context in which the validation is taking place. - * @param groups - Optional validation groups to consider during validation. - * - * @returns A tuple containing `ObjectArrayGetterDetailedErrors` and `ObjectArrayGetterSimpleErrors`. - * - * @remarks - * The method validates both the array as a whole (`field`) and each individual object (`data`) - * using the appropriate validation rules. - */ - test( - value: any[], - context: any, - args: API.Decorator.DecoratorArgs - ): [ns.DetailedErrors, ns.SimpleErrors] { - const _value = value ?? []; - const rootResult = this.getRootErrors(value, context, args); - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - const getData = (element: any) => { - const [errors, detailedErrors] = new ObjectStrat( - this.fieldDescriptor, - this.defaultValue, - this.groups, - this.locale, - this.eventEmitter, - this.engineCfg.asyncDelay! - ).test(element, context, args); - return { - detailedErrors, - errors, - }; - }; - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - const getErrors = (element: any) => getData(element).errors; - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - const getDetailedErrors = (element: any) => getData(element).detailedErrors; - - const details = { - root: rootResult, - data: _value.map(getDetailedErrors), - }; - - const simple = { - root: this.getErrorMessages(rootResult), - data: _value.map(getErrors), - }; - - return [details as any, simple as any]; - } -} diff --git a/packages/core/src/strategy/service/impl/ObjectArrayGetterStrategy/types.ts b/packages/core/src/strategy/service/impl/ObjectArrayGetterStrategy/types.ts deleted file mode 100644 index 00fc49772..000000000 --- a/packages/core/src/strategy/service/impl/ObjectArrayGetterStrategy/types.ts +++ /dev/null @@ -1,63 +0,0 @@ -import type API from "../../../../../index"; -import type * as StrategyFactory from "../../../models/StrategyFactory"; -import ObjectStrategyType from "../ObjectStrategy/types"; - -/** - * Namespace for ObjectArrayGetter Strategy Types. - */ -namespace ObjectArrayGetterStrategyType { - /** - * Constant name identifier for this strategy. - */ - export const Name = `() => ${ObjectStrategyType.Name}[]` as const; - - /** - * Represents the simplified error structure for validating arrays of object types. - * - * @typeParam F - The type of the field being validated. - * - * - `field`: An array of string messages that represent validation errors at the array level. - * - `data`: An array of `Errors` objects that represent validation errors for each object in the array. - */ - export type SimpleErrors = { - root: string[]; - data: Array>; - }; - - /** - * Represents the detailed error structure for validating arrays of object types. - * - * @typeParam F - The type of the field being validated. - * - * - `field`: An array of `ValidationResult` objects that represent detailed validation errors at the array level. - * - `data`: An array of `DetailedErrors` objects that represent detailed validation errors for each object in the array. - */ - export type DetailedErrors = { - root: API.Validation.ValidationResult[]; - data: Array>; - }; - - /** - * Type guard to check if a certain field in a type matches this strategy. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - */ - // prettier-ignore - export type matches = - true extends API.Utilities.Booleans.isGetter - ? API.Utilities.Arrays.getArrayType> extends never - ? false - : API.Utilities.Booleans.isObject>> - : false; - - /** - * Type for the handler function based on the field and result types. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - * @typeParam R - The result type. - */ - // prettier-ignore - export type handler = Array> -} - -export default ObjectArrayGetterStrategyType; diff --git a/packages/core/src/strategy/service/impl/ObjectArrayStrategy.ts b/packages/core/src/strategy/service/impl/ObjectArrayStrategy.ts new file mode 100644 index 000000000..961c23bf8 --- /dev/null +++ b/packages/core/src/strategy/service/impl/ObjectArrayStrategy.ts @@ -0,0 +1,121 @@ +import { DecoratorArgs } from "@decorators"; +import { DetailedErrorsResponse, SimpleErrorsResponse } from "@strategy/models"; +import { Arrays, Booleans } from "@utilities"; +import type { ValidationResult } from "@validation/types"; +import { AbstractValidationStrategyService } from "../AbstractValidationStrategyService"; +import { ObjectStrategy } from "./ObjectStrategy"; + +export namespace ObjectArrayStrategy { + /** + * Constant name identifier for this strategy. + */ + export const Name = "composite[]" as const; + + /** + * Represents the simplified error structure for validating arrays of object types. + * + * @typeParam F - The type of the field being validated. + * + * - `field`: An array of string messages that represent validation errors at the array level. + * - `data`: An array of `Errors` objects that represent validation errors for each object in the array. + */ + export type SimpleErrors = { + root: string[]; + data: Array>; + }; + + /** + * Represents the detailed error structure for validating arrays of object types. + * + * @typeParam F - The type of the field being validated. + * + * - `field`: An array of `ValidationResult` objects that represent detailed validation errors at the array level. + * - `data`: An array of `DetailedErrors` objects that represent detailed validation errors for each object in the array. + */ + export type DetailedErrors = { + root: ValidationResult[]; + data: Array>; + }; + + /** + * Type guard to check if a certain field in a type matches this strategy. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + */ + // prettier-ignore + export type matches = + Arrays.getArrayType> extends never + ? false + : true extends Booleans.isGetter + ? false + : Booleans.isObject>>; + + /** + * Type for the handler function based on the field and result types. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + * @typeParam R - The result type. + */ + // prettier-ignore + export type handler = Array> + + /** + * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating arrays of object types. + * + * @typeParam F - The type of the field being validated, which is expected to be an array of objects. + * + * @extends AbstractValidationStrategyService, ObjectArraySimpleErrors> + */ + export class StrategyResolver extends AbstractValidationStrategyService, SimpleErrors> { + /** + * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for arrays of object types. + * + * @param value - The array of object values to be validated. + * @param context - The context in which the validation is taking place. + * @param groups - Optional validation groups to consider during validation. + * + * @returns A tuple containing `ObjectArrayDetailedErrors` and `ObjectArraySimpleErrors`. + * + * @remarks + * The method validates both the array as a whole (`field`) and each individual object (`data`) + * using the appropriate validation rules. + */ + test(value: any[], context: any, args: DecoratorArgs): [DetailedErrors, SimpleErrors] { + const _value = value ?? []; + const rootResult = this.getRootErrors(value, context, args); + + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + const getData = (element: any) => { + const [errors, detailedErrors] = new ObjectStrategy.StrategyResolver( + this.fieldDescriptor, + this.defaultValue, + this.groups, + this.locale, + this.eventEmitter, + this.engineCfg.asyncDelay! + ).test(element, context, args); + return { + detailedErrors, + errors, + }; + }; + + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + const getErrors = (element: any) => getData(element).errors; + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + const getDetailedErrors = (element: any) => getData(element).detailedErrors; + + const details = { + root: rootResult, + data: _value.map(getDetailedErrors), + }; + + const simple = { + root: this.getErrorMessages(rootResult), + data: _value.map(getErrors), + }; + + return [details as any, simple as any]; + } + } +} diff --git a/packages/core/src/strategy/service/impl/ObjectArrayStrategy/index.ts b/packages/core/src/strategy/service/impl/ObjectArrayStrategy/index.ts deleted file mode 100644 index 39e7e4e61..000000000 --- a/packages/core/src/strategy/service/impl/ObjectArrayStrategy/index.ts +++ /dev/null @@ -1,72 +0,0 @@ -import type API from "../../../../index"; -import { AbstractValidationStrategyService } from "../../../service/AbstractValidationStrategyService"; -import { ObjectStrat } from "../ObjectStrategy"; -import type ns from "./types"; - -/** - * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating arrays of object types. - * - * @typeParam F - The type of the field being validated, which is expected to be an array of objects. - * - * @extends AbstractValidationStrategyService, ObjectArraySimpleErrors> - */ -export class ObjectArrayStrat extends AbstractValidationStrategyService< - F, - ns.DetailedErrors, - ns.SimpleErrors -> { - /** - * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for arrays of object types. - * - * @param value - The array of object values to be validated. - * @param context - The context in which the validation is taking place. - * @param groups - Optional validation groups to consider during validation. - * - * @returns A tuple containing `ObjectArrayDetailedErrors` and `ObjectArraySimpleErrors`. - * - * @remarks - * The method validates both the array as a whole (`field`) and each individual object (`data`) - * using the appropriate validation rules. - */ - test( - value: any[], - context: any, - args: API.Decorator.DecoratorArgs - ): [ns.DetailedErrors, ns.SimpleErrors] { - const _value = value ?? []; - const rootResult = this.getRootErrors(value, context, args); - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - const getData = (element: any) => { - const [errors, detailedErrors] = new ObjectStrat( - this.fieldDescriptor, - this.defaultValue, - this.groups, - this.locale, - this.eventEmitter, - this.engineCfg.asyncDelay! - ).test(element, context, args); - return { - detailedErrors, - errors, - }; - }; - - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - const getErrors = (element: any) => getData(element).errors; - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - const getDetailedErrors = (element: any) => getData(element).detailedErrors; - - const details = { - root: rootResult, - data: _value.map(getDetailedErrors), - }; - - const simple = { - root: this.getErrorMessages(rootResult), - data: _value.map(getErrors), - }; - - return [details as any, simple as any]; - } -} diff --git a/packages/core/src/strategy/service/impl/ObjectArrayStrategy/types.ts b/packages/core/src/strategy/service/impl/ObjectArrayStrategy/types.ts deleted file mode 100644 index 455c0a189..000000000 --- a/packages/core/src/strategy/service/impl/ObjectArrayStrategy/types.ts +++ /dev/null @@ -1,63 +0,0 @@ -import type API from "../../../../../index"; -import type * as StrategyFactory from "../../../models/StrategyFactory"; -import type ObjectStrategyType from "../ObjectStrategy/types"; - -/** - * Namespace for ObjectArray Strategy Types. - */ -namespace ObjectArrayStrategyType { - /** - * Constant name identifier for this strategy. - */ - export const Name = "composite[]" as const; - - /** - * Represents the simplified error structure for validating arrays of object types. - * - * @typeParam F - The type of the field being validated. - * - * - `field`: An array of string messages that represent validation errors at the array level. - * - `data`: An array of `Errors` objects that represent validation errors for each object in the array. - */ - export type SimpleErrors = { - root: string[]; - data: Array>; - }; - - /** - * Represents the detailed error structure for validating arrays of object types. - * - * @typeParam F - The type of the field being validated. - * - * - `field`: An array of `ValidationResult` objects that represent detailed validation errors at the array level. - * - `data`: An array of `DetailedErrors` objects that represent detailed validation errors for each object in the array. - */ - export type DetailedErrors = { - root: API.Validation.ValidationResult[]; - data: Array>; - }; - - /** - * Type guard to check if a certain field in a type matches this strategy. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - */ - // prettier-ignore - export type matches = - API.Utilities.Arrays.getArrayType> extends never - ? false - : true extends API.Utilities.Booleans.isGetter - ? false - : API.Utilities.Booleans.isObject>>; - - /** - * Type for the handler function based on the field and result types. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - * @typeParam R - The result type. - */ - // prettier-ignore - export type handler = Array> -} - -export default ObjectArrayStrategyType; diff --git a/packages/core/src/strategy/service/impl/ObjectGetterStrategy.ts b/packages/core/src/strategy/service/impl/ObjectGetterStrategy.ts new file mode 100644 index 000000000..005fd2d6b --- /dev/null +++ b/packages/core/src/strategy/service/impl/ObjectGetterStrategy.ts @@ -0,0 +1,99 @@ +import { DecoratorArgs } from "@decorators"; +import { DetailedErrorsResponse, SimpleErrorsResponse, evaluate } from "@strategy/models"; +import { Booleans } from "@utilities"; +import type { ValidationResult } from "@validation/types"; +import { AbstractValidationStrategyService } from "../AbstractValidationStrategyService"; +import { ObjectStrategy } from "./ObjectStrategy"; + +export namespace ObjectGetterStrategy { + export const Name = `(): ${ObjectStrategy.Name}` as const; + + /** + * Represents the simplified error structure for validating object types. + * + * @typeParam F - The type of the field being validated. + * + * - `root`: An array of string messages that represent validation errors at the object level. + * - `data`: An `Errors` object that represents validation errors for each property in the object. + */ + export type SimpleErrors = { + root: string[]; + data: SimpleErrorsResponse; + }; + + /** + * Represents the detailed error structure for validating object types. + * + * @typeParam F - The type of the field being validated. + * + * - `root`: An array of `ValidationResult` objects that represent detailed validation errors at the object level. + * - `data`: A `DetailedErrors` object that represents detailed validation errors for each property in the object. + */ + export type DetailedErrors = { + root: ValidationResult[]; + data: DetailedErrorsResponse; + }; + + /** + * Type guard to check if a certain field in a type matches this strategy. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + */ + // prettier-ignore + export type matches = + true extends Booleans.isGetter + ? Booleans.isObject + : false + + /** + * Type for the handler function based on the field and result types. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + * @typeParam R - The result type. + */ + // prettier-ignore + export type handler = + true extends Booleans.isUndefined + ? T[K] + : { root: R; data: evaluate }; + + /** + * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating object types. + * + * @typeParam F - The type of the field being validated, which is expected to be an object. + * + * @extends AbstractValidationStrategyService, ObjectSimpleErrors> + */ + export class StrategyResolver extends AbstractValidationStrategyService, SimpleErrors> { + /** + * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for object types. + * + * @param value - The object value to be validated. + * @param context - The context in which the validation is taking place. + * @param groups - Optional validation groups to consider during validation. + * + * @returns A tuple containing `ObjectDetailedErrors` and `ObjectSimpleErrors`. + * + * @remarks + * The method validates both the object as a whole (`node`) and its properties (`children`) + * using the appropriate validation rules. + */ + test(value: any, context: any, args: DecoratorArgs): [DetailedErrors, SimpleErrors] { + const { detailedErrors, errors } = this.fieldEngine.validate(value); + + const rootResult = [...this.getRootErrors(value, context, args), ...this.getClassErrors(value, context)]; + + const detailedErrorsResult: DetailedErrors = { + root: rootResult, + data: detailedErrors, + }; + + const errorsResult: SimpleErrors = { + root: this.getErrorMessages(rootResult), + data: errors, + }; + + return [detailedErrorsResult, errorsResult]; + } + } +} diff --git a/packages/core/src/strategy/service/impl/ObjectGetterStrategy/index.ts b/packages/core/src/strategy/service/impl/ObjectGetterStrategy/index.ts deleted file mode 100644 index c93b48b24..000000000 --- a/packages/core/src/strategy/service/impl/ObjectGetterStrategy/index.ts +++ /dev/null @@ -1,54 +0,0 @@ -import type API from "../../../../index"; -import { AbstractValidationStrategyService } from "../../../service/AbstractValidationStrategyService"; -import type ns from "./types"; - -/** - * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating object types. - * - * @typeParam F - The type of the field being validated, which is expected to be an object. - * - * @extends AbstractValidationStrategyService, ObjectSimpleErrors> - */ -export class ObjectGetterStrat extends AbstractValidationStrategyService< - F, - ns.DetailedErrors, - ns.SimpleErrors -> { - /** - * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for object types. - * - * @param value - The object value to be validated. - * @param context - The context in which the validation is taking place. - * @param groups - Optional validation groups to consider during validation. - * - * @returns A tuple containing `ObjectDetailedErrors` and `ObjectSimpleErrors`. - * - * @remarks - * The method validates both the object as a whole (`node`) and its properties (`children`) - * using the appropriate validation rules. - */ - test( - value: any, - context: any, - args: API.Decorator.DecoratorArgs - ): [ns.DetailedErrors, ns.SimpleErrors] { - const { detailedErrors, errors } = this.fieldEngine.validate(value); - - const rootResult = [ - ...this.getRootErrors(value, context, args), - ...this.getClassErrors(value, context), - ]; - - const detailedErrorsResult: ns.DetailedErrors = { - root: rootResult, - data: detailedErrors, - }; - - const errorsResult: ns.SimpleErrors = { - root: this.getErrorMessages(rootResult), - data: errors, - }; - - return [detailedErrorsResult, errorsResult]; - } -} diff --git a/packages/core/src/strategy/service/impl/ObjectGetterStrategy/types.ts b/packages/core/src/strategy/service/impl/ObjectGetterStrategy/types.ts deleted file mode 100644 index 5ffb4515b..000000000 --- a/packages/core/src/strategy/service/impl/ObjectGetterStrategy/types.ts +++ /dev/null @@ -1,58 +0,0 @@ -import type API from "../../../../../index"; -import type * as StrategyFactory from "../../../models/StrategyFactory"; -import ObjectStrategyType from "../ObjectStrategy/types"; - -namespace ObjectGetterStrategyType { - export const Name = `(): ${ObjectStrategyType.Name}` as const; - - /** - * Represents the simplified error structure for validating object types. - * - * @typeParam F - The type of the field being validated. - * - * - `root`: An array of string messages that represent validation errors at the object level. - * - `data`: An `Errors` object that represents validation errors for each property in the object. - */ - export type SimpleErrors = { - root: string[]; - data: StrategyFactory.Impl.Errors; - }; - - /** - * Represents the detailed error structure for validating object types. - * - * @typeParam F - The type of the field being validated. - * - * - `root`: An array of `ValidationResult` objects that represent detailed validation errors at the object level. - * - `data`: A `DetailedErrors` object that represents detailed validation errors for each property in the object. - */ - export type DetailedErrors = { - root: API.Validation.ValidationResult[]; - data: StrategyFactory.Impl.DetailedErrors; - }; - - /** - * Type guard to check if a certain field in a type matches this strategy. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - */ - // prettier-ignore - export type matches = - true extends API.Utilities.Booleans.isGetter - ? API.Utilities.Booleans.isObject - : false - - /** - * Type for the handler function based on the field and result types. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - * @typeParam R - The result type. - */ - // prettier-ignore - export type handler = - true extends API.Utilities.Booleans.isUndefined - ? T[K] - : { root: R; data: StrategyFactory.evaluate }; -} - -export default ObjectGetterStrategyType; diff --git a/packages/core/src/strategy/service/impl/ObjectStrategy.ts b/packages/core/src/strategy/service/impl/ObjectStrategy.ts new file mode 100644 index 000000000..9e47c995c --- /dev/null +++ b/packages/core/src/strategy/service/impl/ObjectStrategy.ts @@ -0,0 +1,97 @@ +import { DecoratorArgs } from "@decorators"; +import { DetailedErrorsResponse, SimpleErrorsResponse, evaluate } from "@strategy/models/StrategyFactory"; +import { Booleans } from "@utilities"; +import type { ValidationResult } from "@validation/types"; +import { AbstractValidationStrategyService } from "../AbstractValidationStrategyService"; + +export namespace ObjectStrategy { + /** + * Constant name identifier for this strategy. + */ + export const Name = "composite" as const; + + /** + * Represents the simplified error structure for validating object types. + * @typeParam F - The type of the field being validated. + */ + export type SimpleErrors = { + /** An array of string messages that represent validation errors at the decorated field level. */ + root: string[]; + /** An object that represents simplified validation errors for each property in the object. */ + data: SimpleErrorsResponse; + }; + + /** + * Represents the detailed error structure for validating object types. + * @typeParam F - The type of the field being validated. + */ + export type DetailedErrors = { + /** An array of validation result objects that represent detailed validation errors at the decorated field level. */ + root: ValidationResult[]; + /** An object that represents detailed validation errors for each property in the object. */ + data: DetailedErrorsResponse; + }; + + /** + * Type guard to check if a certain field in a type matches this strategy. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + */ + // prettier-ignore + export type matches = + true extends Booleans.isGetter + ? false + : Booleans.isObject; + + /** + * Type for the handler function based on the field and result types. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + * @typeParam R - The result type. + */ + // prettier-ignore + export type handler = + true extends Booleans.isUndefined + ? T[K] + : { root: R; data: evaluate }; + + /** + * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating object types. + * + * @typeParam F - The type of the field being validated, which is expected to be an object. + * + * @extends AbstractValidationStrategyService, ObjectSimpleErrors> + */ + export class StrategyResolver extends AbstractValidationStrategyService, SimpleErrors> { + /** + * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for object types. + * + * @param value - The object value to be validated. + * @param context - The context in which the validation is taking place. + * @param groups - Optional validation groups to consider during validation. + * + * @returns A tuple containing `ObjectDetailedErrors` and `ObjectSimpleErrors`. + * + * @remarks + * The method validates both the object as a whole (`node`) and its properties (`children`) + * using the appropriate validation rules. + */ + test(value: any, context: any, args: DecoratorArgs): [DetailedErrors, SimpleErrors] { + const { detailedErrors, errors } = this.fieldEngine.validate(value); + + const rootResult = [...this.getRootErrors(value, context, args), ...this.getClassErrors(value, context)]; + + const detailedErrorsResult: DetailedErrors = { + root: rootResult, + data: detailedErrors, + }; + + const errorsResult: SimpleErrors = { + root: this.getErrorMessages(rootResult), + data: errors, + }; + + return [detailedErrorsResult, errorsResult]; + } + } +} diff --git a/packages/core/src/strategy/service/impl/ObjectStrategy/index.ts b/packages/core/src/strategy/service/impl/ObjectStrategy/index.ts deleted file mode 100644 index f66df3c01..000000000 --- a/packages/core/src/strategy/service/impl/ObjectStrategy/index.ts +++ /dev/null @@ -1,54 +0,0 @@ -import type API from "../../../../index"; -import { AbstractValidationStrategyService } from "../../../service/AbstractValidationStrategyService"; -import type ns from "./types"; - -/** - * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating object types. - * - * @typeParam F - The type of the field being validated, which is expected to be an object. - * - * @extends AbstractValidationStrategyService, ObjectSimpleErrors> - */ -export class ObjectStrat extends AbstractValidationStrategyService< - F, - ns.DetailedErrors, - ns.SimpleErrors -> { - /** - * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for object types. - * - * @param value - The object value to be validated. - * @param context - The context in which the validation is taking place. - * @param groups - Optional validation groups to consider during validation. - * - * @returns A tuple containing `ObjectDetailedErrors` and `ObjectSimpleErrors`. - * - * @remarks - * The method validates both the object as a whole (`node`) and its properties (`children`) - * using the appropriate validation rules. - */ - test( - value: any, - context: any, - args: API.Decorator.DecoratorArgs - ): [ns.DetailedErrors, ns.SimpleErrors] { - const { detailedErrors, errors } = this.fieldEngine.validate(value); - - const rootResult = [ - ...this.getRootErrors(value, context, args), - ...this.getClassErrors(value, context), - ]; - - const detailedErrorsResult: ns.DetailedErrors = { - root: rootResult, - data: detailedErrors, - }; - - const errorsResult: ns.SimpleErrors = { - root: this.getErrorMessages(rootResult), - data: errors, - }; - - return [detailedErrorsResult, errorsResult]; - } -} diff --git a/packages/core/src/strategy/service/impl/ObjectStrategy/types.ts b/packages/core/src/strategy/service/impl/ObjectStrategy/types.ts deleted file mode 100644 index 851585cc0..000000000 --- a/packages/core/src/strategy/service/impl/ObjectStrategy/types.ts +++ /dev/null @@ -1,59 +0,0 @@ -import type API from "../../../../../index"; -import type * as StrategyFactory from "../../../models/StrategyFactory"; - -/** - * Namespace for Object Strategy Types. - */ -namespace ObjectStrategyType { - /** - * Constant name identifier for this strategy. - */ - export const Name = "composite" as const; - - /** - * Represents the simplified error structure for validating object types. - * @typeParam F - The type of the field being validated. - */ - export type SimpleErrors = { - /** An array of string messages that represent validation errors at the decorated field level. */ - root: string[]; - /** An object that represents simplified validation errors for each property in the object. */ - data: StrategyFactory.Impl.Errors; - }; - - /** - * Represents the detailed error structure for validating object types. - * @typeParam F - The type of the field being validated. - */ - export type DetailedErrors = { - /** An array of validation result objects that represent detailed validation errors at the decorated field level. */ - root: API.Validation.ValidationResult[]; - /** An object that represents detailed validation errors for each property in the object. */ - data: StrategyFactory.Impl.DetailedErrors; - }; - - /** - * Type guard to check if a certain field in a type matches this strategy. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - */ - // prettier-ignore - export type matches = - true extends API.Utilities.Booleans.isGetter - ? false - : API.Utilities.Booleans.isObject; - - /** - * Type for the handler function based on the field and result types. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - * @typeParam R - The result type. - */ - // prettier-ignore - export type handler = - true extends API.Utilities.Booleans.isUndefined - ? T[K] - : { root: R; data: StrategyFactory.evaluate }; -} - -export default ObjectStrategyType; diff --git a/packages/core/src/strategy/service/impl/PrimitiveArrayGetterStrategy.ts b/packages/core/src/strategy/service/impl/PrimitiveArrayGetterStrategy.ts new file mode 100644 index 000000000..c9559b163 --- /dev/null +++ b/packages/core/src/strategy/service/impl/PrimitiveArrayGetterStrategy.ts @@ -0,0 +1,98 @@ +import { DecoratorArgs } from "@decorators"; +import { Arrays, Booleans, Types } from "@utilities"; +import type { ValidationResult } from "@validation/types"; +import { AbstractValidationStrategyService } from "../AbstractValidationStrategyService"; +import { PrimitiveStrategy } from "./PrimitiveStrategy"; + +export namespace PrimitiveArrayGetterStrategy { + /** + * Constant name identifier for this strategy. + */ + export const Name = `get (): ${PrimitiveStrategy.Name}[]` as const; + + /** + * Represents the simplified error structure for validating arrays of primitive types. + * + * - `node`: An array of string messages that represent validation errors at the array level. + * - `children`: A two-dimensional array of string messages that represent validation errors for each element in the array. + */ + export type SimpleErrors = { + node: string[]; + children: string[][]; + }; + + /** + * Represents the detailed error structure for validating arrays of primitive types. + * + * - `node`: An array of `ValidationResult` objects that represent detailed validation errors at the array level. + * - `children`: A two-dimensional array of `ValidationResult` objects that represent detailed validation errors for each element in the array. + */ + export type DetailedErrors = { + node: ValidationResult[]; + children: ValidationResult[][]; + }; + + /** + * Type guard to check if a certain field in a type matches this strategy. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + */ + // prettier-ignore + export type matches = + true extends Booleans.isGetter + ? Arrays.getArrayType extends never + ? false + : Booleans.isAnyOf, Types.PrimitiveType> + : false; + + /** + * Type for the handler function based on the field and result types. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + * @typeParam R - The result type. + */ + // prettier-ignore + export type handler = + true extends Booleans.isUndefined + ? T[K] + : { node: R; children: R[]; }; + + /** + * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating arrays of primitive types like numbers, strings, etc. + * + * @typeParam F - The type of the field being validated, which is expected to be an array of primitives. + * + * @extends AbstractValidationStrategyService + */ + export class StrategyResolver extends AbstractValidationStrategyService { + /** + * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for arrays of primitive types. + * + * @param value - The array of values to be validated. + * @param context - The context in which the validation is taking place. + * @param groups - Optional validation groups to consider during validation. + * + * @returns A tuple containing `PrimitiveArrayGetterDetailedErrors` and `PrimitiveArrayGetterSimpleErrors`. + * + * @remarks + * The method validates both the array as a whole (`node`) and each individual element (`children`) + * using the appropriate validation rules. + */ + test(value: any[], context: any, args: DecoratorArgs): [DetailedErrors, SimpleErrors] { + const valueArray = value ?? []; + const rootResult = this.getRootErrors(valueArray, context, args); + + const details = { + node: rootResult, + children: valueArray.map(v => this.getArrayItemErrors(v, context)), + }; + + const simple = { + node: this.getErrorMessages(rootResult), + children: details.children.map(v => this.getErrorMessages(v)), + }; + + return [details, simple]; + } + } +} diff --git a/packages/core/src/strategy/service/impl/PrimitiveArrayGetterStrategy/index.ts b/packages/core/src/strategy/service/impl/PrimitiveArrayGetterStrategy/index.ts deleted file mode 100644 index 698cf61cc..000000000 --- a/packages/core/src/strategy/service/impl/PrimitiveArrayGetterStrategy/index.ts +++ /dev/null @@ -1,50 +0,0 @@ -import type API from "../../../../"; -import { AbstractValidationStrategyService } from "../../../service/AbstractValidationStrategyService"; -import type ns from "./types"; - -/** - * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating arrays of primitive types like numbers, strings, etc. - * - * @typeParam F - The type of the field being validated, which is expected to be an array of primitives. - * - * @extends AbstractValidationStrategyService - */ -export class PrimitiveArrayGetterStrat extends AbstractValidationStrategyService< - F, - ns.DetailedErrors, - ns.SimpleErrors -> { - /** - * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for arrays of primitive types. - * - * @param value - The array of values to be validated. - * @param context - The context in which the validation is taking place. - * @param groups - Optional validation groups to consider during validation. - * - * @returns A tuple containing `PrimitiveArrayGetterDetailedErrors` and `PrimitiveArrayGetterSimpleErrors`. - * - * @remarks - * The method validates both the array as a whole (`node`) and each individual element (`children`) - * using the appropriate validation rules. - */ - test( - value: any[], - context: any, - args: API.Decorator.DecoratorArgs - ): [ns.DetailedErrors, ns.SimpleErrors] { - const valueArray = value ?? []; - const rootResult = this.getRootErrors(valueArray, context, args); - - const details = { - node: rootResult, - children: valueArray.map(v => this.getArrayItemErrors(v, context)), - }; - - const simple = { - node: this.getErrorMessages(rootResult), - children: details.children.map(v => this.getErrorMessages(v)), - }; - - return [details, simple]; - } -} diff --git a/packages/core/src/strategy/service/impl/PrimitiveArrayGetterStrategy/types.ts b/packages/core/src/strategy/service/impl/PrimitiveArrayGetterStrategy/types.ts deleted file mode 100644 index 68bd15336..000000000 --- a/packages/core/src/strategy/service/impl/PrimitiveArrayGetterStrategy/types.ts +++ /dev/null @@ -1,61 +0,0 @@ -import type API from "../../../../../index"; -import PrimitiveStrategyType from "../PrimitiveStrategy/types"; - -/** - * Namespace for PrimitiveArrayGetter Strategy Types. - */ -namespace PrimitiveArrayGetterStrategyType { - /** - * Constant name identifier for this strategy. - */ - export const Name = `get (): ${PrimitiveStrategyType.Name}[]` as const; - - /** - * Represents the simplified error structure for validating arrays of primitive types. - * - * - `node`: An array of string messages that represent validation errors at the array level. - * - `children`: A two-dimensional array of string messages that represent validation errors for each element in the array. - */ - export type SimpleErrors = { - node: string[]; - children: string[][]; - }; - - /** - * Represents the detailed error structure for validating arrays of primitive types. - * - * - `node`: An array of `ValidationResult` objects that represent detailed validation errors at the array level. - * - `children`: A two-dimensional array of `ValidationResult` objects that represent detailed validation errors for each element in the array. - */ - export type DetailedErrors = { - node: API.Validation.ValidationResult[]; - children: API.Validation.ValidationResult[][]; - }; - - /** - * Type guard to check if a certain field in a type matches this strategy. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - */ - // prettier-ignore - export type matches = - true extends API.Utilities.Booleans.isGetter - ? API.Utilities.Arrays.getArrayType extends never - ? false - : API.Utilities.Booleans.isAnyOf, API.Utilities.Types.PrimitiveType> - : false; - - /** - * Type for the handler function based on the field and result types. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - * @typeParam R - The result type. - */ - // prettier-ignore - export type handler = - true extends API.Utilities.Booleans.isUndefined - ? T[K] - : { node: R; children: R[]; }; -} - -export default PrimitiveArrayGetterStrategyType; diff --git a/packages/core/src/strategy/service/impl/PrimitiveArrayStrategy.ts b/packages/core/src/strategy/service/impl/PrimitiveArrayStrategy.ts new file mode 100644 index 000000000..f74b37f64 --- /dev/null +++ b/packages/core/src/strategy/service/impl/PrimitiveArrayStrategy.ts @@ -0,0 +1,95 @@ +import { DecoratorArgs } from "@decorators"; +import { Arrays, Booleans, Types } from "@utilities"; +import type { ValidationResult } from "@validation/types"; +import { AbstractValidationStrategyService } from "../AbstractValidationStrategyService"; + +export namespace PrimitiveArrayStrategy { + /** + * Constant name identifier for this strategy. + */ + export const Name = "primitive[]" as const; + + /** + * Represents the simplified error structure for validating arrays of primitive types. + * + * - `root`: An array of string messages that represent validation errors at the array level. + * - `data`: A two-dimensional array of string messages that represent validation errors for each element in the array. + */ + export type SimpleErrors = { + root: string[]; + data: string[][]; + }; + + /** + * Represents the detailed error structure for validating arrays of primitive types. + * + * - `root`: An array of `ValidationResult` objects that represent detailed validation errors at the array level. + * - `data`: A two-dimensional array of `ValidationResult` objects that represent detailed validation errors for each element in the array. + */ + export type DetailedErrors = { + root: ValidationResult[]; + data: ValidationResult[][]; + }; + + /** + * Type guard to check if a certain field in a type matches this strategy. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + */ + // prettier-ignore + export type matches = + Arrays.getArrayType extends never + ? false + : Booleans.isAnyOf, Types.PrimitiveType> + + /** + * Type for the handler function based on the field and result types. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + * @typeParam R - The result type. + */ + // prettier-ignore + export type handler = + true extends Booleans.isUndefined + ? T[K] + : { root: R; data: R[]; }; + + /** + * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating arrays of primitive types like numbers, strings, etc. + * + * @typeParam F - The type of the field being validated, which is expected to be an array of primitives. + * + * @extends AbstractValidationStrategyService + */ + export class StrategyResolver extends AbstractValidationStrategyService { + /** + * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for arrays of primitive types. + * + * @param value - The array of values to be validated. + * @param context - The context in which the validation is taking place. + * @param groups - Optional validation groups to consider during validation. + * + * @returns A tuple containing `PrimitiveArrayDetailedErrors` and `PrimitiveArraySimpleErrors`. + * + * @remarks + * The method validates both the array as a whole (`root`) and each individual element (`data`) + * using the appropriate validation rules. + */ + test(value: any[], context: any, args: DecoratorArgs): [DetailedErrors, SimpleErrors] { + const valueArray = value ?? []; + const rootResult = this.getRootErrors(valueArray, context, args); + + const details = { + root: rootResult, + data: valueArray.map(v => this.getArrayItemErrors(v, context)), + }; + + const simple = { + root: this.getErrorMessages(rootResult), + data: details.data.map(v => this.getErrorMessages(v)), + }; + + return [details, simple]; + } + } +} diff --git a/packages/core/src/strategy/service/impl/PrimitiveArrayStrategy/index.ts b/packages/core/src/strategy/service/impl/PrimitiveArrayStrategy/index.ts deleted file mode 100644 index 587f5b400..000000000 --- a/packages/core/src/strategy/service/impl/PrimitiveArrayStrategy/index.ts +++ /dev/null @@ -1,50 +0,0 @@ -import type API from "../../../../index"; -import { AbstractValidationStrategyService } from "../../../service/AbstractValidationStrategyService"; -import type ns from "./types"; - -/** - * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating arrays of primitive types like numbers, strings, etc. - * - * @typeParam F - The type of the field being validated, which is expected to be an array of primitives. - * - * @extends AbstractValidationStrategyService - */ -export class PrimitiveArrayStrat extends AbstractValidationStrategyService< - F, - ns.DetailedErrors, - ns.SimpleErrors -> { - /** - * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for arrays of primitive types. - * - * @param value - The array of values to be validated. - * @param context - The context in which the validation is taking place. - * @param groups - Optional validation groups to consider during validation. - * - * @returns A tuple containing `PrimitiveArrayDetailedErrors` and `PrimitiveArraySimpleErrors`. - * - * @remarks - * The method validates both the array as a whole (`root`) and each individual element (`data`) - * using the appropriate validation rules. - */ - test( - value: any[], - context: any, - args: API.Decorator.DecoratorArgs - ): [ns.DetailedErrors, ns.SimpleErrors] { - const valueArray = value ?? []; - const rootResult = this.getRootErrors(valueArray, context, args); - - const details = { - root: rootResult, - data: valueArray.map(v => this.getArrayItemErrors(v, context)), - }; - - const simple = { - root: this.getErrorMessages(rootResult), - data: details.data.map(v => this.getErrorMessages(v)), - }; - - return [details, simple]; - } -} diff --git a/packages/core/src/strategy/service/impl/PrimitiveArrayStrategy/types.ts b/packages/core/src/strategy/service/impl/PrimitiveArrayStrategy/types.ts deleted file mode 100644 index cd344abca..000000000 --- a/packages/core/src/strategy/service/impl/PrimitiveArrayStrategy/types.ts +++ /dev/null @@ -1,58 +0,0 @@ -import type API from "../../../../../index"; - -/** - * Namespace for PrimitiveArray Strategy Types. - */ -namespace PrimitiveArrayStrategyType { - /** - * Constant name identifier for this strategy. - */ - export const Name = "primitive[]" as const; - - /** - * Represents the simplified error structure for validating arrays of primitive types. - * - * - `root`: An array of string messages that represent validation errors at the array level. - * - `data`: A two-dimensional array of string messages that represent validation errors for each element in the array. - */ - export type SimpleErrors = { - root: string[]; - data: string[][]; - }; - - /** - * Represents the detailed error structure for validating arrays of primitive types. - * - * - `root`: An array of `ValidationResult` objects that represent detailed validation errors at the array level. - * - `data`: A two-dimensional array of `ValidationResult` objects that represent detailed validation errors for each element in the array. - */ - export type DetailedErrors = { - root: API.Validation.ValidationResult[]; - data: API.Validation.ValidationResult[][]; - }; - - /** - * Type guard to check if a certain field in a type matches this strategy. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - */ - // prettier-ignore - export type matches = - API.Utilities.Arrays.getArrayType extends never - ? false - : API.Utilities.Booleans.isAnyOf, API.Utilities.Types.PrimitiveType> - - /** - * Type for the handler function based on the field and result types. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - * @typeParam R - The result type. - */ - // prettier-ignore - export type handler = - true extends API.Utilities.Booleans.isUndefined - ? T[K] - : { root: R; data: R[]; }; -} - -export default PrimitiveArrayStrategyType; diff --git a/packages/core/src/strategy/service/impl/PrimitiveGetterStrategy.ts b/packages/core/src/strategy/service/impl/PrimitiveGetterStrategy.ts new file mode 100644 index 000000000..7ec40acc1 --- /dev/null +++ b/packages/core/src/strategy/service/impl/PrimitiveGetterStrategy.ts @@ -0,0 +1,67 @@ +import { DecoratorArgs } from "@decorators"; +import { Booleans, Types } from "@utilities"; +import type { ValidationResult } from "@validation/types"; +import { AbstractValidationStrategyService } from "../AbstractValidationStrategyService"; +import { PrimitiveStrategy } from "./PrimitiveStrategy"; + +export namespace PrimitiveGetterStrategy { + /** + * Constant name identifier for this strategy. + */ + export const Name = `get (): ${PrimitiveStrategy.Name}` as const; + + /** + * Represents the simplified error structure for validating getter methods that return primitive types. + */ + export type SimpleErrors = string[]; + + /** + * Represents the detailed error structure for validating getter methods that return primitive types. + */ + export type DetailedErrors = ValidationResult[]; + + /** + * Type guard to check if a certain field in a type matches this strategy. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + */ + // prettier-ignore + export type matches = + true extends Booleans.isGetter + ? Booleans.isAnyOf + : false; + + /** + * Type for the handler function based on the field and result types. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + * @typeParam R - The result type. + */ + // prettier-ignore + export type handler = + true extends Booleans.isUndefined + ? T[K] + : R; + + /** + * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating getter primitive types like numbers, strings, etc. + * + * @typeParam F - The type of the field being validated. + * + * @extends AbstractValidationStrategyService + */ + export class StrategyResolver extends AbstractValidationStrategyService { + /** + * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for primitive types by invoking the root rule's `validate` method and then building simplified error messages. + * + * @param value - The value to be validated. + * @param context - The context in which the validation is taking place. + * + * @returns A tuple containing an array of detailed validation results (`ValidationResult[]`) and an array of simplified error messages (`string[]`). + */ + test(value: any, context: any, args: DecoratorArgs): [DetailedErrors, SimpleErrors] { + const root = this.getRootErrors(value, context, args); + return [root, this.getErrorMessages(root)]; + } + } +} diff --git a/packages/core/src/strategy/service/impl/PrimitiveGetterStrategy/index.ts b/packages/core/src/strategy/service/impl/PrimitiveGetterStrategy/index.ts deleted file mode 100644 index 5f53bb748..000000000 --- a/packages/core/src/strategy/service/impl/PrimitiveGetterStrategy/index.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type API from "../../../../index"; -import { AbstractValidationStrategyService } from "../../../service/AbstractValidationStrategyService"; -import type ns from "./types"; - -/** - * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating getter primitive types like numbers, strings, etc. - * - * @typeParam F - The type of the field being validated. - * - * @extends AbstractValidationStrategyService - */ -export class PrimitiveGetterStrat extends AbstractValidationStrategyService< - F, - ns.DetailedErrors, - ns.SimpleErrors -> { - /** - * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for primitive types by invoking the root rule's `validate` method and then building simplified error messages. - * - * @param value - The value to be validated. - * @param context - The context in which the validation is taking place. - * - * @returns A tuple containing an array of detailed validation results (`ValidationResult[]`) and an array of simplified error messages (`string[]`). - */ - test( - value: any, - context: any, - args: API.Decorator.DecoratorArgs - ): [ns.DetailedErrors, ns.SimpleErrors] { - const root = this.getRootErrors(value, context, args); - return [root, this.getErrorMessages(root)]; - } -} diff --git a/packages/core/src/strategy/service/impl/PrimitiveGetterStrategy/types.ts b/packages/core/src/strategy/service/impl/PrimitiveGetterStrategy/types.ts deleted file mode 100644 index ca88be4ac..000000000 --- a/packages/core/src/strategy/service/impl/PrimitiveGetterStrategy/types.ts +++ /dev/null @@ -1,47 +0,0 @@ -import type API from "../../../../../index"; -import PrimitiveStrategyType from "../PrimitiveStrategy/types"; - -/** - * Namespace for PrimitiveGetter Strategy Types. - */ -namespace PrimitiveGetterStrategyType { - /** - * Constant name identifier for this strategy. - */ - export const Name = `get (): ${PrimitiveStrategyType.Name}` as const; - - /** - * Represents the simplified error structure for validating getter methods that return primitive types. - */ - export type SimpleErrors = string[]; - - /** - * Represents the detailed error structure for validating getter methods that return primitive types. - */ - export type DetailedErrors = API.Validation.ValidationResult[]; - - /** - * Type guard to check if a certain field in a type matches this strategy. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - */ - // prettier-ignore - export type matches = - true extends API.Utilities.Booleans.isGetter - ? API.Utilities.Booleans.isAnyOf - : false; - - /** - * Type for the handler function based on the field and result types. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - * @typeParam R - The result type. - */ - // prettier-ignore - export type handler = - true extends API.Utilities.Booleans.isUndefined - ? T[K] - : R; -} - -export default PrimitiveGetterStrategyType; diff --git a/packages/core/src/strategy/service/impl/PrimitiveStrategy.ts b/packages/core/src/strategy/service/impl/PrimitiveStrategy.ts new file mode 100644 index 000000000..1968ec06f --- /dev/null +++ b/packages/core/src/strategy/service/impl/PrimitiveStrategy.ts @@ -0,0 +1,64 @@ +import { DecoratorArgs } from "@decorators"; +import { Booleans, Types } from "@utilities"; +import type { ValidationResult } from "@validation/types"; +import { AbstractValidationStrategyService } from "../AbstractValidationStrategyService"; + +export namespace PrimitiveStrategy { + /** + * Constant name identifier for this strategy. + */ + export const Name = "primitive" as const; + + /** + * Represents the simplified error structure for validating primitive types. + */ + export type SimpleErrors = string[]; + + /** + * Represents the detailed error structure for validating primitive types. + */ + export type DetailedErrors = ValidationResult[]; + + /** + * Type guard to check if a certain field in a type matches this strategy. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + */ + // prettier-ignore + export type matches = Booleans.isAnyOf; + + /** + * Type for the handler function based on the field and result types. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + * @typeParam R - The result type. + */ + // prettier-ignore + export type handler = + true extends Booleans.isUndefined + ? T[K] + : R; + + /** + * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating primitive types like numbers, strings, etc. + * + * @typeParam F - The type of the field being validated. + * + * @extends AbstractValidationStrategyService + */ + export class StrategyResolver extends AbstractValidationStrategyService { + /** + * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for primitive types by invoking the root rule's `validate` method and then building simplified error messages. + * + * @param value - The value to be validated. + * @param context - The context in which the validation is taking place. + * @param groups - Optional validation groups to consider during validation. + * + * @returns A tuple containing an array of detailed validation results (`ValidationResult[]`) and an array of simplified error messages (`string[]`). + */ + test(value: any, context: any, args: DecoratorArgs): [DetailedErrors, SimpleErrors] { + const root = this.getRootErrors(value, context, args); + return [root, this.getErrorMessages(root)]; + } + } +} diff --git a/packages/core/src/strategy/service/impl/PrimitiveStrategy/index.ts b/packages/core/src/strategy/service/impl/PrimitiveStrategy/index.ts deleted file mode 100644 index ae819d8c1..000000000 --- a/packages/core/src/strategy/service/impl/PrimitiveStrategy/index.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type API from "../../../../index"; -import { AbstractValidationStrategyService } from "../../../service/AbstractValidationStrategyService"; -import type ns from "./types"; - -/** - * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating primitive types like numbers, strings, etc. - * - * @typeParam F - The type of the field being validated. - * - * @extends AbstractValidationStrategyService - */ -export class PrimitiveStrat extends AbstractValidationStrategyService< - F, - ns.DetailedErrors, - ns.SimpleErrors -> { - /** - * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for primitive types by invoking the root rule's `validate` method and then building simplified error messages. - * - * @param value - The value to be validated. - * @param context - The context in which the validation is taking place. - * @param groups - Optional validation groups to consider during validation. - * - * @returns A tuple containing an array of detailed validation results (`ValidationResult[]`) and an array of simplified error messages (`string[]`). - */ - test( - value: any, - context: any, - args: API.Decorator.DecoratorArgs - ): [ns.DetailedErrors, ns.SimpleErrors] { - const root = this.getRootErrors(value, context, args); - return [root, this.getErrorMessages(root)]; - } -} diff --git a/packages/core/src/strategy/service/impl/PrimitiveStrategy/types.ts b/packages/core/src/strategy/service/impl/PrimitiveStrategy/types.ts deleted file mode 100644 index e5e79392f..000000000 --- a/packages/core/src/strategy/service/impl/PrimitiveStrategy/types.ts +++ /dev/null @@ -1,43 +0,0 @@ -import type API from "../../../../../index"; - -/** - * Namespace for Primitive Strategy Types. - */ -namespace PrimitiveStrategyType { - /** - * Constant name identifier for this strategy. - */ - export const Name = "primitive" as const; - - /** - * Represents the simplified error structure for validating primitive types. - */ - export type SimpleErrors = string[]; - - /** - * Represents the detailed error structure for validating primitive types. - */ - export type DetailedErrors = API.Validation.ValidationResult[]; - - /** - * Type guard to check if a certain field in a type matches this strategy. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - */ - // prettier-ignore - export type matches = API.Utilities.Booleans.isAnyOf; - - /** - * Type for the handler function based on the field and result types. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - * @typeParam R - The result type. - */ - // prettier-ignore - export type handler = - true extends API.Utilities.Booleans.isUndefined - ? T[K] - : R; -} - -export default PrimitiveStrategyType; diff --git a/packages/core/src/strategy/service/impl/index.ts b/packages/core/src/strategy/service/impl/index.ts index 7b0b1237c..148499424 100644 --- a/packages/core/src/strategy/service/impl/index.ts +++ b/packages/core/src/strategy/service/impl/index.ts @@ -1,9 +1,17 @@ +export * from "./PrimitiveStrategy"; + export * from "./FunctionStrategy"; + export * from "./ObjectArrayGetterStrategy"; + export * from "./ObjectArrayStrategy"; + export * from "./ObjectGetterStrategy"; + export * from "./ObjectStrategy"; + export * from "./PrimitiveArrayGetterStrategy"; + export * from "./PrimitiveArrayStrategy"; + export * from "./PrimitiveGetterStrategy"; -export * from "./PrimitiveStrategy"; diff --git a/packages/core/src/utilities/impl/Arrays.ts b/packages/core/src/utilities/impl/Arrays.ts index 1362b4e7e..39381ecb3 100644 --- a/packages/core/src/utilities/impl/Arrays.ts +++ b/packages/core/src/utilities/impl/Arrays.ts @@ -1,11 +1,10 @@ -import type * as Booleans from "./Booleans"; - -/** - * Returns depth of provided generic array (example: getArrayDepth returns 2). - * @remarks Due to TypeScript's compiler - evaluation is limited to the depth of 5. - */ -// prettier-ignore -export type getArrayDepth = +export namespace Arrays { + /** + * Returns depth of provided generic array (example: getArrayDepth returns 2). + * @remarks Due to TypeScript's compiler - evaluation is limited to the depth of 5. + */ + // prettier-ignore + export type getArrayDepth = T extends any[] ? T[0] extends any[] ? T[0][0] extends any[] @@ -18,20 +17,17 @@ export type getArrayDepth = : 1 : 0; -/** - * Returns an array type constructed of `N` depth. - */ -export type setArrayDepth = R["length"] extends N - ? T - : setArrayDepth; + /** + * Returns an array type constructed of `N` depth. + */ + export type setArrayDepth = R["length"] extends N + ? T + : setArrayDepth; -/** - * A type that extracts the element type of an array type `T`. - * - * @typeParam T - The type to extract the array type from. - */ -export type getArrayType = T extends Array - ? true extends Booleans.isArray - ? getArrayType - : U - : never; + /** + * A type that extracts the element type of an array type `T`. + * + * @typeParam T - The type to extract the array type from. + */ + export type getArrayType = T extends Array ? U : never; +} diff --git a/packages/core/src/utilities/impl/Booleans.ts b/packages/core/src/utilities/impl/Booleans.ts index 486dc17f4..6ac022120 100644 --- a/packages/core/src/utilities/impl/Booleans.ts +++ b/packages/core/src/utilities/impl/Booleans.ts @@ -1,87 +1,76 @@ -import type API from "../../../index"; +import { Arrays } from "@utilities/impl/Arrays"; +import { Objects } from "@utilities/impl/Objects"; +import { Types } from "@utilities/impl/Types"; -import type * as Arrays from "./Arrays"; -import type * as Objects from "./Objects"; -import type * as Types from "./Types"; +export namespace Booleans { + /** + * Checks if `TCheck` is any of the types in `TData`. + * + * @typeParam TCheck - The type to check. + * @typeParam TData - The array type to check against. + */ + export type isAnyOf = NonNullable extends TData[number] ? true : false; -/** - * Checks if `TCheck` is any of the types in `TData`. - * - * @typeParam TCheck - The type to check. - * @typeParam TData - The array type to check against. - */ -export type isAnyOf< - TCheck, - TData extends Types.ArrayType -> = NonNullable extends TData[number] ? true : false; + /** + * Checks if `T` is an object type. + * + * @typeParam T - The type to check. + */ + export type isObject = NonNullable extends isFunction + ? false + : NonNullable extends isArray + ? false + : NonNullable extends isPrimitive + ? false + : true; -/** - * Checks if `T` is an object type. - * - * @typeParam T - The type to check. - */ -export type isObject = NonNullable extends isFunction - ? false - : NonNullable extends isArray - ? false - : NonNullable extends isPrimitive - ? false - : true; + /** + * Checks if `T` is a function type. + * + * @typeParam T - The type to check. + */ + export type isFunction = NonNullable extends Types.FunctionType ? true : false; -/** - * Checks if `T` is a function type. - * - * @typeParam T - The type to check. - */ -export type isFunction = NonNullable extends Types.FunctionType - ? Types.UnwrapPromise>> extends API.Validation.ValidationResult - ? true - : false - : false; + /** + * Checks if `T[K]` is a getter type. + * + * @typeParam T - The parent type to check. + * @typeParam T - The key of parent to check. + */ + export type isGetter = K extends Objects.Inputs ? false : true; -/** - * Checks if `T[K]` is a getter type. - * - * @typeParam T - The parent type to check. - * @typeParam T - The key of parent to check. - */ -export type isGetter = K extends Objects.Inputs ? false : true; + /** + * Checks if `T` is an array type. + * + * @typeParam T - The type to check. + */ + export type isArray = NonNullable extends Types.ArrayType ? true : false; -/** - * Checks if `T` is an array type. - * - * @typeParam T - The type to check. - */ -export type isArray = NonNullable extends Types.ArrayType ? true : false; + /** + * Checks if `T` is a primitive type. + * + * @typeParam T - The type to check. + */ + export type isPrimitive = isAnyOf; -/** - * Checks if `T` is a primitive type. - * - * @typeParam T - The type to check. - */ -export type isPrimitive = isAnyOf; + /** + * Checks if `T` is an array of primitive types. + * + * @typeParam T - The type to check. + */ + export type isPrimitiveArray = Arrays.getArrayType extends never ? false : isPrimitive>; -/** - * Checks if `T` is an array of primitive types. - * - * @typeParam T - The type to check. - */ -export type isPrimitiveArray = Arrays.getArrayType extends never - ? false - : isPrimitive>; + /** + * Checks if `T` is an array of object types. + * + * @typeParam T - The type to check. + */ + export type isObjectArray = Arrays.getArrayType extends never ? false : isObject>; -/** - * Checks if `T` is an array of object types. - * - * @typeParam T - The type to check. - */ -export type isObjectArray = Arrays.getArrayType extends never - ? false - : isObject>; - -/** - * Checks if `T` is `undefined`. - * - * @typeParam T - The type to check. - */ -export type isUndefined = T extends undefined ? true : false; + /** + * Checks if `T` is `undefined`. + * + * @typeParam T - The type to check. + */ + export type isUndefined = T extends undefined ? true : false; +} diff --git a/packages/core/src/utilities/impl/Classes.ts b/packages/core/src/utilities/impl/Classes.ts new file mode 100644 index 000000000..aa164b716 --- /dev/null +++ b/packages/core/src/utilities/impl/Classes.ts @@ -0,0 +1,68 @@ +import { Types } from "@utilities/impl/Types"; + +export namespace Classes { + /** + * Retrieves the names of all fields in a class. + * + * @param constructor - The class constructor. + * @returns An array of field names. + */ + export function getClassFieldNames(constructor: Types.Class): Array { + function getPropertyNames(classInstance: any): string[] { + return Object.getOwnPropertyNames(classInstance ?? {}).filter(property => property !== "constructor"); + } + const instance: any = new constructor(); + const prototype = instance.__proto__; + const instanceProps = getPropertyNames(instance); + const prototypeProps = getPropertyNames(prototype); + const uniquePropsSet = new Set([...instanceProps, ...prototypeProps]); + const uniquePropsArray = [...uniquePropsSet]; + return uniquePropsArray as Array; + } + + /** + * Retrieves the property descriptor for a specific field in a class. + * + * @param constructor - The class constructor. + * @param name - The name of the field. + * @returns The property descriptor for the field. + */ + export function getClassFieldDescriptor( + constructor: Types.Class, + name: keyof TClass + ): PropertyDescriptor | undefined { + const instance: any = new constructor(); + const prototype = instance.__proto__; + return Object.getOwnPropertyDescriptor(prototype, name); + } + + /** + * Retrieves or initializes metadata for a given strategy. + * + * @param strategy - The strategy to get metadata for. + * @returns The metadata object. + */ + export function getMetadata(strategy: any /* MetaStrategy */): DecoratorMetadataObject { + if (isClass(strategy)) { + (Symbol as any).metadata ??= Symbol("Symbol.metadata"); + // @ts-ignore + strategy[Symbol.metadata] ??= {}; + // @ts-ignore + return strategy[Symbol.metadata]!; + } + if (strategy && !strategy.metadata) { + strategy.metadata = {}; + } + return strategy?.metadata ?? {}; + } + + /** + * Checks if a given strategy is a class. + * + * @param strategy - The strategy to check. + * @returns True if the strategy is a class, false otherwise. + */ + export function isClass(strategy: any /* MetaStrategy */): strategy is Types.Class { + return typeof strategy === "function"; + } +} diff --git a/packages/core/src/utilities/impl/Objects.ts b/packages/core/src/utilities/impl/Objects.ts index 589b89af3..295650d7f 100644 --- a/packages/core/src/utilities/impl/Objects.ts +++ b/packages/core/src/utilities/impl/Objects.ts @@ -1,29 +1,23 @@ -import API from "../../index"; - -import { EventEmitter } from "../misc/EventEmitter"; -import type * as Arrays from "./Arrays"; -import type * as Booleans from "./Booleans"; -import type * as Types from "./Types"; - -/** - * A type that represents an optional value. - * - * @typeParam T - The type of the optional value. - */ -export type Optional = T extends undefined ? any : T | undefined | null; - -/** - * A predicate function for filtering arrays. - * - * @typeParam T - The type of the array elements. - */ -export type ArrayPredicate = ((value: T, index: number, array: T[]) => boolean) & {}; - -/** - * Filters out getters, functions and read-only properties from a type - */ -// prettier-ignore -export type Payload = Types.Prettify = T extends undefined ? any : T | undefined | null; + + /** + * A predicate function for filtering arrays. + * + * @typeParam T - The type of the array elements. + */ + export type ArrayPredicate = ((value: T, index: number, array: T[]) => boolean) & {}; + + /** + * Filters out getters, functions and read-only properties from a type + */ + // prettier-ignore + export type Payload = any/*Types.Prettify, Booleans.isFunction, @@ -36,277 +30,216 @@ export type Payload = Types.Prettify ? T[K] : Payload - }>>; - -/** - * A conditional type that checks if types `X` and `Y` are equal. It returns type `A` if they are equal, and type `B` if they are not. - * - * @typeParam X - The first type. - * @typeParam Y - The second type. - * @typeParam A - The type to return if `X` and `Y` are equal. - * @typeParam B - The type to return if `X` and `Y` are not equal. - */ -export type IfEquals = (() => T extends X ? 1 : 2) extends < - T ->() => T extends Y ? 1 : 2 - ? A - : B; - -/** - * A type that excludes properties with values of type `TExclude` from `TParent`. - * - * @typeParam TParent - The parent type. - * @typeParam TExclude - The type to exclude from `TParent`. - */ -export type Exclude = Pick< - TParent, - Values<{ - [Prop in keyof TParent]: [TParent[Prop]] extends [TExclude] ? never : Prop; - }> ->; - -/** - * A type that removes properties with values of type `never` from `T`. - * - * @typeParam T - The type to purify. - */ -export type Purify = Exclude; - -/** - * A type that extracts the values from the properties of an object type `T`. - * - * @typeParam T - An object type. - */ -export type Values = T[keyof T]; - -/** - * A type that extracts input properties from an object type `T`. - * - * @typeParam T - The object type. - */ -export type Inputs = { - [P in keyof T]-?: IfEquals<{ [Q in P]: T[P] }, { -readonly [Q in P]: T[P] }, P>; -}[keyof T]; - -/** - * Removes duplicate elements from an array while preserving order. - * - * @typeParam T - The type of the elements in the array. - */ -export function unique(data: T[]): T[] { - return [...new Set(data)]; -} - -/** - * Checks if an error object has errors. - * - * @typeParam T - The type of the errors. - */ -export function hasErrors(data: API.Strategy.Impl.Errors): boolean { - const data0: any = data; - if (Array.isArray(data0)) { - return data0.some(item => hasErrors(item)); - } else if (typeof data0 === "object" && data0 !== null) { - return Object.values(data0).some((value: any) => hasErrors(value)); - } else if (typeof data0 === "string") { - return true; + }>>*/; + + /** + * A conditional type that checks if types `X` and `Y` are equal. It returns type `A` if they are equal, and type `B` if they are not. + * + * @typeParam X - The first type. + * @typeParam Y - The second type. + * @typeParam A - The type to return if `X` and `Y` are equal. + * @typeParam B - The type to return if `X` and `Y` are not equal. + */ + export type IfEquals = (() => T extends X ? 1 : 2) extends () => T extends Y ? 1 : 2 + ? A + : B; + + /** + * A type that excludes properties with values of type `TExclude` from `TParent`. + * + * @typeParam TParent - The parent type. + * @typeParam TExclude - The type to exclude from `TParent`. + */ + export type Exclude = Pick< + TParent, + Values<{ + [Prop in keyof TParent]: [TParent[Prop]] extends [TExclude] ? never : Prop; + }> + >; + + /** + * A type that removes properties with values of type `never` from `T`. + * + * @typeParam T - The type to purify. + */ + export type Purify = Exclude; + + /** + * A type that extracts the values from the properties of an object type `T`. + * + * @typeParam T - An object type. + */ + export type Values = T[keyof T]; + + /** + * A type that extracts input properties from an object type `T`. + * + * @typeParam T - The object type. + */ + export type Inputs = { + [P in keyof T]-?: IfEquals<{ [Q in P]: T[P] }, { -readonly [Q in P]: T[P] }, P>; + }[keyof T]; + + /** + * Removes duplicate elements from an array while preserving order. + * + * @typeParam T - The type of the elements in the array. + */ + export function unique(data: T[]): T[] { + return [...new Set(data)]; } - return false; -} -/** - * Recursively checks if two values are deep equal. - */ -export function deepEquals(val1: any, val2: any): boolean { - if (val1 === val2) { - return true; - } else if (typeof val1 !== typeof val2) { - return false; - } else if (Array.isArray(val1) && Array.isArray(val2)) { - if (val1.length !== val2.length) { + /** + * Recursively checks if two values are deep equal. + */ + export function deepEquals(val1: any, val2: any): boolean { + if (val1 === val2) { + return true; + } else if (typeof val1 !== typeof val2) { return false; - } - for (let i = 0; i < val1.length; i++) { - if (!deepEquals(val1[i], val2[i])) { + } else if (Array.isArray(val1) && Array.isArray(val2)) { + if (val1.length !== val2.length) { return false; } - } - return true; - } else if (typeof val1 === "object" && val1 !== null && val2 !== null) { - const keys1 = Object.keys(val1); - const keys2 = Object.keys(val2); - if (keys1.length !== keys2.length) { - return false; - } - for (const key of keys1) { - if (!deepEquals(val1[key], val2[key])) { + for (let i = 0; i < val1.length; i++) { + if (!deepEquals(val1[i], val2[i])) { + return false; + } + } + return true; + } else if (typeof val1 === "object" && val1 !== null && val2 !== null) { + const keys1 = Object.keys(val1); + const keys2 = Object.keys(val2); + if (keys1.length !== keys2.length) { return false; } + for (const key of keys1) { + if (!deepEquals(val1[key], val2[key])) { + return false; + } + } + return true; + } else { + return false; } - return true; - } else { - return false; } -} -/** - * Hashes a value of any type and returns a number. - */ -export function hash(val: any): number { - function stringHash(str: string): number { - let hash = 0; - for (let i = 0; i < str.length; i++) { - hash = (hash << 5) - hash + str.charCodeAt(i); - hash = hash & hash; + /** + * Hashes a value of any type and returns a number. + */ + export function hash(val: any): number { + function stringHash(str: string): number { + let hash = 0; + for (let i = 0; i < str.length; i++) { + hash = (hash << 5) - hash + str.charCodeAt(i); + hash = hash & hash; + } + return hash; } - return hash; - } - function numberHash(num: number): number { - return num - .toString() - .split("") - .reduce((hash, ch) => { - hash = (hash << 5) - hash + ch.charCodeAt(0); - return hash & hash; - }, 0); - } - - function booleanHash(bool: boolean): number { - return bool ? 1 : 0; - } - - function nullHash(): number { - return 0; - } + function numberHash(num: number): number { + return num + .toString() + .split("") + .reduce((hash, ch) => { + hash = (hash << 5) - hash + ch.charCodeAt(0); + return hash & hash; + }, 0); + } - function undefinedHash(): number { - return 0; - } + function booleanHash(bool: boolean): number { + return bool ? 1 : 0; + } - function arrayHash(arr: any[]): number { - return arr.reduce((hash, val) => { - hash = (hash << 5) - hash + hash(val); - return hash & hash; - }, 0); - } + function nullHash(): number { + return 0; + } - function objectHash(obj: any): number { - return Object.keys(obj) - .sort() - .reduce((hashValue, key) => { - hashValue = (hashValue << 5) - hashValue + hash(obj[key]); - return hashValue & hashValue; - }, 0); - } + function undefinedHash(): number { + return 0; + } - function defaultHash(val: any): number { - return (val ?? "") - .toString() - .split("") - .reduce((hash: number, ch: string) => { - hash = (hash << 5) - hash + ch.charCodeAt(0); + function arrayHash(arr: any[]): number { + return arr.reduce((hash, val) => { + hash = (hash << 5) - hash + hash(val); return hash & hash; }, 0); - } + } - if (typeof val === "string") { - return stringHash(val); - } else if (typeof val === "number") { - return numberHash(val); - } else if (typeof val === "boolean") { - return booleanHash(val); - } else if (val === null) { - return nullHash(); - } else if (val === undefined) { - return undefinedHash(); - } else if (Array.isArray(val)) { - return arrayHash(val); - } else if (typeof val === "object") { - return objectHash(val); - } else { - return defaultHash(val); - } -} + function objectHash(obj: any): number { + return Object.keys(obj) + .sort() + .reduce((hashValue, key) => { + hashValue = (hashValue << 5) - hashValue + hash(obj[key]); + return hashValue & hashValue; + }, 0); + } -/** - * Transforms a plain object into an instance of the given class. - * @param clazz - The class to transform the object into. - * @param object - The object to transform. - * @typeParam TClass - The type of the class. - * @returns An instance of TClass. - */ -export function toClass>( - clazz: TClass, - object?: Payload> -): Types.UnwrapClass { - function _toClass>( - clazz: TConstructor, - object?: Payload> | Types.ArrayType - ): Types.UnwrapClass { - if (Array.isArray(object)) { - return object.map(item => _toClass(clazz, item)) as Types.UnwrapClass; + function defaultHash(val: any): number { + return (val ?? "") + .toString() + .split("") + .reduce((hash: number, ch: string) => { + hash = (hash << 5) - hash + ch.charCodeAt(0); + return hash & hash; + }, 0); } - const entries = Object.entries(object ?? {}); - const meta = API.Reflection.FieldValidatorMetaService.inject(clazz, EventEmitter.EMPTY); - const data: API.Decorator.DecoratorArgs = {}; - for (const [key, value] of entries) { - const descriptor = meta.getUntypedDescriptor(key); - const { thisClass } = descriptor; - if (thisClass) { - if (Array.isArray(value)) { - data[key] = value.map(item => _toClass(thisClass, item)); - } else { - data[key] = toClass(thisClass, value); - } - } else { - data[key] = value; - } + if (typeof val === "string") { + return stringHash(val); + } else if (typeof val === "number") { + return numberHash(val); + } else if (typeof val === "boolean") { + return booleanHash(val); + } else if (val === null) { + return nullHash(); + } else if (val === undefined) { + return undefinedHash(); + } else if (Array.isArray(val)) { + return arrayHash(val); + } else if (typeof val === "object") { + return objectHash(val); + } else { + return defaultHash(val); } + } - const instance = new clazz(); - Object.entries(data).forEach(([k, v]) => (instance[k] = v)); - return instance; + /** + * Debounces a function. + * @param fn - The function to debounce. + * @param delay - The delay time in milliseconds. + * @returns A debounced function. + */ + export function debounce(fn: Function, delay: number): Function { + let timeoutID: any = null; + return (...args: any[]) => { + if (timeoutID) { + clearTimeout(timeoutID); + } + timeoutID = setTimeout(() => fn(...args), delay); + }; } - return _toClass(clazz, object); -} -/** - * Debounces a function. - * @param fn - The function to debounce. - * @param delay - The delay time in milliseconds. - * @returns A debounced function. - */ -export function debounce(fn: Function, delay: number): Function { - let timeoutID: any = null; - return (...args: any[]) => { - if (timeoutID) { - clearTimeout(timeoutID); - } - timeoutID = setTimeout(() => fn(...args), delay); - }; -} + export type FieldType = "date" | "array" | "string" | "number" | "boolean" | "object"; -export type FieldType = "date" | "array" | "string" | "number" | "boolean" | "object"; + export function assertType(type: FieldType, value: any): void | never { + if (value == null) return; -export function assertType(type: FieldType, value: any): void | never { - if (value == null) return; + if (type === "date") { + if (value instanceof Date) return; + throwTypeMismatchError(type, value); + } - if (type === "date") { - if (value instanceof Date) return; - throwTypeMismatchError(type, value); - } + if (type === "array") { + if (Array.isArray(value)) return; + throwTypeMismatchError(type, value); + } - if (type === "array") { - if (Array.isArray(value)) return; + if (typeof value === type) return; throwTypeMismatchError(type, value); } - if (typeof value === type) return; - throwTypeMismatchError(type, value); -} - -function throwTypeMismatchError(type: FieldType, value: any): never { - throw new Error(`Type '${type}' is not assignable to type ${JSON.stringify(value)}`); + function throwTypeMismatchError(type: FieldType, value: any): never { + throw new Error(`Type '${type}' is not assignable to type ${JSON.stringify(value)}`); + } } diff --git a/packages/core/src/utilities/impl/Strings.ts b/packages/core/src/utilities/impl/Strings.ts index 61cf8243f..9efe391d2 100644 --- a/packages/core/src/utilities/impl/Strings.ts +++ b/packages/core/src/utilities/impl/Strings.ts @@ -1,20 +1 @@ -/** - * Formats a string by replacing placeholders with provided arguments. - * - * @param str - The string containing placeholders in the form of `{0}`, `{1}`, etc. - * @param args - The values to replace the placeholders with. - * @returns The formatted string with placeholders replaced by the corresponding values from `args`. - * - * @example - * ```typescript - * const formatted = sprintf("Hello, {0}!", "World"); // Output: "Hello, World!" - * ``` - * - * @remarks - * If a placeholder's corresponding value is not provided in `args`, the placeholder will remain unchanged in the output string. - */ -export function sprintf(str: string, ...args: any[]): string { - return str.replace(/{(\d+)}/g, function (match, number) { - return typeof args[number] !== "undefined" ? args[number] : match; - }); -} +export namespace Strings {} diff --git a/packages/core/src/utilities/impl/Types.ts b/packages/core/src/utilities/impl/Types.ts index be2b5f0a6..0d0e9e1a9 100644 --- a/packages/core/src/utilities/impl/Types.ts +++ b/packages/core/src/utilities/impl/Types.ts @@ -1,72 +1,147 @@ -import type API from "../../../index"; -import { type PrimitiveSet } from "../../../index"; - -/** - * Represents the JavaScript `Function` type. - */ -export type FunctionType = (() => any) & {}; - -/** - * Represents the generic array type. - */ -export type ArrayType = any[]; - -/** - * Represents primitive data types including `string`, `number`, `boolean`, - * `bigint`, `Date`, and custom primitives defined in `PrimitiveSetAppend`. - */ -export type PrimitiveType = [ - ...[string, number, boolean, bigint, Date], - ...(PrimitiveSet extends { - values: infer CustomPrimitives extends readonly unknown[]; - } - ? CustomPrimitives - : []) -]; - /** - * Represents a class constructor that can create instances of type `T`. - * - * @typeParam T - The type to be instantiated by the class constructor. + * An overridable interface designed for disabling nested validation on custom object types. + * - when specified ***(example 1)***: an object type is considered primitive and it's simplified errors render as `string[]` + * - when not specified ***(example 2)***: an object type is considered as is and it's simplified errors are evaluated by {@link Strategy.Impl.Errors evaluate}) * * @example - * ```typescript - * class MyClass { - * constructor(arg1: string, arg2: number) { - * // ... + * 1: Disabling nested form validation for `Coordinate` class by augmenting the `PrimitiveSet` interface from `tdv-core`. This is a way of treating custom object types as primitives and avoiding recursive field validation + * ```ts + * // coordinate.ts - model class which is considered primitive + * export class Coordinate { + * x: number; + * y: number; + * } + * ``` + *
+ * ```ts + * // index.ts - entry point of the app + * declare module "tdv-core" { + * interface PrimitiveSet { + * // Specify object types as primitives here + * values: [Coordinate]; * } * } + * ``` + *
+ * ```ts + * // consumer.ts - model class which holds Coordinate property + * import { createFieldValidator } from "tdv-core"; + * // custom Coordinate validator + * function MinX(minX: number) { + * return createFieldValidator(coordinate => ({ + * key: "MinX", + * valid: coordinate.x >= minX, + * message: `Minimum X is ${minX}` + * })) + * } * - * const myClassConstructor: Class = MyClass; - * const instance = new myClassConstructor('hello', 42); - * // Creates an instance of MyClass + * // Coordinate class definition + * class Consumer { + * \@MinX(10) + * coordinate: Coordinate; // primitive, doesn't validate recursively + * } + * + * const engine = new ValidationEngine(Consumer); + * const payload = { coordinate: { x: 9, y: 23 } }; + * const { errors } = engine.validate(payload); + * const coordinateErrors = errors.coordinate; + * console.log(coordinateErrors); // ["Minimum X is 10"] + * ``` + * + * @example + * 2: Default behavior - nested field validation is enabled for `Coordinate` class. It uses `\@attribute` for supplying validation engine with the runtime schema representation of the decorated field (if \@attribute is not defined then a type mismatch occurs between runtime type and compiled type) + * ```ts + * // coordinate.ts + * import { collection } from "tdv-core"; + * + * export class Coordinate { + * \@collection.number.ValueMin(10, { message: "Minimum X is 10" }) + * x: number; + * y: number; + * } + * ``` + * + *
+ * + * ```ts + * // consumer.ts - model class which holds Coordinate property + * import { attribute, Localization, Form, Utilities } from "tdv-core"; + * + * class Consumer { + * \@attribute(Coordinate) // enables deep validation + * coordinate: Coordinate; // non-primitive + * } + * + * const engine = new ValidationEngine(Consumer); + * const payload = { coordinate: { x: 9, y: 23 } }; + * const { errors } = engine.validate(payload); + * const coordinateErrors = errors.coordinate; + * console.log(coordinateErrors); // { root: [], data: { x: ["Minimum X is 10"], y: [] } } * ``` */ -export type Class = (new (...args: any[]) => T) & {}; +export interface PrimitiveSet {} -/** - * Unwraps a Promise type to its resolved value type. - * @typeParam T - The type to unwrap. - */ -export type UnwrapPromise = T extends Promise ? U : T; +export namespace Types { + /** + * Represents the JavaScript `Function` type. + */ + export type FunctionType = (() => any) & {}; -/** - * Unwraps a Class type to its instance type. - * @typeParam T - The type to unwrap. - */ -export type UnwrapClass = T extends Class ? U : never; + /** + * Represents the generic array type. + */ + export type ArrayType = any[]; -/** - * Unwraps a MetaStrategy type to its inferred class. - * @typeParam TStrategy - The MetaStrategy type to unwrap. - */ -export type UnwrapMetaStrategy = - TStrategy extends Class ? TInferredClass : any; + /** + * Represents primitive data types including `string`, `number`, `boolean`, + * `bigint`, `Date`, and custom primitives defined in `PrimitiveSetAppend`. + */ + export type PrimitiveType = [ + ...[string, number, boolean, bigint, Date], + ...(PrimitiveSet extends { + values: infer CustomPrimitives extends readonly unknown[]; + } + ? CustomPrimitives + : []) + ]; -/** - * Prettifies a type by retaining the same shape. - * @typeParam T - The type to prettify. - */ -export type Prettify = { - [K in keyof T]: T[K]; -} & {}; + /** + * Represents a class constructor that can create instances of type `T`. + * + * @typeParam T - The type to be instantiated by the class constructor. + * + * @example + * ```typescript + * class MyClass { + * constructor(arg1: string, arg2: number) { + * // ... + * } + * } + * + * const myClassConstructor: Class = MyClass; + * const instance = new myClassConstructor('hello', 42); + * // Creates an instance of MyClass + * ``` + */ + export type Class = (new (...args: any[]) => T) & {}; + + /** + * Unwraps a Promise type to its resolved value type. + * @typeParam T - The type to unwrap. + */ + export type UnwrapPromise = T extends Promise ? U : T; + + /** + * Unwraps a Class type to its instance type. + * @typeParam T - The type to unwrap. + */ + export type UnwrapClass = T extends Class ? U : never; + + /** + * Prettifies a type by retaining the same shape. + * @typeParam T - The type to prettify. + */ + export type Prettify = { + [K in keyof T]: T[K]; + } & {}; +} diff --git a/packages/core/src/utilities/index.ts b/packages/core/src/utilities/index.ts index 6704936d2..ada48ae01 100644 --- a/packages/core/src/utilities/index.ts +++ b/packages/core/src/utilities/index.ts @@ -1,6 +1,7 @@ -export * as Arrays from "./impl/Arrays"; -export * as Booleans from "./impl/Booleans"; -export * as Objects from "./impl/Objects"; -export * as Strings from "./impl/Strings"; -export * as Types from "./impl/Types"; +export * from "./impl/Arrays"; +export * from "./impl/Booleans"; +export * from "./impl/Classes"; +export * from "./impl/Objects"; +export * from "./impl/Strings"; +export * from "./impl/Types"; export * from "./misc/EventEmitter"; diff --git a/packages/core/src/utilities/misc/EventEmitter.ts b/packages/core/src/utilities/misc/EventEmitter.ts index bcd645b86..67f45433a 100644 --- a/packages/core/src/utilities/misc/EventEmitter.ts +++ b/packages/core/src/utilities/misc/EventEmitter.ts @@ -1,10 +1,7 @@ -import TdvCoreApi from "../../index"; - -/** - * Event emitter class. - */ +/** Event emitter class. */ export class EventEmitter { #id: string; + #asyncDelay: number; public static EMPTY = new EventEmitter("EMPTY"); private readonly events: Map void>>; private readonly handlersTimeout: Map; @@ -13,10 +10,11 @@ export class EventEmitter { return this.#id; } - constructor(id: string) { + constructor(id: string, asyncDelay: number = 500) { this.events = new Map(); this.handlersTimeout = new Map(); this.#id = id; + this.#asyncDelay = asyncDelay; } emit(event: string, data?: any): void { @@ -28,10 +26,9 @@ export class EventEmitter { if (existingTimeout) { clearTimeout(existingTimeout); } - const timeout = setTimeout( - () => { handler(data); }, - TdvCoreApi.Configuration.asyncValidationDelay - ); + const timeout = setTimeout(() => { + handler(data); + }, this.#asyncDelay); this.handlersTimeout.set(handlerKey, timeout); }); } diff --git a/packages/core/src/validation/index.ts b/packages/core/src/validation/index.ts index 1c7cfe200..bbb6882f8 100644 --- a/packages/core/src/validation/index.ts +++ b/packages/core/src/validation/index.ts @@ -1,85 +1,5 @@ -import type API from "../index"; - (Symbol as any).metadata ??= Symbol("Symbol.metadata"); -export * from "./models"; - -/** - * Represents a function that evaluates a value and returns a validation result. - * - * @typeParam T - The type of the value being evaluated. - */ -export type ValidationEvaluator = (( - value: T, - context: any, - locale: API.Localization.Locale, - args: API.Decorator.DecoratorArgs -) => ValidationResult | Promise) & {}; - -/** - * Represents metadata for a validation rule, including the associated validation groups and the evaluator function. - * - * @typeParam T - The type of the value being evaluated. - */ -export type ValidationMetadataEntry = { - groups: string[]; - validate: ValidationEvaluator; -}; - -/** - * Represents the result of a validation, including the key, message, and whether it's valid. - */ -export type ValidationResult = { - key: string; - message: string; - valid: boolean; -}; +export * from "./types"; -/** - * Defines the properties for an async event response. - * @typeParam TClass - The type of the class being validated. - */ -export type AsyncEventResponseProps = { - errors: API.Strategy.Impl.Errors; - detailedErrors: API.Strategy.Impl.DetailedErrors; - globalErrors: API.Validation.ValidationResult[]; -}; - -/** - * Defines the properties for an async event handler. - * @typeParam TClass - The type of the class being validated. - */ -export type AsyncEventHandlerProps = { - key: keyof TClass; - value: ValidationResult; -}; - -/** - * Type for the async event handler function. - * @typeParam TClass - The type of the class being validated. - */ -export type AsyncEventHandler = ((data: AsyncEventHandlerProps) => void) & {}; - -/** - * Configuration options for entity processing. - * - * @typeParam TClass - The type of the default value. - */ -export type FormConfig = { - defaultValue?: API.Utilities.Objects.Payload; - groups?: string[]; - locale?: API.Localization.Locale; - asyncDelay?: number; -}; - -/** - * The result of entity validation. - * - * @typeParam T - The type of the entity being validated. - */ -export type FormValidateResponse = { - valid: boolean; - detailedErrors: API.Strategy.Impl.DetailedErrors; - errors: API.Strategy.Impl.Errors; - globalErrors: API.Validation.ValidationResult[]; -}; +export * from "./models"; diff --git a/packages/core/src/validation/models/Cache.ts b/packages/core/src/validation/models/Cache.ts index 2babab461..c9a46855d 100644 --- a/packages/core/src/validation/models/Cache.ts +++ b/packages/core/src/validation/models/Cache.ts @@ -1,4 +1,4 @@ -import API from "../../../index"; +import { Objects } from "@utilities"; /** * A generic caching utility class used by `ValidationEngine`. @@ -70,12 +70,9 @@ export class Cache { * * @private */ - #fromCache( - payload: Payload, - cacheKey: CacheKey - ): CacheValue[CacheKey] { + #fromCache(payload: Payload, cacheKey: CacheKey): CacheValue[CacheKey] { const cacheValue: CacheValue[CacheKey] = this.#cache[cacheKey]; - return cacheValue !== undefined && API.Utilities.Objects.deepEquals(this.#payload, payload) + return cacheValue !== undefined && Objects.deepEquals(this.#payload, payload) ? cacheValue : this.#changeFn(payload)[cacheKey]; } diff --git a/packages/core/src/validation/models/Form.ts b/packages/core/src/validation/models/Form.ts index fb2849401..c41c2a30e 100644 --- a/packages/core/src/validation/models/Form.ts +++ b/packages/core/src/validation/models/Form.ts @@ -1,8 +1,77 @@ -import API from "../../index"; -import { ValidationMetadata } from "../../reflection/models/ValidationMetadata"; -import { EventEmitter } from "../../utilities/misc/EventEmitter"; -import { Cache } from "./Cache"; -import { Events } from "./Events"; +import { Locale, getLocale } from "@localization"; +import { ClassValidatorMetaService } from "@reflection/service/impl/ClassValidatorMetaService"; +import { FieldValidatorMetaService } from "@reflection/service/impl/FieldValidatorMetaService"; +import { DetailedErrorsResponse, SimpleErrorsResponse, getStrategyResult } from "@strategy"; +import { EventEmitter, Objects, Types } from "@utilities"; +import { Cache } from "@validation/models/Cache"; +import { Events } from "@validation/models/Events"; +import { ValidationMetadata } from "@validation/models/ValidationMetadata"; +import type { + AsyncEventHandler, + AsyncEventHandlerProps, + AsyncEventResponseProps, + FormConfig, + FormValidateResponse, + ValidationResult, +} from "@validation/types"; +/** + * Checks if an error object has errors. + * @typeParam T - The type of the errors. + */ +export function hasErrors(data: SimpleErrorsResponse): boolean { + const data0: any = data; + if (Array.isArray(data0)) { + return data0.some(item => hasErrors(item)); + } else if (typeof data0 === "object" && data0 !== null) { + return Object.values(data0).some((value: any) => hasErrors(value)); + } else if (typeof data0 === "string") { + return true; + } + return false; +} + +/** + * Transforms a plain object into an instance of the given class. + * @param clazz - The class to transform the object into. + * @param object - The object to transform. + * @typeParam TClass - The type of the class. + * @returns An instance of TClass. + */ +export function toClass>( + clazz: TClass, + object?: Objects.Payload> +): Types.UnwrapClass { + function _toClass>( + clazz: TConstructor, + object?: Objects.Payload> | Types.ArrayType + ): Types.UnwrapClass { + if (Array.isArray(object)) { + return object.map(item => _toClass(clazz, item)) as Types.UnwrapClass; + } + + const entries = Object.entries(object ?? {}); + const meta = FieldValidatorMetaService.inject(clazz, EventEmitter.EMPTY); + const data: any = {}; + for (const [key, value] of entries) { + const descriptor = meta.getUntypedDescriptor(key); + const { thisClass } = descriptor; + if (thisClass) { + if (Array.isArray(value)) { + data[key] = value.map(item => _toClass(thisClass, item)); + } else { + data[key] = toClass(thisClass, value); + } + } else { + data[key] = value; + } + } + + const instance = new clazz(); + Object.entries(data).forEach(([k, v]) => (instance[k] = v)); + return instance; + } + return _toClass(clazz, object); +} /** * A class responsible for processing and validating class instances through its decorated validators. @@ -16,19 +85,19 @@ import { Events } from "./Events"; */ export class Form { __id: string; - locale: API.Localization.Locale; - #eventListener?: API.Validation.AsyncEventHandler; + locale: Locale; + #eventListener?: AsyncEventHandler; #eventEmitter: EventEmitter; - #fieldValidatorMetaService: API.Reflection.FieldValidatorMetaService; + #fieldValidatorMetaService: FieldValidatorMetaService; // @ts-expect-error - #classValidatorMetaService: API.Reflection.ClassValidatorMetaService; + #classValidatorMetaService: ClassValidatorMetaService; #groups: string[]; - #defaultValue: API.Utilities.Objects.Payload; - #cache: Cache>; - #hostClass: API.Utilities.Types.Class; + #defaultValue: Objects.Payload; + #cache: Cache>; + #hostClass: Types.Class; #asyncDelay: number; #debounceMap: { - [key in keyof TClass]: ReturnType; + [key in keyof TClass]: ReturnType; } = {} as any; public get async() { @@ -52,27 +121,16 @@ export class Form { * @param clazz - The class type to be processed. * @param config - Optional configuration settings. */ - constructor( - clazz: API.Utilities.Types.Class, - config?: API.Validation.FormConfig - ) { + constructor(clazz: Types.Class, config?: FormConfig) { this.#asyncDelay = config?.asyncDelay ?? 500; this.__id = Math.random().toString(36).substring(2, 8); - this.#eventEmitter = new EventEmitter(this.__id); + this.#eventEmitter = new EventEmitter(this.__id, this.#asyncDelay); this.#hostClass = clazz; - this.locale = config?.locale ?? API.Localization.getLocale(); + this.locale = config?.locale ?? getLocale(); this.#groups = Array.from(new Set(config?.groups ?? [])); - this.#defaultValue = - config?.defaultValue ?? - (API.Utilities.Objects.toClass(clazz) as API.Utilities.Objects.Payload); - this.#fieldValidatorMetaService = API.Reflection.FieldValidatorMetaService.inject( - clazz, - this.#eventEmitter - ); - this.#classValidatorMetaService = API.Reflection.ClassValidatorMetaService.inject( - clazz, - this.#eventEmitter - ); + this.#defaultValue = config?.defaultValue ?? (toClass(clazz) as Objects.Payload); + this.#fieldValidatorMetaService = FieldValidatorMetaService.inject(clazz, this.#eventEmitter); + this.#classValidatorMetaService = ClassValidatorMetaService.inject(clazz, this.#eventEmitter); this.#cache = new Cache(state => this.validate.bind(this)(state)); } @@ -83,7 +141,7 @@ export class Form { * * @returns `true` if valid, `false` otherwise. */ - public isValid(payload: API.Utilities.Objects.Payload): boolean { + public isValid(payload: Objects.Payload): boolean { return this.#cache.get("valid", payload); } @@ -94,9 +152,7 @@ export class Form { * * @returns An object containing detailed error messages. */ - public getDetailedErrors( - payload?: API.Utilities.Objects.Payload - ): API.Strategy.Impl.DetailedErrors { + public getDetailedErrors(payload?: Objects.Payload): DetailedErrorsResponse { return this.#cache.get("detailedErrors", payload); } @@ -107,15 +163,11 @@ export class Form { * * @returns An object containing error messages. */ - public getErrors( - payload?: API.Utilities.Objects.Payload - ): API.Strategy.Impl.Errors { + public getErrors(payload?: Objects.Payload): SimpleErrorsResponse { return this.#cache.get("errors", payload); } - public getGlobalErrors( - payload?: API.Utilities.Objects.Payload - ): API.Validation.ValidationResult[] { + public getGlobalErrors(payload?: Objects.Payload): ValidationResult[] { return this.#cache.get("globalErrors", payload); } @@ -147,14 +199,8 @@ export class Form { * console.log(result.valid); // Output: true or false * ``` */ - public validate( - payload?: API.Utilities.Objects.Payload, - args: API.Decorator.DecoratorArgs = {} - ): API.Validation.FormValidateResponse { - const state: API.Utilities.Objects.Payload = API.Utilities.Objects.toClass( - this.#hostClass, - payload - ) as any; + public validate(payload?: Objects.Payload, args: Record = {}): FormValidateResponse { + const state: Objects.Payload = toClass(this.#hostClass, payload) as any; const errors: any = {}; const detailedErrors: any = {}; @@ -178,7 +224,7 @@ export class Form { return this.#cache.patch( { - valid: !API.Utilities.Objects.hasErrors(errors), + valid: !hasErrors(errors), detailedErrors, errors, globalErrors: classValidationErrors, @@ -217,14 +263,10 @@ export class Form { */ #validateField( fieldName: K, - // @ts-expect-error - payload: API.Utilities.Objects.Payload[K], - args: API.Decorator.DecoratorArgs = {} - ): API.Strategy.getStrategyResult { - const descriptor = this.#fieldValidatorMetaService.getUntypedDescriptor( - fieldName, - this.#eventEmitter - ); + payload: Objects.Payload[K], + args: Record = {} + ): getStrategyResult { + const descriptor = this.#fieldValidatorMetaService.getUntypedDescriptor(fieldName, this.#eventEmitter); const stratImpl = new descriptor.StrategyImpl( descriptor, this.#defaultValue, @@ -235,30 +277,26 @@ export class Form { if (descriptor.strategy === "function") { if (!this.#debounceMap[fieldName]) { - this.#debounceMap[fieldName] = API.Utilities.Objects.debounce( - (value: any, context: any) => { - stratImpl.test(value, context, args); - }, - this.#asyncDelay - ); + this.#debounceMap[fieldName] = Objects.debounce((value: any, context: any) => { + stratImpl.test(value, context, args); + }, this.#asyncDelay); } - // @ts-expect-error this.#debounceMap[fieldName](payload[fieldName], payload, args); return [ (this.#cache.get("detailedErrors") as any)?.[fieldName], (this.#cache.get("errors") as any)?.[fieldName], - ] as API.Strategy.getStrategyResult; + ] as getStrategyResult; } // @ts-expect-error We expect error here due to the nature of arbitrary types depending on the different types of fields (primitive, object, primitive array, object array and so on...) return stratImpl.test(payload[fieldName], payload, args); } - #registerAsync(handler: (props: API.Validation.AsyncEventResponseProps) => void): void { + #registerAsync(handler: (props: AsyncEventResponseProps) => void): void { this.#unregisterAsync(); - this.#eventListener = ({ key, value }: API.Validation.AsyncEventHandlerProps) => { + this.#eventListener = ({ key, value }: AsyncEventHandlerProps) => { const { valid } = value; const currentErrors: any = this.#cache.get("errors"); const currentDetailedErrors: any = this.#cache.get("detailedErrors"); @@ -266,7 +304,7 @@ export class Form { if (key) { let simpleResults = currentErrors[key] as string[]; - let detailedResults = currentDetailedErrors[key] as API.Validation.ValidationResult[]; + let detailedResults = currentDetailedErrors[key] as ValidationResult[]; if (valid) { detailedResults = detailedResults.filter(r => r.key !== value.key); diff --git a/packages/core/src/reflection/models/ValidationMetadata.ts b/packages/core/src/validation/models/ValidationMetadata.ts similarity index 78% rename from packages/core/src/reflection/models/ValidationMetadata.ts rename to packages/core/src/validation/models/ValidationMetadata.ts index f02a9f045..c5abe4476 100644 --- a/packages/core/src/reflection/models/ValidationMetadata.ts +++ b/packages/core/src/validation/models/ValidationMetadata.ts @@ -1,7 +1,7 @@ -import type API from "../../index"; -import { type EventEmitter } from "../../utilities/misc/EventEmitter"; -import { ValidationResult, type ValidationMetadataEntry } from "../../validation"; -import { Events } from "../../validation/models/Events"; +import { Locale } from "@localization"; +import { EventEmitter, Objects } from "@utilities"; +import { Events } from "@validation/models/Events"; +import type { ValidationMetadataEntry, ValidationResult } from "@validation/types"; /** * Manages a collection of validation rules for a specific field. @@ -44,10 +44,10 @@ export class ValidationMetadata { */ validate( value: TFieldType, - payload: API.Utilities.Objects.Payload, + payload: Objects.Payload, groups: string[], - locale: API.Localization.Locale, - args?: API.Decorator.DecoratorArgs, + locale: Locale, + args?: Record, emitter?: EventEmitter, field?: string ): ValidationResult[] { @@ -56,20 +56,14 @@ export class ValidationMetadata { } const groupedValidators = this.#groupedValidators(this.#contents, groups); - const results = groupedValidators.map(({ validate }) => - validate(value, payload, locale, args ?? {}) - ); - const asyncResults = results.filter(v => isPromise(v)) as Array>; + const results = groupedValidators.map(({ validate }) => validate(value, payload, locale, args ?? {})); + const asyncResults = results.filter(v => isPromise(v)) as Promise[]; this.#handleAsyncResults(asyncResults, emitter, field); const syncResults = results.filter(v => !isPromise(v)) as ValidationResult[]; return syncResults.filter(({ valid }) => !valid); } - #handleAsyncResults( - asyncResults: Array>, - emitter?: EventEmitter, - field?: string - ) { + #handleAsyncResults(asyncResults: Array>, emitter?: EventEmitter, field?: string) { if (!emitter) return; Promise.all(asyncResults).then(results => { results.forEach(value => { @@ -111,7 +105,7 @@ export class ValidationMetadata { groups: string[] ): Array> { return data.filter((meta: ValidationMetadataEntry) => - groups.length > 0 ? meta.groups.some(o => groups.includes(o)) : meta.groups.length === 0 + groups.length > 0 ? meta.groups.some((o: any) => groups.includes(o)) : meta.groups.length === 0 ); } } diff --git a/packages/core/src/validation/models/index.ts b/packages/core/src/validation/models/index.ts index 92b9313e7..e40ce0d01 100644 --- a/packages/core/src/validation/models/index.ts +++ b/packages/core/src/validation/models/index.ts @@ -1,3 +1,7 @@ export * from "./Cache"; + export * from "./Events"; + export * from "./Form"; + +export * from "./ValidationMetadata"; diff --git a/packages/core/src/validation/types.ts b/packages/core/src/validation/types.ts new file mode 100644 index 000000000..23c51563e --- /dev/null +++ b/packages/core/src/validation/types.ts @@ -0,0 +1,83 @@ +import { Locale } from "@localization"; +import type { DetailedErrorsResponse, SimpleErrorsResponse } from "@strategy"; +import { Objects } from "@utilities"; + +/** + * Represents a function that evaluates a value and returns a validation result. + * + * @typeParam T - The type of the value being evaluated. + */ +export type ValidationEvaluator = (( + value: T, + context: any, + locale: Locale, + args: Record +) => ValidationResult | Promise) & {}; + +/** + * Represents metadata for a validation rule, including the associated validation groups and the evaluator function. + * + * @typeParam T - The type of the value being evaluated. + */ +export type ValidationMetadataEntry = { + groups: string[]; + validate: ValidationEvaluator; +}; + +/** + * Represents the result of a validation, including the key, message, and whether it's valid. + */ +export type ValidationResult = { + key: string; + message: string; + valid: boolean; +}; + +/** + * Defines the properties for an async event response. + * @typeParam TClass - The type of the class being validated. + */ +export type AsyncEventResponseProps = { + errors: SimpleErrorsResponse; + detailedErrors: DetailedErrorsResponse; + globalErrors: ValidationResult[]; +}; + +/** + * Defines the properties for an async event handler. + * @typeParam TClass - The type of the class being validated. + */ +export type AsyncEventHandlerProps = { + key: keyof TClass; + value: ValidationResult; +}; + +/** + * Type for the async event handler function. + * @typeParam TClass - The type of the class being validated. + */ +export type AsyncEventHandler = ((data: AsyncEventHandlerProps) => void) & {}; + +/** + * Configuration options for entity processing. + * + * @typeParam TClass - The type of the default value. + */ +export type FormConfig = { + defaultValue?: Objects.Payload; + groups?: string[]; + locale?: Locale; + asyncDelay?: number; +}; + +/** + * The result of entity validation. + * + * @typeParam T - The type of the entity being validated. + */ +export type FormValidateResponse = { + valid: boolean; + detailedErrors: DetailedErrorsResponse; + errors: SimpleErrorsResponse; + globalErrors: ValidationResult[]; +}; diff --git a/packages/core/tests/common/TestFactory.ts b/packages/core/tests/common/TestFactory.ts index a7eabca7a..6e5dd9386 100644 --- a/packages/core/tests/common/TestFactory.ts +++ b/packages/core/tests/common/TestFactory.ts @@ -1,5 +1,5 @@ -import { Types } from "../../src/utilities"; -import { Form } from "../../src/validation"; +import { Types } from "@src/utilities"; +import { Form } from "@src/validation"; import ValidationHandlerMock, { IMock, buildIOName } from "./ValidationHandlerMock"; export type StandardTestProps = { @@ -10,13 +10,7 @@ export type StandardTestProps = { errorData: T[]; }; -export function standardTest({ - Model, - identifier, - successData, - errorData, - type, -}: StandardTestProps) { +export function standardTest({ Model, identifier, successData, errorData, type }: StandardTestProps) { const handler = new Form(Model as any); const expectService = new ValidationHandlerMock(handler as any); diff --git a/packages/core/tests/common/ValidationHandlerMock.ts b/packages/core/tests/common/ValidationHandlerMock.ts index 17fd7a3dd..7871b7f26 100644 --- a/packages/core/tests/common/ValidationHandlerMock.ts +++ b/packages/core/tests/common/ValidationHandlerMock.ts @@ -1,4 +1,4 @@ -import { Form } from "../../src/validation"; +import { Form } from "@src/validation"; export interface IMock { value: T; diff --git a/packages/core/tests/impl/any/Required.test.ts b/packages/core/tests/impl/any/Required.test.ts index 16d501579..bd8595d43 100644 --- a/packages/core/tests/impl/any/Required.test.ts +++ b/packages/core/tests/impl/any/Required.test.ts @@ -1,7 +1,7 @@ -import * as Objects from "../../../src/utilities/impl/Objects"; +import { IMock } from "@common/ValidationHandlerMock"; +import { Required } from "@src/decorators"; +import * as Objects from "@src/utilities/impl/Objects"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; -import { Required } from "./../../../src/decorators"; /*** Data ***/ type Type = Objects.Optional; diff --git a/packages/core/tests/impl/any/attribute.test.ts b/packages/core/tests/impl/any/attribute.test.ts index 51a962b23..d0e77ce7a 100644 --- a/packages/core/tests/impl/any/attribute.test.ts +++ b/packages/core/tests/impl/any/attribute.test.ts @@ -1,6 +1,6 @@ +import { IMock } from "@common/ValidationHandlerMock"; import $, { attribute, Decorators } from "../../../index"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; /*** Data ***/ type Type = $.Utilities.Objects.Optional; diff --git a/packages/core/tests/impl/any/create.test.ts b/packages/core/tests/impl/any/create.test.ts index f4f68547e..127d0883b 100644 --- a/packages/core/tests/impl/any/create.test.ts +++ b/packages/core/tests/impl/any/create.test.ts @@ -1,7 +1,7 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { createFieldValidator } from "@src/decorators"; import $ from "../../../index"; -import { createFieldValidator } from "../../../src/decorators"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; /*** Data ***/ type Type = $.Utilities.Objects.Optional; diff --git a/packages/core/tests/impl/array/ArrayContains.test.ts b/packages/core/tests/impl/array/ArrayContains.test.ts index 34fc88caf..6c475f2ae 100644 --- a/packages/core/tests/impl/array/ArrayContains.test.ts +++ b/packages/core/tests/impl/array/ArrayContains.test.ts @@ -1,6 +1,6 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { ArrayContains } from "@src/decorators"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; -import { ArrayContains } from "./../../../src/decorators"; const SEARCH_ITEM = 7; const NON_SEARCH_ITEM_STRING = "X"; @@ -12,14 +12,8 @@ const NON_SEARCH_ITEM_NULL = null; type Type = any[]; const type = "Array"; const identifier = "ArrayContains"; -const successData: Type[] = [ - [SEARCH_ITEM], - [NON_SEARCH_ITEM_STRING, NON_SEARCH_ITEM_UNDEFINED, SEARCH_ITEM], -]; -const errorData: Type[] = [ - [], - [NON_SEARCH_ITEM_NUMBER, NON_SEARCH_ITEM_UNDEFINED, NON_SEARCH_ITEM_NULL], -]; +const successData: Type[] = [[SEARCH_ITEM], [NON_SEARCH_ITEM_STRING, NON_SEARCH_ITEM_UNDEFINED, SEARCH_ITEM]]; +const errorData: Type[] = [[], [NON_SEARCH_ITEM_NUMBER, NON_SEARCH_ITEM_UNDEFINED, NON_SEARCH_ITEM_NULL]]; /*** Model ***/ class Model implements IMock { diff --git a/packages/core/tests/impl/array/ArrayEmpty.test.ts b/packages/core/tests/impl/array/ArrayEmpty.test.ts index 2565f6bbc..038677c45 100644 --- a/packages/core/tests/impl/array/ArrayEmpty.test.ts +++ b/packages/core/tests/impl/array/ArrayEmpty.test.ts @@ -1,6 +1,6 @@ -import { ArrayEmpty } from "../../../src/decorators"; +import { IMock } from "@common/ValidationHandlerMock"; +import { ArrayEmpty } from "@src/decorators"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; /*** Data ***/ type Type = any[]; diff --git a/packages/core/tests/impl/array/ArrayEvery.test.ts b/packages/core/tests/impl/array/ArrayEvery.test.ts index 7a74419fc..f6758655e 100644 --- a/packages/core/tests/impl/array/ArrayEvery.test.ts +++ b/packages/core/tests/impl/array/ArrayEvery.test.ts @@ -1,6 +1,6 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { ArrayEvery } from "@src/decorators"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; -import { ArrayEvery } from "./../../../src/decorators"; /*** Data ***/ type Type = string[]; diff --git a/packages/core/tests/impl/array/ArrayNone.test.ts b/packages/core/tests/impl/array/ArrayNone.test.ts index bb6fa89b0..b00cac7f7 100644 --- a/packages/core/tests/impl/array/ArrayNone.test.ts +++ b/packages/core/tests/impl/array/ArrayNone.test.ts @@ -1,6 +1,6 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { ArrayNone } from "@src/decorators"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; -import { ArrayNone } from "./../../../src/decorators"; /*** Data ***/ type Type = string[]; diff --git a/packages/core/tests/impl/array/ArrayOne.test.ts b/packages/core/tests/impl/array/ArrayOne.test.ts index cbaf789c4..cbf961b13 100644 --- a/packages/core/tests/impl/array/ArrayOne.test.ts +++ b/packages/core/tests/impl/array/ArrayOne.test.ts @@ -1,6 +1,6 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { ArrayOne } from "@src/decorators"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; -import { ArrayOne } from "./../../../src/decorators"; /*** Data ***/ type Type = string[]; diff --git a/packages/core/tests/impl/array/ArraySizeExact.test.ts b/packages/core/tests/impl/array/ArraySizeExact.test.ts index 3a4bc28e8..097dec939 100644 --- a/packages/core/tests/impl/array/ArraySizeExact.test.ts +++ b/packages/core/tests/impl/array/ArraySizeExact.test.ts @@ -1,6 +1,6 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { ArraySizeExact } from "@src/decorators"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; -import { ArraySizeExact } from "./../../../src/decorators"; /*** Data ***/ type Type = string[]; diff --git a/packages/core/tests/impl/array/ArraySizeMax.test.ts b/packages/core/tests/impl/array/ArraySizeMax.test.ts index 5ab775392..cd007b06a 100644 --- a/packages/core/tests/impl/array/ArraySizeMax.test.ts +++ b/packages/core/tests/impl/array/ArraySizeMax.test.ts @@ -1,6 +1,6 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { ArraySizeMax } from "@src/decorators"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; -import { ArraySizeMax } from "./../../../src/decorators"; /*** Data ***/ type Type = string[]; diff --git a/packages/core/tests/impl/array/ArraySizeMin.test.ts b/packages/core/tests/impl/array/ArraySizeMin.test.ts index ac85c6be7..a2e784f80 100644 --- a/packages/core/tests/impl/array/ArraySizeMin.test.ts +++ b/packages/core/tests/impl/array/ArraySizeMin.test.ts @@ -1,6 +1,6 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { ArraySizeMin } from "@src/decorators"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; -import { ArraySizeMin } from "./../../../src/decorators"; /*** Data ***/ type Type = string[]; diff --git a/packages/core/tests/impl/array/ArraySizeRange.test.ts b/packages/core/tests/impl/array/ArraySizeRange.test.ts index 7c81fa431..4a2cf670c 100644 --- a/packages/core/tests/impl/array/ArraySizeRange.test.ts +++ b/packages/core/tests/impl/array/ArraySizeRange.test.ts @@ -1,6 +1,6 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { ArraySizeRange } from "@src/decorators"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; -import { ArraySizeRange } from "./../../../src/decorators"; /*** Data ***/ type Type = string[]; diff --git a/packages/core/tests/impl/array/ArraySome.test.ts b/packages/core/tests/impl/array/ArraySome.test.ts index 9869e10b6..e6b1f234d 100644 --- a/packages/core/tests/impl/array/ArraySome.test.ts +++ b/packages/core/tests/impl/array/ArraySome.test.ts @@ -1,6 +1,6 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { ArraySome } from "@src/decorators"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; -import { ArraySome } from "./../../../src/decorators"; /*** Data ***/ type Type = string[]; diff --git a/packages/core/tests/impl/array/ArrayUnique.test.ts b/packages/core/tests/impl/array/ArrayUnique.test.ts index 485ca348b..23b69dab3 100644 --- a/packages/core/tests/impl/array/ArrayUnique.test.ts +++ b/packages/core/tests/impl/array/ArrayUnique.test.ts @@ -1,6 +1,6 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { ArrayUnique } from "@src/decorators"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; -import { ArrayUnique } from "./../../../src/decorators"; /*** Data ***/ type Type = string[]; diff --git a/packages/core/tests/impl/array/foreach.test.ts b/packages/core/tests/impl/array/foreach.test.ts index d1df35a53..2fc9f0a72 100644 --- a/packages/core/tests/impl/array/foreach.test.ts +++ b/packages/core/tests/impl/array/foreach.test.ts @@ -1,7 +1,6 @@ -import { Required } from "../../../src/decorators"; +import { IMock } from "@common/ValidationHandlerMock"; +import { Required, foreach } from "@src/decorators"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; -import { foreach } from "./../../../src/decorators"; /*** Data ***/ type Type = string[]; diff --git a/packages/core/tests/impl/boolean/AssertFalse.test.ts b/packages/core/tests/impl/boolean/AssertFalse.test.ts index 459b5e55e..223238f50 100644 --- a/packages/core/tests/impl/boolean/AssertFalse.test.ts +++ b/packages/core/tests/impl/boolean/AssertFalse.test.ts @@ -1,6 +1,6 @@ -import { AssertFalse } from "../../../src/decorators"; +import { IMock } from "@common/ValidationHandlerMock"; +import { AssertFalse } from "@src/decorators"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; /*** Data ***/ type Type = boolean; diff --git a/packages/core/tests/impl/boolean/AssertTrue.test.ts b/packages/core/tests/impl/boolean/AssertTrue.test.ts index c60af2493..2d4c8648e 100644 --- a/packages/core/tests/impl/boolean/AssertTrue.test.ts +++ b/packages/core/tests/impl/boolean/AssertTrue.test.ts @@ -1,6 +1,6 @@ -import { AssertTrue } from "../../../src/decorators"; +import { IMock } from "@common/ValidationHandlerMock"; +import { AssertTrue } from "@src/decorators"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; /*** Data ***/ type Type = boolean; diff --git a/packages/core/tests/impl/date/FutureDate.test.ts b/packages/core/tests/impl/date/FutureDate.test.ts index 45f04ffe6..705d652ca 100644 --- a/packages/core/tests/impl/date/FutureDate.test.ts +++ b/packages/core/tests/impl/date/FutureDate.test.ts @@ -1,7 +1,7 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { FutureDate } from "@src/decorators"; import $ from "../../../index"; -import { FutureDate } from "../../../src/decorators"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; const NEG_INFINITY = new Date(1990, 0, 1); const POS_INFINITY = new Date(2099, 11, 31); diff --git a/packages/core/tests/impl/date/PastDate.test.ts b/packages/core/tests/impl/date/PastDate.test.ts index a8bb5bad3..f435161ac 100644 --- a/packages/core/tests/impl/date/PastDate.test.ts +++ b/packages/core/tests/impl/date/PastDate.test.ts @@ -1,7 +1,7 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { PastDate } from "@src/decorators"; import $ from "../../../index"; -import { PastDate } from "../../../src/decorators"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; const NEG_INFINITY = new Date(1990, 0, 1); const POS_INFINITY = new Date(2099, 11, 31); diff --git a/packages/core/tests/impl/date/TodayDate.test.ts b/packages/core/tests/impl/date/TodayDate.test.ts index cc5a57348..9e26b9e9d 100644 --- a/packages/core/tests/impl/date/TodayDate.test.ts +++ b/packages/core/tests/impl/date/TodayDate.test.ts @@ -1,7 +1,7 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { TodayDate } from "@src/decorators"; import $ from "../../../index"; -import { TodayDate } from "../../../src/decorators"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; const NEG_INFINITY = new Date(1990, 0, 1); const POS_INFINITY = new Date(2099, 11, 31); diff --git a/packages/core/tests/impl/number/Decimal.test.ts b/packages/core/tests/impl/number/Decimal.test.ts index 76e559dd9..f3eb8e8fd 100644 --- a/packages/core/tests/impl/number/Decimal.test.ts +++ b/packages/core/tests/impl/number/Decimal.test.ts @@ -1,7 +1,7 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { Decimal } from "@src/decorators"; import $ from "../../../index"; -import { Decimal } from "../../../src/decorators"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; /*** Data ***/ type Type = $.Utilities.Objects.Optional; diff --git a/packages/core/tests/impl/number/Digits.test.ts b/packages/core/tests/impl/number/Digits.test.ts index 3a8fb7712..70844669a 100644 --- a/packages/core/tests/impl/number/Digits.test.ts +++ b/packages/core/tests/impl/number/Digits.test.ts @@ -1,7 +1,7 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { Digits } from "@src/decorators"; import $ from "../../../index"; -import { Digits } from "../../../src/decorators"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; /*** Data ***/ type Type = $.Utilities.Objects.Optional; diff --git a/packages/core/tests/impl/number/Integer.test.ts b/packages/core/tests/impl/number/Integer.test.ts index 6545f577f..cfa3fe860 100644 --- a/packages/core/tests/impl/number/Integer.test.ts +++ b/packages/core/tests/impl/number/Integer.test.ts @@ -1,7 +1,7 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { Integer } from "@src/decorators"; import $ from "../../../index"; -import { Integer } from "../../../src/decorators"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; /*** Data ***/ type Type = $.Utilities.Objects.Optional; diff --git a/packages/core/tests/impl/number/Negative.test.ts b/packages/core/tests/impl/number/Negative.test.ts index 0233b267d..9e9f6cb51 100644 --- a/packages/core/tests/impl/number/Negative.test.ts +++ b/packages/core/tests/impl/number/Negative.test.ts @@ -1,7 +1,7 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { Negative } from "@src/decorators"; import $ from "../../../index"; -import { Negative } from "../../../src/decorators"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; /*** Data ***/ type Type = $.Utilities.Objects.Optional; diff --git a/packages/core/tests/impl/number/NonNegative.test.ts b/packages/core/tests/impl/number/NonNegative.test.ts index 8bfdd5eaa..c4554c777 100644 --- a/packages/core/tests/impl/number/NonNegative.test.ts +++ b/packages/core/tests/impl/number/NonNegative.test.ts @@ -1,7 +1,7 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { NonNegative } from "@src/decorators"; import $ from "../../../index"; -import { NonNegative } from "../../../src/decorators"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; /*** Data ***/ type Type = $.Utilities.Objects.Optional; diff --git a/packages/core/tests/impl/number/NonPositive.test.ts b/packages/core/tests/impl/number/NonPositive.test.ts index 7d65a7d40..256ba6c28 100644 --- a/packages/core/tests/impl/number/NonPositive.test.ts +++ b/packages/core/tests/impl/number/NonPositive.test.ts @@ -1,7 +1,7 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { NonPositive } from "@src/decorators"; import $ from "../../../index"; -import { NonPositive } from "../../../src/decorators"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; /*** Data ***/ type Type = $.Utilities.Objects.Optional; diff --git a/packages/core/tests/impl/number/Positive.test.ts b/packages/core/tests/impl/number/Positive.test.ts index d5f36dea0..e10353571 100644 --- a/packages/core/tests/impl/number/Positive.test.ts +++ b/packages/core/tests/impl/number/Positive.test.ts @@ -1,7 +1,7 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { Positive } from "@src/decorators"; import $ from "../../../index"; -import { Positive } from "../../../src/decorators"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; /*** Data ***/ type Type = $.Utilities.Objects.Optional; diff --git a/packages/core/tests/impl/number/ValueMax.test.ts b/packages/core/tests/impl/number/ValueMax.test.ts index 145fbebf1..8e0854bc7 100644 --- a/packages/core/tests/impl/number/ValueMax.test.ts +++ b/packages/core/tests/impl/number/ValueMax.test.ts @@ -1,7 +1,7 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { ValueMax } from "@src/decorators"; import $ from "../../../index"; -import { ValueMax } from "../../../src/decorators"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; /*** Data ***/ type Type = $.Utilities.Objects.Optional; diff --git a/packages/core/tests/impl/number/ValueMin.test.ts b/packages/core/tests/impl/number/ValueMin.test.ts index 8bcda85df..593a1fcb8 100644 --- a/packages/core/tests/impl/number/ValueMin.test.ts +++ b/packages/core/tests/impl/number/ValueMin.test.ts @@ -1,7 +1,7 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { ValueMin } from "@src/decorators"; import $ from "../../../index"; -import { ValueMin } from "../../../src/decorators"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; /*** Data ***/ type Type = $.Utilities.Objects.Optional; diff --git a/packages/core/tests/impl/number/ValueRange.test.ts b/packages/core/tests/impl/number/ValueRange.test.ts index 8244c3917..ffce0dd6e 100644 --- a/packages/core/tests/impl/number/ValueRange.test.ts +++ b/packages/core/tests/impl/number/ValueRange.test.ts @@ -1,7 +1,7 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { ValueRange } from "@src/decorators"; import $ from "../../../index"; -import { ValueRange } from "../../../src/decorators"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; /*** Data ***/ type Type = $.Utilities.Objects.Optional; diff --git a/packages/core/tests/impl/string/ExactLength.test.ts b/packages/core/tests/impl/string/ExactLength.test.ts index 14a9cd01c..1c4f29ea0 100644 --- a/packages/core/tests/impl/string/ExactLength.test.ts +++ b/packages/core/tests/impl/string/ExactLength.test.ts @@ -1,7 +1,7 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { ExactLength } from "@src/decorators"; import $ from "../../../index"; -import { ExactLength } from "../../../src/decorators"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; /*** Data ***/ type Type = $.Utilities.Objects.Optional; diff --git a/packages/core/tests/impl/string/MaxLength.test.ts b/packages/core/tests/impl/string/MaxLength.test.ts index c0331a6b9..71ac748bc 100644 --- a/packages/core/tests/impl/string/MaxLength.test.ts +++ b/packages/core/tests/impl/string/MaxLength.test.ts @@ -1,7 +1,7 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { MaxLength } from "@src/decorators"; import $ from "../../../index"; -import { MaxLength } from "../../../src/decorators"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; /*** Data ***/ type Type = $.Utilities.Objects.Optional; diff --git a/packages/core/tests/impl/string/MinLength.test.ts b/packages/core/tests/impl/string/MinLength.test.ts index 5a83bdc96..0ba3ca628 100644 --- a/packages/core/tests/impl/string/MinLength.test.ts +++ b/packages/core/tests/impl/string/MinLength.test.ts @@ -1,7 +1,7 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { MinLength } from "@src/decorators"; import $ from "../../../index"; -import { MinLength } from "../../../src/decorators"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; /*** Data ***/ type Type = $.Utilities.Objects.Optional; diff --git a/packages/core/tests/impl/string/Password.test.ts b/packages/core/tests/impl/string/Password.test.ts index a9b1d7430..8279cfa68 100644 --- a/packages/core/tests/impl/string/Password.test.ts +++ b/packages/core/tests/impl/string/Password.test.ts @@ -1,24 +1,14 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { Password } from "@src/decorators"; import $ from "../../../index"; -import { Password } from "../../../src/decorators"; import { standardTest } from "../../common/TestFactory"; -import { IMock } from "../../common/ValidationHandlerMock"; /*** Data ***/ type Type = $.Utilities.Objects.Optional; const type = "String"; const identifier = "Password"; const successData: Type[] = ["Test12345!"]; -const errorData: Type[] = [ - "", - null, - undefined, - "12345", - "12345678", - "12345678!", - "12345678!", - "12345678!A", - "123aA!", -]; +const errorData: Type[] = ["", null, undefined, "12345", "12345678", "12345678!", "12345678!", "12345678!A", "123aA!"]; /*** Model ***/ class Model implements IMock { diff --git a/packages/core/tests/impl/string/regex/Pattern.test.ts b/packages/core/tests/impl/string/regex/Pattern.test.ts index 24d945bf1..f36dd8835 100644 --- a/packages/core/tests/impl/string/regex/Pattern.test.ts +++ b/packages/core/tests/impl/string/regex/Pattern.test.ts @@ -1,8 +1,8 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { Pattern } from "@src/decorators"; +import RegexConst from "@src/decorators/data/validators/string/regex/shared/regex.constants"; import $ from "../../../../index"; -import RegexConst from "../../../../src/decorators/data/validators/string/regex/shared/regex.constants"; import { standardTest } from "../../../common/TestFactory"; -import { IMock } from "../../../common/ValidationHandlerMock"; -import { Pattern } from "./../../../../src/decorators"; /*** Data ***/ type Type = $.Utilities.Objects.Optional; diff --git a/packages/core/tests/impl/string/regex/impl/Alpha.test.ts b/packages/core/tests/impl/string/regex/impl/Alpha.test.ts index 3e6b39c10..17995f22a 100644 --- a/packages/core/tests/impl/string/regex/impl/Alpha.test.ts +++ b/packages/core/tests/impl/string/regex/impl/Alpha.test.ts @@ -1,7 +1,7 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { Alpha } from "@src/decorators"; import $ from "../../../../../index"; -import { Alpha } from "../../../../../src/decorators"; import { standardTest } from "../../../../common/TestFactory"; -import { IMock } from "../../../../common/ValidationHandlerMock"; /*** Data ***/ type Type = $.Utilities.Objects.Optional; diff --git a/packages/core/tests/impl/string/regex/impl/Alphanumeric.test.ts b/packages/core/tests/impl/string/regex/impl/Alphanumeric.test.ts index c1bf9d4e1..ab711307b 100644 --- a/packages/core/tests/impl/string/regex/impl/Alphanumeric.test.ts +++ b/packages/core/tests/impl/string/regex/impl/Alphanumeric.test.ts @@ -1,7 +1,7 @@ -import { Alphanumeric } from "../../../../../src/decorators"; -import { Objects } from "../../../../../src/utilities"; +import { IMock } from "@common/ValidationHandlerMock"; +import { Alphanumeric } from "@src/decorators"; +import { Objects } from "@src/utilities"; import { standardTest } from "../../../../common/TestFactory"; -import { IMock } from "../../../../common/ValidationHandlerMock"; /*** Data ***/ type Type = Objects.Optional; diff --git a/packages/core/tests/impl/string/regex/impl/Email.test.ts b/packages/core/tests/impl/string/regex/impl/Email.test.ts index 821f081e4..539ad8bbd 100644 --- a/packages/core/tests/impl/string/regex/impl/Email.test.ts +++ b/packages/core/tests/impl/string/regex/impl/Email.test.ts @@ -1,7 +1,7 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { Email } from "@src/decorators"; import $ from "../../../../../index"; -import { Email } from "../../../../../src/decorators"; import { standardTest } from "../../../../common/TestFactory"; -import { IMock } from "../../../../common/ValidationHandlerMock"; /*** Data ***/ type Type = $.Utilities.Objects.Optional; diff --git a/packages/core/tests/impl/string/regex/impl/IPAddress.test.ts b/packages/core/tests/impl/string/regex/impl/IPAddress.test.ts index d237a83fe..944da84e5 100644 --- a/packages/core/tests/impl/string/regex/impl/IPAddress.test.ts +++ b/packages/core/tests/impl/string/regex/impl/IPAddress.test.ts @@ -1,7 +1,7 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { IPAddress } from "@src/decorators"; import $ from "../../../../../index"; -import { IPAddress } from "../../../../../src/decorators"; import { standardTest } from "../../../../common/TestFactory"; -import { IMock } from "../../../../common/ValidationHandlerMock"; /*** Data ***/ type Type = $.Utilities.Objects.Optional; diff --git a/packages/core/tests/impl/string/regex/impl/Lowercase.test.ts b/packages/core/tests/impl/string/regex/impl/Lowercase.test.ts index bddcfa8aa..e62ecabc5 100644 --- a/packages/core/tests/impl/string/regex/impl/Lowercase.test.ts +++ b/packages/core/tests/impl/string/regex/impl/Lowercase.test.ts @@ -1,7 +1,7 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { Lowercase } from "@src/decorators"; import $ from "../../../../../index"; -import { Lowercase } from "../../../../../src/decorators"; import { standardTest } from "../../../../common/TestFactory"; -import { IMock } from "../../../../common/ValidationHandlerMock"; /*** Data ***/ type Type = $.Utilities.Objects.Optional; diff --git a/packages/core/tests/impl/string/regex/impl/Numeric.test.ts b/packages/core/tests/impl/string/regex/impl/Numeric.test.ts index 452338f5c..05626142b 100644 --- a/packages/core/tests/impl/string/regex/impl/Numeric.test.ts +++ b/packages/core/tests/impl/string/regex/impl/Numeric.test.ts @@ -1,7 +1,7 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { Numeric } from "@src/decorators"; import $ from "../../../../../index"; -import { Numeric } from "../../../../../src/decorators"; import { standardTest } from "../../../../common/TestFactory"; -import { IMock } from "../../../../common/ValidationHandlerMock"; /*** Data ***/ type Type = $.Utilities.Objects.Optional; diff --git a/packages/core/tests/impl/string/regex/impl/URL.test.ts b/packages/core/tests/impl/string/regex/impl/URL.test.ts index 185547122..37e944e5f 100644 --- a/packages/core/tests/impl/string/regex/impl/URL.test.ts +++ b/packages/core/tests/impl/string/regex/impl/URL.test.ts @@ -1,7 +1,7 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { URL } from "@src/decorators"; import $ from "../../../../../index"; -import { URL } from "../../../../../src/decorators"; import { standardTest } from "../../../../common/TestFactory"; -import { IMock } from "../../../../common/ValidationHandlerMock"; /*** Data ***/ type Type = $.Utilities.Objects.Optional; diff --git a/packages/core/tests/impl/string/regex/impl/Uppercase.test.ts b/packages/core/tests/impl/string/regex/impl/Uppercase.test.ts index df526fdc5..5b3c188e1 100644 --- a/packages/core/tests/impl/string/regex/impl/Uppercase.test.ts +++ b/packages/core/tests/impl/string/regex/impl/Uppercase.test.ts @@ -1,7 +1,7 @@ +import { IMock } from "@common/ValidationHandlerMock"; +import { Uppercase } from "@src/decorators"; import $ from "../../../../../index"; -import { Uppercase } from "../../../../../src/decorators"; import { standardTest } from "../../../../common/TestFactory"; -import { IMock } from "../../../../common/ValidationHandlerMock"; /*** Data ***/ type Type = $.Utilities.Objects.Optional; diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index 867ec24e7..55a942f25 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -1,15 +1,8 @@ { - "extends": "./../../tsconfig.json", - "exclude": ["tests", "jest.config.js", "src/main.ts", "dev"], - "files": [], - "include": ["index.ts", "src", "src/localization/translations/*.json", "translations"], + "extends": "../../tsconfig.json", + "include": ["index.ts", "src/**/*"], + "exclude": ["tests", "jest.config.js", "dev"], "compilerOptions": { - "module": "ESNext", - "outDir": "dist", - "declarationDir": "dist/types", - "baseUrl": "./", // or the base directory where your index.ts is - "paths": { - "api": ["index"] - } + "outDir": "dist" } } diff --git a/packages/core/typedoc.json b/packages/core/typedoc.json index b369a23b8..93ac741af 100644 --- a/packages/core/typedoc.json +++ b/packages/core/typedoc.json @@ -1,4 +1,23 @@ { "extends": ["../../typedoc.base.json"], - "entryPoints": ["index.ts"] + "entryPoints": ["index.ts"], + "compilerOptions": { + "module": "CommonJS", + "outDir": "docs", + "baseUrl": ".", + "paths": { + "@decorators": ["packages/core/src/decorators"], + "@decorators/*": ["packages/core/src/decorators/*"], + "@localization": ["packages/core/src/localization"], + "@localization/*": ["packages/core/src/localization/*"], + "@reflection": ["packages/core/src/reflection"], + "@reflection/*": ["packages/core/src/reflection/*"], + "@strategy": ["packages/core/src/strategy"], + "@strategy/*": ["packages/core/src/strategy/*"], + "@utilities": ["packages/core/src/utilities"], + "@utilities/*": ["packages/core/src/utilities/*"], + "@validation": ["packages/core/src/validation"], + "@validation/*": ["packages/core/src/validation/*"] + } + } } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/index.d.ts new file mode 100644 index 000000000..67c797a1d --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/index.d.ts @@ -0,0 +1,18 @@ +import * as Decorators from "./src/decorators"; +import * as Localization from "./src/localization"; +import * as Reflection from "./src/reflection"; +import * as Strategy from "./src/strategy"; +import * as Utilities from "./src/utilities"; +import * as Validation from "./src/validation"; +export { Decorators, Localization, Reflection, Strategy, Utilities, Validation }; +export import PrimitiveSet = Utilities.PrimitiveSet; +export import createClassDecorator = Decorators.createClassDecorator; +export import createClassValidator = Decorators.createClassValidator; +export import createFieldDecorator = Decorators.createFieldDecorator; +export import createFieldValidator = Decorators.createFieldValidator; +export import Form = Validation.Form; +export import attribute = Decorators.attribute; +export import Class = Utilities.Types.Class; +export import UnwrapClass = Utilities.Types.UnwrapClass; +export import ValidationResult = Validation.ValidationResult; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/index.d.ts.map new file mode 100644 index 000000000..4c7bfeb9c --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,YAAY,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,UAAU,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,QAAQ,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,UAAU,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;AAEjF,MAAM,QAAQ,YAAY,GAAG,SAAS,CAAC,YAAY,CAAC;AACpD,MAAM,QAAQ,oBAAoB,GAAG,UAAU,CAAC,oBAAoB,CAAC;AACrE,MAAM,QAAQ,oBAAoB,GAAG,UAAU,CAAC,oBAAoB,CAAC;AACrE,MAAM,QAAQ,oBAAoB,GAAG,UAAU,CAAC,oBAAoB,CAAC;AACrE,MAAM,QAAQ,oBAAoB,GAAG,UAAU,CAAC,oBAAoB,CAAC;AACrE,MAAM,QAAQ,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC;AACrC,MAAM,QAAQ,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;AAC/C,MAAM,QAAQ,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC;AAC5C,MAAM,QAAQ,WAAW,GAAG,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC;AACxD,MAAM,QAAQ,gBAAgB,GAAG,UAAU,CAAC,gBAAgB,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/index.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/index.js index 0a2898d4e..076acb048 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/index.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/index.js @@ -1,13 +1,13 @@ import * as Decorators from "./src/decorators"; -import { createClassDecorator, createClassValidator, createFieldDecorator, createFieldValidator, } from "./src/decorators"; -import { attribute } from "./src/decorators/data/structural/attribute"; -import TdvCoreApi from "./src/index"; import * as Localization from "./src/localization"; import * as Reflection from "./src/reflection"; import * as Strategy from "./src/strategy"; import * as Utilities from "./src/utilities"; import * as Validation from "./src/validation"; -import { Form } from "./src/validation/models/Form"; -export { Form, attribute, createClassDecorator, createClassValidator, createFieldDecorator, createFieldValidator, }; export { Decorators, Localization, Reflection, Strategy, Utilities, Validation }; -export default TdvCoreApi; +export var createClassDecorator = Decorators.createClassDecorator; +export var createClassValidator = Decorators.createClassValidator; +export var createFieldDecorator = Decorators.createFieldDecorator; +export var createFieldValidator = Decorators.createFieldValidator; +export var Form = Validation.Form; +export var attribute = Decorators.attribute; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/index.d.ts similarity index 100% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/index.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/index.d.ts diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/index.d.ts.map new file mode 100644 index 000000000..bc45253b5 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/decorators/data/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/structural/attribute.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/structural/attribute.d.ts similarity index 86% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/structural/attribute.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/structural/attribute.d.ts index 3bd411d03..20beca186 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/structural/attribute.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/structural/attribute.d.ts @@ -1,9 +1,9 @@ -import type API from "../../../../index"; -import { type FieldDecorator } from "./../../index"; +import { FieldDecorator } from "../../factory/forField/createFieldDecorator"; +import { Objects, Types } from "../../../utilities"; /** * Creates a decorator which flags the given field as a non-primitive (will validate inner fields of `T`). * - * If a field which is being decorated is not a {@link API.Utilities.Types.PrimitiveType primitive} + * If a field which is being decorated is not a {@link Types.PrimitiveType primitive} * (`string`, `number`, `boolean`, `bigint`, `Date`) and isn't marked as a primitive in {@link PrimitiveSet overrides} interface * then the framework treats it as a custom, client-defined validable class. That having in mind, you will always want to apply `@attribute` * to those types of fields so the runtime evaluation matches the TypeScript compiler type evaluation. For more clarity check examples below. @@ -57,5 +57,5 @@ import { type FieldDecorator } from "./../../index"; * } * } */ -export declare function attribute>(clazz: API.Utilities.Types.Class): FieldDecorator; +export declare function attribute>(clazz: Types.Class): FieldDecorator; //# sourceMappingURL=attribute.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/structural/attribute.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/structural/attribute.d.ts.map new file mode 100644 index 000000000..0f863e9ea --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/structural/attribute.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"attribute.d.ts","sourceRoot":"","sources":["../../../../../src/decorators/data/structural/attribute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,mDAAmD,CAAC;AACzG,OAAO,EAAE,OAAO,EAAgB,KAAK,EAAE,MAAM,YAAY,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAInH"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/structural/attribute.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/structural/attribute.js index 648163370..d20feab8e 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/structural/attribute.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/structural/attribute.js @@ -1,8 +1,8 @@ -import { createFieldDecorator } from "./../../index"; +import { createFieldDecorator } from "../../factory/forField/createFieldDecorator"; /** * Creates a decorator which flags the given field as a non-primitive (will validate inner fields of `T`). * - * If a field which is being decorated is not a {@link API.Utilities.Types.PrimitiveType primitive} + * If a field which is being decorated is not a {@link Types.PrimitiveType primitive} * (`string`, `number`, `boolean`, `bigint`, `Date`) and isn't marked as a primitive in {@link PrimitiveSet overrides} interface * then the framework treats it as a custom, client-defined validable class. That having in mind, you will always want to apply `@attribute` * to those types of fields so the runtime evaluation matches the TypeScript compiler type evaluation. For more clarity check examples below. diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/structural/foreach.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/structural/foreach.d.ts similarity index 63% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/structural/foreach.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/structural/foreach.d.ts index cf6370787..c75796e30 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/structural/foreach.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/structural/foreach.d.ts @@ -1,12 +1,10 @@ -import type API from "../../../../index"; -import { type FieldDecorator } from "./../../../decorators"; +import { FieldDecorator } from "../../factory/forField/createFieldDecorator"; +import { Arrays, Types } from "../../../utilities"; /** * Creates a validator decorator which applies multiple validators to each element in array field. - * * @typeParam T - The type of the array property. * @param validators - An array of validators to apply to each element in the array. * @returns A decorator function to use with class array fields. - * * @example * 1: Applies the `MinLength` and `MaxLength` validators to each element in the `names` array property. * ```ts @@ -16,5 +14,5 @@ import { type FieldDecorator } from "./../../../decorators"; * } * ``` */ -export declare function foreach API.Utilities.Types.ArrayType)>>(...validators: Array>>): FieldDecorator; +export declare function foreach Types.ArrayType)>>(...validators: Array>>): FieldDecorator; //# sourceMappingURL=foreach.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/structural/foreach.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/structural/foreach.d.ts.map new file mode 100644 index 000000000..d3f0a10f3 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/structural/foreach.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"foreach.d.ts","sourceRoot":"","sources":["../../../../../src/decorators/data/structural/foreach.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,mDAAmD,CAAC;AACzG,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAE3C;;;;;;;;;;;;;GAaG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,WAAW,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,MAAM,KAAK,CAAC,SAAS,CAAC,CAAC,EACtF,GAAG,UAAU,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,GAC3D,cAAc,CAAC,CAAC,CAAC,CAYnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/structural/foreach.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/structural/foreach.js index 00e4f4ac1..1a36e0c99 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/structural/foreach.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/structural/foreach.js @@ -1,11 +1,9 @@ -import { createFieldDecorator } from "./../../../decorators"; +import { createFieldDecorator } from "../../factory/forField/createFieldDecorator"; /** * Creates a validator decorator which applies multiple validators to each element in array field. - * * @typeParam T - The type of the array property. * @param validators - An array of validators to apply to each element in the array. * @returns A decorator function to use with class array fields. - * * @example * 1: Applies the `MinLength` and `MaxLength` validators to each element in the `names` array property. * ```ts diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/structural/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/structural/index.d.ts similarity index 100% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/structural/index.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/structural/index.d.ts diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/structural/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/structural/index.d.ts.map new file mode 100644 index 000000000..3ac091dca --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/structural/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/decorators/data/structural/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/any/Required.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/any/Required.d.ts similarity index 61% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/any/Required.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/any/Required.d.ts index 244a7dac9..e910e0711 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/any/Required.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/any/Required.d.ts @@ -1,15 +1,8 @@ -import API from "../../../../../index"; -import { type FieldDecorator } from "../../../index"; -/** Required identifier. */ +import { FieldDecorator } from "../../../factory/forField"; +import { DecoratorOptions } from "../../../helper"; +import { Objects } from "../../../../utilities"; +/** `@Required` key. */ export declare const REQUIRED = "Required"; -/** - * Checks if a value is not `null`, `undefined`, `false`, an empty array, an empty string, or an invalid Date. - * - * @typeParam T - The type of the value. - */ -export declare function isRequiredValid( - value: T | undefined -): value is NonNullable; /** * Creates a validator decorator which requires that a value must be present. * @@ -48,7 +41,5 @@ export declare function isRequiredValid( * } * ``` */ -export declare function Required( - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=Required.d.ts.map +export declare function Required(options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=Required.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/any/Required.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/any/Required.d.ts.map new file mode 100644 index 000000000..3ba115c46 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/any/Required.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Required.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/any/Required.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,uBAAuB;AACvB,eAAO,MAAM,QAAQ,aAAa,CAAC;AAkBnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,cAAc,CAAC,CAAC,CAAC,CASlG"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/any/Required.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/any/Required.js index e8fce6e54..bf873c8bf 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/any/Required.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/any/Required.js @@ -1,22 +1,20 @@ -import API from "../../../../../index"; +import { createFieldValidator } from "../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../helper"; import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator } from "../../../index"; -/** Required identifier. */ +/** `@Required` key. */ export const REQUIRED = "Required"; /** * Checks if a value is not `null`, `undefined`, `false`, an empty array, an empty string, or an invalid Date. * * @typeParam T - The type of the value. */ -export function isRequiredValid(value) { - return !( - value === undefined || - value === null || - value === false || - (Array.isArray(value) && value.length === 0) || - (typeof value === "string" && value.trim().length === 0) || - (value instanceof Date && value.toString() === "Invalid Date") - ); +function isRequiredValid(value) { + return !(value === undefined || + value === null || + value === false || + (Array.isArray(value) && value.length === 0) || + (typeof value === "string" && value.trim().length === 0) || + (value instanceof Date && value.toString() === "Invalid Date")); } /** * Creates a validator decorator which requires that a value must be present. @@ -57,12 +55,9 @@ export function isRequiredValid(value) { * ``` */ export function Required(options) { - return createFieldValidator( - (value, _context, locale) => ({ - key: API.Decorators.key(options, REQUIRED), - valid: isRequiredValid(value), - message: API.Decorators.message(options, locale, translate(locale, REQUIRED)), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((value, _context, locale) => ({ + key: buildKeyProp(options, REQUIRED), + valid: isRequiredValid(value), + message: buildMessageProp(options, locale, translate(locale, REQUIRED)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayContains.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayContains.d.ts similarity index 72% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayContains.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayContains.d.ts index fc6fe69e7..936044953 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayContains.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayContains.d.ts @@ -1,9 +1,7 @@ -import API from "../../../../../index"; -import { type FieldDecorator } from "../../../index"; -/** ArrayContains identifier. */ +import { FieldDecorator } from "../../../factory/forField"; +import { DecoratorOptions } from "../../../helper"; +/** `@ArrayContains` key. */ export declare const ARRAY_CONTAINS = "ArrayContains"; -/** Internal validation function for {@link ArrayContains} validator. */ -export declare function isArrayContainsValid(value: T, contains: K): boolean; /** * Checks if the decorated array contains a specific value. * @@ -53,8 +51,5 @@ export declare function isArrayContainsValid(value: T, contain * } * ``` */ -export declare function ArrayContains( - contains: K, - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=ArrayContains.d.ts.map +export declare function ArrayContains(contains: K, options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=ArrayContains.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayContains.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayContains.d.ts.map new file mode 100644 index 000000000..a7ccfd352 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayContains.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ArrayContains.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/array/ArrayContains.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAIvG,4BAA4B;AAC5B,eAAO,MAAM,cAAc,kBAAkB,CAAC;AAQ9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,cAAc,CAAC,CAAC,CAAC,CAS1G"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayContains.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayContains.js index c2fd9d43e..8891f81ac 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayContains.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayContains.js @@ -1,12 +1,13 @@ -import API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator } from "../../../index"; -/** ArrayContains identifier. */ +import { createFieldValidator } from "../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../helper"; +import { translate } from "../../../../localization"; +import { Objects } from "../../../../utilities"; +/** `@ArrayContains` key. */ export const ARRAY_CONTAINS = "ArrayContains"; /** Internal validation function for {@link ArrayContains} validator. */ -export function isArrayContainsValid(value, contains) { - API.Utilities.Objects.assertType("array", value); - return (value !== null && value !== void 0 ? value : []).includes(contains); +function isArrayContainsValid(value, contains) { + Objects.assertType("array", value); + return (value !== null && value !== void 0 ? value : []).includes(contains); } /** * Checks if the decorated array contains a specific value. @@ -58,12 +59,9 @@ export function isArrayContainsValid(value, contains) { * ``` */ export function ArrayContains(contains, options) { - return createFieldValidator( - (array, _context, locale) => ({ - key: API.Decorators.key(options, ARRAY_CONTAINS), - valid: isArrayContainsValid(array, contains), - message: API.Decorators.message(options, locale, translate(locale, ARRAY_CONTAINS, contains)), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((array, _context, locale) => ({ + key: buildKeyProp(options, ARRAY_CONTAINS), + valid: isArrayContainsValid(array, contains), + message: buildMessageProp(options, locale, translate(locale, ARRAY_CONTAINS, contains)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayEmpty.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayEmpty.d.ts similarity index 72% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayEmpty.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayEmpty.d.ts index 83114c750..6a8023a4b 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayEmpty.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayEmpty.d.ts @@ -1,9 +1,7 @@ -import API from "../../../../../index"; -import { type FieldDecorator } from "../../../index"; -/** ArrayEmpty identifier. */ +import { FieldDecorator } from "../../../factory/forField"; +import { DecoratorOptions } from "../../../helper"; +/** `@ArrayEmpty` key. */ export declare const ARRAY_EMPTY = "ArrayEmpty"; -/** Internal validation function for {@link ArrayEmpty} validator. */ -export declare function isArrayEmptyValid(array: any[]): boolean; /** * Checks if the decorated array is empty. * @@ -52,7 +50,5 @@ export declare function isArrayEmptyValid(array: any[]): boolean; * } * ``` */ -export declare function ArrayEmpty( - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=ArrayEmpty.d.ts.map +export declare function ArrayEmpty(options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=ArrayEmpty.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayEmpty.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayEmpty.d.ts.map new file mode 100644 index 000000000..1971f02b5 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayEmpty.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ArrayEmpty.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/array/ArrayEmpty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAIvG,yBAAyB;AACzB,eAAO,MAAM,WAAW,eAAe,CAAC;AAQxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,cAAc,CAAC,CAAC,CAAC,CAS1F"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayEmpty.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayEmpty.js index 77c2baa8e..97c62ffc9 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayEmpty.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayEmpty.js @@ -1,12 +1,13 @@ -import API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator } from "../../../index"; -/** ArrayEmpty identifier. */ +import { createFieldValidator } from "../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../helper"; +import { translate } from "../../../../localization"; +import { Objects } from "../../../../utilities"; +/** `@ArrayEmpty` key. */ export const ARRAY_EMPTY = "ArrayEmpty"; /** Internal validation function for {@link ArrayEmpty} validator. */ -export function isArrayEmptyValid(array) { - API.Utilities.Objects.assertType("array", array); - return (array !== null && array !== void 0 ? array : []).length === 0; +function isArrayEmptyValid(array) { + Objects.assertType("array", array); + return (array !== null && array !== void 0 ? array : []).length === 0; } /** * Checks if the decorated array is empty. @@ -57,12 +58,9 @@ export function isArrayEmptyValid(array) { * ``` */ export function ArrayEmpty(options) { - return createFieldValidator( - (array, _context, locale) => ({ - key: API.Decorators.key(options, ARRAY_EMPTY), - valid: isArrayEmptyValid(array), - message: API.Decorators.message(options, locale, translate(locale, ARRAY_EMPTY)), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((array, _context, locale) => ({ + key: buildKeyProp(options, ARRAY_EMPTY), + valid: isArrayEmptyValid(array), + message: buildMessageProp(options, locale, translate(locale, ARRAY_EMPTY)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayEvery.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayEvery.d.ts similarity index 70% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayEvery.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayEvery.d.ts index f4147a298..a5050b9bf 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayEvery.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayEvery.d.ts @@ -1,12 +1,8 @@ -import API from "../../../../../index"; -import { type FieldDecorator } from "../../../index"; -/** ArrayEvery identifier. */ +import { FieldDecorator } from "../../../factory/forField"; +import { DecoratorOptions } from "../../../helper"; +import { Objects } from "../../../../utilities"; +/** `@ArrayEvery` key. */ export declare const ARRAY_EVERY = "ArrayEvery"; -/** Internal validation function for {@link ArrayEvery} validator. */ -export declare function isArrayEveryValid( - array: T, - predicate: API.Utilities.Objects.ArrayPredicate -): boolean; /** * Checks if all elements of decorated array satisfy the given predicate criteria. * @@ -56,8 +52,5 @@ export declare function isArrayEveryValid( * } * ``` **/ -export declare function ArrayEvery( - predicate: API.Utilities.Objects.ArrayPredicate, - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=ArrayEvery.d.ts.map +export declare function ArrayEvery(predicate: Objects.ArrayPredicate, options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=ArrayEvery.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayEvery.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayEvery.d.ts.map new file mode 100644 index 000000000..d784e87a0 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayEvery.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ArrayEvery.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/array/ArrayEvery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,yBAAyB;AACzB,eAAO,MAAM,WAAW,eAAe,CAAC;AAQxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgDI;AACJ,wBAAgB,UAAU,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,EACzC,SAAS,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,EACpC,OAAO,CAAC,EAAE,gBAAgB,GACzB,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayEvery.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayEvery.js index c2e7943e3..58bef0fc7 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayEvery.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayEvery.js @@ -1,12 +1,13 @@ -import API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator } from "../../../index"; -/** ArrayEvery identifier. */ +import { createFieldValidator } from "../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../helper"; +import { translate } from "../../../../localization"; +import { Objects } from "../../../../utilities"; +/** `@ArrayEvery` key. */ export const ARRAY_EVERY = "ArrayEvery"; /** Internal validation function for {@link ArrayEvery} validator. */ -export function isArrayEveryValid(array, predicate) { - API.Utilities.Objects.assertType("array", array); - return (array !== null && array !== void 0 ? array : []).every(predicate); +function isArrayEveryValid(array, predicate) { + Objects.assertType("array", array); + return (array !== null && array !== void 0 ? array : []).every(predicate); } /** * Checks if all elements of decorated array satisfy the given predicate criteria. @@ -58,12 +59,9 @@ export function isArrayEveryValid(array, predicate) { * ``` **/ export function ArrayEvery(predicate, options) { - return createFieldValidator( - (array, _context, locale) => ({ - key: API.Decorators.key(options, ARRAY_EVERY), - valid: isArrayEveryValid(array, predicate), - message: API.Decorators.message(options, locale, translate(locale, ARRAY_EVERY)), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((array, _context, locale) => ({ + key: buildKeyProp(options, ARRAY_EVERY), + valid: isArrayEveryValid(array, predicate), + message: buildMessageProp(options, locale, translate(locale, ARRAY_EVERY)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayNone.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayNone.d.ts similarity index 70% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayNone.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayNone.d.ts index 6712ead14..e8d227f8d 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayNone.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayNone.d.ts @@ -1,12 +1,8 @@ -import API from "../../../../../index"; -import { type FieldDecorator } from "../../../index"; -/** ArrayNone identifier. */ +import { FieldDecorator } from "../../../factory/forField"; +import { DecoratorOptions } from "../../../helper"; +import { Objects } from "../../../../utilities"; +/** `@ArrayNone` key. */ export declare const ARRAY_NONE = "ArrayNone"; -/** Internal validation function for {@link ArrayNone} validator. */ -export declare function isArrayNoneValid( - array: T, - predicate: API.Utilities.Objects.ArrayPredicate -): boolean; /** * Checks if no elements of decorated array satisfy the given predicate criteria. * @@ -56,8 +52,5 @@ export declare function isArrayNoneValid( * } * ``` **/ -export declare function ArrayNone( - predicate: API.Utilities.Objects.ArrayPredicate, - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=ArrayNone.d.ts.map +export declare function ArrayNone(predicate: Objects.ArrayPredicate, options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=ArrayNone.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayNone.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayNone.d.ts.map new file mode 100644 index 000000000..d727f409d --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayNone.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ArrayNone.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/array/ArrayNone.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,wBAAwB;AACxB,eAAO,MAAM,UAAU,cAAc,CAAC;AAQtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgDI;AACJ,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,EACxC,SAAS,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,EACpC,OAAO,CAAC,EAAE,gBAAgB,GACzB,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayNone.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayNone.js index 7878685a9..da99f2bf8 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayNone.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayNone.js @@ -1,12 +1,13 @@ -import API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator } from "../../../index"; -/** ArrayNone identifier. */ +import { createFieldValidator } from "../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../helper"; +import { translate } from "../../../../localization"; +import { Objects } from "../../../../utilities"; +/** `@ArrayNone` key. */ export const ARRAY_NONE = "ArrayNone"; /** Internal validation function for {@link ArrayNone} validator. */ -export function isArrayNoneValid(array, predicate) { - API.Utilities.Objects.assertType("array", array); - return !(array !== null && array !== void 0 ? array : []).some(predicate); +function isArrayNoneValid(array, predicate) { + Objects.assertType("array", array); + return !(array !== null && array !== void 0 ? array : []).some(predicate); } /** * Checks if no elements of decorated array satisfy the given predicate criteria. @@ -58,12 +59,9 @@ export function isArrayNoneValid(array, predicate) { * ``` **/ export function ArrayNone(predicate, options) { - return createFieldValidator( - (array, _context, locale) => ({ - key: API.Decorators.key(options, ARRAY_NONE), - valid: isArrayNoneValid(array, predicate), - message: API.Decorators.message(options, locale, translate(locale, ARRAY_NONE)), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((array, _context, locale) => ({ + key: buildKeyProp(options, ARRAY_NONE), + valid: isArrayNoneValid(array, predicate), + message: buildMessageProp(options, locale, translate(locale, ARRAY_NONE)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayOne.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayOne.d.ts similarity index 71% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayOne.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayOne.d.ts index 7532240fc..a44823728 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayOne.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayOne.d.ts @@ -1,12 +1,8 @@ -import API from "../../../../../index"; -import { type FieldDecorator } from "../../../index"; -/** ArrayOne identifier. */ +import { FieldDecorator } from "../../../factory/forField"; +import { DecoratorOptions } from "../../../helper"; +import { Objects } from "../../../../utilities"; +/** `@ArrayOne` key. */ export declare const ARRAY_ONE = "ArrayOne"; -/** Internal validation function for {@link ArrayOne} validator. */ -export declare function isArrayOneValid( - array: T, - predicate: API.Utilities.Objects.ArrayPredicate -): boolean; /** * Checks if exactly one element of decorated array satisfies the given predicate criteria. * @@ -56,8 +52,5 @@ export declare function isArrayOneValid( * } * ``` **/ -export declare function ArrayOne( - predicate: API.Utilities.Objects.ArrayPredicate, - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=ArrayOne.d.ts.map +export declare function ArrayOne(predicate: Objects.ArrayPredicate, options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=ArrayOne.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayOne.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayOne.d.ts.map new file mode 100644 index 000000000..90fa8e9cc --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayOne.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ArrayOne.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/array/ArrayOne.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,uBAAuB;AACvB,eAAO,MAAM,SAAS,aAAa,CAAC;AAQpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgDI;AACJ,wBAAgB,QAAQ,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,EACvC,SAAS,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,EACpC,OAAO,CAAC,EAAE,gBAAgB,GACzB,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayOne.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayOne.js index 2c92e98fd..eb4fe0ede 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayOne.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayOne.js @@ -1,12 +1,13 @@ -import API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator } from "../../../index"; -/** ArrayOne identifier. */ +import { createFieldValidator } from "../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../helper"; +import { translate } from "../../../../localization"; +import { Objects } from "../../../../utilities"; +/** `@ArrayOne` key. */ export const ARRAY_ONE = "ArrayOne"; /** Internal validation function for {@link ArrayOne} validator. */ -export function isArrayOneValid(array, predicate) { - API.Utilities.Objects.assertType("array", array); - return (array !== null && array !== void 0 ? array : []).filter(predicate).length === 1; +function isArrayOneValid(array, predicate) { + Objects.assertType("array", array); + return (array !== null && array !== void 0 ? array : []).filter(predicate).length === 1; } /** * Checks if exactly one element of decorated array satisfies the given predicate criteria. @@ -58,12 +59,9 @@ export function isArrayOneValid(array, predicate) { * ``` **/ export function ArrayOne(predicate, options) { - return createFieldValidator( - (array, _context, locale) => ({ - key: API.Decorators.key(options, ARRAY_ONE), - valid: isArrayOneValid(array, predicate), - message: API.Decorators.message(options, locale, translate(locale, ARRAY_ONE)), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((array, _context, locale) => ({ + key: buildKeyProp(options, ARRAY_ONE), + valid: isArrayOneValid(array, predicate), + message: buildMessageProp(options, locale, translate(locale, ARRAY_ONE)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArraySizeExact.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeExact.d.ts similarity index 73% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArraySizeExact.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeExact.d.ts index 6de22f24d..9d7df7678 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArraySizeExact.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeExact.d.ts @@ -1,9 +1,7 @@ -import API from "../../../../../index"; -import { type FieldDecorator } from "../../../index"; -/** ArraySizeExact identifier. */ +import { FieldDecorator } from "../../../factory/forField"; +import { DecoratorOptions } from "../../../helper"; +/** `@ArraySizeExact` key. */ export declare const ARRAY_SIZE_EXACT = "ArraySizeExact"; -/** Internal validation function for {@link ArraySizeExact} validator. */ -export declare function isArraySizeExactValid(array: any[]): boolean; /** * Checks if the decorated array contains an exact number of elements. * @@ -53,8 +51,5 @@ export declare function isArraySizeExactValid(array: any[]): boolean; * } * ``` */ -export declare function ArraySizeExact( - exact: number, - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=ArraySizeExact.d.ts.map +export declare function ArraySizeExact(exact: number, options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=ArraySizeExact.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeExact.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeExact.d.ts.map new file mode 100644 index 000000000..6e86c7ed6 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeExact.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ArraySizeExact.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/array/ArraySizeExact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAIvG,6BAA6B;AAC7B,eAAO,MAAM,gBAAgB,mBAAmB,CAAC;AAQjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,cAAc,CAAC,CAAC,CAAC,CAS7G"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeExact.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeExact.js index 86091f0bb..72d39a62f 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeExact.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeExact.js @@ -1,12 +1,13 @@ -import API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator } from "../../../index"; -/** ArraySizeExact identifier. */ +import { createFieldValidator } from "../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../helper"; +import { translate } from "../../../../localization"; +import { Objects } from "../../../../utilities"; +/** `@ArraySizeExact` key. */ export const ARRAY_SIZE_EXACT = "ArraySizeExact"; /** Internal validation function for {@link ArraySizeExact} validator. */ -export function isArraySizeExactValid(array) { - API.Utilities.Objects.assertType("array", array); - return (array !== null && array !== void 0 ? array : []).length === 0; +function isArraySizeExactValid(array) { + Objects.assertType("array", array); + return (array !== null && array !== void 0 ? array : []).length === 0; } /** * Checks if the decorated array contains an exact number of elements. @@ -58,21 +59,9 @@ export function isArraySizeExactValid(array) { * ``` */ export function ArraySizeExact(exact, options) { - return createFieldValidator( - (array, _context, locale) => ({ - key: API.Decorators.key(options, ARRAY_SIZE_EXACT), - valid: (array !== null && array !== void 0 ? array : []).length === exact, - message: API.Decorators.message( - options, - locale, - translate( - locale, - ARRAY_SIZE_EXACT, - exact, - (array !== null && array !== void 0 ? array : []).length - ) - ), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((array, _context, locale) => ({ + key: buildKeyProp(options, ARRAY_SIZE_EXACT), + valid: isArraySizeExactValid(array), + message: buildMessageProp(options, locale, translate(locale, ARRAY_SIZE_EXACT, exact, (array !== null && array !== void 0 ? array : []).length)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArraySizeMax.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeMax.d.ts similarity index 72% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArraySizeMax.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeMax.d.ts index 547d21907..4ca4e14b7 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArraySizeMax.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeMax.d.ts @@ -1,9 +1,7 @@ -import API from "../../../../../index"; -import { type FieldDecorator } from "../../../index"; -/** ArraySizeMax identifier. */ +import { FieldDecorator } from "../../../factory/forField"; +import { DecoratorOptions } from "../../../helper"; +/** `@ArraySizeMax` key. */ export declare const ARRAY_SIZE_MAX = "ArraySizeMax"; -/** Internal validation function for {@link ArraySizeMax} validator. */ -export declare function isArraySizeMaxValid(array: any[], max: number): boolean; /** * Checks if the decorated array contains up to `max` number of elements. * @@ -53,8 +51,5 @@ export declare function isArraySizeMaxValid(array: any[], max: number): boolean; * } * ``` */ -export declare function ArraySizeMax( - max: number, - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=ArraySizeMax.d.ts.map +export declare function ArraySizeMax(max: number, options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=ArraySizeMax.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeMax.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeMax.d.ts.map new file mode 100644 index 000000000..0f8ff403b --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeMax.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ArraySizeMax.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/array/ArraySizeMax.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAIvG,2BAA2B;AAC3B,eAAO,MAAM,cAAc,iBAAiB,CAAC;AAQ7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,cAAc,CAAC,CAAC,CAAC,CASzG"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeMax.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeMax.js index c2dad8e06..c0b7208a9 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeMax.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeMax.js @@ -1,12 +1,13 @@ -import API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator } from "../../../index"; -/** ArraySizeMax identifier. */ +import { createFieldValidator } from "../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../helper"; +import { translate } from "../../../../localization"; +import { Objects } from "../../../../utilities"; +/** `@ArraySizeMax` key. */ export const ARRAY_SIZE_MAX = "ArraySizeMax"; /** Internal validation function for {@link ArraySizeMax} validator. */ -export function isArraySizeMaxValid(array, max) { - API.Utilities.Objects.assertType("array", array); - return (array !== null && array !== void 0 ? array : []).length <= max; +function isArraySizeMaxValid(array, max) { + Objects.assertType("array", array); + return (array !== null && array !== void 0 ? array : []).length <= max; } /** * Checks if the decorated array contains up to `max` number of elements. @@ -58,21 +59,9 @@ export function isArraySizeMaxValid(array, max) { * ``` */ export function ArraySizeMax(max, options) { - return createFieldValidator( - (array, _, locale) => ({ - key: API.Decorators.key(options, ARRAY_SIZE_MAX), - valid: isArraySizeMaxValid(array, max), - message: API.Decorators.message( - options, - locale, - translate( - locale, - ARRAY_SIZE_MAX, - max, - (array !== null && array !== void 0 ? array : []).length - ) - ), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((array, _, locale) => ({ + key: buildKeyProp(options, ARRAY_SIZE_MAX), + valid: isArraySizeMaxValid(array, max), + message: buildMessageProp(options, locale, translate(locale, ARRAY_SIZE_MAX, max, (array !== null && array !== void 0 ? array : []).length)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArraySizeMin.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeMin.d.ts similarity index 72% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArraySizeMin.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeMin.d.ts index 9b272d473..23711cf09 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArraySizeMin.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeMin.d.ts @@ -1,9 +1,7 @@ -import API from "../../../../../index"; -import { type FieldDecorator } from "../../../index"; -/** ArraySizeMin identifier. */ +import { FieldDecorator } from "../../../factory/forField"; +import { DecoratorOptions } from "../../../helper"; +/** `@ArraySizeMin` key. */ export declare const ARRAY_SIZE_MIN = "ArraySizeMin"; -/** Internal validation function for {@link ArraySizeMin} validator. */ -export declare function isArraySizeMinValid(array: any[], min: number): boolean; /** * Checks if the decorated array contains at least `min` number of elements. * @@ -53,8 +51,5 @@ export declare function isArraySizeMinValid(array: any[], min: number): boolean; * } * ``` */ -export declare function ArraySizeMin( - min: number, - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=ArraySizeMin.d.ts.map +export declare function ArraySizeMin(min: number, options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=ArraySizeMin.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeMin.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeMin.d.ts.map new file mode 100644 index 000000000..3a29e7765 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeMin.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ArraySizeMin.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/array/ArraySizeMin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAIvG,2BAA2B;AAC3B,eAAO,MAAM,cAAc,iBAAiB,CAAC;AAQ7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,cAAc,CAAC,CAAC,CAAC,CASzG"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeMin.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeMin.js index 833dcd6e7..98464b446 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeMin.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeMin.js @@ -1,12 +1,13 @@ -import API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator } from "../../../index"; -/** ArraySizeMin identifier. */ +import { createFieldValidator } from "../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../helper"; +import { translate } from "../../../../localization"; +import { Objects } from "../../../../utilities"; +/** `@ArraySizeMin` key. */ export const ARRAY_SIZE_MIN = "ArraySizeMin"; /** Internal validation function for {@link ArraySizeMin} validator. */ -export function isArraySizeMinValid(array, min) { - API.Utilities.Objects.assertType("array", array); - return (array !== null && array !== void 0 ? array : []).length >= min; +function isArraySizeMinValid(array, min) { + Objects.assertType("array", array); + return (array !== null && array !== void 0 ? array : []).length >= min; } /** * Checks if the decorated array contains at least `min` number of elements. @@ -58,21 +59,9 @@ export function isArraySizeMinValid(array, min) { * ``` */ export function ArraySizeMin(min, options) { - return createFieldValidator( - (array, _context, locale) => ({ - key: API.Decorators.key(options, ARRAY_SIZE_MIN), - valid: isArraySizeMinValid(array, min), - message: API.Decorators.message( - options, - locale, - translate( - locale, - ARRAY_SIZE_MIN, - min, - (array !== null && array !== void 0 ? array : []).length - ) - ), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((array, _context, locale) => ({ + key: buildKeyProp(options, ARRAY_SIZE_MIN), + valid: isArraySizeMinValid(array, min), + message: buildMessageProp(options, locale, translate(locale, ARRAY_SIZE_MIN, min, (array !== null && array !== void 0 ? array : []).length)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArraySizeRange.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeRange.d.ts similarity index 72% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArraySizeRange.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeRange.d.ts index f13ec8628..c5aeaf928 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArraySizeRange.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeRange.d.ts @@ -1,9 +1,7 @@ -import API from "../../../../../index"; -import { type FieldDecorator } from "../../../index"; -/** ArraySizeRange identifier. */ +import { FieldDecorator } from "../../../factory/forField"; +import { DecoratorOptions } from "../../../helper"; +/** `@ArraySizeRange` key. */ export declare const ARRAY_SIZE_RANGE = "ArraySizeRange"; -/** Internal validation function for {@link ArraySizeRange} validator. */ -export declare function isArraySizeRangeValid(array: any[], min: number, max: number): boolean; /** * Checks if the decorated array contains at least `min` number of elements. * @@ -54,9 +52,5 @@ export declare function isArraySizeRangeValid(array: any[], min: number, max: nu * } * ``` */ -export declare function ArraySizeRange( - min: number, - max: number, - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=ArraySizeRange.d.ts.map +export declare function ArraySizeRange(min: number, max: number, options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=ArraySizeRange.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeRange.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeRange.d.ts.map new file mode 100644 index 000000000..cf08dfa54 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeRange.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ArraySizeRange.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/array/ArraySizeRange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAIvG,6BAA6B;AAC7B,eAAO,MAAM,gBAAgB,mBAAmB,CAAC;AAQjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,EAC7C,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,gBAAgB,GACzB,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeRange.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeRange.js index 39bcf3db0..ed5d38aff 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeRange.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySizeRange.js @@ -1,15 +1,13 @@ -import API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator } from "../../../index"; -/** ArraySizeRange identifier. */ +import { createFieldValidator } from "../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../helper"; +import { translate } from "../../../../localization"; +import { Objects } from "../../../../utilities"; +/** `@ArraySizeRange` key. */ export const ARRAY_SIZE_RANGE = "ArraySizeRange"; /** Internal validation function for {@link ArraySizeRange} validator. */ -export function isArraySizeRangeValid(array, min, max) { - API.Utilities.Objects.assertType("array", array); - return ( - (array !== null && array !== void 0 ? array : []).length >= min && - (array !== null && array !== void 0 ? array : []).length <= max - ); +function isArraySizeRangeValid(array, min, max) { + Objects.assertType("array", array); + return (array !== null && array !== void 0 ? array : []).length >= min && (array !== null && array !== void 0 ? array : []).length <= max; } /** * Checks if the decorated array contains at least `min` number of elements. @@ -62,22 +60,9 @@ export function isArraySizeRangeValid(array, min, max) { * ``` */ export function ArraySizeRange(min, max, options) { - return createFieldValidator( - (array, _context, locale) => ({ - key: API.Decorators.key(options, ARRAY_SIZE_RANGE), - valid: isArraySizeRangeValid(array, min, max), - message: API.Decorators.message( - options, - locale, - translate( - locale, - ARRAY_SIZE_RANGE, - min, - max, - (array !== null && array !== void 0 ? array : []).length - ) - ), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((array, _context, locale) => ({ + key: buildKeyProp(options, ARRAY_SIZE_RANGE), + valid: isArraySizeRangeValid(array, min, max), + message: buildMessageProp(options, locale, translate(locale, ARRAY_SIZE_RANGE, min, max, (array !== null && array !== void 0 ? array : []).length)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArraySome.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySome.d.ts similarity index 71% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArraySome.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySome.d.ts index 87fad509c..75b5c971f 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArraySome.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySome.d.ts @@ -1,12 +1,8 @@ -import API from "../../../../../index"; -import { type FieldDecorator } from "../../../index"; -/** ArraySome identifier. */ +import { FieldDecorator } from "../../../factory/forField"; +import { DecoratorOptions } from "../../../helper"; +import { Objects } from "../../../../utilities"; +/** `@ArraySome` key. */ export declare const ARRAY_SOME = "ArraySome"; -/** Internal validation function for {@link ArraySome} validator. */ -export declare function isArraySomeValid( - array: T, - predicate: API.Utilities.Objects.ArrayPredicate -): boolean; /** * Checks if at least one element of decorated array satisfies the given predicate criteria. * @@ -56,8 +52,5 @@ export declare function isArraySomeValid( * } * ``` **/ -export declare function ArraySome( - predicate: API.Utilities.Objects.ArrayPredicate, - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=ArraySome.d.ts.map +export declare function ArraySome(predicate: Objects.ArrayPredicate, options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=ArraySome.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySome.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySome.d.ts.map new file mode 100644 index 000000000..12817aa56 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySome.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ArraySome.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/array/ArraySome.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,wBAAwB;AACxB,eAAO,MAAM,UAAU,cAAc,CAAC;AAQtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgDI;AACJ,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,EACxC,SAAS,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,EACpC,OAAO,CAAC,EAAE,gBAAgB,GACzB,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySome.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySome.js index 540065794..43ca6451b 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySome.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArraySome.js @@ -1,12 +1,13 @@ -import API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator } from "../../../index"; -/** ArraySome identifier. */ +import { createFieldValidator } from "../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../helper"; +import { translate } from "../../../../localization"; +import { Objects } from "../../../../utilities"; +/** `@ArraySome` key. */ export const ARRAY_SOME = "ArraySome"; /** Internal validation function for {@link ArraySome} validator. */ -export function isArraySomeValid(array, predicate) { - API.Utilities.Objects.assertType("array", array); - return (array !== null && array !== void 0 ? array : []).some(predicate); +function isArraySomeValid(array, predicate) { + Objects.assertType("array", array); + return (array !== null && array !== void 0 ? array : []).some(predicate); } /** * Checks if at least one element of decorated array satisfies the given predicate criteria. @@ -58,12 +59,9 @@ export function isArraySomeValid(array, predicate) { * ``` **/ export function ArraySome(predicate, options) { - return createFieldValidator( - (array, _context, locale) => ({ - key: API.Decorators.key(options, ARRAY_SOME), - valid: isArraySomeValid(array, predicate), - message: API.Decorators.message(options, locale, translate(locale, ARRAY_SOME)), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((array, _context, locale) => ({ + key: buildKeyProp(options, ARRAY_SOME), + valid: isArraySomeValid(array, predicate), + message: buildMessageProp(options, locale, translate(locale, ARRAY_SOME)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayUnique.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayUnique.d.ts similarity index 73% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayUnique.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayUnique.d.ts index 136c1e62a..857a3a0cc 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayUnique.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayUnique.d.ts @@ -1,9 +1,7 @@ -import API from "../../../../../index"; -import { type FieldDecorator } from "../../../index"; -/** ArrayUnique identifier. */ +import { FieldDecorator } from "../../../factory/forField"; +import { DecoratorOptions } from "../../../helper"; +/** `@ArrayUnique` key. */ export declare const ARRAY_UNIQUE = "ArrayUnique"; -/** Internal validation function for {@link ArrayUnique} validator. */ -export declare function isArrayUniqueValid(array: any[]): boolean; /** * Checks if all elements in decorated array are unique. * @@ -52,7 +50,5 @@ export declare function isArrayUniqueValid(array: any[]): boolean; * } * ``` */ -export declare function ArrayUnique( - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=ArrayUnique.d.ts.map +export declare function ArrayUnique(options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=ArrayUnique.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayUnique.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayUnique.d.ts.map new file mode 100644 index 000000000..29f78d924 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayUnique.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ArrayUnique.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/array/ArrayUnique.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAIvG,0BAA0B;AAC1B,eAAO,MAAM,YAAY,gBAAgB,CAAC;AAqB1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,cAAc,CAAC,CAAC,CAAC,CAS3F"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayUnique.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayUnique.js index 7f6d4048b..6fdff3032 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayUnique.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/array/ArrayUnique.js @@ -1,28 +1,26 @@ -import API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator } from "../../../index"; -/** ArrayUnique identifier. */ +import { createFieldValidator } from "../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../helper"; +import { translate } from "../../../../localization"; +import { Objects } from "../../../../utilities"; +/** `@ArrayUnique` key. */ export const ARRAY_UNIQUE = "ArrayUnique"; /** Internal validation function for {@link ArrayUnique} validator. */ -export function isArrayUniqueValid(array) { - API.Utilities.Objects.assertType("array", array); - const hashFn = API.Utilities.Objects.hash; - function isArrayUnique(arr, equals) { - const set = new Set(); - for (const val of arr) { - for (const el of set) { - if (equals(val, el)) { - return false; +function isArrayUniqueValid(array) { + Objects.assertType("array", array); + const hashFn = Objects.hash; + function isArrayUnique(arr, equals) { + const set = new Set(); + for (const val of arr) { + for (const el of set) { + if (equals(val, el)) { + return false; + } + } + set.add(val); } - } - set.add(val); + return true; } - return true; - } - return isArrayUnique( - array !== null && array !== void 0 ? array : [], - (obj1, obj2) => hashFn(obj1) === hashFn(obj2) - ); + return isArrayUnique(array !== null && array !== void 0 ? array : [], (obj1, obj2) => hashFn(obj1) === hashFn(obj2)); } /** * Checks if all elements in decorated array are unique. @@ -73,12 +71,9 @@ export function isArrayUniqueValid(array) { * ``` */ export function ArrayUnique(options) { - return createFieldValidator( - (array, _context, locale) => ({ - key: API.Decorators.key(options, ARRAY_UNIQUE), - valid: isArrayUniqueValid(array), - message: API.Decorators.message(options, locale, translate(locale, ARRAY_UNIQUE)), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((array, _context, locale) => ({ + key: buildKeyProp(options, ARRAY_UNIQUE), + valid: isArrayUniqueValid(array), + message: buildMessageProp(options, locale, translate(locale, ARRAY_UNIQUE)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/boolean/AssertFalse.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/boolean/AssertFalse.d.ts similarity index 72% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/boolean/AssertFalse.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/boolean/AssertFalse.d.ts index 90c148cae..2f6a07095 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/boolean/AssertFalse.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/boolean/AssertFalse.d.ts @@ -1,9 +1,7 @@ -import API from "../../../../../index"; -import { type FieldDecorator } from "../../../index"; -/** AssertFalse identifier. */ +import { FieldDecorator } from "../../../factory/forField"; +import { DecoratorOptions } from "../../../helper"; +/** `@AssertFalse` key. */ export declare const ASSERT_FALSE = "AssertFalse"; -/** Internal validation function for {@link AssertFalse} validator. */ -export declare function isAssertFalseValid(value: boolean): boolean; /** * Checks if a boolean value is `false`. * @@ -51,7 +49,5 @@ export declare function isAssertFalseValid(value: boolean): boolean; * } * ``` */ -export declare function AssertFalse( - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=AssertFalse.d.ts.map +export declare function AssertFalse(options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=AssertFalse.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/boolean/AssertFalse.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/boolean/AssertFalse.d.ts.map new file mode 100644 index 000000000..10dd4e6ec --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/boolean/AssertFalse.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"AssertFalse.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/boolean/AssertFalse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAIvG,0BAA0B;AAC1B,eAAO,MAAM,YAAY,gBAAgB,CAAC;AAQ1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,OAAO,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,cAAc,CAAC,CAAC,CAAC,CAS5F"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/boolean/AssertFalse.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/boolean/AssertFalse.js index 853e28c01..974d70b38 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/boolean/AssertFalse.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/boolean/AssertFalse.js @@ -1,12 +1,13 @@ -import API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator } from "../../../index"; -/** AssertFalse identifier. */ +import { createFieldValidator } from "../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../helper"; +import { translate } from "../../../../localization"; +import { Objects } from "../../../../utilities"; +/** `@AssertFalse` key. */ export const ASSERT_FALSE = "AssertFalse"; /** Internal validation function for {@link AssertFalse} validator. */ -export function isAssertFalseValid(value) { - API.Utilities.Objects.assertType("boolean", value); - return !value; +function isAssertFalseValid(value) { + Objects.assertType("boolean", value); + return !value; } /** * Checks if a boolean value is `false`. @@ -56,12 +57,9 @@ export function isAssertFalseValid(value) { * ``` */ export function AssertFalse(options) { - return createFieldValidator( - (value, _context, locale) => ({ - key: API.Decorators.key(options, ASSERT_FALSE), - valid: isAssertFalseValid(value), - message: API.Decorators.message(options, locale, translate(locale, ASSERT_FALSE)), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((value, _context, locale) => ({ + key: buildKeyProp(options, ASSERT_FALSE), + valid: isAssertFalseValid(value), + message: buildMessageProp(options, locale, translate(locale, ASSERT_FALSE)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/boolean/AssertTrue.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/boolean/AssertTrue.d.ts similarity index 73% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/boolean/AssertTrue.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/boolean/AssertTrue.d.ts index a34c00ed0..0be6ec562 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/boolean/AssertTrue.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/boolean/AssertTrue.d.ts @@ -1,9 +1,7 @@ -import API from "../../../../../index"; -import { type FieldDecorator } from "../../../index"; -/** AssertTrue identifier. */ +import { FieldDecorator } from "../../../factory/forField"; +import { DecoratorOptions } from "../../../helper"; +/** `@AssertTrue` key. */ export declare const ASSERT_TRUE = "AssertTrue"; -/** Internal validation function for {@link AssertTrue} validator. */ -export declare function isAssertTrueValid(value: boolean): boolean; /** * Checks if a boolean value is `true`. * @@ -51,7 +49,5 @@ export declare function isAssertTrueValid(value: boolean): boolean; * } * ``` */ -export declare function AssertTrue( - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=AssertTrue.d.ts.map +export declare function AssertTrue(options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=AssertTrue.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/boolean/AssertTrue.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/boolean/AssertTrue.d.ts.map new file mode 100644 index 000000000..cebb8cdcb --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/boolean/AssertTrue.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"AssertTrue.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/boolean/AssertTrue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAIvG,yBAAyB;AACzB,eAAO,MAAM,WAAW,eAAe,CAAC;AAQxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,OAAO,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,cAAc,CAAC,CAAC,CAAC,CAS3F"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/boolean/AssertTrue.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/boolean/AssertTrue.js index 27d993832..e01439700 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/boolean/AssertTrue.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/boolean/AssertTrue.js @@ -1,12 +1,13 @@ -import API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator } from "../../../index"; -/** AssertTrue identifier. */ +import { createFieldValidator } from "../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../helper"; +import { translate } from "../../../../localization"; +import { Objects } from "../../../../utilities"; +/** `@AssertTrue` key. */ export const ASSERT_TRUE = "AssertTrue"; /** Internal validation function for {@link AssertTrue} validator. */ -export function isAssertTrueValid(value) { - API.Utilities.Objects.assertType("boolean", value); - return !!value; +function isAssertTrueValid(value) { + Objects.assertType("boolean", value); + return !!value; } /** * Checks if a boolean value is `true`. @@ -56,12 +57,9 @@ export function isAssertTrueValid(value) { * ``` */ export function AssertTrue(options) { - return createFieldValidator( - (value, _context, locale) => ({ - key: API.Decorators.key(options, ASSERT_TRUE), - valid: isAssertTrueValid(value), - message: API.Decorators.message(options, locale, translate(locale, ASSERT_TRUE)), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((value, _context, locale) => ({ + key: buildKeyProp(options, ASSERT_TRUE), + valid: isAssertTrueValid(value), + message: buildMessageProp(options, locale, translate(locale, ASSERT_TRUE)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/class/ValidDateRange.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/class/ValidDateRange.d.ts similarity index 70% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/class/ValidDateRange.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/class/ValidDateRange.d.ts index 52749895b..9946f0f3e 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/class/ValidDateRange.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/class/ValidDateRange.d.ts @@ -1,13 +1,8 @@ -import API from "../../../../../index"; -import { type ClassDecorator } from "../../../index"; -/** ValidDateRange identifier. */ +import { ClassDecorator } from "../../../factory/forClass"; +import { DecoratorOptions } from "../../../helper"; +import { Types } from "../../../../utilities"; +/** `@ValidDateRange` key. */ export declare const VALID_DATE_RANGE = "ValidDateRange"; -/** Internal validation function for {@link ValidDateRange} validator. */ -export declare function isValidDateRangeValid( - value: any, - startDateField: string, - endDateField: string -): boolean; /** * Checks if {@link Date} `startDateField` is before {@link Date} `endDateField` of a class. * @@ -58,9 +53,5 @@ export declare function isValidDateRangeValid( * } * ``` */ -export declare function ValidDateRange( - startDateField: string, - endDateField: string, - options?: API.Decorators.Options -): ClassDecorator; -//# sourceMappingURL=ValidDateRange.d.ts.map +export declare function ValidDateRange(startDateField: string, endDateField: string, options?: DecoratorOptions): ClassDecorator; +//# sourceMappingURL=ValidDateRange.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/class/ValidDateRange.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/class/ValidDateRange.d.ts.map new file mode 100644 index 000000000..f2a6af674 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/class/ValidDateRange.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ValidDateRange.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/class/ValidDateRange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAEvG,OAAO,EAAW,KAAK,EAAE,MAAM,YAAY,CAAC;AAE5C,6BAA6B;AAC7B,eAAO,MAAM,gBAAgB,mBAAmB,CAAC;AAQjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,KAAK,CAAC,KAAK,EAClD,cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,gBAAgB,GACzB,cAAc,CAAC,CAAC,CAAC,CAkBnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/class/ValidDateRange.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/class/ValidDateRange.js index cc5e8d66b..d99d42087 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/class/ValidDateRange.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/class/ValidDateRange.js @@ -1,12 +1,13 @@ -import API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createClassValidator } from "../../../index"; -/** ValidDateRange identifier. */ +import { createClassValidator } from "../../../factory/forClass"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../helper"; +import { translate } from "../../../../localization"; +import { Objects } from "../../../../utilities"; +/** `@ValidDateRange` key. */ export const VALID_DATE_RANGE = "ValidDateRange"; /** Internal validation function for {@link ValidDateRange} validator. */ -export function isValidDateRangeValid(value, startDateField, endDateField) { - API.Utilities.Objects.assertType("object", value); - return value[startDateField].getTime() < value[endDateField].getTime(); +function isValidDateRangeValid(value, startDateField, endDateField) { + Objects.assertType("object", value); + return value[startDateField].getTime() < value[endDateField].getTime(); } /** * Checks if {@link Date} `startDateField` is before {@link Date} `endDateField` of a class. @@ -59,30 +60,16 @@ export function isValidDateRangeValid(value, startDateField, endDateField) { * ``` */ export function ValidDateRange(startDateField, endDateField, options) { - return createClassValidator( - (value, _context, locale) => ({ - key: API.Decorators.key(options, VALID_DATE_RANGE), - valid: isValidDateRangeValid(value, startDateField, endDateField), - message: API.Decorators.message( - options, - locale, - translate( - locale, - VALID_DATE_RANGE, - convertCamelCaseToText(endDateField, false), - convertCamelCaseToText(startDateField) - ) - ), - }), - API.Decorators.groups(options) - ); + return createClassValidator((value, _context, locale) => ({ + key: buildKeyProp(options, VALID_DATE_RANGE), + valid: isValidDateRangeValid(value, startDateField, endDateField), + message: buildMessageProp(options, locale, translate(locale, VALID_DATE_RANGE, convertCamelCaseToText(endDateField, false), convertCamelCaseToText(startDateField))), + }), buildGroupsProp(options)); } function convertCamelCaseToText(camelCase, capitalizeFirstLetter = true) { - if (camelCase === camelCase.toUpperCase()) { - return camelCase; - } - const result = camelCase - .replace(/([a-z0-9])([A-Z])/g, "$1 $2") - .replace(/ (\w)/g, str => str.toLowerCase()); - return capitalizeFirstLetter ? result.replace(/^./, str => str.toUpperCase()) : result; + if (camelCase === camelCase.toUpperCase()) { + return camelCase; + } + const result = camelCase.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/ (\w)/g, str => str.toLowerCase()); + return capitalizeFirstLetter ? result.replace(/^./, str => str.toUpperCase()) : result; } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/date/FutureDate.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/date/FutureDate.d.ts similarity index 66% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/date/FutureDate.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/date/FutureDate.d.ts index fd5bfc2d4..97bc0bc43 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/date/FutureDate.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/date/FutureDate.d.ts @@ -1,11 +1,8 @@ -import API from "../../../../../index"; -import { type FieldDecorator } from "../../../index"; -/** FutureDate identifier. */ +import { FieldDecorator } from "../../../factory/forField"; +import { DecoratorOptions } from "../../../helper"; +import { Objects } from "../../../../utilities"; +/** `@FutureDate` key. */ export declare const FUTURE_DATE = "FutureDate"; -/** Internal validation function for {@link FutureDate} validator. */ -export declare function isFutureDateValid>( - date: T -): boolean; /** * Checks if a {@link Date} is in the future. * @@ -53,7 +50,5 @@ export declare function isFutureDateValid>( - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=FutureDate.d.ts.map +export declare function FutureDate>(options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=FutureDate.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/date/FutureDate.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/date/FutureDate.d.ts.map new file mode 100644 index 000000000..0e9a6c8b3 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/date/FutureDate.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"FutureDate.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/date/FutureDate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,yBAAyB;AACzB,eAAO,MAAM,WAAW,eAAe,CAAC;AAQxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,cAAc,CAAC,CAAC,CAAC,CAS1G"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/date/FutureDate.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/date/FutureDate.js index 2a99aa65a..5990c0872 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/date/FutureDate.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/date/FutureDate.js @@ -1,12 +1,13 @@ -import API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator } from "../../../index"; -/** FutureDate identifier. */ +import { createFieldValidator } from "../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../helper"; +import { translate } from "../../../../localization"; +import { Objects } from "../../../../utilities"; +/** `@FutureDate` key. */ export const FUTURE_DATE = "FutureDate"; /** Internal validation function for {@link FutureDate} validator. */ -export function isFutureDateValid(date) { - API.Utilities.Objects.assertType("date", date); - return date && date.getTime() > new Date().getTime(); +function isFutureDateValid(date) { + Objects.assertType("date", date); + return date && date.getTime() > new Date().getTime(); } /** * Checks if a {@link Date} is in the future. @@ -56,12 +57,9 @@ export function isFutureDateValid(date) { * ``` */ export function FutureDate(options) { - return createFieldValidator( - (date, _context, locale) => ({ - key: API.Decorators.key(options, FUTURE_DATE), - valid: isFutureDateValid(date), - message: API.Decorators.message(options, locale, translate(locale, FUTURE_DATE, date)), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((date, _context, locale) => ({ + key: buildKeyProp(options, FUTURE_DATE), + valid: isFutureDateValid(date), + message: buildMessageProp(options, locale, translate(locale, FUTURE_DATE, date)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/date/PastDate.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/date/PastDate.d.ts similarity index 66% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/date/PastDate.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/date/PastDate.d.ts index 57a9b3f89..d962b61f9 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/date/PastDate.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/date/PastDate.d.ts @@ -1,11 +1,8 @@ -import API from "../../../../../index"; -import { type FieldDecorator } from "../../../index"; -/** PastDate identifier. */ +import { FieldDecorator } from "../../../factory/forField"; +import { DecoratorOptions } from "../../../helper"; +import { Objects } from "../../../../utilities"; +/** `@PastDate` key. */ export declare const PAST_DATE = "PastDate"; -/** Internal validation function for {@link PastDate} validator. */ -export declare function isPastDateValid>( - date: T -): boolean; /** * Checks if a {@link Date} is in the past. * @@ -53,7 +50,5 @@ export declare function isPastDateValid>( - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=PastDate.d.ts.map +export declare function PastDate>(options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=PastDate.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/date/PastDate.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/date/PastDate.d.ts.map new file mode 100644 index 000000000..1e34119a0 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/date/PastDate.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"PastDate.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/date/PastDate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,uBAAuB;AACvB,eAAO,MAAM,SAAS,aAAa,CAAC;AAQpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,cAAc,CAAC,CAAC,CAAC,CASxG"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/date/PastDate.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/date/PastDate.js index fdb16d663..1f083f861 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/date/PastDate.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/date/PastDate.js @@ -1,12 +1,13 @@ -import API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator } from "../../../index"; -/** PastDate identifier. */ +import { createFieldValidator } from "../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../helper"; +import { translate } from "../../../../localization"; +import { Objects } from "../../../../utilities"; +/** `@PastDate` key. */ export const PAST_DATE = "PastDate"; /** Internal validation function for {@link PastDate} validator. */ -export function isPastDateValid(date) { - API.Utilities.Objects.assertType("date", date); - return date && date.getTime() < new Date().getTime(); +function isPastDateValid(date) { + Objects.assertType("date", date); + return date && date.getTime() < new Date().getTime(); } /** * Checks if a {@link Date} is in the past. @@ -56,12 +57,9 @@ export function isPastDateValid(date) { * ``` */ export function PastDate(options) { - return createFieldValidator( - (date, _context, locale) => ({ - key: API.Decorators.key(options, PAST_DATE), - valid: isPastDateValid(date), - message: API.Decorators.message(options, locale, translate(locale, PAST_DATE, date)), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((date, _context, locale) => ({ + key: buildKeyProp(options, PAST_DATE), + valid: isPastDateValid(date), + message: buildMessageProp(options, locale, translate(locale, PAST_DATE, date)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/date/TodayDate.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/date/TodayDate.d.ts similarity index 67% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/date/TodayDate.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/date/TodayDate.d.ts index 027b1d998..7d4441476 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/date/TodayDate.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/date/TodayDate.d.ts @@ -1,11 +1,8 @@ -import API from "../../../../../index"; -import { type FieldDecorator } from "../../../index"; -/** TodayDate identifier. */ +import { FieldDecorator } from "../../../factory/forField"; +import { DecoratorOptions } from "../../../helper"; +import { Objects } from "../../../../utilities"; +/** `@TodayDate` key. */ export declare const TODAY_DATE = "TodayDate"; -/** Internal validation function for {@link TodayDate} validator. */ -export declare function isTodayDateValid>( - date: T -): boolean; /** * Checks if a {@link Date} is the today's date based on year, month and day. * @@ -53,7 +50,5 @@ export declare function isTodayDateValid>( - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=TodayDate.d.ts.map +export declare function TodayDate>(options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=TodayDate.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/date/TodayDate.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/date/TodayDate.d.ts.map new file mode 100644 index 000000000..a022d93d6 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/date/TodayDate.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TodayDate.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/date/TodayDate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,wBAAwB;AACxB,eAAO,MAAM,UAAU,cAAc,CAAC;AActC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,cAAc,CAAC,CAAC,CAAC,CASzG"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/date/TodayDate.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/date/TodayDate.js index 4dc1eb0e8..4314b8e8b 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/date/TodayDate.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/date/TodayDate.js @@ -1,18 +1,17 @@ -import API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator } from "../../../index"; -/** TodayDate identifier. */ +import { createFieldValidator } from "../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../helper"; +import { translate } from "../../../../localization"; +import { Objects } from "../../../../utilities"; +/** `@TodayDate` key. */ export const TODAY_DATE = "TodayDate"; /** Internal validation function for {@link TodayDate} validator. */ -export function isTodayDateValid(date) { - API.Utilities.Objects.assertType("date", date); - const currentDate = new Date(); - return ( - date && - date.getDate() === currentDate.getDate() && - date.getMonth() === currentDate.getMonth() && - date.getFullYear() === currentDate.getFullYear() - ); +function isTodayDateValid(date) { + Objects.assertType("date", date); + const currentDate = new Date(); + return (date && + date.getDate() === currentDate.getDate() && + date.getMonth() === currentDate.getMonth() && + date.getFullYear() === currentDate.getFullYear()); } /** * Checks if a {@link Date} is the today's date based on year, month and day. @@ -62,12 +61,9 @@ export function isTodayDateValid(date) { * ``` */ export function TodayDate(options) { - return createFieldValidator( - (date, _context, locale) => ({ - key: API.Decorators.key(options, TODAY_DATE), - valid: isTodayDateValid(date), - message: API.Decorators.message(options, locale, translate(locale, TODAY_DATE, date)), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((date, _context, locale) => ({ + key: buildKeyProp(options, TODAY_DATE), + valid: isTodayDateValid(date), + message: buildMessageProp(options, locale, translate(locale, TODAY_DATE, date)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/index.d.ts similarity index 96% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/index.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/index.d.ts index f4a0855c2..d06aaddb9 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/index.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/index.d.ts @@ -40,4 +40,5 @@ export * from "./string/regex/impl/Lowercase"; export * from "./string/regex/impl/Numeric"; export * from "./string/regex/impl/URL"; export * from "./string/regex/impl/Uppercase"; +export * from "./string/regex/shared/regex.constants"; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/index.d.ts.map new file mode 100644 index 000000000..d0b7f1c7c --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/decorators/data/validators/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uCAAuC,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/index.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/index.js index 472367913..40cd58b96 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/index.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/index.js @@ -40,3 +40,4 @@ export * from "./string/regex/impl/Lowercase"; export * from "./string/regex/impl/Numeric"; export * from "./string/regex/impl/URL"; export * from "./string/regex/impl/Uppercase"; +export * from "./string/regex/shared/regex.constants"; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/Decimal.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Decimal.d.ts similarity index 66% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/Decimal.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Decimal.d.ts index c7f7c71cc..58cd7337d 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/Decimal.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Decimal.d.ts @@ -1,11 +1,8 @@ -import API from "../../../../../index"; -import { type FieldDecorator } from "../../../index"; -/** Decimal identifier. */ +import { FieldDecorator } from "../../../factory/forField"; +import { DecoratorOptions } from "../../../helper"; +import { Objects } from "../../../../utilities"; +/** `@Decimal` key. */ export declare const DECIMAL = "Decimal"; -/** Internal validation function for {@link Decimal} validator. */ -export declare function isDecimalValid>( - value: T -): boolean; /** * Checks if decorated number is a decimal number. * @@ -53,7 +50,5 @@ export declare function isDecimalValid>( - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=Decimal.d.ts.map +export declare function Decimal>(options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=Decimal.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Decimal.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Decimal.d.ts.map new file mode 100644 index 000000000..3e3b49c72 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Decimal.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Decimal.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/number/Decimal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,sBAAsB;AACtB,eAAO,MAAM,OAAO,YAAY,CAAC;AAQjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,cAAc,CAAC,CAAC,CAAC,CASzG"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Decimal.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Decimal.js index 044937fcf..d0f5dd8a7 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Decimal.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Decimal.js @@ -1,12 +1,13 @@ -import API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator } from "../../../index"; -/** Decimal identifier. */ +import { createFieldValidator } from "../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../helper"; +import { translate } from "../../../../localization"; +import { Objects } from "../../../../utilities"; +/** `@Decimal` key. */ export const DECIMAL = "Decimal"; /** Internal validation function for {@link Decimal} validator. */ -export function isDecimalValid(value) { - API.Utilities.Objects.assertType("number", value); - return value !== undefined && value !== null && !Number.isInteger(value); +function isDecimalValid(value) { + Objects.assertType("number", value); + return value !== undefined && value !== null && !Number.isInteger(value); } /** * Checks if decorated number is a decimal number. @@ -56,12 +57,9 @@ export function isDecimalValid(value) { * ``` */ export function Decimal(options) { - return createFieldValidator( - (value, _context, locale) => ({ - key: API.Decorators.key(options, DECIMAL), - valid: isDecimalValid(value), - message: API.Decorators.message(options, locale, translate(locale, DECIMAL, value)), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((value, _context, locale) => ({ + key: buildKeyProp(options, DECIMAL), + valid: isDecimalValid(value), + message: buildMessageProp(options, locale, translate(locale, DECIMAL, value)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/Digits.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Digits.d.ts similarity index 76% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/Digits.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Digits.d.ts index 5d52c8015..240278a3f 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/Digits.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Digits.d.ts @@ -1,6 +1,7 @@ -import API from "../../../../../index"; -import { type FieldDecorator } from "../../../index"; -/** Digits identifier. */ +import { FieldDecorator } from "../../../factory/forField"; +import { DecoratorOptions } from "../../../helper"; +import { Objects } from "../../../../utilities"; +/** `@Digits` key. */ export declare const DIGITS = "Digits"; /** * Checks if decorated number is a decimal number. @@ -51,9 +52,5 @@ export declare const DIGITS = "Digits"; * } * ``` */ -export declare function Digits>( - intsLimit: number, - decimalsLimit: number, - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=Digits.d.ts.map +export declare function Digits>(intsLimit: number, decimalsLimit: number, options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=Digits.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Digits.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Digits.d.ts.map new file mode 100644 index 000000000..9d60c7cd8 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Digits.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Digits.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/number/Digits.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,qBAAqB;AACrB,eAAO,MAAM,MAAM,WAAW,CAAC;AAmB/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EACvD,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,gBAAgB,GACzB,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Digits.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Digits.js index d03ca7d2d..9b1b4aaca 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Digits.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Digits.js @@ -1,22 +1,24 @@ -import API from "../../../../../index"; -import { translate } from "../../../../localization/service/TranslationService"; -import { createFieldValidator } from "../../../index"; -/** Digits identifier. */ +import { createFieldValidator } from "../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../helper"; +import { translate } from "../../../../localization"; +/** `@Digits` key. */ export const DIGITS = "Digits"; /** Internal validation function for {@link Digits} validator. */ function isDigitsValid(number, ints, decs) { - const assertValidInputs = () => { - const isMaxIntegersValid = ints !== Infinity && ints % 1 === 0 && ints >= 0; - const isMaxDecimalsValid = decs !== Infinity && decs % 1 === 0 && decs >= 0; - const isInputInvalid = !isMaxIntegersValid || !isMaxDecimalsValid; - if (isInputInvalid) throw new Error(translate(null, "InvalidDigits", ints, decs)); - }; - assertValidInputs(); - if (number == null) return true; - const parts = number.toString().split("."); - const integerPart = parts[0]; - const fractionPart = parts[1] || ""; - return integerPart.length <= ints && fractionPart.length <= decs; + const assertValidInputs = () => { + const isMaxIntegersValid = ints !== Infinity && ints % 1 === 0 && ints >= 0; + const isMaxDecimalsValid = decs !== Infinity && decs % 1 === 0 && decs >= 0; + const isInputInvalid = !isMaxIntegersValid || !isMaxDecimalsValid; + if (isInputInvalid) + throw new Error(translate(null, "InvalidDigits", ints, decs)); + }; + assertValidInputs(); + if (number == null) + return true; + const parts = number.toString().split("."); + const integerPart = parts[0]; + const fractionPart = parts[1] || ""; + return integerPart.length <= ints && fractionPart.length <= decs; } /** * Checks if decorated number is a decimal number. @@ -68,16 +70,9 @@ function isDigitsValid(number, ints, decs) { * ``` */ export function Digits(intsLimit, decimalsLimit, options) { - return createFieldValidator( - (value, _context, locale) => ({ - key: API.Decorators.key(options, DIGITS), - valid: isDigitsValid(value, intsLimit, decimalsLimit), - message: API.Decorators.message( - options, - locale, - translate(locale, DIGITS, intsLimit, decimalsLimit) - ), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((value, _context, locale) => ({ + key: buildKeyProp(options, DIGITS), + valid: isDigitsValid(value, intsLimit, decimalsLimit), + message: buildMessageProp(options, locale, translate(locale, DIGITS, intsLimit, decimalsLimit)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/Integer.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Integer.d.ts similarity index 74% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/Integer.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Integer.d.ts index 578f73f30..54c85a4cc 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/Integer.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Integer.d.ts @@ -1,6 +1,7 @@ -import API from "../../../../../index"; -import { type FieldDecorator } from "../../../../decorators"; -/** Integer identifier. */ +import { FieldDecorator } from "../../../factory/forField"; +import { DecoratorOptions } from "../../../helper"; +import { Objects } from "../../../../utilities"; +/** `@Integer` key. */ export declare const INTEGER = "Integer"; /** * Checks if decorated number is an integer number. @@ -49,7 +50,5 @@ export declare const INTEGER = "Integer"; * } * ``` */ -export declare function Integer>( - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=Integer.d.ts.map +export declare function Integer>(options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=Integer.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Integer.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Integer.d.ts.map new file mode 100644 index 000000000..f9fe0f0bd --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Integer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Integer.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/number/Integer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,sBAAsB;AACtB,eAAO,MAAM,OAAO,YAAY,CAAC;AAQjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,cAAc,CAAC,CAAC,CAAC,CASzG"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Integer.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Integer.js index 9409c8dd9..e569eb4fd 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Integer.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Integer.js @@ -1,12 +1,13 @@ -import API from "../../../../../index"; -import { createFieldValidator } from "../../../../decorators"; -import { translate } from "../../../../localization/service/TranslationService"; -/** Integer identifier. */ +import { createFieldValidator } from "../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../helper"; +import { translate } from "../../../../localization"; +import { Objects } from "../../../../utilities"; +/** `@Integer` key. */ export const INTEGER = "Integer"; /** Internal validation function for {@link Integer} validator. */ function isIntegerValid(num) { - API.Utilities.Objects.assertType("number", num); - return num !== undefined && num !== null && Number.isInteger(num); + Objects.assertType("number", num); + return num !== undefined && num !== null && Number.isInteger(num); } /** * Checks if decorated number is an integer number. @@ -56,12 +57,9 @@ function isIntegerValid(num) { * ``` */ export function Integer(options) { - return createFieldValidator( - (num, _context, locale) => ({ - key: API.Decorators.key(options, INTEGER), - valid: isIntegerValid(num), - message: API.Decorators.message(options, locale, translate(locale, INTEGER, num)), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((num, _context, locale) => ({ + key: buildKeyProp(options, INTEGER), + valid: isIntegerValid(num), + message: buildMessageProp(options, locale, translate(locale, INTEGER, num)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/Negative.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Negative.d.ts similarity index 74% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/Negative.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Negative.d.ts index 1be4df270..89b93a049 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/Negative.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Negative.d.ts @@ -1,6 +1,7 @@ -import API from "../../../../../index"; -import { type FieldDecorator } from "../../../../decorators"; -/** Negative identifier. */ +import { FieldDecorator } from "../../../factory/forField"; +import { DecoratorOptions } from "../../../helper"; +import { Objects } from "../../../../utilities"; +/** `@Negative` key. */ export declare const NEGATIVE = "Negative"; /** * Checks if decorated number is a negative number (number less than 0). @@ -49,7 +50,5 @@ export declare const NEGATIVE = "Negative"; * } * ``` */ -export declare function Negative>( - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=Negative.d.ts.map +export declare function Negative>(options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=Negative.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Negative.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Negative.d.ts.map new file mode 100644 index 000000000..56798ee4d --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Negative.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Negative.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/number/Negative.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,uBAAuB;AACvB,eAAO,MAAM,QAAQ,aAAa,CAAC;AAQnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,cAAc,CAAC,CAAC,CAAC,CAS1G"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Negative.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Negative.js index d14532897..271652179 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Negative.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Negative.js @@ -1,12 +1,13 @@ -import API from "../../../../../index"; -import { createFieldValidator } from "../../../../decorators"; -import { translate } from "../../../../localization/service/TranslationService"; -/** Negative identifier. */ +import { createFieldValidator } from "../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../helper"; +import { translate } from "../../../../localization"; +import { Objects } from "../../../../utilities"; +/** `@Negative` key. */ export const NEGATIVE = "Negative"; /** Internal validation function for {@link Negative} validator. */ function isNegativeValid(num) { - API.Utilities.Objects.assertType("number", num); - return num !== undefined && num !== null && num < 0; + Objects.assertType("number", num); + return num !== undefined && num !== null && num < 0; } /** * Checks if decorated number is a negative number (number less than 0). @@ -56,12 +57,9 @@ function isNegativeValid(num) { * ``` */ export function Negative(options) { - return createFieldValidator( - (num, _context, locale) => ({ - key: API.Decorators.key(options, NEGATIVE), - valid: isNegativeValid(num), - message: API.Decorators.message(options, locale, translate(locale, NEGATIVE, num)), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((num, _context, locale) => ({ + key: buildKeyProp(options, NEGATIVE), + valid: isNegativeValid(num), + message: buildMessageProp(options, locale, translate(locale, NEGATIVE, num)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/NonNegative.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/NonNegative.d.ts similarity index 75% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/NonNegative.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/NonNegative.d.ts index 17381ec86..7ec4f1b73 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/NonNegative.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/NonNegative.d.ts @@ -1,6 +1,7 @@ -import API from "../../../../../index"; -import { type FieldDecorator } from "../../../../decorators"; -/** NonNegative identifier. */ +import { FieldDecorator } from "../../../factory/forField"; +import { DecoratorOptions } from "../../../helper"; +import { Objects } from "../../../../utilities"; +/** `@NonNegative` key. */ export declare const NON_NEGATIVE = "NonNegative"; /** * Checks if decorated number is not a negative number (can be 0). @@ -49,7 +50,5 @@ export declare const NON_NEGATIVE = "NonNegative"; * } * ``` */ -export declare function NonNegative>( - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=NonNegative.d.ts.map +export declare function NonNegative>(options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=NonNegative.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/NonNegative.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/NonNegative.d.ts.map new file mode 100644 index 000000000..c7a13dc24 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/NonNegative.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NonNegative.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/number/NonNegative.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,0BAA0B;AAC1B,eAAO,MAAM,YAAY,gBAAgB,CAAC;AAQ1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,cAAc,CAAC,CAAC,CAAC,CAS7G"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/NonNegative.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/NonNegative.js index 32e0dd965..ca1b8457d 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/NonNegative.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/NonNegative.js @@ -1,12 +1,13 @@ -import API from "../../../../../index"; -import { createFieldValidator } from "../../../../decorators"; -import { translate } from "../../../../localization/service/TranslationService"; -/** NonNegative identifier. */ +import { createFieldValidator } from "../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../helper"; +import { translate } from "../../../../localization"; +import { Objects } from "../../../../utilities"; +/** `@NonNegative` key. */ export const NON_NEGATIVE = "NonNegative"; /** Internal validation function for {@link NonNegative} validator. */ function isNonNegativeValid(num) { - API.Utilities.Objects.assertType("number", num); - return num !== undefined && num !== null && num >= 0; + Objects.assertType("number", num); + return num !== undefined && num !== null && num >= 0; } /** * Checks if decorated number is not a negative number (can be 0). @@ -56,12 +57,9 @@ function isNonNegativeValid(num) { * ``` */ export function NonNegative(options) { - return createFieldValidator( - (num, _context, locale) => ({ - key: API.Decorators.key(options, NON_NEGATIVE), - valid: isNonNegativeValid(num), - message: API.Decorators.message(options, locale, translate(locale, NON_NEGATIVE, num)), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((num, _context, locale) => ({ + key: buildKeyProp(options, NON_NEGATIVE), + valid: isNonNegativeValid(num), + message: buildMessageProp(options, locale, translate(locale, NON_NEGATIVE, num)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/NonPositive.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/NonPositive.d.ts similarity index 75% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/NonPositive.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/NonPositive.d.ts index b5ed62af6..acd824685 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/NonPositive.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/NonPositive.d.ts @@ -1,6 +1,7 @@ -import API from "../../../../../index"; -import { type FieldDecorator } from "../../../../decorators"; -/** NonPositive identifier. */ +import { FieldDecorator } from "../../../factory/forField"; +import { DecoratorOptions } from "../../../helper"; +import { Objects } from "../../../../utilities"; +/** `@NonPositive` key. */ export declare const NON_POSITIVE = "NonPositive"; /** * Checks if decorated number is not a positive number (can be 0). @@ -49,7 +50,5 @@ export declare const NON_POSITIVE = "NonPositive"; * } * ``` */ -export declare function NonPositive>( - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=NonPositive.d.ts.map +export declare function NonPositive>(options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=NonPositive.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/NonPositive.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/NonPositive.d.ts.map new file mode 100644 index 000000000..7dbd74303 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/NonPositive.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NonPositive.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/number/NonPositive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,0BAA0B;AAC1B,eAAO,MAAM,YAAY,gBAAgB,CAAC;AAQ1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,cAAc,CAAC,CAAC,CAAC,CAS7G"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/NonPositive.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/NonPositive.js index f31dc67e8..04f8322aa 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/NonPositive.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/NonPositive.js @@ -1,12 +1,13 @@ -import API from "../../../../../index"; -import { createFieldValidator } from "../../../../decorators"; -import { translate } from "../../../../localization/service/TranslationService"; -/** NonPositive identifier. */ +import { createFieldValidator } from "../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../helper"; +import { translate } from "../../../../localization"; +import { Objects } from "../../../../utilities"; +/** `@NonPositive` key. */ export const NON_POSITIVE = "NonPositive"; /** Internal validation function for {@link NonPositive} validator. */ function isNonPositiveValid(num) { - API.Utilities.Objects.assertType("number", num); - return num !== undefined && num !== null && num <= 0; + Objects.assertType("number", num); + return num !== undefined && num !== null && num <= 0; } /** * Checks if decorated number is not a positive number (can be 0). @@ -56,12 +57,9 @@ function isNonPositiveValid(num) { * ``` */ export function NonPositive(options) { - return createFieldValidator( - (num, _context, locale) => ({ - key: API.Decorators.key(options, NON_POSITIVE), - valid: isNonPositiveValid(num), - message: API.Decorators.message(options, locale, translate(locale, NON_POSITIVE, num)), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((num, _context, locale) => ({ + key: buildKeyProp(options, NON_POSITIVE), + valid: isNonPositiveValid(num), + message: buildMessageProp(options, locale, translate(locale, NON_POSITIVE, num)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/Positive.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Positive.d.ts similarity index 75% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/Positive.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Positive.d.ts index 73ba9f047..e5e759ba5 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/Positive.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Positive.d.ts @@ -1,6 +1,7 @@ -import API from "../../../../../index"; -import { type FieldDecorator } from "../../../../decorators"; -/** Positive identifier. */ +import { FieldDecorator } from "../../../factory/forField"; +import { DecoratorOptions } from "../../../helper"; +import { Objects } from "../../../../utilities"; +/** `@Positive` key. */ export declare const POSITIVE = "Positive"; /** * Checks if decorated number is a positive number (number greater than 0). @@ -49,7 +50,5 @@ export declare const POSITIVE = "Positive"; * } * ``` */ -export declare function Positive>( - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=Positive.d.ts.map +export declare function Positive>(options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=Positive.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Positive.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Positive.d.ts.map new file mode 100644 index 000000000..dd6a2b158 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Positive.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Positive.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/number/Positive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,uBAAuB;AACvB,eAAO,MAAM,QAAQ,aAAa,CAAC;AAQnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,cAAc,CAAC,CAAC,CAAC,CAS1G"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Positive.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Positive.js index 6c21096b0..236c42741 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Positive.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/Positive.js @@ -1,12 +1,13 @@ -import API from "../../../../../index"; -import { createFieldValidator } from "../../../../decorators"; -import { translate } from "../../../../localization/service/TranslationService"; -/** Positive identifier. */ +import { createFieldValidator } from "../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../helper"; +import { translate } from "../../../../localization"; +import { Objects } from "../../../../utilities"; +/** `@Positive` key. */ export const POSITIVE = "Positive"; /** Internal validation function for {@link Positive} validator. */ function isPositiveValid(num) { - API.Utilities.Objects.assertType("number", num); - return num !== undefined && num !== null && num > 0; + Objects.assertType("number", num); + return num !== undefined && num !== null && num > 0; } /** * Checks if decorated number is a positive number (number greater than 0). @@ -56,12 +57,9 @@ function isPositiveValid(num) { * ``` */ export function Positive(options) { - return createFieldValidator( - (num, _context, locale) => ({ - key: API.Decorators.key(options, POSITIVE), - valid: isPositiveValid(num), - message: API.Decorators.message(options, locale, translate(locale, POSITIVE, num)), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((num, _context, locale) => ({ + key: buildKeyProp(options, POSITIVE), + valid: isPositiveValid(num), + message: buildMessageProp(options, locale, translate(locale, POSITIVE, num)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/ValueMax.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/ValueMax.d.ts similarity index 74% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/ValueMax.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/ValueMax.d.ts index b51e41595..863e19894 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/ValueMax.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/ValueMax.d.ts @@ -1,6 +1,7 @@ -import API from "../../../../../index"; -import { type FieldDecorator } from "../../../../decorators"; -/** ValueMax identifier. */ +import { FieldDecorator } from "../../../factory/forField"; +import { DecoratorOptions } from "../../../helper"; +import { Objects } from "../../../../utilities"; +/** `@ValueMax` key. */ export declare const VALUE_MAX = "ValueMax"; /** * Checks if decorated number is not greater than given `max` parameter. @@ -50,8 +51,5 @@ export declare const VALUE_MAX = "ValueMax"; * } * ``` */ -export declare function ValueMax>( - max: number, - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=ValueMax.d.ts.map +export declare function ValueMax>(max: number, options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=ValueMax.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/ValueMax.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/ValueMax.d.ts.map new file mode 100644 index 000000000..a81d91f0b --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/ValueMax.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ValueMax.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/number/ValueMax.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,uBAAuB;AACvB,eAAO,MAAM,SAAS,aAAa,CAAC;AAQpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EACzD,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,gBAAgB,GACzB,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/ValueMax.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/ValueMax.js index c7ba4574a..8729ddbf9 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/ValueMax.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/ValueMax.js @@ -1,12 +1,13 @@ -import API from "../../../../../index"; -import { createFieldValidator } from "../../../../decorators"; -import { translate } from "../../../../localization/service/TranslationService"; -/** ValueMax identifier. */ +import { createFieldValidator } from "../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../helper"; +import { translate } from "../../../../localization"; +import { Objects } from "../../../../utilities"; +/** `@ValueMax` key. */ export const VALUE_MAX = "ValueMax"; /** Internal validation function for {@link ValueMax} validator. */ function isValueMaxValid(num, max) { - API.Utilities.Objects.assertType("number", num); - return num == null ? true : num <= max; + Objects.assertType("number", num); + return num == null ? true : num <= max; } /** * Checks if decorated number is not greater than given `max` parameter. @@ -57,12 +58,9 @@ function isValueMaxValid(num, max) { * ``` */ export function ValueMax(max, options) { - return createFieldValidator( - (value, _context, locale) => ({ - key: API.Decorators.key(options, VALUE_MAX), - valid: isValueMaxValid(value, max), - message: API.Decorators.message(options, locale, translate(locale, VALUE_MAX, max, value)), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((value, _context, locale) => ({ + key: buildKeyProp(options, VALUE_MAX), + valid: isValueMaxValid(value, max), + message: buildMessageProp(options, locale, translate(locale, VALUE_MAX, max, value)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/ValueMin.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/ValueMin.d.ts similarity index 74% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/ValueMin.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/ValueMin.d.ts index f3ff735db..2f7283869 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/ValueMin.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/ValueMin.d.ts @@ -1,6 +1,7 @@ -import API from "../../../../../index"; -import { type FieldDecorator } from "../../../../decorators"; -/** ValueMin identifier. */ +import { FieldDecorator } from "../../../factory/forField"; +import { DecoratorOptions } from "../../../helper"; +import { Objects } from "../../../../utilities"; +/** `@ValueMin` key. */ export declare const VALUE_MIN = "ValueMin"; /** * Checks if decorated number is not lesser than given `min` parameter. @@ -50,8 +51,5 @@ export declare const VALUE_MIN = "ValueMin"; * } * ``` */ -export declare function ValueMin>( - min: number, - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=ValueMin.d.ts.map +export declare function ValueMin>(min: number, options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=ValueMin.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/ValueMin.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/ValueMin.d.ts.map new file mode 100644 index 000000000..0437ce4fd --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/ValueMin.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ValueMin.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/number/ValueMin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,uBAAuB;AACvB,eAAO,MAAM,SAAS,aAAa,CAAC;AAQpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EACzD,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,gBAAgB,GACzB,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/ValueMin.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/ValueMin.js index 6893e63a2..87f6cf3fc 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/ValueMin.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/ValueMin.js @@ -1,12 +1,13 @@ -import API from "../../../../../index"; -import { createFieldValidator } from "../../../../decorators"; -import { translate } from "../../../../localization/service/TranslationService"; -/** ValueMin identifier. */ +import { createFieldValidator } from "../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../helper"; +import { translate } from "../../../../localization"; +import { Objects } from "../../../../utilities"; +/** `@ValueMin` key. */ export const VALUE_MIN = "ValueMin"; /** Internal validation function for {@link ValueMin} validator. */ function isValueMinValid(num, min) { - API.Utilities.Objects.assertType("number", num); - return num == null ? true : num >= min; + Objects.assertType("number", num); + return num == null ? true : num >= min; } /** * Checks if decorated number is not lesser than given `min` parameter. @@ -57,12 +58,9 @@ function isValueMinValid(num, min) { * ``` */ export function ValueMin(min, options) { - return createFieldValidator( - (value, _context, locale) => ({ - key: API.Decorators.key(options, VALUE_MIN), - valid: isValueMinValid(value, min), - message: API.Decorators.message(options, locale, translate(locale, VALUE_MIN, min, value)), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((value, _context, locale) => ({ + key: buildKeyProp(options, VALUE_MIN), + valid: isValueMinValid(value, min), + message: buildMessageProp(options, locale, translate(locale, VALUE_MIN, min, value)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/ValueRange.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/ValueRange.d.ts similarity index 75% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/ValueRange.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/ValueRange.d.ts index 9290fd874..134ef7aea 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/ValueRange.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/ValueRange.d.ts @@ -1,6 +1,7 @@ -import API from "../../../../../index"; -import { type FieldDecorator } from "../../../../decorators"; -/** ValueRange identifier. */ +import { FieldDecorator } from "../../../factory/forField"; +import { DecoratorOptions } from "../../../helper"; +import { Objects } from "../../../../utilities"; +/** `@ValueRange` key. */ export declare const VALUE_RANGE = "ValueRange"; /** * Checks if decorated number is within a given range of `min` and `max` parameters. @@ -51,9 +52,5 @@ export declare const VALUE_RANGE = "ValueRange"; * } * ``` */ -export declare function ValueRange>( - min: number, - max: number, - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=ValueRange.d.ts.map +export declare function ValueRange>(min: number, max: number, options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=ValueRange.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/ValueRange.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/ValueRange.d.ts.map new file mode 100644 index 000000000..c36a362dc --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/ValueRange.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ValueRange.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/number/ValueRange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,yBAAyB;AACzB,eAAO,MAAM,WAAW,eAAe,CAAC;AAQxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAC3D,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,gBAAgB,GACzB,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/ValueRange.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/ValueRange.js index b7f938154..2d7003f00 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/ValueRange.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/number/ValueRange.js @@ -1,12 +1,13 @@ -import API from "../../../../../index"; -import { createFieldValidator } from "../../../../decorators"; -import { translate } from "../../../../localization/service/TranslationService"; -/** ValueRange identifier. */ +import { createFieldValidator } from "../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../helper"; +import { translate } from "../../../../localization"; +import { Objects } from "../../../../utilities"; +/** `@ValueRange` key. */ export const VALUE_RANGE = "ValueRange"; /** Internal validation function for {@link ValueRange} validator. */ function isValueRangeValid(num, min, max) { - API.Utilities.Objects.assertType("number", num); - return num == null ? true : num >= min && num <= max; + Objects.assertType("number", num); + return num == null ? true : num >= min && num <= max; } /** * Checks if decorated number is within a given range of `min` and `max` parameters. @@ -58,16 +59,9 @@ function isValueRangeValid(num, min, max) { * ``` */ export function ValueRange(min, max, options) { - return createFieldValidator( - (num, _context, locale) => ({ - key: API.Decorators.key(options, VALUE_RANGE), - valid: isValueRangeValid(num, min, max), - message: API.Decorators.message( - options, - locale, - translate(locale, VALUE_RANGE, min, max, num) - ), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((num, _context, locale) => ({ + key: buildKeyProp(options, VALUE_RANGE), + valid: isValueRangeValid(num, min, max), + message: buildMessageProp(options, locale, translate(locale, VALUE_RANGE, min, max, num)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/ExactLength.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/ExactLength.d.ts similarity index 67% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/ExactLength.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/ExactLength.d.ts index efa8f42eb..fee6411e6 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/ExactLength.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/ExactLength.d.ts @@ -1,12 +1,8 @@ -import API from "../../../../../index"; -import { type FieldDecorator } from "../../../../decorators"; -/** ExactLength identifier. */ +import { FieldDecorator } from "../../../factory/forField"; +import { DecoratorOptions } from "../../../helper"; +import { Objects } from "../../../../utilities"; +/** `@ExactLength` key. */ export declare const EXACT_LENGTH = "ExactLength"; -/** Internal validation function for {@link ExactLength} validator. */ -export declare function isExactLengthValid( - value: API.Utilities.Objects.Optional, - exact: number -): boolean; /** * Checks if decorated string contains a specific number of characters. * @@ -52,8 +48,5 @@ export declare function isExactLengthValid( * } * ``` */ -export declare function ExactLength>( - exact: number, - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=ExactLength.d.ts.map +export declare function ExactLength>(exact: number, options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=ExactLength.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/ExactLength.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/ExactLength.d.ts.map new file mode 100644 index 000000000..3f330ba48 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/ExactLength.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ExactLength.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/string/ExactLength.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,0BAA0B;AAC1B,eAAO,MAAM,YAAY,gBAAgB,CAAC;AAQ1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAC5D,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,gBAAgB,GACzB,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/ExactLength.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/ExactLength.js index baeaf71ff..e81526539 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/ExactLength.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/ExactLength.js @@ -1,12 +1,13 @@ -import API from "../../../../../index"; -import { createFieldValidator } from "../../../../decorators"; -import { translate } from "../../../../localization/service/TranslationService"; -/** ExactLength identifier. */ +import { createFieldValidator } from "../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../helper"; +import { translate } from "../../../../localization"; +import { Objects } from "../../../../utilities"; +/** `@ExactLength` key. */ export const EXACT_LENGTH = "ExactLength"; /** Internal validation function for {@link ExactLength} validator. */ -export function isExactLengthValid(value, exact) { - API.Utilities.Objects.assertType("string", value); - return (value !== null && value !== void 0 ? value : "").length === exact; +function isExactLengthValid(value, exact) { + Objects.assertType("string", value); + return (value !== null && value !== void 0 ? value : "").length === exact; } /** * Checks if decorated string contains a specific number of characters. @@ -54,12 +55,9 @@ export function isExactLengthValid(value, exact) { * ``` */ export function ExactLength(exact, options) { - return createFieldValidator( - (value, _context, locale) => ({ - key: API.Decorators.key(options, EXACT_LENGTH), - valid: isExactLengthValid(value, exact), - message: API.Decorators.message(options, locale, translate(locale, EXACT_LENGTH, exact)), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((value, _context, locale) => ({ + key: buildKeyProp(options, EXACT_LENGTH), + valid: isExactLengthValid(value, exact), + message: buildMessageProp(options, locale, translate(locale, EXACT_LENGTH, exact)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/MaxLength.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/MaxLength.d.ts similarity index 67% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/MaxLength.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/MaxLength.d.ts index 91e6f4ea7..ffbb1fbb3 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/MaxLength.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/MaxLength.d.ts @@ -1,12 +1,8 @@ -import API from "../../../../../index"; -import { type FieldDecorator } from "../../../../decorators"; -/** MaxLength identifier. */ +import { FieldDecorator } from "../../../factory/forField"; +import { DecoratorOptions } from "../../../helper"; +import { Objects } from "../../../../utilities"; +/** `@MaxLength` key. */ export declare const MAX_LENGTH = "MaxLength"; -/** Internal validation function for {@link MaxLength} validator. */ -export declare function isMaxLengthValid( - value: API.Utilities.Objects.Optional, - max: number -): boolean; /** * Checks if decorated string contains a specific number of characters. * @@ -52,8 +48,5 @@ export declare function isMaxLengthValid( * } * ``` */ -export declare function MaxLength>( - max: number, - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=MaxLength.d.ts.map +export declare function MaxLength>(max: number, options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=MaxLength.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/MaxLength.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/MaxLength.d.ts.map new file mode 100644 index 000000000..3353ef2f3 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/MaxLength.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MaxLength.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/string/MaxLength.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,wBAAwB;AACxB,eAAO,MAAM,UAAU,cAAc,CAAC;AAQtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAC1D,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,gBAAgB,GACzB,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/MaxLength.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/MaxLength.js index 398b12150..c6a22aba0 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/MaxLength.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/MaxLength.js @@ -1,12 +1,13 @@ -import API from "../../../../../index"; -import { createFieldValidator } from "../../../../decorators"; -import { translate } from "../../../../localization/service/TranslationService"; -/** MaxLength identifier. */ +import { createFieldValidator } from "../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../helper"; +import { translate } from "../../../../localization"; +import { Objects } from "../../../../utilities"; +/** `@MaxLength` key. */ export const MAX_LENGTH = "MaxLength"; /** Internal validation function for {@link MaxLength} validator. */ -export function isMaxLengthValid(value, max) { - API.Utilities.Objects.assertType("string", value); - return (value !== null && value !== void 0 ? value : "").length <= max; +function isMaxLengthValid(value, max) { + Objects.assertType("string", value); + return (value !== null && value !== void 0 ? value : "").length <= max; } /** * Checks if decorated string contains a specific number of characters. @@ -54,12 +55,9 @@ export function isMaxLengthValid(value, max) { * ``` */ export function MaxLength(max, options) { - return createFieldValidator( - (value, _context, locale) => ({ - key: API.Decorators.key(options, MAX_LENGTH), - valid: isMaxLengthValid(value, max), - message: API.Decorators.message(options, locale, translate(locale, MAX_LENGTH, max)), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((value, _context, locale) => ({ + key: buildKeyProp(options, MAX_LENGTH), + valid: isMaxLengthValid(value, max), + message: buildMessageProp(options, locale, translate(locale, MAX_LENGTH, max)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/MinLength.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/MinLength.d.ts similarity index 69% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/MinLength.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/MinLength.d.ts index ff22f66e3..81900dc7f 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/MinLength.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/MinLength.d.ts @@ -1,11 +1,7 @@ -import API from "../../../../../index"; -/** MinLength identifier. */ +import { DecoratorOptions } from "../../../helper"; +import { Objects } from "../../../../utilities"; +/** `@MinLength` key. */ export declare const MIN_LENGTH = "MinLength"; -/** Internal validation function for {@link MinLength} validator. */ -export declare function isMinLengthValid( - value: API.Utilities.Objects.Optional, - min: number -): boolean; /** * Checks if decorated string contains a specific number of characters. * @@ -51,8 +47,5 @@ export declare function isMinLengthValid( * } * ``` */ -export declare function MinLength>( - min: number, - options?: API.Decorators.Options -): API.Decorator.FieldDecorator; -//# sourceMappingURL=MinLength.d.ts.map +export declare function MinLength>(min: number, options?: DecoratorOptions): import("../../../factory/forField").FieldDecorator; +//# sourceMappingURL=MinLength.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/MinLength.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/MinLength.d.ts.map new file mode 100644 index 000000000..d822acf44 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/MinLength.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MinLength.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/string/MinLength.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,wBAAwB;AACxB,eAAO,MAAM,UAAU,cAAc,CAAC;AAQtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,4DASpG"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/MinLength.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/MinLength.js index 503a535e9..8ac127eac 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/MinLength.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/MinLength.js @@ -1,12 +1,13 @@ -import API from "../../../../../index"; -import { createFieldValidator } from "../../../../decorators"; -import { translate } from "../../../../localization/service/TranslationService"; -/** MinLength identifier. */ +import { createFieldValidator } from "../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../helper"; +import { translate } from "../../../../localization"; +import { Objects } from "../../../../utilities"; +/** `@MinLength` key. */ export const MIN_LENGTH = "MinLength"; /** Internal validation function for {@link MinLength} validator. */ -export function isMinLengthValid(value, min) { - API.Utilities.Objects.assertType("string", value); - return (value !== null && value !== void 0 ? value : "").length >= min; +function isMinLengthValid(value, min) { + Objects.assertType("string", value); + return (value !== null && value !== void 0 ? value : "").length >= min; } /** * Checks if decorated string contains a specific number of characters. @@ -54,12 +55,9 @@ export function isMinLengthValid(value, min) { * ``` */ export function MinLength(min, options) { - return createFieldValidator( - (value, _context, locale) => ({ - key: API.Decorators.key(options, MIN_LENGTH), - valid: isMinLengthValid(value, min), - message: API.Decorators.message(options, locale, translate(locale, MIN_LENGTH, min)), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((value, _context, locale) => ({ + key: buildKeyProp(options, MIN_LENGTH), + valid: isMinLengthValid(value, min), + message: buildMessageProp(options, locale, translate(locale, MIN_LENGTH, min)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/Password.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/Password.d.ts similarity index 66% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/Password.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/Password.d.ts index b5be781f9..1e564dfab 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/Password.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/Password.d.ts @@ -1,23 +1,14 @@ -import API from "../../../../../index"; -/** Password identifier. */ +import { DecoratorOptions } from "../../../helper"; +import { Objects } from "../../../../utilities"; +/** `@Password` key. */ export declare const PASSWORD = "Password"; +/** Configurable options for `@Password` decorator. */ export type PasswordRules = { - uppercase?: boolean; - lowercase?: boolean; - numbers?: boolean; - specials?: boolean; - length?: number; -}; -/** Internal validation function for {@link Password} validator. */ -export declare function isPasswordValid( - input: API.Utilities.Objects.Optional, - rules: PasswordRules | undefined, - definedMessage?: string, - locale?: API.Localization.Locale -): { - key: string; - message: string; - valid: boolean; + uppercase?: boolean; + lowercase?: boolean; + numbers?: boolean; + specials?: boolean; + length?: number; }; /** * Checks if decorated string contains a specific number of characters. @@ -73,8 +64,5 @@ export declare function isPasswordValid( * } * ``` */ -export declare function Password>( - rules?: PasswordRules, - options?: API.Decorators.Options -): API.Decorator.FieldDecorator; -//# sourceMappingURL=Password.d.ts.map +export declare function Password>(rules?: PasswordRules, options?: DecoratorOptions): import("../../../factory/forField").FieldDecorator; +//# sourceMappingURL=Password.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/Password.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/Password.d.ts.map new file mode 100644 index 000000000..b0503b225 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/Password.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Password.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/string/Password.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAmB,MAAM,oBAAoB,CAAC;AAEvE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,uBAAuB;AACvB,eAAO,MAAM,QAAQ,aAAa,CAAC;AAEnC,sDAAsD;AACtD,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAwDF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,gBAAgB,4DAK7G"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/Password.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/Password.js index f829e6942..9c654609f 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/Password.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/Password.js @@ -1,91 +1,51 @@ -import API from "../../../../../index"; -import { createFieldValidator } from "../../../../decorators"; -import { translate } from "../../../../localization/service/TranslationService"; -import RegexConst from "./regex/shared/regex.constants"; -/** Password identifier. */ +import { RegexConst } from "../../../data/validators/string/regex/shared/regex.constants"; +import { createFieldValidator } from "../../../factory/forField"; +import { buildGroupsProp } from "../../../helper"; +import { translate } from "../../../../localization"; +/** `@Password` key. */ export const PASSWORD = "Password"; /** Internal validation function for {@link Password} validator. */ -export function isPasswordValid(input, rules, definedMessage, locale) { - var _a, _b, _c, _d, _e; - const PASSWORD_REGEXES = { - uppercase: RegexConst.UPPERCASE_ANYWHERE, - lowercase: RegexConst.LOWERCASE_ANYWHERE, - numbers: RegexConst.NUMERIC_ANYWHERE, - specials: RegexConst.SPECIALS_ANYWHERE, - }; - function isInvalid(text, rule) { - const matchers = text.match(PASSWORD_REGEXES[rule]); - return matchers === null || matchers.length === 0; - } - function buildConstraintViolation(message, valid) { - return { - key: PASSWORD, - message, - valid, +function isPasswordValid(input, rules, definedMessage, locale) { + var _a, _b, _c, _d, _e; + const PASSWORD_REGEXES = { + uppercase: RegexConst.UPPERCASE_ANYWHERE, + lowercase: RegexConst.LOWERCASE_ANYWHERE, + numbers: RegexConst.NUMERIC_ANYWHERE, + specials: RegexConst.SPECIALS_ANYWHERE, }; - } - const lowercase = - (_a = rules === null || rules === void 0 ? void 0 : rules.lowercase) !== null && _a !== void 0 - ? _a - : true; - const uppercase = - (_b = rules === null || rules === void 0 ? void 0 : rules.uppercase) !== null && _b !== void 0 - ? _b - : false; - const numbers = - (_c = rules === null || rules === void 0 ? void 0 : rules.numbers) !== null && _c !== void 0 - ? _c - : false; - const specials = - (_d = rules === null || rules === void 0 ? void 0 : rules.specials) !== null && _d !== void 0 - ? _d - : false; - const length = - (_e = rules === null || rules === void 0 ? void 0 : rules.length) !== null && _e !== void 0 - ? _e - : 8; - const str = input !== null && input !== void 0 ? input : ""; - if (str.length < length) { - return buildConstraintViolation( - definedMessage !== null && definedMessage !== void 0 - ? definedMessage - : translate(locale, "PasswordLength", length), - false - ); - } - if (uppercase && isInvalid(str, "uppercase")) { - return buildConstraintViolation( - definedMessage !== null && definedMessage !== void 0 - ? definedMessage - : translate(locale, "PasswordUppercase"), - false - ); - } - if (lowercase && isInvalid(str, "lowercase")) { - return buildConstraintViolation( - definedMessage !== null && definedMessage !== void 0 - ? definedMessage - : translate(locale, "PasswordLowercase"), - false - ); - } - if (numbers && isInvalid(str, "numbers")) { - return buildConstraintViolation( - definedMessage !== null && definedMessage !== void 0 - ? definedMessage - : translate(locale, "PasswordNumbers"), - false - ); - } - if (specials && isInvalid(str, "specials")) { - return buildConstraintViolation( - definedMessage !== null && definedMessage !== void 0 - ? definedMessage - : translate(locale, "PasswordSpecials"), - false - ); - } - return { key: PASSWORD, message: "", valid: true }; + function isInvalid(text, rule) { + const matchers = text.match(PASSWORD_REGEXES[rule]); + return matchers === null || matchers.length === 0; + } + function buildConstraintViolation(message, valid) { + return { + key: PASSWORD, + message, + valid, + }; + } + const lowercase = (_a = rules === null || rules === void 0 ? void 0 : rules.lowercase) !== null && _a !== void 0 ? _a : true; + const uppercase = (_b = rules === null || rules === void 0 ? void 0 : rules.uppercase) !== null && _b !== void 0 ? _b : false; + const numbers = (_c = rules === null || rules === void 0 ? void 0 : rules.numbers) !== null && _c !== void 0 ? _c : false; + const specials = (_d = rules === null || rules === void 0 ? void 0 : rules.specials) !== null && _d !== void 0 ? _d : false; + const length = (_e = rules === null || rules === void 0 ? void 0 : rules.length) !== null && _e !== void 0 ? _e : 8; + const str = input !== null && input !== void 0 ? input : ""; + if (str.length < length) { + return buildConstraintViolation(definedMessage !== null && definedMessage !== void 0 ? definedMessage : translate(locale, "PasswordLength", length), false); + } + if (uppercase && isInvalid(str, "uppercase")) { + return buildConstraintViolation(definedMessage !== null && definedMessage !== void 0 ? definedMessage : translate(locale, "PasswordUppercase"), false); + } + if (lowercase && isInvalid(str, "lowercase")) { + return buildConstraintViolation(definedMessage !== null && definedMessage !== void 0 ? definedMessage : translate(locale, "PasswordLowercase"), false); + } + if (numbers && isInvalid(str, "numbers")) { + return buildConstraintViolation(definedMessage !== null && definedMessage !== void 0 ? definedMessage : translate(locale, "PasswordNumbers"), false); + } + if (specials && isInvalid(str, "specials")) { + return buildConstraintViolation(definedMessage !== null && definedMessage !== void 0 ? definedMessage : translate(locale, "PasswordSpecials"), false); + } + return { key: PASSWORD, message: "", valid: true }; } /** * Checks if decorated string contains a specific number of characters. @@ -142,14 +102,5 @@ export function isPasswordValid(input, rules, definedMessage, locale) { * ``` */ export function Password(rules, options) { - return createFieldValidator( - (value, _context, locale) => - isPasswordValid( - value, - rules, - options === null || options === void 0 ? void 0 : options.message, - locale - ), - API.Decorators.groups(options) - ); + return createFieldValidator((value, _context, locale) => isPasswordValid(value, rules, options === null || options === void 0 ? void 0 : options.message, locale), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/Pattern.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/Pattern.d.ts new file mode 100644 index 000000000..f23873237 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/Pattern.d.ts @@ -0,0 +1,41 @@ +import { DecoratorOptions } from "../../../../helper"; +import { Objects } from "../../../../../utilities"; +/** + * Tests if a value matches a regular expression pattern. + * @template T - The type of the value being tested. + * @param regex - The regular expression pattern to test against. + * @param value - The value to test. + * @returns A boolean indicating whether the value matches the pattern. + */ +export declare function testRegex>(regex: RegExp, value: T): boolean; +/** + * Creates a validator decorator that checks if a string value matches a regular expression pattern. + * @typeparam T - The type of the decorated property (optional string). + * @param regex The regular expression pattern to match against the value. + * @param message - (Optional) The custom error message to display when validation fails. + * @param key - (Optional) The key to identify this validation rule in error messages. Defaults to "Pattern". + * @param config - (Optional) An array of validation groups to which this rule belongs. + * @returns A decorator function to use with class properties. + * @example + * 1: Basic usage with default options + * ```ts + * class MyClass { + * \@Pattern(/^[A-Za-z]+$/) + * lettersOnly: string; + * } + * ``` + * @example + * 2: Custom error message and validation groups + * ```ts + * class MyClass { + * \@Pattern(/^[A-Za-z]+$/, { + * key: "AlphabeticPattern", + * message: "Must contain only alphabetic characters", + * groups: ["group1", "group2"], + * }) + * lettersOnly: string; + * } + * ``` + */ +export declare function Pattern>(regex: RegExp, options?: DecoratorOptions): import("../../../../factory/forField").FieldDecorator; +//# sourceMappingURL=Pattern.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/Pattern.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/Pattern.d.ts.map new file mode 100644 index 000000000..1efc9336c --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/Pattern.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Pattern.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/string/regex/Pattern.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAE9F;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,4DASpG"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/Pattern.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/Pattern.js index 5d1f9690b..a6a821d6b 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/Pattern.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/Pattern.js @@ -1,48 +1,49 @@ -import API from "../../../../../../index"; -import { createFieldValidator } from "../../../../../decorators"; -import { translate } from "../../../../../localization/service/TranslationService"; +import { createFieldValidator } from "../../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../../helper"; +import { translate } from "../../../../../localization"; +/** + * Tests if a value matches a regular expression pattern. + * @template T - The type of the value being tested. + * @param regex - The regular expression pattern to test against. + * @param value - The value to test. + * @returns A boolean indicating whether the value matches the pattern. + */ export function testRegex(regex, value) { - return (value !== null && value !== void 0 ? value : "").length === 0 || regex.test(value); + return (value !== null && value !== void 0 ? value : "").length === 0 || regex.test(value); } /** * Creates a validator decorator that checks if a string value matches a regular expression pattern. - * * @typeparam T - The type of the decorated property (optional string). * @param regex The regular expression pattern to match against the value. * @param message - (Optional) The custom error message to display when validation fails. * @param key - (Optional) The key to identify this validation rule in error messages. Defaults to "Pattern". * @param config - (Optional) An array of validation groups to which this rule belongs. * @returns A decorator function to use with class properties. - * * @example - * // Example 1: Basic usage with default options + * 1: Basic usage with default options + * ```ts * class MyClass { - * @Pattern({ regex: /^[0-9]+$/ }) - * myProperty: string; + * \@Pattern(/^[A-Za-z]+$/) + * lettersOnly: string; * } - * - * // Example 2: Custom error message and validation groups - * class AnotherClass { - * @Pattern({ - * regex: /^[A-Za-z]+$/, + * ``` + * @example + * 2: Custom error message and validation groups + * ```ts + * class MyClass { + * \@Pattern(/^[A-Za-z]+$/, { * key: "AlphabeticPattern", * message: "Must contain only alphabetic characters", - * groups: ["registration", "profile"], + * groups: ["group1", "group2"], * }) - * anotherProperty: string; + * lettersOnly: string; * } + * ``` */ export function Pattern(regex, options) { - return createFieldValidator( - (value, _context, locale) => ({ - key: API.Decorators.key(options, "Pattern"), - valid: testRegex(regex, value), - message: API.Decorators.message( - options, - locale, - translate(locale, "Pattern", regex.toString()) - ), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((value, _context, locale) => ({ + key: buildKeyProp(options, "Pattern"), + valid: testRegex(regex, value), + message: buildMessageProp(options, locale, translate(locale, "Pattern", regex.toString())), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Alpha.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Alpha.d.ts similarity index 68% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Alpha.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Alpha.d.ts index 0f81149eb..706f4cebf 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Alpha.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Alpha.d.ts @@ -1,11 +1,8 @@ -import API from "../../../../../../../index"; -import { type FieldDecorator } from "../../../../../../decorators"; -/** Alpha identifier. */ +import { FieldDecorator } from "../../../../../factory/forField"; +import { DecoratorOptions } from "../../../../../helper"; +import { Objects } from "../../../../../../utilities"; +/** `@Alpha` key. */ export declare const ALPHA = "Alpha"; -/** Internal validation function for {@link Alpha} validator. */ -export declare function isAlphaValid>( - value: T -): boolean; /** * Checks if decorated string contains only alphabetical characters. * @@ -53,7 +50,5 @@ export declare function isAlphaValid>( - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=Alpha.d.ts.map +export declare function Alpha>(options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=Alpha.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Alpha.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Alpha.d.ts.map new file mode 100644 index 000000000..ff3dec451 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Alpha.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Alpha.d.ts","sourceRoot":"","sources":["../../../../../../../../src/decorators/data/validators/string/regex/impl/Alpha.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,oBAAoB;AACpB,eAAO,MAAM,KAAK,UAAU,CAAC;AAQ7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,KAAK,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,cAAc,CAAC,CAAC,CAAC,CASvG"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Alpha.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Alpha.js index 4fd82f921..a4523167a 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Alpha.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Alpha.js @@ -1,14 +1,15 @@ -import API from "../../../../../../../index"; -import { createFieldValidator } from "../../../../../../decorators"; -import { translate } from "../../../../../../localization/service/TranslationService"; -import { testRegex } from "../Pattern"; -import RegexConst from "../shared/regex.constants"; -/** Alpha identifier. */ +import { testRegex } from "../../../../../data/validators/string/regex/Pattern"; +import { RegexConst } from "../../../../../data/validators/string/regex/shared/regex.constants"; +import { createFieldValidator } from "../../../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../../../helper"; +import { translate } from "../../../../../../localization"; +import { Objects } from "../../../../../../utilities"; +/** `@Alpha` key. */ export const ALPHA = "Alpha"; /** Internal validation function for {@link Alpha} validator. */ -export function isAlphaValid(value) { - API.Utilities.Objects.assertType("string", value); - return testRegex(RegexConst.ALPHA, value); +function isAlphaValid(value) { + Objects.assertType("string", value); + return testRegex(RegexConst.ALPHA, value); } /** * Checks if decorated string contains only alphabetical characters. @@ -58,12 +59,9 @@ export function isAlphaValid(value) { * ``` */ export function Alpha(options) { - return createFieldValidator( - (value, _context, locale) => ({ - key: API.Decorators.key(options, ALPHA), - valid: testRegex(RegexConst.ALPHA, value), - message: API.Decorators.message(options, locale, translate(locale, ALPHA)), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((value, _context, locale) => ({ + key: buildKeyProp(options, ALPHA), + valid: isAlphaValid(value), + message: buildMessageProp(options, locale, translate(locale, ALPHA)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Alphanumeric.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Alphanumeric.d.ts similarity index 68% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Alphanumeric.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Alphanumeric.d.ts index f3b923fbd..543124dd0 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Alphanumeric.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Alphanumeric.d.ts @@ -1,11 +1,8 @@ -import API from "../../../../../../../index"; -import { type FieldDecorator } from "../../../../../../decorators"; -/** Alphanumeric identifier. */ +import { FieldDecorator } from "../../../../../factory/forField"; +import { DecoratorOptions } from "../../../../../helper"; +import { Objects } from "../../../../../../utilities"; +/** `@Alphanumeric` key. */ export declare const ALPHANUMERIC = "Alphanumeric"; -/** Internal validation function for {@link Alphanumeric} validator. */ -export declare function isAlphanumericValid>( - value: T -): boolean; /** * Checks if decorated string contains only alphabetical or number characters. * @@ -53,7 +50,5 @@ export declare function isAlphanumericValid>( - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=Alphanumeric.d.ts.map +export declare function Alphanumeric>(options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=Alphanumeric.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Alphanumeric.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Alphanumeric.d.ts.map new file mode 100644 index 000000000..3d4b36070 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Alphanumeric.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Alphanumeric.d.ts","sourceRoot":"","sources":["../../../../../../../../src/decorators/data/validators/string/regex/impl/Alphanumeric.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,2BAA2B;AAC3B,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAQ3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,cAAc,CAAC,CAAC,CAAC,CAS9G"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Alphanumeric.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Alphanumeric.js index 0d5191d6c..6ae0d870e 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Alphanumeric.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Alphanumeric.js @@ -1,14 +1,15 @@ -import API from "../../../../../../../index"; -import { createFieldValidator } from "../../../../../../decorators"; -import { translate } from "../../../../../../localization/service/TranslationService"; -import { testRegex } from "../Pattern"; -import RegexConst from "../shared/regex.constants"; -/** Alphanumeric identifier. */ +import { testRegex } from "../../../../../data/validators/string/regex/Pattern"; +import { RegexConst } from "../../../../../data/validators/string/regex/shared/regex.constants"; +import { createFieldValidator } from "../../../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../../../helper"; +import { translate } from "../../../../../../localization"; +import { Objects } from "../../../../../../utilities"; +/** `@Alphanumeric` key. */ export const ALPHANUMERIC = "Alphanumeric"; /** Internal validation function for {@link Alphanumeric} validator. */ -export function isAlphanumericValid(value) { - API.Utilities.Objects.assertType("string", value); - return testRegex(RegexConst.ALPHANUMERIC, value); +function isAlphanumericValid(value) { + Objects.assertType("string", value); + return testRegex(RegexConst.ALPHANUMERIC, value); } /** * Checks if decorated string contains only alphabetical or number characters. @@ -58,12 +59,9 @@ export function isAlphanumericValid(value) { * ``` */ export function Alphanumeric(options) { - return createFieldValidator( - (value, _context, locale) => ({ - key: API.Decorators.key(options, ALPHANUMERIC), - valid: testRegex(RegexConst.ALPHANUMERIC, value), - message: API.Decorators.message(options, locale, translate(locale, ALPHANUMERIC)), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((value, _context, locale) => ({ + key: buildKeyProp(options, ALPHANUMERIC), + valid: isAlphanumericValid(value), + message: buildMessageProp(options, locale, translate(locale, ALPHANUMERIC)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Email.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Email.d.ts similarity index 66% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Email.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Email.d.ts index 6e0228631..6d7f9622c 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Email.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Email.d.ts @@ -1,11 +1,8 @@ -import API from "../../../../../../../index"; -import { type FieldDecorator } from "../../../../../../decorators"; -/** Email identifier. */ +import { FieldDecorator } from "../../../../../factory/forField"; +import { DecoratorOptions } from "../../../../../helper"; +import { Objects } from "../../../../../../utilities"; +/** `@Email` key. */ export declare const EMAIL = "Email"; -/** Internal validation function for {@link Email} validator. */ -export declare function isEmailValid>( - value: T -): boolean; /** * Checks if decorated string is a valid email. * @@ -53,7 +50,5 @@ export declare function isEmailValid>( - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=Email.d.ts.map +export declare function Email>(options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=Email.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Email.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Email.d.ts.map new file mode 100644 index 000000000..1ce4e6e2e --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Email.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Email.d.ts","sourceRoot":"","sources":["../../../../../../../../src/decorators/data/validators/string/regex/impl/Email.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,oBAAoB;AACpB,eAAO,MAAM,KAAK,UAAU,CAAC;AAQ7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,KAAK,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,cAAc,CAAC,CAAC,CAAC,CASvG"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Email.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Email.js index 202464103..5c632270e 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Email.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Email.js @@ -1,14 +1,15 @@ -import API from "../../../../../../../index"; -import { createFieldValidator } from "../../../../../../decorators"; -import { translate } from "../../../../../../localization/service/TranslationService"; -import { testRegex } from "../Pattern"; -import RegexConst from "../shared/regex.constants"; -/** Email identifier. */ +import { testRegex } from "../../../../../data/validators/string/regex/Pattern"; +import { RegexConst } from "../../../../../data/validators/string/regex/shared/regex.constants"; +import { createFieldValidator } from "../../../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../../../helper"; +import { translate } from "../../../../../../localization"; +import { Objects } from "../../../../../../utilities"; +/** `@Email` key. */ export const EMAIL = "Email"; /** Internal validation function for {@link Email} validator. */ -export function isEmailValid(value) { - API.Utilities.Objects.assertType("string", value); - return testRegex(RegexConst.EMAIL, value); +function isEmailValid(value) { + Objects.assertType("string", value); + return testRegex(RegexConst.EMAIL, value); } /** * Checks if decorated string is a valid email. @@ -58,12 +59,9 @@ export function isEmailValid(value) { * ``` */ export function Email(options) { - return createFieldValidator( - (value, _context, locale) => ({ - key: API.Decorators.key(options, EMAIL), - valid: testRegex(RegexConst.EMAIL, value), - message: API.Decorators.message(options, locale, translate(locale, EMAIL)), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((value, _context, locale) => ({ + key: buildKeyProp(options, EMAIL), + valid: isEmailValid(value), + message: buildMessageProp(options, locale, translate(locale, EMAIL)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/IPAddress.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/IPAddress.d.ts similarity index 66% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/IPAddress.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/IPAddress.d.ts index 866f1f6b9..44b5cb90a 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/IPAddress.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/IPAddress.d.ts @@ -1,11 +1,8 @@ -import API from "../../../../../../../index"; -import { type FieldDecorator } from "../../../../../../decorators"; -/** IPAddress identifier. */ +import { FieldDecorator } from "../../../../../factory/forField"; +import { DecoratorOptions } from "../../../../../helper"; +import { Objects } from "../../../../../../utilities"; +/** `@IPAddress` key. */ export declare const IP_ADDRESS = "IPAddress"; -/** Internal validation function for {@link IPAddress} validator. */ -export declare function isIPAddressValid>( - value: T -): boolean; /** * Checks if decorated string is a valid IP address. * @@ -53,7 +50,5 @@ export declare function isIPAddressValid>( - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=IPAddress.d.ts.map +export declare function IPAddress>(options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=IPAddress.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/IPAddress.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/IPAddress.d.ts.map new file mode 100644 index 000000000..14bcbf407 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/IPAddress.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"IPAddress.d.ts","sourceRoot":"","sources":["../../../../../../../../src/decorators/data/validators/string/regex/impl/IPAddress.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,wBAAwB;AACxB,eAAO,MAAM,UAAU,cAAc,CAAC;AAQtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,cAAc,CAAC,CAAC,CAAC,CAS3G"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/IPAddress.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/IPAddress.js index 27f0950dd..3553234f9 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/IPAddress.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/IPAddress.js @@ -1,14 +1,15 @@ -import API from "../../../../../../../index"; -import { createFieldValidator } from "../../../../../../decorators"; -import { translate } from "../../../../../../localization/service/TranslationService"; -import { testRegex } from "../Pattern"; -import RegexConst from "../shared/regex.constants"; -/** IPAddress identifier. */ +import { testRegex } from "../../../../../data/validators/string/regex/Pattern"; +import { RegexConst } from "../../../../../data/validators/string/regex/shared/regex.constants"; +import { createFieldValidator } from "../../../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../../../helper"; +import { translate } from "../../../../../../localization"; +import { Objects } from "../../../../../../utilities"; +/** `@IPAddress` key. */ export const IP_ADDRESS = "IPAddress"; /** Internal validation function for {@link IPAddress} validator. */ -export function isIPAddressValid(value) { - API.Utilities.Objects.assertType("string", value); - return testRegex(RegexConst.IP_ADDRESS, value); +function isIPAddressValid(value) { + Objects.assertType("string", value); + return testRegex(RegexConst.IP_ADDRESS, value); } /** * Checks if decorated string is a valid IP address. @@ -58,12 +59,9 @@ export function isIPAddressValid(value) { * ``` */ export function IPAddress(options) { - return createFieldValidator( - (value, _context, locale) => ({ - key: API.Decorators.key(options, IP_ADDRESS), - valid: testRegex(RegexConst.IP_ADDRESS, value), - message: API.Decorators.message(options, locale, translate(locale, IP_ADDRESS)), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((value, _context, locale) => ({ + key: buildKeyProp(options, IP_ADDRESS), + valid: isIPAddressValid(value), + message: buildMessageProp(options, locale, translate(locale, IP_ADDRESS)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Lowercase.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Lowercase.d.ts similarity index 67% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Lowercase.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Lowercase.d.ts index 24dc03244..91359d1a8 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Lowercase.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Lowercase.d.ts @@ -1,11 +1,8 @@ -import API from "../../../../../../../index"; -import { type FieldDecorator } from "../../../../../../decorators"; -/** Lowercase identifier. */ +import { FieldDecorator } from "../../../../../factory/forField"; +import { DecoratorOptions } from "../../../../../helper"; +import { Objects } from "../../../../../../utilities"; +/** `@Lowercase` key. */ export declare const LOWERCASE = "Lowercase"; -/** Internal validation function for {@link Lowercase} validator. */ -export declare function isLowercaseValid>( - value: T -): boolean; /** * Checks if decorated string contains only lowercase characters. * @@ -53,7 +50,5 @@ export declare function isLowercaseValid>( - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=Lowercase.d.ts.map +export declare function Lowercase>(options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=Lowercase.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Lowercase.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Lowercase.d.ts.map new file mode 100644 index 000000000..592ae81ab --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Lowercase.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Lowercase.d.ts","sourceRoot":"","sources":["../../../../../../../../src/decorators/data/validators/string/regex/impl/Lowercase.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,wBAAwB;AACxB,eAAO,MAAM,SAAS,cAAc,CAAC;AAQrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,cAAc,CAAC,CAAC,CAAC,CAS3G"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Lowercase.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Lowercase.js index 61f3b0f62..3df5b96ff 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Lowercase.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Lowercase.js @@ -1,14 +1,15 @@ -import API from "../../../../../../../index"; -import { createFieldValidator } from "../../../../../../decorators"; -import { translate } from "../../../../../../localization/service/TranslationService"; -import { testRegex } from "../Pattern"; -import RegexConst from "../shared/regex.constants"; -/** Lowercase identifier. */ +import { testRegex } from "../../../../../data/validators/string/regex/Pattern"; +import { RegexConst } from "../../../../../data/validators/string/regex/shared/regex.constants"; +import { createFieldValidator } from "../../../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../../../helper"; +import { translate } from "../../../../../../localization"; +import { Objects } from "../../../../../../utilities"; +/** `@Lowercase` key. */ export const LOWERCASE = "Lowercase"; /** Internal validation function for {@link Lowercase} validator. */ -export function isLowercaseValid(value) { - API.Utilities.Objects.assertType("string", value); - return testRegex(RegexConst.LOWERCASE, value); +function isLowercaseValid(value) { + Objects.assertType("string", value); + return testRegex(RegexConst.LOWERCASE, value); } /** * Checks if decorated string contains only lowercase characters. @@ -58,12 +59,9 @@ export function isLowercaseValid(value) { * ``` */ export function Lowercase(options) { - return createFieldValidator( - (value, _context, locale) => ({ - key: API.Decorators.key(options, LOWERCASE), - valid: testRegex(RegexConst.LOWERCASE, value), - message: API.Decorators.message(options, locale, translate(locale, LOWERCASE)), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((value, _context, locale) => ({ + key: buildKeyProp(options, LOWERCASE), + valid: isLowercaseValid(value), + message: buildMessageProp(options, locale, translate(locale, LOWERCASE)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Numeric.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Numeric.d.ts similarity index 68% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Numeric.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Numeric.d.ts index c37a97f3d..d56fd96f5 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Numeric.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Numeric.d.ts @@ -1,11 +1,8 @@ -import API from "../../../../../../../index"; -import { type FieldDecorator } from "../../../../../../decorators"; -/** Numeric identifier. */ +import { FieldDecorator } from "../../../../../factory/forField"; +import { DecoratorOptions } from "../../../../../helper"; +import { Objects } from "../../../../../../utilities"; +/** `@Numeric` key. */ export declare const NUMERIC = "Numeric"; -/** Internal validation function for {@link Numeric} validator. */ -export declare function isNumericValid>( - value: T -): boolean; /** * Checks if decorated string contains only numeric characters. * @@ -53,7 +50,5 @@ export declare function isNumericValid>( - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=Numeric.d.ts.map +export declare function Numeric>(options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=Numeric.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Numeric.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Numeric.d.ts.map new file mode 100644 index 000000000..75dea01b3 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Numeric.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Numeric.d.ts","sourceRoot":"","sources":["../../../../../../../../src/decorators/data/validators/string/regex/impl/Numeric.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,sBAAsB;AACtB,eAAO,MAAM,OAAO,YAAY,CAAC;AAQjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,cAAc,CAAC,CAAC,CAAC,CASzG"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Numeric.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Numeric.js index cc78de6ea..0263acd84 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Numeric.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Numeric.js @@ -1,14 +1,15 @@ -import API from "../../../../../../../index"; -import { createFieldValidator } from "../../../../../../decorators"; -import { translate } from "../../../../../../localization/service/TranslationService"; -import { testRegex } from "../Pattern"; -import RegexConst from "../shared/regex.constants"; -/** Numeric identifier. */ +import { testRegex } from "../../../../../data/validators/string/regex/Pattern"; +import { RegexConst } from "../../../../../data/validators/string/regex/shared/regex.constants"; +import { createFieldValidator } from "../../../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../../../helper"; +import { translate } from "../../../../../../localization"; +import { Objects } from "../../../../../../utilities"; +/** `@Numeric` key. */ export const NUMERIC = "Numeric"; /** Internal validation function for {@link Numeric} validator. */ -export function isNumericValid(value) { - API.Utilities.Objects.assertType("string", value); - return testRegex(RegexConst.NUMERIC, value); +function isNumericValid(value) { + Objects.assertType("string", value); + return testRegex(RegexConst.NUMERIC, value); } /** * Checks if decorated string contains only numeric characters. @@ -58,12 +59,9 @@ export function isNumericValid(value) { * ``` */ export function Numeric(options) { - return createFieldValidator( - (value, _context, locale) => ({ - key: API.Decorators.key(options, NUMERIC), - valid: testRegex(RegexConst.NUMERIC, value), - message: API.Decorators.message(options, locale, translate(locale, NUMERIC)), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((value, _context, locale) => ({ + key: buildKeyProp(options, NUMERIC), + valid: testRegex(RegexConst.NUMERIC, value), + message: buildMessageProp(options, locale, translate(locale, NUMERIC)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/URL.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/URL.d.ts similarity index 66% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/URL.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/URL.d.ts index b4b48d4e4..9a2a52e55 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/URL.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/URL.d.ts @@ -1,11 +1,8 @@ -import API from "../../../../../../../index"; -import { type FieldDecorator } from "../../../../../../decorators"; -/** URL identifier. */ +import { FieldDecorator } from "../../../../../factory/forField"; +import { DecoratorOptions } from "../../../../../helper"; +import { Objects } from "../../../../../../utilities"; +/** `@URL` key. */ export declare const URL_KEY = "URL"; -/** Internal validation function for {@link URL} validator. */ -export declare function isURLValid>( - value: T -): boolean; /** * Checks if decorated string is a valid URL. * @@ -53,7 +50,5 @@ export declare function isURLValid>( - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=URL.d.ts.map +export declare function URL>(options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=URL.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/URL.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/URL.d.ts.map new file mode 100644 index 000000000..26975d4f4 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/URL.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"URL.d.ts","sourceRoot":"","sources":["../../../../../../../../src/decorators/data/validators/string/regex/impl/URL.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,kBAAkB;AAClB,eAAO,MAAM,OAAO,QAAQ,CAAC;AAQ7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,cAAc,CAAC,CAAC,CAAC,CASrG"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/URL.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/URL.js index f30935991..27dd62f87 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/URL.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/URL.js @@ -1,14 +1,15 @@ -import API from "../../../../../../../index"; -import { createFieldValidator } from "../../../../../../decorators"; -import { translate } from "../../../../../../localization/service/TranslationService"; -import { testRegex } from "../Pattern"; -import RegexConst from "../shared/regex.constants"; -/** URL identifier. */ +import { testRegex } from "../../../../../data/validators/string/regex/Pattern"; +import { RegexConst } from "../../../../../data/validators/string/regex/shared/regex.constants"; +import { createFieldValidator } from "../../../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../../../helper"; +import { translate } from "../../../../../../localization"; +import { Objects } from "../../../../../../utilities"; +/** `@URL` key. */ export const URL_KEY = "URL"; /** Internal validation function for {@link URL} validator. */ -export function isURLValid(value) { - API.Utilities.Objects.assertType("string", value); - return testRegex(RegexConst.URL, value); +function isURLValid(value) { + Objects.assertType("string", value); + return testRegex(RegexConst.URL, value); } /** * Checks if decorated string is a valid URL. @@ -58,12 +59,9 @@ export function isURLValid(value) { * ``` */ export function URL(options) { - return createFieldValidator( - (value, _context, locale) => ({ - key: API.Decorators.key(options, URL_KEY), - valid: testRegex(RegexConst.URL, value), - message: API.Decorators.message(options, locale, translate(locale, URL_KEY)), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((value, _context, locale) => ({ + key: buildKeyProp(options, URL_KEY), + valid: isURLValid(value), + message: buildMessageProp(options, locale, translate(locale, URL_KEY)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Uppercase.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Uppercase.d.ts similarity index 67% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Uppercase.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Uppercase.d.ts index f31858984..7d68f630f 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Uppercase.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Uppercase.d.ts @@ -1,11 +1,8 @@ -import API from "../../../../../../../index"; -import { type FieldDecorator } from "../../../../../../decorators"; -/** Uppercase identifier. */ +import { FieldDecorator } from "../../../../../factory/forField"; +import { DecoratorOptions } from "../../../../../helper"; +import { Objects } from "../../../../../../utilities"; +/** `@Uppercase` key. */ export declare const UPPERCASE = "Uppercase"; -/** Internal validation function for {@link Uppercase} validator. */ -export declare function isUppercaseValid>( - value: T -): boolean; /** * Checks if decorated string contains only uppercase characters. * @@ -53,7 +50,5 @@ export declare function isUppercaseValid>( - options?: API.Decorators.Options -): FieldDecorator; -//# sourceMappingURL=Uppercase.d.ts.map +export declare function Uppercase>(options?: DecoratorOptions): FieldDecorator; +//# sourceMappingURL=Uppercase.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Uppercase.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Uppercase.d.ts.map new file mode 100644 index 000000000..96c073e22 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Uppercase.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Uppercase.d.ts","sourceRoot":"","sources":["../../../../../../../../src/decorators/data/validators/string/regex/impl/Uppercase.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAmD,MAAM,oBAAoB,CAAC;AAEvG,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,wBAAwB;AACxB,eAAO,MAAM,SAAS,cAAc,CAAC;AAQrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,cAAc,CAAC,CAAC,CAAC,CAS3G"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Uppercase.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Uppercase.js index 84dfd60bc..c1ee97be1 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Uppercase.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/impl/Uppercase.js @@ -1,14 +1,15 @@ -import API from "../../../../../../../index"; -import { createFieldValidator } from "../../../../../../decorators"; -import { translate } from "../../../../../../localization/service/TranslationService"; -import { testRegex } from "../Pattern"; -import RegexConst from "../shared/regex.constants"; -/** Uppercase identifier. */ +import { testRegex } from "../../../../../data/validators/string/regex/Pattern"; +import { RegexConst } from "../../../../../data/validators/string/regex/shared/regex.constants"; +import { createFieldValidator } from "../../../../../factory/forField"; +import { buildGroupsProp, buildKeyProp, buildMessageProp } from "../../../../../helper"; +import { translate } from "../../../../../../localization"; +import { Objects } from "../../../../../../utilities"; +/** `@Uppercase` key. */ export const UPPERCASE = "Uppercase"; /** Internal validation function for {@link Uppercase} validator. */ -export function isUppercaseValid(value) { - API.Utilities.Objects.assertType("string", value); - return testRegex(RegexConst.UPPERCASE, value); +function isUppercaseValid(value) { + Objects.assertType("string", value); + return testRegex(RegexConst.UPPERCASE, value); } /** * Checks if decorated string contains only uppercase characters. @@ -58,12 +59,9 @@ export function isUppercaseValid(value) { * ``` */ export function Uppercase(options) { - return createFieldValidator( - (value, _context, locale) => ({ - key: API.Decorators.key(options, UPPERCASE), - valid: testRegex(RegexConst.UPPERCASE, value), - message: API.Decorators.message(options, locale, translate(locale, UPPERCASE)), - }), - API.Decorators.groups(options) - ); + return createFieldValidator((value, _context, locale) => ({ + key: buildKeyProp(options, UPPERCASE), + valid: isUppercaseValid(value), + message: buildMessageProp(options, locale, translate(locale, UPPERCASE)), + }), buildGroupsProp(options)); } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/shared/regex.constants.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/shared/regex.constants.d.ts similarity index 89% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/shared/regex.constants.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/shared/regex.constants.d.ts index dede73ab5..79599150f 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/shared/regex.constants.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/shared/regex.constants.d.ts @@ -1,15 +1,13 @@ /** * A collection of commonly used regular expressions. - * - * @remarks - * This object provides regular expressions for various validation scenarios. - * + * @remarks This object provides regular expressions for various validation scenarios. * @example - * ```typescript + * 1: Validating URLs + * ```ts * const isURL = RegexConst.URL.test("https://example.com"); * ``` */ -declare const RegexConst: { +export declare const RegexConst: { /** Regular expression for validating URLs. */ readonly URL: RegExp; /** Regular expression for validating email addresses. */ @@ -35,5 +33,4 @@ declare const RegexConst: { /** Regular expression for validating alphanumeric strings. */ readonly ALPHANUMERIC: RegExp; }; -export default RegexConst; //# sourceMappingURL=regex.constants.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/shared/regex.constants.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/shared/regex.constants.d.ts.map new file mode 100644 index 000000000..20ee001ea --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/shared/regex.constants.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"regex.constants.d.ts","sourceRoot":"","sources":["../../../../../../../../src/decorators/data/validators/string/regex/shared/regex.constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,UAAU;IACrB,8CAA8C;;IAG9C,yDAAyD;;IAGzD,yDAAyD;;IAGzD,4DAA4D;;IAG5D,sDAAsD;;IAGtD,sEAAsE;;IAGtE,sEAAsE;;IAGtE,2FAA2F;;IAG3F,2FAA2F;;IAG3F,8EAA8E;;IAG9E,8EAA8E;;IAG9E,8DAA8D;;CAEtD,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/shared/regex.constants.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/shared/regex.constants.js index dd272a043..fd1931e74 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/shared/regex.constants.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/data/validators/string/regex/shared/regex.constants.js @@ -1,16 +1,14 @@ /** * A collection of commonly used regular expressions. - * - * @remarks - * This object provides regular expressions for various validation scenarios. - * + * @remarks This object provides regular expressions for various validation scenarios. * @example - * ```typescript + * 1: Validating URLs + * ```ts * const isURL = RegexConst.URL.test("https://example.com"); * ``` */ // prettier-ignore -const RegexConst = { +export const RegexConst = { /** Regular expression for validating URLs. */ URL: /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/, /** Regular expression for validating email addresses. */ @@ -36,4 +34,3 @@ const RegexConst = { /** Regular expression for validating alphanumeric strings. */ ALPHANUMERIC: /^[a-zA-Z0-9]+$/ }; -export default RegexConst; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forClass/createClassDecorator.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forClass/createClassDecorator.d.ts new file mode 100644 index 000000000..a4f69104b --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forClass/createClassDecorator.d.ts @@ -0,0 +1,35 @@ +import { ClassValidatorMetaService } from "../../../reflection"; +import { Types } from "../../../utilities"; +/** + * Represents a class decorator function. + * @typeParam TClass - The type of the class being decorated. + * @param baseClass - The base class being decorated. + * @param context - The context object for the class decorator. + * @returns The decorated class or undefined/void. + */ +export type ClassDecorator = ((baseClass: TClass, context: ClassDecoratorCtx) => TClass | undefined | void) & {}; +/** + * Type definition for a class decorator supplier. + * A class decorator supplier is a function that takes in metadata, base class, and context, + * and returns a modified class or undefined/void. + * @typeParam TClass - The type of the base class. + * @param meta - The metadata service for class validation. + * @param baseClass - The base class to be decorated. + * @param context - The context object for the class decorator. + * @returns The modified class or undefined/void. + */ +export type ClassDecoratorSupplier = ((meta: ClassValidatorMetaService, baseClass: TClass, context: ClassDecoratorCtx) => TClass | undefined | void) & {}; +/** + * Type definition for the context of a class decorator. + * @typeParam T - The type of the class being decorated. + */ +export type ClassDecoratorCtx = ClassDecoratorContext; +/** + * Creates a new class decorator function using the provided supplier. + * + * @typeParam T - The type of the class being decorated. + * @param supplier - A callback that defines the basic class decorator behavior and returns the modified class. + * @returns A basic class decorator factory. + */ +export declare function createClassDecorator(supplier: ClassDecoratorSupplier): ClassDecorator; +//# sourceMappingURL=createClassDecorator.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forClass/createClassDecorator.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forClass/createClassDecorator.d.ts.map new file mode 100644 index 000000000..22dfd2fb3 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forClass/createClassDecorator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"createClassDecorator.d.ts","sourceRoot":"","sources":["../../../../../src/decorators/factory/forClass/createClassDecorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAgB,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,CAAC,MAAM,SAAS,KAAK,CAAC,KAAK,IAAI,CAAC,CACxD,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,iBAAiB,CAAC,MAAM,CAAC,KAE/B,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AAErC;;;;;;;;;GASG;AACH,MAAM,MAAM,sBAAsB,CAAC,MAAM,SAAS,KAAK,CAAC,KAAK,IAAI,CAAC,CAChE,IAAI,EAAE,yBAAyB,CAAC,MAAM,CAAC,EACvC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,iBAAiB,CAAC,MAAM,CAAC,KAE/B,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AAErC;;;GAGG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,KAAK,CAAC,KAAK,IAAI,qBAAqB,CAAC,CAAC,CAAC,CAAC;AAEhF;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,SAAS,KAAK,CAAC,KAAK,EAC7D,QAAQ,EAAE,sBAAsB,CAAC,MAAM,CAAC,GACvC,cAAc,CAAC,GAAG,CAAC,CAIrB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forClass/createClassDecorator.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forClass/createClassDecorator.js index 17cf2d9fc..65748fc70 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forClass/createClassDecorator.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forClass/createClassDecorator.js @@ -1,5 +1,5 @@ -import API from "../../../index"; -import { EventEmitter } from "../../../utilities/misc/EventEmitter"; +import { ClassValidatorMetaService } from "../../../reflection"; +import { EventEmitter } from "../../../utilities"; /** * Creates a new class decorator function using the provided supplier. * @@ -9,6 +9,6 @@ import { EventEmitter } from "../../../utilities/misc/EventEmitter"; */ export function createClassDecorator(supplier) { return function (baseClass, context) { - return supplier(API.Reflection.ClassValidatorMetaService.inject(baseClass !== null && baseClass !== void 0 ? baseClass : context, EventEmitter.EMPTY), baseClass, context); + return supplier(ClassValidatorMetaService.inject(baseClass !== null && baseClass !== void 0 ? baseClass : context, EventEmitter.EMPTY), baseClass, context); }; } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forClass/createClassValidator.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forClass/createClassValidator.d.ts similarity index 63% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forClass/createClassValidator.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forClass/createClassValidator.d.ts index 4bdcac09a..71a5a9cb4 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forClass/createClassValidator.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forClass/createClassValidator.d.ts @@ -1,8 +1,8 @@ -import type API from "../../../index"; -import { type ClassDecorator } from "./createClassDecorator"; +import { Types } from "../../../utilities"; +import type { ValidationEvaluator } from "../../../validation/types"; +import { ClassDecorator } from "./createClassDecorator"; /** * Creates validation decorators for classes. - * * @typeParam T - The type of class being validated. * @param validate - The callback that defines the validation logic. * @param groups - Validation groups. @@ -16,7 +16,7 @@ import { type ClassDecorator } from "./createClassDecorator"; * } * * function PropGreaterThan(prop: keyof MyClass, value: number) { - * return API.Decorator.ForClass.Validator.build(instance => ({ + * return Decorators.ForClass.Validator.build(instance => ({ * key: "PropGreaterThan", * valid: instance[prop] > value, * message: `${prop} must be greater than ${value}` @@ -24,5 +24,5 @@ import { type ClassDecorator } from "./createClassDecorator"; * } * ``` */ -export declare function createClassValidator(validate: API.Validation.ValidationEvaluator>, groups?: string[]): ClassDecorator; +export declare function createClassValidator(validate: ValidationEvaluator>, groups?: string[]): ClassDecorator; //# sourceMappingURL=createClassValidator.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forClass/createClassValidator.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forClass/createClassValidator.d.ts.map new file mode 100644 index 000000000..326e8dde1 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forClass/createClassValidator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"createClassValidator.d.ts","sourceRoot":"","sources":["../../../../../src/decorators/factory/forClass/createClassValidator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAwB,MAAM,wBAAwB,CAAC;AAE9E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,KAAK,CAAC,KAAK,EACxD,QAAQ,EAAE,mBAAmB,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EACnD,MAAM,GAAE,MAAM,EAAO,GACpB,cAAc,CAAC,CAAC,CAAC,CAInB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forClass/createClassValidator.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forClass/createClassValidator.js index 58302c1d5..fc78ea375 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forClass/createClassValidator.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forClass/createClassValidator.js @@ -1,7 +1,6 @@ import { createClassDecorator } from "./createClassDecorator"; /** * Creates validation decorators for classes. - * * @typeParam T - The type of class being validated. * @param validate - The callback that defines the validation logic. * @param groups - Validation groups. @@ -15,7 +14,7 @@ import { createClassDecorator } from "./createClassDecorator"; * } * * function PropGreaterThan(prop: keyof MyClass, value: number) { - * return API.Decorator.ForClass.Validator.build(instance => ({ + * return Decorators.ForClass.Validator.build(instance => ({ * key: "PropGreaterThan", * valid: instance[prop] > value, * message: `${prop} must be greater than ${value}` diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forClass/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forClass/index.d.ts similarity index 100% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forClass/index.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forClass/index.d.ts diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forClass/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forClass/index.d.ts.map new file mode 100644 index 000000000..958a45d2e --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forClass/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/decorators/factory/forClass/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forField/createFieldDecorator.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forField/createFieldDecorator.d.ts new file mode 100644 index 000000000..24fa802ad --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forField/createFieldDecorator.d.ts @@ -0,0 +1,39 @@ +import { DecoratorArgs } from "../../helper"; +import { FieldValidatorMetaService } from "../../../reflection"; +/** + * Represents a field decorator function that is used to decorate fields in a class. + * The decorator function takes two parameters: the target object and the context object. + * The target object represents the class or prototype that the decorator is applied to. + * The context object provides additional information about the field being decorated. + * @typeParam T - The type of the field being decorated. + */ +export type FieldDecorator = ((target: any, context: FieldDecoratorCtx) => void) & {}; +/** + * Type definition for the FieldDecoratorSupplier function. + * This function is used to create field decorators. + * @typeParam T The type of the field value. + * @param meta The meta service for field validators. + * @param name The name of the field. + * @param context The context object for the field decorator. + * @param args The decorator arguments. + */ +export type FieldDecoratorSupplier = ((meta: FieldValidatorMetaService, name: string, context: FieldDecoratorCtx, args: DecoratorArgs) => void) & {}; +/** Represents the context of a field decorator. */ +export type FieldDecoratorCtx = Readonly<{ + kind: "getter" | "method" | "field"; + static: boolean; + private: boolean; + name: string; + metadata?: globalThis.DecoratorMetadataObject; + access: { + get: (object: any) => T; + }; +}>; +/** + * Creates a new field decorator function using the provided supplier. + * @typeParam T - The type of the field being decorated. + * @param supplier - A callback that defines the basic field decorator behavior. + * @returns A basic field decorator factory. + */ +export declare function createFieldDecorator(supplier: FieldDecoratorSupplier): FieldDecorator; +//# sourceMappingURL=createFieldDecorator.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forField/createFieldDecorator.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forField/createFieldDecorator.d.ts.map new file mode 100644 index 000000000..fd542e53a --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forField/createFieldDecorator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"createFieldDecorator.d.ts","sourceRoot":"","sources":["../../../../../src/decorators/factory/forField/createFieldDecorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAGxD;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,OAAO,IAAI,CAAC,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,GAAG,EAAE,CAAC;AAE5G;;;;;;;;GAQG;AACH,MAAM,MAAM,sBAAsB,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,IAAI,CAAC,CACjE,IAAI,EAAE,yBAAyB,EAC/B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAC7B,IAAI,EAAE,aAAa,KAChB,IAAI,CAAC,GAAG,EAAE,CAAC;AAEhB,mDAAmD;AACnD,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,OAAO,IAAI,QAAQ,CAAC;IAC1D,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,UAAU,CAAC,uBAAuB,CAAC;IAC9C,MAAM,EAAE;QACN,GAAG,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC;KACzB,CAAC;CACH,CAAC,CAAC;AAEH;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,OAAO,EAAE,QAAQ,EAAE,sBAAsB,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAS9G"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forField/createFieldDecorator.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forField/createFieldDecorator.js index 0cf2bd7b6..ed08f713b 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forField/createFieldDecorator.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forField/createFieldDecorator.js @@ -1,5 +1,5 @@ -import API from "../../../index"; -import { EventEmitter } from "../../../utilities/misc/EventEmitter"; +import { FieldValidatorMetaService } from "../../../reflection"; +import { EventEmitter } from "../../../utilities"; /** * Creates a new field decorator function using the provided supplier. * @typeParam T - The type of the field being decorated. @@ -12,7 +12,7 @@ export function createFieldDecorator(supplier) { const nameEval = isStage2 ? context : context.name; const strategyEval = isStage2 ? target.constructor : context; const contextEval = isStage2 ? { name: context, metadata: {} } : context; - const metaService = API.Reflection.FieldValidatorMetaService.inject(strategyEval, EventEmitter.EMPTY); + const metaService = FieldValidatorMetaService.inject(strategyEval, EventEmitter.EMPTY); supplier(metaService, String(nameEval), contextEval, {}); }; } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forField/createFieldValidator.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forField/createFieldValidator.d.ts similarity index 79% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forField/createFieldValidator.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forField/createFieldValidator.d.ts index b69dd8b05..171fcb5f8 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forField/createFieldValidator.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forField/createFieldValidator.d.ts @@ -1,5 +1,5 @@ -import type API from "../../../index"; -import { type FieldDecorator } from "./createFieldDecorator"; +import type { ValidationEvaluator } from "../../../validation/types"; +import { FieldDecorator } from "./createFieldDecorator"; /** * Creates validation decorators for fields. * @@ -24,5 +24,5 @@ import { type FieldDecorator } from "./createFieldDecorator"; * } * ``` */ -export declare function createFieldValidator(validate: API.Validation.ValidationEvaluator, groups?: string[]): FieldDecorator; +export declare function createFieldValidator(validate: ValidationEvaluator, groups?: string[]): FieldDecorator; //# sourceMappingURL=createFieldValidator.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forField/createFieldValidator.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forField/createFieldValidator.d.ts.map new file mode 100644 index 000000000..b591f308e --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forField/createFieldValidator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"createFieldValidator.d.ts","sourceRoot":"","sources":["../../../../../src/decorators/factory/forField/createFieldValidator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAwB,MAAM,wBAAwB,CAAC;AAE9E;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,OAAO,EACpD,QAAQ,EAAE,mBAAmB,CAAC,CAAC,CAAC,EAChC,MAAM,CAAC,EAAE,MAAM,EAAE,GAChB,cAAc,CAAC,CAAC,CAAC,CAInB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forField/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forField/index.d.ts similarity index 100% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forField/index.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forField/index.d.ts diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forField/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forField/index.d.ts.map new file mode 100644 index 000000000..f9b9b840d --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/forField/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/decorators/factory/forField/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/index.d.ts new file mode 100644 index 000000000..c551403db --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/index.d.ts @@ -0,0 +1,3 @@ +export * from "./forClass"; +export * from "./forField"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/index.d.ts.map new file mode 100644 index 000000000..0026de86b --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/decorators/factory/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/index.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/index.js index cf8989886..e18b7f818 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/index.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/factory/index.js @@ -1,2 +1,2 @@ -export * from "./forClass/index"; -export * from "./forField/index"; +export * from "./forClass"; +export * from "./forField"; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/helper.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/helper.d.ts new file mode 100644 index 000000000..1e5624101 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/helper.d.ts @@ -0,0 +1,38 @@ +import { Locale } from "../localization"; +/** Represents decorator external dependency arguments. */ +export type DecoratorArgs = Record; +/** Generic validator decorator configurable options. */ +export type DecoratorOptions = { + /** Identifier of the validator decorator. */ + key?: string; + /** Error message to be evaluated through a preprocessor, which can have a custom or default implementation based on library setup. */ + message?: string; + /** Unique list of groups for conditional validation. Validator triggers only if the form is applied on a listed group. */ + groups?: string[]; +}; +/** + * Retrieves the localized message based on the provided options, locale, and default message. + * If the options contain a custom message, it will be resolved using the provided locale. + * If no custom message is provided, the default message will be returned. + * + * @param options - The options object that may contain a custom message. + * @param locale - The locale resolver used to resolve the custom message. + * @param defaultMessage - The default message to be returned if no custom message is provided. + * @returns The localized message. + */ +export declare function buildMessageProp(options: DecoratorOptions | undefined, locale: Locale, defaultMessage: string): string; +/** + * Retrieves the unique groups from the provided options or returns the default groups. + * @param options - The options object. + * @param defaultGroups - The default groups. + * @returns An array of unique groups. + */ +export declare function buildGroupsProp(options?: DecoratorOptions, defaultGroups?: string[]): string[]; +/** + * Returns the key based on the provided options or the default key. + * @param options - The options object. + * @param defaultKey - The default key. + * @returns The key. + */ +export declare function buildKeyProp(options: DecoratorOptions | undefined, defaultKey: string): string; +//# sourceMappingURL=helper.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/helper.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/helper.d.ts.map new file mode 100644 index 000000000..85ccb6a29 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/helper.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../src/decorators/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAgB,MAAM,eAAe,CAAC;AAGrD,0DAA0D;AAC1D,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAEhD,wDAAwD;AACxD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,6CAA6C;IAC7C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,sIAAsI;IACtI,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0HAA0H;IAC1H,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,gBAAgB,GAAG,SAAS,EACrC,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,MAAM,GACrB,MAAM,CAGR;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,gBAAgB,EAAE,aAAa,GAAE,MAAM,EAAO,GAAG,MAAM,EAAE,CAElG;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,gBAAgB,GAAG,SAAS,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAE9F"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/helper.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/helper.js new file mode 100644 index 000000000..eb322f603 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/helper.js @@ -0,0 +1,36 @@ +import { parseMessage } from "../localization"; +import { Objects } from "../utilities"; +/** + * Retrieves the localized message based on the provided options, locale, and default message. + * If the options contain a custom message, it will be resolved using the provided locale. + * If no custom message is provided, the default message will be returned. + * + * @param options - The options object that may contain a custom message. + * @param locale - The locale resolver used to resolve the custom message. + * @param defaultMessage - The default message to be returned if no custom message is provided. + * @returns The localized message. + */ +export function buildMessageProp(options, locale, defaultMessage) { + var _a; + const msg = (_a = options === null || options === void 0 ? void 0 : options.message) !== null && _a !== void 0 ? _a : ""; + return msg.length > 0 ? parseMessage(locale, msg) : defaultMessage !== null && defaultMessage !== void 0 ? defaultMessage : ""; +} +/** + * Retrieves the unique groups from the provided options or returns the default groups. + * @param options - The options object. + * @param defaultGroups - The default groups. + * @returns An array of unique groups. + */ +export function buildGroupsProp(options, defaultGroups = []) { + return Array.isArray(options === null || options === void 0 ? void 0 : options.groups) ? Objects.unique(options.groups) : Objects.unique(defaultGroups); +} +/** + * Returns the key based on the provided options or the default key. + * @param options - The options object. + * @param defaultKey - The default key. + * @returns The key. + */ +export function buildKeyProp(options, defaultKey) { + var _a; + return (_a = options === null || options === void 0 ? void 0 : options.key) !== null && _a !== void 0 ? _a : defaultKey; +} diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/index.d.ts new file mode 100644 index 000000000..bae387ff3 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/index.d.ts @@ -0,0 +1,4 @@ +export * from "./data"; +export * from "./factory"; +export * from "./helper"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/index.d.ts.map new file mode 100644 index 000000000..b4244e1ab --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/decorators/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/index.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/index.js index 3935641db..d985ba9af 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/index.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/decorators/index.js @@ -1,45 +1,3 @@ -import API from "../../index"; export * from "./data"; export * from "./factory"; -export var Config; -(function (Config) { - /** - * Retrieves the localized message based on the provided options, locale, and default message. - * If the options contain a custom message, it will be resolved using the provided locale. - * If no custom message is provided, the default message will be returned. - * - * @param options - The options object that may contain a custom message. - * @param locale - The locale resolver used to resolve the custom message. - * @param defaultMessage - The default message to be returned if no custom message is provided. - * @returns The localized message. - */ - function message(options, locale, defaultMessage) { - var _a; - const msg = (_a = options === null || options === void 0 ? void 0 : options.message) !== null && _a !== void 0 ? _a : ""; - return msg.length > 0 ? API.Localization.parseMessage(locale, msg) : defaultMessage !== null && defaultMessage !== void 0 ? defaultMessage : ""; - } - Config.message = message; - /** - * Retrieves the unique groups from the provided options or returns the default groups. - * @param options - The options object. - * @param defaultGroups - The default groups. - * @returns An array of unique groups. - */ - function groups(options, defaultGroups = []) { - return Array.isArray(options === null || options === void 0 ? void 0 : options.groups) - ? API.Utilities.Objects.unique(options.groups) - : API.Utilities.Objects.unique(defaultGroups); - } - Config.groups = groups; - /** - * Returns the key based on the provided options or the default key. - * @param options - The options object. - * @param defaultKey - The default key. - * @returns The key. - */ - function key(options, defaultKey) { - var _a; - return (_a = options === null || options === void 0 ? void 0 : options.key) !== null && _a !== void 0 ? _a : defaultKey; - } - Config.key = key; -})(Config || (Config = {})); +export * from "./helper"; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/index.d.ts new file mode 100644 index 000000000..3854ca928 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/index.d.ts @@ -0,0 +1,7 @@ +export * from "./utilities"; +export * from "./localization"; +export * from "./decorators"; +export * from "./reflection"; +export * from "./strategy"; +export * from "./validation"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/index.d.ts.map new file mode 100644 index 000000000..3dafe1098 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAC;AAE5B,cAAc,gBAAgB,CAAC;AAE/B,cAAc,cAAc,CAAC;AAE7B,cAAc,cAAc,CAAC;AAE7B,cAAc,YAAY,CAAC;AAE3B,cAAc,cAAc,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/index.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/index.js index d98e1832f..37b7f502c 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/index.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/index.js @@ -1,30 +1,7 @@ -import * as _Decorator from "./decorators"; -import * as _collection from "./decorators/data"; -import * as _attribute from "./decorators/data/structural/attribute"; -import * as _Localization from "./localization"; -import * as _Reflection from "./reflection"; -import * as _Strategy from "./strategy"; -import * as _Utilities from "./utilities"; -import * as _Validation from "./validation"; -/** `tdv-core` API entry-point. */ -var API; -(function (API) { - API.Localization = _Localization; - API.Validation = _Validation; - API.Decorator = _Decorator; - API.Utilities = _Utilities; - API.Reflection = _Reflection; - API.collection = _collection; - API.attribute = _attribute.attribute; - API.Strategy = _Strategy; - /** - * Configuration object for the `tdv-core` package. - */ - API.Configuration = { - /** - * The delay in milliseconds for async validation. Defaults to `500 ms` - */ - asyncValidationDelay: 500, - }; -})(API || (API = {})); -export default API; +// samo prati redoslijed +export * from "./utilities"; +export * from "./localization"; +export * from "./decorators"; +export * from "./reflection"; +export * from "./strategy"; +export * from "./validation"; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/index.d.ts new file mode 100644 index 000000000..a74546563 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/index.d.ts @@ -0,0 +1,3 @@ +export * from "./resolver"; +export * from "./service"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/index.d.ts.map new file mode 100644 index 000000000..6c9518f64 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/localization/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/index.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/index.js index 15b6647e9..599d92c8c 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/index.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/index.js @@ -1,2 +1,2 @@ -export * from "./resolver/LocaleResolver"; -export * from "./resolver/MessageResolver"; +export * from "./resolver"; +export * from "./service"; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/localization/resolver/LocaleResolver.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/resolver/LocaleResolver.d.ts similarity index 100% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/localization/resolver/LocaleResolver.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/resolver/LocaleResolver.d.ts diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/resolver/LocaleResolver.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/resolver/LocaleResolver.d.ts.map new file mode 100644 index 000000000..aafbe416b --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/resolver/LocaleResolver.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"LocaleResolver.d.ts","sourceRoot":"","sources":["../../../../src/localization/resolver/LocaleResolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,MAAM,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAOpE;;GAEG;AACH,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAEnD"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/resolver/MessageResolver.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/resolver/MessageResolver.d.ts new file mode 100644 index 000000000..7d54f003f --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/resolver/MessageResolver.d.ts @@ -0,0 +1,12 @@ +import { Locale } from "../resolver/LocaleResolver"; +/** Message parser definition. */ +export type MessageParser = ((locale: Locale, message: string) => string) & {}; +/** + * Is used to globally define a custom message parser. + */ +export declare function configureParser(handler?: MessageParser): void; +/** + * Internal handler for the customized message parser + */ +export declare function parseMessage(locale: Locale, message: string): string; +//# sourceMappingURL=MessageResolver.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/resolver/MessageResolver.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/resolver/MessageResolver.d.ts.map new file mode 100644 index 000000000..d61a3b4aa --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/resolver/MessageResolver.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MessageResolver.d.ts","sourceRoot":"","sources":["../../../../src/localization/resolver/MessageResolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAE/D,iCAAiC;AACjC,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,EAAE,CAAC;AAM/E;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI,CAE7D;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CASpE"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/resolver/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/resolver/index.d.ts new file mode 100644 index 000000000..39af05b94 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/resolver/index.d.ts @@ -0,0 +1,3 @@ +export * from "./LocaleResolver"; +export * from "./MessageResolver"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/resolver/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/resolver/index.d.ts.map new file mode 100644 index 000000000..e925c1cdc --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/resolver/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/localization/resolver/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/resolver/index.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/resolver/index.js new file mode 100644 index 000000000..b93e66dd9 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/resolver/index.js @@ -0,0 +1,2 @@ +export * from "./LocaleResolver"; +export * from "./MessageResolver"; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/localization/service/MessageReaderService.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/service/MessageReaderService.d.ts similarity index 84% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/localization/service/MessageReaderService.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/service/MessageReaderService.d.ts index fd768e882..9b8eac7ef 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/localization/service/MessageReaderService.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/service/MessageReaderService.d.ts @@ -1,4 +1,4 @@ -import * as LocaleResolver from "../resolver/LocaleResolver"; +import { Locale } from "../resolver/LocaleResolver"; import * as en from "../translations/en.json"; /** * All translation json files content in map, grouped by `Locale`. @@ -16,7 +16,7 @@ export type LocalizedMessages = typeof en; * in which the key represents a translation identifier while the value * corresponds to the identifier's localized string. */ -export type Messages = Record; +export type Messages = Record; export type MessageKey = keyof LocalizedMessages; /** * Returns localized message by key, allowing `locale` to be optional (defaults to global `locale`). @@ -24,5 +24,5 @@ export type MessageKey = keyof LocalizedMessages; * @param locale Locale to translate by * @returns Localized message by key. */ -export declare function getMessage(key: keyof LocalizedMessages, locale?: LocaleResolver.Locale | null): string; +export declare function getMessage(key: keyof LocalizedMessages, locale?: Locale | null): string; //# sourceMappingURL=MessageReaderService.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/service/MessageReaderService.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/service/MessageReaderService.d.ts.map new file mode 100644 index 000000000..2e778e796 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/service/MessageReaderService.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MessageReaderService.d.ts","sourceRoot":"","sources":["../../../../src/localization/service/MessageReaderService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAa,MAAM,uCAAuC,CAAC;AAG1E,OAAO,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAO9C;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,QAQtB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,EAAE,CAAC;AAE1C;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAEzD,MAAM,MAAM,UAAU,GAAG,MAAM,iBAAiB,CAAC;AAEjD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,iBAAiB,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAIvF"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/service/MessageReaderService.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/service/MessageReaderService.js index 1d42e8da4..524a7e988 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/service/MessageReaderService.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/service/MessageReaderService.js @@ -1,4 +1,4 @@ -import * as LocaleResolver from "../resolver/LocaleResolver"; +import { getLocale } from "../resolver/LocaleResolver"; import * as de from "../translations/de.json"; import * as en from "../translations/en.json"; import * as es from "../translations/es.json"; @@ -25,7 +25,7 @@ export const messages = { * @returns Localized message by key. */ export function getMessage(key, locale) { - const computedLocale = locale !== null && locale !== void 0 ? locale : LocaleResolver.getLocale(); + const computedLocale = locale !== null && locale !== void 0 ? locale : getLocale(); const computedLocaleMessages = messages[computedLocale]; return computedLocaleMessages[key]; } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/localization/service/TranslationService.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/service/TranslationService.d.ts similarity index 81% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/localization/service/TranslationService.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/service/TranslationService.d.ts index 5bd27b2cb..d1359f7bb 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/localization/service/TranslationService.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/service/TranslationService.d.ts @@ -1,5 +1,5 @@ -import API from "../../../index"; -import { type LocalizedMessages } from "./MessageReaderService"; +import { Locale } from "../resolver/LocaleResolver"; +import { LocalizedMessages } from "../service/MessageReaderService"; /** * Localizes a string based on a corresponding key and optional arguments mapped by indices. (ex: `"Hello {0}! How are you?"`) * @@ -26,5 +26,5 @@ import { type LocalizedMessages } from "./MessageReaderService"; * const greeting = translate("en", "Hello", "John Doe"); // "Hello John Doe! How are you?" * ``` */ -export declare function translate(locale: API.Localization.Locale | null | undefined, key: keyof LocalizedMessages, ...args: any[]): string; +export declare function translate(locale: Locale | null | undefined, key: keyof LocalizedMessages, ...args: any[]): string; //# sourceMappingURL=TranslationService.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/service/TranslationService.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/service/TranslationService.d.ts.map new file mode 100644 index 000000000..90169a9f4 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/service/TranslationService.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TranslationService.d.ts","sourceRoot":"","sources":["../../../../src/localization/service/TranslationService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAc,MAAM,4CAA4C,CAAC;AAoB3F;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,iBAAiB,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,MAAM,CAIjH"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/service/TranslationService.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/service/TranslationService.js index fc1731819..4c1b5cfdd 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/service/TranslationService.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/service/TranslationService.js @@ -1,5 +1,21 @@ -import API from "../../../index"; -import { getMessage } from "./MessageReaderService"; +import { getMessage } from "../service/MessageReaderService"; +/** + * Formats a string by replacing placeholders with provided arguments. + * @param str - The string containing placeholders in the form of `{0}`, `{1}`, etc. + * @param args - The values to replace the placeholders with. + * @returns The formatted string with placeholders replaced by the corresponding values from `args`. + * @remarks If a placeholder's corresponding value is not provided in `args`, the placeholder will remain unchanged in the output string. + * @example + * 1: Basic usage + * ```ts + * const formatted = sprintf("Hello, {0}!", "World"); // Output: "Hello, World!" + * ``` + */ +function sprintf(str, ...args) { + return str.replace(/{(\d+)}/g, function (match, number) { + return typeof args[number] !== "undefined" ? args[number] : match; + }); +} /** * Localizes a string based on a corresponding key and optional arguments mapped by indices. (ex: `"Hello {0}! How are you?"`) * @@ -28,6 +44,6 @@ import { getMessage } from "./MessageReaderService"; */ export function translate(locale, key, ...args) { const message = getMessage(key, locale); - const translatedMessage = API.Utilities.Strings.sprintf(message, ...args); + const translatedMessage = sprintf(message, ...args); return translatedMessage; } diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/service/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/service/index.d.ts new file mode 100644 index 000000000..ae0b64412 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/service/index.d.ts @@ -0,0 +1,3 @@ +export * from "./MessageReaderService"; +export * from "./TranslationService"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/service/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/service/index.d.ts.map new file mode 100644 index 000000000..cc6d9b6a6 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/service/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/localization/service/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/service/index.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/service/index.js new file mode 100644 index 000000000..6e10ab30a --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/localization/service/index.js @@ -0,0 +1,2 @@ +export * from "./MessageReaderService"; +export * from "./TranslationService"; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/index.d.ts new file mode 100644 index 000000000..ab546f6f7 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/index.d.ts @@ -0,0 +1,2 @@ +export * from "./service"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/index.d.ts.map new file mode 100644 index 000000000..7aa43d314 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/reflection/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/index.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/index.js index 825830376..6261f8963 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/index.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/index.js @@ -1,62 +1 @@ -export * from "./models"; export * from "./service"; -/** - * Retrieves the names of all fields in a class. - * - * @param constructor - The class constructor. - * @returns An array of field names. - */ -export function getClassFieldNames(constructor) { - function getPropertyNames(classInstance) { - return Object.getOwnPropertyNames(classInstance !== null && classInstance !== void 0 ? classInstance : {}).filter(property => property !== "constructor"); - } - const instance = new constructor(); - const prototype = instance.__proto__; - const instanceProps = getPropertyNames(instance); - const prototypeProps = getPropertyNames(prototype); - const uniquePropsSet = new Set([...instanceProps, ...prototypeProps]); - const uniquePropsArray = [...uniquePropsSet]; - return uniquePropsArray; -} -/** - * Retrieves the property descriptor for a specific field in a class. - * - * @param constructor - The class constructor. - * @param name - The name of the field. - * @returns The property descriptor for the field. - */ -export function getClassFieldDescriptor(constructor, name) { - const instance = new constructor(); - const prototype = instance.__proto__; - return Object.getOwnPropertyDescriptor(prototype, name); -} -/** - * Retrieves or initializes metadata for a given strategy. - * - * @param strategy - The strategy to get metadata for. - * @returns The metadata object. - */ -export function getMetadata(strategy) { - var _a, _b, _c; - var _d, _e; - if (isClass(strategy)) { - (_a = (_d = Symbol).metadata) !== null && _a !== void 0 ? _a : (_d.metadata = Symbol("Symbol.metadata")); - // @ts-ignore Don't delete - (_b = strategy[_e = Symbol.metadata]) !== null && _b !== void 0 ? _b : (strategy[_e] = {}); - // @ts-ignore Don't delete - return strategy[Symbol.metadata]; - } - if (strategy && !strategy.metadata) { - strategy.metadata = {}; - } - return (_c = strategy === null || strategy === void 0 ? void 0 : strategy.metadata) !== null && _c !== void 0 ? _c : {}; -} -/** - * Checks if a given strategy is a class. - * - * @param strategy - The strategy to check. - * @returns True if the strategy is a class, false otherwise. - */ -export function isClass(strategy) { - return typeof strategy === "function"; -} diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/models/ControlDescriptor.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/models/ControlDescriptor.js deleted file mode 100644 index c2c2c62de..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/models/ControlDescriptor.js +++ /dev/null @@ -1,91 +0,0 @@ -import API from "../../../index"; -import * as StrategyMapper from "./../../strategy/models/StrategyMapper"; -import { ValidationMetadata } from "./ValidationMetadata"; -/** - * A class responsible for describing reflection metadata for a specific field within a class. - * @typeParam This - The type of the current class. - * @typeParam HostClass - The type of the host class. - * @typeParam Name - The name of the descriptor within the host class. - * @remarks This class is used to store metadata about a specific field, including its validation rules and default values. - */ -export class ControlDescriptor { - constructor(props) { - var _a, _b; - this.hostClass = props.hostClass; - this.thisName = props.thisName; - this.thisClass = props.thisClass; - this.hostDefault = ((_a = props.hostDefault) !== null && _a !== void 0 ? _a : props.hostClass) ? new props.hostClass() : undefined; - this.thisDefault = props.thisDefault; - this.eventEmitter = props.eventEmitter; - this.validations = (_b = props.validations) !== null && _b !== void 0 ? _b : { - root: new ValidationMetadata(), - foreach: new ValidationMetadata(), - }; - } - /** - * Gets the implementation of the reflection strategy. - * @throws {Error} If the strategy is not implemented. - */ - get StrategyImpl() { - const strategy = this.strategy; - if (!(strategy in StrategyMapper.data)) { - const error = `Validation strategy not implemented for field type '${strategy}'`; - throw new Error(error); - } - return StrategyMapper.data[strategy]; - } - /** - * Determines the reflection strategy type for the descriptor. - * @returns The type of the reflection strategy. - * @remarks - * This method performs the following steps: - * 1. Checks if the host class is defined. - * 2. Checks if the field name is defined. - * 3. Determines the strategy based on the field type and its metadata. - */ - get strategy() { - var _a; - if (!this.hostClass) { - return "unknown"; - } - if (!this.thisName) { - return API.Strategy.Object.Name; - } - const instance = new this.hostClass(); - const fieldName = this.thisName; - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - const getNativeStrategy = (value) => { - const meta = API.Reflection.FieldValidatorMetaService.inject(this.hostClass, this.eventEmitter); - const descriptor = meta.getTypedDescriptor(this.thisName); - if (value instanceof Promise || - (value && - typeof value === "object" && - "key" in value && - typeof value.key === "string" && - "valid" in value && - typeof value.valid === "boolean" && - "message" in value && - typeof value.message === "string")) { - return API.Strategy.Function.Name; - } - return Array.isArray(value) - ? descriptor.thisClass - ? API.Strategy.ObjectArray.Name - : API.Strategy.PrimitiveArray.Name - : descriptor.thisClass - ? API.Strategy.Object.Name - : API.Strategy.Primitive.Name; - }; - const descriptor = API.Reflection.getClassFieldDescriptor(this.hostClass, fieldName); - const isGetter = (descriptor === null || descriptor === void 0 ? void 0 : descriptor.get) && !descriptor.set; - if (isGetter) { - const value = descriptor.get.call(instance); - return `get (): ${getNativeStrategy(value)}`; - } - const value = instance[fieldName]; - if (typeof value === "function") { - return getNativeStrategy(value.bind((_a = this.hostDefault) !== null && _a !== void 0 ? _a : new this.hostClass())()); - } - return getNativeStrategy(value); - } -} diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/models/index.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/models/index.js deleted file mode 100644 index 8a6680c3a..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/models/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./ControlDescriptor"; -export * from "./ValidationMetadata"; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/service/AbstractMetaService.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/AbstractMetaService.d.ts similarity index 71% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/service/AbstractMetaService.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/AbstractMetaService.d.ts index 3a9378385..8c62b02ca 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/service/AbstractMetaService.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/AbstractMetaService.d.ts @@ -1,5 +1,16 @@ -import API from "../../../index"; -import { type FieldDecoratorCtx } from "./../../decorators"; +import { Types } from "../../utilities"; +type FieldDecoratorCtx = Readonly<{ + kind: "getter" | "method" | "field"; + static: boolean; + private: boolean; + name: string; + metadata?: globalThis.DecoratorMetadataObject; + access: { + get: (object: any) => T; + }; +}>; +/** Type alias for strategies that can either be a decorator context or a class. */ +export type MetaStrategy = FieldDecoratorCtx | Types.Class | DecoratorContext; /** * Abstract class for managing metadata. * @remarks This class provides methods for managing metadata associated with a given strategy. It can be used to get, set, and check for the existence of attributes in the metadata. @@ -13,15 +24,15 @@ export declare abstract class AbstractMetaService { * @param strategy - The strategy for which metadata is managed. * @param initial - A function that returns the initial value for the metadata entry. */ - constructor(injectionKey: string, strategy: API.Reflection.MetaStrategy, initial: () => Entry); + constructor(injectionKey: string, strategy: MetaStrategy, initial: () => Entry); /** * Gets the class associated with this AbstractMetaService. */ - get class(): API.Utilities.Types.Class; + get class(): Types.Class; /** * Sets the class associated with this AbstractMetaService. */ - set class(clazz: API.Utilities.Types.Class); + set class(clazz: Types.Class); /** * Gets the metadata object. */ @@ -49,4 +60,5 @@ export declare abstract class AbstractMetaService { */ protected attr(attrKey: string, attrDefault?: () => T): T; } +export {}; //# sourceMappingURL=AbstractMetaService.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/AbstractMetaService.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/AbstractMetaService.d.ts.map new file mode 100644 index 000000000..928820d54 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/AbstractMetaService.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"AbstractMetaService.d.ts","sourceRoot":"","sources":["../../../../src/reflection/service/AbstractMetaService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,EAAE,MAAM,YAAY,CAAC;AAE5C,KAAK,iBAAiB,CAAC,CAAC,GAAG,OAAO,IAAI,QAAQ,CAAC;IAC7C,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,UAAU,CAAC,uBAAuB,CAAC;IAC9C,MAAM,EAAE;QACN,GAAG,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC;KACzB,CAAC;CACH,CAAC,CAAC;AAEH,mFAAmF;AACnF,MAAM,MAAM,YAAY,GAAG,iBAAiB,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,gBAAgB,CAAC;AAExF;;;GAGG;AACH,8BAAsB,mBAAmB,CAAC,KAAK;;IAK7C,SAAS,CAAC,OAAO,CAAC,EAAE,iBAAiB,CAAC,GAAG,CAAC,CAAC;IAE3C;;;;;OAKG;gBACS,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,KAAK;IAW9E;;OAEG;IACH,IAAI,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAE5B;IAED;;OAEG;IACH,IAAI,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAEhC;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,uBAAuB,CAEtC;IAED;;;;OAIG;IACH,IAAW,IAAI,IAAI,KAAK,CAEvB;IAED;;;;;;OAMG;IACH,SAAS,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIvC;;;;;;OAMG;IACH,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC;CAO7D"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/AbstractMetaService.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/AbstractMetaService.js index 77a311aef..3dde2bb42 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/AbstractMetaService.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/AbstractMetaService.js @@ -10,7 +10,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function ( return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); }; var _AbstractMetaService_metadata, _AbstractMetaService_injectionKey, _AbstractMetaService_initial, _AbstractMetaService_class; -import API from "../../../index"; +import { Classes } from "../../utilities"; /** * Abstract class for managing metadata. * @remarks This class provides methods for managing metadata associated with a given strategy. It can be used to get, set, and check for the existence of attributes in the metadata. @@ -27,10 +27,10 @@ export class AbstractMetaService { _AbstractMetaService_injectionKey.set(this, void 0); _AbstractMetaService_initial.set(this, void 0); _AbstractMetaService_class.set(this, void 0); - __classPrivateFieldSet(this, _AbstractMetaService_metadata, API.Reflection.getMetadata(strategy), "f"); + __classPrivateFieldSet(this, _AbstractMetaService_metadata, Classes.getMetadata(strategy), "f"); __classPrivateFieldSet(this, _AbstractMetaService_injectionKey, injectionKey, "f"); __classPrivateFieldSet(this, _AbstractMetaService_initial, initial, "f"); - if (API.Reflection.isClass(strategy)) { + if (Classes.isClass(strategy)) { this.class = strategy; } else { diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/impl/ClassValidatorMetaService.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/impl/ClassValidatorMetaService.d.ts new file mode 100644 index 000000000..803f9cbd8 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/impl/ClassValidatorMetaService.d.ts @@ -0,0 +1,30 @@ +import { AbstractMetaService, MetaStrategy } from "../../service/AbstractMetaService"; +import { EventEmitter, Types } from "../../../utilities"; +import { ValidationMetadata } from "../../../validation/models/ValidationMetadata"; +import type { ValidationEvaluator } from "../../../validation/types"; +/** + * Unwraps a MetaStrategy type to its inferred class. + * @typeParam TStrategy - The MetaStrategy type to unwrap. + */ +export type UnwrapMetaStrategy = TStrategy extends Types.Class ? TInferredClass : any; +/** + * A configurer class which allows for easier manipulation of decorated class validators and corresponding metadata + * @remarks This class is responsible for managing metadata related to validation (at class level). It provides methods to add validators and read them. + */ +export declare class ClassValidatorMetaService extends AbstractMetaService> { + /** + * Static method to create a new instance of ClassValidatorMetaService. + * @param strategy - The strategy to inject. + * @returns A new instance of ClassValidatorMetaService. + */ + static inject(strategy: T, eventEmitter: EventEmitter): ClassValidatorMetaService>; + eventEmitter: EventEmitter; + private constructor(); + /** + * Adds a class-level validator to the provided class. + * @param isValid - The validation function. + * @param groups - Optional validation groups. + */ + addValidator(isValid: ValidationEvaluator>, groups: string[]): void; +} +//# sourceMappingURL=ClassValidatorMetaService.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/impl/ClassValidatorMetaService.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/impl/ClassValidatorMetaService.d.ts.map new file mode 100644 index 000000000..a2e8aba8c --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/impl/ClassValidatorMetaService.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ClassValidatorMetaService.d.ts","sourceRoot":"","sources":["../../../../../src/reflection/service/impl/ClassValidatorMetaService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D;;;GAGG;AACH,MAAM,MAAM,kBAAkB,CAAC,SAAS,SAAS,YAAY,IAAI,SAAS,SAAS,KAAK,CAAC,KAAK,CAAC,MAAM,cAAc,CAAC,GAChH,cAAc,GACd,GAAG,CAAC;AAER;;;GAGG;AACH,qBAAa,yBAAyB,CAAC,SAAS,SAAS,YAAY,CAAE,SAAQ,mBAAmB,CAChG,kBAAkB,CAAC,GAAG,CAAC,CACxB;IACC;;;;OAIG;WACW,MAAM,CAAC,CAAC,SAAS,YAAY,EACzC,QAAQ,EAAE,CAAC,EACX,YAAY,EAAE,YAAY,GACzB,yBAAyB,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;IAInD,YAAY,EAAG,YAAY,CAAC;IAE5B,OAAO;IAKP;;;;OAIG;IACH,YAAY,CAAC,OAAO,EAAE,mBAAmB,CAAC,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI;CAMjG"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/impl/ClassValidatorMetaService.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/impl/ClassValidatorMetaService.js index 3d66ef03d..881fd509c 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/impl/ClassValidatorMetaService.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/impl/ClassValidatorMetaService.js @@ -1,5 +1,5 @@ -import { ValidationMetadata } from "../../models/ValidationMetadata"; -import { AbstractMetaService } from "../AbstractMetaService"; +import { AbstractMetaService } from "../../service/AbstractMetaService"; +import { ValidationMetadata } from "../../../validation/models/ValidationMetadata"; /** * A configurer class which allows for easier manipulation of decorated class validators and corresponding metadata * @remarks This class is responsible for managing metadata related to validation (at class level). It provides methods to add validators and read them. diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/impl/FieldValidatorMetaService.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/impl/FieldValidatorMetaService.d.ts new file mode 100644 index 000000000..feb3cb385 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/impl/FieldValidatorMetaService.d.ts @@ -0,0 +1,119 @@ +import { AbstractMetaService, MetaStrategy } from "../../service/AbstractMetaService"; +import { type AbstractValidationStrategyService } from "../../../strategy"; +import { EventEmitter, Types } from "../../../utilities"; +import { ValidationMetadata } from "../../../validation/models/ValidationMetadata"; +import type { ValidationEvaluator } from "../../../validation/types"; +/** + * Describes the reflection rules for a specific field within a class. + * @typeParam FieldType - The type of the field. + */ +export type ControlDescriptorValidationMetadata = { + root: ValidationMetadata; + foreach: ValidationMetadata; +}; +/** + * Properties for constructing a `ReflectionDescriptor`. + * @typeParam This - The type of the current class. + * @typeParam HostClass - The type of the host class. + * @typeParam Name - The name of the descriptor within the host class. + */ +export type ControlDescriptorType = Name extends keyof HostClass ? HostClass[Name] : HostClass; +/** + * Properties for constructing a `ReflectionDescriptor`. + * @typeParam This - The type of the current class. + * @typeParam HostClass - The type of the host class. + * @typeParam Name - The name of the descriptor within the host class. + */ +export type ControlDescriptorProps = { + hostClass?: Types.Class; + hostDefault?: HostClass; + thisClass?: Types.Class; + thisName?: Name; + thisDefault?: ControlDescriptorType; + validations?: ControlDescriptorValidationMetadata>; + eventEmitter: EventEmitter; +}; +/** + * A class responsible for describing reflection metadata for a specific field within a class. + * @typeParam This - The type of the current class. + * @typeParam HostClass - The type of the host class. + * @typeParam Name - The name of the descriptor within the host class. + * @remarks This class is used to store metadata about a specific field, including its validation rules and default values. + */ +export declare class ControlDescriptor { + hostClass?: Types.Class; + hostDefault?: HostClass; + thisClass?: Types.Class; + thisName?: Name; + thisDefault?: ControlDescriptorType; + validations: ControlDescriptorValidationMetadata>; + eventEmitter: EventEmitter; + constructor(props: ControlDescriptorProps); + /** + * Gets the implementation of the reflection strategy. + * @throws {Error} If the strategy is not implemented. + */ + get StrategyImpl(): Types.Class; + /** + * Determines the reflection strategy type for the descriptor. + * @returns The type of the reflection strategy. + * @remarks + * This method performs the following steps: + * 1. Checks if the host class is defined. + * 2. Checks if the field name is defined. + * 3. Determines the strategy based on the field type and its metadata. + */ + get strategy(): string; +} +/** + * A configurer class which allows for easier manipulation of decorated fields and corresponding metadata + * @remarks This class is responsible for managing metadata related to validation. It provides methods to add validators, get field names, and manage descriptors. + */ +export declare class FieldValidatorMetaService extends AbstractMetaService>> { + #private; + /** + * Static method to create a new instance of FieldValidatorMetaService. + * @param strategy - The strategy to inject. + * @returns A new instance of FieldValidatorMetaService. + */ + static inject(strategy: MetaStrategy, eventEmitter: EventEmitter): FieldValidatorMetaService; + eventEmitter: EventEmitter; + private constructor(); + /** + * Adds a validator to a field. + * + * @param field - The name of the field. + * @param isValid - The validation function. + * @param groups - Optional validation groups. + */ + addValidator(field: string, isValid: ValidationEvaluator, groups: string[]): void; + /** + * Gets the names of all fields present within given + * reflection strategy (`Types.Class` or `Decorator.Context`). + * + * @returns An array of field names. + */ + getFields(): string[]; + /** + * Checks if a descriptor exists for a given name. + * + * @param name - The name of a field descriptor. + * @returns `true` if the descriptor exists, `false` otherwise. + */ + hasDescriptor(name: string): boolean; + /** + * Gets a typed descriptor for a given field name. + * + * @param thisName - The name of the field. + * @returns The typed descriptor. + */ + getTypedDescriptor(thisName: TName): ControlDescriptor; + /** + * Gets an untyped descriptor for a given field key. + * + * @param fieldKey - The key of the field. + * @returns The untyped descriptor. + */ + getUntypedDescriptor(fieldKey: any, eventEmitter?: EventEmitter): ControlDescriptor; +} +//# sourceMappingURL=FieldValidatorMetaService.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/impl/FieldValidatorMetaService.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/impl/FieldValidatorMetaService.d.ts.map new file mode 100644 index 000000000..ccc15e743 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/impl/FieldValidatorMetaService.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"FieldValidatorMetaService.d.ts","sourceRoot":"","sources":["../../../../../src/reflection/service/impl/FieldValidatorMetaService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAC5F,OAAO,EAAE,KAAK,iCAAiC,EAAE,MAAM,WAAW,CAAC;AAGnE,OAAO,EAAW,YAAY,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D;;;GAGG;AACH,MAAM,MAAM,mCAAmC,CAAC,SAAS,IAAI;IAC3D,IAAI,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAAC;IACpC,OAAO,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAAC;CACxC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,CAC/B,SAAS,EACT,IAAI,SAAS,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS,IAClD,IAAI,SAAS,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;AAE/D;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,SAAS,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS,IAAI;IAC1G,SAAS,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IACnC,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,SAAS,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC9B,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,WAAW,CAAC,EAAE,qBAAqB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IACrD,WAAW,CAAC,EAAE,mCAAmC,CAAC,qBAAqB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;IAC1F,YAAY,EAAE,YAAY,CAAC;CAC5B,CAAC;AAEF;;;;;;GAMG;AACH,qBAAa,iBAAiB,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,SAAS,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS;IAClG,SAAS,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IACnC,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,SAAS,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC9B,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,WAAW,CAAC,EAAE,qBAAqB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IACrD,WAAW,EAAE,mCAAmC,CAAC,qBAAqB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;IACzF,YAAY,EAAE,YAAY,CAAC;gBAEf,KAAK,EAAE,sBAAsB,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC;IAahE;;;OAGG;IACH,IAAW,YAAY,IAAI,KAAK,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAOxE;IAED;;;;;;;;OAQG;IACH,IAAW,QAAQ,IAAI,MAAM,CAqD5B;CACF;AAaD;;;GAGG;AACH,qBAAa,yBAA0B,SAAQ,mBAAmB,CAAC,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;;IAC/G;;;;OAIG;WACW,MAAM,CAAC,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,GAAG,yBAAyB;IAInG,YAAY,EAAG,YAAY,CAAC;IAG5B,OAAO;IAMP;;;;;;OAMG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI;IAOtF;;;;;OAKG;IACH,SAAS,IAAI,MAAM,EAAE;IAIrB;;;;;OAKG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIpC;;;;;OAKG;IACH,kBAAkB,CAAC,MAAM,EAAE,KAAK,SAAS,MAAM,MAAM,EAAE,QAAQ,EAAE,KAAK,GAAG,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC;IAIlH;;;;;OAKG;IACH,oBAAoB,CAAC,QAAQ,EAAE,GAAG,EAAE,YAAY,CAAC,EAAE,YAAY,GAAG,iBAAiB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;CAqCnG"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/impl/FieldValidatorMetaService.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/impl/FieldValidatorMetaService.js index bbaf2bb17..25cbc023d 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/impl/FieldValidatorMetaService.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/impl/FieldValidatorMetaService.js @@ -10,9 +10,99 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function ( return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; }; var _FieldValidatorMetaService_instances, _FieldValidatorMetaService_fields, _FieldValidatorMetaService_handleClassInit, _FieldValidatorMetaService_handleContextInit; -import API from "../../../../index"; -import { AbstractMetaService } from "../AbstractMetaService"; -import { ControlDescriptor } from "./../../models/ControlDescriptor"; +import { AbstractMetaService } from "../../service/AbstractMetaService"; +import { StrategyData } from "../../../strategy/models/StrategyMapper"; +import * as Strategies from "../../../strategy/service/impl"; +import { Classes } from "../../../utilities"; +import { ValidationMetadata } from "../../../validation/models/ValidationMetadata"; +/** + * A class responsible for describing reflection metadata for a specific field within a class. + * @typeParam This - The type of the current class. + * @typeParam HostClass - The type of the host class. + * @typeParam Name - The name of the descriptor within the host class. + * @remarks This class is used to store metadata about a specific field, including its validation rules and default values. + */ +export class ControlDescriptor { + constructor(props) { + var _a, _b; + this.hostClass = props.hostClass; + this.thisName = props.thisName; + this.thisClass = props.thisClass; + this.hostDefault = ((_a = props.hostDefault) !== null && _a !== void 0 ? _a : props.hostClass) ? new props.hostClass() : undefined; + this.thisDefault = props.thisDefault; + this.eventEmitter = props.eventEmitter; + this.validations = (_b = props.validations) !== null && _b !== void 0 ? _b : { + root: new ValidationMetadata(), + foreach: new ValidationMetadata(), + }; + } + /** + * Gets the implementation of the reflection strategy. + * @throws {Error} If the strategy is not implemented. + */ + get StrategyImpl() { + const strategy = this.strategy; + if (!(strategy in StrategyData)) { + const error = `Validation strategy not implemented for field type '${strategy}'`; + throw new Error(error); + } + return StrategyData[strategy]; + } + /** + * Determines the reflection strategy type for the descriptor. + * @returns The type of the reflection strategy. + * @remarks + * This method performs the following steps: + * 1. Checks if the host class is defined. + * 2. Checks if the field name is defined. + * 3. Determines the strategy based on the field type and its metadata. + */ + get strategy() { + var _a; + if (!this.hostClass) { + return "unknown"; + } + if (!this.thisName) { + return Strategies["ObjectStrategy"].Name; + } + const instance = new this.hostClass(); + const fieldName = this.thisName; + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + const getNativeStrategy = (value) => { + const meta = FieldValidatorMetaService.inject(this.hostClass, this.eventEmitter); + const descriptor = meta.getTypedDescriptor(this.thisName); + if (value instanceof Promise || + (value && + typeof value === "object" && + "key" in value && + typeof value.key === "string" && + "valid" in value && + typeof value.valid === "boolean" && + "message" in value && + typeof value.message === "string")) { + return Strategies["FunctionStrategy"].Name; + } + return Array.isArray(value) + ? descriptor.thisClass + ? Strategies["ObjectArrayStrategy"].Name + : Strategies["PrimitiveArrayStrategy"].Name + : descriptor.thisClass + ? Strategies["ObjectStrategy"].Name + : Strategies["PrimitiveStrategy"].Name; + }; + const descriptor = Classes.getClassFieldDescriptor(this.hostClass, fieldName); + const isGetter = (descriptor === null || descriptor === void 0 ? void 0 : descriptor.get) && !descriptor.set; + if (isGetter) { + const value = descriptor.get.call(instance); + return `get (): ${getNativeStrategy(value)}`; + } + const value = instance[fieldName]; + if (typeof value === "function") { + return getNativeStrategy(value.bind((_a = this.hostDefault) !== null && _a !== void 0 ? _a : new this.hostClass())()); + } + return getNativeStrategy(value); + } +} /** * A configurer class which allows for easier manipulation of decorated fields and corresponding metadata * @remarks This class is responsible for managing metadata related to validation. It provides methods to add validators, get field names, and manage descriptors. @@ -31,9 +121,7 @@ export class FieldValidatorMetaService extends AbstractMetaService { _FieldValidatorMetaService_instances.add(this); _FieldValidatorMetaService_fields.set(this, void 0); this.eventEmitter = eventEmitter; - API.Reflection.isClass(strategy) - ? __classPrivateFieldGet(this, _FieldValidatorMetaService_instances, "m", _FieldValidatorMetaService_handleClassInit).call(this, strategy) - : __classPrivateFieldGet(this, _FieldValidatorMetaService_instances, "m", _FieldValidatorMetaService_handleContextInit).call(this, strategy); + Classes.isClass(strategy) ? __classPrivateFieldGet(this, _FieldValidatorMetaService_instances, "m", _FieldValidatorMetaService_handleClassInit).call(this, strategy) : __classPrivateFieldGet(this, _FieldValidatorMetaService_instances, "m", _FieldValidatorMetaService_handleContextInit).call(this, strategy); } /** * Adds a validator to a field. @@ -97,7 +185,7 @@ export class FieldValidatorMetaService extends AbstractMetaService { } } _FieldValidatorMetaService_fields = new WeakMap(), _FieldValidatorMetaService_instances = new WeakSet(), _FieldValidatorMetaService_handleClassInit = function _FieldValidatorMetaService_handleClassInit(clazz) { - __classPrivateFieldSet(this, _FieldValidatorMetaService_fields, API.Reflection.getClassFieldNames(clazz), "f"); + __classPrivateFieldSet(this, _FieldValidatorMetaService_fields, Classes.getClassFieldNames(clazz), "f"); __classPrivateFieldGet(this, _FieldValidatorMetaService_fields, "f").forEach(name => this.getUntypedDescriptor(name)); }, _FieldValidatorMetaService_handleContextInit = function _FieldValidatorMetaService_handleContextInit(_context) { __classPrivateFieldSet(this, _FieldValidatorMetaService_fields, [], "f"); diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/impl/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/impl/index.d.ts new file mode 100644 index 000000000..b57978ccf --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/impl/index.d.ts @@ -0,0 +1,3 @@ +export * from "./ClassValidatorMetaService"; +export * from "./FieldValidatorMetaService"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/impl/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/impl/index.d.ts.map new file mode 100644 index 000000000..7b10d6436 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/impl/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/reflection/service/impl/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/impl/index.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/impl/index.js new file mode 100644 index 000000000..98ba7a0cd --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/impl/index.js @@ -0,0 +1,2 @@ +export * from "./ClassValidatorMetaService"; +export * from "./FieldValidatorMetaService"; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/index.d.ts new file mode 100644 index 000000000..a30b4a679 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/index.d.ts @@ -0,0 +1,3 @@ +export * from "./AbstractMetaService"; +export * from "./impl"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/index.d.ts.map new file mode 100644 index 000000000..4bd1dd2c3 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/reflection/service/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,QAAQ,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/index.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/index.js index 090e07a0b..94677f17c 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/index.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/service/index.js @@ -1,3 +1,2 @@ export * from "./AbstractMetaService"; -export * from "./impl/ClassValidatorMetaService"; -export * from "./impl/FieldValidatorMetaService"; +export * from "./impl"; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/index.d.ts similarity index 100% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/index.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/index.d.ts diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/index.d.ts.map new file mode 100644 index 000000000..d9244035e --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/strategy/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/models/StrategyFactory.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/models/StrategyFactory.d.ts new file mode 100644 index 000000000..458863731 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/models/StrategyFactory.d.ts @@ -0,0 +1,55 @@ +import { FunctionStrategy, ObjectArrayGetterStrategy, ObjectArrayStrategy, ObjectGetterStrategy, ObjectStrategy, PrimitiveArrayGetterStrategy, PrimitiveArrayStrategy, PrimitiveGetterStrategy, PrimitiveStrategy } from "../service/impl"; +import { Booleans, Objects, Types } from "../../utilities"; +import type { ValidationResult } from "../../validation/types"; +/** + * Evaluates a type, returning either an optional or mandatory evaluation based on the second type parameter. + * @typeParam T - The type to evaluate. + * @typeParam R - The result type. Determines if the evaluation is optional or mandatory. + */ +export type evaluate = true extends Booleans.isUndefined ? Types.Prettify>> : Types.Prettify>>; +/** + * Type for optional evaluation of each field in a type. + * @typeParam T - The type to evaluate. + * @typeParam R - The result type. + */ +export type evaluateOptional = { + [K in keyof T]?: fieldEvaluation; +}; +/** + * Type for mandatory evaluation of each field in a type. + * @typeParam T - The type to evaluate. + * @typeParam R - The result type. + */ +export type evaluateMandatory = { + [K in keyof T]-?: fieldEvaluation; +}; +/** + * Determines the evaluation strategy for a field in a type. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + * @typeParam R - The result type. + */ +export type fieldEvaluation = true extends FunctionStrategy.matches ? FunctionStrategy.handler : true extends PrimitiveArrayStrategy.matches ? PrimitiveArrayStrategy.handler : true extends PrimitiveGetterStrategy.matches ? PrimitiveGetterStrategy.handler : true extends PrimitiveArrayGetterStrategy.matches ? PrimitiveArrayGetterStrategy.handler : true extends PrimitiveStrategy.matches ? PrimitiveStrategy.handler : true extends ObjectArrayStrategy.matches ? ObjectArrayStrategy.handler : true extends ObjectArrayGetterStrategy.matches ? ObjectArrayGetterStrategy.handler : true extends ObjectGetterStrategy.matches ? ObjectGetterStrategy.handler : true extends ObjectStrategy.matches ? ObjectStrategy.handler : never; +/** + * A type that maps field types to their respective validation strategy results. + * + * @typeParam Field - The type of the field being validated. + */ +export type getStrategyResult = ReturnType["test"]>; +/** + * A type that maps field types to their respective validation strategy classes. + * + * @typeParam Field - The type of the field being validated. + */ +export type getStrategyClass = true extends FunctionStrategy.matches ? FunctionStrategy.StrategyResolver : true extends PrimitiveArrayStrategy.matches ? PrimitiveArrayStrategy.StrategyResolver : true extends PrimitiveGetterStrategy.matches ? PrimitiveGetterStrategy.StrategyResolver : true extends PrimitiveArrayGetterStrategy.matches ? PrimitiveArrayGetterStrategy.StrategyResolver : true extends PrimitiveStrategy.matches ? PrimitiveStrategy.StrategyResolver : true extends ObjectArrayStrategy.matches ? ObjectArrayStrategy.StrategyResolver : true extends ObjectArrayGetterStrategy.matches ? ObjectArrayGetterStrategy.StrategyResolver : true extends ObjectGetterStrategy.matches ? ObjectGetterStrategy.StrategyResolver : true extends ObjectStrategy.matches ? ObjectStrategy.StrategyResolver : never; +/** + * Type for detailed errors during validation. + * @typeParam T - The type being validated. + */ +export type DetailedErrorsResponse = evaluate; +/** + * Type for basic errors during validation. + * @typeParam T - The type being validated. + */ +export type SimpleErrorsResponse = evaluate; +//# sourceMappingURL=StrategyFactory.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/models/StrategyFactory.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/models/StrategyFactory.d.ts.map new file mode 100644 index 000000000..59e10faa6 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/models/StrategyFactory.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"StrategyFactory.d.ts","sourceRoot":"","sources":["../../../../src/strategy/models/StrategyFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,yBAAyB,EACzB,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,4BAA4B,EAC5B,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;GAIG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,SAAS,IAAI,IAAI,SAAS,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,GACzE,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GACtD,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAE5D;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,EAAE,CAAC,IAAI;KAClC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;CAC1C,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,EAAE,CAAC,IAAI;KACnC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;CAC3C,CAAC;AAEF;;;;;GAKG;AAEH,MAAM,MAAM,eAAe,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,IAC/C,IAAI,SAAS,gBAAgB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GACzC,gBAAgB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAEjC,IAAI,SAAS,sBAAsB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GACjD,sBAAsB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAEvC,IAAI,SAAS,uBAAuB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GAClD,uBAAuB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAExC,IAAI,SAAS,4BAA4B,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GACvD,4BAA4B,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAE7C,IAAI,SAAS,iBAAiB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GAC5C,iBAAiB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAElC,IAAI,SAAS,mBAAmB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GAC9C,mBAAmB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAEpC,IAAI,SAAS,yBAAyB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GACpD,yBAAyB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAE1C,IAAI,SAAS,oBAAoB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GAC/C,oBAAoB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAErC,IAAI,SAAS,cAAc,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GACzC,cAAc,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GACjC,KAAK,CAAC;AAEV;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,UAAU,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAEjG;;;;GAIG;AAEH,MAAM,MAAM,gBAAgB,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAC7C,IAAI,SAAS,gBAAgB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GACzC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAEvC,IAAI,SAAS,sBAAsB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GACjD,sBAAsB,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAE7C,IAAI,SAAS,uBAAuB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GAClD,uBAAuB,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAE9C,IAAI,SAAS,4BAA4B,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GACvD,4BAA4B,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAEnD,IAAI,SAAS,iBAAiB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GAC5C,iBAAiB,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAExC,IAAI,SAAS,mBAAmB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GAC9C,mBAAmB,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAE1C,IAAI,SAAS,yBAAyB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GACpD,yBAAyB,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAEhD,IAAI,SAAS,oBAAoB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GAC/C,oBAAoB,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAE3C,IAAI,SAAS,cAAc,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GACzC,cAAc,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACvC,KAAK,CAAC;AAEV;;;GAGG;AACH,MAAM,MAAM,sBAAsB,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC;AAExE;;;GAGG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/models/StrategyMapper.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/models/StrategyMapper.d.ts new file mode 100644 index 000000000..79d5fb492 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/models/StrategyMapper.d.ts @@ -0,0 +1,8 @@ +import { AbstractValidationStrategyService } from "../service/AbstractValidationStrategyService"; +import { Types } from "../../utilities"; +/** + * A mapping of reflection strategy types to their corresponding `ValidationStrategy` classes. + * @remarks This object provides a way to look up the `ValidationStrategy` class that should be used for a given reflection strategy type. + */ +export declare const StrategyData: Record>; +//# sourceMappingURL=StrategyMapper.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/models/StrategyMapper.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/models/StrategyMapper.d.ts.map new file mode 100644 index 000000000..bc2389db2 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/models/StrategyMapper.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"StrategyMapper.d.ts","sourceRoot":"","sources":["../../../../src/strategy/models/StrategyMapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iCAAiC,EAAE,MAAM,qDAAqD,CAAC;AAExG,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAWvF,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/models/StrategyMapper.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/models/StrategyMapper.js index 1aa25cf06..18c47f2bc 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/models/StrategyMapper.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/models/StrategyMapper.js @@ -1,30 +1,17 @@ -import { FunctionStrat } from "../service/impl/FunctionStrategy"; -import { ObjectArrayGetterStrat } from "../service/impl/ObjectArrayGetterStrategy"; -import { ObjectArrayStrat } from "../service/impl/ObjectArrayStrategy"; -import { ObjectGetterStrat } from "../service/impl/ObjectGetterStrategy"; -import { ObjectStrat } from "../service/impl/ObjectStrategy"; -import { PrimitiveArrayGetterStrat } from "../service/impl/PrimitiveArrayGetterStrategy"; -import { PrimitiveArrayStrat } from "../service/impl/PrimitiveArrayStrategy"; -import { PrimitiveGetterStrat } from "../service/impl/PrimitiveGetterStrategy"; -import { PrimitiveStrat } from "../service/impl/PrimitiveStrategy"; -import * as StrategyTypes from "./StrategyTypes"; +import * as Strategies from "../service/impl"; /** * A mapping of reflection strategy types to their corresponding `ValidationStrategy` classes. - * - * @remarks - * This object provides a way to look up the `ValidationStrategy` class that should be used for a given - * reflection strategy type. + * @remarks This object provides a way to look up the `ValidationStrategy` class that should be used for a given reflection strategy type. */ -// prettier-ignore -export const data = { +export const StrategyData = { unknown: (() => { }), - [StrategyTypes.Primitive.Name]: PrimitiveStrat, - [StrategyTypes.Object.Name]: ObjectStrat, - [StrategyTypes.PrimitiveArray.Name]: PrimitiveArrayStrat, - [StrategyTypes.ObjectArray.Name]: ObjectArrayStrat, - [StrategyTypes.PrimitiveGetter.Name]: PrimitiveGetterStrat, - [StrategyTypes.ObjectGetter.Name]: ObjectGetterStrat, - [StrategyTypes.PrimitiveArrayGetter.Name]: PrimitiveArrayGetterStrat, - [StrategyTypes.ObjectArrayGetter.Name]: ObjectArrayGetterStrat, - [StrategyTypes.Function.Name]: FunctionStrat + [Strategies["PrimitiveStrategy"].Name]: Strategies.PrimitiveStrategy.StrategyResolver, + [Strategies["ObjectStrategy"].Name]: Strategies.ObjectStrategy.StrategyResolver, + [Strategies["PrimitiveArrayStrategy"].Name]: Strategies.PrimitiveArrayStrategy.StrategyResolver, + [Strategies["ObjectArrayStrategy"].Name]: Strategies.ObjectArrayStrategy.StrategyResolver, + [Strategies["PrimitiveGetterStrategy"].Name]: Strategies.PrimitiveGetterStrategy.StrategyResolver, + [Strategies["ObjectGetterStrategy"].Name]: Strategies.ObjectGetterStrategy.StrategyResolver, + [Strategies["PrimitiveArrayGetterStrategy"].Name]: Strategies.PrimitiveArrayGetterStrategy.StrategyResolver, + [Strategies["ObjectArrayGetterStrategy"].Name]: Strategies.ObjectArrayGetterStrategy.StrategyResolver, + [Strategies["FunctionStrategy"].Name]: Strategies.FunctionStrategy.StrategyResolver, }; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/models/StrategyTypes.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/models/StrategyTypes.js deleted file mode 100644 index 476d7cde3..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/models/StrategyTypes.js +++ /dev/null @@ -1,18 +0,0 @@ -import FunctionStrategyType from "../service/impl/FunctionStrategy/types"; -import ObjectArrayGetterStrategyType from "../service/impl/ObjectArrayGetterStrategy/types"; -import ObjectArrayStrategyType from "../service/impl/ObjectArrayStrategy/types"; -import ObjectGetterStrategyType from "../service/impl/ObjectGetterStrategy/types"; -import ObjectStrategyType from "../service/impl/ObjectStrategy/types"; -import PrimitiveArrayGetterStrategyType from "../service/impl/PrimitiveArrayGetterStrategy/types"; -import PrimitiveArrayStrategyType from "../service/impl/PrimitiveArrayStrategy/types"; -import PrimitiveGetterStrategyType from "../service/impl/PrimitiveGetterStrategy/types"; -import PrimitiveStrategyType from "../service/impl/PrimitiveStrategy/types"; -export var ObjectArray = ObjectArrayStrategyType; -export var Object = ObjectStrategyType; -export var ObjectGetter = ObjectGetterStrategyType; -export var PrimitiveArray = PrimitiveArrayStrategyType; -export var Primitive = PrimitiveStrategyType; -export var PrimitiveGetter = PrimitiveGetterStrategyType; -export var Function = FunctionStrategyType; -export var ObjectArrayGetter = ObjectArrayGetterStrategyType; -export var PrimitiveArrayGetter = PrimitiveArrayGetterStrategyType; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/models/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/models/index.d.ts similarity index 75% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/models/index.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/models/index.d.ts index f13015a2d..6332bc4e4 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/models/index.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/models/index.d.ts @@ -1,4 +1,3 @@ export * from "./StrategyFactory"; export * from "./StrategyMapper"; -export * from "./StrategyTypes"; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/models/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/models/index.d.ts.map new file mode 100644 index 000000000..cfd4be16e --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/models/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/strategy/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/models/index.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/models/index.js index 745c5fcda..c834a4e8d 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/models/index.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/models/index.js @@ -1,3 +1,2 @@ export * from "./StrategyFactory"; export * from "./StrategyMapper"; -export * from "./StrategyTypes"; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/AbstractValidationStrategyService.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/AbstractValidationStrategyService.d.ts similarity index 76% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/AbstractValidationStrategyService.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/AbstractValidationStrategyService.d.ts index eadcdad45..3e97d4e9b 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/AbstractValidationStrategyService.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/AbstractValidationStrategyService.d.ts @@ -1,8 +1,10 @@ -import API from "../../index"; -import { type ControlDescriptor } from "../../reflection/models/ControlDescriptor"; -import { type ValidationMetadata } from "../../reflection/models/ValidationMetadata"; -import { type EventEmitter } from "../../utilities/misc/EventEmitter"; +import { DecoratorArgs } from "../../decorators"; +import { Locale } from "../../localization"; +import { ControlDescriptor } from "../../reflection/service/impl/FieldValidatorMetaService"; +import { EventEmitter } from "../../utilities"; import { Form } from "../../validation/models/Form"; +import { ValidationMetadata } from "../../validation/models/ValidationMetadata"; +import type { FormConfig, ValidationResult } from "../../validation/types"; /** * The `AbstractValidationStrategyService` class serves as an abstract base class for implementing various validation strategies. It provides essential utility methods and properties to facilitate the validation process. * @@ -18,14 +20,14 @@ export declare abstract class AbstractValidationStrategyService, defaultValue: TClass, groups: string[], locale: API.Localization.Locale, eventEmitter: EventEmitter, asyncDelay: number); + constructor(descriptor: ControlDescriptor, defaultValue: TClass, groups: string[], locale: Locale, eventEmitter: EventEmitter, asyncDelay: number); set eventEmitter(v: EventEmitter); get eventEmitter(): EventEmitter; protected get fieldEngine(): Form; - protected get engineCfg(): API.Validation.FormConfig; + protected get engineCfg(): FormConfig; protected get classRules(): ValidationMetadata; protected get groups(): string[]; - protected get locale(): API.Localization.Locale; + protected get locale(): Locale; /** * Constructs and returns the configuration object for entity processing. * @@ -46,10 +48,10 @@ export declare abstract class AbstractValidationStrategyService = Booleans.isFunction; + /** + * Type for the handler function based on the field and result types. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + * @typeParam R - The result type. + */ + type handler = true extends Booleans.isUndefined ? T[K] : Arrays.getArrayType | null; + /** + * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating primitive types like numbers, strings, etc. + * + * @typeParam F - The type of the field being validated. + * + * @extends AbstractValidationStrategyService + */ + class StrategyResolver extends AbstractValidationStrategyService { + private static readonly EMPTY; + /** + * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for primitive types by invoking the root rule's `validate` method and then building simplified error messages. + * + * @param value - The value to be validated. + * @param context - The context in which the validation is taking place. + * + * @returns A tuple containing an array of detailed validation results (`ValidationResult[]`) and an array of simplified error messages (`string[]`). + */ + test(value: Types.FunctionType, _context: any): [DetailedErrors, SimpleErrors]; + } +} +//# sourceMappingURL=FunctionStrategy.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/FunctionStrategy.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/FunctionStrategy.d.ts.map new file mode 100644 index 000000000..dbd9871c8 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/FunctionStrategy.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"FunctionStrategy.d.ts","sourceRoot":"","sources":["../../../../../src/strategy/service/impl/FunctionStrategy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAErD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,iCAAiC,EAAE,MAAM,sCAAsC,CAAC;AAEzF,yBAAiB,gBAAgB,CAAC;IAChC;;OAEG;IACI,MAAM,IAAI,YAAsB,CAAC;IAExC;;OAEG;IACH,KAAY,YAAY,GAAG,MAAM,GAAG,IAAI,CAAC;IAEzC;;OAEG;IACH,KAAY,cAAc,GAAG,gBAAgB,GAAG,IAAI,CAAC;IAErD;;;;OAIG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAErE;;;;;OAKG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,IACzC,IAAI,SAAS,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,GAChC,CAAC,CAAC,CAAC,CAAC,GACR,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAEhC;;;;;;OAMG;IACH,MAAa,gBAAgB,CAAC,CAAC,CAAE,SAAQ,iCAAiC,CAAC,CAAC,EAAE,cAAc,EAAE,YAAY,CAAC;QACzG,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAgD;QAE7E;;;;;;;WAOG;QACH,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAC,cAAc,EAAE,YAAY,CAAC;KAmB/E;CACF"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/FunctionStrategy.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/FunctionStrategy.js new file mode 100644 index 000000000..5e0a5a858 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/FunctionStrategy.js @@ -0,0 +1,43 @@ +import { Events } from "../../../validation/models/Events"; +import { AbstractValidationStrategyService } from "../AbstractValidationStrategyService"; +export var FunctionStrategy; +(function (FunctionStrategy) { + /** + * Constant name identifier for this strategy. + */ + FunctionStrategy.Name = "function"; + /** + * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating primitive types like numbers, strings, etc. + * + * @typeParam F - The type of the field being validated. + * + * @extends AbstractValidationStrategyService + */ + class StrategyResolver extends AbstractValidationStrategyService { + /** + * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for primitive types by invoking the root rule's `validate` method and then building simplified error messages. + * + * @param value - The value to be validated. + * @param context - The context in which the validation is taking place. + * + * @returns A tuple containing an array of detailed validation results (`ValidationResult[]`) and an array of simplified error messages (`string[]`). + */ + test(value, _context) { + const result = value.bind(_context)(); + if (result instanceof Promise) { + result.then(validationResult => { + this.eventEmitter.emit(Events.ASYNC_VALIDATION_COMPLETE, { + key: this.fieldName, + value: validationResult, + }); + }, reason => { + throw new Error(reason); + }); + return StrategyResolver.EMPTY; + } + return result.valid ? StrategyResolver.EMPTY : [result, result.message]; + } + } + StrategyResolver.EMPTY = [null, null]; + FunctionStrategy.StrategyResolver = StrategyResolver; +})(FunctionStrategy || (FunctionStrategy = {})); diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/FunctionStrategy/index.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/FunctionStrategy/index.js deleted file mode 100644 index 3fc10867f..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/FunctionStrategy/index.js +++ /dev/null @@ -1,35 +0,0 @@ -import { Events } from "../../../../validation/models/Events"; -import { AbstractValidationStrategyService } from "../../../service/AbstractValidationStrategyService"; -/** - * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating primitive types like numbers, strings, etc. - * - * @typeParam F - The type of the field being validated. - * - * @extends AbstractValidationStrategyService - */ -export class FunctionStrat extends AbstractValidationStrategyService { - /** - * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for primitive types by invoking the root rule's `validate` method and then building simplified error messages. - * - * @param value - The value to be validated. - * @param context - The context in which the validation is taking place. - * - * @returns A tuple containing an array of detailed validation results (`ValidationResult[]`) and an array of simplified error messages (`string[]`). - */ - test(value, _context) { - const result = value.bind(_context)(); - if (result instanceof Promise) { - result.then(validationResult => { - this.eventEmitter.emit(Events.ASYNC_VALIDATION_COMPLETE, { - key: this.fieldName, - value: validationResult, - }); - }, reason => { - throw new Error(reason); - }); - return FunctionStrat.EMPTY; - } - return result.valid ? FunctionStrat.EMPTY : [result, result.message]; - } -} -FunctionStrat.EMPTY = [null, null]; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/FunctionStrategy/types.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/FunctionStrategy/types.js deleted file mode 100644 index 71c00333b..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/FunctionStrategy/types.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Namespace for Function Strategy Types. - */ -var FunctionStrategyType; -(function (FunctionStrategyType) { - /** - * Constant name identifier for this strategy. - */ - FunctionStrategyType.Name = "function"; -})(FunctionStrategyType || (FunctionStrategyType = {})); -export default FunctionStrategyType; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectArrayGetterStrategy.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectArrayGetterStrategy.d.ts new file mode 100644 index 000000000..6ee782730 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectArrayGetterStrategy.d.ts @@ -0,0 +1,73 @@ +import { DecoratorArgs } from "../../../decorators"; +import { DetailedErrorsResponse, SimpleErrorsResponse } from "../../models/StrategyFactory"; +import { Arrays, Booleans } from "../../../utilities"; +import type { ValidationResult } from "../../../validation/types"; +import { AbstractValidationStrategyService } from "../AbstractValidationStrategyService"; +import { ObjectStrategy } from "./ObjectStrategy"; +export declare namespace ObjectArrayGetterStrategy { + /** + * Constant name identifier for this strategy. + */ + const Name: "() => composite[]"; + /** + * Represents the simplified error structure for validating arrays of object types. + * + * @typeParam F - The type of the field being validated. + * + * - `field`: An array of string messages that represent validation errors at the array level. + * - `data`: An array of `Errors` objects that represent validation errors for each object in the array. + */ + type SimpleErrors = { + root: string[]; + data: Array>; + }; + /** + * Represents the detailed error structure for validating arrays of object types. + * + * @typeParam F - The type of the field being validated. + * + * - `field`: An array of `ValidationResult` objects that represent detailed validation errors at the array level. + * - `data`: An array of `DetailedErrors` objects that represent detailed validation errors for each object in the array. + */ + type DetailedErrors = { + root: ValidationResult[]; + data: Array>; + }; + /** + * Type guard to check if a certain field in a type matches this strategy. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + */ + type matches = true extends Booleans.isGetter ? Arrays.getArrayType> extends never ? false : Booleans.isObject>> : false; + /** + * Type for the handler function based on the field and result types. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + * @typeParam R - The result type. + */ + type handler = Array>; + /** + * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating arrays of object types. + * + * @typeParam F - The type of the field being validated, which is expected to be an array of objects. + * + * @extends AbstractValidationStrategyService, ObjectArrayGetterSimpleErrors> + */ + class StrategyResolver extends AbstractValidationStrategyService, SimpleErrors> { + /** + * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for arrays of object types. + * + * @param value - The array of object values to be validated. + * @param context - The context in which the validation is taking place. + * @param groups - Optional validation groups to consider during validation. + * + * @returns A tuple containing `ObjectArrayGetterDetailedErrors` and `ObjectArrayGetterSimpleErrors`. + * + * @remarks + * The method validates both the array as a whole (`field`) and each individual object (`data`) + * using the appropriate validation rules. + */ + test(value: any[], context: any, args: DecoratorArgs): [DetailedErrors, SimpleErrors]; + } +} +//# sourceMappingURL=ObjectArrayGetterStrategy.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectArrayGetterStrategy.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectArrayGetterStrategy.d.ts.map new file mode 100644 index 000000000..bd0535e92 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectArrayGetterStrategy.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ObjectArrayGetterStrategy.d.ts","sourceRoot":"","sources":["../../../../../src/strategy/service/impl/ObjectArrayGetterStrategy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAChG,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,iCAAiC,EAAE,MAAM,sCAAsC,CAAC;AACzF,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,yBAAiB,yBAAyB,CAAC;IACzC;;OAEG;IACI,MAAM,IAAI,qBAA4C,CAAC;IAE9D;;;;;;;OAOG;IACH,KAAY,YAAY,CAAC,CAAC,IAAI;QAC5B,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,IAAI,EAAE,KAAK,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;KACtC,CAAC;IAEF;;;;;;;OAOG;IACH,KAAY,cAAc,CAAC,CAAC,IAAI;QAC9B,IAAI,EAAE,gBAAgB,EAAE,CAAC;QACzB,IAAI,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC;KACxC,CAAC;IAEF;;;;OAIG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IACpC,IAAI,SAAS,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,GAChC,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,KAAK,GAClD,KAAK,GACL,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAC3D,KAAK,CAAC;IAEd;;;;;OAKG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;IAErF;;;;;;OAMG;IACH,MAAa,gBAAgB,CAAC,CAAC,CAAE,SAAQ,iCAAiC,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;QAC/G;;;;;;;;;;;;WAYG;QACH,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,aAAa,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;KAqC5F;CACF"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectArrayGetterStrategy.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectArrayGetterStrategy.js new file mode 100644 index 000000000..90b4e142f --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectArrayGetterStrategy.js @@ -0,0 +1,57 @@ +import { AbstractValidationStrategyService } from "../AbstractValidationStrategyService"; +import { ObjectStrategy } from "./ObjectStrategy"; +export var ObjectArrayGetterStrategy; +(function (ObjectArrayGetterStrategy) { + /** + * Constant name identifier for this strategy. + */ + ObjectArrayGetterStrategy.Name = `() => ${ObjectStrategy.Name}[]`; + /** + * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating arrays of object types. + * + * @typeParam F - The type of the field being validated, which is expected to be an array of objects. + * + * @extends AbstractValidationStrategyService, ObjectArrayGetterSimpleErrors> + */ + class StrategyResolver extends AbstractValidationStrategyService { + /** + * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for arrays of object types. + * + * @param value - The array of object values to be validated. + * @param context - The context in which the validation is taking place. + * @param groups - Optional validation groups to consider during validation. + * + * @returns A tuple containing `ObjectArrayGetterDetailedErrors` and `ObjectArrayGetterSimpleErrors`. + * + * @remarks + * The method validates both the array as a whole (`field`) and each individual object (`data`) + * using the appropriate validation rules. + */ + test(value, context, args) { + const _value = value !== null && value !== void 0 ? value : []; + const rootResult = this.getRootErrors(value, context, args); + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + const getData = (element) => { + const [errors, detailedErrors] = new ObjectStrategy.StrategyResolver(this.fieldDescriptor, this.defaultValue, this.groups, this.locale, this.eventEmitter, this.engineCfg.asyncDelay).test(element, context, args); + return { + detailedErrors, + errors, + }; + }; + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + const getErrors = (element) => getData(element).errors; + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + const getDetailedErrors = (element) => getData(element).detailedErrors; + const details = { + root: rootResult, + data: _value.map(getDetailedErrors), + }; + const simple = { + root: this.getErrorMessages(rootResult), + data: _value.map(getErrors), + }; + return [details, simple]; + } + } + ObjectArrayGetterStrategy.StrategyResolver = StrategyResolver; +})(ObjectArrayGetterStrategy || (ObjectArrayGetterStrategy = {})); diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectArrayGetterStrategy/index.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectArrayGetterStrategy/index.js deleted file mode 100644 index 023e5baa5..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectArrayGetterStrategy/index.js +++ /dev/null @@ -1,49 +0,0 @@ -import { AbstractValidationStrategyService } from "../../../service/AbstractValidationStrategyService"; -import { ObjectStrat } from "../ObjectStrategy"; -/** - * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating arrays of object types. - * - * @typeParam F - The type of the field being validated, which is expected to be an array of objects. - * - * @extends AbstractValidationStrategyService, ObjectArrayGetterSimpleErrors> - */ -export class ObjectArrayGetterStrat extends AbstractValidationStrategyService { - /** - * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for arrays of object types. - * - * @param value - The array of object values to be validated. - * @param context - The context in which the validation is taking place. - * @param groups - Optional validation groups to consider during validation. - * - * @returns A tuple containing `ObjectArrayGetterDetailedErrors` and `ObjectArrayGetterSimpleErrors`. - * - * @remarks - * The method validates both the array as a whole (`field`) and each individual object (`data`) - * using the appropriate validation rules. - */ - test(value, context, args) { - const _value = value !== null && value !== void 0 ? value : []; - const rootResult = this.getRootErrors(value, context, args); - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - const getData = (element) => { - const [errors, detailedErrors] = new ObjectStrat(this.fieldDescriptor, this.defaultValue, this.groups, this.locale, this.eventEmitter, this.engineCfg.asyncDelay).test(element, context, args); - return { - detailedErrors, - errors, - }; - }; - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - const getErrors = (element) => getData(element).errors; - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - const getDetailedErrors = (element) => getData(element).detailedErrors; - const details = { - root: rootResult, - data: _value.map(getDetailedErrors), - }; - const simple = { - root: this.getErrorMessages(rootResult), - data: _value.map(getErrors), - }; - return [details, simple]; - } -} diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectArrayGetterStrategy/types.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectArrayGetterStrategy/types.js deleted file mode 100644 index 4bbfbe3e2..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectArrayGetterStrategy/types.js +++ /dev/null @@ -1,12 +0,0 @@ -import ObjectStrategyType from "../ObjectStrategy/types"; -/** - * Namespace for ObjectArrayGetter Strategy Types. - */ -var ObjectArrayGetterStrategyType; -(function (ObjectArrayGetterStrategyType) { - /** - * Constant name identifier for this strategy. - */ - ObjectArrayGetterStrategyType.Name = `() => ${ObjectStrategyType.Name}[]`; -})(ObjectArrayGetterStrategyType || (ObjectArrayGetterStrategyType = {})); -export default ObjectArrayGetterStrategyType; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectArrayStrategy.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectArrayStrategy.d.ts new file mode 100644 index 000000000..c75515889 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectArrayStrategy.d.ts @@ -0,0 +1,73 @@ +import { DecoratorArgs } from "../../../decorators"; +import { DetailedErrorsResponse, SimpleErrorsResponse } from "../../models"; +import { Arrays, Booleans } from "../../../utilities"; +import type { ValidationResult } from "../../../validation/types"; +import { AbstractValidationStrategyService } from "../AbstractValidationStrategyService"; +import { ObjectStrategy } from "./ObjectStrategy"; +export declare namespace ObjectArrayStrategy { + /** + * Constant name identifier for this strategy. + */ + const Name: "composite[]"; + /** + * Represents the simplified error structure for validating arrays of object types. + * + * @typeParam F - The type of the field being validated. + * + * - `field`: An array of string messages that represent validation errors at the array level. + * - `data`: An array of `Errors` objects that represent validation errors for each object in the array. + */ + type SimpleErrors = { + root: string[]; + data: Array>; + }; + /** + * Represents the detailed error structure for validating arrays of object types. + * + * @typeParam F - The type of the field being validated. + * + * - `field`: An array of `ValidationResult` objects that represent detailed validation errors at the array level. + * - `data`: An array of `DetailedErrors` objects that represent detailed validation errors for each object in the array. + */ + type DetailedErrors = { + root: ValidationResult[]; + data: Array>; + }; + /** + * Type guard to check if a certain field in a type matches this strategy. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + */ + type matches = Arrays.getArrayType> extends never ? false : true extends Booleans.isGetter ? false : Booleans.isObject>>; + /** + * Type for the handler function based on the field and result types. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + * @typeParam R - The result type. + */ + type handler = Array>; + /** + * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating arrays of object types. + * + * @typeParam F - The type of the field being validated, which is expected to be an array of objects. + * + * @extends AbstractValidationStrategyService, ObjectArraySimpleErrors> + */ + class StrategyResolver extends AbstractValidationStrategyService, SimpleErrors> { + /** + * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for arrays of object types. + * + * @param value - The array of object values to be validated. + * @param context - The context in which the validation is taking place. + * @param groups - Optional validation groups to consider during validation. + * + * @returns A tuple containing `ObjectArrayDetailedErrors` and `ObjectArraySimpleErrors`. + * + * @remarks + * The method validates both the array as a whole (`field`) and each individual object (`data`) + * using the appropriate validation rules. + */ + test(value: any[], context: any, args: DecoratorArgs): [DetailedErrors, SimpleErrors]; + } +} +//# sourceMappingURL=ObjectArrayStrategy.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectArrayStrategy.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectArrayStrategy.d.ts.map new file mode 100644 index 000000000..61a8340f5 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectArrayStrategy.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ObjectArrayStrategy.d.ts","sourceRoot":"","sources":["../../../../../src/strategy/service/impl/ObjectArrayStrategy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,iCAAiC,EAAE,MAAM,sCAAsC,CAAC;AACzF,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,yBAAiB,mBAAmB,CAAC;IACnC;;OAEG;IACI,MAAM,IAAI,eAAyB,CAAC;IAE3C;;;;;;;OAOG;IACH,KAAY,YAAY,CAAC,CAAC,IAAI;QAC5B,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,IAAI,EAAE,KAAK,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;KACtC,CAAC;IAEF;;;;;;;OAOG;IACH,KAAY,cAAc,CAAC,CAAC,IAAI;QAC9B,IAAI,EAAE,gBAAgB,EAAE,CAAC;QACzB,IAAI,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC;KACxC,CAAC;IAEF;;;;OAIG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IACtC,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,KAAK,GAC9C,KAAK,GACP,IAAI,SAAS,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,GAClC,KAAK,GACT,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAE9D;;;;;OAKG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;IAErF;;;;;;OAMG;IACH,MAAa,gBAAgB,CAAC,CAAC,CAAE,SAAQ,iCAAiC,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;QAC/G;;;;;;;;;;;;WAYG;QACH,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,aAAa,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;KAqC5F;CACF"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectArrayStrategy.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectArrayStrategy.js new file mode 100644 index 000000000..9bc2facdc --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectArrayStrategy.js @@ -0,0 +1,57 @@ +import { AbstractValidationStrategyService } from "../AbstractValidationStrategyService"; +import { ObjectStrategy } from "./ObjectStrategy"; +export var ObjectArrayStrategy; +(function (ObjectArrayStrategy) { + /** + * Constant name identifier for this strategy. + */ + ObjectArrayStrategy.Name = "composite[]"; + /** + * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating arrays of object types. + * + * @typeParam F - The type of the field being validated, which is expected to be an array of objects. + * + * @extends AbstractValidationStrategyService, ObjectArraySimpleErrors> + */ + class StrategyResolver extends AbstractValidationStrategyService { + /** + * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for arrays of object types. + * + * @param value - The array of object values to be validated. + * @param context - The context in which the validation is taking place. + * @param groups - Optional validation groups to consider during validation. + * + * @returns A tuple containing `ObjectArrayDetailedErrors` and `ObjectArraySimpleErrors`. + * + * @remarks + * The method validates both the array as a whole (`field`) and each individual object (`data`) + * using the appropriate validation rules. + */ + test(value, context, args) { + const _value = value !== null && value !== void 0 ? value : []; + const rootResult = this.getRootErrors(value, context, args); + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + const getData = (element) => { + const [errors, detailedErrors] = new ObjectStrategy.StrategyResolver(this.fieldDescriptor, this.defaultValue, this.groups, this.locale, this.eventEmitter, this.engineCfg.asyncDelay).test(element, context, args); + return { + detailedErrors, + errors, + }; + }; + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + const getErrors = (element) => getData(element).errors; + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type + const getDetailedErrors = (element) => getData(element).detailedErrors; + const details = { + root: rootResult, + data: _value.map(getDetailedErrors), + }; + const simple = { + root: this.getErrorMessages(rootResult), + data: _value.map(getErrors), + }; + return [details, simple]; + } + } + ObjectArrayStrategy.StrategyResolver = StrategyResolver; +})(ObjectArrayStrategy || (ObjectArrayStrategy = {})); diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectArrayStrategy/index.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectArrayStrategy/index.js deleted file mode 100644 index cdc8d2c58..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectArrayStrategy/index.js +++ /dev/null @@ -1,49 +0,0 @@ -import { AbstractValidationStrategyService } from "../../../service/AbstractValidationStrategyService"; -import { ObjectStrat } from "../ObjectStrategy"; -/** - * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating arrays of object types. - * - * @typeParam F - The type of the field being validated, which is expected to be an array of objects. - * - * @extends AbstractValidationStrategyService, ObjectArraySimpleErrors> - */ -export class ObjectArrayStrat extends AbstractValidationStrategyService { - /** - * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for arrays of object types. - * - * @param value - The array of object values to be validated. - * @param context - The context in which the validation is taking place. - * @param groups - Optional validation groups to consider during validation. - * - * @returns A tuple containing `ObjectArrayDetailedErrors` and `ObjectArraySimpleErrors`. - * - * @remarks - * The method validates both the array as a whole (`field`) and each individual object (`data`) - * using the appropriate validation rules. - */ - test(value, context, args) { - const _value = value !== null && value !== void 0 ? value : []; - const rootResult = this.getRootErrors(value, context, args); - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - const getData = (element) => { - const [errors, detailedErrors] = new ObjectStrat(this.fieldDescriptor, this.defaultValue, this.groups, this.locale, this.eventEmitter, this.engineCfg.asyncDelay).test(element, context, args); - return { - detailedErrors, - errors, - }; - }; - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - const getErrors = (element) => getData(element).errors; - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - const getDetailedErrors = (element) => getData(element).detailedErrors; - const details = { - root: rootResult, - data: _value.map(getDetailedErrors), - }; - const simple = { - root: this.getErrorMessages(rootResult), - data: _value.map(getErrors), - }; - return [details, simple]; - } -} diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectArrayStrategy/types.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectArrayStrategy/types.js deleted file mode 100644 index 05f6f37e2..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectArrayStrategy/types.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Namespace for ObjectArray Strategy Types. - */ -var ObjectArrayStrategyType; -(function (ObjectArrayStrategyType) { - /** - * Constant name identifier for this strategy. - */ - ObjectArrayStrategyType.Name = "composite[]"; -})(ObjectArrayStrategyType || (ObjectArrayStrategyType = {})); -export default ObjectArrayStrategyType; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectGetterStrategy.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectGetterStrategy.d.ts new file mode 100644 index 000000000..8ac2af063 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectGetterStrategy.d.ts @@ -0,0 +1,72 @@ +import { DecoratorArgs } from "../../../decorators"; +import { DetailedErrorsResponse, SimpleErrorsResponse, evaluate } from "../../models"; +import { Booleans } from "../../../utilities"; +import type { ValidationResult } from "../../../validation/types"; +import { AbstractValidationStrategyService } from "../AbstractValidationStrategyService"; +export declare namespace ObjectGetterStrategy { + const Name: "(): composite"; + /** + * Represents the simplified error structure for validating object types. + * + * @typeParam F - The type of the field being validated. + * + * - `root`: An array of string messages that represent validation errors at the object level. + * - `data`: An `Errors` object that represents validation errors for each property in the object. + */ + type SimpleErrors = { + root: string[]; + data: SimpleErrorsResponse; + }; + /** + * Represents the detailed error structure for validating object types. + * + * @typeParam F - The type of the field being validated. + * + * - `root`: An array of `ValidationResult` objects that represent detailed validation errors at the object level. + * - `data`: A `DetailedErrors` object that represents detailed validation errors for each property in the object. + */ + type DetailedErrors = { + root: ValidationResult[]; + data: DetailedErrorsResponse; + }; + /** + * Type guard to check if a certain field in a type matches this strategy. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + */ + type matches = true extends Booleans.isGetter ? Booleans.isObject : false; + /** + * Type for the handler function based on the field and result types. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + * @typeParam R - The result type. + */ + type handler = true extends Booleans.isUndefined ? T[K] : { + root: R; + data: evaluate; + }; + /** + * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating object types. + * + * @typeParam F - The type of the field being validated, which is expected to be an object. + * + * @extends AbstractValidationStrategyService, ObjectSimpleErrors> + */ + class StrategyResolver extends AbstractValidationStrategyService, SimpleErrors> { + /** + * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for object types. + * + * @param value - The object value to be validated. + * @param context - The context in which the validation is taking place. + * @param groups - Optional validation groups to consider during validation. + * + * @returns A tuple containing `ObjectDetailedErrors` and `ObjectSimpleErrors`. + * + * @remarks + * The method validates both the object as a whole (`node`) and its properties (`children`) + * using the appropriate validation rules. + */ + test(value: any, context: any, args: DecoratorArgs): [DetailedErrors, SimpleErrors]; + } +} +//# sourceMappingURL=ObjectGetterStrategy.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectGetterStrategy.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectGetterStrategy.d.ts.map new file mode 100644 index 000000000..c11c87aad --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectGetterStrategy.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ObjectGetterStrategy.d.ts","sourceRoot":"","sources":["../../../../../src/strategy/service/impl/ObjectGetterStrategy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC1F,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,iCAAiC,EAAE,MAAM,sCAAsC,CAAC;AAGzF,yBAAiB,oBAAoB,CAAC;IAC7B,MAAM,IAAI,iBAAwC,CAAC;IAE1D;;;;;;;OAOG;IACH,KAAY,YAAY,CAAC,CAAC,IAAI;QAC5B,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,IAAI,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC;KAC/B,CAAC;IAEF;;;;;;;OAOG;IACH,KAAY,cAAc,CAAC,CAAC,IAAI;QAC9B,IAAI,EAAE,gBAAgB,EAAE,CAAC;QACzB,IAAI,EAAE,sBAAsB,CAAC,CAAC,CAAC,CAAC;KACjC,CAAC;IAEF;;;;OAIG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IACpC,IAAI,SAAS,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,GAChC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACvB,KAAK,CAAA;IAEb;;;;;OAKG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,IACvC,IAAI,SAAS,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,GAChC,CAAC,CAAC,CAAC,CAAC,GACR;QAAE,IAAI,EAAE,CAAC,CAAC;QAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;KAAE,CAAC;IAEzC;;;;;;OAMG;IACH,MAAa,gBAAgB,CAAC,CAAC,CAAE,SAAQ,iCAAiC,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;QAC/G;;;;;;;;;;;;WAYG;QACH,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,aAAa,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;KAiB1F;CACF"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectGetterStrategy.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectGetterStrategy.js new file mode 100644 index 000000000..209b03c2c --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectGetterStrategy.js @@ -0,0 +1,42 @@ +import { AbstractValidationStrategyService } from "../AbstractValidationStrategyService"; +import { ObjectStrategy } from "./ObjectStrategy"; +export var ObjectGetterStrategy; +(function (ObjectGetterStrategy) { + ObjectGetterStrategy.Name = `(): ${ObjectStrategy.Name}`; + /** + * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating object types. + * + * @typeParam F - The type of the field being validated, which is expected to be an object. + * + * @extends AbstractValidationStrategyService, ObjectSimpleErrors> + */ + class StrategyResolver extends AbstractValidationStrategyService { + /** + * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for object types. + * + * @param value - The object value to be validated. + * @param context - The context in which the validation is taking place. + * @param groups - Optional validation groups to consider during validation. + * + * @returns A tuple containing `ObjectDetailedErrors` and `ObjectSimpleErrors`. + * + * @remarks + * The method validates both the object as a whole (`node`) and its properties (`children`) + * using the appropriate validation rules. + */ + test(value, context, args) { + const { detailedErrors, errors } = this.fieldEngine.validate(value); + const rootResult = [...this.getRootErrors(value, context, args), ...this.getClassErrors(value, context)]; + const detailedErrorsResult = { + root: rootResult, + data: detailedErrors, + }; + const errorsResult = { + root: this.getErrorMessages(rootResult), + data: errors, + }; + return [detailedErrorsResult, errorsResult]; + } + } + ObjectGetterStrategy.StrategyResolver = StrategyResolver; +})(ObjectGetterStrategy || (ObjectGetterStrategy = {})); diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectGetterStrategy/index.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectGetterStrategy/index.js deleted file mode 100644 index 312931d0f..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectGetterStrategy/index.js +++ /dev/null @@ -1,39 +0,0 @@ -import { AbstractValidationStrategyService } from "../../../service/AbstractValidationStrategyService"; -/** - * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating object types. - * - * @typeParam F - The type of the field being validated, which is expected to be an object. - * - * @extends AbstractValidationStrategyService, ObjectSimpleErrors> - */ -export class ObjectGetterStrat extends AbstractValidationStrategyService { - /** - * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for object types. - * - * @param value - The object value to be validated. - * @param context - The context in which the validation is taking place. - * @param groups - Optional validation groups to consider during validation. - * - * @returns A tuple containing `ObjectDetailedErrors` and `ObjectSimpleErrors`. - * - * @remarks - * The method validates both the object as a whole (`node`) and its properties (`children`) - * using the appropriate validation rules. - */ - test(value, context, args) { - const { detailedErrors, errors } = this.fieldEngine.validate(value); - const rootResult = [ - ...this.getRootErrors(value, context, args), - ...this.getClassErrors(value, context), - ]; - const detailedErrorsResult = { - root: rootResult, - data: detailedErrors, - }; - const errorsResult = { - root: this.getErrorMessages(rootResult), - data: errors, - }; - return [detailedErrorsResult, errorsResult]; - } -} diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectGetterStrategy/types.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectGetterStrategy/types.js deleted file mode 100644 index c09d49f89..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectGetterStrategy/types.js +++ /dev/null @@ -1,6 +0,0 @@ -import ObjectStrategyType from "../ObjectStrategy/types"; -var ObjectGetterStrategyType; -(function (ObjectGetterStrategyType) { - ObjectGetterStrategyType.Name = `(): ${ObjectStrategyType.Name}`; -})(ObjectGetterStrategyType || (ObjectGetterStrategyType = {})); -export default ObjectGetterStrategyType; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectStrategy.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectStrategy.d.ts new file mode 100644 index 000000000..116d0898d --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectStrategy.d.ts @@ -0,0 +1,71 @@ +import { DecoratorArgs } from "../../../decorators"; +import { DetailedErrorsResponse, SimpleErrorsResponse, evaluate } from "../../models/StrategyFactory"; +import { Booleans } from "../../../utilities"; +import type { ValidationResult } from "../../../validation/types"; +import { AbstractValidationStrategyService } from "../AbstractValidationStrategyService"; +export declare namespace ObjectStrategy { + /** + * Constant name identifier for this strategy. + */ + const Name: "composite"; + /** + * Represents the simplified error structure for validating object types. + * @typeParam F - The type of the field being validated. + */ + type SimpleErrors = { + /** An array of string messages that represent validation errors at the decorated field level. */ + root: string[]; + /** An object that represents simplified validation errors for each property in the object. */ + data: SimpleErrorsResponse; + }; + /** + * Represents the detailed error structure for validating object types. + * @typeParam F - The type of the field being validated. + */ + type DetailedErrors = { + /** An array of validation result objects that represent detailed validation errors at the decorated field level. */ + root: ValidationResult[]; + /** An object that represents detailed validation errors for each property in the object. */ + data: DetailedErrorsResponse; + }; + /** + * Type guard to check if a certain field in a type matches this strategy. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + */ + type matches = true extends Booleans.isGetter ? false : Booleans.isObject; + /** + * Type for the handler function based on the field and result types. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + * @typeParam R - The result type. + */ + type handler = true extends Booleans.isUndefined ? T[K] : { + root: R; + data: evaluate; + }; + /** + * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating object types. + * + * @typeParam F - The type of the field being validated, which is expected to be an object. + * + * @extends AbstractValidationStrategyService, ObjectSimpleErrors> + */ + class StrategyResolver extends AbstractValidationStrategyService, SimpleErrors> { + /** + * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for object types. + * + * @param value - The object value to be validated. + * @param context - The context in which the validation is taking place. + * @param groups - Optional validation groups to consider during validation. + * + * @returns A tuple containing `ObjectDetailedErrors` and `ObjectSimpleErrors`. + * + * @remarks + * The method validates both the object as a whole (`node`) and its properties (`children`) + * using the appropriate validation rules. + */ + test(value: any, context: any, args: DecoratorArgs): [DetailedErrors, SimpleErrors]; + } +} +//# sourceMappingURL=ObjectStrategy.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectStrategy.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectStrategy.d.ts.map new file mode 100644 index 000000000..8bd7c8082 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectStrategy.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ObjectStrategy.d.ts","sourceRoot":"","sources":["../../../../../src/strategy/service/impl/ObjectStrategy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC1G,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,iCAAiC,EAAE,MAAM,sCAAsC,CAAC;AAEzF,yBAAiB,cAAc,CAAC;IAC9B;;OAEG;IACI,MAAM,IAAI,aAAuB,CAAC;IAEzC;;;OAGG;IACH,KAAY,YAAY,CAAC,CAAC,IAAI;QAC5B,iGAAiG;QACjG,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,8FAA8F;QAC9F,IAAI,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC;KAC/B,CAAC;IAEF;;;OAGG;IACH,KAAY,cAAc,CAAC,CAAC,IAAI;QAC9B,oHAAoH;QACpH,IAAI,EAAE,gBAAgB,EAAE,CAAC;QACzB,4FAA4F;QAC5F,IAAI,EAAE,sBAAsB,CAAC,CAAC,CAAC,CAAC;KACjC,CAAC;IAEF;;;;OAIG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IACpC,IAAI,SAAS,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,GAChC,KAAK,GACT,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAE5B;;;;;OAKG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,IACvC,IAAI,SAAS,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,GAChC,CAAC,CAAC,CAAC,CAAC,GACR;QAAE,IAAI,EAAE,CAAC,CAAC;QAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;KAAE,CAAC;IAEzC;;;;;;OAMG;IACH,MAAa,gBAAgB,CAAC,CAAC,CAAE,SAAQ,iCAAiC,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;QAC/G;;;;;;;;;;;;WAYG;QACH,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,aAAa,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;KAiB1F;CACF"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectStrategy.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectStrategy.js new file mode 100644 index 000000000..f85e14f97 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectStrategy.js @@ -0,0 +1,44 @@ +import { AbstractValidationStrategyService } from "../AbstractValidationStrategyService"; +export var ObjectStrategy; +(function (ObjectStrategy) { + /** + * Constant name identifier for this strategy. + */ + ObjectStrategy.Name = "composite"; + /** + * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating object types. + * + * @typeParam F - The type of the field being validated, which is expected to be an object. + * + * @extends AbstractValidationStrategyService, ObjectSimpleErrors> + */ + class StrategyResolver extends AbstractValidationStrategyService { + /** + * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for object types. + * + * @param value - The object value to be validated. + * @param context - The context in which the validation is taking place. + * @param groups - Optional validation groups to consider during validation. + * + * @returns A tuple containing `ObjectDetailedErrors` and `ObjectSimpleErrors`. + * + * @remarks + * The method validates both the object as a whole (`node`) and its properties (`children`) + * using the appropriate validation rules. + */ + test(value, context, args) { + const { detailedErrors, errors } = this.fieldEngine.validate(value); + const rootResult = [...this.getRootErrors(value, context, args), ...this.getClassErrors(value, context)]; + const detailedErrorsResult = { + root: rootResult, + data: detailedErrors, + }; + const errorsResult = { + root: this.getErrorMessages(rootResult), + data: errors, + }; + return [detailedErrorsResult, errorsResult]; + } + } + ObjectStrategy.StrategyResolver = StrategyResolver; +})(ObjectStrategy || (ObjectStrategy = {})); diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectStrategy/index.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectStrategy/index.js deleted file mode 100644 index 0567acc94..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectStrategy/index.js +++ /dev/null @@ -1,39 +0,0 @@ -import { AbstractValidationStrategyService } from "../../../service/AbstractValidationStrategyService"; -/** - * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating object types. - * - * @typeParam F - The type of the field being validated, which is expected to be an object. - * - * @extends AbstractValidationStrategyService, ObjectSimpleErrors> - */ -export class ObjectStrat extends AbstractValidationStrategyService { - /** - * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for object types. - * - * @param value - The object value to be validated. - * @param context - The context in which the validation is taking place. - * @param groups - Optional validation groups to consider during validation. - * - * @returns A tuple containing `ObjectDetailedErrors` and `ObjectSimpleErrors`. - * - * @remarks - * The method validates both the object as a whole (`node`) and its properties (`children`) - * using the appropriate validation rules. - */ - test(value, context, args) { - const { detailedErrors, errors } = this.fieldEngine.validate(value); - const rootResult = [ - ...this.getRootErrors(value, context, args), - ...this.getClassErrors(value, context), - ]; - const detailedErrorsResult = { - root: rootResult, - data: detailedErrors, - }; - const errorsResult = { - root: this.getErrorMessages(rootResult), - data: errors, - }; - return [detailedErrorsResult, errorsResult]; - } -} diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectStrategy/types.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectStrategy/types.js deleted file mode 100644 index d76dca73e..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/ObjectStrategy/types.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Namespace for Object Strategy Types. - */ -var ObjectStrategyType; -(function (ObjectStrategyType) { - /** - * Constant name identifier for this strategy. - */ - ObjectStrategyType.Name = "composite"; -})(ObjectStrategyType || (ObjectStrategyType = {})); -export default ObjectStrategyType; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveArrayGetterStrategy.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveArrayGetterStrategy.d.ts new file mode 100644 index 000000000..9bd7e8a8e --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveArrayGetterStrategy.d.ts @@ -0,0 +1,70 @@ +import { DecoratorArgs } from "../../../decorators"; +import { Arrays, Booleans, Types } from "../../../utilities"; +import type { ValidationResult } from "../../../validation/types"; +import { AbstractValidationStrategyService } from "../AbstractValidationStrategyService"; +export declare namespace PrimitiveArrayGetterStrategy { + /** + * Constant name identifier for this strategy. + */ + const Name: "get (): primitive[]"; + /** + * Represents the simplified error structure for validating arrays of primitive types. + * + * - `node`: An array of string messages that represent validation errors at the array level. + * - `children`: A two-dimensional array of string messages that represent validation errors for each element in the array. + */ + type SimpleErrors = { + node: string[]; + children: string[][]; + }; + /** + * Represents the detailed error structure for validating arrays of primitive types. + * + * - `node`: An array of `ValidationResult` objects that represent detailed validation errors at the array level. + * - `children`: A two-dimensional array of `ValidationResult` objects that represent detailed validation errors for each element in the array. + */ + type DetailedErrors = { + node: ValidationResult[]; + children: ValidationResult[][]; + }; + /** + * Type guard to check if a certain field in a type matches this strategy. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + */ + type matches = true extends Booleans.isGetter ? Arrays.getArrayType extends never ? false : Booleans.isAnyOf, Types.PrimitiveType> : false; + /** + * Type for the handler function based on the field and result types. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + * @typeParam R - The result type. + */ + type handler = true extends Booleans.isUndefined ? T[K] : { + node: R; + children: R[]; + }; + /** + * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating arrays of primitive types like numbers, strings, etc. + * + * @typeParam F - The type of the field being validated, which is expected to be an array of primitives. + * + * @extends AbstractValidationStrategyService + */ + class StrategyResolver extends AbstractValidationStrategyService { + /** + * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for arrays of primitive types. + * + * @param value - The array of values to be validated. + * @param context - The context in which the validation is taking place. + * @param groups - Optional validation groups to consider during validation. + * + * @returns A tuple containing `PrimitiveArrayGetterDetailedErrors` and `PrimitiveArrayGetterSimpleErrors`. + * + * @remarks + * The method validates both the array as a whole (`node`) and each individual element (`children`) + * using the appropriate validation rules. + */ + test(value: any[], context: any, args: DecoratorArgs): [DetailedErrors, SimpleErrors]; + } +} +//# sourceMappingURL=PrimitiveArrayGetterStrategy.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveArrayGetterStrategy.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveArrayGetterStrategy.d.ts.map new file mode 100644 index 000000000..e2ab75de9 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveArrayGetterStrategy.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"PrimitiveArrayGetterStrategy.d.ts","sourceRoot":"","sources":["../../../../../src/strategy/service/impl/PrimitiveArrayGetterStrategy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,iCAAiC,EAAE,MAAM,sCAAsC,CAAC;AAGzF,yBAAiB,4BAA4B,CAAC;IAC5C;;OAEG;IACI,MAAM,IAAI,uBAAiD,CAAC;IAEnE;;;;;OAKG;IACH,KAAY,YAAY,GAAG;QACzB,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC;KACtB,CAAC;IAEF;;;;;OAKG;IACH,KAAY,cAAc,GAAG;QAC3B,IAAI,EAAE,gBAAgB,EAAE,CAAC;QACzB,QAAQ,EAAE,gBAAgB,EAAE,EAAE,CAAC;KAChC,CAAC;IAEF;;;;OAIG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IACpC,IAAI,SAAS,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,GAChC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,KAAK,GACrC,KAAK,GACL,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAClE,KAAK,CAAC;IAEd;;;;;OAKG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,IACvC,IAAI,SAAS,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,GAChC,CAAC,CAAC,CAAC,CAAC,GACR;QAAE,IAAI,EAAE,CAAC,CAAC;QAAC,QAAQ,EAAE,CAAC,EAAE,CAAC;KAAE,CAAC;IAEhC;;;;;;OAMG;IACH,MAAa,gBAAgB,CAAC,CAAC,CAAE,SAAQ,iCAAiC,CAAC,CAAC,EAAE,cAAc,EAAE,YAAY,CAAC;QACzG;;;;;;;;;;;;WAYG;QACH,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,aAAa,GAAG,CAAC,cAAc,EAAE,YAAY,CAAC;KAgBtF;CACF"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveArrayGetterStrategy.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveArrayGetterStrategy.js new file mode 100644 index 000000000..b9be047ff --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveArrayGetterStrategy.js @@ -0,0 +1,45 @@ +import { AbstractValidationStrategyService } from "../AbstractValidationStrategyService"; +import { PrimitiveStrategy } from "./PrimitiveStrategy"; +export var PrimitiveArrayGetterStrategy; +(function (PrimitiveArrayGetterStrategy) { + /** + * Constant name identifier for this strategy. + */ + PrimitiveArrayGetterStrategy.Name = `get (): ${PrimitiveStrategy.Name}[]`; + /** + * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating arrays of primitive types like numbers, strings, etc. + * + * @typeParam F - The type of the field being validated, which is expected to be an array of primitives. + * + * @extends AbstractValidationStrategyService + */ + class StrategyResolver extends AbstractValidationStrategyService { + /** + * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for arrays of primitive types. + * + * @param value - The array of values to be validated. + * @param context - The context in which the validation is taking place. + * @param groups - Optional validation groups to consider during validation. + * + * @returns A tuple containing `PrimitiveArrayGetterDetailedErrors` and `PrimitiveArrayGetterSimpleErrors`. + * + * @remarks + * The method validates both the array as a whole (`node`) and each individual element (`children`) + * using the appropriate validation rules. + */ + test(value, context, args) { + const valueArray = value !== null && value !== void 0 ? value : []; + const rootResult = this.getRootErrors(valueArray, context, args); + const details = { + node: rootResult, + children: valueArray.map(v => this.getArrayItemErrors(v, context)), + }; + const simple = { + node: this.getErrorMessages(rootResult), + children: details.children.map(v => this.getErrorMessages(v)), + }; + return [details, simple]; + } + } + PrimitiveArrayGetterStrategy.StrategyResolver = StrategyResolver; +})(PrimitiveArrayGetterStrategy || (PrimitiveArrayGetterStrategy = {})); diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveArrayGetterStrategy/index.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveArrayGetterStrategy/index.js deleted file mode 100644 index cb07f5e11..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveArrayGetterStrategy/index.js +++ /dev/null @@ -1,36 +0,0 @@ -import { AbstractValidationStrategyService } from "../../../service/AbstractValidationStrategyService"; -/** - * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating arrays of primitive types like numbers, strings, etc. - * - * @typeParam F - The type of the field being validated, which is expected to be an array of primitives. - * - * @extends AbstractValidationStrategyService - */ -export class PrimitiveArrayGetterStrat extends AbstractValidationStrategyService { - /** - * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for arrays of primitive types. - * - * @param value - The array of values to be validated. - * @param context - The context in which the validation is taking place. - * @param groups - Optional validation groups to consider during validation. - * - * @returns A tuple containing `PrimitiveArrayGetterDetailedErrors` and `PrimitiveArrayGetterSimpleErrors`. - * - * @remarks - * The method validates both the array as a whole (`node`) and each individual element (`children`) - * using the appropriate validation rules. - */ - test(value, context, args) { - const valueArray = value !== null && value !== void 0 ? value : []; - const rootResult = this.getRootErrors(valueArray, context, args); - const details = { - node: rootResult, - children: valueArray.map(v => this.getArrayItemErrors(v, context)), - }; - const simple = { - node: this.getErrorMessages(rootResult), - children: details.children.map(v => this.getErrorMessages(v)), - }; - return [details, simple]; - } -} diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveArrayGetterStrategy/types.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveArrayGetterStrategy/types.js deleted file mode 100644 index b6a35a7a1..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveArrayGetterStrategy/types.js +++ /dev/null @@ -1,12 +0,0 @@ -import PrimitiveStrategyType from "../PrimitiveStrategy/types"; -/** - * Namespace for PrimitiveArrayGetter Strategy Types. - */ -var PrimitiveArrayGetterStrategyType; -(function (PrimitiveArrayGetterStrategyType) { - /** - * Constant name identifier for this strategy. - */ - PrimitiveArrayGetterStrategyType.Name = `get (): ${PrimitiveStrategyType.Name}[]`; -})(PrimitiveArrayGetterStrategyType || (PrimitiveArrayGetterStrategyType = {})); -export default PrimitiveArrayGetterStrategyType; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveArrayStrategy.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveArrayStrategy.d.ts new file mode 100644 index 000000000..d83bda705 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveArrayStrategy.d.ts @@ -0,0 +1,70 @@ +import { DecoratorArgs } from "../../../decorators"; +import { Arrays, Booleans, Types } from "../../../utilities"; +import type { ValidationResult } from "../../../validation/types"; +import { AbstractValidationStrategyService } from "../AbstractValidationStrategyService"; +export declare namespace PrimitiveArrayStrategy { + /** + * Constant name identifier for this strategy. + */ + const Name: "primitive[]"; + /** + * Represents the simplified error structure for validating arrays of primitive types. + * + * - `root`: An array of string messages that represent validation errors at the array level. + * - `data`: A two-dimensional array of string messages that represent validation errors for each element in the array. + */ + type SimpleErrors = { + root: string[]; + data: string[][]; + }; + /** + * Represents the detailed error structure for validating arrays of primitive types. + * + * - `root`: An array of `ValidationResult` objects that represent detailed validation errors at the array level. + * - `data`: A two-dimensional array of `ValidationResult` objects that represent detailed validation errors for each element in the array. + */ + type DetailedErrors = { + root: ValidationResult[]; + data: ValidationResult[][]; + }; + /** + * Type guard to check if a certain field in a type matches this strategy. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + */ + type matches = Arrays.getArrayType extends never ? false : Booleans.isAnyOf, Types.PrimitiveType>; + /** + * Type for the handler function based on the field and result types. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + * @typeParam R - The result type. + */ + type handler = true extends Booleans.isUndefined ? T[K] : { + root: R; + data: R[]; + }; + /** + * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating arrays of primitive types like numbers, strings, etc. + * + * @typeParam F - The type of the field being validated, which is expected to be an array of primitives. + * + * @extends AbstractValidationStrategyService + */ + class StrategyResolver extends AbstractValidationStrategyService { + /** + * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for arrays of primitive types. + * + * @param value - The array of values to be validated. + * @param context - The context in which the validation is taking place. + * @param groups - Optional validation groups to consider during validation. + * + * @returns A tuple containing `PrimitiveArrayDetailedErrors` and `PrimitiveArraySimpleErrors`. + * + * @remarks + * The method validates both the array as a whole (`root`) and each individual element (`data`) + * using the appropriate validation rules. + */ + test(value: any[], context: any, args: DecoratorArgs): [DetailedErrors, SimpleErrors]; + } +} +//# sourceMappingURL=PrimitiveArrayStrategy.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveArrayStrategy.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveArrayStrategy.d.ts.map new file mode 100644 index 000000000..51c102d42 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveArrayStrategy.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"PrimitiveArrayStrategy.d.ts","sourceRoot":"","sources":["../../../../../src/strategy/service/impl/PrimitiveArrayStrategy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,iCAAiC,EAAE,MAAM,sCAAsC,CAAC;AAEzF,yBAAiB,sBAAsB,CAAC;IACtC;;OAEG;IACI,MAAM,IAAI,eAAyB,CAAC;IAE3C;;;;;OAKG;IACH,KAAY,YAAY,GAAG;QACzB,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC;KAClB,CAAC;IAEF;;;;;OAKG;IACH,KAAY,cAAc,GAAG;QAC3B,IAAI,EAAE,gBAAgB,EAAE,CAAC;QACzB,IAAI,EAAE,gBAAgB,EAAE,EAAE,CAAC;KAC5B,CAAC;IAEF;;;;OAIG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IACxC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,KAAK,GACjC,KAAK,GACT,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,CAAA;IAElE;;;;;OAKG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,IACzC,IAAI,SAAS,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,GAChC,CAAC,CAAC,CAAC,CAAC,GACR;QAAE,IAAI,EAAE,CAAC,CAAC;QAAC,IAAI,EAAE,CAAC,EAAE,CAAC;KAAE,CAAC;IAE1B;;;;;;OAMG;IACH,MAAa,gBAAgB,CAAC,CAAC,CAAE,SAAQ,iCAAiC,CAAC,CAAC,EAAE,cAAc,EAAE,YAAY,CAAC;QACzG;;;;;;;;;;;;WAYG;QACH,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,aAAa,GAAG,CAAC,cAAc,EAAE,YAAY,CAAC;KAgBtF;CACF"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveArrayStrategy.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveArrayStrategy.js new file mode 100644 index 000000000..386db6056 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveArrayStrategy.js @@ -0,0 +1,44 @@ +import { AbstractValidationStrategyService } from "../AbstractValidationStrategyService"; +export var PrimitiveArrayStrategy; +(function (PrimitiveArrayStrategy) { + /** + * Constant name identifier for this strategy. + */ + PrimitiveArrayStrategy.Name = "primitive[]"; + /** + * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating arrays of primitive types like numbers, strings, etc. + * + * @typeParam F - The type of the field being validated, which is expected to be an array of primitives. + * + * @extends AbstractValidationStrategyService + */ + class StrategyResolver extends AbstractValidationStrategyService { + /** + * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for arrays of primitive types. + * + * @param value - The array of values to be validated. + * @param context - The context in which the validation is taking place. + * @param groups - Optional validation groups to consider during validation. + * + * @returns A tuple containing `PrimitiveArrayDetailedErrors` and `PrimitiveArraySimpleErrors`. + * + * @remarks + * The method validates both the array as a whole (`root`) and each individual element (`data`) + * using the appropriate validation rules. + */ + test(value, context, args) { + const valueArray = value !== null && value !== void 0 ? value : []; + const rootResult = this.getRootErrors(valueArray, context, args); + const details = { + root: rootResult, + data: valueArray.map(v => this.getArrayItemErrors(v, context)), + }; + const simple = { + root: this.getErrorMessages(rootResult), + data: details.data.map(v => this.getErrorMessages(v)), + }; + return [details, simple]; + } + } + PrimitiveArrayStrategy.StrategyResolver = StrategyResolver; +})(PrimitiveArrayStrategy || (PrimitiveArrayStrategy = {})); diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveArrayStrategy/index.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveArrayStrategy/index.js deleted file mode 100644 index 32763ba2d..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveArrayStrategy/index.js +++ /dev/null @@ -1,36 +0,0 @@ -import { AbstractValidationStrategyService } from "../../../service/AbstractValidationStrategyService"; -/** - * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating arrays of primitive types like numbers, strings, etc. - * - * @typeParam F - The type of the field being validated, which is expected to be an array of primitives. - * - * @extends AbstractValidationStrategyService - */ -export class PrimitiveArrayStrat extends AbstractValidationStrategyService { - /** - * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for arrays of primitive types. - * - * @param value - The array of values to be validated. - * @param context - The context in which the validation is taking place. - * @param groups - Optional validation groups to consider during validation. - * - * @returns A tuple containing `PrimitiveArrayDetailedErrors` and `PrimitiveArraySimpleErrors`. - * - * @remarks - * The method validates both the array as a whole (`root`) and each individual element (`data`) - * using the appropriate validation rules. - */ - test(value, context, args) { - const valueArray = value !== null && value !== void 0 ? value : []; - const rootResult = this.getRootErrors(valueArray, context, args); - const details = { - root: rootResult, - data: valueArray.map(v => this.getArrayItemErrors(v, context)), - }; - const simple = { - root: this.getErrorMessages(rootResult), - data: details.data.map(v => this.getErrorMessages(v)), - }; - return [details, simple]; - } -} diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveArrayStrategy/types.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveArrayStrategy/types.js deleted file mode 100644 index cd1049a4c..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveArrayStrategy/types.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Namespace for PrimitiveArray Strategy Types. - */ -var PrimitiveArrayStrategyType; -(function (PrimitiveArrayStrategyType) { - /** - * Constant name identifier for this strategy. - */ - PrimitiveArrayStrategyType.Name = "primitive[]"; -})(PrimitiveArrayStrategyType || (PrimitiveArrayStrategyType = {})); -export default PrimitiveArrayStrategyType; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveGetterStrategy.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveGetterStrategy.d.ts new file mode 100644 index 000000000..81a9d1d7f --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveGetterStrategy.d.ts @@ -0,0 +1,50 @@ +import { DecoratorArgs } from "../../../decorators"; +import { Booleans, Types } from "../../../utilities"; +import type { ValidationResult } from "../../../validation/types"; +import { AbstractValidationStrategyService } from "../AbstractValidationStrategyService"; +export declare namespace PrimitiveGetterStrategy { + /** + * Constant name identifier for this strategy. + */ + const Name: "get (): primitive"; + /** + * Represents the simplified error structure for validating getter methods that return primitive types. + */ + type SimpleErrors = string[]; + /** + * Represents the detailed error structure for validating getter methods that return primitive types. + */ + type DetailedErrors = ValidationResult[]; + /** + * Type guard to check if a certain field in a type matches this strategy. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + */ + type matches = true extends Booleans.isGetter ? Booleans.isAnyOf : false; + /** + * Type for the handler function based on the field and result types. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + * @typeParam R - The result type. + */ + type handler = true extends Booleans.isUndefined ? T[K] : R; + /** + * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating getter primitive types like numbers, strings, etc. + * + * @typeParam F - The type of the field being validated. + * + * @extends AbstractValidationStrategyService + */ + class StrategyResolver extends AbstractValidationStrategyService { + /** + * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for primitive types by invoking the root rule's `validate` method and then building simplified error messages. + * + * @param value - The value to be validated. + * @param context - The context in which the validation is taking place. + * + * @returns A tuple containing an array of detailed validation results (`ValidationResult[]`) and an array of simplified error messages (`string[]`). + */ + test(value: any, context: any, args: DecoratorArgs): [DetailedErrors, SimpleErrors]; + } +} +//# sourceMappingURL=PrimitiveGetterStrategy.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveGetterStrategy.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveGetterStrategy.d.ts.map new file mode 100644 index 000000000..47f3bf4cf --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveGetterStrategy.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"PrimitiveGetterStrategy.d.ts","sourceRoot":"","sources":["../../../../../src/strategy/service/impl/PrimitiveGetterStrategy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,iCAAiC,EAAE,MAAM,sCAAsC,CAAC;AAGzF,yBAAiB,uBAAuB,CAAC;IACvC;;OAEG;IACI,MAAM,IAAI,qBAA+C,CAAC;IAEjE;;OAEG;IACH,KAAY,YAAY,GAAG,MAAM,EAAE,CAAC;IAEpC;;OAEG;IACH,KAAY,cAAc,GAAG,gBAAgB,EAAE,CAAC;IAEhD;;;;OAIG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IACpC,IAAI,SAAS,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,GAChC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAC3C,KAAK,CAAC;IAEd;;;;;OAKG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,IACvC,IAAI,SAAS,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,GAChC,CAAC,CAAC,CAAC,CAAC,GACR,CAAC,CAAC;IAEN;;;;;;OAMG;IACH,MAAa,gBAAgB,CAAC,CAAC,CAAE,SAAQ,iCAAiC,CAAC,CAAC,EAAE,cAAc,EAAE,YAAY,CAAC;QACzG;;;;;;;WAOG;QACH,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,aAAa,GAAG,CAAC,cAAc,EAAE,YAAY,CAAC;KAIpF;CACF"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveGetterStrategy.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveGetterStrategy.js new file mode 100644 index 000000000..f02072195 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveGetterStrategy.js @@ -0,0 +1,31 @@ +import { AbstractValidationStrategyService } from "../AbstractValidationStrategyService"; +import { PrimitiveStrategy } from "./PrimitiveStrategy"; +export var PrimitiveGetterStrategy; +(function (PrimitiveGetterStrategy) { + /** + * Constant name identifier for this strategy. + */ + PrimitiveGetterStrategy.Name = `get (): ${PrimitiveStrategy.Name}`; + /** + * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating getter primitive types like numbers, strings, etc. + * + * @typeParam F - The type of the field being validated. + * + * @extends AbstractValidationStrategyService + */ + class StrategyResolver extends AbstractValidationStrategyService { + /** + * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for primitive types by invoking the root rule's `validate` method and then building simplified error messages. + * + * @param value - The value to be validated. + * @param context - The context in which the validation is taking place. + * + * @returns A tuple containing an array of detailed validation results (`ValidationResult[]`) and an array of simplified error messages (`string[]`). + */ + test(value, context, args) { + const root = this.getRootErrors(value, context, args); + return [root, this.getErrorMessages(root)]; + } + } + PrimitiveGetterStrategy.StrategyResolver = StrategyResolver; +})(PrimitiveGetterStrategy || (PrimitiveGetterStrategy = {})); diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveGetterStrategy/index.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveGetterStrategy/index.js deleted file mode 100644 index cdfe03e80..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveGetterStrategy/index.js +++ /dev/null @@ -1,22 +0,0 @@ -import { AbstractValidationStrategyService } from "../../../service/AbstractValidationStrategyService"; -/** - * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating getter primitive types like numbers, strings, etc. - * - * @typeParam F - The type of the field being validated. - * - * @extends AbstractValidationStrategyService - */ -export class PrimitiveGetterStrat extends AbstractValidationStrategyService { - /** - * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for primitive types by invoking the root rule's `validate` method and then building simplified error messages. - * - * @param value - The value to be validated. - * @param context - The context in which the validation is taking place. - * - * @returns A tuple containing an array of detailed validation results (`ValidationResult[]`) and an array of simplified error messages (`string[]`). - */ - test(value, context, args) { - const root = this.getRootErrors(value, context, args); - return [root, this.getErrorMessages(root)]; - } -} diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveGetterStrategy/types.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveGetterStrategy/types.js deleted file mode 100644 index 21444e592..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveGetterStrategy/types.js +++ /dev/null @@ -1,12 +0,0 @@ -import PrimitiveStrategyType from "../PrimitiveStrategy/types"; -/** - * Namespace for PrimitiveGetter Strategy Types. - */ -var PrimitiveGetterStrategyType; -(function (PrimitiveGetterStrategyType) { - /** - * Constant name identifier for this strategy. - */ - PrimitiveGetterStrategyType.Name = `get (): ${PrimitiveStrategyType.Name}`; -})(PrimitiveGetterStrategyType || (PrimitiveGetterStrategyType = {})); -export default PrimitiveGetterStrategyType; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveStrategy.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveStrategy.d.ts new file mode 100644 index 000000000..a71c08ca6 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveStrategy.d.ts @@ -0,0 +1,51 @@ +import { DecoratorArgs } from "../../../decorators"; +import { Booleans, Types } from "../../../utilities"; +import type { ValidationResult } from "../../../validation/types"; +import { AbstractValidationStrategyService } from "../AbstractValidationStrategyService"; +export declare namespace PrimitiveStrategy { + /** + * Constant name identifier for this strategy. + */ + const Name: "primitive"; + /** + * Represents the simplified error structure for validating primitive types. + */ + type SimpleErrors = string[]; + /** + * Represents the detailed error structure for validating primitive types. + */ + type DetailedErrors = ValidationResult[]; + /** + * Type guard to check if a certain field in a type matches this strategy. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + */ + type matches = Booleans.isAnyOf; + /** + * Type for the handler function based on the field and result types. + * @typeParam T - The type containing the field. + * @typeParam K - The key of the field. + * @typeParam R - The result type. + */ + type handler = true extends Booleans.isUndefined ? T[K] : R; + /** + * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating primitive types like numbers, strings, etc. + * + * @typeParam F - The type of the field being validated. + * + * @extends AbstractValidationStrategyService + */ + class StrategyResolver extends AbstractValidationStrategyService { + /** + * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for primitive types by invoking the root rule's `validate` method and then building simplified error messages. + * + * @param value - The value to be validated. + * @param context - The context in which the validation is taking place. + * @param groups - Optional validation groups to consider during validation. + * + * @returns A tuple containing an array of detailed validation results (`ValidationResult[]`) and an array of simplified error messages (`string[]`). + */ + test(value: any, context: any, args: DecoratorArgs): [DetailedErrors, SimpleErrors]; + } +} +//# sourceMappingURL=PrimitiveStrategy.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveStrategy.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveStrategy.d.ts.map new file mode 100644 index 000000000..6a3bc9d2f --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveStrategy.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"PrimitiveStrategy.d.ts","sourceRoot":"","sources":["../../../../../src/strategy/service/impl/PrimitiveStrategy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,iCAAiC,EAAE,MAAM,sCAAsC,CAAC;AAEzF,yBAAiB,iBAAiB,CAAC;IACjC;;OAEG;IACI,MAAM,IAAI,aAAuB,CAAC;IAEzC;;OAEG;IACH,KAAY,YAAY,GAAG,MAAM,EAAE,CAAC;IAEpC;;OAEG;IACH,KAAY,cAAc,GAAG,gBAAgB,EAAE,CAAC;IAEhD;;;;OAIG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IAExF;;;;;OAKG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,IACzC,IAAI,SAAS,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,GAChC,CAAC,CAAC,CAAC,CAAC,GACR,CAAC,CAAC;IAEJ;;;;;;OAMG;IACH,MAAa,gBAAgB,CAAC,CAAC,CAAE,SAAQ,iCAAiC,CAAC,CAAC,EAAE,cAAc,EAAE,YAAY,CAAC;QACzG;;;;;;;;WAQG;QACH,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,aAAa,GAAG,CAAC,cAAc,EAAE,YAAY,CAAC;KAIpF;CACF"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveStrategy.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveStrategy.js new file mode 100644 index 000000000..5be856701 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveStrategy.js @@ -0,0 +1,31 @@ +import { AbstractValidationStrategyService } from "../AbstractValidationStrategyService"; +export var PrimitiveStrategy; +(function (PrimitiveStrategy) { + /** + * Constant name identifier for this strategy. + */ + PrimitiveStrategy.Name = "primitive"; + /** + * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating primitive types like numbers, strings, etc. + * + * @typeParam F - The type of the field being validated. + * + * @extends AbstractValidationStrategyService + */ + class StrategyResolver extends AbstractValidationStrategyService { + /** + * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for primitive types by invoking the root rule's `validate` method and then building simplified error messages. + * + * @param value - The value to be validated. + * @param context - The context in which the validation is taking place. + * @param groups - Optional validation groups to consider during validation. + * + * @returns A tuple containing an array of detailed validation results (`ValidationResult[]`) and an array of simplified error messages (`string[]`). + */ + test(value, context, args) { + const root = this.getRootErrors(value, context, args); + return [root, this.getErrorMessages(root)]; + } + } + PrimitiveStrategy.StrategyResolver = StrategyResolver; +})(PrimitiveStrategy || (PrimitiveStrategy = {})); diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveStrategy/index.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveStrategy/index.js deleted file mode 100644 index 775ab6dd2..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveStrategy/index.js +++ /dev/null @@ -1,23 +0,0 @@ -import { AbstractValidationStrategyService } from "../../../service/AbstractValidationStrategyService"; -/** - * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating primitive types like numbers, strings, etc. - * - * @typeParam F - The type of the field being validated. - * - * @extends AbstractValidationStrategyService - */ -export class PrimitiveStrat extends AbstractValidationStrategyService { - /** - * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for primitive types by invoking the root rule's `validate` method and then building simplified error messages. - * - * @param value - The value to be validated. - * @param context - The context in which the validation is taking place. - * @param groups - Optional validation groups to consider during validation. - * - * @returns A tuple containing an array of detailed validation results (`ValidationResult[]`) and an array of simplified error messages (`string[]`). - */ - test(value, context, args) { - const root = this.getRootErrors(value, context, args); - return [root, this.getErrorMessages(root)]; - } -} diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveStrategy/types.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveStrategy/types.js deleted file mode 100644 index b0825d8a3..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/PrimitiveStrategy/types.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Namespace for Primitive Strategy Types. - */ -var PrimitiveStrategyType; -(function (PrimitiveStrategyType) { - /** - * Constant name identifier for this strategy. - */ - PrimitiveStrategyType.Name = "primitive"; -})(PrimitiveStrategyType || (PrimitiveStrategyType = {})); -export default PrimitiveStrategyType; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/index.d.ts similarity index 100% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/index.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/index.d.ts index 502adae2c..3f77f8be2 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/index.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/index.d.ts @@ -1,3 +1,4 @@ +export * from "./PrimitiveStrategy"; export * from "./FunctionStrategy"; export * from "./ObjectArrayGetterStrategy"; export * from "./ObjectArrayStrategy"; @@ -6,5 +7,4 @@ export * from "./ObjectStrategy"; export * from "./PrimitiveArrayGetterStrategy"; export * from "./PrimitiveArrayStrategy"; export * from "./PrimitiveGetterStrategy"; -export * from "./PrimitiveStrategy"; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/index.d.ts.map new file mode 100644 index 000000000..2d9e9216f --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/strategy/service/impl/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AAEpC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,6BAA6B,CAAC;AAE5C,cAAc,uBAAuB,CAAC;AAEtC,cAAc,wBAAwB,CAAC;AAEvC,cAAc,kBAAkB,CAAC;AAEjC,cAAc,gCAAgC,CAAC;AAE/C,cAAc,0BAA0B,CAAC;AAEzC,cAAc,2BAA2B,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/index.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/index.js index 7b0b1237c..4ae27c19e 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/index.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/impl/index.js @@ -1,3 +1,4 @@ +export * from "./PrimitiveStrategy"; export * from "./FunctionStrategy"; export * from "./ObjectArrayGetterStrategy"; export * from "./ObjectArrayStrategy"; @@ -6,4 +7,3 @@ export * from "./ObjectStrategy"; export * from "./PrimitiveArrayGetterStrategy"; export * from "./PrimitiveArrayStrategy"; export * from "./PrimitiveGetterStrategy"; -export * from "./PrimitiveStrategy"; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/index.d.ts similarity index 100% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/index.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/index.d.ts diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/index.d.ts.map new file mode 100644 index 000000000..06e3e9954 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/strategy/service/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/strategy/service/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC;AACpD,cAAc,QAAQ,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Arrays.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Arrays.d.ts new file mode 100644 index 000000000..f607571b1 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Arrays.d.ts @@ -0,0 +1,18 @@ +export declare namespace Arrays { + /** + * Returns depth of provided generic array (example: getArrayDepth returns 2). + * @remarks Due to TypeScript's compiler - evaluation is limited to the depth of 5. + */ + type getArrayDepth = T extends any[] ? T[0] extends any[] ? T[0][0] extends any[] ? T[0][0][0] extends any[] ? T[0][0][0][0] extends any[] ? 5 : 4 : 3 : 2 : 1 : 0; + /** + * Returns an array type constructed of `N` depth. + */ + type setArrayDepth = R["length"] extends N ? T : setArrayDepth; + /** + * A type that extracts the element type of an array type `T`. + * + * @typeParam T - The type to extract the array type from. + */ + type getArrayType = T extends Array ? U : never; +} +//# sourceMappingURL=Arrays.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Arrays.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Arrays.d.ts.map new file mode 100644 index 000000000..07c4b533a --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Arrays.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Arrays.d.ts","sourceRoot":"","sources":["../../../../src/utilities/impl/Arrays.ts"],"names":[],"mappings":"AAAA,yBAAiB,MAAM,CAAC;IACtB;;;OAGG;IAEH,KAAY,aAAa,CAAC,CAAC,IACzB,CAAC,SAAS,GAAG,EAAE,GACX,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,EAAE,GAChB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,EAAE,GACnB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,EAAE,GACtB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,EAAE,GACzB,CAAC,GACD,CAAC,GACH,CAAC,GACH,CAAC,GACH,CAAC,GACH,CAAC,CAAC;IAER;;OAEG;IACH,KAAY,aAAa,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,GACxF,CAAC,GACD,aAAa,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IAErC;;;;OAIG;IACH,KAAY,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;CACpE"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Booleans.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Booleans.d.ts new file mode 100644 index 000000000..6bb35885d --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Booleans.d.ts @@ -0,0 +1,62 @@ +import { Arrays } from "../impl/Arrays"; +import { Objects } from "../impl/Objects"; +import { Types } from "../impl/Types"; +export declare namespace Booleans { + /** + * Checks if `TCheck` is any of the types in `TData`. + * + * @typeParam TCheck - The type to check. + * @typeParam TData - The array type to check against. + */ + type isAnyOf = NonNullable extends TData[number] ? true : false; + /** + * Checks if `T` is an object type. + * + * @typeParam T - The type to check. + */ + type isObject = NonNullable extends isFunction ? false : NonNullable extends isArray ? false : NonNullable extends isPrimitive ? false : true; + /** + * Checks if `T` is a function type. + * + * @typeParam T - The type to check. + */ + type isFunction = NonNullable extends Types.FunctionType ? true : false; + /** + * Checks if `T[K]` is a getter type. + * + * @typeParam T - The parent type to check. + * @typeParam T - The key of parent to check. + */ + type isGetter = K extends Objects.Inputs ? false : true; + /** + * Checks if `T` is an array type. + * + * @typeParam T - The type to check. + */ + type isArray = NonNullable extends Types.ArrayType ? true : false; + /** + * Checks if `T` is a primitive type. + * + * @typeParam T - The type to check. + */ + type isPrimitive = isAnyOf; + /** + * Checks if `T` is an array of primitive types. + * + * @typeParam T - The type to check. + */ + type isPrimitiveArray = Arrays.getArrayType extends never ? false : isPrimitive>; + /** + * Checks if `T` is an array of object types. + * + * @typeParam T - The type to check. + */ + type isObjectArray = Arrays.getArrayType extends never ? false : isObject>; + /** + * Checks if `T` is `undefined`. + * + * @typeParam T - The type to check. + */ + type isUndefined = T extends undefined ? true : false; +} +//# sourceMappingURL=Booleans.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Booleans.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Booleans.d.ts.map new file mode 100644 index 000000000..b52250be7 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Booleans.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Booleans.d.ts","sourceRoot":"","sources":["../../../../src/utilities/impl/Booleans.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE9C,yBAAiB,QAAQ,CAAC;IACxB;;;;;OAKG;IACH,KAAY,OAAO,CAAC,MAAM,EAAE,KAAK,SAAS,KAAK,CAAC,SAAS,IAAI,WAAW,CAAC,MAAM,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;IAEtH;;;;OAIG;IACH,KAAY,QAAQ,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,GAC1D,KAAK,GACL,WAAW,CAAC,CAAC,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,GACjC,KAAK,GACL,WAAW,CAAC,CAAC,CAAC,SAAS,WAAW,CAAC,CAAC,CAAC,GACrC,KAAK,GACL,IAAI,CAAC;IAET;;;;OAIG;IACH,KAAY,UAAU,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,SAAS,KAAK,CAAC,YAAY,GAAG,IAAI,GAAG,KAAK,CAAC;IAErF;;;;;OAKG;IACH,KAAY,QAAQ,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC;IAExF;;;;OAIG;IACH,KAAY,OAAO,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,SAAS,KAAK,CAAC,SAAS,GAAG,IAAI,GAAG,KAAK,CAAC;IAE/E;;;;OAIG;IACH,KAAY,WAAW,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IAE7D;;;;OAIG;IACH,KAAY,gBAAgB,CAAC,CAAC,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,GAAG,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IAErH;;;;OAIG;IACH,KAAY,aAAa,CAAC,CAAC,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IAE/G;;;;OAIG;IACH,KAAY,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,IAAI,GAAG,KAAK,CAAC;CACjE"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Classes.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Classes.d.ts new file mode 100644 index 000000000..990755aae --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Classes.d.ts @@ -0,0 +1,33 @@ +import { Types } from "../impl/Types"; +export declare namespace Classes { + /** + * Retrieves the names of all fields in a class. + * + * @param constructor - The class constructor. + * @returns An array of field names. + */ + function getClassFieldNames(constructor: Types.Class): Array; + /** + * Retrieves the property descriptor for a specific field in a class. + * + * @param constructor - The class constructor. + * @param name - The name of the field. + * @returns The property descriptor for the field. + */ + function getClassFieldDescriptor(constructor: Types.Class, name: keyof TClass): PropertyDescriptor | undefined; + /** + * Retrieves or initializes metadata for a given strategy. + * + * @param strategy - The strategy to get metadata for. + * @returns The metadata object. + */ + function getMetadata(strategy: any): DecoratorMetadataObject; + /** + * Checks if a given strategy is a class. + * + * @param strategy - The strategy to check. + * @returns True if the strategy is a class, false otherwise. + */ + function isClass(strategy: any): strategy is Types.Class; +} +//# sourceMappingURL=Classes.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Classes.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Classes.d.ts.map new file mode 100644 index 000000000..fded49676 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Classes.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Classes.d.ts","sourceRoot":"","sources":["../../../../src/utilities/impl/Classes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE9C,yBAAiB,OAAO,CAAC;IACvB;;;;;OAKG;IACH,SAAgB,kBAAkB,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,MAAM,CAAC,CAWhG;IAED;;;;;;OAMG;IACH,SAAgB,uBAAuB,CAAC,MAAM,EAC5C,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,EAChC,IAAI,EAAE,MAAM,MAAM,GACjB,kBAAkB,GAAG,SAAS,CAIhC;IAED;;;;;OAKG;IACH,SAAgB,WAAW,CAAC,QAAQ,EAAE,GAAG,GAAsB,uBAAuB,CAYrF;IAED;;;;;OAKG;IACH,SAAgB,OAAO,CAAC,QAAQ,EAAE,GAAG,GAAsB,QAAQ,IAAI,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAEtF;CACF"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Classes.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Classes.js new file mode 100644 index 000000000..2324a35ee --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Classes.js @@ -0,0 +1,67 @@ +export var Classes; +(function (Classes) { + /** + * Retrieves the names of all fields in a class. + * + * @param constructor - The class constructor. + * @returns An array of field names. + */ + function getClassFieldNames(constructor) { + function getPropertyNames(classInstance) { + return Object.getOwnPropertyNames(classInstance !== null && classInstance !== void 0 ? classInstance : {}).filter(property => property !== "constructor"); + } + const instance = new constructor(); + const prototype = instance.__proto__; + const instanceProps = getPropertyNames(instance); + const prototypeProps = getPropertyNames(prototype); + const uniquePropsSet = new Set([...instanceProps, ...prototypeProps]); + const uniquePropsArray = [...uniquePropsSet]; + return uniquePropsArray; + } + Classes.getClassFieldNames = getClassFieldNames; + /** + * Retrieves the property descriptor for a specific field in a class. + * + * @param constructor - The class constructor. + * @param name - The name of the field. + * @returns The property descriptor for the field. + */ + function getClassFieldDescriptor(constructor, name) { + const instance = new constructor(); + const prototype = instance.__proto__; + return Object.getOwnPropertyDescriptor(prototype, name); + } + Classes.getClassFieldDescriptor = getClassFieldDescriptor; + /** + * Retrieves or initializes metadata for a given strategy. + * + * @param strategy - The strategy to get metadata for. + * @returns The metadata object. + */ + function getMetadata(strategy /* MetaStrategy */) { + var _a, _b, _c; + var _d, _e; + if (isClass(strategy)) { + (_a = (_d = Symbol).metadata) !== null && _a !== void 0 ? _a : (_d.metadata = Symbol("Symbol.metadata")); + // @ts-ignore + (_b = strategy[_e = Symbol.metadata]) !== null && _b !== void 0 ? _b : (strategy[_e] = {}); + // @ts-ignore + return strategy[Symbol.metadata]; + } + if (strategy && !strategy.metadata) { + strategy.metadata = {}; + } + return (_c = strategy === null || strategy === void 0 ? void 0 : strategy.metadata) !== null && _c !== void 0 ? _c : {}; + } + Classes.getMetadata = getMetadata; + /** + * Checks if a given strategy is a class. + * + * @param strategy - The strategy to check. + * @returns True if the strategy is a class, false otherwise. + */ + function isClass(strategy /* MetaStrategy */) { + return typeof strategy === "function"; + } + Classes.isClass = isClass; +})(Classes || (Classes = {})); diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Objects.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Objects.d.ts new file mode 100644 index 000000000..ad512932e --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Objects.d.ts @@ -0,0 +1,84 @@ +export declare namespace Objects { + /** + * A type that represents an optional value. + * + * @typeParam T - The type of the optional value. + */ + type Optional = T extends undefined ? any : T | undefined | null; + /** + * A predicate function for filtering arrays. + * + * @typeParam T - The type of the array elements. + */ + type ArrayPredicate = ((value: T, index: number, array: T[]) => boolean) & {}; + /** + * Filters out getters, functions and read-only properties from a type + */ + type Payload = any; + /** + * A conditional type that checks if types `X` and `Y` are equal. It returns type `A` if they are equal, and type `B` if they are not. + * + * @typeParam X - The first type. + * @typeParam Y - The second type. + * @typeParam A - The type to return if `X` and `Y` are equal. + * @typeParam B - The type to return if `X` and `Y` are not equal. + */ + type IfEquals = (() => T extends X ? 1 : 2) extends () => T extends Y ? 1 : 2 ? A : B; + /** + * A type that excludes properties with values of type `TExclude` from `TParent`. + * + * @typeParam TParent - The parent type. + * @typeParam TExclude - The type to exclude from `TParent`. + */ + type Exclude = Pick>; + /** + * A type that removes properties with values of type `never` from `T`. + * + * @typeParam T - The type to purify. + */ + type Purify = Exclude; + /** + * A type that extracts the values from the properties of an object type `T`. + * + * @typeParam T - An object type. + */ + type Values = T[keyof T]; + /** + * A type that extracts input properties from an object type `T`. + * + * @typeParam T - The object type. + */ + type Inputs = { + [P in keyof T]-?: IfEquals<{ + [Q in P]: T[P]; + }, { + -readonly [Q in P]: T[P]; + }, P>; + }[keyof T]; + /** + * Removes duplicate elements from an array while preserving order. + * + * @typeParam T - The type of the elements in the array. + */ + function unique(data: T[]): T[]; + /** + * Recursively checks if two values are deep equal. + */ + function deepEquals(val1: any, val2: any): boolean; + /** + * Hashes a value of any type and returns a number. + */ + function hash(val: any): number; + /** + * Debounces a function. + * @param fn - The function to debounce. + * @param delay - The delay time in milliseconds. + * @returns A debounced function. + */ + function debounce(fn: Function, delay: number): Function; + type FieldType = "date" | "array" | "string" | "number" | "boolean" | "object"; + function assertType(type: FieldType, value: any): void | never; +} +//# sourceMappingURL=Objects.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Objects.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Objects.d.ts.map new file mode 100644 index 000000000..d43ec0ec5 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Objects.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Objects.d.ts","sourceRoot":"","sources":["../../../../src/utilities/impl/Objects.ts"],"names":[],"mappings":"AAAA,yBAAiB,OAAO,CAAC;IACvB;;;;OAIG;IACH,KAAY,QAAQ,CAAC,CAAC,GAAG,SAAS,IAAI,CAAC,SAAS,SAAS,GAAG,GAAG,GAAG,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC;IAEvF;;;;OAIG;IACH,KAAY,cAAc,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,OAAO,CAAC,GAAG,EAAE,CAAC;IAExF;;OAEG;IAEH,KAAY,OAAO,CAAC,CAAC,IAAI,GAAG,CAatB;IAEN;;;;;;;OAOG;IACH,KAAY,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,GAC9G,CAAC,GACD,CAAC,CAAC;IAEN;;;;;OAKG;IACH,KAAY,OAAO,CAAC,OAAO,EAAE,QAAQ,IAAI,IAAI,CAC3C,OAAO,EACP,MAAM,CAAC;SACJ,IAAI,IAAI,MAAM,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,KAAK,GAAG,IAAI;KAC3E,CAAC,CACH,CAAC;IAEF;;;;OAIG;IACH,KAAY,MAAM,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IAE1C;;;;OAIG;IACH,KAAY,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IAEnC;;;;OAIG;IACH,KAAY,MAAM,CAAC,CAAC,IAAI;SACrB,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC;aAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SAAE,EAAE;YAAE,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SAAE,EAAE,CAAC,CAAC;KAChF,CAAC,MAAM,CAAC,CAAC,CAAC;IAEX;;;;OAIG;IACH,SAAgB,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAExC;IAED;;OAEG;IACH,SAAgB,UAAU,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CA8BxD;IAED;;OAEG;IACH,SAAgB,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CA2ErC;IAED;;;;;OAKG;IACH,SAAgB,QAAQ,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,QAAQ,CAQ9D;IAED,KAAY,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;IAEtF,SAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI,GAAG,KAAK,CAepE;CAKF"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Objects.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Objects.js index 2f7295f9f..42c20117e 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Objects.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Objects.js @@ -1,215 +1,167 @@ -import API from "../../index"; -import { EventEmitter } from "../misc/EventEmitter"; -/** - * Removes duplicate elements from an array while preserving order. - * - * @typeParam T - The type of the elements in the array. - */ -export function unique(data) { - return [...new Set(data)]; -} -/** - * Checks if an error object has errors. - * - * @typeParam T - The type of the errors. - */ -export function hasErrors(data) { - const data0 = data; - if (Array.isArray(data0)) { - return data0.some(item => hasErrors(item)); - } - else if (typeof data0 === "object" && data0 !== null) { - return Object.values(data0).some((value) => hasErrors(value)); - } - else if (typeof data0 === "string") { - return true; - } - return false; -} -/** - * Recursively checks if two values are deep equal. - */ -export function deepEquals(val1, val2) { - if (val1 === val2) { - return true; - } - else if (typeof val1 !== typeof val2) { - return false; - } - else if (Array.isArray(val1) && Array.isArray(val2)) { - if (val1.length !== val2.length) { +export var Objects; +(function (Objects) { + /** + * Removes duplicate elements from an array while preserving order. + * + * @typeParam T - The type of the elements in the array. + */ + function unique(data) { + return [...new Set(data)]; + } + Objects.unique = unique; + /** + * Recursively checks if two values are deep equal. + */ + function deepEquals(val1, val2) { + if (val1 === val2) { + return true; + } + else if (typeof val1 !== typeof val2) { return false; } - for (let i = 0; i < val1.length; i++) { - if (!deepEquals(val1[i], val2[i])) { + else if (Array.isArray(val1) && Array.isArray(val2)) { + if (val1.length !== val2.length) { return false; } + for (let i = 0; i < val1.length; i++) { + if (!deepEquals(val1[i], val2[i])) { + return false; + } + } + return true; } - return true; - } - else if (typeof val1 === "object" && val1 !== null && val2 !== null) { - const keys1 = Object.keys(val1); - const keys2 = Object.keys(val2); - if (keys1.length !== keys2.length) { - return false; - } - for (const key of keys1) { - if (!deepEquals(val1[key], val2[key])) { + else if (typeof val1 === "object" && val1 !== null && val2 !== null) { + const keys1 = Object.keys(val1); + const keys2 = Object.keys(val2); + if (keys1.length !== keys2.length) { return false; } - } - return true; - } - else { - return false; - } -} -/** - * Hashes a value of any type and returns a number. - */ -export function hash(val) { - function stringHash(str) { - let hash = 0; - for (let i = 0; i < str.length; i++) { - hash = (hash << 5) - hash + str.charCodeAt(i); - hash = hash & hash; - } - return hash; - } - function numberHash(num) { - return num - .toString() - .split("") - .reduce((hash, ch) => { - hash = (hash << 5) - hash + ch.charCodeAt(0); - return hash & hash; - }, 0); - } - function booleanHash(bool) { - return bool ? 1 : 0; - } - function nullHash() { - return 0; - } - function undefinedHash() { - return 0; - } - function arrayHash(arr) { - return arr.reduce((hash, val) => { - hash = (hash << 5) - hash + hash(val); - return hash & hash; - }, 0); - } - function objectHash(obj) { - return Object.keys(obj) - .sort() - .reduce((hashValue, key) => { - hashValue = (hashValue << 5) - hashValue + hash(obj[key]); - return hashValue & hashValue; - }, 0); - } - function defaultHash(val) { - return (val !== null && val !== void 0 ? val : "") - .toString() - .split("") - .reduce((hash, ch) => { - hash = (hash << 5) - hash + ch.charCodeAt(0); - return hash & hash; - }, 0); - } - if (typeof val === "string") { - return stringHash(val); - } - else if (typeof val === "number") { - return numberHash(val); - } - else if (typeof val === "boolean") { - return booleanHash(val); - } - else if (val === null) { - return nullHash(); - } - else if (val === undefined) { - return undefinedHash(); - } - else if (Array.isArray(val)) { - return arrayHash(val); - } - else if (typeof val === "object") { - return objectHash(val); - } - else { - return defaultHash(val); - } -} -/** - * Transforms a plain object into an instance of the given class. - * @param clazz - The class to transform the object into. - * @param object - The object to transform. - * @typeParam TClass - The type of the class. - * @returns An instance of TClass. - */ -export function toClass(clazz, object) { - function _toClass(clazz, object) { - if (Array.isArray(object)) { - return object.map(item => _toClass(clazz, item)); - } - const entries = Object.entries(object !== null && object !== void 0 ? object : {}); - const meta = API.Reflection.FieldValidatorMetaService.inject(clazz, EventEmitter.EMPTY); - const data = {}; - for (const [key, value] of entries) { - const descriptor = meta.getUntypedDescriptor(key); - const { thisClass } = descriptor; - if (thisClass) { - if (Array.isArray(value)) { - data[key] = value.map(item => _toClass(thisClass, item)); - } - else { - data[key] = toClass(thisClass, value); + for (const key of keys1) { + if (!deepEquals(val1[key], val2[key])) { + return false; } } - else { - data[key] = value; + return true; + } + else { + return false; + } + } + Objects.deepEquals = deepEquals; + /** + * Hashes a value of any type and returns a number. + */ + function hash(val) { + function stringHash(str) { + let hash = 0; + for (let i = 0; i < str.length; i++) { + hash = (hash << 5) - hash + str.charCodeAt(i); + hash = hash & hash; } + return hash; + } + function numberHash(num) { + return num + .toString() + .split("") + .reduce((hash, ch) => { + hash = (hash << 5) - hash + ch.charCodeAt(0); + return hash & hash; + }, 0); + } + function booleanHash(bool) { + return bool ? 1 : 0; + } + function nullHash() { + return 0; + } + function undefinedHash() { + return 0; + } + function arrayHash(arr) { + return arr.reduce((hash, val) => { + hash = (hash << 5) - hash + hash(val); + return hash & hash; + }, 0); + } + function objectHash(obj) { + return Object.keys(obj) + .sort() + .reduce((hashValue, key) => { + hashValue = (hashValue << 5) - hashValue + hash(obj[key]); + return hashValue & hashValue; + }, 0); + } + function defaultHash(val) { + return (val !== null && val !== void 0 ? val : "") + .toString() + .split("") + .reduce((hash, ch) => { + hash = (hash << 5) - hash + ch.charCodeAt(0); + return hash & hash; + }, 0); + } + if (typeof val === "string") { + return stringHash(val); + } + else if (typeof val === "number") { + return numberHash(val); + } + else if (typeof val === "boolean") { + return booleanHash(val); + } + else if (val === null) { + return nullHash(); + } + else if (val === undefined) { + return undefinedHash(); + } + else if (Array.isArray(val)) { + return arrayHash(val); + } + else if (typeof val === "object") { + return objectHash(val); + } + else { + return defaultHash(val); } - const instance = new clazz(); - Object.entries(data).forEach(([k, v]) => (instance[k] = v)); - return instance; } - return _toClass(clazz, object); -} -/** - * Debounces a function. - * @param fn - The function to debounce. - * @param delay - The delay time in milliseconds. - * @returns A debounced function. - */ -export function debounce(fn, delay) { - let timeoutID = null; - return (...args) => { - if (timeoutID) { - clearTimeout(timeoutID); - } - timeoutID = setTimeout(() => fn(...args), delay); - }; -} -export function assertType(type, value) { - if (value == null) - return; - if (type === "date") { - if (value instanceof Date) - return; - throwTypeMismatchError(type, value); + Objects.hash = hash; + /** + * Debounces a function. + * @param fn - The function to debounce. + * @param delay - The delay time in milliseconds. + * @returns A debounced function. + */ + function debounce(fn, delay) { + let timeoutID = null; + return (...args) => { + if (timeoutID) { + clearTimeout(timeoutID); + } + timeoutID = setTimeout(() => fn(...args), delay); + }; } - if (type === "array") { - if (Array.isArray(value)) + Objects.debounce = debounce; + function assertType(type, value) { + if (value == null) + return; + if (type === "date") { + if (value instanceof Date) + return; + throwTypeMismatchError(type, value); + } + if (type === "array") { + if (Array.isArray(value)) + return; + throwTypeMismatchError(type, value); + } + if (typeof value === type) return; throwTypeMismatchError(type, value); } - if (typeof value === type) - return; - throwTypeMismatchError(type, value); -} -function throwTypeMismatchError(type, value) { - throw new Error(`Type '${type}' is not assignable to type ${JSON.stringify(value)}`); -} + Objects.assertType = assertType; + function throwTypeMismatchError(type, value) { + throw new Error(`Type '${type}' is not assignable to type ${JSON.stringify(value)}`); + } +})(Objects || (Objects = {})); diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Strings.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Strings.d.ts new file mode 100644 index 000000000..ccd9c5608 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Strings.d.ts @@ -0,0 +1,2 @@ +export declare namespace Strings { } +//# sourceMappingURL=Strings.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Strings.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Strings.d.ts.map new file mode 100644 index 000000000..bac1aec64 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Strings.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Strings.d.ts","sourceRoot":"","sources":["../../../../src/utilities/impl/Strings.ts"],"names":[],"mappings":"AAAA,yBAAiB,OAAO,CAAC,GAAE"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Strings.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Strings.js index 01e3a73de..cb0ff5c3b 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Strings.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Strings.js @@ -1,20 +1 @@ -/** - * Formats a string by replacing placeholders with provided arguments. - * - * @param str - The string containing placeholders in the form of `{0}`, `{1}`, etc. - * @param args - The values to replace the placeholders with. - * @returns The formatted string with placeholders replaced by the corresponding values from `args`. - * - * @example - * ```typescript - * const formatted = sprintf("Hello, {0}!", "World"); // Output: "Hello, World!" - * ``` - * - * @remarks - * If a placeholder's corresponding value is not provided in `args`, the placeholder will remain unchanged in the output string. - */ -export function sprintf(str, ...args) { - return str.replace(/{(\d+)}/g, function (match, number) { - return typeof args[number] !== "undefined" ? args[number] : match; - }); -} +export {}; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Types.d.ts similarity index 61% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/index.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Types.d.ts index 47b865acd..8474abf06 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/index.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Types.d.ts @@ -1,18 +1,3 @@ -import * as Decorators from "./src/decorators"; -import { createClassDecorator, createClassValidator, createFieldDecorator, createFieldValidator } from "./src/decorators"; -import { attribute } from "./src/decorators/data/structural/attribute"; -import TdvCoreApi from "./src/index"; -import * as Localization from "./src/localization"; -import * as Reflection from "./src/reflection"; -import * as Strategy from "./src/strategy"; -import * as Utilities from "./src/utilities"; -import * as Validation from "./src/validation"; -import { Form } from "./src/validation/models/Form"; -export import Class = Utilities.Types.Class; -export import UnwrapClass = Utilities.Types.UnwrapClass; -export import ValidationResult = Validation.ValidationResult; -export { Form, attribute, createClassDecorator, createClassValidator, createFieldDecorator, createFieldValidator, }; -export { Decorators, Localization, Reflection, Strategy, Utilities, Validation }; /** * An overridable interface designed for disabling nested validation on custom object types. * - when specified ***(example 1)***: an object type is considered primitive and it's simplified errors render as `string[]` @@ -27,9 +12,7 @@ export { Decorators, Localization, Reflection, Strategy, Utilities, Validation } * y: number; * } * ``` - * *
- * * ```ts * // index.ts - entry point of the app * declare module "tdv-core" { @@ -39,13 +22,10 @@ export { Decorators, Localization, Reflection, Strategy, Utilities, Validation } * } * } * ``` - * *
- * * ```ts * // consumer.ts - model class which holds Coordinate property * import { createFieldValidator } from "tdv-core"; - * * // custom Coordinate validator * function MinX(minX: number) { * return createFieldValidator(coordinate => ({ @@ -85,11 +65,8 @@ export { Decorators, Localization, Reflection, Strategy, Utilities, Validation } * * ```ts * // consumer.ts - model class which holds Coordinate property - * import { attribute } from "tdv-core"; - *import Localization from '../react/examples/basic-example-form/libs/tdv-core/dist/types/src/localization/index.d'; -import Utilities from './dist/src/utilities/index'; -import { Form } from './src/validation/models/Form'; - + * import { attribute, Localization, Form, Utilities } from "tdv-core"; + * * class Consumer { * \@attribute(Coordinate) // enables deep validation * coordinate: Coordinate; // non-primitive @@ -104,5 +81,60 @@ import { Form } from './src/validation/models/Form'; */ export interface PrimitiveSet { } -export default TdvCoreApi; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file +export declare namespace Types { + /** + * Represents the JavaScript `Function` type. + */ + type FunctionType = (() => any) & {}; + /** + * Represents the generic array type. + */ + type ArrayType = any[]; + /** + * Represents primitive data types including `string`, `number`, `boolean`, + * `bigint`, `Date`, and custom primitives defined in `PrimitiveSetAppend`. + */ + type PrimitiveType = [ + ...[string, number, boolean, bigint, Date], + ...(PrimitiveSet extends { + values: infer CustomPrimitives extends readonly unknown[]; + } ? CustomPrimitives : []) + ]; + /** + * Represents a class constructor that can create instances of type `T`. + * + * @typeParam T - The type to be instantiated by the class constructor. + * + * @example + * ```typescript + * class MyClass { + * constructor(arg1: string, arg2: number) { + * // ... + * } + * } + * + * const myClassConstructor: Class = MyClass; + * const instance = new myClassConstructor('hello', 42); + * // Creates an instance of MyClass + * ``` + */ + type Class = (new (...args: any[]) => T) & {}; + /** + * Unwraps a Promise type to its resolved value type. + * @typeParam T - The type to unwrap. + */ + type UnwrapPromise = T extends Promise ? U : T; + /** + * Unwraps a Class type to its instance type. + * @typeParam T - The type to unwrap. + */ + type UnwrapClass = T extends Class ? U : never; + /** + * Prettifies a type by retaining the same shape. + * @typeParam T - The type to prettify. + */ + type Prettify = { + [K in keyof T]: T[K]; + } & {}; +} +//# sourceMappingURL=Types.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Types.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Types.d.ts.map new file mode 100644 index 000000000..e3d972e5f --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/impl/Types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Types.d.ts","sourceRoot":"","sources":["../../../../src/utilities/impl/Types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgFG;AACH,MAAM,WAAW,YAAY;CAAG;AAEhC,yBAAiB,KAAK,CAAC;IACrB;;OAEG;IACH,KAAY,YAAY,GAAG,CAAC,MAAM,GAAG,CAAC,GAAG,EAAE,CAAC;IAE5C;;OAEG;IACH,KAAY,SAAS,GAAG,GAAG,EAAE,CAAC;IAE9B;;;OAGG;IACH,KAAY,aAAa,GAAG;QAC1B,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC;QAC1C,GAAG,CAAC,YAAY,SAAS;YACvB,MAAM,EAAE,MAAM,gBAAgB,SAAS,SAAS,OAAO,EAAE,CAAC;SAC3D,GACG,gBAAgB,GAChB,EAAE,CAAC;KACR,CAAC;IAEF;;;;;;;;;;;;;;;;;OAiBG;IACH,KAAY,KAAK,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC;IAE7D;;;OAGG;IACH,KAAY,aAAa,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAElE;;;OAGG;IACH,KAAY,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IAElE;;;OAGG;IACH,KAAY,QAAQ,CAAC,CAAC,IAAI;SACvB,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;KACrB,GAAG,EAAE,CAAC;CACR"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/index.d.ts new file mode 100644 index 000000000..368cfc4ca --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/index.d.ts @@ -0,0 +1,8 @@ +export * from "./impl/Arrays"; +export * from "./impl/Booleans"; +export * from "./impl/Classes"; +export * from "./impl/Objects"; +export * from "./impl/Strings"; +export * from "./impl/Types"; +export * from "./misc/EventEmitter"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/index.d.ts.map new file mode 100644 index 000000000..1a554e785 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utilities/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/index.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/index.js index 6704936d2..ada48ae01 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/index.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/index.js @@ -1,6 +1,7 @@ -export * as Arrays from "./impl/Arrays"; -export * as Booleans from "./impl/Booleans"; -export * as Objects from "./impl/Objects"; -export * as Strings from "./impl/Strings"; -export * as Types from "./impl/Types"; +export * from "./impl/Arrays"; +export * from "./impl/Booleans"; +export * from "./impl/Classes"; +export * from "./impl/Objects"; +export * from "./impl/Strings"; +export * from "./impl/Types"; export * from "./misc/EventEmitter"; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/misc/EventEmitter.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/misc/EventEmitter.d.ts similarity index 69% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/misc/EventEmitter.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/misc/EventEmitter.d.ts index f09ba97e4..3e9932d70 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/misc/EventEmitter.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/misc/EventEmitter.d.ts @@ -1,14 +1,11 @@ -import TdvCoreApi from "../../index"; -/** - * Event emitter class. - */ +/** Event emitter class. */ export declare class EventEmitter { #private; - static EMPTY: TdvCoreApi.Utilities.EventEmitter; + static EMPTY: EventEmitter; private readonly events; private readonly handlersTimeout; get id(): string; - constructor(id: string); + constructor(id: string, asyncDelay?: number); emit(event: string, data?: any): void; on(event: string, handler: (data?: any) => void): void; off(event: string, handler: (data?: any) => void): void; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/misc/EventEmitter.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/misc/EventEmitter.d.ts.map new file mode 100644 index 000000000..0de2a4000 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/misc/EventEmitter.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"EventEmitter.d.ts","sourceRoot":"","sources":["../../../../src/utilities/misc/EventEmitter.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,qBAAa,YAAY;;IAGvB,OAAc,KAAK,eAA6B;IAChD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA2C;IAClE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA8B;IAE9D,IAAI,EAAE,WAEL;gBAEW,EAAE,EAAE,MAAM,EAAE,UAAU,GAAE,MAAY;IAOhD,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI;IAiBrC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI;IAMtD,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI;CAoBxD"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/misc/EventEmitter.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/misc/EventEmitter.js index 6c538ebe9..d56a358ca 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/misc/EventEmitter.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/utilities/misc/EventEmitter.js @@ -9,20 +9,19 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function ( if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; }; -var _EventEmitter_id; -import TdvCoreApi from "../../index"; -/** - * Event emitter class. - */ +var _EventEmitter_id, _EventEmitter_asyncDelay; +/** Event emitter class. */ export class EventEmitter { get id() { return __classPrivateFieldGet(this, _EventEmitter_id, "f"); } - constructor(id) { + constructor(id, asyncDelay = 500) { _EventEmitter_id.set(this, void 0); + _EventEmitter_asyncDelay.set(this, void 0); this.events = new Map(); this.handlersTimeout = new Map(); __classPrivateFieldSet(this, _EventEmitter_id, id, "f"); + __classPrivateFieldSet(this, _EventEmitter_asyncDelay, asyncDelay, "f"); } emit(event, data) { const handlers = this.events.get(event); @@ -33,7 +32,9 @@ export class EventEmitter { if (existingTimeout) { clearTimeout(existingTimeout); } - const timeout = setTimeout(() => { handler(data); }, TdvCoreApi.Configuration.asyncValidationDelay); + const timeout = setTimeout(() => { + handler(data); + }, __classPrivateFieldGet(this, _EventEmitter_asyncDelay, "f")); this.handlersTimeout.set(handlerKey, timeout); }); } @@ -66,5 +67,5 @@ export class EventEmitter { } } } -_EventEmitter_id = new WeakMap(); +_EventEmitter_id = new WeakMap(), _EventEmitter_asyncDelay = new WeakMap(); EventEmitter.EMPTY = new EventEmitter("EMPTY"); diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/index.d.ts new file mode 100644 index 000000000..b44bd5113 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/index.d.ts @@ -0,0 +1,3 @@ +export * from "./types"; +export * from "./models"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/index.d.ts.map new file mode 100644 index 000000000..3f48187fe --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/validation/index.ts"],"names":[],"mappings":"AAEA,cAAc,SAAS,CAAC;AAExB,cAAc,UAAU,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/index.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/index.js index 104a49c21..3f74cc100 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/index.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/index.js @@ -1,4 +1,5 @@ var _a; var _b; (_a = (_b = Symbol).metadata) !== null && _a !== void 0 ? _a : (_b.metadata = Symbol("Symbol.metadata")); +export * from "./types"; export * from "./models"; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/validation/models/Cache.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/Cache.d.ts similarity index 100% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/validation/models/Cache.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/Cache.d.ts diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/Cache.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/Cache.d.ts.map new file mode 100644 index 000000000..da3b73655 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/Cache.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Cache.d.ts","sourceRoot":"","sources":["../../../../src/validation/models/Cache.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,qBAAa,KAAK,CAAC,UAAU,SAAS,MAAM,GAAG,EAAE,EAAE,OAAO,GAAG,GAAG;;IAK9D;;;;;OAKG;gBACS,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,UAAU,EAAE,YAAY,CAAC,EAAE,UAAU;IAM/E;;;;;;;;;OASG;IAEH,GAAG,CAAC,QAAQ,SAAS,MAAM,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,QAAQ,CAAC;IAMnG;;;;;;;OAOG;IACH,KAAK,CAAC,YAAY,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,UAAU;CAyBzE"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/Cache.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/Cache.js index 834ba1701..52c7552fb 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/Cache.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/Cache.js @@ -10,7 +10,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function ( return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); }; var _Cache_instances, _Cache_cache, _Cache_payload, _Cache_changeFn, _Cache_fromCache; -import API from "../../../index"; +import { Objects } from "../../utilities"; /** * A generic caching utility class used by `ValidationEngine`. * @@ -69,7 +69,7 @@ export class Cache { } _Cache_cache = new WeakMap(), _Cache_payload = new WeakMap(), _Cache_changeFn = new WeakMap(), _Cache_instances = new WeakSet(), _Cache_fromCache = function _Cache_fromCache(payload, cacheKey) { const cacheValue = __classPrivateFieldGet(this, _Cache_cache, "f")[cacheKey]; - return cacheValue !== undefined && API.Utilities.Objects.deepEquals(__classPrivateFieldGet(this, _Cache_payload, "f"), payload) + return cacheValue !== undefined && Objects.deepEquals(__classPrivateFieldGet(this, _Cache_payload, "f"), payload) ? cacheValue : __classPrivateFieldGet(this, _Cache_changeFn, "f").call(this, payload)[cacheKey]; }; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/validation/models/Events.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/Events.d.ts similarity index 100% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/validation/models/Events.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/Events.d.ts diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/Events.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/Events.d.ts.map new file mode 100644 index 000000000..420d5de52 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/Events.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Events.d.ts","sourceRoot":"","sources":["../../../../src/validation/models/Events.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;CAET,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/validation/models/Form.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/Form.d.ts similarity index 69% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/validation/models/Form.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/Form.d.ts index b9e488805..686632bd4 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/validation/models/Form.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/Form.d.ts @@ -1,4 +1,20 @@ -import API from "../../index"; +import { Locale } from "../../localization"; +import { DetailedErrorsResponse, SimpleErrorsResponse } from "../../strategy"; +import { Objects, Types } from "../../utilities"; +import type { AsyncEventResponseProps, FormConfig, FormValidateResponse, ValidationResult } from "../types"; +/** + * Checks if an error object has errors. + * @typeParam T - The type of the errors. + */ +export declare function hasErrors(data: SimpleErrorsResponse): boolean; +/** + * Transforms a plain object into an instance of the given class. + * @param clazz - The class to transform the object into. + * @param object - The object to transform. + * @typeParam TClass - The type of the class. + * @returns An instance of TClass. + */ +export declare function toClass>(clazz: TClass, object?: Objects.Payload>): Types.UnwrapClass; /** * A class responsible for processing and validating class instances through its decorated validators. * @@ -12,9 +28,9 @@ import API from "../../index"; export declare class Form { #private; __id: string; - locale: API.Localization.Locale; + locale: Locale; get async(): { - register: (handler: (props: API.Validation.AsyncEventResponseProps) => void) => void; + register: (handler: (props: AsyncEventResponseProps) => void) => void; unregister: () => void; delay: number; }; @@ -28,7 +44,7 @@ export declare class Form { * @param clazz - The class type to be processed. * @param config - Optional configuration settings. */ - constructor(clazz: API.Utilities.Types.Class, config?: API.Validation.FormConfig); + constructor(clazz: Types.Class, config?: FormConfig); /** * Checks if the given payload is valid. * @@ -36,7 +52,7 @@ export declare class Form { * * @returns `true` if valid, `false` otherwise. */ - isValid(payload: API.Utilities.Objects.Payload): boolean; + isValid(payload: Objects.Payload): boolean; /** * Retrieves detailed error messages for the given payload. * @@ -44,7 +60,7 @@ export declare class Form { * * @returns An object containing detailed error messages. */ - getDetailedErrors(payload?: API.Utilities.Objects.Payload): API.Strategy.Impl.DetailedErrors; + getDetailedErrors(payload?: Objects.Payload): DetailedErrorsResponse; /** * Retrieves error messages for the given payload. * @@ -52,8 +68,8 @@ export declare class Form { * * @returns An object containing error messages. */ - getErrors(payload?: API.Utilities.Objects.Payload): API.Strategy.Impl.Errors; - getGlobalErrors(payload?: API.Utilities.Objects.Payload): API.Validation.ValidationResult[]; + getErrors(payload?: Objects.Payload): SimpleErrorsResponse; + getGlobalErrors(payload?: Objects.Payload): ValidationResult[]; /** * Validates the given payload and updates the cache. * @@ -82,7 +98,7 @@ export declare class Form { * console.log(result.valid); // Output: true or false * ``` */ - validate(payload?: API.Utilities.Objects.Payload, args?: API.Decorator.DecoratorArgs): API.Validation.FormValidateResponse; + validate(payload?: Objects.Payload, args?: Record): FormValidateResponse; /** * Registers an event listener for the specified event. * @param event - The name of the event to listen for. diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/Form.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/Form.d.ts.map new file mode 100644 index 000000000..299f94b28 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/Form.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../../src/validation/models/Form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAa,MAAM,eAAe,CAAC;AAGlD,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAqB,MAAM,WAAW,CAAC;AAC5F,OAAO,EAAgB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAI1D,OAAO,KAAK,EAGV,uBAAuB,EACvB,UAAU,EACV,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;AAC3B;;;GAGG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG,OAAO,CAUnE;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,KAAK,CAAC,MAAM,SAAS,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAC3D,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,GAClD,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CA+B3B;AAED;;;;;;;;;GASG;AACH,qBAAa,IAAI,CAAC,MAAM;;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IAef,IAAW,KAAK;;;;MAMf;IAED;;OAEG;IACH,IAAW,YAAY,IAAI,GAAG,CAE7B;IAED;;;;;OAKG;gBACS,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC;IAanE;;;;;;OAMG;IACI,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO;IAIzD;;;;;;OAMG;IACI,iBAAiB,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,sBAAsB,CAAC,MAAM,CAAC;IAI3F;;;;;;OAMG;IACI,SAAS,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,oBAAoB,CAAC,MAAM,CAAC;IAI1E,eAAe,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,gBAAgB,EAAE;IAI7E;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACI,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,GAAG,oBAAoB,CAAC,MAAM,CAAC;IAkChH;;;;OAIG;IACI,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI;IAIlE;;;;OAIG;IACI,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG;CAwGtC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/Form.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/Form.js index 9a1daad48..dc3f5a3cc 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/Form.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/Form.js @@ -10,11 +10,66 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function ( return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; }; var _Form_instances, _Form_eventListener, _Form_eventEmitter, _Form_fieldValidatorMetaService, _Form_classValidatorMetaService, _Form_groups, _Form_defaultValue, _Form_cache, _Form_hostClass, _Form_asyncDelay, _Form_debounceMap, _Form_validateField, _Form_registerAsync, _Form_unregisterAsync; -import API from "../../index"; -import { ValidationMetadata } from "../../reflection/models/ValidationMetadata"; -import { EventEmitter } from "../../utilities/misc/EventEmitter"; -import { Cache } from "./Cache"; -import { Events } from "./Events"; +import { getLocale } from "../../localization"; +import { ClassValidatorMetaService } from "../../reflection/service/impl/ClassValidatorMetaService"; +import { FieldValidatorMetaService } from "../../reflection/service/impl/FieldValidatorMetaService"; +import { EventEmitter, Objects } from "../../utilities"; +import { Cache } from "../models/Cache"; +import { Events } from "../models/Events"; +import { ValidationMetadata } from "../models/ValidationMetadata"; +/** + * Checks if an error object has errors. + * @typeParam T - The type of the errors. + */ +export function hasErrors(data) { + const data0 = data; + if (Array.isArray(data0)) { + return data0.some(item => hasErrors(item)); + } + else if (typeof data0 === "object" && data0 !== null) { + return Object.values(data0).some((value) => hasErrors(value)); + } + else if (typeof data0 === "string") { + return true; + } + return false; +} +/** + * Transforms a plain object into an instance of the given class. + * @param clazz - The class to transform the object into. + * @param object - The object to transform. + * @typeParam TClass - The type of the class. + * @returns An instance of TClass. + */ +export function toClass(clazz, object) { + function _toClass(clazz, object) { + if (Array.isArray(object)) { + return object.map(item => _toClass(clazz, item)); + } + const entries = Object.entries(object !== null && object !== void 0 ? object : {}); + const meta = FieldValidatorMetaService.inject(clazz, EventEmitter.EMPTY); + const data = {}; + for (const [key, value] of entries) { + const descriptor = meta.getUntypedDescriptor(key); + const { thisClass } = descriptor; + if (thisClass) { + if (Array.isArray(value)) { + data[key] = value.map(item => _toClass(thisClass, item)); + } + else { + data[key] = toClass(thisClass, value); + } + } + else { + data[key] = value; + } + } + const instance = new clazz(); + Object.entries(data).forEach(([k, v]) => (instance[k] = v)); + return instance; + } + return _toClass(clazz, object); +} /** * A class responsible for processing and validating class instances through its decorated validators. * @@ -61,13 +116,13 @@ export class Form { _Form_debounceMap.set(this, {}); __classPrivateFieldSet(this, _Form_asyncDelay, (_a = config === null || config === void 0 ? void 0 : config.asyncDelay) !== null && _a !== void 0 ? _a : 500, "f"); this.__id = Math.random().toString(36).substring(2, 8); - __classPrivateFieldSet(this, _Form_eventEmitter, new EventEmitter(this.__id), "f"); + __classPrivateFieldSet(this, _Form_eventEmitter, new EventEmitter(this.__id, __classPrivateFieldGet(this, _Form_asyncDelay, "f")), "f"); __classPrivateFieldSet(this, _Form_hostClass, clazz, "f"); - this.locale = (_b = config === null || config === void 0 ? void 0 : config.locale) !== null && _b !== void 0 ? _b : API.Localization.getLocale(); + this.locale = (_b = config === null || config === void 0 ? void 0 : config.locale) !== null && _b !== void 0 ? _b : getLocale(); __classPrivateFieldSet(this, _Form_groups, Array.from(new Set((_c = config === null || config === void 0 ? void 0 : config.groups) !== null && _c !== void 0 ? _c : [])), "f"); - __classPrivateFieldSet(this, _Form_defaultValue, (_d = config === null || config === void 0 ? void 0 : config.defaultValue) !== null && _d !== void 0 ? _d : API.Utilities.Objects.toClass(clazz), "f"); - __classPrivateFieldSet(this, _Form_fieldValidatorMetaService, API.Reflection.FieldValidatorMetaService.inject(clazz, __classPrivateFieldGet(this, _Form_eventEmitter, "f")), "f"); - __classPrivateFieldSet(this, _Form_classValidatorMetaService, API.Reflection.ClassValidatorMetaService.inject(clazz, __classPrivateFieldGet(this, _Form_eventEmitter, "f")), "f"); + __classPrivateFieldSet(this, _Form_defaultValue, (_d = config === null || config === void 0 ? void 0 : config.defaultValue) !== null && _d !== void 0 ? _d : toClass(clazz), "f"); + __classPrivateFieldSet(this, _Form_fieldValidatorMetaService, FieldValidatorMetaService.inject(clazz, __classPrivateFieldGet(this, _Form_eventEmitter, "f")), "f"); + __classPrivateFieldSet(this, _Form_classValidatorMetaService, ClassValidatorMetaService.inject(clazz, __classPrivateFieldGet(this, _Form_eventEmitter, "f")), "f"); __classPrivateFieldSet(this, _Form_cache, new Cache(state => this.validate.bind(this)(state)), "f"); } /** @@ -132,7 +187,7 @@ export class Form { * ``` */ validate(payload, args = {}) { - const state = API.Utilities.Objects.toClass(__classPrivateFieldGet(this, _Form_hostClass, "f"), payload); + const state = toClass(__classPrivateFieldGet(this, _Form_hostClass, "f"), payload); const errors = {}; const detailedErrors = {}; const classValidators = __classPrivateFieldGet(this, _Form_classValidatorMetaService, "f").data.contents; @@ -144,7 +199,7 @@ export class Form { errors[field] = validation[1]; }); return __classPrivateFieldGet(this, _Form_cache, "f").patch({ - valid: !API.Utilities.Objects.hasErrors(errors), + valid: !hasErrors(errors), detailedErrors, errors, globalErrors: classValidationErrors, @@ -167,19 +222,16 @@ export class Form { __classPrivateFieldGet(this, _Form_eventEmitter, "f").emit(event, data); } } -_Form_eventListener = new WeakMap(), _Form_eventEmitter = new WeakMap(), _Form_fieldValidatorMetaService = new WeakMap(), _Form_classValidatorMetaService = new WeakMap(), _Form_groups = new WeakMap(), _Form_defaultValue = new WeakMap(), _Form_cache = new WeakMap(), _Form_hostClass = new WeakMap(), _Form_asyncDelay = new WeakMap(), _Form_debounceMap = new WeakMap(), _Form_instances = new WeakSet(), _Form_validateField = function _Form_validateField(fieldName, -// @ts-expect-error -payload, args = {}) { +_Form_eventListener = new WeakMap(), _Form_eventEmitter = new WeakMap(), _Form_fieldValidatorMetaService = new WeakMap(), _Form_classValidatorMetaService = new WeakMap(), _Form_groups = new WeakMap(), _Form_defaultValue = new WeakMap(), _Form_cache = new WeakMap(), _Form_hostClass = new WeakMap(), _Form_asyncDelay = new WeakMap(), _Form_debounceMap = new WeakMap(), _Form_instances = new WeakSet(), _Form_validateField = function _Form_validateField(fieldName, payload, args = {}) { var _a, _b; const descriptor = __classPrivateFieldGet(this, _Form_fieldValidatorMetaService, "f").getUntypedDescriptor(fieldName, __classPrivateFieldGet(this, _Form_eventEmitter, "f")); const stratImpl = new descriptor.StrategyImpl(descriptor, __classPrivateFieldGet(this, _Form_defaultValue, "f"), __classPrivateFieldGet(this, _Form_groups, "f"), this.locale, __classPrivateFieldGet(this, _Form_eventEmitter, "f")); if (descriptor.strategy === "function") { if (!__classPrivateFieldGet(this, _Form_debounceMap, "f")[fieldName]) { - __classPrivateFieldGet(this, _Form_debounceMap, "f")[fieldName] = API.Utilities.Objects.debounce((value, context) => { + __classPrivateFieldGet(this, _Form_debounceMap, "f")[fieldName] = Objects.debounce((value, context) => { stratImpl.test(value, context, args); }, __classPrivateFieldGet(this, _Form_asyncDelay, "f")); } - // @ts-expect-error __classPrivateFieldGet(this, _Form_debounceMap, "f")[fieldName](payload[fieldName], payload, args); return [ (_a = __classPrivateFieldGet(this, _Form_cache, "f").get("detailedErrors")) === null || _a === void 0 ? void 0 : _a[fieldName], diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/models/ValidationMetadata.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/ValidationMetadata.d.ts similarity index 79% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/models/ValidationMetadata.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/ValidationMetadata.d.ts index d7ea4cb9c..2dfce91ea 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/models/ValidationMetadata.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/ValidationMetadata.d.ts @@ -1,6 +1,6 @@ -import type API from "../../index"; -import { type EventEmitter } from "../../utilities/misc/EventEmitter"; -import { ValidationResult, type ValidationMetadataEntry } from "../../validation"; +import { Locale } from "../../localization"; +import { EventEmitter, Objects } from "../../utilities"; +import type { ValidationMetadataEntry, ValidationResult } from "../types"; /** * Manages a collection of validation rules for a specific field. * @@ -33,7 +33,7 @@ export declare class ValidationMetadata { * * @returns An array of `ValidationResult` containing the validation results. */ - validate(value: TFieldType, payload: API.Utilities.Objects.Payload, groups: string[], locale: API.Localization.Locale, args?: API.Decorator.DecoratorArgs, emitter?: EventEmitter, field?: string): ValidationResult[]; + validate(value: TFieldType, payload: Objects.Payload, groups: string[], locale: Locale, args?: Record, emitter?: EventEmitter, field?: string): ValidationResult[]; /** * Removes and returns the last validation rule from the collection. * diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/ValidationMetadata.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/ValidationMetadata.d.ts.map new file mode 100644 index 000000000..654783aba --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/ValidationMetadata.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ValidationMetadata.d.ts","sourceRoot":"","sources":["../../../../src/validation/models/ValidationMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAEnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAEnF;;;;;;;;GAQG;AACH,qBAAa,kBAAkB,CAAC,UAAU;;IAGxC;;;;OAIG;IACH,IAAI,QAAQ,IAAI,KAAK,CAAC,uBAAuB,CAAC,UAAU,CAAC,CAAC,CAEzD;IAED;;OAEG;gBACS,QAAQ,GAAE,KAAK,CAAC,uBAAuB,CAAC,UAAU,CAAC,CAAM;IAIrE;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,KAAK,EACZ,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAC/B,MAAM,EAAE,MAAM,EAAE,EAChB,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1B,OAAO,CAAC,EAAE,YAAY,EACtB,KAAK,CAAC,EAAE,MAAM,GACb,gBAAgB,EAAE;IAyBrB;;;;OAIG;IACH,GAAG,IAAI,uBAAuB,CAAC,UAAU,CAAC;IAI1C;;;;OAIG;IACH,GAAG,CAAC,IAAI,EAAE,uBAAuB,CAAC,UAAU,CAAC,GAAG,IAAI;CAmBrD"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/models/ValidationMetadata.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/ValidationMetadata.js similarity index 97% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/models/ValidationMetadata.js rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/ValidationMetadata.js index 1f97de7de..f16435c32 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/reflection/models/ValidationMetadata.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/ValidationMetadata.js @@ -10,7 +10,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function ( return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; }; var _ValidationMetadata_instances, _ValidationMetadata_contents, _ValidationMetadata_handleAsyncResults, _ValidationMetadata_groupedValidators; -import { Events } from "../../validation/models/Events"; +import { Events } from "../models/Events"; /** * Manages a collection of validation rules for a specific field. * @@ -88,5 +88,5 @@ _ValidationMetadata_contents = new WeakMap(), _ValidationMetadata_instances = ne }); }); }, _ValidationMetadata_groupedValidators = function _ValidationMetadata_groupedValidators(data, groups) { - return data.filter((meta) => groups.length > 0 ? meta.groups.some(o => groups.includes(o)) : meta.groups.length === 0); + return data.filter((meta) => groups.length > 0 ? meta.groups.some((o) => groups.includes(o)) : meta.groups.length === 0); }; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/validation/models/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/index.d.ts similarity index 74% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/validation/models/index.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/index.d.ts index c8f756632..f17c4cbb7 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/validation/models/index.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/index.d.ts @@ -1,4 +1,5 @@ export * from "./Cache"; export * from "./Events"; export * from "./Form"; +export * from "./ValidationMetadata"; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/index.d.ts.map new file mode 100644 index 000000000..8365d6738 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/validation/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AAExB,cAAc,UAAU,CAAC;AAEzB,cAAc,QAAQ,CAAC;AAEvB,cAAc,sBAAsB,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/index.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/index.js index 92b9313e7..9af697929 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/index.js +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/models/index.js @@ -1,3 +1,4 @@ export * from "./Cache"; export * from "./Events"; export * from "./Form"; +export * from "./ValidationMetadata"; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/validation/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/types.d.ts similarity index 72% rename from packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/validation/index.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/types.d.ts index 661d6390b..232b025cb 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/validation/index.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/types.d.ts @@ -1,11 +1,12 @@ -import type API from "../index"; -export * from "./models"; +import { Locale } from "../localization"; +import type { DetailedErrorsResponse, SimpleErrorsResponse } from "../strategy"; +import { Objects } from "../utilities"; /** * Represents a function that evaluates a value and returns a validation result. * * @typeParam T - The type of the value being evaluated. */ -export type ValidationEvaluator = ((value: T, context: any, locale: API.Localization.Locale, args: API.Decorator.DecoratorArgs) => ValidationResult | Promise) & {}; +export type ValidationEvaluator = ((value: T, context: any, locale: Locale, args: Record) => ValidationResult | Promise) & {}; /** * Represents metadata for a validation rule, including the associated validation groups and the evaluator function. * @@ -28,9 +29,9 @@ export type ValidationResult = { * @typeParam TClass - The type of the class being validated. */ export type AsyncEventResponseProps = { - errors: API.Strategy.Impl.Errors; - detailedErrors: API.Strategy.Impl.DetailedErrors; - globalErrors: API.Validation.ValidationResult[]; + errors: SimpleErrorsResponse; + detailedErrors: DetailedErrorsResponse; + globalErrors: ValidationResult[]; }; /** * Defines the properties for an async event handler. @@ -51,9 +52,9 @@ export type AsyncEventHandler = ((data: AsyncEventHandlerProps) * @typeParam TClass - The type of the default value. */ export type FormConfig = { - defaultValue?: API.Utilities.Objects.Payload; + defaultValue?: Objects.Payload; groups?: string[]; - locale?: API.Localization.Locale; + locale?: Locale; asyncDelay?: number; }; /** @@ -63,8 +64,8 @@ export type FormConfig = { */ export type FormValidateResponse = { valid: boolean; - detailedErrors: API.Strategy.Impl.DetailedErrors; - errors: API.Strategy.Impl.Errors; - globalErrors: API.Validation.ValidationResult[]; + detailedErrors: DetailedErrorsResponse; + errors: SimpleErrorsResponse; + globalErrors: ValidationResult[]; }; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/types.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/types.d.ts.map new file mode 100644 index 000000000..1b1eecc88 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/validation/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,KAAK,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,CAAC,CACpC,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,GAAG,EACZ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KACtB,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,GAAG,EAAE,CAAC;AAExD;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,CAAC,CAAC,IAAI;IACvC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC;CAClC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,uBAAuB,CAAC,MAAM,IAAI;IAC5C,MAAM,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAC;IACrC,cAAc,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAC/C,YAAY,EAAE,gBAAgB,EAAE,CAAC;CAClC,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,sBAAsB,CAAC,MAAM,IAAI;IAC3C,GAAG,EAAE,MAAM,MAAM,CAAC;IAClB,KAAK,EAAE,gBAAgB,CAAC;CACzB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,iBAAiB,CAAC,MAAM,IAAI,CAAC,CAAC,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,GAAG,EAAE,CAAC;AAE9F;;;;GAIG;AACH,MAAM,MAAM,UAAU,CAAC,MAAM,IAAI;IAC/B,YAAY,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACvC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI;IACpC,KAAK,EAAE,OAAO,CAAC;IACf,cAAc,EAAE,sBAAsB,CAAC,CAAC,CAAC,CAAC;IAC1C,MAAM,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC;IAChC,YAAY,EAAE,gBAAgB,EAAE,CAAC;CAClC,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/types.js b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/types.js new file mode 100644 index 000000000..cb0ff5c3b --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-core/dist/src/validation/types.js @@ -0,0 +1 @@ +export {}; diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/index.d.ts.map deleted file mode 100644 index 674ca8cd7..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,4CAA4C,CAAC;AACvE,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAEpD,MAAM,QAAQ,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC;AAC5C,MAAM,QAAQ,WAAW,GAAG,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC;AACxD,MAAM,QAAQ,gBAAgB,GAAG,UAAU,CAAC,gBAAgB,CAAC;AAE7D,OAAO,EACL,IAAI,EACJ,SAAS,EACT,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,GACrB,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;AAEjF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwFG;AACH,MAAM,WAAW,YAAY;CAAG;AAEhC,eAAe,UAAU,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/index.d.ts.map deleted file mode 100644 index 715006948..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/decorators/data/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/structural/attribute.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/structural/attribute.d.ts.map deleted file mode 100644 index 1bafc4f50..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/structural/attribute.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"attribute.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/structural/attribute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,eAAe,CAAC;AAE1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC,EACnF,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,GACpC,cAAc,CAAC,CAAC,CAAC,CAInB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/structural/foreach.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/structural/foreach.d.ts.map deleted file mode 100644 index f92cb34e1..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/structural/foreach.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"foreach.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/structural/foreach.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAElF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,OAAO,CACrB,CAAC,SAAS,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,MAAM,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,EAC5F,GAAG,UAAU,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAY/F"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/structural/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/structural/index.d.ts.map deleted file mode 100644 index faa64e778..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/structural/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/structural/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/any/Required.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/any/Required.d.ts.map deleted file mode 100644 index 1edd3449e..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/any/Required.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Required.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/any/Required.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,sBAAsB,CAAC;AAEvC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gBAAgB,CAAC;AAE3E,2BAA2B;AAC3B,eAAO,MAAM,QAAQ,aAAa,CAAC;AAEnC;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,SAAS,GAAG,KAAK,IAAI,WAAW,CAAC,OAAO,KAAK,CAAC,CAS3F;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,EAC/D,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayContains.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayContains.d.ts.map deleted file mode 100644 index 2d3cd920e..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayContains.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ArrayContains.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/array/ArrayContains.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,sBAAsB,CAAC;AAEvC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gBAAgB,CAAC;AAE3E,gCAAgC;AAChC,eAAO,MAAM,cAAc,kBAAkB,CAAC;AAE9C,wEAAwE;AACxE,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,OAAO,CAGrF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,EAC5C,QAAQ,EAAE,CAAC,EACX,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CAanB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayEmpty.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayEmpty.d.ts.map deleted file mode 100644 index 76baeed46..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayEmpty.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ArrayEmpty.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/array/ArrayEmpty.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,sBAAsB,CAAC;AAEvC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gBAAgB,CAAC;AAE3E,6BAA6B;AAC7B,eAAO,MAAM,WAAW,eAAe,CAAC;AAExC,qEAAqE;AACrE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,OAAO,CAGvD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,EACzC,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayEvery.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayEvery.d.ts.map deleted file mode 100644 index dfb3df6c0..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayEvery.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ArrayEvery.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/array/ArrayEvery.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,sBAAsB,CAAC;AAEvC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gBAAgB,CAAC;AAE3E,6BAA6B;AAC7B,eAAO,MAAM,WAAW,eAAe,CAAC;AAExC,qEAAqE;AACrE,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,EAChD,KAAK,EAAE,CAAC,EACR,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,GACjD,OAAO,CAGT;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgDI;AACJ,wBAAgB,UAAU,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,EACzC,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,EAClD,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayNone.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayNone.d.ts.map deleted file mode 100644 index 04e3f1fa4..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayNone.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ArrayNone.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/array/ArrayNone.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,sBAAsB,CAAC;AAEvC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gBAAgB,CAAC;AAE3E,4BAA4B;AAC5B,eAAO,MAAM,UAAU,cAAc,CAAC;AAEtC,oEAAoE;AACpE,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,EAC/C,KAAK,EAAE,CAAC,EACR,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,GACjD,OAAO,CAGT;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgDI;AACJ,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,EACxC,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,EAClD,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayOne.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayOne.d.ts.map deleted file mode 100644 index 9bf419122..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayOne.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ArrayOne.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/array/ArrayOne.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,sBAAsB,CAAC;AAEvC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gBAAgB,CAAC;AAE3E,2BAA2B;AAC3B,eAAO,MAAM,SAAS,aAAa,CAAC;AAEpC,mEAAmE;AACnE,wBAAgB,eAAe,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,EAC9C,KAAK,EAAE,CAAC,EACR,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,GACjD,OAAO,CAGT;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgDI;AACJ,wBAAgB,QAAQ,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,EACvC,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,EAClD,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArraySizeExact.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArraySizeExact.d.ts.map deleted file mode 100644 index 714e74f30..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArraySizeExact.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ArraySizeExact.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/array/ArraySizeExact.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,sBAAsB,CAAC;AAEvC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gBAAgB,CAAC;AAE3E,iCAAiC;AACjC,eAAO,MAAM,gBAAgB,mBAAmB,CAAC;AAEjD,yEAAyE;AACzE,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,OAAO,CAG3D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,EAC7C,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CAanB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArraySizeMax.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArraySizeMax.d.ts.map deleted file mode 100644 index 1c8f11385..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArraySizeMax.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ArraySizeMax.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/array/ArraySizeMax.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,sBAAsB,CAAC;AAEvC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gBAAgB,CAAC;AAE3E,+BAA+B;AAC/B,eAAO,MAAM,cAAc,iBAAiB,CAAC;AAE7C,uEAAuE;AACvE,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAGtE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,EAC3C,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CAanB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArraySizeMin.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArraySizeMin.d.ts.map deleted file mode 100644 index 9ac63bac0..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArraySizeMin.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ArraySizeMin.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/array/ArraySizeMin.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,sBAAsB,CAAC;AAEvC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gBAAgB,CAAC;AAE3E,+BAA+B;AAC/B,eAAO,MAAM,cAAc,iBAAiB,CAAC;AAE7C,uEAAuE;AACvE,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAGtE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,EAC3C,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CAanB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArraySizeRange.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArraySizeRange.d.ts.map deleted file mode 100644 index c0710bb38..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArraySizeRange.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ArraySizeRange.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/array/ArraySizeRange.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,sBAAsB,CAAC;AAEvC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gBAAgB,CAAC;AAE3E,iCAAiC;AACjC,eAAO,MAAM,gBAAgB,mBAAmB,CAAC;AAEjD,yEAAyE;AACzE,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAGrF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,EAC7C,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CAanB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArraySome.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArraySome.d.ts.map deleted file mode 100644 index ee600eac7..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArraySome.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ArraySome.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/array/ArraySome.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,sBAAsB,CAAC;AAEvC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gBAAgB,CAAC;AAE3E,4BAA4B;AAC5B,eAAO,MAAM,UAAU,cAAc,CAAC;AAEtC,oEAAoE;AACpE,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,EAC/C,KAAK,EAAE,CAAC,EACR,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,GACjD,OAAO,CAGT;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgDI;AACJ,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,EACxC,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,EAClD,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayUnique.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayUnique.d.ts.map deleted file mode 100644 index 897e60387..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/array/ArrayUnique.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ArrayUnique.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/array/ArrayUnique.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,sBAAsB,CAAC;AAEvC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gBAAgB,CAAC;AAE3E,8BAA8B;AAC9B,eAAO,MAAM,YAAY,gBAAgB,CAAC;AAE1C,sEAAsE;AACtE,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,OAAO,CAgBxD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,EAC1C,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/boolean/AssertFalse.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/boolean/AssertFalse.d.ts.map deleted file mode 100644 index f1149cb6c..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/boolean/AssertFalse.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"AssertFalse.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/boolean/AssertFalse.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,sBAAsB,CAAC;AAEvC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gBAAgB,CAAC;AAE3E,8BAA8B;AAC9B,eAAO,MAAM,YAAY,gBAAgB,CAAC;AAE1C,sEAAsE;AACtE,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAG1D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,OAAO,EAC3C,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/boolean/AssertTrue.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/boolean/AssertTrue.d.ts.map deleted file mode 100644 index ffc3123e0..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/boolean/AssertTrue.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"AssertTrue.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/boolean/AssertTrue.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,sBAAsB,CAAC;AAEvC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gBAAgB,CAAC;AAE3E,6BAA6B;AAC7B,eAAO,MAAM,WAAW,eAAe,CAAC;AAExC,qEAAqE;AACrE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAGzD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,OAAO,EAC1C,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/class/ValidDateRange.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/class/ValidDateRange.d.ts.map deleted file mode 100644 index 4c9e44250..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/class/ValidDateRange.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ValidDateRange.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/class/ValidDateRange.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,sBAAsB,CAAC;AAEvC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gBAAgB,CAAC;AAE3E,iCAAiC;AACjC,eAAO,MAAM,gBAAgB,mBAAmB,CAAC;AAEjD,yEAAyE;AACzE,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,GAAG,EACV,cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,MAAM,GACnB,OAAO,CAGT;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,EAChE,cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CAkBnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/date/FutureDate.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/date/FutureDate.d.ts.map deleted file mode 100644 index f386d9c96..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/date/FutureDate.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"FutureDate.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/date/FutureDate.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,sBAAsB,CAAC;AAEvC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gBAAgB,CAAC;AAE3E,6BAA6B;AAC7B,eAAO,MAAM,WAAW,eAAe,CAAC;AAExC,qEAAqE;AACrE,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAC9E,IAAI,EAAE,CAAC,GACN,OAAO,CAGT;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EACvE,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/date/PastDate.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/date/PastDate.d.ts.map deleted file mode 100644 index 6b2fd4d3f..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/date/PastDate.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"PastDate.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/date/PastDate.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,sBAAsB,CAAC;AAEvC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gBAAgB,CAAC;AAE3E,2BAA2B;AAC3B,eAAO,MAAM,SAAS,aAAa,CAAC;AAEpC,mEAAmE;AACnE,wBAAgB,eAAe,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,OAAO,CAGhG;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EACrE,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/date/TodayDate.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/date/TodayDate.d.ts.map deleted file mode 100644 index 5fda63f44..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/date/TodayDate.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"TodayDate.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/date/TodayDate.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,sBAAsB,CAAC;AAEvC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gBAAgB,CAAC;AAE3E,4BAA4B;AAC5B,eAAO,MAAM,UAAU,cAAc,CAAC;AAEtC,oEAAoE;AACpE,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,OAAO,CASjG;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EACtE,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/index.d.ts.map deleted file mode 100644 index 79bd8ba2e..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/data/validators/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/Decimal.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/Decimal.d.ts.map deleted file mode 100644 index 9bfde1a38..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/Decimal.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Decimal.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/number/Decimal.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,sBAAsB,CAAC;AAEvC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gBAAgB,CAAC;AAE3E,0BAA0B;AAC1B,eAAO,MAAM,OAAO,YAAY,CAAC;AAEjC,kEAAkE;AAClE,wBAAgB,cAAc,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAC7E,KAAK,EAAE,CAAC,GACP,OAAO,CAGT;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EACtE,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/Digits.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/Digits.d.ts.map deleted file mode 100644 index 4db643f8f..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/Digits.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Digits.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/number/Digits.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,sBAAsB,CAAC;AAEvC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gBAAgB,CAAC;AAE3E,yBAAyB;AACzB,eAAO,MAAM,MAAM,WAAW,CAAC;AAuB/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EACrE,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CAanB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/Integer.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/Integer.d.ts.map deleted file mode 100644 index b3b725652..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/Integer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Integer.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/number/Integer.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,sBAAsB,CAAC;AACvC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,wBAAwB,CAAC;AAGnF,0BAA0B;AAC1B,eAAO,MAAM,OAAO,YAAY,CAAC;AAQjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EACtE,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/Negative.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/Negative.d.ts.map deleted file mode 100644 index 9a231e6fa..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/Negative.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Negative.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/number/Negative.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,sBAAsB,CAAC;AACvC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,wBAAwB,CAAC;AAGnF,2BAA2B;AAC3B,eAAO,MAAM,QAAQ,aAAa,CAAC;AAQnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EACvE,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/NonNegative.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/NonNegative.d.ts.map deleted file mode 100644 index 4a6455e12..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/NonNegative.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"NonNegative.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/number/NonNegative.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,sBAAsB,CAAC;AACvC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,wBAAwB,CAAC;AAGnF,8BAA8B;AAC9B,eAAO,MAAM,YAAY,gBAAgB,CAAC;AAQ1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAC1E,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/NonPositive.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/NonPositive.d.ts.map deleted file mode 100644 index 533874431..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/NonPositive.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"NonPositive.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/number/NonPositive.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,sBAAsB,CAAC;AACvC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,wBAAwB,CAAC;AAGnF,8BAA8B;AAC9B,eAAO,MAAM,YAAY,gBAAgB,CAAC;AAQ1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAC1E,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/Positive.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/Positive.d.ts.map deleted file mode 100644 index 3af1f288b..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/Positive.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Positive.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/number/Positive.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,sBAAsB,CAAC;AACvC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,wBAAwB,CAAC;AAGnF,2BAA2B;AAC3B,eAAO,MAAM,QAAQ,aAAa,CAAC;AAQnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EACvE,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/ValueMax.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/ValueMax.d.ts.map deleted file mode 100644 index d6cb36307..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/ValueMax.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ValueMax.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/number/ValueMax.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,sBAAsB,CAAC;AACvC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,wBAAwB,CAAC;AAGnF,2BAA2B;AAC3B,eAAO,MAAM,SAAS,aAAa,CAAC;AAQpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EACvE,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CAanB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/ValueMin.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/ValueMin.d.ts.map deleted file mode 100644 index 7be8a3686..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/ValueMin.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ValueMin.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/number/ValueMin.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,sBAAsB,CAAC;AACvC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,wBAAwB,CAAC;AAGnF,2BAA2B;AAC3B,eAAO,MAAM,SAAS,aAAa,CAAC;AAQpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EACvE,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CAanB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/ValueRange.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/ValueRange.d.ts.map deleted file mode 100644 index 2a3228692..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/number/ValueRange.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ValueRange.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/number/ValueRange.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,sBAAsB,CAAC;AACvC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,wBAAwB,CAAC;AAGnF,6BAA6B;AAC7B,eAAO,MAAM,WAAW,eAAe,CAAC;AAYxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EACzE,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CAanB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/ExactLength.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/ExactLength.d.ts.map deleted file mode 100644 index 56946cd09..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/ExactLength.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ExactLength.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/string/ExactLength.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,sBAAsB,CAAC;AACvC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,wBAAwB,CAAC;AAGnF,8BAA8B;AAC9B,eAAO,MAAM,YAAY,gBAAgB,CAAC;AAE1C,sEAAsE;AACtE,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAC7C,KAAK,EAAE,MAAM,GACZ,OAAO,CAGT;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAC1E,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CAanB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/MaxLength.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/MaxLength.d.ts.map deleted file mode 100644 index 7a3ba0824..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/MaxLength.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MaxLength.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/string/MaxLength.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,sBAAsB,CAAC;AACvC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,wBAAwB,CAAC;AAGnF,4BAA4B;AAC5B,eAAO,MAAM,UAAU,cAAc,CAAC;AAEtC,oEAAoE;AACpE,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAC7C,GAAG,EAAE,MAAM,GACV,OAAO,CAGT;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EACxE,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/MinLength.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/MinLength.d.ts.map deleted file mode 100644 index eecb50d91..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/MinLength.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MinLength.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/string/MinLength.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,sBAAsB,CAAC;AAIvC,4BAA4B;AAC5B,eAAO,MAAM,UAAU,cAAc,CAAC;AAEtC,oEAAoE;AACpE,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAC7C,GAAG,EAAE,MAAM,GACV,OAAO,CAGT;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EACxE,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,mCAUvC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/Password.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/Password.d.ts.map deleted file mode 100644 index 367bf559b..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/Password.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Password.d.ts","sourceRoot":"","sources":["../../../../../../../src/decorators/data/validators/string/Password.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,sBAAsB,CAAC;AAKvC,2BAA2B;AAC3B,eAAO,MAAM,QAAQ,aAAa,CAAC;AAEnC,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,mEAAmE;AACnE,wBAAgB,eAAe,CAC7B,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAC7C,KAAK,EAAE,aAAa,GAAG,SAAS,EAChC,cAAc,CAAC,EAAE,MAAM,EACvB,MAAM,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC,MAAM;;;;EAoDjC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EACvE,KAAK,CAAC,EAAE,aAAa,EACrB,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,mCAMvC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/Pattern.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/Pattern.d.ts deleted file mode 100644 index eec49a728..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/Pattern.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import API from "../../../../../../index"; -export declare function testRegex>( - regex: RegExp, - value: T -): boolean; -/** - * Creates a validator decorator that checks if a string value matches a regular expression pattern. - * - * @typeparam T - The type of the decorated property (optional string). - * @param regex The regular expression pattern to match against the value. - * @param message - (Optional) The custom error message to display when validation fails. - * @param key - (Optional) The key to identify this validation rule in error messages. Defaults to "Pattern". - * @param config - (Optional) An array of validation groups to which this rule belongs. - * @returns A decorator function to use with class properties. - * - * @example - * // Example 1: Basic usage with default options - * class MyClass { - * @Pattern({ regex: /^[0-9]+$/ }) - * myProperty: string; - * } - * - * // Example 2: Custom error message and validation groups - * class AnotherClass { - * @Pattern({ - * regex: /^[A-Za-z]+$/, - * key: "AlphabeticPattern", - * message: "Must contain only alphabetic characters", - * groups: ["registration", "profile"], - * }) - * anotherProperty: string; - * } - */ -export declare function Pattern>( - regex: RegExp, - options?: API.Decorators.Options -): API.Decorator.FieldDecorator; -//# sourceMappingURL=Pattern.d.ts.map diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/Pattern.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/Pattern.d.ts.map deleted file mode 100644 index 8625130bb..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/Pattern.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Pattern.d.ts","sourceRoot":"","sources":["../../../../../../../../src/decorators/data/validators/string/regex/Pattern.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,yBAAyB,CAAC;AAI1C,wBAAgB,SAAS,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EACxE,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,CAAC,GACP,OAAO,CAET;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EACtE,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,mCAcvC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Alpha.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Alpha.d.ts.map deleted file mode 100644 index 0aab27dd7..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Alpha.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Alpha.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/decorators/data/validators/string/regex/impl/Alpha.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,4BAA4B,CAAC;AAC7C,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AAMzF,wBAAwB;AACxB,eAAO,MAAM,KAAK,UAAU,CAAC;AAE7B,gEAAgE;AAChE,wBAAgB,YAAY,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAGhG;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,KAAK,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EACpE,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Alphanumeric.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Alphanumeric.d.ts.map deleted file mode 100644 index 581f8ebbe..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Alphanumeric.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Alphanumeric.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/decorators/data/validators/string/regex/impl/Alphanumeric.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,4BAA4B,CAAC;AAE7C,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AAKzF,+BAA+B;AAC/B,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAE3C,uEAAuE;AACvE,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAClF,KAAK,EAAE,CAAC,GACP,OAAO,CAGT;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAC3E,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Email.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Email.d.ts.map deleted file mode 100644 index 969b97a5c..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Email.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Email.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/decorators/data/validators/string/regex/impl/Email.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,4BAA4B,CAAC;AAE7C,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AAKzF,wBAAwB;AACxB,eAAO,MAAM,KAAK,UAAU,CAAC;AAE7B,gEAAgE;AAChE,wBAAgB,YAAY,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAGhG;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,KAAK,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EACpE,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/IPAddress.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/IPAddress.d.ts.map deleted file mode 100644 index 7965267af..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/IPAddress.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"IPAddress.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/decorators/data/validators/string/regex/impl/IPAddress.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,4BAA4B,CAAC;AAE7C,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AAKzF,4BAA4B;AAC5B,eAAO,MAAM,UAAU,cAAc,CAAC;AAEtC,oEAAoE;AACpE,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAC/E,KAAK,EAAE,CAAC,GACP,OAAO,CAGT;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EACxE,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Lowercase.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Lowercase.d.ts.map deleted file mode 100644 index da38394a8..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Lowercase.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Lowercase.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/decorators/data/validators/string/regex/impl/Lowercase.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,4BAA4B,CAAC;AAE7C,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AAKzF,4BAA4B;AAC5B,eAAO,MAAM,SAAS,cAAc,CAAC;AAErC,oEAAoE;AACpE,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAC/E,KAAK,EAAE,CAAC,GACP,OAAO,CAGT;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EACxE,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Numeric.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Numeric.d.ts.map deleted file mode 100644 index 7b6d2291d..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Numeric.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Numeric.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/decorators/data/validators/string/regex/impl/Numeric.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,4BAA4B,CAAC;AAE7C,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AAKzF,0BAA0B;AAC1B,eAAO,MAAM,OAAO,YAAY,CAAC;AAEjC,kEAAkE;AAClE,wBAAgB,cAAc,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAC7E,KAAK,EAAE,CAAC,GACP,OAAO,CAGT;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EACtE,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/URL.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/URL.d.ts.map deleted file mode 100644 index 46bf7a3ad..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/URL.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"URL.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/decorators/data/validators/string/regex/impl/URL.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,4BAA4B,CAAC;AAE7C,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AAKzF,sBAAsB;AACtB,eAAO,MAAM,OAAO,QAAQ,CAAC;AAE7B,8DAA8D;AAC9D,wBAAgB,UAAU,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAG9F;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAClE,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Uppercase.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Uppercase.d.ts.map deleted file mode 100644 index 6e85a340f..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/impl/Uppercase.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Uppercase.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/decorators/data/validators/string/regex/impl/Uppercase.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,4BAA4B,CAAC;AAE7C,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,8BAA8B,CAAC;AAKzF,4BAA4B;AAC5B,eAAO,MAAM,SAAS,cAAc,CAAC;AAErC,oEAAoE;AACpE,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAC/E,KAAK,EAAE,CAAC,GACP,OAAO,CAGT;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EACxE,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,GACrC,cAAc,CAAC,CAAC,CAAC,CASnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/shared/regex.constants.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/shared/regex.constants.d.ts.map deleted file mode 100644 index 12718a5e6..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/data/validators/string/regex/shared/regex.constants.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"regex.constants.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/decorators/data/validators/string/regex/shared/regex.constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,QAAA,MAAM,UAAU;IACd,8CAA8C;;IAG9C,yDAAyD;;IAGzD,yDAAyD;;IAGzD,4DAA4D;;IAG5D,sDAAsD;;IAGtD,sEAAsE;;IAGtE,sEAAsE;;IAGtE,2FAA2F;;IAG3F,2FAA2F;;IAG3F,8EAA8E;;IAG9E,8EAA8E;;IAG9E,8DAA8D;;CAEtD,CAAC;AAEX,eAAe,UAAU,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forClass/createClassDecorator.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forClass/createClassDecorator.d.ts deleted file mode 100644 index 41b49cb55..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forClass/createClassDecorator.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import API from "../../../index"; -export type ClassDecorator = ((baseClass: TClass, context: ClassDecoratorCtx) => TClass | undefined | void) & {}; -export type ClassDecoratorSupplier = ((meta: API.Reflection.ClassValidatorMetaService, baseClass: TClass, context: ClassDecoratorCtx) => TClass | undefined | void) & {}; -export type ClassDecoratorCtx = ClassDecoratorContext; -/** - * Creates a new class decorator function using the provided supplier. - * - * @typeParam T - The type of the class being decorated. - * @param supplier - A callback that defines the basic class decorator behavior and returns the modified class. - * @returns A basic class decorator factory. - */ -export declare function createClassDecorator(supplier: ClassDecoratorSupplier): ClassDecorator; -//# sourceMappingURL=createClassDecorator.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forClass/createClassDecorator.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forClass/createClassDecorator.d.ts.map deleted file mode 100644 index 5b8e46e22..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forClass/createClassDecorator.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"createClassDecorator.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/factory/forClass/createClassDecorator.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,gBAAgB,CAAC;AAGjC,MAAM,MAAM,cAAc,CAAC,MAAM,SAAS,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,CACtE,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,iBAAiB,CAAC,MAAM,CAAC,KAE/B,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AAErC,MAAM,MAAM,sBAAsB,CAAC,MAAM,SAAS,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,CAC9E,IAAI,EAAE,GAAG,CAAC,UAAU,CAAC,yBAAyB,CAAC,MAAM,CAAC,EACtD,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,iBAAiB,CAAC,MAAM,CAAC,KAE/B,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;AAErC,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,IAAI,qBAAqB,CAAC,CAAC,CAAC,CAAC;AAE9F;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,SAAS,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,EAC3E,QAAQ,EAAE,sBAAsB,CAAC,MAAM,CAAC,GACvC,cAAc,CAAC,GAAG,CAAC,CAQrB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forClass/createClassValidator.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forClass/createClassValidator.d.ts.map deleted file mode 100644 index c893788fb..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forClass/createClassValidator.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"createClassValidator.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/factory/forClass/createClassValidator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,wBAAwB,CAAC;AAEnF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,EACtE,QAAQ,EAAE,GAAG,CAAC,UAAU,CAAC,mBAAmB,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAChF,MAAM,GAAE,MAAM,EAAO,GACpB,cAAc,CAAC,CAAC,CAAC,CAInB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forClass/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forClass/index.d.ts.map deleted file mode 100644 index 5e132919a..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forClass/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/factory/forClass/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forField/createFieldDecorator.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forField/createFieldDecorator.d.ts deleted file mode 100644 index 3e77b61df..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forField/createFieldDecorator.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import API from "../../../index"; -export type FieldDecorator = ((target: any, context: FieldDecoratorCtx) => void) & {}; -export type FieldDecoratorSupplier = ((meta: API.Reflection.FieldValidatorMetaService, name: string, context: FieldDecoratorCtx, args: API.Decorator.DecoratorArgs) => void) & {}; -export type FieldDecoratorCtx = Readonly<{ - kind: "getter" | "method" | "field"; - static: boolean; - private: boolean; - name: string; - metadata?: globalThis.DecoratorMetadataObject; - access: { - get: (object: any) => T; - }; -}>; -/** - * Creates a new field decorator function using the provided supplier. - * @typeParam T - The type of the field being decorated. - * @param supplier - A callback that defines the basic field decorator behavior. - * @returns A basic field decorator factory. - */ -export declare function createFieldDecorator(supplier: FieldDecoratorSupplier): FieldDecorator; -//# sourceMappingURL=createFieldDecorator.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forField/createFieldDecorator.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forField/createFieldDecorator.d.ts.map deleted file mode 100644 index 894c50830..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forField/createFieldDecorator.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"createFieldDecorator.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/factory/forField/createFieldDecorator.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,gBAAgB,CAAC;AAGjC,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,OAAO,IAAI,CAAC,CAC/C,MAAM,EAAE,GAAG,EACX,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,KAC1B,IAAI,CAAC,GAAG,EAAE,CAAC;AAEhB,MAAM,MAAM,sBAAsB,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,IAAI,CAAC,CACjE,IAAI,EAAE,GAAG,CAAC,UAAU,CAAC,yBAAyB,EAC9C,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAC7B,IAAI,EAAE,GAAG,CAAC,SAAS,CAAC,aAAa,KAC9B,IAAI,CAAC,GAAG,EAAE,CAAC;AAEhB,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,OAAO,IAAI,QAAQ,CAAC;IAC1D,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,UAAU,CAAC,uBAAuB,CAAC;IAC9C,MAAM,EAAE;QACN,GAAG,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC;KACzB,CAAC;CACH,CAAC,CAAC;AAEH;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,OAAO,EACpD,QAAQ,EAAE,sBAAsB,CAAC,CAAC,CAAC,GAClC,cAAc,CAAC,CAAC,CAAC,CAYnB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forField/createFieldValidator.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forField/createFieldValidator.d.ts.map deleted file mode 100644 index 344945059..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forField/createFieldValidator.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"createFieldValidator.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/factory/forField/createFieldValidator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,wBAAwB,CAAC;AAEnF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,OAAO,EACpD,QAAQ,EAAE,GAAG,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAC/C,MAAM,CAAC,EAAE,MAAM,EAAE,GAChB,cAAc,CAAC,CAAC,CAAC,CAInB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forField/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forField/index.d.ts.map deleted file mode 100644 index c2ac4c379..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/forField/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/decorators/factory/forField/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/index.d.ts deleted file mode 100644 index 21f689440..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./forClass/index"; -export * from "./forField/index"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/index.d.ts.map deleted file mode 100644 index c74dcea2b..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/factory/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/decorators/factory/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/index.d.ts deleted file mode 100644 index e5be7fc5d..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/index.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -import API from "../../index"; -export * from "./data"; -export * from "./factory"; -export type DecoratorArgs = Record; -export declare namespace Config { - /** Generic validator decorator configurable options. */ - type Options = { - /** Identifier of the validator decorator. */ - key?: string; - /** Error message to be evaluated through a preprocessor, which can have a custom or default implementation based on library setup. */ - message?: string; - /** Unique list of groups for conditional validation. Validator triggers only if the form is applied on a listed group. */ - groups?: string[]; - }; - /** - * Retrieves the localized message based on the provided options, locale, and default message. - * If the options contain a custom message, it will be resolved using the provided locale. - * If no custom message is provided, the default message will be returned. - * - * @param options - The options object that may contain a custom message. - * @param locale - The locale resolver used to resolve the custom message. - * @param defaultMessage - The default message to be returned if no custom message is provided. - * @returns The localized message. - */ - function message(options: Options | undefined, locale: API.Localization.Locale, defaultMessage: string): string; - /** - * Retrieves the unique groups from the provided options or returns the default groups. - * @param options - The options object. - * @param defaultGroups - The default groups. - * @returns An array of unique groups. - */ - function groups(options?: Options, defaultGroups?: string[]): string[]; - /** - * Returns the key based on the provided options or the default key. - * @param options - The options object. - * @param defaultKey - The default key. - * @returns The key. - */ - function key(options: Options | undefined, defaultKey: string): string; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/index.d.ts.map deleted file mode 100644 index 579deb5d4..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/decorators/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/decorators/index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAC;AAE9B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAE1B,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAEhD,yBAAiB,MAAM,CAAC;IACtB,wDAAwD;IACxD,KAAY,OAAO,GAAG;QACpB,6CAA6C;QAC7C,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,sIAAsI;QACtI,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,0HAA0H;QAC1H,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC;IAEF;;;;;;;;;OASG;IACH,SAAgB,OAAO,CACrB,OAAO,EAAE,OAAO,GAAG,SAAS,EAC5B,MAAM,EAAE,GAAG,CAAC,YAAY,CAAC,MAAM,EAC/B,cAAc,EAAE,MAAM,GACrB,MAAM,CAGR;IAED;;;;;OAKG;IACH,SAAgB,MAAM,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,aAAa,GAAE,MAAM,EAAO,GAAG,MAAM,EAAE,CAIhF;IAED;;;;;OAKG;IACH,SAAgB,GAAG,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAE5E;CACF"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/index.d.ts deleted file mode 100644 index 240d49a40..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/index.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import * as _Decorator from "./decorators"; -import * as _collection from "./decorators/data"; -import * as _attribute from "./decorators/data/structural/attribute"; -import * as _Localization from "./localization"; -import * as _Reflection from "./reflection"; -import * as _Strategy from "./strategy"; -import * as _Utilities from "./utilities"; -import * as _Validation from "./validation"; -/** `tdv-core` API entry-point. */ -declare namespace API { - export import Localization = _Localization; - export import Validation = _Validation; - export import Decorator = _Decorator; - export import Utilities = _Utilities; - export import Reflection = _Reflection; - export import collection = _collection; - export import attribute = _attribute.attribute; - export import Strategy = _Strategy; - /** - * Configuration object for the `tdv-core` package. - */ - const Configuration: { - /** - * The delay in milliseconds for async validation. Defaults to `500 ms` - */ - asyncValidationDelay: number; - }; -} -export default API; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/index.d.ts.map deleted file mode 100644 index 856a4f19f..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,WAAW,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,UAAU,MAAM,wCAAwC,CAAC;AACrE,OAAO,KAAK,aAAa,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,WAAW,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,UAAU,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,WAAW,MAAM,cAAc,CAAC;AAE5C,kCAAkC;AAClC,kBAAU,GAAG,CAAC;IACZ,MAAM,QAAQ,YAAY,GAAG,aAAa,CAAC;IAC3C,MAAM,QAAQ,UAAU,GAAG,WAAW,CAAC;IACvC,MAAM,QAAQ,SAAS,GAAG,UAAU,CAAC;IACrC,MAAM,QAAQ,SAAS,GAAG,UAAU,CAAC;IACrC,MAAM,QAAQ,UAAU,GAAG,WAAW,CAAC;IACvC,MAAM,QAAQ,UAAU,GAAG,WAAW,CAAC;IACvC,MAAM,QAAQ,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;IAC/C,MAAM,QAAQ,QAAQ,GAAG,SAAS,CAAC;IACnC;;OAEG;IACI,MAAM,aAAa;QACxB;;WAEG;;KAEJ,CAAC;CACH;AAED,eAAe,GAAG,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/localization/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/localization/index.d.ts deleted file mode 100644 index 1d08c849f..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/localization/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./resolver/LocaleResolver"; -export * from "./resolver/MessageResolver"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/localization/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/localization/index.d.ts.map deleted file mode 100644 index cd69fb9a2..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/localization/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/localization/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/localization/resolver/LocaleResolver.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/localization/resolver/LocaleResolver.d.ts.map deleted file mode 100644 index b9d586e12..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/localization/resolver/LocaleResolver.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"LocaleResolver.d.ts","sourceRoot":"","sources":["../../../../../src/localization/resolver/LocaleResolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,MAAM,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAOpE;;GAEG;AACH,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAEnD"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/localization/resolver/MessageResolver.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/localization/resolver/MessageResolver.d.ts deleted file mode 100644 index f66573066..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/localization/resolver/MessageResolver.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type * as LocaleResolver from "./LocaleResolver"; -/** - * Message parser definition. - */ -export type MessageParser = ((locale: LocaleResolver.Locale, message: string) => string) & {}; -/** - * Is used to globally define a custom message parser. - */ -export declare function configureParser(handler?: MessageParser): void; -/** - * Internal handler for the customized message parser - */ -export declare function parseMessage(locale: LocaleResolver.Locale, message: string): string; -//# sourceMappingURL=MessageResolver.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/localization/resolver/MessageResolver.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/localization/resolver/MessageResolver.d.ts.map deleted file mode 100644 index 4c67a5e7d..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/localization/resolver/MessageResolver.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MessageResolver.d.ts","sourceRoot":"","sources":["../../../../../src/localization/resolver/MessageResolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,cAAc,MAAM,kBAAkB,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,EAAE,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,EAAE,CAAC;AAM9F;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI,CAE7D;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CASnF"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/localization/service/MessageReaderService.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/localization/service/MessageReaderService.d.ts.map deleted file mode 100644 index 66a53b35c..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/localization/service/MessageReaderService.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MessageReaderService.d.ts","sourceRoot":"","sources":["../../../../../src/localization/service/MessageReaderService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,4BAA4B,CAAC;AAE7D,OAAO,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAO9C;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,QAQtB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,EAAE,CAAC;AAE1C;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAExE,MAAM,MAAM,UAAU,GAAG,MAAM,iBAAiB,CAAC;AAEjD;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,MAAM,iBAAiB,EAC5B,MAAM,CAAC,EAAE,cAAc,CAAC,MAAM,GAAG,IAAI,GACpC,MAAM,CAIR"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/localization/service/TranslationService.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/localization/service/TranslationService.d.ts.map deleted file mode 100644 index fdf6ecbb5..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/localization/service/TranslationService.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"TranslationService.d.ts","sourceRoot":"","sources":["../../../../../src/localization/service/TranslationService.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,gBAAgB,CAAC;AACjC,OAAO,EAAE,KAAK,iBAAiB,EAAc,MAAM,wBAAwB,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,SAAS,CACvB,MAAM,EAAE,GAAG,CAAC,YAAY,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,EAClD,GAAG,EAAE,MAAM,iBAAiB,EAC5B,GAAG,IAAI,EAAE,GAAG,EAAE,GACb,MAAM,CAIR"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/index.d.ts deleted file mode 100644 index c4f097e94..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/index.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -import type API from "../../index"; -import { type FieldDecoratorCtx } from "./../decorators"; -export * from "./models"; -export * from "./service"; -/** - * Retrieves the names of all fields in a class. - * - * @param constructor - The class constructor. - * @returns An array of field names. - */ -export declare function getClassFieldNames(constructor: API.Utilities.Types.Class): Array; -/** - * Retrieves the property descriptor for a specific field in a class. - * - * @param constructor - The class constructor. - * @param name - The name of the field. - * @returns The property descriptor for the field. - */ -export declare function getClassFieldDescriptor(constructor: API.Utilities.Types.Class, name: keyof TClass): PropertyDescriptor | undefined; -/** - * Retrieves or initializes metadata for a given strategy. - * - * @param strategy - The strategy to get metadata for. - * @returns The metadata object. - */ -export declare function getMetadata(strategy: MetaStrategy): DecoratorMetadataObject; -/** - * Checks if a given strategy is a class. - * - * @param strategy - The strategy to check. - * @returns True if the strategy is a class, false otherwise. - */ -export declare function isClass(strategy: MetaStrategy): strategy is API.Utilities.Types.Class; -/** - * Type alias for strategies that can either be a decorator context or a class. - */ -export type MetaStrategy = FieldDecoratorCtx | API.Utilities.Types.Class | DecoratorContext; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/index.d.ts.map deleted file mode 100644 index a7d0b5afd..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/reflection/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAE1B;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EACvC,WAAW,EAAE,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,GAC7C,KAAK,CAAC,MAAM,MAAM,CAAC,CAarB;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAC5C,WAAW,EAAE,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,EAC9C,IAAI,EAAE,MAAM,MAAM,GACjB,kBAAkB,GAAG,SAAS,CAIhC;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,YAAY,GAAG,uBAAuB,CAY3E;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,QAAQ,EAAE,YAAY,GAAG,QAAQ,IAAI,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAE1F;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GACpB,iBAAiB,CAAC,GAAG,CAAC,GACtB,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,GAC9B,gBAAgB,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/models/ControlDescriptor.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/models/ControlDescriptor.d.ts deleted file mode 100644 index 5f4e8987d..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/models/ControlDescriptor.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -import API from "../../../index"; -import { type EventEmitter } from "../../utilities/misc/EventEmitter"; -import * as StrategyMapper from "./../../strategy/models/StrategyMapper"; -import { ValidationMetadata } from "./ValidationMetadata"; -/** - * Describes the reflection rules for a specific field within a class. - * @typeParam FieldType - The type of the field. - */ -export type ControlDescriptorValidationMetadata = { - root: ValidationMetadata; - foreach: ValidationMetadata; -}; -/** - * Properties for constructing a `ReflectionDescriptor`. - * @typeParam This - The type of the current class. - * @typeParam HostClass - The type of the host class. - * @typeParam Name - The name of the descriptor within the host class. - */ -export type ControlDescriptorType = Name extends keyof HostClass ? HostClass[Name] : HostClass; -/** - * Properties for constructing a `ReflectionDescriptor`. - * @typeParam This - The type of the current class. - * @typeParam HostClass - The type of the host class. - * @typeParam Name - The name of the descriptor within the host class. - */ -export type ControlDescriptorProps = { - hostClass?: API.Utilities.Types.Class; - hostDefault?: HostClass; - thisClass?: API.Utilities.Types.Class; - thisName?: Name; - thisDefault?: ControlDescriptorType; - validations?: ControlDescriptorValidationMetadata>; - eventEmitter: EventEmitter; -}; -/** - * A class responsible for describing reflection metadata for a specific field within a class. - * @typeParam This - The type of the current class. - * @typeParam HostClass - The type of the host class. - * @typeParam Name - The name of the descriptor within the host class. - * @remarks This class is used to store metadata about a specific field, including its validation rules and default values. - */ -export declare class ControlDescriptor { - hostClass?: API.Utilities.Types.Class; - hostDefault?: HostClass; - thisClass?: API.Utilities.Types.Class; - thisName?: Name; - thisDefault?: ControlDescriptorType; - validations: ControlDescriptorValidationMetadata>; - eventEmitter: EventEmitter; - constructor(props: ControlDescriptorProps); - /** - * Gets the implementation of the reflection strategy. - * @throws {Error} If the strategy is not implemented. - */ - get StrategyImpl(): API.Utilities.Types.Class; - /** - * Determines the reflection strategy type for the descriptor. - * @returns The type of the reflection strategy. - * @remarks - * This method performs the following steps: - * 1. Checks if the host class is defined. - * 2. Checks if the field name is defined. - * 3. Determines the strategy based on the field type and its metadata. - */ - get strategy(): StrategyMapper.Key; -} -//# sourceMappingURL=ControlDescriptor.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/models/ControlDescriptor.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/models/ControlDescriptor.d.ts.map deleted file mode 100644 index bb613e765..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/models/ControlDescriptor.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ControlDescriptor.d.ts","sourceRoot":"","sources":["../../../../../src/reflection/models/ControlDescriptor.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,gBAAgB,CAAC;AACjC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,KAAK,cAAc,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;GAGG;AACH,MAAM,MAAM,mCAAmC,CAAC,SAAS,IAAI;IAC3D,IAAI,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAAC;IACpC,OAAO,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAAC;CACxC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,CAC/B,SAAS,EACT,IAAI,SAAS,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS,IAClD,IAAI,SAAS,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;AAE/D;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,CAChC,IAAI,EACJ,SAAS,EACT,IAAI,SAAS,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS,IAClD;IACF,SAAS,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IACjD,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,SAAS,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC5C,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,WAAW,CAAC,EAAE,qBAAqB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IACrD,WAAW,CAAC,EAAE,mCAAmC,CAAC,qBAAqB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;IAC1F,YAAY,EAAE,YAAY,CAAC;CAC5B,CAAC;AAEF;;;;;;GAMG;AACH,qBAAa,iBAAiB,CAC5B,IAAI,EACJ,SAAS,EACT,IAAI,SAAS,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS;IAEpD,SAAS,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IACjD,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,SAAS,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC5C,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,WAAW,CAAC,EAAE,qBAAqB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IACrD,WAAW,EAAE,mCAAmC,CAAC,qBAAqB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;IACzF,YAAY,EAAE,YAAY,CAAC;gBAEf,KAAK,EAAE,sBAAsB,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC;IAahE;;;OAGG;IACH,IAAW,YAAY,IAAI,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,iCAAiC,CAAC,CAOnG;IAED;;;;;;;;OAQG;IACH,IAAW,QAAQ,IAAI,cAAc,CAAC,GAAG,CAwDxC;CACF"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/models/ValidationMetadata.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/models/ValidationMetadata.d.ts.map deleted file mode 100644 index 0017d032f..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/models/ValidationMetadata.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ValidationMetadata.d.ts","sourceRoot":"","sources":["../../../../../src/reflection/models/ValidationMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,KAAK,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAGlF;;;;;;;;GAQG;AACH,qBAAa,kBAAkB,CAAC,UAAU;;IAGxC;;;;OAIG;IACH,IAAI,QAAQ,IAAI,KAAK,CAAC,uBAAuB,CAAC,UAAU,CAAC,CAAC,CAEzD;IAED;;OAEG;gBACS,QAAQ,GAAE,KAAK,CAAC,uBAAuB,CAAC,UAAU,CAAC,CAAM;IAIrE;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,KAAK,EACZ,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAC7C,MAAM,EAAE,MAAM,EAAE,EAChB,MAAM,EAAE,GAAG,CAAC,YAAY,CAAC,MAAM,EAC/B,IAAI,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,aAAa,EAClC,OAAO,CAAC,EAAE,YAAY,EACtB,KAAK,CAAC,EAAE,MAAM,GACb,gBAAgB,EAAE;IA+BrB;;;;OAIG;IACH,GAAG,IAAI,uBAAuB,CAAC,UAAU,CAAC;IAI1C;;;;OAIG;IACH,GAAG,CAAC,IAAI,EAAE,uBAAuB,CAAC,UAAU,CAAC,GAAG,IAAI;CAmBrD"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/models/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/models/index.d.ts deleted file mode 100644 index e041a6c3e..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/models/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./ControlDescriptor"; -export * from "./ValidationMetadata"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/models/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/models/index.d.ts.map deleted file mode 100644 index 4e78cda68..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/models/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/reflection/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/service/AbstractMetaService.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/service/AbstractMetaService.d.ts.map deleted file mode 100644 index 46404b9f1..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/service/AbstractMetaService.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"AbstractMetaService.d.ts","sourceRoot":"","sources":["../../../../../src/reflection/service/AbstractMetaService.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,gBAAgB,CAAC;AACjC,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D;;;GAGG;AACH,8BAAsB,mBAAmB,CAAC,KAAK;;IAK7C,SAAS,CAAC,OAAO,CAAC,EAAE,iBAAiB,CAAC,GAAG,CAAC,CAAC;IAE3C;;;;;OAKG;gBACS,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,CAAC,UAAU,CAAC,YAAY,EAAE,OAAO,EAAE,MAAM,KAAK;IAW7F;;OAEG;IACH,IAAI,KAAK,IAAI,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAE1C;IAED;;OAEG;IACH,IAAI,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAE9C;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,uBAAuB,CAEtC;IAED;;;;OAIG;IACH,IAAW,IAAI,IAAI,KAAK,CAEvB;IAED;;;;;;OAMG;IACH,SAAS,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIvC;;;;;;OAMG;IACH,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC;CAO7D"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/service/impl/ClassValidatorMetaService.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/service/impl/ClassValidatorMetaService.d.ts deleted file mode 100644 index bbe43f701..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/service/impl/ClassValidatorMetaService.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type API from "../../../../index"; -import { type EventEmitter } from "../../../utilities/misc/EventEmitter"; -import { ValidationMetadata } from "../../models/ValidationMetadata"; -import { AbstractMetaService } from "../AbstractMetaService"; -/** - * A configurer class which allows for easier manipulation of decorated class validators and corresponding metadata - * @remarks This class is responsible for managing metadata related to validation (at class level). It provides methods to add validators and read them. - */ -export declare class ClassValidatorMetaService extends AbstractMetaService> { - /** - * Static method to create a new instance of ClassValidatorMetaService. - * @param strategy - The strategy to inject. - * @returns A new instance of ClassValidatorMetaService. - */ - static inject(strategy: T, eventEmitter: EventEmitter): ClassValidatorMetaService>; - eventEmitter: EventEmitter; - private constructor(); - /** - * Adds a class-level validator to the provided class. - * @param isValid - The validation function. - * @param groups - Optional validation groups. - */ - addValidator(isValid: API.Validation.ValidationEvaluator>, groups: string[]): void; -} -//# sourceMappingURL=ClassValidatorMetaService.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/service/impl/ClassValidatorMetaService.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/service/impl/ClassValidatorMetaService.d.ts.map deleted file mode 100644 index c41a719a0..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/service/impl/ClassValidatorMetaService.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ClassValidatorMetaService.d.ts","sourceRoot":"","sources":["../../../../../../src/reflection/service/impl/ClassValidatorMetaService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D;;;GAGG;AACH,qBAAa,yBAAyB,CACpC,SAAS,SAAS,GAAG,CAAC,UAAU,CAAC,YAAY,CAC7C,SAAQ,mBAAmB,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;IACpD;;;;OAIG;WACW,MAAM,CAAC,CAAC,SAAS,GAAG,CAAC,UAAU,CAAC,YAAY,EACxD,QAAQ,EAAE,CAAC,EACX,YAAY,EAAE,YAAY,GACzB,yBAAyB,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;IAOvE,YAAY,EAAG,YAAY,CAAC;IAE5B,OAAO;IAKP;;;;OAIG;IACH,YAAY,CACV,OAAO,EAAE,GAAG,CAAC,UAAU,CAAC,mBAAmB,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,EACvF,MAAM,EAAE,MAAM,EAAE,GACf,IAAI;CAMR"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/service/impl/FieldValidatorMetaService.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/service/impl/FieldValidatorMetaService.d.ts deleted file mode 100644 index 191e13380..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/service/impl/FieldValidatorMetaService.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -import API from "../../../../index"; -import { type EventEmitter } from "../../../utilities/misc/EventEmitter"; -import { AbstractMetaService } from "../AbstractMetaService"; -import { ControlDescriptor } from "./../../models/ControlDescriptor"; -/** - * A configurer class which allows for easier manipulation of decorated fields and corresponding metadata - * @remarks This class is responsible for managing metadata related to validation. It provides methods to add validators, get field names, and manage descriptors. - */ -export declare class FieldValidatorMetaService extends AbstractMetaService>> { - #private; - /** - * Static method to create a new instance of FieldValidatorMetaService. - * @param strategy - The strategy to inject. - * @returns A new instance of FieldValidatorMetaService. - */ - static inject(strategy: API.Reflection.MetaStrategy, eventEmitter: EventEmitter): FieldValidatorMetaService; - eventEmitter: EventEmitter; - private constructor(); - /** - * Adds a validator to a field. - * - * @param field - The name of the field. - * @param isValid - The validation function. - * @param groups - Optional validation groups. - */ - addValidator(field: string, isValid: API.Validation.ValidationEvaluator, groups: string[]): void; - /** - * Gets the names of all fields present within given - * reflection strategy (`Types.Class` or `Decorator.Context`). - * - * @returns An array of field names. - */ - getFields(): string[]; - /** - * Checks if a descriptor exists for a given name. - * - * @param name - The name of a field descriptor. - * @returns `true` if the descriptor exists, `false` otherwise. - */ - hasDescriptor(name: string): boolean; - /** - * Gets a typed descriptor for a given field name. - * - * @param thisName - The name of the field. - * @returns The typed descriptor. - */ - getTypedDescriptor(thisName: TName): ControlDescriptor; - /** - * Gets an untyped descriptor for a given field key. - * - * @param fieldKey - The key of the field. - * @returns The untyped descriptor. - */ - getUntypedDescriptor(fieldKey: any, eventEmitter?: EventEmitter): ControlDescriptor; -} -//# sourceMappingURL=FieldValidatorMetaService.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/service/impl/FieldValidatorMetaService.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/service/impl/FieldValidatorMetaService.d.ts.map deleted file mode 100644 index 0ce6f6e31..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/service/impl/FieldValidatorMetaService.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"FieldValidatorMetaService.d.ts","sourceRoot":"","sources":["../../../../../../src/reflection/service/impl/FieldValidatorMetaService.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAErE;;;GAGG;AACH,qBAAa,yBAA0B,SAAQ,mBAAmB,CAChE,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAC9C;;IACC;;;;OAIG;WACW,MAAM,CAClB,QAAQ,EAAE,GAAG,CAAC,UAAU,CAAC,YAAY,EACrC,YAAY,EAAE,YAAY,GACzB,yBAAyB;IAI5B,YAAY,EAAG,YAAY,CAAC;IAG5B,OAAO;IAQP;;;;;;OAMG;IACH,YAAY,CACV,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,GAAG,CAAC,UAAU,CAAC,mBAAmB,CAAC,GAAG,CAAC,EAChD,MAAM,EAAE,MAAM,EAAE,GACf,IAAI;IAOP;;;;;OAKG;IACH,SAAS,IAAI,MAAM,EAAE;IAIrB;;;;;OAKG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIpC;;;;;OAKG;IACH,kBAAkB,CAAC,MAAM,EAAE,KAAK,SAAS,MAAM,MAAM,EACnD,QAAQ,EAAE,KAAK,GACd,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC;IAQ5C;;;;;OAKG;IACH,oBAAoB,CAClB,QAAQ,EAAE,GAAG,EACb,YAAY,CAAC,EAAE,YAAY,GAC1B,iBAAiB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;CAqCpC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/service/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/service/index.d.ts deleted file mode 100644 index 3b376b572..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/service/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export * from "./AbstractMetaService"; -export * from "./impl/ClassValidatorMetaService"; -export * from "./impl/FieldValidatorMetaService"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/service/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/service/index.d.ts.map deleted file mode 100644 index 26d97b6b2..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/reflection/service/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/reflection/service/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/index.d.ts.map deleted file mode 100644 index 346e071cf..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/strategy/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/models/StrategyFactory.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/models/StrategyFactory.d.ts deleted file mode 100644 index 83fad7988..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/models/StrategyFactory.d.ts +++ /dev/null @@ -1,68 +0,0 @@ -import type API from "../../../index"; -import { type FunctionStrat } from "../service/impl/FunctionStrategy"; -import { type ObjectArrayGetterStrat } from "../service/impl/ObjectArrayGetterStrategy"; -import { type ObjectArrayStrat } from "../service/impl/ObjectArrayStrategy"; -import { type ObjectGetterStrat } from "../service/impl/ObjectGetterStrategy"; -import { type ObjectStrat } from "../service/impl/ObjectStrategy"; -import { type PrimitiveArrayGetterStrat } from "../service/impl/PrimitiveArrayGetterStrategy"; -import { type PrimitiveArrayStrat } from "../service/impl/PrimitiveArrayStrategy"; -import { type PrimitiveGetterStrat } from "../service/impl/PrimitiveGetterStrategy"; -import { type PrimitiveStrat } from "../service/impl/PrimitiveStrategy"; -import type * as StrategyTypes from "./StrategyTypes"; -/** - * Evaluates a type, returning either an optional or mandatory evaluation based on the second type parameter. - * @typeParam T - The type to evaluate. - * @typeParam R - The result type. Determines if the evaluation is optional or mandatory. - */ -export type evaluate = true extends API.Utilities.Booleans.isUndefined ? API.Utilities.Types.Prettify>> : API.Utilities.Types.Prettify>>; -/** - * Type for optional evaluation of each field in a type. - * @typeParam T - The type to evaluate. - * @typeParam R - The result type. - */ -export type evaluateOptional = { - [K in keyof T]?: fieldEvaluation; -}; -/** - * Type for mandatory evaluation of each field in a type. - * @typeParam T - The type to evaluate. - * @typeParam R - The result type. - */ -export type evaluateMandatory = { - [K in keyof T]-?: fieldEvaluation; -}; -/** - * Determines the evaluation strategy for a field in a type. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - * @typeParam R - The result type. - */ -export type fieldEvaluation = true extends StrategyTypes.Function.matches ? StrategyTypes.Function.handler : true extends StrategyTypes.PrimitiveArray.matches ? StrategyTypes.PrimitiveArray.handler : true extends StrategyTypes.PrimitiveGetter.matches ? StrategyTypes.PrimitiveGetter.handler : true extends StrategyTypes.PrimitiveArrayGetter.matches ? StrategyTypes.PrimitiveArrayGetter.handler : true extends StrategyTypes.Primitive.matches ? StrategyTypes.Primitive.handler : true extends StrategyTypes.ObjectArray.matches ? StrategyTypes.ObjectArray.handler : true extends StrategyTypes.ObjectArrayGetter.matches ? StrategyTypes.ObjectArrayGetter.handler : true extends StrategyTypes.ObjectGetter.matches ? StrategyTypes.ObjectGetter.handler : true extends StrategyTypes.Object.matches ? StrategyTypes.Object.handler : never; -/** - * A type that maps field types to their respective validation strategy results. - * - * @typeParam Field - The type of the field being validated. - */ -export type getStrategyResult = ReturnType["test"]>; -/** - * A type that maps field types to their respective validation strategy classes. - * - * @typeParam Field - The type of the field being validated. - */ -export type getStrategyClass = true extends StrategyTypes.Function.matches ? FunctionStrat : true extends StrategyTypes.PrimitiveArray.matches ? PrimitiveArrayStrat : true extends StrategyTypes.PrimitiveGetter.matches ? PrimitiveGetterStrat : true extends StrategyTypes.PrimitiveArrayGetter.matches ? PrimitiveArrayGetterStrat : true extends StrategyTypes.Primitive.matches ? PrimitiveStrat : true extends StrategyTypes.ObjectArray.matches ? ObjectArrayStrat : true extends StrategyTypes.ObjectArrayGetter.matches ? ObjectArrayGetterStrat : true extends StrategyTypes.ObjectGetter.matches ? ObjectGetterStrat : true extends StrategyTypes.Object.matches ? ObjectStrat : never; -/** - * Namespace for Strategy Factory Implementations. - */ -export declare namespace Impl { - /** - * Type for detailed errors during validation. - * @typeParam T - The type being validated. - */ - type DetailedErrors = evaluate; - /** - * Type for basic errors during validation. - * @typeParam T - The type being validated. - */ - type Errors = evaluate; -} -//# sourceMappingURL=StrategyFactory.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/models/StrategyFactory.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/models/StrategyFactory.d.ts.map deleted file mode 100644 index 9621f5062..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/models/StrategyFactory.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"StrategyFactory.d.ts","sourceRoot":"","sources":["../../../../../src/strategy/models/StrategyFactory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACxF,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AAC9F,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,KAAK,aAAa,MAAM,iBAAiB,CAAC;AAEtD;;;;GAIG;AAEH,MAAM,MAAM,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,SAAS,IAAI,IAAI,SAAS,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,GACrF,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAClF,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAE1F;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,EAAE,CAAC,IAAI;KAClC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;CAC1C,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,EAAE,CAAC,IAAI;KACnC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;CAC3C,CAAC;AAEF;;;;;GAKG;AAEH,MAAM,MAAM,eAAe,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,IAC/C,IAAI,SAAS,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GAC/C,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAEvC,IAAI,SAAS,aAAa,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GACvD,aAAa,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAE7C,IAAI,SAAS,aAAa,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GACxD,aAAa,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAE9C,IAAI,SAAS,aAAa,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GAC7D,aAAa,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAEnD,IAAI,SAAS,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GAClD,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAExC,IAAI,SAAS,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GACpD,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAE1C,IAAI,SAAS,aAAa,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GAC1D,aAAa,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAEhD,IAAI,SAAS,aAAa,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GACrD,aAAa,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAE3C,IAAI,SAAS,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GAC/C,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GACvC,KAAK,CAAC;AAEV;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,UAAU,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAEjG;;;;GAIG;AAEH,MAAM,MAAM,gBAAgB,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAC7C,IAAI,SAAS,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GAC/C,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAEnB,IAAI,SAAS,aAAa,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GACvD,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAEzB,IAAI,SAAS,aAAa,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GACxD,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAE1B,IAAI,SAAS,aAAa,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GAC7D,yBAAyB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAE/B,IAAI,SAAS,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GAClD,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAEpB,IAAI,SAAS,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GACpD,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAEtB,IAAI,SAAS,aAAa,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GAC1D,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAE5B,IAAI,SAAS,aAAa,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GACrD,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAEvB,IAAI,SAAS,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GAC/C,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACnB,KAAK,CAAC;AAEV;;GAEG;AACH,yBAAiB,IAAI,CAAC;IACpB;;;OAGG;IACH,KAAY,cAAc,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAE/E;;;OAGG;IACH,KAAY,MAAM,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;CAC/C"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/models/StrategyMapper.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/models/StrategyMapper.d.ts deleted file mode 100644 index 149e1298a..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/models/StrategyMapper.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type * as Types from "../../utilities/impl/Types"; -import { type AbstractValidationStrategyService } from "../service/AbstractValidationStrategyService"; -import * as StrategyTypes from "./StrategyTypes"; -/** - * The type of a reflection strategy. - * - * @remarks - * This type is derived from the keys of the `ReflectionStrategy` object. - */ -export type Key = "unknown" | typeof StrategyTypes.Primitive.Name | typeof StrategyTypes.Object.Name | typeof StrategyTypes.PrimitiveArray.Name | typeof StrategyTypes.ObjectArray.Name | typeof StrategyTypes.PrimitiveGetter.Name | typeof StrategyTypes.ObjectGetter.Name | typeof StrategyTypes.PrimitiveArrayGetter.Name | typeof StrategyTypes.ObjectArrayGetter.Name | typeof StrategyTypes.Function.Name; -/** - * A mapping of reflection strategy types to their corresponding `ValidationStrategy` classes. - * - * @remarks - * This object provides a way to look up the `ValidationStrategy` class that should be used for a given - * reflection strategy type. - */ -export declare const data: Record>; -//# sourceMappingURL=StrategyMapper.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/models/StrategyMapper.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/models/StrategyMapper.d.ts.map deleted file mode 100644 index 91a96609a..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/models/StrategyMapper.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"StrategyMapper.d.ts","sourceRoot":"","sources":["../../../../../src/strategy/models/StrategyMapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,KAAK,iCAAiC,EAAE,MAAM,8CAA8C,CAAC;AAUtG,OAAO,KAAK,aAAa,MAAM,iBAAiB,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,MAAM,GAAG,GACX,SAAS,GACT,OAAO,aAAa,CAAC,SAAS,CAAC,IAAI,GACnC,OAAO,aAAa,CAAC,MAAM,CAAC,IAAI,GAChC,OAAO,aAAa,CAAC,cAAc,CAAC,IAAI,GACxC,OAAO,aAAa,CAAC,WAAW,CAAC,IAAI,GACrC,OAAO,aAAa,CAAC,eAAe,CAAC,IAAI,GACzC,OAAO,aAAa,CAAC,YAAY,CAAC,IAAI,GACtC,OAAO,aAAa,CAAC,oBAAoB,CAAC,IAAI,GAC9C,OAAO,aAAa,CAAC,iBAAiB,CAAC,IAAI,GAC3C,OAAO,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC;AAEvC;;;;;;GAMG;AAEH,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAW1E,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/models/StrategyTypes.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/models/StrategyTypes.d.ts deleted file mode 100644 index e39b5082b..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/models/StrategyTypes.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import FunctionStrategyType from "../service/impl/FunctionStrategy/types"; -import ObjectArrayGetterStrategyType from "../service/impl/ObjectArrayGetterStrategy/types"; -import ObjectArrayStrategyType from "../service/impl/ObjectArrayStrategy/types"; -import ObjectGetterStrategyType from "../service/impl/ObjectGetterStrategy/types"; -import ObjectStrategyType from "../service/impl/ObjectStrategy/types"; -import PrimitiveArrayGetterStrategyType from "../service/impl/PrimitiveArrayGetterStrategy/types"; -import PrimitiveArrayStrategyType from "../service/impl/PrimitiveArrayStrategy/types"; -import PrimitiveGetterStrategyType from "../service/impl/PrimitiveGetterStrategy/types"; -import PrimitiveStrategyType from "../service/impl/PrimitiveStrategy/types"; -export import ObjectArray = ObjectArrayStrategyType; -export import Object = ObjectStrategyType; -export import ObjectGetter = ObjectGetterStrategyType; -export import PrimitiveArray = PrimitiveArrayStrategyType; -export import Primitive = PrimitiveStrategyType; -export import PrimitiveGetter = PrimitiveGetterStrategyType; -export import Function = FunctionStrategyType; -export import ObjectArrayGetter = ObjectArrayGetterStrategyType; -export import PrimitiveArrayGetter = PrimitiveArrayGetterStrategyType; -//# sourceMappingURL=StrategyTypes.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/models/StrategyTypes.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/models/StrategyTypes.d.ts.map deleted file mode 100644 index 5063897c7..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/models/StrategyTypes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"StrategyTypes.d.ts","sourceRoot":"","sources":["../../../../../src/strategy/models/StrategyTypes.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,MAAM,wCAAwC,CAAC;AAC1E,OAAO,6BAA6B,MAAM,iDAAiD,CAAC;AAC5F,OAAO,uBAAuB,MAAM,2CAA2C,CAAC;AAChF,OAAO,wBAAwB,MAAM,4CAA4C,CAAC;AAClF,OAAO,kBAAkB,MAAM,sCAAsC,CAAC;AACtE,OAAO,gCAAgC,MAAM,oDAAoD,CAAC;AAClG,OAAO,0BAA0B,MAAM,8CAA8C,CAAC;AACtF,OAAO,2BAA2B,MAAM,+CAA+C,CAAC;AACxF,OAAO,qBAAqB,MAAM,yCAAyC,CAAC;AAE5E,MAAM,QAAQ,WAAW,GAAG,uBAAuB,CAAC;AACpD,MAAM,QAAQ,MAAM,GAAG,kBAAkB,CAAC;AAC1C,MAAM,QAAQ,YAAY,GAAG,wBAAwB,CAAC;AACtD,MAAM,QAAQ,cAAc,GAAG,0BAA0B,CAAC;AAC1D,MAAM,QAAQ,SAAS,GAAG,qBAAqB,CAAC;AAChD,MAAM,QAAQ,eAAe,GAAG,2BAA2B,CAAC;AAC5D,MAAM,QAAQ,QAAQ,GAAG,oBAAoB,CAAC;AAC9C,MAAM,QAAQ,iBAAiB,GAAG,6BAA6B,CAAC;AAChE,MAAM,QAAQ,oBAAoB,GAAG,gCAAgC,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/models/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/models/index.d.ts.map deleted file mode 100644 index cd470462e..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/models/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/strategy/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/AbstractValidationStrategyService.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/AbstractValidationStrategyService.d.ts.map deleted file mode 100644 index 6ed7e2166..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/AbstractValidationStrategyService.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"AbstractValidationStrategyService.d.ts","sourceRoot":"","sources":["../../../../../src/strategy/service/AbstractValidationStrategyService.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAC;AAC9B,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AACnF,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AACrF,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAEpD;;;;;;GAMG;AACH,8BAAsB,iCAAiC,CACrD,MAAM,GAAG,GAAG,EACZ,eAAe,GAAG,GAAG,EACrB,aAAa,GAAG,GAAG;;IAWnB;;;;;OAKG;gBAED,UAAU,EAAE,iBAAiB,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1C,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,EAAE,EAChB,MAAM,EAAE,GAAG,CAAC,YAAY,CAAC,MAAM,EAC/B,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,MAAM;IAgBpB,IAAW,YAAY,CAAC,CAAC,EAAE,YAAY,EAEtC;IAED,IAAW,YAAY,IAAI,YAAY,CAEtC;IAED,SAAS,KAAK,WAAW,IAAI,IAAI,CAAC,MAAM,CAAC,CAExC;IAED,SAAS,KAAK,SAAS,IAAI,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,CAExD;IAED,SAAS,KAAK,UAAU,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAErD;IAED,SAAS,KAAK,MAAM,IAAI,MAAM,EAAE,CAE/B;IAED,SAAS,KAAK,MAAM,IAAI,GAAG,CAAC,YAAY,CAAC,MAAM,CAE9C;IAED;;;;;;OAMG;IACH,SAAS,KAAK,eAAe,IAAI,iBAAiB,CAAC,MAAM,EAAE,GAAG,EAAE,SAAS,CAAC,CAOzE;IAED;;;;OAIG;IACH,SAAS,KAAK,SAAS,IAAI,MAAM,CAEhC;IAED;;;;OAIG;IACH,SAAS,KAAK,YAAY,IAAI,GAAG,CAEhC;IAED,SAAS,CAAC,gBAAgB,CAAC,WAAW,GAAE,GAAG,CAAC,UAAU,CAAC,gBAAgB,EAAO,GAAG,MAAM,EAAE;IAKzF,SAAS,CAAC,cAAc,CAAC,UAAU,EAAE,GAAG,EAAE,WAAW,EAAE,GAAG,GAAG,GAAG,CAAC,UAAU,CAAC,gBAAgB,EAAE;IAI9F,SAAS,CAAC,aAAa,CACrB,UAAU,EAAE,GAAG,EACf,WAAW,EAAE,GAAG,EAChB,IAAI,EAAE,GAAG,CAAC,SAAS,CAAC,aAAa,GAChC,GAAG,CAAC,UAAU,CAAC,gBAAgB,EAAE;IAYpC,SAAS,CAAC,kBAAkB,CAC1B,SAAS,EAAE,GAAG,EACd,WAAW,EAAE,GAAG,GACf,GAAG,CAAC,UAAU,CAAC,gBAAgB,EAAE;IASpC;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,IAAI,CACX,KAAK,EAAE,GAAG,EACV,OAAO,EAAE,GAAG,EACZ,IAAI,EAAE,GAAG,CAAC,SAAS,CAAC,aAAa,GAChC,CAAC,eAAe,EAAE,aAAa,CAAC;CACpC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/FunctionStrategy/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/FunctionStrategy/index.d.ts deleted file mode 100644 index 66ede9ad3..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/FunctionStrategy/index.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type API from "../../../../../index"; -import { AbstractValidationStrategyService } from "../../../service/AbstractValidationStrategyService"; -import type ns from "./types"; -/** - * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating primitive types like numbers, strings, etc. - * - * @typeParam F - The type of the field being validated. - * - * @extends AbstractValidationStrategyService - */ -export declare class FunctionStrat extends AbstractValidationStrategyService { - private static readonly EMPTY; - /** - * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for primitive types by invoking the root rule's `validate` method and then building simplified error messages. - * - * @param value - The value to be validated. - * @param context - The context in which the validation is taking place. - * - * @returns A tuple containing an array of detailed validation results (`ValidationResult[]`) and an array of simplified error messages (`string[]`). - */ - test(value: API.Utilities.Types.FunctionType, _context: any): [ns.DetailedErrors, ns.SimpleErrors]; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/FunctionStrategy/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/FunctionStrategy/index.d.ts.map deleted file mode 100644 index 6c9356e11..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/FunctionStrategy/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/strategy/service/impl/FunctionStrategy/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,sBAAsB,CAAC;AAE5C,OAAO,EAAE,iCAAiC,EAAE,MAAM,oDAAoD,CAAC;AACvG,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B;;;;;;GAMG;AACH,qBAAa,aAAa,CAAC,CAAC,CAAE,SAAQ,iCAAiC,CACrE,CAAC,EACD,EAAE,CAAC,cAAc,EACjB,EAAE,CAAC,YAAY,CAChB;IACC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAsD;IAEnF;;;;;;;OAOG;IACH,IAAI,CACF,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,YAAY,EACvC,QAAQ,EAAE,GAAG,GACZ,CAAC,EAAE,CAAC,cAAc,EAAE,EAAE,CAAC,YAAY,CAAC;CAoBxC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/FunctionStrategy/types.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/FunctionStrategy/types.d.ts deleted file mode 100644 index 6e79adc4c..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/FunctionStrategy/types.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type API from "../../../../../index"; -/** - * Namespace for Function Strategy Types. - */ -declare namespace FunctionStrategyType { - /** - * Constant name identifier for this strategy. - */ - const Name: "function"; - /** - * Type definition for simple errors in this strategy. - */ - type SimpleErrors = string | null; - /** - * Type definition for detailed errors in this strategy. - */ - type DetailedErrors = API.Validation.ValidationResult | null; - /** - * Type guard to check if a certain field in a type matches this strategy. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - */ - type matches = API.Utilities.Booleans.isFunction; - /** - * Type for the handler function based on the field and result types. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - * @typeParam R - The result type. - */ - type handler = true extends API.Utilities.Booleans.isUndefined ? T[K] : API.Utilities.Arrays.getArrayType | null; -} -export default FunctionStrategyType; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/FunctionStrategy/types.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/FunctionStrategy/types.d.ts.map deleted file mode 100644 index 82c287986..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/FunctionStrategy/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../src/strategy/service/impl/FunctionStrategy/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,sBAAsB,CAAC;AAE5C;;GAEG;AACH,kBAAU,oBAAoB,CAAC;IAC7B;;OAEG;IACI,MAAM,IAAI,YAAsB,CAAC;IAExC;;OAEG;IACH,KAAY,YAAY,GAAG,MAAM,GAAG,IAAI,CAAC;IAEzC;;OAEG;IACH,KAAY,cAAc,GAAG,GAAG,CAAC,UAAU,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAEpE;;;;OAIG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAEnF;;;;;OAKG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,IACzC,IAAI,SAAS,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,GAC9C,CAAC,CAAC,CAAC,CAAC,GACR,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;CAC/C;AAED,eAAe,oBAAoB,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectArrayGetterStrategy/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectArrayGetterStrategy/index.d.ts deleted file mode 100644 index e0d773f7b..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectArrayGetterStrategy/index.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type API from "../../../../index"; -import { AbstractValidationStrategyService } from "../../../service/AbstractValidationStrategyService"; -import type ns from "./types"; -/** - * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating arrays of object types. - * - * @typeParam F - The type of the field being validated, which is expected to be an array of objects. - * - * @extends AbstractValidationStrategyService, ObjectArrayGetterSimpleErrors> - */ -export declare class ObjectArrayGetterStrat extends AbstractValidationStrategyService, ns.SimpleErrors> { - /** - * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for arrays of object types. - * - * @param value - The array of object values to be validated. - * @param context - The context in which the validation is taking place. - * @param groups - Optional validation groups to consider during validation. - * - * @returns A tuple containing `ObjectArrayGetterDetailedErrors` and `ObjectArrayGetterSimpleErrors`. - * - * @remarks - * The method validates both the array as a whole (`field`) and each individual object (`data`) - * using the appropriate validation rules. - */ - test(value: any[], context: any, args: API.Decorator.DecoratorArgs): [ns.DetailedErrors, ns.SimpleErrors]; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectArrayGetterStrategy/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectArrayGetterStrategy/index.d.ts.map deleted file mode 100644 index 58b7ae709..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectArrayGetterStrategy/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/strategy/service/impl/ObjectArrayGetterStrategy/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,iCAAiC,EAAE,MAAM,oDAAoD,CAAC;AAEvG,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B;;;;;;GAMG;AACH,qBAAa,sBAAsB,CAAC,CAAC,CAAE,SAAQ,iCAAiC,CAC9E,CAAC,EACD,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,EACpB,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,CACnB;IACC;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,KAAK,EAAE,GAAG,EAAE,EACZ,OAAO,EAAE,GAAG,EACZ,IAAI,EAAE,GAAG,CAAC,SAAS,CAAC,aAAa,GAChC,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;CAqC9C"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectArrayGetterStrategy/types.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectArrayGetterStrategy/types.d.ts deleted file mode 100644 index 226d78acf..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectArrayGetterStrategy/types.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -import type API from "../../../../../index"; -import type * as StrategyFactory from "../../../models/StrategyFactory"; -import ObjectStrategyType from "../ObjectStrategy/types"; -/** - * Namespace for ObjectArrayGetter Strategy Types. - */ -declare namespace ObjectArrayGetterStrategyType { - /** - * Constant name identifier for this strategy. - */ - const Name: "() => composite[]"; - /** - * Represents the simplified error structure for validating arrays of object types. - * - * @typeParam F - The type of the field being validated. - * - * - `field`: An array of string messages that represent validation errors at the array level. - * - `data`: An array of `Errors` objects that represent validation errors for each object in the array. - */ - type SimpleErrors = { - root: string[]; - data: Array>; - }; - /** - * Represents the detailed error structure for validating arrays of object types. - * - * @typeParam F - The type of the field being validated. - * - * - `field`: An array of `ValidationResult` objects that represent detailed validation errors at the array level. - * - `data`: An array of `DetailedErrors` objects that represent detailed validation errors for each object in the array. - */ - type DetailedErrors = { - root: API.Validation.ValidationResult[]; - data: Array>; - }; - /** - * Type guard to check if a certain field in a type matches this strategy. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - */ - type matches = true extends API.Utilities.Booleans.isGetter ? API.Utilities.Arrays.getArrayType> extends never ? false : API.Utilities.Booleans.isObject>> : false; - /** - * Type for the handler function based on the field and result types. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - * @typeParam R - The result type. - */ - type handler = Array>; -} -export default ObjectArrayGetterStrategyType; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectArrayGetterStrategy/types.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectArrayGetterStrategy/types.d.ts.map deleted file mode 100644 index 32aec79c7..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectArrayGetterStrategy/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../src/strategy/service/impl/ObjectArrayGetterStrategy/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,sBAAsB,CAAC;AAC5C,OAAO,KAAK,KAAK,eAAe,MAAM,iCAAiC,CAAC;AACxE,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AAEzD;;GAEG;AACH,kBAAU,6BAA6B,CAAC;IACtC;;OAEG;IACI,MAAM,IAAI,qBAAgD,CAAC;IAElE;;;;;;;OAOG;IACH,KAAY,YAAY,CAAC,CAAC,IAAI;QAC5B,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,IAAI,EAAE,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;KAC7C,CAAC;IAEF;;;;;;;OAOG;IACH,KAAY,cAAc,CAAC,CAAC,IAAI;QAC9B,IAAI,EAAE,GAAG,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC;QACxC,IAAI,EAAE,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;KACrD,CAAC;IAEF;;;;OAIG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IACtC,IAAI,SAAS,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,GAC9C,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,KAAK,GAChE,KAAK,GACL,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACvF,KAAK,CAAC;IAEZ;;;;;OAKG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;CAC1F;AAED,eAAe,6BAA6B,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectArrayStrategy/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectArrayStrategy/index.d.ts deleted file mode 100644 index 47cfe8176..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectArrayStrategy/index.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type API from "../../../../index"; -import { AbstractValidationStrategyService } from "../../../service/AbstractValidationStrategyService"; -import type ns from "./types"; -/** - * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating arrays of object types. - * - * @typeParam F - The type of the field being validated, which is expected to be an array of objects. - * - * @extends AbstractValidationStrategyService, ObjectArraySimpleErrors> - */ -export declare class ObjectArrayStrat extends AbstractValidationStrategyService, ns.SimpleErrors> { - /** - * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for arrays of object types. - * - * @param value - The array of object values to be validated. - * @param context - The context in which the validation is taking place. - * @param groups - Optional validation groups to consider during validation. - * - * @returns A tuple containing `ObjectArrayDetailedErrors` and `ObjectArraySimpleErrors`. - * - * @remarks - * The method validates both the array as a whole (`field`) and each individual object (`data`) - * using the appropriate validation rules. - */ - test(value: any[], context: any, args: API.Decorator.DecoratorArgs): [ns.DetailedErrors, ns.SimpleErrors]; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectArrayStrategy/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectArrayStrategy/index.d.ts.map deleted file mode 100644 index 2100df146..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectArrayStrategy/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/strategy/service/impl/ObjectArrayStrategy/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,iCAAiC,EAAE,MAAM,oDAAoD,CAAC;AAEvG,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B;;;;;;GAMG;AACH,qBAAa,gBAAgB,CAAC,CAAC,CAAE,SAAQ,iCAAiC,CACxE,CAAC,EACD,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,EACpB,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,CACnB;IACC;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,KAAK,EAAE,GAAG,EAAE,EACZ,OAAO,EAAE,GAAG,EACZ,IAAI,EAAE,GAAG,CAAC,SAAS,CAAC,aAAa,GAChC,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;CAqC9C"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectArrayStrategy/types.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectArrayStrategy/types.d.ts deleted file mode 100644 index aecb25152..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectArrayStrategy/types.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -import type API from "../../../../../index"; -import type * as StrategyFactory from "../../../models/StrategyFactory"; -import type ObjectStrategyType from "../ObjectStrategy/types"; -/** - * Namespace for ObjectArray Strategy Types. - */ -declare namespace ObjectArrayStrategyType { - /** - * Constant name identifier for this strategy. - */ - const Name: "composite[]"; - /** - * Represents the simplified error structure for validating arrays of object types. - * - * @typeParam F - The type of the field being validated. - * - * - `field`: An array of string messages that represent validation errors at the array level. - * - `data`: An array of `Errors` objects that represent validation errors for each object in the array. - */ - type SimpleErrors = { - root: string[]; - data: Array>; - }; - /** - * Represents the detailed error structure for validating arrays of object types. - * - * @typeParam F - The type of the field being validated. - * - * - `field`: An array of `ValidationResult` objects that represent detailed validation errors at the array level. - * - `data`: An array of `DetailedErrors` objects that represent detailed validation errors for each object in the array. - */ - type DetailedErrors = { - root: API.Validation.ValidationResult[]; - data: Array>; - }; - /** - * Type guard to check if a certain field in a type matches this strategy. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - */ - type matches = API.Utilities.Arrays.getArrayType> extends never ? false : true extends API.Utilities.Booleans.isGetter ? false : API.Utilities.Booleans.isObject>>; - /** - * Type for the handler function based on the field and result types. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - * @typeParam R - The result type. - */ - type handler = Array>; -} -export default ObjectArrayStrategyType; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectArrayStrategy/types.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectArrayStrategy/types.d.ts.map deleted file mode 100644 index 183c7507b..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectArrayStrategy/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../src/strategy/service/impl/ObjectArrayStrategy/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,sBAAsB,CAAC;AAC5C,OAAO,KAAK,KAAK,eAAe,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,kBAAkB,MAAM,yBAAyB,CAAC;AAE9D;;GAEG;AACH,kBAAU,uBAAuB,CAAC;IAChC;;OAEG;IACI,MAAM,IAAI,eAAyB,CAAC;IAE3C;;;;;;;OAOG;IACH,KAAY,YAAY,CAAC,CAAC,IAAI;QAC5B,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,IAAI,EAAE,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;KAC7C,CAAC;IAEF;;;;;;;OAOG;IACH,KAAY,cAAc,CAAC,CAAC,IAAI;QAC9B,IAAI,EAAE,GAAG,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC;QACxC,IAAI,EAAE,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;KACrD,CAAC;IAEF;;;;OAIG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IACxC,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,KAAK,GAC5D,KAAK,GACP,IAAI,SAAS,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,GAChD,KAAK,GACT,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAExF;;;;;OAKG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;CAC1F;AAED,eAAe,uBAAuB,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectGetterStrategy/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectGetterStrategy/index.d.ts deleted file mode 100644 index b7e81bcb5..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectGetterStrategy/index.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type API from "../../../../index"; -import { AbstractValidationStrategyService } from "../../../service/AbstractValidationStrategyService"; -import type ns from "./types"; -/** - * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating object types. - * - * @typeParam F - The type of the field being validated, which is expected to be an object. - * - * @extends AbstractValidationStrategyService, ObjectSimpleErrors> - */ -export declare class ObjectGetterStrat extends AbstractValidationStrategyService, ns.SimpleErrors> { - /** - * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for object types. - * - * @param value - The object value to be validated. - * @param context - The context in which the validation is taking place. - * @param groups - Optional validation groups to consider during validation. - * - * @returns A tuple containing `ObjectDetailedErrors` and `ObjectSimpleErrors`. - * - * @remarks - * The method validates both the object as a whole (`node`) and its properties (`children`) - * using the appropriate validation rules. - */ - test(value: any, context: any, args: API.Decorator.DecoratorArgs): [ns.DetailedErrors, ns.SimpleErrors]; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectGetterStrategy/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectGetterStrategy/index.d.ts.map deleted file mode 100644 index 6899f3c24..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectGetterStrategy/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/strategy/service/impl/ObjectGetterStrategy/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,iCAAiC,EAAE,MAAM,oDAAoD,CAAC;AACvG,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B;;;;;;GAMG;AACH,qBAAa,iBAAiB,CAAC,CAAC,CAAE,SAAQ,iCAAiC,CACzE,CAAC,EACD,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,EACpB,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,CACnB;IACC;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,KAAK,EAAE,GAAG,EACV,OAAO,EAAE,GAAG,EACZ,IAAI,EAAE,GAAG,CAAC,SAAS,CAAC,aAAa,GAChC,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;CAoB9C"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectGetterStrategy/types.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectGetterStrategy/types.d.ts deleted file mode 100644 index 3e8781572..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectGetterStrategy/types.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -import type API from "../../../../../index"; -import type * as StrategyFactory from "../../../models/StrategyFactory"; -declare namespace ObjectGetterStrategyType { - const Name: "(): composite"; - /** - * Represents the simplified error structure for validating object types. - * - * @typeParam F - The type of the field being validated. - * - * - `root`: An array of string messages that represent validation errors at the object level. - * - `data`: An `Errors` object that represents validation errors for each property in the object. - */ - type SimpleErrors = { - root: string[]; - data: StrategyFactory.Impl.Errors; - }; - /** - * Represents the detailed error structure for validating object types. - * - * @typeParam F - The type of the field being validated. - * - * - `root`: An array of `ValidationResult` objects that represent detailed validation errors at the object level. - * - `data`: A `DetailedErrors` object that represents detailed validation errors for each property in the object. - */ - type DetailedErrors = { - root: API.Validation.ValidationResult[]; - data: StrategyFactory.Impl.DetailedErrors; - }; - /** - * Type guard to check if a certain field in a type matches this strategy. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - */ - type matches = true extends API.Utilities.Booleans.isGetter ? API.Utilities.Booleans.isObject : false; - /** - * Type for the handler function based on the field and result types. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - * @typeParam R - The result type. - */ - type handler = true extends API.Utilities.Booleans.isUndefined ? T[K] : { - root: R; - data: StrategyFactory.evaluate; - }; -} -export default ObjectGetterStrategyType; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectGetterStrategy/types.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectGetterStrategy/types.d.ts.map deleted file mode 100644 index f44de84fd..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectGetterStrategy/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../src/strategy/service/impl/ObjectGetterStrategy/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,sBAAsB,CAAC;AAC5C,OAAO,KAAK,KAAK,eAAe,MAAM,iCAAiC,CAAC;AAGxE,kBAAU,wBAAwB,CAAC;IAC1B,MAAM,IAAI,iBAA4C,CAAC;IAE9D;;;;;;;OAOG;IACH,KAAY,YAAY,CAAC,CAAC,IAAI;QAC5B,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,IAAI,EAAE,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;KACtC,CAAC;IAEF;;;;;;;OAOG;IACH,KAAY,cAAc,CAAC,CAAC,IAAI;QAC9B,IAAI,EAAE,GAAG,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC;QACxC,IAAI,EAAE,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;KAC9C,CAAC;IAEF;;;;OAIG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IACtC,IAAI,SAAS,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,GAC9C,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACrC,KAAK,CAAA;IAEX;;;;;OAKG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,IACzC,IAAI,SAAS,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,GAC9C,CAAC,CAAC,CAAC,CAAC,GACR;QAAE,IAAI,EAAE,CAAC,CAAC;QAAC,IAAI,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;KAAE,CAAC;CACxD;AAED,eAAe,wBAAwB,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectStrategy/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectStrategy/index.d.ts deleted file mode 100644 index e63ba0189..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectStrategy/index.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type API from "../../../../index"; -import { AbstractValidationStrategyService } from "../../../service/AbstractValidationStrategyService"; -import type ns from "./types"; -/** - * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating object types. - * - * @typeParam F - The type of the field being validated, which is expected to be an object. - * - * @extends AbstractValidationStrategyService, ObjectSimpleErrors> - */ -export declare class ObjectStrat extends AbstractValidationStrategyService, ns.SimpleErrors> { - /** - * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for object types. - * - * @param value - The object value to be validated. - * @param context - The context in which the validation is taking place. - * @param groups - Optional validation groups to consider during validation. - * - * @returns A tuple containing `ObjectDetailedErrors` and `ObjectSimpleErrors`. - * - * @remarks - * The method validates both the object as a whole (`node`) and its properties (`children`) - * using the appropriate validation rules. - */ - test(value: any, context: any, args: API.Decorator.DecoratorArgs): [ns.DetailedErrors, ns.SimpleErrors]; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectStrategy/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectStrategy/index.d.ts.map deleted file mode 100644 index 9791ebc74..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectStrategy/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/strategy/service/impl/ObjectStrategy/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,iCAAiC,EAAE,MAAM,oDAAoD,CAAC;AACvG,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B;;;;;;GAMG;AACH,qBAAa,WAAW,CAAC,CAAC,CAAE,SAAQ,iCAAiC,CACnE,CAAC,EACD,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,EACpB,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,CACnB;IACC;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,KAAK,EAAE,GAAG,EACV,OAAO,EAAE,GAAG,EACZ,IAAI,EAAE,GAAG,CAAC,SAAS,CAAC,aAAa,GAChC,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;CAoB9C"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectStrategy/types.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectStrategy/types.d.ts deleted file mode 100644 index 8328f497c..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectStrategy/types.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -import type API from "../../../../../index"; -import type * as StrategyFactory from "../../../models/StrategyFactory"; -/** - * Namespace for Object Strategy Types. - */ -declare namespace ObjectStrategyType { - /** - * Constant name identifier for this strategy. - */ - const Name: "composite"; - /** - * Represents the simplified error structure for validating object types. - * @typeParam F - The type of the field being validated. - */ - type SimpleErrors = { - /** An array of string messages that represent validation errors at the decorated field level. */ - root: string[]; - /** An object that represents simplified validation errors for each property in the object. */ - data: StrategyFactory.Impl.Errors; - }; - /** - * Represents the detailed error structure for validating object types. - * @typeParam F - The type of the field being validated. - */ - type DetailedErrors = { - /** An array of validation result objects that represent detailed validation errors at the decorated field level. */ - root: API.Validation.ValidationResult[]; - /** An object that represents detailed validation errors for each property in the object. */ - data: StrategyFactory.Impl.DetailedErrors; - }; - /** - * Type guard to check if a certain field in a type matches this strategy. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - */ - type matches = true extends API.Utilities.Booleans.isGetter ? false : API.Utilities.Booleans.isObject; - /** - * Type for the handler function based on the field and result types. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - * @typeParam R - The result type. - */ - type handler = true extends API.Utilities.Booleans.isUndefined ? T[K] : { - root: R; - data: StrategyFactory.evaluate; - }; -} -export default ObjectStrategyType; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectStrategy/types.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectStrategy/types.d.ts.map deleted file mode 100644 index f83dbc3e0..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/ObjectStrategy/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../src/strategy/service/impl/ObjectStrategy/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,sBAAsB,CAAC;AAC5C,OAAO,KAAK,KAAK,eAAe,MAAM,iCAAiC,CAAC;AAExE;;GAEG;AACH,kBAAU,kBAAkB,CAAC;IAC3B;;OAEG;IACI,MAAM,IAAI,aAAuB,CAAC;IAEzC;;;OAGG;IACH,KAAY,YAAY,CAAC,CAAC,IAAI;QAC5B,iGAAiG;QACjG,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,8FAA8F;QAC9F,IAAI,EAAE,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;KACtC,CAAC;IAEF;;;OAGG;IACH,KAAY,cAAc,CAAC,CAAC,IAAI;QAC9B,oHAAoH;QACpH,IAAI,EAAE,GAAG,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC;QACxC,4FAA4F;QAC5F,IAAI,EAAE,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;KAC9C,CAAC;IAEF;;;;OAIG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IACtC,IAAI,SAAS,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,GAC9C,KAAK,GACT,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAExC;;;;;OAKG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,IACzC,IAAI,SAAS,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,GAC9C,CAAC,CAAC,CAAC,CAAC,GACR;QAAE,IAAI,EAAE,CAAC,CAAC;QAAC,IAAI,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;KAAE,CAAC;CACxD;AAED,eAAe,kBAAkB,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveArrayGetterStrategy/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveArrayGetterStrategy/index.d.ts deleted file mode 100644 index 1f265777f..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveArrayGetterStrategy/index.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type API from "../../../../"; -import { AbstractValidationStrategyService } from "../../../service/AbstractValidationStrategyService"; -import type ns from "./types"; -/** - * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating arrays of primitive types like numbers, strings, etc. - * - * @typeParam F - The type of the field being validated, which is expected to be an array of primitives. - * - * @extends AbstractValidationStrategyService - */ -export declare class PrimitiveArrayGetterStrat extends AbstractValidationStrategyService { - /** - * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for arrays of primitive types. - * - * @param value - The array of values to be validated. - * @param context - The context in which the validation is taking place. - * @param groups - Optional validation groups to consider during validation. - * - * @returns A tuple containing `PrimitiveArrayGetterDetailedErrors` and `PrimitiveArrayGetterSimpleErrors`. - * - * @remarks - * The method validates both the array as a whole (`node`) and each individual element (`children`) - * using the appropriate validation rules. - */ - test(value: any[], context: any, args: API.Decorator.DecoratorArgs): [ns.DetailedErrors, ns.SimpleErrors]; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveArrayGetterStrategy/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveArrayGetterStrategy/index.d.ts.map deleted file mode 100644 index 1b5324824..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveArrayGetterStrategy/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/strategy/service/impl/PrimitiveArrayGetterStrategy/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,iCAAiC,EAAE,MAAM,oDAAoD,CAAC;AACvG,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B;;;;;;GAMG;AACH,qBAAa,yBAAyB,CAAC,CAAC,CAAE,SAAQ,iCAAiC,CACjF,CAAC,EACD,EAAE,CAAC,cAAc,EACjB,EAAE,CAAC,YAAY,CAChB;IACC;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,KAAK,EAAE,GAAG,EAAE,EACZ,OAAO,EAAE,GAAG,EACZ,IAAI,EAAE,GAAG,CAAC,SAAS,CAAC,aAAa,GAChC,CAAC,EAAE,CAAC,cAAc,EAAE,EAAE,CAAC,YAAY,CAAC;CAgBxC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveArrayGetterStrategy/types.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveArrayGetterStrategy/types.d.ts deleted file mode 100644 index a187063d1..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveArrayGetterStrategy/types.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -import type API from "../../../../../index"; -/** - * Namespace for PrimitiveArrayGetter Strategy Types. - */ -declare namespace PrimitiveArrayGetterStrategyType { - /** - * Constant name identifier for this strategy. - */ - const Name: "get (): primitive[]"; - /** - * Represents the simplified error structure for validating arrays of primitive types. - * - * - `node`: An array of string messages that represent validation errors at the array level. - * - `children`: A two-dimensional array of string messages that represent validation errors for each element in the array. - */ - type SimpleErrors = { - node: string[]; - children: string[][]; - }; - /** - * Represents the detailed error structure for validating arrays of primitive types. - * - * - `node`: An array of `ValidationResult` objects that represent detailed validation errors at the array level. - * - `children`: A two-dimensional array of `ValidationResult` objects that represent detailed validation errors for each element in the array. - */ - type DetailedErrors = { - node: API.Validation.ValidationResult[]; - children: API.Validation.ValidationResult[][]; - }; - /** - * Type guard to check if a certain field in a type matches this strategy. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - */ - type matches = true extends API.Utilities.Booleans.isGetter ? API.Utilities.Arrays.getArrayType extends never ? false : API.Utilities.Booleans.isAnyOf, API.Utilities.Types.PrimitiveType> : false; - /** - * Type for the handler function based on the field and result types. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - * @typeParam R - The result type. - */ - type handler = true extends API.Utilities.Booleans.isUndefined ? T[K] : { - node: R; - children: R[]; - }; -} -export default PrimitiveArrayGetterStrategyType; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveArrayGetterStrategy/types.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveArrayGetterStrategy/types.d.ts.map deleted file mode 100644 index e7b0f39f6..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveArrayGetterStrategy/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../src/strategy/service/impl/PrimitiveArrayGetterStrategy/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,sBAAsB,CAAC;AAG5C;;GAEG;AACH,kBAAU,gCAAgC,CAAC;IACzC;;OAEG;IACI,MAAM,IAAI,uBAAqD,CAAC;IAEvE;;;;;OAKG;IACH,KAAY,YAAY,GAAG;QACzB,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC;KACtB,CAAC;IAEF;;;;;OAKG;IACH,KAAY,cAAc,GAAG;QAC3B,IAAI,EAAE,GAAG,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC;QACxC,QAAQ,EAAE,GAAG,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE,CAAC;KAC/C,CAAC;IAEF;;;;OAIG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IACtC,IAAI,SAAS,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,GAC9C,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,KAAK,GACnD,KAAK,GACL,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,aAAa,CAAC,GAC5G,KAAK,CAAC;IAEZ;;;;;OAKG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,IACzC,IAAI,SAAS,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,GAC9C,CAAC,CAAC,CAAC,CAAC,GACR;QAAE,IAAI,EAAE,CAAC,CAAC;QAAC,QAAQ,EAAE,CAAC,EAAE,CAAC;KAAE,CAAC;CAC/B;AAED,eAAe,gCAAgC,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveArrayStrategy/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveArrayStrategy/index.d.ts deleted file mode 100644 index 6d12fab69..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveArrayStrategy/index.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type API from "../../../../index"; -import { AbstractValidationStrategyService } from "../../../service/AbstractValidationStrategyService"; -import type ns from "./types"; -/** - * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating arrays of primitive types like numbers, strings, etc. - * - * @typeParam F - The type of the field being validated, which is expected to be an array of primitives. - * - * @extends AbstractValidationStrategyService - */ -export declare class PrimitiveArrayStrat extends AbstractValidationStrategyService { - /** - * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for arrays of primitive types. - * - * @param value - The array of values to be validated. - * @param context - The context in which the validation is taking place. - * @param groups - Optional validation groups to consider during validation. - * - * @returns A tuple containing `PrimitiveArrayDetailedErrors` and `PrimitiveArraySimpleErrors`. - * - * @remarks - * The method validates both the array as a whole (`root`) and each individual element (`data`) - * using the appropriate validation rules. - */ - test(value: any[], context: any, args: API.Decorator.DecoratorArgs): [ns.DetailedErrors, ns.SimpleErrors]; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveArrayStrategy/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveArrayStrategy/index.d.ts.map deleted file mode 100644 index 92a601c90..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveArrayStrategy/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/strategy/service/impl/PrimitiveArrayStrategy/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,iCAAiC,EAAE,MAAM,oDAAoD,CAAC;AACvG,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B;;;;;;GAMG;AACH,qBAAa,mBAAmB,CAAC,CAAC,CAAE,SAAQ,iCAAiC,CAC3E,CAAC,EACD,EAAE,CAAC,cAAc,EACjB,EAAE,CAAC,YAAY,CAChB;IACC;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,KAAK,EAAE,GAAG,EAAE,EACZ,OAAO,EAAE,GAAG,EACZ,IAAI,EAAE,GAAG,CAAC,SAAS,CAAC,aAAa,GAChC,CAAC,EAAE,CAAC,cAAc,EAAE,EAAE,CAAC,YAAY,CAAC;CAgBxC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveArrayStrategy/types.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveArrayStrategy/types.d.ts deleted file mode 100644 index 45f64a09e..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveArrayStrategy/types.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -import type API from "../../../../../index"; -/** - * Namespace for PrimitiveArray Strategy Types. - */ -declare namespace PrimitiveArrayStrategyType { - /** - * Constant name identifier for this strategy. - */ - const Name: "primitive[]"; - /** - * Represents the simplified error structure for validating arrays of primitive types. - * - * - `root`: An array of string messages that represent validation errors at the array level. - * - `data`: A two-dimensional array of string messages that represent validation errors for each element in the array. - */ - type SimpleErrors = { - root: string[]; - data: string[][]; - }; - /** - * Represents the detailed error structure for validating arrays of primitive types. - * - * - `root`: An array of `ValidationResult` objects that represent detailed validation errors at the array level. - * - `data`: A two-dimensional array of `ValidationResult` objects that represent detailed validation errors for each element in the array. - */ - type DetailedErrors = { - root: API.Validation.ValidationResult[]; - data: API.Validation.ValidationResult[][]; - }; - /** - * Type guard to check if a certain field in a type matches this strategy. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - */ - type matches = API.Utilities.Arrays.getArrayType extends never ? false : API.Utilities.Booleans.isAnyOf, API.Utilities.Types.PrimitiveType>; - /** - * Type for the handler function based on the field and result types. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - * @typeParam R - The result type. - */ - type handler = true extends API.Utilities.Booleans.isUndefined ? T[K] : { - root: R; - data: R[]; - }; -} -export default PrimitiveArrayStrategyType; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveArrayStrategy/types.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveArrayStrategy/types.d.ts.map deleted file mode 100644 index 3dbf4eaf1..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveArrayStrategy/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../src/strategy/service/impl/PrimitiveArrayStrategy/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,sBAAsB,CAAC;AAE5C;;GAEG;AACH,kBAAU,0BAA0B,CAAC;IACnC;;OAEG;IACI,MAAM,IAAI,eAAyB,CAAC;IAE3C;;;;;OAKG;IACH,KAAY,YAAY,GAAG;QACzB,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC;KAClB,CAAC;IAEF;;;;;OAKG;IACH,KAAY,cAAc,GAAG;QAC3B,IAAI,EAAE,GAAG,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC;QACxC,IAAI,EAAE,GAAG,CAAC,UAAU,CAAC,gBAAgB,EAAE,EAAE,CAAC;KAC3C,CAAC;IAEF;;;;OAIG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IACxC,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,KAAK,GAC/C,KAAK,GACT,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;IAE5G;;;;;OAKG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,IACzC,IAAI,SAAS,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,GAC9C,CAAC,CAAC,CAAC,CAAC,GACR;QAAE,IAAI,EAAE,CAAC,CAAC;QAAC,IAAI,EAAE,CAAC,EAAE,CAAC;KAAE,CAAC;CAC3B;AAED,eAAe,0BAA0B,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveGetterStrategy/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveGetterStrategy/index.d.ts deleted file mode 100644 index 25152543e..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveGetterStrategy/index.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import type API from "../../../../index"; -import { AbstractValidationStrategyService } from "../../../service/AbstractValidationStrategyService"; -import type ns from "./types"; -/** - * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating getter primitive types like numbers, strings, etc. - * - * @typeParam F - The type of the field being validated. - * - * @extends AbstractValidationStrategyService - */ -export declare class PrimitiveGetterStrat extends AbstractValidationStrategyService { - /** - * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for primitive types by invoking the root rule's `validate` method and then building simplified error messages. - * - * @param value - The value to be validated. - * @param context - The context in which the validation is taking place. - * - * @returns A tuple containing an array of detailed validation results (`ValidationResult[]`) and an array of simplified error messages (`string[]`). - */ - test(value: any, context: any, args: API.Decorator.DecoratorArgs): [ns.DetailedErrors, ns.SimpleErrors]; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveGetterStrategy/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveGetterStrategy/index.d.ts.map deleted file mode 100644 index cf3ccc4c7..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveGetterStrategy/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/strategy/service/impl/PrimitiveGetterStrategy/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,iCAAiC,EAAE,MAAM,oDAAoD,CAAC;AACvG,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B;;;;;;GAMG;AACH,qBAAa,oBAAoB,CAAC,CAAC,CAAE,SAAQ,iCAAiC,CAC5E,CAAC,EACD,EAAE,CAAC,cAAc,EACjB,EAAE,CAAC,YAAY,CAChB;IACC;;;;;;;OAOG;IACH,IAAI,CACF,KAAK,EAAE,GAAG,EACV,OAAO,EAAE,GAAG,EACZ,IAAI,EAAE,GAAG,CAAC,SAAS,CAAC,aAAa,GAChC,CAAC,EAAE,CAAC,cAAc,EAAE,EAAE,CAAC,YAAY,CAAC;CAIxC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveGetterStrategy/types.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveGetterStrategy/types.d.ts deleted file mode 100644 index 8fea3e3d7..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveGetterStrategy/types.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type API from "../../../../../index"; -/** - * Namespace for PrimitiveGetter Strategy Types. - */ -declare namespace PrimitiveGetterStrategyType { - /** - * Constant name identifier for this strategy. - */ - const Name: "get (): primitive"; - /** - * Represents the simplified error structure for validating getter methods that return primitive types. - */ - type SimpleErrors = string[]; - /** - * Represents the detailed error structure for validating getter methods that return primitive types. - */ - type DetailedErrors = API.Validation.ValidationResult[]; - /** - * Type guard to check if a certain field in a type matches this strategy. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - */ - type matches = true extends API.Utilities.Booleans.isGetter ? API.Utilities.Booleans.isAnyOf : false; - /** - * Type for the handler function based on the field and result types. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - * @typeParam R - The result type. - */ - type handler = true extends API.Utilities.Booleans.isUndefined ? T[K] : R; -} -export default PrimitiveGetterStrategyType; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveGetterStrategy/types.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveGetterStrategy/types.d.ts.map deleted file mode 100644 index a0834fa77..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveGetterStrategy/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../src/strategy/service/impl/PrimitiveGetterStrategy/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,sBAAsB,CAAC;AAG5C;;GAEG;AACH,kBAAU,2BAA2B,CAAC;IACpC;;OAEG;IACI,MAAM,IAAI,qBAAmD,CAAC;IAErE;;OAEG;IACH,KAAY,YAAY,GAAG,MAAM,EAAE,CAAC;IAEpC;;OAEG;IACH,KAAY,cAAc,GAAG,GAAG,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC;IAE/D;;;;OAIG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IACtC,IAAI,SAAS,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,GAC9C,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,aAAa,CAAC,GACvE,KAAK,CAAC;IAEZ;;;;;OAKG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,IACzC,IAAI,SAAS,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,GAC9C,CAAC,CAAC,CAAC,CAAC,GACR,CAAC,CAAC;CACL;AAED,eAAe,2BAA2B,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveStrategy/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveStrategy/index.d.ts deleted file mode 100644 index eae10bf04..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveStrategy/index.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type API from "../../../../index"; -import { AbstractValidationStrategyService } from "../../../service/AbstractValidationStrategyService"; -import type ns from "./types"; -/** - * Extends the abstract `ValidationStrategy` class to provide a concrete implementation for validating primitive types like numbers, strings, etc. - * - * @typeParam F - The type of the field being validated. - * - * @extends AbstractValidationStrategyService - */ -export declare class PrimitiveStrat extends AbstractValidationStrategyService { - /** - * Implements the `test` method from the `ValidationStrategy` abstract class. It performs the actual validation logic for primitive types by invoking the root rule's `validate` method and then building simplified error messages. - * - * @param value - The value to be validated. - * @param context - The context in which the validation is taking place. - * @param groups - Optional validation groups to consider during validation. - * - * @returns A tuple containing an array of detailed validation results (`ValidationResult[]`) and an array of simplified error messages (`string[]`). - */ - test(value: any, context: any, args: API.Decorator.DecoratorArgs): [ns.DetailedErrors, ns.SimpleErrors]; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveStrategy/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveStrategy/index.d.ts.map deleted file mode 100644 index 4c079c059..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveStrategy/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/strategy/service/impl/PrimitiveStrategy/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,iCAAiC,EAAE,MAAM,oDAAoD,CAAC;AACvG,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B;;;;;;GAMG;AACH,qBAAa,cAAc,CAAC,CAAC,CAAE,SAAQ,iCAAiC,CACtE,CAAC,EACD,EAAE,CAAC,cAAc,EACjB,EAAE,CAAC,YAAY,CAChB;IACC;;;;;;;;OAQG;IACH,IAAI,CACF,KAAK,EAAE,GAAG,EACV,OAAO,EAAE,GAAG,EACZ,IAAI,EAAE,GAAG,CAAC,SAAS,CAAC,aAAa,GAChC,CAAC,EAAE,CAAC,cAAc,EAAE,EAAE,CAAC,YAAY,CAAC;CAIxC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveStrategy/types.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveStrategy/types.d.ts deleted file mode 100644 index 4e8412d06..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveStrategy/types.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type API from "../../../../../index"; -/** - * Namespace for Primitive Strategy Types. - */ -declare namespace PrimitiveStrategyType { - /** - * Constant name identifier for this strategy. - */ - const Name: "primitive"; - /** - * Represents the simplified error structure for validating primitive types. - */ - type SimpleErrors = string[]; - /** - * Represents the detailed error structure for validating primitive types. - */ - type DetailedErrors = API.Validation.ValidationResult[]; - /** - * Type guard to check if a certain field in a type matches this strategy. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - */ - type matches = API.Utilities.Booleans.isAnyOf; - /** - * Type for the handler function based on the field and result types. - * @typeParam T - The type containing the field. - * @typeParam K - The key of the field. - * @typeParam R - The result type. - */ - type handler = true extends API.Utilities.Booleans.isUndefined ? T[K] : R; -} -export default PrimitiveStrategyType; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveStrategy/types.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveStrategy/types.d.ts.map deleted file mode 100644 index 3f6fd0c55..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/PrimitiveStrategy/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../src/strategy/service/impl/PrimitiveStrategy/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,sBAAsB,CAAC;AAE5C;;GAEG;AACH,kBAAU,qBAAqB,CAAC;IAC9B;;OAEG;IACI,MAAM,IAAI,aAAuB,CAAC;IAEzC;;OAEG;IACH,KAAY,YAAY,GAAG,MAAM,EAAE,CAAC;IAEpC;;OAEG;IACH,KAAY,cAAc,GAAG,GAAG,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC;IAE/D;;;;OAIG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IAEpH;;;;;OAKG;IAEH,KAAY,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,IACzC,IAAI,SAAS,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,GAC9C,CAAC,CAAC,CAAC,CAAC,GACR,CAAC,CAAC;CACL;AAED,eAAe,qBAAqB,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/index.d.ts.map deleted file mode 100644 index 0c2ff7635..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/impl/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/strategy/service/impl/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/index.d.ts.map deleted file mode 100644 index 4a8693e43..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/strategy/service/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/strategy/service/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC;AACpD,cAAc,QAAQ,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/impl/Arrays.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/impl/Arrays.d.ts deleted file mode 100644 index bb1c8496d..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/impl/Arrays.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type * as Booleans from "./Booleans"; -/** - * Returns depth of provided generic array (example: getArrayDepth returns 2). - * @remarks Due to TypeScript's compiler - evaluation is limited to the depth of 5. - */ -export type getArrayDepth = T extends any[] ? T[0] extends any[] ? T[0][0] extends any[] ? T[0][0][0] extends any[] ? T[0][0][0][0] extends any[] ? 5 : 4 : 3 : 2 : 1 : 0; -/** - * Returns an array type constructed of `N` depth. - */ -export type setArrayDepth = R["length"] extends N ? T : setArrayDepth; -/** - * A type that extracts the element type of an array type `T`. - * - * @typeParam T - The type to extract the array type from. - */ -export type getArrayType = T extends Array ? true extends Booleans.isArray ? getArrayType : U : never; -//# sourceMappingURL=Arrays.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/impl/Arrays.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/impl/Arrays.d.ts.map deleted file mode 100644 index 54d016e8e..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/impl/Arrays.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Arrays.d.ts","sourceRoot":"","sources":["../../../../../src/utilities/impl/Arrays.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,QAAQ,MAAM,YAAY,CAAC;AAE5C;;;GAGG;AAEH,MAAM,MAAM,aAAa,CAAC,CAAC,IACvB,CAAC,SAAS,GAAG,EAAE,GACX,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,EAAE,GAChB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,EAAE,GACnB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,EAAE,GACtB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,EAAE,GACzB,CAAC,GACD,CAAC,GACH,CAAC,GACH,CAAC,GACH,CAAC,GACH,CAAC,CAAC;AAEV;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,GACxF,CAAC,GACD,aAAa,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;AAErC;;;;GAIG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GAClD,IAAI,SAAS,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,GAC9B,YAAY,CAAC,CAAC,CAAC,GACf,CAAC,GACH,KAAK,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/impl/Booleans.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/impl/Booleans.d.ts deleted file mode 100644 index ec33f653e..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/impl/Booleans.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -import type API from "../../../index"; -import type * as Arrays from "./Arrays"; -import type * as Objects from "./Objects"; -import type * as Types from "./Types"; -/** - * Checks if `TCheck` is any of the types in `TData`. - * - * @typeParam TCheck - The type to check. - * @typeParam TData - The array type to check against. - */ -export type isAnyOf = NonNullable extends TData[number] ? true : false; -/** - * Checks if `T` is an object type. - * - * @typeParam T - The type to check. - */ -export type isObject = NonNullable extends isFunction ? false : NonNullable extends isArray ? false : NonNullable extends isPrimitive ? false : true; -/** - * Checks if `T` is a function type. - * - * @typeParam T - The type to check. - */ -export type isFunction = NonNullable extends Types.FunctionType ? Types.UnwrapPromise>> extends API.Validation.ValidationResult ? true : false : false; -/** - * Checks if `T[K]` is a getter type. - * - * @typeParam T - The parent type to check. - * @typeParam T - The key of parent to check. - */ -export type isGetter = K extends Objects.Inputs ? false : true; -/** - * Checks if `T` is an array type. - * - * @typeParam T - The type to check. - */ -export type isArray = NonNullable extends Types.ArrayType ? true : false; -/** - * Checks if `T` is a primitive type. - * - * @typeParam T - The type to check. - */ -export type isPrimitive = isAnyOf; -/** - * Checks if `T` is an array of primitive types. - * - * @typeParam T - The type to check. - */ -export type isPrimitiveArray = Arrays.getArrayType extends never ? false : isPrimitive>; -/** - * Checks if `T` is an array of object types. - * - * @typeParam T - The type to check. - */ -export type isObjectArray = Arrays.getArrayType extends never ? false : isObject>; -/** - * Checks if `T` is `undefined`. - * - * @typeParam T - The type to check. - */ -export type isUndefined = T extends undefined ? true : false; -//# sourceMappingURL=Booleans.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/impl/Booleans.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/impl/Booleans.d.ts.map deleted file mode 100644 index 0e29ac034..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/impl/Booleans.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Booleans.d.ts","sourceRoot":"","sources":["../../../../../src/utilities/impl/Booleans.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AAEtC,OAAO,KAAK,KAAK,MAAM,MAAM,UAAU,CAAC;AACxC,OAAO,KAAK,KAAK,OAAO,MAAM,WAAW,CAAC;AAC1C,OAAO,KAAK,KAAK,KAAK,MAAM,SAAS,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,MAAM,OAAO,CACjB,MAAM,EACN,KAAK,SAAS,KAAK,CAAC,SAAS,IAC3B,WAAW,CAAC,MAAM,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;AAE7D;;;;GAIG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,GAC1D,KAAK,GACL,WAAW,CAAC,CAAC,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,GACjC,KAAK,GACL,WAAW,CAAC,CAAC,CAAC,SAAS,WAAW,CAAC,CAAC,CAAC,GACrC,KAAK,GACL,IAAI,CAAC;AAET;;;;GAIG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,SAAS,KAAK,CAAC,YAAY,GACjE,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,CAAC,UAAU,CAAC,gBAAgB,GACrF,IAAI,GACJ,KAAK,GACP,KAAK,CAAC;AAEV;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC;AAExF;;;;GAIG;AACH,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,SAAS,KAAK,CAAC,SAAS,GAAG,IAAI,GAAG,KAAK,CAAC;AAE/E;;;;GAIG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;AAE7D;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,KAAK,GAClE,KAAK,GACL,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;AAExC;;;;GAIG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,KAAK,GAC/D,KAAK,GACL,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;AAErC;;;;GAIG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,IAAI,GAAG,KAAK,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/impl/Objects.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/impl/Objects.d.ts deleted file mode 100644 index d58fc6307..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/impl/Objects.d.ts +++ /dev/null @@ -1,105 +0,0 @@ -import API from "../../index"; -import type * as Arrays from "./Arrays"; -import type * as Booleans from "./Booleans"; -import type * as Types from "./Types"; -/** - * A type that represents an optional value. - * - * @typeParam T - The type of the optional value. - */ -export type Optional = T extends undefined ? any : T | undefined | null; -/** - * A predicate function for filtering arrays. - * - * @typeParam T - The type of the array elements. - */ -export type ArrayPredicate = ((value: T, index: number, array: T[]) => boolean) & {}; -/** - * Filters out getters, functions and read-only properties from a type - */ -export type Payload = Types.Prettify, - Booleans.isFunction - ]> ? never : true extends Booleans.isArray ? true extends Booleans.isPrimitive> ? T[K] : Arrays.setArrayDepth>, Arrays.getArrayDepth> : true extends Booleans.isPrimitive ? T[K] : Payload; -}>>; -/** - * A conditional type that checks if types `X` and `Y` are equal. It returns type `A` if they are equal, and type `B` if they are not. - * - * @typeParam X - The first type. - * @typeParam Y - The second type. - * @typeParam A - The type to return if `X` and `Y` are equal. - * @typeParam B - The type to return if `X` and `Y` are not equal. - */ -export type IfEquals = (() => T extends X ? 1 : 2) extends () => T extends Y ? 1 : 2 ? A : B; -/** - * A type that excludes properties with values of type `TExclude` from `TParent`. - * - * @typeParam TParent - The parent type. - * @typeParam TExclude - The type to exclude from `TParent`. - */ -export type Exclude = Pick>; -/** - * A type that removes properties with values of type `never` from `T`. - * - * @typeParam T - The type to purify. - */ -export type Purify = Exclude; -/** - * A type that extracts the values from the properties of an object type `T`. - * - * @typeParam T - An object type. - */ -export type Values = T[keyof T]; -/** - * A type that extracts input properties from an object type `T`. - * - * @typeParam T - The object type. - */ -export type Inputs = { - [P in keyof T]-?: IfEquals<{ - [Q in P]: T[P]; - }, { - -readonly [Q in P]: T[P]; - }, P>; -}[keyof T]; -/** - * Removes duplicate elements from an array while preserving order. - * - * @typeParam T - The type of the elements in the array. - */ -export declare function unique(data: T[]): T[]; -/** - * Checks if an error object has errors. - * - * @typeParam T - The type of the errors. - */ -export declare function hasErrors(data: API.Strategy.Impl.Errors): boolean; -/** - * Recursively checks if two values are deep equal. - */ -export declare function deepEquals(val1: any, val2: any): boolean; -/** - * Hashes a value of any type and returns a number. - */ -export declare function hash(val: any): number; -/** - * Transforms a plain object into an instance of the given class. - * @param clazz - The class to transform the object into. - * @param object - The object to transform. - * @typeParam TClass - The type of the class. - * @returns An instance of TClass. - */ -export declare function toClass>(clazz: TClass, object?: Payload>): Types.UnwrapClass; -/** - * Debounces a function. - * @param fn - The function to debounce. - * @param delay - The delay time in milliseconds. - * @returns A debounced function. - */ -export declare function debounce(fn: Function, delay: number): Function; -export type FieldType = "date" | "array" | "string" | "number" | "boolean" | "object"; -export declare function assertType(type: FieldType, value: any): void | never; -//# sourceMappingURL=Objects.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/impl/Objects.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/impl/Objects.d.ts.map deleted file mode 100644 index 5e9f1d2e5..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/impl/Objects.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Objects.d.ts","sourceRoot":"","sources":["../../../../../src/utilities/impl/Objects.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAC;AAG9B,OAAO,KAAK,KAAK,MAAM,MAAM,UAAU,CAAC;AACxC,OAAO,KAAK,KAAK,QAAQ,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,KAAK,KAAK,MAAM,SAAS,CAAC;AAEtC;;;;GAIG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,GAAG,SAAS,IAAI,CAAC,SAAS,SAAS,GAAG,GAAG,GAAG,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC;AAEvF;;;;GAIG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,OAAO,CAAC,GAAG,EAAE,CAAC;AAExF;;GAEG;AAEH,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC;KAChE,CAAC,IAAI,MAAM,CAAC,GAAG,IAAI,SAAS,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE;QAClD,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;QACvB,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAC1B,CAAC,GACE,KAAK,GACL,IAAI,SAAS,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACjC,IAAI,SAAS,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAC1D,CAAC,CAAC,CAAC,CAAC,GACJ,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACtF,IAAI,SAAS,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACrC,CAAC,CAAC,CAAC,CAAC,GACJ,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACtB,CAAC,CAAC,CAAC;AAEN;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,SAAS,CACpF,CAAC,OACI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,GACtB,CAAC,GACD,CAAC,CAAC;AAEN;;;;;GAKG;AACH,MAAM,MAAM,OAAO,CAAC,OAAO,EAAE,QAAQ,IAAI,IAAI,CAC3C,OAAO,EACP,MAAM,CAAC;KACJ,IAAI,IAAI,MAAM,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,KAAK,GAAG,IAAI;CAC3E,CAAC,CACH,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AAE1C;;;;GAIG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAEnC;;;;GAIG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI;KACrB,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC;SAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;KAAE,EAAE;QAAE,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;KAAE,EAAE,CAAC,CAAC;CAChF,CAAC,MAAM,CAAC,CAAC,CAAC;AAEX;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAExC;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,OAAO,CAUvE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CA8BxD;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CA2ErC;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,KAAK,CAAC,MAAM,SAAS,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAC3D,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,GAC1C,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CA+B3B;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,QAAQ,CAQ9D;AAED,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEtF,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI,GAAG,KAAK,CAepE"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/impl/Strings.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/impl/Strings.d.ts deleted file mode 100644 index 661da7611..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/impl/Strings.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Formats a string by replacing placeholders with provided arguments. - * - * @param str - The string containing placeholders in the form of `{0}`, `{1}`, etc. - * @param args - The values to replace the placeholders with. - * @returns The formatted string with placeholders replaced by the corresponding values from `args`. - * - * @example - * ```typescript - * const formatted = sprintf("Hello, {0}!", "World"); // Output: "Hello, World!" - * ``` - * - * @remarks - * If a placeholder's corresponding value is not provided in `args`, the placeholder will remain unchanged in the output string. - */ -export declare function sprintf(str: string, ...args: any[]): string; -//# sourceMappingURL=Strings.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/impl/Strings.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/impl/Strings.d.ts.map deleted file mode 100644 index 4994d4663..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/impl/Strings.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Strings.d.ts","sourceRoot":"","sources":["../../../../../src/utilities/impl/Strings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,MAAM,CAI3D"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/impl/Types.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/impl/Types.d.ts deleted file mode 100644 index fd34a18c2..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/impl/Types.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -import type API from "../../../index"; -import { type PrimitiveSet } from "../../../index"; -/** - * Represents the JavaScript `Function` type. - */ -export type FunctionType = (() => any) & {}; -/** - * Represents the generic array type. - */ -export type ArrayType = any[]; -/** - * Represents primitive data types including `string`, `number`, `boolean`, - * `bigint`, `Date`, and custom primitives defined in `PrimitiveSetAppend`. - */ -export type PrimitiveType = [ - ...[string, number, boolean, bigint, Date], - ...(PrimitiveSet extends { - values: infer CustomPrimitives extends readonly unknown[]; - } ? CustomPrimitives : []) -]; -/** - * Represents a class constructor that can create instances of type `T`. - * - * @typeParam T - The type to be instantiated by the class constructor. - * - * @example - * ```typescript - * class MyClass { - * constructor(arg1: string, arg2: number) { - * // ... - * } - * } - * - * const myClassConstructor: Class = MyClass; - * const instance = new myClassConstructor('hello', 42); - * // Creates an instance of MyClass - * ``` - */ -export type Class = (new (...args: any[]) => T) & {}; -/** - * Unwraps a Promise type to its resolved value type. - * @typeParam T - The type to unwrap. - */ -export type UnwrapPromise = T extends Promise ? U : T; -/** - * Unwraps a Class type to its instance type. - * @typeParam T - The type to unwrap. - */ -export type UnwrapClass = T extends Class ? U : never; -/** - * Unwraps a MetaStrategy type to its inferred class. - * @typeParam TStrategy - The MetaStrategy type to unwrap. - */ -export type UnwrapMetaStrategy = TStrategy extends Class ? TInferredClass : any; -/** - * Prettifies a type by retaining the same shape. - * @typeParam T - The type to prettify. - */ -export type Prettify = { - [K in keyof T]: T[K]; -} & {}; -//# sourceMappingURL=Types.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/impl/Types.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/impl/Types.d.ts.map deleted file mode 100644 index 21c624f36..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/impl/Types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Types.d.ts","sourceRoot":"","sources":["../../../../../src/utilities/impl/Types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,MAAM,GAAG,CAAC,GAAG,EAAE,CAAC;AAE5C;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC;AAE9B;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC;IAC1C,GAAG,CAAC,YAAY,SAAS;QACvB,MAAM,EAAE,MAAM,gBAAgB,SAAS,SAAS,OAAO,EAAE,CAAC;KAC3D,GACG,gBAAgB,GAChB,EAAE,CAAC;CACR,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,KAAK,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC;AAE7D;;;GAGG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAElE;;;GAGG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAElE;;;GAGG;AACH,MAAM,MAAM,kBAAkB,CAAC,SAAS,SAAS,GAAG,CAAC,UAAU,CAAC,YAAY,IAC1E,SAAS,SAAS,KAAK,CAAC,MAAM,cAAc,CAAC,GAAG,cAAc,GAAG,GAAG,CAAC;AAEvE;;;GAGG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI;KACvB,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACrB,GAAG,EAAE,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/index.d.ts deleted file mode 100644 index 48c503756..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * as Arrays from "./impl/Arrays"; -export * as Booleans from "./impl/Booleans"; -export * as Objects from "./impl/Objects"; -export * as Strings from "./impl/Strings"; -export * as Types from "./impl/Types"; -export * from "./misc/EventEmitter"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/index.d.ts.map deleted file mode 100644 index caad5be52..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utilities/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,cAAc,qBAAqB,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/misc/EventEmitter.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/misc/EventEmitter.d.ts.map deleted file mode 100644 index 82bc7c628..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/utilities/misc/EventEmitter.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"EventEmitter.d.ts","sourceRoot":"","sources":["../../../../../src/utilities/misc/EventEmitter.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC;;GAEG;AACH,qBAAa,YAAY;;IAEvB,OAAc,KAAK,oCAA6B;IAChD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA2C;IAClE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA8B;IAE9D,IAAI,EAAE,WAEL;gBAEW,EAAE,EAAE,MAAM;IAMtB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI;IAkBrC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI;IAMtD,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI;CAoBxD"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/validation/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/validation/index.d.ts.map deleted file mode 100644 index ecd87c398..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/validation/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/validation/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAIhC,cAAc,UAAU,CAAC;AAEzB;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,CAAC,CACpC,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,GAAG,EACZ,MAAM,EAAE,GAAG,CAAC,YAAY,CAAC,MAAM,EAC/B,IAAI,EAAE,GAAG,CAAC,SAAS,CAAC,aAAa,KAC9B,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,GAAG,EAAE,CAAC;AAExD;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,CAAC,CAAC,IAAI;IACvC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC;CAClC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,uBAAuB,CAAC,MAAM,IAAI;IAC5C,MAAM,EAAE,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACzC,cAAc,EAAE,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IACzD,YAAY,EAAE,GAAG,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC;CACjD,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,sBAAsB,CAAC,MAAM,IAAI;IAC3C,GAAG,EAAE,MAAM,MAAM,CAAC;IAClB,KAAK,EAAE,gBAAgB,CAAC;CACzB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,iBAAiB,CAAC,MAAM,IAAI,CAAC,CAAC,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,GAAG,EAAE,CAAC;AAE9F;;;;GAIG;AACH,MAAM,MAAM,UAAU,CAAC,MAAM,IAAI;IAC/B,YAAY,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACrD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI;IACpC,KAAK,EAAE,OAAO,CAAC;IACf,cAAc,EAAE,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IACpD,MAAM,EAAE,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACpC,YAAY,EAAE,GAAG,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC;CACjD,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/validation/models/Cache.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/validation/models/Cache.d.ts.map deleted file mode 100644 index a49b11d7d..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/validation/models/Cache.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Cache.d.ts","sourceRoot":"","sources":["../../../../../src/validation/models/Cache.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,qBAAa,KAAK,CAAC,UAAU,SAAS,MAAM,GAAG,EAAE,EAAE,OAAO,GAAG,GAAG;;IAK9D;;;;;OAKG;gBACS,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,UAAU,EAAE,YAAY,CAAC,EAAE,UAAU;IAM/E;;;;;;;;;OASG;IAEH,GAAG,CAAC,QAAQ,SAAS,MAAM,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,QAAQ,CAAC;IAMnG;;;;;;;OAOG;IACH,KAAK,CAAC,YAAY,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,UAAU;CA4BzE"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/validation/models/Events.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/validation/models/Events.d.ts.map deleted file mode 100644 index a3381f737..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/validation/models/Events.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Events.d.ts","sourceRoot":"","sources":["../../../../../src/validation/models/Events.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;CAET,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/validation/models/Form.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/validation/models/Form.d.ts.map deleted file mode 100644 index 7a793fc26..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/validation/models/Form.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../../../src/validation/models/Form.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAC;AAM9B;;;;;;;;;GASG;AACH,qBAAa,IAAI,CAAC,MAAM;;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC;IAehC,IAAW,KAAK;;;;MAMf;IAED;;OAEG;IACH,IAAW,YAAY,IAAI,GAAG,CAE7B;IAED;;;;;OAKG;gBAED,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,EACxC,MAAM,CAAC,EAAE,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC;IAsB5C;;;;;;OAMG;IACI,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO;IAIvE;;;;;;OAMG;IACI,iBAAiB,CACtB,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,GAC9C,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC;IAI3C;;;;;;OAMG;IACI,SAAS,CACd,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,GAC9C,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;IAI5B,eAAe,CACpB,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,GAC9C,GAAG,CAAC,UAAU,CAAC,gBAAgB,EAAE;IAIpC;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACI,QAAQ,CACb,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAC/C,IAAI,GAAE,GAAG,CAAC,SAAS,CAAC,aAAkB,GACrC,GAAG,CAAC,UAAU,CAAC,oBAAoB,CAAC,MAAM,CAAC;IAqC9C;;;;OAIG;IACI,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI;IAIlE;;;;OAIG;IACI,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG;CAgHtC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/validation/models/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/validation/models/index.d.ts.map deleted file mode 100644 index a5bf7a8c9..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-core/dist/types/src/validation/models/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/validation/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-core/package.json b/packages/react/examples/basic-example-form/libs/tdv-core/package.json index dbb2f4e29..7e89bc243 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-core/package.json +++ b/packages/react/examples/basic-example-form/libs/tdv-core/package.json @@ -1,6 +1,6 @@ { "name": "tdv-core", - "version": "1.7.1", + "version": "1.9.0", "description": "Typescript form validation using Decorators", "main": "dist/index.js", "types": "dist/types/index.d.ts", @@ -10,9 +10,10 @@ "license": "MIT", "private": false, "scripts": { + "lint": "echo \"No linting configured\"", "clean": "rm -rf dist", "build": "npm run clean && npm run test && tsc", - "build:noTest": "npm run clean && tsc", + "build:noTest": "npm run clean && tsc && npx tsc-alias", "deploy:minor": "bash ../../scripts/deploy.sh core minor", "deploy:major": "bash ../../scripts/deploy.sh core major", "deploy:patch": "bash ../../scripts/deploy.sh core patch", @@ -43,9 +44,11 @@ "@types/react": "^18.0.26", "@types/react-dom": "^18.0.10", "auto-i18n": "^1.0.0", + "eslint-plugin-import": "^2.29.1", "esm": "^3.2.25", "jest": "^29.5.0", "ts-jest": "^29.1.0", - "ts-node": "^10.9.1" + "ts-node": "^10.9.1", + "tsc-alias": "^1.8.8" } } diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-react/dist/index.d.ts similarity index 88% rename from packages/react/examples/basic-example-form/libs/tdv-react/dist/types/index.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-react/dist/index.d.ts index 626e8b800..abf120bcc 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/index.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-react/dist/index.d.ts @@ -1,4 +1,3 @@ -import TdvCoreApi from "tdv-core"; import FormProvider from "./src/contexts/FormContext"; import FormContextNamespace from "./src/contexts/FormContext/types"; import useForm from "./src/hooks/useForm"; @@ -18,5 +17,5 @@ export declare namespace Hooks { export import UseForm = UseFormNamespace; export import UseValidation = UseValidationNamespace; } -export { FormProvider, TdvCoreApi, useForm, useValidation }; +export { FormProvider, useForm, useValidation }; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-react/dist/index.d.ts.map new file mode 100644 index 000000000..ade5c0d2e --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-react/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,oBAAoB,MAAM,kCAAkC,CAAC;AACpE,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAC1C,OAAO,gBAAgB,MAAM,2BAA2B,CAAC;AACzD,OAAO,aAAa,MAAM,2BAA2B,CAAC;AACtD,OAAO,sBAAsB,MAAM,iCAAiC,CAAC;AAErE;;GAEG;AACH,yBAAiB,QAAQ,CAAC;IACxB,MAAM,QAAQ,YAAY,GAAG,oBAAoB,CAAC;CACnD;AAED;;GAEG;AACH,yBAAiB,KAAK,CAAC;IACrB,MAAM,QAAQ,OAAO,GAAG,gBAAgB,CAAC;IAEzC,MAAM,QAAQ,aAAa,GAAG,sBAAsB,CAAC;CACtD;AAED,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/index.js b/packages/react/examples/basic-example-form/libs/tdv-react/dist/index.js index 30e4ec2ef..9e30df6d9 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-react/dist/index.js +++ b/packages/react/examples/basic-example-form/libs/tdv-react/dist/index.js @@ -1,4 +1,4 @@ -import TdvCoreApi from "tdv-core"; +//import * as TdvCoreApi from "tdv-core"; import FormProvider from "./src/contexts/FormContext"; import useForm from "./src/hooks/useForm"; import useValidation from "./src/hooks/useValidation"; @@ -14,4 +14,4 @@ export var Contexts; export var Hooks; (function (Hooks) { })(Hooks || (Hooks = {})); -export { FormProvider, TdvCoreApi, useForm, useValidation }; +export { FormProvider, useForm, useValidation }; diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/contexts/FormContext/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/contexts/FormContext/index.d.ts similarity index 100% rename from packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/contexts/FormContext/index.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-react/dist/src/contexts/FormContext/index.d.ts diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/contexts/FormContext/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/contexts/FormContext/index.d.ts.map new file mode 100644 index 000000000..ce78c2184 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/contexts/FormContext/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/contexts/FormContext/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB,KAAK,eAAe,GAAG,IAAI,CAAC,EAAE,CAAC,iBAAiB,EAAE,UAAU,CAAC,GAAG,SAAS,CAAC;AAE1E,eAAO,MAAM,WAAW,gCAA4C,CAAC;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,mBAAmB,GACpB,EAAE,EAAE,CAAC,iBAAiB,qBAMtB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/contexts/FormContext/types.d.ts b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/contexts/FormContext/types.d.ts similarity index 100% rename from packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/contexts/FormContext/types.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-react/dist/src/contexts/FormContext/types.d.ts diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/contexts/FormContext/types.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/contexts/FormContext/types.d.ts.map new file mode 100644 index 000000000..77be7cda7 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/contexts/FormContext/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/contexts/FormContext/types.ts"],"names":[],"mappings":";AAAA;;GAEG;AACH,kBAAU,WAAW,CAAC;IACpB;;OAEG;IACH,KAAY,iBAAiB,GAAG;QAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;QAC1B,SAAS,EAAE,OAAO,CAAC;QACnB,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;QACtC,mBAAmB,EAAE,OAAO,CAAC;KAC9B,CAAC;CACH;AAED,eAAe,WAAW,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/helpers/clearErrorsHelper.d.ts b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/helpers/clearErrorsHelper.d.ts similarity index 100% rename from packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/helpers/clearErrorsHelper.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-react/dist/src/helpers/clearErrorsHelper.d.ts diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/helpers/clearErrorsHelper.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/helpers/clearErrorsHelper.d.ts.map new file mode 100644 index 000000000..f6d908416 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/helpers/clearErrorsHelper.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"clearErrorsHelper.d.ts","sourceRoot":"","sources":["../../../src/helpers/clearErrorsHelper.ts"],"names":[],"mappings":"AAaA,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAgB1E"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useAfterMount/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useAfterMount/index.d.ts similarity index 100% rename from packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useAfterMount/index.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useAfterMount/index.d.ts diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useAfterMount/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useAfterMount/index.d.ts.map new file mode 100644 index 000000000..1837e8a6c --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useAfterMount/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useAfterMount/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAC1C,EAAE,EAAE,MAAM,IAAI,EACd,IAAI,GAAE,EAAE,CAAC,yBAA8B,GACtC,IAAI,CAYN"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useAfterMount/types.d.ts b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useAfterMount/types.d.ts similarity index 100% rename from packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useAfterMount/types.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useAfterMount/types.d.ts diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useAfterMount/types.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useAfterMount/types.d.ts.map new file mode 100644 index 000000000..255679d82 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useAfterMount/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useAfterMount/types.ts"],"names":[],"mappings":"AAAA,kBAAU,iBAAiB,CAAC;IAC1B,KAAY,yBAAyB,GAAG,GAAG,EAAE,CAAC;CAC/C;AAED,eAAe,iBAAiB,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useForm/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useForm/index.d.ts similarity index 96% rename from packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useForm/index.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useForm/index.d.ts index cdc3fd1bc..18ccb299e 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useForm/index.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useForm/index.d.ts @@ -1,4 +1,4 @@ -import TdvCore from "tdv-core"; +import * as TdvCore from "tdv-core"; import ns from "./types"; /** * React hook which exposes useful form and validation-related props to a form component diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useForm/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useForm/index.d.ts.map new file mode 100644 index 000000000..846d75dad --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useForm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useForm/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,OAAO,MAAM,UAAU,CAAC;AAMpC,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,MAAM,EACpC,KAAK,EAAE,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,EAC5C,EACE,YAAY,EACZ,QAAQ,EAAE,aAAa,EACvB,sBAAsB,EACtB,UAAU,EACV,mBAAmB,EACnB,gBAAgB,EAAE,MAAM,EACxB,oBAAoB,EACpB,QAAQ,EACR,UAAU,EACV,MAAM,GACP,GAAE,EAAE,CAAC,aAAa,CAAC,MAAM,CAMzB,GACA,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,CAiF1B"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useForm/types.d.ts b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useForm/types.d.ts similarity index 90% rename from packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useForm/types.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useForm/types.d.ts index c82214e2f..fd7cad96f 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useForm/types.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useForm/types.d.ts @@ -1,6 +1,6 @@ import { type Dispatch, type SetStateAction } from "react"; +import type * as TdvCore from "tdv-core"; import { type ValidationResult } from "tdv-core"; -import type TdvCore from "tdv-core"; import type FormContextNamespace from "../../contexts/FormContext/types"; /** * A namespace containing all types related to the `useForm` hook. @@ -14,9 +14,9 @@ declare namespace UseFormHook { validationGroups?: string[]; validateImmediately?: boolean; standalone?: boolean; - resolveDecoratorArgs?: () => TdvCore.Decorator.DecoratorArgs; + resolveDecoratorArgs?: () => TdvCore.Decorators.DecoratorArgs; onSubmit?: () => Promise | void; - onSubmitValidationFail?: (errors: TdvCore.Strategy.Impl.Errors) => void; + onSubmitValidationFail?: (errors: TdvCore.Strategy.SimpleErrorsResponse) => void; onChange?: (value: TdvCore.Utilities.Objects.Payload) => void; asyncDelay?: number; locale?: TdvCore.Localization.Locale; @@ -31,8 +31,8 @@ declare namespace UseFormHook { mutations: UseFormChangeHandlerMap>; providerProps: Omit; globalErrors: ValidationResult[]; - errors: TdvCore.Strategy.Impl.Errors; - detailedErrors: TdvCore.Strategy.Impl.DetailedErrors; + errors: TdvCore.Strategy.SimpleErrorsResponse; + detailedErrors: TdvCore.Strategy.DetailedErrorsResponse; reset: (...fieldPaths: Array>>) => void; }; /** diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useForm/types.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useForm/types.d.ts.map new file mode 100644 index 000000000..690e34541 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useForm/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useForm/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,KAAK,KAAK,OAAO,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,KAAK,oBAAoB,MAAM,kCAAkC,CAAC;AAEzE;;GAEG;AACH,kBAAU,WAAW,CAAC;IACpB;;OAEG;IACH,KAAY,aAAa,CAAC,MAAM,IAAI;QAClC,YAAY,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACzD,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;QAC5B,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,oBAAoB,CAAC,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC;QAC9D,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;QACtC,sBAAsB,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;QACzF,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;QACtE,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC;KACtC,CAAC;IAEF;;OAEG;IACH,KAAY,WAAW,CAAC,MAAM,IAAI;QAChC,OAAO,EAAE,OAAO,CAAC;QACjB,WAAW,EAAE,OAAO,CAAC;QACrB,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;QAC9B,SAAS,EAAE,uBAAuB,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;QAC9E,aAAa,EAAE,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC;QACxE,YAAY,EAAE,gBAAgB,EAAE,CAAC;QACjC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;QACtD,cAAc,EAAE,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC;QAChE,KAAK,EAAE,CAAC,GAAG,UAAU,EAAE,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;KACpG,CAAC;IAEF;;OAEG;IACH,KAAY,aAAa,CAAC,MAAM,IAAI,SAAS;QAC3C,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC;QACzC,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;QACnE,WAAW,CAAC,MAAM,CAAC;KACpB,CAAC;IAEF;;OAEG;IACH,KAAY,kBAAkB,CAAC,KAAK,EAAE,IAAI,SAAS,MAAM,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAErH;;OAEG;IACH,KAAY,eAAe,CAAC,KAAK,IAAI,CAAC,IAAI,SAAS,MAAM,KAAK,EAC5D,GAAG,EAAE,IAAI,EACT,KAAK,EAAE,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,KACnC,IAAI,CAAC;IAEV;;OAEG;IACH,KAAY,uBAAuB,CAAC,KAAK,IAAI;SAC1C,IAAI,IAAI,MAAM,KAAK,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI;KACpD,CAAC;IAEF;;OAEG;IACH,KAAY,mBAAmB,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,MAAM,CAAC,GACpE,CAAC,SAAS,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,GAC3C,CAAC,GAAG,GAAG,CAAC,IAAI,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GACpC,EAAE,GACJ,KAAK,CAAC;IAEV;;OAEG;IACH,KAAY,yBAAyB,CAAC,CAAC,IAAI;SACxC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,GAC9B,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GACtD,KAAK,GACL,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GACrD,CAAC,GACD,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GACtD,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,GACzB,CAAC,SAAS,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,GAC7C,CAAC,GACD,KAAK,GACP,KAAK;KACV,CAAC;IAEF;;OAEG;IACH,KAAY,gBAAgB,CAAC,CAAC,IAAI,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,IAAI,GACnF,EAAE,GACF,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,IAAI,GACnD,yBAAyB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,GACrC,EAAE,CAAC;CACR;AAED,eAAe,WAAW,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useMutations/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useMutations/index.d.ts similarity index 51% rename from packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useMutations/index.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useMutations/index.d.ts index 75665945c..f0c50c044 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useMutations/index.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useMutations/index.d.ts @@ -1,5 +1,5 @@ -import type TdvCore from "tdv-core"; +import { Utilities } from "tdv-core"; import type UseFormNamespace from "./../useForm/types"; import type ns from "./types"; -export default function useMutations(clazz: TdvCore.Utilities.Types.Class, { setForm }: ns.UseMutationsConfig): UseFormNamespace.UseFormChangeHandlerMap; +export default function useMutations(clazz: Utilities.Types.Class, { setForm }: ns.UseMutationsConfig): UseFormNamespace.UseFormChangeHandlerMap; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useMutations/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useMutations/index.d.ts.map new file mode 100644 index 000000000..ecacf2d72 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useMutations/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useMutations/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,KAAK,gBAAgB,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,MAAM,EAAE,KAAK,GAAG,MAAM,EACzD,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,EACpC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,kBAAkB,CAAC,KAAK,CAAC,GACxC,gBAAgB,CAAC,uBAAuB,CAAC,KAAK,CAAC,CA6BjD"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useMutations/index.js b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useMutations/index.js index 2e40e3a06..0717e0ec8 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useMutations/index.js +++ b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useMutations/index.js @@ -1,15 +1,14 @@ import { useMemo } from "react"; -import { Reflection } from "tdv-core"; +import { Utilities } from "tdv-core"; export default function useMutations(clazz, { setForm }) { - const fields = useMemo(() => Reflection.getClassFieldNames(clazz), []); + const fields = useMemo(() => Utilities.Classes.getClassFieldNames(clazz), []); const handleChange = (key, value) => { - setForm((prev) => { + setForm(prev => { const obj = {}; for (const prop of fields) { obj[prop] = prev[prop]; } - obj[key] = - typeof value === "function" ? value(prev[key]) : value; + obj[key] = typeof value === "function" ? value(prev[key]) : value; return obj; }); }; diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useMutations/types.d.ts b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useMutations/types.d.ts similarity index 100% rename from packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useMutations/types.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useMutations/types.d.ts diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useMutations/types.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useMutations/types.d.ts.map new file mode 100644 index 000000000..bd28f33f9 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useMutations/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useMutations/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEtD,kBAAU,gBAAgB,CAAC;IACzB,KAAY,kBAAkB,CAAC,KAAK,IAAI;QACtC,OAAO,EAAE,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;KAC1C,CAAC;CACH;AAED,eAAe,gBAAgB,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useReset/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useReset/index.d.ts similarity index 100% rename from packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useReset/index.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useReset/index.d.ts diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useReset/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useReset/index.d.ts.map new file mode 100644 index 000000000..99fa1efc9 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useReset/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useReset/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,MAAM,EAAE,EACvC,MAAM,EACN,IAAI,EACJ,OAAO,EACP,SAAS,EACT,kBAAkB,GACnB,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,CAmCvD"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useReset/types.d.ts b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useReset/types.d.ts similarity index 92% rename from packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useReset/types.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useReset/types.d.ts index a6a89f341..8795b01ed 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useReset/types.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useReset/types.d.ts @@ -1,5 +1,5 @@ +import type * as TdvCore from "tdv-core"; import { type Form } from "tdv-core"; -import type TdvCore from "tdv-core"; import type UseFormHook from "../useForm/types"; declare namespace UseResetHook { type UseResetConfig = { diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useReset/types.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useReset/types.d.ts.map new file mode 100644 index 000000000..24be518e8 --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useReset/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useReset/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAC;AAEhD,kBAAU,YAAY,CAAC;IACrB,KAAY,cAAc,CAAC,MAAM,IAAI;QACnC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACrB,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAChD,OAAO,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;QAChE,SAAS,EAAE,OAAO,CAAC;QACnB,kBAAkB,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;KAC1C,CAAC;IAEF,KAAY,cAAc,CAAC,MAAM,IAAI,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC;CAC/E;AAED,eAAe,YAAY,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useValidation/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useValidation/index.d.ts similarity index 85% rename from packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useValidation/index.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useValidation/index.d.ts index 516016ee4..fc137b2c8 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useValidation/index.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useValidation/index.d.ts @@ -1,4 +1,4 @@ -import type TdvCore from "tdv-core"; +import type * as TdvCore from "tdv-core"; import type ns from "./types"; /** * React hook which exposes validation-related props to a form component @@ -21,5 +21,5 @@ import type ns from "./types"; * * @typeParam TClass - represents parent form class model holding context of current compontent */ -export default function useValidation(model: TdvCore.Utilities.Types.Class, { defaultValue, groups, asyncDelay, locale, resolveDecoratorArgs, }?: ns.UseValidationConfig): ns.UseValidationReturn; +export default function useValidation(model: TdvCore.Utilities.Types.Class, { defaultValue, groups, asyncDelay, locale, resolveDecoratorArgs }?: ns.UseValidationConfig): ns.UseValidationReturn; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useValidation/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useValidation/index.d.ts.map new file mode 100644 index 000000000..8b8db55be --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useValidation/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useValidation/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,OAAO,MAAM,UAAU,CAAC;AAEzC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,MAAM,EAC1C,KAAK,EAAE,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,EAC5C,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,oBAAiC,EAAE,GAAE,EAAE,CAAC,mBAAmB,CAAC,MAAM,CAAM,GACnH,EAAE,CAAC,mBAAmB,CAAC,MAAM,CAAC,CA6ChC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useValidation/index.js b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useValidation/index.js index 9bb1aefe0..18d74cc7c 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useValidation/index.js +++ b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useValidation/index.js @@ -21,7 +21,7 @@ import useValidationEngine from "../useValidationEngine"; * * @typeParam TClass - represents parent form class model holding context of current compontent */ -export default function useValidation(model, { defaultValue, groups, asyncDelay, locale, resolveDecoratorArgs = () => ({}), } = {}) { +export default function useValidation(model, { defaultValue, groups, asyncDelay, locale, resolveDecoratorArgs = () => ({}) } = {}) { const engine = useValidationEngine(model, { groups, defaultValue, diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useValidation/types.d.ts b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useValidation/types.d.ts similarity index 84% rename from packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useValidation/types.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useValidation/types.d.ts index 5061196f4..107f56210 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useValidation/types.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useValidation/types.d.ts @@ -1,6 +1,6 @@ import type { Dispatch, SetStateAction } from "react"; +import type * as TdvCore from "tdv-core"; import { type Form, type ValidationResult } from "tdv-core"; -import type TdvCore from "tdv-core"; /** * A namespace which holds all necessary data for `useValidation` hook */ @@ -10,8 +10,8 @@ declare namespace UseValidationHook { */ type UseValidationData = { isValid: boolean; - detailedErrors: TdvCore.Strategy.Impl.DetailedErrors; - errors: TdvCore.Strategy.Impl.Errors; + detailedErrors: TdvCore.Strategy.DetailedErrorsResponse; + errors: TdvCore.Strategy.SimpleErrorsResponse; engine: Form; globalErrors: ValidationResult[]; }; @@ -29,7 +29,7 @@ declare namespace UseValidationHook { type UseValidationConfig = { defaultValue?: TdvCore.Utilities.Objects.Payload; groups?: string[]; - resolveDecoratorArgs?: () => TdvCore.Decorator.DecoratorArgs; + resolveDecoratorArgs?: () => TdvCore.Decorators.DecoratorArgs; asyncDelay?: number; locale?: TdvCore.Localization.Locale; }; diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useValidation/types.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useValidation/types.d.ts.map new file mode 100644 index 000000000..525d3ed5a --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useValidation/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useValidation/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,KAAK,OAAO,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5D;;GAEG;AACH,kBAAU,iBAAiB,CAAC;IAC1B;;OAEG;IACH,KAAY,iBAAiB,CAAC,MAAM,IAAI;QACtC,OAAO,EAAE,OAAO,CAAC;QACjB,cAAc,EAAE,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC;QAChE,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;QACtD,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACrB,YAAY,EAAE,gBAAgB,EAAE,CAAC;KAClC,CAAC;IAEF;;OAEG;IACH,KAAY,mBAAmB,CAAC,MAAM,IAAI,SAAS;QACjD,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC;QACzC,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;QACnE,iBAAiB,CAAC,MAAM,CAAC;KAC1B,CAAC;IAEF;;OAEG;IACH,KAAY,mBAAmB,CAAC,MAAM,IAAI;QACxC,YAAY,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACzD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;QAClB,oBAAoB,CAAC,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC;QAC9D,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC;KACtC,CAAC;CACH;AAED,eAAe,iBAAiB,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useValidationEngine/index.d.ts b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useValidationEngine/index.d.ts similarity index 86% rename from packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useValidationEngine/index.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useValidationEngine/index.d.ts index b054cbce1..42a812406 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useValidationEngine/index.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useValidationEngine/index.d.ts @@ -1,4 +1,4 @@ -import type TdvCore from "tdv-core"; +import type * as TdvCore from "tdv-core"; import { Form } from "tdv-core"; import type ns from "./types"; export default function useValidationEngine(model: TdvCore.Utilities.Types.Class, config?: ns.UseValidationEngineConfig): Form; diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useValidationEngine/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useValidationEngine/index.d.ts.map new file mode 100644 index 000000000..eaafaf79a --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useValidationEngine/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useValidationEngine/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,OAAO,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,MAAM,EAChD,KAAK,EAAE,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,EAC5C,MAAM,CAAC,EAAE,EAAE,CAAC,yBAAyB,CAAC,MAAM,CAAC,GAC5C,IAAI,CAAC,MAAM,CAAC,CAId"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useValidationEngine/types.d.ts b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useValidationEngine/types.d.ts similarity index 82% rename from packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useValidationEngine/types.d.ts rename to packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useValidationEngine/types.d.ts index a74f5b464..8b4b70596 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useValidationEngine/types.d.ts +++ b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useValidationEngine/types.d.ts @@ -1,4 +1,4 @@ -import type TdvCore from "tdv-core"; +import type * as TdvCore from "tdv-core"; declare namespace UseValidationEngineHook { type UseValidationEngineConfig = TdvCore.Validation.FormConfig; } diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useValidationEngine/types.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useValidationEngine/types.d.ts.map new file mode 100644 index 000000000..3d840bf6a --- /dev/null +++ b/packages/react/examples/basic-example-form/libs/tdv-react/dist/src/hooks/useValidationEngine/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useValidationEngine/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,UAAU,CAAC;AAEzC,kBAAU,uBAAuB,CAAC;IAChC,KAAY,yBAAyB,CAAC,MAAM,IAAI,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;CACvF;AAED,eAAe,uBAAuB,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/index.d.ts.map deleted file mode 100644 index edc477b70..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,UAAU,CAAC;AAClC,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,oBAAoB,MAAM,kCAAkC,CAAC;AACpE,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAC1C,OAAO,gBAAgB,MAAM,2BAA2B,CAAC;AACzD,OAAO,aAAa,MAAM,2BAA2B,CAAC;AACtD,OAAO,sBAAsB,MAAM,iCAAiC,CAAC;AAErE;;GAEG;AACH,yBAAiB,QAAQ,CAAC;IACxB,MAAM,QAAQ,YAAY,GAAG,oBAAoB,CAAC;CACnD;AAED;;GAEG;AACH,yBAAiB,KAAK,CAAC;IACrB,MAAM,QAAQ,OAAO,GAAG,gBAAgB,CAAC;IAEzC,MAAM,QAAQ,aAAa,GAAG,sBAAsB,CAAC;CACtD;AAED,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/contexts/FormContext/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/contexts/FormContext/index.d.ts.map deleted file mode 100644 index 3c7721369..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/contexts/FormContext/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/contexts/FormContext/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB,KAAK,eAAe,GAAG,IAAI,CAAC,EAAE,CAAC,iBAAiB,EAAE,UAAU,CAAC,GAAG,SAAS,CAAC;AAE1E,eAAO,MAAM,WAAW,gCAA4C,CAAC;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,mBAAmB,GACpB,EAAE,EAAE,CAAC,iBAAiB,qBAMtB"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/contexts/FormContext/types.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/contexts/FormContext/types.d.ts.map deleted file mode 100644 index 5077fdc72..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/contexts/FormContext/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/contexts/FormContext/types.ts"],"names":[],"mappings":";AAAA;;GAEG;AACH,kBAAU,WAAW,CAAC;IACpB;;OAEG;IACH,KAAY,iBAAiB,GAAG;QAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;QAC1B,SAAS,EAAE,OAAO,CAAC;QACnB,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;QACtC,mBAAmB,EAAE,OAAO,CAAC;KAC9B,CAAC;CACH;AAED,eAAe,WAAW,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/helpers/clearErrorsHelper.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/helpers/clearErrorsHelper.d.ts.map deleted file mode 100644 index 4d5ae9c29..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/helpers/clearErrorsHelper.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"clearErrorsHelper.d.ts","sourceRoot":"","sources":["../../../../src/helpers/clearErrorsHelper.ts"],"names":[],"mappings":"AAaA,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAgB1E"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useAfterMount/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useAfterMount/index.d.ts.map deleted file mode 100644 index 29e1716c7..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useAfterMount/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/useAfterMount/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAC1C,EAAE,EAAE,MAAM,IAAI,EACd,IAAI,GAAE,EAAE,CAAC,yBAA8B,GACtC,IAAI,CAYN"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useAfterMount/types.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useAfterMount/types.d.ts.map deleted file mode 100644 index 9fad0b11f..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useAfterMount/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/useAfterMount/types.ts"],"names":[],"mappings":"AAAA,kBAAU,iBAAiB,CAAC;IAC1B,KAAY,yBAAyB,GAAG,GAAG,EAAE,CAAC;CAC/C;AAED,eAAe,iBAAiB,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useForm/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useForm/index.d.ts.map deleted file mode 100644 index 2e623b13f..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useForm/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/useForm/index.tsx"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,UAAU,CAAC;AAM/B,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,MAAM,EACpC,KAAK,EAAE,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,EAC5C,EACE,YAAY,EACZ,QAAQ,EAAE,aAAa,EACvB,sBAAsB,EACtB,UAAU,EACV,mBAAmB,EACnB,gBAAgB,EAAE,MAAM,EACxB,oBAAoB,EACpB,QAAQ,EACR,UAAU,EACV,MAAM,GACP,GAAE,EAAE,CAAC,aAAa,CAAC,MAAM,CAMzB,GACA,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,CAkF1B"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useForm/types.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useForm/types.d.ts.map deleted file mode 100644 index 71af2d561..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useForm/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/useForm/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,UAAU,CAAC;AACpC,OAAO,KAAK,oBAAoB,MAAM,kCAAkC,CAAC;AAEzE;;GAEG;AACH,kBAAU,WAAW,CAAC;IACpB;;OAEG;IACH,KAAY,aAAa,CAAC,MAAM,IAAI;QAClC,YAAY,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACzD,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;QAC5B,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,oBAAoB,CAAC,EAAE,MAAM,OAAO,CAAC,SAAS,CAAC,aAAa,CAAC;QAC7D,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;QACtC,sBAAsB,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;QAChF,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;QACtE,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC;KACtC,CAAC;IAEF;;OAEG;IACH,KAAY,WAAW,CAAC,MAAM,IAAI;QAChC,OAAO,EAAE,OAAO,CAAC;QACjB,WAAW,EAAE,OAAO,CAAC;QACrB,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;QAC9B,SAAS,EAAE,uBAAuB,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;QAC9E,aAAa,EAAE,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC;QACxE,YAAY,EAAE,gBAAgB,EAAE,CAAC;QACjC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC7C,cAAc,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QAC7D,KAAK,EAAE,CACL,GAAG,UAAU,EAAE,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAC9E,IAAI,CAAC;KACX,CAAC;IAEF;;OAEG;IACH,KAAY,aAAa,CAAC,MAAM,IAAI,SAAS;QAC3C,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC;QACzC,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;QACnE,WAAW,CAAC,MAAM,CAAC;KACpB,CAAC;IAEF;;OAEG;IACH,KAAY,kBAAkB,CAAC,KAAK,EAAE,IAAI,SAAS,MAAM,KAAK,IAC1D,KAAK,CAAC,IAAI,CAAC,GACX,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAEzC;;OAEG;IACH,KAAY,eAAe,CAAC,KAAK,IAAI,CAAC,IAAI,SAAS,MAAM,KAAK,EAC5D,GAAG,EAAE,IAAI,EACT,KAAK,EAAE,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,KACnC,IAAI,CAAC;IAEV;;OAEG;IACH,KAAY,uBAAuB,CAAC,KAAK,IAAI;SAC1C,IAAI,IAAI,MAAM,KAAK,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI;KACpD,CAAC;IAEF;;OAEG;IACH,KAAY,mBAAmB,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,MAAM,CAAC,GACpE,CAAC,SAAS,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,GAC3C,CAAC,GAAG,GAAG,CAAC,IAAI,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GACpC,EAAE,GACJ,KAAK,CAAC;IAEV;;OAEG;IACH,KAAY,yBAAyB,CAAC,CAAC,IAAI;SACxC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,GAC9B,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GACtD,KAAK,GACL,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GACrD,CAAC,GACD,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GACtD,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,GACzB,CAAC,SAAS,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,GAC7C,CAAC,GACD,KAAK,GACP,KAAK;KACV,CAAC;IAEF;;OAEG;IACH,KAAY,gBAAgB,CAAC,CAAC,IAAI,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,IAAI,GACnF,EAAE,GACF,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,IAAI,GACnD,yBAAyB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,GACrC,EAAE,CAAC;CACR;AAED,eAAe,WAAW,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useMutations/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useMutations/index.d.ts.map deleted file mode 100644 index 57792d2f1..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useMutations/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/useMutations/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,OAAO,MAAM,UAAU,CAAC;AAEpC,OAAO,KAAK,gBAAgB,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,MAAM,EAAE,KAAK,GAAG,MAAM,EACzD,KAAK,EAAE,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,EAC5C,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,kBAAkB,CAAC,KAAK,CAAC,GACxC,gBAAgB,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAiCjD"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useMutations/types.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useMutations/types.d.ts.map deleted file mode 100644 index ff2736598..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useMutations/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/useMutations/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEtD,kBAAU,gBAAgB,CAAC;IACzB,KAAY,kBAAkB,CAAC,KAAK,IAAI;QACtC,OAAO,EAAE,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;KAC1C,CAAC;CACH;AAED,eAAe,gBAAgB,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useReset/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useReset/index.d.ts.map deleted file mode 100644 index 3f6951acf..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useReset/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/useReset/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,MAAM,EAAE,EACvC,MAAM,EACN,IAAI,EACJ,OAAO,EACP,SAAS,EACT,kBAAkB,GACnB,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,CAmCvD"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useReset/types.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useReset/types.d.ts.map deleted file mode 100644 index d1e56da6e..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useReset/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/useReset/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,KAAK,OAAO,MAAM,UAAU,CAAC;AACpC,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAC;AAEhD,kBAAU,YAAY,CAAC;IACrB,KAAY,cAAc,CAAC,MAAM,IAAI;QACnC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACrB,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAChD,OAAO,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;QAChE,SAAS,EAAE,OAAO,CAAC;QACnB,kBAAkB,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;KAC1C,CAAC;IAEF,KAAY,cAAc,CAAC,MAAM,IAAI,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC;CAC/E;AAED,eAAe,YAAY,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useValidation/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useValidation/index.d.ts.map deleted file mode 100644 index 020628f4d..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useValidation/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/useValidation/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,OAAO,MAAM,UAAU,CAAC;AAEpC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,MAAM,EAC1C,KAAK,EAAE,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,EAC5C,EACE,YAAY,EACZ,MAAM,EACN,UAAU,EACV,MAAM,EACN,oBAAiC,GAClC,GAAE,EAAE,CAAC,mBAAmB,CAAC,MAAM,CAAM,GACrC,EAAE,CAAC,mBAAmB,CAAC,MAAM,CAAC,CA+ChC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useValidation/types.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useValidation/types.d.ts.map deleted file mode 100644 index 62684d985..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useValidation/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/useValidation/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,KAAK,OAAO,MAAM,UAAU,CAAC;AAEpC;;GAEG;AACH,kBAAU,iBAAiB,CAAC;IAC1B;;OAEG;IACH,KAAY,iBAAiB,CAAC,MAAM,IAAI;QACtC,OAAO,EAAE,OAAO,CAAC;QACjB,cAAc,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QAC7D,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC7C,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACrB,YAAY,EAAE,gBAAgB,EAAE,CAAC;KAClC,CAAC;IAEF;;OAEG;IACH,KAAY,mBAAmB,CAAC,MAAM,IAAI,SAAS;QACjD,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC;QACzC,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;QACnE,iBAAiB,CAAC,MAAM,CAAC;KAC1B,CAAC;IAEF;;OAEG;IACH,KAAY,mBAAmB,CAAC,MAAM,IAAI;QACxC,YAAY,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACzD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;QAClB,oBAAoB,CAAC,EAAE,MAAM,OAAO,CAAC,SAAS,CAAC,aAAa,CAAC;QAC7D,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC;KACtC,CAAC;CACH;AAED,eAAe,iBAAiB,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useValidationEngine/index.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useValidationEngine/index.d.ts.map deleted file mode 100644 index 881f7a1d7..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useValidationEngine/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/useValidationEngine/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,OAAO,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,MAAM,EAChD,KAAK,EAAE,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,EAC5C,MAAM,CAAC,EAAE,EAAE,CAAC,yBAAyB,CAAC,MAAM,CAAC,GAC5C,IAAI,CAAC,MAAM,CAAC,CAId"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useValidationEngine/types.d.ts.map b/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useValidationEngine/types.d.ts.map deleted file mode 100644 index fdca09753..000000000 --- a/packages/react/examples/basic-example-form/libs/tdv-react/dist/types/src/hooks/useValidationEngine/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/useValidationEngine/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,UAAU,CAAC;AAEpC,kBAAU,uBAAuB,CAAC;IAChC,KAAY,yBAAyB,CAAC,MAAM,IAAI,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;CACvF;AAED,eAAe,uBAAuB,CAAC"} \ No newline at end of file diff --git a/packages/react/examples/basic-example-form/libs/tdv-react/package.json b/packages/react/examples/basic-example-form/libs/tdv-react/package.json index 8d9eb1777..dd9a789bc 100644 --- a/packages/react/examples/basic-example-form/libs/tdv-react/package.json +++ b/packages/react/examples/basic-example-form/libs/tdv-react/package.json @@ -1,6 +1,6 @@ { "name": "tdv-react", - "version": "1.7.1", + "version": "1.9.0", "description": "React library that allows form validation manipulation through TypeScript Decorators", "main": "dist/index.js", "types": "dist/types/index.d.ts", @@ -9,6 +9,7 @@ ], "private": false, "scripts": { + "lint": "echo \"No linting configured\"", "clean": "rm -rf dist", "build": "npm run test && npm run build:noTest", "build:noTest": "npm run clean && tsc", @@ -36,14 +37,14 @@ "@types/react-dom": "^18.0.10", "react": "^18.2.0", "react-dom": "^18.2.0", - "tdv-core": "^1.7.1", + "tdv-core": "^1.9.0", "typescript": "^5.2.2" }, "devDependencies": { - "@babel/core": "^7.22.11", - "@babel/preset-env": "^7.22.10", - "@babel/preset-react": "^7.22.5", - "@babel/preset-typescript": "^7.22.11", + "@babel/core": "^7.23.7", + "@babel/plugin-proposal-decorators": "^7.23.7", + "@babel/preset-env": "^7.23.8", + "@babel/preset-typescript": "^7.23.3", "@jest/reporters": "^29.6.4", "@testing-library/jest-dom": "^6.1.2", "@testing-library/react": "^14.0.0", diff --git a/packages/react/examples/basic-example-form/package.json b/packages/react/examples/basic-example-form/package.json index d1a64b1b4..21183a3e1 100644 --- a/packages/react/examples/basic-example-form/package.json +++ b/packages/react/examples/basic-example-form/package.json @@ -20,7 +20,8 @@ "react-dom": "^18.2.0", "react-syntax-highlighter": "^15.5.0", "tdv-core": "file://./libs/tdv-core", - "tdv-react": "file://./libs/tdv-react" + "tdv-react": "file://./libs/tdv-react", + "vite-plugin-commonjs": "^0.10.1" }, "devDependencies": { "@types/react": "^18.2.15", diff --git a/packages/react/examples/basic-example-form/src/components/demo/ClassLevelFormValidationDemo/code/component.tsx b/packages/react/examples/basic-example-form/src/components/demo/ClassLevelFormValidationDemo/code/component.tsx index 5c14017d8..fe5851ecf 100644 --- a/packages/react/examples/basic-example-form/src/components/demo/ClassLevelFormValidationDemo/code/component.tsx +++ b/packages/react/examples/basic-example-form/src/components/demo/ClassLevelFormValidationDemo/code/component.tsx @@ -1,7 +1,7 @@ import { Warning } from "@mui/icons-material"; import * as MUI from "@mui/material"; import { useForm } from "tdv-react"; -import Code from "../../../shared/Code"; +import { Code } from "../../../shared/Code"; import { ModelForm } from "./model"; export default function Component() { @@ -39,8 +39,7 @@ export default function Component() { {globalErrors.map(({ key, message }) => ( - {" "} - {message} + {message} ))} diff --git a/packages/react/examples/basic-example-form/src/components/demo/CompoundFieldsValidationDemo/code/component.tsx b/packages/react/examples/basic-example-form/src/components/demo/CompoundFieldsValidationDemo/code/component.tsx index 0b19a2c5a..b16f3a9ca 100644 --- a/packages/react/examples/basic-example-form/src/components/demo/CompoundFieldsValidationDemo/code/component.tsx +++ b/packages/react/examples/basic-example-form/src/components/demo/CompoundFieldsValidationDemo/code/component.tsx @@ -1,7 +1,7 @@ import { Warning } from "@mui/icons-material"; import * as MUI from "@mui/material"; import { useForm } from "tdv-react"; -import Code from "../../../shared/Code"; +import { Code } from "../../../shared/Code"; import { Model, ModelForm } from "./model"; export default function Component() { @@ -37,7 +37,7 @@ export default function Component() { - {errors.passwordsMatch.map(msg => ( + {errors.passwordsMatch.map((msg: string) => ( {msg} diff --git a/packages/react/examples/basic-example-form/src/components/shared/Code/index.tsx b/packages/react/examples/basic-example-form/src/components/shared/Code/index.tsx index 251a57050..e28eab1cc 100644 --- a/packages/react/examples/basic-example-form/src/components/shared/Code/index.tsx +++ b/packages/react/examples/basic-example-form/src/components/shared/Code/index.tsx @@ -1,9 +1,9 @@ import { ContentCopy, DoneAll } from "@mui/icons-material"; import { IconButton } from "@mui/material"; import { useState } from "react"; -import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; -import { vscDarkPlus } from "react-syntax-highlighter/dist/esm/styles/prism"; -import "./index.css"; +import SyntaxHighlighter from "react-syntax-highlighter"; +import { vs2015 as theme } from "react-syntax-highlighter/dist/esm/styles/hljs"; +import "./index.css?inline"; export type CodeProps = { code: string; @@ -13,7 +13,7 @@ export type CodeProps = { style?: any; }; -export default function Code({ +export function Code({ code, style = {}, language = "typescript", @@ -49,7 +49,7 @@ export default function Code({ showLineNumbers={showLineNumbers} customStyle={{ padding: "1rem" }} language={language} - style={vscDarkPlus} + style={theme} > {code} diff --git a/packages/react/examples/basic-example-form/src/components/shared/Playground/index.tsx b/packages/react/examples/basic-example-form/src/components/shared/Playground/index.tsx index 3104301a3..0b263c8fb 100644 --- a/packages/react/examples/basic-example-form/src/components/shared/Playground/index.tsx +++ b/packages/react/examples/basic-example-form/src/components/shared/Playground/index.tsx @@ -12,9 +12,9 @@ import { } from "@mui/material"; import { ReactNode, useState } from "react"; import { DemoCodeData } from "../../demo/DemoList"; -import Code from "../Code"; +import { Code } from "../Code"; import RelatedFAQ from "../RelatedFAQ"; -import "./index.css"; +import "./index.css?inline"; export type PlaygroundProps = { title: string; @@ -24,21 +24,12 @@ export type PlaygroundProps = { children: ReactNode; }; -export default function Playground({ - title, - description, - codeData, - children, - relatedFAQ = [], -}: PlaygroundProps) { +export default function Playground({ title, description, codeData, children, relatedFAQ = [] }: PlaygroundProps) { const [currentCodeData, setCurrentCodeData] = useState(codeData[0]); const [expanded, setExpanded] = useState(true); return ( - } - > + }> {title} @@ -65,9 +56,7 @@ export default function Playground({ ))} - + {expanded && } diff --git a/packages/react/examples/basic-example-form/src/components/shared/RelatedFAQ/index.tsx b/packages/react/examples/basic-example-form/src/components/shared/RelatedFAQ/index.tsx index 230c82376..070f625bd 100644 --- a/packages/react/examples/basic-example-form/src/components/shared/RelatedFAQ/index.tsx +++ b/packages/react/examples/basic-example-form/src/components/shared/RelatedFAQ/index.tsx @@ -1,5 +1,5 @@ import { List, ListItem, Typography } from "@mui/material"; -import "./index.css"; +import "./index.css?inline"; export type RelatedFAQProps = { data: string[]; diff --git a/packages/react/examples/basic-example-form/src/main.tsx b/packages/react/examples/basic-example-form/src/main.tsx index 50a230163..c10f8ec1a 100644 --- a/packages/react/examples/basic-example-form/src/main.tsx +++ b/packages/react/examples/basic-example-form/src/main.tsx @@ -1,5 +1,5 @@ import ReactDOM from "react-dom/client"; import App from "./App.tsx"; -import "./main.css"; +import "./main.css?inline"; ReactDOM.createRoot(document.getElementById("root")!).render(); diff --git a/packages/react/examples/basic-example-form/tsconfig.json b/packages/react/examples/basic-example-form/tsconfig.json index 95f294184..c3192418a 100644 --- a/packages/react/examples/basic-example-form/tsconfig.json +++ b/packages/react/examples/basic-example-form/tsconfig.json @@ -6,6 +6,8 @@ "skipLibCheck": true, "useDefineForClassFields": true, + "experimentalDecorators": false, + /* Bundler mode */ "moduleResolution": "bundler", "allowImportingTsExtensions": true, diff --git a/packages/react/examples/basic-example-form/vite.config.ts b/packages/react/examples/basic-example-form/vite.config.ts index bca48b308..b984fe66c 100644 --- a/packages/react/examples/basic-example-form/vite.config.ts +++ b/packages/react/examples/basic-example-form/vite.config.ts @@ -1,10 +1,19 @@ import react from "@vitejs/plugin-react"; import path from "path"; import { defineConfig } from "vite"; +import commonJs from "vite-plugin-commonjs"; // https://vitejs.dev/config/ export default defineConfig({ - plugins: [react()], + plugins: [ + commonJs(), + react({ + babel: { + presets: ["@babel/preset-env", "@babel/preset-typescript"], + plugins: [["@babel/plugin-proposal-decorators", { version: "2023-05" }]], + }, + }), + ], optimizeDeps: { include: ["tdv-core", "tdv-react"], }, diff --git a/packages/react/examples/basic-example-form/vite.config.ts.timestamp-1704303867547-8f30ee155f6ce.mjs b/packages/react/examples/basic-example-form/vite.config.ts.timestamp-1704303867547-8f30ee155f6ce.mjs deleted file mode 100644 index d7d3df6e3..000000000 --- a/packages/react/examples/basic-example-form/vite.config.ts.timestamp-1704303867547-8f30ee155f6ce.mjs +++ /dev/null @@ -1,20 +0,0 @@ -// vite.config.ts -import react from "file:///home/bruno/Desktop/private/dev/react/typescript-decorator-validation/packages/react/examples/basic-example-form/node_modules/@vitejs/plugin-react/dist/index.mjs"; -import path from "path"; -import { defineConfig } from "file:///home/bruno/Desktop/private/dev/react/typescript-decorator-validation/packages/react/examples/basic-example-form/node_modules/vite/dist/node/index.js"; -var __vite_injected_original_dirname = "/home/bruno/Desktop/private/dev/react/typescript-decorator-validation/packages/react/examples/basic-example-form"; -var vite_config_default = defineConfig({ - plugins: [react()], - optimizeDeps: { - include: ["tdv-core", "tdv-react"] - }, - resolve: { - alias: { - "tdv-core/validators": path.resolve(__vite_injected_original_dirname, "libs/tdv-core/dist/validators") - } - } -}); -export { - vite_config_default as default -}; -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lID0gXCIvaG9tZS9icnVuby9EZXNrdG9wL3ByaXZhdGUvZGV2L3JlYWN0L3R5cGVzY3JpcHQtZGVjb3JhdG9yLXZhbGlkYXRpb24vcGFja2FnZXMvcmVhY3QvZXhhbXBsZXMvYmFzaWMtZXhhbXBsZS1mb3JtXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ZpbGVuYW1lID0gXCIvaG9tZS9icnVuby9EZXNrdG9wL3ByaXZhdGUvZGV2L3JlYWN0L3R5cGVzY3JpcHQtZGVjb3JhdG9yLXZhbGlkYXRpb24vcGFja2FnZXMvcmVhY3QvZXhhbXBsZXMvYmFzaWMtZXhhbXBsZS1mb3JtL3ZpdGUuY29uZmlnLnRzXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ltcG9ydF9tZXRhX3VybCA9IFwiZmlsZTovLy9ob21lL2JydW5vL0Rlc2t0b3AvcHJpdmF0ZS9kZXYvcmVhY3QvdHlwZXNjcmlwdC1kZWNvcmF0b3ItdmFsaWRhdGlvbi9wYWNrYWdlcy9yZWFjdC9leGFtcGxlcy9iYXNpYy1leGFtcGxlLWZvcm0vdml0ZS5jb25maWcudHNcIjtpbXBvcnQgcmVhY3QgZnJvbSBcIkB2aXRlanMvcGx1Z2luLXJlYWN0XCI7XG5pbXBvcnQgcGF0aCBmcm9tIFwicGF0aFwiO1xuaW1wb3J0IHsgZGVmaW5lQ29uZmlnIH0gZnJvbSBcInZpdGVcIjtcblxuLy8gaHR0cHM6Ly92aXRlanMuZGV2L2NvbmZpZy9cbmV4cG9ydCBkZWZhdWx0IGRlZmluZUNvbmZpZyh7XG4gIHBsdWdpbnM6IFtyZWFjdCgpXSxcbiAgb3B0aW1pemVEZXBzOiB7XG4gICAgaW5jbHVkZTogW1widGR2LWNvcmVcIiwgXCJ0ZHYtcmVhY3RcIl0sXG4gIH0sXG4gIHJlc29sdmU6IHtcbiAgICBhbGlhczoge1xuICAgICAgXCJ0ZHYtY29yZS92YWxpZGF0b3JzXCI6IHBhdGgucmVzb2x2ZShfX2Rpcm5hbWUsIFwibGlicy90ZHYtY29yZS9kaXN0L3ZhbGlkYXRvcnNcIiksXG4gICAgfSxcbiAgfSxcbn0pO1xuIl0sCiAgIm1hcHBpbmdzIjogIjtBQUFrZ0IsT0FBTyxXQUFXO0FBQ3BoQixPQUFPLFVBQVU7QUFDakIsU0FBUyxvQkFBb0I7QUFGN0IsSUFBTSxtQ0FBbUM7QUFLekMsSUFBTyxzQkFBUSxhQUFhO0FBQUEsRUFDMUIsU0FBUyxDQUFDLE1BQU0sQ0FBQztBQUFBLEVBQ2pCLGNBQWM7QUFBQSxJQUNaLFNBQVMsQ0FBQyxZQUFZLFdBQVc7QUFBQSxFQUNuQztBQUFBLEVBQ0EsU0FBUztBQUFBLElBQ1AsT0FBTztBQUFBLE1BQ0wsdUJBQXVCLEtBQUssUUFBUSxrQ0FBVywrQkFBK0I7QUFBQSxJQUNoRjtBQUFBLEVBQ0Y7QUFDRixDQUFDOyIsCiAgIm5hbWVzIjogW10KfQo= diff --git a/packages/react/index.ts b/packages/react/index.ts index ebe104791..4ee50fbf0 100644 --- a/packages/react/index.ts +++ b/packages/react/index.ts @@ -1,4 +1,4 @@ -import TdvCoreApi from "tdv-core"; +//import * as TdvCoreApi from "tdv-core"; import FormProvider from "./src/contexts/FormContext"; import FormContextNamespace from "./src/contexts/FormContext/types"; import useForm from "./src/hooks/useForm"; @@ -22,4 +22,4 @@ export namespace Hooks { export import UseValidation = UseValidationNamespace; } -export { FormProvider, TdvCoreApi, useForm, useValidation }; +export { FormProvider, useForm, useValidation }; diff --git a/packages/react/package.json b/packages/react/package.json index 3d84773fc..dd9a789bc 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -41,10 +41,10 @@ "typescript": "^5.2.2" }, "devDependencies": { - "@babel/core": "^7.22.11", - "@babel/preset-env": "^7.22.10", - "@babel/preset-react": "^7.22.5", - "@babel/preset-typescript": "^7.22.11", + "@babel/core": "^7.23.7", + "@babel/plugin-proposal-decorators": "^7.23.7", + "@babel/preset-env": "^7.23.8", + "@babel/preset-typescript": "^7.23.3", "@jest/reporters": "^29.6.4", "@testing-library/jest-dom": "^6.1.2", "@testing-library/react": "^14.0.0", diff --git a/packages/react/src/hooks/useForm/index.tsx b/packages/react/src/hooks/useForm/index.tsx index 19347b828..703f8c2cc 100644 --- a/packages/react/src/hooks/useForm/index.tsx +++ b/packages/react/src/hooks/useForm/index.tsx @@ -1,5 +1,5 @@ import { useContext, useEffect, useState } from "react"; -import TdvCore from "tdv-core"; +import * as TdvCore from "tdv-core"; import { FormContext } from "../../contexts/FormContext"; import useEffectWhenMounted from "../useAfterMount"; import useMutations from "../useMutations"; @@ -60,14 +60,13 @@ export default function useForm( const instantContextValidation = standalone ? validateImmediately! : ctx? ctx.validateImmediately : validateImmediately!; const isSubmitted = instantContextValidation || submitted; - const [form, setForm, { globalErrors, errors, detailedErrors, isValid, engine }] = - useValidation(model, { - defaultValue, - groups, - resolveDecoratorArgs, - asyncDelay, - locale, - }); + const [form, setForm, { globalErrors, errors, detailedErrors, isValid, engine }] = useValidation(model, { + defaultValue, + groups, + resolveDecoratorArgs, + asyncDelay, + locale, + }); //* Dispatcher function which fires only when //* itself isn't a parent and context exists. diff --git a/packages/react/src/hooks/useForm/types.ts b/packages/react/src/hooks/useForm/types.ts index c3ad6c7bb..f566357ad 100644 --- a/packages/react/src/hooks/useForm/types.ts +++ b/packages/react/src/hooks/useForm/types.ts @@ -1,6 +1,6 @@ import { type Dispatch, type SetStateAction } from "react"; +import type * as TdvCore from "tdv-core"; import { type ValidationResult } from "tdv-core"; -import type TdvCore from "tdv-core"; import type FormContextNamespace from "../../contexts/FormContext/types"; /** @@ -15,9 +15,9 @@ namespace UseFormHook { validationGroups?: string[]; validateImmediately?: boolean; standalone?: boolean; - resolveDecoratorArgs?: () => TdvCore.Decorator.DecoratorArgs; + resolveDecoratorArgs?: () => TdvCore.Decorators.DecoratorArgs; onSubmit?: () => Promise | void; - onSubmitValidationFail?: (errors: TdvCore.Strategy.Impl.Errors) => void; + onSubmitValidationFail?: (errors: TdvCore.Strategy.SimpleErrorsResponse) => void; onChange?: (value: TdvCore.Utilities.Objects.Payload) => void; asyncDelay?: number; locale?: TdvCore.Localization.Locale; @@ -33,11 +33,9 @@ namespace UseFormHook { mutations: UseFormChangeHandlerMap>; providerProps: Omit; globalErrors: ValidationResult[]; - errors: TdvCore.Strategy.Impl.Errors; - detailedErrors: TdvCore.Strategy.Impl.DetailedErrors; - reset: ( - ...fieldPaths: Array>> - ) => void; + errors: TdvCore.Strategy.SimpleErrorsResponse; + detailedErrors: TdvCore.Strategy.DetailedErrorsResponse; + reset: (...fieldPaths: Array>>) => void; }; /** @@ -52,9 +50,7 @@ namespace UseFormHook { /** * Argument type for the form field setter function. */ - export type UseFormSetterFnArg = - | TBody[TKey] - | ((prev: TBody[TKey]) => TBody[TKey]); + export type UseFormSetterFnArg = TBody[TKey] | ((prev: TBody[TKey]) => TBody[TKey]); /** * Type of the form field setter function. diff --git a/packages/react/src/hooks/useMutations/index.ts b/packages/react/src/hooks/useMutations/index.ts index 712f9e482..d54afb28e 100644 --- a/packages/react/src/hooks/useMutations/index.ts +++ b/packages/react/src/hooks/useMutations/index.ts @@ -1,26 +1,21 @@ import { useMemo } from "react"; -import type TdvCore from "tdv-core"; -import { Reflection } from "tdv-core"; +import { Utilities } from "tdv-core"; import type UseFormNamespace from "./../useForm/types"; import type ns from "./types"; export default function useMutations( - clazz: TdvCore.Utilities.Types.Class, + clazz: Utilities.Types.Class, { setForm }: ns.UseMutationsConfig ): UseFormNamespace.UseFormChangeHandlerMap { - const fields = useMemo(() => Reflection.getClassFieldNames(clazz), []); + const fields = useMemo(() => Utilities.Classes.getClassFieldNames(clazz), []); - const handleChange: UseFormNamespace.UseFormSetterFn = ( - key, - value - ) => { - setForm((prev) => { + const handleChange: UseFormNamespace.UseFormSetterFn = (key, value) => { + setForm(prev => { const obj: any = {}; for (const prop of fields) { obj[prop] = (prev as any)[prop]; } - obj[key] = - typeof value === "function" ? (value as any)(prev[key]) : value; + obj[key] = typeof value === "function" ? (value as any)(prev[key]) : value; return obj; }); }; diff --git a/packages/react/src/hooks/useReset/types.ts b/packages/react/src/hooks/useReset/types.ts index d52217645..2c362fc90 100644 --- a/packages/react/src/hooks/useReset/types.ts +++ b/packages/react/src/hooks/useReset/types.ts @@ -1,5 +1,5 @@ +import type * as TdvCore from "tdv-core"; import { type Form } from "tdv-core"; -import type TdvCore from "tdv-core"; import type UseFormHook from "../useForm/types"; namespace UseResetHook { diff --git a/packages/react/src/hooks/useValidation/index.ts b/packages/react/src/hooks/useValidation/index.ts index 469116725..403f3d65c 100644 --- a/packages/react/src/hooks/useValidation/index.ts +++ b/packages/react/src/hooks/useValidation/index.ts @@ -1,5 +1,5 @@ import { useEffect, useState } from "react"; -import type TdvCore from "tdv-core"; +import type * as TdvCore from "tdv-core"; import useValidationEngine from "../useValidationEngine"; import type ns from "./types"; @@ -26,13 +26,7 @@ import type ns from "./types"; */ export default function useValidation( model: TdvCore.Utilities.Types.Class, - { - defaultValue, - groups, - asyncDelay, - locale, - resolveDecoratorArgs = () => ({}), - }: ns.UseValidationConfig = {} + { defaultValue, groups, asyncDelay, locale, resolveDecoratorArgs = () => ({}) }: ns.UseValidationConfig = {} ): ns.UseValidationReturn { const engine = useValidationEngine(model, { groups, @@ -42,9 +36,7 @@ export default function useValidation( }); const [form, setForm] = useState>(engine.defaultValue); const decoratorArgs = resolveDecoratorArgs(); - const [globalErrors, setGlobalErrors] = useState( - () => engine.validate(form, decoratorArgs).globalErrors - ); + const [globalErrors, setGlobalErrors] = useState(() => engine.validate(form, decoratorArgs).globalErrors); const [details, setDetails] = useState(() => engine.validate(form, decoratorArgs).detailedErrors); const [simpleErrors, setSimpleErrors] = useState(() => { return engine.validate(form, decoratorArgs).errors; diff --git a/packages/react/src/hooks/useValidation/types.ts b/packages/react/src/hooks/useValidation/types.ts index 27fa8bc77..eeed0954a 100644 --- a/packages/react/src/hooks/useValidation/types.ts +++ b/packages/react/src/hooks/useValidation/types.ts @@ -1,6 +1,6 @@ import type { Dispatch, SetStateAction } from "react"; +import type * as TdvCore from "tdv-core"; import { type Form, type ValidationResult } from "tdv-core"; -import type TdvCore from "tdv-core"; /** * A namespace which holds all necessary data for `useValidation` hook @@ -11,8 +11,8 @@ namespace UseValidationHook { */ export type UseValidationData = { isValid: boolean; - detailedErrors: TdvCore.Strategy.Impl.DetailedErrors; - errors: TdvCore.Strategy.Impl.Errors; + detailedErrors: TdvCore.Strategy.DetailedErrorsResponse; + errors: TdvCore.Strategy.SimpleErrorsResponse; engine: Form; globalErrors: ValidationResult[]; }; @@ -32,7 +32,7 @@ namespace UseValidationHook { export type UseValidationConfig = { defaultValue?: TdvCore.Utilities.Objects.Payload; groups?: string[]; - resolveDecoratorArgs?: () => TdvCore.Decorator.DecoratorArgs; + resolveDecoratorArgs?: () => TdvCore.Decorators.DecoratorArgs; asyncDelay?: number; locale?: TdvCore.Localization.Locale; }; diff --git a/packages/react/src/hooks/useValidationEngine/index.ts b/packages/react/src/hooks/useValidationEngine/index.ts index 083b8a299..f6e68f9e2 100644 --- a/packages/react/src/hooks/useValidationEngine/index.ts +++ b/packages/react/src/hooks/useValidationEngine/index.ts @@ -1,5 +1,5 @@ import { useMemo } from "react"; -import type TdvCore from "tdv-core"; +import type * as TdvCore from "tdv-core"; import { Form } from "tdv-core"; import type ns from "./types"; diff --git a/packages/react/src/hooks/useValidationEngine/types.ts b/packages/react/src/hooks/useValidationEngine/types.ts index 7d9c1697c..daaa78e8e 100644 --- a/packages/react/src/hooks/useValidationEngine/types.ts +++ b/packages/react/src/hooks/useValidationEngine/types.ts @@ -1,4 +1,4 @@ -import type TdvCore from "tdv-core"; +import type * as TdvCore from "tdv-core"; namespace UseValidationEngineHook { export type UseValidationEngineConfig = TdvCore.Validation.FormConfig; diff --git a/packages/react/tsconfig.json b/packages/react/tsconfig.json index 35b9cc006..9a077886a 100644 --- a/packages/react/tsconfig.json +++ b/packages/react/tsconfig.json @@ -1,14 +1,8 @@ { - "extends": "./../../tsconfig.json", + "extends": "../../tsconfig.json", "exclude": ["tests", "jest.config.js"], - "include": ["src", "index.ts"], + "include": ["index.ts", "src/**/*"], "compilerOptions": { - "module": "ESNext", - "jsx": "react", - "outDir": "dist", - "declarationDir": "dist/types", - "paths": { - "api": ["../core/index"] - } + "outDir": "dist" } } diff --git a/scripts/generate-docs.sh b/scripts/generate-docs.sh index 3beef5db9..48ab97937 100644 --- a/scripts/generate-docs.sh +++ b/scripts/generate-docs.sh @@ -12,20 +12,20 @@ for arg in "$@"; do fi done -start "$(color $CYAN)1 $(color)" " $(color $GREY)5$(color) Cleaning cache..." -npm run clean --force --silent +start "$(color $CYAN)1 $(color)" " $(color $GREY)5$(color) Installing dependencies..." +npm i --force --silent --no-progress stop "/" -start "$(color $CYAN)2 $(color)" " $(color $GREY)5$(color) Running build script..." -tsc --build +start "$(color $CYAN)2 $(color)" " $(color $GREY)5$(color) Building core..." +npm run build:noTest --prefix="$PWD_ROOT/packages/core" --silent stop "/" -start "$(color $CYAN)3 $(color)" " $(color $GREY)5$(color) Installing dependencies..." -npm i --force --silent --no-progress +start "$(color $CYAN)3 $(color)" " $(color $GREY)5$(color) Building react..." +npm run build:noTest --prefix="$PWD_ROOT/packages/react" --silent stop "/" start "$(color $CYAN)4 $(color)" " $(color $GREY)5$(color) Generating documentation..." -npx typedoc --logLevel None +(cd "$PWD_ROOT" && npx typedoc --logLevel None) stop "/" start "$(color $CYAN)5 $(color)" " $(color $GREY)5$(color) Normalizing output..." diff --git a/tsconfig.base.json b/tsconfig.base.json deleted file mode 100644 index 5fb057fe4..000000000 --- a/tsconfig.base.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "target": "ES6", - "lib": ["dom", "dom.iterable", "esnext"], - "moduleResolution": "node", - "forceConsistentCasingInFileNames": true, - "allowSyntheticDefaultImports": true, - "resolveJsonModule": true, - "esModuleInterop": true, - "declarationMap": true, - "skipLibCheck": true, - "declaration": true, - "allowJs": true, - "strict": true, - "isolatedModules": false - }, - "ts-node": { - "compilerOptions": { - "module": "commonjs" - } - } -} diff --git a/tsconfig.json b/tsconfig.json index 681e6ad6e..316356e92 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,10 +1,41 @@ { - "extends": "./tsconfig.base.json", "exclude": ["tests", "jest.config.js"], - "include": [], - "files": [], "compilerOptions": { - "module": "CommonJS", - "outDir": "dist" + "module": "esnext", + "target": "ES6", + "lib": ["dom", "dom.iterable", "esnext"], + "moduleResolution": "node", + "forceConsistentCasingInFileNames": true, + "allowSyntheticDefaultImports": true, + "resolveJsonModule": true, + "esModuleInterop": true, + "declarationMap": true, + "skipLibCheck": true, + "declaration": true, + "allowJs": true, + "strict": true, + "isolatedModules": false, + "jsx": "react", + "baseUrl": ".", + "outDir": "dist", + "paths": { + "@decorators": ["packages/core/src/decorators"], + "@decorators/*": ["packages/core/src/decorators/*"], + "@localization": ["packages/core/src/localization"], + "@localization/*": ["packages/core/src/localization/*"], + "@reflection": ["packages/core/src/reflection"], + "@reflection/*": ["packages/core/src/reflection/*"], + "@strategy": ["packages/core/src/strategy"], + "@strategy/*": ["packages/core/src/strategy/*"], + "@utilities": ["packages/core/src/utilities"], + "@utilities/*": ["packages/core/src/utilities/*"], + "@validation": ["packages/core/src/validation"], + "@validation/*": ["packages/core/src/validation/*"] + } + }, + "ts-node": { + "compilerOptions": { + "module": "commonjs" + } } } diff --git a/typedoc.base.json b/typedoc.base.json index 9e2f6144b..9f0e0314b 100644 --- a/typedoc.base.json +++ b/typedoc.base.json @@ -1,4 +1,23 @@ { "$schema": "https://typedoc.org/schema.json", - "includeVersion": true -} + "includeVersion": true, + "compilerOptions": { + "module": "CommonJS", + "outDir": "docs", + "baseUrl": ".", + "paths": { + "@decorators": ["packages/core/src/decorators"], + "@localization": ["packages/core/src/localization"], + "@reflection": ["packages/core/src/reflection"], + "@strategy": ["packages/core/src/strategy"], + "@utilities": ["packages/core/src/utilities"], + "@validation": ["packages/core/src/validation"], + "@decorators/*": ["packages/core/src/decorators/*"], + "@localization/*": ["packages/core/src/localization/*"], + "@reflection/*": ["packages/core/src/reflection/*"], + "@strategy/*": ["packages/core/src/strategy/*"], + "@utilities/*": ["packages/core/src/utilities/*"], + "@validation/*": ["packages/core/src/validation/*"] + } + } +} diff --git a/typedoc.json b/typedoc.json index 1ac8cca2f..15705f01e 100644 --- a/typedoc.json +++ b/typedoc.json @@ -1,4 +1,5 @@ { + "extends": ["./typedoc.base.json"], "entryPoints": ["packages/*"], "name": "Typescript Decorator Validation", "entryPointStrategy": "packages",