@colijnit/ioneconnector 3.1.26 → 254.1.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.
- package/build/connector.d.ts +30 -30
- package/build/connector.js +67 -67
- package/build/connector.unit.test.d.ts +1 -1
- package/build/connector.unit.test.js +108 -108
- package/build/enum/activate-user-account-status.enum.d.ts +6 -6
- package/build/enum/activate-user-account-status.enum.js +10 -10
- package/build/enum/address-format.enum.d.ts +4 -4
- package/build/enum/address-format.enum.js +8 -8
- package/build/enum/backend-language-code.enum.d.ts +6 -6
- package/build/enum/backend-language-code.enum.js +10 -10
- package/build/enum/backend-service-name.enum.d.ts +7 -7
- package/build/enum/backend-service-name.enum.js +11 -11
- package/build/enum/communication-type.enum.d.ts +8 -8
- package/build/enum/communication-type.enum.js +12 -12
- package/build/enum/datasession-service-method.enum.d.ts +13 -13
- package/build/enum/datasession-service-method.enum.js +17 -17
- package/build/enum/db-boolean-value-type.enum.d.ts +12 -12
- package/build/enum/db-boolean-value-type.enum.js +32 -32
- package/build/enum/end-point.enum.d.ts +4 -4
- package/build/enum/end-point.enum.js +8 -8
- package/build/enum/file-type-internal.enum.d.ts +11 -11
- package/build/enum/file-type-internal.enum.js +15 -15
- package/build/enum/file-type.enum.d.ts +5 -5
- package/build/enum/file-type.enum.js +9 -9
- package/build/enum/filter-type.enum.d.ts +4 -4
- package/build/enum/filter-type.enum.js +8 -8
- package/build/enum/health-service-method.enum.d.ts +3 -3
- package/build/enum/health-service-method.enum.js +7 -7
- package/build/enum/language-code.enum.d.ts +7 -7
- package/build/enum/language-code.enum.js +11 -11
- package/build/enum/login-service-method.enum.d.ts +24 -24
- package/build/enum/login-service-method.enum.js +28 -28
- package/build/enum/login-status.enum.d.ts +20 -20
- package/build/enum/login-status.enum.js +24 -24
- package/build/enum/message-type.enum.d.ts +6 -6
- package/build/enum/message-type.enum.js +10 -10
- package/build/enum/object-config-kind.d.ts +9 -9
- package/build/enum/object-config-kind.js +13 -13
- package/build/enum/object-configuration-data-type.enum.d.ts +7 -7
- package/build/enum/object-configuration-data-type.enum.js +11 -11
- package/build/enum/object-configuration-value-type.enum.d.ts +10 -10
- package/build/enum/object-configuration-value-type.enum.js +14 -14
- package/build/enum/object-right-type.enum.d.ts +5 -5
- package/build/enum/object-right-type.enum.js +9 -9
- package/build/enum/one-zero-bool-db-type.enum.d.ts +5 -5
- package/build/enum/one-zero-bool-db-type.enum.js +20 -20
- package/build/enum/public-service-method.enum.d.ts +5 -5
- package/build/enum/public-service-method.enum.js +9 -9
- package/build/enum/reset-password-status.enum.d.ts +5 -5
- package/build/enum/reset-password-status.enum.js +9 -9
- package/build/enum/screen-config-subcategory.enum.d.ts +2 -2
- package/build/enum/screen-config-subcategory.enum.js +2 -2
- package/build/enum/search-data-type.enum.d.ts +4 -4
- package/build/enum/search-data-type.enum.js +8 -8
- package/build/enum/search-property-state.enum.d.ts +5 -5
- package/build/enum/search-property-state.enum.js +9 -9
- package/build/enum/sort-direction.d.ts +5 -5
- package/build/enum/sort-direction.js +12 -12
- package/build/enum/sort-type.enum.d.ts +6 -6
- package/build/enum/sort-type.enum.js +10 -10
- package/build/enum/true-false-db-type.enum.d.ts +5 -5
- package/build/enum/true-false-db-type.enum.js +20 -20
- package/build/enum/user-info-service-method.enum.d.ts +3 -3
- package/build/enum/user-info-service-method.enum.js +7 -7
- package/build/enum/user-right-type.enum.d.ts +7 -7
- package/build/enum/user-right-type.enum.js +11 -11
- package/build/enum/user-role-type.enum.d.ts +17 -17
- package/build/enum/user-role-type.enum.js +21 -21
- package/build/enum/value-comparison-type.enum.d.ts +15 -15
- package/build/enum/value-comparison-type.enum.js +31 -31
- package/build/enum/yes-no-db-type.enum.d.ts +5 -5
- package/build/enum/yes-no-db-type.enum.js +20 -20
- package/build/factory/business-object-serializer.d.ts +11 -11
- package/build/factory/business-object-serializer.js +145 -145
- package/build/factory/decorators/bo-factory-step.decorator.d.ts +4 -4
- package/build/factory/decorators/bo-factory-step.decorator.js +16 -16
- package/build/factory/decorators/bo-serializer-step.decorator.d.ts +4 -4
- package/build/factory/decorators/bo-serializer-step.decorator.js +16 -16
- package/build/factory/decorators/boolean.decorator.d.ts +12 -12
- package/build/factory/decorators/boolean.decorator.js +73 -73
- package/build/factory/decorators/business-object-data.decorator.d.ts +23 -23
- package/build/factory/decorators/business-object-data.decorator.js +87 -87
- package/build/factory/decorators/co-inject.decorator.d.ts +7 -7
- package/build/factory/decorators/co-inject.decorator.js +54 -54
- package/build/factory/decorators/complex-array.decorator.d.ts +6 -6
- package/build/factory/decorators/complex-array.decorator.js +37 -37
- package/build/factory/decorators/complex-field.decorator.d.ts +6 -6
- package/build/factory/decorators/complex-field.decorator.js +37 -37
- package/build/factory/decorators/date-field.decorator.d.ts +6 -6
- package/build/factory/decorators/date-field.decorator.js +27 -27
- package/build/factory/decorators/db-field-alias.decorator.d.ts +6 -6
- package/build/factory/decorators/db-field-alias.decorator.js +40 -40
- package/build/factory/decorators/db-method-value.decorator.d.ts +5 -5
- package/build/factory/decorators/db-method-value.decorator.js +19 -19
- package/build/factory/decorators/db-number.decorator.d.ts +6 -6
- package/build/factory/decorators/db-number.decorator.js +35 -35
- package/build/factory/decorators/default-send-value.decorator.d.ts +7 -7
- package/build/factory/decorators/default-send-value.decorator.js +53 -53
- package/build/factory/decorators/exclude-when-empty-string.decorator.d.ts +5 -5
- package/build/factory/decorators/exclude-when-empty-string.decorator.js +19 -19
- package/build/factory/decorators/json.decorator.d.ts +6 -6
- package/build/factory/decorators/json.decorator.js +26 -26
- package/build/factory/decorators/map-property.decorator.d.ts +6 -6
- package/build/factory/decorators/map-property.decorator.js +29 -29
- package/build/factory/decorators/no-db-field.decorator.d.ts +5 -5
- package/build/factory/decorators/no-db-field.decorator.js +34 -34
- package/build/factory/decorators/number-string.decorator.d.ts +6 -6
- package/build/factory/decorators/number-string.decorator.js +23 -23
- package/build/factory/decorators/simple-method-tag.decorator.d.ts +6 -6
- package/build/factory/decorators/simple-method-tag.decorator.js +31 -31
- package/build/factory/decorators/simple-property-tag.decorator.d.ts +6 -6
- package/build/factory/decorators/simple-property-tag.decorator.js +38 -38
- package/build/factory/decorators/string-number.decorator.d.ts +7 -7
- package/build/factory/decorators/string-number.decorator.js +30 -30
- package/build/factory/decorators/validate.decorator.d.ts +11 -11
- package/build/factory/decorators/validate.decorator.js +55 -55
- package/build/interface/address-common-shape.interface.d.ts +14 -14
- package/build/interface/address-common-shape.interface.js +2 -2
- package/build/interface/business-object-data-shape.d.ts +19 -19
- package/build/interface/business-object-data-shape.js +2 -2
- package/build/interface/check-precision-and-scale-result.d.ts +4 -4
- package/build/interface/check-precision-and-scale-result.js +2 -2
- package/build/interface/check-within-stepped-bounds-result.d.ts +4 -4
- package/build/interface/check-within-stepped-bounds-result.js +2 -2
- package/build/interface/filter-property.d.ts +9 -9
- package/build/interface/filter-property.js +2 -2
- package/build/interface/login-storage-data.interface.d.ts +10 -10
- package/build/interface/login-storage-data.interface.js +2 -2
- package/build/interface/precision-scale-object.d.ts +4 -4
- package/build/interface/precision-scale-object.js +2 -2
- package/build/interface/search-property.d.ts +11 -11
- package/build/interface/search-property.js +2 -2
- package/build/interface/sort-property.d.ts +11 -11
- package/build/interface/sort-property.js +2 -2
- package/build/interface/text-part.d.ts +4 -4
- package/build/interface/text-part.js +2 -2
- package/build/interface/value-comparison-type-view-wrapper.d.ts +6 -6
- package/build/interface/value-comparison-type-view-wrapper.js +2 -2
- package/build/model/business-object.d.ts +13 -13
- package/build/model/business-object.js +34 -34
- package/build/model/company.bo.d.ts +9 -9
- package/build/model/company.bo.js +13 -13
- package/build/model/constant/java-constants.d.ts +2 -2
- package/build/model/constant/java-constants.js +5 -5
- package/build/model/country.bo.d.ts +11 -11
- package/build/model/country.bo.js +11 -11
- package/build/model/data-service-data.d.ts +15 -15
- package/build/model/data-service-data.js +6 -6
- package/build/model/data-service-response-data.d.ts +19 -19
- package/build/model/data-service-response-data.interface.d.ts +9 -9
- package/build/model/data-service-response-data.interface.js +2 -2
- package/build/model/data-service-response-data.js +57 -57
- package/build/model/data-service-response-exception.d.ts +29 -29
- package/build/model/data-service-response-exception.js +2 -2
- package/build/model/data-service-response-root.d.ts +7 -7
- package/build/model/data-service-response-root.js +2 -2
- package/build/model/default-all-scr-cfg-subcategory.d.ts +2 -2
- package/build/model/default-all-scr-cfg-subcategory.js +4 -4
- package/build/model/default-get-object-configurations-params.d.ts +2 -2
- package/build/model/default-get-object-configurations-params.js +5 -5
- package/build/model/field-validation.d.ts +11 -11
- package/build/model/field-validation.interface.d.ts +6 -6
- package/build/model/field-validation.interface.js +2 -2
- package/build/model/field-validation.js +76 -76
- package/build/model/field-validations-object.d.ts +4 -4
- package/build/model/field-validations-object.interface.d.ts +4 -4
- package/build/model/field-validations-object.interface.js +2 -2
- package/build/model/field-validations-object.js +2 -2
- package/build/model/ione-local-storage-root-object.d.ts +5 -5
- package/build/model/ione-local-storage-root-object.js +9 -9
- package/build/model/keycloak-parameters.bo.d.ts +5 -5
- package/build/model/keycloak-parameters.bo.js +7 -7
- package/build/model/local-storage-root-object.d.ts +4 -4
- package/build/model/local-storage-root-object.js +9 -9
- package/build/model/local-storage-schema-object.d.ts +7 -7
- package/build/model/local-storage-schema-object.js +9 -9
- package/build/model/local-storage-user-object.d.ts +7 -7
- package/build/model/local-storage-user-object.js +6 -6
- package/build/model/login-request.d.ts +15 -15
- package/build/model/login-request.interface.d.ts +12 -12
- package/build/model/login-request.interface.js +2 -2
- package/build/model/login-request.js +6 -6
- package/build/model/login-response.d.ts +36 -36
- package/build/model/login-response.interface.d.ts +22 -22
- package/build/model/login-response.interface.js +2 -2
- package/build/model/login-response.js +57 -57
- package/build/model/login-service-request-data.d.ts +17 -17
- package/build/model/login-service-request-data.js +2 -2
- package/build/model/login.d.ts +16 -16
- package/build/model/login.js +35 -35
- package/build/model/menu-content.bo.d.ts +13 -13
- package/build/model/menu-content.bo.js +13 -13
- package/build/model/object-configuration.d.ts +53 -53
- package/build/model/object-configuration.js +200 -200
- package/build/model/options.d.ts +26 -26
- package/build/model/options.js +16 -16
- package/build/model/paging-parameters.d.ts +15 -15
- package/build/model/paging-parameters.interface.d.ts +6 -6
- package/build/model/paging-parameters.interface.js +6 -6
- package/build/model/paging-parameters.js +37 -37
- package/build/model/public-service-request-data.d.ts +5 -5
- package/build/model/public-service-request-data.js +2 -2
- package/build/model/server-response-data.d.ts +5 -5
- package/build/model/server-response-data.js +2 -2
- package/build/model/server-stack-trace-element.d.ts +7 -7
- package/build/model/server-stack-trace-element.js +2 -2
- package/build/model/session-storage-root-object.d.ts +4 -4
- package/build/model/session-storage-root-object.js +9 -9
- package/build/model/session-storage-schema-object.d.ts +7 -7
- package/build/model/session-storage-schema-object.js +9 -9
- package/build/model/session-storage-user-object.d.ts +6 -6
- package/build/model/session-storage-user-object.js +10 -10
- package/build/model/session.d.ts +6 -6
- package/build/model/session.js +6 -6
- package/build/model/token-response.bo.d.ts +5 -5
- package/build/model/token-response.bo.js +7 -7
- package/build/model/user-parameters-values.bo.d.ts +8 -8
- package/build/model/user-parameters-values.bo.js +7 -7
- package/build/model/validation-message.d.ts +13 -13
- package/build/model/validation-message.interface.d.ts +6 -6
- package/build/model/validation-message.interface.js +2 -2
- package/build/model/validation-message.js +48 -48
- package/build/model/validation-result.d.ts +34 -34
- package/build/model/validation-result.interface.d.ts +14 -14
- package/build/model/validation-result.interface.js +2 -2
- package/build/model/validation-result.js +192 -192
- package/build/provider/ajax.service.d.ts +32 -32
- package/build/provider/ajax.service.js +271 -271
- package/build/provider/base-backend-connection.service.d.ts +45 -45
- package/build/provider/base-backend-connection.service.js +166 -166
- package/build/provider/base-backend-connection.service.js.map +1 -1
- package/build/service/business-object-factory.d.ts +8 -8
- package/build/service/business-object-factory.js +119 -119
- package/build/service/datasession.service.d.ts +9 -9
- package/build/service/datasession.service.js +26 -26
- package/build/service/encrypt.service.d.ts +6 -6
- package/build/service/encrypt.service.js +30 -30
- package/build/service/encrypt.service.unit.test.d.ts +1 -1
- package/build/service/encrypt.service.unit.test.js +14 -14
- package/build/service/external-jwt-token.service.d.ts +10 -10
- package/build/service/external-jwt-token.service.js +21 -21
- package/build/service/health.service.d.ts +10 -10
- package/build/service/health.service.js +34 -34
- package/build/service/internal-jwt-token.service.d.ts +11 -11
- package/build/service/internal-jwt-token.service.js +40 -40
- package/build/service/jwt-token.service.d.ts +12 -12
- package/build/service/jwt-token.service.js +32 -32
- package/build/service/local-storage.service.d.ts +27 -27
- package/build/service/local-storage.service.js +147 -147
- package/build/service/login.service.d.ts +45 -45
- package/build/service/login.service.js +312 -312
- package/build/service/public.service.d.ts +12 -12
- package/build/service/public.service.js +36 -36
- package/build/service/session-storage.service.d.ts +18 -18
- package/build/service/session-storage.service.js +116 -116
- package/build/service/user-info.service.d.ts +9 -9
- package/build/service/user-info.service.js +33 -33
- package/build/tests/int/connector.int.test.d.ts +1 -1
- package/build/tests/int/connector.int.test.js +12 -12
- package/build/type/business-object-id-type.d.ts +4 -4
- package/build/type/business-object-id-type.js +13 -13
- package/build/type/object-configuration-default-value-type.d.ts +1 -1
- package/build/type/object-configuration-default-value-type.js +2 -2
- package/build/utils/array-utils.d.ts +38 -38
- package/build/utils/array-utils.js +375 -375
- package/build/utils/business-object-utils.d.ts +20 -20
- package/build/utils/business-object-utils.js +198 -198
- package/build/utils/date-utils.d.ts +5 -5
- package/build/utils/date-utils.js +24 -24
- package/build/utils/file-utils.d.ts +6 -6
- package/build/utils/file-utils.js +66 -66
- package/build/utils/function/any-nill.function.d.ts +1 -1
- package/build/utils/function/any-nill.function.js +16 -16
- package/build/utils/function/is-nill.function.d.ts +1 -1
- package/build/utils/function/is-nill.function.js +7 -7
- package/build/utils/function/not-nill.function.d.ts +1 -1
- package/build/utils/function/not-nill.function.js +7 -7
- package/build/utils/function-utils.d.ts +4 -4
- package/build/utils/function-utils.js +31 -31
- package/build/utils/image-utils.d.ts +4 -4
- package/build/utils/image-utils.js +28 -28
- package/build/utils/map-utils.d.ts +4 -4
- package/build/utils/map-utils.js +31 -31
- package/build/utils/number-utils.d.ts +39 -39
- package/build/utils/number-utils.js +268 -268
- package/build/utils/object-utils.d.ts +21 -21
- package/build/utils/object-utils.js +247 -247
- package/build/utils/parameter-value-conversion-utils.d.ts +3 -3
- package/build/utils/parameter-value-conversion-utils.js +19 -19
- package/build/utils/promise-utils.d.ts +6 -6
- package/build/utils/promise-utils.js +22 -22
- package/build/utils/ref-code-utils.d.ts +4 -4
- package/build/utils/ref-code-utils.js +19 -19
- package/build/utils/sort-utils.d.ts +12 -12
- package/build/utils/sort-utils.js +120 -120
- package/build/utils/string-utils.d.ts +25 -25
- package/build/utils/string-utils.js +212 -212
- package/build/utils/url-utils.d.ts +4 -4
- package/build/utils/url-utils.js +33 -33
- package/build/validators/communication-type.validator.d.ts +1 -1
- package/build/validators/communication-type.validator.js +16 -16
- package/build/validators/email.validator.d.ts +2 -2
- package/build/validators/email.validator.js +9 -9
- package/build/validators/empty-address.validator.d.ts +3 -3
- package/build/validators/empty-address.validator.js +12 -12
- package/build/validators/empty-array.validator.d.ts +2 -2
- package/build/validators/empty-array.validator.js +14 -14
- package/build/validators/end-date-equal.validator.d.ts +1 -1
- package/build/validators/end-date-equal.validator.js +17 -17
- package/build/validators/end-date.validator.d.ts +1 -1
- package/build/validators/end-date.validator.js +17 -17
- package/build/validators/equal.validator.d.ts +2 -2
- package/build/validators/equal.validator.js +14 -14
- package/build/validators/max-string-length.validator.d.ts +2 -2
- package/build/validators/max-string-length.validator.js +13 -13
- package/build/validators/nl-post-code.validator.d.ts +3 -3
- package/build/validators/nl-post-code.validator.js +14 -14
- package/build/validators/password.validator.d.ts +3 -3
- package/build/validators/password.validator.js +33 -33
- package/build/validators/postal-code-function.validator.d.ts +2 -2
- package/build/validators/postal-code-function.validator.js +19 -19
- package/build/validators/postal-code.validator.d.ts +1 -1
- package/build/validators/postal-code.validator.js +21 -21
- package/build/validators/precision-scale.validator.d.ts +2 -2
- package/build/validators/precision-scale.validator.js +14 -14
- package/build/validators/required.validator.d.ts +2 -2
- package/build/validators/required.validator.js +8 -8
- package/build/validators/social-security-number.validator.d.ts +2 -2
- package/build/validators/social-security-number.validator.js +28 -28
- package/build/validators/space-trim.validator.d.ts +2 -2
- package/build/validators/space-trim.validator.js +12 -12
- package/build/validators/true.validator.d.ts +2 -2
- package/build/validators/true.validator.js +8 -8
- package/package.json +2 -2
|
@@ -1,193 +1,193 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ValidationResult = void 0;
|
|
4
|
-
const object_utils_1 = require("../utils/object-utils");
|
|
5
|
-
const validation_message_1 = require("./validation-message");
|
|
6
|
-
const field_validation_1 = require("./field-validation");
|
|
7
|
-
const number_utils_1 = require("../utils/number-utils");
|
|
8
|
-
const business_object_utils_1 = require("../utils/business-object-utils");
|
|
9
|
-
const array_utils_1 = require("../utils/array-utils");
|
|
10
|
-
const message_type_enum_1 = require("../enum/message-type.enum");
|
|
11
|
-
class ValidationResult {
|
|
12
|
-
constructor(rawData) {
|
|
13
|
-
this.messages = [];
|
|
14
|
-
this.fieldValidations = {};
|
|
15
|
-
this.setData(rawData);
|
|
16
|
-
}
|
|
17
|
-
setData(rawData) {
|
|
18
|
-
if (!rawData) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
this.objectId = rawData.objectId;
|
|
22
|
-
this.objectType = rawData.objectType;
|
|
23
|
-
this.parentField = rawData.parentField;
|
|
24
|
-
this.parentProperty = rawData.parentProperty;
|
|
25
|
-
this.parentValidationId = rawData.parentValidationId;
|
|
26
|
-
this.success = rawData.success;
|
|
27
|
-
this.validationId = rawData.validationId;
|
|
28
|
-
if (rawData.messages) {
|
|
29
|
-
this.messages.length = 0;
|
|
30
|
-
for (let i = 0, len = rawData.messages.length; i < len; i++) {
|
|
31
|
-
this.messages.push(new validation_message_1.ValidationMessage(rawData.messages[i]));
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
if (rawData.fieldValidations) {
|
|
35
|
-
this.fieldValidations = {};
|
|
36
|
-
object_utils_1.ObjectUtils.ForOwnProperty(rawData.fieldValidations, (validationFieldData, propKey) => {
|
|
37
|
-
this.fieldValidations[propKey] = new field_validation_1.FieldValidation(validationFieldData);
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
merge(otherValidation) {
|
|
42
|
-
if (otherValidation) {
|
|
43
|
-
this.success = this.success && otherValidation.success;
|
|
44
|
-
this.messages.push(...otherValidation.messages);
|
|
45
|
-
this._mergeValidationResultFieldsObjects(otherValidation.fieldValidations);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
addValidationResultField(key, value) {
|
|
49
|
-
this.fieldValidations[key] = value;
|
|
50
|
-
}
|
|
51
|
-
makeAndAddValidationResultField(key, plainErrorMssg) {
|
|
52
|
-
const field = new field_validation_1.FieldValidation();
|
|
53
|
-
field.messages = [];
|
|
54
|
-
const messageObject = new validation_message_1.ValidationMessage();
|
|
55
|
-
messageObject.fieldId = key;
|
|
56
|
-
messageObject.message = plainErrorMssg;
|
|
57
|
-
field.messages.push(messageObject);
|
|
58
|
-
this.fieldValidations[key] = field;
|
|
59
|
-
}
|
|
60
|
-
getAllErrorMessagesOfMyValidationFields() {
|
|
61
|
-
return this.getAllErrorMessages();
|
|
62
|
-
}
|
|
63
|
-
getAllErrorMessages(messages = null) {
|
|
64
|
-
if (messages === null) {
|
|
65
|
-
messages = [];
|
|
66
|
-
}
|
|
67
|
-
object_utils_1.ObjectUtils.ForOwnProperty(this.fieldValidations, (validationField) => {
|
|
68
|
-
messages = validationField.getAllErrorMessages(messages);
|
|
69
|
-
});
|
|
70
|
-
return messages;
|
|
71
|
-
}
|
|
72
|
-
getFullErrorString(includeCode = true) {
|
|
73
|
-
const generalError = this.getGeneralErrorString(includeCode);
|
|
74
|
-
const validationFieldsError = this.getValidationFieldsErrorString();
|
|
75
|
-
if (!generalError && !validationFieldsError) {
|
|
76
|
-
return "";
|
|
77
|
-
}
|
|
78
|
-
else if (generalError && validationFieldsError) {
|
|
79
|
-
return generalError + "\n" + validationFieldsError;
|
|
80
|
-
}
|
|
81
|
-
else if (generalError) {
|
|
82
|
-
return generalError;
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
return validationFieldsError;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
getGeneralErrorString(includeCode = true) {
|
|
89
|
-
return this._getMessageString(includeCode, true);
|
|
90
|
-
}
|
|
91
|
-
getGeneralMessageString(includeCode = true) {
|
|
92
|
-
return this._getMessageString(includeCode, false);
|
|
93
|
-
}
|
|
94
|
-
getValidationFieldsErrorString() {
|
|
95
|
-
let errors = "";
|
|
96
|
-
object_utils_1.ObjectUtils.ForOwnProperty(this.fieldValidations, (validationField, propKey) => {
|
|
97
|
-
const errorString = validationField.getErrorString();
|
|
98
|
-
if (errorString) {
|
|
99
|
-
if (propKey) {
|
|
100
|
-
errors += propKey + ": ";
|
|
101
|
-
}
|
|
102
|
-
errors += errorString;
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
return errors;
|
|
106
|
-
}
|
|
107
|
-
createOrGetSubValidationResult(objectOrFieldId, objectId = null) {
|
|
108
|
-
let subValidation = this._getSubValidationResult(objectOrFieldId, objectId);
|
|
109
|
-
if (!subValidation) {
|
|
110
|
-
subValidation = new ValidationResult();
|
|
111
|
-
subValidation.objectId = objectId;
|
|
112
|
-
this._addSubValidationToValidationResultField(objectOrFieldId, subValidation);
|
|
113
|
-
}
|
|
114
|
-
return subValidation;
|
|
115
|
-
}
|
|
116
|
-
getAllFieldIds() {
|
|
117
|
-
const allFieldIds = [];
|
|
118
|
-
if (this.fieldValidations) {
|
|
119
|
-
object_utils_1.ObjectUtils.ForOwnProperty(this.fieldValidations, (fieldValidation) => {
|
|
120
|
-
if (fieldValidation) {
|
|
121
|
-
allFieldIds.push(...fieldValidation.getAllFieldIds());
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
return allFieldIds;
|
|
126
|
-
}
|
|
127
|
-
hasErrorForPropertyWithId(parentPropPath, boId) {
|
|
128
|
-
const messages = this.getAllErrorMessages();
|
|
129
|
-
return array_utils_1.ArrayUtils.ContainsAnElementFoundBy(messages, (msg) => {
|
|
130
|
-
return msg.getParentFieldId() === parentPropPath && business_object_utils_1.BusinessObjectUtils.IsEqualBoId(msg.boId, boId);
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
_getSubValidationResult(objectOrFieldId, objectId = null, subValidationFields = null) {
|
|
134
|
-
if (subValidationFields === null) {
|
|
135
|
-
subValidationFields = this.fieldValidations;
|
|
136
|
-
}
|
|
137
|
-
object_utils_1.ObjectUtils.ForOwnProperty(subValidationFields, (validationField, propKey) => {
|
|
138
|
-
const len = validationField.subValidations.length;
|
|
139
|
-
for (let i = 0; i < len; i++) {
|
|
140
|
-
const subValidation = validationField.subValidations[i];
|
|
141
|
-
if (subValidation.objectType === objectOrFieldId && (subValidation.objectId === objectId || objectId === null)) {
|
|
142
|
-
return subValidation;
|
|
143
|
-
}
|
|
144
|
-
if (subValidation.fieldValidations) {
|
|
145
|
-
return this._getSubValidationResult(objectOrFieldId, objectId, subValidation.fieldValidations);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
return null;
|
|
150
|
-
}
|
|
151
|
-
_addSubValidationToValidationResultField(key, sub) {
|
|
152
|
-
let found = false;
|
|
153
|
-
object_utils_1.ObjectUtils.ForOwnProperty(this.fieldValidations, (validationField, propKey) => {
|
|
154
|
-
if (propKey === key) {
|
|
155
|
-
validationField.subValidations.push(sub);
|
|
156
|
-
found = true;
|
|
157
|
-
return false;
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
|
-
if (!found) {
|
|
161
|
-
const validationResultField = new field_validation_1.FieldValidation();
|
|
162
|
-
validationResultField.subValidations.push(sub);
|
|
163
|
-
this.addValidationResultField(key, validationResultField);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
_mergeValidationResultFieldsObjects(otherValidationFields) {
|
|
167
|
-
if (this.fieldValidations && otherValidationFields) {
|
|
168
|
-
object_utils_1.ObjectUtils.ForOwnProperty(otherValidationFields, (val, key) => {
|
|
169
|
-
this.fieldValidations[key] = val;
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
_getMessageString(includeCode = true, errorFilter) {
|
|
174
|
-
let allMessages = "";
|
|
175
|
-
if (this.messages) {
|
|
176
|
-
const len = this.messages.length;
|
|
177
|
-
for (let i = 0; i < len; i++) {
|
|
178
|
-
const message = this.messages[i];
|
|
179
|
-
if (message && ((message.messageType === message_type_enum_1.MessageType.Error) || !errorFilter)) {
|
|
180
|
-
if (includeCode && !number_utils_1.NumberUtils.IsNaN(message.code)) {
|
|
181
|
-
allMessages += message.code + ": " + message.message + "\n";
|
|
182
|
-
}
|
|
183
|
-
else {
|
|
184
|
-
allMessages += message.message + "\n";
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
return allMessages;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
exports.ValidationResult = ValidationResult;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ValidationResult = void 0;
|
|
4
|
+
const object_utils_1 = require("../utils/object-utils");
|
|
5
|
+
const validation_message_1 = require("./validation-message");
|
|
6
|
+
const field_validation_1 = require("./field-validation");
|
|
7
|
+
const number_utils_1 = require("../utils/number-utils");
|
|
8
|
+
const business_object_utils_1 = require("../utils/business-object-utils");
|
|
9
|
+
const array_utils_1 = require("../utils/array-utils");
|
|
10
|
+
const message_type_enum_1 = require("../enum/message-type.enum");
|
|
11
|
+
class ValidationResult {
|
|
12
|
+
constructor(rawData) {
|
|
13
|
+
this.messages = [];
|
|
14
|
+
this.fieldValidations = {};
|
|
15
|
+
this.setData(rawData);
|
|
16
|
+
}
|
|
17
|
+
setData(rawData) {
|
|
18
|
+
if (!rawData) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
this.objectId = rawData.objectId;
|
|
22
|
+
this.objectType = rawData.objectType;
|
|
23
|
+
this.parentField = rawData.parentField;
|
|
24
|
+
this.parentProperty = rawData.parentProperty;
|
|
25
|
+
this.parentValidationId = rawData.parentValidationId;
|
|
26
|
+
this.success = rawData.success;
|
|
27
|
+
this.validationId = rawData.validationId;
|
|
28
|
+
if (rawData.messages) {
|
|
29
|
+
this.messages.length = 0;
|
|
30
|
+
for (let i = 0, len = rawData.messages.length; i < len; i++) {
|
|
31
|
+
this.messages.push(new validation_message_1.ValidationMessage(rawData.messages[i]));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (rawData.fieldValidations) {
|
|
35
|
+
this.fieldValidations = {};
|
|
36
|
+
object_utils_1.ObjectUtils.ForOwnProperty(rawData.fieldValidations, (validationFieldData, propKey) => {
|
|
37
|
+
this.fieldValidations[propKey] = new field_validation_1.FieldValidation(validationFieldData);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
merge(otherValidation) {
|
|
42
|
+
if (otherValidation) {
|
|
43
|
+
this.success = this.success && otherValidation.success;
|
|
44
|
+
this.messages.push(...otherValidation.messages);
|
|
45
|
+
this._mergeValidationResultFieldsObjects(otherValidation.fieldValidations);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
addValidationResultField(key, value) {
|
|
49
|
+
this.fieldValidations[key] = value;
|
|
50
|
+
}
|
|
51
|
+
makeAndAddValidationResultField(key, plainErrorMssg) {
|
|
52
|
+
const field = new field_validation_1.FieldValidation();
|
|
53
|
+
field.messages = [];
|
|
54
|
+
const messageObject = new validation_message_1.ValidationMessage();
|
|
55
|
+
messageObject.fieldId = key;
|
|
56
|
+
messageObject.message = plainErrorMssg;
|
|
57
|
+
field.messages.push(messageObject);
|
|
58
|
+
this.fieldValidations[key] = field;
|
|
59
|
+
}
|
|
60
|
+
getAllErrorMessagesOfMyValidationFields() {
|
|
61
|
+
return this.getAllErrorMessages();
|
|
62
|
+
}
|
|
63
|
+
getAllErrorMessages(messages = null) {
|
|
64
|
+
if (messages === null) {
|
|
65
|
+
messages = [];
|
|
66
|
+
}
|
|
67
|
+
object_utils_1.ObjectUtils.ForOwnProperty(this.fieldValidations, (validationField) => {
|
|
68
|
+
messages = validationField.getAllErrorMessages(messages);
|
|
69
|
+
});
|
|
70
|
+
return messages;
|
|
71
|
+
}
|
|
72
|
+
getFullErrorString(includeCode = true) {
|
|
73
|
+
const generalError = this.getGeneralErrorString(includeCode);
|
|
74
|
+
const validationFieldsError = this.getValidationFieldsErrorString();
|
|
75
|
+
if (!generalError && !validationFieldsError) {
|
|
76
|
+
return "";
|
|
77
|
+
}
|
|
78
|
+
else if (generalError && validationFieldsError) {
|
|
79
|
+
return generalError + "\n" + validationFieldsError;
|
|
80
|
+
}
|
|
81
|
+
else if (generalError) {
|
|
82
|
+
return generalError;
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
return validationFieldsError;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
getGeneralErrorString(includeCode = true) {
|
|
89
|
+
return this._getMessageString(includeCode, true);
|
|
90
|
+
}
|
|
91
|
+
getGeneralMessageString(includeCode = true) {
|
|
92
|
+
return this._getMessageString(includeCode, false);
|
|
93
|
+
}
|
|
94
|
+
getValidationFieldsErrorString() {
|
|
95
|
+
let errors = "";
|
|
96
|
+
object_utils_1.ObjectUtils.ForOwnProperty(this.fieldValidations, (validationField, propKey) => {
|
|
97
|
+
const errorString = validationField.getErrorString();
|
|
98
|
+
if (errorString) {
|
|
99
|
+
if (propKey) {
|
|
100
|
+
errors += propKey + ": ";
|
|
101
|
+
}
|
|
102
|
+
errors += errorString;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
return errors;
|
|
106
|
+
}
|
|
107
|
+
createOrGetSubValidationResult(objectOrFieldId, objectId = null) {
|
|
108
|
+
let subValidation = this._getSubValidationResult(objectOrFieldId, objectId);
|
|
109
|
+
if (!subValidation) {
|
|
110
|
+
subValidation = new ValidationResult();
|
|
111
|
+
subValidation.objectId = objectId;
|
|
112
|
+
this._addSubValidationToValidationResultField(objectOrFieldId, subValidation);
|
|
113
|
+
}
|
|
114
|
+
return subValidation;
|
|
115
|
+
}
|
|
116
|
+
getAllFieldIds() {
|
|
117
|
+
const allFieldIds = [];
|
|
118
|
+
if (this.fieldValidations) {
|
|
119
|
+
object_utils_1.ObjectUtils.ForOwnProperty(this.fieldValidations, (fieldValidation) => {
|
|
120
|
+
if (fieldValidation) {
|
|
121
|
+
allFieldIds.push(...fieldValidation.getAllFieldIds());
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
return allFieldIds;
|
|
126
|
+
}
|
|
127
|
+
hasErrorForPropertyWithId(parentPropPath, boId) {
|
|
128
|
+
const messages = this.getAllErrorMessages();
|
|
129
|
+
return array_utils_1.ArrayUtils.ContainsAnElementFoundBy(messages, (msg) => {
|
|
130
|
+
return msg.getParentFieldId() === parentPropPath && business_object_utils_1.BusinessObjectUtils.IsEqualBoId(msg.boId, boId);
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
_getSubValidationResult(objectOrFieldId, objectId = null, subValidationFields = null) {
|
|
134
|
+
if (subValidationFields === null) {
|
|
135
|
+
subValidationFields = this.fieldValidations;
|
|
136
|
+
}
|
|
137
|
+
object_utils_1.ObjectUtils.ForOwnProperty(subValidationFields, (validationField, propKey) => {
|
|
138
|
+
const len = validationField.subValidations.length;
|
|
139
|
+
for (let i = 0; i < len; i++) {
|
|
140
|
+
const subValidation = validationField.subValidations[i];
|
|
141
|
+
if (subValidation.objectType === objectOrFieldId && (subValidation.objectId === objectId || objectId === null)) {
|
|
142
|
+
return subValidation;
|
|
143
|
+
}
|
|
144
|
+
if (subValidation.fieldValidations) {
|
|
145
|
+
return this._getSubValidationResult(objectOrFieldId, objectId, subValidation.fieldValidations);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
_addSubValidationToValidationResultField(key, sub) {
|
|
152
|
+
let found = false;
|
|
153
|
+
object_utils_1.ObjectUtils.ForOwnProperty(this.fieldValidations, (validationField, propKey) => {
|
|
154
|
+
if (propKey === key) {
|
|
155
|
+
validationField.subValidations.push(sub);
|
|
156
|
+
found = true;
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
if (!found) {
|
|
161
|
+
const validationResultField = new field_validation_1.FieldValidation();
|
|
162
|
+
validationResultField.subValidations.push(sub);
|
|
163
|
+
this.addValidationResultField(key, validationResultField);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
_mergeValidationResultFieldsObjects(otherValidationFields) {
|
|
167
|
+
if (this.fieldValidations && otherValidationFields) {
|
|
168
|
+
object_utils_1.ObjectUtils.ForOwnProperty(otherValidationFields, (val, key) => {
|
|
169
|
+
this.fieldValidations[key] = val;
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
_getMessageString(includeCode = true, errorFilter) {
|
|
174
|
+
let allMessages = "";
|
|
175
|
+
if (this.messages) {
|
|
176
|
+
const len = this.messages.length;
|
|
177
|
+
for (let i = 0; i < len; i++) {
|
|
178
|
+
const message = this.messages[i];
|
|
179
|
+
if (message && ((message.messageType === message_type_enum_1.MessageType.Error) || !errorFilter)) {
|
|
180
|
+
if (includeCode && !number_utils_1.NumberUtils.IsNaN(message.code)) {
|
|
181
|
+
allMessages += message.code + ": " + message.message + "\n";
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
allMessages += message.message + "\n";
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return allMessages;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
exports.ValidationResult = ValidationResult;
|
|
193
193
|
//# sourceMappingURL=validation-result.js.map
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { Options } from '../model/options';
|
|
2
|
-
import { DataServiceData } from '../model/data-service-data';
|
|
3
|
-
import { BaseBackendConnectionService } from './base-backend-connection.service';
|
|
4
|
-
import { ServerResponseData } from '../model/server-response-data';
|
|
5
|
-
import { PublicServiceRequestData } from '../model/public-service-request-data';
|
|
6
|
-
import { LoginRequest } from '../model/login-request';
|
|
7
|
-
import { LoginResponse } from '../model/login-response';
|
|
8
|
-
export declare class AjaxService extends BaseBackendConnectionService {
|
|
9
|
-
private _showLoaderRequests;
|
|
10
|
-
private _timeout;
|
|
11
|
-
constructor(options: Options);
|
|
12
|
-
connect(): Promise<LoginResponse>;
|
|
13
|
-
hasSession(): boolean;
|
|
14
|
-
isPublicSession(): boolean;
|
|
15
|
-
call(method: string, data?: DataServiceData | PublicServiceRequestData, showLoader?: boolean, service?: string, endPoint?: string, isPublicService?: boolean, ownMessage?: {}): Promise<ServerResponseData>;
|
|
16
|
-
login(request: LoginRequest, encrypt: boolean): Promise<LoginResponse>;
|
|
17
|
-
confirmCode(upId: number, userName: string, confirmationCode: string, clientDeviceFingerprint: string, clientDeviceDescription: string, rememberClientDeviceForMFA: boolean): Promise<ServerResponseData>;
|
|
18
|
-
resetGoogleAuth(upId: number, userName: string): Promise<ServerResponseData>;
|
|
19
|
-
changePassword(password: string, securityCode: string, upId: number): Promise<ServerResponseData>;
|
|
20
|
-
changePasswordAndActivateUser(password: string, securityCode: string, upId: number, reCaptchaResponse?: string): Promise<ServerResponseData>;
|
|
21
|
-
sendResetPasswordOrInviteMessage(upId: number, userName: string, reCaptchaResponse: string): Promise<ServerResponseData>;
|
|
22
|
-
getUserNameBySecurityCode(securityCode: string, upId: number): Promise<ServerResponseData>;
|
|
23
|
-
getPublicKey(): Promise<string>;
|
|
24
|
-
close(): Promise<ServerResponseData>;
|
|
25
|
-
protected _doCall(method: string, data?: DataServiceData | PublicServiceRequestData, showLoader?: boolean, service?: string, endPoint?: string, isPublicService?: boolean, ownMessage?: {}): Promise<ServerResponseData>;
|
|
26
|
-
private _methodNeedsAccessToken;
|
|
27
|
-
private _waitForAccessToken;
|
|
28
|
-
private setShowLoaderRequests;
|
|
29
|
-
private _redirectToIdentityServerRealm;
|
|
30
|
-
private _getParameter;
|
|
31
|
-
private _createGuid;
|
|
32
|
-
}
|
|
1
|
+
import { Options } from '../model/options';
|
|
2
|
+
import { DataServiceData } from '../model/data-service-data';
|
|
3
|
+
import { BaseBackendConnectionService } from './base-backend-connection.service';
|
|
4
|
+
import { ServerResponseData } from '../model/server-response-data';
|
|
5
|
+
import { PublicServiceRequestData } from '../model/public-service-request-data';
|
|
6
|
+
import { LoginRequest } from '../model/login-request';
|
|
7
|
+
import { LoginResponse } from '../model/login-response';
|
|
8
|
+
export declare class AjaxService extends BaseBackendConnectionService {
|
|
9
|
+
private _showLoaderRequests;
|
|
10
|
+
private _timeout;
|
|
11
|
+
constructor(options: Options);
|
|
12
|
+
connect(): Promise<LoginResponse>;
|
|
13
|
+
hasSession(): boolean;
|
|
14
|
+
isPublicSession(): boolean;
|
|
15
|
+
call(method: string, data?: DataServiceData | PublicServiceRequestData, showLoader?: boolean, service?: string, endPoint?: string, isPublicService?: boolean, ownMessage?: {}): Promise<ServerResponseData>;
|
|
16
|
+
login(request: LoginRequest, encrypt: boolean): Promise<LoginResponse>;
|
|
17
|
+
confirmCode(upId: number, userName: string, confirmationCode: string, clientDeviceFingerprint: string, clientDeviceDescription: string, rememberClientDeviceForMFA: boolean): Promise<ServerResponseData>;
|
|
18
|
+
resetGoogleAuth(upId: number, userName: string): Promise<ServerResponseData>;
|
|
19
|
+
changePassword(password: string, securityCode: string, upId: number): Promise<ServerResponseData>;
|
|
20
|
+
changePasswordAndActivateUser(password: string, securityCode: string, upId: number, reCaptchaResponse?: string): Promise<ServerResponseData>;
|
|
21
|
+
sendResetPasswordOrInviteMessage(upId: number, userName: string, reCaptchaResponse: string): Promise<ServerResponseData>;
|
|
22
|
+
getUserNameBySecurityCode(securityCode: string, upId: number): Promise<ServerResponseData>;
|
|
23
|
+
getPublicKey(): Promise<string>;
|
|
24
|
+
close(): Promise<ServerResponseData>;
|
|
25
|
+
protected _doCall(method: string, data?: DataServiceData | PublicServiceRequestData, showLoader?: boolean, service?: string, endPoint?: string, isPublicService?: boolean, ownMessage?: {}): Promise<ServerResponseData>;
|
|
26
|
+
private _methodNeedsAccessToken;
|
|
27
|
+
private _waitForAccessToken;
|
|
28
|
+
private setShowLoaderRequests;
|
|
29
|
+
private _redirectToIdentityServerRealm;
|
|
30
|
+
private _getParameter;
|
|
31
|
+
private _createGuid;
|
|
32
|
+
}
|