@elliemae/pui-app-sdk 2.17.0 → 3.0.0-beta.3

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 (342) hide show
  1. package/dist/cjs/analytics/appdynamics.js +34 -30
  2. package/dist/cjs/analytics/index.js +32 -26
  3. package/dist/cjs/analytics/page-view-event.js +42 -29
  4. package/dist/cjs/analytics/user-session-event.js +34 -27
  5. package/dist/cjs/analytics/user-wait-event.js +31 -17
  6. package/dist/cjs/analytics/web-analytics.js +16 -19
  7. package/dist/cjs/api/auth/index.js +41 -39
  8. package/dist/cjs/api/helpers.js +33 -99
  9. package/dist/cjs/api/users/index.js +28 -16
  10. package/dist/cjs/communication/http-client/index.js +44 -48
  11. package/dist/cjs/communication/http-client/request-interceptor.js +28 -12
  12. package/dist/cjs/communication/http-client/response-interceptor.js +41 -38
  13. package/dist/cjs/communication/http-client/retry-axios.js +68 -122
  14. package/dist/cjs/communication/http-client/retry.js +42 -36
  15. package/dist/cjs/communication/http-client/tests/index.test-disable.js +48 -56
  16. package/dist/cjs/data/auth/actions.js +17 -26
  17. package/dist/cjs/data/auth/reducer.js +30 -18
  18. package/dist/cjs/data/breakpoint/index.js +38 -32
  19. package/dist/cjs/data/error/index.js +33 -18
  20. package/dist/cjs/data/live-message/index.js +34 -25
  21. package/dist/cjs/data/logout/actions.js +12 -9
  22. package/dist/cjs/data/navigation-prompt/actions.js +12 -9
  23. package/dist/cjs/data/react-redux.js +29 -13
  24. package/dist/cjs/data/reducers.js +35 -23
  25. package/dist/cjs/data/saga.js +12 -9
  26. package/dist/cjs/data/store.js +53 -60
  27. package/dist/cjs/data/wait-message/actions.js +14 -13
  28. package/dist/cjs/data/wait-message/reducer.js +32 -24
  29. package/dist/cjs/index.js +189 -809
  30. package/dist/cjs/route/index.js +37 -32
  31. package/dist/cjs/route/page-view.js +30 -22
  32. package/dist/cjs/route/private-route/index.js +52 -60
  33. package/dist/cjs/sideeffect/auth/index.js +42 -30
  34. package/dist/cjs/sideeffect/error-toast/index.js +39 -26
  35. package/dist/cjs/sideeffect/wait-message/index.js +45 -29
  36. package/dist/cjs/typings/custom.d.js +0 -1
  37. package/dist/cjs/typings/elliemae.d.js +0 -1
  38. package/dist/cjs/typings/styled.d.js +19 -3
  39. package/dist/cjs/utils/app-config/config.js +33 -33
  40. package/dist/cjs/utils/app-config/index.js +42 -44
  41. package/dist/cjs/utils/app-host-integration/react.js +27 -14
  42. package/dist/cjs/utils/auth/helper.js +30 -18
  43. package/dist/cjs/utils/auth/index.js +76 -116
  44. package/dist/cjs/utils/await.js +3 -0
  45. package/dist/cjs/utils/constants.js +22 -21
  46. package/dist/cjs/utils/font-size.js +13 -14
  47. package/dist/cjs/utils/guest-with-service.js +11 -12
  48. package/dist/cjs/utils/helpers.js +15 -19
  49. package/dist/cjs/utils/history.js +29 -12
  50. package/dist/cjs/utils/log-records.js +38 -35
  51. package/dist/cjs/utils/micro-frontend/console-logger.js +39 -23
  52. package/dist/cjs/utils/micro-frontend/guest.js +80 -128
  53. package/dist/cjs/utils/micro-frontend/host.js +84 -124
  54. package/dist/cjs/utils/micro-frontend/index.js +60 -61
  55. package/dist/cjs/utils/micro-frontend/types.js +3 -5
  56. package/dist/cjs/utils/redact-pii.js +15 -17
  57. package/dist/cjs/utils/service-worker.js +36 -21
  58. package/dist/cjs/utils/session.js +64 -70
  59. package/dist/cjs/utils/storybook/main.js +32 -25
  60. package/dist/cjs/utils/storybook/manager.js +31 -16
  61. package/dist/cjs/utils/storybook/middleware.js +3 -7
  62. package/dist/cjs/utils/storybook/preview.js +57 -48
  63. package/dist/cjs/utils/storybook/theme.js +30 -14
  64. package/dist/cjs/utils/storybook/vite.js +6 -0
  65. package/dist/cjs/utils/storybook/webpack.js +13 -0
  66. package/dist/cjs/utils/testing/index.js +38 -50
  67. package/dist/cjs/utils/testing/render-with-redux.js +34 -27
  68. package/dist/cjs/utils/testing/render-with-router-redux.js +40 -37
  69. package/dist/cjs/utils/testing/render-with-router.js +34 -28
  70. package/dist/cjs/utils/testing/render-with-state-addons.js +40 -36
  71. package/dist/cjs/utils/types.js +3 -0
  72. package/dist/cjs/utils/url.js +12 -13
  73. package/dist/cjs/utils/web-storage.js +40 -30
  74. package/dist/cjs/utils/window.js +36 -28
  75. package/dist/cjs/view/app-root/hosted-app.js +35 -32
  76. package/dist/cjs/view/app-root/index.js +57 -62
  77. package/dist/cjs/view/app-root/stand-alone-app.js +38 -37
  78. package/dist/cjs/view/app-root/style.js +50 -12
  79. package/dist/cjs/view/error-boundary/default-error-template.js +10 -15
  80. package/dist/cjs/view/error-boundary/index.js +41 -43
  81. package/dist/cjs/view/error-toast/index.js +42 -32
  82. package/dist/cjs/view/fetch-host-app-data/index.js +34 -26
  83. package/dist/cjs/view/fetch-host-app-data/store.js +31 -24
  84. package/dist/cjs/view/fields/check-box/index.js +34 -39
  85. package/dist/cjs/view/fields/combo-box/index.js +37 -31
  86. package/dist/cjs/view/fields/connect-form.js +30 -15
  87. package/dist/cjs/view/fields/date-input/index.js +34 -26
  88. package/dist/cjs/view/fields/date-picker/index.js +34 -26
  89. package/dist/cjs/view/fields/form-item-layout/index.js +36 -30
  90. package/dist/cjs/view/fields/input-mask/index.js +35 -41
  91. package/dist/cjs/view/fields/large-text-box/index.js +34 -26
  92. package/dist/cjs/view/fields/radio/index.js +34 -30
  93. package/dist/cjs/view/fields/radio-group/index.js +32 -27
  94. package/dist/cjs/view/fields/text-box/index.js +34 -26
  95. package/dist/cjs/view/fields/watch-value.js +41 -35
  96. package/dist/cjs/view/form/index.js +41 -34
  97. package/dist/cjs/view/form/personal-info-section.js +56 -80
  98. package/dist/cjs/view/form/submit-button/index.js +34 -23
  99. package/dist/cjs/view/guest-unload-handlers/index.js +33 -22
  100. package/dist/cjs/view/header/center-region/index.js +61 -38
  101. package/dist/cjs/view/header/index.js +41 -35
  102. package/dist/cjs/view/header/logo-region/index.js +31 -23
  103. package/dist/cjs/view/header/nav-region/index.js +44 -30
  104. package/dist/cjs/view/header/nav-region/notification/index.js +28 -18
  105. package/dist/cjs/view/header/nav-region/user/index.js +28 -18
  106. package/dist/cjs/view/host-binding-events/index.js +10 -11
  107. package/dist/cjs/view/intro.stories.mdx +1 -1
  108. package/dist/cjs/view/live-message/index.js +33 -34
  109. package/dist/cjs/view/loadable/index.js +33 -27
  110. package/dist/cjs/view/login/index.js +36 -30
  111. package/dist/cjs/view/media-breakpoint/index.js +43 -34
  112. package/dist/cjs/view/message-to-host-app/index.js +31 -20
  113. package/dist/cjs/view/micro-app/app-factory/index.js +98 -134
  114. package/dist/cjs/view/micro-app/const.js +10 -7
  115. package/dist/cjs/view/micro-app/index.js +37 -27
  116. package/dist/cjs/view/micro-app/resources/manifest.js +41 -34
  117. package/dist/cjs/view/micro-app/resources/script.js +56 -53
  118. package/dist/cjs/view/micro-app/resources/style.js +44 -38
  119. package/dist/cjs/view/micro-app/types.js +3 -5
  120. package/dist/cjs/view/micro-app/use-app-will-render.js +58 -50
  121. package/dist/cjs/view/micro-app/utils.js +32 -21
  122. package/dist/cjs/view/micro-iframe-app/app.js +37 -39
  123. package/dist/cjs/view/micro-iframe-app/iframe/const.js +10 -7
  124. package/dist/cjs/view/micro-iframe-app/iframe/index.js +51 -47
  125. package/dist/cjs/view/micro-iframe-app/index.js +36 -24
  126. package/dist/cjs/view/micro-iframe-app/types.js +3 -5
  127. package/dist/cjs/view/micro-iframe-app/use-frame-loaded.js +40 -36
  128. package/dist/cjs/view/modals/error/index.js +35 -28
  129. package/dist/cjs/view/modals/navigation-prompt/index.js +38 -37
  130. package/dist/cjs/view/modals/session-expiry/customHooks.js +40 -35
  131. package/dist/cjs/view/modals/session-expiry/index.js +45 -50
  132. package/dist/cjs/view/modals/wait-message/html-wait-message.js +32 -18
  133. package/dist/cjs/view/modals/wait-message/index.js +50 -53
  134. package/dist/cjs/view/modals/wait-message/wait-message-launcher.js +33 -21
  135. package/dist/cjs/view/render-with-delay/index.js +30 -19
  136. package/dist/cjs/view/render-with-host-data/index.js +35 -30
  137. package/dist/cjs/view/session-timeout/index.js +44 -35
  138. package/dist/cjs/view/storybook/decorator.js +32 -21
  139. package/dist/cjs/view/use-previous.js +29 -13
  140. package/dist/cjs/view/useMediaBreakpoints/index.js +34 -19
  141. package/dist/cjs/view/visually-hidden/index.js +41 -21
  142. package/dist/cjs/view/window-size/index.js +34 -22
  143. package/dist/es/analytics/appdynamics.js +14 -15
  144. package/dist/es/analytics/index.js +11 -17
  145. package/dist/es/analytics/page-view-event.js +20 -20
  146. package/dist/es/analytics/user-session-event.js +13 -15
  147. package/dist/es/analytics/user-wait-event.js +10 -6
  148. package/dist/es/analytics/web-analytics.js +12 -10
  149. package/dist/es/api/auth/index.js +22 -27
  150. package/dist/es/api/helpers.js +8 -81
  151. package/dist/es/api/users/index.js +7 -8
  152. package/dist/es/communication/http-client/index.js +24 -30
  153. package/dist/es/communication/http-client/request-interceptor.js +6 -3
  154. package/dist/es/communication/http-client/response-interceptor.js +20 -21
  155. package/dist/es/communication/http-client/retry-axios.js +45 -105
  156. package/dist/es/communication/http-client/retry.js +22 -25
  157. package/dist/es/communication/http-client/tests/index.test-disable.js +28 -47
  158. package/dist/es/data/auth/actions.js +13 -19
  159. package/dist/es/data/auth/reducer.js +9 -7
  160. package/dist/es/data/breakpoint/index.js +19 -21
  161. package/dist/es/data/error/index.js +11 -9
  162. package/dist/es/data/live-message/index.js +12 -16
  163. package/dist/es/data/logout/actions.js +9 -5
  164. package/dist/es/data/navigation-prompt/actions.js +9 -5
  165. package/dist/es/data/react-redux.js +7 -3
  166. package/dist/es/data/reducers.js +10 -7
  167. package/dist/es/data/saga.js +8 -5
  168. package/dist/es/data/store.js +27 -44
  169. package/dist/es/data/wait-message/actions.js +11 -9
  170. package/dist/es/data/wait-message/reducer.js +10 -10
  171. package/dist/es/index.js +183 -84
  172. package/dist/es/route/index.js +16 -19
  173. package/dist/es/route/page-view.js +9 -9
  174. package/dist/es/route/private-route/index.js +30 -38
  175. package/dist/es/sideeffect/auth/index.js +27 -14
  176. package/dist/es/sideeffect/error-toast/index.js +15 -14
  177. package/dist/es/sideeffect/wait-message/index.js +18 -14
  178. package/dist/es/typings/styled.d.js +1 -1
  179. package/dist/es/utils/app-config/config.js +11 -9
  180. package/dist/es/utils/app-config/index.js +21 -31
  181. package/dist/es/utils/app-host-integration/react.js +8 -6
  182. package/dist/es/utils/auth/helper.js +8 -4
  183. package/dist/es/utils/auth/index.js +59 -83
  184. package/dist/es/utils/constants.js +18 -13
  185. package/dist/es/utils/font-size.js +7 -3
  186. package/dist/es/utils/guest-with-service.js +6 -7
  187. package/dist/es/utils/helpers.js +10 -6
  188. package/dist/es/utils/history.js +7 -3
  189. package/dist/es/utils/log-records.js +34 -31
  190. package/dist/es/utils/micro-frontend/console-logger.js +17 -13
  191. package/dist/es/utils/micro-frontend/guest.js +52 -108
  192. package/dist/es/utils/micro-frontend/host.js +53 -89
  193. package/dist/es/utils/micro-frontend/index.js +39 -37
  194. package/dist/es/utils/micro-frontend/types.js +0 -1
  195. package/dist/es/utils/redact-pii.js +10 -11
  196. package/dist/es/utils/service-worker.js +14 -11
  197. package/dist/es/utils/session.js +47 -48
  198. package/dist/es/utils/storybook/manager.js +8 -5
  199. package/dist/es/utils/storybook/preview.js +30 -26
  200. package/dist/es/utils/storybook/theme.js +9 -6
  201. package/dist/es/utils/testing/index.js +14 -21
  202. package/dist/es/utils/testing/render-with-redux.js +13 -13
  203. package/dist/es/utils/testing/render-with-router-redux.js +19 -21
  204. package/dist/es/utils/testing/render-with-router.js +14 -16
  205. package/dist/es/utils/testing/render-with-state-addons.js +18 -18
  206. package/dist/es/utils/url.js +7 -3
  207. package/dist/es/utils/web-storage.js +21 -17
  208. package/dist/es/utils/window.js +18 -18
  209. package/dist/es/view/app-root/hosted-app.js +13 -17
  210. package/dist/es/view/app-root/index.js +34 -39
  211. package/dist/es/view/app-root/stand-alone-app.js +17 -19
  212. package/dist/es/view/app-root/style.js +30 -5
  213. package/dist/es/view/error-boundary/default-error-template.js +4 -5
  214. package/dist/es/view/error-boundary/index.js +20 -27
  215. package/dist/es/view/error-toast/index.js +21 -16
  216. package/dist/es/view/fetch-host-app-data/index.js +13 -13
  217. package/dist/es/view/fetch-host-app-data/store.js +10 -7
  218. package/dist/es/view/fields/check-box/index.js +16 -18
  219. package/dist/es/view/fields/combo-box/index.js +19 -19
  220. package/dist/es/view/fields/connect-form.js +8 -6
  221. package/dist/es/view/fields/date-input/index.js +16 -14
  222. package/dist/es/view/fields/date-picker/index.js +16 -14
  223. package/dist/es/view/fields/form-item-layout/index.js +15 -16
  224. package/dist/es/view/fields/input-mask/index.js +20 -14
  225. package/dist/es/view/fields/large-text-box/index.js +16 -14
  226. package/dist/es/view/fields/radio/index.js +16 -18
  227. package/dist/es/view/fields/radio-group/index.js +14 -15
  228. package/dist/es/view/fields/text-box/index.js +16 -14
  229. package/dist/es/view/fields/watch-value.js +19 -24
  230. package/dist/es/view/form/index.js +22 -22
  231. package/dist/es/view/form/personal-info-section.js +31 -52
  232. package/dist/es/view/form/submit-button/index.js +12 -10
  233. package/dist/es/view/guest-unload-handlers/index.js +11 -10
  234. package/dist/es/view/header/center-region/index.js +40 -23
  235. package/dist/es/view/header/index.js +19 -19
  236. package/dist/es/view/header/logo-region/index.js +8 -9
  237. package/dist/es/view/header/nav-region/index.js +22 -15
  238. package/dist/es/view/header/nav-region/notification/index.js +5 -6
  239. package/dist/es/view/header/nav-region/user/index.js +5 -6
  240. package/dist/es/view/host-binding-events/index.js +7 -3
  241. package/dist/es/view/intro.stories.mdx +1 -1
  242. package/dist/es/view/live-message/index.js +13 -23
  243. package/dist/es/view/loadable/index.js +12 -15
  244. package/dist/es/view/login/index.js +14 -18
  245. package/dist/es/view/media-breakpoint/index.js +19 -17
  246. package/dist/es/view/message-to-host-app/index.js +11 -10
  247. package/dist/es/view/micro-app/app-factory/index.js +67 -86
  248. package/dist/es/view/micro-app/const.js +4 -1
  249. package/dist/es/view/micro-app/index.js +13 -11
  250. package/dist/es/view/micro-app/resources/manifest.js +19 -19
  251. package/dist/es/view/micro-app/resources/script.js +36 -36
  252. package/dist/es/view/micro-app/resources/style.js +23 -22
  253. package/dist/es/view/micro-app/types.js +0 -1
  254. package/dist/es/view/micro-app/use-app-will-render.js +32 -28
  255. package/dist/es/view/micro-app/utils.js +12 -14
  256. package/dist/es/view/micro-iframe-app/app.js +15 -22
  257. package/dist/es/view/micro-iframe-app/iframe/const.js +4 -1
  258. package/dist/es/view/micro-iframe-app/iframe/index.js +27 -32
  259. package/dist/es/view/micro-iframe-app/index.js +11 -12
  260. package/dist/es/view/micro-iframe-app/types.js +0 -1
  261. package/dist/es/view/micro-iframe-app/use-frame-loaded.js +16 -21
  262. package/dist/es/view/modals/error/index.js +12 -10
  263. package/dist/es/view/modals/navigation-prompt/index.js +12 -16
  264. package/dist/es/view/modals/session-expiry/customHooks.js +13 -15
  265. package/dist/es/view/modals/session-expiry/index.js +16 -24
  266. package/dist/es/view/modals/wait-message/html-wait-message.js +10 -10
  267. package/dist/es/view/modals/wait-message/index.js +31 -39
  268. package/dist/es/view/modals/wait-message/wait-message-launcher.js +9 -8
  269. package/dist/es/view/render-with-delay/index.js +7 -10
  270. package/dist/es/view/render-with-host-data/index.js +11 -15
  271. package/dist/es/view/session-timeout/index.js +21 -12
  272. package/dist/es/view/storybook/decorator.js +9 -7
  273. package/dist/es/view/use-previous.js +6 -3
  274. package/dist/es/view/useMediaBreakpoints/index.js +11 -9
  275. package/dist/es/view/visually-hidden/index.js +19 -10
  276. package/dist/es/view/window-size/index.js +12 -11
  277. package/dist/types/utils/storybook/main.d.cts +41 -0
  278. package/dist/types/utils/storybook/{middleware.d.ts → middleware.d.cts} +0 -0
  279. package/dist/types/utils/storybook/preview.d.ts +2 -2
  280. package/dist/types/utils/storybook/vite.d.cts +4 -0
  281. package/dist/types/utils/storybook/webpack.d.cts +8 -0
  282. package/dist/types/utils/window.d.ts +1 -1
  283. package/dist/types/view/visually-hidden/index.d.ts +1 -3
  284. package/package.json +6 -4
  285. package/dist/cjs/api/users/index.endpoint.js +0 -14
  286. package/dist/cjs/communication/http-client/tests/hello.endpoint.js +0 -14
  287. package/dist/cjs/communication/http-client/tests/private.endpoint.js +0 -14
  288. package/dist/cjs/view/error-toast/index.stories.js +0 -128
  289. package/dist/cjs/view/fields/check-box/index.stories.js +0 -64
  290. package/dist/cjs/view/fields/check-box/set-value.stories.js +0 -83
  291. package/dist/cjs/view/fields/combo-box/index.stories.js +0 -65
  292. package/dist/cjs/view/fields/date-input/index.stories.js +0 -53
  293. package/dist/cjs/view/fields/date-input/index1.stories.js +0 -53
  294. package/dist/cjs/view/fields/date-picker/index.stories.js +0 -53
  295. package/dist/cjs/view/fields/form-item-layout/index.stories.js +0 -43
  296. package/dist/cjs/view/fields/input-mask/index.stories.js +0 -52
  297. package/dist/cjs/view/fields/large-text-box/index.stories.js +0 -47
  298. package/dist/cjs/view/fields/radio/index.stories.js +0 -60
  299. package/dist/cjs/view/fields/radio/set-value.stories.js +0 -81
  300. package/dist/cjs/view/fields/radio-group/index.stories.js +0 -85
  301. package/dist/cjs/view/fields/text-box/index.stories.js +0 -48
  302. package/dist/cjs/view/form/index.stories.js +0 -71
  303. package/dist/cjs/view/form/usecases.stories.js +0 -59
  304. package/dist/cjs/view/header/index.stories.js +0 -24
  305. package/dist/cjs/view/live-message/index.stories.js +0 -53
  306. package/dist/cjs/view/media-breakpoint/index.stories.js +0 -24
  307. package/dist/cjs/view/modals/error/index.stories.js +0 -36
  308. package/dist/cjs/view/modals/navigation-prompt/index.stories.js +0 -32
  309. package/dist/cjs/view/modals/session-expiry/index.stories.js +0 -30
  310. package/dist/cjs/view/modals/wait-message/index.stories.js +0 -47
  311. package/dist/cjs/view/session-timeout/index.stories.js +0 -28
  312. package/dist/es/api/users/index.endpoint.js +0 -14
  313. package/dist/es/communication/http-client/tests/hello.endpoint.js +0 -14
  314. package/dist/es/communication/http-client/tests/private.endpoint.js +0 -14
  315. package/dist/es/utils/storybook/main.js +0 -38
  316. package/dist/es/utils/storybook/middleware.js +0 -9
  317. package/dist/es/view/error-toast/index.stories.js +0 -108
  318. package/dist/es/view/fields/check-box/index.stories.js +0 -47
  319. package/dist/es/view/fields/check-box/set-value.stories.js +0 -65
  320. package/dist/es/view/fields/combo-box/index.stories.js +0 -48
  321. package/dist/es/view/fields/date-input/index.stories.js +0 -35
  322. package/dist/es/view/fields/date-input/index1.stories.js +0 -35
  323. package/dist/es/view/fields/date-picker/index.stories.js +0 -35
  324. package/dist/es/view/fields/form-item-layout/index.stories.js +0 -27
  325. package/dist/es/view/fields/input-mask/index.stories.js +0 -35
  326. package/dist/es/view/fields/large-text-box/index.stories.js +0 -30
  327. package/dist/es/view/fields/radio/index.stories.js +0 -43
  328. package/dist/es/view/fields/radio/set-value.stories.js +0 -63
  329. package/dist/es/view/fields/radio-group/index.stories.js +0 -68
  330. package/dist/es/view/fields/text-box/index.stories.js +0 -31
  331. package/dist/es/view/form/index.stories.js +0 -56
  332. package/dist/es/view/form/usecases.stories.js +0 -43
  333. package/dist/es/view/header/index.stories.js +0 -14
  334. package/dist/es/view/live-message/index.stories.js +0 -32
  335. package/dist/es/view/media-breakpoint/index.stories.js +0 -10
  336. package/dist/es/view/modals/error/index.stories.js +0 -21
  337. package/dist/es/view/modals/navigation-prompt/index.stories.js +0 -18
  338. package/dist/es/view/modals/session-expiry/index.stories.js +0 -18
  339. package/dist/es/view/modals/wait-message/index.stories.js +0 -33
  340. package/dist/es/view/session-timeout/index.stories.js +0 -13
  341. package/dist/types/utils/storybook/main.d.ts +0 -30
  342. package/dist/types/view/fields/date-input/index1.stories.d.ts +0 -24
@@ -1,148 +1,88 @@
1
- /* eslint-disable no-param-reassign,jsdoc/require-returns,jsdoc/require-param-type,jsdoc/require-returns-type,max-lines,@typescript-eslint/no-non-null-assertion */
2
- import axios from 'axios';
3
-
4
- const onFulfilled = res => res;
5
- /**
6
- * Eject the Axios interceptor that is providing retry capabilities.
7
- *
8
- * @param interceptorId The interceptorId provided in the config.
9
- * @param instance The axios instance using this interceptor.
10
- */
11
-
12
-
13
- export const detach = (interceptorId, instance) => {
14
- var _instance, _instance$interceptor;
15
-
1
+ import axios from "axios";
2
+ const onFulfilled = (res) => res;
3
+ const detach = (interceptorId, instance) => {
16
4
  instance = instance || axios;
17
- if ((_instance = instance) !== null && _instance !== void 0 && (_instance$interceptor = _instance.interceptors) !== null && _instance$interceptor !== void 0 && _instance$interceptor.response) instance.interceptors.response.eject(interceptorId);
5
+ if (instance?.interceptors?.response)
6
+ instance.interceptors.response.eject(interceptorId);
18
7
  };
19
- /**
20
- * Determine based on config if we should retry the request.
21
- *
22
- * @param err The AxiosError passed to the interceptor.
23
- */
24
- // eslint-disable-next-line complexity
25
-
26
- const shouldRetryRequest = err => {
27
- const config = err.config.retryConfig; // If there's no config, or retries are disabled, return.
28
-
8
+ const shouldRetryRequest = (err) => {
9
+ const config = err.config.retryConfig;
29
10
  if (!config || config.retry === 0) {
30
11
  return false;
31
- } // Check if this error has no response (ETIMEDOUT, ENOTFOUND, etc)
32
-
33
-
12
+ }
34
13
  if (!err.response && (config.currentRetryAttempt || 0) >= config.noResponseRetries) {
35
14
  return false;
36
- } // Only retry with configured HttpMethods.
37
-
38
-
15
+ }
39
16
  if (!err.config.method || config.httpMethodsToRetry.indexOf(err.config.method.toUpperCase()) < 0) {
40
17
  return false;
41
- } // If this wasn't in the list of status codes where we want
42
- // to automatically retry, return.
43
-
44
-
18
+ }
45
19
  if (err.response && err.response.status) {
46
- let isInRange = false; // eslint-disable-next-line no-restricted-syntax
47
-
20
+ let isInRange = false;
48
21
  for (const [min, max] of config.statusCodesToRetry) {
49
- const {
50
- status
51
- } = err.response;
52
-
22
+ const { status } = err.response;
53
23
  if (status >= min && status <= max) {
54
24
  isInRange = true;
55
25
  break;
56
26
  }
57
27
  }
58
-
59
28
  if (!isInRange) {
60
29
  return false;
61
30
  }
62
- } // If we are out of retry attempts, return
63
-
64
-
31
+ }
65
32
  config.currentRetryAttempt = config.currentRetryAttempt || 0;
66
-
67
33
  if (config.currentRetryAttempt >= config.retry) {
68
34
  return false;
69
35
  }
70
-
71
36
  return true;
72
- }; // eslint-disable-next-line complexity
73
-
74
-
75
- const onError = err => {
37
+ };
38
+ const onError = (err) => {
76
39
  if (!err.config) {
77
40
  return Promise.reject(err);
78
41
  }
79
-
80
42
  const config = err.config.retryConfig || {};
81
43
  config.currentRetryAttempt = config.currentRetryAttempt || 0;
82
- config.retry = config.retry === undefined || config.retry === null ? 3 : config.retry;
44
+ config.retry = config.retry === void 0 || config.retry === null ? 3 : config.retry;
83
45
  config.retryDelay = config.retryDelay || 100;
84
46
  config.instance = config.instance || axios;
85
- config.httpMethodsToRetry = config.httpMethodsToRetry || ['GET', 'HEAD', 'PUT', 'OPTIONS', 'DELETE'];
86
- config.noResponseRetries = config.noResponseRetries === undefined || config.noResponseRetries === null ? 2 : config.noResponseRetries; // If this wasn't in the list of status codes where we want
87
- // to automatically retry, return.
88
-
89
- const retryRanges = [// https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
90
- // 1xx - Retry (Informational, request still processing)
91
- // 2xx - Do not retry (Success)
92
- // 3xx - Do not retry (Redirect)
93
- // 4xx - Do not retry (Client errors)
94
- // 429 - Retry ("Too Many Requests")
95
- // 5xx - Retry (Server errors)
96
- [100, 199], [429, 429], [500, 599]];
97
- config.statusCodesToRetry = config.statusCodesToRetry || retryRanges; // Put the config back into the err
98
-
99
- err.config.retryConfig = config; // Determine if we should retry the request
100
-
47
+ config.httpMethodsToRetry = config.httpMethodsToRetry || [
48
+ "GET",
49
+ "HEAD",
50
+ "PUT",
51
+ "OPTIONS",
52
+ "DELETE"
53
+ ];
54
+ config.noResponseRetries = config.noResponseRetries === void 0 || config.noResponseRetries === null ? 2 : config.noResponseRetries;
55
+ const retryRanges = [
56
+ [100, 199],
57
+ [429, 429],
58
+ [500, 599]
59
+ ];
60
+ config.statusCodesToRetry = config.statusCodesToRetry || retryRanges;
61
+ err.config.retryConfig = config;
101
62
  const shouldRetryFn = config.shouldRetry || shouldRetryRequest;
102
-
103
63
  if (!shouldRetryFn(err)) {
104
64
  return Promise.reject(err);
105
- } // Create a promise that invokes the retry after the backOffDelay
106
-
107
-
108
- const onBackoffPromise = new Promise(resolve => {
109
- // Calculate time to wait with exponential backoff.
110
- // Formula: (2^c - 1 / 2) * 1000
111
- // eslint-disable-next-line no-restricted-properties
112
- const delay = (Math.pow(2, config.currentRetryAttempt) - 1) / 2 * 1000;
65
+ }
66
+ const onBackoffPromise = new Promise((resolve) => {
67
+ const delay = (Math.pow(2, config.currentRetryAttempt) - 1) / 2 * 1e3;
113
68
  err.config.retryConfig.currentRetryAttempt += 1;
114
69
  setTimeout(resolve, delay);
115
- }); // Notify the user if they added an `onRetryAttempt` handler
116
-
117
- const onRetryAttemptPromise = config.onRetryAttempt ? Promise.resolve(config.onRetryAttempt(err)) : Promise.resolve(); // Return the promise in which recalls axios to retry the request
118
-
70
+ });
71
+ const onRetryAttemptPromise = config.onRetryAttempt ? Promise.resolve(config.onRetryAttempt(err)) : Promise.resolve();
119
72
  return Promise.resolve().then(() => onBackoffPromise).then(() => onRetryAttemptPromise).then(() => config.instance.request(err.config));
120
73
  };
121
- /**
122
- * Attach the interceptor to the Axios instance.
123
- *
124
- * @param instance The optional Axios instance on which to attach the
125
- * interceptor.
126
- * @returns The id of the interceptor attached to the axios instance.
127
- */
128
-
129
-
130
- export const attach = instance => {
131
- var _instance2, _instance2$intercepto;
132
-
74
+ const attach = (instance) => {
133
75
  instance = instance || axios;
134
- return (_instance2 = instance) !== null && _instance2 !== void 0 && (_instance2$intercepto = _instance2.interceptors) !== null && _instance2$intercepto !== void 0 && _instance2$intercepto.response ? instance.interceptors.response.use(onFulfilled, onError) : null;
76
+ return instance?.interceptors?.response ? instance.interceptors.response.use(onFulfilled, onError) : null;
135
77
  };
136
- /**
137
- * Acquire the retryConfig object from an AxiosError if available.
138
- *
139
- * @param err The Axios error with a config object.
140
- */
141
-
142
- export const getConfig = err => {
78
+ const getConfig = (err) => {
143
79
  if (err && err.config) {
144
80
  return err.config.retryConfig;
145
81
  }
146
-
147
82
  return null;
148
- };
83
+ };
84
+ export {
85
+ attach,
86
+ detach,
87
+ getConfig
88
+ };
@@ -1,34 +1,31 @@
1
- import { attach, getConfig } from "./retry-axios.js";
2
- export const getRaxConfig = httpClient => ({
3
- // Retry 3 times on requests that return a response (500, etc) before giving up. Defaults to 3.
1
+ import {
2
+ attach,
3
+ getConfig
4
+ } from "./retry-axios";
5
+ const getRaxConfig = (httpClient) => ({
4
6
  retry: 3,
5
- // Retry twice on errors that don't return a response (ENOTFOUND, ETIMEDOUT, etc).
6
7
  noResponseRetries: 2,
7
- // Milliseconds to delay at first. Defaults to 100.
8
8
  retryDelay: 100,
9
- // HTTP methods to automatically retry. Defaults to:
10
- // ['GET', 'HEAD', 'OPTIONS', 'DELETE', 'PUT']
11
- httpMethodsToRetry: ['GET', 'HEAD', 'OPTIONS', 'DELETE', 'PUT'],
12
- // The response status codes to retry. Supports a double
13
- // array with a list of ranges. Defaults to:
14
- // [[100, 199], [429, 429], [500, 599]]
15
- statusCodesToRetry: [[100, 199], [429, 429], [500, 599]],
16
- // If you are using a non static instance of Axios you need
17
- // to pass that instance here (const ax = axios.create())
9
+ httpMethodsToRetry: ["GET", "HEAD", "OPTIONS", "DELETE", "PUT"],
10
+ statusCodesToRetry: [
11
+ [100, 199],
12
+ [429, 429],
13
+ [500, 599]
14
+ ],
18
15
  instance: httpClient,
19
- // You can detect when a retry is happening, and figure out how many
20
- // retry attempts have been made
21
- onRetryAttempt: err => {
22
- const cfg = getConfig(err); // eslint-disable-next-line no-console
23
-
24
- if (cfg && cfg.currentRetryAttempt) {}
16
+ onRetryAttempt: (err) => {
17
+ const cfg = getConfig(err);
18
+ if (cfg && cfg.currentRetryAttempt)
19
+ console.log(`Retry attempt #${cfg.currentRetryAttempt}`);
25
20
  }
26
21
  });
27
-
28
- const setupRetry = httpClient => {
29
- if (httpClient !== null && httpClient !== void 0 && httpClient.defaults) // eslint-disable-next-line no-param-reassign
22
+ const setupRetry = (httpClient) => {
23
+ if (httpClient?.defaults)
30
24
  httpClient.defaults.retryConfig = getRaxConfig(httpClient);
31
25
  attach(httpClient);
32
26
  };
33
-
34
- export default setupRetry;
27
+ var retry_default = setupRetry;
28
+ export {
29
+ retry_default as default,
30
+ getRaxConfig
31
+ };
@@ -1,65 +1,46 @@
1
- /* Important. these test cases work only with server backend. so do not enable these test cases. */
2
- import enums from "../../../utils/constants.js";
3
- import { getAuthHTTPClient } from "../index.js";
4
- import { onAuthorizationFailure } from "../response-interceptor.js";
5
- describe('http client test cases', () => {
1
+ import enums from "../../../utils/constants";
2
+ import { getAuthHTTPClient } from "../index";
3
+ import { onAuthorizationFailure } from "../response-interceptor";
4
+ describe("http client test cases", () => {
6
5
  const callApi = ({
7
6
  apiUrl,
8
7
  options = {},
9
- baseURL = 'http://localhost:3001'
8
+ baseURL = "http://localhost:3001"
10
9
  }) => {
11
- const httpClient = getAuthHTTPClient({
12
- baseURL
13
- });
10
+ const httpClient = getAuthHTTPClient({ baseURL });
14
11
  return httpClient.get(apiUrl, options);
15
12
  };
16
-
17
- const refreshToken = () => new Promise(resolve => {
18
- const authorizationHeader = 'pui';
13
+ const refreshToken = () => new Promise((resolve) => {
14
+ const authorizationHeader = "pui";
19
15
  sessionStorage.setItem(enums.AUTHORIZATION, authorizationHeader);
20
16
  resolve(authorizationHeader);
21
17
  });
22
-
23
- it('should download large file without timing out', async () => {
24
- jest.setTimeout(300000);
25
- const {
26
- data
27
- } = await callApi({
28
- apiUrl: 'annual_report_2009.pdf',
29
- options: {
30
- timeout: 200000
31
- },
32
- baseURL: 'https://www.iso.org/files/live/sites/isoorg/files/archive/pdf/en'
18
+ it("should download large file without timing out", async () => {
19
+ jest.setTimeout(3e5);
20
+ const { data } = await callApi({
21
+ apiUrl: "annual_report_2009.pdf",
22
+ options: { timeout: 2e5 },
23
+ baseURL: "https://www.iso.org/files/live/sites/isoorg/files/archive/pdf/en"
33
24
  });
34
25
  expect(data).toBeDefined();
35
26
  });
36
- it('should throw connection aborted error for large file download', async () => {
37
- jest.setTimeout(300000);
27
+ it("should throw connection aborted error for large file download", async () => {
28
+ jest.setTimeout(3e5);
38
29
  await expect(callApi({
39
- apiUrl: 'annual_report_2009.pdf',
40
- baseURL: 'https://www.iso.org/files/live/sites/isoorg/files/archive/pdf/en'
41
- })).rejects.toEqual(new Error('timeout of 10000ms exceeded'));
30
+ apiUrl: "annual_report_2009.pdf",
31
+ baseURL: "https://www.iso.org/files/live/sites/isoorg/files/archive/pdf/en"
32
+ })).rejects.toEqual(new Error("timeout of 10000ms exceeded"));
42
33
  });
43
- it('should return success response', async () => {
44
- const {
45
- data
46
- } = await callApi({
47
- apiUrl: '/hello'
48
- });
49
- expect(data.name).toEqual('pui-app-sdk');
34
+ it("should return success response", async () => {
35
+ const { data } = await callApi({ apiUrl: "/hello" });
36
+ expect(data.name).toEqual("pui-app-sdk");
50
37
  });
51
- it('should return unauthorized 401 response', async () => {
52
- await expect(callApi({
53
- apiUrl: '/private'
54
- })).rejects.toThrow('Request failed with status code 401');
38
+ it("should return unauthorized 401 response", async () => {
39
+ await expect(callApi({ apiUrl: "/private" })).rejects.toThrow("Request failed with status code 401");
55
40
  });
56
- it('should return success after refreshing authorization token', async () => {
41
+ it("should return success after refreshing authorization token", async () => {
57
42
  onAuthorizationFailure(refreshToken);
58
- const {
59
- data
60
- } = await callApi({
61
- apiUrl: '/private'
62
- });
63
- expect(data.message).toEqual('you are viewing a private message');
43
+ const { data } = await callApi({ apiUrl: "/private" });
44
+ expect(data.message).toEqual("you are viewing a private message");
64
45
  });
65
- });
46
+ });
@@ -1,7 +1,7 @@
1
- export const LOGIN = 'auth/LOGIN';
2
- export const LOGIN_SUCCESS = 'auth/LOGIN_SUCCESS';
3
- export const LOGOUT = 'auth/LOGOUT';
4
- export const auth = {
1
+ const LOGIN = "auth/LOGIN";
2
+ const LOGIN_SUCCESS = "auth/LOGIN_SUCCESS";
3
+ const LOGOUT = "auth/LOGOUT";
4
+ const auth = {
5
5
  login: ({
6
6
  idpCode,
7
7
  redirectUri,
@@ -10,13 +10,7 @@ export const auth = {
10
10
  scope
11
11
  }) => ({
12
12
  type: LOGIN,
13
- payload: {
14
- idpCode,
15
- redirectUri,
16
- clientId,
17
- responseType,
18
- scope
19
- }
13
+ payload: { idpCode, redirectUri, clientId, responseType, scope }
20
14
  }),
21
15
  logout: ({
22
16
  clientId,
@@ -26,12 +20,12 @@ export const auth = {
26
20
  code
27
21
  }) => ({
28
22
  type: LOGOUT,
29
- payload: {
30
- clientId,
31
- redirectUri,
32
- responseType,
33
- scope,
34
- code
35
- }
23
+ payload: { clientId, redirectUri, responseType, scope, code }
36
24
  })
37
- };
25
+ };
26
+ export {
27
+ LOGIN,
28
+ LOGIN_SUCCESS,
29
+ LOGOUT,
30
+ auth
31
+ };
@@ -1,14 +1,16 @@
1
- import produce from 'immer';
2
- import { LOGIN_SUCCESS } from "./actions.js";
3
- export const initialState = {
1
+ import produce from "immer";
2
+ import { LOGIN_SUCCESS } from "./actions";
3
+ const initialState = {
4
4
  authenticated: false
5
5
  };
6
- /* eslint-disable default-case, no-param-reassign */
7
-
8
- export const authReducer = produce((draft, action) => {
6
+ const authReducer = produce((draft, action) => {
9
7
  switch (action.type) {
10
8
  case LOGIN_SUCCESS:
11
9
  draft.authenticated = true;
12
10
  break;
13
11
  }
14
- }, initialState);
12
+ }, initialState);
13
+ export {
14
+ authReducer,
15
+ initialState
16
+ };
@@ -1,30 +1,28 @@
1
- /* eslint-disable no-param-reassign */
2
- import produce from 'immer';
3
- export const breakpoint = {
4
- change: 'change'
1
+ import produce from "immer";
2
+ const breakpoint = {
3
+ change: "change"
5
4
  };
6
- export let Breakpoints;
7
-
8
- (function (Breakpoints) {
9
- Breakpoints["LARGE"] = "large";
10
- Breakpoints["MEDIUM"] = "medium";
11
- Breakpoints["SMALL"] = "small";
12
- })(Breakpoints || (Breakpoints = {}));
13
-
5
+ var Breakpoints = /* @__PURE__ */ ((Breakpoints2) => {
6
+ Breakpoints2["LARGE"] = "large";
7
+ Breakpoints2["MEDIUM"] = "medium";
8
+ Breakpoints2["SMALL"] = "small";
9
+ return Breakpoints2;
10
+ })(Breakpoints || {});
14
11
  const initialState = {
15
- value: Breakpoints.LARGE
12
+ value: "large" /* LARGE */
16
13
  };
17
- export const breakpointReducer = (state = initialState, action) => {
18
- const {
19
- type,
20
- payload
21
- } = action;
22
- return produce(state, draft => {
23
- // eslint-disable-next-line default-case
14
+ const breakpointReducer = (state = initialState, action) => {
15
+ const { type, payload } = action;
16
+ return produce(state, (draft) => {
24
17
  switch (type) {
25
18
  case breakpoint.change:
26
19
  draft.value = payload;
27
20
  break;
28
21
  }
29
22
  });
30
- };
23
+ };
24
+ export {
25
+ Breakpoints,
26
+ breakpoint,
27
+ breakpointReducer
28
+ };
@@ -1,17 +1,19 @@
1
- import { createSlice } from '@reduxjs/toolkit';
1
+ import { createSlice } from "@reduxjs/toolkit";
2
2
  const initialState = {
3
- description: '',
4
- messageText: ''
3
+ description: "",
4
+ messageText: ""
5
5
  };
6
6
  const errorSlice = createSlice({
7
- name: 'error',
7
+ name: "error",
8
8
  initialState,
9
9
  reducers: {
10
- set: (_, actions) => actions.payload,
10
+ set: (_, actions2) => actions2.payload,
11
11
  clear: () => initialState
12
12
  }
13
13
  });
14
- export const {
15
- actions
16
- } = errorSlice;
17
- export const errorReducer = errorSlice.reducer;
14
+ const { actions } = errorSlice;
15
+ const errorReducer = errorSlice.reducer;
16
+ export {
17
+ actions,
18
+ errorReducer
19
+ };
@@ -1,27 +1,23 @@
1
- import { createSlice } from '@reduxjs/toolkit';
1
+ import { createSlice } from "@reduxjs/toolkit";
2
2
  const initialState = {
3
- message: '',
4
- ariaLive: 'polite',
5
- id: ''
3
+ message: "",
4
+ ariaLive: "polite",
5
+ id: ""
6
6
  };
7
7
  const liveMessage = createSlice({
8
- name: 'liveMessage',
8
+ name: "liveMessage",
9
9
  initialState,
10
10
  reducers: {
11
- announce: (state, {
12
- payload: {
13
- message,
14
- ariaLive,
15
- id
16
- }
17
- }) => ({
11
+ announce: (state, { payload: { message, ariaLive, id } }) => ({
18
12
  message,
19
13
  ariaLive,
20
14
  id
21
15
  })
22
16
  }
23
17
  });
24
- export const {
25
- actions
26
- } = liveMessage;
27
- export const liveMessageReducer = liveMessage.reducer;
18
+ const { actions } = liveMessage;
19
+ const liveMessageReducer = liveMessage.reducer;
20
+ export {
21
+ actions,
22
+ liveMessageReducer
23
+ };
@@ -1,8 +1,8 @@
1
- export const actions = {
2
- CONFIRM: 'log-out/CONFIRM',
3
- CANCEL: 'log-out/CANCEL'
1
+ const actions = {
2
+ CONFIRM: "log-out/CONFIRM",
3
+ CANCEL: "log-out/CANCEL"
4
4
  };
5
- export const logout = {
5
+ const logout = {
6
6
  confirm: () => ({
7
7
  type: actions.CONFIRM,
8
8
  payload: null
@@ -11,4 +11,8 @@ export const logout = {
11
11
  type: actions.CANCEL,
12
12
  payload: null
13
13
  })
14
- };
14
+ };
15
+ export {
16
+ actions,
17
+ logout
18
+ };
@@ -1,8 +1,8 @@
1
- export const ACTIONS = {
2
- CONFIRM: 'navigation-prompt/CONFIRM',
3
- CANCEL: 'navigation-prompt/CANCEL'
1
+ const ACTIONS = {
2
+ CONFIRM: "navigation-prompt/CONFIRM",
3
+ CANCEL: "navigation-prompt/CANCEL"
4
4
  };
5
- export const navigationPrompt = {
5
+ const navigationPrompt = {
6
6
  confirm: () => ({
7
7
  type: ACTIONS.CONFIRM,
8
8
  payload: null
@@ -11,4 +11,8 @@ export const navigationPrompt = {
11
11
  type: ACTIONS.CANCEL,
12
12
  payload: null
13
13
  })
14
- };
14
+ };
15
+ export {
16
+ ACTIONS,
17
+ navigationPrompt
18
+ };
@@ -1,3 +1,7 @@
1
- import { useDispatch, useSelector } from 'react-redux';
2
- export const useAppDispatch = () => useDispatch();
3
- export const useAppSelector = useSelector;
1
+ import { useDispatch, useSelector } from "react-redux";
2
+ const useAppDispatch = () => useDispatch();
3
+ const useAppSelector = useSelector;
4
+ export {
5
+ useAppDispatch,
6
+ useAppSelector
7
+ };
@@ -1,9 +1,9 @@
1
- import { combineReducers } from '@reduxjs/toolkit';
2
- import { waitMessageReducer } from "./wait-message/reducer.js";
3
- import { errorReducer } from "./error/index.js";
4
- import { breakpointReducer } from "./breakpoint/index.js";
5
- import { liveMessageReducer } from "./live-message/index.js";
6
- export const createReducer = (injectedReducers = {}) => {
1
+ import { combineReducers } from "@reduxjs/toolkit";
2
+ import { waitMessageReducer } from "./wait-message/reducer";
3
+ import { errorReducer } from "./error";
4
+ import { breakpointReducer } from "./breakpoint";
5
+ import { liveMessageReducer } from "./live-message";
6
+ const createReducer = (injectedReducers = {}) => {
7
7
  const rootReducer = combineReducers({
8
8
  waitMessage: waitMessageReducer,
9
9
  error: errorReducer,
@@ -12,4 +12,7 @@ export const createReducer = (injectedReducers = {}) => {
12
12
  ...injectedReducers
13
13
  });
14
14
  return rootReducer;
15
- };
15
+ };
16
+ export {
17
+ createReducer
18
+ };
@@ -1,5 +1,8 @@
1
- export const AllowedModes = {
2
- RestartOnRemount: 'RESTART_ON_REMOUNT',
3
- Daemon: 'DAEMON',
4
- OnceTillUnmount: 'ONCE_TILL_UNMOUNT'
5
- };
1
+ const AllowedModes = {
2
+ RestartOnRemount: "RESTART_ON_REMOUNT",
3
+ Daemon: "DAEMON",
4
+ OnceTillUnmount: "ONCE_TILL_UNMOUNT"
5
+ };
6
+ export {
7
+ AllowedModes
8
+ };