@warlock.js/seal 4.1.6 → 4.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/index.cjs +92 -92
- package/cjs/index.cjs.map +1 -1
- package/esm/config.d.mts +1 -1
- package/esm/config.mjs +1 -1
- package/esm/factory/validate.d.mts +1 -1
- package/esm/factory/validate.mjs +1 -1
- package/esm/factory/validators.d.mts +1 -1
- package/esm/factory/validators.mjs +1 -1
- package/esm/helpers/date-helpers.d.mts +1 -1
- package/esm/helpers/date-helpers.mjs +1 -1
- package/esm/helpers/file.utils.d.mts +1 -1
- package/esm/helpers/file.utils.mjs +1 -1
- package/esm/helpers/get-field-value.d.mts +1 -1
- package/esm/helpers/get-field-value.mjs +1 -1
- package/esm/helpers/is-empty-value.mjs +1 -1
- package/esm/helpers/path-helpers.d.mts +1 -1
- package/esm/helpers/path-helpers.mjs +1 -1
- package/esm/helpers/validation-helpers.d.mts +1 -1
- package/esm/helpers/validation-helpers.mjs +1 -1
- package/esm/index.d.mts +5 -1
- package/esm/mutators/array-mutators.d.mts +1 -1
- package/esm/mutators/array-mutators.mjs +1 -1
- package/esm/mutators/date-mutators.d.mts +1 -1
- package/esm/mutators/date-mutators.mjs +1 -1
- package/esm/mutators/number-mutators.d.mts +1 -1
- package/esm/mutators/number-mutators.mjs +1 -1
- package/esm/mutators/object-mutators.d.mts +1 -1
- package/esm/mutators/object-mutators.mjs +1 -1
- package/esm/mutators/scalar-mutators.d.mts +1 -1
- package/esm/mutators/scalar-mutators.mjs +1 -1
- package/esm/mutators/string-mutators.d.mts +1 -1
- package/esm/mutators/string-mutators.mjs +1 -1
- package/esm/plugins/plugin-system.d.mts +1 -1
- package/esm/plugins/plugin-system.mjs +1 -1
- package/esm/rules/array/array-rules.d.mts +1 -1
- package/esm/rules/array/array-rules.mjs +1 -1
- package/esm/rules/color/color-rules.d.mts +1 -1
- package/esm/rules/color/color-rules.mjs +1 -1
- package/esm/rules/common/enum.d.mts +1 -1
- package/esm/rules/common/enum.mjs +1 -1
- package/esm/rules/common/equals-field-rules.d.mts +1 -1
- package/esm/rules/common/equals-field-rules.mjs +1 -1
- package/esm/rules/common/instanceof.d.mts +1 -1
- package/esm/rules/common/instanceof.mjs +1 -1
- package/esm/rules/common/literal.d.mts +1 -1
- package/esm/rules/common/literal.mjs +1 -1
- package/esm/rules/common/type-rules.d.mts +1 -1
- package/esm/rules/common/type-rules.mjs +1 -1
- package/esm/rules/common/unknown-key.d.mts +1 -1
- package/esm/rules/common/unknown-key.mjs +1 -1
- package/esm/rules/conditional/forbidden-if-rules.d.mts +1 -1
- package/esm/rules/conditional/forbidden-if-rules.mjs +1 -1
- package/esm/rules/conditional/present-if-rules.d.mts +1 -1
- package/esm/rules/conditional/present-if-rules.mjs +1 -1
- package/esm/rules/conditional/present-unless-rules.d.mts +1 -1
- package/esm/rules/conditional/present-unless-rules.mjs +1 -1
- package/esm/rules/conditional/present-with-rules.d.mts +1 -1
- package/esm/rules/conditional/present-with-rules.mjs +1 -1
- package/esm/rules/conditional/present-without-rules.d.mts +1 -1
- package/esm/rules/conditional/present-without-rules.mjs +1 -1
- package/esm/rules/conditional/required-if-rules.d.mts +1 -1
- package/esm/rules/conditional/required-if-rules.mjs +1 -1
- package/esm/rules/conditional/required-unless-rules.d.mts +1 -1
- package/esm/rules/conditional/required-unless-rules.mjs +1 -1
- package/esm/rules/conditional/required-when-rule.d.mts +1 -1
- package/esm/rules/conditional/required-when-rule.mjs +1 -1
- package/esm/rules/conditional/required-with-rules.d.mts +1 -1
- package/esm/rules/conditional/required-with-rules.mjs +1 -1
- package/esm/rules/conditional/required-without-rules.d.mts +1 -1
- package/esm/rules/conditional/required-without-rules.mjs +1 -1
- package/esm/rules/core/equal.d.mts +1 -1
- package/esm/rules/core/equal.mjs +1 -1
- package/esm/rules/core/forbidden.d.mts +1 -1
- package/esm/rules/core/forbidden.mjs +1 -1
- package/esm/rules/core/required.d.mts +1 -1
- package/esm/rules/core/required.mjs +1 -1
- package/esm/rules/core/union.d.mts +1 -1
- package/esm/rules/core/union.mjs +1 -1
- package/esm/rules/core/when.d.mts +1 -1
- package/esm/rules/core/when.mjs +1 -1
- package/esm/rules/date/date-comparison-rules.d.mts +1 -1
- package/esm/rules/date/date-comparison-rules.mjs +1 -1
- package/esm/rules/date/date-day-rules.d.mts +1 -1
- package/esm/rules/date/date-day-rules.mjs +1 -1
- package/esm/rules/date/date-field-comparison-rules.d.mts +1 -1
- package/esm/rules/date/date-field-comparison-rules.mjs +1 -1
- package/esm/rules/date/date-period-rules.d.mts +1 -1
- package/esm/rules/date/date-period-rules.mjs +1 -1
- package/esm/rules/date/date-relative-rules.d.mts +1 -1
- package/esm/rules/date/date-relative-rules.mjs +1 -1
- package/esm/rules/date/date-special-rules.d.mts +1 -1
- package/esm/rules/date/date-special-rules.mjs +1 -1
- package/esm/rules/date/date.d.mts +1 -1
- package/esm/rules/date/date.mjs +1 -1
- package/esm/rules/file/dimensions.d.mts +1 -1
- package/esm/rules/file/dimensions.mjs +1 -1
- package/esm/rules/file/file-size.d.mts +1 -1
- package/esm/rules/file/file-size.mjs +1 -1
- package/esm/rules/length/length-rules.d.mts +1 -1
- package/esm/rules/length/length-rules.mjs +1 -1
- package/esm/rules/number/number-rules.d.mts +1 -1
- package/esm/rules/number/number-rules.mjs +1 -1
- package/esm/rules/scalar/accepted-rule.mjs +1 -1
- package/esm/rules/scalar/declined-rule.mjs +1 -1
- package/esm/rules/string/alpha.d.mts +1 -1
- package/esm/rules/string/alpha.mjs +1 -1
- package/esm/rules/string/credit-card.d.mts +1 -1
- package/esm/rules/string/credit-card.mjs +1 -1
- package/esm/rules/string/email.d.mts +1 -1
- package/esm/rules/string/email.mjs +1 -1
- package/esm/rules/string/id-formats.d.mts +1 -1
- package/esm/rules/string/id-formats.mjs +1 -1
- package/esm/rules/string/ip.d.mts +1 -1
- package/esm/rules/string/ip.mjs +1 -1
- package/esm/rules/string/matches.d.mts +1 -1
- package/esm/rules/string/matches.mjs +1 -1
- package/esm/rules/string/pattern.d.mts +1 -1
- package/esm/rules/string/pattern.mjs +1 -1
- package/esm/rules/string/string-comparison.d.mts +1 -1
- package/esm/rules/string/string-comparison.mjs +1 -1
- package/esm/rules/string/strong-password-rule.d.mts +1 -1
- package/esm/rules/string/strong-password-rule.mjs +1 -1
- package/esm/rules/string/url.d.mts +1 -1
- package/esm/rules/string/url.mjs +1 -1
- package/esm/rules/string/without-whitespace.d.mts +1 -1
- package/esm/rules/string/without-whitespace.mjs +1 -1
- package/esm/standard-schema/json-schema.d.mts +1 -1
- package/esm/standard-schema/json-schema.mjs +1 -1
- package/esm/standard-schema/map-result.d.mts +1 -1
- package/esm/standard-schema/map-result.mjs +1 -1
- package/esm/standard-schema/types.d.mts +1 -1
- package/esm/types/conditional-types.d.mts +1 -1
- package/esm/types/context-types.d.mts +1 -1
- package/esm/types/data-transformer-types.d.mts +1 -1
- package/esm/types/date-types.d.mts +1 -1
- package/esm/types/date-types.mjs +1 -1
- package/esm/types/file.types.d.mts +1 -1
- package/esm/types/inference-types.d.mts +1 -1
- package/esm/types/mutator-types.d.mts +1 -1
- package/esm/types/result-types.d.mts +1 -1
- package/esm/types/rule-types.d.mts +1 -1
- package/esm/types/schema-types.d.mts +1 -1
- package/esm/validators/any-validator.d.mts +1 -1
- package/esm/validators/any-validator.mjs +1 -1
- package/esm/validators/array-validator.d.mts +1 -1
- package/esm/validators/array-validator.mjs +1 -1
- package/esm/validators/base-validator.d.mts +1 -1
- package/esm/validators/base-validator.mjs +1 -1
- package/esm/validators/boolean-validator.d.mts +1 -1
- package/esm/validators/boolean-validator.mjs +1 -1
- package/esm/validators/computed-validator.d.mts +1 -1
- package/esm/validators/computed-validator.mjs +1 -1
- package/esm/validators/date-validator.d.mts +1 -1
- package/esm/validators/date-validator.mjs +1 -1
- package/esm/validators/discriminated-union-validator.d.mts +1 -1
- package/esm/validators/discriminated-union-validator.mjs +1 -1
- package/esm/validators/float-validator.d.mts +1 -1
- package/esm/validators/float-validator.mjs +1 -1
- package/esm/validators/instanceof-validator.d.mts +1 -1
- package/esm/validators/instanceof-validator.mjs +1 -1
- package/esm/validators/int-validator.d.mts +1 -1
- package/esm/validators/int-validator.mjs +1 -1
- package/esm/validators/lazy-validator.d.mts +1 -1
- package/esm/validators/lazy-validator.mjs +1 -1
- package/esm/validators/literal-validator.d.mts +1 -1
- package/esm/validators/literal-validator.mjs +1 -1
- package/esm/validators/managed-validator.d.mts +1 -1
- package/esm/validators/managed-validator.mjs +1 -1
- package/esm/validators/methods/equality-conditional-methods.d.mts +2 -2
- package/esm/validators/methods/equality-conditional-methods.mjs +1 -1
- package/esm/validators/methods/equality-conditional-methods.mjs.map +1 -1
- package/esm/validators/methods/forbidden-methods.d.mts +2 -2
- package/esm/validators/methods/forbidden-methods.mjs +1 -1
- package/esm/validators/methods/forbidden-methods.mjs.map +1 -1
- package/esm/validators/methods/present-methods.d.mts +2 -2
- package/esm/validators/methods/present-methods.mjs +1 -1
- package/esm/validators/methods/present-methods.mjs.map +1 -1
- package/esm/validators/methods/required-methods.d.mts +2 -2
- package/esm/validators/methods/required-methods.mjs +1 -1
- package/esm/validators/methods/required-methods.mjs.map +1 -1
- package/esm/validators/number-validator.d.mts +1 -1
- package/esm/validators/number-validator.mjs +1 -1
- package/esm/validators/numeric-validator.d.mts +1 -1
- package/esm/validators/numeric-validator.mjs +1 -1
- package/esm/validators/object-validator.d.mts +1 -1
- package/esm/validators/object-validator.mjs +1 -1
- package/esm/validators/primitive-validator.d.mts +1 -1
- package/esm/validators/primitive-validator.mjs +1 -1
- package/esm/validators/record-validator.d.mts +1 -1
- package/esm/validators/record-validator.mjs +1 -1
- package/esm/validators/scalar-validator.d.mts +1 -1
- package/esm/validators/scalar-validator.mjs +1 -1
- package/esm/validators/string-validator.d.mts +1 -1
- package/esm/validators/string-validator.mjs +1 -1
- package/esm/validators/tuple-validator.d.mts +1 -1
- package/esm/validators/tuple-validator.mjs +1 -1
- package/esm/validators/union-validator.d.mts +1 -1
- package/esm/validators/union-validator.mjs +1 -1
- package/package.json +1 -1
package/esm/config.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AttributeTranslation, RuleTranslation } from "./types/context-types.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../@warlock.js/seal/src/config.d.ts
|
|
4
4
|
type TranslateRuleCallback = (ruleTranslation: RuleTranslation) => string;
|
|
5
5
|
type TranslateAttributeCallback = (attributeTranslation: AttributeTranslation) => string;
|
|
6
6
|
type SealConfig = {
|
package/esm/config.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { ValidationResult } from "../types/result-types.mjs";
|
|
|
2
2
|
import { BaseValidator } from "../validators/base-validator.mjs";
|
|
3
3
|
import { ValidateOptions } from "./validators.mjs";
|
|
4
4
|
|
|
5
|
-
//#region
|
|
5
|
+
//#region ../@warlock.js/seal/src/factory/validate.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Validate data against a schema
|
|
8
8
|
*/
|
package/esm/factory/validate.mjs
CHANGED
|
@@ -26,7 +26,7 @@ import { TupleValidator } from "../validators/tuple-validator.mjs";
|
|
|
26
26
|
import { UnionValidator } from "../validators/union-validator.mjs";
|
|
27
27
|
import { SealConfig } from "../config.mjs";
|
|
28
28
|
|
|
29
|
-
//#region
|
|
29
|
+
//#region ../@warlock.js/seal/src/factory/validators.d.ts
|
|
30
30
|
/**
|
|
31
31
|
* Seal factory object - creates instances of validators
|
|
32
32
|
*
|
|
@@ -24,7 +24,7 @@ import { StringValidator } from "../validators/string-validator.mjs";
|
|
|
24
24
|
import { TupleValidator } from "../validators/tuple-validator.mjs";
|
|
25
25
|
import { UnionValidator } from "../validators/union-validator.mjs";
|
|
26
26
|
|
|
27
|
-
//#region
|
|
27
|
+
//#region ../@warlock.js/seal/src/factory/validators.ts
|
|
28
28
|
/**
|
|
29
29
|
* Seal factory object - creates instances of validators
|
|
30
30
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FileSizeOption } from "../types/file.types.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../@warlock.js/seal/src/helpers/file.utils.d.ts
|
|
4
4
|
declare function resolveFileSize(size: number | FileSizeOption): number;
|
|
5
5
|
/**
|
|
6
6
|
* Convert the given size to a human size
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ContextualSchemaRule } from "../types/rule-types.mjs";
|
|
2
2
|
import { SchemaContext } from "../types/context-types.mjs";
|
|
3
3
|
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../@warlock.js/seal/src/helpers/get-field-value.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Get field value based on scope from rule options
|
|
7
7
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isEmpty, isObject } from "@mongez/supportive-is";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../@warlock.js/seal/src/helpers/is-empty-value.ts
|
|
4
4
|
function isEmptyValue(value) {
|
|
5
5
|
return isEmpty(value) && !isObject(value);
|
|
6
6
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ContextualSchemaRule, RuleResult } from "../types/rule-types.mjs";
|
|
2
2
|
import { SchemaContext } from "../types/context-types.mjs";
|
|
3
3
|
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../@warlock.js/seal/src/helpers/validation-helpers.d.ts
|
|
5
5
|
declare const VALID_RULE: RuleResult;
|
|
6
6
|
/**
|
|
7
7
|
* Resolve a single attribute value through the full translation priority chain:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getSealConfig } from "../config.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../@warlock.js/seal/src/helpers/validation-helpers.ts
|
|
4
4
|
const VALID_RULE = { isValid: true };
|
|
5
5
|
/**
|
|
6
6
|
* Resolve a single attribute value through the full translation priority chain:
|
package/esm/index.d.mts
CHANGED
|
@@ -93,4 +93,8 @@ import { ValidateOptions, ValidatorV, v } from "./factory/validators.mjs";
|
|
|
93
93
|
import { validate } from "./factory/validate.mjs";
|
|
94
94
|
import { PluginContext, SealPlugin, getInstalledPlugins, hasPlugin, registerPlugin, unregisterPlugin } from "./plugins/plugin-system.mjs";
|
|
95
95
|
import { mapToStandardResult } from "./standard-schema/map-result.mjs";
|
|
96
|
-
export { AnyValidator, ArrayValidator, AttributeTranslation, BaseValidator, BooleanValidator, ComputedCallback, ComputedValidator, ContextualSchemaRule, ContextualizedMutator, ContextualizedTransformer, DateValidator, DiscriminatedUnionValidator, FileSizeOption, FloatValidator, Infer, InferInput, InferInputObjectShape, InferObjectShape, InferOutput, InferOutputObjectShape, InstanceOfValidator, IntValidator, IsInputOptionalKey, IsOptionalKey, IsOutputOptionalKey, JsonSchemaResult, JsonSchemaTarget, LazyValidator, LiteralValidator, ManagedCallback, ManagedValidator, Month, Mutator, MutatorContext, NumberValidator, NumericValidator, ObjectValidator, PluginContext, PrimitiveValidator, RecordValidator, RuleResult, RuleTranslation, ScalarValidator, Schema, SchemaContext, SchemaRule, SchemaRuleOptions, SealConfig, SealPlugin, SimpleTransformerCallback, StandardJSONSchemaV1, StandardSchemaV1, StringValidator, TransformerCallback, TranslateAttributeCallback, TranslateRuleCallback, TupleValidator, UUIDVersion, UnionValidator, VALID_RULE, ValidateOptions, ValidationAttributesList, ValidationResult, ValidatorV, WEEK_DAYS, WeekDay, WhenRuleOptions, absMutator, addDaysMutator, addHoursMutator, addMonthsMutator, addYearsMutator, afterFieldRule, afterTodayRule, ageRule, allowedValuesRule, alphaNumericRule, alphaOnlyMutator, alphaRule, alphanumericOnlyMutator, appendMutator, applyNullable, arrayRule, base64DecodeMutator, base64EncodeMutator, beforeFieldRule, beforeHourRule, beforeMinuteRule, beforeTodayRule, betweenAgeRule, betweenDatesRule, betweenDaysRule, betweenHoursRule, betweenLengthRule, betweenMinutesRule, betweenMonthsRule, betweenNumbersRule, betweenTimesRule, betweenYearsRule, birthdayRule, booleanMutator, booleanRule, businessDayRule, camelCaseMutator, capitalizeMutator, ceilMutator, colorRule, configureSeal, containsRule, cuidRule, darkColorRule, dateMutator, dateRule, emailRule, endsWithRule, enumRule, equalRule, equalsFieldRule, evenRule, flipArrayMutator, floatRule, floorMutator, forbiddenIfEmptyRule, forbiddenIfInRule, forbiddenIfNotEmptyRule, forbiddenIfNotInRule, forbiddenIfNotRule, forbiddenIfRule, forbiddenRule, fromHourRule, fromMinuteRule, fromTodayRule, futureRule, getFieldValue, getInstalledPlugins, getRuleOptions, getSealConfig, greaterThanRule, hasPlugin, hexColorRule, hslColorRule, htmlEscapeMutator, humanizeSize, inRule, instanceofRule, intRule, invalidRule, ip4Rule, ip6Rule, ipRule, isCreditCardRule, isDateValue, isNumericRule, jsonMutator, kebabCaseMutator, leapYearRule, lengthRule, lessThanRule, lightColorRule, literalRule, lowercaseMutator, ltrimMutator, mapToStandardResult, maskMutator, matchesRule, maxAgeRule, maxDateRule, maxDayRule, maxFileSizeRule, maxHeightRule, maxLengthRule, maxMonthRule, maxRule, maxWidthRule, maxWordsRule, maxYearRule, minAgeRule, minDateRule, minDayRule, minFileSizeRule, minHeightRule, minLengthRule, minMonthRule, minRule, minWidthRule, minWordsRule, minYearRule, moduloRule, monthRule, nanoidRule, negativeRule, notAllowedValuesRule, notContainsRule, notEqualsFieldRule, numberMutator, numberRule, numericMutator, objectRule, objectTrimMutator, oddRule, padEndMutator, padStartMutator, pascalCaseMutator, pastRule, patternRule, plainObjectRule, positiveRule, prependMutator, presentIfEmptyRule, presentIfInRule, presentIfNotEmptyRule, presentIfNotInRule, presentIfRule, presentRule, presentUnlessRule, presentWithAllRule, presentWithAnyRule, presentWithRule, presentWithoutAllRule, presentWithoutAnyRule, presentWithoutRule, quarterRule, registerPlugin, removeEmptyArrayElementsMutator, removeNumbersMutator, removeSpecialCharactersMutator, repeatMutator, replaceAllMutator, replaceMutator, requiredIfAllEmptyRule, requiredIfAllNotEmptyRule, requiredIfAnyEmptyRule, requiredIfAnyNotEmptyRule, requiredIfEmptyRule, requiredIfInRule, requiredIfNotEmptyRule, requiredIfNotInRule, requiredIfRule, requiredRule, requiredUnlessRule, requiredWhenRule, requiredWithAllRule, requiredWithAnyRule, requiredWithRule, requiredWithoutAllRule, requiredWithoutAnyRule, requiredWithoutRule, resetSealConfig, resolveFileSize, resolveTranslation, reverseArrayMutator, reverseMutator, rgbColorRule, rgbaColorRule, roundMutator, roundNumberMutator, rtrimMutator, safeHtmlMutator, sameAsFieldDateRule, scalarRule, setKeyPath, slugMutator, snakeCaseMutator, sortArrayMutator, sortedArrayRule, startsWithRule, stringMutator, stringRule, stringifyMutator, stripUnknownMutator, strongPasswordRule, titleCaseMutator, toDateOnlyMutator, toEndOfDayMutator, toEndOfMonthMutator, toEndOfYearMutator, toFixedMutator, toFormatMutator, toISOStringMutator, toStartOfDayMutator, toStartOfMonthMutator, toStartOfYearMutator, toTimeOnlyMutator, toTimestampMutator, toUTCMutator, todayRule, trimMultipleWhitespaceMutator, trimMutator, truncateMutator, ulidRule, unescapeHtmlMutator, unionRule, uniqueArrayMutator, uniqueArrayRule, unknownKeyRule, unregisterPlugin, uppercaseMutator, urlDecodeMutator, urlEncodeMutator, urlRule, uuidRule, v, validate, weekDayRule, weekdayRule, weekdaysRule, weekendRule, whenRule, withinDaysRule, withinFutureDaysRule, withinPastDaysRule, withoutWhitespaceRule, wordsRule, wrapNullableStrict, yearRule };
|
|
96
|
+
export { AnyValidator, ArrayValidator, AttributeTranslation, BaseValidator, BooleanValidator, ComputedCallback, ComputedValidator, ContextualSchemaRule, ContextualizedMutator, ContextualizedTransformer, DateValidator, DiscriminatedUnionValidator, FileSizeOption, FloatValidator, Infer, InferInput, InferInputObjectShape, InferObjectShape, InferOutput, InferOutputObjectShape, InstanceOfValidator, IntValidator, IsInputOptionalKey, IsOptionalKey, IsOutputOptionalKey, JsonSchemaResult, JsonSchemaTarget, LazyValidator, LiteralValidator, ManagedCallback, ManagedValidator, Month, Mutator, MutatorContext, NumberValidator, NumericValidator, ObjectValidator, PluginContext, PrimitiveValidator, RecordValidator, RuleResult, RuleTranslation, ScalarValidator, Schema, SchemaContext, SchemaRule, SchemaRuleOptions, SealConfig, SealPlugin, SimpleTransformerCallback, StandardJSONSchemaV1, StandardSchemaV1, StringValidator, TransformerCallback, TranslateAttributeCallback, TranslateRuleCallback, TupleValidator, UUIDVersion, UnionValidator, VALID_RULE, ValidateOptions, ValidationAttributesList, ValidationResult, ValidatorV, WEEK_DAYS, WeekDay, WhenRuleOptions, absMutator, addDaysMutator, addHoursMutator, addMonthsMutator, addYearsMutator, afterFieldRule, afterTodayRule, ageRule, allowedValuesRule, alphaNumericRule, alphaOnlyMutator, alphaRule, alphanumericOnlyMutator, appendMutator, applyNullable, arrayRule, base64DecodeMutator, base64EncodeMutator, beforeFieldRule, beforeHourRule, beforeMinuteRule, beforeTodayRule, betweenAgeRule, betweenDatesRule, betweenDaysRule, betweenHoursRule, betweenLengthRule, betweenMinutesRule, betweenMonthsRule, betweenNumbersRule, betweenTimesRule, betweenYearsRule, birthdayRule, booleanMutator, booleanRule, businessDayRule, camelCaseMutator, capitalizeMutator, ceilMutator, colorRule, configureSeal, containsRule, cuidRule, darkColorRule, dateMutator, dateRule, emailRule, endsWithRule, enumRule, equalRule, equalsFieldRule, evenRule, flipArrayMutator, floatRule, floorMutator, forbiddenIfEmptyRule, forbiddenIfInRule, forbiddenIfNotEmptyRule, forbiddenIfNotInRule, forbiddenIfNotRule, forbiddenIfRule, forbiddenRule, fromHourRule, fromMinuteRule, fromTodayRule, futureRule, getFieldValue, getInstalledPlugins, getRuleOptions, getSealConfig, greaterThanRule, hasPlugin, hexColorRule, hslColorRule, htmlEscapeMutator, humanizeSize, inRule, instanceofRule, intRule, invalidRule, ip4Rule, ip6Rule, ipRule, isCreditCardRule, isDateValue, isNumericRule, jsonMutator, kebabCaseMutator, leapYearRule, lengthRule, lessThanRule, lightColorRule, literalRule, lowercaseMutator, ltrimMutator, mapToStandardResult, maskMutator, matchesRule, maxAgeRule, maxDateRule, maxDayRule, maxFileSizeRule, maxHeightRule, maxLengthRule, maxMonthRule, maxRule, maxWidthRule, maxWordsRule, maxYearRule, minAgeRule, minDateRule, minDayRule, minFileSizeRule, minHeightRule, minLengthRule, minMonthRule, minRule, minWidthRule, minWordsRule, minYearRule, moduloRule, monthRule, nanoidRule, negativeRule, notAllowedValuesRule, notContainsRule, notEqualsFieldRule, numberMutator, numberRule, numericMutator, objectRule, objectTrimMutator, oddRule, padEndMutator, padStartMutator, pascalCaseMutator, pastRule, patternRule, plainObjectRule, positiveRule, prependMutator, presentIfEmptyRule, presentIfInRule, presentIfNotEmptyRule, presentIfNotInRule, presentIfRule, presentRule, presentUnlessRule, presentWithAllRule, presentWithAnyRule, presentWithRule, presentWithoutAllRule, presentWithoutAnyRule, presentWithoutRule, quarterRule, registerPlugin, removeEmptyArrayElementsMutator, removeNumbersMutator, removeSpecialCharactersMutator, repeatMutator, replaceAllMutator, replaceMutator, requiredIfAllEmptyRule, requiredIfAllNotEmptyRule, requiredIfAnyEmptyRule, requiredIfAnyNotEmptyRule, requiredIfEmptyRule, requiredIfInRule, requiredIfNotEmptyRule, requiredIfNotInRule, requiredIfRule, requiredRule, requiredUnlessRule, requiredWhenRule, requiredWithAllRule, requiredWithAnyRule, requiredWithRule, requiredWithoutAllRule, requiredWithoutAnyRule, requiredWithoutRule, resetSealConfig, resolveFileSize, resolveTranslation, reverseArrayMutator, reverseMutator, rgbColorRule, rgbaColorRule, roundMutator, roundNumberMutator, rtrimMutator, safeHtmlMutator, sameAsFieldDateRule, scalarRule, setKeyPath, slugMutator, snakeCaseMutator, sortArrayMutator, sortedArrayRule, startsWithRule, stringMutator, stringRule, stringifyMutator, stripUnknownMutator, strongPasswordRule, titleCaseMutator, toDateOnlyMutator, toEndOfDayMutator, toEndOfMonthMutator, toEndOfYearMutator, toFixedMutator, toFormatMutator, toISOStringMutator, toStartOfDayMutator, toStartOfMonthMutator, toStartOfYearMutator, toTimeOnlyMutator, toTimestampMutator, toUTCMutator, todayRule, trimMultipleWhitespaceMutator, trimMutator, truncateMutator, ulidRule, unescapeHtmlMutator, unionRule, uniqueArrayMutator, uniqueArrayRule, unknownKeyRule, unregisterPlugin, uppercaseMutator, urlDecodeMutator, urlEncodeMutator, urlRule, uuidRule, v, validate, weekDayRule, weekdayRule, weekdaysRule, weekendRule, whenRule, withinDaysRule, withinFutureDaysRule, withinPastDaysRule, withoutWhitespaceRule, wordsRule, wrapNullableStrict, yearRule };
|
|
97
|
+
import "./validators/methods/equality-conditional-methods.mjs";
|
|
98
|
+
import "./validators/methods/forbidden-methods.mjs";
|
|
99
|
+
import "./validators/methods/present-methods.mjs";
|
|
100
|
+
import "./validators/methods/required-methods.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Mutator } from "../types/mutator-types.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../@warlock.js/seal/src/mutators/array-mutators.d.ts
|
|
4
4
|
/** Reverse array order */
|
|
5
5
|
declare const flipArrayMutator: Mutator;
|
|
6
6
|
/** Reverse array order (alias) */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isEmptyValue } from "../helpers/is-empty-value.mjs";
|
|
2
2
|
import { get } from "@mongez/reinforcements";
|
|
3
3
|
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../@warlock.js/seal/src/mutators/array-mutators.ts
|
|
5
5
|
/** Reverse array order */
|
|
6
6
|
const flipArrayMutator = async (value) => {
|
|
7
7
|
return value.reverse();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Mutator } from "../types/mutator-types.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../@warlock.js/seal/src/mutators/date-mutators.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Convert value to Date object
|
|
6
6
|
* Returns Invalid Date if value cannot be converted
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Mutator } from "../types/mutator-types.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../@warlock.js/seal/src/mutators/number-mutators.d.ts
|
|
4
4
|
/** Convert value to number */
|
|
5
5
|
declare const numberMutator: Mutator;
|
|
6
6
|
/** Round number to specified decimals */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { round } from "@mongez/reinforcements";
|
|
2
2
|
import { isNumeric } from "@mongez/supportive-is";
|
|
3
3
|
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../@warlock.js/seal/src/mutators/number-mutators.ts
|
|
5
5
|
/** Convert value to number */
|
|
6
6
|
const numberMutator = async (value) => {
|
|
7
7
|
if (!value) return value;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Mutator } from "../types/mutator-types.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../@warlock.js/seal/src/mutators/object-mutators.d.ts
|
|
4
4
|
/** Strip unknown keys from object */
|
|
5
5
|
declare const stripUnknownMutator: Mutator;
|
|
6
6
|
/** Trim all string values in object */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { trim } from "@mongez/reinforcements";
|
|
2
2
|
import { isPlainObject } from "@mongez/supportive-is";
|
|
3
3
|
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../@warlock.js/seal/src/mutators/object-mutators.ts
|
|
5
5
|
/** Strip unknown keys from object */
|
|
6
6
|
const stripUnknownMutator = async (value, context) => {
|
|
7
7
|
const allowedKeys = [...context?.ctx.schema ? Object.keys(context.ctx.schema) : [], ...context?.options.allowedKeys ?? []];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Mutator } from "../types/mutator-types.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../@warlock.js/seal/src/mutators/scalar-mutators.d.ts
|
|
4
4
|
declare const stringMutator: Mutator;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { stringMutator };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Mutator } from "../types/mutator-types.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../@warlock.js/seal/src/mutators/string-mutators.d.ts
|
|
4
4
|
/** Convert string to lowercase */
|
|
5
5
|
declare const lowercaseMutator: Mutator;
|
|
6
6
|
/** Convert string to uppercase */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { capitalize, ltrim, readMoreChars, rtrim, toCamelCase, toKebabCase, toSnakeCase, toStudlyCase, trim } from "@mongez/reinforcements";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../@warlock.js/seal/src/mutators/string-mutators.ts
|
|
4
4
|
/** Convert string to lowercase */
|
|
5
5
|
const lowercaseMutator = async (value) => {
|
|
6
6
|
return value?.toString().toLowerCase();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VALID_RULE, invalidRule } from "../../helpers/validation-helpers.mjs";
|
|
2
2
|
import "../../helpers/index.mjs";
|
|
3
3
|
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../@warlock.js/seal/src/rules/array/array-rules.ts
|
|
5
5
|
/**
|
|
6
6
|
* Unique array rule - array must contain unique values
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VALID_RULE, invalidRule } from "../../helpers/validation-helpers.mjs";
|
|
2
2
|
import "../../helpers/index.mjs";
|
|
3
3
|
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../@warlock.js/seal/src/rules/color/color-rules.ts
|
|
5
5
|
/**
|
|
6
6
|
* Color validation regex patterns
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VALID_RULE, invalidRule, resolveTranslation } from "../../helpers/validation-helpers.mjs";
|
|
2
2
|
import "../../helpers/index.mjs";
|
|
3
3
|
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../@warlock.js/seal/src/rules/common/enum.ts
|
|
5
5
|
/**
|
|
6
6
|
* Enum rule - value must be one of the enum values
|
|
7
7
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SchemaRule } from "../../types/rule-types.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../@warlock.js/seal/src/rules/common/equals-field-rules.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Equals field rule - value must equal another field's value
|
|
6
6
|
* Supports both global and sibling scope
|
|
@@ -2,7 +2,7 @@ import { getFieldValue } from "../../helpers/get-field-value.mjs";
|
|
|
2
2
|
import { VALID_RULE, invalidRule } from "../../helpers/validation-helpers.mjs";
|
|
3
3
|
import "../../helpers/index.mjs";
|
|
4
4
|
|
|
5
|
-
//#region
|
|
5
|
+
//#region ../@warlock.js/seal/src/rules/common/equals-field-rules.ts
|
|
6
6
|
/**
|
|
7
7
|
* Equals field rule - value must equal another field's value
|
|
8
8
|
* Supports both global and sibling scope
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SchemaRule } from "../../types/rule-types.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../@warlock.js/seal/src/rules/common/instanceof.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* InstanceOf rule - value must be an instance of the given constructor.
|
|
6
6
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VALID_RULE, invalidRule } from "../../helpers/validation-helpers.mjs";
|
|
2
2
|
import "../../helpers/index.mjs";
|
|
3
3
|
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../@warlock.js/seal/src/rules/common/instanceof.ts
|
|
5
5
|
/**
|
|
6
6
|
* InstanceOf rule - value must be an instance of the given constructor.
|
|
7
7
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SchemaRule } from "../../types/rule-types.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../@warlock.js/seal/src/rules/common/literal.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Literal rule - value must be strictly equal to one of the literal values.
|
|
6
6
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VALID_RULE, invalidRule, resolveTranslation } from "../../helpers/validation-helpers.mjs";
|
|
2
2
|
import "../../helpers/index.mjs";
|
|
3
3
|
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../@warlock.js/seal/src/rules/common/literal.ts
|
|
5
5
|
/**
|
|
6
6
|
* Literal rule - value must be strictly equal to one of the literal values.
|
|
7
7
|
*
|
|
@@ -2,7 +2,7 @@ import { VALID_RULE, invalidRule } from "../../helpers/validation-helpers.mjs";
|
|
|
2
2
|
import "../../helpers/index.mjs";
|
|
3
3
|
import { isObject, isPlainObject } from "@mongez/supportive-is";
|
|
4
4
|
|
|
5
|
-
//#region
|
|
5
|
+
//#region ../@warlock.js/seal/src/rules/common/type-rules.ts
|
|
6
6
|
/**
|
|
7
7
|
* String rule - validates string type
|
|
8
8
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Schema } from "../../types/schema-types.mjs";
|
|
2
2
|
import { SchemaRule } from "../../types/rule-types.mjs";
|
|
3
3
|
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../@warlock.js/seal/src/rules/common/unknown-key.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Unknown key rule - validates that object doesn't have unknown keys
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VALID_RULE, invalidRule } from "../../helpers/validation-helpers.mjs";
|
|
2
2
|
import "../../helpers/index.mjs";
|
|
3
3
|
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../@warlock.js/seal/src/rules/common/unknown-key.ts
|
|
5
5
|
/**
|
|
6
6
|
* Unknown key rule - validates that object doesn't have unknown keys
|
|
7
7
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SchemaRule } from "../../types/rule-types.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../@warlock.js/seal/src/rules/conditional/forbidden-if-rules.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Forbidden if rule - field is forbidden if another field equals a specific value
|
|
6
6
|
* Supports both global and sibling scope
|
|
@@ -3,7 +3,7 @@ import { VALID_RULE, invalidRule } from "../../helpers/validation-helpers.mjs";
|
|
|
3
3
|
import "../../helpers/index.mjs";
|
|
4
4
|
import { isEmptyValue } from "../../helpers/is-empty-value.mjs";
|
|
5
5
|
|
|
6
|
-
//#region
|
|
6
|
+
//#region ../@warlock.js/seal/src/rules/conditional/forbidden-if-rules.ts
|
|
7
7
|
/**
|
|
8
8
|
* Forbidden if rule - field is forbidden if another field equals a specific value
|
|
9
9
|
* Supports both global and sibling scope
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SchemaRule } from "../../types/rule-types.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../@warlock.js/seal/src/rules/conditional/present-if-rules.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Present if rule - field must be present if another field equals a specific value
|
|
6
6
|
* Supports both global and sibling scope
|
|
@@ -3,7 +3,7 @@ import { VALID_RULE, invalidRule } from "../../helpers/validation-helpers.mjs";
|
|
|
3
3
|
import "../../helpers/index.mjs";
|
|
4
4
|
import { isEmptyValue } from "../../helpers/is-empty-value.mjs";
|
|
5
5
|
|
|
6
|
-
//#region
|
|
6
|
+
//#region ../@warlock.js/seal/src/rules/conditional/present-if-rules.ts
|
|
7
7
|
/**
|
|
8
8
|
* Present if rule - field must be present if another field equals a specific value
|
|
9
9
|
* Supports both global and sibling scope
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SchemaRule } from "../../types/rule-types.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../@warlock.js/seal/src/rules/conditional/present-unless-rules.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Present unless rule - field must be present unless another field equals a specific value
|
|
6
6
|
* Supports both global and sibling scope
|
|
@@ -2,7 +2,7 @@ import { getFieldValue } from "../../helpers/get-field-value.mjs";
|
|
|
2
2
|
import { VALID_RULE, invalidRule } from "../../helpers/validation-helpers.mjs";
|
|
3
3
|
import "../../helpers/index.mjs";
|
|
4
4
|
|
|
5
|
-
//#region
|
|
5
|
+
//#region ../@warlock.js/seal/src/rules/conditional/present-unless-rules.ts
|
|
6
6
|
/**
|
|
7
7
|
* Present unless rule - field must be present unless another field equals a specific value
|
|
8
8
|
* Supports both global and sibling scope
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SchemaRule } from "../../types/rule-types.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../@warlock.js/seal/src/rules/conditional/present-with-rules.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Present with rule - field must be present if another field is present
|
|
6
6
|
* Supports both global and sibling scope
|
|
@@ -3,7 +3,7 @@ import { VALID_RULE, invalidRule } from "../../helpers/validation-helpers.mjs";
|
|
|
3
3
|
import "../../helpers/index.mjs";
|
|
4
4
|
import { get } from "@mongez/reinforcements";
|
|
5
5
|
|
|
6
|
-
//#region
|
|
6
|
+
//#region ../@warlock.js/seal/src/rules/conditional/present-with-rules.ts
|
|
7
7
|
/**
|
|
8
8
|
* Present with rule - field must be present if another field is present
|
|
9
9
|
* Supports both global and sibling scope
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SchemaRule } from "../../types/rule-types.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../@warlock.js/seal/src/rules/conditional/present-without-rules.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Present without rule - field must be present if another field is missing
|
|
6
6
|
* Supports both global and sibling scope
|
|
@@ -3,7 +3,7 @@ import { VALID_RULE, invalidRule } from "../../helpers/validation-helpers.mjs";
|
|
|
3
3
|
import "../../helpers/index.mjs";
|
|
4
4
|
import { get } from "@mongez/reinforcements";
|
|
5
5
|
|
|
6
|
-
//#region
|
|
6
|
+
//#region ../@warlock.js/seal/src/rules/conditional/present-without-rules.ts
|
|
7
7
|
/**
|
|
8
8
|
* Present without rule - field must be present if another field is missing
|
|
9
9
|
* Supports both global and sibling scope
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SchemaRule } from "../../types/rule-types.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../@warlock.js/seal/src/rules/conditional/required-if-rules.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Required if rule - field is required if another field equals a specific value
|
|
6
6
|
* Supports both global and sibling scope
|
|
@@ -4,7 +4,7 @@ import "../../helpers/index.mjs";
|
|
|
4
4
|
import { isEmptyValue } from "../../helpers/is-empty-value.mjs";
|
|
5
5
|
import { get } from "@mongez/reinforcements";
|
|
6
6
|
|
|
7
|
-
//#region
|
|
7
|
+
//#region ../@warlock.js/seal/src/rules/conditional/required-if-rules.ts
|
|
8
8
|
/**
|
|
9
9
|
* Required if rule - field is required if another field equals a specific value
|
|
10
10
|
* Supports both global and sibling scope
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SchemaRule } from "../../types/rule-types.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../@warlock.js/seal/src/rules/conditional/required-unless-rules.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Required unless rule - field is required unless another field equals a specific value
|
|
6
6
|
* Supports both global and sibling scope
|
|
@@ -3,7 +3,7 @@ import { VALID_RULE, invalidRule } from "../../helpers/validation-helpers.mjs";
|
|
|
3
3
|
import "../../helpers/index.mjs";
|
|
4
4
|
import { isEmptyValue } from "../../helpers/is-empty-value.mjs";
|
|
5
5
|
|
|
6
|
-
//#region
|
|
6
|
+
//#region ../@warlock.js/seal/src/rules/conditional/required-unless-rules.ts
|
|
7
7
|
/**
|
|
8
8
|
* Required unless rule - field is required unless another field equals a specific value
|
|
9
9
|
* Supports both global and sibling scope
|