@colijnit/ioneconnector 3.1.18 → 3.1.19
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 -29
- package/build/connector.js +67 -64
- package/build/connector.js.map +1 -1
- 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 -6
- package/build/enum/backend-service-name.enum.js +11 -10
- package/build/enum/backend-service-name.enum.js.map +1 -1
- 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 -0
- package/build/enum/user-info-service-method.enum.js +8 -0
- package/build/enum/user-info-service-method.enum.js.map +1 -0
- 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 -24
- package/build/model/options.js +16 -16
- package/build/model/options.js.map +1 -1
- 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 +33 -32
- package/build/provider/ajax.service.js +280 -275
- package/build/provider/ajax.service.js.map +1 -1
- package/build/provider/base-backend-connection.service.d.ts +44 -43
- package/build/provider/base-backend-connection.service.js +154 -144
- 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 -0
- package/build/service/external-jwt-token.service.js +22 -0
- package/build/service/external-jwt-token.service.js.map +1 -0
- 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 -0
- package/build/service/internal-jwt-token.service.js +41 -0
- package/build/service/internal-jwt-token.service.js.map +1 -0
- package/build/service/jwt-token.service.d.ts +12 -12
- package/build/service/jwt-token.service.js +32 -62
- package/build/service/jwt-token.service.js.map +1 -1
- package/build/service/local-storage.service.d.ts +27 -28
- package/build/service/local-storage.service.js +147 -154
- package/build/service/local-storage.service.js.map +1 -1
- 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 -0
- package/build/service/user-info.service.js +34 -0
- package/build/service/user-info.service.js.map +1 -0
- 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 +64 -64
|
@@ -1,120 +1,120 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BusinessObjectFactory = void 0;
|
|
4
|
-
const complex_field_decorator_1 = require("../factory/decorators/complex-field.decorator");
|
|
5
|
-
const complex_array_decorator_1 = require("../factory/decorators/complex-array.decorator");
|
|
6
|
-
const boolean_decorator_1 = require("../factory/decorators/boolean.decorator");
|
|
7
|
-
const date_field_decorator_1 = require("../factory/decorators/date-field.decorator");
|
|
8
|
-
const string_number_decorator_1 = require("../factory/decorators/string-number.decorator");
|
|
9
|
-
const is_nill_function_1 = require("../utils/function/is-nill.function");
|
|
10
|
-
const array_utils_1 = require("../utils/array-utils");
|
|
11
|
-
const business_object_1 = require("../model/business-object");
|
|
12
|
-
const map_property_decorator_1 = require("../factory/decorators/map-property.decorator");
|
|
13
|
-
const json_decorator_1 = require("../factory/decorators/json.decorator");
|
|
14
|
-
class BusinessObjectFactory {
|
|
15
|
-
constructor() {
|
|
16
|
-
}
|
|
17
|
-
makeWithRawBackendData(modelClass, rawData) {
|
|
18
|
-
if (!modelClass) {
|
|
19
|
-
return undefined;
|
|
20
|
-
}
|
|
21
|
-
if (typeof modelClass !== typeof business_object_1.BusinessObject) {
|
|
22
|
-
return undefined;
|
|
23
|
-
}
|
|
24
|
-
const model = new modelClass();
|
|
25
|
-
this._copyAllPropertiesDecoratorProcessedFrom(rawData, model);
|
|
26
|
-
return model;
|
|
27
|
-
}
|
|
28
|
-
makeBOArrayFromRawBackendDataArray(modelClass, arrayOfRawDatas) {
|
|
29
|
-
if (!modelClass) {
|
|
30
|
-
return undefined;
|
|
31
|
-
}
|
|
32
|
-
const trueClientBos = [];
|
|
33
|
-
if (arrayOfRawDatas) {
|
|
34
|
-
for (let i = 0, len = arrayOfRawDatas.length; i < len; i++) {
|
|
35
|
-
trueClientBos.push(this.makeWithRawBackendData(modelClass, arrayOfRawDatas[i]));
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return trueClientBos;
|
|
39
|
-
}
|
|
40
|
-
instantiateNewBo(modelClass) {
|
|
41
|
-
return this.makeWithRawBackendData(modelClass, {});
|
|
42
|
-
}
|
|
43
|
-
_copyAllPropertiesDecoratorProcessedFrom(sourceData, destinationModel) {
|
|
44
|
-
if (!sourceData || !destinationModel) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
for (let srcPropKey in sourceData) {
|
|
48
|
-
if (!sourceData.hasOwnProperty(srcPropKey)) {
|
|
49
|
-
continue;
|
|
50
|
-
}
|
|
51
|
-
let srcPropVal = sourceData[srcPropKey];
|
|
52
|
-
for (let prop in destinationModel) {
|
|
53
|
-
if (destinationModel.hasOwnProperty(prop)) {
|
|
54
|
-
if (map_property_decorator_1.MapPropertyDecorator.IsMapProperty(destinationModel, prop)) {
|
|
55
|
-
const destPropKeys = map_property_decorator_1.MapPropertyDecorator.GetMapProperty(destinationModel, prop).split(',');
|
|
56
|
-
const keyFound = destPropKeys.find(k => k.trim() === srcPropKey);
|
|
57
|
-
if (keyFound) {
|
|
58
|
-
srcPropKey = prop;
|
|
59
|
-
break;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
if (json_decorator_1.JsonFieldFieldDecorator.IsJsonField(destinationModel, srcPropKey)) {
|
|
65
|
-
srcPropVal = json_decorator_1.JsonFieldFieldDecorator.StringAsJson(srcPropVal);
|
|
66
|
-
}
|
|
67
|
-
if (complex_field_decorator_1.ComplexFieldDecorator.IsComplexField(destinationModel, srcPropKey)) {
|
|
68
|
-
const classOfField = complex_field_decorator_1.ComplexFieldDecorator.GetComplexFieldType(destinationModel, srcPropKey);
|
|
69
|
-
destinationModel[srcPropKey] = this.makeWithRawBackendData(classOfField, srcPropVal);
|
|
70
|
-
}
|
|
71
|
-
else if (complex_array_decorator_1.ComplexArrayDecorator.IsComplexArray(destinationModel, srcPropKey)) {
|
|
72
|
-
const sourceArray = srcPropVal;
|
|
73
|
-
if (!sourceArray) {
|
|
74
|
-
continue;
|
|
75
|
-
}
|
|
76
|
-
const classOfArrayItems = complex_array_decorator_1.ComplexArrayDecorator.GetComplexArrayType(destinationModel, srcPropKey);
|
|
77
|
-
const tempArray = [];
|
|
78
|
-
for (let i = 0, len = sourceArray.length; i < len; i++) {
|
|
79
|
-
tempArray.push(this.makeWithRawBackendData(classOfArrayItems, sourceArray[i]));
|
|
80
|
-
}
|
|
81
|
-
destinationModel[srcPropKey] = tempArray;
|
|
82
|
-
}
|
|
83
|
-
else if (boolean_decorator_1.BooleanTextDecorator.IsBooleanTextField(destinationModel, srcPropKey)) {
|
|
84
|
-
if (typeof srcPropVal === "boolean") {
|
|
85
|
-
destinationModel[srcPropKey] = srcPropVal;
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
destinationModel[srcPropKey] = boolean_decorator_1.BooleanTextDecorator.GetLogicalBooleanValue(srcPropVal);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
else if (date_field_decorator_1.DateFieldFieldDecorator.IsDateField(destinationModel, srcPropKey)) {
|
|
92
|
-
destinationModel[srcPropKey] = date_field_decorator_1.DateFieldFieldDecorator.StringAsDate(srcPropVal);
|
|
93
|
-
}
|
|
94
|
-
else if (string_number_decorator_1.StringNumberDecorator.IsStringNumber(destinationModel, srcPropKey)) {
|
|
95
|
-
destinationModel[srcPropKey] = string_number_decorator_1.StringNumberDecorator.StringAsNumber(srcPropVal);
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
if ((0, is_nill_function_1.isNill)(srcPropVal)) {
|
|
99
|
-
destinationModel[srcPropKey] = undefined;
|
|
100
|
-
}
|
|
101
|
-
else if (Array.isArray(srcPropVal)) {
|
|
102
|
-
destinationModel[srcPropKey] = array_utils_1.ArrayUtils.CloneArray(srcPropVal);
|
|
103
|
-
}
|
|
104
|
-
else if (typeof srcPropVal === "object") {
|
|
105
|
-
if (srcPropVal instanceof Map) {
|
|
106
|
-
destinationModel[srcPropKey] = srcPropVal;
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
destinationModel[srcPropKey] = Object.assign({}, srcPropVal);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
destinationModel[srcPropKey] = srcPropVal;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
exports.BusinessObjectFactory = BusinessObjectFactory;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BusinessObjectFactory = void 0;
|
|
4
|
+
const complex_field_decorator_1 = require("../factory/decorators/complex-field.decorator");
|
|
5
|
+
const complex_array_decorator_1 = require("../factory/decorators/complex-array.decorator");
|
|
6
|
+
const boolean_decorator_1 = require("../factory/decorators/boolean.decorator");
|
|
7
|
+
const date_field_decorator_1 = require("../factory/decorators/date-field.decorator");
|
|
8
|
+
const string_number_decorator_1 = require("../factory/decorators/string-number.decorator");
|
|
9
|
+
const is_nill_function_1 = require("../utils/function/is-nill.function");
|
|
10
|
+
const array_utils_1 = require("../utils/array-utils");
|
|
11
|
+
const business_object_1 = require("../model/business-object");
|
|
12
|
+
const map_property_decorator_1 = require("../factory/decorators/map-property.decorator");
|
|
13
|
+
const json_decorator_1 = require("../factory/decorators/json.decorator");
|
|
14
|
+
class BusinessObjectFactory {
|
|
15
|
+
constructor() {
|
|
16
|
+
}
|
|
17
|
+
makeWithRawBackendData(modelClass, rawData) {
|
|
18
|
+
if (!modelClass) {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
if (typeof modelClass !== typeof business_object_1.BusinessObject) {
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
const model = new modelClass();
|
|
25
|
+
this._copyAllPropertiesDecoratorProcessedFrom(rawData, model);
|
|
26
|
+
return model;
|
|
27
|
+
}
|
|
28
|
+
makeBOArrayFromRawBackendDataArray(modelClass, arrayOfRawDatas) {
|
|
29
|
+
if (!modelClass) {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
const trueClientBos = [];
|
|
33
|
+
if (arrayOfRawDatas) {
|
|
34
|
+
for (let i = 0, len = arrayOfRawDatas.length; i < len; i++) {
|
|
35
|
+
trueClientBos.push(this.makeWithRawBackendData(modelClass, arrayOfRawDatas[i]));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return trueClientBos;
|
|
39
|
+
}
|
|
40
|
+
instantiateNewBo(modelClass) {
|
|
41
|
+
return this.makeWithRawBackendData(modelClass, {});
|
|
42
|
+
}
|
|
43
|
+
_copyAllPropertiesDecoratorProcessedFrom(sourceData, destinationModel) {
|
|
44
|
+
if (!sourceData || !destinationModel) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
for (let srcPropKey in sourceData) {
|
|
48
|
+
if (!sourceData.hasOwnProperty(srcPropKey)) {
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
let srcPropVal = sourceData[srcPropKey];
|
|
52
|
+
for (let prop in destinationModel) {
|
|
53
|
+
if (destinationModel.hasOwnProperty(prop)) {
|
|
54
|
+
if (map_property_decorator_1.MapPropertyDecorator.IsMapProperty(destinationModel, prop)) {
|
|
55
|
+
const destPropKeys = map_property_decorator_1.MapPropertyDecorator.GetMapProperty(destinationModel, prop).split(',');
|
|
56
|
+
const keyFound = destPropKeys.find(k => k.trim() === srcPropKey);
|
|
57
|
+
if (keyFound) {
|
|
58
|
+
srcPropKey = prop;
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (json_decorator_1.JsonFieldFieldDecorator.IsJsonField(destinationModel, srcPropKey)) {
|
|
65
|
+
srcPropVal = json_decorator_1.JsonFieldFieldDecorator.StringAsJson(srcPropVal);
|
|
66
|
+
}
|
|
67
|
+
if (complex_field_decorator_1.ComplexFieldDecorator.IsComplexField(destinationModel, srcPropKey)) {
|
|
68
|
+
const classOfField = complex_field_decorator_1.ComplexFieldDecorator.GetComplexFieldType(destinationModel, srcPropKey);
|
|
69
|
+
destinationModel[srcPropKey] = this.makeWithRawBackendData(classOfField, srcPropVal);
|
|
70
|
+
}
|
|
71
|
+
else if (complex_array_decorator_1.ComplexArrayDecorator.IsComplexArray(destinationModel, srcPropKey)) {
|
|
72
|
+
const sourceArray = srcPropVal;
|
|
73
|
+
if (!sourceArray) {
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
const classOfArrayItems = complex_array_decorator_1.ComplexArrayDecorator.GetComplexArrayType(destinationModel, srcPropKey);
|
|
77
|
+
const tempArray = [];
|
|
78
|
+
for (let i = 0, len = sourceArray.length; i < len; i++) {
|
|
79
|
+
tempArray.push(this.makeWithRawBackendData(classOfArrayItems, sourceArray[i]));
|
|
80
|
+
}
|
|
81
|
+
destinationModel[srcPropKey] = tempArray;
|
|
82
|
+
}
|
|
83
|
+
else if (boolean_decorator_1.BooleanTextDecorator.IsBooleanTextField(destinationModel, srcPropKey)) {
|
|
84
|
+
if (typeof srcPropVal === "boolean") {
|
|
85
|
+
destinationModel[srcPropKey] = srcPropVal;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
destinationModel[srcPropKey] = boolean_decorator_1.BooleanTextDecorator.GetLogicalBooleanValue(srcPropVal);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
else if (date_field_decorator_1.DateFieldFieldDecorator.IsDateField(destinationModel, srcPropKey)) {
|
|
92
|
+
destinationModel[srcPropKey] = date_field_decorator_1.DateFieldFieldDecorator.StringAsDate(srcPropVal);
|
|
93
|
+
}
|
|
94
|
+
else if (string_number_decorator_1.StringNumberDecorator.IsStringNumber(destinationModel, srcPropKey)) {
|
|
95
|
+
destinationModel[srcPropKey] = string_number_decorator_1.StringNumberDecorator.StringAsNumber(srcPropVal);
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
if ((0, is_nill_function_1.isNill)(srcPropVal)) {
|
|
99
|
+
destinationModel[srcPropKey] = undefined;
|
|
100
|
+
}
|
|
101
|
+
else if (Array.isArray(srcPropVal)) {
|
|
102
|
+
destinationModel[srcPropKey] = array_utils_1.ArrayUtils.CloneArray(srcPropVal);
|
|
103
|
+
}
|
|
104
|
+
else if (typeof srcPropVal === "object") {
|
|
105
|
+
if (srcPropVal instanceof Map) {
|
|
106
|
+
destinationModel[srcPropKey] = srcPropVal;
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
destinationModel[srcPropKey] = Object.assign({}, srcPropVal);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
destinationModel[srcPropKey] = srcPropVal;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
exports.BusinessObjectFactory = BusinessObjectFactory;
|
|
120
120
|
//# sourceMappingURL=business-object-factory.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { BaseBackendConnectionService } from "../provider/base-backend-connection.service";
|
|
2
|
-
import { ServerResponseData } from "../model/server-response-data";
|
|
3
|
-
export declare class DatasessionService {
|
|
4
|
-
protected backendConnection: BaseBackendConnectionService;
|
|
5
|
-
constructor(backendConnection: BaseBackendConnectionService);
|
|
6
|
-
createDataSession(id: string): Promise<ServerResponseData>;
|
|
7
|
-
commit(): Promise<ServerResponseData>;
|
|
8
|
-
private _call;
|
|
9
|
-
}
|
|
1
|
+
import { BaseBackendConnectionService } from "../provider/base-backend-connection.service";
|
|
2
|
+
import { ServerResponseData } from "../model/server-response-data";
|
|
3
|
+
export declare class DatasessionService {
|
|
4
|
+
protected backendConnection: BaseBackendConnectionService;
|
|
5
|
+
constructor(backendConnection: BaseBackendConnectionService);
|
|
6
|
+
createDataSession(id: string): Promise<ServerResponseData>;
|
|
7
|
+
commit(): Promise<ServerResponseData>;
|
|
8
|
+
private _call;
|
|
9
|
+
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DatasessionService = void 0;
|
|
4
|
-
const backend_service_name_enum_1 = require("../enum/backend-service-name.enum");
|
|
5
|
-
const datasession_service_method_enum_1 = require("../enum/datasession-service-method.enum");
|
|
6
|
-
class DatasessionService {
|
|
7
|
-
constructor(backendConnection) {
|
|
8
|
-
this.backendConnection = backendConnection;
|
|
9
|
-
}
|
|
10
|
-
createDataSession(id) {
|
|
11
|
-
return this._call(datasession_service_method_enum_1.DatasessionServiceMethod.OpenDataSession, { moduleName: id }, true);
|
|
12
|
-
}
|
|
13
|
-
async commit() {
|
|
14
|
-
return await this._call(datasession_service_method_enum_1.DatasessionServiceMethod.Commit, {}, false);
|
|
15
|
-
}
|
|
16
|
-
_call(method, data, showLoader) {
|
|
17
|
-
if (data === undefined) {
|
|
18
|
-
data = {};
|
|
19
|
-
}
|
|
20
|
-
if (showLoader === undefined) {
|
|
21
|
-
showLoader = true;
|
|
22
|
-
}
|
|
23
|
-
return this.backendConnection.call(method, data, showLoader, backend_service_name_enum_1.BackendServiceName.DatasessionService);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.DatasessionService = DatasessionService;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DatasessionService = void 0;
|
|
4
|
+
const backend_service_name_enum_1 = require("../enum/backend-service-name.enum");
|
|
5
|
+
const datasession_service_method_enum_1 = require("../enum/datasession-service-method.enum");
|
|
6
|
+
class DatasessionService {
|
|
7
|
+
constructor(backendConnection) {
|
|
8
|
+
this.backendConnection = backendConnection;
|
|
9
|
+
}
|
|
10
|
+
createDataSession(id) {
|
|
11
|
+
return this._call(datasession_service_method_enum_1.DatasessionServiceMethod.OpenDataSession, { moduleName: id }, true);
|
|
12
|
+
}
|
|
13
|
+
async commit() {
|
|
14
|
+
return await this._call(datasession_service_method_enum_1.DatasessionServiceMethod.Commit, {}, false);
|
|
15
|
+
}
|
|
16
|
+
_call(method, data, showLoader) {
|
|
17
|
+
if (data === undefined) {
|
|
18
|
+
data = {};
|
|
19
|
+
}
|
|
20
|
+
if (showLoader === undefined) {
|
|
21
|
+
showLoader = true;
|
|
22
|
+
}
|
|
23
|
+
return this.backendConnection.call(method, data, showLoader, backend_service_name_enum_1.BackendServiceName.DatasessionService);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.DatasessionService = DatasessionService;
|
|
27
27
|
//# sourceMappingURL=datasession.service.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare class EncryptService {
|
|
2
|
-
private rsa;
|
|
3
|
-
constructor();
|
|
4
|
-
set publicKey(key: string);
|
|
5
|
-
encRsa(stringToEncrypt: string): string;
|
|
6
|
-
}
|
|
1
|
+
export declare class EncryptService {
|
|
2
|
+
private rsa;
|
|
3
|
+
constructor();
|
|
4
|
+
set publicKey(key: string);
|
|
5
|
+
encRsa(stringToEncrypt: string): string;
|
|
6
|
+
}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EncryptService = void 0;
|
|
4
|
-
const jsencrypt_1 = require("jsencrypt");
|
|
5
|
-
let JSEncryptNode = null;
|
|
6
|
-
try {
|
|
7
|
-
JSEncryptNode = require("nodejs-jsencrypt").default;
|
|
8
|
-
}
|
|
9
|
-
catch (e) { }
|
|
10
|
-
class EncryptService {
|
|
11
|
-
constructor() {
|
|
12
|
-
if (JSEncryptNode) {
|
|
13
|
-
this.rsa = new JSEncryptNode({
|
|
14
|
-
default_key_size: "2048"
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
this.rsa = new jsencrypt_1.JSEncrypt({
|
|
19
|
-
default_key_size: "2048"
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
set publicKey(key) {
|
|
24
|
-
this.rsa.setPublicKey(key);
|
|
25
|
-
}
|
|
26
|
-
encRsa(stringToEncrypt) {
|
|
27
|
-
return this.rsa.encrypt(stringToEncrypt);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
exports.EncryptService = EncryptService;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EncryptService = void 0;
|
|
4
|
+
const jsencrypt_1 = require("jsencrypt");
|
|
5
|
+
let JSEncryptNode = null;
|
|
6
|
+
try {
|
|
7
|
+
JSEncryptNode = require("nodejs-jsencrypt").default;
|
|
8
|
+
}
|
|
9
|
+
catch (e) { }
|
|
10
|
+
class EncryptService {
|
|
11
|
+
constructor() {
|
|
12
|
+
if (JSEncryptNode) {
|
|
13
|
+
this.rsa = new JSEncryptNode({
|
|
14
|
+
default_key_size: "2048"
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
this.rsa = new jsencrypt_1.JSEncrypt({
|
|
19
|
+
default_key_size: "2048"
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
set publicKey(key) {
|
|
24
|
+
this.rsa.setPublicKey(key);
|
|
25
|
+
}
|
|
26
|
+
encRsa(stringToEncrypt) {
|
|
27
|
+
return this.rsa.encrypt(stringToEncrypt);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.EncryptService = EncryptService;
|
|
31
31
|
//# sourceMappingURL=encrypt.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const encrypt_service_1 = require("./encrypt.service");
|
|
4
|
-
const publicKey = "-----BEGIN PUBLIC KEY-----\n" +
|
|
5
|
-
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArrb9f3obcZG3WETmxtzoJlfkMc2LuIT1n6J5WmPVCPwk8gYqI/bq7+/yLvdC0ZCB641YJa/hA9avCScOHbHqf5AHr3Tk7yYR52oitBuclOkHJdInTfTCMmK2mdtaPulPy1aOJFsIycnKqV8+iCAztXRq3vKqz/rbF7oZIeAZ0FSTh0E628meaEZhb07foaxXDu1vK0OYKB9axNX2EL2Pn886VeOE0sjdOTF49HG3b3Axgt/NLLF1FX0brwQDWt7HYXd3Pw/RCUWnyag7b/ap+9EDaxAvhcO5ZFYZklPgHFUTO7w2Dj2jCH2e1/l9+KFb8FvoLVh23PT9fpaZbcHVtwIDAQAB\n" +
|
|
6
|
-
"-----END PUBLIC KEY-----";
|
|
7
|
-
describe("EncryptService", () => {
|
|
8
|
-
it('encRsa', () => {
|
|
9
|
-
const encryptionService = new encrypt_service_1.EncryptService();
|
|
10
|
-
encryptionService.publicKey = publicKey;
|
|
11
|
-
const encryptedString = encryptionService.encRsa("gast3");
|
|
12
|
-
expect(encryptedString.length).toBeGreaterThan(1);
|
|
13
|
-
});
|
|
14
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const encrypt_service_1 = require("./encrypt.service");
|
|
4
|
+
const publicKey = "-----BEGIN PUBLIC KEY-----\n" +
|
|
5
|
+
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArrb9f3obcZG3WETmxtzoJlfkMc2LuIT1n6J5WmPVCPwk8gYqI/bq7+/yLvdC0ZCB641YJa/hA9avCScOHbHqf5AHr3Tk7yYR52oitBuclOkHJdInTfTCMmK2mdtaPulPy1aOJFsIycnKqV8+iCAztXRq3vKqz/rbF7oZIeAZ0FSTh0E628meaEZhb07foaxXDu1vK0OYKB9axNX2EL2Pn886VeOE0sjdOTF49HG3b3Axgt/NLLF1FX0brwQDWt7HYXd3Pw/RCUWnyag7b/ap+9EDaxAvhcO5ZFYZklPgHFUTO7w2Dj2jCH2e1/l9+KFb8FvoLVh23PT9fpaZbcHVtwIDAQAB\n" +
|
|
6
|
+
"-----END PUBLIC KEY-----";
|
|
7
|
+
describe("EncryptService", () => {
|
|
8
|
+
it('encRsa', () => {
|
|
9
|
+
const encryptionService = new encrypt_service_1.EncryptService();
|
|
10
|
+
encryptionService.publicKey = publicKey;
|
|
11
|
+
const encryptedString = encryptionService.encRsa("gast3");
|
|
12
|
+
expect(encryptedString.length).toBeGreaterThan(1);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
15
|
//# sourceMappingURL=encrypt.service.unit.test.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { JwtTokenService } from "./jwt-token.service";
|
|
2
|
+
import { SessionStorageService } from "./session-storage.service";
|
|
3
|
+
import { LoginService } from "./login.service";
|
|
4
|
+
export declare class ExternalJwtTokenService extends JwtTokenService {
|
|
5
|
+
get jwt(): string;
|
|
6
|
+
get retrievingToken(): boolean;
|
|
7
|
+
private readonly _getAccessTokenFunction;
|
|
8
|
+
constructor(sessionStorageService: SessionStorageService, loginService: LoginService, getAccessTokenFunction: Function);
|
|
9
|
+
getAccessToken(refresh?: boolean): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExternalJwtTokenService = void 0;
|
|
4
|
+
const jwt_token_service_1 = require("./jwt-token.service");
|
|
5
|
+
class ExternalJwtTokenService extends jwt_token_service_1.JwtTokenService {
|
|
6
|
+
get jwt() {
|
|
7
|
+
if (this._getAccessTokenFunction) {
|
|
8
|
+
return this._getAccessTokenFunction();
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
get retrievingToken() {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
constructor(sessionStorageService, loginService, getAccessTokenFunction) {
|
|
15
|
+
super(sessionStorageService, loginService);
|
|
16
|
+
this._getAccessTokenFunction = getAccessTokenFunction;
|
|
17
|
+
}
|
|
18
|
+
async getAccessToken(refresh) {
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.ExternalJwtTokenService = ExternalJwtTokenService;
|
|
22
|
+
//# sourceMappingURL=external-jwt-token.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"external-jwt-token.service.js","sourceRoot":"","sources":["../../src/service/external-jwt-token.service.ts"],"names":[],"mappings":";;;AAAA,2DAAoD;AAIpD,MAAa,uBAAwB,SAAQ,mCAAe;IAExD,IAAW,GAAG;QACV,IAAI,IAAI,CAAC,uBAAuB,EAAE;YAC9B,OAAO,IAAI,CAAC,uBAAuB,EAAE,CAAC;SACzC;IACL,CAAC;IAED,IAAW,eAAe;QAEtB,OAAO,KAAK,CAAC;IACjB,CAAC;IAID,YAAY,qBAA4C,EAAE,YAA0B,EAAE,sBAAgC;QAClH,KAAK,CAAC,qBAAqB,EAAE,YAAY,CAAC,CAAC;QAC3C,IAAI,CAAC,uBAAuB,GAAG,sBAAsB,CAAC;IAC1D,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,OAAiB;IAE7C,CAAC;CACJ;AAvBD,0DAuBC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { BaseBackendConnectionService } from '../provider/base-backend-connection.service';
|
|
2
|
-
export declare class HealthService {
|
|
3
|
-
private static HEARTBEAT_INTERVAL_MS;
|
|
4
|
-
protected heartbeatTimer: any;
|
|
5
|
-
protected backendConnection: BaseBackendConnectionService;
|
|
6
|
-
constructor(backendConnection: BaseBackendConnectionService);
|
|
7
|
-
startHeartBeat(): void;
|
|
8
|
-
stopHeartBeat(): void;
|
|
9
|
-
private _call;
|
|
10
|
-
}
|
|
1
|
+
import { BaseBackendConnectionService } from '../provider/base-backend-connection.service';
|
|
2
|
+
export declare class HealthService {
|
|
3
|
+
private static HEARTBEAT_INTERVAL_MS;
|
|
4
|
+
protected heartbeatTimer: any;
|
|
5
|
+
protected backendConnection: BaseBackendConnectionService;
|
|
6
|
+
constructor(backendConnection: BaseBackendConnectionService);
|
|
7
|
+
startHeartBeat(): void;
|
|
8
|
+
stopHeartBeat(): void;
|
|
9
|
+
private _call;
|
|
10
|
+
}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HealthService = void 0;
|
|
4
|
-
const backend_service_name_enum_1 = require("../enum/backend-service-name.enum");
|
|
5
|
-
const health_service_method_enum_1 = require("../enum/health-service-method.enum");
|
|
6
|
-
class HealthService {
|
|
7
|
-
constructor(backendConnection) {
|
|
8
|
-
this.backendConnection = backendConnection;
|
|
9
|
-
}
|
|
10
|
-
startHeartBeat() {
|
|
11
|
-
if (!this.heartbeatTimer) {
|
|
12
|
-
this.heartbeatTimer = setInterval(() => {
|
|
13
|
-
this._call(health_service_method_enum_1.HealthServiceMethod.GetHeartBeat, {}, false);
|
|
14
|
-
}, HealthService.HEARTBEAT_INTERVAL_MS);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
stopHeartBeat() {
|
|
18
|
-
if (this.heartbeatTimer) {
|
|
19
|
-
clearInterval(this.heartbeatTimer);
|
|
20
|
-
this.heartbeatTimer = null;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
_call(method, data, showLoader) {
|
|
24
|
-
if (data === undefined) {
|
|
25
|
-
data = {};
|
|
26
|
-
}
|
|
27
|
-
if (showLoader === undefined) {
|
|
28
|
-
showLoader = true;
|
|
29
|
-
}
|
|
30
|
-
return this.backendConnection.call(method, data, showLoader, backend_service_name_enum_1.BackendServiceName.HealthService);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.HealthService = HealthService;
|
|
34
|
-
HealthService.HEARTBEAT_INTERVAL_MS = 59000;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HealthService = void 0;
|
|
4
|
+
const backend_service_name_enum_1 = require("../enum/backend-service-name.enum");
|
|
5
|
+
const health_service_method_enum_1 = require("../enum/health-service-method.enum");
|
|
6
|
+
class HealthService {
|
|
7
|
+
constructor(backendConnection) {
|
|
8
|
+
this.backendConnection = backendConnection;
|
|
9
|
+
}
|
|
10
|
+
startHeartBeat() {
|
|
11
|
+
if (!this.heartbeatTimer) {
|
|
12
|
+
this.heartbeatTimer = setInterval(() => {
|
|
13
|
+
this._call(health_service_method_enum_1.HealthServiceMethod.GetHeartBeat, {}, false);
|
|
14
|
+
}, HealthService.HEARTBEAT_INTERVAL_MS);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
stopHeartBeat() {
|
|
18
|
+
if (this.heartbeatTimer) {
|
|
19
|
+
clearInterval(this.heartbeatTimer);
|
|
20
|
+
this.heartbeatTimer = null;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
_call(method, data, showLoader) {
|
|
24
|
+
if (data === undefined) {
|
|
25
|
+
data = {};
|
|
26
|
+
}
|
|
27
|
+
if (showLoader === undefined) {
|
|
28
|
+
showLoader = true;
|
|
29
|
+
}
|
|
30
|
+
return this.backendConnection.call(method, data, showLoader, backend_service_name_enum_1.BackendServiceName.HealthService);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.HealthService = HealthService;
|
|
34
|
+
HealthService.HEARTBEAT_INTERVAL_MS = 59000;
|
|
35
35
|
//# sourceMappingURL=health.service.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { JwtTokenService } from "./jwt-token.service";
|
|
2
|
+
import { SessionStorageService } from "./session-storage.service";
|
|
3
|
+
import { LoginService } from "./login.service";
|
|
4
|
+
export declare class InternalJwtTokenService extends JwtTokenService {
|
|
5
|
+
get jwt(): string;
|
|
6
|
+
get retrievingToken(): boolean;
|
|
7
|
+
constructor(sessionStorageService: SessionStorageService, loginService: LoginService);
|
|
8
|
+
getAccessToken(refresh?: boolean): Promise<void>;
|
|
9
|
+
private _tokenExpired;
|
|
10
|
+
private _refreshToken;
|
|
11
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InternalJwtTokenService = void 0;
|
|
4
|
+
const jwt_token_service_1 = require("./jwt-token.service");
|
|
5
|
+
class InternalJwtTokenService extends jwt_token_service_1.JwtTokenService {
|
|
6
|
+
get jwt() {
|
|
7
|
+
return this.sessionStorageService.getLoginData() ? this.sessionStorageService.getLoginData().accessToken : "";
|
|
8
|
+
}
|
|
9
|
+
get retrievingToken() {
|
|
10
|
+
return this.sessionStorageService.getBusy();
|
|
11
|
+
}
|
|
12
|
+
constructor(sessionStorageService, loginService) {
|
|
13
|
+
super(sessionStorageService, loginService);
|
|
14
|
+
}
|
|
15
|
+
async getAccessToken(refresh = true) {
|
|
16
|
+
if (refresh && this._tokenExpired()) {
|
|
17
|
+
await this._refreshToken();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
_tokenExpired() {
|
|
21
|
+
if (this.sessionStorageService.getLoginData().accessToken && this.sessionStorageService.getLoginData().tokenExp) {
|
|
22
|
+
return ((1000 * this.sessionStorageService.getLoginData().tokenExp) - (new Date()).getTime()) < 60000;
|
|
23
|
+
}
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
async _refreshToken() {
|
|
27
|
+
this.sessionStorageService.setBusy(true);
|
|
28
|
+
const tokenResponse = await this.loginService.refreshAccessToken(this.sessionStorageService.getLoginData().refreshToken);
|
|
29
|
+
const loginData = this.sessionStorageService.getLoginData();
|
|
30
|
+
loginData.accessToken = tokenResponse.accessToken;
|
|
31
|
+
loginData.refreshToken = tokenResponse.refreshToken;
|
|
32
|
+
this.setExpirationTime(tokenResponse.accessToken);
|
|
33
|
+
this.sessionStorageService.setLoginData(loginData);
|
|
34
|
+
this.sessionStorageService.setBusy(false);
|
|
35
|
+
if (window.hasOwnProperty('tokenRetrieved')) {
|
|
36
|
+
window.tokenRetrieved.next(true);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.InternalJwtTokenService = InternalJwtTokenService;
|
|
41
|
+
//# sourceMappingURL=internal-jwt-token.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal-jwt-token.service.js","sourceRoot":"","sources":["../../src/service/internal-jwt-token.service.ts"],"names":[],"mappings":";;;AAAA,2DAAoD;AAMpD,MAAa,uBAAwB,SAAQ,mCAAe;IAExD,IAAW,GAAG;QACV,OAAO,IAAI,CAAC,qBAAqB,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,YAAY,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;IAClH,CAAC;IAED,IAAW,eAAe;QACtB,OAAO,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,CAAC;IAChD,CAAC;IAED,YAAY,qBAA4C,EAAE,YAA0B;QAChF,KAAK,CAAC,qBAAqB,EAAE,YAAY,CAAC,CAAC;IAC/C,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,UAAmB,IAAI;QAC/C,IAAI,OAAO,IAAI,IAAI,CAAC,aAAa,EAAE,EAAE;YACjC,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;SAC9B;IACL,CAAC;IAEO,aAAa;QACjB,IAAI,IAAI,CAAC,qBAAqB,CAAC,YAAY,EAAE,CAAC,WAAW,IAAI,IAAI,CAAC,qBAAqB,CAAC,YAAY,EAAE,CAAC,QAAQ,EAAE;YAC7G,OAAO,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,qBAAqB,CAAC,YAAY,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,GAAG,KAAK,CAAC;SACzG;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;IAEO,KAAK,CAAC,aAAa;QACvB,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACzC,MAAM,aAAa,GAAkB,MAAM,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,IAAI,CAAC,qBAAqB,CAAC,YAAY,EAAE,CAAC,YAAY,CAAC,CAAC;QACxI,MAAM,SAAS,GAAqB,IAAI,CAAC,qBAAqB,CAAC,YAAY,EAAE,CAAC;QAC9E,SAAS,CAAC,WAAW,GAAG,aAAa,CAAC,WAAW,CAAC;QAClD,SAAS,CAAC,YAAY,GAAG,aAAa,CAAC,YAAY,CAAC;QACpD,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;QAClD,IAAI,CAAC,qBAAqB,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QACnD,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAE1C,IAAI,MAAM,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE;YAEzC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACpC;IACL,CAAC;CACJ;AA1CD,0DA0CC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
1
|
+
import { SessionStorageService } from './session-storage.service';
|
|
2
|
+
import { LoginService } from './login.service';
|
|
3
|
+
export declare abstract class JwtTokenService {
|
|
4
|
+
abstract get jwt(): string;
|
|
5
|
+
protected sessionStorageService: SessionStorageService;
|
|
6
|
+
protected loginService: LoginService;
|
|
7
|
+
constructor(sessionStorageService: any, loginService: any);
|
|
8
|
+
abstract get retrievingToken(): boolean;
|
|
9
|
+
abstract getAccessToken(refresh?: boolean): Promise<void>;
|
|
10
|
+
setExpirationTime(jwt: string): void;
|
|
11
|
+
setLoginDataByPublicToken(token: string): void;
|
|
12
|
+
}
|