querier-ts 2.0.2 → 2.1.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 (79) hide show
  1. package/README.md +132 -78
  2. package/lib/__tests__/query.spec.d.ts +1 -0
  3. package/lib/__tests__/query.spec.d.ts.map +1 -0
  4. package/lib/__tests__/query.spec.js +193 -87
  5. package/lib/__tests__/query.spec.js.map +1 -0
  6. package/lib/core/errors/__tests__/invalid-argument-error.spec.d.ts +1 -0
  7. package/lib/core/errors/__tests__/invalid-argument-error.spec.d.ts.map +1 -0
  8. package/lib/core/errors/__tests__/invalid-argument-error.spec.js +7 -45
  9. package/lib/core/errors/__tests__/invalid-argument-error.spec.js.map +1 -0
  10. package/lib/core/errors/invalid-argument-error.d.ts +1 -12
  11. package/lib/core/errors/invalid-argument-error.d.ts.map +1 -1
  12. package/lib/core/errors/invalid-argument-error.js +2 -8
  13. package/lib/core/errors/invalid-argument-error.js.map +1 -1
  14. package/lib/core/types/nullable-condition.d.ts +2 -0
  15. package/lib/core/types/nullable-condition.d.ts.map +1 -0
  16. package/lib/core/types/nullable-condition.js +2 -0
  17. package/lib/core/types/nullable-condition.js.map +1 -0
  18. package/lib/core/types/query-conditions-group-nullable.d.ts +2 -1
  19. package/lib/core/types/query-conditions-group-nullable.d.ts.map +1 -1
  20. package/lib/core/types/validation-options.d.ts +4 -0
  21. package/lib/core/types/validation-options.d.ts.map +1 -0
  22. package/lib/core/types/validation-options.js +2 -0
  23. package/lib/core/types/validation-options.js.map +1 -0
  24. package/lib/core/validation/__tests__/query-row-validator.spec.d.ts +1 -0
  25. package/lib/core/validation/__tests__/query-row-validator.spec.d.ts.map +1 -0
  26. package/lib/core/validation/__tests__/query-row-validator.spec.js +48 -87
  27. package/lib/core/validation/__tests__/query-row-validator.spec.js.map +1 -0
  28. package/lib/core/validation/decorators/__tests__/number-validation.spec.d.ts +2 -1
  29. package/lib/core/validation/decorators/__tests__/number-validation.spec.d.ts.map +1 -0
  30. package/lib/core/validation/decorators/__tests__/number-validation.spec.js +40 -24
  31. package/lib/core/validation/decorators/__tests__/number-validation.spec.js.map +1 -0
  32. package/lib/core/validation/decorators/number-validaton.d.ts.map +1 -1
  33. package/lib/core/validation/decorators/number-validaton.js +6 -18
  34. package/lib/core/validation/decorators/number-validaton.js.map +1 -1
  35. package/lib/core/validation/query-row-validator.d.ts +6 -40
  36. package/lib/core/validation/query-row-validator.d.ts.map +1 -1
  37. package/lib/core/validation/query-row-validator.js +22 -44
  38. package/lib/core/validation/query-row-validator.js.map +1 -1
  39. package/lib/query.d.ts +18 -17
  40. package/lib/query.d.ts.map +1 -1
  41. package/lib/query.js +57 -59
  42. package/lib/query.js.map +1 -1
  43. package/lib/utils/functions/generic/__tests__/compare-arrays.spec.d.ts +1 -0
  44. package/lib/utils/functions/generic/__tests__/compare-arrays.spec.d.ts.map +1 -0
  45. package/lib/utils/functions/generic/__tests__/compare-arrays.spec.js +6 -7
  46. package/lib/utils/functions/generic/__tests__/compare-arrays.spec.js.map +1 -0
  47. package/lib/utils/functions/generic/__tests__/deep-equal.spec.d.ts +1 -0
  48. package/lib/utils/functions/generic/__tests__/deep-equal.spec.d.ts.map +1 -0
  49. package/lib/utils/functions/generic/__tests__/deep-equal.spec.js +25 -26
  50. package/lib/utils/functions/generic/__tests__/deep-equal.spec.js.map +1 -0
  51. package/lib/utils/functions/generic/__tests__/get-entries.spec.d.ts +1 -0
  52. package/lib/utils/functions/generic/__tests__/get-entries.spec.d.ts.map +1 -0
  53. package/lib/utils/functions/generic/__tests__/get-entries.spec.js +7 -8
  54. package/lib/utils/functions/generic/__tests__/get-entries.spec.js.map +1 -0
  55. package/lib/utils/functions/generic/__tests__/get-object-property-names.spec.d.ts +2 -0
  56. package/lib/utils/functions/generic/__tests__/get-object-property-names.spec.d.ts.map +1 -0
  57. package/lib/utils/functions/generic/__tests__/get-object-property-names.spec.js +82 -0
  58. package/lib/utils/functions/generic/__tests__/get-object-property-names.spec.js.map +1 -0
  59. package/lib/utils/functions/sort/__tests__/sort-by-properties.spec.d.ts +1 -0
  60. package/lib/utils/functions/sort/__tests__/sort-by-properties.spec.d.ts.map +1 -0
  61. package/lib/utils/functions/sort/__tests__/sort-by-properties.spec.js +10 -11
  62. package/lib/utils/functions/sort/__tests__/sort-by-properties.spec.js.map +1 -0
  63. package/lib/utils/functions/sort/__tests__/sort-by-property.spec.d.ts +1 -0
  64. package/lib/utils/functions/sort/__tests__/sort-by-property.spec.d.ts.map +1 -0
  65. package/lib/utils/functions/sort/__tests__/sort-by-property.spec.js +24 -12
  66. package/lib/utils/functions/sort/__tests__/sort-by-property.spec.js.map +1 -0
  67. package/lib/utils/functions/type-guards/__tests__/is-function.spec.d.ts +1 -0
  68. package/lib/utils/functions/type-guards/__tests__/is-function.spec.d.ts.map +1 -0
  69. package/lib/utils/functions/type-guards/__tests__/is-function.spec.js +14 -15
  70. package/lib/utils/functions/type-guards/__tests__/is-function.spec.js.map +1 -0
  71. package/lib/utils/functions/type-guards/__tests__/is-number.spec.d.ts +1 -0
  72. package/lib/utils/functions/type-guards/__tests__/is-number.spec.d.ts.map +1 -0
  73. package/lib/utils/functions/type-guards/__tests__/is-number.spec.js +19 -20
  74. package/lib/utils/functions/type-guards/__tests__/is-number.spec.js.map +1 -0
  75. package/lib/utils/functions/type-guards/__tests__/is-object.spec.d.ts +1 -0
  76. package/lib/utils/functions/type-guards/__tests__/is-object.spec.d.ts.map +1 -0
  77. package/lib/utils/functions/type-guards/__tests__/is-object.spec.js +19 -20
  78. package/lib/utils/functions/type-guards/__tests__/is-object.spec.js.map +1 -0
  79. package/package.json +15 -13
@@ -1,54 +1,16 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const invalid_argument_error_1 = require("../invalid-argument-error");
1
+ import { InvalidArgumentError } from '../invalid-argument-error';
4
2
  describe('InvalidArgumentError', () => {
5
3
  it('should be an instance of Error', () => {
6
- const error = new invalid_argument_error_1.InvalidArgumentError({
7
- method: 'testMethod',
8
- param: 'value',
9
- argument: 123,
10
- expected: 'a string',
11
- });
4
+ const error = new InvalidArgumentError('Test error');
12
5
  expect(error).toBeInstanceOf(Error);
13
6
  });
14
7
  it('should have the correct name', () => {
15
- const error = new invalid_argument_error_1.InvalidArgumentError({
16
- method: 'testMethod',
17
- param: 'value',
18
- argument: 123,
19
- expected: 'a string',
20
- });
8
+ const error = new InvalidArgumentError('Test error');
21
9
  expect(error.name).toBe('InvalidArgumentError');
22
10
  });
23
- it('should generate the correct error message', () => {
24
- const error = new invalid_argument_error_1.InvalidArgumentError({
25
- method: 'doSomething',
26
- param: 0,
27
- argument: false,
28
- expected: 'a boolean',
29
- });
30
- expect(error.message).toBe('false is not a valid argument to param 0 on doSomething(). It should be a boolean.');
31
- });
32
- it('should expose configuration properties', () => {
33
- const config = {
34
- method: 'save',
35
- param: 'id',
36
- argument: null,
37
- expected: 'a non-null value',
38
- };
39
- const error = new invalid_argument_error_1.InvalidArgumentError(config);
40
- expect(error.method).toBe(config.method);
41
- expect(error.param).toBe(config.param);
42
- expect(error.argument).toBe(config.argument);
43
- expect(error.expected).toBe(config.expected);
44
- });
45
- it('should preserve prototype chain', () => {
46
- const error = new invalid_argument_error_1.InvalidArgumentError({
47
- method: 'run',
48
- param: 'options',
49
- argument: {},
50
- expected: 'a valid options object',
51
- });
52
- expect(error instanceof invalid_argument_error_1.InvalidArgumentError).toBe(true);
11
+ it('should have the correct message', () => {
12
+ const error = new InvalidArgumentError('Test error');
13
+ expect(error.message).toBe('Test error');
53
14
  });
54
15
  });
16
+ //# sourceMappingURL=invalid-argument-error.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invalid-argument-error.spec.js","sourceRoot":"","sources":["../../../../src/core/errors/__tests__/invalid-argument-error.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;QACxC,MAAM,KAAK,GAAG,IAAI,oBAAoB,CAAC,YAAY,CAAC,CAAC;QAErD,MAAM,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;QACtC,MAAM,KAAK,GAAG,IAAI,oBAAoB,CAAC,YAAY,CAAC,CAAC;QAErD,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE;QACzC,MAAM,KAAK,GAAG,IAAI,oBAAoB,CAAC,YAAY,CAAC,CAAC;QAErD,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,15 +1,4 @@
1
- interface InvalidArgumentErrorConfig {
2
- method: string;
3
- param: string | number;
4
- argument: unknown;
5
- expected: string;
6
- }
7
1
  export declare class InvalidArgumentError extends Error {
8
- readonly method: string;
9
- readonly param: string | number;
10
- readonly argument: unknown;
11
- readonly expected: string;
12
- constructor({ method, param, argument, expected, }: InvalidArgumentErrorConfig);
2
+ constructor(message: string);
13
3
  }
14
- export {};
15
4
  //# sourceMappingURL=invalid-argument-error.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"invalid-argument-error.d.ts","sourceRoot":"","sources":["../../../src/core/errors/invalid-argument-error.ts"],"names":[],"mappings":"AAAA,UAAU,0BAA0B;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,SAAgB,MAAM,EAAE,MAAM,CAAC;IAC/B,SAAgB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvC,SAAgB,QAAQ,EAAE,OAAO,CAAC;IAClC,SAAgB,QAAQ,EAAE,MAAM,CAAC;gBAErB,EACV,MAAM,EACN,KAAK,EACL,QAAQ,EACR,QAAQ,GACT,EAAE,0BAA0B;CAc9B"}
1
+ {"version":3,"file":"invalid-argument-error.d.ts","sourceRoot":"","sources":["../../../src/core/errors/invalid-argument-error.ts"],"names":[],"mappings":"AAAA,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,OAAO,EAAE,MAAM;CAI5B"}
@@ -1,13 +1,7 @@
1
1
  export class InvalidArgumentError extends Error {
2
- constructor({ method, param, argument, expected, }) {
3
- super(`${String(argument)} is not a valid argument to param ${param} on ${method}(). ` +
4
- `It should be ${expected}.`);
2
+ constructor(message) {
3
+ super(message);
5
4
  this.name = 'InvalidArgumentError';
6
- this.method = method;
7
- this.param = param;
8
- this.argument = argument;
9
- this.expected = expected;
10
- Object.setPrototypeOf(this, new.target.prototype);
11
5
  }
12
6
  }
13
7
  //# sourceMappingURL=invalid-argument-error.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"invalid-argument-error.js","sourceRoot":"","sources":["../../../src/core/errors/invalid-argument-error.ts"],"names":[],"mappings":"AAOA,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAM7C,YAAY,EACV,MAAM,EACN,KAAK,EACL,QAAQ,EACR,QAAQ,GACmB;QAC3B,KAAK,CACH,GAAG,MAAM,CAAC,QAAQ,CAAC,qCAAqC,KAAK,OAAO,MAAM,MAAM;YAC9E,gBAAgB,QAAQ,GAAG,CAC9B,CAAC;QAEF,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;QACnC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACpD,CAAC;CACF"}
1
+ {"version":3,"file":"invalid-argument-error.js","sourceRoot":"","sources":["../../../src/core/errors/invalid-argument-error.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF"}
@@ -0,0 +1,2 @@
1
+ export type NullableCondition<T> = T | ((value: T) => boolean) | null | undefined;
2
+ //# sourceMappingURL=nullable-condition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nullable-condition.d.ts","sourceRoot":"","sources":["../../../src/core/types/nullable-condition.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAC3B,CAAC,GACD,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC,GACvB,IAAI,GACJ,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=nullable-condition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nullable-condition.js","sourceRoot":"","sources":["../../../src/core/types/nullable-condition.ts"],"names":[],"mappings":""}
@@ -1,5 +1,6 @@
1
1
  import type { PropertyOnly } from '../../utils/types';
2
+ import type { NullableCondition } from './nullable-condition';
2
3
  export type QueryConditionsGroupNullable<T extends object> = {
3
- [P in keyof PropertyOnly<T>]?: T[P] extends object ? QueryConditionsGroupNullable<T[P]> : T[P] | ((value: T[P]) => boolean) | null;
4
+ [P in keyof PropertyOnly<T>]?: T[P] extends object ? QueryConditionsGroupNullable<T[P]> : NullableCondition<T[P]>;
4
5
  };
5
6
  //# sourceMappingURL=query-conditions-group-nullable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"query-conditions-group-nullable.d.ts","sourceRoot":"","sources":["../../../src/core/types/query-conditions-group-nullable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,MAAM,4BAA4B,CAAC,CAAC,SAAS,MAAM,IAAI;KAC1D,CAAC,IAAI,MAAM,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAC9C,4BAA4B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAClC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,GAAG,IAAI;CAC7C,CAAC"}
1
+ {"version":3,"file":"query-conditions-group-nullable.d.ts","sourceRoot":"","sources":["../../../src/core/types/query-conditions-group-nullable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,MAAM,MAAM,4BAA4B,CAAC,CAAC,SAAS,MAAM,IAAI;KAC1D,CAAC,IAAI,MAAM,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAC9C,4BAA4B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAClC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAC5B,CAAC"}
@@ -0,0 +1,4 @@
1
+ export interface ValidationOptions {
2
+ ignoreNullValues: boolean;
3
+ }
4
+ //# sourceMappingURL=validation-options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation-options.d.ts","sourceRoot":"","sources":["../../../src/core/types/validation-options.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,gBAAgB,EAAE,OAAO,CAAC;CAC3B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=validation-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation-options.js","sourceRoot":"","sources":["../../../src/core/types/validation-options.ts"],"names":[],"mappings":""}
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=query-row-validator.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-row-validator.spec.d.ts","sourceRoot":"","sources":["../../../../src/core/validation/__tests__/query-row-validator.spec.ts"],"names":[],"mappings":""}
@@ -1,26 +1,18 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const query_row_validator_1 = require("../query-row-validator");
1
+ import { QueryRowValidator } from '../query-row-validator';
4
2
  describe('QueryRowValidator', () => {
5
3
  describe('primitive comparisons', () => {
6
4
  it('should validate equality for primitive values', () => {
7
5
  const row = { id: 1, name: 'Alice' };
8
- const result = query_row_validator_1.QueryRowValidator.validate(row, {
9
- conditionsObject: {
10
- id: 1,
11
- name: 'Alice',
12
- },
13
- ignoreNullValues: false,
6
+ const result = QueryRowValidator.validate(row, {
7
+ id: 1,
8
+ name: 'Alice',
14
9
  });
15
10
  expect(result).toBe(true);
16
11
  });
17
12
  it('should return false when primitive values differ', () => {
18
13
  const row = { id: 1 };
19
- const result = query_row_validator_1.QueryRowValidator.validate(row, {
20
- conditionsObject: {
21
- id: 2,
22
- },
23
- ignoreNullValues: false,
14
+ const result = QueryRowValidator.validate(row, {
15
+ id: 2,
24
16
  });
25
17
  expect(result).toBe(false);
26
18
  });
@@ -28,21 +20,15 @@ describe('QueryRowValidator', () => {
28
20
  describe('function conditions', () => {
29
21
  it('should validate using a function condition', () => {
30
22
  const row = { age: 30 };
31
- const result = query_row_validator_1.QueryRowValidator.validate(row, {
32
- conditionsObject: {
33
- age: (value) => value > 18,
34
- },
35
- ignoreNullValues: false,
23
+ const result = QueryRowValidator.validate(row, {
24
+ age: (value) => value > 18,
36
25
  });
37
26
  expect(result).toBe(true);
38
27
  });
39
28
  it('should return false when function condition fails', () => {
40
29
  const row = { age: 15 };
41
- const result = query_row_validator_1.QueryRowValidator.validate(row, {
42
- conditionsObject: {
43
- age: (value) => value > 18,
44
- },
45
- ignoreNullValues: false,
30
+ const result = QueryRowValidator.validate(row, {
31
+ age: (value) => value > 18,
46
32
  });
47
33
  expect(result).toBe(false);
48
34
  });
@@ -50,31 +36,22 @@ describe('QueryRowValidator', () => {
50
36
  describe('array conditions', () => {
51
37
  it('should validate arrays using strict comparison', () => {
52
38
  const row = { tags: ['a', 'b'] };
53
- const result = query_row_validator_1.QueryRowValidator.validate(row, {
54
- conditionsObject: {
55
- tags: ['a', 'b'],
56
- },
57
- ignoreNullValues: false,
39
+ const result = QueryRowValidator.validate(row, {
40
+ tags: ['a', 'b'],
58
41
  });
59
42
  expect(result).toBe(true);
60
43
  });
61
44
  it('should return false for arrays with different values', () => {
62
45
  const row = { tags: ['a', 'b'] };
63
- const result = query_row_validator_1.QueryRowValidator.validate(row, {
64
- conditionsObject: {
65
- tags: ['a', 'c'],
66
- },
67
- ignoreNullValues: false,
46
+ const result = QueryRowValidator.validate(row, {
47
+ tags: ['a', 'c'],
68
48
  });
69
49
  expect(result).toBe(false);
70
50
  });
71
51
  it('should return false if condition is array but value is not', () => {
72
52
  const row = { tags: 'a,b' };
73
- const result = query_row_validator_1.QueryRowValidator.validate(row, {
74
- conditionsObject: {
75
- tags: ['a', 'b'],
76
- },
77
- ignoreNullValues: false,
53
+ const result = QueryRowValidator.validate(row, {
54
+ tags: ['a', 'b'],
78
55
  });
79
56
  expect(result).toBe(false);
80
57
  });
@@ -87,14 +64,11 @@ describe('QueryRowValidator', () => {
87
64
  age: 25,
88
65
  },
89
66
  };
90
- const result = query_row_validator_1.QueryRowValidator.validate(row, {
91
- conditionsObject: {
92
- user: {
93
- name: 'John',
94
- age: (value) => value >= 18,
95
- },
67
+ const result = QueryRowValidator.validate(row, {
68
+ user: {
69
+ name: 'John',
70
+ age: (value) => value >= 18,
96
71
  },
97
- ignoreNullValues: false,
98
72
  });
99
73
  expect(result).toBe(true);
100
74
  });
@@ -105,13 +79,10 @@ describe('QueryRowValidator', () => {
105
79
  age: 15,
106
80
  },
107
81
  };
108
- const result = query_row_validator_1.QueryRowValidator.validate(row, {
109
- conditionsObject: {
110
- user: {
111
- age: (value) => value >= 18,
112
- },
82
+ const result = QueryRowValidator.validate(row, {
83
+ user: {
84
+ age: (value) => value >= 18,
113
85
  },
114
- ignoreNullValues: false,
115
86
  });
116
87
  expect(result).toBe(false);
117
88
  });
@@ -119,11 +90,8 @@ describe('QueryRowValidator', () => {
119
90
  const row = {
120
91
  user: 'John',
121
92
  };
122
- const result = query_row_validator_1.QueryRowValidator.validate(row, {
123
- conditionsObject: {
124
- user: { name: 'John' },
125
- },
126
- ignoreNullValues: false,
93
+ const result = QueryRowValidator.validate(row, {
94
+ user: { name: 'John' },
127
95
  });
128
96
  expect(result).toBe(false);
129
97
  });
@@ -131,31 +99,29 @@ describe('QueryRowValidator', () => {
131
99
  describe('ignoreNullValues behavior', () => {
132
100
  it('should ignore null conditions when ignoreNullValues is true', () => {
133
101
  const row = { name: 'Alice' };
134
- const result = query_row_validator_1.QueryRowValidator.validate(row, {
135
- conditionsObject: {
136
- name: null,
137
- },
138
- ignoreNullValues: true,
139
- });
102
+ const result = QueryRowValidator.validate(row, {
103
+ name: null,
104
+ }, { ignoreNullValues: true });
140
105
  expect(result).toBe(true);
141
106
  });
142
107
  it('should ignore undefined conditions when ignoreNullValues is true', () => {
143
108
  const row = { name: 'Alice' };
144
- const result = query_row_validator_1.QueryRowValidator.validate(row, {
145
- conditionsObject: {
146
- name: undefined,
147
- },
148
- ignoreNullValues: true,
149
- });
109
+ const result = QueryRowValidator.validate(row, {
110
+ name: undefined,
111
+ }, { ignoreNullValues: true });
150
112
  expect(result).toBe(true);
151
113
  });
152
114
  it('should NOT ignore null when ignoreNullValues is false', () => {
153
115
  const row = { name: 'Alice' };
154
- const result = query_row_validator_1.QueryRowValidator.validate(row, {
155
- conditionsObject: {
156
- name: null,
157
- },
158
- ignoreNullValues: false,
116
+ const result = QueryRowValidator.validate(row, {
117
+ name: null,
118
+ }, { ignoreNullValues: false });
119
+ expect(result).toBe(false);
120
+ });
121
+ it('should use default options (ignoreNullValues = false)', () => {
122
+ const row = { name: 'Alice' };
123
+ const result = QueryRowValidator.validate(row, {
124
+ name: null,
159
125
  });
160
126
  expect(result).toBe(false);
161
127
  });
@@ -167,13 +133,10 @@ describe('QueryRowValidator', () => {
167
133
  active: true,
168
134
  roles: ['admin'],
169
135
  };
170
- const result = query_row_validator_1.QueryRowValidator.validate(row, {
171
- conditionsObject: {
172
- id: 1,
173
- active: true,
174
- roles: ['admin'],
175
- },
176
- ignoreNullValues: false,
136
+ const result = QueryRowValidator.validate(row, {
137
+ id: 1,
138
+ active: true,
139
+ roles: ['admin'],
177
140
  });
178
141
  expect(result).toBe(true);
179
142
  });
@@ -182,14 +145,12 @@ describe('QueryRowValidator', () => {
182
145
  id: 1,
183
146
  active: false,
184
147
  };
185
- const result = query_row_validator_1.QueryRowValidator.validate(row, {
186
- conditionsObject: {
187
- id: 1,
188
- active: true,
189
- },
190
- ignoreNullValues: false,
148
+ const result = QueryRowValidator.validate(row, {
149
+ id: 1,
150
+ active: true,
191
151
  });
192
152
  expect(result).toBe(false);
193
153
  });
194
154
  });
195
155
  });
156
+ //# sourceMappingURL=query-row-validator.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-row-validator.spec.js","sourceRoot":"","sources":["../../../../src/core/validation/__tests__/query-row-validator.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;QACrC,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;YACvD,MAAM,G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Root":"","sources":["../../../../../src/core/validation/decorators/__tests__/number-validation.spec.ts"],"names":[],"mappings":""}
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
2
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
3
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -8,10 +7,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
7
  var __param = (this && this.__param) || function (paramIndex, decorator) {
9
8
  return function (target, key) { decorator(target, key, paramIndex); }
10
9
  };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- require("reflect-metadata");
13
- const errors_1 = require("../../../errors");
14
- const number_validaton_1 = require("../number-validaton");
10
+ import { InvalidArgumentError } from '../../../errors';
11
+ import { integer, max, min, validateNumbers } from '../number-validaton';
15
12
  class TestService {
16
13
  sum(a, b, c) {
17
14
  return a + b + c;
@@ -24,19 +21,19 @@ class TestService {
24
21
  }
25
22
  }
26
23
  __decorate([
27
- number_validaton_1.validateNumbers,
28
- __param(0, (0, number_validaton_1.min)(0)),
29
- __param(1, (0, number_validaton_1.max)(10)),
30
- __param(2, number_validaton_1.integer)
24
+ validateNumbers,
25
+ __param(0, min(0)),
26
+ __param(1, max(10)),
27
+ __param(2, integer)
31
28
  ], TestService.prototype, "sum", null);
32
29
  __decorate([
33
- number_validaton_1.validateNumbers,
34
- __param(0, number_validaton_1.integer)
30
+ validateNumbers,
31
+ __param(0, integer)
35
32
  ], TestService.prototype, "onlyInteger", null);
36
33
  __decorate([
37
- number_validaton_1.validateNumbers,
38
- __param(0, (0, number_validaton_1.min)(5)),
39
- __param(0, (0, number_validaton_1.max)(10))
34
+ validateNumbers,
35
+ __param(0, min(5)),
36
+ __param(0, max(10))
40
37
  ], TestService.prototype, "ranged", null);
41
38
  describe('number decorators', () => {
42
39
  let service;
@@ -57,47 +54,65 @@ describe('number decorators', () => {
57
54
  });
58
55
  describe('min decorator', () => {
59
56
  it('should throw if value is less than min', () => {
60
- expect(() => service.sum(-1, 5, 3)).toThrow(errors_1.InvalidArgumentError);
57
+ expect(() => service.sum(-1, 5, 3)).toThrow(InvalidArgumentError);
61
58
  });
62
59
  it('should throw with correct error message', () => {
63
60
  try {
64
61
  service.sum(-1, 5, 3);
65
62
  }
66
63
  catch (e) {
67
- expect(e).toBeInstanceOf(errors_1.InvalidArgumentError);
64
+ expect(e).toBeInstanceOf(InvalidArgumentError);
68
65
  expect(e.message).toContain('equal or greater than 0');
69
66
  }
70
67
  });
71
68
  });
72
69
  describe('max decorator', () => {
73
70
  it('should throw if value is greater than max', () => {
74
- expect(() => service.sum(1, 20, 3)).toThrow(errors_1.InvalidArgumentError);
71
+ expect(() => service.sum(1, 20, 3)).toThrow(InvalidArgumentError);
75
72
  });
76
73
  it('should throw with correct error message', () => {
77
74
  try {
78
75
  service.sum(1, 20, 3);
79
76
  }
80
77
  catch (e) {
81
- expect(e).toBeInstanceOf(errors_1.InvalidArgumentError);
78
+ expect(e).toBeInstanceOf(InvalidArgumentError);
82
79
  expect(e.message).toContain('equal or less than 10');
83
80
  }
84
81
  });
82
+ describe('decorator override behavior', () => {
83
+ class OverrideService {
84
+ test(value) {
85
+ return value;
86
+ }
87
+ }
88
+ __decorate([
89
+ validateNumbers,
90
+ __param(0, max(10)),
91
+ __param(0, max(5))
92
+ ], OverrideService.prototype, "test", null);
93
+ const service = new OverrideService();
94
+ it('should override max value when decorator is applied multiple times', () => {
95
+ // valor final é 10 (último decorator executado)
96
+ expect(service.test(10)).toBe(10);
97
+ expect(() => service.test(11)).toThrow(InvalidArgumentError);
98
+ });
99
+ });
85
100
  });
86
101
  describe('integer decorator', () => {
87
102
  it('should throw if value is not an integer', () => {
88
- expect(() => service.onlyInteger(1.5)).toThrow(errors_1.InvalidArgumentError);
103
+ expect(() => service.onlyInteger(1.5)).toThrow(InvalidArgumentError);
89
104
  });
90
105
  it('should accept safe integers', () => {
91
106
  expect(service.onlyInteger(Number.MAX_SAFE_INTEGER)).toBe(Number.MAX_SAFE_INTEGER);
92
107
  });
93
108
  it('should throw if value is NaN', () => {
94
- expect(() => service.onlyInteger(NaN)).toThrow(errors_1.InvalidArgumentError);
109
+ expect(() => service.onlyInteger(NaN)).toThrow(InvalidArgumentError);
95
110
  });
96
111
  });
97
112
  describe('combined decorators', () => {
98
113
  it('should validate min and max together', () => {
99
- expect(() => service.ranged(4)).toThrow(errors_1.InvalidArgumentError);
100
- expect(() => service.ranged(11)).toThrow(errors_1.InvalidArgumentError);
114
+ expect(() => service.ranged(4)).toThrow(InvalidArgumentError);
115
+ expect(() => service.ranged(11)).toThrow(InvalidArgumentError);
101
116
  });
102
117
  it('should pass when all constraints are satisfied', () => {
103
118
  expect(service.ranged(7)).toBe(7);
@@ -105,10 +120,11 @@ describe('number decorators', () => {
105
120
  });
106
121
  describe('type validation', () => {
107
122
  it('should throw if value is not a number for min', () => {
108
- expect(() => service.sum('1', 5, 3)).toThrow(errors_1.InvalidArgumentError);
123
+ expect(() => service.sum('1', 5, 3)).toThrow(InvalidArgumentError);
109
124
  });
110
125
  it('should throw if value is not a number for max', () => {
111
- expect(() => service.sum(1, '5', 3)).toThrow(errors_1.InvalidArgumentError);
126
+ expect(() => service.sum(1, '5', 3)).toThrow(InvalidArgumentError);
112
127
  });
113
128
  });
114
129
  });
130
+ //# sourceMappingURL=number-validation.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number-validation.spec.js","sourceRoot":"","sources":["../../../../../src/core/validation/decorators/__tests__/number-validation.spec.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEzE,MAAM,WAAW;IAEf,GAAG,CAAS,CAAS,EAAW,CAAS,EA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CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"number-validaton.d.ts","sourceRoot":"","sources":["../../../../src/core/validation/decorators/number-validaton.ts"],"names":[],"mappings":"AAiCA,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,IAE7B,QAAQ,MAAM,EACd,aAAa,MAAM,GAAG,MAAM,EAC5B,OAAO,MAAM,KACZ,IAAI,CAWR;AAED,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,IAE7B,QAAQ,MAAM,EACd,aAAa,MAAM,GAAG,MAAM,EAC5B,OAAO,MAAM,KACZ,IAAI,CAWR;AAED,wBAAgB,OAAO,CACrB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAAG,MAAM,EAC5B,KAAK,EAAE,MAAM,GACZ,IAAI,CAUN;AAED,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EAEnB,UAAU,EAAE,uBAAuB,CAAC,GAAG,CAAC,GACvC,IAAI,CAgDN"}
1
+ {"version":3,"file":"number-validaton.d.ts","sourceRoot":"","sources":["../../../../src/core/validation/decorators/number-validaton.ts"],"names":[],"mappings":"AAiCA,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,IAE7B,QAAQ,MAAM,EACd,aAAa,MAAM,GAAG,MAAM,EAC5B,OAAO,MAAM,KACZ,IAAI,CAWR;AAED,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,IAE7B,QAAQ,MAAM,EACd,aAAa,MAAM,GAAG,MAAM,EAC5B,OAAO,MAAM,KACZ,IAAI,CAWR;AAED,wBAAgB,OAAO,CACrB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAAG,MAAM,EAC5B,KAAK,EAAE,MAAM,GACZ,IAAI,CAUN;AAED,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EAEnB,UAAU,EAAE,uBAAuB,CAAC,GAAG,CAAC,GACvC,IAAI,CA0CN"}
@@ -59,34 +59,22 @@ descriptor) {
59
59
  // MIN
60
60
  if (rule.min !== undefined) {
61
61
  if (!isNumber(value) || value < rule.min) {
62
- throw new InvalidArgumentError({
63
- method: propertyKey,
64
- param: rule.index,
65
- argument: value,
66
- expected: `equal or greater than ${rule.min}`,
67
- });
62
+ throw new InvalidArgumentError(`${String(value)} is not a valid argument to param ${rule.index} on ${propertyKey}(). ` +
63
+ `Expected value to be equal or greater than ${rule.min}.`);
68
64
  }
69
65
  }
70
66
  // MAX
71
67
  if (rule.max !== undefined) {
72
68
  if (!isNumber(value) || value > rule.max) {
73
- throw new InvalidArgumentError({
74
- method: propertyKey,
75
- param: rule.index,
76
- argument: value,
77
- expected: `equal or less than ${rule.max}`,
78
- });
69
+ throw new InvalidArgumentError(`${String(value)} is not a valid argument to param ${rule.index} on ${propertyKey}(). ` +
70
+ `Expected value to be equal or less than ${rule.max}.`);
79
71
  }
80
72
  }
81
73
  // INTEGER
82
74
  if (rule.integer) {
83
75
  if (!Number.isSafeInteger(value)) {
84
- throw new InvalidArgumentError({
85
- method: propertyKey,
86
- param: rule.index,
87
- argument: value,
88
- expected: 'an integer',
89
- });
76
+ throw new InvalidArgumentError(`${String(value)} is not a valid argument to param ${rule.index} on ${propertyKey}(). ` +
77
+ `Expected value to be an integer.`);
90
78
  }
91
79
  }
92
80
  }
@@ -1 +1 @@
1
- {"version":3,"file":"number-validaton.js","sourceRoot":"","sources":["../../../../src/core/validation/decorators/number-validaton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AASpD,MAAM,QAAQ,GAAG,IAAI,OAAO,EAAmD,CAAC;AAEhF,SAAS,SAAS,CAChB,MAAc,EACd,WAA4B;IAE5B,IAAI,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAEnC,IAAI,CAAC,OAAO,EAAE,CAA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wBACjB,QAAQ,EAAE,KAAK;wBACf,QAAQ,EAAE,yBAAyB,IAAI,CAAC,GAAG,EAAE;qBAC9C,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;YAED,MAAM;YACN,IAAI,IAAI,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;gBAC3B,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;oBACzC,MAAM,IAAI,oBAAoB,CAAC;wBAC7B,MAAM,EAAE,WAAW;wBACnB,KAAK,EAAE,IAAI,CAAC,KAAK;wBACjB,QAAQ,EAAE,KAAK;wBACf,QAAQ,EAAE,sBAAsB,IAAI,CAAC,GAAG,EAAE;qBAC3C,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;YAED,UAAU;YACV,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;gBACjB,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;oBACjC,MAAM,IAAI,oBAAoB,CAAC;wBAC7B,MAAM,EAAE,WAAW;wBACnB,KAAK,EAAE,IAAI,CAAC,KAAK;wBACjB,QAAQ,EAAE,KAAK;wBACf,QAAQ,EAAE,YAAY;qBACvB,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACpC,CAAC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"number-validaton.js","sourceRoot":"","sources":["../../../../src/core/validation/decorators/number-validaton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AASpD,MAAM,QAAQ,GAAG,IAAI,OAAO,EAAmD,CAAC;AAEhF,SAAS,SAAS,CAChB,MAAc,EACd,WAA4B;IAE5B,IAAI,OAAO,GAAG,QAAQ,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