@elliemae/pui-app-sdk 5.21.0-beta.7 → 5.21.1

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 (149) hide show
  1. package/dist/cjs/analytics/index.js +1 -2
  2. package/dist/cjs/index.js +0 -3
  3. package/dist/cjs/utils/app-config/config.js +4 -4
  4. package/dist/cjs/utils/decorators/functionDecorators.js +35 -2
  5. package/dist/cjs/utils/decorators/index.js +2 -1
  6. package/dist/cjs/utils/micro-frontend/guest.js +14 -101
  7. package/dist/cjs/{view/tests/scriptingObjects/constant.js → utils/micro-frontend/host-app.js} +10 -5
  8. package/dist/cjs/utils/micro-frontend/host.js +3 -36
  9. package/dist/cjs/utils/micro-frontend/scripting-objects/analytics.js +12 -2
  10. package/dist/cjs/{view/tests/utils.js → utils/micro-frontend/ssfguest-adapter.js} +29 -34
  11. package/dist/cjs/utils/testing/index.js +1 -15
  12. package/dist/cjs/view/micro-iframe-app/iframe/index.js +1 -1
  13. package/dist/cjs/view/micro-iframe-app/iframe.html +1 -5
  14. package/dist/cjs/view/micro-iframe-app/use-frame-loaded.js +1 -3
  15. package/dist/esm/analytics/index.js +1 -2
  16. package/dist/esm/index.js +1 -7
  17. package/dist/esm/utils/app-config/config.js +4 -4
  18. package/dist/esm/utils/decorators/functionDecorators.js +35 -2
  19. package/dist/esm/utils/decorators/index.js +4 -2
  20. package/dist/esm/utils/micro-frontend/guest.js +14 -101
  21. package/dist/esm/utils/micro-frontend/host-app.js +9 -0
  22. package/dist/esm/utils/micro-frontend/host.js +3 -36
  23. package/dist/esm/utils/micro-frontend/scripting-objects/analytics.js +2 -2
  24. package/dist/esm/utils/micro-frontend/ssfguest-adapter.js +28 -0
  25. package/dist/esm/utils/testing/index.js +1 -5
  26. package/dist/esm/view/micro-iframe-app/iframe/index.js +1 -1
  27. package/dist/esm/view/micro-iframe-app/iframe.html +1 -5
  28. package/dist/esm/view/micro-iframe-app/use-frame-loaded.js +1 -3
  29. package/dist/types/lib/index.d.ts +1 -2
  30. package/dist/types/lib/utils/decorators/functionDecorators.d.ts +28 -0
  31. package/dist/types/lib/utils/decorators/index.d.ts +2 -1
  32. package/dist/types/lib/utils/micro-frontend/guest.d.ts +11 -46
  33. package/dist/types/lib/utils/micro-frontend/host-app.d.ts +11 -0
  34. package/dist/types/lib/utils/micro-frontend/host.d.ts +10 -27
  35. package/dist/types/lib/utils/micro-frontend/scripting-objects/analytics.d.ts +2 -2
  36. package/dist/types/lib/utils/micro-frontend/ssfguest-adapter.d.ts +7 -0
  37. package/dist/types/lib/utils/micro-frontend/types.d.ts +1 -2
  38. package/dist/types/lib/utils/testing/index.d.ts +1 -57
  39. package/dist/types/lib/utils/window.d.ts +6 -13
  40. package/dist/types/lib/view/micro-app/index.d.ts +0 -5
  41. package/dist/types/lib/view/micro-iframe-app/index.d.ts +0 -5
  42. package/dist/types/tsconfig.tsbuildinfo +1 -1
  43. package/package.json +48 -43
  44. package/dist/cjs/utils/micro-frontend/app-bridge.js +0 -40
  45. package/dist/cjs/utils/micro-frontend/tests/app.config.json +0 -200
  46. package/dist/cjs/utils/micro-frontend/tests/utils.js +0 -116
  47. package/dist/cjs/view/guest-microapp.js +0 -126
  48. package/dist/cjs/view/tests/__snapshots__/guest-microapp.test.tsx.snap +0 -21
  49. package/dist/cjs/view/tests/__snapshots__/micro-iframe-app.test.tsx.snap +0 -208
  50. package/dist/cjs/view/tests/app.config.json +0 -200
  51. package/dist/cjs/view/tests/constants.js +0 -44
  52. package/dist/cjs/view/tests/flights/23.1/app.checksum1.css +0 -3
  53. package/dist/cjs/view/tests/flights/23.1/app.checksum1.js +0 -52
  54. package/dist/cjs/view/tests/flights/23.1/manifest.json +0 -4
  55. package/dist/cjs/view/tests/flights/latest/app.checksum.css +0 -3
  56. package/dist/cjs/view/tests/flights/latest/app.checksum.js +0 -52
  57. package/dist/cjs/view/tests/flights/latest/manifest.json +0 -4
  58. package/dist/cjs/view/tests/hotels/23.1/app.checksum.css +0 -3
  59. package/dist/cjs/view/tests/hotels/23.1/app.checksum.js +0 -52
  60. package/dist/cjs/view/tests/hotels/23.1/manifest.json +0 -4
  61. package/dist/cjs/view/tests/hotels/latest/app.checksum.css +0 -3
  62. package/dist/cjs/view/tests/hotels/latest/app.checksum.js +0 -52
  63. package/dist/cjs/view/tests/hotels/latest/manifest.json +0 -4
  64. package/dist/cjs/view/tests/loan/latest/index.js +0 -116
  65. package/dist/cjs/view/tests/loan/latest/manifest.json +0 -3
  66. package/dist/cjs/view/tests/scriptingObjects/appraisalServiceModule.js +0 -85
  67. package/dist/cjs/view/tests/scriptingObjects/global.js +0 -40
  68. package/dist/cjs/view/tests/scriptingObjects/loan.js +0 -207
  69. package/dist/cjs/view/tests/server.js +0 -29
  70. package/dist/cjs/view/tests/serverHandlers.js +0 -210
  71. package/dist/cjs/view/tests/task/latest/index.dev.js +0 -67
  72. package/dist/cjs/view/tests/task/latest/index.js +0 -67
  73. package/dist/cjs/view/tests/task/latest/manifest.json +0 -4
  74. package/dist/cjs/view/tests/travelhub/23.1/app.checksum.css +0 -3
  75. package/dist/cjs/view/tests/travelhub/23.1/app.checksum.js +0 -25
  76. package/dist/cjs/view/tests/travelhub/23.1/landing.checksum1.css +0 -3
  77. package/dist/cjs/view/tests/travelhub/23.1/landing.checksum1.js +0 -6
  78. package/dist/cjs/view/tests/travelhub/23.1/manifest.json +0 -6
  79. package/dist/cjs/view/tests/travelhub/latest/app.checksum.css +0 -3
  80. package/dist/cjs/view/tests/travelhub/latest/app.checksum.js +0 -30
  81. package/dist/cjs/view/tests/travelhub/latest/landing.checksum.css +0 -3
  82. package/dist/cjs/view/tests/travelhub/latest/landing.checksum.js +0 -8
  83. package/dist/cjs/view/tests/travelhub/latest/manifest.json +0 -6
  84. package/dist/esm/utils/micro-frontend/app-bridge.js +0 -20
  85. package/dist/esm/utils/micro-frontend/tests/app.config.json +0 -200
  86. package/dist/esm/utils/micro-frontend/tests/utils.js +0 -96
  87. package/dist/esm/view/guest-microapp.js +0 -96
  88. package/dist/esm/view/tests/__snapshots__/guest-microapp.test.tsx.snap +0 -21
  89. package/dist/esm/view/tests/__snapshots__/micro-iframe-app.test.tsx.snap +0 -208
  90. package/dist/esm/view/tests/app.config.json +0 -200
  91. package/dist/esm/view/tests/constants.js +0 -24
  92. package/dist/esm/view/tests/flights/23.1/app.checksum1.css +0 -3
  93. package/dist/esm/view/tests/flights/23.1/app.checksum1.js +0 -51
  94. package/dist/esm/view/tests/flights/23.1/manifest.json +0 -4
  95. package/dist/esm/view/tests/flights/latest/app.checksum.css +0 -3
  96. package/dist/esm/view/tests/flights/latest/app.checksum.js +0 -51
  97. package/dist/esm/view/tests/flights/latest/manifest.json +0 -4
  98. package/dist/esm/view/tests/hotels/23.1/app.checksum.css +0 -3
  99. package/dist/esm/view/tests/hotels/23.1/app.checksum.js +0 -51
  100. package/dist/esm/view/tests/hotels/23.1/manifest.json +0 -4
  101. package/dist/esm/view/tests/hotels/latest/app.checksum.css +0 -3
  102. package/dist/esm/view/tests/hotels/latest/app.checksum.js +0 -51
  103. package/dist/esm/view/tests/hotels/latest/manifest.json +0 -4
  104. package/dist/esm/view/tests/loan/latest/index.js +0 -115
  105. package/dist/esm/view/tests/loan/latest/manifest.json +0 -3
  106. package/dist/esm/view/tests/scriptingObjects/appraisalServiceModule.js +0 -67
  107. package/dist/esm/view/tests/scriptingObjects/constant.js +0 -4
  108. package/dist/esm/view/tests/scriptingObjects/global.js +0 -20
  109. package/dist/esm/view/tests/scriptingObjects/loan.js +0 -187
  110. package/dist/esm/view/tests/server.js +0 -9
  111. package/dist/esm/view/tests/serverHandlers.js +0 -180
  112. package/dist/esm/view/tests/task/latest/index.dev.js +0 -66
  113. package/dist/esm/view/tests/task/latest/index.js +0 -66
  114. package/dist/esm/view/tests/task/latest/manifest.json +0 -4
  115. package/dist/esm/view/tests/travelhub/23.1/app.checksum.css +0 -3
  116. package/dist/esm/view/tests/travelhub/23.1/app.checksum.js +0 -24
  117. package/dist/esm/view/tests/travelhub/23.1/landing.checksum1.css +0 -3
  118. package/dist/esm/view/tests/travelhub/23.1/landing.checksum1.js +0 -5
  119. package/dist/esm/view/tests/travelhub/23.1/manifest.json +0 -6
  120. package/dist/esm/view/tests/travelhub/latest/app.checksum.css +0 -3
  121. package/dist/esm/view/tests/travelhub/latest/app.checksum.js +0 -29
  122. package/dist/esm/view/tests/travelhub/latest/landing.checksum.css +0 -3
  123. package/dist/esm/view/tests/travelhub/latest/landing.checksum.js +0 -7
  124. package/dist/esm/view/tests/travelhub/latest/manifest.json +0 -6
  125. package/dist/esm/view/tests/utils.js +0 -33
  126. package/dist/types/lib/utils/micro-frontend/app-bridge.d.ts +0 -4
  127. package/dist/types/lib/utils/micro-frontend/tests/utils.d.ts +0 -39
  128. package/dist/types/lib/view/guest-microapp.d.ts +0 -13
  129. package/dist/types/lib/view/tests/constants.d.ts +0 -11
  130. package/dist/types/lib/view/tests/flights/23.1/app.checksum1.d.ts +0 -7
  131. package/dist/types/lib/view/tests/flights/latest/app.checksum.d.ts +0 -7
  132. package/dist/types/lib/view/tests/hotels/23.1/app.checksum.d.ts +0 -7
  133. package/dist/types/lib/view/tests/hotels/latest/app.checksum.d.ts +0 -7
  134. package/dist/types/lib/view/tests/loan/latest/index.d.ts +0 -11
  135. package/dist/types/lib/view/tests/micro-iframe-app.test.d.ts +0 -1
  136. package/dist/types/lib/view/tests/scriptingObjects/appraisalServiceModule.d.ts +0 -36
  137. package/dist/types/lib/view/tests/scriptingObjects/constant.d.ts +0 -1
  138. package/dist/types/lib/view/tests/scriptingObjects/global.d.ts +0 -9
  139. package/dist/types/lib/view/tests/scriptingObjects/loan.d.ts +0 -31
  140. package/dist/types/lib/view/tests/server.d.ts +0 -1
  141. package/dist/types/lib/view/tests/serverHandlers.d.ts +0 -5
  142. package/dist/types/lib/view/tests/task/latest/index.d.ts +0 -10
  143. package/dist/types/lib/view/tests/task/latest/index.dev.d.ts +0 -10
  144. package/dist/types/lib/view/tests/travelhub/23.1/app.checksum.d.ts +0 -7
  145. package/dist/types/lib/view/tests/travelhub/23.1/landing.checksum1.d.ts +0 -2
  146. package/dist/types/lib/view/tests/travelhub/latest/app.checksum.d.ts +0 -0
  147. package/dist/types/lib/view/tests/travelhub/latest/landing.checksum.d.ts +0 -0
  148. package/dist/types/lib/view/tests/utils.d.ts +0 -7
  149. /package/dist/types/lib/{view/tests/guest-microapp.test.d.ts → utils/micro-frontend/tests/guest-ssf-host.test.d.ts} +0 -0
@@ -38,8 +38,7 @@ const sendBAEvent = ({
38
38
  self = true
39
39
  }) => {
40
40
  if (!self) {
41
- const host = import_guest.CMicroAppGuest.getInstance()?.getHost();
42
- const sendEvent = host?.sendBAEvent;
41
+ const sendEvent = import_guest.CMicroAppGuest.getInstance()?.getHost()?.sendBAEvent;
43
42
  if (sendEvent) {
44
43
  sendEvent(data);
45
44
  } else {
package/dist/cjs/index.js CHANGED
@@ -32,7 +32,6 @@ __export(index_exports, {
32
32
  Analytics: () => import_analytics2.Analytics,
33
33
  AppRoot: () => import_app_root.AppRoot,
34
34
  Autocomplete: () => import_autocomplete.Autocomplete,
35
- CMicroApp: () => import_guest.CMicroAppGuest,
36
35
  CMicroAppGuest: () => import_guest.CMicroAppGuest,
37
36
  CMicroAppHost: () => import_host.CMicroAppHost,
38
37
  CheckBox: () => import_check_box.CheckBox,
@@ -49,7 +48,6 @@ __export(index_exports, {
49
48
  FormItemLayout: () => import_form_item_layout.FormItemLayout,
50
49
  FormLayoutBlockItem: () => import_form_layout_block_item.FormLayoutBlockItem,
51
50
  FormSubmitButton: () => import_submit_button.FormSubmitButton,
52
- GuestMicroApp: () => import_guest_microapp.GuestMicroApp,
53
51
  InputMask: () => import_input_mask.InputMask,
54
52
  InputText: () => import_input_text.InputText,
55
53
  LargeTextBox: () => import_large_text_box.LargeTextBox,
@@ -235,7 +233,6 @@ var import_live_message = require("./data/live-message/index.js");
235
233
  var import_error = require("./data/error/index.js");
236
234
  var import_actions4 = require("./data/logout/actions.js");
237
235
  var import_micro_app = require("./view/micro-app/index.js");
238
- var import_guest_microapp = require("./view/guest-microapp.js");
239
236
  var import_micro_iframe_app = require("./view/micro-iframe-app/index.js");
240
237
  var import_utils = require("./view/micro-app/utils.js");
241
238
  var import_store3 = require("./data/store.js");
@@ -34,12 +34,12 @@ __export(config_exports, {
34
34
  setAppConfigValue: () => setAppConfigValue
35
35
  });
36
36
  module.exports = __toCommonJS(config_exports);
37
- var import_lodash = __toESM(require("lodash"));
37
+ var import_lodash = require("lodash");
38
38
  var import_app_config = __toESM(require("../../app.config.json"));
39
39
  let gAppConfig = import_app_config.default;
40
40
  const setAppConfig = (config) => {
41
41
  gAppConfig = config;
42
42
  };
43
- const getAppConfigValue = (key = "", defaultValue = null) => import_lodash.default.clone(import_lodash.default.get(gAppConfig, key, defaultValue));
44
- const setAppConfigValue = (key, value) => import_lodash.default.set(gAppConfig, key, value);
45
- const hasItem = (key = "") => import_lodash.default.has(gAppConfig, key);
43
+ const getAppConfigValue = (key = "", defaultValue = null) => (0, import_lodash.clone)((0, import_lodash.get)(gAppConfig, key, defaultValue));
44
+ const setAppConfigValue = (key, value) => (0, import_lodash.set)(gAppConfig, key, value);
45
+ const hasItem = (key = "") => (0, import_lodash.has)(gAppConfig, key);
@@ -25,6 +25,7 @@ __export(functionDecorators_exports, {
25
25
  Memoize: () => Memoize,
26
26
  MemoizeAsync: () => MemoizeAsync,
27
27
  QueueTask: () => QueueTask,
28
+ RetryAsync: () => RetryAsync,
28
29
  Throttle: () => Throttle
29
30
  });
30
31
  module.exports = __toCommonJS(functionDecorators_exports);
@@ -166,9 +167,9 @@ function AsyncSingleExecution(_target, _propertyKey, descriptor) {
166
167
  return promiseMap.get(key);
167
168
  }
168
169
  const promise = originalMethod.apply(this, args);
169
- if (promise instanceof Promise) {
170
+ if (promise && typeof promise.then === "function") {
170
171
  promiseMap.set(key, promise);
171
- promise.finally(() => {
172
+ promise.catch((e) => e).finally(() => {
172
173
  promiseMap.delete(key);
173
174
  });
174
175
  }
@@ -176,3 +177,35 @@ function AsyncSingleExecution(_target, _propertyKey, descriptor) {
176
177
  };
177
178
  return descriptor;
178
179
  }
180
+ function RetryAsync(retries = 3, interval = 2e3, reThrowException = true) {
181
+ return function(_target, _propertyKey, descriptor) {
182
+ const originalMethod = descriptor.value;
183
+ descriptor.value = async function(...args) {
184
+ let attempts = 0;
185
+ while (attempts < retries) {
186
+ try {
187
+ const result = originalMethod.apply(this, args);
188
+ if (result && typeof result.then === "function") {
189
+ return await result;
190
+ }
191
+ return result;
192
+ } catch (error) {
193
+ attempts += 1;
194
+ if (attempts >= retries) {
195
+ if (reThrowException) {
196
+ throw error;
197
+ }
198
+ return void 0;
199
+ }
200
+ await new Promise((resolve) => {
201
+ setTimeout(() => {
202
+ resolve(true);
203
+ }, interval);
204
+ });
205
+ }
206
+ }
207
+ return void 0;
208
+ };
209
+ return descriptor;
210
+ };
211
+ }
@@ -36,6 +36,7 @@ const decorators = {
36
36
  MemoizeAsync: import_functionDecorators.MemoizeAsync,
37
37
  QueueTask: import_functionDecorators.QueueTask,
38
38
  Throttle: import_functionDecorators.Throttle,
39
- AsyncSingleExecution: import_functionDecorators.AsyncSingleExecution
39
+ AsyncSingleExecution: import_functionDecorators.AsyncSingleExecution,
40
+ RetryAsync: import_functionDecorators.RetryAsync
40
41
  }
41
42
  };
@@ -34,7 +34,6 @@ module.exports = __toCommonJS(guest_exports);
34
34
  var import_lodash = __toESM(require("lodash"));
35
35
  var import_uuid = require("uuid");
36
36
  var import_pui_theme = require("@elliemae/pui-theme");
37
- var import_ssf_guest = require("@elliemae/ssf-guest");
38
37
  var import_window = require("../window.js");
39
38
  var import_app_config = require("../app-config/index.js");
40
39
  var import_config = require("../app-config/config.js");
@@ -44,7 +43,8 @@ var import_logger = require("../logger.js");
44
43
  var import_web_storage = require("../web-storage.js");
45
44
  var import_web_analytics = require("./scripting-objects/web-analytics.js");
46
45
  var import_appdynamics = require("../../analytics/appdynamics.js");
47
- var import_app_bridge = require("./app-bridge.js");
46
+ var import_ssfguest_adapter = require("./ssfguest-adapter.js");
47
+ var import_host_app = require("./host-app.js");
48
48
  const isCrossDomain = () => {
49
49
  try {
50
50
  window.parent.document;
@@ -53,11 +53,6 @@ const isCrossDomain = () => {
53
53
  return true;
54
54
  }
55
55
  };
56
- var CommunicationMethod = /* @__PURE__ */ ((CommunicationMethod2) => {
57
- CommunicationMethod2["SSF"] = "ssf";
58
- CommunicationMethod2["APPSDK"] = "app-sdk";
59
- return CommunicationMethod2;
60
- })(CommunicationMethod || {});
61
56
  class CMicroAppGuest {
62
57
  /**
63
58
  * unique microapp id
@@ -68,14 +63,6 @@ class CMicroAppGuest {
68
63
  appId;
69
64
  props;
70
65
  containerId;
71
- /**
72
- * communication method used between microapps
73
- */
74
- #communicationMethod;
75
- /**
76
- * AppBridge instance
77
- */
78
- #appBridge = null;
79
66
  onInit;
80
67
  onMount;
81
68
  onUnmount;
@@ -86,7 +73,6 @@ class CMicroAppGuest {
86
73
  window.emui.uuid = window.emui.uuid || (0, import_uuid.v4)();
87
74
  this.appId = window.emui?.appId || (0, import_config.getAppConfigValue)("appId");
88
75
  this.#uuid = window.emui.uuid;
89
- this.#communicationMethod = "app-sdk" /* APPSDK */;
90
76
  this.props = {
91
77
  host: null,
92
78
  hostUrl: null,
@@ -108,7 +94,7 @@ class CMicroAppGuest {
108
94
  }
109
95
  static getInstance(params) {
110
96
  if (!this.instance) {
111
- this.instance = new CMicroAppGuest(params);
97
+ this.instance = new this(params);
112
98
  }
113
99
  return this.instance;
114
100
  }
@@ -124,46 +110,6 @@ class CMicroAppGuest {
124
110
  getLogger() {
125
111
  return this.logger;
126
112
  }
127
- getObject(objectId) {
128
- let host = null;
129
- if (this.#communicationMethod === "ssf" /* SSF */) {
130
- host = this.getHost();
131
- return host.getObject(objectId);
132
- }
133
- host = this.getHost();
134
- if (!host) return Promise.resolve(null);
135
- return host.getObject(objectId);
136
- }
137
- /**
138
- * subscribe to the scripting object event
139
- * @param {SubscribeParam<EventId, AppEvents[EventId]>} params - the parameters for the subscription
140
- * @param {string} params.soName - the name of the scripting object
141
- * @param {string} params.eventName - the name of the event
142
- * @param {Function} params.callback - the callback function to be called when the event is triggered
143
- * @returns {void}
144
- */
145
- subscribe(params) {
146
- let host = null;
147
- if (this.#communicationMethod === "ssf" /* SSF */) {
148
- host = this.getHost();
149
- return host.subscribe(params);
150
- }
151
- host = this.getHost();
152
- return host.subscribe(params);
153
- }
154
- /**
155
- * unsubscribe from the scripting object event
156
- * @param params - parameters for the unsubscription
157
- */
158
- unsubscribe(params) {
159
- let host = null;
160
- if (this.#communicationMethod === "ssf" /* SSF */) {
161
- host = this.getHost();
162
- host.unsubscribe(params);
163
- }
164
- host = this.getHost();
165
- host.unsubscribe(params);
166
- }
167
113
  getProps() {
168
114
  return this.props;
169
115
  }
@@ -228,22 +174,21 @@ class CMicroAppGuest {
228
174
  }
229
175
  getSessionStorageItem(key) {
230
176
  let value = sessionStorage.getItem(key);
231
- const host = this.getHost();
232
- if (!value && host?.getItem) {
233
- value = host.getItem(key);
177
+ if (!value && this.props.host?.getItem) {
178
+ value = this.props.host.getItem(key);
234
179
  }
235
180
  return value;
236
181
  }
237
- async findHost() {
182
+ async getSSFAdapter() {
238
183
  let host = null;
239
184
  if (window.parent !== window) {
240
185
  if (!isCrossDomain()) {
241
- host = window.parent?.emui?.MicroAppHost ?? null;
186
+ host = window.parent?.emui?.MicroAppHost || null;
242
187
  }
243
188
  if (!host) {
244
- host = new import_ssf_guest.SSFGuest({ appLogger: this.logger });
245
- await host.connect();
246
- this.#communicationMethod = "ssf" /* SSF */;
189
+ const ssfAdapter = new import_ssfguest_adapter.SSFGuestAdapter();
190
+ if (!await ssfAdapter.init()) return null;
191
+ host = ssfAdapter;
247
192
  }
248
193
  }
249
194
  return host;
@@ -255,21 +200,17 @@ class CMicroAppGuest {
255
200
  this.props = import_lodash.default.merge(this.props, options);
256
201
  this.props.history = options?.history || this.props.history;
257
202
  if (!this.props.host) {
258
- const host = await this.findHost();
259
- if (host) {
260
- this.props.host = host;
261
- }
203
+ const host = await this.getSSFAdapter();
204
+ if (host) this.props.host = host;
262
205
  }
206
+ if (this.props.host) (0, import_host_app.setHostApp)(this.props.host);
263
207
  __webpack_public_path__ = __webpack_public_path__.replace(/\/?$/, "/");
264
208
  return (0, import_app_config.loadAppConfig)().then(() => {
265
209
  const instanceId = this.getSessionStorageItem("instanceId") || "";
266
210
  const userId = this.getSessionStorageItem("userId") || "";
267
211
  (0, import_web_analytics.updateBAEventParameters)({ appId: this.appId, instanceId, userId });
268
212
  (0, import_appdynamics.setAppDynamicsUserData)({ appId: this.appId, instanceId, userId });
269
- return (0, import_app_bridge.getAppBridge)().then((appBridge) => {
270
- this.#appBridge = appBridge;
271
- if (this.onInit) this.onInit(this.props);
272
- });
213
+ if (this.onInit) this.onInit(this.props);
273
214
  });
274
215
  }
275
216
  mount(options = { containerId: "app-container" }) {
@@ -290,32 +231,4 @@ class CMicroAppGuest {
290
231
  navigate(url, state) {
291
232
  if (url) this.props.history.push(url, state);
292
233
  }
293
- /**
294
- * add scripting object for child microapp to use
295
- * @param so - The scripting object to be added.
296
- * @param params - Optional parameters for adding the scripting object.
297
- */
298
- addScriptingObject(so, params) {
299
- if (this.#appBridge) {
300
- this.#appBridge.addScriptingObject(so, params);
301
- }
302
- }
303
- /**
304
- * dispatch event to child microapp
305
- * @param {DispatchEventParams<EventId, Params>} params - event parameters
306
- */
307
- async dispatchEvent(params) {
308
- if (this.#appBridge) {
309
- await this.#appBridge.dispatchEvent(params);
310
- }
311
- }
312
- /**
313
- * removes scripting object from child microapp use
314
- * @param objectId unique id of the scripting object
315
- */
316
- removeScriptingObject(objectId) {
317
- if (this.#appBridge) {
318
- this.#appBridge.removeScriptingObject(objectId);
319
- }
320
- }
321
234
  }
@@ -16,9 +16,14 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var constant_exports = {};
20
- __export(constant_exports, {
21
- UNLOADING_EVENT_NAME: () => UNLOADING_EVENT_NAME
19
+ var host_app_exports = {};
20
+ __export(host_app_exports, {
21
+ getHostApp: () => getHostApp,
22
+ setHostApp: () => setHostApp
22
23
  });
23
- module.exports = __toCommonJS(constant_exports);
24
- const UNLOADING_EVENT_NAME = "Unloading";
24
+ module.exports = __toCommonJS(host_app_exports);
25
+ let hostApp = null;
26
+ const setHostApp = (host) => {
27
+ hostApp = host;
28
+ };
29
+ const getHostApp = () => hostApp;
@@ -39,7 +39,7 @@ var import_appdynamics = require("../../analytics/appdynamics.js");
39
39
  var import_analytics = require("./scripting-objects/analytics.js");
40
40
  var import_web_analytics = require("./scripting-objects/web-analytics.js");
41
41
  var import_session = require("../session.js");
42
- var import_app_bridge = require("./app-bridge.js");
42
+ var import_host_app = require("./host-app.js");
43
43
  class CMicroAppHost {
44
44
  static instance;
45
45
  logger;
@@ -51,7 +51,6 @@ class CMicroAppHost {
51
51
  throttleRenewSessionTimer;
52
52
  scriptingObjects;
53
53
  #ssfHostRef;
54
- #appBridge = null;
55
54
  // eslint-disable-next-line max-statements
56
55
  constructor(params) {
57
56
  this.appId = (0, import_config.getAppConfigValue)("appId");
@@ -92,11 +91,6 @@ class CMicroAppHost {
92
91
  }
93
92
  );
94
93
  (0, import_app_config.loadAppConfig)().then(() => {
95
- (0, import_app_bridge.getAppBridge)().then((appBridge) => {
96
- this.#appBridge = appBridge;
97
- }).catch((ex) => {
98
- throw ex;
99
- });
100
94
  if (this.onInit) this.onInit(this.props);
101
95
  }).catch(() => {
102
96
  });
@@ -107,7 +101,8 @@ class CMicroAppHost {
107
101
  }
108
102
  static getInstance(params) {
109
103
  if (!this.instance) {
110
- this.instance = new CMicroAppHost(params);
104
+ this.instance = new this(params);
105
+ (0, import_host_app.setHostApp)(this.instance);
111
106
  }
112
107
  return this.instance;
113
108
  }
@@ -201,32 +196,4 @@ class CMicroAppHost {
201
196
  async getObject(name) {
202
197
  return this.scriptingObjects[name];
203
198
  }
204
- /**
205
- * add scripting object for child microapp to use
206
- * @param so - The scripting object to be added.
207
- * @param params - Optional parameters for adding the scripting object.
208
- */
209
- addScriptingObject(so, params) {
210
- if (this.#appBridge) {
211
- this.#appBridge.addScriptingObject(so, params);
212
- }
213
- }
214
- /**
215
- * dispatch event to child microapp
216
- * @param {DispatchEventParams<EventId, Params>} params - event parameters
217
- */
218
- async dispatchEvent(params) {
219
- if (this.#appBridge) {
220
- await this.#appBridge.dispatchEvent(params);
221
- }
222
- }
223
- /**
224
- * removes scripting object from child microapp use
225
- * @param objectId unique id of the scripting object
226
- */
227
- removeScriptingObject(objectId) {
228
- if (this.#appBridge) {
229
- this.#appBridge.removeScriptingObject(objectId);
230
- }
231
- }
232
199
  }
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,17 +17,25 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
19
  };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
29
  var analytics_exports = {};
20
30
  __export(analytics_exports, {
21
31
  Analytics: () => Analytics
22
32
  });
23
33
  module.exports = __toCommonJS(analytics_exports);
24
- var import_ssf_host = require("@elliemae/ssf-host");
34
+ var import_em_ssf_host = __toESM(require("@elliemae/em-ssf-host"));
25
35
  var import_web_analytics = require("./web-analytics.js");
26
36
  var import_helpers = require("../../helpers.js");
27
37
  var import_headSampler = require("../../headSampler.js");
28
- class Analytics extends import_ssf_host.ScriptingObject {
38
+ class Analytics extends import_em_ssf_host.default.ScriptingObject {
29
39
  /**
30
40
  * logger instance
31
41
  */
@@ -26,38 +26,33 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var utils_exports = {};
30
- __export(utils_exports, {
31
- getMajorMinorVersion: () => getMajorMinorVersion,
32
- logger: () => logger,
33
- releaseJSThread: () => releaseJSThread,
34
- sendJS: () => sendJS,
35
- sendJSText: () => sendJSText
36
- });
37
- module.exports = __toCommonJS(utils_exports);
38
- var import_promises = require("fs/promises");
39
- var import_node_path = __toESM(require("node:path"));
40
- var import_pui_diagnostics = require("@elliemae/pui-diagnostics");
41
- const getMajorMinorVersion = (version) => version.split(".").slice(0, 2).join(".");
42
- const sendJS = async (res, ctx, filePath) => {
43
- const fileContent = await (0, import_promises.readFile)(import_node_path.default.join(__dirname, filePath), "utf-8");
44
- return res.once(
45
- ctx.status(200),
46
- ctx.set("Content-Type", "application/javascript"),
47
- ctx.body(fileContent)
48
- );
49
- };
50
- const sendJSText = async (res, ctx, fileContent) => res.once(
51
- ctx.status(200),
52
- ctx.set("Content-Type", "application/javascript"),
53
- ctx.body(fileContent)
54
- );
55
- const releaseJSThread = () => new Promise((resolve) => {
56
- setTimeout(resolve, 0);
57
- });
58
- const logger = (0, import_pui_diagnostics.logger)({
59
- transport: (0, import_pui_diagnostics.Console)(),
60
- index: "microfe",
61
- team: "ui platform",
62
- appName: "MicroFE Tests"
29
+ var ssfguest_adapter_exports = {};
30
+ __export(ssfguest_adapter_exports, {
31
+ SSFGuestAdapter: () => SSFGuestAdapter
63
32
  });
33
+ module.exports = __toCommonJS(ssfguest_adapter_exports);
34
+ var import_em_ssf_guest = __toESM(require("@elliemae/em-ssf-guest"));
35
+ class SSFGuestAdapter {
36
+ async init() {
37
+ if (!import_em_ssf_guest.default) return false;
38
+ await import_em_ssf_guest.default.connect();
39
+ return true;
40
+ }
41
+ async getObject(name) {
42
+ return import_em_ssf_guest.default.getObject(name);
43
+ }
44
+ subscribe(message, func) {
45
+ const callback = (scriptingObj, eventData) => {
46
+ func(message, eventData);
47
+ };
48
+ const [objectId, eventName] = message.split(".");
49
+ return import_em_ssf_guest.default.subscribe(
50
+ objectId,
51
+ eventName || "",
52
+ callback
53
+ );
54
+ }
55
+ unsubscribe(token, objectId, eventName) {
56
+ return import_em_ssf_guest.default.unsubscribe(objectId, eventName, token);
57
+ }
58
+ }
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  var __export = (target, all) => {
9
7
  for (var name in all)
@@ -18,14 +16,6 @@ var __copyProps = (to, from, except, desc) => {
18
16
  return to;
19
17
  };
20
18
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- ));
29
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
20
  var testing_exports = {};
31
21
  __export(testing_exports, {
@@ -34,7 +24,6 @@ __export(testing_exports, {
34
24
  module.exports = __toCommonJS(testing_exports);
35
25
  var import_jsx_runtime = require("react/jsx-runtime");
36
26
  var import_react = require("@testing-library/react");
37
- var import_user_event = __toESM(require("@testing-library/user-event"));
38
27
  var import_pui_theme = require("@elliemae/pui-theme");
39
28
  var import_store = require("../../data/store.js");
40
29
  var import_app_root = require("../../view/app-root/index.js");
@@ -47,7 +36,4 @@ const AllTheProviders = ({
47
36
  theme = defaultTheme,
48
37
  children
49
38
  }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_app_root.AppRoot, { store, history: import_history.browserHistory, theme, children });
50
- const customRender = (ui, options) => ({
51
- user: import_user_event.default.setup(),
52
- ...(0, import_react.render)(ui, { wrapper: AllTheProviders, ...options })
53
- });
39
+ const customRender = (ui, options) => (0, import_react.render)(ui, { wrapper: AllTheProviders, ...options });
@@ -61,7 +61,7 @@ const IFrame = (0, import_react.memo)(
61
61
  ref: frameRef,
62
62
  title,
63
63
  src,
64
- "data-testid": `${import_const.IFRAME_CONTAINER_ID_PREFIX}${id}`,
64
+ scrolling: "no",
65
65
  ...sandboxProps,
66
66
  onLoad: () => frameRef?.current?.contentDocument && onFrameReady(frameRef.current.contentDocument)
67
67
  }
@@ -69,10 +69,6 @@
69
69
  <strong>JavaScript has been disabled on your browser</strong>, please
70
70
  <strong>enable JS</strong> to make this app work.</noscript
71
71
  >
72
- <div
73
- id="pui-app-container-"
74
- data-testid="pui-app-container-"
75
- class="full-width full-height"
76
- ></div>
72
+ <div id="pui-app-container-" class="full-width full-height"></div>
77
73
  </body>
78
74
  </html>
@@ -25,7 +25,6 @@ var import_react = require("react");
25
25
  var import_session = require("../../utils/session.js");
26
26
  var import_host = require("../../utils/micro-frontend/host.js");
27
27
  var import_micro_frontend = require("../../utils/micro-frontend/index.js");
28
- var import_const = require("../micro-app/const.js");
29
28
  const addBaseTag = (id, documentEle) => {
30
29
  const { hostUrl, manifestPath } = (0, import_micro_frontend.getMicroFrontEndAppConfig)({
31
30
  id
@@ -37,10 +36,9 @@ const addBaseTag = (id, documentEle) => {
37
36
  documentEle.getElementsByTagName("head")[0].appendChild(base);
38
37
  };
39
38
  const updateContainerId = (id, documentEle) => {
40
- const ele = documentEle.getElementById(import_const.APP_CONTAINER_ID_PREFIX);
39
+ const ele = documentEle.getElementById("pui-app-container-");
41
40
  if (ele) {
42
41
  ele.id = `${ele.id}${id}`;
43
- ele.dataset.testid = ele.id;
44
42
  }
45
43
  };
46
44
  const useFrameLoaded = ({ id, documentEle }) => {
@@ -15,8 +15,7 @@ const sendBAEvent = ({
15
15
  self = true
16
16
  }) => {
17
17
  if (!self) {
18
- const host = CMicroAppGuest.getInstance()?.getHost();
19
- const sendEvent = host?.sendBAEvent;
18
+ const sendEvent = CMicroAppGuest.getInstance()?.getHost()?.sendBAEvent;
20
19
  if (sendEvent) {
21
20
  sendEvent(data);
22
21
  } else {
package/dist/esm/index.js CHANGED
@@ -60,10 +60,7 @@ import {
60
60
  } from "./utils/session.js";
61
61
  import { waitMessage } from "./data/wait-message/actions.js";
62
62
  import { initServiceWorker } from "./utils/service-worker.js";
63
- import {
64
- CMicroAppGuest,
65
- CMicroAppGuest as CMicroAppGuest2
66
- } from "./utils/micro-frontend/guest.js";
63
+ import { CMicroAppGuest } from "./utils/micro-frontend/guest.js";
67
64
  import { CMicroAppHost } from "./utils/micro-frontend/host.js";
68
65
  import { enableReactAppForHostIntegration } from "./utils/app-host-integration/react.js";
69
66
  import {
@@ -135,7 +132,6 @@ import { actions } from "./data/live-message/index.js";
135
132
  import { actions as actions2 } from "./data/error/index.js";
136
133
  import { actions as actions3 } from "./data/logout/actions.js";
137
134
  import { MicroApp } from "./view/micro-app/index.js";
138
- import { GuestMicroApp } from "./view/guest-microapp.js";
139
135
  import { MicroIFrameApp } from "./view/micro-iframe-app/index.js";
140
136
  import { getNavigationLinks } from "./view/micro-app/utils.js";
141
137
  import { getStore } from "./data/store.js";
@@ -149,7 +145,6 @@ export {
149
145
  Analytics,
150
146
  AppRoot,
151
147
  Autocomplete,
152
- CMicroAppGuest2 as CMicroApp,
153
148
  CMicroAppGuest,
154
149
  CMicroAppHost,
155
150
  CheckBox,
@@ -166,7 +161,6 @@ export {
166
161
  FormItemLayout,
167
162
  FormLayoutBlockItem,
168
163
  FormSubmitButton,
169
- GuestMicroApp,
170
164
  InputMask,
171
165
  InputText,
172
166
  LargeTextBox,
@@ -1,12 +1,12 @@
1
- import _ from "lodash";
1
+ import { get, set, clone, has } from "lodash";
2
2
  import appConfig from "../../app.config.json";
3
3
  let gAppConfig = appConfig;
4
4
  const setAppConfig = (config) => {
5
5
  gAppConfig = config;
6
6
  };
7
- const getAppConfigValue = (key = "", defaultValue = null) => _.clone(_.get(gAppConfig, key, defaultValue));
8
- const setAppConfigValue = (key, value) => _.set(gAppConfig, key, value);
9
- const hasItem = (key = "") => _.has(gAppConfig, key);
7
+ const getAppConfigValue = (key = "", defaultValue = null) => clone(get(gAppConfig, key, defaultValue));
8
+ const setAppConfigValue = (key, value) => set(gAppConfig, key, value);
9
+ const hasItem = (key = "") => has(gAppConfig, key);
10
10
  export {
11
11
  getAppConfigValue,
12
12
  hasItem,