@beinformed/ui 1.62.8 → 1.63.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.
Files changed (649) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/esm/models/attributes/__tests__/AttributeContent.spec.js.flow +1 -1
  3. package/esm/models/content/SectionModel.js +22 -11
  4. package/esm/models/content/SectionModel.js.flow +32 -19
  5. package/esm/models/content/SectionModel.js.map +1 -1
  6. package/esm/models/content/__tests__/ContentModel.spec.js.flow +35 -0
  7. package/esm/models/types.js.flow +2 -1
  8. package/esm/models/types.js.map +1 -1
  9. package/esm/react-server/__tests__/requestInformation.spec.js.flow +265 -0
  10. package/esm/react-server/requestInformation.js +6 -3
  11. package/esm/react-server/requestInformation.js.flow +8 -3
  12. package/esm/react-server/requestInformation.js.map +1 -1
  13. package/lib/models/content/SectionModel.js +22 -11
  14. package/lib/models/content/SectionModel.js.map +1 -1
  15. package/lib/models/types.js.map +1 -1
  16. package/lib/react-server/requestInformation.js +6 -3
  17. package/lib/react-server/requestInformation.js.map +1 -1
  18. package/package.json +3 -3
  19. package/src/models/attributes/__tests__/AttributeContent.spec.js +1 -1
  20. package/src/models/content/SectionModel.js +32 -19
  21. package/src/models/content/__tests__/ContentModel.spec.js +35 -0
  22. package/src/models/content/__tests__/content-with-sections.json +105 -0
  23. package/src/models/types.js +2 -1
  24. package/src/react-server/__tests__/requestInformation.spec.js +265 -0
  25. package/src/react-server/requestInformation.js +8 -3
  26. package/esm/builder/index.d.ts +0 -1
  27. package/esm/builder/mergeLayoutHintConfigurations.d.ts +0 -1
  28. package/esm/constants/Constants.d.ts +0 -158
  29. package/esm/constants/LayoutHintConfig.d.ts +0 -267
  30. package/esm/constants/LayoutHints.d.ts +0 -83
  31. package/esm/constants/Settings.d.ts +0 -33
  32. package/esm/constants/index.d.ts +0 -3
  33. package/esm/exceptions/ConfigurationException.d.ts +0 -7
  34. package/esm/exceptions/FetchException.d.ts +0 -31
  35. package/esm/exceptions/IllegalArgumentException.d.ts +0 -7
  36. package/esm/exceptions/IllegalReturnException.d.ts +0 -6
  37. package/esm/exceptions/IllegalStateException.d.ts +0 -7
  38. package/esm/exceptions/JsonParseException.d.ts +0 -7
  39. package/esm/exceptions/MissingPropertyException.d.ts +0 -7
  40. package/esm/exceptions/NetworkException.d.ts +0 -9
  41. package/esm/exceptions/NotAllowedUriException.d.ts +0 -7
  42. package/esm/exceptions/NotFoundException.d.ts +0 -10
  43. package/esm/exceptions/ServerRequestException.d.ts +0 -7
  44. package/esm/exceptions/ThemePropertyException.d.ts +0 -7
  45. package/esm/exceptions/TimeoutException.d.ts +0 -7
  46. package/esm/exceptions/UnauthorizedException.d.ts +0 -11
  47. package/esm/exceptions/UnsupportedOperationException.d.ts +0 -7
  48. package/esm/exceptions/index.d.ts +0 -15
  49. package/esm/hooks/index.d.ts +0 -16
  50. package/esm/hooks/useAllFormsOnModel.d.ts +0 -7
  51. package/esm/hooks/useAuthentication.d.ts +0 -16
  52. package/esm/hooks/useContent.d.ts +0 -3
  53. package/esm/hooks/useDeepCompareEffect.d.ts +0 -6
  54. package/esm/hooks/useForm.d.ts +0 -21
  55. package/esm/hooks/useI18n.d.ts +0 -13
  56. package/esm/hooks/useModal.d.ts +0 -12
  57. package/esm/hooks/useModelCatalog.d.ts +0 -34
  58. package/esm/hooks/useModels.d.ts +0 -10
  59. package/esm/hooks/useModularUI.d.ts +0 -3
  60. package/esm/hooks/useModularUIBasic.d.ts +0 -9
  61. package/esm/hooks/useModularUIModel.d.ts +0 -27
  62. package/esm/hooks/useModularUIRequest.d.ts +0 -4
  63. package/esm/hooks/useNotification.d.ts +0 -8
  64. package/esm/hooks/usePreference.d.ts +0 -2
  65. package/esm/hooks/useProgressIndicator.d.ts +0 -9
  66. package/esm/hooks/useRouter.d.ts +0 -23
  67. package/esm/i18n/Locale.d.ts +0 -53
  68. package/esm/i18n/Locales.d.ts +0 -59
  69. package/esm/i18n/Message.d.ts +0 -6
  70. package/esm/i18n/index.d.ts +0 -5
  71. package/esm/i18n/languages.d.ts +0 -215
  72. package/esm/i18n/translations/beinformed_error_messages_en.nl.d.ts +0 -97
  73. package/esm/i18n/translations/beinformed_error_messages_nl.nl.d.ts +0 -97
  74. package/esm/i18n/types.d.ts +0 -11
  75. package/esm/i18n/withMessage.d.ts +0 -3
  76. package/esm/index.d.ts +0 -6
  77. package/esm/models/actions/ActionCollection.d.ts +0 -30
  78. package/esm/models/actions/ActionModel.d.ts +0 -82
  79. package/esm/models/application/ApplicationModel.d.ts +0 -48
  80. package/esm/models/attributes/AttributeCollection.d.ts +0 -102
  81. package/esm/models/attributes/AttributeContent.d.ts +0 -64
  82. package/esm/models/attributes/AttributeDataHelper.d.ts +0 -67
  83. package/esm/models/attributes/AttributeModel.d.ts +0 -398
  84. package/esm/models/attributes/AttributeSetModel.d.ts +0 -36
  85. package/esm/models/attributes/BooleanAttributeModel.d.ts +0 -69
  86. package/esm/models/attributes/CaptchaAttributeModel.d.ts +0 -19
  87. package/esm/models/attributes/ChoiceAttributeModel.d.ts +0 -85
  88. package/esm/models/attributes/ChoiceAttributeOptionCollection.d.ts +0 -87
  89. package/esm/models/attributes/ChoiceAttributeOptionModel.d.ts +0 -151
  90. package/esm/models/attributes/CompositeAttributeChildCollection.d.ts +0 -57
  91. package/esm/models/attributes/CompositeAttributeModel.d.ts +0 -42
  92. package/esm/models/attributes/DatetimeAttributeModel.d.ts +0 -85
  93. package/esm/models/attributes/HelptextAttributeModel.d.ts +0 -16
  94. package/esm/models/attributes/LabelAttributeModel.d.ts +0 -12
  95. package/esm/models/attributes/MemoAttributeModel.d.ts +0 -14
  96. package/esm/models/attributes/MoneyAttributeModel.d.ts +0 -14
  97. package/esm/models/attributes/NumberAttributeModel.d.ts +0 -49
  98. package/esm/models/attributes/PasswordAttributeModel.d.ts +0 -62
  99. package/esm/models/attributes/StringAttributeModel.d.ts +0 -65
  100. package/esm/models/attributes/UploadAttributeModel.d.ts +0 -60
  101. package/esm/models/attributes/XMLAttributeModel.d.ts +0 -10
  102. package/esm/models/attributes/_createAttribute.d.ts +0 -7
  103. package/esm/models/attributes/input-constraints/BSNConstraint.d.ts +0 -26
  104. package/esm/models/attributes/input-constraints/ConstraintCollection.d.ts +0 -24
  105. package/esm/models/attributes/input-constraints/ConstraintModel.d.ts +0 -34
  106. package/esm/models/attributes/input-constraints/DateBoundaryConstraint.d.ts +0 -65
  107. package/esm/models/attributes/input-constraints/DateTimeDateFormatConstraint.d.ts +0 -36
  108. package/esm/models/attributes/input-constraints/DateTimeTimeFormatConstraint.d.ts +0 -36
  109. package/esm/models/attributes/input-constraints/DatetimeFormatConstraint.d.ts +0 -50
  110. package/esm/models/attributes/input-constraints/FileExtensionConstraint.d.ts +0 -33
  111. package/esm/models/attributes/input-constraints/FileSizeConstraint.d.ts +0 -42
  112. package/esm/models/attributes/input-constraints/IBANConstraint.d.ts +0 -23
  113. package/esm/models/attributes/input-constraints/MandatoryConstraint.d.ts +0 -23
  114. package/esm/models/attributes/input-constraints/MandatoryRangeConstraint.d.ts +0 -36
  115. package/esm/models/attributes/input-constraints/NumberBoundaryConstraint.d.ts +0 -61
  116. package/esm/models/attributes/input-constraints/NumberFormatConstraint.d.ts +0 -52
  117. package/esm/models/attributes/input-constraints/NumberGroupingConstraint.d.ts +0 -46
  118. package/esm/models/attributes/input-constraints/PasswordConfirmConstraint.d.ts +0 -36
  119. package/esm/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.d.ts +0 -23
  120. package/esm/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.d.ts +0 -32
  121. package/esm/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.d.ts +0 -32
  122. package/esm/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.d.ts +0 -35
  123. package/esm/models/attributes/input-constraints/RangeConstraint.d.ts +0 -51
  124. package/esm/models/attributes/input-constraints/RegexConstraint.d.ts +0 -37
  125. package/esm/models/attributes/input-constraints/StringLengthConstraint.d.ts +0 -46
  126. package/esm/models/attributes/input-constraints/XMLConstraint.d.ts +0 -26
  127. package/esm/models/attributes/layouthint-rules/BaseLayoutHintRule.d.ts +0 -45
  128. package/esm/models/attributes/layouthint-rules/DependentAttribute.d.ts +0 -57
  129. package/esm/models/attributes/layouthint-rules/LayoutHintRuleCollection.d.ts +0 -27
  130. package/esm/models/attributes/layouthint-rules/RemainingTotalUploadSize.d.ts +0 -17
  131. package/esm/models/base/BaseCollection.d.ts +0 -89
  132. package/esm/models/base/BaseModel.d.ts +0 -78
  133. package/esm/models/base/ResourceCollection.d.ts +0 -20
  134. package/esm/models/base/ResourceModel.d.ts +0 -102
  135. package/esm/models/caseview/CaseViewModel.d.ts +0 -46
  136. package/esm/models/concepts/BusinessScenarioModel.d.ts +0 -20
  137. package/esm/models/concepts/ConceptDetailModel.d.ts +0 -86
  138. package/esm/models/concepts/ConceptIndexModel.d.ts +0 -44
  139. package/esm/models/concepts/ConceptLinkModel.d.ts +0 -82
  140. package/esm/models/concepts/ConceptRelationCollection.d.ts +0 -36
  141. package/esm/models/concepts/ConceptRelationModel.d.ts +0 -61
  142. package/esm/models/concepts/ConceptTypeDetailModel.d.ts +0 -54
  143. package/esm/models/concepts/SourceReferenceCollection.d.ts +0 -14
  144. package/esm/models/concepts/SourceReferenceModel.d.ts +0 -48
  145. package/esm/models/content/ContentIndexModel.d.ts +0 -41
  146. package/esm/models/content/ContentLinkModel.d.ts +0 -102
  147. package/esm/models/content/ContentModel.d.ts +0 -80
  148. package/esm/models/content/ContentTOCModel.d.ts +0 -56
  149. package/esm/models/content/ContentTypeModel.d.ts +0 -26
  150. package/esm/models/content/SectionModel.d.ts +0 -79
  151. package/esm/models/content/SubSectionModel.d.ts +0 -69
  152. package/esm/models/contentconfiguration/ContentConfiguration.d.ts +0 -28
  153. package/esm/models/contentconfiguration/ContentConfigurationElements.d.ts +0 -47
  154. package/esm/models/contentconfiguration/ContentConfigurationEndResults.d.ts +0 -16
  155. package/esm/models/contentconfiguration/ContentConfigurationQuestions.d.ts +0 -22
  156. package/esm/models/contentconfiguration/ContentConfigurationResults.d.ts +0 -39
  157. package/esm/models/detail/DetailModel.d.ts +0 -80
  158. package/esm/models/error/ErrorCollection.d.ts +0 -51
  159. package/esm/models/error/ErrorModel.d.ts +0 -41
  160. package/esm/models/error/ErrorResponse.d.ts +0 -156
  161. package/esm/models/filters/AssignmentFilterModel.d.ts +0 -35
  162. package/esm/models/filters/BaseFilterModel.d.ts +0 -101
  163. package/esm/models/filters/ConceptIndexFilterModel.d.ts +0 -6
  164. package/esm/models/filters/FilterCollection.d.ts +0 -49
  165. package/esm/models/filters/FilterModel.d.ts +0 -5
  166. package/esm/models/filters/RangeFilterModel.d.ts +0 -6
  167. package/esm/models/filters/StringFilterModel.d.ts +0 -30
  168. package/esm/models/form/FormModel.d.ts +0 -350
  169. package/esm/models/form/FormObjectModel.d.ts +0 -210
  170. package/esm/models/grouping/GroupingModel.d.ts +0 -86
  171. package/esm/models/href/Href.d.ts +0 -218
  172. package/esm/models/href/ListHref.d.ts +0 -64
  173. package/esm/models/index.d.ts +0 -96
  174. package/esm/models/layouthint/LayoutHintCollection.d.ts +0 -43
  175. package/esm/models/links/LinkCollection.d.ts +0 -71
  176. package/esm/models/links/LinkModel.d.ts +0 -93
  177. package/esm/models/links/normalizeLinkJSON.d.ts +0 -9
  178. package/esm/models/list/ListDetailModel.d.ts +0 -69
  179. package/esm/models/list/ListHeaderModel.d.ts +0 -53
  180. package/esm/models/list/ListItemCollection.d.ts +0 -21
  181. package/esm/models/list/ListItemModel.d.ts +0 -35
  182. package/esm/models/list/ListModel.d.ts +0 -143
  183. package/esm/models/lookup/LookupOptionCollection.d.ts +0 -15
  184. package/esm/models/lookup/LookupOptionsModel.d.ts +0 -23
  185. package/esm/models/modelcatalog/ModelCatalogModel.d.ts +0 -23
  186. package/esm/models/modelcatalog/ModelCategoryCollection.d.ts +0 -11
  187. package/esm/models/modelcatalog/ModelCategoryModel.d.ts +0 -39
  188. package/esm/models/paging/PagesizeModel.d.ts +0 -25
  189. package/esm/models/paging/PagingModel.d.ts +0 -49
  190. package/esm/models/panels/GroupingPanelModel.d.ts +0 -49
  191. package/esm/models/parameter/Parameter.d.ts +0 -40
  192. package/esm/models/process/ProcessStatusSettingsModel.d.ts +0 -38
  193. package/esm/models/resolveModel.d.ts +0 -7
  194. package/esm/models/search/CaseSearchModel.d.ts +0 -14
  195. package/esm/models/sorting/SortOptionModel.d.ts +0 -48
  196. package/esm/models/sorting/SortingModel.d.ts +0 -42
  197. package/esm/models/tab/TabModel.d.ts +0 -53
  198. package/esm/models/taskgroup/TaskGroupCollection.d.ts +0 -12
  199. package/esm/models/taskgroup/TaskGroupModel.d.ts +0 -25
  200. package/esm/models/types.d.ts +0 -171
  201. package/esm/models/user/UserModel.d.ts +0 -18
  202. package/esm/models/user/UserProfileModel.d.ts +0 -17
  203. package/esm/models/user/UserServicesModel.d.ts +0 -39
  204. package/esm/modularui/Authenticate.d.ts +0 -46
  205. package/esm/modularui/CaptchaRequest.d.ts +0 -54
  206. package/esm/modularui/ModularUIError.d.ts +0 -10
  207. package/esm/modularui/ModularUIRequest.d.ts +0 -207
  208. package/esm/modularui/ModularUIResponse.d.ts +0 -78
  209. package/esm/modularui/UploadRequest.d.ts +0 -41
  210. package/esm/modularui/index.d.ts +0 -5
  211. package/esm/modularui/types.d.ts +0 -2
  212. package/esm/react/ErrorBoundary.d.ts +0 -31
  213. package/esm/react/ErrorBoundaryFallback.d.ts +0 -8
  214. package/esm/react/index.d.ts +0 -2
  215. package/esm/react/utils.d.ts +0 -5
  216. package/esm/react-client/Init.d.ts +0 -6
  217. package/esm/react-client/client.d.ts +0 -25
  218. package/esm/react-client/contextPath.d.ts +0 -1
  219. package/esm/react-client/index.d.ts +0 -3
  220. package/esm/react-client/rehydrate.d.ts +0 -5
  221. package/esm/react-server/contextPath.d.ts +0 -1
  222. package/esm/react-server/createSSRComplete.d.ts +0 -5
  223. package/esm/react-server/htmlpage.d.ts +0 -11
  224. package/esm/react-server/index.d.ts +0 -8
  225. package/esm/react-server/renderSSRComplete.d.ts +0 -13
  226. package/esm/react-server/renderSSRMinimal.d.ts +0 -11
  227. package/esm/react-server/requestInformation.d.ts +0 -6
  228. package/esm/react-server/serverNoSSR.d.ts +0 -15
  229. package/esm/react-server/serverSSR.d.ts +0 -15
  230. package/esm/react-server/serverUtil.d.ts +0 -46
  231. package/esm/react-theme/ThemeProvider.d.ts +0 -8
  232. package/esm/react-theme/createTheme.d.ts +0 -53
  233. package/esm/react-theme/index.d.ts +0 -10
  234. package/esm/react-theme/types.d.ts +0 -13
  235. package/esm/react-theme/useTheme.d.ts +0 -4
  236. package/esm/react-theme/utils/background.d.ts +0 -4
  237. package/esm/react-theme/utils/colors.d.ts +0 -9
  238. package/esm/react-theme/utils/contrast.d.ts +0 -18
  239. package/esm/react-theme/utils/corners.d.ts +0 -3
  240. package/esm/react-theme/utils/spacers.d.ts +0 -9
  241. package/esm/react-theme/utils/themeProps.d.ts +0 -7
  242. package/esm/redux/_i18n/I18nActions.d.ts +0 -7
  243. package/esm/redux/_i18n/I18nReducer.d.ts +0 -7
  244. package/esm/redux/_i18n/index.d.ts +0 -3
  245. package/esm/redux/_i18n/types.d.ts +0 -13
  246. package/esm/redux/_modularui/ModularUIActions.d.ts +0 -26
  247. package/esm/redux/_modularui/ModularUIConnector.d.ts +0 -7
  248. package/esm/redux/_modularui/ModularUIMiddleware.d.ts +0 -7
  249. package/esm/redux/_modularui/ModularUIReducer.d.ts +0 -7
  250. package/esm/redux/_modularui/ModularUISelectors.d.ts +0 -3
  251. package/esm/redux/_modularui/ModularUIUtils.d.ts +0 -5
  252. package/esm/redux/_modularui/index.d.ts +0 -8
  253. package/esm/redux/_modularui/types.d.ts +0 -84
  254. package/esm/redux/_modularui/withModularUI.d.ts +0 -3
  255. package/esm/redux/_router/RouterActions.d.ts +0 -10
  256. package/esm/redux/_router/RouterConnectors.d.ts +0 -6
  257. package/esm/redux/_router/RouterMiddleware.d.ts +0 -5
  258. package/esm/redux/_router/RouterReducer.d.ts +0 -7
  259. package/esm/redux/_router/index.d.ts +0 -5
  260. package/esm/redux/_router/types.d.ts +0 -35
  261. package/esm/redux/actions/Application.d.ts +0 -4
  262. package/esm/redux/actions/Authorization.d.ts +0 -3
  263. package/esm/redux/actions/Error.d.ts +0 -7
  264. package/esm/redux/actions/Form.d.ts +0 -5
  265. package/esm/redux/actions/FormAttributeSet.d.ts +0 -6
  266. package/esm/redux/actions/FormAttributeSetRepeatable.d.ts +0 -6
  267. package/esm/redux/actions/FormAutosave.d.ts +0 -3
  268. package/esm/redux/actions/FormAutosubmit.d.ts +0 -4
  269. package/esm/redux/actions/FormAutoupdate.d.ts +0 -4
  270. package/esm/redux/actions/FormValidations.d.ts +0 -3
  271. package/esm/redux/actions/Modals.d.ts +0 -4
  272. package/esm/redux/actions/ModelCatalog.d.ts +0 -2
  273. package/esm/redux/actions/Notification.d.ts +0 -10
  274. package/esm/redux/actions/Preferences.d.ts +0 -11
  275. package/esm/redux/actions/ProgressIndicator.d.ts +0 -8
  276. package/esm/redux/actions/SignIn.d.ts +0 -10
  277. package/esm/redux/actions/SignOut.d.ts +0 -4
  278. package/esm/redux/actions/index.d.ts +0 -16
  279. package/esm/redux/connectors/Application.d.ts +0 -4
  280. package/esm/redux/connectors/Breadcrumb.d.ts +0 -3
  281. package/esm/redux/connectors/CaseView.d.ts +0 -4
  282. package/esm/redux/connectors/ConceptDetail.d.ts +0 -4
  283. package/esm/redux/connectors/ContentBrowser.d.ts +0 -4
  284. package/esm/redux/connectors/ContentDetail.d.ts +0 -4
  285. package/esm/redux/connectors/ContentDetailSection.d.ts +0 -4
  286. package/esm/redux/connectors/Form.d.ts +0 -16
  287. package/esm/redux/connectors/FormAttributeSet.d.ts +0 -5
  288. package/esm/redux/connectors/ListDetail.d.ts +0 -4
  289. package/esm/redux/connectors/Modal.d.ts +0 -4
  290. package/esm/redux/connectors/ModelCatalog.d.ts +0 -4
  291. package/esm/redux/connectors/Notification.d.ts +0 -4
  292. package/esm/redux/connectors/PanelRenderer.d.ts +0 -4
  293. package/esm/redux/connectors/Preferences.d.ts +0 -2
  294. package/esm/redux/connectors/Progress.d.ts +0 -3
  295. package/esm/redux/connectors/ProgressIndicator.d.ts +0 -3
  296. package/esm/redux/connectors/QuickSearch.d.ts +0 -11
  297. package/esm/redux/connectors/SignIn.d.ts +0 -4
  298. package/esm/redux/connectors/SignOut.d.ts +0 -4
  299. package/esm/redux/connectors/Tab.d.ts +0 -4
  300. package/esm/redux/connectors/index.d.ts +0 -21
  301. package/esm/redux/index.d.ts +0 -9
  302. package/esm/redux/reducers/AuthReducer.d.ts +0 -8
  303. package/esm/redux/reducers/ErrorReducer.d.ts +0 -8
  304. package/esm/redux/reducers/ModalsReducer.d.ts +0 -8
  305. package/esm/redux/reducers/ModelCatalogReducer.d.ts +0 -8
  306. package/esm/redux/reducers/NotificationReducer.d.ts +0 -8
  307. package/esm/redux/reducers/PreferencesReducer.d.ts +0 -8
  308. package/esm/redux/reducers/ProgressIndicatorReducer.d.ts +0 -8
  309. package/esm/redux/reducers/createReducer.d.ts +0 -14
  310. package/esm/redux/reducers/index.d.ts +0 -8
  311. package/esm/redux/selectors/i18n.d.ts +0 -4
  312. package/esm/redux/selectors/index.d.ts +0 -2
  313. package/esm/redux/selectors/modelcatalog.d.ts +0 -2
  314. package/esm/redux/store/beforeRenderHooks.d.ts +0 -7
  315. package/esm/redux/store/configureStore.d.ts +0 -9
  316. package/esm/redux/types.d.ts +0 -113
  317. package/esm/utils/browser/Cache.d.ts +0 -45
  318. package/esm/utils/browser/Cookies.d.ts +0 -9
  319. package/esm/utils/datetime/DateTimeUtil.d.ts +0 -214
  320. package/esm/utils/fetch/__mocks__/universalFetch.d.ts +0 -3
  321. package/esm/utils/fetch/serverFetch.d.ts +0 -5
  322. package/esm/utils/fetch/types.d.ts +0 -44
  323. package/esm/utils/fetch/universalFetch.d.ts +0 -7
  324. package/esm/utils/fetch/xhr.d.ts +0 -5
  325. package/esm/utils/helpers/checkResource.d.ts +0 -3
  326. package/esm/utils/helpers/createHash.d.ts +0 -9
  327. package/esm/utils/helpers/createHref.d.ts +0 -8
  328. package/esm/utils/helpers/createUUID.d.ts +0 -4
  329. package/esm/utils/helpers/index.d.ts +0 -8
  330. package/esm/utils/helpers/objects.d.ts +0 -11
  331. package/esm/utils/helpers/repositoryResource.d.ts +0 -1
  332. package/esm/utils/helpers/sanitizeHtml.d.ts +0 -9
  333. package/esm/utils/helpers/text.d.ts +0 -7
  334. package/esm/utils/index.d.ts +0 -11
  335. package/esm/utils/number/DecimalFormat.d.ts +0 -90
  336. package/esm/utils/number/formatValue.d.ts +0 -4
  337. package/esm/utils/number/parseNumbers.d.ts +0 -9
  338. package/lib/builder/index.d.ts +0 -1
  339. package/lib/builder/mergeLayoutHintConfigurations.d.ts +0 -1
  340. package/lib/constants/Constants.d.ts +0 -158
  341. package/lib/constants/LayoutHintConfig.d.ts +0 -267
  342. package/lib/constants/LayoutHints.d.ts +0 -83
  343. package/lib/constants/Settings.d.ts +0 -33
  344. package/lib/constants/index.d.ts +0 -3
  345. package/lib/exceptions/ConfigurationException.d.ts +0 -7
  346. package/lib/exceptions/FetchException.d.ts +0 -31
  347. package/lib/exceptions/IllegalArgumentException.d.ts +0 -7
  348. package/lib/exceptions/IllegalReturnException.d.ts +0 -6
  349. package/lib/exceptions/IllegalStateException.d.ts +0 -7
  350. package/lib/exceptions/JsonParseException.d.ts +0 -7
  351. package/lib/exceptions/MissingPropertyException.d.ts +0 -7
  352. package/lib/exceptions/NetworkException.d.ts +0 -9
  353. package/lib/exceptions/NotAllowedUriException.d.ts +0 -7
  354. package/lib/exceptions/NotFoundException.d.ts +0 -10
  355. package/lib/exceptions/ServerRequestException.d.ts +0 -7
  356. package/lib/exceptions/ThemePropertyException.d.ts +0 -7
  357. package/lib/exceptions/TimeoutException.d.ts +0 -7
  358. package/lib/exceptions/UnauthorizedException.d.ts +0 -11
  359. package/lib/exceptions/UnsupportedOperationException.d.ts +0 -7
  360. package/lib/exceptions/index.d.ts +0 -15
  361. package/lib/hooks/index.d.ts +0 -16
  362. package/lib/hooks/useAllFormsOnModel.d.ts +0 -7
  363. package/lib/hooks/useAuthentication.d.ts +0 -16
  364. package/lib/hooks/useContent.d.ts +0 -3
  365. package/lib/hooks/useDeepCompareEffect.d.ts +0 -6
  366. package/lib/hooks/useForm.d.ts +0 -21
  367. package/lib/hooks/useI18n.d.ts +0 -13
  368. package/lib/hooks/useModal.d.ts +0 -12
  369. package/lib/hooks/useModelCatalog.d.ts +0 -34
  370. package/lib/hooks/useModels.d.ts +0 -10
  371. package/lib/hooks/useModularUI.d.ts +0 -3
  372. package/lib/hooks/useModularUIBasic.d.ts +0 -9
  373. package/lib/hooks/useModularUIModel.d.ts +0 -27
  374. package/lib/hooks/useModularUIRequest.d.ts +0 -4
  375. package/lib/hooks/useNotification.d.ts +0 -8
  376. package/lib/hooks/usePreference.d.ts +0 -2
  377. package/lib/hooks/useProgressIndicator.d.ts +0 -9
  378. package/lib/hooks/useRouter.d.ts +0 -23
  379. package/lib/i18n/Locale.d.ts +0 -53
  380. package/lib/i18n/Locales.d.ts +0 -59
  381. package/lib/i18n/Message.d.ts +0 -6
  382. package/lib/i18n/index.d.ts +0 -5
  383. package/lib/i18n/languages.d.ts +0 -215
  384. package/lib/i18n/translations/beinformed_error_messages_en.nl.d.ts +0 -97
  385. package/lib/i18n/translations/beinformed_error_messages_nl.nl.d.ts +0 -97
  386. package/lib/i18n/types.d.ts +0 -11
  387. package/lib/i18n/withMessage.d.ts +0 -3
  388. package/lib/index.d.ts +0 -6
  389. package/lib/models/actions/ActionCollection.d.ts +0 -30
  390. package/lib/models/actions/ActionModel.d.ts +0 -82
  391. package/lib/models/application/ApplicationModel.d.ts +0 -48
  392. package/lib/models/attributes/AttributeCollection.d.ts +0 -102
  393. package/lib/models/attributes/AttributeContent.d.ts +0 -64
  394. package/lib/models/attributes/AttributeDataHelper.d.ts +0 -67
  395. package/lib/models/attributes/AttributeModel.d.ts +0 -398
  396. package/lib/models/attributes/AttributeSetModel.d.ts +0 -36
  397. package/lib/models/attributes/BooleanAttributeModel.d.ts +0 -69
  398. package/lib/models/attributes/CaptchaAttributeModel.d.ts +0 -19
  399. package/lib/models/attributes/ChoiceAttributeModel.d.ts +0 -85
  400. package/lib/models/attributes/ChoiceAttributeOptionCollection.d.ts +0 -87
  401. package/lib/models/attributes/ChoiceAttributeOptionModel.d.ts +0 -151
  402. package/lib/models/attributes/CompositeAttributeChildCollection.d.ts +0 -57
  403. package/lib/models/attributes/CompositeAttributeModel.d.ts +0 -42
  404. package/lib/models/attributes/DatetimeAttributeModel.d.ts +0 -85
  405. package/lib/models/attributes/HelptextAttributeModel.d.ts +0 -16
  406. package/lib/models/attributes/LabelAttributeModel.d.ts +0 -12
  407. package/lib/models/attributes/MemoAttributeModel.d.ts +0 -14
  408. package/lib/models/attributes/MoneyAttributeModel.d.ts +0 -14
  409. package/lib/models/attributes/NumberAttributeModel.d.ts +0 -49
  410. package/lib/models/attributes/PasswordAttributeModel.d.ts +0 -62
  411. package/lib/models/attributes/StringAttributeModel.d.ts +0 -65
  412. package/lib/models/attributes/UploadAttributeModel.d.ts +0 -60
  413. package/lib/models/attributes/XMLAttributeModel.d.ts +0 -10
  414. package/lib/models/attributes/_createAttribute.d.ts +0 -7
  415. package/lib/models/attributes/input-constraints/BSNConstraint.d.ts +0 -26
  416. package/lib/models/attributes/input-constraints/ConstraintCollection.d.ts +0 -24
  417. package/lib/models/attributes/input-constraints/ConstraintModel.d.ts +0 -34
  418. package/lib/models/attributes/input-constraints/DateBoundaryConstraint.d.ts +0 -65
  419. package/lib/models/attributes/input-constraints/DateTimeDateFormatConstraint.d.ts +0 -36
  420. package/lib/models/attributes/input-constraints/DateTimeTimeFormatConstraint.d.ts +0 -36
  421. package/lib/models/attributes/input-constraints/DatetimeFormatConstraint.d.ts +0 -50
  422. package/lib/models/attributes/input-constraints/FileExtensionConstraint.d.ts +0 -33
  423. package/lib/models/attributes/input-constraints/FileSizeConstraint.d.ts +0 -42
  424. package/lib/models/attributes/input-constraints/IBANConstraint.d.ts +0 -23
  425. package/lib/models/attributes/input-constraints/MandatoryConstraint.d.ts +0 -23
  426. package/lib/models/attributes/input-constraints/MandatoryRangeConstraint.d.ts +0 -36
  427. package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.d.ts +0 -61
  428. package/lib/models/attributes/input-constraints/NumberFormatConstraint.d.ts +0 -52
  429. package/lib/models/attributes/input-constraints/NumberGroupingConstraint.d.ts +0 -46
  430. package/lib/models/attributes/input-constraints/PasswordConfirmConstraint.d.ts +0 -36
  431. package/lib/models/attributes/input-constraints/PasswordLowerAndUpperCaseConstraint.d.ts +0 -23
  432. package/lib/models/attributes/input-constraints/PasswordMinNumericCharactersConstraint.d.ts +0 -32
  433. package/lib/models/attributes/input-constraints/PasswordMinSpecialCharactersConstraint.d.ts +0 -32
  434. package/lib/models/attributes/input-constraints/PasswordThreeConsecutiveCharactersNotAllowedConstraint.d.ts +0 -35
  435. package/lib/models/attributes/input-constraints/RangeConstraint.d.ts +0 -51
  436. package/lib/models/attributes/input-constraints/RegexConstraint.d.ts +0 -37
  437. package/lib/models/attributes/input-constraints/StringLengthConstraint.d.ts +0 -46
  438. package/lib/models/attributes/input-constraints/XMLConstraint.d.ts +0 -26
  439. package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.d.ts +0 -45
  440. package/lib/models/attributes/layouthint-rules/DependentAttribute.d.ts +0 -57
  441. package/lib/models/attributes/layouthint-rules/LayoutHintRuleCollection.d.ts +0 -27
  442. package/lib/models/attributes/layouthint-rules/RemainingTotalUploadSize.d.ts +0 -17
  443. package/lib/models/base/BaseCollection.d.ts +0 -89
  444. package/lib/models/base/BaseModel.d.ts +0 -78
  445. package/lib/models/base/ResourceCollection.d.ts +0 -20
  446. package/lib/models/base/ResourceModel.d.ts +0 -102
  447. package/lib/models/caseview/CaseViewModel.d.ts +0 -46
  448. package/lib/models/concepts/BusinessScenarioModel.d.ts +0 -20
  449. package/lib/models/concepts/ConceptDetailModel.d.ts +0 -86
  450. package/lib/models/concepts/ConceptIndexModel.d.ts +0 -44
  451. package/lib/models/concepts/ConceptLinkModel.d.ts +0 -82
  452. package/lib/models/concepts/ConceptRelationCollection.d.ts +0 -36
  453. package/lib/models/concepts/ConceptRelationModel.d.ts +0 -61
  454. package/lib/models/concepts/ConceptTypeDetailModel.d.ts +0 -54
  455. package/lib/models/concepts/SourceReferenceCollection.d.ts +0 -14
  456. package/lib/models/concepts/SourceReferenceModel.d.ts +0 -48
  457. package/lib/models/content/ContentIndexModel.d.ts +0 -41
  458. package/lib/models/content/ContentLinkModel.d.ts +0 -102
  459. package/lib/models/content/ContentModel.d.ts +0 -80
  460. package/lib/models/content/ContentTOCModel.d.ts +0 -56
  461. package/lib/models/content/ContentTypeModel.d.ts +0 -26
  462. package/lib/models/content/SectionModel.d.ts +0 -79
  463. package/lib/models/content/SubSectionModel.d.ts +0 -69
  464. package/lib/models/contentconfiguration/ContentConfiguration.d.ts +0 -28
  465. package/lib/models/contentconfiguration/ContentConfigurationElements.d.ts +0 -47
  466. package/lib/models/contentconfiguration/ContentConfigurationEndResults.d.ts +0 -16
  467. package/lib/models/contentconfiguration/ContentConfigurationQuestions.d.ts +0 -22
  468. package/lib/models/contentconfiguration/ContentConfigurationResults.d.ts +0 -39
  469. package/lib/models/detail/DetailModel.d.ts +0 -80
  470. package/lib/models/error/ErrorCollection.d.ts +0 -51
  471. package/lib/models/error/ErrorModel.d.ts +0 -41
  472. package/lib/models/error/ErrorResponse.d.ts +0 -156
  473. package/lib/models/filters/AssignmentFilterModel.d.ts +0 -35
  474. package/lib/models/filters/BaseFilterModel.d.ts +0 -101
  475. package/lib/models/filters/ConceptIndexFilterModel.d.ts +0 -6
  476. package/lib/models/filters/FilterCollection.d.ts +0 -49
  477. package/lib/models/filters/FilterModel.d.ts +0 -5
  478. package/lib/models/filters/RangeFilterModel.d.ts +0 -6
  479. package/lib/models/filters/StringFilterModel.d.ts +0 -30
  480. package/lib/models/form/FormModel.d.ts +0 -350
  481. package/lib/models/form/FormObjectModel.d.ts +0 -210
  482. package/lib/models/grouping/GroupingModel.d.ts +0 -86
  483. package/lib/models/href/Href.d.ts +0 -218
  484. package/lib/models/href/ListHref.d.ts +0 -64
  485. package/lib/models/index.d.ts +0 -96
  486. package/lib/models/layouthint/LayoutHintCollection.d.ts +0 -43
  487. package/lib/models/links/LinkCollection.d.ts +0 -71
  488. package/lib/models/links/LinkModel.d.ts +0 -93
  489. package/lib/models/links/normalizeLinkJSON.d.ts +0 -9
  490. package/lib/models/list/ListDetailModel.d.ts +0 -69
  491. package/lib/models/list/ListHeaderModel.d.ts +0 -53
  492. package/lib/models/list/ListItemCollection.d.ts +0 -21
  493. package/lib/models/list/ListItemModel.d.ts +0 -35
  494. package/lib/models/list/ListModel.d.ts +0 -143
  495. package/lib/models/lookup/LookupOptionCollection.d.ts +0 -15
  496. package/lib/models/lookup/LookupOptionsModel.d.ts +0 -23
  497. package/lib/models/modelcatalog/ModelCatalogModel.d.ts +0 -23
  498. package/lib/models/modelcatalog/ModelCategoryCollection.d.ts +0 -11
  499. package/lib/models/modelcatalog/ModelCategoryModel.d.ts +0 -39
  500. package/lib/models/paging/PagesizeModel.d.ts +0 -25
  501. package/lib/models/paging/PagingModel.d.ts +0 -49
  502. package/lib/models/panels/GroupingPanelModel.d.ts +0 -49
  503. package/lib/models/parameter/Parameter.d.ts +0 -40
  504. package/lib/models/process/ProcessStatusSettingsModel.d.ts +0 -38
  505. package/lib/models/resolveModel.d.ts +0 -7
  506. package/lib/models/search/CaseSearchModel.d.ts +0 -14
  507. package/lib/models/sorting/SortOptionModel.d.ts +0 -48
  508. package/lib/models/sorting/SortingModel.d.ts +0 -42
  509. package/lib/models/tab/TabModel.d.ts +0 -53
  510. package/lib/models/taskgroup/TaskGroupCollection.d.ts +0 -12
  511. package/lib/models/taskgroup/TaskGroupModel.d.ts +0 -25
  512. package/lib/models/types.d.ts +0 -171
  513. package/lib/models/user/UserModel.d.ts +0 -18
  514. package/lib/models/user/UserProfileModel.d.ts +0 -17
  515. package/lib/models/user/UserServicesModel.d.ts +0 -39
  516. package/lib/modularui/Authenticate.d.ts +0 -46
  517. package/lib/modularui/CaptchaRequest.d.ts +0 -54
  518. package/lib/modularui/ModularUIError.d.ts +0 -10
  519. package/lib/modularui/ModularUIRequest.d.ts +0 -207
  520. package/lib/modularui/ModularUIResponse.d.ts +0 -78
  521. package/lib/modularui/UploadRequest.d.ts +0 -41
  522. package/lib/modularui/index.d.ts +0 -5
  523. package/lib/modularui/types.d.ts +0 -2
  524. package/lib/react/ErrorBoundary.d.ts +0 -31
  525. package/lib/react/ErrorBoundaryFallback.d.ts +0 -8
  526. package/lib/react/index.d.ts +0 -2
  527. package/lib/react/utils.d.ts +0 -5
  528. package/lib/react-client/Init.d.ts +0 -6
  529. package/lib/react-client/client.d.ts +0 -25
  530. package/lib/react-client/contextPath.d.ts +0 -1
  531. package/lib/react-client/index.d.ts +0 -3
  532. package/lib/react-client/rehydrate.d.ts +0 -5
  533. package/lib/react-server/contextPath.d.ts +0 -1
  534. package/lib/react-server/createSSRComplete.d.ts +0 -5
  535. package/lib/react-server/htmlpage.d.ts +0 -11
  536. package/lib/react-server/index.d.ts +0 -8
  537. package/lib/react-server/renderSSRComplete.d.ts +0 -13
  538. package/lib/react-server/renderSSRMinimal.d.ts +0 -11
  539. package/lib/react-server/requestInformation.d.ts +0 -6
  540. package/lib/react-server/serverNoSSR.d.ts +0 -15
  541. package/lib/react-server/serverSSR.d.ts +0 -15
  542. package/lib/react-server/serverUtil.d.ts +0 -46
  543. package/lib/react-theme/ThemeProvider.d.ts +0 -8
  544. package/lib/react-theme/createTheme.d.ts +0 -53
  545. package/lib/react-theme/index.d.ts +0 -10
  546. package/lib/react-theme/types.d.ts +0 -13
  547. package/lib/react-theme/useTheme.d.ts +0 -4
  548. package/lib/react-theme/utils/background.d.ts +0 -4
  549. package/lib/react-theme/utils/colors.d.ts +0 -9
  550. package/lib/react-theme/utils/contrast.d.ts +0 -18
  551. package/lib/react-theme/utils/corners.d.ts +0 -3
  552. package/lib/react-theme/utils/spacers.d.ts +0 -9
  553. package/lib/react-theme/utils/themeProps.d.ts +0 -7
  554. package/lib/redux/_i18n/I18nActions.d.ts +0 -7
  555. package/lib/redux/_i18n/I18nReducer.d.ts +0 -7
  556. package/lib/redux/_i18n/index.d.ts +0 -3
  557. package/lib/redux/_i18n/types.d.ts +0 -13
  558. package/lib/redux/_modularui/ModularUIActions.d.ts +0 -26
  559. package/lib/redux/_modularui/ModularUIConnector.d.ts +0 -7
  560. package/lib/redux/_modularui/ModularUIMiddleware.d.ts +0 -7
  561. package/lib/redux/_modularui/ModularUIReducer.d.ts +0 -7
  562. package/lib/redux/_modularui/ModularUISelectors.d.ts +0 -3
  563. package/lib/redux/_modularui/ModularUIUtils.d.ts +0 -5
  564. package/lib/redux/_modularui/index.d.ts +0 -8
  565. package/lib/redux/_modularui/types.d.ts +0 -84
  566. package/lib/redux/_modularui/withModularUI.d.ts +0 -3
  567. package/lib/redux/_router/RouterActions.d.ts +0 -10
  568. package/lib/redux/_router/RouterConnectors.d.ts +0 -6
  569. package/lib/redux/_router/RouterMiddleware.d.ts +0 -5
  570. package/lib/redux/_router/RouterReducer.d.ts +0 -7
  571. package/lib/redux/_router/index.d.ts +0 -5
  572. package/lib/redux/_router/types.d.ts +0 -35
  573. package/lib/redux/actions/Application.d.ts +0 -4
  574. package/lib/redux/actions/Authorization.d.ts +0 -3
  575. package/lib/redux/actions/Error.d.ts +0 -7
  576. package/lib/redux/actions/Form.d.ts +0 -5
  577. package/lib/redux/actions/FormAttributeSet.d.ts +0 -6
  578. package/lib/redux/actions/FormAttributeSetRepeatable.d.ts +0 -6
  579. package/lib/redux/actions/FormAutosave.d.ts +0 -3
  580. package/lib/redux/actions/FormAutosubmit.d.ts +0 -4
  581. package/lib/redux/actions/FormAutoupdate.d.ts +0 -4
  582. package/lib/redux/actions/FormValidations.d.ts +0 -3
  583. package/lib/redux/actions/Modals.d.ts +0 -4
  584. package/lib/redux/actions/ModelCatalog.d.ts +0 -2
  585. package/lib/redux/actions/Notification.d.ts +0 -10
  586. package/lib/redux/actions/Preferences.d.ts +0 -11
  587. package/lib/redux/actions/ProgressIndicator.d.ts +0 -8
  588. package/lib/redux/actions/SignIn.d.ts +0 -10
  589. package/lib/redux/actions/SignOut.d.ts +0 -4
  590. package/lib/redux/actions/index.d.ts +0 -16
  591. package/lib/redux/connectors/Application.d.ts +0 -4
  592. package/lib/redux/connectors/Breadcrumb.d.ts +0 -3
  593. package/lib/redux/connectors/CaseView.d.ts +0 -4
  594. package/lib/redux/connectors/ConceptDetail.d.ts +0 -4
  595. package/lib/redux/connectors/ContentBrowser.d.ts +0 -4
  596. package/lib/redux/connectors/ContentDetail.d.ts +0 -4
  597. package/lib/redux/connectors/ContentDetailSection.d.ts +0 -4
  598. package/lib/redux/connectors/Form.d.ts +0 -16
  599. package/lib/redux/connectors/FormAttributeSet.d.ts +0 -5
  600. package/lib/redux/connectors/ListDetail.d.ts +0 -4
  601. package/lib/redux/connectors/Modal.d.ts +0 -4
  602. package/lib/redux/connectors/ModelCatalog.d.ts +0 -4
  603. package/lib/redux/connectors/Notification.d.ts +0 -4
  604. package/lib/redux/connectors/PanelRenderer.d.ts +0 -4
  605. package/lib/redux/connectors/Preferences.d.ts +0 -2
  606. package/lib/redux/connectors/Progress.d.ts +0 -3
  607. package/lib/redux/connectors/ProgressIndicator.d.ts +0 -3
  608. package/lib/redux/connectors/QuickSearch.d.ts +0 -11
  609. package/lib/redux/connectors/SignIn.d.ts +0 -4
  610. package/lib/redux/connectors/SignOut.d.ts +0 -4
  611. package/lib/redux/connectors/Tab.d.ts +0 -4
  612. package/lib/redux/connectors/index.d.ts +0 -21
  613. package/lib/redux/index.d.ts +0 -9
  614. package/lib/redux/reducers/AuthReducer.d.ts +0 -8
  615. package/lib/redux/reducers/ErrorReducer.d.ts +0 -8
  616. package/lib/redux/reducers/ModalsReducer.d.ts +0 -8
  617. package/lib/redux/reducers/ModelCatalogReducer.d.ts +0 -8
  618. package/lib/redux/reducers/NotificationReducer.d.ts +0 -8
  619. package/lib/redux/reducers/PreferencesReducer.d.ts +0 -8
  620. package/lib/redux/reducers/ProgressIndicatorReducer.d.ts +0 -8
  621. package/lib/redux/reducers/createReducer.d.ts +0 -14
  622. package/lib/redux/reducers/index.d.ts +0 -8
  623. package/lib/redux/selectors/i18n.d.ts +0 -4
  624. package/lib/redux/selectors/index.d.ts +0 -2
  625. package/lib/redux/selectors/modelcatalog.d.ts +0 -2
  626. package/lib/redux/store/beforeRenderHooks.d.ts +0 -7
  627. package/lib/redux/store/configureStore.d.ts +0 -9
  628. package/lib/redux/types.d.ts +0 -113
  629. package/lib/utils/browser/Cache.d.ts +0 -45
  630. package/lib/utils/browser/Cookies.d.ts +0 -9
  631. package/lib/utils/datetime/DateTimeUtil.d.ts +0 -214
  632. package/lib/utils/fetch/__mocks__/universalFetch.d.ts +0 -3
  633. package/lib/utils/fetch/serverFetch.d.ts +0 -5
  634. package/lib/utils/fetch/types.d.ts +0 -44
  635. package/lib/utils/fetch/universalFetch.d.ts +0 -7
  636. package/lib/utils/fetch/xhr.d.ts +0 -5
  637. package/lib/utils/helpers/checkResource.d.ts +0 -3
  638. package/lib/utils/helpers/createHash.d.ts +0 -9
  639. package/lib/utils/helpers/createHref.d.ts +0 -8
  640. package/lib/utils/helpers/createUUID.d.ts +0 -4
  641. package/lib/utils/helpers/index.d.ts +0 -8
  642. package/lib/utils/helpers/objects.d.ts +0 -11
  643. package/lib/utils/helpers/repositoryResource.d.ts +0 -1
  644. package/lib/utils/helpers/sanitizeHtml.d.ts +0 -9
  645. package/lib/utils/helpers/text.d.ts +0 -7
  646. package/lib/utils/index.d.ts +0 -11
  647. package/lib/utils/number/DecimalFormat.d.ts +0 -90
  648. package/lib/utils/number/formatValue.d.ts +0 -4
  649. package/lib/utils/number/parseNumbers.d.ts +0 -9
package/CHANGELOG.md CHANGED
@@ -2,6 +2,25 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
4
4
 
5
+ ## [1.63.0](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.62.8...v1.63.0) (2025-07-02)
6
+
7
+
8
+ ### Features
9
+
10
+ * **content:** handle rename of childSections to sections ([8ba3298](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/8ba329856ca539c2e24f77c91992134a293667e4))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **server-request:** escape deeplink ([07c24a7](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/07c24a727806e7cfe3b2fc154886e9187ca93759))
16
+
17
+ ## [1.62.9](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.62.8...v1.62.9) (2025-06-30)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **server-request:** escape deeplink ([07c24a7](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/07c24a727806e7cfe3b2fc154886e9187ca93759))
23
+
5
24
  ## [1.62.8](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.62.7...v1.62.8) (2025-06-27)
6
25
 
7
26
 
@@ -55,7 +55,7 @@ const json = {
55
55
  href: "/content/_Context/Police%20incident%20decisions/Content/Breath%20analysis/Breathalyzer%20test.formalsource/Alert.%3A-",
56
56
  },
57
57
  },
58
- childSections: [
58
+ sections: [
59
59
  {
60
60
  id: "pass",
61
61
  label: "Pass",
@@ -94,14 +94,19 @@ class SectionModel extends BaseModel {
94
94
  * Retrieve child section links
95
95
  */
96
96
  get childSectionLinks() {
97
- var _context;
98
- return this.data.childSections ? _mapInstanceProperty(_context = this.data.childSections).call(_context, childSection => new ContentLinkModel({
97
+ let sections = [];
98
+ if (this.data.childSections) {
99
+ sections = this.data.childSections;
100
+ } else if (this.data.sections) {
101
+ sections = this.data.sections;
102
+ }
103
+ return _mapInstanceProperty(sections).call(sections, childSection => new ContentLinkModel({
99
104
  section: childSection.id || childSection._id,
100
105
  _id: childSection.id || childSection._id,
101
106
  label: childSection.label,
102
107
  sourceLabel: childSection.sourceLabel,
103
108
  _links: childSection._links
104
- }, this.entryDate, this.modelOptions)) : [];
109
+ }, this.entryDate, this.modelOptions));
105
110
  }
106
111
 
107
112
  /**
@@ -120,11 +125,17 @@ class SectionModel extends BaseModel {
120
125
  * Get tree of child sections
121
126
  */
122
127
  get childSections() {
123
- if (!this._childSections && this.data.childSections) {
124
- var _context2, _context3;
125
- this._childSections = _mapInstanceProperty(_context2 = _filterInstanceProperty(_context3 = this.data.childSections).call(_context3, childSection => "body" in childSection)).call(_context2, childSection => new SectionModel(childSection, this.entryDate, this.modelOptions));
128
+ if (!this._childSections) {
129
+ var _context;
130
+ let sections = [];
131
+ if (this.data.childSections) {
132
+ sections = this.data.childSections;
133
+ } else if (this.data.sections) {
134
+ sections = this.data.sections;
135
+ }
136
+ this._childSections = _mapInstanceProperty(_context = _filterInstanceProperty(sections).call(sections, childSection => "body" in childSection)).call(_context, childSection => new SectionModel(childSection, this.entryDate, this.modelOptions));
126
137
  }
127
- return this._childSections || [];
138
+ return this._childSections;
128
139
  }
129
140
 
130
141
  /**
@@ -138,8 +149,8 @@ class SectionModel extends BaseModel {
138
149
  */
139
150
  get sections() {
140
151
  if (this.data.sections) {
141
- var _context4;
142
- return _mapInstanceProperty(_context4 = this.data.sections).call(_context4, section => new SectionModel(section, this.entryDate, this.modelOptions));
152
+ var _context2;
153
+ return _mapInstanceProperty(_context2 = this.data.sections).call(_context2, section => new SectionModel(section, this.entryDate, this.modelOptions));
143
154
  }
144
155
  return [];
145
156
  }
@@ -147,8 +158,8 @@ class SectionModel extends BaseModel {
147
158
  * Get sub sections
148
159
  */
149
160
  get subSections() {
150
- var _context5;
151
- return this.data.subSections ? _mapInstanceProperty(_context5 = this.data.subSections).call(_context5, subSection => new SubSectionModel(subSection, this.entryDate, this.modelOptions)) : [];
161
+ var _context3;
162
+ return this.data.subSections ? _mapInstanceProperty(_context3 = this.data.subSections).call(_context3, subSection => new SubSectionModel(subSection, this.entryDate, this.modelOptions)) : [];
152
163
  }
153
164
 
154
165
  /**
@@ -108,22 +108,27 @@ class SectionModel extends BaseModel {
108
108
  * Retrieve child section links
109
109
  */
110
110
  get childSectionLinks(): Array<ContentLinkModel> {
111
- return this.data.childSections
112
- ? this.data.childSections.map(
113
- (childSection) =>
114
- new ContentLinkModel(
115
- {
116
- section: childSection.id || childSection._id,
117
- _id: childSection.id || childSection._id,
118
- label: childSection.label,
119
- sourceLabel: childSection.sourceLabel,
120
- _links: childSection._links,
121
- },
122
- this.entryDate,
123
- this.modelOptions,
124
- ),
125
- )
126
- : [];
111
+ let sections = [];
112
+ if (this.data.childSections) {
113
+ sections = this.data.childSections;
114
+ } else if (this.data.sections) {
115
+ sections = this.data.sections;
116
+ }
117
+
118
+ return sections.map(
119
+ (childSection) =>
120
+ new ContentLinkModel(
121
+ {
122
+ section: childSection.id || childSection._id,
123
+ _id: childSection.id || childSection._id,
124
+ label: childSection.label,
125
+ sourceLabel: childSection.sourceLabel,
126
+ _links: childSection._links,
127
+ },
128
+ this.entryDate,
129
+ this.modelOptions,
130
+ ),
131
+ );
127
132
  }
128
133
 
129
134
  /**
@@ -146,15 +151,23 @@ class SectionModel extends BaseModel {
146
151
  * Get tree of child sections
147
152
  */
148
153
  get childSections(): Array<SectionModel> {
149
- if (!this._childSections && this.data.childSections) {
150
- this._childSections = this.data.childSections
154
+ if (!this._childSections) {
155
+ let sections = [];
156
+ if (this.data.childSections) {
157
+ sections = this.data.childSections;
158
+ } else if (this.data.sections) {
159
+ sections = this.data.sections;
160
+ }
161
+
162
+ this._childSections = sections
151
163
  .filter((childSection) => "body" in childSection)
152
164
  .map(
153
165
  (childSection) =>
154
166
  new SectionModel(childSection, this.entryDate, this.modelOptions),
155
167
  );
156
168
  }
157
- return this._childSections || [];
169
+
170
+ return this._childSections;
158
171
  }
159
172
 
160
173
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"SectionModel.js","names":["BaseModel","ContentLinkModel","SubSectionModel","createHashFromHref","LinkModel","retrieveText","SectionModel","constructor","data","entryDate","modelOptions","_defineProperty","_entryDate","referred","selflink","_selflink","_links","self","selfhref","href","type","sourceLabel","id","_id","key","label","getData","number","body","childSectionLinks","_context","childSections","_mapInstanceProperty","call","childSection","section","selfContentLink","_childSections","_context2","_context3","_filterInstanceProperty","sections","_context4","subSections","_context5","subSection","referenceHash","getReferredSections","push","referredChilds"],"sources":["../../../src/models/content/SectionModel.js"],"sourcesContent":["// @flow\nimport BaseModel from \"../base/BaseModel\";\nimport ContentLinkModel from \"./ContentLinkModel\";\nimport SubSectionModel from \"./SubSectionModel\";\n\nimport { createHashFromHref } from \"../../utils/helpers/createHash\";\nimport LinkModel from \"../links/LinkModel\";\n\nimport { retrieveText } from \"../../utils\";\n\nimport type Href from \"../href/Href\";\nimport type { ModelOptions } from \"../types\";\n\n/**\n */\nclass SectionModel extends BaseModel {\n _entryDate: ISO_DATE | null;\n _selflink: ?LinkModel;\n _childSections: Array<SectionModel>;\n\n constructor(\n data: Object,\n entryDate: ISO_DATE | null,\n modelOptions?: ModelOptions,\n ) {\n super(data, {}, modelOptions);\n\n this._entryDate = entryDate;\n }\n\n /**\n */\n get referred(): boolean {\n return this.data.referred;\n }\n\n /**\n */\n get selflink(): LinkModel {\n if (!this._selflink) {\n this._selflink = new LinkModel(\n this.data._links?.self,\n null,\n this.modelOptions,\n );\n }\n return this._selflink;\n }\n\n /**\n */\n get selfhref(): Href {\n return this.selflink.href;\n }\n\n /**\n */\n get entryDate(): ISO_DATE | null {\n return this._entryDate;\n }\n\n /**\n */\n get type(): string {\n return this.data.type;\n }\n\n /**\n */\n get sourceLabel(): string {\n return this.data.sourceLabel;\n }\n\n /**\n */\n get id(): string {\n return this.data.id || this.data._id;\n }\n\n /**\n */\n get key(): string {\n return this.id;\n }\n\n /**\n * Get content label\n */\n get label(): string {\n return this.getData(\"label\", \"\");\n }\n\n /**\n * Retrieve number of section\n */\n get number(): string | null {\n return this.data.number ?? null;\n }\n\n /**\n * Get content body\n */\n get body(): ?string {\n return retrieveText(this.data.body);\n }\n\n /**\n * Retrieve child section links\n */\n get childSectionLinks(): Array<ContentLinkModel> {\n return this.data.childSections\n ? this.data.childSections.map(\n (childSection) =>\n new ContentLinkModel(\n {\n section: childSection.id || childSection._id,\n _id: childSection.id || childSection._id,\n label: childSection.label,\n sourceLabel: childSection.sourceLabel,\n _links: childSection._links,\n },\n this.entryDate,\n this.modelOptions,\n ),\n )\n : [];\n }\n\n /**\n */\n get selfContentLink(): ContentLinkModel {\n return new ContentLinkModel(\n {\n section: this.id,\n _id: this.id,\n label: this.data.label,\n sourceLabel: this.data.sourceLabel,\n _links: this.data._links,\n },\n this.entryDate,\n this.modelOptions,\n );\n }\n\n /**\n * Get tree of child sections\n */\n get childSections(): Array<SectionModel> {\n if (!this._childSections && this.data.childSections) {\n this._childSections = this.data.childSections\n .filter((childSection) => \"body\" in childSection)\n .map(\n (childSection) =>\n new SectionModel(childSection, this.entryDate, this.modelOptions),\n );\n }\n return this._childSections || [];\n }\n\n /**\n * set resolved child sections\n */\n set childSections(sections: Array<SectionModel>) {\n this._childSections = sections || [];\n }\n\n /**\n */\n get sections(): Array<SectionModel> {\n if (this.data.sections) {\n return this.data.sections.map(\n (section) =>\n new SectionModel(section, this.entryDate, this.modelOptions),\n );\n }\n return [];\n }\n /**\n * Get sub sections\n */\n get subSections(): Array<SubSectionModel> {\n return this.data.subSections\n ? this.data.subSections.map(\n (subSection) =>\n new SubSectionModel(subSection, this.entryDate, this.modelOptions),\n )\n : [];\n }\n\n /**\n */\n get referenceHash(): number {\n return createHashFromHref(this.selfhref);\n }\n\n /**\n */\n getReferredSections(): Array<SubSectionModel | SectionModel> {\n const sections = [];\n\n for (const subSection of this.subSections) {\n if (subSection.referred) {\n sections.push(subSection);\n }\n\n const referredChilds = subSection.getReferredSections();\n sections.push(...referredChilds);\n }\n\n for (const childSection of this.childSections) {\n if (childSection.referred) {\n sections.push(childSection);\n }\n\n const referredChilds = childSection.getReferredSections();\n sections.push(...referredChilds);\n }\n\n return sections;\n }\n}\n\nexport default SectionModel;\n"],"mappings":";;;AACA,OAAOA,SAAS,MAAM,mBAAmB;AACzC,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,eAAe,MAAM,mBAAmB;AAE/C,SAASC,kBAAkB,QAAQ,gCAAgC;AACnE,OAAOC,SAAS,MAAM,oBAAoB;AAE1C,SAASC,YAAY,QAAQ,aAAa;AAK1C;AACA;AACA,MAAMC,YAAY,SAASN,SAAS,CAAC;EAKnCO,WAAWA,CACTC,IAAY,EACZC,SAA0B,EAC1BC,YAA2B,EAC3B;IACA,KAAK,CAACF,IAAI,EAAE,CAAC,CAAC,EAAEE,YAAY,CAAC;IAACC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAE9B,IAAI,CAACC,UAAU,GAAGH,SAAS;EAC7B;;EAEA;AACF;EACE,IAAII,QAAQA,CAAA,EAAY;IACtB,OAAO,IAAI,CAACL,IAAI,CAACK,QAAQ;EAC3B;;EAEA;AACF;EACE,IAAIC,QAAQA,CAAA,EAAc;IACxB,IAAI,CAAC,IAAI,CAACC,SAAS,EAAE;MACnB,IAAI,CAACA,SAAS,GAAG,IAAIX,SAAS,CAC5B,IAAI,CAACI,IAAI,CAACQ,MAAM,EAAEC,IAAI,EACtB,IAAI,EACJ,IAAI,CAACP,YACP,CAAC;IACH;IACA,OAAO,IAAI,CAACK,SAAS;EACvB;;EAEA;AACF;EACE,IAAIG,QAAQA,CAAA,EAAS;IACnB,OAAO,IAAI,CAACJ,QAAQ,CAACK,IAAI;EAC3B;;EAEA;AACF;EACE,IAAIV,SAASA,CAAA,EAAoB;IAC/B,OAAO,IAAI,CAACG,UAAU;EACxB;;EAEA;AACF;EACE,IAAIQ,IAAIA,C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AAQ;EACjB;AACF;AAEA,eAAenC,YAAY","ignoreList":[]}
1
+ {"version":3,"file":"SectionModel.js","names":["BaseModel","ContentLinkModel","SubSectionModel","createHashFromHref","LinkModel","retrieveText","SectionModel","constructor","data","entryDate","modelOptions","_defineProperty","_entryDate","referred","selflink","_selflink","_links","self","selfhref","href","type","sourceLabel","id","_id","key","label","getData","number","body","childSectionLinks","sections","childSections","_mapInstanceProperty","call","childSection","section","selfContentLink","_childSections","_context","_filterInstanceProperty","_context2","subSections","_context3","subSection","referenceHash","getReferredSections","push","referredChilds"],"sources":["../../../src/models/content/SectionModel.js"],"sourcesContent":["// @flow\nimport BaseModel from \"../base/BaseModel\";\nimport ContentLinkModel from \"./ContentLinkModel\";\nimport SubSectionModel from \"./SubSectionModel\";\n\nimport { createHashFromHref } from \"../../utils/helpers/createHash\";\nimport LinkModel from \"../links/LinkModel\";\n\nimport { retrieveText } from \"../../utils\";\n\nimport type Href from \"../href/Href\";\nimport type { ModelOptions } from \"../types\";\n\n/**\n */\nclass SectionModel extends BaseModel {\n _entryDate: ISO_DATE | null;\n _selflink: ?LinkModel;\n _childSections: Array<SectionModel>;\n\n constructor(\n data: Object,\n entryDate: ISO_DATE | null,\n modelOptions?: ModelOptions,\n ) {\n super(data, {}, modelOptions);\n\n this._entryDate = entryDate;\n }\n\n /**\n */\n get referred(): boolean {\n return this.data.referred;\n }\n\n /**\n */\n get selflink(): LinkModel {\n if (!this._selflink) {\n this._selflink = new LinkModel(\n this.data._links?.self,\n null,\n this.modelOptions,\n );\n }\n return this._selflink;\n }\n\n /**\n */\n get selfhref(): Href {\n return this.selflink.href;\n }\n\n /**\n */\n get entryDate(): ISO_DATE | null {\n return this._entryDate;\n }\n\n /**\n */\n get type(): string {\n return this.data.type;\n }\n\n /**\n */\n get sourceLabel(): string {\n return this.data.sourceLabel;\n }\n\n /**\n */\n get id(): string {\n return this.data.id || this.data._id;\n }\n\n /**\n */\n get key(): string {\n return this.id;\n }\n\n /**\n * Get content label\n */\n get label(): string {\n return this.getData(\"label\", \"\");\n }\n\n /**\n * Retrieve number of section\n */\n get number(): string | null {\n return this.data.number ?? null;\n }\n\n /**\n * Get content body\n */\n get body(): ?string {\n return retrieveText(this.data.body);\n }\n\n /**\n * Retrieve child section links\n */\n get childSectionLinks(): Array<ContentLinkModel> {\n let sections = [];\n if (this.data.childSections) {\n sections = this.data.childSections;\n } else if (this.data.sections) {\n sections = this.data.sections;\n }\n\n return sections.map(\n (childSection) =>\n new ContentLinkModel(\n {\n section: childSection.id || childSection._id,\n _id: childSection.id || childSection._id,\n label: childSection.label,\n sourceLabel: childSection.sourceLabel,\n _links: childSection._links,\n },\n this.entryDate,\n this.modelOptions,\n ),\n );\n }\n\n /**\n */\n get selfContentLink(): ContentLinkModel {\n return new ContentLinkModel(\n {\n section: this.id,\n _id: this.id,\n label: this.data.label,\n sourceLabel: this.data.sourceLabel,\n _links: this.data._links,\n },\n this.entryDate,\n this.modelOptions,\n );\n }\n\n /**\n * Get tree of child sections\n */\n get childSections(): Array<SectionModel> {\n if (!this._childSections) {\n let sections = [];\n if (this.data.childSections) {\n sections = this.data.childSections;\n } else if (this.data.sections) {\n sections = this.data.sections;\n }\n\n this._childSections = sections\n .filter((childSection) => \"body\" in childSection)\n .map(\n (childSection) =>\n new SectionModel(childSection, this.entryDate, this.modelOptions),\n );\n }\n\n return this._childSections;\n }\n\n /**\n * set resolved child sections\n */\n set childSections(sections: Array<SectionModel>) {\n this._childSections = sections || [];\n }\n\n /**\n */\n get sections(): Array<SectionModel> {\n if (this.data.sections) {\n return this.data.sections.map(\n (section) =>\n new SectionModel(section, this.entryDate, this.modelOptions),\n );\n }\n return [];\n }\n /**\n * Get sub sections\n */\n get subSections(): Array<SubSectionModel> {\n return this.data.subSections\n ? this.data.subSections.map(\n (subSection) =>\n new SubSectionModel(subSection, this.entryDate, this.modelOptions),\n )\n : [];\n }\n\n /**\n */\n get referenceHash(): number {\n return createHashFromHref(this.selfhref);\n }\n\n /**\n */\n getReferredSections(): Array<SubSectionModel | SectionModel> {\n const sections = [];\n\n for (const subSection of this.subSections) {\n if (subSection.referred) {\n sections.push(subSection);\n }\n\n const referredChilds = subSection.getReferredSections();\n sections.push(...referredChilds);\n }\n\n for (const childSection of this.childSections) {\n if (childSection.referred) {\n sections.push(childSection);\n }\n\n const referredChilds = childSection.getReferredSections();\n sections.push(...referredChilds);\n }\n\n return sections;\n }\n}\n\nexport default SectionModel;\n"],"mappings":";;;AACA,OAAOA,SAAS,MAAM,mBAAmB;AACzC,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,eAAe,MAAM,mBAAmB;AAE/C,SAASC,kBAAkB,QAAQ,gCAAgC;AACnE,OAAOC,SAAS,MAAM,oBAAoB;AAE1C,SAASC,YAAY,QAAQ,aAAa;AAK1C;AACA;AACA,MAAMC,YAAY,SAASN,SAAS,CAAC;EAKnCO,WAAWA,CACTC,IAAY,EACZC,SAA0B,EAC1BC,YAA2B,EAC3B;IACA,KAAK,CAACF,IAAI,EAAE,CAAC,CAAC,EAAEE,YAAY,CAAC;IAACC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAE9B,IAAI,CAACC,UAAU,GAAGH,SAAS;EAC7B;;EAEA;AACF;EACE,IAAII,QAAQA,CAAA,EAAY;IACtB,OAAO,IAAI,CAACL,IAAI,CAACK,QAAQ;EAC3B;;EAEA;AACF;EACE,IAAIC,QAAQA,CAAA,EAAc;IACxB,IAAI,CAAC,IAAI,CAACC,SAAS,EAAE;MACnB,IAAI,CAACA,SAAS,GAAG,IAAIX,SAAS,CAC5B,IAAI,CAACI,IAAI,CAACQ,MAAM,EAAEC,IAAI,EACtB,IAAI,EACJ,IAAI,CAACP,YACP,CAAC;IACH;IACA,OAAO,IAAI,CAACK,SAAS;EACvB;;EAEA;AACF;EACE,IAAIG,QAAQA,CAAA,EAAS;IACnB,OAAO,IAAI,CAACJ,QAAQ,CAACK,IAAI;EAC3B;;EAEA;AACF;EACE,IAAIV,SAASA,CAAA,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AC;MAC3B;MAEA,MAAMI,cAAc,GAAGJ,UAAU,CAACE,mBAAmB,CAAC,CAAC;MACvDf,QAAQ,CAACgB,IAAI,CAAC,GAAGC,cAAc,CAAC;IAClC;IAEA,KAAK,MAAMb,YAAY,IAAI,IAAI,CAACH,aAAa,EAAE;MAC7C,IAAIG,YAAY,CAACrB,QAAQ,EAAE;QACzBiB,QAAQ,CAACgB,IAAI,CAACZ,YAAY,CAAC;MAC7B;MAEA,MAAMa,cAAc,GAAGb,YAAY,CAACW,mBAAmB,CAAC,CAAC;MACzDf,QAAQ,CAACgB,IAAI,CAAC,GAAGC,cAAc,CAAC;IAClC;IAEA,OAAOjB,QAAQ;EACjB;AACF;AAEA,eAAexB,YAAY","ignoreList":[]}
@@ -8,6 +8,7 @@ import content from "./content.json";
8
8
  import contentWithSubsections from "./content-with-subsections.json";
9
9
  import contentWithSubsections2 from "./content-with-subsections2.json";
10
10
  import contentWithChildsections from "./content-with-childsections.json";
11
+ import contentWithSections from "./content-with-sections.json";
11
12
  import ContentLinkModel from "../ContentLinkModel";
12
13
 
13
14
  describe("contentmodel", () => {
@@ -119,6 +120,40 @@ describe("contentmodel", () => {
119
120
  );
120
121
  });
121
122
 
123
+ it("can handle content service with sections", () => {
124
+ const response = ModularUIResponse.create({
125
+ key: "contentmodel",
126
+ data: contentWithSections,
127
+ contributions,
128
+ });
129
+
130
+ expect(ContentModel.isApplicableModel(response)).toBe(true);
131
+
132
+ const contentModel = new ContentModel(response);
133
+ expect(contentModel.getInitialChildModelLinks()).toHaveLength(0);
134
+
135
+ expect(contentModel.id).toBe("uitslag");
136
+
137
+ expect(contentModel.childSectionLinks).toHaveLength(4);
138
+ expect(contentModel.childSections).toHaveLength(0);
139
+ expect(contentModel.subSections).toHaveLength(0);
140
+ expect(contentModel.relatedConceptsHrefs).toHaveLength(1);
141
+ expect(contentModel.relatedConceptsHref.href.toString()).toBe(
142
+ "/content/Incident/Business design/Content/Blaastest.textilesource/uitslag/relatedConcepts?entryDate=2021-08-31",
143
+ );
144
+ expect(contentModel.referenceHash).toBe(8236987459042);
145
+
146
+ const firstChildSectionLink = contentModel.childSectionLinks[0];
147
+ expect(firstChildSectionLink instanceof ContentLinkModel).toBe(true);
148
+
149
+ expect(firstChildSectionLink.key).toBe("pass");
150
+ expect(firstChildSectionLink.label).toBe("Pass");
151
+ expect(firstChildSectionLink.sourceLabel).toBeNull();
152
+ expect(firstChildSectionLink.encodedHref.toString()).toBe(
153
+ "/content/Incident%2FBusiness%20design%2FContent%2FBlaastest.textilesource/pass?entryDate=2021-08-31",
154
+ );
155
+ });
156
+
122
157
  it("can handle content service with subsections and correct related concepts", () => {
123
158
  const response = ModularUIResponse.create({
124
159
  key: "contentmodel",
@@ -201,7 +201,8 @@ export type SectionData = {
201
201
  number?: string,
202
202
  body: string | { id?: string, message: string, properties?: Object },
203
203
  _links: { self: { href: string } },
204
- childSections: Array<SectionData>,
204
+ childSections?: Array<SectionData>,
205
+ sections?: Array<SectionData>,
205
206
  subSections: Array<SectionData>,
206
207
  };
207
208
 
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../src/models/types.js"],"sourcesContent":["// @flow\nimport type ApplicationModel from \"./application/ApplicationModel\";\nimport type BooleanAttributeModel from \"./attributes/BooleanAttributeModel\";\nimport type CaptchaAttributeModel from \"./attributes/CaptchaAttributeModel\";\nimport type ChoiceAttributeModel from \"./attributes/ChoiceAttributeModel\";\nimport type CompositeAttributeModel from \"./attributes/CompositeAttributeModel\";\nimport type DatetimeAttributeModel from \"./attributes/DatetimeAttributeModel\";\nimport type HelptextAttributeModel from \"./attributes/HelptextAttributeModel\";\nimport type LabelAttributeModel from \"./attributes/LabelAttributeModel\";\nimport type MemoAttributeModel from \"./attributes/MemoAttributeModel\";\nimport type MoneyAttributeModel from \"./attributes/MoneyAttributeModel\";\nimport type NumberAttributeModel from \"./attributes/NumberAttributeModel\";\nimport type PasswordAttributeModel from \"./attributes/PasswordAttributeModel\";\nimport type StringAttributeModel from \"./attributes/StringAttributeModel\";\nimport type UploadAttributeModel from \"./attributes/UploadAttributeModel\";\nimport type XMLAttributeModel from \"./attributes/XMLAttributeModel\";\nimport type CaseViewModel from \"./caseview/CaseViewModel\";\nimport type BusinessScenarioModel from \"./concepts/BusinessScenarioModel\";\nimport type ConceptDetailModel from \"./concepts/ConceptDetailModel\";\nimport type ConceptIndexModel from \"./concepts/ConceptIndexModel\";\nimport type ConceptTypeDetailModel from \"./concepts/ConceptTypeDetailModel\";\nimport type ContentIndexModel from \"./content/ContentIndexModel\";\nimport type ContentModel from \"./content/ContentModel\";\nimport type SectionModel from \"./content/SectionModel\";\nimport type ContentTOCModel from \"./content/ContentTOCModel\";\nimport type ContentTypeModel from \"./content/ContentTypeModel\";\nimport type DetailModel from \"./detail/DetailModel\";\nimport type AssignmentFilterModel from \"./filters/AssignmentFilterModel\";\nimport type FilterModel from \"./filters/FilterModel\";\nimport type RangeFilterModel from \"./filters/RangeFilterModel\";\nimport type ConceptIndexFilterModel from \"./filters/ConceptIndexFilterModel\";\nimport type FormModel from \"./form/FormModel\";\nimport type ListDetailModel from \"./list/ListDetailModel\";\nimport type ListModel from \"./list/ListModel\";\nimport type ModelCatalogModel from \"./modelcatalog/ModelCatalogModel\";\nimport type GroupingPanelModel from \"./panels/GroupingPanelModel\";\nimport type CaseSearchModel from \"./search/CaseSearchModel\";\nimport type TabModel from \"./tab/TabModel\";\nimport type TaskGroupModel from \"./taskgroup/TaskGroupModel\";\nimport type UserModel from \"./user/UserModel\";\nimport type UserServicesModel from \"./user/UserServicesModel\";\nimport type LinkModel from \"./links/LinkModel\";\nimport type LookupOptionsModel from \"./lookup/LookupOptionsModel\";\nimport type BaseFilterModel from \"./filters/BaseFilterModel\";\nimport type AttributeCollection from \"./attributes/AttributeCollection\";\nimport type AttributeModel from \"./attributes/AttributeModel\";\nimport type LayoutHintCollection from \"./layouthint/LayoutHintCollection\";\nimport type ErrorResponse from \"./error/ErrorResponse\";\n\nexport type ModularUIModel =\n | ApplicationModel\n | CaseSearchModel\n | CaseViewModel\n | ListDetailModel\n | DetailModel\n | FormModel\n | GroupingPanelModel\n | ListModel\n | TabModel\n | TaskGroupModel\n | UserModel\n | UserServicesModel\n | ModelCatalogModel\n | ConceptIndexModel\n | ConceptDetailModel\n | BusinessScenarioModel\n | ConceptTypeDetailModel\n | ContentIndexModel\n | ContentTOCModel\n | ContentModel\n | ContentTypeModel\n | LookupOptionsModel;\n\nexport type AttributeType =\n | BooleanAttributeModel\n | CaptchaAttributeModel\n | ChoiceAttributeModel\n | DatetimeAttributeModel\n | HelptextAttributeModel\n | LabelAttributeModel\n | MemoAttributeModel\n | MoneyAttributeModel\n | NumberAttributeModel\n | PasswordAttributeModel\n | CompositeAttributeModel\n | StringAttributeModel\n | UploadAttributeModel\n | XMLAttributeModel;\n\nexport type RangeChildAttributeType =\n | NumberAttributeModel\n | DatetimeAttributeModel;\n\nexport type FilterType =\n | BaseFilterModel\n | FilterModel\n | AssignmentFilterModel\n | RangeFilterModel\n | ConceptIndexFilterModel;\n\nexport type FormErrorAnchor = {\n id: string,\n properties?: {\n [propertyName: string]: string | number,\n },\n anchor?: {\n objectid: string,\n elementid?: string,\n _links?: Object,\n index?: number,\n \"index-identifier\"?: string,\n },\n layouthint: LayoutHintCollection,\n message: string,\n param?: {\n name: string,\n },\n};\n\nexport type labelsJSON = {\n _id: string,\n label: string,\n value: string,\n};\n\nexport type propertyJSON = {\n _id: string,\n type: string,\n mandatory: string,\n label: string,\n value: string,\n};\n\nexport type textfragmentJSON = {\n label: string,\n text: string,\n type: string,\n};\n\nexport interface IConstraintModel {\n +id: string;\n +defaultMessage: string;\n +parameters: Object;\n +isMandatoryConstraint: boolean;\n validate(value: any): boolean;\n hasValidation(): boolean;\n}\n\nexport interface ILayoutHintRule {\n process(attribute: AttributeModel, attributes: AttributeCollection): void;\n}\n\nexport interface IModelWithChildModels {\n getInitialChildModelLinks(): Array<LinkModel>;\n setChildModels(\n models: Array<ModularUIModel>,\n errors: Array<ErrorResponse>,\n ): void;\n}\n\nexport type AuthenticationType = {\n name: string,\n authentication: string,\n redirectUri?: string,\n isPrimary: boolean,\n};\n\nexport type FileEntryType = {\n name: string,\n size?: number,\n progress: number,\n error?: string,\n token?: string,\n};\n\nexport type FilesType = {\n [filename: string]: FileEntryType,\n};\n\nexport type FiletypeConstraintsType = Array<{|\n extensions: Array<string>,\n mimeTypes: Array<string>,\n|}>;\n\nexport type FilesizeConstraintsType = {\n fileSize: ?number,\n maxTotalFileSize: ?number,\n isMaxTotal: boolean,\n};\n\nexport type PropertyData = { type: string, label: string, value: string };\nexport type TextFragmentData = {\n type: string,\n label: string,\n text: string | { id?: string, message: string, properties?: Object },\n};\nexport type SectionData = {\n id: string,\n type: string,\n label?: string,\n number?: string,\n body: string | { id?: string, message: string, properties?: Object },\n _links: { self: { href: string } },\n childSections: Array<SectionData>,\n subSections: Array<SectionData>,\n};\n\nexport type PropertyElement = {\n propertyElement: {\n label: string,\n layouthint: Array<string>,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElement = {\n textFragmentElement: {\n label: string,\n layouthint: Array<string>,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElement = {\n contentElement: {\n label: string,\n layouthint: Array<string>,\n sections: Array<SectionData>,\n },\n};\n\nexport type PropertyElementMapped = {\n propertyElement: {\n label: string,\n layouthint: LayoutHintCollection,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElementMapped = {\n textFragmentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElementMapped = {\n contentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n sections: Array<SectionModel>,\n },\n};\n\nexport type ContentAll = Array<\n PropertyElementMapped | TextFragmentElementMapped | ContentElementMapped,\n>;\n\nexport type ContentData = {\n header: {\n label?: string,\n description?: { id?: string, message: string, properties?: Object },\n },\n label?: string,\n elements: Array<PropertyElement | TextFragmentElement | ContentElement>,\n};\n\nexport type SectionFragment = {\n text: string,\n startOffset: number,\n endOffset: number,\n};\n\nexport type ModelOptions = {\n origin?: ?string,\n contextPath?: ?string,\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/models/types.js"],"sourcesContent":["// @flow\nimport type ApplicationModel from \"./application/ApplicationModel\";\nimport type BooleanAttributeModel from \"./attributes/BooleanAttributeModel\";\nimport type CaptchaAttributeModel from \"./attributes/CaptchaAttributeModel\";\nimport type ChoiceAttributeModel from \"./attributes/ChoiceAttributeModel\";\nimport type CompositeAttributeModel from \"./attributes/CompositeAttributeModel\";\nimport type DatetimeAttributeModel from \"./attributes/DatetimeAttributeModel\";\nimport type HelptextAttributeModel from \"./attributes/HelptextAttributeModel\";\nimport type LabelAttributeModel from \"./attributes/LabelAttributeModel\";\nimport type MemoAttributeModel from \"./attributes/MemoAttributeModel\";\nimport type MoneyAttributeModel from \"./attributes/MoneyAttributeModel\";\nimport type NumberAttributeModel from \"./attributes/NumberAttributeModel\";\nimport type PasswordAttributeModel from \"./attributes/PasswordAttributeModel\";\nimport type StringAttributeModel from \"./attributes/StringAttributeModel\";\nimport type UploadAttributeModel from \"./attributes/UploadAttributeModel\";\nimport type XMLAttributeModel from \"./attributes/XMLAttributeModel\";\nimport type CaseViewModel from \"./caseview/CaseViewModel\";\nimport type BusinessScenarioModel from \"./concepts/BusinessScenarioModel\";\nimport type ConceptDetailModel from \"./concepts/ConceptDetailModel\";\nimport type ConceptIndexModel from \"./concepts/ConceptIndexModel\";\nimport type ConceptTypeDetailModel from \"./concepts/ConceptTypeDetailModel\";\nimport type ContentIndexModel from \"./content/ContentIndexModel\";\nimport type ContentModel from \"./content/ContentModel\";\nimport type SectionModel from \"./content/SectionModel\";\nimport type ContentTOCModel from \"./content/ContentTOCModel\";\nimport type ContentTypeModel from \"./content/ContentTypeModel\";\nimport type DetailModel from \"./detail/DetailModel\";\nimport type AssignmentFilterModel from \"./filters/AssignmentFilterModel\";\nimport type FilterModel from \"./filters/FilterModel\";\nimport type RangeFilterModel from \"./filters/RangeFilterModel\";\nimport type ConceptIndexFilterModel from \"./filters/ConceptIndexFilterModel\";\nimport type FormModel from \"./form/FormModel\";\nimport type ListDetailModel from \"./list/ListDetailModel\";\nimport type ListModel from \"./list/ListModel\";\nimport type ModelCatalogModel from \"./modelcatalog/ModelCatalogModel\";\nimport type GroupingPanelModel from \"./panels/GroupingPanelModel\";\nimport type CaseSearchModel from \"./search/CaseSearchModel\";\nimport type TabModel from \"./tab/TabModel\";\nimport type TaskGroupModel from \"./taskgroup/TaskGroupModel\";\nimport type UserModel from \"./user/UserModel\";\nimport type UserServicesModel from \"./user/UserServicesModel\";\nimport type LinkModel from \"./links/LinkModel\";\nimport type LookupOptionsModel from \"./lookup/LookupOptionsModel\";\nimport type BaseFilterModel from \"./filters/BaseFilterModel\";\nimport type AttributeCollection from \"./attributes/AttributeCollection\";\nimport type AttributeModel from \"./attributes/AttributeModel\";\nimport type LayoutHintCollection from \"./layouthint/LayoutHintCollection\";\nimport type ErrorResponse from \"./error/ErrorResponse\";\n\nexport type ModularUIModel =\n | ApplicationModel\n | CaseSearchModel\n | CaseViewModel\n | ListDetailModel\n | DetailModel\n | FormModel\n | GroupingPanelModel\n | ListModel\n | TabModel\n | TaskGroupModel\n | UserModel\n | UserServicesModel\n | ModelCatalogModel\n | ConceptIndexModel\n | ConceptDetailModel\n | BusinessScenarioModel\n | ConceptTypeDetailModel\n | ContentIndexModel\n | ContentTOCModel\n | ContentModel\n | ContentTypeModel\n | LookupOptionsModel;\n\nexport type AttributeType =\n | BooleanAttributeModel\n | CaptchaAttributeModel\n | ChoiceAttributeModel\n | DatetimeAttributeModel\n | HelptextAttributeModel\n | LabelAttributeModel\n | MemoAttributeModel\n | MoneyAttributeModel\n | NumberAttributeModel\n | PasswordAttributeModel\n | CompositeAttributeModel\n | StringAttributeModel\n | UploadAttributeModel\n | XMLAttributeModel;\n\nexport type RangeChildAttributeType =\n | NumberAttributeModel\n | DatetimeAttributeModel;\n\nexport type FilterType =\n | BaseFilterModel\n | FilterModel\n | AssignmentFilterModel\n | RangeFilterModel\n | ConceptIndexFilterModel;\n\nexport type FormErrorAnchor = {\n id: string,\n properties?: {\n [propertyName: string]: string | number,\n },\n anchor?: {\n objectid: string,\n elementid?: string,\n _links?: Object,\n index?: number,\n \"index-identifier\"?: string,\n },\n layouthint: LayoutHintCollection,\n message: string,\n param?: {\n name: string,\n },\n};\n\nexport type labelsJSON = {\n _id: string,\n label: string,\n value: string,\n};\n\nexport type propertyJSON = {\n _id: string,\n type: string,\n mandatory: string,\n label: string,\n value: string,\n};\n\nexport type textfragmentJSON = {\n label: string,\n text: string,\n type: string,\n};\n\nexport interface IConstraintModel {\n +id: string;\n +defaultMessage: string;\n +parameters: Object;\n +isMandatoryConstraint: boolean;\n validate(value: any): boolean;\n hasValidation(): boolean;\n}\n\nexport interface ILayoutHintRule {\n process(attribute: AttributeModel, attributes: AttributeCollection): void;\n}\n\nexport interface IModelWithChildModels {\n getInitialChildModelLinks(): Array<LinkModel>;\n setChildModels(\n models: Array<ModularUIModel>,\n errors: Array<ErrorResponse>,\n ): void;\n}\n\nexport type AuthenticationType = {\n name: string,\n authentication: string,\n redirectUri?: string,\n isPrimary: boolean,\n};\n\nexport type FileEntryType = {\n name: string,\n size?: number,\n progress: number,\n error?: string,\n token?: string,\n};\n\nexport type FilesType = {\n [filename: string]: FileEntryType,\n};\n\nexport type FiletypeConstraintsType = Array<{|\n extensions: Array<string>,\n mimeTypes: Array<string>,\n|}>;\n\nexport type FilesizeConstraintsType = {\n fileSize: ?number,\n maxTotalFileSize: ?number,\n isMaxTotal: boolean,\n};\n\nexport type PropertyData = { type: string, label: string, value: string };\nexport type TextFragmentData = {\n type: string,\n label: string,\n text: string | { id?: string, message: string, properties?: Object },\n};\nexport type SectionData = {\n id: string,\n type: string,\n label?: string,\n number?: string,\n body: string | { id?: string, message: string, properties?: Object },\n _links: { self: { href: string } },\n childSections?: Array<SectionData>,\n sections?: Array<SectionData>,\n subSections: Array<SectionData>,\n};\n\nexport type PropertyElement = {\n propertyElement: {\n label: string,\n layouthint: Array<string>,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElement = {\n textFragmentElement: {\n label: string,\n layouthint: Array<string>,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElement = {\n contentElement: {\n label: string,\n layouthint: Array<string>,\n sections: Array<SectionData>,\n },\n};\n\nexport type PropertyElementMapped = {\n propertyElement: {\n label: string,\n layouthint: LayoutHintCollection,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElementMapped = {\n textFragmentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElementMapped = {\n contentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n sections: Array<SectionModel>,\n },\n};\n\nexport type ContentAll = Array<\n PropertyElementMapped | TextFragmentElementMapped | ContentElementMapped,\n>;\n\nexport type ContentData = {\n header: {\n label?: string,\n description?: { id?: string, message: string, properties?: Object },\n },\n label?: string,\n elements: Array<PropertyElement | TextFragmentElement | ContentElement>,\n};\n\nexport type SectionFragment = {\n text: string,\n startOffset: number,\n endOffset: number,\n};\n\nexport type ModelOptions = {\n origin?: ?string,\n contextPath?: ?string,\n};\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,265 @@
1
+ import {
2
+ getFullRequestUrl,
3
+ getFullRequestHref,
4
+ getCookieFromRequest,
5
+ getPreferredLocale,
6
+ } from "../requestInformation"; // Adjust path as needed
7
+
8
+ // Mock the Href class
9
+ const mockHref = jest.fn((url) => ({
10
+ url: url, // For easy inspection in tests
11
+ // You can add other Href methods here if they are used by your functions
12
+ toString: () => url,
13
+ }));
14
+ jest.mock("../../models/href/Href", () => {
15
+ return jest.fn().mockImplementation((url) => {
16
+ return new mockHref(url);
17
+ });
18
+ });
19
+
20
+ // Mock the Locales class
21
+ const mockLocales = {
22
+ availableLocaleCodes: ["en-US", "es-ES", "fr-FR"],
23
+ getPreferredLocale: jest.fn((header) => {
24
+ if (header.includes("en")) return "en-US";
25
+ if (header.includes("es")) return "es-ES";
26
+ if (header.includes("fr")) return "fr-FR";
27
+ return mockLocales.availableLocaleCodes[0]; // Default if no match
28
+ }),
29
+ };
30
+ jest.mock("../../i18n/Locales", () => {
31
+ return jest.fn().mockImplementation(() => {
32
+ return mockLocales;
33
+ });
34
+ });
35
+
36
+ // Helper function to create a mock HttpServletRequestJava object
37
+ const createMockRequest = ({
38
+ pathInfo = null,
39
+ queryString = null,
40
+ cookies = [],
41
+ headers = {},
42
+ } = {}) => ({
43
+ getPathInfo: jest.fn(() => pathInfo),
44
+ getQueryString: jest.fn(() => queryString),
45
+ getCookieByName: jest.fn((name) => {
46
+ const cookie = cookies.find((c) => c.name === name);
47
+ return cookie ? cookie.value : null;
48
+ }),
49
+ getHeader: jest.fn((name) => headers[name.toLowerCase()] || null),
50
+ });
51
+
52
+ describe("requestInformation", () => {
53
+ beforeEach(() => {
54
+ jest.clearAllMocks();
55
+
56
+ // Reset mock Href to its initial mock implementation
57
+ // This is important if you test multiple instantiations or interactions
58
+ // with the Href mock.
59
+ require("../../models/href/Href").mockClear();
60
+ require("../../models/href/Href").mockImplementation((url) => {
61
+ return new mockHref(url);
62
+ });
63
+ });
64
+
65
+ describe("getFullRequestUrl", () => {
66
+ it("should return the path info when no query string is present", () => {
67
+ const request = createMockRequest({
68
+ pathInfo: "/some/path",
69
+ });
70
+ expect(getFullRequestUrl(request)).toBe("/some/path");
71
+ expect(request.getPathInfo).toHaveBeenCalledTimes(1);
72
+ expect(request.getQueryString).toHaveBeenCalledTimes(1);
73
+ });
74
+
75
+ it("should return the path info with a leading slash if pathInfo is null", () => {
76
+ const request = createMockRequest({
77
+ pathInfo: null,
78
+ });
79
+ expect(getFullRequestUrl(request)).toBe("/");
80
+ });
81
+
82
+ it("should return the path info with a leading slash if pathInfo is an empty string", () => {
83
+ const request = createMockRequest({
84
+ pathInfo: "",
85
+ });
86
+ expect(getFullRequestUrl(request)).toBe("/");
87
+ });
88
+
89
+ it("should return the path info with an encoded query string", () => {
90
+ const request = createMockRequest({
91
+ pathInfo: "/search",
92
+ queryString: "q=hello world&filter=test",
93
+ });
94
+ expect(getFullRequestUrl(request)).toBe(
95
+ "/search?q%3Dhello%20world%26filter%3Dtest",
96
+ );
97
+ });
98
+
99
+ it("should handle special characters in pathInfo by encoding them", () => {
100
+ const request = createMockRequest({
101
+ pathInfo: "/path with spaces/and<script>alert(1)</script>",
102
+ });
103
+ expect(getFullRequestUrl(request)).toBe(
104
+ "/path%20with%20spaces/and%3Cscript%3Ealert(1)%3C/script%3E",
105
+ );
106
+ });
107
+
108
+ it("should handle path info with multiple segments and special characters", () => {
109
+ const request = createMockRequest({
110
+ pathInfo: "/product/category/item with special chars & numbers/id-123",
111
+ });
112
+ expect(getFullRequestUrl(request)).toBe(
113
+ "/product/category/item%20with%20special%20chars%20%26%20numbers/id-123",
114
+ );
115
+ });
116
+
117
+ it("should correctly encode both path and query string with special characters", () => {
118
+ const request = createMockRequest({
119
+ pathInfo: "/api/data",
120
+ queryString: "name=John Doe & email=john@example.com",
121
+ });
122
+ expect(getFullRequestUrl(request)).toBe(
123
+ "/api/data?name%3DJohn%20Doe%20%26%20email%3Djohn%40example.com",
124
+ );
125
+ });
126
+
127
+ it("should handle an empty query string (not null) gracefully", () => {
128
+ const request = createMockRequest({
129
+ pathInfo: "/home",
130
+ queryString: "",
131
+ });
132
+ expect(getFullRequestUrl(request)).toBe("/home");
133
+ });
134
+ });
135
+
136
+ describe("getFullRequestHref", () => {
137
+ it("should return an Href instance with the full request URL", () => {
138
+ const request = createMockRequest({
139
+ pathInfo: "/products",
140
+ queryString: "id=123",
141
+ });
142
+ const hrefInstance = getFullRequestHref(request);
143
+
144
+ // Verify that Href constructor was called with the correct URL
145
+ expect(require("../../models/href/Href")).toHaveBeenCalledTimes(1);
146
+ expect(require("../../models/href/Href")).toHaveBeenCalledWith(
147
+ "/products?id%3D123",
148
+ );
149
+
150
+ // Verify the returned object is an instance of the mock Href
151
+ expect(hrefInstance.url).toBe("/products?id%3D123");
152
+ });
153
+
154
+ it("should handle complex URLs and pass them to Href", () => {
155
+ const request = createMockRequest({
156
+ pathInfo: "/search/results",
157
+ queryString: "q=javascript%20xss&param=value",
158
+ });
159
+ const hrefInstance = getFullRequestHref(request);
160
+ expect(require("../../models/href/Href")).toHaveBeenCalledWith(
161
+ "/search/results?q%3Djavascript%2520xss%26param%3Dvalue",
162
+ );
163
+ expect(hrefInstance.url).toBe(
164
+ "/search/results?q%3Djavascript%2520xss%26param%3Dvalue",
165
+ );
166
+ });
167
+ });
168
+
169
+ describe("getCookieFromRequest", () => {
170
+ it("should return the cookie value if found", () => {
171
+ const request = createMockRequest({
172
+ cookies: [
173
+ {
174
+ name: "session_id",
175
+ value: "abc123xyz",
176
+ },
177
+ ],
178
+ });
179
+ expect(getCookieFromRequest(request, "session_id")).toBe("abc123xyz");
180
+ expect(request.getCookieByName).toHaveBeenCalledWith("session_id");
181
+ });
182
+
183
+ it("should return null if the cookie is not found", () => {
184
+ const request = createMockRequest({
185
+ cookies: [
186
+ {
187
+ name: "other_cookie",
188
+ value: "value",
189
+ },
190
+ ],
191
+ });
192
+ expect(getCookieFromRequest(request, "non_existent_cookie")).toBeNull();
193
+ expect(request.getCookieByName).toHaveBeenCalledWith(
194
+ "non_existent_cookie",
195
+ );
196
+ });
197
+
198
+ it("should handle empty cookies array", () => {
199
+ const request = createMockRequest({
200
+ cookies: [],
201
+ });
202
+ expect(getCookieFromRequest(request, "any_cookie")).toBeNull();
203
+ });
204
+ });
205
+
206
+ describe("getPreferredLocale", () => {
207
+ it("should return locale from cookie if present", () => {
208
+ const request = createMockRequest({
209
+ cookies: [
210
+ {
211
+ name: "locale",
212
+ value: "es-ES",
213
+ },
214
+ ],
215
+ headers: {
216
+ "accept-language": "en-US,en;q=0.9",
217
+ },
218
+ });
219
+ const locales = mockLocales; // Using the mocked locales directly for convenience
220
+ expect(getPreferredLocale(request, locales)).toBe("es-ES");
221
+ expect(locales.getPreferredLocale).toHaveBeenCalledWith("es-ES"); // Because cookie took precedence
222
+ });
223
+
224
+ it("should return the first available locale code if no cookie and no Accept-Language header", () => {
225
+ const request = createMockRequest({}); // No cookies, no headers
226
+ const locales = mockLocales;
227
+ expect(getPreferredLocale(request, locales)).toBe("en-US");
228
+ expect(locales.getPreferredLocale).not.toHaveBeenCalled();
229
+ });
230
+
231
+ it("should handle null Accept-Language header correctly", () => {
232
+ const request = createMockRequest({
233
+ headers: {
234
+ "accept-language": null,
235
+ },
236
+ }); // Explicitly null header
237
+ const locales = mockLocales;
238
+ expect(getPreferredLocale(request, locales)).toBe("en-US");
239
+ expect(locales.getPreferredLocale).not.toHaveBeenCalled();
240
+ });
241
+
242
+ it("should handle empty string Accept-Language header correctly", () => {
243
+ const request = createMockRequest({
244
+ headers: {
245
+ "accept-language": "",
246
+ },
247
+ }); // Explicitly empty header
248
+ const locales = mockLocales;
249
+ expect(getPreferredLocale(request, locales)).toBe("en-US");
250
+ expect(locales.getPreferredLocale).not.toHaveBeenCalled();
251
+ });
252
+
253
+ it("should call getCookieFromRequest and getHeader", () => {
254
+ const request = createMockRequest({
255
+ headers: {
256
+ "accept-language": "de-DE",
257
+ },
258
+ });
259
+ const locales = mockLocales;
260
+ getPreferredLocale(request, locales);
261
+ expect(request.getCookieByName).toHaveBeenCalledWith("locale");
262
+ expect(request.getHeader).toHaveBeenCalledWith("Accept-Language");
263
+ });
264
+ });
265
+ });
@@ -1,11 +1,14 @@
1
+ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
1
2
  import Href from "../models/href/Href";
2
3
  /**
3
4
  */
4
5
  export const getFullRequestUrl = request => {
5
- const pathInfo = request.getPathInfo() || "/";
6
- const queryString = request.getQueryString();
6
+ var _context;
7
+ let pathInfo = request.getPathInfo() || "/";
8
+ let queryString = request.getQueryString();
9
+ pathInfo = _mapInstanceProperty(_context = pathInfo.split("/")).call(_context, segment => encodeURIComponent(segment)).join("/");
7
10
  if (queryString) {
8
- return `${pathInfo}?${queryString}`;
11
+ return `${pathInfo}?${encodeURIComponent(queryString)}`;
9
12
  }
10
13
  return pathInfo;
11
14
  };
@@ -6,11 +6,16 @@ import type Locales from "../i18n/Locales";
6
6
  /**
7
7
  */
8
8
  export const getFullRequestUrl = (request: HttpServletRequestJava): string => {
9
- const pathInfo = request.getPathInfo() || "/";
10
- const queryString = request.getQueryString();
9
+ let pathInfo = request.getPathInfo() || "/";
10
+ let queryString = request.getQueryString();
11
+
12
+ pathInfo = pathInfo
13
+ .split("/")
14
+ .map((segment) => encodeURIComponent(segment))
15
+ .join("/");
11
16
 
12
17
  if (queryString) {
13
- return `${pathInfo}?${queryString}`;
18
+ return `${pathInfo}?${encodeURIComponent(queryString)}`;
14
19
  }
15
20
 
16
21
  return pathInfo;
@@ -1 +1 @@
1
- {"version":3,"file":"requestInformation.js","names":["Href","getFullRequestUrl","request","pathInfo","getPathInfo","queryString","getQueryString","getFullRequestHref","getCookieFromRequest","cookieName","getCookieByName","getPreferredLocale","locales","languageFromCookie","acceptLanguageHeader","getHeader","availableLocaleCodes"],"sources":["../../src/react-server/requestInformation.js"],"sourcesContent":["// @flow\nimport Href from \"../models/href/Href\";\n\nimport type Locales from \"../i18n/Locales\";\n\n/**\n */\nexport const getFullRequestUrl = (request: HttpServletRequestJava): string => {\n const pathInfo = request.getPathInfo() || \"/\";\n const queryString = request.getQueryString();\n\n if (queryString) {\n return `${pathInfo}?${queryString}`;\n }\n\n return pathInfo;\n};\n\n/**\n */\nexport const getFullRequestHref = (request: HttpServletRequestJava): Href =>\n new Href(getFullRequestUrl(request));\n\n/**\n */\nexport const getCookieFromRequest = (\n request: HttpServletRequestJava,\n cookieName: string,\n): null | string => {\n return request.getCookieByName(cookieName);\n};\n\n/**\n */\nexport const getPreferredLocale = (\n request: HttpServletRequestJava,\n locales: Locales,\n): void | string => {\n const languageFromCookie = getCookieFromRequest(request, \"locale\");\n const acceptLanguageHeader =\n languageFromCookie || request.getHeader(\"Accept-Language\");\n\n // when no accept language header or cookie present, get first locale code\n if (acceptLanguageHeader === null) {\n return locales.availableLocaleCodes[0];\n }\n\n return locales.getPreferredLocale(acceptLanguageHeader);\n};\n"],"mappings":"AACA,OAAOA,IAAI,MAAM,qBAAqB;AAItC;AACA;AACA,OAAO,MAAMC,iBAAiB,GAAIC,OAA+B,IAAa;EAC5E,MAAMC,QAAQ,GAAGD,OAAO,CAACE,WAAW,CAAC,CAAC,IAAI,GAAG;EAC7C,MAAMC,WAAW,GAAGH,OAAO,CAACI,cAAc,CAAC,CAAC;EAE5C,IAAID,WAAW,EAAE;IACf,OAAO,GAAGF,QAAQ,IAAIE,WAAW,EAAE;EACrC;EAEA,OAAOF,QAAQ;AACjB,CAAC;;AAED;AACA;AACA,OAAO,MAAMI,kBAAkB,GAAIL,OAA+B,IAChE,IAAIF,IAAI,CAACC,iBAAiB,CAACC,OAAO,CAAC,CAAC;;AAEtC;AACA;AACA,OAAO,MAAMM,oBAAoB,GAAGA,CAClCN,OAA+B,EAC/BO,UAAkB,KACA;EAClB,OAAOP,OAAO,CAACQ,eAAe,CAACD,UAAU,CAAC;AAC5C,CAAC;;AAED;AACA;AACA,OAAO,MAAME,kBAAkB,GAAGA,CAChCT,OAA+B,EAC/BU,OAAgB,KACE;EAClB,MAAMC,kBAAkB,GAAGL,oBAAoB,CAACN,OAAO,EAAE,QAAQ,CAAC;EAClE,MAAMY,oBAAoB,GACxBD,kBAAkB,IAAIX,OAAO,CAACa,SAAS,CAAC,iBAAiB,CAAC;;EAE5D;EACA,IAAID,oBAAoB,KAAK,IAAI,EAAE;IACjC,OAAOF,OAAO,CAACI,oBAAoB,CAAC,CAAC,CAAC;EACxC;EAEA,OAAOJ,OAAO,CAACD,kBAAkB,CAACG,oBAAoB,CAAC;AACzD,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"requestInformation.js","names":["Href","getFullRequestUrl","request","_context","pathInfo","getPathInfo","queryString","getQueryString","_mapInstanceProperty","split","call","segment","encodeURIComponent","join","getFullRequestHref","getCookieFromRequest","cookieName","getCookieByName","getPreferredLocale","locales","languageFromCookie","acceptLanguageHeader","getHeader","availableLocaleCodes"],"sources":["../../src/react-server/requestInformation.js"],"sourcesContent":["// @flow\nimport Href from \"../models/href/Href\";\n\nimport type Locales from \"../i18n/Locales\";\n\n/**\n */\nexport const getFullRequestUrl = (request: HttpServletRequestJava): string => {\n let pathInfo = request.getPathInfo() || \"/\";\n let queryString = request.getQueryString();\n\n pathInfo = pathInfo\n .split(\"/\")\n .map((segment) => encodeURIComponent(segment))\n .join(\"/\");\n\n if (queryString) {\n return `${pathInfo}?${encodeURIComponent(queryString)}`;\n }\n\n return pathInfo;\n};\n\n/**\n */\nexport const getFullRequestHref = (request: HttpServletRequestJava): Href =>\n new Href(getFullRequestUrl(request));\n\n/**\n */\nexport const getCookieFromRequest = (\n request: HttpServletRequestJava,\n cookieName: string,\n): null | string => {\n return request.getCookieByName(cookieName);\n};\n\n/**\n */\nexport const getPreferredLocale = (\n request: HttpServletRequestJava,\n locales: Locales,\n): void | string => {\n const languageFromCookie = getCookieFromRequest(request, \"locale\");\n const acceptLanguageHeader =\n languageFromCookie || request.getHeader(\"Accept-Language\");\n\n // when no accept language header or cookie present, get first locale code\n if (acceptLanguageHeader === null) {\n return locales.availableLocaleCodes[0];\n }\n\n return locales.getPreferredLocale(acceptLanguageHeader);\n};\n"],"mappings":";AACA,OAAOA,IAAI,MAAM,qBAAqB;AAItC;AACA;AACA,OAAO,MAAMC,iBAAiB,GAAIC,OAA+B,IAAa;EAAA,IAAAC,QAAA;EAC5E,IAAIC,QAAQ,GAAGF,OAAO,CAACG,WAAW,CAAC,CAAC,IAAI,GAAG;EAC3C,IAAIC,WAAW,GAAGJ,OAAO,CAACK,cAAc,CAAC,CAAC;EAE1CH,QAAQ,GAAGI,oBAAA,CAAAL,QAAA,GAAAC,QAAQ,CAChBK,KAAK,CAAC,GAAG,C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