@elliemae/ssf-host 2.28.7-alpha.0 → 2.29.0-alpha.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/guest.js +5 -5
- package/dist/cjs/host.js +180 -151
- package/dist/cjs/tests/utils.js +8 -0
- package/dist/cjs/utils.js +1 -1
- package/dist/esm/guest.js +5 -5
- package/dist/esm/host.js +180 -151
- package/dist/esm/tests/utils.js +8 -0
- package/dist/esm/utils.js +1 -1
- package/dist/public/callchain-host.html +1 -1
- package/dist/public/callchain-intermediate.html +1 -1
- package/dist/public/e2e-host.html +1 -1
- package/dist/public/e2e-index.html +1 -1
- package/dist/public/index.html +1 -1
- package/dist/public/js/emuiSsfHost.4b00d8e6203361c7da33.js +3 -0
- package/dist/public/js/emuiSsfHost.4b00d8e6203361c7da33.js.br +0 -0
- package/dist/public/js/emuiSsfHost.4b00d8e6203361c7da33.js.gz +0 -0
- package/dist/public/js/emuiSsfHost.4b00d8e6203361c7da33.js.map +1 -0
- package/dist/public/popup-focus-host.html +1 -1
- package/dist/public/utils.js +1 -1
- package/dist/public/utils.js.br +0 -0
- package/dist/public/utils.js.gz +0 -0
- package/dist/public/utils.js.map +1 -1
- package/dist/public/v1-guest-v2-host.html +1 -1
- package/dist/public/v2-host-v1-guest.html +1 -1
- package/dist/types/lib/guest.d.ts +2 -2
- package/dist/types/lib/host.d.ts +4 -4
- package/dist/types/lib/ihost.d.ts +3 -3
- package/dist/types/lib/tests/scriptingObjects/analytics.d.ts +1 -1
- package/dist/types/lib/tests/scriptingObjects/appEvents.d.ts +2 -2
- package/dist/types/lib/tests/scriptingObjects/appObjects.d.ts +3 -3
- package/dist/types/lib/tests/scriptingObjects/appraisalServiceModule.d.ts +1 -1
- package/dist/types/lib/tests/scriptingObjects/creditServiceModule.d.ts +1 -1
- package/dist/types/lib/tests/server.d.ts +1 -1
- package/dist/types/lib/tests/utils.d.ts +21 -3
- package/dist/types/lib/utils.d.ts +2 -2
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/umd/index.js +1 -1
- 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/utils.js +1 -1
- package/dist/umd/utils.js.br +0 -0
- package/dist/umd/utils.js.gz +0 -0
- package/dist/umd/utils.js.map +1 -1
- package/package.json +8 -8
- package/dist/public/js/emuiSsfHost.13ebecc9684f2da752d9.js +0 -3
- package/dist/public/js/emuiSsfHost.13ebecc9684f2da752d9.js.br +0 -0
- package/dist/public/js/emuiSsfHost.13ebecc9684f2da752d9.js.gz +0 -0
- package/dist/public/js/emuiSsfHost.13ebecc9684f2da752d9.js.map +0 -1
package/dist/public/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://ice.host/utils.js"],"sourcesContent":["let appConfig = null;\nlet host = null;\n\nconst monitorPerformance = () => {\n try {\n const po = new PerformanceObserver((list) => {\n // eslint-disable-next-line no-restricted-syntax\n for (const entry of list.getEntries()) {\n switch (entry.entryType) {\n case 'measure': {\n const detail = entry.detail ?? {};\n const data = {\n name: entry.name,\n duration: entry.duration,\n startTime: new Date(\n performance.timeOrigin + entry.startTime,\n ).toISOString(),\n ...detail,\n };\n console.log('timing', data);\n break;\n }\n default:\n break;\n }\n }\n });\n po.observe({ type: 'measure', buffered: true });\n } catch (e) {}\n};\n\nconst createLogger = () => {\n const { logger, http, webvitals, logUnhandledErrors, Console } =\n window.emuiDiagnostics || {};\n if (logger) {\n window.logger = logger({\n transport: http('https://int.api.ellielabs.com/diagnostics/v2/logging'),\n // transport: Console(),\n index: 'ssfhost',\n team: 'ui platform',\n appName: 'SSF Host Demo',\n });\n\n webvitals(window.logger);\n logUnhandledErrors(window.logger);\n window.logger.info('SSF Host launched');\n } else console.warn('ui logger missing'); // eslint-disable-line no-console\n};\n\nexport const getHost = (analyticsObj) => {\n if (host) return host;\n createLogger();\n monitorPerformance();\n const hostOptions = {\n logger: window.logger,\n readyStateCallback: (guest) => {},\n analyticsObj,\n measurePerformance: true,\n onGuestEventSubscribe: (options) => {\n console.log('Guest Event Subscribe:', options);\n },\n onGuestEventUnSubscribe: (options) => {\n console.log('Guest Event UnSubscribe:', options);\n },\n };\n host = ice?.host?.SSFHost\n ? new ice.host.SSFHost('IMTProduct', hostOptions)\n : null;\n // debug loglevel\n // host.setLogLevel(10);\n return host;\n};\n\nexport const getGuestBaseUrl = async () => {\n if (!appConfig) {\n const response = await fetch('./app.config.json');\n appConfig = await response.json();\n }\n const activeEnvConfig = {\n ...appConfig?.options,\n ...appConfig[appConfig.activeEnv]?.options,\n };\n return activeEnvConfig?.guestUrl;\n};\n"],"mappings":"AAAA,IAAIA,EAAY,KACZC,EAAO,KAEX,MAAMC,EAAqB,IAAM,CAC/B,GAAI,CACS,IAAI,oBAAqBC,GAAS,CAE3C,UAAWC,KAASD,EAAK,WAAW,EAClC,
|
|
1
|
+
{"version":3,"sources":["webpack://ice.host/utils.js"],"sourcesContent":["let appConfig = null;\nlet host = null;\n\nconst monitorPerformance = () => {\n try {\n const po = new PerformanceObserver((list) => {\n // eslint-disable-next-line no-restricted-syntax\n for (const entry of list.getEntries()) {\n switch (entry.entryType) {\n case 'measure': {\n const detail = entry.detail ?? {};\n const data = {\n name: entry.name,\n duration: entry.duration,\n startTime: new Date(\n performance.timeOrigin + entry.startTime,\n ).toISOString(),\n ...detail,\n };\n console.log('timing', data);\n break;\n }\n default:\n break;\n }\n }\n });\n po.observe({ type: 'measure', buffered: true });\n } catch (e) {}\n};\n\nconst createLogger = () => {\n const { logger, http, webvitals, logUnhandledErrors, Console } =\n window.emuiDiagnostics || {};\n if (logger) {\n window.logger = logger({\n transport: http('https://int.api.ellielabs.com/diagnostics/v2/logging'),\n // transport: Console(),\n index: 'ssfhost',\n team: 'ui platform',\n appName: 'SSF Host Demo',\n });\n\n webvitals(window.logger);\n logUnhandledErrors(window.logger);\n window.logger.info('SSF Host launched');\n } else console.warn('ui logger missing'); // eslint-disable-line no-console\n};\n\nexport const getHost = (analyticsObj) => {\n if (host) return host;\n createLogger();\n monitorPerformance();\n const hostOptions = {\n logger: window.logger,\n readyStateCallback: (guest) => {},\n analyticsObj,\n measurePerformance: true,\n onGuestEventSubscribe: (options) => {\n console.log('Guest Event Subscribe:', options);\n },\n onGuestEventUnSubscribe: (options) => {\n console.log('Guest Event UnSubscribe:', options);\n },\n };\n host = ice?.host?.SSFHost\n ? new ice.host.SSFHost('IMTProduct', hostOptions)\n : null;\n // debug loglevel\n // host.setLogLevel(10);\n return host;\n};\n\nexport const getGuestBaseUrl = async () => {\n if (!appConfig) {\n const response = await fetch('./app.config.json');\n appConfig = await response.json();\n }\n const activeEnvConfig = {\n ...appConfig?.options,\n ...appConfig[appConfig.activeEnv]?.options,\n };\n return activeEnvConfig?.guestUrl;\n};\n"],"mappings":"AAAA,IAAIA,EAAY,KACZC,EAAO,KAEX,MAAMC,EAAqB,IAAM,CAC/B,GAAI,CACS,IAAI,oBAAqBC,GAAS,CAE3C,UAAWC,KAASD,EAAK,WAAW,EAClC,GAAQC,EAAM,YACP,UAAW,CACd,MAAMC,EAASD,EAAM,QAAU,CAAC,EAC1BE,EAAO,CACX,KAAMF,EAAM,KACZ,SAAUA,EAAM,SAChB,UAAW,IAAI,KACb,YAAY,WAAaA,EAAM,SACjC,EAAE,YAAY,EACd,GAAGC,CACL,CAGF,CAKN,CAAC,EACE,QAAQ,CAAE,KAAM,UAAW,SAAU,EAAK,CAAC,CAChD,MAAY,CAAC,CACf,EAEME,EAAe,IAAM,CACzB,KAAM,CAAE,OAAAC,EAAQ,KAAAC,EAAM,UAAAC,EAAW,mBAAAC,EAAoB,QAAAC,CAAQ,EAC3D,OAAO,iBAAmB,CAAC,EACzBJ,IACF,OAAO,OAASA,EAAO,CACrB,UAAWC,EAAK,sDAAsD,EAEtE,MAAO,UACP,KAAM,cACN,QAAS,eACX,CAAC,EAEDC,EAAU,OAAO,MAAM,EACvBC,EAAmB,OAAO,MAAM,EAChC,OAAO,OAAO,KAAK,mBAAmB,EAE1C,EAEO,aAAM,QAAWE,GAAiB,CACvC,GAAIZ,EAAM,OAAOA,EACjBM,EAAa,EACbL,EAAmB,EACnB,MAAMY,EAAc,CAClB,OAAQ,OAAO,OACf,mBAAqBC,GAAU,CAAC,EAChC,aAAAF,EACA,mBAAoB,GACpB,sBAAwBG,GAAY,CAEpC,EACA,wBAA0BA,GAAY,CAEtC,CACF,EACA,OAAAf,EAAO,KAAK,MAAM,QACd,IAAI,IAAI,KAAK,QAAQ,aAAca,CAAW,EAC9C,KAGGb,CACT,EAEa,gBAAkB,UACxBD,IAEHA,EAAY,MADK,MAAM,MAAM,mBAAmB,GACrB,KAAK,GAEV,CACtB,GAAGA,GAAW,QACd,GAAGA,EAAUA,EAAU,SAAS,GAAG,OACrC,GACwB","names":["appConfig","host","monitorPerformance","list","entry","detail","data","createLogger","logger","http","webvitals","logUnhandledErrors","Console","analyticsObj","hostOptions","guest","options"],"sourceRoot":"","file":"utils.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Guest V1 -> V2 Host</title><style>body,html,main{height:100%;margin:2px;padding:0}iframe{width:100%;height:100%;border:none}#guest-container{height:100%}</style><script src="https://cdn.mortgagetech.q1.ice.com/pui-diagnostics@3"></script><script src="https://cdn.elliemae.io/elliemae/core/ssf/1.0/elli.ssf.guest.js"></script><script defer="defer" src="js/emuiSsfHost.
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Guest V1 -> V2 Host</title><style>body,html,main{height:100%;margin:2px;padding:0}iframe{width:100%;height:100%;border:none}#guest-container{height:100%}</style><script src="https://cdn.mortgagetech.q1.ice.com/pui-diagnostics@3"></script><script src="https://cdn.elliemae.io/elliemae/core/ssf/1.0/elli.ssf.guest.js"></script><script defer="defer" src="js/emuiSsfHost.4b00d8e6203361c7da33.js"></script></head><body><h2>Guest V1 nesting Host V2</h2><div id="result"><p id="loan-details"></p><p id="loan-pre-save-event-details"></p></div><div id="guest-container"></div><script type="module">import{getGuestBaseUrl,getHost}from"./utils.js";import{Analytics}from"./analytics-object-v2.js";const analyticsObj=new Analytics,hostV2=getHost(analyticsObj),loadV2Guest=async()=>{const t=await getGuestBaseUrl(),{id:e}=hostV2.loadGuest({id:"guestV2",url:new URL("./v2-guest.html",t).href,title:"Guest V2",targetElement:document.getElementById("guest-container")})};window.addEventListener("load",async()=>{await elli.script.connect();const t=await elli.script.getObject("Application"),e=await elli.script.getObject("Loan"),a=await e.getLoanDetails();document.getElementById("loan-details").innerText=`Loan Data: ${JSON.stringify(a)}`,elli.script.subscribe("loan","onPreSave",(t,e)=>(document.getElementById("loan-pre-save-event-details").innerText=`Presave event data: ${JSON.stringify(e)}`,!1)),hostV2.addScriptingObject(hostV2.cloneScriptingObject(t,{})),hostV2.addScriptingObject(hostV2.cloneScriptingObject(e,{})),await loadV2Guest()})</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Host V2 -> V1 Guest</title><style>body,html,main{height:100%;margin:4px;padding:0}iframe{width:100%;height:100%;border:none}#guest-container{height:100%}</style><script src="https://cdn.mortgagetech.q1.ice.com/pui-diagnostics@3"></script><script defer="defer" src="js/emuiSsfHost.
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Host V2 -> V1 Guest</title><style>body,html,main{height:100%;margin:4px;padding:0}iframe{width:100%;height:100%;border:none}#guest-container{height:100%}</style><script src="https://cdn.mortgagetech.q1.ice.com/pui-diagnostics@3"></script><script defer="defer" src="js/emuiSsfHost.4b00d8e6203361c7da33.js"></script></head><body><main><h1>Host V2 nesting V1 Guest</h1><button id="save-btn" type="button" onclick="saveLoan()">Save Loan</button><div id="results"><p id="pre-save-feedback-result"></p></div><div id="guest-container"></div></main><script type="module">import{Loan}from"./loan-object.js";import{Application}from"./application-object-v2.js";import{getGuestBaseUrl,getHost}from"./utils.js";import{Analytics}from"./analytics-object-v2.js";const analyticsObj=new Analytics,hostV2=getHost(analyticsObj),loanObj=new Loan,appObj=new Application;hostV2.addScriptingObject(loanObj),hostV2.addScriptingObject(appObj);const params=new URLSearchParams(document.location.search),{id:id}=hostV2.loadGuest({id:"guestV1",url:new URL("true"!==params.get("nestV1GuestV2Host")?"./v1-guest.html":"./v1-guest-v2-host.html",window.location.href).href,searchParams:{nestHostV1:!0},title:"Guest V1",targetElement:document.getElementById("guest-container")});window.saveLoan=async()=>{const e=loanObj.getLoanDetails();(await hostV2.dispatchEvent({event:loanObj.onPreSave,eventParams:e,eventOptions:{timeout:1e3}})).some(e=>!1===e)?document.getElementById("pre-save-feedback-result").innerText="Pre save failed":document.getElementById("pre-save-feedback-result").innerText="Pre save succeeded"}</script></body></html>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Remoting } from '@elliemae/microfe-common';
|
|
2
|
-
import { EventObject, OpenMode } from './types.js';
|
|
1
|
+
import { type Remoting } from '@elliemae/microfe-common';
|
|
2
|
+
import { type EventObject, OpenMode } from './types.js';
|
|
3
3
|
import type { PerformanceTracker } from './performanceTracker.js';
|
|
4
4
|
/**
|
|
5
5
|
* options for creating a guest application
|
package/dist/types/lib/host.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { IScriptingObjectProxy, ScriptingObjectTypes, Events } from '@elliemae/pui-scripting-object';
|
|
2
|
-
import type
|
|
3
|
-
import { LogLevels } from '@elliemae/pui-diagnostics';
|
|
4
|
-
import { IFrameSandboxValues, ValueOf, ScriptingObjects } from './types.js';
|
|
5
|
-
import { ISSFHost, HostOption, LoadGuestParam, LoadGuestsParam, GuestCloseParam } from './ihost.js';
|
|
2
|
+
import { type EventListeners, type AddScriptingObjectParams, type GetObjectParams, type DispatchEventParam, type EventOptions } from '@elliemae/microfe-common';
|
|
3
|
+
import type { LogLevels } from '@elliemae/pui-diagnostics';
|
|
4
|
+
import { IFrameSandboxValues, type ValueOf, type ScriptingObjects } from './types.js';
|
|
5
|
+
import type { ISSFHost, HostOption, LoadGuestParam, LoadGuestsParam, GuestCloseParam } from './ihost.js';
|
|
6
6
|
import { Guest } from './guest.js';
|
|
7
7
|
export declare const SANDBOX_DEFAULT: IFrameSandboxValues[];
|
|
8
8
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { IScriptingObjectProxy, ScriptingObjectTypes, Events, IAnalytics } from '@elliemae/pui-scripting-object';
|
|
2
2
|
import type { ISSFGuest, EventListeners, AddScriptingObjectParams, GetObjectParams, EventOptions, DispatchEventParam, FilterCriteria } from '@elliemae/microfe-common';
|
|
3
|
-
import { Logger, LogLevels } from '@elliemae/pui-diagnostics';
|
|
4
|
-
import { GuestOptions, ValueOf, ScriptingObjects } from './types.js';
|
|
5
|
-
import { Guest } from './guest.js';
|
|
3
|
+
import type { Logger, LogLevels } from '@elliemae/pui-diagnostics';
|
|
4
|
+
import type { GuestOptions, ValueOf, ScriptingObjects } from './types.js';
|
|
5
|
+
import type { Guest } from './guest.js';
|
|
6
6
|
export type GuestEventSubscribeParam<EventId = string> = {
|
|
7
7
|
/**
|
|
8
8
|
* unique id of the guest application
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IAnalytics, BAEvent, TimingOptions, PerfMark } from '@elliemae/pui-scripting-object';
|
|
1
|
+
import type { IAnalytics, BAEvent, TimingOptions, PerfMark } from '@elliemae/pui-scripting-object';
|
|
2
2
|
import { ScriptingObject } from '@elliemae/microfe-common';
|
|
3
3
|
export declare class Analytics extends ScriptingObject implements IAnalytics {
|
|
4
4
|
constructor();
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Events } from '@elliemae/pui-scripting-object';
|
|
2
|
-
import { AppraisalServiceEvents } from './appraisalServiceModule.js';
|
|
1
|
+
import type { Events } from '@elliemae/pui-scripting-object';
|
|
2
|
+
import type { AppraisalServiceEvents } from './appraisalServiceModule.js';
|
|
3
3
|
export type AppEvents = AppraisalServiceEvents & Events;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ScriptingObjectTypes } from '@elliemae/pui-scripting-object';
|
|
2
|
-
import { AppraisalService } from './appraisalServiceModule.js';
|
|
3
|
-
import { FloodService } from './floodServiceModule.js';
|
|
1
|
+
import type { ScriptingObjectTypes } from '@elliemae/pui-scripting-object';
|
|
2
|
+
import type { AppraisalService } from './appraisalServiceModule.js';
|
|
3
|
+
import type { FloodService } from './floodServiceModule.js';
|
|
4
4
|
export type AppObjects = {
|
|
5
5
|
AppraisalService: AppraisalService;
|
|
6
6
|
FloodService: FloodService;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IModule, Listener, Events, LogLevels, LogMessage } from '@elliemae/pui-scripting-object';
|
|
1
|
+
import type { IModule, Listener, Events, LogLevels, LogMessage } from '@elliemae/pui-scripting-object';
|
|
2
2
|
import { ScriptingObject, Event } from '@elliemae/microfe-common';
|
|
3
3
|
import { CreditService } from './creditServiceModule.js';
|
|
4
4
|
export declare const APPRAISAL_SERVICE_OBJECT = "AppraisalService";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IModule, Events, LogLevels, LogMessage } from '@elliemae/pui-scripting-object';
|
|
1
|
+
import type { IModule, Events, LogLevels, LogMessage } from '@elliemae/pui-scripting-object';
|
|
2
2
|
import { ScriptingObject, Event } from '@elliemae/microfe-common';
|
|
3
3
|
export declare const CREDIT_SERVICE_OBJECT = "CreditService";
|
|
4
4
|
export declare class CreditService extends ScriptingObject implements IModule {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const initServer: () => import("msw/
|
|
1
|
+
export declare const initServer: () => import("msw/node").SetupServer;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SSFHost, Guest } from '../index.js';
|
|
2
|
-
import { AppObjects } from './scriptingObjects/appObjects.js';
|
|
3
|
-
import { AppEvents } from './scriptingObjects/appEvents.js';
|
|
1
|
+
import { SSFHost, type Guest } from '../index.js';
|
|
2
|
+
import type { AppObjects } from './scriptingObjects/appObjects.js';
|
|
3
|
+
import type { AppEvents } from './scriptingObjects/appEvents.js';
|
|
4
4
|
export declare const createHost: (name?: string) => {
|
|
5
5
|
host: SSFHost<AppObjects, AppEvents>;
|
|
6
6
|
guestReady: Promise<Guest>;
|
|
@@ -23,6 +23,24 @@ export type Data = {
|
|
|
23
23
|
objectId: string;
|
|
24
24
|
};
|
|
25
25
|
eventName: string;
|
|
26
|
+
functionName?: string;
|
|
27
|
+
functionParams?: unknown[];
|
|
28
|
+
callerChain?: Array<{
|
|
29
|
+
id: string;
|
|
30
|
+
metadata?: Record<string, unknown>;
|
|
31
|
+
}>;
|
|
26
32
|
};
|
|
27
33
|
};
|
|
28
34
|
};
|
|
35
|
+
export type CallableWithCallContext = {
|
|
36
|
+
callContext?: {
|
|
37
|
+
guest?: {
|
|
38
|
+
id: string;
|
|
39
|
+
};
|
|
40
|
+
callChain?: Array<{
|
|
41
|
+
id: string;
|
|
42
|
+
metadata?: Record<string, unknown>;
|
|
43
|
+
}>;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export declare const getCallContext: (fn: unknown) => NonNullable<CallableWithCallContext["callContext"]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { GenericFunction } from './types.js';
|
|
1
|
+
import type { GenericFunction } from './types.js';
|
|
2
2
|
export declare const getOrigin: (url: string) => string;
|
|
3
3
|
export declare const flatten: (source: unknown[]) => unknown[];
|
|
4
|
-
export declare function isFunction(value:
|
|
4
|
+
export declare function isFunction(value: unknown): value is GenericFunction;
|
|
5
5
|
export declare const isTrustedDomain: (url: string) => boolean;
|