@cratis/arc 19.0.0 → 19.0.2

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 (140) hide show
  1. package/commands/Command.ts +9 -1
  2. package/commands/for_Command/when_executing/and_command_route_not_found.ts +2 -2
  3. package/commands/for_Command/when_executing/and_fetch_throws_exception.ts +3 -3
  4. package/commands/for_Command/when_executing/with_client_validation_failing.ts +5 -5
  5. package/commands/for_Command/when_executing/with_client_validation_failure_and_custom_message.ts +5 -5
  6. package/commands/for_Command/when_executing/with_client_validation_passing.ts +1 -1
  7. package/commands/for_Command/when_executing/with_command_properties.ts +1 -1
  8. package/commands/for_Command/when_executing/with_custom_http_headers.ts +2 -2
  9. package/commands/for_Command/when_executing/with_microservice_header.ts +1 -1
  10. package/commands/for_Command/when_executing/with_missing_required_property.ts +7 -7
  11. package/commands/for_Command/when_executing/with_origin_and_api_base_path.ts +1 -1
  12. package/commands/for_Command/when_executing/with_route_parameters.ts +2 -2
  13. package/commands/for_Command/when_executing/with_successful_response.ts +5 -5
  14. package/commands/for_Command/when_validating/and_fetch_throws_exception.ts +3 -3
  15. package/commands/for_Command/when_validating/and_validation_endpoint_not_found.ts +2 -2
  16. package/commands/for_Command/when_validating/does_not_update_initial_values.ts +1 -1
  17. package/commands/for_Command/when_validating/with_client_validation_failure.ts +4 -4
  18. package/commands/for_Command/when_validating/with_client_validation_passing.ts +3 -3
  19. package/commands/for_Command/when_validating/with_required_property_missing.ts +4 -4
  20. package/commands/for_Command/when_validating/with_route_parameters.ts +61 -0
  21. package/commands/for_Command/when_validating/with_successful_response.ts +3 -3
  22. package/commands/for_Command/when_validating/with_validation_errors.ts +3 -3
  23. package/dist/cjs/commands/Command.d.ts.map +1 -1
  24. package/dist/cjs/commands/Command.js +7 -1
  25. package/dist/cjs/commands/Command.js.map +1 -1
  26. package/dist/cjs/commands/for_Command/when_validating/with_route_parameters.d.ts +2 -0
  27. package/dist/cjs/commands/for_Command/when_validating/with_route_parameters.d.ts.map +1 -0
  28. package/dist/esm/commands/Command.d.ts.map +1 -1
  29. package/dist/esm/commands/Command.js +7 -1
  30. package/dist/esm/commands/Command.js.map +1 -1
  31. package/dist/esm/commands/for_Command/when_executing/and_command_route_not_found.js +2 -2
  32. package/dist/esm/commands/for_Command/when_executing/and_fetch_throws_exception.js +3 -3
  33. package/dist/esm/commands/for_Command/when_executing/with_client_validation_failing.js +5 -5
  34. package/dist/esm/commands/for_Command/when_executing/with_client_validation_failure_and_custom_message.js +5 -5
  35. package/dist/esm/commands/for_Command/when_executing/with_client_validation_passing.js +1 -1
  36. package/dist/esm/commands/for_Command/when_executing/with_command_properties.js +1 -1
  37. package/dist/esm/commands/for_Command/when_executing/with_custom_http_headers.js +2 -2
  38. package/dist/esm/commands/for_Command/when_executing/with_microservice_header.js +1 -1
  39. package/dist/esm/commands/for_Command/when_executing/with_missing_required_property.js +7 -7
  40. package/dist/esm/commands/for_Command/when_executing/with_origin_and_api_base_path.js +1 -1
  41. package/dist/esm/commands/for_Command/when_executing/with_route_parameters.js +2 -2
  42. package/dist/esm/commands/for_Command/when_executing/with_successful_response.js +5 -5
  43. package/dist/esm/commands/for_Command/when_validating/and_fetch_throws_exception.js +3 -3
  44. package/dist/esm/commands/for_Command/when_validating/and_validation_endpoint_not_found.js +2 -2
  45. package/dist/esm/commands/for_Command/when_validating/does_not_update_initial_values.js +1 -1
  46. package/dist/esm/commands/for_Command/when_validating/with_client_validation_failure.js +4 -4
  47. package/dist/esm/commands/for_Command/when_validating/with_client_validation_passing.js +3 -3
  48. package/dist/esm/commands/for_Command/when_validating/with_required_property_missing.js +4 -4
  49. package/dist/esm/commands/for_Command/when_validating/with_route_parameters.d.ts +2 -0
  50. package/dist/esm/commands/for_Command/when_validating/with_route_parameters.d.ts.map +1 -0
  51. package/dist/esm/commands/for_Command/when_validating/with_route_parameters.js +51 -0
  52. package/dist/esm/commands/for_Command/when_validating/with_route_parameters.js.map +1 -0
  53. package/dist/esm/commands/for_Command/when_validating/with_successful_response.js +3 -3
  54. package/dist/esm/commands/for_Command/when_validating/with_validation_errors.js +3 -3
  55. package/dist/esm/for_UrlHelpers/when_creating_url_from/with_base_path_ending_with_slash.js +3 -3
  56. package/dist/esm/for_UrlHelpers/when_creating_url_from/with_empty_origin.js +2 -2
  57. package/dist/esm/for_UrlHelpers/when_creating_url_from/with_null_or_undefined_origin.js +4 -4
  58. package/dist/esm/for_UrlHelpers/when_creating_url_from/with_relative_route.js +3 -3
  59. package/dist/esm/for_UrlHelpers/when_creating_url_from/with_valid_parameters.js +3 -3
  60. package/dist/esm/for_UrlHelpers/when_creating_url_from/without_document_object.js +1 -1
  61. package/dist/esm/identity/for_IdentityProvider/when_refreshing/with_api_base_path_set.js +1 -1
  62. package/dist/esm/identity/for_IdentityProvider/when_refreshing/with_globals_api_base_path.js +1 -1
  63. package/dist/esm/identity/for_IdentityProvider/when_refreshing/with_origin_set.js +3 -3
  64. package/dist/esm/identity/for_IdentityProvider/when_refreshing/without_api_base_path.js +1 -1
  65. package/dist/esm/queries/for_QueryFor/when_performing/with_client_validation_failing.js +4 -4
  66. package/dist/esm/queries/for_QueryFor/when_performing/with_client_validation_failure_and_custom_message.js +5 -5
  67. package/dist/esm/queries/for_QueryFor/when_performing/with_client_validation_passing.js +1 -1
  68. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  69. package/dist/esm/validation/for_Validator/when_defining_multiple_rules_for_same_property.js +2 -2
  70. package/dist/esm/validation/for_Validator/when_using_custom_error_message.js +1 -1
  71. package/dist/esm/validation/for_Validator/when_validating/with_all_rules_passing.js +2 -2
  72. package/dist/esm/validation/for_Validator/when_validating/with_multiple_rules_failing.js +3 -3
  73. package/dist/esm/validation/for_Validator/when_validating/with_one_rule_failing.js +3 -3
  74. package/dist/esm/validation/rules/for_EmailRule/when_validating/with_empty_string.js +1 -1
  75. package/dist/esm/validation/rules/for_EmailRule/when_validating/with_invalid_email.js +1 -1
  76. package/dist/esm/validation/rules/for_EmailRule/when_validating/with_valid_email.js +1 -1
  77. package/dist/esm/validation/rules/for_GreaterThanOrEqualRule/when_validating/with_value_equal_to_threshold.js +1 -1
  78. package/dist/esm/validation/rules/for_GreaterThanRule/when_validating/with_value_equal_to_threshold.js +1 -1
  79. package/dist/esm/validation/rules/for_GreaterThanRule/when_validating/with_value_greater_than_threshold.js +1 -1
  80. package/dist/esm/validation/rules/for_GreaterThanRule/when_validating/with_value_less_than_threshold.js +2 -2
  81. package/dist/esm/validation/rules/for_LengthRule/when_validating/with_string_longer_than_maximum.js +1 -1
  82. package/dist/esm/validation/rules/for_LengthRule/when_validating/with_string_shorter_than_minimum.js +1 -1
  83. package/dist/esm/validation/rules/for_LengthRule/when_validating/with_string_within_range.js +1 -1
  84. package/dist/esm/validation/rules/for_LessThanRule/when_validating/with_value_less_than_threshold.js +1 -1
  85. package/dist/esm/validation/rules/for_MaxLengthRule/when_validating/with_string_equal_to_maximum.js +1 -1
  86. package/dist/esm/validation/rules/for_MaxLengthRule/when_validating/with_string_longer_than_maximum.js +2 -2
  87. package/dist/esm/validation/rules/for_MinLengthRule/when_validating/with_string_equal_to_minimum.js +1 -1
  88. package/dist/esm/validation/rules/for_MinLengthRule/when_validating/with_string_longer_than_minimum.js +1 -1
  89. package/dist/esm/validation/rules/for_MinLengthRule/when_validating/with_string_shorter_than_minimum.js +2 -2
  90. package/dist/esm/validation/rules/for_NotEmptyRule/when_setting_custom_message.js +1 -1
  91. package/dist/esm/validation/rules/for_NotEmptyRule/when_validating/with_empty_array.js +1 -1
  92. package/dist/esm/validation/rules/for_NotEmptyRule/when_validating/with_empty_string.js +1 -1
  93. package/dist/esm/validation/rules/for_NotEmptyRule/when_validating/with_non_empty_array.js +1 -1
  94. package/dist/esm/validation/rules/for_NotEmptyRule/when_validating/with_null_value.js +4 -4
  95. package/dist/esm/validation/rules/for_NotEmptyRule/when_validating/with_undefined_value.js +2 -2
  96. package/dist/esm/validation/rules/for_NotEmptyRule/when_validating/with_valid_string.js +1 -1
  97. package/dist/esm/validation/rules/for_NotEmptyRule/when_validating/with_whitespace_string.js +1 -1
  98. package/for_UrlHelpers/when_creating_url_from/with_base_path_ending_with_slash.ts +3 -3
  99. package/for_UrlHelpers/when_creating_url_from/with_empty_origin.ts +2 -2
  100. package/for_UrlHelpers/when_creating_url_from/with_null_or_undefined_origin.ts +4 -4
  101. package/for_UrlHelpers/when_creating_url_from/with_relative_route.ts +3 -3
  102. package/for_UrlHelpers/when_creating_url_from/with_valid_parameters.ts +3 -3
  103. package/for_UrlHelpers/when_creating_url_from/without_document_object.ts +1 -1
  104. package/identity/for_IdentityProvider/when_refreshing/with_api_base_path_set.ts +1 -1
  105. package/identity/for_IdentityProvider/when_refreshing/with_globals_api_base_path.ts +1 -1
  106. package/identity/for_IdentityProvider/when_refreshing/with_origin_set.ts +3 -3
  107. package/identity/for_IdentityProvider/when_refreshing/without_api_base_path.ts +1 -1
  108. package/package.json +2 -2
  109. package/queries/for_QueryFor/when_performing/with_client_validation_failing.ts +4 -4
  110. package/queries/for_QueryFor/when_performing/with_client_validation_failure_and_custom_message.ts +5 -5
  111. package/queries/for_QueryFor/when_performing/with_client_validation_passing.ts +1 -1
  112. package/validation/for_Validator/when_defining_multiple_rules_for_same_property.ts +2 -2
  113. package/validation/for_Validator/when_using_custom_error_message.ts +1 -1
  114. package/validation/for_Validator/when_validating/with_all_rules_passing.ts +2 -2
  115. package/validation/for_Validator/when_validating/with_multiple_rules_failing.ts +3 -3
  116. package/validation/for_Validator/when_validating/with_one_rule_failing.ts +3 -3
  117. package/validation/rules/for_EmailRule/when_validating/with_empty_string.ts +1 -1
  118. package/validation/rules/for_EmailRule/when_validating/with_invalid_email.ts +1 -1
  119. package/validation/rules/for_EmailRule/when_validating/with_valid_email.ts +1 -1
  120. package/validation/rules/for_GreaterThanOrEqualRule/when_validating/with_value_equal_to_threshold.ts +1 -1
  121. package/validation/rules/for_GreaterThanRule/when_validating/with_value_equal_to_threshold.ts +1 -1
  122. package/validation/rules/for_GreaterThanRule/when_validating/with_value_greater_than_threshold.ts +1 -1
  123. package/validation/rules/for_GreaterThanRule/when_validating/with_value_less_than_threshold.ts +2 -2
  124. package/validation/rules/for_LengthRule/when_validating/with_string_longer_than_maximum.ts +1 -1
  125. package/validation/rules/for_LengthRule/when_validating/with_string_shorter_than_minimum.ts +1 -1
  126. package/validation/rules/for_LengthRule/when_validating/with_string_within_range.ts +1 -1
  127. package/validation/rules/for_LessThanRule/when_validating/with_value_less_than_threshold.ts +1 -1
  128. package/validation/rules/for_MaxLengthRule/when_validating/with_string_equal_to_maximum.ts +1 -1
  129. package/validation/rules/for_MaxLengthRule/when_validating/with_string_longer_than_maximum.ts +2 -2
  130. package/validation/rules/for_MinLengthRule/when_validating/with_string_equal_to_minimum.ts +1 -1
  131. package/validation/rules/for_MinLengthRule/when_validating/with_string_longer_than_minimum.ts +1 -1
  132. package/validation/rules/for_MinLengthRule/when_validating/with_string_shorter_than_minimum.ts +2 -2
  133. package/validation/rules/for_NotEmptyRule/when_setting_custom_message.ts +1 -1
  134. package/validation/rules/for_NotEmptyRule/when_validating/with_empty_array.ts +1 -1
  135. package/validation/rules/for_NotEmptyRule/when_validating/with_empty_string.ts +1 -1
  136. package/validation/rules/for_NotEmptyRule/when_validating/with_non_empty_array.ts +1 -1
  137. package/validation/rules/for_NotEmptyRule/when_validating/with_null_value.ts +4 -4
  138. package/validation/rules/for_NotEmptyRule/when_validating/with_undefined_value.ts +2 -2
  139. package/validation/rules/for_NotEmptyRule/when_validating/with_valid_string.ts +1 -1
  140. package/validation/rules/for_NotEmptyRule/when_validating/with_whitespace_string.ts +1 -1
@@ -10,10 +10,10 @@ describe("when defining multiple rules for same property", () => {
10
10
  instance = { name: 'ab' };
11
11
  results = validator.validate(instance);
12
12
  });
13
- it("should_return_one_validation_error", () => {
13
+ it("should return one validation error", () => {
14
14
  results.should.have.lengthOf(1);
15
15
  });
16
- it("should_have_error_for_min_length", () => {
16
+ it("should have error for min length", () => {
17
17
  results[0].message.should.include('3');
18
18
  });
19
19
  });
@@ -12,7 +12,7 @@ describe("when using custom error message", () => {
12
12
  instance = { email: '' };
13
13
  results = validator.validate(instance);
14
14
  });
15
- it("should_use_custom_error_message", () => {
15
+ it("should use custom error message", () => {
16
16
  results[0].message.should.equal(customMessage);
17
17
  });
18
18
  });
@@ -11,10 +11,10 @@ describe("when validating with all rules passing", () => {
11
11
  instance = { name: 'John', age: 25 };
12
12
  results = validator.validate(instance);
13
13
  });
14
- it("should_return_no_validation_errors", () => {
14
+ it("should return no validation errors", () => {
15
15
  results.should.be.empty;
16
16
  });
17
- it("should_indicate_instance_is_valid", () => {
17
+ it("should indicate instance is valid", () => {
18
18
  validator.isValidFor(instance).should.be.true;
19
19
  });
20
20
  });
@@ -11,13 +11,13 @@ describe("when validating with multiple rules failing", () => {
11
11
  instance = { name: '', age: 15 };
12
12
  results = validator.validate(instance);
13
13
  });
14
- it("should_return_two_validation_errors", () => {
14
+ it("should return two validation errors", () => {
15
15
  results.should.have.lengthOf(2);
16
16
  });
17
- it("should_have_error_for_name_property", () => {
17
+ it("should have error for name property", () => {
18
18
  results.some(r => r.members.includes('name')).should.be.true;
19
19
  });
20
- it("should_have_error_for_age_property", () => {
20
+ it("should have error for age property", () => {
21
21
  results.some(r => r.members.includes('age')).should.be.true;
22
22
  });
23
23
  });
@@ -11,13 +11,13 @@ describe("when validating with one rule failing", () => {
11
11
  instance = { name: '', age: 25 };
12
12
  results = validator.validate(instance);
13
13
  });
14
- it("should_return_one_validation_error", () => {
14
+ it("should return one validation error", () => {
15
15
  results.should.have.lengthOf(1);
16
16
  });
17
- it("should_indicate_instance_is_not_valid", () => {
17
+ it("should indicate instance is not valid", () => {
18
18
  validator.isValidFor(instance).should.be.false;
19
19
  });
20
- it("should_have_error_for_name_property", () => {
20
+ it("should have error for name property", () => {
21
21
  results[0].members.should.include('name');
22
22
  });
23
23
  });
@@ -8,7 +8,7 @@ describe("when validating with empty string", () => {
8
8
  instance = { value: '' };
9
9
  results = rule.validate(instance, 'value');
10
10
  });
11
- it("should_return_no_validation_errors", () => {
11
+ it("should return no validation errors", () => {
12
12
  results.should.be.empty;
13
13
  });
14
14
  });
@@ -8,7 +8,7 @@ describe("when validating with invalid email", () => {
8
8
  instance = { value: 'notanemail' };
9
9
  results = rule.validate(instance, 'value');
10
10
  });
11
- it("should_return_one_validation_error", () => {
11
+ it("should return one validation error", () => {
12
12
  results.should.have.lengthOf(1);
13
13
  });
14
14
  });
@@ -8,7 +8,7 @@ describe("when validating with valid email", () => {
8
8
  instance = { value: 'test@example.com' };
9
9
  results = rule.validate(instance, 'value');
10
10
  });
11
- it("should_return_no_validation_errors", () => {
11
+ it("should return no validation errors", () => {
12
12
  results.should.be.empty;
13
13
  });
14
14
  });
@@ -8,7 +8,7 @@ describe("when validating with value equal to threshold", () => {
8
8
  instance = { value: 18 };
9
9
  results = rule.validate(instance, 'value');
10
10
  });
11
- it("should_return_no_validation_errors", () => {
11
+ it("should return no validation errors", () => {
12
12
  results.should.be.empty;
13
13
  });
14
14
  });
@@ -8,7 +8,7 @@ describe("when validating with value equal to threshold", () => {
8
8
  instance = { value: 18 };
9
9
  results = rule.validate(instance, 'value');
10
10
  });
11
- it("should_return_one_validation_error", () => {
11
+ it("should return one validation error", () => {
12
12
  results.should.have.lengthOf(1);
13
13
  });
14
14
  });
@@ -8,7 +8,7 @@ describe("when validating with value greater than threshold", () => {
8
8
  instance = { value: 25 };
9
9
  results = rule.validate(instance, 'value');
10
10
  });
11
- it("should_return_no_validation_errors", () => {
11
+ it("should return no validation errors", () => {
12
12
  results.should.be.empty;
13
13
  });
14
14
  });
@@ -8,10 +8,10 @@ describe("when validating with value less than threshold", () => {
8
8
  instance = { value: 15 };
9
9
  results = rule.validate(instance, 'value');
10
10
  });
11
- it("should_return_one_validation_error", () => {
11
+ it("should return one validation error", () => {
12
12
  results.should.have.lengthOf(1);
13
13
  });
14
- it("should_include_threshold_in_message", () => {
14
+ it("should include threshold in message", () => {
15
15
  results[0].message.should.include('18');
16
16
  });
17
17
  });
@@ -8,7 +8,7 @@ describe("when validating with string longer than maximum", () => {
8
8
  instance = { value: 'abcdefgh' };
9
9
  results = rule.validate(instance, 'value');
10
10
  });
11
- it("should_return_one_validation_error", () => {
11
+ it("should return one validation error", () => {
12
12
  results.should.have.lengthOf(1);
13
13
  });
14
14
  });
@@ -8,7 +8,7 @@ describe("when validating with string shorter than minimum", () => {
8
8
  instance = { value: 'ab' };
9
9
  results = rule.validate(instance, 'value');
10
10
  });
11
- it("should_return_one_validation_error", () => {
11
+ it("should return one validation error", () => {
12
12
  results.should.have.lengthOf(1);
13
13
  });
14
14
  });
@@ -8,7 +8,7 @@ describe("when validating with string within range", () => {
8
8
  instance = { value: 'abcde' };
9
9
  results = rule.validate(instance, 'value');
10
10
  });
11
- it("should_return_no_validation_errors", () => {
11
+ it("should return no validation errors", () => {
12
12
  results.should.be.empty;
13
13
  });
14
14
  });
@@ -8,7 +8,7 @@ describe("when validating with value less than threshold", () => {
8
8
  instance = { value: 15 };
9
9
  results = rule.validate(instance, 'value');
10
10
  });
11
- it("should_return_no_validation_errors", () => {
11
+ it("should return no validation errors", () => {
12
12
  results.should.be.empty;
13
13
  });
14
14
  });
@@ -8,7 +8,7 @@ describe("when validating with string equal to maximum", () => {
8
8
  instance = { value: 'abcde' };
9
9
  results = rule.validate(instance, 'value');
10
10
  });
11
- it("should_return_no_validation_errors", () => {
11
+ it("should return no validation errors", () => {
12
12
  results.should.be.empty;
13
13
  });
14
14
  });
@@ -8,10 +8,10 @@ describe("when validating with string longer than maximum", () => {
8
8
  instance = { value: 'abcdefg' };
9
9
  results = rule.validate(instance, 'value');
10
10
  });
11
- it("should_return_one_validation_error", () => {
11
+ it("should return one validation error", () => {
12
12
  results.should.have.lengthOf(1);
13
13
  });
14
- it("should_include_maximum_length_in_message", () => {
14
+ it("should include maximum length in message", () => {
15
15
  results[0].message.should.include('5');
16
16
  });
17
17
  });
@@ -8,7 +8,7 @@ describe("when validating with string equal to minimum", () => {
8
8
  instance = { value: 'abcde' };
9
9
  results = rule.validate(instance, 'value');
10
10
  });
11
- it("should_return_no_validation_errors", () => {
11
+ it("should return no validation errors", () => {
12
12
  results.should.be.empty;
13
13
  });
14
14
  });
@@ -8,7 +8,7 @@ describe("when validating with string longer than minimum", () => {
8
8
  instance = { value: 'abcdefg' };
9
9
  results = rule.validate(instance, 'value');
10
10
  });
11
- it("should_return_no_validation_errors", () => {
11
+ it("should return no validation errors", () => {
12
12
  results.should.be.empty;
13
13
  });
14
14
  });
@@ -8,10 +8,10 @@ describe("when validating with string shorter than minimum", () => {
8
8
  instance = { value: 'abc' };
9
9
  results = rule.validate(instance, 'value');
10
10
  });
11
- it("should_return_one_validation_error", () => {
11
+ it("should return one validation error", () => {
12
12
  results.should.have.lengthOf(1);
13
13
  });
14
- it("should_include_minimum_length_in_message", () => {
14
+ it("should include minimum length in message", () => {
15
15
  results[0].message.should.include('5');
16
16
  });
17
17
  });
@@ -10,7 +10,7 @@ describe("when setting custom message", () => {
10
10
  instance = { value: null };
11
11
  results = rule.validate(instance, 'value');
12
12
  });
13
- it("should_use_custom_message", () => {
13
+ it("should use custom message", () => {
14
14
  results[0].message.should.equal(customMessage);
15
15
  });
16
16
  });
@@ -8,7 +8,7 @@ describe("when validating with empty array", () => {
8
8
  instance = { value: [] };
9
9
  results = rule.validate(instance, 'value');
10
10
  });
11
- it("should_return_one_validation_error", () => {
11
+ it("should return one validation error", () => {
12
12
  results.should.have.lengthOf(1);
13
13
  });
14
14
  });
@@ -8,7 +8,7 @@ describe("when validating with empty string", () => {
8
8
  instance = { value: '' };
9
9
  results = rule.validate(instance, 'value');
10
10
  });
11
- it("should_return_one_validation_error", () => {
11
+ it("should return one validation error", () => {
12
12
  results.should.have.lengthOf(1);
13
13
  });
14
14
  });
@@ -8,7 +8,7 @@ describe("when validating with non empty array", () => {
8
8
  instance = { value: ['item'] };
9
9
  results = rule.validate(instance, 'value');
10
10
  });
11
- it("should_return_no_validation_errors", () => {
11
+ it("should return no validation errors", () => {
12
12
  results.should.be.empty;
13
13
  });
14
14
  });
@@ -9,16 +9,16 @@ describe("when validating with null value", () => {
9
9
  instance = { value: null };
10
10
  results = rule.validate(instance, 'value');
11
11
  });
12
- it("should_return_one_validation_error", () => {
12
+ it("should return one validation error", () => {
13
13
  results.should.have.lengthOf(1);
14
14
  });
15
- it("should_have_error_severity", () => {
15
+ it("should have error severity", () => {
16
16
  results[0].severity.should.equal(ValidationResultSeverity.Error);
17
17
  });
18
- it("should_have_property_name_in_message", () => {
18
+ it("should have property name in message", () => {
19
19
  results[0].message.should.include('value');
20
20
  });
21
- it("should_include_property_in_members", () => {
21
+ it("should include property in members", () => {
22
22
  results[0].members.should.include('value');
23
23
  });
24
24
  });
@@ -9,10 +9,10 @@ describe("when validating with undefined value", () => {
9
9
  instance = { value: undefined };
10
10
  results = rule.validate(instance, 'value');
11
11
  });
12
- it("should_return_one_validation_error", () => {
12
+ it("should return one validation error", () => {
13
13
  results.should.have.lengthOf(1);
14
14
  });
15
- it("should_have_error_severity", () => {
15
+ it("should have error severity", () => {
16
16
  results[0].severity.should.equal(ValidationResultSeverity.Error);
17
17
  });
18
18
  });
@@ -8,7 +8,7 @@ describe("when validating with valid string", () => {
8
8
  instance = { value: 'test' };
9
9
  results = rule.validate(instance, 'value');
10
10
  });
11
- it("should_return_no_validation_errors", () => {
11
+ it("should return no validation errors", () => {
12
12
  results.should.be.empty;
13
13
  });
14
14
  });
@@ -8,7 +8,7 @@ describe("when validating with whitespace string", () => {
8
8
  instance = { value: ' ' };
9
9
  results = rule.validate(instance, 'value');
10
10
  });
11
- it("should_return_one_validation_error", () => {
11
+ it("should return one validation error", () => {
12
12
  results.should.have.lengthOf(1);
13
13
  });
14
14
  });
@@ -18,15 +18,15 @@ describe("with_base_path_ending_with_slash", () => {
18
18
  result = UrlHelpers.createUrlFrom(origin, apiBasePath, route);
19
19
  });
20
20
 
21
- it("should_create_correct_url", () => {
21
+ it("should create correct url", () => {
22
22
  result.href.should.equal('https://example.com/api/v1/users/123');
23
23
  });
24
24
 
25
- it("should_have_correct_origin", () => {
25
+ it("should have correct origin", () => {
26
26
  result.origin.should.equal('https://example.com');
27
27
  });
28
28
 
29
- it("should_have_correct_pathname", () => {
29
+ it("should have correct pathname", () => {
30
30
  result.pathname.should.equal('/api/v1/users/123');
31
31
  });
32
32
  });
@@ -35,11 +35,11 @@ describe("with_empty_origin", () => {
35
35
  }
36
36
  });
37
37
 
38
- it("should_use_document_location_origin", () => {
38
+ it("should use document location origin", () => {
39
39
  result.origin.should.equal('https://mocked-origin.com');
40
40
  });
41
41
 
42
- it("should_create_correct_url_with_document_origin", () => {
42
+ it("should create correct url with document origin", () => {
43
43
  result.href.should.equal('https://mocked-origin.com/users/123');
44
44
  });
45
45
  });
@@ -31,22 +31,22 @@ describe("with_null_or_undefined_origin", () => {
31
31
  }
32
32
  });
33
33
 
34
- it("should_use_document_location_origin_when_null", () => {
34
+ it("should use document location origin when null", () => {
35
35
  result = UrlHelpers.createUrlFrom(null as unknown as string, apiBasePath, route);
36
36
  result.origin.should.equal('https://fallback-origin.com');
37
37
  });
38
38
 
39
- it("should_use_document_location_origin_when_undefined", () => {
39
+ it("should use document location origin when undefined", () => {
40
40
  result = UrlHelpers.createUrlFrom(undefined as unknown as string, apiBasePath, route);
41
41
  result.origin.should.equal('https://fallback-origin.com');
42
42
  });
43
43
 
44
- it("should_create_correct_url_with_document_origin_when_null", () => {
44
+ it("should create correct url with document origin when null", () => {
45
45
  result = UrlHelpers.createUrlFrom(null as unknown as string, apiBasePath, route);
46
46
  result.href.should.equal('https://fallback-origin.com/users/123');
47
47
  });
48
48
 
49
- it("should_create_correct_url_with_document_origin_when_undefined", () => {
49
+ it("should create correct url with document origin when undefined", () => {
50
50
  result = UrlHelpers.createUrlFrom(undefined as unknown as string, apiBasePath, route);
51
51
  result.href.should.equal('https://fallback-origin.com/users/123');
52
52
  });
@@ -18,15 +18,15 @@ describe("with_relative_route", () => {
18
18
  result = UrlHelpers.createUrlFrom(origin, apiBasePath, route);
19
19
  });
20
20
 
21
- it("should_create_correct_url_with_relative_route", () => {
21
+ it("should create correct url with relative route", () => {
22
22
  result.href.should.equal('https://example.com/api/users/123');
23
23
  });
24
24
 
25
- it("should_have_correct_origin", () => {
25
+ it("should have correct origin", () => {
26
26
  result.origin.should.equal('https://example.com');
27
27
  });
28
28
 
29
- it("should_have_correct_pathname", () => {
29
+ it("should have correct pathname", () => {
30
30
  result.pathname.should.equal('/api/users/123');
31
31
  });
32
32
  });
@@ -18,15 +18,15 @@ describe("with_valid_parameters", () => {
18
18
  result = UrlHelpers.createUrlFrom(origin, apiBasePath, route);
19
19
  });
20
20
 
21
- it("should_create_correct_url", () => {
21
+ it("should create correct url", () => {
22
22
  result.href.should.equal('https://example.com/users/123');
23
23
  });
24
24
 
25
- it("should_have_correct_origin", () => {
25
+ it("should have correct origin", () => {
26
26
  result.origin.should.equal('https://example.com');
27
27
  });
28
28
 
29
- it("should_have_correct_pathname", () => {
29
+ it("should have correct pathname", () => {
30
30
  result.pathname.should.equal('/users/123');
31
31
  });
32
32
  });
@@ -28,7 +28,7 @@ describe("without_document_object", () => {
28
28
  }
29
29
  });
30
30
 
31
- it("should_throw_invalid_url_error", () => {
31
+ it("should throw invalid url error", () => {
32
32
  (() => UrlHelpers.createUrlFrom(origin, apiBasePath, route)).should.throw('Invalid URL');
33
33
  });
34
34
  });
@@ -28,7 +28,7 @@ describe('when refreshing with api base path set', given(an_identity_provider, c
28
28
  IdentityProvider.setApiBasePath('');
29
29
  });
30
30
 
31
- it('should_call_fetch_with_api_base_path_prefixed', () => {
31
+ it('should call fetch with api base path prefixed', () => {
32
32
  actualUrl.pathname.should.equal('/custom/api/.cratis/me');
33
33
  });
34
34
  }));
@@ -33,7 +33,7 @@ describe('when refreshing with globals api base path', given(an_identity_provide
33
33
  IdentityProvider.setApiBasePath('');
34
34
  });
35
35
 
36
- it('should_call_fetch_with_globals_api_base_path_prefixed', () => {
36
+ it('should call fetch with globals api base path prefixed', () => {
37
37
  actualUrl.pathname.should.equal('/global/api/.cratis/me');
38
38
  });
39
39
  }));
@@ -31,15 +31,15 @@ describe('when refreshing with origin set', given(an_identity_provider, context
31
31
  IdentityProvider.setApiBasePath('');
32
32
  });
33
33
 
34
- it('should_call_fetch_with_full_url_including_origin', () => {
34
+ it('should call fetch with full url including origin', () => {
35
35
  actualUrl.href.should.equal('https://example.com/api/v1/.cratis/me');
36
36
  });
37
37
 
38
- it('should_have_correct_origin', () => {
38
+ it('should have correct origin', () => {
39
39
  actualUrl.origin.should.equal('https://example.com');
40
40
  });
41
41
 
42
- it('should_have_correct_pathname', () => {
42
+ it('should have correct pathname', () => {
43
43
  actualUrl.pathname.should.equal('/api/v1/.cratis/me');
44
44
  });
45
45
  }));
@@ -32,7 +32,7 @@ describe('when refreshing without api base path', given(an_identity_provider, co
32
32
  Globals.apiBasePath = originalGlobalsApiBasePath;
33
33
  });
34
34
 
35
- it('should_call_fetch_with_default_path', () => {
35
+ it('should call fetch with default path', () => {
36
36
  actualUrl.pathname.should.equal('/.cratis/me');
37
37
  });
38
38
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/arc",
3
- "version": "19.0.0",
3
+ "version": "19.0.2",
4
4
  "description": "",
5
5
  "author": "Cratis",
6
6
  "license": "MIT",
@@ -65,6 +65,6 @@
65
65
  "up": "yarn g:up"
66
66
  },
67
67
  "dependencies": {
68
- "@cratis/fundamentals": "^7.4.0"
68
+ "@cratis/fundamentals": "^7.5.0"
69
69
  }
70
70
  }
@@ -45,19 +45,19 @@ describe("when performing with client validation failing", () => {
45
45
  result = await query.perform(query.parameters);
46
46
  });
47
47
 
48
- it("should_not_be_success", () => {
48
+ it("should not be success", () => {
49
49
  result.isSuccess.should.be.false;
50
50
  });
51
51
 
52
- it("should_not_be_valid", () => {
52
+ it("should not be valid", () => {
53
53
  result.isValid.should.be.false;
54
54
  });
55
55
 
56
- it("should_have_validation_results", () => {
56
+ it("should have validation results", () => {
57
57
  result.validationResults.should.not.be.empty;
58
58
  });
59
59
 
60
- it("should_have_error_for_minAge", () => {
60
+ it("should have error for minAge", () => {
61
61
  result.validationResults.some(r => r.members.includes('minAge')).should.be.true;
62
62
  });
63
63
  });
@@ -20,9 +20,9 @@ describe("when performing with client validation failure and custom message", gi
20
20
  context.fetchStub.restore();
21
21
  });
22
22
 
23
- it("should_not_call_server", () => context.fetchStub.called.should.be.false);
24
- it("should_return_invalid_result", () => result.isValid.should.be.false);
25
- it("should_have_validation_error", () => result.validationResults.length.should.equal(1));
26
- it("should_have_custom_error_message", () => result.validationResults[0].message.should.equal('Search term must be at least 3 characters'));
27
- it("should_have_error_for_searchTerm_property", () => result.validationResults[0].members[0].should.equal('searchTerm'));
23
+ it("should not call server", () => context.fetchStub.called.should.be.false);
24
+ it("should return invalid result", () => result.isValid.should.be.false);
25
+ it("should have validation error", () => result.validationResults.length.should.equal(1));
26
+ it("should have custom error message", () => result.validationResults[0].message.should.equal('Search term must be at least 3 characters'));
27
+ it("should have error for searchTerm property", () => result.validationResults[0].members[0].should.equal('searchTerm'));
28
28
  }));
@@ -57,7 +57,7 @@ describe("when performing with client validation passing", () => {
57
57
  fetchHelper.restore();
58
58
  });
59
59
 
60
- it("should_call_server", async () => {
60
+ it("should call server", async () => {
61
61
  await query.perform(query.parameters);
62
62
  fetchStub.should.have.been.called;
63
63
  });
@@ -22,11 +22,11 @@ describe("when defining multiple rules for same property", () => {
22
22
  results = validator.validate(instance);
23
23
  });
24
24
 
25
- it("should_return_one_validation_error", () => {
25
+ it("should return one validation error", () => {
26
26
  results.should.have.lengthOf(1);
27
27
  });
28
28
 
29
- it("should_have_error_for_min_length", () => {
29
+ it("should have error for min length", () => {
30
30
  results[0].message.should.include('3');
31
31
  });
32
32
  });
@@ -24,7 +24,7 @@ describe("when using custom error message", () => {
24
24
  results = validator.validate(instance);
25
25
  });
26
26
 
27
- it("should_use_custom_error_message", () => {
27
+ it("should use custom error message", () => {
28
28
  results[0].message.should.equal(customMessage);
29
29
  });
30
30
  });
@@ -24,11 +24,11 @@ describe("when validating with all rules passing", () => {
24
24
  results = validator.validate(instance);
25
25
  });
26
26
 
27
- it("should_return_no_validation_errors", () => {
27
+ it("should return no validation errors", () => {
28
28
  results.should.be.empty;
29
29
  });
30
30
 
31
- it("should_indicate_instance_is_valid", () => {
31
+ it("should indicate instance is valid", () => {
32
32
  validator.isValidFor(instance).should.be.true;
33
33
  });
34
34
  });