@elliemae/pui-app-sdk 5.21.0-beta.3 → 5.21.0
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.
- package/dist/cjs/analytics/index.js +1 -2
- package/dist/cjs/index.js +0 -2
- package/dist/cjs/utils/decorators/functionDecorators.js +35 -2
- package/dist/cjs/utils/decorators/index.js +2 -1
- package/dist/cjs/utils/micro-frontend/guest.js +13 -99
- package/dist/cjs/{view/tests/scriptingObjects/constant.js → utils/micro-frontend/host-app.js} +10 -5
- package/dist/cjs/utils/micro-frontend/host.js +2 -35
- package/dist/cjs/{view/tests/utils.js → utils/micro-frontend/ssfguest-adapter.js} +29 -34
- package/dist/cjs/utils/testing/index.js +1 -15
- package/dist/cjs/view/micro-iframe-app/iframe/index.js +1 -1
- package/dist/cjs/view/micro-iframe-app/iframe.html +1 -5
- package/dist/cjs/view/micro-iframe-app/use-frame-loaded.js +1 -3
- package/dist/esm/analytics/index.js +1 -2
- package/dist/esm/index.js +0 -2
- package/dist/esm/utils/decorators/functionDecorators.js +35 -2
- package/dist/esm/utils/decorators/index.js +4 -2
- package/dist/esm/utils/micro-frontend/guest.js +13 -99
- package/dist/esm/utils/micro-frontend/host-app.js +9 -0
- package/dist/esm/utils/micro-frontend/host.js +2 -35
- package/dist/esm/utils/micro-frontend/ssfguest-adapter.js +28 -0
- package/dist/esm/utils/testing/index.js +1 -5
- package/dist/esm/view/micro-iframe-app/iframe/index.js +1 -1
- package/dist/esm/view/micro-iframe-app/iframe.html +1 -5
- package/dist/esm/view/micro-iframe-app/use-frame-loaded.js +1 -3
- package/dist/types/lib/index.d.ts +0 -1
- package/dist/types/lib/utils/decorators/functionDecorators.d.ts +28 -0
- package/dist/types/lib/utils/decorators/index.d.ts +2 -1
- package/dist/types/lib/utils/micro-frontend/guest.d.ts +11 -46
- package/dist/types/lib/utils/micro-frontend/host-app.d.ts +11 -0
- package/dist/types/lib/utils/micro-frontend/host.d.ts +3 -20
- package/dist/types/lib/utils/micro-frontend/ssfguest-adapter.d.ts +7 -0
- package/dist/types/lib/utils/micro-frontend/types.d.ts +1 -2
- package/dist/types/lib/utils/testing/index.d.ts +1 -57
- package/dist/types/lib/utils/window.d.ts +6 -13
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +44 -43
- package/dist/cjs/utils/micro-frontend/app-bridge.js +0 -36
- package/dist/cjs/utils/micro-frontend/tests/app.config.json +0 -200
- package/dist/cjs/utils/micro-frontend/tests/utils.js +0 -116
- package/dist/cjs/view/microapp-v2.js +0 -91
- package/dist/cjs/view/tests/__snapshots__/micro-iframe-app.test.tsx.snap +0 -208
- package/dist/cjs/view/tests/__snapshots__/microapp-v2.test.tsx.snap +0 -21
- package/dist/cjs/view/tests/app.config.json +0 -200
- package/dist/cjs/view/tests/constants.js +0 -44
- package/dist/cjs/view/tests/flights/23.1/app.checksum1.css +0 -3
- package/dist/cjs/view/tests/flights/23.1/app.checksum1.js +0 -52
- package/dist/cjs/view/tests/flights/23.1/manifest.json +0 -4
- package/dist/cjs/view/tests/flights/latest/app.checksum.css +0 -3
- package/dist/cjs/view/tests/flights/latest/app.checksum.js +0 -52
- package/dist/cjs/view/tests/flights/latest/manifest.json +0 -4
- package/dist/cjs/view/tests/hotels/23.1/app.checksum.css +0 -3
- package/dist/cjs/view/tests/hotels/23.1/app.checksum.js +0 -52
- package/dist/cjs/view/tests/hotels/23.1/manifest.json +0 -4
- package/dist/cjs/view/tests/hotels/latest/app.checksum.css +0 -3
- package/dist/cjs/view/tests/hotels/latest/app.checksum.js +0 -52
- package/dist/cjs/view/tests/hotels/latest/manifest.json +0 -4
- package/dist/cjs/view/tests/loan/latest/index.js +0 -116
- package/dist/cjs/view/tests/loan/latest/manifest.json +0 -3
- package/dist/cjs/view/tests/scriptingObjects/appraisalServiceModule.js +0 -85
- package/dist/cjs/view/tests/scriptingObjects/global.js +0 -40
- package/dist/cjs/view/tests/scriptingObjects/loan.js +0 -207
- package/dist/cjs/view/tests/server.js +0 -29
- package/dist/cjs/view/tests/serverHandlers.js +0 -210
- package/dist/cjs/view/tests/task/latest/index.dev.js +0 -67
- package/dist/cjs/view/tests/task/latest/index.js +0 -67
- package/dist/cjs/view/tests/task/latest/manifest.json +0 -4
- package/dist/cjs/view/tests/travelhub/23.1/app.checksum.css +0 -3
- package/dist/cjs/view/tests/travelhub/23.1/app.checksum.js +0 -25
- package/dist/cjs/view/tests/travelhub/23.1/landing.checksum1.css +0 -3
- package/dist/cjs/view/tests/travelhub/23.1/landing.checksum1.js +0 -6
- package/dist/cjs/view/tests/travelhub/23.1/manifest.json +0 -6
- package/dist/cjs/view/tests/travelhub/latest/app.checksum.css +0 -3
- package/dist/cjs/view/tests/travelhub/latest/app.checksum.js +0 -30
- package/dist/cjs/view/tests/travelhub/latest/landing.checksum.css +0 -3
- package/dist/cjs/view/tests/travelhub/latest/landing.checksum.js +0 -8
- package/dist/cjs/view/tests/travelhub/latest/manifest.json +0 -6
- package/dist/esm/utils/micro-frontend/app-bridge.js +0 -16
- package/dist/esm/utils/micro-frontend/tests/app.config.json +0 -200
- package/dist/esm/utils/micro-frontend/tests/utils.js +0 -96
- package/dist/esm/view/microapp-v2.js +0 -71
- package/dist/esm/view/tests/__snapshots__/micro-iframe-app.test.tsx.snap +0 -208
- package/dist/esm/view/tests/__snapshots__/microapp-v2.test.tsx.snap +0 -21
- package/dist/esm/view/tests/app.config.json +0 -200
- package/dist/esm/view/tests/constants.js +0 -24
- package/dist/esm/view/tests/flights/23.1/app.checksum1.css +0 -3
- package/dist/esm/view/tests/flights/23.1/app.checksum1.js +0 -51
- package/dist/esm/view/tests/flights/23.1/manifest.json +0 -4
- package/dist/esm/view/tests/flights/latest/app.checksum.css +0 -3
- package/dist/esm/view/tests/flights/latest/app.checksum.js +0 -51
- package/dist/esm/view/tests/flights/latest/manifest.json +0 -4
- package/dist/esm/view/tests/hotels/23.1/app.checksum.css +0 -3
- package/dist/esm/view/tests/hotels/23.1/app.checksum.js +0 -51
- package/dist/esm/view/tests/hotels/23.1/manifest.json +0 -4
- package/dist/esm/view/tests/hotels/latest/app.checksum.css +0 -3
- package/dist/esm/view/tests/hotels/latest/app.checksum.js +0 -51
- package/dist/esm/view/tests/hotels/latest/manifest.json +0 -4
- package/dist/esm/view/tests/loan/latest/index.js +0 -115
- package/dist/esm/view/tests/loan/latest/manifest.json +0 -3
- package/dist/esm/view/tests/scriptingObjects/appraisalServiceModule.js +0 -67
- package/dist/esm/view/tests/scriptingObjects/constant.js +0 -4
- package/dist/esm/view/tests/scriptingObjects/global.js +0 -20
- package/dist/esm/view/tests/scriptingObjects/loan.js +0 -187
- package/dist/esm/view/tests/server.js +0 -9
- package/dist/esm/view/tests/serverHandlers.js +0 -180
- package/dist/esm/view/tests/task/latest/index.dev.js +0 -66
- package/dist/esm/view/tests/task/latest/index.js +0 -66
- package/dist/esm/view/tests/task/latest/manifest.json +0 -4
- package/dist/esm/view/tests/travelhub/23.1/app.checksum.css +0 -3
- package/dist/esm/view/tests/travelhub/23.1/app.checksum.js +0 -24
- package/dist/esm/view/tests/travelhub/23.1/landing.checksum1.css +0 -3
- package/dist/esm/view/tests/travelhub/23.1/landing.checksum1.js +0 -5
- package/dist/esm/view/tests/travelhub/23.1/manifest.json +0 -6
- package/dist/esm/view/tests/travelhub/latest/app.checksum.css +0 -3
- package/dist/esm/view/tests/travelhub/latest/app.checksum.js +0 -29
- package/dist/esm/view/tests/travelhub/latest/landing.checksum.css +0 -3
- package/dist/esm/view/tests/travelhub/latest/landing.checksum.js +0 -7
- package/dist/esm/view/tests/travelhub/latest/manifest.json +0 -6
- package/dist/esm/view/tests/utils.js +0 -33
- package/dist/types/lib/utils/micro-frontend/app-bridge.d.ts +0 -4
- package/dist/types/lib/utils/micro-frontend/tests/utils.d.ts +0 -39
- package/dist/types/lib/view/microapp-v2.d.ts +0 -16
- package/dist/types/lib/view/tests/constants.d.ts +0 -11
- package/dist/types/lib/view/tests/flights/23.1/app.checksum1.d.ts +0 -7
- package/dist/types/lib/view/tests/flights/latest/app.checksum.d.ts +0 -7
- package/dist/types/lib/view/tests/hotels/23.1/app.checksum.d.ts +0 -7
- package/dist/types/lib/view/tests/hotels/latest/app.checksum.d.ts +0 -7
- package/dist/types/lib/view/tests/loan/latest/index.d.ts +0 -11
- package/dist/types/lib/view/tests/microapp-v2.test.d.ts +0 -1
- package/dist/types/lib/view/tests/scriptingObjects/appraisalServiceModule.d.ts +0 -36
- package/dist/types/lib/view/tests/scriptingObjects/constant.d.ts +0 -1
- package/dist/types/lib/view/tests/scriptingObjects/global.d.ts +0 -9
- package/dist/types/lib/view/tests/scriptingObjects/loan.d.ts +0 -31
- package/dist/types/lib/view/tests/server.d.ts +0 -1
- package/dist/types/lib/view/tests/serverHandlers.d.ts +0 -5
- package/dist/types/lib/view/tests/task/latest/index.d.ts +0 -10
- package/dist/types/lib/view/tests/task/latest/index.dev.d.ts +0 -10
- package/dist/types/lib/view/tests/travelhub/23.1/app.checksum.d.ts +0 -7
- package/dist/types/lib/view/tests/travelhub/23.1/landing.checksum1.d.ts +0 -2
- package/dist/types/lib/view/tests/travelhub/latest/app.checksum.d.ts +0 -0
- package/dist/types/lib/view/tests/travelhub/latest/landing.checksum.d.ts +0 -0
- package/dist/types/lib/view/tests/utils.d.ts +0 -7
- /package/dist/types/lib/{view/tests/micro-iframe-app.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
|
|
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
|
@@ -55,7 +55,6 @@ __export(index_exports, {
|
|
|
55
55
|
MASK_TYPES: () => import_input_mask.MASK_TYPES,
|
|
56
56
|
MaskedInputText: () => import_masked_input_text.MaskedInputText,
|
|
57
57
|
MicroApp: () => import_micro_app.MicroApp,
|
|
58
|
-
MicroApp2: () => import_microapp_v2.MicroApp2,
|
|
59
58
|
MicroIFrameApp: () => import_micro_iframe_app.MicroIFrameApp,
|
|
60
59
|
NavigationPrompt: () => import_navigation_prompt.NavigationPrompt,
|
|
61
60
|
NavigationPromptActions: () => import_actions2.ACTIONS,
|
|
@@ -234,7 +233,6 @@ var import_live_message = require("./data/live-message/index.js");
|
|
|
234
233
|
var import_error = require("./data/error/index.js");
|
|
235
234
|
var import_actions4 = require("./data/logout/actions.js");
|
|
236
235
|
var import_micro_app = require("./view/micro-app/index.js");
|
|
237
|
-
var import_microapp_v2 = require("./view/microapp-v2.js");
|
|
238
236
|
var import_micro_iframe_app = require("./view/micro-iframe-app/index.js");
|
|
239
237
|
var import_utils = require("./view/micro-app/utils.js");
|
|
240
238
|
var import_store3 = require("./data/store.js");
|
|
@@ -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
|
|
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
|
|
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,
|
|
@@ -124,45 +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
|
-
return host.getObject(objectId);
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* subscribe to the scripting object event
|
|
138
|
-
* @param {SubscribeParam<EventId, AppEvents[EventId]>} params - the parameters for the subscription
|
|
139
|
-
* @param {string} params.soName - the name of the scripting object
|
|
140
|
-
* @param {string} params.eventName - the name of the event
|
|
141
|
-
* @param {Function} params.callback - the callback function to be called when the event is triggered
|
|
142
|
-
* @returns {void}
|
|
143
|
-
*/
|
|
144
|
-
subscribe(params) {
|
|
145
|
-
let host = null;
|
|
146
|
-
if (this.#communicationMethod === "ssf" /* SSF */) {
|
|
147
|
-
host = this.getHost();
|
|
148
|
-
return host.subscribe(params);
|
|
149
|
-
}
|
|
150
|
-
host = this.getHost();
|
|
151
|
-
return host.subscribe(params);
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* unsubscribe from the scripting object event
|
|
155
|
-
* @param params - parameters for the unsubscription
|
|
156
|
-
*/
|
|
157
|
-
unsubscribe(params) {
|
|
158
|
-
let host = null;
|
|
159
|
-
if (this.#communicationMethod === "ssf" /* SSF */) {
|
|
160
|
-
host = this.getHost();
|
|
161
|
-
host.unsubscribe(params);
|
|
162
|
-
}
|
|
163
|
-
host = this.getHost();
|
|
164
|
-
host.unsubscribe(params);
|
|
165
|
-
}
|
|
166
113
|
getProps() {
|
|
167
114
|
return this.props;
|
|
168
115
|
}
|
|
@@ -227,22 +174,21 @@ class CMicroAppGuest {
|
|
|
227
174
|
}
|
|
228
175
|
getSessionStorageItem(key) {
|
|
229
176
|
let value = sessionStorage.getItem(key);
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
value = host.getItem(key);
|
|
177
|
+
if (!value && this.props.host?.getItem) {
|
|
178
|
+
value = this.props.host.getItem(key);
|
|
233
179
|
}
|
|
234
180
|
return value;
|
|
235
181
|
}
|
|
236
|
-
async
|
|
182
|
+
async getSSFAdapter() {
|
|
237
183
|
let host = null;
|
|
238
184
|
if (window.parent !== window) {
|
|
239
185
|
if (!isCrossDomain()) {
|
|
240
|
-
host = window.parent?.emui?.MicroAppHost
|
|
186
|
+
host = window.parent?.emui?.MicroAppHost || null;
|
|
241
187
|
}
|
|
242
188
|
if (!host) {
|
|
243
|
-
|
|
244
|
-
await
|
|
245
|
-
|
|
189
|
+
const ssfAdapter = new import_ssfguest_adapter.SSFGuestAdapter();
|
|
190
|
+
if (!await ssfAdapter.init()) return null;
|
|
191
|
+
host = ssfAdapter;
|
|
246
192
|
}
|
|
247
193
|
}
|
|
248
194
|
return host;
|
|
@@ -254,21 +200,17 @@ class CMicroAppGuest {
|
|
|
254
200
|
this.props = import_lodash.default.merge(this.props, options);
|
|
255
201
|
this.props.history = options?.history || this.props.history;
|
|
256
202
|
if (!this.props.host) {
|
|
257
|
-
const host = await this.
|
|
258
|
-
if (host)
|
|
259
|
-
this.props.host = host;
|
|
260
|
-
}
|
|
203
|
+
const host = await this.getSSFAdapter();
|
|
204
|
+
if (host) this.props.host = host;
|
|
261
205
|
}
|
|
206
|
+
if (this.props.host) (0, import_host_app.setHostApp)(this.props.host);
|
|
262
207
|
__webpack_public_path__ = __webpack_public_path__.replace(/\/?$/, "/");
|
|
263
208
|
return (0, import_app_config.loadAppConfig)().then(() => {
|
|
264
209
|
const instanceId = this.getSessionStorageItem("instanceId") || "";
|
|
265
210
|
const userId = this.getSessionStorageItem("userId") || "";
|
|
266
211
|
(0, import_web_analytics.updateBAEventParameters)({ appId: this.appId, instanceId, userId });
|
|
267
212
|
(0, import_appdynamics.setAppDynamicsUserData)({ appId: this.appId, instanceId, userId });
|
|
268
|
-
|
|
269
|
-
this.#appBridge = appBridge;
|
|
270
|
-
if (this.onInit) this.onInit(this.props);
|
|
271
|
-
});
|
|
213
|
+
if (this.onInit) this.onInit(this.props);
|
|
272
214
|
});
|
|
273
215
|
}
|
|
274
216
|
mount(options = { containerId: "app-container" }) {
|
|
@@ -289,32 +231,4 @@ class CMicroAppGuest {
|
|
|
289
231
|
navigate(url, state) {
|
|
290
232
|
if (url) this.props.history.push(url, state);
|
|
291
233
|
}
|
|
292
|
-
/**
|
|
293
|
-
* add scripting object for child microapp to use
|
|
294
|
-
* @param so - The scripting object to be added.
|
|
295
|
-
* @param params - Optional parameters for adding the scripting object.
|
|
296
|
-
*/
|
|
297
|
-
addScriptingObject(so, params) {
|
|
298
|
-
if (this.#appBridge) {
|
|
299
|
-
this.#appBridge.addScriptingObject(so, params);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
/**
|
|
303
|
-
* dispatch event to child microapp
|
|
304
|
-
* @param {DispatchEventParams<EventId, Params>} params - event parameters
|
|
305
|
-
*/
|
|
306
|
-
async dispatchEvent(params) {
|
|
307
|
-
if (this.#appBridge) {
|
|
308
|
-
await this.#appBridge.dispatchEvent(params);
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
/**
|
|
312
|
-
* removes scripting object from child microapp use
|
|
313
|
-
* @param objectId unique id of the scripting object
|
|
314
|
-
*/
|
|
315
|
-
removeScriptingObject(objectId) {
|
|
316
|
-
if (this.#appBridge) {
|
|
317
|
-
this.#appBridge.removeScriptingObject(objectId);
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
234
|
}
|
package/dist/cjs/{view/tests/scriptingObjects/constant.js → utils/micro-frontend/host-app.js}
RENAMED
|
@@ -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
|
|
20
|
-
__export(
|
|
21
|
-
|
|
19
|
+
var host_app_exports = {};
|
|
20
|
+
__export(host_app_exports, {
|
|
21
|
+
getHostApp: () => getHostApp,
|
|
22
|
+
setHostApp: () => setHostApp
|
|
22
23
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
|
|
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
|
|
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
|
});
|
|
@@ -108,6 +102,7 @@ class CMicroAppHost {
|
|
|
108
102
|
static getInstance(params) {
|
|
109
103
|
if (!this.instance) {
|
|
110
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
|
}
|
|
@@ -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
|
|
30
|
-
__export(
|
|
31
|
-
|
|
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
|
-
"
|
|
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(
|
|
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
|
|
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
|
@@ -132,7 +132,6 @@ import { actions } from "./data/live-message/index.js";
|
|
|
132
132
|
import { actions as actions2 } from "./data/error/index.js";
|
|
133
133
|
import { actions as actions3 } from "./data/logout/actions.js";
|
|
134
134
|
import { MicroApp } from "./view/micro-app/index.js";
|
|
135
|
-
import { MicroApp2 } from "./view/microapp-v2.js";
|
|
136
135
|
import { MicroIFrameApp } from "./view/micro-iframe-app/index.js";
|
|
137
136
|
import { getNavigationLinks } from "./view/micro-app/utils.js";
|
|
138
137
|
import { getStore } from "./data/store.js";
|
|
@@ -169,7 +168,6 @@ export {
|
|
|
169
168
|
MASK_TYPES,
|
|
170
169
|
MaskedInputText,
|
|
171
170
|
MicroApp,
|
|
172
|
-
MicroApp2,
|
|
173
171
|
MicroIFrameApp,
|
|
174
172
|
NavigationPrompt,
|
|
175
173
|
ACTIONS as NavigationPromptActions,
|
|
@@ -136,9 +136,9 @@ function AsyncSingleExecution(_target, _propertyKey, descriptor) {
|
|
|
136
136
|
return promiseMap.get(key);
|
|
137
137
|
}
|
|
138
138
|
const promise = originalMethod.apply(this, args);
|
|
139
|
-
if (promise
|
|
139
|
+
if (promise && typeof promise.then === "function") {
|
|
140
140
|
promiseMap.set(key, promise);
|
|
141
|
-
promise.finally(() => {
|
|
141
|
+
promise.catch((e) => e).finally(() => {
|
|
142
142
|
promiseMap.delete(key);
|
|
143
143
|
});
|
|
144
144
|
}
|
|
@@ -146,6 +146,38 @@ function AsyncSingleExecution(_target, _propertyKey, descriptor) {
|
|
|
146
146
|
};
|
|
147
147
|
return descriptor;
|
|
148
148
|
}
|
|
149
|
+
function RetryAsync(retries = 3, interval = 2e3, reThrowException = true) {
|
|
150
|
+
return function(_target, _propertyKey, descriptor) {
|
|
151
|
+
const originalMethod = descriptor.value;
|
|
152
|
+
descriptor.value = async function(...args) {
|
|
153
|
+
let attempts = 0;
|
|
154
|
+
while (attempts < retries) {
|
|
155
|
+
try {
|
|
156
|
+
const result = originalMethod.apply(this, args);
|
|
157
|
+
if (result && typeof result.then === "function") {
|
|
158
|
+
return await result;
|
|
159
|
+
}
|
|
160
|
+
return result;
|
|
161
|
+
} catch (error) {
|
|
162
|
+
attempts += 1;
|
|
163
|
+
if (attempts >= retries) {
|
|
164
|
+
if (reThrowException) {
|
|
165
|
+
throw error;
|
|
166
|
+
}
|
|
167
|
+
return void 0;
|
|
168
|
+
}
|
|
169
|
+
await new Promise((resolve) => {
|
|
170
|
+
setTimeout(() => {
|
|
171
|
+
resolve(true);
|
|
172
|
+
}, interval);
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return void 0;
|
|
177
|
+
};
|
|
178
|
+
return descriptor;
|
|
179
|
+
};
|
|
180
|
+
}
|
|
149
181
|
export {
|
|
150
182
|
AsyncSingleExecution,
|
|
151
183
|
CacheUntilResolved,
|
|
@@ -154,5 +186,6 @@ export {
|
|
|
154
186
|
Memoize,
|
|
155
187
|
MemoizeAsync,
|
|
156
188
|
QueueTask,
|
|
189
|
+
RetryAsync,
|
|
157
190
|
Throttle
|
|
158
191
|
};
|
|
@@ -7,7 +7,8 @@ import {
|
|
|
7
7
|
Memoize,
|
|
8
8
|
MemoizeAsync,
|
|
9
9
|
QueueTask,
|
|
10
|
-
Throttle
|
|
10
|
+
Throttle,
|
|
11
|
+
RetryAsync
|
|
11
12
|
} from "./functionDecorators.js";
|
|
12
13
|
const decorators = {
|
|
13
14
|
class: {
|
|
@@ -22,7 +23,8 @@ const decorators = {
|
|
|
22
23
|
MemoizeAsync,
|
|
23
24
|
QueueTask,
|
|
24
25
|
Throttle,
|
|
25
|
-
AsyncSingleExecution
|
|
26
|
+
AsyncSingleExecution,
|
|
27
|
+
RetryAsync
|
|
26
28
|
}
|
|
27
29
|
};
|
|
28
30
|
export {
|