reslib 1.1.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/README.md +9 -5
  2. package/build/auth/index.js +2 -2
  3. package/build/countries/index.js +2 -2
  4. package/build/currency/index.js +2 -2
  5. package/build/currency/session.js +2 -2
  6. package/build/exception/index.d.ts +1908 -0
  7. package/build/exception/index.js +5 -0
  8. package/build/i18n/index.d.ts +12 -4
  9. package/build/i18n/index.js +2 -2
  10. package/build/inputFormatter/index.js +2 -2
  11. package/build/logger/index.js +2 -2
  12. package/build/resources/ResourcePaginationHelper.js +1 -1
  13. package/build/resources/decorators/index.js +1 -1
  14. package/build/resources/fields/index.d.ts +5 -5
  15. package/build/resources/fields/index.js +1 -1
  16. package/build/resources/index.d.ts +1 -1
  17. package/build/resources/index.js +3 -3
  18. package/build/translations/index.d.ts +36 -4
  19. package/build/translations/index.js +2 -2
  20. package/build/translations/validator.en.d.ts +69 -4
  21. package/build/translations/validator.en.js +2 -2
  22. package/build/types/index.d.ts +21 -0
  23. package/build/utils/date/dateHelper.js +2 -2
  24. package/build/utils/date/index.js +2 -2
  25. package/build/utils/index.d.ts +2 -2
  26. package/build/utils/index.js +3 -3
  27. package/build/utils/interpolate.js +1 -1
  28. package/build/utils/isTime.js +1 -1
  29. package/build/utils/numbers.js +2 -2
  30. package/build/utils/object.js +1 -1
  31. package/build/validator/errors/index.d.ts +299 -0
  32. package/build/validator/errors/index.js +1 -0
  33. package/build/validator/index.d.ts +1 -0
  34. package/build/validator/index.js +3 -3
  35. package/build/validator/rules/array.js +2 -2
  36. package/build/validator/rules/boolean.js +2 -2
  37. package/build/validator/rules/date.js +2 -2
  38. package/build/validator/rules/default.js +2 -2
  39. package/build/validator/rules/enum.js +2 -2
  40. package/build/validator/rules/file.js +2 -2
  41. package/build/validator/rules/format.d.ts +13 -13
  42. package/build/validator/rules/format.js +3 -3
  43. package/build/validator/rules/index.js +3 -3
  44. package/build/validator/rules/multiRules.d.ts +10 -10
  45. package/build/validator/rules/multiRules.js +2 -2
  46. package/build/validator/rules/numeric.d.ts +8 -8
  47. package/build/validator/rules/numeric.js +2 -2
  48. package/build/validator/rules/object.js +2 -2
  49. package/build/validator/rules/string.d.ts +6 -6
  50. package/build/validator/rules/string.js +2 -2
  51. package/build/validator/rules/target.d.ts +8 -8
  52. package/build/validator/rules/target.js +2 -2
  53. package/build/validator/rules.types.d.ts +167 -0
  54. package/build/validator/rules.types.js +1 -0
  55. package/build/validator/types.d.ts +832 -1286
  56. package/build/validator/validator.d.ts +554 -867
  57. package/build/validator/validator.js +2 -2
  58. package/lib/cjs/exception.js +1 -0
  59. package/lib/esm/exception.mjs +2 -0
  60. package/package.json +6 -1
@@ -144,7 +144,7 @@ import { IsUrlOptions } from '../../utils/uri';
144
144
  *
145
145
  * @returns {PropertyDecorator} A property decorator that validates email format
146
146
  *
147
- * @throws {ValidationError} When validation fails, containing localized error message
147
+ * @throws {ValidatorError} When validation fails, containing localized error message
148
148
  *
149
149
  * @example
150
150
  * ```typescript
@@ -366,7 +366,7 @@ export declare const IsHexadecimal: () => PropertyDecorator;
366
366
  * @param options.allowedProtocols - Array of allowed protocols without colons
367
367
  * @returns A property decorator that validates URL format
368
368
  *
369
- * @throws {ValidationError} When validation fails, containing localized error message
369
+ * @throws {ValidatorError} When validation fails, containing localized error message
370
370
  *
371
371
  * @example
372
372
  * ```typescript
@@ -527,7 +527,7 @@ export declare const IsUrl: (options?: IsUrlOptions | undefined) => PropertyDeco
527
527
  * @param options.countryCode - Country code to validate against specific country's format
528
528
  * @returns A property decorator that validates phone number format
529
529
  *
530
- * @throws {ValidationError} When validation fails, containing localized error message
530
+ * @throws {ValidatorError} When validation fails, containing localized error message
531
531
  *
532
532
  * @example
533
533
  * ```typescript
@@ -694,7 +694,7 @@ export declare const IsPhoneNumber: (countryCode?: "AF" | "AL" | "DZ" | "AS" | "
694
694
  * @param options.phoneNumber - Phone validation options with country code
695
695
  * @returns A property decorator that validates email or phone number format
696
696
  *
697
- * @throws {ValidationError} When validation fails, containing localized error message
697
+ * @throws {ValidatorError} When validation fails, containing localized error message
698
698
  *
699
699
  * @example
700
700
  * ```typescript
@@ -840,7 +840,7 @@ export declare const IsEmailOrPhone: (options?: {
840
840
  *
841
841
  * @returns A property decorator that validates file name format
842
842
  *
843
- * @throws {ValidationError} When validation fails, containing localized error message
843
+ * @throws {ValidatorError} When validation fails, containing localized error message
844
844
  *
845
845
  * @example
846
846
  * ```typescript
@@ -980,7 +980,7 @@ export declare const IsFileName: () => PropertyDecorator;
980
980
  *
981
981
  * @returns A property decorator that validates UUID format
982
982
  *
983
- * @throws {ValidationError} When validation fails, containing localized error message
983
+ * @throws {ValidatorError} When validation fails, containing localized error message
984
984
  *
985
985
  * @example
986
986
  * ```typescript
@@ -1126,7 +1126,7 @@ export declare const IsUUID: () => PropertyDecorator;
1126
1126
  *
1127
1127
  * @returns A property decorator that validates JSON format
1128
1128
  *
1129
- * @throws {ValidationError} When validation fails, containing localized error message
1129
+ * @throws {ValidatorError} When validation fails, containing localized error message
1130
1130
  *
1131
1131
  * @example
1132
1132
  * ```typescript
@@ -1264,7 +1264,7 @@ export declare const IsJSON: () => PropertyDecorator;
1264
1264
  *
1265
1265
  * @returns A property decorator that validates Base64 format
1266
1266
  *
1267
- * @throws {ValidationError} When validation fails, containing localized error message
1267
+ * @throws {ValidatorError} When validation fails, containing localized error message
1268
1268
  *
1269
1269
  * @example
1270
1270
  * ```typescript
@@ -1406,7 +1406,7 @@ export declare const IsBase64: () => PropertyDecorator;
1406
1406
  *
1407
1407
  * @returns A property decorator that validates hexadecimal color format
1408
1408
  *
1409
- * @throws {ValidationError} When validation fails, containing localized error message
1409
+ * @throws {ValidatorError} When validation fails, containing localized error message
1410
1410
  *
1411
1411
  * @example
1412
1412
  * ```typescript
@@ -1554,7 +1554,7 @@ export declare const IsHexColor: () => PropertyDecorator;
1554
1554
  *
1555
1555
  * @returns A property decorator that validates credit card number format and checksum
1556
1556
  *
1557
- * @throws {ValidationError} When validation fails, containing localized error message
1557
+ * @throws {ValidatorError} When validation fails, containing localized error message
1558
1558
  *
1559
1559
  * @example
1560
1560
  * ```typescript
@@ -1718,7 +1718,7 @@ export declare const IsCreditCard: () => PropertyDecorator;
1718
1718
  * @param ruleParams[0] - IP version: "4" (IPv4 only), "6" (IPv6 only), or "4/6" (both, default)
1719
1719
  * @returns A property decorator that validates IP address format
1720
1720
  *
1721
- * @throws {ValidationError} When validation fails, containing localized error message
1721
+ * @throws {ValidatorError} When validation fails, containing localized error message
1722
1722
  *
1723
1723
  * @example
1724
1724
  * ```typescript
@@ -1875,7 +1875,7 @@ export declare const IsIP: (...ruleParameters: string[]) => PropertyDecorator;
1875
1875
  *
1876
1876
  * @returns A property decorator that validates MAC address format
1877
1877
  *
1878
- * @throws {ValidationError} When validation fails, containing localized error message
1878
+ * @throws {ValidatorError} When validation fails, containing localized error message
1879
1879
  *
1880
1880
  * @example
1881
1881
  * ```typescript
@@ -2035,7 +2035,7 @@ export declare const IsMACAddress: () => PropertyDecorator;
2035
2035
  * @param ruleParams[1] - Optional custom error message key for i18n translation
2036
2036
  * @returns A property decorator that validates string patterns using regular expressions
2037
2037
  *
2038
- * @throws {ValidationError} When validation fails, containing localized error message
2038
+ * @throws {ValidatorError} When validation fails, containing localized error message
2039
2039
  *
2040
2040
  * @example
2041
2041
  * ```typescript