@beinformed/ui 1.20.8 → 1.21.0
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/CHANGELOG.md +20 -0
- package/esm/builder/mergeLayoutHintConfigurations.js +34 -59
- package/esm/builder/mergeLayoutHintConfigurations.js.map +1 -1
- package/esm/constants/Constants.js +37 -37
- package/esm/constants/Constants.js.map +1 -1
- package/esm/constants/LayoutHintConfig.js +1 -1
- package/esm/constants/LayoutHintConfig.js.map +1 -1
- package/esm/constants/LayoutHints.js +20 -22
- package/esm/constants/LayoutHints.js.map +1 -1
- package/esm/constants/Settings.js +14 -26
- package/esm/constants/Settings.js.map +1 -1
- package/esm/exceptions/ConfigurationException.js +5 -27
- package/esm/exceptions/ConfigurationException.js.map +1 -1
- package/esm/exceptions/FetchException.js +33 -65
- package/esm/exceptions/FetchException.js.map +1 -1
- package/esm/exceptions/IllegalArgumentException.js +5 -27
- package/esm/exceptions/IllegalArgumentException.js.map +1 -1
- package/esm/exceptions/IllegalReturnException.js +5 -27
- package/esm/exceptions/IllegalReturnException.js.map +1 -1
- package/esm/exceptions/IllegalStateException.js +5 -27
- package/esm/exceptions/IllegalStateException.js.map +1 -1
- package/esm/exceptions/JsonParseException.js +5 -27
- package/esm/exceptions/JsonParseException.js.map +1 -1
- package/esm/exceptions/MissingPropertyException.js +5 -27
- package/esm/exceptions/MissingPropertyException.js.map +1 -1
- package/esm/exceptions/NetworkException.js +9 -31
- package/esm/exceptions/NetworkException.js.map +1 -1
- package/esm/exceptions/NotAllowedUriException.js +5 -27
- package/esm/exceptions/NotAllowedUriException.js.map +1 -1
- package/esm/exceptions/NotFoundException.js +12 -35
- package/esm/exceptions/NotFoundException.js.map +1 -1
- package/esm/exceptions/ServerRequestException.js +5 -27
- package/esm/exceptions/ServerRequestException.js.map +1 -1
- package/esm/exceptions/ThemePropertyException.js +5 -27
- package/esm/exceptions/ThemePropertyException.js.map +1 -1
- package/esm/exceptions/TimeoutException.js +5 -26
- package/esm/exceptions/TimeoutException.js.map +1 -1
- package/esm/exceptions/UnauthorizedException.js +11 -33
- package/esm/exceptions/UnauthorizedException.js.map +1 -1
- package/esm/exceptions/UnsupportedOperationException.js +5 -27
- package/esm/exceptions/UnsupportedOperationException.js.map +1 -1
- package/esm/hooks/useAllFormsOnModel.js +25 -46
- package/esm/hooks/useAllFormsOnModel.js.map +1 -1
- package/esm/hooks/useAuthentication.js +20 -26
- package/esm/hooks/useAuthentication.js.map +1 -1
- package/esm/hooks/useContent.js +13 -24
- package/esm/hooks/useContent.js.map +1 -1
- package/esm/hooks/useDeepCompareEffect.js +3 -3
- package/esm/hooks/useDeepCompareEffect.js.map +1 -1
- package/esm/hooks/useForm.js +27 -45
- package/esm/hooks/useForm.js.map +1 -1
- package/esm/hooks/useI18n.js +9 -19
- package/esm/hooks/useI18n.js.map +1 -1
- package/esm/hooks/useModal.js +11 -11
- package/esm/hooks/useModal.js.map +1 -1
- package/esm/hooks/useModelCatalog.js +24 -30
- package/esm/hooks/useModelCatalog.js.map +1 -1
- package/esm/hooks/useModels.js +3 -3
- package/esm/hooks/useModels.js.map +1 -1
- package/esm/hooks/useModularUI.js +17 -16
- package/esm/hooks/useModularUI.js.map +1 -1
- package/esm/hooks/useModularUIBasic.js +9 -7
- package/esm/hooks/useModularUIBasic.js.map +1 -1
- package/esm/hooks/useModularUIModel.js +39 -59
- package/esm/hooks/useModularUIModel.js.map +1 -1
- package/esm/hooks/useModularUIRequest.js +4 -6
- package/esm/hooks/useModularUIRequest.js.map +1 -1
- package/esm/hooks/useNotification.js +16 -21
- package/esm/hooks/useNotification.js.map +1 -1
- package/esm/hooks/usePreference.js +3 -5
- package/esm/hooks/usePreference.js.map +1 -1
- package/esm/hooks/useProgressIndicator.js +9 -30
- package/esm/hooks/useProgressIndicator.js.map +1 -1
- package/esm/hooks/useRouter.js +12 -26
- package/esm/hooks/useRouter.js.map +1 -1
- package/esm/i18n/Locale.js +96 -135
- package/esm/i18n/Locale.js.map +1 -1
- package/esm/i18n/Locales.js +94 -148
- package/esm/i18n/Locales.js.map +1 -1
- package/esm/i18n/Message.js +13 -24
- package/esm/i18n/Message.js.map +1 -1
- package/esm/i18n/languages.js +1 -1
- package/esm/i18n/languages.js.map +1 -1
- package/esm/i18n/withMessage.js +10 -16
- package/esm/i18n/withMessage.js.map +1 -1
- package/esm/models/actions/ActionCollection.js +55 -100
- package/esm/models/actions/ActionCollection.js.map +1 -1
- package/esm/models/actions/ActionModel.js +165 -204
- package/esm/models/actions/ActionModel.js.map +1 -1
- package/esm/models/application/ApplicationModel.js +104 -153
- package/esm/models/application/ApplicationModel.js.map +1 -1
- package/esm/models/attributes/AttributeCollection.js +246 -331
- package/esm/models/attributes/AttributeCollection.js.map +1 -1
- package/esm/models/attributes/AttributeContent.js +181 -246
- package/esm/models/attributes/AttributeContent.js.map +1 -1
- package/esm/models/attributes/AttributeDataHelper.js +208 -251
- package/esm/models/attributes/AttributeDataHelper.js.map +1 -1
- package/esm/models/attributes/AttributeModel.js +832 -941
- package/esm/models/attributes/AttributeModel.js.map +1 -1
- package/esm/models/attributes/AttributeSetModel.js +46 -77
- package/esm/models/attributes/AttributeSetModel.js.map +1 -1
- package/esm/models/attributes/BooleanAttributeModel.js +259 -325
- package/esm/models/attributes/BooleanAttributeModel.js.map +1 -1
- package/esm/models/attributes/CaptchaAttributeModel.js +24 -55
- package/esm/models/attributes/CaptchaAttributeModel.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeModel.js +337 -424
- package/esm/models/attributes/ChoiceAttributeModel.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeOptionCollection.js +271 -361
- package/esm/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeOptionModel.js +297 -351
- package/esm/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
- package/esm/models/attributes/CompositeAttributeChildCollection.js +180 -257
- package/esm/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
- package/esm/models/attributes/CompositeAttributeModel.js +326 -401
- package/esm/models/attributes/CompositeAttributeModel.js.map +1 -1
- package/esm/models/attributes/DatetimeAttributeModel.js +368 -419
- package/esm/models/attributes/DatetimeAttributeModel.js.map +1 -1
- package/esm/models/attributes/HelptextAttributeModel.js +38 -70
- package/esm/models/attributes/HelptextAttributeModel.js.map +1 -1
- package/esm/models/attributes/LabelAttributeModel.js +23 -54
- package/esm/models/attributes/LabelAttributeModel.js.map +1 -1
- package/esm/models/attributes/MemoAttributeModel.js +31 -63
- package/esm/models/attributes/MemoAttributeModel.js.map +1 -1
- package/esm/models/attributes/MoneyAttributeModel.js +30 -62
- package/esm/models/attributes/MoneyAttributeModel.js.map +1 -1
- package/esm/models/attributes/NumberAttributeModel.js +178 -225
- package/esm/models/attributes/NumberAttributeModel.js.map +1 -1
- package/esm/models/attributes/PasswordAttributeModel.js +197 -246
- package/esm/models/attributes/PasswordAttributeModel.js.map +1 -1
- package/esm/models/attributes/StringAttributeModel.js +234 -282
- package/esm/models/attributes/StringAttributeModel.js.map +1 -1
- package/esm/models/attributes/UploadAttributeModel.js +181 -238
- package/esm/models/attributes/UploadAttributeModel.js.map +1 -1
- package/esm/models/attributes/XMLAttributeModel.js +32 -64
- package/esm/models/attributes/XMLAttributeModel.js.map +1 -1
- package/esm/models/attributes/_createAttribute.js +21 -36
- package/esm/models/attributes/_createAttribute.js.map +1 -1
- package/esm/models/attributes/input-constraints/BSNConstraint.js +63 -81
- package/esm/models/attributes/input-constraints/BSNConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/ConstraintCollection.js +29 -66
- package/esm/models/attributes/input-constraints/ConstraintCollection.js.map +1 -1
- package/esm/models/attributes/input-constraints/ConstraintModel.js +44 -59
- package/esm/models/attributes/input-constraints/ConstraintModel.js.map +1 -1
- package/esm/models/attributes/input-constraints/DateBoundaryConstraint.js +170 -192
- package/esm/models/attributes/input-constraints/DateBoundaryConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/DateTimeDateFormatConstraint.js +52 -67
- package/esm/models/attributes/input-constraints/DateTimeDateFormatConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js +52 -67
- package/esm/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/DatetimeFormatConstraint.js +66 -83
- package/esm/models/attributes/input-constraints/DatetimeFormatConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/FileExtensionConstraint.js +53 -69
- package/esm/models/attributes/input-constraints/FileExtensionConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/FileSizeConstraint.js +78 -94
- package/esm/models/attributes/input-constraints/FileSizeConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/IBANConstraint.js +35 -51
- package/esm/models/attributes/input-constraints/IBANConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/MandatoryConstraint.js +39 -57
- package/esm/models/attributes/input-constraints/MandatoryConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/MandatoryRangeConstraint.js +62 -81
- package/esm/models/attributes/input-constraints/MandatoryRangeConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/NumberBoundaryConstraint.js +149 -171
- package/esm/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/NumberFormatConstraint.js +104 -124
- package/esm/models/attributes/input-constraints/NumberFormatConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/NumberGroupingConstraint.js +91 -113
- package/esm/models/attributes/input-constraints/NumberGroupingConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/PasswordConfirmConstraint.js +58 -73
- package/esm/models/attributes/input-constraints/PasswordConfirmConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js +35 -52
- package/esm/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js +51 -65
- package/esm/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js +51 -65
- package/esm/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js +65 -83
- package/esm/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/RangeConstraint.js +115 -134
- package/esm/models/attributes/input-constraints/RangeConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/RegexConstraint.js +47 -61
- package/esm/models/attributes/input-constraints/RegexConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/StringLengthConstraint.js +157 -176
- package/esm/models/attributes/input-constraints/StringLengthConstraint.js.map +1 -1
- package/esm/models/attributes/input-constraints/XMLConstraint.js +48 -66
- package/esm/models/attributes/input-constraints/XMLConstraint.js.map +1 -1
- package/esm/models/attributes/layouthint-rules/BaseLayoutHintRule.js +49 -64
- package/esm/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +1 -1
- package/esm/models/attributes/layouthint-rules/DependentAttribute.js +167 -209
- package/esm/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
- package/esm/models/attributes/layouthint-rules/LayoutHintRuleCollection.js +40 -68
- package/esm/models/attributes/layouthint-rules/LayoutHintRuleCollection.js.map +1 -1
- package/esm/models/attributes/layouthint-rules/RemainingTotalUploadSize.js +30 -59
- package/esm/models/attributes/layouthint-rules/RemainingTotalUploadSize.js.map +1 -1
- package/esm/models/base/BaseCollection.js +169 -203
- package/esm/models/base/BaseCollection.js.map +1 -1
- package/esm/models/base/BaseModel.js +97 -112
- package/esm/models/base/BaseModel.js.map +1 -1
- package/esm/models/base/ResourceCollection.js +27 -55
- package/esm/models/base/ResourceCollection.js.map +1 -1
- package/esm/models/base/ResourceModel.js +167 -217
- package/esm/models/base/ResourceModel.js.map +1 -1
- package/esm/models/caseview/CaseViewModel.js +132 -180
- package/esm/models/caseview/CaseViewModel.js.map +1 -1
- package/esm/models/concepts/BusinessScenarioModel.js +98 -147
- package/esm/models/concepts/BusinessScenarioModel.js.map +1 -1
- package/esm/models/concepts/ConceptDetailModel.js +239 -316
- package/esm/models/concepts/ConceptDetailModel.js.map +1 -1
- package/esm/models/concepts/ConceptIndexModel.js +114 -150
- package/esm/models/concepts/ConceptIndexModel.js.map +1 -1
- package/esm/models/concepts/ConceptLinkModel.js +118 -158
- package/esm/models/concepts/ConceptLinkModel.js.map +1 -1
- package/esm/models/concepts/ConceptRelationCollection.js +56 -103
- package/esm/models/concepts/ConceptRelationCollection.js.map +1 -1
- package/esm/models/concepts/ConceptRelationModel.js +60 -75
- package/esm/models/concepts/ConceptRelationModel.js.map +1 -1
- package/esm/models/concepts/ConceptTypeDetailModel.js +89 -126
- package/esm/models/concepts/ConceptTypeDetailModel.js.map +1 -1
- package/esm/models/concepts/SourceReferenceCollection.js +11 -42
- package/esm/models/concepts/SourceReferenceCollection.js.map +1 -1
- package/esm/models/concepts/SourceReferenceModel.js +47 -70
- package/esm/models/concepts/SourceReferenceModel.js.map +1 -1
- package/esm/models/content/ContentIndexModel.js +108 -150
- package/esm/models/content/ContentIndexModel.js.map +1 -1
- package/esm/models/content/ContentLinkModel.js +157 -199
- package/esm/models/content/ContentLinkModel.js.map +1 -1
- package/esm/models/content/ContentModel.js +184 -228
- package/esm/models/content/ContentModel.js.map +1 -1
- package/esm/models/content/ContentTOCModel.js +132 -196
- package/esm/models/content/ContentTOCModel.js.map +1 -1
- package/esm/models/content/ContentTypeModel.js +58 -93
- package/esm/models/content/ContentTypeModel.js.map +1 -1
- package/esm/models/content/SectionModel.js +161 -247
- package/esm/models/content/SectionModel.js.map +1 -1
- package/esm/models/content/SubSectionModel.js +122 -188
- package/esm/models/content/SubSectionModel.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfiguration.js +44 -58
- package/esm/models/contentconfiguration/ContentConfiguration.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfigurationElements.js +123 -162
- package/esm/models/contentconfiguration/ContentConfigurationElements.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfigurationEndResults.js +24 -38
- package/esm/models/contentconfiguration/ContentConfigurationEndResults.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfigurationQuestions.js +30 -41
- package/esm/models/contentconfiguration/ContentConfigurationQuestions.js.map +1 -1
- package/esm/models/contentconfiguration/ContentConfigurationResults.js +73 -95
- package/esm/models/contentconfiguration/ContentConfigurationResults.js.map +1 -1
- package/esm/models/detail/DetailModel.js +174 -225
- package/esm/models/detail/DetailModel.js.map +1 -1
- package/esm/models/error/ErrorCollection.js +79 -132
- package/esm/models/error/ErrorCollection.js.map +1 -1
- package/esm/models/error/ErrorModel.js +48 -49
- package/esm/models/error/ErrorModel.js.map +1 -1
- package/esm/models/error/ErrorResponse.js +285 -203
- package/esm/models/error/ErrorResponse.js.map +1 -1
- package/esm/models/filters/AssignmentFilterModel.js +142 -186
- package/esm/models/filters/AssignmentFilterModel.js.map +1 -1
- package/esm/models/filters/BaseFilterModel.js +170 -220
- package/esm/models/filters/BaseFilterModel.js.map +1 -1
- package/esm/models/filters/ConceptIndexFilterModel.js +8 -36
- package/esm/models/filters/ConceptIndexFilterModel.js.map +1 -1
- package/esm/models/filters/FilterCollection.js +106 -165
- package/esm/models/filters/FilterCollection.js.map +1 -1
- package/esm/models/filters/FilterModel.js +1 -26
- package/esm/models/filters/FilterModel.js.map +1 -1
- package/esm/models/filters/RangeFilterModel.js +29 -58
- package/esm/models/filters/RangeFilterModel.js.map +1 -1
- package/esm/models/form/FormModel.js +957 -1133
- package/esm/models/form/FormModel.js.map +1 -1
- package/esm/models/form/FormObjectModel.js +412 -506
- package/esm/models/form/FormObjectModel.js.map +1 -1
- package/esm/models/grouping/GroupingModel.js +115 -163
- package/esm/models/grouping/GroupingModel.js.map +1 -1
- package/esm/models/href/Href.js +391 -450
- package/esm/models/href/Href.js.map +1 -1
- package/esm/models/href/ListHref.js +116 -155
- package/esm/models/href/ListHref.js.map +1 -1
- package/esm/models/layouthint/LayoutHintCollection.js +91 -136
- package/esm/models/layouthint/LayoutHintCollection.js.map +1 -1
- package/esm/models/links/LinkCollection.js +127 -185
- package/esm/models/links/LinkCollection.js.map +1 -1
- package/esm/models/links/LinkModel.js +189 -228
- package/esm/models/links/LinkModel.js.map +1 -1
- package/esm/models/links/normalizeLinkJSON.js +30 -57
- package/esm/models/links/normalizeLinkJSON.js.map +1 -1
- package/esm/models/list/ListDetailModel.js +226 -289
- package/esm/models/list/ListDetailModel.js.map +1 -1
- package/esm/models/list/ListHeaderModel.js +74 -97
- package/esm/models/list/ListHeaderModel.js.map +1 -1
- package/esm/models/list/ListItemCollection.js +49 -85
- package/esm/models/list/ListItemCollection.js.map +1 -1
- package/esm/models/list/ListItemModel.js +73 -110
- package/esm/models/list/ListItemModel.js.map +1 -1
- package/esm/models/list/ListModel.js +342 -421
- package/esm/models/list/ListModel.js.map +1 -1
- package/esm/models/lookup/LookupOptionCollection.js +15 -51
- package/esm/models/lookup/LookupOptionCollection.js.map +1 -1
- package/esm/models/lookup/LookupOptionsModel.js +42 -71
- package/esm/models/lookup/LookupOptionsModel.js.map +1 -1
- package/esm/models/modelcatalog/ModelCatalogModel.js +35 -67
- package/esm/models/modelcatalog/ModelCatalogModel.js.map +1 -1
- package/esm/models/paging/PagesizeModel.js +31 -42
- package/esm/models/paging/PagesizeModel.js.map +1 -1
- package/esm/models/paging/PagingModel.js +77 -94
- package/esm/models/paging/PagingModel.js.map +1 -1
- package/esm/models/panels/GroupingPanelModel.js +116 -160
- package/esm/models/panels/GroupingPanelModel.js.map +1 -1
- package/esm/models/parameter/Parameter.js +82 -97
- package/esm/models/parameter/Parameter.js.map +1 -1
- package/esm/models/process/ProcessStatusSettingsModel.js +63 -100
- package/esm/models/process/ProcessStatusSettingsModel.js.map +1 -1
- package/esm/models/resolveModel.js +3 -5
- package/esm/models/resolveModel.js.map +1 -1
- package/esm/models/search/CaseSearchModel.js +23 -56
- package/esm/models/search/CaseSearchModel.js.map +1 -1
- package/esm/models/sorting/SortOptionModel.js +76 -90
- package/esm/models/sorting/SortOptionModel.js.map +1 -1
- package/esm/models/sorting/SortingModel.js +86 -134
- package/esm/models/sorting/SortingModel.js.map +1 -1
- package/esm/models/tab/TabModel.js +118 -163
- package/esm/models/tab/TabModel.js.map +1 -1
- package/esm/models/taskgroup/TaskGroupCollection.js +7 -37
- package/esm/models/taskgroup/TaskGroupCollection.js.map +1 -1
- package/esm/models/taskgroup/TaskGroupModel.js +51 -83
- package/esm/models/taskgroup/TaskGroupModel.js.map +1 -1
- package/esm/models/types.js.map +1 -1
- package/esm/models/user/UserModel.js +29 -61
- package/esm/models/user/UserModel.js.map +1 -1
- package/esm/models/user/UserProfileModel.js +19 -50
- package/esm/models/user/UserProfileModel.js.map +1 -1
- package/esm/models/user/UserServicesModel.js +79 -123
- package/esm/models/user/UserServicesModel.js.map +1 -1
- package/esm/modularui/Authenticate.js +143 -156
- package/esm/modularui/Authenticate.js.map +1 -1
- package/esm/modularui/ModularUIError.js +9 -32
- package/esm/modularui/ModularUIError.js.map +1 -1
- package/esm/modularui/ModularUIRequest.js +476 -630
- package/esm/modularui/ModularUIRequest.js.map +1 -1
- package/esm/modularui/ModularUIResponse.js +104 -119
- package/esm/modularui/ModularUIResponse.js.map +1 -1
- package/esm/react/ErrorBoundary.js +32 -65
- package/esm/react/ErrorBoundary.js.map +1 -1
- package/esm/react/ErrorBoundaryFallback.js +8 -6
- package/esm/react/ErrorBoundaryFallback.js.map +1 -1
- package/esm/react/utils.js +12 -15
- package/esm/react/utils.js.map +1 -1
- package/esm/react-client/Init.js +9 -7
- package/esm/react-client/Init.js.map +1 -1
- package/esm/react-client/client.js +21 -22
- package/esm/react-client/client.js.map +1 -1
- package/esm/react-client/contextPath.js +4 -4
- package/esm/react-client/contextPath.js.map +1 -1
- package/esm/react-client/rehydrate.js +14 -21
- package/esm/react-client/rehydrate.js.map +1 -1
- package/esm/react-server/createSSRComplete.js +10 -14
- package/esm/react-server/createSSRComplete.js.map +1 -1
- package/esm/react-server/htmlpage.js +5 -8
- package/esm/react-server/htmlpage.js.map +1 -1
- package/esm/react-server/renderSSRComplete.js +50 -55
- package/esm/react-server/renderSSRComplete.js.map +1 -1
- package/esm/react-server/renderSSRMinimal.js +13 -13
- package/esm/react-server/renderSSRMinimal.js.map +1 -1
- package/esm/react-server/requestInformation.js +8 -10
- package/esm/react-server/requestInformation.js.map +1 -1
- package/esm/react-server/serverNoSSR.js +22 -21
- package/esm/react-server/serverNoSSR.js.map +1 -1
- package/esm/react-server/serverSSR.js +24 -24
- package/esm/react-server/serverSSR.js.map +1 -1
- package/esm/react-server/serverUtil.js +45 -61
- package/esm/react-server/serverUtil.js.map +1 -1
- package/esm/react-theme/ThemeProvider.js +10 -7
- package/esm/react-theme/ThemeProvider.js.map +1 -1
- package/esm/react-theme/createTheme.js +15 -35
- package/esm/react-theme/createTheme.js.map +1 -1
- package/esm/react-theme/useTheme.js +1 -1
- package/esm/react-theme/useTheme.js.map +1 -1
- package/esm/react-theme/utils/background.js +9 -9
- package/esm/react-theme/utils/background.js.map +1 -1
- package/esm/react-theme/utils/colors.js +12 -12
- package/esm/react-theme/utils/colors.js.map +1 -1
- package/esm/react-theme/utils/contrast.js +27 -27
- package/esm/react-theme/utils/contrast.js.map +1 -1
- package/esm/react-theme/utils/corners.js +10 -9
- package/esm/react-theme/utils/corners.js.map +1 -1
- package/esm/react-theme/utils/spacers.js +23 -22
- package/esm/react-theme/utils/spacers.js.map +1 -1
- package/esm/react-theme/utils/themeProps.js +28 -29
- package/esm/react-theme/utils/themeProps.js.map +1 -1
- package/esm/redux/_i18n/actions.js +15 -21
- package/esm/redux/_i18n/actions.js.map +1 -1
- package/esm/redux/_i18n/reducer.js +20 -29
- package/esm/redux/_i18n/reducer.js.map +1 -1
- package/esm/redux/_modularui/actions.js +40 -67
- package/esm/redux/_modularui/actions.js.map +1 -1
- package/esm/redux/_modularui/connector.js +46 -50
- package/esm/redux/_modularui/connector.js.map +1 -1
- package/esm/redux/_modularui/middleware.js +23 -36
- package/esm/redux/_modularui/middleware.js.map +1 -1
- package/esm/redux/_modularui/modularuiUtils.js +16 -23
- package/esm/redux/_modularui/modularuiUtils.js.map +1 -1
- package/esm/redux/_modularui/reducer.js +42 -53
- package/esm/redux/_modularui/reducer.js.map +1 -1
- package/esm/redux/_modularui/selectors.js +89 -99
- package/esm/redux/_modularui/selectors.js.map +1 -1
- package/esm/redux/_modularui/withModularUI.js +15 -19
- package/esm/redux/_modularui/withModularUI.js.map +1 -1
- package/esm/redux/_router/actions.js +29 -39
- package/esm/redux/_router/actions.js.map +1 -1
- package/esm/redux/_router/connectors.js +12 -14
- package/esm/redux/_router/connectors.js.map +1 -1
- package/esm/redux/_router/middleware.js +27 -29
- package/esm/redux/_router/middleware.js.map +1 -1
- package/esm/redux/_router/reducer.js +4 -4
- package/esm/redux/_router/reducer.js.map +1 -1
- package/esm/redux/actions/Application.js +9 -32
- package/esm/redux/actions/Application.js.map +1 -1
- package/esm/redux/actions/Authorization.js +31 -33
- package/esm/redux/actions/Authorization.js.map +1 -1
- package/esm/redux/actions/Error.js +33 -43
- package/esm/redux/actions/Error.js.map +1 -1
- package/esm/redux/actions/Form.js +13 -15
- package/esm/redux/actions/Form.js.map +1 -1
- package/esm/redux/actions/FormAttributeSet.js +6 -6
- package/esm/redux/actions/FormAttributeSet.js.map +1 -1
- package/esm/redux/actions/FormAttributeSetRepeatable.js +6 -6
- package/esm/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
- package/esm/redux/actions/FormAutosave.js +12 -18
- package/esm/redux/actions/FormAutosave.js.map +1 -1
- package/esm/redux/actions/FormAutosubmit.js +2 -2
- package/esm/redux/actions/FormAutosubmit.js.map +1 -1
- package/esm/redux/actions/FormValidations.js +12 -20
- package/esm/redux/actions/FormValidations.js.map +1 -1
- package/esm/redux/actions/Modals.js +8 -12
- package/esm/redux/actions/Modals.js.map +1 -1
- package/esm/redux/actions/Notification.js +32 -42
- package/esm/redux/actions/Notification.js.map +1 -1
- package/esm/redux/actions/Preferences.js +32 -38
- package/esm/redux/actions/Preferences.js.map +1 -1
- package/esm/redux/actions/ProgressIndicator.js +15 -23
- package/esm/redux/actions/ProgressIndicator.js.map +1 -1
- package/esm/redux/actions/SignIn.js +39 -53
- package/esm/redux/actions/SignIn.js.map +1 -1
- package/esm/redux/actions/SignOut.js +9 -17
- package/esm/redux/actions/SignOut.js.map +1 -1
- package/esm/redux/connectors/Application.js +1 -1
- package/esm/redux/connectors/Application.js.map +1 -1
- package/esm/redux/connectors/Breadcrumb.js +4 -6
- package/esm/redux/connectors/Breadcrumb.js.map +1 -1
- package/esm/redux/connectors/CaseView.js +4 -2
- package/esm/redux/connectors/CaseView.js.map +1 -1
- package/esm/redux/connectors/ConceptDetail.js +5 -3
- package/esm/redux/connectors/ConceptDetail.js.map +1 -1
- package/esm/redux/connectors/ContentBrowser.js +4 -2
- package/esm/redux/connectors/ContentBrowser.js.map +1 -1
- package/esm/redux/connectors/ContentDetail.js +5 -3
- package/esm/redux/connectors/ContentDetail.js.map +1 -1
- package/esm/redux/connectors/ContentDetailSection.js +6 -4
- package/esm/redux/connectors/ContentDetailSection.js.map +1 -1
- package/esm/redux/connectors/Form.js +11 -9
- package/esm/redux/connectors/Form.js.map +1 -1
- package/esm/redux/connectors/FormAttributeSet.js +13 -21
- package/esm/redux/connectors/FormAttributeSet.js.map +1 -1
- package/esm/redux/connectors/ListDetail.js +4 -2
- package/esm/redux/connectors/ListDetail.js.map +1 -1
- package/esm/redux/connectors/Modal.js +4 -6
- package/esm/redux/connectors/Modal.js.map +1 -1
- package/esm/redux/connectors/ModelCatalog.js +4 -2
- package/esm/redux/connectors/ModelCatalog.js.map +1 -1
- package/esm/redux/connectors/Notification.js +8 -10
- package/esm/redux/connectors/Notification.js.map +1 -1
- package/esm/redux/connectors/PanelRenderer.js +7 -6
- package/esm/redux/connectors/PanelRenderer.js.map +1 -1
- package/esm/redux/connectors/Preferences.js +6 -8
- package/esm/redux/connectors/Preferences.js.map +1 -1
- package/esm/redux/connectors/Progress.js +2 -2
- package/esm/redux/connectors/Progress.js.map +1 -1
- package/esm/redux/connectors/ProgressIndicator.js +6 -8
- package/esm/redux/connectors/ProgressIndicator.js.map +1 -1
- package/esm/redux/connectors/QuickSearch.js +6 -4
- package/esm/redux/connectors/QuickSearch.js.map +1 -1
- package/esm/redux/connectors/SignIn.js +4 -4
- package/esm/redux/connectors/SignIn.js.map +1 -1
- package/esm/redux/connectors/SignOut.js +3 -3
- package/esm/redux/connectors/SignOut.js.map +1 -1
- package/esm/redux/connectors/Tab.js +4 -2
- package/esm/redux/connectors/Tab.js.map +1 -1
- package/esm/redux/reducers/AuthReducer.js +14 -25
- package/esm/redux/reducers/AuthReducer.js.map +1 -1
- package/esm/redux/reducers/ErrorReducer.js +4 -4
- package/esm/redux/reducers/ErrorReducer.js.map +1 -1
- package/esm/redux/reducers/ModalsReducer.js +19 -37
- package/esm/redux/reducers/ModalsReducer.js.map +1 -1
- package/esm/redux/reducers/NotificationReducer.js +8 -19
- package/esm/redux/reducers/NotificationReducer.js.map +1 -1
- package/esm/redux/reducers/PreferencesReducer.js +10 -17
- package/esm/redux/reducers/PreferencesReducer.js.map +1 -1
- package/esm/redux/reducers/ProgressIndicatorReducer.js +14 -25
- package/esm/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
- package/esm/redux/reducers/createReducer.js +11 -13
- package/esm/redux/reducers/createReducer.js.map +1 -1
- package/esm/redux/selectors/i18n.js +2 -4
- package/esm/redux/selectors/i18n.js.map +1 -1
- package/esm/redux/store/beforeRenderHooks.js +5 -26
- package/esm/redux/store/beforeRenderHooks.js.map +1 -1
- package/esm/redux/store/configureStore.js +10 -19
- package/esm/redux/store/configureStore.js.map +1 -1
- package/esm/utils/browser/Cache.js +122 -156
- package/esm/utils/browser/Cache.js.map +1 -1
- package/esm/utils/browser/Cookies.js +4 -4
- package/esm/utils/browser/Cookies.js.map +1 -1
- package/esm/utils/datetime/DateTimeUtil.js +363 -418
- package/esm/utils/datetime/DateTimeUtil.js.map +1 -1
- package/esm/utils/fetch/serverFetch.js +5 -5
- package/esm/utils/fetch/serverFetch.js.map +1 -1
- package/esm/utils/fetch/universalFetch.js +13 -14
- package/esm/utils/fetch/universalFetch.js.map +1 -1
- package/esm/utils/fetch/xhr.js +281 -358
- package/esm/utils/fetch/xhr.js.map +1 -1
- package/esm/utils/helpers/checkResource.js +7 -7
- package/esm/utils/helpers/checkResource.js.map +1 -1
- package/esm/utils/helpers/createHash.js +5 -5
- package/esm/utils/helpers/createHash.js.map +1 -1
- package/esm/utils/helpers/createUUID.js +4 -4
- package/esm/utils/helpers/createUUID.js.map +1 -1
- package/esm/utils/helpers/objects.js +9 -14
- package/esm/utils/helpers/objects.js.map +1 -1
- package/esm/utils/helpers/sanitizeHtml.js +13 -13
- package/esm/utils/helpers/sanitizeHtml.js.map +1 -1
- package/esm/utils/helpers/text.js +1 -1
- package/esm/utils/helpers/text.js.map +1 -1
- package/esm/utils/number/DecimalFormat.js +297 -327
- package/esm/utils/number/DecimalFormat.js.map +1 -1
- package/esm/utils/number/formatValue.js +10 -16
- package/esm/utils/number/formatValue.js.map +1 -1
- package/esm/utils/number/parseNumbers.js +13 -13
- package/esm/utils/number/parseNumbers.js.map +1 -1
- package/lib/builder/index.js +1 -1
- package/lib/builder/mergeLayoutHintConfigurations.js +34 -64
- package/lib/builder/mergeLayoutHintConfigurations.js.map +1 -1
- package/lib/constants/Constants.js +37 -37
- package/lib/constants/Constants.js.map +1 -1
- package/lib/constants/LayoutHintConfig.js +1 -1
- package/lib/constants/LayoutHintConfig.js.map +1 -1
- package/lib/constants/LayoutHints.js +20 -22
- package/lib/constants/LayoutHints.js.map +1 -1
- package/lib/constants/Settings.js +17 -27
- package/lib/constants/Settings.js.flow +3 -0
- package/lib/constants/Settings.js.map +1 -1
- package/lib/constants/index.js +3 -3
- package/lib/exceptions/ConfigurationException.js +5 -34
- package/lib/exceptions/ConfigurationException.js.map +1 -1
- package/lib/exceptions/FetchException.js +32 -75
- package/lib/exceptions/FetchException.js.map +1 -1
- package/lib/exceptions/IllegalArgumentException.js +5 -34
- package/lib/exceptions/IllegalArgumentException.js.map +1 -1
- package/lib/exceptions/IllegalReturnException.js +5 -34
- package/lib/exceptions/IllegalReturnException.js.map +1 -1
- package/lib/exceptions/IllegalStateException.js +5 -34
- package/lib/exceptions/IllegalStateException.js.map +1 -1
- package/lib/exceptions/JsonParseException.js +5 -34
- package/lib/exceptions/JsonParseException.js.map +1 -1
- package/lib/exceptions/MissingPropertyException.js +5 -34
- package/lib/exceptions/MissingPropertyException.js.map +1 -1
- package/lib/exceptions/NetworkException.js +9 -38
- package/lib/exceptions/NetworkException.js.map +1 -1
- package/lib/exceptions/NotAllowedUriException.js +5 -34
- package/lib/exceptions/NotAllowedUriException.js.map +1 -1
- package/lib/exceptions/NotFoundException.js +12 -41
- package/lib/exceptions/NotFoundException.js.map +1 -1
- package/lib/exceptions/ServerRequestException.js +5 -34
- package/lib/exceptions/ServerRequestException.js.map +1 -1
- package/lib/exceptions/ThemePropertyException.js +5 -34
- package/lib/exceptions/ThemePropertyException.js.map +1 -1
- package/lib/exceptions/TimeoutException.js +5 -32
- package/lib/exceptions/TimeoutException.js.map +1 -1
- package/lib/exceptions/UnauthorizedException.js +11 -40
- package/lib/exceptions/UnauthorizedException.js.map +1 -1
- package/lib/exceptions/UnsupportedOperationException.js +5 -34
- package/lib/exceptions/UnsupportedOperationException.js.map +1 -1
- package/lib/exceptions/index.js +15 -15
- package/lib/hooks/index.js +16 -16
- package/lib/hooks/useAllFormsOnModel.js +25 -51
- package/lib/hooks/useAllFormsOnModel.js.map +1 -1
- package/lib/hooks/useAuthentication.js +18 -24
- package/lib/hooks/useAuthentication.js.map +1 -1
- package/lib/hooks/useContent.js +14 -27
- package/lib/hooks/useContent.js.map +1 -1
- package/lib/hooks/useDeepCompareEffect.js +5 -7
- package/lib/hooks/useDeepCompareEffect.js.map +1 -1
- package/lib/hooks/useForm.js +27 -45
- package/lib/hooks/useForm.js.map +1 -1
- package/lib/hooks/useI18n.js +10 -20
- package/lib/hooks/useI18n.js.map +1 -1
- package/lib/hooks/useModal.js +11 -11
- package/lib/hooks/useModal.js.map +1 -1
- package/lib/hooks/useModelCatalog.js +24 -30
- package/lib/hooks/useModelCatalog.js.map +1 -1
- package/lib/hooks/useModels.js +3 -3
- package/lib/hooks/useModels.js.map +1 -1
- package/lib/hooks/useModularUI.js +17 -16
- package/lib/hooks/useModularUI.js.map +1 -1
- package/lib/hooks/useModularUIBasic.js +9 -7
- package/lib/hooks/useModularUIBasic.js.map +1 -1
- package/lib/hooks/useModularUIModel.js +39 -59
- package/lib/hooks/useModularUIModel.js.map +1 -1
- package/lib/hooks/useModularUIRequest.js +4 -6
- package/lib/hooks/useModularUIRequest.js.map +1 -1
- package/lib/hooks/useNotification.js +16 -21
- package/lib/hooks/useNotification.js.map +1 -1
- package/lib/hooks/usePreference.js +3 -5
- package/lib/hooks/usePreference.js.map +1 -1
- package/lib/hooks/useProgressIndicator.js +9 -37
- package/lib/hooks/useProgressIndicator.js.map +1 -1
- package/lib/hooks/useRouter.js +11 -25
- package/lib/hooks/useRouter.js.map +1 -1
- package/lib/i18n/Locale.js +97 -144
- package/lib/i18n/Locale.js.map +1 -1
- package/lib/i18n/Locales.js +97 -160
- package/lib/i18n/Locales.js.map +1 -1
- package/lib/i18n/Message.js +13 -31
- package/lib/i18n/Message.js.map +1 -1
- package/lib/i18n/index.js +9 -11
- package/lib/i18n/index.js.map +1 -1
- package/lib/i18n/languages.js +1 -1
- package/lib/i18n/languages.js.map +1 -1
- package/lib/i18n/withMessage.js +11 -17
- package/lib/i18n/withMessage.js.map +1 -1
- package/lib/index.js +6 -6
- package/lib/models/actions/ActionCollection.js +58 -104
- package/lib/models/actions/ActionCollection.js.map +1 -1
- package/lib/models/actions/ActionModel.js +169 -210
- package/lib/models/actions/ActionModel.js.map +1 -1
- package/lib/models/application/ApplicationModel.js +107 -159
- package/lib/models/application/ApplicationModel.js.map +1 -1
- package/lib/models/attributes/AttributeCollection.js +245 -341
- package/lib/models/attributes/AttributeCollection.js.map +1 -1
- package/lib/models/attributes/AttributeContent.js +182 -257
- package/lib/models/attributes/AttributeContent.js.map +1 -1
- package/lib/models/attributes/AttributeDataHelper.js +209 -258
- package/lib/models/attributes/AttributeDataHelper.js.flow +5 -1
- package/lib/models/attributes/AttributeDataHelper.js.map +1 -1
- package/lib/models/attributes/AttributeModel.js +838 -950
- package/lib/models/attributes/AttributeModel.js.map +1 -1
- package/lib/models/attributes/AttributeSetModel.js +49 -83
- package/lib/models/attributes/AttributeSetModel.js.map +1 -1
- package/lib/models/attributes/BooleanAttributeModel.js +267 -339
- package/lib/models/attributes/BooleanAttributeModel.js.map +1 -1
- package/lib/models/attributes/CaptchaAttributeModel.js +27 -59
- package/lib/models/attributes/CaptchaAttributeModel.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeModel.js +343 -437
- package/lib/models/attributes/ChoiceAttributeModel.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js +268 -369
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeOptionModel.js +299 -357
- package/lib/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
- package/lib/models/attributes/CompositeAttributeChildCollection.js +181 -270
- package/lib/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
- package/lib/models/attributes/CompositeAttributeModel.js +331 -411
- package/lib/models/attributes/CompositeAttributeModel.js.map +1 -1
- package/lib/models/attributes/DatetimeAttributeModel.js +371 -425
- package/lib/models/attributes/DatetimeAttributeModel.js.map +1 -1
- package/lib/models/attributes/HelptextAttributeModel.js +41 -74
- package/lib/models/attributes/HelptextAttributeModel.js.map +1 -1
- package/lib/models/attributes/LabelAttributeModel.js +26 -58
- package/lib/models/attributes/LabelAttributeModel.js.map +1 -1
- package/lib/models/attributes/MemoAttributeModel.js +34 -67
- package/lib/models/attributes/MemoAttributeModel.js.map +1 -1
- package/lib/models/attributes/MoneyAttributeModel.js +34 -67
- package/lib/models/attributes/MoneyAttributeModel.js.map +1 -1
- package/lib/models/attributes/NumberAttributeModel.js +181 -231
- package/lib/models/attributes/NumberAttributeModel.js.map +1 -1
- package/lib/models/attributes/PasswordAttributeModel.js +201 -253
- package/lib/models/attributes/PasswordAttributeModel.js.map +1 -1
- package/lib/models/attributes/StringAttributeModel.js +239 -289
- package/lib/models/attributes/StringAttributeModel.js.map +1 -1
- package/lib/models/attributes/UploadAttributeModel.js +183 -243
- package/lib/models/attributes/UploadAttributeModel.js.map +1 -1
- package/lib/models/attributes/XMLAttributeModel.js +38 -71
- package/lib/models/attributes/XMLAttributeModel.js.map +1 -1
- package/lib/models/attributes/_createAttribute.js +20 -43
- package/lib/models/attributes/_createAttribute.js.map +1 -1
- package/lib/models/attributes/input-constraints/BSNConstraint.js +64 -84
- package/lib/models/attributes/input-constraints/BSNConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/ConstraintCollection.js +36 -74
- package/lib/models/attributes/input-constraints/ConstraintCollection.js.map +1 -1
- package/lib/models/attributes/input-constraints/ConstraintModel.js +46 -59
- package/lib/models/attributes/input-constraints/ConstraintModel.js.map +1 -1
- package/lib/models/attributes/input-constraints/DateBoundaryConstraint.js +171 -193
- package/lib/models/attributes/input-constraints/DateBoundaryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/DateTimeDateFormatConstraint.js +53 -68
- package/lib/models/attributes/input-constraints/DateTimeDateFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js +53 -68
- package/lib/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/DatetimeFormatConstraint.js +67 -84
- package/lib/models/attributes/input-constraints/DatetimeFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/FileExtensionConstraint.js +53 -69
- package/lib/models/attributes/input-constraints/FileExtensionConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/FileSizeConstraint.js +79 -95
- package/lib/models/attributes/input-constraints/FileSizeConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/IBANConstraint.js +41 -58
- package/lib/models/attributes/input-constraints/IBANConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/MandatoryConstraint.js +39 -60
- package/lib/models/attributes/input-constraints/MandatoryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/MandatoryRangeConstraint.js +63 -82
- package/lib/models/attributes/input-constraints/MandatoryRangeConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.js +150 -172
- package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberFormatConstraint.js +105 -125
- package/lib/models/attributes/input-constraints/NumberFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberGroupingConstraint.js +92 -114
- package/lib/models/attributes/input-constraints/NumberGroupingConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordConfirmConstraint.js +58 -73
- package/lib/models/attributes/input-constraints/PasswordConfirmConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js +36 -55
- package/lib/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js +51 -65
- package/lib/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js +51 -65
- package/lib/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js +64 -82
- package/lib/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/RangeConstraint.js +116 -135
- package/lib/models/attributes/input-constraints/RangeConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/RegexConstraint.js +48 -62
- package/lib/models/attributes/input-constraints/RegexConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/StringLengthConstraint.js +158 -177
- package/lib/models/attributes/input-constraints/StringLengthConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/XMLConstraint.js +49 -69
- package/lib/models/attributes/input-constraints/XMLConstraint.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js +54 -70
- package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/DependentAttribute.js +172 -218
- package/lib/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/LayoutHintRuleCollection.js +43 -74
- package/lib/models/attributes/layouthint-rules/LayoutHintRuleCollection.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/RemainingTotalUploadSize.js +32 -64
- package/lib/models/attributes/layouthint-rules/RemainingTotalUploadSize.js.map +1 -1
- package/lib/models/base/BaseCollection.js +170 -206
- package/lib/models/base/BaseCollection.js.map +1 -1
- package/lib/models/base/BaseModel.js +98 -113
- package/lib/models/base/BaseModel.js.map +1 -1
- package/lib/models/base/ResourceCollection.js +28 -60
- package/lib/models/base/ResourceCollection.js.map +1 -1
- package/lib/models/base/ResourceModel.js +171 -231
- package/lib/models/base/ResourceModel.js.map +1 -1
- package/lib/models/caseview/CaseViewModel.js +137 -188
- package/lib/models/caseview/CaseViewModel.js.map +1 -1
- package/lib/models/concepts/BusinessScenarioModel.js +97 -153
- package/lib/models/concepts/BusinessScenarioModel.js.map +1 -1
- package/lib/models/concepts/ConceptDetailModel.js +243 -329
- package/lib/models/concepts/ConceptDetailModel.js.map +1 -1
- package/lib/models/concepts/ConceptIndexModel.js +118 -156
- package/lib/models/concepts/ConceptIndexModel.js.map +1 -1
- package/lib/models/concepts/ConceptLinkModel.js +122 -163
- package/lib/models/concepts/ConceptLinkModel.js.map +1 -1
- package/lib/models/concepts/ConceptRelationCollection.js +57 -105
- package/lib/models/concepts/ConceptRelationCollection.js.map +1 -1
- package/lib/models/concepts/ConceptRelationModel.js +62 -75
- package/lib/models/concepts/ConceptRelationModel.js.map +1 -1
- package/lib/models/concepts/ConceptTypeDetailModel.js +87 -127
- package/lib/models/concepts/ConceptTypeDetailModel.js.map +1 -1
- package/lib/models/concepts/SourceReferenceCollection.js +13 -44
- package/lib/models/concepts/SourceReferenceCollection.js.map +1 -1
- package/lib/models/concepts/SourceReferenceModel.js +47 -74
- package/lib/models/concepts/SourceReferenceModel.js.map +1 -1
- package/lib/models/content/ContentIndexModel.js +112 -156
- package/lib/models/content/ContentIndexModel.js.map +1 -1
- package/lib/models/content/ContentLinkModel.js +162 -205
- package/lib/models/content/ContentLinkModel.js.map +1 -1
- package/lib/models/content/ContentModel.js +188 -235
- package/lib/models/content/ContentModel.js.map +1 -1
- package/lib/models/content/ContentTOCModel.js +133 -209
- package/lib/models/content/ContentTOCModel.js.map +1 -1
- package/lib/models/content/ContentTypeModel.js +56 -92
- package/lib/models/content/ContentTypeModel.js.map +1 -1
- package/lib/models/content/SectionModel.js +160 -254
- package/lib/models/content/SectionModel.js.map +1 -1
- package/lib/models/content/SubSectionModel.js +125 -196
- package/lib/models/content/SubSectionModel.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfiguration.js +46 -58
- package/lib/models/contentconfiguration/ContentConfiguration.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationElements.js +127 -171
- package/lib/models/contentconfiguration/ContentConfigurationElements.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationEndResults.js +28 -45
- package/lib/models/contentconfiguration/ContentConfigurationEndResults.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationQuestions.js +31 -42
- package/lib/models/contentconfiguration/ContentConfigurationQuestions.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationResults.js +74 -98
- package/lib/models/contentconfiguration/ContentConfigurationResults.js.map +1 -1
- package/lib/models/detail/DetailModel.js +176 -232
- package/lib/models/detail/DetailModel.js.map +1 -1
- package/lib/models/error/ErrorCollection.js +82 -139
- package/lib/models/error/ErrorCollection.js.map +1 -1
- package/lib/models/error/ErrorModel.js +47 -48
- package/lib/models/error/ErrorModel.js.flow +9 -1
- package/lib/models/error/ErrorModel.js.map +1 -1
- package/lib/models/error/ErrorResponse.js +286 -204
- package/lib/models/error/ErrorResponse.js.flow +102 -0
- package/lib/models/error/ErrorResponse.js.map +1 -1
- package/lib/models/filters/AssignmentFilterModel.js +144 -195
- package/lib/models/filters/AssignmentFilterModel.js.map +1 -1
- package/lib/models/filters/BaseFilterModel.js +171 -228
- package/lib/models/filters/BaseFilterModel.js.map +1 -1
- package/lib/models/filters/ConceptIndexFilterModel.js +9 -39
- package/lib/models/filters/ConceptIndexFilterModel.js.map +1 -1
- package/lib/models/filters/FilterCollection.js +109 -177
- package/lib/models/filters/FilterCollection.js.map +1 -1
- package/lib/models/filters/FilterModel.js +2 -29
- package/lib/models/filters/FilterModel.js.map +1 -1
- package/lib/models/filters/RangeFilterModel.js +30 -60
- package/lib/models/filters/RangeFilterModel.js.map +1 -1
- package/lib/models/form/FormModel.js +961 -1150
- package/lib/models/form/FormModel.js.map +1 -1
- package/lib/models/form/FormObjectModel.js +411 -517
- package/lib/models/form/FormObjectModel.js.map +1 -1
- package/lib/models/grouping/GroupingModel.js +117 -165
- package/lib/models/grouping/GroupingModel.js.map +1 -1
- package/lib/models/href/Href.js +392 -452
- package/lib/models/href/Href.js.map +1 -1
- package/lib/models/href/ListHref.js +119 -159
- package/lib/models/href/ListHref.js.map +1 -1
- package/lib/models/index.js +97 -99
- package/lib/models/index.js.map +1 -1
- package/lib/models/layouthint/LayoutHintCollection.js +94 -140
- package/lib/models/layouthint/LayoutHintCollection.js.map +1 -1
- package/lib/models/links/LinkCollection.js +136 -196
- package/lib/models/links/LinkCollection.js.map +1 -1
- package/lib/models/links/LinkModel.js +191 -235
- package/lib/models/links/LinkModel.js.map +1 -1
- package/lib/models/links/normalizeLinkJSON.js +30 -66
- package/lib/models/links/normalizeLinkJSON.js.map +1 -1
- package/lib/models/list/ListDetailModel.js +229 -302
- package/lib/models/list/ListDetailModel.js.map +1 -1
- package/lib/models/list/ListHeaderModel.js +73 -97
- package/lib/models/list/ListHeaderModel.js.map +1 -1
- package/lib/models/list/ListItemCollection.js +49 -91
- package/lib/models/list/ListItemCollection.js.map +1 -1
- package/lib/models/list/ListItemModel.js +76 -114
- package/lib/models/list/ListItemModel.js.map +1 -1
- package/lib/models/list/ListModel.js +347 -435
- package/lib/models/list/ListModel.js.map +1 -1
- package/lib/models/lookup/LookupOptionCollection.js +16 -61
- package/lib/models/lookup/LookupOptionCollection.js.map +1 -1
- package/lib/models/lookup/LookupOptionsModel.js +48 -79
- package/lib/models/lookup/LookupOptionsModel.js.map +1 -1
- package/lib/models/modelcatalog/ModelCatalogModel.js +39 -72
- package/lib/models/modelcatalog/ModelCatalogModel.js.map +1 -1
- package/lib/models/paging/PagesizeModel.js +29 -38
- package/lib/models/paging/PagesizeModel.js.map +1 -1
- package/lib/models/paging/PagingModel.js +77 -92
- package/lib/models/paging/PagingModel.js.map +1 -1
- package/lib/models/panels/GroupingPanelModel.js +117 -164
- package/lib/models/panels/GroupingPanelModel.js.map +1 -1
- package/lib/models/parameter/Parameter.js +83 -99
- package/lib/models/parameter/Parameter.js.map +1 -1
- package/lib/models/process/ProcessStatusSettingsModel.js +67 -105
- package/lib/models/process/ProcessStatusSettingsModel.js.map +1 -1
- package/lib/models/resolveModel.js +3 -5
- package/lib/models/resolveModel.js.map +1 -1
- package/lib/models/search/CaseSearchModel.js +26 -60
- package/lib/models/search/CaseSearchModel.js.map +1 -1
- package/lib/models/sorting/SortOptionModel.js +77 -91
- package/lib/models/sorting/SortOptionModel.js.map +1 -1
- package/lib/models/sorting/SortingModel.js +88 -140
- package/lib/models/sorting/SortingModel.js.map +1 -1
- package/lib/models/tab/TabModel.js +122 -170
- package/lib/models/tab/TabModel.js.map +1 -1
- package/lib/models/taskgroup/TaskGroupCollection.js +8 -39
- package/lib/models/taskgroup/TaskGroupCollection.js.map +1 -1
- package/lib/models/taskgroup/TaskGroupModel.js +54 -88
- package/lib/models/taskgroup/TaskGroupModel.js.map +1 -1
- package/lib/models/types.js.flow +1 -0
- package/lib/models/types.js.map +1 -1
- package/lib/models/user/UserModel.js +32 -65
- package/lib/models/user/UserModel.js.map +1 -1
- package/lib/models/user/UserProfileModel.js +21 -56
- package/lib/models/user/UserProfileModel.js.map +1 -1
- package/lib/models/user/UserServicesModel.js +78 -128
- package/lib/models/user/UserServicesModel.js.flow +1 -7
- package/lib/models/user/UserServicesModel.js.map +1 -1
- package/lib/modularui/Authenticate.js +144 -157
- package/lib/modularui/Authenticate.js.flow +13 -7
- package/lib/modularui/Authenticate.js.map +1 -1
- package/lib/modularui/ModularUIError.js +9 -39
- package/lib/modularui/ModularUIError.js.map +1 -1
- package/lib/modularui/ModularUIRequest.js +477 -647
- package/lib/modularui/ModularUIRequest.js.map +1 -1
- package/lib/modularui/ModularUIResponse.js +102 -120
- package/lib/modularui/ModularUIResponse.js.map +1 -1
- package/lib/modularui/index.js +3 -3
- package/lib/react/ErrorBoundary.js +33 -71
- package/lib/react/ErrorBoundary.js.map +1 -1
- package/lib/react/ErrorBoundaryFallback.js +8 -6
- package/lib/react/ErrorBoundaryFallback.js.map +1 -1
- package/lib/react/index.js +2 -2
- package/lib/react/utils.js +12 -16
- package/lib/react/utils.js.map +1 -1
- package/lib/react-client/Init.js +9 -7
- package/lib/react-client/Init.js.map +1 -1
- package/lib/react-client/client.js +22 -23
- package/lib/react-client/client.js.map +1 -1
- package/lib/react-client/contextPath.js +4 -4
- package/lib/react-client/contextPath.js.map +1 -1
- package/lib/react-client/index.js +3 -3
- package/lib/react-client/rehydrate.js +14 -22
- package/lib/react-client/rehydrate.js.map +1 -1
- package/lib/react-server/createSSRComplete.js +10 -14
- package/lib/react-server/createSSRComplete.js.map +1 -1
- package/lib/react-server/htmlpage.js +5 -8
- package/lib/react-server/htmlpage.js.map +1 -1
- package/lib/react-server/index.js +8 -8
- package/lib/react-server/renderSSRComplete.js +50 -55
- package/lib/react-server/renderSSRComplete.js.map +1 -1
- package/lib/react-server/renderSSRMinimal.js +13 -13
- package/lib/react-server/renderSSRMinimal.js.map +1 -1
- package/lib/react-server/requestInformation.js +8 -10
- package/lib/react-server/requestInformation.js.map +1 -1
- package/lib/react-server/serverNoSSR.js +22 -21
- package/lib/react-server/serverNoSSR.js.map +1 -1
- package/lib/react-server/serverSSR.js +24 -24
- package/lib/react-server/serverSSR.js.map +1 -1
- package/lib/react-server/serverUtil.js +49 -74
- package/lib/react-server/serverUtil.js.map +1 -1
- package/lib/react-theme/ThemeProvider.js +10 -7
- package/lib/react-theme/ThemeProvider.js.map +1 -1
- package/lib/react-theme/createTheme.js +15 -44
- package/lib/react-theme/createTheme.js.map +1 -1
- package/lib/react-theme/index.js +9 -9
- package/lib/react-theme/useTheme.js +1 -1
- package/lib/react-theme/useTheme.js.map +1 -1
- package/lib/react-theme/utils/background.js +9 -9
- package/lib/react-theme/utils/background.js.map +1 -1
- package/lib/react-theme/utils/colors.js +12 -12
- package/lib/react-theme/utils/colors.js.map +1 -1
- package/lib/react-theme/utils/contrast.js +27 -28
- package/lib/react-theme/utils/contrast.js.map +1 -1
- package/lib/react-theme/utils/corners.js +10 -9
- package/lib/react-theme/utils/corners.js.map +1 -1
- package/lib/react-theme/utils/spacers.js +23 -22
- package/lib/react-theme/utils/spacers.js.map +1 -1
- package/lib/react-theme/utils/themeProps.js +28 -30
- package/lib/react-theme/utils/themeProps.js.map +1 -1
- package/lib/redux/_i18n/actions.js +15 -21
- package/lib/redux/_i18n/actions.js.map +1 -1
- package/lib/redux/_i18n/index.js +2 -2
- package/lib/redux/_i18n/reducer.js +20 -34
- package/lib/redux/_i18n/reducer.js.map +1 -1
- package/lib/redux/_modularui/actions.js +40 -72
- package/lib/redux/_modularui/actions.js.map +1 -1
- package/lib/redux/_modularui/connector.js +46 -55
- package/lib/redux/_modularui/connector.js.map +1 -1
- package/lib/redux/_modularui/index.js +7 -7
- package/lib/redux/_modularui/middleware.js +23 -36
- package/lib/redux/_modularui/middleware.js.map +1 -1
- package/lib/redux/_modularui/modularuiUtils.js +16 -24
- package/lib/redux/_modularui/modularuiUtils.js.map +1 -1
- package/lib/redux/_modularui/reducer.js +42 -61
- package/lib/redux/_modularui/reducer.js.map +1 -1
- package/lib/redux/_modularui/selectors.js +89 -106
- package/lib/redux/_modularui/selectors.js.map +1 -1
- package/lib/redux/_modularui/withModularUI.js +11 -15
- package/lib/redux/_modularui/withModularUI.js.map +1 -1
- package/lib/redux/_router/actions.js +29 -39
- package/lib/redux/_router/actions.js.map +1 -1
- package/lib/redux/_router/connectors.js +7 -9
- package/lib/redux/_router/connectors.js.map +1 -1
- package/lib/redux/_router/index.js +4 -4
- package/lib/redux/_router/middleware.js +27 -29
- package/lib/redux/_router/middleware.js.map +1 -1
- package/lib/redux/_router/reducer.js +4 -4
- package/lib/redux/_router/reducer.js.map +1 -1
- package/lib/redux/actions/Application.js +11 -37
- package/lib/redux/actions/Application.js.map +1 -1
- package/lib/redux/actions/Authorization.js +31 -33
- package/lib/redux/actions/Authorization.js.map +1 -1
- package/lib/redux/actions/Error.js +33 -43
- package/lib/redux/actions/Error.js.map +1 -1
- package/lib/redux/actions/Form.js +14 -16
- package/lib/redux/actions/Form.js.map +1 -1
- package/lib/redux/actions/FormAttributeSet.js +6 -6
- package/lib/redux/actions/FormAttributeSet.js.map +1 -1
- package/lib/redux/actions/FormAttributeSetRepeatable.js +6 -6
- package/lib/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
- package/lib/redux/actions/FormAutosave.js +12 -18
- package/lib/redux/actions/FormAutosave.js.map +1 -1
- package/lib/redux/actions/FormAutosubmit.js +2 -2
- package/lib/redux/actions/FormAutosubmit.js.map +1 -1
- package/lib/redux/actions/FormValidations.js +12 -20
- package/lib/redux/actions/FormValidations.js.map +1 -1
- package/lib/redux/actions/Modals.js +8 -12
- package/lib/redux/actions/Modals.js.map +1 -1
- package/lib/redux/actions/Notification.js +32 -42
- package/lib/redux/actions/Notification.js.map +1 -1
- package/lib/redux/actions/Preferences.js +32 -43
- package/lib/redux/actions/Preferences.js.map +1 -1
- package/lib/redux/actions/ProgressIndicator.js +15 -23
- package/lib/redux/actions/ProgressIndicator.js.map +1 -1
- package/lib/redux/actions/SignIn.js +43 -57
- package/lib/redux/actions/SignIn.js.map +1 -1
- package/lib/redux/actions/SignOut.js +9 -17
- package/lib/redux/actions/SignOut.js.map +1 -1
- package/lib/redux/actions/__tests__/Error-server.spec.js.flow +0 -1
- package/lib/redux/actions/index.js +15 -15
- package/lib/redux/connectors/Application.js +1 -1
- package/lib/redux/connectors/Application.js.map +1 -1
- package/lib/redux/connectors/Breadcrumb.js +4 -6
- package/lib/redux/connectors/Breadcrumb.js.map +1 -1
- package/lib/redux/connectors/CaseView.js +4 -2
- package/lib/redux/connectors/CaseView.js.map +1 -1
- package/lib/redux/connectors/ConceptDetail.js +5 -3
- package/lib/redux/connectors/ConceptDetail.js.map +1 -1
- package/lib/redux/connectors/ContentBrowser.js +4 -2
- package/lib/redux/connectors/ContentBrowser.js.map +1 -1
- package/lib/redux/connectors/ContentDetail.js +5 -3
- package/lib/redux/connectors/ContentDetail.js.map +1 -1
- package/lib/redux/connectors/ContentDetailSection.js +6 -4
- package/lib/redux/connectors/ContentDetailSection.js.map +1 -1
- package/lib/redux/connectors/Form.js +10 -8
- package/lib/redux/connectors/Form.js.map +1 -1
- package/lib/redux/connectors/FormAttributeSet.js +13 -21
- package/lib/redux/connectors/FormAttributeSet.js.map +1 -1
- package/lib/redux/connectors/ListDetail.js +4 -2
- package/lib/redux/connectors/ListDetail.js.map +1 -1
- package/lib/redux/connectors/Modal.js +4 -6
- package/lib/redux/connectors/Modal.js.map +1 -1
- package/lib/redux/connectors/ModelCatalog.js +4 -2
- package/lib/redux/connectors/ModelCatalog.js.map +1 -1
- package/lib/redux/connectors/Notification.js +8 -10
- package/lib/redux/connectors/Notification.js.map +1 -1
- package/lib/redux/connectors/PanelRenderer.js +7 -6
- package/lib/redux/connectors/PanelRenderer.js.map +1 -1
- package/lib/redux/connectors/Preferences.js +6 -8
- package/lib/redux/connectors/Preferences.js.map +1 -1
- package/lib/redux/connectors/Progress.js +2 -2
- package/lib/redux/connectors/Progress.js.map +1 -1
- package/lib/redux/connectors/ProgressIndicator.js +6 -8
- package/lib/redux/connectors/ProgressIndicator.js.map +1 -1
- package/lib/redux/connectors/QuickSearch.js +5 -3
- package/lib/redux/connectors/QuickSearch.js.map +1 -1
- package/lib/redux/connectors/SignIn.js +4 -4
- package/lib/redux/connectors/SignIn.js.map +1 -1
- package/lib/redux/connectors/SignOut.js +3 -3
- package/lib/redux/connectors/SignOut.js.map +1 -1
- package/lib/redux/connectors/Tab.js +4 -2
- package/lib/redux/connectors/Tab.js.map +1 -1
- package/lib/redux/connectors/index.js +21 -21
- package/lib/redux/index.js +8 -8
- package/lib/redux/reducers/AuthReducer.js +14 -33
- package/lib/redux/reducers/AuthReducer.js.map +1 -1
- package/lib/redux/reducers/ErrorReducer.js +4 -4
- package/lib/redux/reducers/ErrorReducer.js.map +1 -1
- package/lib/redux/reducers/ModalsReducer.js +19 -45
- package/lib/redux/reducers/ModalsReducer.js.map +1 -1
- package/lib/redux/reducers/NotificationReducer.js +8 -27
- package/lib/redux/reducers/NotificationReducer.js.map +1 -1
- package/lib/redux/reducers/PreferencesReducer.js +10 -25
- package/lib/redux/reducers/PreferencesReducer.js.map +1 -1
- package/lib/redux/reducers/ProgressIndicatorReducer.js +14 -33
- package/lib/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
- package/lib/redux/reducers/createReducer.js +11 -13
- package/lib/redux/reducers/createReducer.js.map +1 -1
- package/lib/redux/reducers/index.js +7 -7
- package/lib/redux/selectors/i18n.js +2 -4
- package/lib/redux/selectors/i18n.js.map +1 -1
- package/lib/redux/selectors/index.js +1 -1
- package/lib/redux/store/beforeRenderHooks.js +5 -29
- package/lib/redux/store/beforeRenderHooks.js.map +1 -1
- package/lib/redux/store/configureStore.js +10 -24
- package/lib/redux/store/configureStore.js.map +1 -1
- package/lib/utils/browser/Cache.js +126 -161
- package/lib/utils/browser/Cache.js.map +1 -1
- package/lib/utils/browser/Cookies.js +4 -4
- package/lib/utils/browser/Cookies.js.map +1 -1
- package/lib/utils/datetime/DateTimeUtil.js +364 -418
- package/lib/utils/datetime/DateTimeUtil.js.map +1 -1
- package/lib/utils/fetch/serverFetch.js +5 -5
- package/lib/utils/fetch/serverFetch.js.map +1 -1
- package/lib/utils/fetch/universalFetch.js +13 -13
- package/lib/utils/fetch/universalFetch.js.map +1 -1
- package/lib/utils/fetch/xhr.js +281 -365
- package/lib/utils/fetch/xhr.js.map +1 -1
- package/lib/utils/helpers/checkResource.js +7 -7
- package/lib/utils/helpers/checkResource.js.map +1 -1
- package/lib/utils/helpers/createHash.js +5 -5
- package/lib/utils/helpers/createHash.js.map +1 -1
- package/lib/utils/helpers/createUUID.js +4 -4
- package/lib/utils/helpers/createUUID.js.map +1 -1
- package/lib/utils/helpers/objects.js +9 -15
- package/lib/utils/helpers/objects.js.map +1 -1
- package/lib/utils/helpers/sanitizeHtml.js +13 -13
- package/lib/utils/helpers/sanitizeHtml.js.map +1 -1
- package/lib/utils/helpers/text.js +1 -1
- package/lib/utils/helpers/text.js.map +1 -1
- package/lib/utils/index.js +15 -15
- package/lib/utils/number/DecimalFormat.js +298 -328
- package/lib/utils/number/DecimalFormat.js.map +1 -1
- package/lib/utils/number/formatValue.js +10 -17
- package/lib/utils/number/formatValue.js.map +1 -1
- package/lib/utils/number/parseNumbers.js +13 -13
- package/lib/utils/number/parseNumbers.js.map +1 -1
- package/package.json +14 -14
- package/src/constants/Settings.js +3 -0
- package/src/models/attributes/AttributeDataHelper.js +5 -1
- package/src/models/error/ErrorModel.js +9 -1
- package/src/models/error/ErrorResponse.js +102 -0
- package/src/models/types.js +1 -0
- package/src/models/user/UserServicesModel.js +1 -7
- package/src/modularui/Authenticate.js +13 -7
- package/src/redux/actions/__tests__/Error-server.spec.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xhr.js","names":["NETWORK_ERROR_CODE","SUCCESS_CODE","CLIENT_ERROR_CODE","UNAUTHORIZED_CODE","REDIRECTION_CODE","NOT_FOUND_CODE","JSON_TYPE","XHR","options","_options","_attempts","_xmlhttp","xmlhttp","attempts","url","params","aUrl","split","data","method","HTTP_METHODS","GET","timeout","getSetting","responseType","onProgress","events","baseHeaders","Accept","headers","reject","TimeoutException","responseJSON","status","isReload","NetworkException","NotFoundException","UnauthorizedException","FetchException","response","getResponseHeader","isPlainObject","JSON","parse","error","JsonParseException","resolve","getResponse","has","errorHandler","forEach","eventType","addEventListener","timeoutHandler","responseHandler","eventName","open","Cache","hasItem","withCredentials","basicToken","getItem","setRequestHeader","headerName","send","stringData","XMLHttpRequest","setEventListeners","openConnection","setBasicAuthentication","setCustomHeaders","setOtherOptions","sendData","setXMLHttpRequest","fetch","validateInputArguments","args","IllegalArgumentException","toString","xhr"],"sources":["../../../src/utils/fetch/xhr.js"],"sourcesContent":["// @flow\nimport { has, isPlainObject } from \"../helpers/objects\";\n\nimport {\n IllegalArgumentException,\n UnauthorizedException,\n FetchException,\n TimeoutException,\n NotFoundException,\n JsonParseException,\n NetworkException,\n} from \"../../exceptions\";\n\nimport Cache from \"../browser/Cache\";\n\nimport { HTTP_METHODS } from \"../../constants/Constants\";\n\nimport { getSetting } from \"../../constants/Settings\";\n\nimport type { RequestOptions } from \"./types\";\n\nconst NETWORK_ERROR_CODE = 0;\nconst SUCCESS_CODE = 200;\nconst CLIENT_ERROR_CODE = 400;\nconst UNAUTHORIZED_CODE = 401;\nconst REDIRECTION_CODE = 300;\nconst NOT_FOUND_CODE = 404;\n\nconst JSON_TYPE = \"application/json\";\n\n/**\n * @private\n */\nclass XHR {\n _options: RequestOptions;\n _xmlhttp: XMLHttpRequest;\n _attempts: number;\n\n /**\n */\n constructor(options: RequestOptions) {\n this._options = options;\n this._attempts = 0;\n }\n\n /**\n */\n get xmlhttp() {\n return this._xmlhttp;\n }\n\n /**\n */\n set xmlhttp(xmlhttp) {\n this._xmlhttp = xmlhttp;\n }\n\n /**\n */\n get options() {\n return this._options;\n }\n\n /**\n */\n set options(options: RequestOptions) {\n this._options = options;\n }\n\n /**\n */\n get attempts() {\n return this._attempts;\n }\n\n /**\n */\n set attempts(attempts) {\n this._attempts = attempts;\n }\n\n /**\n * Create and fix url when params or both querystring and params exist.\n */\n get url() {\n const { url } = this.options;\n if (this.params !== \"\") {\n if (url.includes(\"?\")) {\n const aUrl = url.split(\"?\");\n\n return `${aUrl[0]}?${aUrl[1]}&${this.params}`;\n }\n\n return `${url}?${this.params}`;\n }\n\n return url;\n }\n\n /**\n */\n get params() {\n return this.options.params || \"\";\n }\n\n /**\n */\n get data() {\n return this.options.data || null;\n }\n\n /**\n */\n get method() {\n return this.options.method || HTTP_METHODS.GET;\n }\n\n /**\n */\n get timeout() {\n return this.options.timeout || getSetting(\"XHR_TIMEOUT_MS\", 300000);\n }\n\n /**\n */\n get responseType() {\n return this.options.responseType || \"json\";\n }\n\n /**\n */\n get onProgress(): ProgressEventHandler {\n if (this.options.onProgress) {\n return this.options.onProgress;\n }\n\n return () => {\n // do nothing\n };\n }\n\n /**\n */\n get events() {\n return this.options.events || {};\n }\n\n /**\n */\n get headers() {\n const baseHeaders = {\n Accept: JSON_TYPE,\n \"Content-Type\": JSON_TYPE,\n\n // needed for csrf, see: https://plaza.beinformed.com/amdoc/csrf-protection-in-modular-ui-services-40054554.html\n \"X-Requested-With\": \"XMLHttpRequest\",\n\n \"Accept-Language\": \"en\",\n };\n\n if (this.options.headers) {\n // $FlowFixMe[cannot-spread-indexer]\n return {\n ...baseHeaders,\n ...this.options.headers,\n };\n }\n\n return baseHeaders;\n }\n\n /**\n */\n timeoutHandler(reject) {\n return reject(new TimeoutException(this.url, this.method));\n }\n\n /**\n */\n errorHandler(reject, responseJSON = null) {\n const { status } = this.xmlhttp;\n const { isReload } = this.options;\n\n if (status === NETWORK_ERROR_CODE) {\n return reject(new NetworkException(this.url, this.method));\n }\n\n if (status === NOT_FOUND_CODE) {\n return reject(new NotFoundException(this.url, this.method, isReload));\n }\n\n if (status === UNAUTHORIZED_CODE) {\n return reject(\n new UnauthorizedException(this.url, this.method, responseJSON)\n );\n }\n\n return reject(new FetchException(responseJSON, this.xmlhttp, this.options));\n }\n\n /**\n */\n getResponse() {\n const { responseType, response } = this.xmlhttp;\n\n if (\n (responseType === \"\" || responseType === \"text\") &&\n this.getResponseHeader(\"Content-Type\") === JSON_TYPE\n ) {\n if (isPlainObject(response)) {\n return response;\n }\n\n try {\n return JSON.parse(response);\n } catch (error) {\n throw new JsonParseException(error);\n }\n }\n\n return response;\n }\n\n /**\n */\n responseHandler(resolve, reject) {\n const { status } = this.xmlhttp;\n\n let response = null;\n try {\n response = this.getResponse();\n } catch (error) {\n return reject(error);\n }\n\n if (\n (status >= SUCCESS_CODE && status < REDIRECTION_CODE) ||\n (status === CLIENT_ERROR_CODE && has(response, \"formresponse\"))\n ) {\n return resolve(response);\n }\n\n return this.errorHandler(reject, response);\n }\n\n /**\n */\n setEventListeners(resolve, reject) {\n if (this.options.onProgress) {\n [\"load\", \"loadend\", \"loadstart\", \"progress\"].forEach((eventType) => {\n this.xmlhttp.addEventListener(eventType, this.onProgress);\n });\n }\n\n [\"abort\", \"error\"].forEach((eventType) => {\n this.xmlhttp.addEventListener(eventType, () => this.errorHandler(reject));\n });\n\n this.xmlhttp.addEventListener(\"timeout\", () => this.timeoutHandler(reject));\n\n this.xmlhttp.addEventListener(\"load\", () =>\n this.responseHandler(resolve, reject)\n );\n\n // Set custom events\n Object.keys(this.events).forEach((eventName) => {\n this.xmlhttp.addEventListener(eventName, this.events[eventName]);\n });\n }\n\n /**\n */\n openConnection() {\n this.xmlhttp.open(this.method, this.url, true);\n }\n\n /**\n */\n setBasicAuthentication() {\n if (Cache.hasItem(\"basic\")) {\n this.xmlhttp.withCredentials = true;\n const basicToken = Cache.getItem(\"basic\");\n\n if (typeof basicToken === \"string\") {\n this.xmlhttp.setRequestHeader(\"Authorization\", `Basic ${basicToken}`);\n }\n }\n }\n\n /**\n */\n getResponseHeader(headerName) {\n return this.xmlhttp.getResponseHeader(headerName);\n }\n\n /**\n */\n setCustomHeaders() {\n Object.keys(this.headers).forEach((headerName) => {\n this.xmlhttp.setRequestHeader(headerName, this.headers[headerName]);\n });\n }\n\n /**\n */\n setOtherOptions() {\n this.xmlhttp.responseType = this.responseType;\n this.xmlhttp.timeout = this.timeout;\n }\n\n /**\n */\n sendData() {\n if (this.data == null) {\n this.xmlhttp.send();\n } else {\n const stringData = isPlainObject(this.data)\n ? JSON.stringify(this.data)\n : this.data;\n this.xmlhttp.send(stringData);\n }\n }\n\n /**\n */\n setXMLHttpRequest() {\n return new Promise((resolve, reject) => {\n this.xmlhttp = new XMLHttpRequest();\n\n this.setEventListeners(resolve, reject);\n\n this.openConnection();\n\n this.setBasicAuthentication();\n\n this.setCustomHeaders();\n\n this.setOtherOptions();\n\n this.sendData();\n });\n }\n\n /**\n */\n async fetch() {\n try {\n return await this.setXMLHttpRequest();\n } catch (err) {\n if (err instanceof NetworkException && this.attempts < 2) {\n this.attempts += 1;\n return this.fetch();\n }\n\n throw err;\n }\n }\n}\n\n/**\n */\nconst validateInputArguments = (args: RequestOptions) => {\n if (args == null) {\n throw new IllegalArgumentException(\n \"Missing request options, expecting an object as argument for xhr\"\n );\n }\n\n if (!isPlainObject(args)) {\n throw new IllegalArgumentException(\n `Expecting an object as argument for xhr, but received: ${args.toString()}`\n );\n }\n\n if (!has(args, \"url\")) {\n throw new IllegalArgumentException(\n `No url property found in arguments of xhr, received: ${JSON.stringify(\n args\n )}`\n );\n }\n\n return true;\n};\n\n/**\n */\nconst xhr = (args: RequestOptions): Promise<any> => {\n validateInputArguments(args);\n\n return new XHR(args).fetch();\n};\n\nexport default xhr;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AAEA;;AAUA;;AAEA;;AAEA;;;;;;AAIA,IAAMA,kBAAkB,GAAG,CAA3B;AACA,IAAMC,YAAY,GAAG,GAArB;AACA,IAAMC,iBAAiB,GAAG,GAA1B;AACA,IAAMC,iBAAiB,GAAG,GAA1B;AACA,IAAMC,gBAAgB,GAAG,GAAzB;AACA,IAAMC,cAAc,GAAG,GAAvB;AAEA,IAAMC,SAAS,GAAG,kBAAlB;AAEA;AACA;AACA;;IACMC,G;EAKJ;AACF;EACE,aAAYC,OAAZ,EAAqC;IAAA;IAAA;IAAA;IAAA;IACnC,KAAKC,QAAL,GAAgBD,OAAhB;IACA,KAAKE,SAAL,GAAiB,CAAjB;EACD;EAED;AACF;;;;;SACE,eAAc;MACZ,OAAO,KAAKC,QAAZ;IACD;IAED;AACF;;SACE,aAAYC,OAAZ,EAAqB;MACnB,KAAKD,QAAL,GAAgBC,OAAhB;IACD;IAED;AACF;;;;SACE,eAAc;MACZ,OAAO,KAAKH,QAAZ;IACD;IAED;AACF;;SACE,aAAYD,OAAZ,EAAqC;MACnC,KAAKC,QAAL,GAAgBD,OAAhB;IACD;IAED;AACF;;;;SACE,eAAe;MACb,OAAO,KAAKE,SAAZ;IACD;IAED;AACF;;SACE,aAAaG,QAAb,EAAuB;MACrB,KAAKH,SAAL,GAAiBG,QAAjB;IACD;IAED;AACF;AACA;;;;SACE,eAAU;MACR,IAAQC,GAAR,GAAgB,KAAKN,OAArB,CAAQM,GAAR;;MACA,IAAI,KAAKC,MAAL,KAAgB,EAApB,EAAwB;QAAA;;QACtB,IAAI,uBAAAD,GAAG,MAAH,CAAAA,GAAG,EAAU,GAAV,CAAP,EAAuB;UAAA;;UACrB,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,SAAzBA,sBAAyB,CAACC,IAAD,EAA0B;EACvD,IAAIA,IAAI,IAAI,IAAZ,EAAkB;IAChB,MAAM,IAAIC,oCAAJ,CACJ,kEADI,CAAN;EAGD;;EAED,IAAI,CAAC,IAAApC,sBAAA,EAAcmC,IAAd,CAAL,EAA0B;IACxB,MAAM,IAAIC,oCAAJ,kEACsDD,IAAI,CAACE,QAAL,EADtD,EAAN;EAGD;;EAED,IAAI,CAAC,IAAA9B,YAAA,EAAI4B,IAAJ,EAAU,KAAV,CAAL,EAAuB;IACrB,MAAM,IAAIC,oCAAJ,gEACoD,wBACtDD,IADsD,CADpD,EAAN;EAKD;;EAED,OAAO,IAAP;AACD,CAtBD;AAwBA;AACA;;;AACA,IAAMG,GAAG,GAAG,SAANA,GAAM,CAACH,IAAD,EAAwC;EAClDD,sBAAsB,CAACC,IAAD,CAAtB;EAEA,OAAO,IAAIrE,GAAJ,CAAQqE,IAAR,EAAcF,KAAd,EAAP;AACD,CAJD;;eAMeK,G"}
|
|
1
|
+
{"version":3,"file":"xhr.js","names":["NETWORK_ERROR_CODE","SUCCESS_CODE","CLIENT_ERROR_CODE","UNAUTHORIZED_CODE","REDIRECTION_CODE","NOT_FOUND_CODE","JSON_TYPE","XHR","constructor","options","_options","_attempts","xmlhttp","_xmlhttp","attempts","url","params","aUrl","split","data","method","HTTP_METHODS","GET","timeout","getSetting","responseType","onProgress","events","headers","baseHeaders","Accept","timeoutHandler","reject","TimeoutException","errorHandler","responseJSON","status","isReload","NetworkException","NotFoundException","UnauthorizedException","FetchException","getResponse","response","getResponseHeader","isPlainObject","JSON","parse","error","JsonParseException","responseHandler","resolve","has","setEventListeners","forEach","eventType","addEventListener","eventName","openConnection","open","setBasicAuthentication","Cache","hasItem","withCredentials","basicToken","getItem","setRequestHeader","headerName","setCustomHeaders","setOtherOptions","sendData","send","stringData","setXMLHttpRequest","XMLHttpRequest","fetch","err","validateInputArguments","args","IllegalArgumentException","toString","xhr"],"sources":["../../../src/utils/fetch/xhr.js"],"sourcesContent":["// @flow\nimport { has, isPlainObject } from \"../helpers/objects\";\n\nimport {\n IllegalArgumentException,\n UnauthorizedException,\n FetchException,\n TimeoutException,\n NotFoundException,\n JsonParseException,\n NetworkException,\n} from \"../../exceptions\";\n\nimport Cache from \"../browser/Cache\";\n\nimport { HTTP_METHODS } from \"../../constants/Constants\";\n\nimport { getSetting } from \"../../constants/Settings\";\n\nimport type { RequestOptions } from \"./types\";\n\nconst NETWORK_ERROR_CODE = 0;\nconst SUCCESS_CODE = 200;\nconst CLIENT_ERROR_CODE = 400;\nconst UNAUTHORIZED_CODE = 401;\nconst REDIRECTION_CODE = 300;\nconst NOT_FOUND_CODE = 404;\n\nconst JSON_TYPE = \"application/json\";\n\n/**\n * @private\n */\nclass XHR {\n _options: RequestOptions;\n _xmlhttp: XMLHttpRequest;\n _attempts: number;\n\n /**\n */\n constructor(options: RequestOptions) {\n this._options = options;\n this._attempts = 0;\n }\n\n /**\n */\n get xmlhttp() {\n return this._xmlhttp;\n }\n\n /**\n */\n set xmlhttp(xmlhttp) {\n this._xmlhttp = xmlhttp;\n }\n\n /**\n */\n get options() {\n return this._options;\n }\n\n /**\n */\n set options(options: RequestOptions) {\n this._options = options;\n }\n\n /**\n */\n get attempts() {\n return this._attempts;\n }\n\n /**\n */\n set attempts(attempts) {\n this._attempts = attempts;\n }\n\n /**\n * Create and fix url when params or both querystring and params exist.\n */\n get url() {\n const { url } = this.options;\n if (this.params !== \"\") {\n if (url.includes(\"?\")) {\n const aUrl = url.split(\"?\");\n\n return `${aUrl[0]}?${aUrl[1]}&${this.params}`;\n }\n\n return `${url}?${this.params}`;\n }\n\n return url;\n }\n\n /**\n */\n get params() {\n return this.options.params || \"\";\n }\n\n /**\n */\n get data() {\n return this.options.data || null;\n }\n\n /**\n */\n get method() {\n return this.options.method || HTTP_METHODS.GET;\n }\n\n /**\n */\n get timeout() {\n return this.options.timeout || getSetting(\"XHR_TIMEOUT_MS\", 300000);\n }\n\n /**\n */\n get responseType() {\n return this.options.responseType || \"json\";\n }\n\n /**\n */\n get onProgress(): ProgressEventHandler {\n if (this.options.onProgress) {\n return this.options.onProgress;\n }\n\n return () => {\n // do nothing\n };\n }\n\n /**\n */\n get events() {\n return this.options.events || {};\n }\n\n /**\n */\n get headers() {\n const baseHeaders = {\n Accept: JSON_TYPE,\n \"Content-Type\": JSON_TYPE,\n\n // needed for csrf, see: https://plaza.beinformed.com/amdoc/csrf-protection-in-modular-ui-services-40054554.html\n \"X-Requested-With\": \"XMLHttpRequest\",\n\n \"Accept-Language\": \"en\",\n };\n\n if (this.options.headers) {\n // $FlowFixMe[cannot-spread-indexer]\n return {\n ...baseHeaders,\n ...this.options.headers,\n };\n }\n\n return baseHeaders;\n }\n\n /**\n */\n timeoutHandler(reject) {\n return reject(new TimeoutException(this.url, this.method));\n }\n\n /**\n */\n errorHandler(reject, responseJSON = null) {\n const { status } = this.xmlhttp;\n const { isReload } = this.options;\n\n if (status === NETWORK_ERROR_CODE) {\n return reject(new NetworkException(this.url, this.method));\n }\n\n if (status === NOT_FOUND_CODE) {\n return reject(new NotFoundException(this.url, this.method, isReload));\n }\n\n if (status === UNAUTHORIZED_CODE) {\n return reject(\n new UnauthorizedException(this.url, this.method, responseJSON)\n );\n }\n\n return reject(new FetchException(responseJSON, this.xmlhttp, this.options));\n }\n\n /**\n */\n getResponse() {\n const { responseType, response } = this.xmlhttp;\n\n if (\n (responseType === \"\" || responseType === \"text\") &&\n this.getResponseHeader(\"Content-Type\") === JSON_TYPE\n ) {\n if (isPlainObject(response)) {\n return response;\n }\n\n try {\n return JSON.parse(response);\n } catch (error) {\n throw new JsonParseException(error);\n }\n }\n\n return response;\n }\n\n /**\n */\n responseHandler(resolve, reject) {\n const { status } = this.xmlhttp;\n\n let response = null;\n try {\n response = this.getResponse();\n } catch (error) {\n return reject(error);\n }\n\n if (\n (status >= SUCCESS_CODE && status < REDIRECTION_CODE) ||\n (status === CLIENT_ERROR_CODE && has(response, \"formresponse\"))\n ) {\n return resolve(response);\n }\n\n return this.errorHandler(reject, response);\n }\n\n /**\n */\n setEventListeners(resolve, reject) {\n if (this.options.onProgress) {\n [\"load\", \"loadend\", \"loadstart\", \"progress\"].forEach((eventType) => {\n this.xmlhttp.addEventListener(eventType, this.onProgress);\n });\n }\n\n [\"abort\", \"error\"].forEach((eventType) => {\n this.xmlhttp.addEventListener(eventType, () => this.errorHandler(reject));\n });\n\n this.xmlhttp.addEventListener(\"timeout\", () => this.timeoutHandler(reject));\n\n this.xmlhttp.addEventListener(\"load\", () =>\n this.responseHandler(resolve, reject)\n );\n\n // Set custom events\n Object.keys(this.events).forEach((eventName) => {\n this.xmlhttp.addEventListener(eventName, this.events[eventName]);\n });\n }\n\n /**\n */\n openConnection() {\n this.xmlhttp.open(this.method, this.url, true);\n }\n\n /**\n */\n setBasicAuthentication() {\n if (Cache.hasItem(\"basic\")) {\n this.xmlhttp.withCredentials = true;\n const basicToken = Cache.getItem(\"basic\");\n\n if (typeof basicToken === \"string\") {\n this.xmlhttp.setRequestHeader(\"Authorization\", `Basic ${basicToken}`);\n }\n }\n }\n\n /**\n */\n getResponseHeader(headerName) {\n return this.xmlhttp.getResponseHeader(headerName);\n }\n\n /**\n */\n setCustomHeaders() {\n Object.keys(this.headers).forEach((headerName) => {\n this.xmlhttp.setRequestHeader(headerName, this.headers[headerName]);\n });\n }\n\n /**\n */\n setOtherOptions() {\n this.xmlhttp.responseType = this.responseType;\n this.xmlhttp.timeout = this.timeout;\n }\n\n /**\n */\n sendData() {\n if (this.data == null) {\n this.xmlhttp.send();\n } else {\n const stringData = isPlainObject(this.data)\n ? JSON.stringify(this.data)\n : this.data;\n this.xmlhttp.send(stringData);\n }\n }\n\n /**\n */\n setXMLHttpRequest() {\n return new Promise((resolve, reject) => {\n this.xmlhttp = new XMLHttpRequest();\n\n this.setEventListeners(resolve, reject);\n\n this.openConnection();\n\n this.setBasicAuthentication();\n\n this.setCustomHeaders();\n\n this.setOtherOptions();\n\n this.sendData();\n });\n }\n\n /**\n */\n async fetch() {\n try {\n return await this.setXMLHttpRequest();\n } catch (err) {\n if (err instanceof NetworkException && this.attempts < 2) {\n this.attempts += 1;\n return this.fetch();\n }\n\n throw err;\n }\n }\n}\n\n/**\n */\nconst validateInputArguments = (args: RequestOptions) => {\n if (args == null) {\n throw new IllegalArgumentException(\n \"Missing request options, expecting an object as argument for xhr\"\n );\n }\n\n if (!isPlainObject(args)) {\n throw new IllegalArgumentException(\n `Expecting an object as argument for xhr, but received: ${args.toString()}`\n );\n }\n\n if (!has(args, \"url\")) {\n throw new IllegalArgumentException(\n `No url property found in arguments of xhr, received: ${JSON.stringify(\n args\n )}`\n );\n }\n\n return true;\n};\n\n/**\n */\nconst xhr = (args: RequestOptions): Promise<any> => {\n validateInputArguments(args);\n\n return new XHR(args).fetch();\n};\n\nexport default xhr;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA;;AAEA;;AAUA;;AAEA;;AAEA;;AAIA,MAAMA,kBAAkB,GAAG,CAA3B;AACA,MAAMC,YAAY,GAAG,GAArB;AACA,MAAMC,iBAAiB,GAAG,GAA1B;AACA,MAAMC,iBAAiB,GAAG,GAA1B;AACA,MAAMC,gBAAgB,GAAG,GAAzB;AACA,MAAMC,cAAc,GAAG,GAAvB;AAEA,MAAMC,SAAS,GAAG,kBAAlB;AAEA;AACA;AACA;;AACA,MAAMC,GAAN,CAAU;EAKR;AACF;EACEC,WAAW,CAACC,OAAD,EAA0B;IAAA;IAAA;IAAA;IACnC,KAAKC,QAAL,GAAgBD,OAAhB;IACA,KAAKE,SAAL,GAAiB,CAAjB;EACD;EAED;AACF;;;EACa,IAAPC,OAAO,GAAG;IACZ,OAAO,KAAKC,QAAZ;EACD;EAED;AACF;;;EACa,IAAPD,OAAO,CAACA,OAAD,EAAU;IACnB,KAAKC,QAAL,GAAgBD,OAAhB;EACD;EAED;AACF;;;EACa,IAAPH,OAAO,GAAG;IACZ,OAAO,KAAKC,QAAZ;EACD;EAED;AACF;;;E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G;IACZ,IAAI;MACF,OAAO,MAAM,KAAKF,iBAAL,EAAb;IACD,CAFD,CAEE,OAAOG,GAAP,EAAY;MACZ,IAAIA,GAAG,YAAYtC,4BAAf,IAAmC,KAAKxB,QAAL,GAAgB,CAAvD,EAA0D;QACxD,KAAKA,QAAL,IAAiB,CAAjB;QACA,OAAO,KAAK6D,KAAL,EAAP;MACD;;MAED,MAAMC,GAAN;IACD;EACF;;AAnUO;AAsUV;AACA;;;AACA,MAAMC,sBAAsB,GAAIC,IAAD,IAA0B;EACvD,IAAIA,IAAI,IAAI,IAAZ,EAAkB;IAChB,MAAM,IAAIC,oCAAJ,CACJ,kEADI,CAAN;EAGD;;EAED,IAAI,CAAC,IAAAlC,sBAAA,EAAciC,IAAd,CAAL,EAA0B;IACxB,MAAM,IAAIC,oCAAJ,kEACsDD,IAAI,CAACE,QAAL,EADtD,EAAN;EAGD;;EAED,IAAI,CAAC,IAAA5B,YAAA,EAAI0B,IAAJ,EAAU,KAAV,CAAL,EAAuB;IACrB,MAAM,IAAIC,oCAAJ,gEACoD,wBACtDD,IADsD,CADpD,EAAN;EAKD;;EAED,OAAO,IAAP;AACD,CAtBD;AAwBA;AACA;;;AACA,MAAMG,GAAG,GAAIH,IAAD,IAAwC;EAClDD,sBAAsB,CAACC,IAAD,CAAtB;EAEA,OAAO,IAAIvE,GAAJ,CAAQuE,IAAR,EAAcH,KAAd,EAAP;AACD,CAJD;;eAMeM,G"}
|
|
@@ -18,10 +18,10 @@ var _Href = _interopRequireDefault(require("../../models/href/Href"));
|
|
|
18
18
|
* @param url
|
|
19
19
|
* @returns {boolean}
|
|
20
20
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
const resourceExists = url => {
|
|
22
|
+
const fullUrl = new _Href.default(url).absolutehref; // const fullUrl = `${BASE}/${url}`.replace(/\/\//g, "/");
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
const xhr = new XMLHttpRequest();
|
|
25
25
|
xhr.open("HEAD", fullUrl, false);
|
|
26
26
|
xhr.setRequestHeader("Accept", "application/json");
|
|
27
27
|
xhr.setRequestHeader("Content-Type", "application/json");
|
|
@@ -38,17 +38,17 @@ var resourceExists = function resourceExists(url) {
|
|
|
38
38
|
|
|
39
39
|
exports.resourceExists = resourceExists;
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
const resourceRedirectsToSecureLogin = url => {
|
|
42
42
|
var _xhr$responseURL;
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
const fullUrl = new _Href.default(url).absolutehref;
|
|
45
|
+
const xhr = new XMLHttpRequest();
|
|
46
46
|
xhr.open("HEAD", fullUrl, false);
|
|
47
47
|
xhr.setRequestHeader("Accept", "application/json");
|
|
48
48
|
xhr.setRequestHeader("Content-Type", "application/json");
|
|
49
49
|
xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
|
|
50
50
|
xhr.send();
|
|
51
|
-
|
|
51
|
+
const responseURL = (_xhr$responseURL = xhr.responseURL) !== null && _xhr$responseURL !== void 0 ? _xhr$responseURL : "";
|
|
52
52
|
return xhr.status === 400 && (0, _endsWith.default)(responseURL).call(responseURL, "/secureLogin");
|
|
53
53
|
};
|
|
54
54
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkResource.js","names":["resourceExists","url","fullUrl","Href","absolutehref","xhr","XMLHttpRequest","open","setRequestHeader","send","status","resourceRedirectsToSecureLogin","responseURL"],"sources":["../../../src/utils/helpers/checkResource.js"],"sourcesContent":["// @flow\nimport Href from \"../../models/href/Href\";\n\n/**\n * Checks if a given url to a modular ui resource exists using a HEAD request to the resource (synchronous)\n * When the resource returns a 404, the resource does not exists and the method returns false\n *\n * @param url\n * @returns {boolean}\n */\nexport const resourceExists = (url: string | Href): boolean => {\n const fullUrl = new Href(url).absolutehref;\n\n // const fullUrl = `${BASE}/${url}`.replace(/\\/\\//g, \"/\");\n\n const xhr = new XMLHttpRequest();\n xhr.open(\"HEAD\", fullUrl, false);\n xhr.setRequestHeader(\"Accept\", \"application/json\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n\n xhr.send();\n\n return xhr.status !== 404;\n};\n\n/**\n * Indicates if a request to the given url resuls in a redirect to /secureRedirect\n * @param url\n * @returns {boolean}\n */\nexport const resourceRedirectsToSecureLogin = (url: string | Href): boolean => {\n const fullUrl = new Href(url).absolutehref;\n\n const xhr = new XMLHttpRequest();\n xhr.open(\"HEAD\", fullUrl, false);\n xhr.setRequestHeader(\"Accept\", \"application/json\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n xhr.send();\n\n const responseURL = xhr.responseURL ?? \"\";\n\n return xhr.status === 400 && responseURL.endsWith(\"/secureLogin\");\n};\n"],"mappings":";;;;;;;;;;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,
|
|
1
|
+
{"version":3,"file":"checkResource.js","names":["resourceExists","url","fullUrl","Href","absolutehref","xhr","XMLHttpRequest","open","setRequestHeader","send","status","resourceRedirectsToSecureLogin","responseURL"],"sources":["../../../src/utils/helpers/checkResource.js"],"sourcesContent":["// @flow\nimport Href from \"../../models/href/Href\";\n\n/**\n * Checks if a given url to a modular ui resource exists using a HEAD request to the resource (synchronous)\n * When the resource returns a 404, the resource does not exists and the method returns false\n *\n * @param url\n * @returns {boolean}\n */\nexport const resourceExists = (url: string | Href): boolean => {\n const fullUrl = new Href(url).absolutehref;\n\n // const fullUrl = `${BASE}/${url}`.replace(/\\/\\//g, \"/\");\n\n const xhr = new XMLHttpRequest();\n xhr.open(\"HEAD\", fullUrl, false);\n xhr.setRequestHeader(\"Accept\", \"application/json\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n\n xhr.send();\n\n return xhr.status !== 404;\n};\n\n/**\n * Indicates if a request to the given url resuls in a redirect to /secureRedirect\n * @param url\n * @returns {boolean}\n */\nexport const resourceRedirectsToSecureLogin = (url: string | Href): boolean => {\n const fullUrl = new Href(url).absolutehref;\n\n const xhr = new XMLHttpRequest();\n xhr.open(\"HEAD\", fullUrl, false);\n xhr.setRequestHeader(\"Accept\", \"application/json\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n xhr.send();\n\n const responseURL = xhr.responseURL ?? \"\";\n\n return xhr.status === 400 && responseURL.endsWith(\"/secureLogin\");\n};\n"],"mappings":";;;;;;;;;;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,cAAc,GAAIC,GAAD,IAAiC;EAC7D,MAAMC,OAAO,GAAG,IAAIC,aAAJ,CAASF,GAAT,EAAcG,YAA9B,CAD6D,CAG7D;;EAEA,MAAMC,GAAG,GAAG,IAAIC,cAAJ,EAAZ;EACAD,GAAG,CAACE,IAAJ,CAAS,MAAT,EAAiBL,OAAjB,EAA0B,KAA1B;EACAG,GAAG,CAACG,gBAAJ,CAAqB,QAArB,EAA+B,kBAA/B;EACAH,GAAG,CAACG,gBAAJ,CAAqB,cAArB,EAAqC,kBAArC;EACAH,GAAG,CAACG,gBAAJ,CAAqB,kBAArB,EAAyC,gBAAzC;EAEAH,GAAG,CAACI,IAAJ;EAEA,OAAOJ,GAAG,CAACK,MAAJ,KAAe,GAAtB;AACD,CAdM;AAgBP;AACA;AACA;AACA;AACA;;;;;AACO,MAAMC,8BAA8B,GAAIV,GAAD,IAAiC;EAAA;;EAC7E,MAAMC,OAAO,GAAG,IAAIC,aAAJ,CAASF,GAAT,EAAcG,YAA9B;EAEA,MAAMC,GAAG,GAAG,IAAIC,cAAJ,EAAZ;EACAD,GAAG,CAACE,IAAJ,CAAS,MAAT,EAAiBL,OAAjB,EAA0B,KAA1B;EACAG,GAAG,CAACG,gBAAJ,CAAqB,QAArB,EAA+B,kBAA/B;EACAH,GAAG,CAACG,gBAAJ,CAAqB,cAArB,EAAqC,kBAArC;EACAH,GAAG,CAACG,gBAAJ,CAAqB,kBAArB,EAAyC,gBAAzC;EACAH,GAAG,CAACI,IAAJ;EAEA,MAAMG,WAAW,uBAAGP,GAAG,CAACO,WAAP,+DAAsB,EAAvC;EAEA,OAAOP,GAAG,CAACK,MAAJ,KAAe,GAAf,IAAsB,uBAAAE,WAAW,MAAX,CAAAA,WAAW,EAAU,cAAV,CAAxC;AACD,CAbM"}
|
|
@@ -8,11 +8,11 @@ exports.createHashFromHref = exports.createHash = void 0;
|
|
|
8
8
|
/**
|
|
9
9
|
* https://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
const createHash = str => {
|
|
12
12
|
if (!str) return 0;
|
|
13
|
-
|
|
13
|
+
let hash = 0;
|
|
14
14
|
|
|
15
|
-
for (
|
|
15
|
+
for (let i = 0; i < str.length; i++) {
|
|
16
16
|
hash = (hash << 5) - hash + str.charCodeAt(i);
|
|
17
17
|
hash = hash & hash;
|
|
18
18
|
}
|
|
@@ -25,8 +25,8 @@ var createHash = function createHash(str) {
|
|
|
25
25
|
|
|
26
26
|
exports.createHash = createHash;
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
const createHashFromHref = href => {
|
|
29
|
+
const hrefString = href.hash ? [href.toString(), href.hash].join("#") : href.toString();
|
|
30
30
|
return createHash(hrefString);
|
|
31
31
|
};
|
|
32
32
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createHash.js","names":["createHash","str","hash","i","length","charCodeAt","createHashFromHref","href","hrefString","toString","join"],"sources":["../../../src/utils/helpers/createHash.js"],"sourcesContent":["// @flow\nimport type Href from \"../../models/href/Href\";\n\n/**\n * https://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/\n */\nconst createHash = (str: string): number => {\n if (!str) return 0;\n\n let hash = 0;\n for (let i = 0; i < str.length; i++) {\n hash = (hash << 5) - hash + str.charCodeAt(i);\n hash = hash & hash;\n }\n return hash;\n};\n\n/**\n */\nconst createHashFromHref = (href: Href): number => {\n const hrefString = href.hash\n ? [href.toString(), href.hash].join(\"#\")\n : href.toString();\n\n return createHash(hrefString);\n};\n\nexport { createHash, createHashFromHref };\n"],"mappings":";;;;;;;AAGA;AACA;AACA;AACA,
|
|
1
|
+
{"version":3,"file":"createHash.js","names":["createHash","str","hash","i","length","charCodeAt","createHashFromHref","href","hrefString","toString","join"],"sources":["../../../src/utils/helpers/createHash.js"],"sourcesContent":["// @flow\nimport type Href from \"../../models/href/Href\";\n\n/**\n * https://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/\n */\nconst createHash = (str: string): number => {\n if (!str) return 0;\n\n let hash = 0;\n for (let i = 0; i < str.length; i++) {\n hash = (hash << 5) - hash + str.charCodeAt(i);\n hash = hash & hash;\n }\n return hash;\n};\n\n/**\n */\nconst createHashFromHref = (href: Href): number => {\n const hrefString = href.hash\n ? [href.toString(), href.hash].join(\"#\")\n : href.toString();\n\n return createHash(hrefString);\n};\n\nexport { createHash, createHashFromHref };\n"],"mappings":";;;;;;;AAGA;AACA;AACA;AACA,MAAMA,UAAU,GAAIC,GAAD,IAAyB;EAC1C,IAAI,CAACA,GAAL,EAAU,OAAO,CAAP;EAEV,IAAIC,IAAI,GAAG,CAAX;;EACA,KAAK,IAAIC,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGF,GAAG,CAACG,MAAxB,EAAgCD,CAAC,EAAjC,EAAqC;IACnCD,IAAI,GAAG,CAACA,IAAI,IAAI,CAAT,IAAcA,IAAd,GAAqBD,GAAG,CAACI,UAAJ,CAAeF,CAAf,CAA5B;IACAD,IAAI,GAAGA,IAAI,GAAGA,IAAd;EACD;;EACD,OAAOA,IAAP;AACD,CATD;AAWA;AACA;;;;;AACA,MAAMI,kBAAkB,GAAIC,IAAD,IAAwB;EACjD,MAAMC,UAAU,GAAGD,IAAI,CAACL,IAAL,GACf,CAACK,IAAI,CAACE,QAAL,EAAD,EAAkBF,IAAI,CAACL,IAAvB,EAA6BQ,IAA7B,CAAkC,GAAlC,CADe,GAEfH,IAAI,CAACE,QAAL,EAFJ;EAIA,OAAOT,UAAU,CAACQ,UAAD,CAAjB;AACD,CAND"}
|
|
@@ -7,10 +7,10 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,
|
|
13
|
-
|
|
10
|
+
const createUUID = () => {
|
|
11
|
+
let d = new Date().getTime();
|
|
12
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, c => {
|
|
13
|
+
const r = (d + Math.random() * 16) % 16 | 0;
|
|
14
14
|
d = Math.floor(d / 16);
|
|
15
15
|
return (c === "x" ? r : r & 0x3 | 0x8).toString(16);
|
|
16
16
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createUUID.js","names":["createUUID","d","Date","getTime","replace","c","r","Math","random","floor","toString"],"sources":["../../../src/utils/helpers/createUUID.js"],"sourcesContent":["// @flow\n/**\n */\nconst createUUID = (): string => {\n let d = new Date().getTime();\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, (c) => {\n const r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c === \"x\" ? r : (r & 0x3) | 0x8).toString(16);\n });\n};\n\nexport default createUUID;\n"],"mappings":";;;;;;;AACA;AACA;AACA,
|
|
1
|
+
{"version":3,"file":"createUUID.js","names":["createUUID","d","Date","getTime","replace","c","r","Math","random","floor","toString"],"sources":["../../../src/utils/helpers/createUUID.js"],"sourcesContent":["// @flow\n/**\n */\nconst createUUID = (): string => {\n let d = new Date().getTime();\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, (c) => {\n const r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c === \"x\" ? r : (r & 0x3) | 0x8).toString(16);\n });\n};\n\nexport default createUUID;\n"],"mappings":";;;;;;;AACA;AACA;AACA,MAAMA,UAAU,GAAG,MAAc;EAC/B,IAAIC,CAAC,GAAG,IAAIC,IAAJ,GAAWC,OAAX,EAAR;EACA,OAAO,uCAAuCC,OAAvC,CAA+C,OAA/C,EAAyDC,CAAD,IAAO;IACpE,MAAMC,CAAC,GAAG,CAACL,CAAC,GAAGM,IAAI,CAACC,MAAL,KAAgB,EAArB,IAA2B,EAA3B,GAAgC,CAA1C;IACAP,CAAC,GAAGM,IAAI,CAACE,KAAL,CAAWR,CAAC,GAAG,EAAf,CAAJ;IACA,OAAO,CAACI,CAAC,KAAK,GAAN,GAAYC,CAAZ,GAAiBA,CAAC,GAAG,GAAL,GAAY,GAA7B,EAAkCI,QAAlC,CAA2C,EAA3C,CAAP;EACD,CAJM,CAAP;AAKD,CAPD;;eASeV,U"}
|
|
@@ -7,24 +7,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.isPlainObject = exports.has = exports.get = void 0;
|
|
9
9
|
|
|
10
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/typeof"));
|
|
11
|
-
|
|
12
10
|
var _has2 = _interopRequireDefault(require("lodash/has"));
|
|
13
11
|
|
|
14
12
|
var _isPlainObject2 = _interopRequireDefault(require("lodash/isPlainObject"));
|
|
15
13
|
|
|
16
14
|
/**
|
|
17
15
|
*/
|
|
18
|
-
|
|
19
|
-
return (0, _isPlainObject2.default)(value);
|
|
20
|
-
};
|
|
16
|
+
const isPlainObject = value => (0, _isPlainObject2.default)(value);
|
|
21
17
|
/**
|
|
22
18
|
*/
|
|
23
19
|
|
|
24
20
|
|
|
25
21
|
exports.isPlainObject = isPlainObject;
|
|
26
22
|
|
|
27
|
-
|
|
23
|
+
const has = (obj, propName) => {
|
|
28
24
|
if (!isPlainObject(obj)) {
|
|
29
25
|
return false;
|
|
30
26
|
}
|
|
@@ -39,17 +35,15 @@ var has = function has(obj, propName) {
|
|
|
39
35
|
|
|
40
36
|
exports.has = has;
|
|
41
37
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
var _acc$v;
|
|
38
|
+
const get = (obj, path, defaultValue) => String(path).split(".").reduce((acc, v) => {
|
|
39
|
+
if (typeof acc === "object") {
|
|
40
|
+
var _acc$v;
|
|
46
41
|
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
return (_acc$v = acc[v]) !== null && _acc$v !== void 0 ? _acc$v : defaultValue;
|
|
43
|
+
}
|
|
49
44
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
};
|
|
45
|
+
return defaultValue;
|
|
46
|
+
}, obj);
|
|
53
47
|
|
|
54
48
|
exports.get = get;
|
|
55
49
|
//# sourceMappingURL=objects.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objects.js","names":["isPlainObject","value","_isPlainObject","has","obj","propName","_has","get","path","defaultValue","String","split","reduce","acc","v"],"sources":["../../../src/utils/helpers/objects.js"],"sourcesContent":["// @flow\nimport _has from \"lodash/has\";\nimport _isPlainObject from \"lodash/isPlainObject\";\n\n/**\n */\nexport const isPlainObject = (value: any): boolean => _isPlainObject(value);\n\n/**\n */\nexport const has = (obj: any, propName: string): boolean => {\n if (!isPlainObject(obj)) {\n return false;\n }\n\n return _has(obj, propName);\n};\n\n/**\n * Retrieve property of an object\n * When path is only one deep better use optional chaining\n */\nexport const get = (obj: { ... }, path: string, defaultValue?: any): any =>\n String(path)\n .split(\".\")\n .reduce((acc, v) => {\n if (typeof acc === \"object\") {\n return acc[v] ?? defaultValue;\n }\n return defaultValue;\n }, obj);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"objects.js","names":["isPlainObject","value","_isPlainObject","has","obj","propName","_has","get","path","defaultValue","String","split","reduce","acc","v"],"sources":["../../../src/utils/helpers/objects.js"],"sourcesContent":["// @flow\nimport _has from \"lodash/has\";\nimport _isPlainObject from \"lodash/isPlainObject\";\n\n/**\n */\nexport const isPlainObject = (value: any): boolean => _isPlainObject(value);\n\n/**\n */\nexport const has = (obj: any, propName: string): boolean => {\n if (!isPlainObject(obj)) {\n return false;\n }\n\n return _has(obj, propName);\n};\n\n/**\n * Retrieve property of an object\n * When path is only one deep better use optional chaining\n */\nexport const get = (obj: { ... }, path: string, defaultValue?: any): any =>\n String(path)\n .split(\".\")\n .reduce((acc, v) => {\n if (typeof acc === \"object\") {\n return acc[v] ?? defaultValue;\n }\n return defaultValue;\n }, obj);\n"],"mappings":";;;;;;;;;AACA;;AACA;;AAEA;AACA;AACO,MAAMA,aAAa,GAAIC,KAAD,IAAyB,IAAAC,uBAAA,EAAeD,KAAf,CAA/C;AAEP;AACA;;;;;AACO,MAAME,GAAG,GAAG,CAACC,GAAD,EAAWC,QAAX,KAAyC;EAC1D,IAAI,CAACL,aAAa,CAACI,GAAD,CAAlB,EAAyB;IACvB,OAAO,KAAP;EACD;;EAED,OAAO,IAAAE,aAAA,EAAKF,GAAL,EAAUC,QAAV,CAAP;AACD,CANM;AAQP;AACA;AACA;AACA;;;;;AACO,MAAME,GAAG,GAAG,CAACH,GAAD,EAAeI,IAAf,EAA6BC,YAA7B,KACjBC,MAAM,CAACF,IAAD,CAAN,CACGG,KADH,CACS,GADT,EAEGC,MAFH,CAEU,CAACC,GAAD,EAAMC,CAAN,KAAY;EAClB,IAAI,OAAOD,GAAP,KAAe,QAAnB,EAA6B;IAAA;;IAC3B,iBAAOA,GAAG,CAACC,CAAD,CAAV,2CAAiBL,YAAjB;EACD;;EACD,OAAOA,YAAP;AACD,CAPH,EAOKL,GAPL,CADK"}
|
|
@@ -15,15 +15,15 @@ var _exceptions = require("../../exceptions");
|
|
|
15
15
|
* Translates html entities to their correct decimal equivalent
|
|
16
16
|
* When path is only one deep better use optional chaining
|
|
17
17
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
const properEntityEncoding = html => {
|
|
19
|
+
const escapedGt = html.replace(/</g, "[");
|
|
20
|
+
const escapedLt = escapedGt.replace(/>/g, "]");
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
const properEntities = _he.default.encode(_he.default.decode(escapedLt), {
|
|
23
23
|
decimal: true
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
const unescapedGt = properEntities.replace(/\[/g, "<");
|
|
27
27
|
return unescapedGt.replace(/]/g, ">");
|
|
28
28
|
};
|
|
29
29
|
/**
|
|
@@ -32,8 +32,8 @@ var properEntityEncoding = function properEntityEncoding(html) {
|
|
|
32
32
|
*/
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
const removeUnwantedHtml = function (html) {
|
|
36
|
+
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
37
37
|
allowedTags: ["p", "br", "b", "i", "u", "strike"]
|
|
38
38
|
};
|
|
39
39
|
|
|
@@ -41,14 +41,14 @@ var removeUnwantedHtml = function removeUnwantedHtml(html) {
|
|
|
41
41
|
throw new _exceptions.IllegalArgumentException("sanitizeHTML method expects a string");
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
const correctEntityHtml = properEntityEncoding(html); // remove attributes from html elements
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
const htmlWithoutAttributes = correctEntityHtml.replace(/<(\w+)(.|[\r\n])*?>/gi, "<$1>");
|
|
47
|
+
const htmlWithCorrectBR = htmlWithoutAttributes.replace(/<br\s*>/gi, "<br />"); // remove not allowed tags
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
const allowedTags = Array.isArray(options.allowedTags) ? options.allowedTags.join("|") : "";
|
|
50
|
+
const pattern = "<(?!\\/?(".concat(allowedTags, ")(>|\\s\\/))[^<]+?>");
|
|
51
|
+
const regex = new RegExp(pattern, "gi");
|
|
52
52
|
return htmlWithCorrectBR.replace(regex, "");
|
|
53
53
|
};
|
|
54
54
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sanitizeHtml.js","names":["properEntityEncoding","html","escapedGt","replace","escapedLt","properEntities","he","encode","decode","decimal","unescapedGt","removeUnwantedHtml","options","allowedTags","IllegalArgumentException","correctEntityHtml","htmlWithoutAttributes","htmlWithCorrectBR","Array","isArray","join","pattern","regex","RegExp"],"sources":["../../../src/utils/helpers/sanitizeHtml.js"],"sourcesContent":["// @flow\nimport he from \"he\";\n\nimport { IllegalArgumentException } from \"../../exceptions\";\n\ntype removeUnwantedHtmlOptions = {\n allowedTags?: Array<string>,\n};\n\n/**\n * Translates html entities to their correct decimal equivalent\n * When path is only one deep better use optional chaining\n */\nconst properEntityEncoding = (html) => {\n const escapedGt = html.replace(/</g, \"[\");\n const escapedLt = escapedGt.replace(/>/g, \"]\");\n\n const properEntities = he.encode(he.decode(escapedLt), {\n decimal: true,\n });\n\n const unescapedGt = properEntities.replace(/\\[/g, \"<\");\n\n return unescapedGt.replace(/]/g, \">\");\n};\n\n/**\n * removes unwanted html, this might result in incorrect html, as it removes all html that we don't except,\n * like <b style=\"font-weight: 400\">bold</b> will result in bold</b>\n */\nconst removeUnwantedHtml = (\n html: string,\n options: removeUnwantedHtmlOptions = {\n allowedTags: [\"p\", \"br\", \"b\", \"i\", \"u\", \"strike\"],\n }\n): string => {\n if (typeof html !== \"string\") {\n throw new IllegalArgumentException(\"sanitizeHTML method expects a string\");\n }\n\n const correctEntityHtml = properEntityEncoding(html);\n\n // remove attributes from html elements\n const htmlWithoutAttributes = correctEntityHtml.replace(\n /<(\\w+)(.|[\\r\\n])*?>/gi,\n \"<$1>\"\n );\n\n const htmlWithCorrectBR = htmlWithoutAttributes.replace(\n /<br\\s*>/gi,\n \"<br />\"\n );\n\n // remove not allowed tags\n const allowedTags = Array.isArray(options.allowedTags)\n ? options.allowedTags.join(\"|\")\n : \"\";\n const pattern = `<(?!\\\\/?(${allowedTags})(>|\\\\s\\\\/))[^<]+?>`;\n const regex = new RegExp(pattern, \"gi\");\n\n return htmlWithCorrectBR.replace(regex, \"\");\n};\n\nexport { removeUnwantedHtml };\n"],"mappings":";;;;;;;;;AACA;;AAEA;;AAMA;AACA;AACA;AACA;AACA,
|
|
1
|
+
{"version":3,"file":"sanitizeHtml.js","names":["properEntityEncoding","html","escapedGt","replace","escapedLt","properEntities","he","encode","decode","decimal","unescapedGt","removeUnwantedHtml","options","allowedTags","IllegalArgumentException","correctEntityHtml","htmlWithoutAttributes","htmlWithCorrectBR","Array","isArray","join","pattern","regex","RegExp"],"sources":["../../../src/utils/helpers/sanitizeHtml.js"],"sourcesContent":["// @flow\nimport he from \"he\";\n\nimport { IllegalArgumentException } from \"../../exceptions\";\n\ntype removeUnwantedHtmlOptions = {\n allowedTags?: Array<string>,\n};\n\n/**\n * Translates html entities to their correct decimal equivalent\n * When path is only one deep better use optional chaining\n */\nconst properEntityEncoding = (html) => {\n const escapedGt = html.replace(/</g, \"[\");\n const escapedLt = escapedGt.replace(/>/g, \"]\");\n\n const properEntities = he.encode(he.decode(escapedLt), {\n decimal: true,\n });\n\n const unescapedGt = properEntities.replace(/\\[/g, \"<\");\n\n return unescapedGt.replace(/]/g, \">\");\n};\n\n/**\n * removes unwanted html, this might result in incorrect html, as it removes all html that we don't except,\n * like <b style=\"font-weight: 400\">bold</b> will result in bold</b>\n */\nconst removeUnwantedHtml = (\n html: string,\n options: removeUnwantedHtmlOptions = {\n allowedTags: [\"p\", \"br\", \"b\", \"i\", \"u\", \"strike\"],\n }\n): string => {\n if (typeof html !== \"string\") {\n throw new IllegalArgumentException(\"sanitizeHTML method expects a string\");\n }\n\n const correctEntityHtml = properEntityEncoding(html);\n\n // remove attributes from html elements\n const htmlWithoutAttributes = correctEntityHtml.replace(\n /<(\\w+)(.|[\\r\\n])*?>/gi,\n \"<$1>\"\n );\n\n const htmlWithCorrectBR = htmlWithoutAttributes.replace(\n /<br\\s*>/gi,\n \"<br />\"\n );\n\n // remove not allowed tags\n const allowedTags = Array.isArray(options.allowedTags)\n ? options.allowedTags.join(\"|\")\n : \"\";\n const pattern = `<(?!\\\\/?(${allowedTags})(>|\\\\s\\\\/))[^<]+?>`;\n const regex = new RegExp(pattern, \"gi\");\n\n return htmlWithCorrectBR.replace(regex, \"\");\n};\n\nexport { removeUnwantedHtml };\n"],"mappings":";;;;;;;;;AACA;;AAEA;;AAMA;AACA;AACA;AACA;AACA,MAAMA,oBAAoB,GAAIC,IAAD,IAAU;EACrC,MAAMC,SAAS,GAAGD,IAAI,CAACE,OAAL,CAAa,IAAb,EAAmB,GAAnB,CAAlB;EACA,MAAMC,SAAS,GAAGF,SAAS,CAACC,OAAV,CAAkB,IAAlB,EAAwB,GAAxB,CAAlB;;EAEA,MAAME,cAAc,GAAGC,WAAA,CAAGC,MAAH,CAAUD,WAAA,CAAGE,MAAH,CAAUJ,SAAV,CAAV,EAAgC;IACrDK,OAAO,EAAE;EAD4C,CAAhC,CAAvB;;EAIA,MAAMC,WAAW,GAAGL,cAAc,CAACF,OAAf,CAAuB,KAAvB,EAA8B,GAA9B,CAApB;EAEA,OAAOO,WAAW,CAACP,OAAZ,CAAoB,IAApB,EAA0B,GAA1B,CAAP;AACD,CAXD;AAaA;AACA;AACA;AACA;;;AACA,MAAMQ,kBAAkB,GAAG,UACzBV,IADyB,EAKd;EAAA,IAHXW,OAGW,uEAH0B;IACnCC,WAAW,EAAE,CAAC,GAAD,EAAM,IAAN,EAAY,GAAZ,EAAiB,GAAjB,EAAsB,GAAtB,EAA2B,QAA3B;EADsB,CAG1B;;EACX,IAAI,OAAOZ,IAAP,KAAgB,QAApB,EAA8B;IAC5B,MAAM,IAAIa,oCAAJ,CAA6B,sCAA7B,CAAN;EACD;;EAED,MAAMC,iBAAiB,GAAGf,oBAAoB,CAACC,IAAD,CAA9C,CALW,CAOX;;EACA,MAAMe,qBAAqB,GAAGD,iBAAiB,CAACZ,OAAlB,CAC5B,uBAD4B,EAE5B,MAF4B,CAA9B;EAKA,MAAMc,iBAAiB,GAAGD,qBAAqB,CAACb,OAAtB,CACxB,WADwB,EAExB,QAFwB,CAA1B,CAbW,CAkBX;;EACA,MAAMU,WAAW,GAAGK,KAAK,CAACC,OAAN,CAAcP,OAAO,CAACC,WAAtB,IAChBD,OAAO,CAACC,WAAR,CAAoBO,IAApB,CAAyB,GAAzB,CADgB,GAEhB,EAFJ;EAGA,MAAMC,OAAO,sBAAeR,WAAf,wBAAb;EACA,MAAMS,KAAK,GAAG,IAAIC,MAAJ,CAAWF,OAAX,EAAoB,IAApB,CAAd;EAEA,OAAOJ,iBAAiB,CAACd,OAAlB,CAA0BmB,KAA1B,EAAiC,EAAjC,CAAP;AACD,CA/BD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","names":["retrieveText","text","isPlainObject","message"],"sources":["../../../src/utils/helpers/text.js"],"sourcesContent":["// @flow\nimport { isPlainObject } from \"./objects\";\n\n/**\n * Handles text that is in the ApplicationMessage form ({ id: string, message: string, properties: object })\n * @param text\n * @returns {string}\n */\nexport const retrieveText = (\n text:\n | string\n | { id?: string, message: string, properties?: { [key: string]: any } }\n): string => {\n if (typeof text === \"string\") {\n return text;\n }\n\n if (isPlainObject(text) && \"message\" in text) {\n return text.message;\n }\n\n return \"\";\n};\n"],"mappings":";;;;;;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACO,
|
|
1
|
+
{"version":3,"file":"text.js","names":["retrieveText","text","isPlainObject","message"],"sources":["../../../src/utils/helpers/text.js"],"sourcesContent":["// @flow\nimport { isPlainObject } from \"./objects\";\n\n/**\n * Handles text that is in the ApplicationMessage form ({ id: string, message: string, properties: object })\n * @param text\n * @returns {string}\n */\nexport const retrieveText = (\n text:\n | string\n | { id?: string, message: string, properties?: { [key: string]: any } }\n): string => {\n if (typeof text === \"string\") {\n return text;\n }\n\n if (isPlainObject(text) && \"message\" in text) {\n return text.message;\n }\n\n return \"\";\n};\n"],"mappings":";;;;;;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAMA,YAAY,GACvBC,IAD0B,IAIf;EACX,IAAI,OAAOA,IAAP,KAAgB,QAApB,EAA8B;IAC5B,OAAOA,IAAP;EACD;;EAED,IAAI,IAAAC,sBAAA,EAAcD,IAAd,KAAuB,aAAaA,IAAxC,EAA8C;IAC5C,OAAOA,IAAI,CAACE,OAAZ;EACD;;EAED,OAAO,EAAP;AACD,CAdM"}
|
package/lib/utils/index.js
CHANGED
|
@@ -18,43 +18,43 @@ var _exportNames = {
|
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "Cache", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function
|
|
21
|
+
get: function () {
|
|
22
22
|
return _Cache.default;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
Object.defineProperty(exports, "DecimalFormat", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function
|
|
27
|
+
get: function () {
|
|
28
28
|
return _DecimalFormat.default;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "createUUID", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function
|
|
33
|
+
get: function () {
|
|
34
34
|
return _createUUID.default;
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
Object.defineProperty(exports, "formatValue", {
|
|
38
38
|
enumerable: true,
|
|
39
|
-
get: function
|
|
39
|
+
get: function () {
|
|
40
40
|
return _formatValue.default;
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
Object.defineProperty(exports, "serverFetch", {
|
|
44
44
|
enumerable: true,
|
|
45
|
-
get: function
|
|
45
|
+
get: function () {
|
|
46
46
|
return _serverFetch.default;
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
Object.defineProperty(exports, "universalFetch", {
|
|
50
50
|
enumerable: true,
|
|
51
|
-
get: function
|
|
51
|
+
get: function () {
|
|
52
52
|
return _universalFetch.default;
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
55
|
Object.defineProperty(exports, "xhr", {
|
|
56
56
|
enumerable: true,
|
|
57
|
-
get: function
|
|
57
|
+
get: function () {
|
|
58
58
|
return _xhr.default;
|
|
59
59
|
}
|
|
60
60
|
});
|
|
@@ -69,7 +69,7 @@ _Object$keys(_Cookies).forEach(function (key) {
|
|
|
69
69
|
if (key in exports && exports[key] === _Cookies[key]) return;
|
|
70
70
|
Object.defineProperty(exports, key, {
|
|
71
71
|
enumerable: true,
|
|
72
|
-
get: function
|
|
72
|
+
get: function () {
|
|
73
73
|
return _Cookies[key];
|
|
74
74
|
}
|
|
75
75
|
});
|
|
@@ -83,7 +83,7 @@ _Object$keys(_DateTimeUtil).forEach(function (key) {
|
|
|
83
83
|
if (key in exports && exports[key] === _DateTimeUtil[key]) return;
|
|
84
84
|
Object.defineProperty(exports, key, {
|
|
85
85
|
enumerable: true,
|
|
86
|
-
get: function
|
|
86
|
+
get: function () {
|
|
87
87
|
return _DateTimeUtil[key];
|
|
88
88
|
}
|
|
89
89
|
});
|
|
@@ -103,7 +103,7 @@ _Object$keys(_createHash).forEach(function (key) {
|
|
|
103
103
|
if (key in exports && exports[key] === _createHash[key]) return;
|
|
104
104
|
Object.defineProperty(exports, key, {
|
|
105
105
|
enumerable: true,
|
|
106
|
-
get: function
|
|
106
|
+
get: function () {
|
|
107
107
|
return _createHash[key];
|
|
108
108
|
}
|
|
109
109
|
});
|
|
@@ -119,7 +119,7 @@ _Object$keys(_sanitizeHtml).forEach(function (key) {
|
|
|
119
119
|
if (key in exports && exports[key] === _sanitizeHtml[key]) return;
|
|
120
120
|
Object.defineProperty(exports, key, {
|
|
121
121
|
enumerable: true,
|
|
122
|
-
get: function
|
|
122
|
+
get: function () {
|
|
123
123
|
return _sanitizeHtml[key];
|
|
124
124
|
}
|
|
125
125
|
});
|
|
@@ -133,7 +133,7 @@ _Object$keys(_objects).forEach(function (key) {
|
|
|
133
133
|
if (key in exports && exports[key] === _objects[key]) return;
|
|
134
134
|
Object.defineProperty(exports, key, {
|
|
135
135
|
enumerable: true,
|
|
136
|
-
get: function
|
|
136
|
+
get: function () {
|
|
137
137
|
return _objects[key];
|
|
138
138
|
}
|
|
139
139
|
});
|
|
@@ -147,7 +147,7 @@ _Object$keys(_text).forEach(function (key) {
|
|
|
147
147
|
if (key in exports && exports[key] === _text[key]) return;
|
|
148
148
|
Object.defineProperty(exports, key, {
|
|
149
149
|
enumerable: true,
|
|
150
|
-
get: function
|
|
150
|
+
get: function () {
|
|
151
151
|
return _text[key];
|
|
152
152
|
}
|
|
153
153
|
});
|
|
@@ -161,7 +161,7 @@ _Object$keys(_checkResource).forEach(function (key) {
|
|
|
161
161
|
if (key in exports && exports[key] === _checkResource[key]) return;
|
|
162
162
|
Object.defineProperty(exports, key, {
|
|
163
163
|
enumerable: true,
|
|
164
|
-
get: function
|
|
164
|
+
get: function () {
|
|
165
165
|
return _checkResource[key];
|
|
166
166
|
}
|
|
167
167
|
});
|
|
@@ -179,7 +179,7 @@ _Object$keys(_parseNumbers).forEach(function (key) {
|
|
|
179
179
|
if (key in exports && exports[key] === _parseNumbers[key]) return;
|
|
180
180
|
Object.defineProperty(exports, key, {
|
|
181
181
|
enumerable: true,
|
|
182
|
-
get: function
|
|
182
|
+
get: function () {
|
|
183
183
|
return _parseNumbers[key];
|
|
184
184
|
}
|
|
185
185
|
});
|