@elliemae/pui-app-bridge 2.0.0-next.27 → 2.0.0-next.28

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 (38) hide show
  1. package/dist/cjs/config/app.js +10 -5
  2. package/dist/cjs/config/microFE.js +8 -3
  3. package/dist/cjs/index.html +1 -1
  4. package/dist/cjs/loaders/script.js +13 -8
  5. package/dist/cjs/loaders/style.js +11 -6
  6. package/dist/cjs/microfeFactory.js +19 -14
  7. package/dist/cjs/microfeHost.js +23 -18
  8. package/dist/cjs/tests/scriptingObjects/appraisalServiceModule.js +24 -19
  9. package/dist/cjs/tests/scriptingObjects/global.js +10 -5
  10. package/dist/esm/config/app.js +11 -5
  11. package/dist/esm/config/microFE.js +9 -3
  12. package/dist/esm/index.html +1 -1
  13. package/dist/esm/loaders/script.js +14 -8
  14. package/dist/esm/loaders/style.js +12 -6
  15. package/dist/esm/microfeFactory.js +20 -14
  16. package/dist/esm/microfeHost.js +24 -18
  17. package/dist/esm/tests/scriptingObjects/appraisalServiceModule.js +25 -19
  18. package/dist/esm/tests/scriptingObjects/global.js +11 -5
  19. package/dist/public/frame.html +1 -1
  20. package/dist/public/index.html +1 -1
  21. package/dist/public/js/emuiAppBridge.0bdd77190acabd48390a.js +24 -0
  22. package/dist/public/js/emuiAppBridge.0bdd77190acabd48390a.js.br +0 -0
  23. package/dist/public/js/emuiAppBridge.0bdd77190acabd48390a.js.gz +0 -0
  24. package/dist/public/js/emuiAppBridge.0bdd77190acabd48390a.js.map +1 -0
  25. package/dist/public/utils.js.map +1 -1
  26. package/dist/types/tests/server.d.ts +1 -1
  27. package/dist/types/tests/utils.d.ts +2 -2
  28. package/dist/umd/index.html +1 -1
  29. package/dist/umd/index.js +7 -7
  30. package/dist/umd/index.js.br +0 -0
  31. package/dist/umd/index.js.gz +0 -0
  32. package/dist/umd/index.js.map +1 -1
  33. package/dist/umd/utils.js.map +1 -1
  34. package/package.json +2 -2
  35. package/dist/public/js/emuiAppBridge.943ed7f133ada8a33815.js +0 -24
  36. package/dist/public/js/emuiAppBridge.943ed7f133ada8a33815.js.br +0 -0
  37. package/dist/public/js/emuiAppBridge.943ed7f133ada8a33815.js.gz +0 -0
  38. package/dist/public/js/emuiAppBridge.943ed7f133ada8a33815.js.map +0 -1
@@ -5,6 +5,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
9
  var __export = (target, all) => {
9
10
  for (var name in all)
10
11
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -26,6 +27,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
27
  mod
27
28
  ));
28
29
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var __publicField = (obj, key, value) => {
31
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
32
+ return value;
33
+ };
29
34
  var __accessCheck = (obj, member, msg) => {
30
35
  if (!member.has(obj))
31
36
  throw TypeError("Cannot " + msg);
@@ -73,7 +78,7 @@ class CAppConfig {
73
78
  * @param defaultValue default value to return if key is not found
74
79
  * @returns value for the given key
75
80
  */
76
- this.get = (key = "", defaultValue = null) => (0, import_clone.default)((0, import_get.default)(__privateGet(this, _gAppConfig), key, defaultValue));
81
+ __publicField(this, "get", (key = "", defaultValue = null) => (0, import_clone.default)((0, import_get.default)(__privateGet(this, _gAppConfig), key, defaultValue)));
77
82
  /**
78
83
  * Set value for the given app config key
79
84
  *
@@ -81,20 +86,20 @@ class CAppConfig {
81
86
  * @param value value to set
82
87
  * @returns app config instance
83
88
  */
84
- this.set = (key, value) => (0, import_set.default)(__privateGet(this, _gAppConfig), key, value);
89
+ __publicField(this, "set", (key, value) => (0, import_set.default)(__privateGet(this, _gAppConfig), key, value));
85
90
  /**
86
91
  * Check if the given key exists in app config
87
92
  *
88
93
  * @param key key to check
89
94
  * @returns true if key exists
90
95
  */
91
- this.has = (key = "") => (0, import_has.default)(__privateGet(this, _gAppConfig), key);
96
+ __publicField(this, "has", (key = "") => (0, import_has.default)(__privateGet(this, _gAppConfig), key));
92
97
  /**
93
98
  * load application configuration from the given asset path
94
99
  *
95
100
  * @param assetPath url path to load app config from
96
101
  */
97
- this.load = async (assetPath = "latest/") => {
102
+ __publicField(this, "load", async (assetPath = "latest/") => {
98
103
  const response = await fetch(
99
104
  `${assetPath.replace(/\/?$/, "/")}app.config.json`
100
105
  );
@@ -108,7 +113,7 @@ class CAppConfig {
108
113
  } else {
109
114
  throw new Error("Failed to load app config");
110
115
  }
111
- };
116
+ });
112
117
  }
113
118
  }
114
119
  _gAppConfig = new WeakMap();
@@ -5,6 +5,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
9
  var __export = (target, all) => {
9
10
  for (var name in all)
10
11
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -26,6 +27,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
27
  mod
27
28
  ));
28
29
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var __publicField = (obj, key, value) => {
31
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
32
+ return value;
33
+ };
29
34
  var __accessCheck = (obj, member, msg) => {
30
35
  if (!member.has(obj))
31
36
  throw TypeError("Cannot " + msg);
@@ -138,7 +143,7 @@ const getConfig = ({
138
143
  class CMicroFEConfig {
139
144
  constructor() {
140
145
  __privateAdd(this, _microFrontendApps, []);
141
- this.init = ({
146
+ __publicField(this, "init", ({
142
147
  version,
143
148
  appConfig
144
149
  }) => {
@@ -155,8 +160,8 @@ class CMicroFEConfig {
155
160
  });
156
161
  }
157
162
  ));
158
- };
159
- this.getConfigById = (id) => __privateGet(this, _microFrontendApps).find((app) => app.id === id);
163
+ });
164
+ __publicField(this, "getConfigById", (id) => __privateGet(this, _microFrontendApps).find((app) => app.id === id));
160
165
  }
161
166
  }
162
167
  _microFrontendApps = new WeakMap();
@@ -6,7 +6,7 @@
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>Host</title>
8
8
  <script src="https://cdn.tailwindcss.com?plugins=forms"></script>
9
- <script src="https://qa.assets.rd.elliemae.io/pui-diagnostics@3.0.0-next.9/umd/index.js" ></script>
9
+ <script src="https://qa.assets.rd.elliemae.io/pui-diagnostics@3" ></script>
10
10
  </head>
11
11
  <body>
12
12
  <header class="bg-indigo-300 h-10 flex place-items-center">
@@ -3,6 +3,7 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
7
  var __export = (target, all) => {
7
8
  for (var name in all)
8
9
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -16,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
16
17
  return to;
17
18
  };
18
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var __publicField = (obj, key, value) => {
21
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
22
+ return value;
23
+ };
19
24
  var __accessCheck = (obj, member, msg) => {
20
25
  if (!member.has(obj))
21
26
  throw TypeError("Cannot " + msg);
@@ -48,7 +53,7 @@ const isDeferEligible = (scriptSrc) => !HEAD_SCRIPTS.test(scriptSrc);
48
53
  class ScriptLoader {
49
54
  constructor(logger) {
50
55
  __privateAdd(this, _logger, void 0);
51
- this.add = ({
56
+ __publicField(this, "add", ({
52
57
  name,
53
58
  hostUrl,
54
59
  documentEle,
@@ -71,8 +76,8 @@ class ScriptLoader {
71
76
  if (!(0, import_utils.isJSDOM)() && isDeferEligible(ele.src))
72
77
  ele.defer = true;
73
78
  documentEle.head.appendChild(ele);
74
- });
75
- this.remove = (elementId = "", documentEle = document) => new Promise((resolve) => {
79
+ }));
80
+ __publicField(this, "remove", (elementId = "", documentEle = document) => new Promise((resolve) => {
76
81
  const ele = documentEle.getElementById(elementId);
77
82
  if (!ele) {
78
83
  __privateGet(this, _logger).warn(`script with id ${elementId} not found`);
@@ -80,8 +85,8 @@ class ScriptLoader {
80
85
  }
81
86
  ele.remove();
82
87
  resolve();
83
- });
84
- this.removeDynamicImportedScripts = (hostUrl, documentEle) => {
88
+ }));
89
+ __publicField(this, "removeDynamicImportedScripts", (hostUrl, documentEle) => {
85
90
  const hostPattern = new RegExp(hostUrl, "i");
86
91
  const scriptElements = documentEle.getElementsByTagName("script");
87
92
  for (let index = scriptElements.length - 1; index >= 0; index -= 1) {
@@ -90,8 +95,8 @@ class ScriptLoader {
90
95
  if (hostPattern.test(src))
91
96
  scriptEle.remove();
92
97
  }
93
- };
94
- this.removePrefetchLinks = (hostUrl, documentEle) => {
98
+ });
99
+ __publicField(this, "removePrefetchLinks", (hostUrl, documentEle) => {
95
100
  const hostPattern = new RegExp(hostUrl, "i");
96
101
  const prefetchElements = documentEle.querySelectorAll('[rel="prefetch"]');
97
102
  for (let index = prefetchElements.length - 1; index >= 0; index -= 1) {
@@ -100,7 +105,7 @@ class ScriptLoader {
100
105
  if (hostPattern.test(href))
101
106
  ele.remove();
102
107
  }
103
- };
108
+ });
104
109
  __privateSet(this, _logger, logger);
105
110
  }
106
111
  }
@@ -3,6 +3,7 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
7
  var __export = (target, all) => {
7
8
  for (var name in all)
8
9
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -16,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
16
17
  return to;
17
18
  };
18
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var __publicField = (obj, key, value) => {
21
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
22
+ return value;
23
+ };
19
24
  var __accessCheck = (obj, member, msg) => {
20
25
  if (!member.has(obj))
21
26
  throw TypeError("Cannot " + msg);
@@ -46,7 +51,7 @@ const APP_STYLE_ID_PREFIX = "ice-style-";
46
51
  class StyleLoader {
47
52
  constructor(logger) {
48
53
  __privateAdd(this, _logger, void 0);
49
- this.add = ({
54
+ __publicField(this, "add", ({
50
55
  name,
51
56
  hostUrl,
52
57
  documentEle,
@@ -67,8 +72,8 @@ class StyleLoader {
67
72
  );
68
73
  };
69
74
  documentEle.head.appendChild(ele);
70
- });
71
- this.remove = (elementId = "", documentEle = document) => new Promise((resolve) => {
75
+ }));
76
+ __publicField(this, "remove", (elementId = "", documentEle = document) => new Promise((resolve) => {
72
77
  const ele = documentEle.getElementById(elementId);
73
78
  if (!ele) {
74
79
  __privateGet(this, _logger).warn(`style with id ${elementId} not found`);
@@ -76,8 +81,8 @@ class StyleLoader {
76
81
  }
77
82
  ele.remove();
78
83
  resolve();
79
- });
80
- this.removeDynamicImportedStyles = (hostUrl, documentEle) => {
84
+ }));
85
+ __publicField(this, "removeDynamicImportedStyles", (hostUrl, documentEle) => {
81
86
  const hostPattern = new RegExp(hostUrl, "i");
82
87
  const prefetchElements = documentEle.querySelectorAll('[rel="stylesheet"]');
83
88
  for (let index = prefetchElements.length - 1; index >= 0; index -= 1) {
@@ -86,7 +91,7 @@ class StyleLoader {
86
91
  if (hostPattern.test(href))
87
92
  ele.remove();
88
93
  }
89
- };
94
+ });
90
95
  __privateSet(this, _logger, logger);
91
96
  }
92
97
  }
@@ -3,6 +3,7 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
7
  var __export = (target, all) => {
7
8
  for (var name in all)
8
9
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -16,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
16
17
  return to;
17
18
  };
18
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var __publicField = (obj, key, value) => {
21
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
22
+ return value;
23
+ };
19
24
  var __accessCheck = (obj, member, msg) => {
20
25
  if (!member.has(obj))
21
26
  throw TypeError("Cannot " + msg);
@@ -201,15 +206,15 @@ class CMicroAppFactory {
201
206
  /**
202
207
  * Close all active guest micro frontend applications
203
208
  */
204
- this.closeAllApps = async () => {
209
+ __publicField(this, "closeAllApps", async () => {
205
210
  await Promise.all(Object.keys(__privateGet(this, _activeApps)).map(this.closeApp));
206
- };
211
+ });
207
212
  /**
208
213
  * Close guest micro frontend application
209
214
  *
210
215
  * @param id unique id of guest application
211
216
  */
212
- this.closeApp = async (id) => {
217
+ __publicField(this, "closeApp", async (id) => {
213
218
  if (!id)
214
219
  throw new Error("id is required");
215
220
  const appConfig = __privateGet(this, _microFEConfig).getConfigById(id);
@@ -227,37 +232,37 @@ class CMicroAppFactory {
227
232
  __privateGet(this, _unloadApp).call(this, { id, hostUrl, documentEle: frameEle.contentDocument });
228
233
  import_frame.Frame.remove(id);
229
234
  }
230
- };
235
+ });
231
236
  /**
232
237
  * Get guest by id
233
238
  *
234
239
  * @param guestId unique id of guest
235
240
  * @returns guest instance
236
241
  */
237
- this.getGuest = (guestId) => __privateGet(this, _activeGuests).get(guestId);
242
+ __publicField(this, "getGuest", (guestId) => __privateGet(this, _activeGuests).get(guestId));
238
243
  /**
239
244
  * Get list of active guests
240
245
  *
241
246
  * @returns list of active guests
242
247
  */
243
- this.getGuests = () => Array.from(__privateGet(this, _activeGuests).values());
248
+ __publicField(this, "getGuests", () => Array.from(__privateGet(this, _activeGuests).values()));
244
249
  /**
245
250
  * Initialize factory
246
251
  */
247
- this.init = async () => {
252
+ __publicField(this, "init", async () => {
248
253
  await __privateGet(this, _appConfig).load();
249
254
  __privateGet(this, _microFEConfig).init({
250
255
  version: __privateGet(this, _host).version,
251
256
  appConfig: __privateGet(this, _appConfig)
252
257
  });
253
- };
258
+ });
254
259
  /**
255
260
  * Mount guest micro frontend application into DOM
256
261
  *
257
262
  * @param id unique id of guest micro frontend application
258
263
  * @throws Error if application with given id is not found in configuration
259
264
  */
260
- this.mountApp = async (id) => {
265
+ __publicField(this, "mountApp", async (id) => {
261
266
  if (!id)
262
267
  throw new Error("id is required");
263
268
  const appConfig = __privateGet(this, _microFEConfig).getConfigById(id);
@@ -265,13 +270,13 @@ class CMicroAppFactory {
265
270
  throw new Error(`Application with id ${id} is not found`);
266
271
  }
267
272
  await __privateGet(this, _mountApp).call(this, appConfig);
268
- };
273
+ });
269
274
  /**
270
275
  * Open guest micro frontend application
271
276
  *
272
277
  * @param {OpenAppParams} params - options to open guest application
273
278
  */
274
- this.openApp = async (params) => {
279
+ __publicField(this, "openApp", async (params) => {
275
280
  const { id, frameOptions, history, theme } = params;
276
281
  const appConfig = __privateGet(this, _microFEConfig).getConfigById(id);
277
282
  if (!appConfig) {
@@ -302,14 +307,14 @@ class CMicroAppFactory {
302
307
  import_frame.Frame.remove(id);
303
308
  throw err;
304
309
  }
305
- };
310
+ });
306
311
  /**
307
312
  * Unmount guest micro frontend application from DOM
308
313
  *
309
314
  * @param id unique id of guest micro frontend application
310
315
  * @throws Error if application with given id is not found in configuration
311
316
  */
312
- this.unmountApp = async (id) => {
317
+ __publicField(this, "unmountApp", async (id) => {
313
318
  if (!id)
314
319
  throw new Error("id is required");
315
320
  const appConfig = __privateGet(this, _microFEConfig).getConfigById(id);
@@ -317,7 +322,7 @@ class CMicroAppFactory {
317
322
  throw new Error(`Application with id ${id} is not found`);
318
323
  }
319
324
  await __privateGet(this, _unmountApp).call(this, appConfig);
320
- };
325
+ });
321
326
  const { logger } = params;
322
327
  if (!logger)
323
328
  throw new Error("logger is required");
@@ -3,6 +3,7 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
7
  var __export = (target, all) => {
7
8
  for (var name in all)
8
9
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -16,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
16
17
  return to;
17
18
  };
18
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var __publicField = (obj, key, value) => {
21
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
22
+ return value;
23
+ };
19
24
  var __accessCheck = (obj, member, msg) => {
20
25
  if (!member.has(obj))
21
26
  throw TypeError("Cannot " + msg);
@@ -61,13 +66,13 @@ class CMicroFEHost {
61
66
  * @param {AddEventListenerParams<EventId, EventType>} params - parameters to add event listener
62
67
  * @returns subscription id
63
68
  */
64
- this.addEventListener = (params) => __privateGet(this, _eventManager).subscribe(params);
69
+ __publicField(this, "addEventListener", (params) => __privateGet(this, _eventManager).subscribe(params));
65
70
  /**
66
71
  * registers scripting object to the host
67
72
  *
68
73
  * @param so scripting object to publish
69
74
  */
70
- this.addScriptingObject = (so) => {
75
+ __publicField(this, "addScriptingObject", (so) => {
71
76
  if (!so?.id || !so?._toJSON) {
72
77
  throw new Error("Object is not derived from ScriptingObject");
73
78
  }
@@ -79,13 +84,13 @@ class CMicroFEHost {
79
84
  if (__privateGet(this, _scriptingObjects).has(objectId))
80
85
  throw new Error(`Scripting Object ${so.id} already exists`);
81
86
  __privateGet(this, _scriptingObjects).set(objectId, so);
82
- };
87
+ });
83
88
  /**
84
89
  * dispatch event to guest microfrontend application
85
90
  *
86
91
  * @param {DispatchEventParams<EventId, Params>} params - event parameters
87
92
  */
88
- this.dispatchEvent = async (params) => __privateGet(this, _eventManager).dispatchEvent(params);
93
+ __publicField(this, "dispatchEvent", async (params) => __privateGet(this, _eventManager).dispatchEvent(params));
89
94
  /**
90
95
  * Get reference to the scripting object (or proxy) by name
91
96
  *
@@ -93,41 +98,41 @@ class CMicroFEHost {
93
98
  * @param objectId
94
99
  * @returns scripting object reference
95
100
  */
96
- this.getObject = (objectId) => {
101
+ __publicField(this, "getObject", (objectId) => {
97
102
  const id = objectId.toLowerCase();
98
103
  const data = __privateGet(this, _scriptingObjects).get(id);
99
104
  return Promise.resolve(data || null);
100
- };
105
+ });
101
106
  /**
102
107
  * removes listener from the scripting object event
103
108
  *
104
109
  * @param {RemoveEventListenerParams<EventId>} params - parameters to remove event listener
105
110
  */
106
- this.removeEventListener = (params) => {
111
+ __publicField(this, "removeEventListener", (params) => {
107
112
  __privateGet(this, _eventManager).unsubscribe(params);
108
- };
113
+ });
109
114
  /**
110
115
  * remove all listeners
111
116
  */
112
- this.removeAllEventListeners = () => {
117
+ __publicField(this, "removeAllEventListeners", () => {
113
118
  __privateGet(this, _eventManager).unsubscribeAll();
114
- };
119
+ });
115
120
  /**
116
121
  * removes scripting object from the host
117
122
  *
118
123
  * @param objectId unique id of the scripting object
119
124
  */
120
- this.removeScriptingObject = (objectId) => {
125
+ __publicField(this, "removeScriptingObject", (objectId) => {
121
126
  __privateGet(this, _scriptingObjects).delete(
122
127
  objectId.toLowerCase()
123
128
  );
124
- };
129
+ });
125
130
  /**
126
131
  * set the size of the guest application iframe window
127
132
  *
128
133
  * @param {AppWindowSize} appSize window size of the application
129
134
  */
130
- this.setAppWindowSize = (appSize) => {
135
+ __publicField(this, "setAppWindowSize", (appSize) => {
131
136
  const { appId, size } = appSize;
132
137
  const frameEle = document.getElementById(
133
138
  `${import_frame.FRAME_CONTAINER_ID_PREFIX}${appId}`
@@ -135,7 +140,7 @@ class CMicroFEHost {
135
140
  if (frameEle) {
136
141
  frameEle.style.height = `${size.height}px`;
137
142
  }
138
- };
143
+ });
139
144
  // deprecated legacy eventing methods (to be removed)
140
145
  /**
141
146
  * emit event to all subscribers (deprecated)
@@ -144,7 +149,7 @@ class CMicroFEHost {
144
149
  * @param data data to be sent to the subscribers of the event
145
150
  * @returns true if event is published successfully
146
151
  */
147
- this.publish = (eventId, data) => (0, import_pubsub_js.publish)(eventId, data);
152
+ __publicField(this, "publish", (eventId, data) => (0, import_pubsub_js.publish)(eventId, data));
148
153
  /**
149
154
  * subscribe to an scripting object event (deprecated)
150
155
  *
@@ -153,16 +158,16 @@ class CMicroFEHost {
153
158
  * @returns token to be used to unsubscribe
154
159
  */
155
160
  // eslint-disable-next-line @typescript-eslint/ban-types
156
- this.subscribe = (eventId, listener) => (0, import_pubsub_js.subscribe)(eventId, listener);
161
+ __publicField(this, "subscribe", (eventId, listener) => (0, import_pubsub_js.subscribe)(eventId, listener));
157
162
  /**
158
163
  * unsubscribe from an scripting object event (deprecated)
159
164
  *
160
165
  * @param token unique token returned by subscribe
161
166
  * @param eventId unique id of the event. The format is <scripting object name>.<event name>
162
167
  */
163
- this.unsubscribe = (token) => {
168
+ __publicField(this, "unsubscribe", (token) => {
164
169
  (0, import_pubsub_js.unsubscribe)(token);
165
- };
170
+ });
166
171
  __privateSet(this, _logger, params.logger);
167
172
  __privateSet(this, _version, params?.version || import_constant.LATEST_VERSION);
168
173
  __privateSet(this, _eventManager, new import_em_ssf_common.EventManager());
@@ -3,6 +3,7 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
7
  var __export = (target, all) => {
7
8
  for (var name in all)
8
9
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -16,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
16
17
  return to;
17
18
  };
18
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var __publicField = (obj, key, value) => {
21
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
22
+ return value;
23
+ };
19
24
  var __accessCheck = (obj, member, msg) => {
20
25
  if (!member.has(obj))
21
26
  throw TypeError("Cannot " + msg);
@@ -50,44 +55,44 @@ class AppraisalService extends import_em_ssf_common.ScriptingObject {
50
55
  super(import_constant.OBJECT_NAME);
51
56
  __privateAdd(this, _loanId, void 0);
52
57
  __privateAdd(this, _creditScore, void 0);
53
- this.Unloading = new import_em_ssf_common.Event({
58
+ __publicField(this, "Unloading", new import_em_ssf_common.Event({
54
59
  name: "Unloading",
55
60
  requiresFeedback: false,
56
61
  so: this
57
- });
58
- this.onPreCommit = new import_em_ssf_common.Event({
62
+ }));
63
+ __publicField(this, "onPreCommit", new import_em_ssf_common.Event({
59
64
  name: "onPreCommit",
60
65
  requiresFeedback: true,
61
66
  so: this
62
- });
63
- this.onSaved = new import_em_ssf_common.Event({
67
+ }));
68
+ __publicField(this, "onSaved", new import_em_ssf_common.Event({
64
69
  name: "onSaved",
65
70
  requiresFeedback: false,
66
71
  so: this
67
- });
68
- this.getCapabilities = () => Promise.resolve({
72
+ }));
73
+ __publicField(this, "getCapabilities", () => Promise.resolve({
69
74
  isAdmin: true,
70
75
  los: "Encompass"
71
- });
72
- this.getParameters = () => Promise.resolve({
76
+ }));
77
+ __publicField(this, "getParameters", () => Promise.resolve({
73
78
  loanId: __privateGet(this, _loanId),
74
79
  creditScore: __privateGet(this, _creditScore)
75
- });
76
- this.setCreditScore = (creditScore) => {
80
+ }));
81
+ __publicField(this, "setCreditScore", (creditScore) => {
77
82
  __privateSet(this, _creditScore, creditScore);
78
83
  return Promise.resolve();
79
- };
80
- this.saveLoan = () => Promise.resolve();
81
- this.commit = () => new Promise((resolve) => {
84
+ });
85
+ __publicField(this, "saveLoan", () => Promise.resolve());
86
+ __publicField(this, "commit", () => new Promise((resolve) => {
82
87
  setTimeout(() => {
83
88
  resolve({ loanId: __privateGet(this, _loanId) });
84
89
  }, 1e3);
85
- });
86
- this.delete = () => {
90
+ }));
91
+ __publicField(this, "delete", () => {
87
92
  throw new Error("Not implemented");
88
- };
89
- this.unload = async () => {
90
- };
93
+ });
94
+ __publicField(this, "unload", async () => {
95
+ });
91
96
  __privateSet(this, _loanId, loanId);
92
97
  __privateSet(this, _creditScore, creditScore);
93
98
  }
@@ -3,6 +3,7 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
7
  var __export = (target, all) => {
7
8
  for (var name in all)
8
9
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -16,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
16
17
  return to;
17
18
  };
18
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var __publicField = (obj, key, value) => {
21
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
22
+ return value;
23
+ };
19
24
  var __accessCheck = (obj, member, msg) => {
20
25
  if (!member.has(obj))
21
26
  throw TypeError("Cannot " + msg);
@@ -40,16 +45,16 @@ class Global extends import_em_ssf_common.ScriptingObject {
40
45
  constructor() {
41
46
  super("Global");
42
47
  __privateAdd(this, _data, /* @__PURE__ */ new Map());
43
- this.Change = new import_em_ssf_common.Event({
48
+ __publicField(this, "Change", new import_em_ssf_common.Event({
44
49
  name: "Change",
45
50
  requiresFeedback: false,
46
51
  so: this
47
- });
48
- this.set = (key, value) => {
52
+ }));
53
+ __publicField(this, "set", (key, value) => {
49
54
  __privateGet(this, _data).set(key, value);
50
55
  return Promise.resolve();
51
- };
52
- this.get = (key) => Promise.resolve(__privateGet(this, _data).get(key));
56
+ });
57
+ __publicField(this, "get", (key) => Promise.resolve(__privateGet(this, _data).get(key)));
53
58
  }
54
59
  }
55
60
  _data = new WeakMap();