@elliemae/pui-app-sdk 2.12.3 → 2.13.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 (231) hide show
  1. package/dist/cjs/analytics/appdynamics.js +36 -0
  2. package/dist/cjs/analytics/index.js +15 -13
  3. package/dist/cjs/analytics/page-view-event.js +16 -19
  4. package/dist/cjs/analytics/user-session-event.js +13 -14
  5. package/dist/cjs/analytics/user-wait-event.js +4 -4
  6. package/dist/cjs/analytics/{ba-event-parameters.js → web-analytics.js} +2 -2
  7. package/dist/cjs/api/auth/index.js +13 -20
  8. package/dist/cjs/api/helpers.js +4 -16
  9. package/dist/cjs/api/users/index.js +4 -5
  10. package/dist/cjs/communication/http-client/index.js +16 -21
  11. package/dist/cjs/communication/http-client/retry-axios.js +0 -2
  12. package/dist/cjs/communication/http-client/tests/index.test-disable.js +5 -6
  13. package/dist/cjs/data/auth/actions.js +22 -28
  14. package/dist/cjs/data/breakpoint/index.js +1 -3
  15. package/dist/cjs/data/live-message/index.js +8 -11
  16. package/dist/cjs/data/reducers.js +1 -2
  17. package/dist/cjs/data/store.js +4 -8
  18. package/dist/cjs/data/wait-message/actions.js +6 -9
  19. package/dist/cjs/data/wait-message/reducer.js +13 -17
  20. package/dist/cjs/index.js +21 -15
  21. package/dist/cjs/route/index.js +23 -12
  22. package/dist/cjs/route/{usePageView.js → page-view.js} +12 -22
  23. package/dist/cjs/route/private-route/index.js +9 -10
  24. package/dist/cjs/sideeffect/auth/index.js +6 -10
  25. package/dist/cjs/utils/app-config/config.js +3 -14
  26. package/dist/cjs/utils/app-config/index.js +11 -15
  27. package/dist/cjs/utils/app-host-integration/react.js +7 -10
  28. package/dist/cjs/utils/auth/index.js +40 -44
  29. package/dist/cjs/utils/font-size.js +1 -1
  30. package/dist/cjs/utils/helpers.js +0 -6
  31. package/dist/cjs/utils/log-records.js +7 -7
  32. package/dist/cjs/utils/micro-frontend/guest.js +31 -8
  33. package/dist/cjs/utils/micro-frontend/host.js +14 -7
  34. package/dist/cjs/utils/micro-frontend/index.js +2 -4
  35. package/dist/cjs/utils/redact-pii.js +39 -0
  36. package/dist/cjs/utils/service-worker.js +2 -5
  37. package/dist/cjs/utils/session.js +2 -8
  38. package/dist/cjs/utils/storybook/theme.js +9 -12
  39. package/dist/cjs/utils/testing/index.js +9 -18
  40. package/dist/cjs/utils/testing/render-with-redux.js +11 -14
  41. package/dist/cjs/utils/testing/render-with-router-redux.js +17 -20
  42. package/dist/cjs/utils/testing/render-with-router.js +13 -16
  43. package/dist/cjs/utils/testing/render-with-state-addons.js +7 -16
  44. package/dist/cjs/utils/url.js +0 -8
  45. package/dist/cjs/utils/web-storage.js +1 -7
  46. package/dist/cjs/utils/window.js +0 -2
  47. package/dist/cjs/view/app-root/hosted-app.js +5 -8
  48. package/dist/cjs/view/app-root/index.js +20 -23
  49. package/dist/cjs/view/app-root/stand-alone-app.js +5 -8
  50. package/dist/cjs/view/app-root/style.js +5 -12
  51. package/dist/cjs/view/error-toast/index.stories.js +22 -31
  52. package/dist/cjs/view/fetch-host-app-data/store.js +1 -5
  53. package/dist/cjs/view/fields/check-box/index.js +20 -32
  54. package/dist/cjs/view/fields/check-box/index.stories.js +20 -24
  55. package/dist/cjs/view/fields/check-box/set-value.stories.js +17 -21
  56. package/dist/cjs/view/fields/combo-box/index.js +22 -28
  57. package/dist/cjs/view/fields/connect-form.js +3 -4
  58. package/dist/cjs/view/fields/date-input/index.js +15 -21
  59. package/dist/cjs/view/fields/date-picker/index.js +15 -21
  60. package/dist/cjs/view/fields/form-item-layout/index.js +16 -20
  61. package/dist/cjs/view/fields/input-mask/index.js +16 -28
  62. package/dist/cjs/view/fields/large-text-box/index.js +15 -21
  63. package/dist/cjs/view/fields/radio/index.js +20 -26
  64. package/dist/cjs/view/fields/radio/index.stories.js +17 -21
  65. package/dist/cjs/view/fields/radio/set-value.stories.js +15 -19
  66. package/dist/cjs/view/fields/radio-group/index.js +16 -22
  67. package/dist/cjs/view/fields/radio-group/index.stories.js +37 -44
  68. package/dist/cjs/view/fields/text-box/index.js +15 -21
  69. package/dist/cjs/view/fields/watch-value.js +4 -5
  70. package/dist/cjs/view/form/index.js +9 -10
  71. package/dist/cjs/view/form/index.stories.js +3 -6
  72. package/dist/cjs/view/form/submit-button/index.js +2 -3
  73. package/dist/cjs/view/form/usecases.stories.js +3 -6
  74. package/dist/cjs/view/guest-unload-handlers/index.js +1 -2
  75. package/dist/cjs/view/header/center-region/index.js +8 -20
  76. package/dist/cjs/view/header/index.js +8 -11
  77. package/dist/cjs/view/host-binding-events/index.js +2 -2
  78. package/dist/cjs/view/live-message/index.stories.js +0 -6
  79. package/dist/cjs/view/loadable/index.js +1 -2
  80. package/dist/cjs/view/login/index.js +5 -6
  81. package/dist/cjs/view/media-breakpoint/index.js +1 -1
  82. package/dist/cjs/view/message-to-host-app/index.js +1 -2
  83. package/dist/cjs/view/micro-app/app-factory/index.js +30 -48
  84. package/dist/cjs/view/micro-app/index.js +1 -1
  85. package/dist/cjs/view/micro-app/resources/manifest.js +27 -39
  86. package/dist/cjs/view/micro-app/resources/script.js +22 -35
  87. package/dist/cjs/view/micro-app/resources/style.js +20 -33
  88. package/dist/cjs/view/micro-app/use-app-will-render.js +12 -12
  89. package/dist/cjs/view/micro-app/utils.js +0 -6
  90. package/dist/cjs/view/micro-iframe-app/app.js +6 -9
  91. package/dist/cjs/view/micro-iframe-app/iframe/index.js +8 -9
  92. package/dist/cjs/view/micro-iframe-app/index.js +4 -7
  93. package/dist/cjs/view/micro-iframe-app/use-frame-loaded.js +5 -12
  94. package/dist/cjs/view/modals/error/index.js +6 -13
  95. package/dist/cjs/view/modals/navigation-prompt/index.js +4 -11
  96. package/dist/cjs/view/modals/session-expiry/customHooks.js +3 -5
  97. package/dist/cjs/view/modals/session-expiry/index.js +6 -13
  98. package/dist/cjs/view/modals/wait-message/html-wait-message.js +3 -4
  99. package/dist/cjs/view/modals/wait-message/index.js +8 -9
  100. package/dist/cjs/view/modals/wait-message/index.stories.js +4 -5
  101. package/dist/cjs/view/render-with-delay/index.js +3 -6
  102. package/dist/cjs/view/render-with-host-data/index.js +0 -2
  103. package/dist/cjs/view/session-timeout/index.js +0 -2
  104. package/dist/cjs/view/useMediaBreakpoints/index.js +0 -12
  105. package/dist/es/analytics/appdynamics.js +18 -0
  106. package/dist/es/analytics/index.js +14 -13
  107. package/dist/es/analytics/page-view-event.js +16 -19
  108. package/dist/es/analytics/user-session-event.js +12 -13
  109. package/dist/es/analytics/user-wait-event.js +4 -4
  110. package/dist/es/analytics/{ba-event-parameters.js → web-analytics.js} +2 -2
  111. package/dist/es/api/auth/index.js +13 -18
  112. package/dist/es/api/helpers.js +4 -14
  113. package/dist/es/api/users/index.js +4 -5
  114. package/dist/es/communication/http-client/index.js +16 -20
  115. package/dist/es/communication/http-client/retry-axios.js +0 -2
  116. package/dist/es/communication/http-client/tests/index.test-disable.js +5 -6
  117. package/dist/es/data/auth/actions.js +22 -28
  118. package/dist/es/data/breakpoint/index.js +1 -3
  119. package/dist/es/data/live-message/index.js +8 -11
  120. package/dist/es/data/reducers.js +1 -2
  121. package/dist/es/data/store.js +4 -8
  122. package/dist/es/data/wait-message/actions.js +6 -9
  123. package/dist/es/data/wait-message/reducer.js +12 -16
  124. package/dist/es/index.js +4 -1
  125. package/dist/es/route/index.js +23 -13
  126. package/dist/es/route/page-view.js +15 -0
  127. package/dist/es/route/private-route/index.js +9 -10
  128. package/dist/es/sideeffect/auth/index.js +6 -10
  129. package/dist/es/utils/app-config/config.js +3 -14
  130. package/dist/es/utils/app-config/index.js +11 -15
  131. package/dist/es/utils/app-host-integration/react.js +7 -10
  132. package/dist/es/utils/auth/index.js +39 -41
  133. package/dist/es/utils/font-size.js +1 -1
  134. package/dist/es/utils/helpers.js +0 -3
  135. package/dist/es/utils/log-records.js +7 -7
  136. package/dist/es/utils/micro-frontend/guest.js +29 -6
  137. package/dist/es/utils/micro-frontend/host.js +13 -7
  138. package/dist/es/utils/micro-frontend/index.js +2 -3
  139. package/dist/es/utils/redact-pii.js +31 -0
  140. package/dist/es/utils/service-worker.js +2 -4
  141. package/dist/es/utils/session.js +2 -8
  142. package/dist/es/utils/storybook/theme.js +9 -12
  143. package/dist/es/utils/testing/index.js +9 -12
  144. package/dist/es/utils/testing/render-with-redux.js +11 -14
  145. package/dist/es/utils/testing/render-with-router-redux.js +17 -20
  146. package/dist/es/utils/testing/render-with-router.js +13 -16
  147. package/dist/es/utils/testing/render-with-state-addons.js +7 -12
  148. package/dist/es/utils/url.js +0 -4
  149. package/dist/es/utils/web-storage.js +1 -4
  150. package/dist/es/utils/window.js +0 -1
  151. package/dist/es/view/app-root/hosted-app.js +5 -8
  152. package/dist/es/view/app-root/index.js +20 -23
  153. package/dist/es/view/app-root/stand-alone-app.js +5 -8
  154. package/dist/es/view/app-root/style.js +5 -10
  155. package/dist/es/view/error-toast/index.stories.js +22 -30
  156. package/dist/es/view/fetch-host-app-data/store.js +1 -5
  157. package/dist/es/view/fields/check-box/index.js +20 -26
  158. package/dist/es/view/fields/check-box/index.stories.js +20 -24
  159. package/dist/es/view/fields/check-box/set-value.stories.js +17 -21
  160. package/dist/es/view/fields/combo-box/index.js +22 -28
  161. package/dist/es/view/fields/connect-form.js +3 -4
  162. package/dist/es/view/fields/date-input/index.js +15 -21
  163. package/dist/es/view/fields/date-picker/index.js +15 -21
  164. package/dist/es/view/fields/form-item-layout/index.js +16 -20
  165. package/dist/es/view/fields/input-mask/index.js +16 -22
  166. package/dist/es/view/fields/large-text-box/index.js +15 -21
  167. package/dist/es/view/fields/radio/index.js +20 -26
  168. package/dist/es/view/fields/radio/index.stories.js +17 -21
  169. package/dist/es/view/fields/radio/set-value.stories.js +15 -19
  170. package/dist/es/view/fields/radio-group/index.js +16 -22
  171. package/dist/es/view/fields/radio-group/index.stories.js +37 -44
  172. package/dist/es/view/fields/text-box/index.js +15 -21
  173. package/dist/es/view/fields/watch-value.js +4 -5
  174. package/dist/es/view/form/index.js +9 -10
  175. package/dist/es/view/form/index.stories.js +3 -6
  176. package/dist/es/view/form/submit-button/index.js +2 -3
  177. package/dist/es/view/form/usecases.stories.js +3 -6
  178. package/dist/es/view/guest-unload-handlers/index.js +1 -2
  179. package/dist/es/view/header/center-region/index.js +8 -17
  180. package/dist/es/view/header/index.js +8 -11
  181. package/dist/es/view/host-binding-events/index.js +2 -2
  182. package/dist/es/view/live-message/index.stories.js +0 -1
  183. package/dist/es/view/loadable/index.js +1 -2
  184. package/dist/es/view/login/index.js +5 -6
  185. package/dist/es/view/media-breakpoint/index.js +1 -1
  186. package/dist/es/view/message-to-host-app/index.js +1 -2
  187. package/dist/es/view/micro-app/app-factory/index.js +30 -42
  188. package/dist/es/view/micro-app/index.js +1 -1
  189. package/dist/es/view/micro-app/resources/manifest.js +26 -31
  190. package/dist/es/view/micro-app/resources/script.js +21 -31
  191. package/dist/es/view/micro-app/resources/style.js +20 -30
  192. package/dist/es/view/micro-app/use-app-will-render.js +12 -12
  193. package/dist/es/view/micro-app/utils.js +0 -3
  194. package/dist/es/view/micro-iframe-app/app.js +6 -8
  195. package/dist/es/view/micro-iframe-app/iframe/index.js +8 -9
  196. package/dist/es/view/micro-iframe-app/index.js +4 -6
  197. package/dist/es/view/micro-iframe-app/use-frame-loaded.js +5 -9
  198. package/dist/es/view/modals/error/index.js +6 -8
  199. package/dist/es/view/modals/navigation-prompt/index.js +4 -5
  200. package/dist/es/view/modals/session-expiry/customHooks.js +3 -4
  201. package/dist/es/view/modals/session-expiry/index.js +6 -8
  202. package/dist/es/view/modals/wait-message/html-wait-message.js +3 -4
  203. package/dist/es/view/modals/wait-message/index.js +8 -9
  204. package/dist/es/view/modals/wait-message/index.stories.js +4 -5
  205. package/dist/es/view/render-with-delay/index.js +3 -5
  206. package/dist/es/view/render-with-host-data/index.js +0 -1
  207. package/dist/es/view/session-timeout/index.js +0 -1
  208. package/dist/es/view/useMediaBreakpoints/index.js +0 -6
  209. package/dist/types/analytics/appdynamics.d.ts +9 -0
  210. package/dist/types/analytics/index.d.ts +2 -2
  211. package/dist/types/analytics/web-analytics.d.ts +8 -0
  212. package/dist/types/index.d.ts +3 -1
  213. package/dist/types/route/page-view.d.ts +1 -0
  214. package/dist/types/utils/micro-frontend/guest.d.ts +1 -0
  215. package/dist/types/utils/micro-frontend/host.d.ts +1 -1
  216. package/dist/types/utils/redact-pii.d.ts +1 -0
  217. package/dist/types/view/visually-hidden/index.d.ts +1 -1
  218. package/package.json +7 -3
  219. package/dist/es/route/usePageView.js +0 -18
  220. package/dist/public/app.config.json +0 -129
  221. package/dist/public/assets/index.ad459dcebaa616bff55e77d860405729.svg +0 -1
  222. package/dist/public/assets/index.dae17c8817fd9c5ab29e7c3a8925a1f4.svg +0 -1
  223. package/dist/public/assets/logo.0cbd33c5006f8ea6d106f8ab13f6e6dc.svg +0 -1
  224. package/dist/public/iframe.b3911eaf1a99a53ef7b10a1e1f0bdfc4.html +0 -8
  225. package/dist/public/index.html +0 -5
  226. package/dist/public/js/emuiAppSdk.e28a62497e211b4c6132.js +0 -3
  227. package/dist/public/js/emuiAppSdk.e28a62497e211b4c6132.js.LICENSE.txt +0 -95
  228. package/dist/public/js/emuiAppSdk.e28a62497e211b4c6132.js.gz +0 -0
  229. package/dist/public/js/emuiAppSdk.e28a62497e211b4c6132.js.map +0 -1
  230. package/dist/types/analytics/ba-event-parameters.d.ts +0 -8
  231. package/dist/types/route/usePageView.d.ts +0 -1
@@ -13,19 +13,15 @@ const parseAppConfig = data => {
13
13
  setAppConfig(_merge(data, activeEnvConfig));
14
14
  };
15
15
 
16
- export const loadAppConfig = function () {
17
- let hostUrl = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : './';
18
- return new Promise((resolve, reject) => {
19
- getHTTPClient({
20
- baseURL: hostUrl
21
- }).get('app.config.json').then(_ref => {
22
- let {
23
- data
24
- } = _ref;
25
- parseAppConfig(data);
26
- resolve();
27
- }).catch(err => {
28
- reject(new Error("Unable to load application configurtion file. ".concat(err.Message)));
29
- });
16
+ export const loadAppConfig = (hostUrl = './') => new Promise((resolve, reject) => {
17
+ getHTTPClient({
18
+ baseURL: hostUrl
19
+ }).get('app.config.json').then(({
20
+ data
21
+ }) => {
22
+ parseAppConfig(data);
23
+ resolve();
24
+ }).catch(err => {
25
+ reject(new Error(`Unable to load application configurtion file. ${err.Message}`));
30
26
  });
31
- };
27
+ });
@@ -1,11 +1,8 @@
1
1
  import { CMicroAppGuest } from "../micro-frontend/guest.js";
2
- export const enableReactAppForHostIntegration = _ref => {
3
- let {
4
- onInit,
5
- onMount
6
- } = _ref;
7
- return CMicroAppGuest.getInstance({
8
- onInit,
9
- onMount
10
- });
11
- };
2
+ export const enableReactAppForHostIntegration = ({
3
+ onInit,
4
+ onMount
5
+ }) => CMicroAppGuest.getInstance({
6
+ onInit,
7
+ onMount
8
+ });
@@ -1,13 +1,9 @@
1
- import "core-js/modules/web.dom-collections.iterator.js";
2
- import "core-js/modules/web.url.js";
3
- import "core-js/modules/web.url-search-params.js";
4
- import "core-js/modules/es.string.replace.js";
5
-
6
1
  /* eslint-disable max-lines */
7
2
  import { browserHistory as history } from "../history.js";
8
3
  import { getToken, revokeToken, introspectToken } from "../../api/auth/index.js";
9
4
  import { getUser } from "../../api/users/index.js";
10
5
  import { loginEvent, logoutEvent } from "../../analytics/user-session-event.js";
6
+ import { setAppDynamicsUserData } from "../../analytics/appdynamics.js";
11
7
  import { getAuthorizationHeader, setAuthorizationHeader } from "./helper.js";
12
8
  import { getAppConfigValue } from "../app-config/config.js";
13
9
  import { getLogger } from "../micro-frontend/index.js";
@@ -25,15 +21,14 @@ export const getIDPInfoFromUrl = () => {
25
21
  redirectUri: currentUrl.href
26
22
  };
27
23
  };
28
- export const navigateToLoginPage = _ref => {
29
- let {
30
- clientId,
31
- redirectUri,
32
- idpErrorCode,
33
- scope,
34
- // eslint-disable-next-line camelcase
35
- responseType
36
- } = _ref;
24
+ export const navigateToLoginPage = ({
25
+ clientId,
26
+ redirectUri,
27
+ idpErrorCode,
28
+ scope,
29
+ // eslint-disable-next-line camelcase
30
+ responseType
31
+ }) => {
37
32
  const idpHost = getAppConfigValue(IDP_ENDPOINT_CONFIG_KEY, '');
38
33
  const idpUrl = new URL('/authorize', idpHost);
39
34
  const idpOptions = {
@@ -48,15 +43,13 @@ export const navigateToLoginPage = _ref => {
48
43
  idpUrl.search = searchParams.toString();
49
44
  window.location.replace(idpUrl.href);
50
45
  };
51
- export const endSession = async _ref2 => {
52
- let {
53
- clientId,
54
- redirectUri,
55
- responseType,
56
- scope,
57
- code = '1004'
58
- } = _ref2;
59
-
46
+ export const endSession = async ({
47
+ clientId,
48
+ redirectUri,
49
+ responseType,
50
+ scope,
51
+ code = '1004'
52
+ }) => {
60
53
  try {
61
54
  const authorization = getAuthorizationHeader();
62
55
  sessionStorage.clear();
@@ -65,7 +58,11 @@ export const endSession = async _ref2 => {
65
58
  clientId,
66
59
  token
67
60
  });
68
- logoutEvent(); // redirect
61
+ logoutEvent();
62
+ setAppDynamicsUserData({
63
+ instanceId: '',
64
+ userId: ''
65
+ }); // redirect
69
66
 
70
67
  const idpHost = getAppConfigValue(IDP_ENDPOINT_CONFIG_KEY, '');
71
68
  const logoutUrl = new URL('/authorize', idpHost);
@@ -85,15 +82,13 @@ export const endSession = async _ref2 => {
85
82
  });
86
83
  }
87
84
  };
88
- export const authorize = async _ref3 => {
89
- let {
90
- idpCode,
91
- redirectUri,
92
- clientId,
93
- scope,
94
- responseType
95
- } = _ref3;
96
-
85
+ export const authorize = async ({
86
+ idpCode,
87
+ redirectUri,
88
+ clientId,
89
+ scope,
90
+ responseType
91
+ }) => {
97
92
  try {
98
93
  const {
99
94
  tokenType,
@@ -103,7 +98,7 @@ export const authorize = async _ref3 => {
103
98
  redirectUri,
104
99
  clientId
105
100
  });
106
- const authorizationToken = "".concat(tokenType, " ").concat(accessToken);
101
+ const authorizationToken = `${tokenType} ${accessToken}`;
107
102
  setAuthorizationHeader(authorizationToken); // get user introspect data
108
103
 
109
104
  const introspectResponse = await introspectToken({
@@ -120,7 +115,7 @@ export const authorize = async _ref3 => {
120
115
  bearerToken,
121
116
  realm: instanceId,
122
117
  userName,
123
- sessionId: bearerToken.replace("".concat(instanceId, " "), '')
118
+ sessionId: bearerToken.replace(`${instanceId} `, '')
124
119
  };
125
120
  sessionStorage.setItem('cred', JSON.stringify(cred));
126
121
  sessionStorage.setItem('instanceId', instanceId);
@@ -128,6 +123,10 @@ export const authorize = async _ref3 => {
128
123
  loginEvent({
129
124
  instanceId,
130
125
  userId: userName
126
+ });
127
+ setAppDynamicsUserData({
128
+ instanceId,
129
+ userId: userName
131
130
  }); // get user info
132
131
 
133
132
  const data = await getUser({
@@ -151,12 +150,11 @@ export const authorize = async _ref3 => {
151
150
  });
152
151
  }
153
152
  };
154
- export const login = async _ref4 => {
155
- let {
156
- clientId,
157
- scope,
158
- responseType
159
- } = _ref4;
153
+ export const login = async ({
154
+ clientId,
155
+ scope,
156
+ responseType
157
+ }) => {
160
158
  const {
161
159
  idpCode,
162
160
  idpErrorCode,
@@ -1,3 +1,3 @@
1
1
  const docFontSize = document && document.documentElement ? getComputedStyle(document.documentElement).fontSize : '16';
2
2
  export const remToPx = rem => rem * parseFloat(docFontSize);
3
- export const pxToRem = px => "".concat(px / parseFloat(docFontSize), "rem");
3
+ export const pxToRem = px => `${px / parseFloat(docFontSize)}rem`;
@@ -1,6 +1,3 @@
1
- import "core-js/modules/web.dom-collections.iterator.js";
2
- import "core-js/modules/web.url.js";
3
- import "core-js/modules/web.url-search-params.js";
4
1
  export const isProd = () => process.env.NODE_ENV === 'production';
5
2
  export const isCIBuild = () => process.env.CI === 'true';
6
3
  const PROTOCOL = new RegExp('^(?:[a-z]+:)?//', 'i');
@@ -17,31 +17,31 @@ export const logRecords = {
17
17
  },
18
18
  ASSET_NOT_FOUND_IN_MANIFEST: assetName => ({
19
19
  code: 'appsdk05',
20
- msg: "Application load failed. unable to locate ".concat(assetName, " in the manifest")
20
+ msg: `Application load failed. unable to locate ${assetName} in the manifest`
21
21
  }),
22
22
  APP_INIT_FAILED: (appId, errMsg) => ({
23
23
  code: 'appsdk06',
24
- msg: "Application load failed. Unable to load one or more application resources for appId: ".concat(appId, ". ").concat(errMsg)
24
+ msg: `Application load failed. Unable to load one or more application resources for appId: ${appId}. ${errMsg}`
25
25
  }),
26
26
  APP_LOADING: appId => ({
27
27
  code: 'appsdk07',
28
- msg: "Application ".concat(appId, " is loading...")
28
+ msg: `Application ${appId} is loading...`
29
29
  }),
30
30
  APP_LOADING_COMPLETE: appId => ({
31
31
  code: 'appsdk08',
32
- msg: "Application ".concat(appId, " loaded")
32
+ msg: `Application ${appId} loaded`
33
33
  }),
34
34
  APP_UNLOADING: appId => ({
35
35
  code: 'appsdk09',
36
- msg: "Application ".concat(appId, " unloading...")
36
+ msg: `Application ${appId} unloading...`
37
37
  }),
38
38
  APP_UNLOADING_COMPLETE: appId => ({
39
39
  code: 'appsdk10',
40
- msg: "Application ".concat(appId, " unloaded")
40
+ msg: `Application ${appId} unloaded`
41
41
  }),
42
42
  SSF_HOST_OBJECT_NOT_FOUND: name => ({
43
43
  code: 'appsdk11',
44
- msg: "Parent window doesn't expose SSF Object named ".concat(name)
44
+ msg: `Parent window doesn't expose SSF Object named ${name}`
45
45
  }),
46
46
  LOGIN_FAILED: {
47
47
  code: 'appsdk12',
@@ -1,7 +1,5 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import _merge from "lodash/merge";
3
- import "core-js/modules/web.dom-collections.iterator.js";
4
- import "core-js/modules/es.string.replace.js";
5
3
  import ReactDOM from 'react-dom';
6
4
  import ssfGuest from '@elliemae/em-ssf-guest';
7
5
  import { getDefaultTheme } from '@elliemae/pui-theme';
@@ -11,6 +9,8 @@ import { getAppConfigValue } from "../app-config/config.js";
11
9
  import { browserHistory } from "../history.js";
12
10
  import { logger } from "./console-logger.js";
13
11
  import { removeStorageEvents } from "../web-storage.js";
12
+ import { updateBAEventParameters } from "../../analytics/web-analytics.js";
13
+ import { setAppDynamicsUserData } from "../../analytics/appdynamics.js";
14
14
 
15
15
  const isCrossDomain = () => {
16
16
  try {
@@ -104,6 +104,18 @@ export class CMicroAppGuest {
104
104
  return this.props;
105
105
  }
106
106
 
107
+ getSessionStorageItem(key) {
108
+ var _this$props$host;
109
+
110
+ 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) {
113
+ value = this.props.host.getItem(key);
114
+ }
115
+
116
+ return value;
117
+ }
118
+
107
119
  async getSSFHost() {
108
120
  let host = null;
109
121
 
@@ -140,12 +152,23 @@ export class CMicroAppGuest {
140
152
  if (this.onInit) this.onInit(this.props);
141
153
  });
142
154
  /* eslint-enable camelcase, no-undef */
155
+
156
+ const instanceId = this.getSessionStorageItem('instanceId') || '';
157
+ const userId = this.getSessionStorageItem('userId') || '';
158
+ updateBAEventParameters({
159
+ instanceId,
160
+ userId
161
+ });
162
+ setAppDynamicsUserData({
163
+ subAppId: this.appId,
164
+ instanceId,
165
+ userId
166
+ });
143
167
  }
144
168
 
145
- mount() {
146
- let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
147
- containerId: 'app-container'
148
- };
169
+ mount(options = {
170
+ containerId: 'app-container'
171
+ }) {
149
172
  this.containerId = options === null || options === void 0 ? void 0 : options.containerId;
150
173
  return Promise.resolve().then(() => {
151
174
  if (this.onMount) this.onMount(options);
@@ -13,6 +13,7 @@ import { logger } from "./console-logger.js";
13
13
  import { HOST_WINDOW_RESIZED, HOST_WINDOW_BREAKPOINT_CHANGED } from "../constants.js";
14
14
  import { getCurrentBreakpoint, getViewportSize as getWindowViewportSize } from "../window.js";
15
15
  import { sendBAEvent } from "../../analytics/index.js";
16
+ import { setAppDynamicsUserData } from "../../analytics/appdynamics.js";
16
17
  export class CMicroAppHost {
17
18
  constructor(params) {
18
19
  _defineProperty(this, "logger", void 0);
@@ -49,6 +50,12 @@ export class CMicroAppHost {
49
50
  if (this.onInit) this.onInit(this.props);
50
51
  }).catch(() => {});
51
52
  /* eslint-enable camelcase, no-undef */
53
+
54
+ setAppDynamicsUserData({
55
+ subAppId: this.appId,
56
+ instanceId: '',
57
+ userId: ''
58
+ });
52
59
  }
53
60
 
54
61
  static getInstance(params) {
@@ -155,19 +162,18 @@ export class CMicroAppHost {
155
162
  return subscribe(HOST_WINDOW_BREAKPOINT_CHANGED, (msg, data) => eventHandler(data));
156
163
  }
157
164
 
158
- setSystemVersion() {
159
- let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'latest';
165
+ setSystemVersion(version = 'latest') {
160
166
  window.emui.version = version;
161
167
  this.props.systemVersion = version;
162
- }
168
+ } // eslint-disable-next-line max-lines
163
169
 
164
- sendBAEvent(event) {
170
+
171
+ sendBAEvent(data) {
165
172
  sendBAEvent({
166
- event,
173
+ data,
167
174
  self: true
168
175
  });
169
- } // eslint-disable-next-line max-lines
170
-
176
+ }
171
177
 
172
178
  }
173
179
 
@@ -1,5 +1,4 @@
1
1
  import _merge from "lodash/merge";
2
- import "core-js/modules/es.string.replace.js";
3
2
  import { CMicroAppGuest } from "./guest.js";
4
3
  import { CMicroAppHost } from "./host.js";
5
4
  import { getAppConfigValue } from "../app-config/config.js";
@@ -24,8 +23,8 @@ const getVersionedPath = path => {
24
23
  };
25
24
 
26
25
  export const getMicroFrontEndAppConfig = appInfo => {
27
- const microFEAppConfig = getAppConfigValue("microFrontendApps.".concat(appInfo.id));
28
- if (!microFEAppConfig) throw new Error("unable to locate application configuraiton for ".concat(appInfo.id, " under microFrontendApps section of app.config.json"));
26
+ 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`);
29
28
  const {
30
29
  mode = 'production'
31
30
  } = microFEAppConfig;
@@ -0,0 +1,31 @@
1
+ const aptRegex = /(apt|bldg|dept|fl|hngr|lot|pier|rm|ste|slip|trlr|unit|#)\.? *[a-z0-9-]+\b/gi;
2
+ const poBoxRegex = /P\.? ?O\.? *Box +\d+/gi;
3
+ const roadRegex = /(street|st|road|rd|avenue|ave|drive|dr|loop|court|ct|circle|cir|lane|ln|boulevard|blvd|way)\.?\b/gi;
4
+ const piiPatterns = {
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'),
7
+ zipcode: /\b\d{5}\b(-\d{4})?\b/g,
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
+ ipAddress: /(\d{1,3}(\.\d{1,3}){3}|[0-9A-F]{4}(:[0-9A-F]{4}){5}(::|(:0000)+))/gi,
10
+ usSocialSecurityNumber: /\b\d{3}[ -.]\d{2}[ -.]\d{4}\b/g,
11
+ emailAddress: /([a-z0-9_\-.+]+)@\w+(\.\w+)*/gi,
12
+ // username: /(user( ?name)?|login): \S+/gi,
13
+ 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
+
17
+ };
18
+
19
+ 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);
22
+ };
23
+
24
+ export const redactPii = data => {
25
+ try {
26
+ const redactedData = JSON.stringify(data, replacer);
27
+ return JSON.parse(redactedData);
28
+ } catch (err) {
29
+ return data;
30
+ }
31
+ };
@@ -1,13 +1,11 @@
1
- import "core-js/modules/es.string.replace.js";
2
1
  import { logRecords } from "./log-records.js";
3
2
  import { getLogger } from "./micro-frontend/index.js";
4
- export const initServiceWorker = function () {
5
- let swDest = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
3
+ export const initServiceWorker = (swDest = '') => {
6
4
  const logger = getLogger() || console;
7
5
 
8
6
  if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
9
7
  window.addEventListener('load', () => {
10
- navigator.serviceWorker.register("".concat(swDest.replace(/\/?$/, '/'), "sw.js")).then(() => {
8
+ navigator.serviceWorker.register(`${swDest.replace(/\/?$/, '/')}sw.js`).then(() => {
11
9
  logger.debug('Service Worker registered');
12
10
  }).catch(registrationError => {
13
11
  logger.error({ ...logRecords.SERVICE_WORKER_FAILED,
@@ -23,15 +23,9 @@ const throttledResetUserIdleTime = _throttle(resetUserIdleTime, THROTTLING_TIME,
23
23
  leading: true
24
24
  });
25
25
 
26
- const isPastWarningTime = function () {
27
- let warnInterval = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getAppConfigValue('sessionTimeoutWarnInterval') || SESSION_TIMEOUT_INTERVAL.WARN;
28
- return Date.now() - lastUserActivityTimeStamp > warnInterval;
29
- };
26
+ const isPastWarningTime = (warnInterval = getAppConfigValue('sessionTimeoutWarnInterval') || SESSION_TIMEOUT_INTERVAL.WARN) => Date.now() - lastUserActivityTimeStamp > warnInterval;
30
27
 
31
- const isPastSessionTimeoutTime = function () {
32
- let sessionTimeout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getAppConfigValue('sessionTimeoutInterval') || SESSION_TIMEOUT_INTERVAL.EXPIRY;
33
- return Date.now() - lastUserActivityTimeStamp > sessionTimeout;
34
- };
28
+ const isPastSessionTimeoutTime = (sessionTimeout = getAppConfigValue('sessionTimeoutInterval') || SESSION_TIMEOUT_INTERVAL.EXPIRY) => Date.now() - lastUserActivityTimeStamp > sessionTimeout;
35
29
 
36
30
  const notifySessionExpiryWarning = () => {
37
31
  sessionExpiryWarningNotified = true;
@@ -1,13 +1,10 @@
1
1
  import { create } from '@storybook/theming/create';
2
- export const createTheme = _ref => {
3
- let {
4
- base = 'light',
5
- brandTitle = 'Platform UI Components',
6
- ...rest
7
- } = _ref;
8
- return create({
9
- base,
10
- brandTitle: "".concat(brandTitle, " ").concat(process.env.STORYBOOK_VERSION || ''),
11
- ...rest
12
- });
13
- };
2
+ export const createTheme = ({
3
+ base = 'light',
4
+ brandTitle = 'Platform UI Components',
5
+ ...rest
6
+ }) => create({
7
+ base,
8
+ brandTitle: `${brandTitle} ${process.env.STORYBOOK_VERSION || ''}`,
9
+ ...rest
10
+ });
@@ -7,18 +7,15 @@ import { browserHistory } from "../history.js";
7
7
  const defaultStore = createAppStore({}, browserHistory);
8
8
  const defaultTheme = getDefaultTheme();
9
9
 
10
- const AllTheProviders = _ref => {
11
- let {
12
- store = defaultStore,
13
- theme = defaultTheme,
14
- children
15
- } = _ref;
16
- return /*#__PURE__*/_jsx(AppRoot, {
17
- store: store,
18
- history: browserHistory,
19
- theme: theme
20
- }, void 0, children);
21
- };
10
+ const AllTheProviders = ({
11
+ store = defaultStore,
12
+ theme = defaultTheme,
13
+ children
14
+ }) => /*#__PURE__*/_jsx(AppRoot, {
15
+ store: store,
16
+ history: browserHistory,
17
+ theme: theme
18
+ }, void 0, children);
22
19
 
23
20
  const customRender = (ui, options) => render(ui, {
24
21
  wrapper: AllTheProviders,
@@ -3,17 +3,14 @@ import { render } from '@testing-library/react';
3
3
  import { Provider } from 'react-redux';
4
4
  import { createAppStore } from "../../data/store.js";
5
5
  import { browserHistory } from "../history.js";
6
- export const renderWithRedux = function (ui) {
7
- let {
8
- initialState,
9
- store = createAppStore(initialState, browserHistory)
10
- } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
11
- return { ...render( /*#__PURE__*/_jsx(Provider, {
12
- store: store
13
- }, void 0, ui)),
14
- // adding `store` to the returned utilities to allow us
15
- // to reference it in our tests (just try to avoid using
16
- // this to test implementation details).
17
- store
18
- };
19
- };
6
+ export const renderWithRedux = (ui, {
7
+ initialState,
8
+ store = createAppStore(initialState, browserHistory)
9
+ } = {}) => ({ ...render( /*#__PURE__*/_jsx(Provider, {
10
+ store: store
11
+ }, void 0, ui)),
12
+ // adding `store` to the returned utilities to allow us
13
+ // to reference it in our tests (just try to avoid using
14
+ // this to test implementation details).
15
+ store
16
+ });
@@ -5,23 +5,20 @@ import { Router } from 'react-router-dom';
5
5
  import { createMemoryHistory } from 'history';
6
6
  import { createAppStore } from "../../data/store.js";
7
7
  import { browserHistory } from "../history.js";
8
- export const renderWithRouterRedux = function (ui) {
9
- let {
10
- route = '/',
11
- history = createMemoryHistory({
12
- initialEntries: [route]
13
- }),
14
- initialState,
15
- store = createAppStore(initialState, browserHistory)
16
- } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
17
- return { ...render( /*#__PURE__*/_jsx(Provider, {
18
- store: store
19
- }, void 0, /*#__PURE__*/_jsx(Router, {
20
- history: history
21
- }, void 0, ui))),
22
- // adding `store` to the returned utilities to allow us
23
- // to reference it in our tests (just try to avoid using
24
- // this to test implementation details).
25
- store
26
- };
27
- };
8
+ export const renderWithRouterRedux = (ui, {
9
+ route = '/',
10
+ history = createMemoryHistory({
11
+ initialEntries: [route]
12
+ }),
13
+ initialState,
14
+ store = createAppStore(initialState, browserHistory)
15
+ } = {}) => ({ ...render( /*#__PURE__*/_jsx(Provider, {
16
+ store: store
17
+ }, void 0, /*#__PURE__*/_jsx(Router, {
18
+ history: history
19
+ }, void 0, ui))),
20
+ // adding `store` to the returned utilities to allow us
21
+ // to reference it in our tests (just try to avoid using
22
+ // this to test implementation details).
23
+ store
24
+ });
@@ -2,19 +2,16 @@ import _jsx from "@babel/runtime/helpers/jsx";
2
2
  import { render } from '@testing-library/react';
3
3
  import { Router } from 'react-router-dom';
4
4
  import { createMemoryHistory } from 'history';
5
- export const renderWithRouter = function (ui) {
6
- let {
7
- route = '/',
8
- history = createMemoryHistory({
9
- initialEntries: [route]
10
- })
11
- } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
12
- return { ...render( /*#__PURE__*/_jsx(Router, {
13
- history: history
14
- }, void 0, ui)),
15
- // adding `history` to the returned utilities to allow us
16
- // to reference it in our tests (just try to avoid using
17
- // this to test implementation details).
18
- history
19
- };
20
- };
5
+ export const renderWithRouter = (ui, {
6
+ route = '/',
7
+ history = createMemoryHistory({
8
+ initialEntries: [route]
9
+ })
10
+ } = {}) => ({ ...render( /*#__PURE__*/_jsx(Router, {
11
+ history: history
12
+ }, void 0, ui)),
13
+ // adding `history` to the returned utilities to allow us
14
+ // to reference it in our tests (just try to avoid using
15
+ // this to test implementation details).
16
+ history
17
+ });
@@ -1,8 +1,4 @@
1
1
  import _jsx2 from "@babel/runtime/helpers/jsx";
2
- import "core-js/modules/web.dom-collections.iterator.js";
3
- import "core-js/modules/esnext.async-iterator.for-each.js";
4
- import "core-js/modules/esnext.iterator.constructor.js";
5
- import "core-js/modules/esnext.iterator.for-each.js";
6
2
 
7
3
  /* eslint-disable react-hooks/rules-of-hooks */
8
4
  import { useEffect, useState } from 'react';
@@ -10,14 +6,13 @@ import { ThemeProvider } from 'styled-components';
10
6
  import { getDefaultTheme } from '@elliemae/pui-theme';
11
7
  import { useInjectReducer, useInjectSaga } from 'redux-injectors';
12
8
  import { jsx as _jsx } from "react/jsx-runtime";
13
- export const RenderWithStateAddOns = _ref => {
14
- let {
15
- Component,
16
- reducer,
17
- saga,
18
- theme = getDefaultTheme(),
19
- ...rest
20
- } = _ref;
9
+ export const RenderWithStateAddOns = ({
10
+ Component,
11
+ reducer,
12
+ saga,
13
+ theme = getDefaultTheme(),
14
+ ...rest
15
+ }) => {
21
16
  const [ready, setReady] = useState(false);
22
17
 
23
18
  if (Array.isArray(reducer)) {
@@ -1,7 +1,3 @@
1
- import "core-js/modules/web.dom-collections.iterator.js";
2
- import "core-js/modules/web.url.js";
3
- import "core-js/modules/web.url-search-params.js";
4
- import "core-js/modules/es.string.replace.js";
5
1
  export const getRedirectUrl = () => {
6
2
  const url = new URL(window.location.href);
7
3
  url.search = '';