@colijnit/ioneconnector 3.1.18 → 3.1.20
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,20 +1,20 @@
|
|
|
1
|
-
import { BusinessObjectIDType } from "../type/business-object-id-type";
|
|
2
|
-
import { BusinessObject } from '../model/business-object';
|
|
3
|
-
export declare class BusinessObjectUtils {
|
|
4
|
-
static FindItemById<T extends BusinessObject>(modelArray: T[], id: BusinessObjectIDType): T;
|
|
5
|
-
static FindItemByProp<T extends BusinessObject>(modelArray: T[], prop: string, valueMatch: any): T;
|
|
6
|
-
static RemoveElementById<T extends BusinessObject>(modelArray: T[], idOfItemToRemove: BusinessObjectIDType): void;
|
|
7
|
-
static PutBoInList<T extends BusinessObject>(boList: T[], businessObject: T): void;
|
|
8
|
-
static GetId(businessObject: any): BusinessObjectIDType;
|
|
9
|
-
static GetIdAsString(businessObject: BusinessObject): string;
|
|
10
|
-
static GetIdsAsString(businessObjects: BusinessObject[]): string;
|
|
11
|
-
static IsEqualBoId(idA: BusinessObjectIDType, idB: BusinessObjectIDType): boolean;
|
|
12
|
-
static AreEqual(objectA: any, objectB: any): boolean;
|
|
13
|
-
static GetDisplayName(firstName: string, prefix: string, familyName: string): string;
|
|
14
|
-
static GetDisplayPersonalName(firstName: string, initials: string, prefix: string, familyName: string): string;
|
|
15
|
-
static GetDisplayInitials(firstName: string, familyName: string): string;
|
|
16
|
-
static GetDisplayInitialsForOneFullName(fullName: string): string;
|
|
17
|
-
static GetDescriptionValue(boClass: any, boObject: BusinessObject): any;
|
|
18
|
-
static GetIsActive(endDate: Date): boolean;
|
|
19
|
-
static GetBoAsConcreteClassOrNullObject(businessObject: BusinessObject, boClasses: any[], orNullObject: BusinessObject): BusinessObject;
|
|
20
|
-
}
|
|
1
|
+
import { BusinessObjectIDType } from "../type/business-object-id-type";
|
|
2
|
+
import { BusinessObject } from '../model/business-object';
|
|
3
|
+
export declare class BusinessObjectUtils {
|
|
4
|
+
static FindItemById<T extends BusinessObject>(modelArray: T[], id: BusinessObjectIDType): T;
|
|
5
|
+
static FindItemByProp<T extends BusinessObject>(modelArray: T[], prop: string, valueMatch: any): T;
|
|
6
|
+
static RemoveElementById<T extends BusinessObject>(modelArray: T[], idOfItemToRemove: BusinessObjectIDType): void;
|
|
7
|
+
static PutBoInList<T extends BusinessObject>(boList: T[], businessObject: T): void;
|
|
8
|
+
static GetId(businessObject: any): BusinessObjectIDType;
|
|
9
|
+
static GetIdAsString(businessObject: BusinessObject): string;
|
|
10
|
+
static GetIdsAsString(businessObjects: BusinessObject[]): string;
|
|
11
|
+
static IsEqualBoId(idA: BusinessObjectIDType, idB: BusinessObjectIDType): boolean;
|
|
12
|
+
static AreEqual(objectA: any, objectB: any): boolean;
|
|
13
|
+
static GetDisplayName(firstName: string, prefix: string, familyName: string): string;
|
|
14
|
+
static GetDisplayPersonalName(firstName: string, initials: string, prefix: string, familyName: string): string;
|
|
15
|
+
static GetDisplayInitials(firstName: string, familyName: string): string;
|
|
16
|
+
static GetDisplayInitialsForOneFullName(fullName: string): string;
|
|
17
|
+
static GetDescriptionValue(boClass: any, boObject: BusinessObject): any;
|
|
18
|
+
static GetIsActive(endDate: Date): boolean;
|
|
19
|
+
static GetBoAsConcreteClassOrNullObject(businessObject: BusinessObject, boClasses: any[], orNullObject: BusinessObject): BusinessObject;
|
|
20
|
+
}
|
|
@@ -1,199 +1,199 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BusinessObjectUtils = void 0;
|
|
4
|
-
const CircularJSON = require("circular-json");
|
|
5
|
-
const not_nill_function_1 = require("./function/not-nill.function");
|
|
6
|
-
const object_utils_1 = require("./object-utils");
|
|
7
|
-
const business_object_1 = require("../model/business-object");
|
|
8
|
-
const array_utils_1 = require("./array-utils");
|
|
9
|
-
const string_utils_1 = require("./string-utils");
|
|
10
|
-
const number_utils_1 = require("./number-utils");
|
|
11
|
-
const is_nill_function_1 = require("./function/is-nill.function");
|
|
12
|
-
const business_object_data_decorator_1 = require("../factory/decorators/business-object-data.decorator");
|
|
13
|
-
class BusinessObjectUtils {
|
|
14
|
-
static FindItemById(modelArray, id) {
|
|
15
|
-
if (!modelArray) {
|
|
16
|
-
return undefined;
|
|
17
|
-
}
|
|
18
|
-
let foundModel = undefined;
|
|
19
|
-
const len = modelArray.length;
|
|
20
|
-
for (let i = 0; i < len; i++) {
|
|
21
|
-
const modelCur = modelArray[i];
|
|
22
|
-
if (modelCur && !!modelCur.getId && this.IsEqualBoId(modelCur.getId(), id)) {
|
|
23
|
-
foundModel = modelCur;
|
|
24
|
-
break;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return foundModel;
|
|
28
|
-
}
|
|
29
|
-
static FindItemByProp(modelArray, prop, valueMatch) {
|
|
30
|
-
if (!modelArray) {
|
|
31
|
-
return undefined;
|
|
32
|
-
}
|
|
33
|
-
let foundModel = undefined;
|
|
34
|
-
const len = modelArray.length;
|
|
35
|
-
for (let i = 0; i < len; i++) {
|
|
36
|
-
const modelCur = modelArray[i];
|
|
37
|
-
if (modelCur && modelCur[prop] === valueMatch) {
|
|
38
|
-
foundModel = modelCur;
|
|
39
|
-
break;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return foundModel;
|
|
43
|
-
}
|
|
44
|
-
static RemoveElementById(modelArray, idOfItemToRemove) {
|
|
45
|
-
array_utils_1.ArrayUtils.RemoveElementsByFilter(modelArray, (item) => {
|
|
46
|
-
return !!item && this.IsEqualBoId(item.getId(), idOfItemToRemove);
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
static PutBoInList(boList, businessObject) {
|
|
50
|
-
if (boList && businessObject) {
|
|
51
|
-
const businessObjectId = businessObject.getId();
|
|
52
|
-
const boObjInList = boList.find((bo) => bo.getId() === businessObjectId);
|
|
53
|
-
if (boObjInList && businessObject.getId()) {
|
|
54
|
-
array_utils_1.ArrayUtils.ReplaceElement(businessObject, boObjInList, boList);
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
boList.push(businessObject);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
static GetId(businessObject) {
|
|
62
|
-
if (businessObject && businessObject instanceof business_object_1.BusinessObject) {
|
|
63
|
-
return businessObject.getId();
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
static GetIdAsString(businessObject) {
|
|
67
|
-
let result = "";
|
|
68
|
-
const boId = businessObject ? businessObject.getId() : undefined;
|
|
69
|
-
if (boId) {
|
|
70
|
-
if (string_utils_1.StringUtils.IsString(boId)) {
|
|
71
|
-
result = boId;
|
|
72
|
-
}
|
|
73
|
-
else if (number_utils_1.NumberUtils.IsNumber(boId)) {
|
|
74
|
-
result = "" + boId;
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
result = JSON.stringify(boId);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
return result;
|
|
81
|
-
}
|
|
82
|
-
static GetIdsAsString(businessObjects) {
|
|
83
|
-
let result = "";
|
|
84
|
-
if (businessObjects) {
|
|
85
|
-
businessObjects.forEach(bo => {
|
|
86
|
-
result += this.GetIdAsString(bo);
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
return result;
|
|
90
|
-
}
|
|
91
|
-
static IsEqualBoId(idA, idB) {
|
|
92
|
-
let isEqualId = false;
|
|
93
|
-
if ((0, not_nill_function_1.notNill)(idA) && (0, not_nill_function_1.notNill)(idB)) {
|
|
94
|
-
if (idA === idB) {
|
|
95
|
-
isEqualId = true;
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
isEqualId = object_utils_1.ObjectUtils.DeepEquals(idA, idB);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
return isEqualId;
|
|
102
|
-
}
|
|
103
|
-
static AreEqual(objectA, objectB) {
|
|
104
|
-
if (!objectA && !objectB) {
|
|
105
|
-
return true;
|
|
106
|
-
}
|
|
107
|
-
else if (!objectA || !objectB) {
|
|
108
|
-
return false;
|
|
109
|
-
}
|
|
110
|
-
if (object_utils_1.ObjectUtils.GetClassName(objectA) === object_utils_1.ObjectUtils.GetClassName(objectB)) {
|
|
111
|
-
if ((0, is_nill_function_1.isNill)(objectA.getId()) && (0, is_nill_function_1.isNill)(objectB.getId())) {
|
|
112
|
-
return CircularJSON.stringify(objectA) === CircularJSON.stringify(objectB);
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
return this.IsEqualBoId(objectA.getId(), objectB.getId());
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
return objectA === objectB;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
static GetDisplayName(firstName, prefix, familyName) {
|
|
123
|
-
if (!firstName) {
|
|
124
|
-
if (prefix) {
|
|
125
|
-
return string_utils_1.StringUtils.Format("{0} {1}", [prefix, familyName]);
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
return familyName;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
if (prefix) {
|
|
132
|
-
return string_utils_1.StringUtils.Format("{0} {1} {2}", [firstName, prefix, familyName]);
|
|
133
|
-
}
|
|
134
|
-
else {
|
|
135
|
-
return string_utils_1.StringUtils.Format("{0} {1}", [firstName, familyName]);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
static GetDisplayPersonalName(firstName, initials, prefix, familyName) {
|
|
139
|
-
if (!firstName && initials) {
|
|
140
|
-
if (prefix) {
|
|
141
|
-
return string_utils_1.StringUtils.Format("{0} {1} {2}", [initials, prefix, familyName]);
|
|
142
|
-
}
|
|
143
|
-
return string_utils_1.StringUtils.Format("{0} {1}", [initials, familyName]);
|
|
144
|
-
}
|
|
145
|
-
return BusinessObjectUtils.GetDisplayName(firstName, prefix, familyName);
|
|
146
|
-
}
|
|
147
|
-
static GetDisplayInitials(firstName, familyName) {
|
|
148
|
-
if (!firstName && !familyName) {
|
|
149
|
-
return "";
|
|
150
|
-
}
|
|
151
|
-
if (!firstName) {
|
|
152
|
-
return string_utils_1.StringUtils.GetFirstCapital(familyName).toUpperCase();
|
|
153
|
-
}
|
|
154
|
-
else {
|
|
155
|
-
return string_utils_1.StringUtils.Format("{0}{1}", [firstName[0], string_utils_1.StringUtils.GetFirstCapital(familyName)]).toUpperCase();
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
static GetDisplayInitialsForOneFullName(fullName) {
|
|
159
|
-
if (!fullName) {
|
|
160
|
-
return "";
|
|
161
|
-
}
|
|
162
|
-
const name = fullName.replace(/[^a-zA-Z0-9\s]/gi, "");
|
|
163
|
-
const parts = name.split(" ");
|
|
164
|
-
const first = parts.shift();
|
|
165
|
-
if (!parts.length) {
|
|
166
|
-
return first.substr(0, 2).toUpperCase();
|
|
167
|
-
}
|
|
168
|
-
const initials = first.substr(0, 1);
|
|
169
|
-
parts.sort((part1, part2) => part2.length - part1.length);
|
|
170
|
-
return (initials + parts[0].substr(0, 1)).toUpperCase();
|
|
171
|
-
}
|
|
172
|
-
static GetDescriptionValue(boClass, boObject) {
|
|
173
|
-
if (boClass && boObject) {
|
|
174
|
-
return boObject[business_object_data_decorator_1.BusinessObjectDataDecorator.GetDescriptionField(boClass)];
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
static GetIsActive(endDate) {
|
|
178
|
-
return (endDate ? endDate > new Date() : true);
|
|
179
|
-
}
|
|
180
|
-
static GetBoAsConcreteClassOrNullObject(businessObject, boClasses, orNullObject) {
|
|
181
|
-
let givenBoOfCorrectClass = false;
|
|
182
|
-
if (boClasses) {
|
|
183
|
-
for (let i = 0, len = boClasses.length; i < len; i++) {
|
|
184
|
-
if (businessObject instanceof boClasses[i]) {
|
|
185
|
-
givenBoOfCorrectClass = true;
|
|
186
|
-
break;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
if (givenBoOfCorrectClass) {
|
|
191
|
-
return businessObject;
|
|
192
|
-
}
|
|
193
|
-
else {
|
|
194
|
-
return orNullObject;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
exports.BusinessObjectUtils = BusinessObjectUtils;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BusinessObjectUtils = void 0;
|
|
4
|
+
const CircularJSON = require("circular-json");
|
|
5
|
+
const not_nill_function_1 = require("./function/not-nill.function");
|
|
6
|
+
const object_utils_1 = require("./object-utils");
|
|
7
|
+
const business_object_1 = require("../model/business-object");
|
|
8
|
+
const array_utils_1 = require("./array-utils");
|
|
9
|
+
const string_utils_1 = require("./string-utils");
|
|
10
|
+
const number_utils_1 = require("./number-utils");
|
|
11
|
+
const is_nill_function_1 = require("./function/is-nill.function");
|
|
12
|
+
const business_object_data_decorator_1 = require("../factory/decorators/business-object-data.decorator");
|
|
13
|
+
class BusinessObjectUtils {
|
|
14
|
+
static FindItemById(modelArray, id) {
|
|
15
|
+
if (!modelArray) {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
let foundModel = undefined;
|
|
19
|
+
const len = modelArray.length;
|
|
20
|
+
for (let i = 0; i < len; i++) {
|
|
21
|
+
const modelCur = modelArray[i];
|
|
22
|
+
if (modelCur && !!modelCur.getId && this.IsEqualBoId(modelCur.getId(), id)) {
|
|
23
|
+
foundModel = modelCur;
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return foundModel;
|
|
28
|
+
}
|
|
29
|
+
static FindItemByProp(modelArray, prop, valueMatch) {
|
|
30
|
+
if (!modelArray) {
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
let foundModel = undefined;
|
|
34
|
+
const len = modelArray.length;
|
|
35
|
+
for (let i = 0; i < len; i++) {
|
|
36
|
+
const modelCur = modelArray[i];
|
|
37
|
+
if (modelCur && modelCur[prop] === valueMatch) {
|
|
38
|
+
foundModel = modelCur;
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return foundModel;
|
|
43
|
+
}
|
|
44
|
+
static RemoveElementById(modelArray, idOfItemToRemove) {
|
|
45
|
+
array_utils_1.ArrayUtils.RemoveElementsByFilter(modelArray, (item) => {
|
|
46
|
+
return !!item && this.IsEqualBoId(item.getId(), idOfItemToRemove);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
static PutBoInList(boList, businessObject) {
|
|
50
|
+
if (boList && businessObject) {
|
|
51
|
+
const businessObjectId = businessObject.getId();
|
|
52
|
+
const boObjInList = boList.find((bo) => bo.getId() === businessObjectId);
|
|
53
|
+
if (boObjInList && businessObject.getId()) {
|
|
54
|
+
array_utils_1.ArrayUtils.ReplaceElement(businessObject, boObjInList, boList);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
boList.push(businessObject);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
static GetId(businessObject) {
|
|
62
|
+
if (businessObject && businessObject instanceof business_object_1.BusinessObject) {
|
|
63
|
+
return businessObject.getId();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
static GetIdAsString(businessObject) {
|
|
67
|
+
let result = "";
|
|
68
|
+
const boId = businessObject ? businessObject.getId() : undefined;
|
|
69
|
+
if (boId) {
|
|
70
|
+
if (string_utils_1.StringUtils.IsString(boId)) {
|
|
71
|
+
result = boId;
|
|
72
|
+
}
|
|
73
|
+
else if (number_utils_1.NumberUtils.IsNumber(boId)) {
|
|
74
|
+
result = "" + boId;
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
result = JSON.stringify(boId);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return result;
|
|
81
|
+
}
|
|
82
|
+
static GetIdsAsString(businessObjects) {
|
|
83
|
+
let result = "";
|
|
84
|
+
if (businessObjects) {
|
|
85
|
+
businessObjects.forEach(bo => {
|
|
86
|
+
result += this.GetIdAsString(bo);
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
return result;
|
|
90
|
+
}
|
|
91
|
+
static IsEqualBoId(idA, idB) {
|
|
92
|
+
let isEqualId = false;
|
|
93
|
+
if ((0, not_nill_function_1.notNill)(idA) && (0, not_nill_function_1.notNill)(idB)) {
|
|
94
|
+
if (idA === idB) {
|
|
95
|
+
isEqualId = true;
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
isEqualId = object_utils_1.ObjectUtils.DeepEquals(idA, idB);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return isEqualId;
|
|
102
|
+
}
|
|
103
|
+
static AreEqual(objectA, objectB) {
|
|
104
|
+
if (!objectA && !objectB) {
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
else if (!objectA || !objectB) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
if (object_utils_1.ObjectUtils.GetClassName(objectA) === object_utils_1.ObjectUtils.GetClassName(objectB)) {
|
|
111
|
+
if ((0, is_nill_function_1.isNill)(objectA.getId()) && (0, is_nill_function_1.isNill)(objectB.getId())) {
|
|
112
|
+
return CircularJSON.stringify(objectA) === CircularJSON.stringify(objectB);
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
return this.IsEqualBoId(objectA.getId(), objectB.getId());
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
return objectA === objectB;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
static GetDisplayName(firstName, prefix, familyName) {
|
|
123
|
+
if (!firstName) {
|
|
124
|
+
if (prefix) {
|
|
125
|
+
return string_utils_1.StringUtils.Format("{0} {1}", [prefix, familyName]);
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
return familyName;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
if (prefix) {
|
|
132
|
+
return string_utils_1.StringUtils.Format("{0} {1} {2}", [firstName, prefix, familyName]);
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
return string_utils_1.StringUtils.Format("{0} {1}", [firstName, familyName]);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
static GetDisplayPersonalName(firstName, initials, prefix, familyName) {
|
|
139
|
+
if (!firstName && initials) {
|
|
140
|
+
if (prefix) {
|
|
141
|
+
return string_utils_1.StringUtils.Format("{0} {1} {2}", [initials, prefix, familyName]);
|
|
142
|
+
}
|
|
143
|
+
return string_utils_1.StringUtils.Format("{0} {1}", [initials, familyName]);
|
|
144
|
+
}
|
|
145
|
+
return BusinessObjectUtils.GetDisplayName(firstName, prefix, familyName);
|
|
146
|
+
}
|
|
147
|
+
static GetDisplayInitials(firstName, familyName) {
|
|
148
|
+
if (!firstName && !familyName) {
|
|
149
|
+
return "";
|
|
150
|
+
}
|
|
151
|
+
if (!firstName) {
|
|
152
|
+
return string_utils_1.StringUtils.GetFirstCapital(familyName).toUpperCase();
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
return string_utils_1.StringUtils.Format("{0}{1}", [firstName[0], string_utils_1.StringUtils.GetFirstCapital(familyName)]).toUpperCase();
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
static GetDisplayInitialsForOneFullName(fullName) {
|
|
159
|
+
if (!fullName) {
|
|
160
|
+
return "";
|
|
161
|
+
}
|
|
162
|
+
const name = fullName.replace(/[^a-zA-Z0-9\s]/gi, "");
|
|
163
|
+
const parts = name.split(" ");
|
|
164
|
+
const first = parts.shift();
|
|
165
|
+
if (!parts.length) {
|
|
166
|
+
return first.substr(0, 2).toUpperCase();
|
|
167
|
+
}
|
|
168
|
+
const initials = first.substr(0, 1);
|
|
169
|
+
parts.sort((part1, part2) => part2.length - part1.length);
|
|
170
|
+
return (initials + parts[0].substr(0, 1)).toUpperCase();
|
|
171
|
+
}
|
|
172
|
+
static GetDescriptionValue(boClass, boObject) {
|
|
173
|
+
if (boClass && boObject) {
|
|
174
|
+
return boObject[business_object_data_decorator_1.BusinessObjectDataDecorator.GetDescriptionField(boClass)];
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
static GetIsActive(endDate) {
|
|
178
|
+
return (endDate ? endDate > new Date() : true);
|
|
179
|
+
}
|
|
180
|
+
static GetBoAsConcreteClassOrNullObject(businessObject, boClasses, orNullObject) {
|
|
181
|
+
let givenBoOfCorrectClass = false;
|
|
182
|
+
if (boClasses) {
|
|
183
|
+
for (let i = 0, len = boClasses.length; i < len; i++) {
|
|
184
|
+
if (businessObject instanceof boClasses[i]) {
|
|
185
|
+
givenBoOfCorrectClass = true;
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
if (givenBoOfCorrectClass) {
|
|
191
|
+
return businessObject;
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
return orNullObject;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
exports.BusinessObjectUtils = BusinessObjectUtils;
|
|
199
199
|
//# sourceMappingURL=business-object-utils.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare class DateUtils {
|
|
2
|
-
static StringAsDate(str: string): Date;
|
|
3
|
-
static GetDaysFromNow(date: Date): number;
|
|
4
|
-
static GetDayDifference(from: Date, to: Date): number;
|
|
5
|
-
}
|
|
1
|
+
export declare class DateUtils {
|
|
2
|
+
static StringAsDate(str: string): Date;
|
|
3
|
+
static GetDaysFromNow(date: Date): number;
|
|
4
|
+
static GetDayDifference(from: Date, to: Date): number;
|
|
5
|
+
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DateUtils = void 0;
|
|
4
|
-
const not_nill_function_1 = require("./function/not-nill.function");
|
|
5
|
-
class DateUtils {
|
|
6
|
-
static StringAsDate(str) {
|
|
7
|
-
if ((0, not_nill_function_1.notNill)(str)) {
|
|
8
|
-
return new Date(str);
|
|
9
|
-
}
|
|
10
|
-
else {
|
|
11
|
-
return undefined;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
static GetDaysFromNow(date) {
|
|
15
|
-
return DateUtils.GetDayDifference(new Date(Date.now()), date);
|
|
16
|
-
}
|
|
17
|
-
static GetDayDifference(from, to) {
|
|
18
|
-
if (!from || !to) {
|
|
19
|
-
return NaN;
|
|
20
|
-
}
|
|
21
|
-
return ((to.getTime() - from.getTime()) / 1000 / 60 / 60 / 24);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.DateUtils = DateUtils;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DateUtils = void 0;
|
|
4
|
+
const not_nill_function_1 = require("./function/not-nill.function");
|
|
5
|
+
class DateUtils {
|
|
6
|
+
static StringAsDate(str) {
|
|
7
|
+
if ((0, not_nill_function_1.notNill)(str)) {
|
|
8
|
+
return new Date(str);
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
static GetDaysFromNow(date) {
|
|
15
|
+
return DateUtils.GetDayDifference(new Date(Date.now()), date);
|
|
16
|
+
}
|
|
17
|
+
static GetDayDifference(from, to) {
|
|
18
|
+
if (!from || !to) {
|
|
19
|
+
return NaN;
|
|
20
|
+
}
|
|
21
|
+
return ((to.getTime() - from.getTime()) / 1000 / 60 / 60 / 24);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.DateUtils = DateUtils;
|
|
25
25
|
//# sourceMappingURL=date-utils.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FileTypeInternal } from '../enum/file-type-internal.enum';
|
|
2
|
-
export declare class FileUtils {
|
|
3
|
-
static DocumentBodyToDataUri(documentBody: string, mimeType: string): string;
|
|
4
|
-
static FileNameToFileTypeInternal(fileName: string): FileTypeInternal;
|
|
5
|
-
static FixAssetUrl(assetUrl: string): string;
|
|
6
|
-
}
|
|
1
|
+
import { FileTypeInternal } from '../enum/file-type-internal.enum';
|
|
2
|
+
export declare class FileUtils {
|
|
3
|
+
static DocumentBodyToDataUri(documentBody: string, mimeType: string): string;
|
|
4
|
+
static FileNameToFileTypeInternal(fileName: string): FileTypeInternal;
|
|
5
|
+
static FixAssetUrl(assetUrl: string): string;
|
|
6
|
+
}
|
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FileUtils = void 0;
|
|
4
|
-
const string_utils_1 = require("./string-utils");
|
|
5
|
-
const file_type_internal_enum_1 = require("../enum/file-type-internal.enum");
|
|
6
|
-
class FileUtils {
|
|
7
|
-
static DocumentBodyToDataUri(documentBody, mimeType) {
|
|
8
|
-
return string_utils_1.StringUtils.IsStringWithLength(documentBody) ? "data:" + mimeType + ";base64," + documentBody : "";
|
|
9
|
-
}
|
|
10
|
-
static FileNameToFileTypeInternal(fileName) {
|
|
11
|
-
if (!fileName) {
|
|
12
|
-
return file_type_internal_enum_1.FileTypeInternal.Undefined;
|
|
13
|
-
}
|
|
14
|
-
const stringParts = fileName.split(".");
|
|
15
|
-
const extension = stringParts[stringParts.length - 1];
|
|
16
|
-
switch (extension.toLowerCase()) {
|
|
17
|
-
case "pdn":
|
|
18
|
-
case "bmp":
|
|
19
|
-
case "gif":
|
|
20
|
-
case "jpg":
|
|
21
|
-
case "jpeg":
|
|
22
|
-
case "jpe":
|
|
23
|
-
case "jfif":
|
|
24
|
-
case "png":
|
|
25
|
-
case "tif":
|
|
26
|
-
case "tiff":
|
|
27
|
-
case "tga":
|
|
28
|
-
case "dds":
|
|
29
|
-
return file_type_internal_enum_1.FileTypeInternal.Image;
|
|
30
|
-
case "swf":
|
|
31
|
-
return file_type_internal_enum_1.FileTypeInternal.Swf;
|
|
32
|
-
case "xls":
|
|
33
|
-
case "xlsx":
|
|
34
|
-
return file_type_internal_enum_1.FileTypeInternal.ExcelSheet;
|
|
35
|
-
case "doc":
|
|
36
|
-
case "docx":
|
|
37
|
-
return file_type_internal_enum_1.FileTypeInternal.WordDocument;
|
|
38
|
-
case "pdf":
|
|
39
|
-
return file_type_internal_enum_1.FileTypeInternal.Pdf;
|
|
40
|
-
case "txt":
|
|
41
|
-
return file_type_internal_enum_1.FileTypeInternal.TextFile;
|
|
42
|
-
case "exe":
|
|
43
|
-
return file_type_internal_enum_1.FileTypeInternal.Executable;
|
|
44
|
-
default:
|
|
45
|
-
return file_type_internal_enum_1.FileTypeInternal.Undefined;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
static FixAssetUrl(assetUrl) {
|
|
49
|
-
if (!assetUrl) {
|
|
50
|
-
return "";
|
|
51
|
-
}
|
|
52
|
-
let fixedUrl = assetUrl;
|
|
53
|
-
if (assetUrl.indexOf('_webplayer') === -1) {
|
|
54
|
-
fixedUrl = assetUrl.replace('.unity3d', '_webplayer.ione3d');
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
fixedUrl = assetUrl.replace('_webplayer.unity3d', '_webplayer.ione3d');
|
|
58
|
-
}
|
|
59
|
-
fixedUrl = fixedUrl.replace('content/', 'content43/');
|
|
60
|
-
if (!fixedUrl.endsWith('.gz')) {
|
|
61
|
-
fixedUrl = fixedUrl.concat('.gz');
|
|
62
|
-
}
|
|
63
|
-
return fixedUrl;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
exports.FileUtils = FileUtils;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FileUtils = void 0;
|
|
4
|
+
const string_utils_1 = require("./string-utils");
|
|
5
|
+
const file_type_internal_enum_1 = require("../enum/file-type-internal.enum");
|
|
6
|
+
class FileUtils {
|
|
7
|
+
static DocumentBodyToDataUri(documentBody, mimeType) {
|
|
8
|
+
return string_utils_1.StringUtils.IsStringWithLength(documentBody) ? "data:" + mimeType + ";base64," + documentBody : "";
|
|
9
|
+
}
|
|
10
|
+
static FileNameToFileTypeInternal(fileName) {
|
|
11
|
+
if (!fileName) {
|
|
12
|
+
return file_type_internal_enum_1.FileTypeInternal.Undefined;
|
|
13
|
+
}
|
|
14
|
+
const stringParts = fileName.split(".");
|
|
15
|
+
const extension = stringParts[stringParts.length - 1];
|
|
16
|
+
switch (extension.toLowerCase()) {
|
|
17
|
+
case "pdn":
|
|
18
|
+
case "bmp":
|
|
19
|
+
case "gif":
|
|
20
|
+
case "jpg":
|
|
21
|
+
case "jpeg":
|
|
22
|
+
case "jpe":
|
|
23
|
+
case "jfif":
|
|
24
|
+
case "png":
|
|
25
|
+
case "tif":
|
|
26
|
+
case "tiff":
|
|
27
|
+
case "tga":
|
|
28
|
+
case "dds":
|
|
29
|
+
return file_type_internal_enum_1.FileTypeInternal.Image;
|
|
30
|
+
case "swf":
|
|
31
|
+
return file_type_internal_enum_1.FileTypeInternal.Swf;
|
|
32
|
+
case "xls":
|
|
33
|
+
case "xlsx":
|
|
34
|
+
return file_type_internal_enum_1.FileTypeInternal.ExcelSheet;
|
|
35
|
+
case "doc":
|
|
36
|
+
case "docx":
|
|
37
|
+
return file_type_internal_enum_1.FileTypeInternal.WordDocument;
|
|
38
|
+
case "pdf":
|
|
39
|
+
return file_type_internal_enum_1.FileTypeInternal.Pdf;
|
|
40
|
+
case "txt":
|
|
41
|
+
return file_type_internal_enum_1.FileTypeInternal.TextFile;
|
|
42
|
+
case "exe":
|
|
43
|
+
return file_type_internal_enum_1.FileTypeInternal.Executable;
|
|
44
|
+
default:
|
|
45
|
+
return file_type_internal_enum_1.FileTypeInternal.Undefined;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
static FixAssetUrl(assetUrl) {
|
|
49
|
+
if (!assetUrl) {
|
|
50
|
+
return "";
|
|
51
|
+
}
|
|
52
|
+
let fixedUrl = assetUrl;
|
|
53
|
+
if (assetUrl.indexOf('_webplayer') === -1) {
|
|
54
|
+
fixedUrl = assetUrl.replace('.unity3d', '_webplayer.ione3d');
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
fixedUrl = assetUrl.replace('_webplayer.unity3d', '_webplayer.ione3d');
|
|
58
|
+
}
|
|
59
|
+
fixedUrl = fixedUrl.replace('content/', 'content43/');
|
|
60
|
+
if (!fixedUrl.endsWith('.gz')) {
|
|
61
|
+
fixedUrl = fixedUrl.concat('.gz');
|
|
62
|
+
}
|
|
63
|
+
return fixedUrl;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.FileUtils = FileUtils;
|
|
67
67
|
//# sourceMappingURL=file-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function anyNill(...values: any[]): boolean;
|
|
1
|
+
export declare function anyNill(...values: any[]): boolean;
|