@elliemae/ssf-guest 2.9.9 → 2.17.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/creditService.html +1 -1
- package/dist/cjs/guest.js +71 -22
- package/dist/cjs/loanValidation.html +1 -1
- package/dist/cjs/pricingService.html +1 -1
- package/dist/cjs/tests/utils.js +11 -1
- package/dist/cjs/titleService.html +27 -28
- package/dist/cjs/v1-adapter.js +92 -0
- package/dist/cjs/v2-guest.html +1 -5
- package/dist/esm/creditService.html +1 -1
- package/dist/esm/guest.js +72 -23
- package/dist/esm/loanValidation.html +1 -1
- package/dist/esm/pricingService.html +1 -1
- package/dist/esm/tests/utils.js +11 -1
- package/dist/esm/titleService.html +27 -28
- package/dist/esm/v1-adapter.js +72 -0
- package/dist/esm/v2-guest.html +1 -5
- package/dist/public/businessObjects.js.gz +0 -0
- package/dist/public/creditScoreService.js.gz +0 -0
- package/dist/public/creditService.html +1 -1
- package/dist/public/index.html +1 -1
- package/dist/public/js/emuiSsfGuest.a6277961cb41c8cde6b0.js +29 -0
- package/dist/public/js/emuiSsfGuest.a6277961cb41c8cde6b0.js.br +0 -0
- package/dist/public/js/emuiSsfGuest.a6277961cb41c8cde6b0.js.gz +0 -0
- package/dist/public/js/emuiSsfGuest.a6277961cb41c8cde6b0.js.map +1 -0
- package/dist/public/loanValidation.html +1 -1
- package/dist/public/loanValidation.js.gz +0 -0
- package/dist/public/pricingService.html +1 -1
- package/dist/public/pricingService.js.gz +0 -0
- package/dist/public/titleService.html +1 -1
- package/dist/public/titleService.js.gz +0 -0
- package/dist/public/util.js +1 -1
- package/dist/public/util.js.br +0 -0
- package/dist/public/util.js.gz +0 -0
- package/dist/public/util.js.map +1 -1
- package/dist/public/v2-guest.html +1 -1
- package/dist/types/lib/guest.d.ts +17 -9
- package/dist/types/lib/index.d.ts +1 -1
- package/dist/types/lib/typings/window.d.ts +17 -0
- package/dist/types/lib/v1-adapter.d.ts +10 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/umd/businessObjects.js.gz +0 -0
- package/dist/umd/creditScoreService.js.gz +0 -0
- package/dist/umd/creditService.html +1 -1
- package/dist/umd/index.js +15 -15
- package/dist/umd/index.js.br +0 -0
- package/dist/umd/index.js.gz +0 -0
- package/dist/umd/index.js.map +1 -1
- package/dist/umd/loanValidation.html +1 -1
- package/dist/umd/loanValidation.js.gz +0 -0
- package/dist/umd/pricingService.html +1 -1
- package/dist/umd/pricingService.js.gz +0 -0
- package/dist/umd/titleService.html +1 -1
- package/dist/umd/titleService.js.gz +0 -0
- package/dist/umd/util.js +1 -1
- package/dist/umd/util.js.br +0 -0
- package/dist/umd/util.js.gz +0 -0
- package/dist/umd/util.js.map +1 -1
- package/dist/umd/v2-guest.html +1 -1
- package/package.json +5 -5
- package/dist/cjs/proxy.js +0 -42
- package/dist/cjs/types.js +0 -16
- package/dist/esm/proxy.js +0 -22
- package/dist/esm/types.js +0 -0
- package/dist/public/js/emuiSsfGuest.f2e6a00ee4685efdf26f.js +0 -29
- package/dist/public/js/emuiSsfGuest.f2e6a00ee4685efdf26f.js.br +0 -0
- package/dist/public/js/emuiSsfGuest.f2e6a00ee4685efdf26f.js.gz +0 -0
- package/dist/public/js/emuiSsfGuest.f2e6a00ee4685efdf26f.js.map +0 -1
- package/dist/types/lib/proxy.d.ts +0 -20
- package/dist/types/lib/types.d.ts +0 -6
package/dist/esm/guest.js
CHANGED
|
@@ -5,7 +5,8 @@ import {
|
|
|
5
5
|
sendMessage,
|
|
6
6
|
MessageType,
|
|
7
7
|
getEventId,
|
|
8
|
-
ProxyEvent
|
|
8
|
+
ProxyEvent,
|
|
9
|
+
ScriptingObjectProxy
|
|
9
10
|
} from "@elliemae/microfe-common";
|
|
10
11
|
import {
|
|
11
12
|
logger as puiLogger,
|
|
@@ -15,7 +16,6 @@ import {
|
|
|
15
16
|
webvitals,
|
|
16
17
|
logUnhandledErrors
|
|
17
18
|
} from "@elliemae/pui-diagnostics";
|
|
18
|
-
import { Proxy } from "./proxy.js";
|
|
19
19
|
import {
|
|
20
20
|
getOrigin,
|
|
21
21
|
isEmbedded,
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
getHostDetails,
|
|
24
24
|
getParentWindowLocation
|
|
25
25
|
} from "./utils.js";
|
|
26
|
+
import { setupV1Adapter, setScriptOnlyGuest } from "./v1-adapter.js";
|
|
26
27
|
var ResponseType = /* @__PURE__ */ ((ResponseType2) => {
|
|
27
28
|
ResponseType2["OBJECT"] = "object";
|
|
28
29
|
ResponseType2["VALUE"] = "value";
|
|
@@ -52,8 +53,21 @@ const onLoad = () => {
|
|
|
52
53
|
if (isEmbedded()) {
|
|
53
54
|
window.addEventListener("load", onLoad);
|
|
54
55
|
}
|
|
55
|
-
const
|
|
56
|
+
const diagnosticsEndpoint = {
|
|
57
|
+
"cdn.ice.com": "https://api.elliemae.com/diagnostics/v2/logging",
|
|
58
|
+
"cdn.np.ice.com": "https://stg.api.elliemae.com/diagnostics/v2/logging",
|
|
59
|
+
"cdn.uat.ice.com": "https://concept.api.elliemae.com/diagnostics/v2/logging",
|
|
60
|
+
"cdn.pt1.ice.com": "https://pel1.api.ellielabs.com/diagnostics/v2/logging",
|
|
61
|
+
"cdn.qa1.ice.com": "https://int.api.ellielabs.com/diagnostics/v2/logging",
|
|
62
|
+
"cdn.dev1.ice.com": "https://int.api.ellielabs.com/diagnostics/v2/logging",
|
|
63
|
+
localhost: "https://int.api.ellielabs.com/diagnostics/v2/logging"
|
|
64
|
+
};
|
|
56
65
|
const userInteractionEvents = ["click", "scroll", "keypress", "touchstart"];
|
|
66
|
+
const getDiagnosticsAPIUrl = () => {
|
|
67
|
+
const scriptUrl = document.currentScript?.src || import.meta.url;
|
|
68
|
+
const hostName = scriptUrl ? new URL(scriptUrl).hostname : "localhost";
|
|
69
|
+
return diagnosticsEndpoint[hostName] || diagnosticsEndpoint["cdn.qa1.ice.com"];
|
|
70
|
+
};
|
|
57
71
|
class SSFGuest {
|
|
58
72
|
/* eslint-enable indent */
|
|
59
73
|
#correlationId;
|
|
@@ -104,21 +118,22 @@ class SSFGuest {
|
|
|
104
118
|
* Create new guest
|
|
105
119
|
* @param {GuestOption} options - options for the guest
|
|
106
120
|
*/
|
|
121
|
+
// eslint-disable-next-line complexity
|
|
107
122
|
constructor(options) {
|
|
108
123
|
const {
|
|
109
124
|
console: logToConsole = false,
|
|
110
125
|
// eslint-disable-next-line no-underscore-dangle
|
|
111
|
-
url = window.__ICE__?.diagnosticsUrl ||
|
|
112
|
-
index,
|
|
113
|
-
team,
|
|
114
|
-
appName
|
|
126
|
+
url = window.__ICE__?.diagnosticsUrl || getDiagnosticsAPIUrl(),
|
|
127
|
+
index = "ssf-guest-v2",
|
|
128
|
+
team = "ICE",
|
|
129
|
+
appName = "SSF Guest V2 Application"
|
|
115
130
|
} = options?.logger ?? {};
|
|
116
131
|
this.#loggerOptions = options?.logger;
|
|
117
132
|
this.#usesDevConnectAPI = options?.usesDevConnectAPI ?? false;
|
|
118
133
|
this.#keepAlive = options?.keepAlive ?? true;
|
|
119
134
|
this.#keepAliveInterval = options?.keepAliveInterval ?? KEEP_ALIVE_INTERVAL;
|
|
120
135
|
const transport = logToConsole ? Console() : http(url);
|
|
121
|
-
this.#logger = puiLogger({
|
|
136
|
+
this.#logger = options?.appLogger ?? puiLogger({
|
|
122
137
|
transport,
|
|
123
138
|
index,
|
|
124
139
|
team,
|
|
@@ -128,6 +143,7 @@ class SSFGuest {
|
|
|
128
143
|
logUnhandledErrors(this.#logger);
|
|
129
144
|
this.#correlationId = uuidv4();
|
|
130
145
|
this.#remoting = new Remoting(this.#logger, this.#correlationId);
|
|
146
|
+
setupV1Adapter(this);
|
|
131
147
|
this.#logger.audit({
|
|
132
148
|
message: "Guest created",
|
|
133
149
|
guestUrl: window.location.href,
|
|
@@ -151,7 +167,7 @@ class SSFGuest {
|
|
|
151
167
|
);
|
|
152
168
|
throw new Error("Cannot deserialize object JSON into proxy.");
|
|
153
169
|
}
|
|
154
|
-
const ctrl = new
|
|
170
|
+
const ctrl = new ScriptingObjectProxy(soJSON.objectId, soJSON.objectType);
|
|
155
171
|
if (soJSON.functions) {
|
|
156
172
|
soJSON.functions.forEach((functionName) => {
|
|
157
173
|
Object.defineProperty(ctrl, functionName, {
|
|
@@ -169,7 +185,8 @@ class SSFGuest {
|
|
|
169
185
|
Object.defineProperty(ctrl, eventName, {
|
|
170
186
|
value: new ProxyEvent({
|
|
171
187
|
objectId: ctrl.id,
|
|
172
|
-
name: eventName
|
|
188
|
+
name: eventName,
|
|
189
|
+
eventSrc: this
|
|
173
190
|
}),
|
|
174
191
|
enumerable: true
|
|
175
192
|
});
|
|
@@ -448,19 +465,27 @@ class SSFGuest {
|
|
|
448
465
|
*/
|
|
449
466
|
#useParentApplicationLogger = async () => {
|
|
450
467
|
try {
|
|
451
|
-
const
|
|
452
|
-
if (
|
|
453
|
-
const {
|
|
468
|
+
const moduleObj = await this.getObject("module");
|
|
469
|
+
if (moduleObj?.log && !this.#loggerOptions.console) {
|
|
470
|
+
const {
|
|
471
|
+
index = "",
|
|
472
|
+
team = "",
|
|
473
|
+
appName = ""
|
|
474
|
+
} = this.#loggerOptions || {};
|
|
475
|
+
if (!index || !team || !appName)
|
|
476
|
+
throw new Error(
|
|
477
|
+
"Missing one of required logger options: index, team, appName"
|
|
478
|
+
);
|
|
454
479
|
this.#logger = puiLogger({
|
|
455
|
-
transport: parentApp(
|
|
480
|
+
transport: parentApp(moduleObj),
|
|
456
481
|
index,
|
|
457
482
|
team,
|
|
458
483
|
appName
|
|
459
484
|
});
|
|
460
485
|
}
|
|
461
486
|
} catch (e) {
|
|
462
|
-
this.#logger.
|
|
463
|
-
`
|
|
487
|
+
this.#logger.info(
|
|
488
|
+
`Module object not exposed from hosting application. using local logger instance. ${e.message}`
|
|
464
489
|
);
|
|
465
490
|
}
|
|
466
491
|
};
|
|
@@ -474,10 +499,12 @@ class SSFGuest {
|
|
|
474
499
|
await this.connect();
|
|
475
500
|
const scriptEle = document.createElement("script");
|
|
476
501
|
scriptEle.setAttribute("src", scriptUri);
|
|
502
|
+
scriptEle.setAttribute("type", "module");
|
|
477
503
|
await new Promise((resolve) => {
|
|
478
504
|
const onScriptLoad = () => {
|
|
479
505
|
scriptEle?.removeEventListener?.("load", onScriptLoad);
|
|
480
506
|
this.#created = true;
|
|
507
|
+
setScriptOnlyGuest(true);
|
|
481
508
|
resolve();
|
|
482
509
|
};
|
|
483
510
|
scriptEle.addEventListener("load", onScriptLoad);
|
|
@@ -568,7 +595,6 @@ class SSFGuest {
|
|
|
568
595
|
this.#handleParentClose();
|
|
569
596
|
if (this.#usesDevConnectAPI) await this.getAuthToken();
|
|
570
597
|
await this.#startKeepSessionAlive();
|
|
571
|
-
await this.#useParentApplicationLogger();
|
|
572
598
|
window.addEventListener("beforeunload", this.close);
|
|
573
599
|
this.#logger.audit({
|
|
574
600
|
message: "Guest connected to host",
|
|
@@ -611,6 +637,7 @@ class SSFGuest {
|
|
|
611
637
|
this.#logger.debug(
|
|
612
638
|
`Retrieving scripting object "${objectId}" from host...`
|
|
613
639
|
);
|
|
640
|
+
if (!this.#isConnected) throw new Error("Not connected to host");
|
|
614
641
|
const response = await this.#remoting.invoke({
|
|
615
642
|
targetWin: this.#hostWindow,
|
|
616
643
|
targetOrigin: this.#hostOrigin,
|
|
@@ -627,6 +654,28 @@ class SSFGuest {
|
|
|
627
654
|
});
|
|
628
655
|
return obj;
|
|
629
656
|
};
|
|
657
|
+
/**
|
|
658
|
+
* Get names of scripting objects exposed by the host
|
|
659
|
+
* @returns scripting objects exposed by the host
|
|
660
|
+
*/
|
|
661
|
+
listObjects = async () => {
|
|
662
|
+
this.#logger.debug(
|
|
663
|
+
`Retrieving names of scripting objects exposed by host...`
|
|
664
|
+
);
|
|
665
|
+
if (!this.#isConnected) throw new Error("Not connected to host");
|
|
666
|
+
const objects = await this.#remoting.invoke({
|
|
667
|
+
targetWin: this.#hostWindow,
|
|
668
|
+
targetOrigin: this.#hostOrigin,
|
|
669
|
+
messageType: MessageType.ListObjects,
|
|
670
|
+
messageBody: {}
|
|
671
|
+
});
|
|
672
|
+
this.#logger.audit({
|
|
673
|
+
message: "Received names of all scripting objects exposed by host",
|
|
674
|
+
objects,
|
|
675
|
+
...this.#getGuestInfo()
|
|
676
|
+
});
|
|
677
|
+
return objects;
|
|
678
|
+
};
|
|
630
679
|
/**
|
|
631
680
|
* remove the guest from the host
|
|
632
681
|
*/
|
|
@@ -648,30 +697,30 @@ class SSFGuest {
|
|
|
648
697
|
};
|
|
649
698
|
/**
|
|
650
699
|
* subscribe to an scripting object event
|
|
651
|
-
* @param {
|
|
700
|
+
* @param {SubscribeParam<EventId, AppEvents[EventId]>} param - parameters for subscribing to an event
|
|
652
701
|
* @returns subscription token
|
|
653
702
|
*/
|
|
654
703
|
subscribe = (param) => {
|
|
655
704
|
const { eventId, callback } = param;
|
|
656
705
|
this.#logger.debug(`Registering subscription for event ${eventId}`);
|
|
657
|
-
const listeners = this.#eventListeners.get(eventId) || [];
|
|
706
|
+
const listeners = this.#eventListeners.get(eventId.toLowerCase()) || [];
|
|
658
707
|
const token = uuidv4();
|
|
659
708
|
listeners.push({ callback, token });
|
|
660
|
-
this.#eventListeners.set(eventId, listeners);
|
|
709
|
+
this.#eventListeners.set(eventId.toLowerCase(), listeners);
|
|
661
710
|
return token;
|
|
662
711
|
};
|
|
663
712
|
/**
|
|
664
713
|
* unsubscribe from an scripting object event
|
|
665
|
-
* @param {
|
|
714
|
+
* @param {UnsubscribeParam<EventId>} param - parameters for unsubscribing from an event
|
|
666
715
|
*/
|
|
667
716
|
unsubscribe = (param) => {
|
|
668
717
|
const { eventId, token } = param;
|
|
669
|
-
let listeners = this.#eventListeners.get(eventId);
|
|
718
|
+
let listeners = this.#eventListeners.get(eventId.toLowerCase());
|
|
670
719
|
if (listeners) {
|
|
671
720
|
listeners = listeners.filter(
|
|
672
721
|
(callbackInfo) => callbackInfo.token !== token
|
|
673
722
|
);
|
|
674
|
-
this.#eventListeners.set(eventId, listeners);
|
|
723
|
+
this.#eventListeners.set(eventId.toLowerCase(), listeners);
|
|
675
724
|
}
|
|
676
725
|
};
|
|
677
726
|
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
margin: 0px;
|
|
11
11
|
}
|
|
12
12
|
</style>
|
|
13
|
-
<script src="https://
|
|
13
|
+
<script src="https://cdn.qa1.ice.com/pui-diagnostics@3"></script>
|
|
14
14
|
</head>
|
|
15
15
|
<body class="px-2">
|
|
16
16
|
<script src="./loanValidation.js" type="module"></script>
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>Pricing Service</title>
|
|
8
8
|
<script src="https://cdn.tailwindcss.com?plugins=forms"></script>
|
|
9
|
-
<script src="https://
|
|
9
|
+
<script src="https://cdn.qa1.ice.com/pui-diagnostics@3"></script>
|
|
10
10
|
</head>
|
|
11
11
|
<body class="px-2">
|
|
12
12
|
<main>
|
package/dist/esm/tests/utils.js
CHANGED
|
@@ -130,9 +130,19 @@ const applicationScriptingObject = {
|
|
|
130
130
|
},
|
|
131
131
|
type: "object"
|
|
132
132
|
};
|
|
133
|
+
const moduleScriptingObject = {
|
|
134
|
+
object: {
|
|
135
|
+
events: [],
|
|
136
|
+
functions: ["getParameters", "getCapabilities", "log", "unload"],
|
|
137
|
+
objectId: "module",
|
|
138
|
+
objectType: "Object"
|
|
139
|
+
},
|
|
140
|
+
type: "object"
|
|
141
|
+
};
|
|
133
142
|
const hostObjects = {
|
|
134
143
|
application: applicationScriptingObject,
|
|
135
|
-
auth: authScriptingObject
|
|
144
|
+
auth: authScriptingObject,
|
|
145
|
+
module: moduleScriptingObject
|
|
136
146
|
};
|
|
137
147
|
const setupHost = (hostWindow) => {
|
|
138
148
|
const onMessage = ({ data }) => {
|
|
@@ -1,31 +1,30 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>Title Service</title>
|
|
8
|
+
<style>
|
|
9
|
+
body {
|
|
10
|
+
margin: 0px;
|
|
11
|
+
}
|
|
12
|
+
</style>
|
|
13
|
+
<script src="https://cdn.tailwindcss.com?plugins=forms"></script>
|
|
14
|
+
<script src="https://cdn.qa1.ice.com/pui-diagnostics@3"></script>
|
|
15
|
+
</head>
|
|
3
16
|
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
</
|
|
17
|
-
|
|
18
|
-
<body class="px-2">
|
|
19
|
-
<h3 class="text-lg font-medium leading-6 text-gray-900">
|
|
20
|
-
Title
|
|
21
|
-
</h3>
|
|
22
|
-
<div class="mt-5 flex flex-col">
|
|
23
|
-
<button id="order" type="button"
|
|
24
|
-
class="rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2">
|
|
25
|
-
Order
|
|
26
|
-
</button>
|
|
27
|
-
</div>
|
|
28
|
-
<script src="./titleService.js" type="module"></script>
|
|
29
|
-
</body>
|
|
30
|
-
|
|
31
|
-
</html>
|
|
17
|
+
<body class="px-2">
|
|
18
|
+
<h3 class="text-lg font-medium leading-6 text-gray-900">Title</h3>
|
|
19
|
+
<div class="mt-5 flex flex-col">
|
|
20
|
+
<button
|
|
21
|
+
id="order"
|
|
22
|
+
type="button"
|
|
23
|
+
class="rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2"
|
|
24
|
+
>
|
|
25
|
+
Order
|
|
26
|
+
</button>
|
|
27
|
+
</div>
|
|
28
|
+
<script src="./titleService.js" type="module"></script>
|
|
29
|
+
</body>
|
|
30
|
+
</html>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
let scriptOnlyGuest = false;
|
|
2
|
+
const setScriptOnlyGuest = (value) => {
|
|
3
|
+
scriptOnlyGuest = value;
|
|
4
|
+
};
|
|
5
|
+
const setupV1Adapter = (guestV2 = null) => {
|
|
6
|
+
let guest = guestV2;
|
|
7
|
+
const getGuest = () => {
|
|
8
|
+
if (!guest) {
|
|
9
|
+
guest = window.ice?.guest?.SSFGuest ? new window.ice.guest.SSFGuest() : null;
|
|
10
|
+
if (!guest) {
|
|
11
|
+
throw new Error("Guest definition not found");
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return guest;
|
|
15
|
+
};
|
|
16
|
+
window.elli = window.elli ?? {};
|
|
17
|
+
window.elli.script = {
|
|
18
|
+
guest: {
|
|
19
|
+
create: async (scriptUri, element) => getGuest().addScript(scriptUri, element)
|
|
20
|
+
},
|
|
21
|
+
connect: async (params) => {
|
|
22
|
+
console.warn(
|
|
23
|
+
"elli.script.connect is deprecated. Please use connect method of SSFGuest class instead, const guest = new ice.guest.SSFGuest(); await guest.connect(params);"
|
|
24
|
+
);
|
|
25
|
+
return getGuest().connect(params);
|
|
26
|
+
},
|
|
27
|
+
getObject: async (objectName) => {
|
|
28
|
+
if (!scriptOnlyGuest)
|
|
29
|
+
console.warn(
|
|
30
|
+
"elli.script.getObject is deprecated. Please use getObject method of SSFGuest class instead, const guest = new ice.guest.SSFGuest(); await guest.getObject(objectName);"
|
|
31
|
+
);
|
|
32
|
+
return getGuest().getObject(objectName);
|
|
33
|
+
},
|
|
34
|
+
setLogLevel: (level) => {
|
|
35
|
+
if (!scriptOnlyGuest)
|
|
36
|
+
console.warn(
|
|
37
|
+
"elli.script.setLogLevel is deprecated. Please use setLogLevel method of SSFGuest class instead, const guest = new ice.guest.SSFGuest(); guest.setLogLevel(level);"
|
|
38
|
+
);
|
|
39
|
+
return getGuest().setLogLevel(level);
|
|
40
|
+
},
|
|
41
|
+
subscribe: (objectId, eventName, callback) => {
|
|
42
|
+
if (!scriptOnlyGuest)
|
|
43
|
+
console.warn(
|
|
44
|
+
// eslint-disable-next-line no-template-curly-in-string
|
|
45
|
+
"elli.script.subscribe is deprecated. Please use subscribe method of SSFGuest class instead, const guest = new ice.guest.SSFGuest(); guest.subscribe({ eventId: `${objectId}.${eventName}`, callback: (event) => { console.log(event); });"
|
|
46
|
+
);
|
|
47
|
+
return getGuest().subscribe({
|
|
48
|
+
eventId: `${objectId}.${eventName}`,
|
|
49
|
+
// eslint-disable-line @typescript-eslint/no-unsafe-assignment
|
|
50
|
+
callback: (event) => callback(event?.obj, event?.eventParams, event?.eventOptions)
|
|
51
|
+
// eslint-disable-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
unsubscribe: (objectId, eventName, token) => {
|
|
55
|
+
if (!scriptOnlyGuest)
|
|
56
|
+
console.warn(
|
|
57
|
+
// eslint-disable-next-line no-template-curly-in-string
|
|
58
|
+
"elli.script.unsubscribe is deprecated. Please use unsubscribe method of SSFGuest class instead, const guest = new ice.guest.SSFGuest(); guest.unsubscribe({ eventId: `${objectId}.${eventName}`, token });"
|
|
59
|
+
);
|
|
60
|
+
return getGuest().unsubscribe({
|
|
61
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
62
|
+
eventId: `${objectId}.${eventName}`,
|
|
63
|
+
token
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
setupV1Adapter();
|
|
69
|
+
export {
|
|
70
|
+
setScriptOnlyGuest,
|
|
71
|
+
setupV1Adapter
|
|
72
|
+
};
|
package/dist/esm/v2-guest.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Guest V2</title>
|
|
7
|
-
<script src="https://
|
|
7
|
+
<script src="https://cdn.qa1.ice.com/pui-diagnostics@3"></script>
|
|
8
8
|
</head>
|
|
9
9
|
<body>
|
|
10
10
|
<h2>Guest V2</h2>
|
|
@@ -13,10 +13,6 @@
|
|
|
13
13
|
<p id="loan-pre-save-event-details"></p>
|
|
14
14
|
</div>
|
|
15
15
|
<script type="module">
|
|
16
|
-
window.__ICE__ = {
|
|
17
|
-
diagnosticsUrl: 'https://int.api.ellielabs.com/diagnostics/v2/logging',
|
|
18
|
-
};
|
|
19
|
-
|
|
20
16
|
window.addEventListener('load', async () => {
|
|
21
17
|
const guestV2 = new ice.guest.SSFGuest({
|
|
22
18
|
logger: {
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Credit Service</title><style>body{margin:0}</style><script src="https://
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Credit Service</title><style>body{margin:0}</style><script src="https://cdn.qa1.ice.com/pui-diagnostics@3"></script><script>window.addEventListener("DOMContentLoaded",(async()=>{window.__ICE__={diagnosticsUrl:"https://int.api.ellielabs.com/diagnostics/v2/logging"};const e=new URL(window.location),i=e?.searchParams?.get?.("src");window.__ICE__.ssfGuest=new ice.guest.SSFGuest({logger:{index:"creditServiceGuest",team:"ui platform",appName:"credit-service"}}),await window.__ICE__.ssfGuest.addScript(i,document.body)}))</script><script defer="defer" src="js/emuiSsfGuest.a6277961cb41c8cde6b0.js"></script></head><body></body></html>
|
package/dist/public/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en" style="height:100%"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Plugin</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script defer="defer" src="js/emuiSsfGuest.
|
|
1
|
+
<!doctype html><html lang="en" style="height:100%"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Plugin</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script defer="defer" src="js/emuiSsfGuest.a6277961cb41c8cde6b0.js"></script></head><body class="px-2 h-full"><main class="h-full"><h1 class="text-md font-bold">Credit Score Service</h1><div class="h-full mt-2"><output id="msg" class="mt-2 p-2"></output></div></main></body></html>
|