@elliemae/pui-app-bridge 2.9.4 → 2.16.6
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/appBridge.js +380 -93
- package/dist/cjs/appRegistry.js +136 -0
- package/dist/cjs/config/app.js +15 -2
- package/dist/cjs/config/microFE.js +3 -3
- package/dist/cjs/eventManager.js +16 -16
- package/dist/cjs/frame.html +2 -2
- package/dist/cjs/frame.js +39 -14
- package/dist/cjs/index.html +1 -1
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/loaders/script.js +5 -5
- package/dist/cjs/loaders/style.js +1 -0
- package/dist/cjs/microfeHost.js +51 -31
- package/dist/cjs/tests/flights/23.1/app.checksum1.js +25 -24
- package/dist/cjs/tests/flights/latest/app.checksum.js +25 -24
- package/dist/cjs/tests/hotels/23.1/app.checksum.js +27 -24
- package/dist/cjs/tests/hotels/latest/app.checksum.js +27 -24
- package/dist/cjs/tests/loan/latest/index.js +49 -57
- package/dist/cjs/tests/scriptingObjects/analytics.js +7 -7
- package/dist/cjs/tests/scriptingObjects/appraisalServiceModule.js +8 -8
- package/dist/cjs/tests/scriptingObjects/global.js +1 -2
- package/dist/cjs/tests/task/latest/index.dev.js +29 -28
- package/dist/cjs/tests/task/latest/index.js +29 -28
- package/dist/cjs/tests/travelhub/23.1/app.checksum.js +24 -26
- package/dist/cjs/tests/travelhub/23.1/landing.checksum1.js +5 -7
- package/dist/cjs/utils.js +31 -1
- package/dist/esm/appBridge.js +390 -95
- package/dist/esm/appRegistry.js +116 -0
- package/dist/esm/config/app.js +15 -2
- package/dist/esm/config/microFE.js +3 -3
- package/dist/esm/eventManager.js +16 -16
- package/dist/esm/frame.html +2 -2
- package/dist/esm/frame.js +29 -14
- package/dist/esm/index.html +1 -1
- package/dist/esm/loaders/script.js +5 -5
- package/dist/esm/loaders/style.js +1 -0
- package/dist/esm/microfeHost.js +55 -31
- package/dist/esm/tests/flights/23.1/app.checksum1.js +25 -24
- package/dist/esm/tests/flights/latest/app.checksum.js +25 -24
- package/dist/esm/tests/hotels/23.1/app.checksum.js +27 -24
- package/dist/esm/tests/hotels/latest/app.checksum.js +27 -24
- package/dist/esm/tests/loan/latest/index.js +49 -57
- package/dist/esm/tests/scriptingObjects/analytics.js +7 -7
- package/dist/esm/tests/scriptingObjects/appraisalServiceModule.js +8 -8
- package/dist/esm/tests/scriptingObjects/global.js +1 -2
- package/dist/esm/tests/task/latest/index.dev.js +29 -28
- package/dist/esm/tests/task/latest/index.js +29 -28
- package/dist/esm/tests/travelhub/23.1/app.checksum.js +24 -26
- package/dist/esm/tests/travelhub/23.1/landing.checksum1.js +5 -7
- package/dist/esm/utils.js +31 -1
- package/dist/public/assets/frame.671d9de68be598da64ca.html +47 -0
- package/dist/public/frame.html +1 -1
- package/dist/public/index.html +1 -1
- package/dist/public/js/emuiAppBridge.40c8880c94dbc97b49fd.js +51 -0
- package/dist/public/js/emuiAppBridge.40c8880c94dbc97b49fd.js.br +0 -0
- package/dist/public/js/emuiAppBridge.40c8880c94dbc97b49fd.js.gz +0 -0
- package/dist/public/js/emuiAppBridge.40c8880c94dbc97b49fd.js.map +1 -0
- package/dist/public/loan-object.js +1 -1
- package/dist/public/loan-object.js.br +0 -0
- package/dist/public/loan-object.js.gz +0 -0
- package/dist/public/loan-object.js.map +1 -1
- package/dist/types/lib/appBridge.d.ts +38 -28
- package/dist/types/lib/appRegistry.d.ts +41 -0
- package/dist/types/lib/eventManager.d.ts +4 -4
- package/dist/types/lib/frame.d.ts +45 -4
- package/dist/types/lib/index.d.ts +3 -3
- package/dist/types/lib/loaders/script.d.ts +2 -1
- package/dist/types/lib/microfeHost.d.ts +15 -25
- package/dist/types/lib/tests/flights/23.1/app.checksum1.d.ts +7 -0
- package/dist/types/lib/tests/flights/latest/app.checksum.d.ts +7 -0
- package/dist/types/lib/tests/hotels/23.1/app.checksum.d.ts +7 -0
- package/dist/types/lib/tests/hotels/latest/app.checksum.d.ts +7 -0
- package/dist/types/lib/tests/loan/latest/index.d.ts +11 -0
- package/dist/types/lib/tests/scriptingObjects/analytics.d.ts +3 -3
- package/dist/types/lib/tests/scriptingObjects/appraisalServiceModule.d.ts +2 -1
- package/dist/types/lib/tests/task/latest/index.d.ts +10 -0
- package/dist/types/lib/tests/task/latest/index.dev.d.ts +10 -0
- package/dist/types/lib/tests/travelhub/23.1/app.checksum.d.ts +7 -0
- package/dist/types/lib/tests/travelhub/23.1/landing.checksum1.d.ts +2 -0
- package/dist/types/lib/typings/appInfo.d.ts +1 -0
- package/dist/types/lib/typings/common.d.ts +0 -66
- package/dist/types/lib/typings/guest.d.ts +10 -3
- package/dist/types/lib/typings/host.d.ts +32 -32
- package/dist/types/lib/typings/window.d.ts +6 -1
- package/dist/types/lib/utils.d.ts +7 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/umd/671d9de68be598da64ca.html +47 -0
- package/dist/umd/frame.html +1 -1
- package/dist/umd/index.html +1 -1
- package/dist/umd/index.js +35 -9
- 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/loan-object.js +1 -1
- package/dist/umd/loan-object.js.br +0 -0
- package/dist/umd/loan-object.js.gz +0 -0
- package/dist/umd/loan-object.js.map +1 -1
- package/package.json +12 -12
- package/dist/public/js/emuiAppBridge.34df989fae2296115611.js +0 -25
- package/dist/public/js/emuiAppBridge.34df989fae2296115611.js.br +0 -0
- package/dist/public/js/emuiAppBridge.34df989fae2296115611.js.gz +0 -0
- package/dist/public/js/emuiAppBridge.34df989fae2296115611.js.map +0 -1
- package/dist/types/lib/tests/pubsubAPI.test.d.ts +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{getAppBridge as
|
|
1
|
+
import{getAppBridge as a}from"./utils.js";const e=o=>document.getElementById(o);class r extends ice.ScriptingObject{constructor(){super("Loan"),this.loanId="ABC123",this.onSaved=new ice.Event({name:"onSaved",objectId:this.constructor.name}),this.onPreSave=new ice.Event({name:"onPreSave",objectId:this.constructor.name}),this.onLoanAmountChanged=new ice.Event({name:"onLoanAmountChanged",objectId:this.constructor.name}),this.onLoanTermChanged=new ice.Event({name:"onLoanTermChanged",objectId:this.constructor.name}),this.onDownPaymentChanged=new ice.Event({name:"onDownPaymentChanged",objectId:this.constructor.name}),e("amount").addEventListener("blur",async n=>{(await a()).dispatchEvent({event:this.onLoanAmountChanged,eventParams:{amount:n.target.value}})}),e("term").addEventListener("blur",async n=>{(await a()).dispatchEvent({event:this.onLoanTermChanged,eventParams:{term:n.target.value}})}),e("downPayment").addEventListener("blur",async n=>{(await a()).dispatchEvent({event:this.onDownPaymentChanged,eventParams:{downPayment:n.target.value}})})}getLoanDetails=()=>({id:this.loanId,firstName:e("firstName").value,lastName:e("lastName").value,ssn:e("ssn").value,amount:e("amount").value,term:e("term").value,downPayment:e("downPayment").value,creditScore:e("creditScore").value});setCreditScore=n=>{const t=document.getElementById("creditScore");t&&(t.value=n)};saveLoan=async()=>{(await a()).dispatchEvent({event:this.onSaved,eventParams:{id:this.loanId}})}}export{r as Loan};
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=loan-object.js.map
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://ice/loan-object.js"],"sourcesContent":["import { getAppBridge } from './utils.js';\n\nconst getLoanField = (name) => document.getElementById(name);\n\nclass Loan extends ice.ScriptingObject {\n constructor() {\n super('Loan');\n this.loanId = 'ABC123';\n this.onSaved = new ice.Event({\n name: 'onSaved',\n
|
|
1
|
+
{"version":3,"sources":["webpack://ice/loan-object.js"],"sourcesContent":["import { getAppBridge } from './utils.js';\n\nconst getLoanField = (name) => document.getElementById(name);\n\nclass Loan extends ice.ScriptingObject {\n constructor() {\n super('Loan');\n this.loanId = 'ABC123';\n this.onSaved = new ice.Event({\n name: 'onSaved',\n objectId: this.constructor.name,\n });\n this.onPreSave = new ice.Event({\n name: 'onPreSave',\n objectId: this.constructor.name,\n });\n this.onLoanAmountChanged = new ice.Event({\n name: 'onLoanAmountChanged',\n objectId: this.constructor.name,\n });\n this.onLoanTermChanged = new ice.Event({\n name: 'onLoanTermChanged',\n objectId: this.constructor.name,\n });\n this.onDownPaymentChanged = new ice.Event({\n name: 'onDownPaymentChanged',\n objectId: this.constructor.name,\n });\n\n getLoanField('amount').addEventListener('blur', async (e) => {\n const appBridge = await getAppBridge();\n appBridge.dispatchEvent({\n event: this.onLoanAmountChanged,\n eventParams: {\n amount: e.target.value,\n },\n });\n });\n\n getLoanField('term').addEventListener('blur', async (e) => {\n const appBridge = await getAppBridge();\n appBridge.dispatchEvent({\n event: this.onLoanTermChanged,\n eventParams: { term: e.target.value },\n });\n });\n\n getLoanField('downPayment').addEventListener('blur', async (e) => {\n const appBridge = await getAppBridge();\n appBridge.dispatchEvent({\n event: this.onDownPaymentChanged,\n eventParams: {\n downPayment: e.target.value,\n },\n });\n });\n }\n\n getLoanDetails = () => ({\n id: this.loanId,\n firstName: getLoanField('firstName').value,\n lastName: getLoanField('lastName').value,\n ssn: getLoanField('ssn').value,\n amount: getLoanField('amount').value,\n term: getLoanField('term').value,\n downPayment: getLoanField('downPayment').value,\n creditScore: getLoanField('creditScore').value,\n });\n\n setCreditScore = (creditScore) => {\n const creditScoreElement = document.getElementById('creditScore');\n if (creditScoreElement) creditScoreElement.value = creditScore;\n };\n\n saveLoan = async () => {\n const appBridge = await getAppBridge();\n appBridge.dispatchEvent({\n event: this.onSaved,\n eventParams: { id: this.loanId },\n });\n };\n}\n\nexport { Loan };\n"],"mappings":"AAAA,OAAS,gBAAAA,MAAoB,aAE7B,MAAMC,EAAgBC,GAAS,SAAS,eAAeA,CAAI,EAE3D,MAAMC,UAAa,IAAI,eAAgB,CACrC,aAAc,CACZ,MAAM,MAAM,EACZ,KAAK,OAAS,SACd,KAAK,QAAU,IAAI,IAAI,MAAM,CAC3B,KAAM,UACN,SAAU,KAAK,YAAY,IAC7B,CAAC,EACD,KAAK,UAAY,IAAI,IAAI,MAAM,CAC7B,KAAM,YACN,SAAU,KAAK,YAAY,IAC7B,CAAC,EACD,KAAK,oBAAsB,IAAI,IAAI,MAAM,CACvC,KAAM,sBACN,SAAU,KAAK,YAAY,IAC7B,CAAC,EACD,KAAK,kBAAoB,IAAI,IAAI,MAAM,CACrC,KAAM,oBACN,SAAU,KAAK,YAAY,IAC7B,CAAC,EACD,KAAK,qBAAuB,IAAI,IAAI,MAAM,CACxC,KAAM,uBACN,SAAU,KAAK,YAAY,IAC7B,CAAC,EAEDF,EAAa,QAAQ,EAAE,iBAAiB,OAAQ,MAAOG,GAAM,EACzC,MAAMJ,EAAa,GAC3B,cAAc,CACtB,MAAO,KAAK,oBACZ,YAAa,CACX,OAAQI,EAAE,OAAO,KACnB,CACF,CAAC,CACH,CAAC,EAEDH,EAAa,MAAM,EAAE,iBAAiB,OAAQ,MAAOG,GAAM,EACvC,MAAMJ,EAAa,GAC3B,cAAc,CACtB,MAAO,KAAK,kBACZ,YAAa,CAAE,KAAMI,EAAE,OAAO,KAAM,CACtC,CAAC,CACH,CAAC,EAEDH,EAAa,aAAa,EAAE,iBAAiB,OAAQ,MAAOG,GAAM,EAC9C,MAAMJ,EAAa,GAC3B,cAAc,CACtB,MAAO,KAAK,qBACZ,YAAa,CACX,YAAaI,EAAE,OAAO,KACxB,CACF,CAAC,CACH,CAAC,CACH,CAEA,eAAiB,KAAO,CACtB,GAAI,KAAK,OACT,UAAWH,EAAa,WAAW,EAAE,MACrC,SAAUA,EAAa,UAAU,EAAE,MACnC,IAAKA,EAAa,KAAK,EAAE,MACzB,OAAQA,EAAa,QAAQ,EAAE,MAC/B,KAAMA,EAAa,MAAM,EAAE,MAC3B,YAAaA,EAAa,aAAa,EAAE,MACzC,YAAaA,EAAa,aAAa,EAAE,KAC3C,GAEA,eAAkBI,GAAgB,CAChC,MAAMC,EAAqB,SAAS,eAAe,aAAa,EAC5DA,IAAoBA,EAAmB,MAAQD,EACrD,EAEA,SAAW,SAAY,EACH,MAAML,EAAa,GAC3B,cAAc,CACtB,MAAO,KAAK,QACZ,YAAa,CAAE,GAAI,KAAK,MAAO,CACjC,CAAC,CACH,CACF,CAEA,OAASG,KAAA","names":["getAppBridge","getLoanField","name","Loan","e","creditScore","creditScoreElement"],"sourceRoot":"","file":"loan-object.js"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Logger } from '@elliemae/pui-diagnostics';
|
|
2
|
-
import { Events, ScriptingObjectTypes } from '@elliemae/pui-scripting-object';
|
|
3
|
-
import
|
|
2
|
+
import { Events, ScriptingObjectTypes, IScriptingObjectProxy } from '@elliemae/pui-scripting-object';
|
|
3
|
+
import { EventListeners, AddScriptingObjectParams, DispatchEventParam, EventOptions, ScriptingObjects } from '@elliemae/microfe-common';
|
|
4
4
|
import { IMicroFEGuest } from './typings/guest.js';
|
|
5
5
|
import { OpenAppParams } from './typings/host.js';
|
|
6
|
-
import {
|
|
6
|
+
import { ValueOf } from './typings/common.js';
|
|
7
7
|
/**
|
|
8
8
|
* AppBridge constructor parameter
|
|
9
9
|
*/
|
|
@@ -23,6 +23,11 @@ export type AppBridgeParams = {
|
|
|
23
23
|
* instance of the pui diagnostics logger
|
|
24
24
|
*/
|
|
25
25
|
logger: Logger;
|
|
26
|
+
/**
|
|
27
|
+
* Extend parent session when user interacts with the guest application
|
|
28
|
+
* @defaultValue true
|
|
29
|
+
*/
|
|
30
|
+
extendSession?: boolean;
|
|
26
31
|
};
|
|
27
32
|
/**
|
|
28
33
|
* AppBridge implementation. This class is responsible for creating & managing the Micro FrontEnd Guest instances. It also exposes scripting objects to all the Micro FrontEnd Guests.
|
|
@@ -33,76 +38,81 @@ export declare class CAppBridge<AppObjects extends ScriptingObjects = Partial<Sc
|
|
|
33
38
|
#private;
|
|
34
39
|
/**
|
|
35
40
|
* Create a new instance of the AppBridge
|
|
36
|
-
* @param {AppBridgeParams}
|
|
41
|
+
* @param {AppBridgeParams} options - App Bridge constructor parameters
|
|
37
42
|
*/
|
|
38
|
-
constructor(
|
|
43
|
+
constructor(options: AppBridgeParams);
|
|
39
44
|
/**
|
|
40
45
|
* registers scripting object to the host
|
|
41
46
|
* @param {ValueOf<AppObjects>} so scripting object
|
|
42
47
|
* @param {AddScriptingObjectParams} params params to add scripting object
|
|
43
48
|
*/
|
|
44
49
|
addScriptingObject: <SO extends ValueOf<AppObjects>>(so: SO, params?: AddScriptingObjectParams) => void;
|
|
50
|
+
/**
|
|
51
|
+
* Create new Scripting Object from SSF scripting object proxy
|
|
52
|
+
* @param proxy - reference to the scripting object obtained through getObject method
|
|
53
|
+
* @returns cloned version of the scripting object
|
|
54
|
+
*/
|
|
55
|
+
cloneScriptingObject: <ObjectId extends Extract<keyof AppObjects, string>>(proxy: IScriptingObjectProxy) => AppObjects[ObjectId];
|
|
45
56
|
/**
|
|
46
57
|
* Close all active guest micro frontend applications
|
|
47
58
|
*/
|
|
48
59
|
closeAllApps: () => Promise<void>;
|
|
49
60
|
/**
|
|
50
61
|
* Close guest micro frontend application
|
|
51
|
-
* @param
|
|
62
|
+
* @param instanceId unique instance id of the application
|
|
52
63
|
*/
|
|
53
|
-
closeApp: (
|
|
64
|
+
closeApp: (instanceId: string) => Promise<void>;
|
|
54
65
|
/**
|
|
55
66
|
* dispatch event to guest microfrontend application
|
|
56
|
-
* @param {DispatchEventParams<EventId, Params>} params - event parameters
|
|
67
|
+
* @param {DispatchEventParams<EventId, Params, Options>} params - event parameters
|
|
57
68
|
*/
|
|
58
|
-
dispatchEvent: <EventId extends Extract<keyof AppEvents, string>, Params extends Parameters<AppEvents[EventId]>[0]["eventParams"]>(params: DispatchEventParam<EventId, Params>) => Promise<void | any[]>;
|
|
69
|
+
dispatchEvent: <EventId extends Extract<keyof AppEvents, string>, Params extends Parameters<AppEvents[EventId]>[0]["eventParams"], Options extends EventOptions>(params: DispatchEventParam<EventId, Params, Options>) => Promise<void | any[]>;
|
|
59
70
|
/**
|
|
60
|
-
* Get
|
|
71
|
+
* Get App by instanceId
|
|
61
72
|
* @param id unique id of guest
|
|
73
|
+
* @param instanceId
|
|
62
74
|
* @returns guest instance
|
|
63
75
|
*/
|
|
64
|
-
|
|
76
|
+
getApp: <T extends IMicroFEGuest>(instanceId: string) => T;
|
|
65
77
|
/**
|
|
66
|
-
* Get list of active
|
|
78
|
+
* Get list of active apps
|
|
67
79
|
* @returns list of active guests
|
|
68
80
|
*/
|
|
69
|
-
|
|
81
|
+
getApps: () => IMicroFEGuest<Partial<ScriptingObjectTypes>, Events>[];
|
|
70
82
|
/**
|
|
71
83
|
* Initialize appBridge
|
|
72
84
|
*/
|
|
73
85
|
init: () => Promise<void>;
|
|
74
86
|
/**
|
|
75
87
|
* Mount guest micro frontend application into DOM
|
|
76
|
-
* @param
|
|
77
|
-
* @throws Error if application with given id is not found in configuration
|
|
88
|
+
* @param instanceId unique instance id of guest micro frontend application
|
|
89
|
+
* @throws Error if application with given instance id is not found in configuration
|
|
78
90
|
*/
|
|
79
|
-
mountApp: (
|
|
91
|
+
mountApp: (instanceId: string) => Promise<void>;
|
|
80
92
|
/**
|
|
81
93
|
* Open guest micro frontend application
|
|
82
94
|
* @param {OpenAppParams} params - options to open guest application
|
|
83
95
|
*/
|
|
84
|
-
openApp: (params: OpenAppParams) => Promise<
|
|
96
|
+
openApp: (params: OpenAppParams) => Promise<string>;
|
|
85
97
|
/**
|
|
86
|
-
*
|
|
87
|
-
* @deprecated use dispatchEvent instead
|
|
88
|
-
* @param eventId unique id of the event. The format is [scripting object name].[event name]
|
|
89
|
-
* @param data data to be sent to the subscribers of the event
|
|
90
|
-
* @returns true if event is published successfully
|
|
98
|
+
* remove all listeners
|
|
91
99
|
*/
|
|
92
|
-
|
|
100
|
+
removeAllEventSubscriptions: () => void;
|
|
93
101
|
/**
|
|
94
|
-
*
|
|
102
|
+
* removes all scripting objects from host
|
|
103
|
+
* @param guestId unique id of the guest application
|
|
95
104
|
*/
|
|
96
|
-
|
|
105
|
+
removeAllScriptingObjects: (guestId?: string) => void;
|
|
97
106
|
/**
|
|
98
107
|
* removes scripting object from the host
|
|
99
108
|
* @param objectId unique id of the scripting object
|
|
109
|
+
* @param guestId
|
|
100
110
|
*/
|
|
101
|
-
removeScriptingObject: (objectId: Extract<keyof AppObjects, string
|
|
111
|
+
removeScriptingObject: (objectId: Extract<keyof AppObjects, string>, guestId?: string) => void;
|
|
102
112
|
/**
|
|
103
113
|
* Unmount guest micro frontend application from DOM
|
|
104
|
-
* @param
|
|
114
|
+
* @param instanceId unique instance id of guest micro frontend application
|
|
105
115
|
* @throws Error if application with given id is not found in configuration
|
|
106
116
|
*/
|
|
107
|
-
unmountApp: (
|
|
117
|
+
unmountApp: (instanceId: string) => Promise<void>;
|
|
108
118
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { IMicroFEGuest } from './typings/guest.js';
|
|
2
|
+
export declare class CAppRegistry {
|
|
3
|
+
#private;
|
|
4
|
+
constructor();
|
|
5
|
+
/**
|
|
6
|
+
* get micro app guest from window object
|
|
7
|
+
* @param param0 id and uuid
|
|
8
|
+
* @param param0.id app id
|
|
9
|
+
* @param param0.uuid unique instance id
|
|
10
|
+
* @param param0.instanceId
|
|
11
|
+
* @returns micro app guest
|
|
12
|
+
*/
|
|
13
|
+
get: ({ id, instanceId }: {
|
|
14
|
+
id: string;
|
|
15
|
+
instanceId: string;
|
|
16
|
+
}) => Omit<IMicroFEGuest<Partial<import("@elliemae/pui-scripting-object").ScriptingObjectTypes>, import("@elliemae/pui-scripting-object").Events>, "guestWindow"> | null;
|
|
17
|
+
/**
|
|
18
|
+
* add app to global emui window variable
|
|
19
|
+
* @param id.id
|
|
20
|
+
* @param id app id
|
|
21
|
+
* @param instanceId unique instance id
|
|
22
|
+
* @param id.instanceId
|
|
23
|
+
* @param id.documentEle
|
|
24
|
+
*/
|
|
25
|
+
add: ({ id, instanceId, documentEle, }: {
|
|
26
|
+
id: string;
|
|
27
|
+
instanceId: string;
|
|
28
|
+
documentEle: Document;
|
|
29
|
+
}) => void;
|
|
30
|
+
/**
|
|
31
|
+
* delete app from global emui window variable
|
|
32
|
+
* @param id.id app id
|
|
33
|
+
* @param id.instanceId unique instance id
|
|
34
|
+
* @param id.id.id
|
|
35
|
+
* @param id.id.instanceId
|
|
36
|
+
*/
|
|
37
|
+
delete: ({ id, instanceId }: {
|
|
38
|
+
id: string;
|
|
39
|
+
instanceId: string;
|
|
40
|
+
}) => void;
|
|
41
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { IScriptingObject, Events } from '@elliemae/pui-scripting-object';
|
|
2
|
-
import type { EventListeners, Listener } from '@elliemae/microfe-common';
|
|
3
|
-
import { SubscribeParam, UnsubscribeParam, DispatchEventParam } from './typings/common.js';
|
|
2
|
+
import type { EventListeners, Listener, SubscribeParam, UnsubscribeParam, DispatchEventParam, EventOptions } from '@elliemae/microfe-common';
|
|
4
3
|
/**
|
|
5
4
|
* details of an event listener
|
|
6
5
|
*/
|
|
@@ -12,7 +11,7 @@ type EventListenerDetails = {
|
|
|
12
11
|
/**
|
|
13
12
|
* subscription id
|
|
14
13
|
*/
|
|
15
|
-
|
|
14
|
+
token: string;
|
|
16
15
|
};
|
|
17
16
|
/**
|
|
18
17
|
* parameters for emitting an event
|
|
@@ -42,9 +41,10 @@ export declare class EventManager<AppEvents extends EventListeners = Events> {
|
|
|
42
41
|
#private;
|
|
43
42
|
/**
|
|
44
43
|
* dispatch an event
|
|
44
|
+
* @param scriptingObject
|
|
45
45
|
* @param {DispatchEventParam<EventId, Params>} param - parameters for dispatching an event
|
|
46
46
|
*/
|
|
47
|
-
dispatchEvent: <EventId extends Extract<keyof AppEvents, string>, Params extends Parameters<AppEvents[EventId]>[0]["eventParams"]>(param: DispatchEventParam<EventId, Params>) => Promise<void | any[]>;
|
|
47
|
+
dispatchEvent: <EventId extends Extract<keyof AppEvents, string>, Params extends Parameters<AppEvents[EventId]>[0]["eventParams"], Options extends EventOptions>(scriptingObject: IScriptingObject, param: DispatchEventParam<EventId, Params, Options>) => Promise<void | any[]>;
|
|
48
48
|
/**
|
|
49
49
|
* Subscribe to an event
|
|
50
50
|
* @param {SubscribeParam<EventId, AppEvents[EventId]>} param - parameters for subscribing to an event
|
|
@@ -1,14 +1,55 @@
|
|
|
1
|
+
import { IApplication } from '@elliemae/pui-scripting-object';
|
|
2
|
+
import { Logger } from '@elliemae/pui-diagnostics';
|
|
3
|
+
/**
|
|
4
|
+
* Options for creating an iframe for a guest application
|
|
5
|
+
*/
|
|
1
6
|
export type FrameOptions = {
|
|
7
|
+
/**
|
|
8
|
+
* title of the iframe
|
|
9
|
+
*/
|
|
2
10
|
title: string;
|
|
11
|
+
/**
|
|
12
|
+
* sandbox attribute for the iframe
|
|
13
|
+
* check https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-sandbox for more details
|
|
14
|
+
*/
|
|
3
15
|
sandbox?: string;
|
|
16
|
+
/**
|
|
17
|
+
* source url for the iframe
|
|
18
|
+
*/
|
|
4
19
|
src?: string;
|
|
20
|
+
/**
|
|
21
|
+
* css style for the iframe
|
|
22
|
+
* @default 'flex-grow: 1;border: none;margin: 0;padding: 0;display: block;min-width: 100%;height: 100%;'
|
|
23
|
+
*/
|
|
5
24
|
style?: string;
|
|
25
|
+
/**
|
|
26
|
+
* unique identified of the iframe container
|
|
27
|
+
*/
|
|
6
28
|
containerId?: string;
|
|
29
|
+
/**
|
|
30
|
+
* application object for the guest application
|
|
31
|
+
*/
|
|
32
|
+
appObj?: IApplication;
|
|
33
|
+
/**
|
|
34
|
+
* logger instance for the guest application
|
|
35
|
+
*/
|
|
36
|
+
logger?: Logger;
|
|
37
|
+
/**
|
|
38
|
+
* permission policy for the guest iframe
|
|
39
|
+
* check https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/iframe#allow for more details
|
|
40
|
+
* @example "microphone 'self' https://example.com; geolocation 'none'"
|
|
41
|
+
*/
|
|
42
|
+
permissionPolicy?: string;
|
|
7
43
|
};
|
|
8
|
-
export declare const FRAME_CONTAINER_ID_PREFIX = "pui-iframe-container-";
|
|
9
44
|
export declare const FRAME_APP_CONTAINER_ID_PREFIX = "pui-app-container-";
|
|
10
45
|
export declare const Frame: {
|
|
11
|
-
create: (
|
|
12
|
-
|
|
13
|
-
|
|
46
|
+
create: ({ id, instanceId, manifestPath, hostUrl, options, }: {
|
|
47
|
+
id: string;
|
|
48
|
+
instanceId: string;
|
|
49
|
+
manifestPath: string;
|
|
50
|
+
hostUrl: string;
|
|
51
|
+
options: FrameOptions;
|
|
52
|
+
}) => Promise<HTMLIFrameElement>;
|
|
53
|
+
remove: (instanceId: string) => void;
|
|
54
|
+
get: (instanceId: string) => HTMLIFrameElement;
|
|
14
55
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export type { MountParams, InitParams, IMicroFEGuest, } from './typings/guest.js';
|
|
2
|
-
export type {
|
|
2
|
+
export type { IMicroFEHost, OpenAppParams } from './typings/host.js';
|
|
3
3
|
export { SecurityContext } from './typings/common.js';
|
|
4
|
-
export type { DispatchEventParam, SubscribeParam, UnsubscribeParam, } from './typings/common.js';
|
|
5
4
|
export type { AppBridgeParams } from './appBridge.js';
|
|
6
5
|
export type { IAppConfig, MicroFrontendApp } from './config/app.js';
|
|
7
6
|
export type { FrameOptions } from './frame.js';
|
|
8
|
-
export type { Listener, AddScriptingObjectParams, } from '@elliemae/microfe-common';
|
|
7
|
+
export type { Listener, EventListeners, AddScriptingObjectParams, SubscribeParam, UnsubscribeParam, } from '@elliemae/microfe-common';
|
|
9
8
|
export { Event, ScriptingObject } from '@elliemae/microfe-common';
|
|
9
|
+
export type { ScriptingObjects } from '@elliemae/microfe-common';
|
|
10
10
|
export { CAppBridge } from './appBridge.js';
|
|
@@ -6,11 +6,12 @@ type ResourceOptions = {
|
|
|
6
6
|
documentEle: Document;
|
|
7
7
|
fileName: string;
|
|
8
8
|
index: number;
|
|
9
|
+
isJsModule?: boolean;
|
|
9
10
|
};
|
|
10
11
|
export declare class ScriptLoader {
|
|
11
12
|
#private;
|
|
12
13
|
constructor(logger: Logger);
|
|
13
|
-
add: ({ name, hostUrl, documentEle, fileName, index, }: ResourceOptions) => Promise<string>;
|
|
14
|
+
add: ({ name, hostUrl, documentEle, fileName, index, isJsModule, }: ResourceOptions) => Promise<string>;
|
|
14
15
|
remove: (elementId?: string, documentEle?: Document) => Promise<void>;
|
|
15
16
|
removeDynamicImportedScripts: (hostUrl: string, documentEle: Document) => void;
|
|
16
17
|
removePrefetchLinks: (hostUrl: string, documentEle: Document) => void;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { Events, ScriptingObjectTypes } from '@elliemae/pui-scripting-object';
|
|
2
2
|
import { Logger } from '@elliemae/pui-diagnostics';
|
|
3
|
-
import type { EventListeners, GuestContext } from '@elliemae/microfe-common';
|
|
4
|
-
import { ScriptingObjectManager } from '@elliemae/microfe-common';
|
|
3
|
+
import type { EventListeners, GuestContext, SubscribeParam, UnsubscribeParam } from '@elliemae/microfe-common';
|
|
4
|
+
import { ScriptingObjectManager, ScriptingObjects } from '@elliemae/microfe-common';
|
|
5
5
|
import { EventManager } from './eventManager.js';
|
|
6
|
-
import { IMicroFEHost,
|
|
7
|
-
import { ScriptingObjects, SubscribeParam, UnsubscribeParam } from './typings/common.js';
|
|
6
|
+
import { IMicroFEHost, AppWindowSize } from './typings/host.js';
|
|
8
7
|
/**
|
|
9
8
|
* Constructor parameters for the host application
|
|
10
9
|
*/
|
|
11
10
|
export type CMicroFEHostParams<AppObjects extends ScriptingObjects, AppEvents extends EventListeners> = {
|
|
11
|
+
/**
|
|
12
|
+
* unique id of the iframe container
|
|
13
|
+
*/
|
|
14
|
+
containerId?: string;
|
|
12
15
|
/**
|
|
13
16
|
* unique id of the guest application
|
|
14
17
|
*/
|
|
@@ -42,12 +45,6 @@ export declare class CMicroFEHost<AppObjects extends ScriptingObjects = Partial<
|
|
|
42
45
|
* @param {CMicroFEHostParams} params - constructor parameters
|
|
43
46
|
*/
|
|
44
47
|
constructor(params: CMicroFEHostParams<AppObjects, AppEvents>);
|
|
45
|
-
/**
|
|
46
|
-
* add listener to the scripting object event
|
|
47
|
-
* @param {SubscribeParam<EventId, EventListener>} params - parameters to add event listener
|
|
48
|
-
* @returns subscription id
|
|
49
|
-
*/
|
|
50
|
-
addEventListener: <EventId extends Extract<keyof AppEvents, string>>(params: SubscribeParam<EventId, AppEvents[EventId]>) => string;
|
|
51
48
|
/**
|
|
52
49
|
* application release version
|
|
53
50
|
* @returns release version
|
|
@@ -59,28 +56,21 @@ export declare class CMicroFEHost<AppObjects extends ScriptingObjects = Partial<
|
|
|
59
56
|
* @param objectId
|
|
60
57
|
* @returns scripting object reference
|
|
61
58
|
*/
|
|
62
|
-
getObject: <ObjectId extends Extract<keyof AppObjects, string>>(objectId: ObjectId) => Promise<Awaited<AppObjects[ObjectId]
|
|
63
|
-
/**
|
|
64
|
-
* removes listener from the scripting object event
|
|
65
|
-
* @param {UnsubscribeParam<EventId>} params - parameters to remove event listener
|
|
66
|
-
*/
|
|
67
|
-
removeEventListener: <EventId extends Extract<keyof AppEvents, string>>(params: UnsubscribeParam<EventId>) => void;
|
|
59
|
+
getObject: <ObjectId extends Extract<keyof AppObjects, string>>(objectId: ObjectId) => Promise<Awaited<AppObjects[ObjectId]>> | Promise<null>;
|
|
68
60
|
/**
|
|
69
61
|
* set the size of the guest application iframe window
|
|
70
62
|
* @param {AppWindowSize} appSize window size of the application
|
|
71
63
|
*/
|
|
72
64
|
setAppWindowSize: (appSize: AppWindowSize) => void;
|
|
73
65
|
/**
|
|
74
|
-
*
|
|
75
|
-
* @param
|
|
76
|
-
* @
|
|
77
|
-
* @returns token to be used to unsubscribe
|
|
66
|
+
* add listener to the scripting object event
|
|
67
|
+
* @param {SubscribeParam<EventId, EventListener>} params - parameters to add event listener
|
|
68
|
+
* @returns subscription id
|
|
78
69
|
*/
|
|
79
|
-
subscribe: <
|
|
70
|
+
subscribe: <EventId extends Extract<keyof AppEvents, string>>(params: SubscribeParam<EventId, AppEvents[EventId]>) => string;
|
|
80
71
|
/**
|
|
81
|
-
*
|
|
82
|
-
* @param
|
|
83
|
-
* @param eventId unique id of the event. The format is [scripting object name].[event name]
|
|
72
|
+
* removes listener from the scripting object event
|
|
73
|
+
* @param {UnsubscribeParam<EventId>} params - parameters to remove event listener
|
|
84
74
|
*/
|
|
85
|
-
unsubscribe: (
|
|
75
|
+
unsubscribe: <EventId extends Extract<keyof AppEvents, string>>(params: UnsubscribeParam<EventId>) => void;
|
|
86
76
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const appId: "loanapp";
|
|
2
|
+
declare const appName: "Loan App";
|
|
3
|
+
declare const appElementId: "pui-app-container-flights";
|
|
4
|
+
declare const pipelinePath: "/pipeline";
|
|
5
|
+
declare const pipelineLinkText: "Pipeline";
|
|
6
|
+
declare function getWindow(): Window;
|
|
7
|
+
declare let host: null;
|
|
8
|
+
declare let parentHistory: null;
|
|
9
|
+
declare let logger: null;
|
|
10
|
+
declare function setFrameSize(): void;
|
|
11
|
+
declare const browserWindow: Window;
|
|
@@ -2,7 +2,7 @@ import { IAnalytics, BAEvent, TimingOptions } from '@elliemae/pui-scripting-obje
|
|
|
2
2
|
import { ScriptingObject } from '@elliemae/microfe-common';
|
|
3
3
|
export declare class Analytics extends ScriptingObject implements IAnalytics {
|
|
4
4
|
constructor();
|
|
5
|
-
sendBAEvent(event: BAEvent)
|
|
6
|
-
startTiming(name: string, options: TimingOptions)
|
|
7
|
-
endTiming(start: string | PerformanceMeasure, options: TimingOptions)
|
|
5
|
+
sendBAEvent: (event: BAEvent) => Promise<void>;
|
|
6
|
+
startTiming: (name: string, options: TimingOptions) => Promise<PerformanceMark>;
|
|
7
|
+
endTiming: (start: string | PerformanceMeasure, options: TimingOptions) => Promise<void>;
|
|
8
8
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IModule, Listener, Events } from '@elliemae/pui-scripting-object';
|
|
1
|
+
import { IModule, Listener, Events, LogLevels, LogMessage } from '@elliemae/pui-scripting-object';
|
|
2
2
|
import { ScriptingObject, Event } from '@elliemae/microfe-common';
|
|
3
3
|
export type AppraisalServiceEvents = {
|
|
4
4
|
'appraisalservice.onprecommit': Listener<AppraisalService, {
|
|
@@ -31,5 +31,6 @@ export declare class AppraisalService extends ScriptingObject implements IModule
|
|
|
31
31
|
saveLoan: () => Promise<void>;
|
|
32
32
|
commit: () => Promise<unknown>;
|
|
33
33
|
delete: () => never;
|
|
34
|
+
log: (message: string | LogMessage, level: keyof typeof LogLevels) => Promise<void>;
|
|
34
35
|
unload: () => Promise<void>;
|
|
35
36
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const appId: "taskapp";
|
|
2
|
+
declare const appName: "Task App";
|
|
3
|
+
declare const appElementId: "pui-app-container-flights";
|
|
4
|
+
declare const pipelinePath: "/pipeline";
|
|
5
|
+
declare const pipelineLinkText: "Pipeline";
|
|
6
|
+
declare function getWindow(): Window;
|
|
7
|
+
declare let host: null;
|
|
8
|
+
declare let parentHistory: null;
|
|
9
|
+
declare let logger: null;
|
|
10
|
+
declare const browserWindow: Window;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const appId: "taskapp";
|
|
2
|
+
declare const appName: "Task App Dev";
|
|
3
|
+
declare const appElementId: "pui-app-container-flights";
|
|
4
|
+
declare const pipelinePath: "/pipeline";
|
|
5
|
+
declare const pipelineLinkText: "Pipeline";
|
|
6
|
+
declare function getWindow(): Window;
|
|
7
|
+
declare let host: null;
|
|
8
|
+
declare let parentHistory: null;
|
|
9
|
+
declare let logger: null;
|
|
10
|
+
declare const browserWindow: Window;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const appId: "travelhub";
|
|
2
|
+
declare const appName: "Travel Hub";
|
|
3
|
+
declare function getWindow(): Window;
|
|
4
|
+
declare const browserWindow: Window;
|
|
5
|
+
declare const mainElement: HTMLElement;
|
|
6
|
+
declare const pageHeaderEle: HTMLHeadingElement;
|
|
7
|
+
declare const versionEle: HTMLParagraphElement;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import { IScriptingObject } from '@elliemae/pui-scripting-object';
|
|
2
|
-
import type { Listener } from '@elliemae/microfe-common';
|
|
3
|
-
/**
|
|
4
|
-
* collection of scripting objects
|
|
5
|
-
*/
|
|
6
|
-
export type ScriptingObjects = Record<string, IScriptingObject>;
|
|
7
1
|
export type ValueOf<T> = T[keyof T];
|
|
8
2
|
/**
|
|
9
3
|
* security context under which the guest application is running
|
|
@@ -18,63 +12,3 @@ export declare enum SecurityContext {
|
|
|
18
12
|
*/
|
|
19
13
|
PARTNER = "PARTNER"
|
|
20
14
|
}
|
|
21
|
-
/**
|
|
22
|
-
* parameters for subscribing to an event
|
|
23
|
-
*/
|
|
24
|
-
export type SubscribeParam<EventId, EventListener extends Listener<any, any, any, any>> = {
|
|
25
|
-
/**
|
|
26
|
-
* unique id of the event
|
|
27
|
-
*/
|
|
28
|
-
eventId: EventId;
|
|
29
|
-
/**
|
|
30
|
-
* event listener
|
|
31
|
-
*/
|
|
32
|
-
listener: EventListener;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* parameters for unsubscribing from an event
|
|
36
|
-
*/
|
|
37
|
-
export type UnsubscribeParam<EventId> = {
|
|
38
|
-
/**
|
|
39
|
-
* unique id of the event
|
|
40
|
-
*/
|
|
41
|
-
eventId: EventId;
|
|
42
|
-
/**
|
|
43
|
-
* subscription id
|
|
44
|
-
*/
|
|
45
|
-
subscriptionId?: string;
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* parameters for dispatching an event
|
|
49
|
-
*/
|
|
50
|
-
export type DispatchEventParam<EventId, Params> = {
|
|
51
|
-
/**
|
|
52
|
-
* event details
|
|
53
|
-
*/
|
|
54
|
-
event: {
|
|
55
|
-
/**
|
|
56
|
-
* unique id of the event
|
|
57
|
-
*/
|
|
58
|
-
id: EventId;
|
|
59
|
-
/**
|
|
60
|
-
* name of the event
|
|
61
|
-
*/
|
|
62
|
-
name: string;
|
|
63
|
-
/**
|
|
64
|
-
* flag indicating this event requires feedback from all of the listeners
|
|
65
|
-
*/
|
|
66
|
-
requiresFeedback: boolean;
|
|
67
|
-
/**
|
|
68
|
-
* scripting object that owns this event
|
|
69
|
-
*/
|
|
70
|
-
scriptingObject: IScriptingObject;
|
|
71
|
-
};
|
|
72
|
-
/**
|
|
73
|
-
* event parameters
|
|
74
|
-
*/
|
|
75
|
-
eventParams: Params;
|
|
76
|
-
/**
|
|
77
|
-
* time to wait for feedback from listeners. milliseconds
|
|
78
|
-
*/
|
|
79
|
-
feedbackWaitTime?: number;
|
|
80
|
-
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { History } from 'history';
|
|
1
|
+
import { History, To } from 'history';
|
|
2
2
|
import { DefaultTheme } from 'styled-components';
|
|
3
3
|
import { Logger } from '@elliemae/pui-diagnostics';
|
|
4
4
|
import { BreakPoint } from '@elliemae/pui-theme';
|
|
5
5
|
import { ScriptingObjectTypes, Events } from '@elliemae/pui-scripting-object';
|
|
6
|
-
import type { EventListeners } from '@elliemae/microfe-common';
|
|
7
|
-
import { ScriptingObjects } from './common.js';
|
|
6
|
+
import type { EventListeners, ScriptingObjects } from '@elliemae/microfe-common';
|
|
8
7
|
import { IMicroFEHost } from './host.js';
|
|
9
8
|
/**
|
|
10
9
|
* Viewport size
|
|
@@ -43,6 +42,10 @@ export type InitParams<AppObjects extends ScriptingObjects = Partial<ScriptingOb
|
|
|
43
42
|
* home route of the application
|
|
44
43
|
*/
|
|
45
44
|
homeRoute?: string;
|
|
45
|
+
/**
|
|
46
|
+
* initial route of the application
|
|
47
|
+
*/
|
|
48
|
+
initialRoute?: To;
|
|
46
49
|
/**
|
|
47
50
|
* previous state of the application
|
|
48
51
|
*/
|
|
@@ -91,6 +94,10 @@ export type MountParams = {
|
|
|
91
94
|
* @typeParam AppEvents - scripting object events
|
|
92
95
|
*/
|
|
93
96
|
export interface IMicroFEGuest<AppObjects extends ScriptingObjects = Partial<ScriptingObjectTypes>, AppEvents extends EventListeners = Events> {
|
|
97
|
+
/**
|
|
98
|
+
* unique guest instance id
|
|
99
|
+
*/
|
|
100
|
+
uuid: string;
|
|
94
101
|
/**
|
|
95
102
|
* guest window object
|
|
96
103
|
*/
|