@elliemae/pui-app-sdk 2.16.1 → 3.0.0-beta.2

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 +33 -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 +187 -800
  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 +37 -29
  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 +11 -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 +181 -83
  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 +16 -19
  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 +7 -5
  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,16 +1,20 @@
1
- import { logger as uiLogger, Console } from '@elliemae/pui-diagnostics';
2
- import { getAppConfigValue } from "../app-config/config.js";
3
- export const logger = (() => {
4
- if (!uiLogger) return console;
1
+ import { logger as uiLogger, Console } from "@elliemae/pui-diagnostics";
2
+ import { getAppConfigValue } from "../app-config/config";
3
+ const logger = (() => {
4
+ if (!uiLogger)
5
+ return console;
5
6
  return uiLogger({
6
7
  transport: Console(),
7
- index: 'app',
8
- environment: getAppConfigValue('activeEnv'),
9
- logger: 'icemt.app.logger',
10
- team: 'app team',
11
- appName: 'ICEMT App',
12
- appVersion: 'latest',
13
- tenantId: '',
14
- userId: ''
8
+ index: "app",
9
+ environment: getAppConfigValue("activeEnv"),
10
+ logger: "icemt.app.logger",
11
+ team: "app team",
12
+ appName: "ICEMT App",
13
+ appVersion: "latest",
14
+ tenantId: "",
15
+ userId: ""
15
16
  });
16
- })();
17
+ })();
18
+ export {
19
+ logger
20
+ };
@@ -1,194 +1,138 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import _merge from "lodash/merge";
3
- import ReactDOM from 'react-dom';
4
- import ssfGuest from '@elliemae/em-ssf-guest';
5
- import { getDefaultTheme } from '@elliemae/pui-theme';
6
- import { getWindow } from "../window.js";
7
- import { loadAppConfig } from "../app-config/index.js";
8
- import { getAppConfigValue } from "../app-config/config.js";
9
- import { browserHistory } from "../history.js";
10
- import { logger } from "./console-logger.js";
11
- import { removeStorageEvents } from "../web-storage.js";
12
- import { updateBAEventParameters } from "../../analytics/web-analytics.js";
13
- import { setAppDynamicsUserData } from "../../analytics/appdynamics.js";
14
-
1
+ import ReactDOM from "react-dom";
2
+ import _ from "lodash";
3
+ import ssfGuest from "@elliemae/em-ssf-guest";
4
+ import { getDefaultTheme } from "@elliemae/pui-theme";
5
+ import { getWindow } from "../window";
6
+ import { loadAppConfig } from "../app-config";
7
+ import { getAppConfigValue } from "../app-config/config";
8
+ import { browserHistory } from "../history";
9
+ import { logger } from "./console-logger";
10
+ import { removeStorageEvents } from "../web-storage";
11
+ import { updateBAEventParameters } from "../../analytics/web-analytics";
12
+ import { setAppDynamicsUserData } from "../../analytics/appdynamics";
15
13
  const isCrossDomain = () => {
16
14
  try {
17
- // eslint-disable-next-line @typescript-eslint/no-unused-expressions
18
15
  window.parent.document;
19
16
  return false;
20
17
  } catch (ex) {
21
18
  return true;
22
19
  }
23
- }; // singleton class
24
-
25
-
26
- export class CMicroAppGuest {
20
+ };
21
+ class CMicroAppGuest {
27
22
  constructor(params) {
28
- var _window$emui;
29
-
30
- _defineProperty(this, "logger", void 0);
31
-
32
- _defineProperty(this, "appId", void 0);
33
-
34
- _defineProperty(this, "props", void 0);
35
-
36
- _defineProperty(this, "containerId", void 0);
37
-
38
- _defineProperty(this, "onInit", void 0);
39
-
40
- _defineProperty(this, "onMount", void 0);
41
-
42
- _defineProperty(this, "onUnmount", void 0);
43
-
44
- _defineProperty(this, "onGetRef", void 0);
45
-
46
- this.containerId = 'app-container';
47
- this.appId = ((_window$emui = window.emui) === null || _window$emui === void 0 ? void 0 : _window$emui.appId) || getAppConfigValue('appId');
23
+ this.containerId = "app-container";
24
+ this.appId = window.emui?.appId || getAppConfigValue("appId");
48
25
  this.props = {
49
26
  host: null,
50
27
  hostUrl: null,
51
28
  prevState: null,
52
29
  history: browserHistory,
53
30
  theme: getDefaultTheme(),
54
- manifestPath: './latest'
31
+ manifestPath: "./latest"
55
32
  };
56
- this.logger = (params === null || params === void 0 ? void 0 : params.logger) || logger;
57
- this.onInit = params === null || params === void 0 ? void 0 : params.onInit;
58
- this.onMount = params === null || params === void 0 ? void 0 : params.onMount;
59
- this.onUnmount = params === null || params === void 0 ? void 0 : params.onUnmount;
60
- this.onGetRef = params === null || params === void 0 ? void 0 : params.onGetRef;
33
+ this.logger = params?.logger || logger;
34
+ this.onInit = params?.onInit;
35
+ this.onMount = params?.onMount;
36
+ this.onUnmount = params?.onUnmount;
37
+ this.onGetRef = params?.onGetRef;
61
38
  this.getHost = this.getHost.bind(this);
62
39
  this.getLogger = this.getLogger.bind(this);
63
40
  this.getProps = this.getProps.bind(this);
64
41
  const browserWindow = getWindow();
65
-
66
42
  if (browserWindow) {
67
43
  browserWindow.emui = browserWindow.emui || {};
68
- browserWindow.emui[this.appId] = browserWindow.emui[this.appId] || {}; // expose init mount & unmount methods
69
-
44
+ browserWindow.emui[this.appId] = browserWindow.emui[this.appId] || {};
70
45
  browserWindow.emui[this.appId].init = this.init.bind(this);
71
46
  browserWindow.emui[this.appId].mount = this.mount.bind(this);
72
47
  browserWindow.emui[this.appId].unmount = this.unmount.bind(this);
73
48
  browserWindow.emui[this.appId].getRef = this.getRef.bind(this);
74
49
  }
75
50
  }
76
-
77
51
  static getInstance(params) {
78
52
  if (!this.instance) {
79
53
  this.instance = new this(params);
80
54
  }
81
-
82
55
  return this.instance;
83
56
  }
84
-
85
57
  static isInitialized() {
86
58
  return !!this.instance;
87
59
  }
88
-
89
60
  static isHosted() {
90
- var _this$instance, _this$instance$props;
91
-
92
- return !!((_this$instance = this.instance) !== null && _this$instance !== void 0 && (_this$instance$props = _this$instance.props) !== null && _this$instance$props !== void 0 && _this$instance$props.host);
61
+ return !!this.instance?.props?.host;
93
62
  }
94
-
95
63
  getHost() {
96
64
  return this.props.host;
97
65
  }
98
-
99
66
  getLogger() {
100
67
  return this.logger;
101
68
  }
102
-
103
69
  getProps() {
104
70
  return this.props;
105
71
  }
106
-
107
72
  getSessionStorageItem(key) {
108
- var _this$props$host;
109
-
110
73
  let value = sessionStorage.getItem(key);
111
-
112
- if (!value && (_this$props$host = this.props.host) !== null && _this$props$host !== void 0 && _this$props$host.getItem) {
74
+ if (!value && this.props.host?.getItem) {
113
75
  value = this.props.host.getItem(key);
114
76
  }
115
-
116
77
  return value;
117
78
  }
118
-
119
79
  async getSSFHost() {
120
80
  let host = null;
121
-
122
81
  if (window.parent !== window) {
123
- // not a standalone app
124
82
  if (!isCrossDomain()) {
125
- var _window$parent, _window$parent$emui;
126
-
127
- host = ((_window$parent = window.parent) === null || _window$parent === void 0 ? void 0 : (_window$parent$emui = _window$parent.emui) === null || _window$parent$emui === void 0 ? void 0 : _window$parent$emui.MicroAppHost) || null;
83
+ host = window.parent?.emui?.MicroAppHost || null;
128
84
  } else if (ssfGuest && this.props.hostName) {
129
85
  ssfGuest.connect();
130
- const timeout = new Promise(resolve => {
86
+ const timeout = new Promise((resolve) => {
131
87
  setTimeout(resolve, 100, null);
132
88
  });
133
- host = await Promise.race([ssfGuest.getObject(this.props.hostName), timeout]);
89
+ host = await Promise.race([
90
+ ssfGuest.getObject(this.props.hostName),
91
+ timeout
92
+ ]);
134
93
  }
135
94
  }
136
-
137
95
  return host;
138
96
  }
139
-
140
97
  async init(options) {
141
- this.props = _merge(this.props, options);
142
-
98
+ this.props = _.merge(this.props, options);
143
99
  if (!this.props.host) {
144
100
  const host = await this.getSSFHost();
145
- if (host) this.props.host = host;
101
+ if (host)
102
+ this.props.host = host;
146
103
  }
147
- /* eslint-disable camelcase, no-undef */
148
-
149
-
150
- __webpack_public_path__ = __webpack_public_path__.replace(/\/?$/, '/');
104
+ __webpack_public_path__ = __webpack_public_path__.replace(/\/?$/, "/");
151
105
  return loadAppConfig(__webpack_public_path__).then(() => {
152
- const instanceId = this.getSessionStorageItem('instanceId') || '';
153
- const userId = this.getSessionStorageItem('userId') || '';
154
- updateBAEventParameters({
155
- appId: this.appId,
156
- instanceId,
157
- userId
158
- });
159
- setAppDynamicsUserData({
160
- appId: this.appId,
161
- instanceId,
162
- userId
163
- });
164
- if (this.onInit) this.onInit(this.props);
106
+ const instanceId = this.getSessionStorageItem("instanceId") || "";
107
+ const userId = this.getSessionStorageItem("userId") || "";
108
+ updateBAEventParameters({ appId: this.appId, instanceId, userId });
109
+ setAppDynamicsUserData({ appId: this.appId, instanceId, userId });
110
+ if (this.onInit)
111
+ this.onInit(this.props);
165
112
  });
166
113
  }
167
-
168
- mount(options = {
169
- containerId: 'app-container'
170
- }) {
171
- this.containerId = options === null || options === void 0 ? void 0 : options.containerId;
114
+ mount(options = { containerId: "app-container" }) {
115
+ this.containerId = options?.containerId;
172
116
  return Promise.resolve().then(() => {
173
- if (this.onMount) this.onMount(options);
117
+ if (this.onMount)
118
+ this.onMount(options);
174
119
  });
175
120
  }
176
-
177
121
  unmount(options) {
178
122
  const appEle = document.getElementById(this.containerId);
179
- if (appEle) ReactDOM.unmountComponentAtNode(appEle);
123
+ if (appEle)
124
+ ReactDOM.unmountComponentAtNode(appEle);
180
125
  removeStorageEvents();
181
126
  return Promise.resolve().then(() => this.onUnmount ? this.onUnmount(options) : null);
182
127
  }
183
-
184
128
  getRef() {
185
129
  return this.onGetRef ? this.onGetRef() : null;
186
130
  }
187
-
188
131
  navigate(url, state) {
189
- if (url) this.props.history.push(url, state);
132
+ if (url)
133
+ this.props.history.push(url, state);
190
134
  }
191
-
192
135
  }
193
-
194
- _defineProperty(CMicroAppGuest, "instance", void 0);
136
+ export {
137
+ CMicroAppGuest
138
+ };
@@ -1,40 +1,33 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import { publish, subscribe, unsubscribe } from 'pubsub-js';
3
- import { getDefaultTheme } from '@elliemae/pui-theme';
4
- import { getStore } from "../../data/store.js";
5
- import { waitMessage } from "../../data/wait-message/actions.js";
6
- import { actions as error } from "../../data/error/index.js";
7
- import { logout } from "../../data/logout/actions.js";
8
- import { getAppConfigValue } from "../app-config/config.js";
9
- import { resetUserIdleTime } from "../session.js";
10
- import { loadAppConfig } from "../app-config/index.js";
11
- import { browserHistory } from "../history.js";
12
- import { logger } from "./console-logger.js";
13
- import { HOST_WINDOW_RESIZED, HOST_WINDOW_BREAKPOINT_CHANGED } from "../constants.js";
14
- import { getCurrentBreakpoint, getViewportSize as getWindowViewportSize } from "../window.js";
15
- import { sendBAEvent } from "../../analytics/index.js";
16
- import { setAppDynamicsUserData } from "../../analytics/appdynamics.js";
17
- import { updateBAEventParameters } from "../../analytics/web-analytics.js";
18
- export class CMicroAppHost {
1
+ import { publish, subscribe, unsubscribe } from "pubsub-js";
2
+ import { getDefaultTheme } from "@elliemae/pui-theme";
3
+ import { getStore } from "../../data/store";
4
+ import { waitMessage } from "../../data/wait-message/actions";
5
+ import { actions as error } from "../../data/error";
6
+ import { logout } from "../../data/logout/actions";
7
+ import { getAppConfigValue } from "../app-config/config";
8
+ import { resetUserIdleTime } from "../session";
9
+ import { loadAppConfig } from "../app-config";
10
+ import { browserHistory } from "../history";
11
+ import { logger } from "./console-logger";
12
+ import {
13
+ HOST_WINDOW_RESIZED,
14
+ HOST_WINDOW_BREAKPOINT_CHANGED
15
+ } from "../constants";
16
+ import {
17
+ getCurrentBreakpoint,
18
+ getViewportSize as getWindowViewportSize
19
+ } from "../window";
20
+ import { sendBAEvent } from "../../analytics";
21
+ import { setAppDynamicsUserData } from "../../analytics/appdynamics";
22
+ import { updateBAEventParameters } from "../../analytics/web-analytics";
23
+ class CMicroAppHost {
19
24
  constructor(params) {
20
- _defineProperty(this, "logger", void 0);
21
-
22
- _defineProperty(this, "appId", void 0);
23
-
24
- _defineProperty(this, "props", void 0);
25
-
26
- _defineProperty(this, "activeGuests", void 0);
27
-
28
- _defineProperty(this, "onInit", void 0);
29
-
30
- _defineProperty(this, "onRenewSessionTimer", void 0);
31
-
32
- this.appId = getAppConfigValue('appId');
33
- this.onInit = params === null || params === void 0 ? void 0 : params.onInit;
34
- this.logger = (params === null || params === void 0 ? void 0 : params.logger) || logger;
35
- this.onRenewSessionTimer = params === null || params === void 0 ? void 0 : params.onRenewSessionTimer;
25
+ this.appId = getAppConfigValue("appId");
26
+ this.onInit = params?.onInit;
27
+ this.logger = params?.logger || logger;
28
+ this.onRenewSessionTimer = params?.onRenewSessionTimer;
36
29
  this.props = {
37
- systemVersion: 'latest',
30
+ systemVersion: "latest",
38
31
  history: browserHistory,
39
32
  theme: getDefaultTheme()
40
33
  };
@@ -45,136 +38,107 @@ export class CMicroAppHost {
45
38
  this.getGuest = this.getGuest.bind(this);
46
39
  this.renewSessionTimer = this.renewSessionTimer.bind(this);
47
40
  this.setSystemVersion = this.setSystemVersion.bind(this);
48
- /* eslint-disable camelcase, no-undef */
49
-
50
41
  loadAppConfig(__webpack_public_path__).then(() => {
51
- if (this.onInit) this.onInit(this.props);
52
- }).catch(() => {});
53
- updateBAEventParameters({
54
- appId: this.appId
42
+ if (this.onInit)
43
+ this.onInit(this.props);
44
+ }).catch(() => {
55
45
  });
46
+ updateBAEventParameters({ appId: this.appId });
56
47
  setAppDynamicsUserData({
57
48
  appId: this.appId
58
49
  });
59
50
  }
60
-
61
51
  static getInstance(params) {
62
52
  if (!this.instance) {
63
53
  this.instance = new this(params);
64
54
  }
65
-
66
55
  return this.instance;
67
56
  }
68
-
69
57
  static isInitialized() {
70
58
  return !!this.instance;
71
59
  }
72
-
73
60
  getProps() {
74
61
  return this.props;
75
62
  }
76
-
77
63
  getLogger() {
78
64
  return this.logger;
79
65
  }
80
-
81
66
  getItem(key) {
82
67
  return window.parent.sessionStorage.getItem(key);
83
68
  }
84
-
85
69
  setItem(key, value) {
86
70
  window.parent.sessionStorage.setItem(key, value);
87
71
  }
88
-
89
72
  getGuests() {
90
73
  return this.activeGuests;
91
74
  }
92
-
93
75
  getGuest(id) {
94
76
  return this.activeGuests[id] ? this.activeGuests[id] : null;
95
77
  }
96
-
97
78
  publish(message, data) {
98
79
  return publish(message, data);
99
- } // eslint-disable-next-line @typescript-eslint/ban-types
100
-
101
-
80
+ }
102
81
  subscribe(message, func) {
103
82
  return subscribe(message, func);
104
83
  }
105
-
106
84
  unsubscribe(token) {
107
85
  unsubscribe(token);
108
86
  }
109
-
110
87
  navigate(url, state) {
111
- if (url) this.props.history.push(url, state);
88
+ if (url)
89
+ this.props.history.push(url, state);
112
90
  }
113
-
114
91
  openWaitMessage() {
115
92
  const store = getStore();
116
- if (store) store.dispatch(waitMessage.open());
93
+ if (store)
94
+ store.dispatch(waitMessage.open());
117
95
  }
118
-
119
96
  closeWaitMessage() {
120
97
  const store = getStore();
121
- if (store) store.dispatch(waitMessage.close());
98
+ if (store)
99
+ store.dispatch(waitMessage.close());
122
100
  }
123
-
124
101
  openErrorBanner(message) {
125
102
  const store = getStore();
126
- if (store) store.dispatch(error.set({
127
- description: message
128
- }));
103
+ if (store)
104
+ store.dispatch(error.set({ description: message }));
129
105
  }
130
-
131
106
  getAuthToken() {
132
- return window.parent.sessionStorage.getItem('Authorization');
107
+ return window.parent.sessionStorage.getItem("Authorization");
133
108
  }
134
-
135
109
  renewAuthToken() {
136
- return window.parent.sessionStorage.getItem('Authorization');
110
+ return window.parent.sessionStorage.getItem("Authorization");
137
111
  }
138
-
139
112
  logout() {
140
113
  const store = getStore();
141
- if (store) store.dispatch(logout.confirm());
114
+ if (store)
115
+ store.dispatch(logout.confirm());
142
116
  }
143
-
144
117
  renewSessionTimer() {
145
118
  resetUserIdleTime();
146
- if (this.onRenewSessionTimer) this.onRenewSessionTimer();
119
+ if (this.onRenewSessionTimer)
120
+ this.onRenewSessionTimer();
147
121
  }
148
-
149
122
  getBreakpoint() {
150
123
  return getCurrentBreakpoint();
151
124
  }
152
-
153
125
  getViewportSize() {
154
126
  return getWindowViewportSize();
155
127
  }
156
-
157
128
  onResizeEvent(eventHandler) {
158
129
  return subscribe(HOST_WINDOW_RESIZED, (msg, data) => eventHandler(data));
159
130
  }
160
-
161
131
  onBreakpointChangeEvent(eventHandler) {
162
132
  return subscribe(HOST_WINDOW_BREAKPOINT_CHANGED, (msg, data) => eventHandler(data));
163
133
  }
164
-
165
- setSystemVersion(version = 'latest') {
134
+ setSystemVersion(version = "latest") {
166
135
  window.emui.version = version;
167
136
  this.props.systemVersion = version;
168
- } // eslint-disable-next-line max-lines
169
-
170
-
137
+ }
171
138
  sendBAEvent(data) {
172
- sendBAEvent({
173
- data,
174
- self: true
175
- });
139
+ sendBAEvent({ data, self: true });
176
140
  }
177
-
178
141
  }
179
-
180
- _defineProperty(CMicroAppHost, "instance", void 0);
142
+ export {
143
+ CMicroAppHost
144
+ };
@@ -1,45 +1,47 @@
1
- import _merge from "lodash/merge";
2
- import { CMicroAppGuest } from "./guest.js";
3
- import { CMicroAppHost } from "./host.js";
4
- import { getAppConfigValue } from "../app-config/config.js";
5
- import { convertRelativeToAbsoluteUrl, isCIBuild } from "../helpers.js";
6
- export const isHost = () => CMicroAppHost.isInitialized();
7
- export const isGuest = () => CMicroAppGuest.isInitialized();
8
- export const isStandAloneGuest = () => isGuest() && window.top === window.self;
9
- export const getLogger = () => isHost() ? CMicroAppHost.getInstance().getLogger() : CMicroAppGuest.getInstance().getLogger();
10
-
11
- const isProduction = mode => {
12
- if (isCIBuild()) return true;
13
- if (mode) return mode === 'production';
1
+ import _ from "lodash";
2
+ import { CMicroAppGuest } from "./guest";
3
+ import { CMicroAppHost } from "./host";
4
+ import { getAppConfigValue } from "../app-config/config";
5
+ import { convertRelativeToAbsoluteUrl, isCIBuild } from "../helpers";
6
+ const isHost = () => CMicroAppHost.isInitialized();
7
+ const isGuest = () => CMicroAppGuest.isInitialized();
8
+ const isStandAloneGuest = () => isGuest() && window.top === window.self;
9
+ const getLogger = () => isHost() ? CMicroAppHost.getInstance().getLogger() : CMicroAppGuest.getInstance().getLogger();
10
+ const isProduction = (mode) => {
11
+ if (isCIBuild())
12
+ return true;
13
+ if (mode)
14
+ return mode === "production";
14
15
  return true;
15
16
  };
16
-
17
- const getVersionedPath = path => {
18
- const {
19
- systemVersion
20
- } = CMicroAppHost.getInstance().getProps();
17
+ const getVersionedPath = (path) => {
18
+ const { systemVersion } = CMicroAppHost.getInstance().getProps();
21
19
  const majorMinorVersion = systemVersion.match(/^(?:\d+\.\d+)*/g);
22
- return path.replace(/{SYSTEM_VERSION}/, majorMinorVersion && majorMinorVersion[0] || 'latest');
20
+ return path.replace(/{SYSTEM_VERSION}/, majorMinorVersion && majorMinorVersion[0] || "latest");
23
21
  };
24
-
25
- export const getMicroFrontEndAppConfig = appInfo => {
22
+ const getMicroFrontEndAppConfig = (appInfo) => {
26
23
  const microFEAppConfig = getAppConfigValue(`microFrontendApps.${appInfo.id}`);
27
- if (!microFEAppConfig) throw new Error(`unable to locate application configuraiton for ${appInfo.id} under microFrontendApps section of app.config.json`);
28
- const {
29
- mode = 'production'
30
- } = microFEAppConfig;
31
- const envConfig = isProduction(mode) ? microFEAppConfig.production : microFEAppConfig.development; // delete env config
32
-
33
- if (microFEAppConfig.production) delete microFEAppConfig.production;
34
- if (microFEAppConfig.development) delete microFEAppConfig.development;
35
-
36
- const microFEConfig = _merge(appInfo, {
37
- mode: 'production',
38
- hostUrl: './',
39
- manifestPath: './{SYSTEM_VERSION}'
24
+ if (!microFEAppConfig)
25
+ throw new Error(`unable to locate application configuraiton for ${appInfo.id} under microFrontendApps section of app.config.json`);
26
+ const { mode = "production" } = microFEAppConfig;
27
+ const envConfig = isProduction(mode) ? microFEAppConfig.production : microFEAppConfig.development;
28
+ if (microFEAppConfig.production)
29
+ delete microFEAppConfig.production;
30
+ if (microFEAppConfig.development)
31
+ delete microFEAppConfig.development;
32
+ const microFEConfig = _.merge(appInfo, {
33
+ mode: "production",
34
+ hostUrl: "./",
35
+ manifestPath: "./{SYSTEM_VERSION}"
40
36
  }, microFEAppConfig, envConfig);
41
-
42
- microFEConfig.hostUrl = convertRelativeToAbsoluteUrl(microFEConfig.hostUrl.replace(/\/?$/, '/'));
37
+ microFEConfig.hostUrl = convertRelativeToAbsoluteUrl(microFEConfig.hostUrl.replace(/\/?$/, "/"));
43
38
  microFEConfig.manifestPath = getVersionedPath(microFEConfig.manifestPath);
44
39
  return microFEConfig;
45
- };
40
+ };
41
+ export {
42
+ getLogger,
43
+ getMicroFrontEndAppConfig,
44
+ isGuest,
45
+ isHost,
46
+ isStandAloneGuest
47
+ };
@@ -1 +0,0 @@
1
- export {};
@@ -3,29 +3,28 @@ const poBoxRegex = /P\.? ?O\.? *Box +\d+/gi;
3
3
  const roadRegex = /(street|st|road|rd|avenue|ave|drive|dr|loop|court|ct|circle|cir|lane|ln|boulevard|blvd|way)\.?\b/gi;
4
4
  const piiPatterns = {
5
5
  creditCardNumber: /\d{4}[ -]?\d{4}[ -]?\d{4}[ -]?\d{4}|\d{4}[ -]?\d{6}[ -]?\d{4}\d?/g,
6
- streetAddress: new RegExp(`(\\d+\\s*(\\w+ ){1,2}${roadRegex.source}(\\s+${aptRegex.source})?)|(${poBoxRegex.source})`, 'gi'),
6
+ streetAddress: new RegExp(`(\\d+\\s*(\\w+ ){1,2}${roadRegex.source}(\\s+${aptRegex.source})?)|(${poBoxRegex.source})`, "gi"),
7
7
  zipcode: /\b\d{5}\b(-\d{4})?\b/g,
8
8
  phoneNumber: /(\(?\+?[0-9]{1,2}\)?[-. ]?)?(\(?[0-9]{3}\)?|[0-9]{3})[-. ]?([0-9]{3}[-. ]?[0-9]{4}|\b[A-Z0-9]{7}\b)/g,
9
9
  ipAddress: /(\d{1,3}(\.\d{1,3}){3}|[0-9A-F]{4}(:[0-9A-F]{4}){5}(::|(:0000)+))/gi,
10
10
  usSocialSecurityNumber: /\b\d{3}[ -.]\d{2}[ -.]\d{4}\b/g,
11
11
  emailAddress: /([a-z0-9_\-.+]+)@\w+(\.\w+)*/gi,
12
- // username: /(user( ?name)?|login): \S+/gi,
13
12
  password: /(pass(word|phrase)?|secret): \S+/gi,
14
- credentials: /(login( cred(ential)?s| info(rmation)?)?|cred(ential)?s) ?:\s*\S+\s+\/?\s*\S+/gi // digits: /\b\d{4,}\b/g,
15
- // url: /([^\s:/?#]+):\/\/([^/?#\s]*)([^?#\s]*)(\?([^#\s]*))?(#([^\s]*))?/g,
16
-
13
+ credentials: /(login( cred(ential)?s| info(rmation)?)?|cred(ential)?s) ?:\s*\S+\s+\/?\s*\S+/gi
17
14
  };
18
-
19
15
  const replacer = (key, value) => {
20
- if (!key || typeof value !== 'string' || key === 'correlationId') return value;
21
- return Object.values(piiPatterns).reduce((redactedString, piiPattern) => redactedString.replace(piiPattern, '****'), value);
16
+ if (!key || typeof value !== "string" || key === "correlationId")
17
+ return value;
18
+ return Object.values(piiPatterns).reduce((redactedString, piiPattern) => redactedString.replace(piiPattern, "****"), value);
22
19
  };
23
-
24
- export const redactPii = data => {
20
+ const redactPii = (data) => {
25
21
  try {
26
22
  const redactedData = JSON.stringify(data, replacer);
27
23
  return JSON.parse(redactedData);
28
24
  } catch (err) {
29
25
  return data;
30
26
  }
31
- };
27
+ };
28
+ export {
29
+ redactPii
30
+ };