@elliemae/pui-app-bridge 2.28.6 → 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.
Files changed (61) hide show
  1. package/dist/cjs/appBridge.js +11 -14
  2. package/dist/cjs/config/app.js +2 -7
  3. package/dist/cjs/config/microFE.js +30 -28
  4. package/dist/cjs/eventManager.js +7 -6
  5. package/dist/cjs/frame.js +10 -7
  6. package/dist/cjs/loaders/manifest.js +1 -1
  7. package/dist/cjs/microfeHost.js +5 -2
  8. package/dist/cjs/tests/scriptingObjects/analytics.js +6 -21
  9. package/dist/cjs/tests/scriptingObjects/appraisalServiceModule.js +1 -4
  10. package/dist/cjs/tests/utils.js +76 -1
  11. package/dist/cjs/typings/window.js +1 -1
  12. package/dist/esm/appBridge.js +11 -14
  13. package/dist/esm/config/app.js +2 -7
  14. package/dist/esm/config/microFE.js +30 -28
  15. package/dist/esm/eventManager.js +7 -6
  16. package/dist/esm/frame.js +10 -7
  17. package/dist/esm/loaders/manifest.js +1 -1
  18. package/dist/esm/microfeHost.js +5 -2
  19. package/dist/esm/tests/scriptingObjects/analytics.js +6 -21
  20. package/dist/esm/tests/scriptingObjects/appraisalServiceModule.js +1 -4
  21. package/dist/esm/tests/serverHandlers.js +3 -1
  22. package/dist/esm/tests/utils.js +76 -1
  23. package/dist/esm/typings/window.js +1 -1
  24. package/dist/public/e2e-host.html +1 -1
  25. package/dist/public/e2e-index.html +1 -1
  26. package/dist/public/frame.html +1 -1
  27. package/dist/public/index.html +1 -1
  28. package/dist/public/js/emuiAppBridge.e4cfaa7d8c810b09c233.js +12 -0
  29. package/dist/public/js/emuiAppBridge.e4cfaa7d8c810b09c233.js.br +0 -0
  30. package/dist/public/js/emuiAppBridge.e4cfaa7d8c810b09c233.js.gz +0 -0
  31. package/dist/public/js/emuiAppBridge.e4cfaa7d8c810b09c233.js.map +1 -0
  32. package/dist/types/lib/appBridge.d.ts +6 -6
  33. package/dist/types/lib/appRegistry.d.ts +1 -1
  34. package/dist/types/lib/config/app.d.ts +1 -1
  35. package/dist/types/lib/config/microFE.d.ts +2 -2
  36. package/dist/types/lib/eventManager.d.ts +3 -3
  37. package/dist/types/lib/loaders/script.d.ts +1 -1
  38. package/dist/types/lib/loaders/style.d.ts +1 -1
  39. package/dist/types/lib/microfeHost.d.ts +5 -6
  40. package/dist/types/lib/tests/scriptingObjects/analytics.d.ts +5 -5
  41. package/dist/types/lib/tests/scriptingObjects/appraisalServiceModule.d.ts +8 -5
  42. package/dist/types/lib/tests/scriptingObjects/global.d.ts +1 -1
  43. package/dist/types/lib/tests/server.d.ts +1 -1
  44. package/dist/types/lib/tests/serverHandlers.d.ts +1 -1
  45. package/dist/types/lib/tests/utils.d.ts +64 -2
  46. package/dist/types/lib/typings/appInfo.d.ts +1 -1
  47. package/dist/types/lib/typings/common.d.ts +10 -0
  48. package/dist/types/lib/typings/guest.d.ts +6 -6
  49. package/dist/types/lib/typings/host.d.ts +4 -4
  50. package/dist/types/lib/typings/index.d.ts +1 -1
  51. package/dist/types/lib/typings/window.d.ts +4 -4
  52. package/dist/types/tsconfig.tsbuildinfo +1 -1
  53. package/dist/umd/index.js +9 -14
  54. package/dist/umd/index.js.br +0 -0
  55. package/dist/umd/index.js.gz +0 -0
  56. package/dist/umd/index.js.map +1 -1
  57. package/package.json +12 -11
  58. package/dist/public/js/emuiAppBridge.57ee9e3892a5a9c5af74.js +0 -17
  59. package/dist/public/js/emuiAppBridge.57ee9e3892a5a9c5af74.js.br +0 -0
  60. package/dist/public/js/emuiAppBridge.57ee9e3892a5a9c5af74.js.gz +0 -0
  61. package/dist/public/js/emuiAppBridge.57ee9e3892a5a9c5af74.js.map +0 -1
@@ -1,9 +1,9 @@
1
- import { Logger } from '@elliemae/pui-diagnostics';
2
- import { Events, ScriptingObjectTypes, IScriptingObjectProxy } from '@elliemae/pui-scripting-object';
3
- import { EventListeners, AddScriptingObjectParams, DispatchEventParam, EventOptions, ScriptingObjects } from '@elliemae/microfe-common';
4
- import { IMicroFEGuest } from './typings/guest.js';
5
- import { OpenAppParams } from './typings/host.js';
6
- import { ValueOf } from './typings/common.js';
1
+ import type { Logger } from '@elliemae/pui-diagnostics';
2
+ import { type Events, type ScriptingObjectTypes, type IScriptingObjectProxy } from '@elliemae/pui-scripting-object';
3
+ import { type EventListeners, type AddScriptingObjectParams, type DispatchEventParam, type EventOptions, type ScriptingObjects } from '@elliemae/microfe-common';
4
+ import type { IMicroFEGuest } from './typings/guest.js';
5
+ import type { OpenAppParams } from './typings/host.js';
6
+ import type { ValueOf } from './typings/common.js';
7
7
  /**
8
8
  * AppBridge constructor parameter
9
9
  */
@@ -1,4 +1,4 @@
1
- import { IMicroFEGuest } from './typings/guest.js';
1
+ import type { IMicroFEGuest } from './typings/guest.js';
2
2
  export declare class CAppRegistry {
3
3
  #private;
4
4
  constructor();
@@ -1,4 +1,4 @@
1
- import { SecurityContext } from '../typings/common.js';
1
+ import type { SecurityContext } from '../typings/common.js';
2
2
  /**
3
3
  * service configuration
4
4
  */
@@ -1,5 +1,5 @@
1
- import { AppInfo } from '../typings/appInfo.js';
2
- import { CAppConfig } from './app.js';
1
+ import type { AppInfo } from '../typings/appInfo.js';
2
+ import { type CAppConfig } from './app.js';
3
3
  export declare class CMicroFEConfig {
4
4
  #private;
5
5
  init: ({ version, appConfig, }: {
@@ -1,5 +1,5 @@
1
- import { Logger } from '@elliemae/pui-diagnostics';
2
- import { IScriptingObject, Events } from '@elliemae/pui-scripting-object';
1
+ import type { Logger } from '@elliemae/pui-diagnostics';
2
+ import type { IScriptingObject, Events, IScriptingObjectProxy } from '@elliemae/pui-scripting-object';
3
3
  import type { EventListeners, Listener, SubscribeParam, UnsubscribeParam, DispatchEventParam, EventOptions, FilterCriteria } from '@elliemae/microfe-common';
4
4
  /**
5
5
  * details of an event listener
@@ -12,7 +12,7 @@ type EventListenerDetails = {
12
12
  /**
13
13
  * event listener
14
14
  */
15
- callback: Listener<any, any, any, any>;
15
+ callback: Listener<IScriptingObjectProxy, Record<string, unknown>, Record<string, unknown>, unknown>;
16
16
  /**
17
17
  * subscription id
18
18
  */
@@ -1,4 +1,4 @@
1
- import { Logger } from '@elliemae/pui-diagnostics';
1
+ import type { Logger } from '@elliemae/pui-diagnostics';
2
2
  export declare const APP_SCRIPT_ID_PREFIX = "ice-script-";
3
3
  type LoadOptions = {
4
4
  name: string;
@@ -1,4 +1,4 @@
1
- import { Logger } from '@elliemae/pui-diagnostics';
1
+ import type { Logger } from '@elliemae/pui-diagnostics';
2
2
  export declare const APP_STYLE_ID_PREFIX = "ice-style-";
3
3
  type LoadOptions = {
4
4
  name: string;
@@ -1,9 +1,8 @@
1
- import { Events, ScriptingObjectTypes } from '@elliemae/pui-scripting-object';
2
- import { Logger } from '@elliemae/pui-diagnostics';
3
- import type { EventListeners, GuestContext, SubscribeParam, UnsubscribeParam } from '@elliemae/microfe-common';
4
- import { ScriptingObjectManager, ScriptingObjects } from '@elliemae/microfe-common';
5
- import { EventManager } from './eventManager.js';
6
- import { IMicroFEHost, AppWindowSize } from './typings/host.js';
1
+ import type { Events, ScriptingObjectTypes } from '@elliemae/pui-scripting-object';
2
+ import type { Logger } from '@elliemae/pui-diagnostics';
3
+ import type { EventListeners, GuestContext, SubscribeParam, UnsubscribeParam, ScriptingObjectManager, ScriptingObjects } from '@elliemae/microfe-common';
4
+ import type { EventManager } from './eventManager.js';
5
+ import type { IMicroFEHost, AppWindowSize } from './typings/host.js';
7
6
  /**
8
7
  * Constructor parameters for the host application
9
8
  */
@@ -1,12 +1,12 @@
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();
5
- deleteTimingEventSamplingRatio: (names: string[]) => void;
5
+ deleteTimingEventSamplingRatio: (_names: string[]) => void;
6
6
  getAllTimingEventSamplingRatios: () => {};
7
- getTimingEventSamplingRatio: (names: string[]) => {};
8
- setTimingEventSamplingRatio: (ratios: Record<string, number>) => void;
9
- sendBAEvent: (event: BAEvent) => Promise<void>;
7
+ getTimingEventSamplingRatio: (_names: string[]) => {};
8
+ setTimingEventSamplingRatio: (_ratios: Record<string, number>) => void;
9
+ sendBAEvent: (_event: BAEvent) => Promise<void>;
10
10
  startTiming: (name: string, options: TimingOptions) => Promise<PerformanceMark>;
11
11
  endTiming: (start: string | PerfMark, options: TimingOptions) => Promise<void>;
12
12
  }
@@ -1,12 +1,15 @@
1
- import { IModule, Listener, Events, LogLevels, LogMessage } from '@elliemae/pui-scripting-object';
1
+ import { type IModule, type Listener, type Events, type LogLevels, type LogMessage } from '@elliemae/pui-scripting-object';
2
2
  import { ScriptingObject, Event } from '@elliemae/microfe-common';
3
+ export type AppraisalOnSavedEventParams = {
4
+ loanId: string;
5
+ tags?: string | string[];
6
+ creditScore?: number | string;
7
+ };
3
8
  export type AppraisalServiceEvents = {
4
9
  'appraisalservice.onprecommit': Listener<AppraisalService, {
5
10
  loanId: string;
6
11
  }, Record<string, unknown>, boolean>;
7
- 'appraisalservice.onsaved': Listener<AppraisalService, {
8
- loanId: string;
9
- }, Record<string, unknown>, void>;
12
+ 'appraisalservice.onsaved': Listener<AppraisalService, AppraisalOnSavedEventParams, Record<string, unknown>, void>;
10
13
  };
11
14
  export declare class AppraisalService extends ScriptingObject implements IModule {
12
15
  #private;
@@ -31,6 +34,6 @@ export declare class AppraisalService extends ScriptingObject implements IModule
31
34
  saveLoan: () => Promise<void>;
32
35
  commit: () => Promise<unknown>;
33
36
  delete: () => never;
34
- log: (message: string | LogMessage, level: keyof typeof LogLevels) => Promise<void>;
37
+ log: (_message: string | LogMessage, _level: keyof typeof LogLevels) => Promise<void>;
35
38
  unload: () => Promise<void>;
36
39
  }
@@ -1,4 +1,4 @@
1
- import { Events, IGlobal } from '@elliemae/pui-scripting-object';
1
+ import type { Events, IGlobal } from '@elliemae/pui-scripting-object';
2
2
  import { ScriptingObject, Event } from '@elliemae/microfe-common';
3
3
  export declare class Global extends ScriptingObject implements IGlobal {
4
4
  #private;
@@ -1 +1 @@
1
- export declare const initServer: () => import("msw/lib/glossary-2792c6da").K;
1
+ export declare const initServer: () => import("msw/node").SetupServer;
@@ -1,4 +1,4 @@
1
- import { RestHandler, DefaultBodyType, MockedRequest } from 'msw';
1
+ import { type RestHandler, type DefaultBodyType, type MockedRequest } from 'msw';
2
2
  type Handlers = Array<RestHandler<MockedRequest<DefaultBodyType>>>;
3
3
  export declare const getServerHandlers: () => Handlers;
4
4
  export declare const serverHandlers: RestHandler<MockedRequest<DefaultBodyType>>[];
@@ -1,5 +1,8 @@
1
- import { rest } from 'msw';
2
- import { InitParams, MountParams } from '../index.js';
1
+ import type { rest } from 'msw';
2
+ import { ScriptingObject } from '@elliemae/microfe-common';
3
+ import type { InitParams, MountParams } from '../index.js';
4
+ import type { IMicroFEGuest } from '../typings/guest.js';
5
+ import type { EMUI } from '../typings/window.js';
3
6
  export type Params = Parameters<Parameters<typeof rest.get>[1]>;
4
7
  export type TestGuestWindow = Window & typeof globalThis & {
5
8
  __TEST__: {
@@ -7,6 +10,65 @@ export type TestGuestWindow = Window & typeof globalThis & {
7
10
  mountOptions: MountParams;
8
11
  };
9
12
  };
13
+ /** Minimal guest registration payload for registry tests. */
14
+ export type MockGuestApp = Partial<Omit<IMicroFEGuest, 'guestWindow' | 'init' | 'mount' | 'unmount'>> & {
15
+ uuid: string;
16
+ init?: jest.Mock | (() => Promise<void>);
17
+ mount?: jest.Mock;
18
+ };
19
+ export type TestIframeWindow = Window & {
20
+ emui: EMUI;
21
+ };
22
+ export declare const getIframeWindow: (frame: HTMLIFrameElement) => TestIframeWindow;
23
+ export declare const getEmuiApps: (emui: EMUI, appId: string) => Array<Omit<IMicroFEGuest, "guestWindow">>;
24
+ export declare const setEmuiAppEntry: (emui: EMUI, appId: string, entry: MockGuestApp) => void;
25
+ export declare const clearWindowEmui: () => void;
26
+ /** Module scripting object shape used in self-initialize tests. */
27
+ export type TestModuleScriptingObject = {
28
+ getParameters: () => Promise<{
29
+ moduleId: string;
30
+ homeRoute: string;
31
+ }>;
32
+ _setUnloadHandler?: (handler: () => Promise<void>) => void;
33
+ };
34
+ export declare const createTestModuleSO: () => ScriptingObject & TestModuleScriptingObject;
35
+ export declare const expectInitHistoryShape: (history: InitParams["history"]) => void;
36
+ export declare const expectInitThemeShape: (theme: InitParams["theme"]) => void;
37
+ export declare const expectInitLoggerShape: (initLogger: InitParams["logger"]) => void;
38
+ export declare const snapshotInitOptionsPayload: (initOptions: InitParams) => {
39
+ logger: undefined;
40
+ history: {
41
+ action: import("history").Action;
42
+ location: import("history").Location;
43
+ } | undefined;
44
+ theme: {
45
+ breakpoints: import("@elliemae/pui-theme").BreakPoints;
46
+ colors: import("node_modules/@elliemae/pui-theme/dist/types/lib/theme-type.js").Colors;
47
+ fontSizes: import("node_modules/@elliemae/pui-theme/dist/types/lib/theme-type.js").FontSizes;
48
+ fontWeights: import("node_modules/@elliemae/pui-theme/dist/types/lib/theme-type.js").FontWeights;
49
+ fonts: import("node_modules/@elliemae/pui-theme/dist/types/lib/theme-type.js").Fonts;
50
+ letterSpacings: import("node_modules/@elliemae/pui-theme/dist/types/lib/theme-type.js").LetterSpacings;
51
+ lineHeights: import("node_modules/@elliemae/pui-theme/dist/types/lib/theme-type.js").LineHeights;
52
+ shadows: {
53
+ xs: string;
54
+ s: string;
55
+ m: string;
56
+ l: string;
57
+ xl: string;
58
+ };
59
+ space: import("node_modules/@elliemae/pui-theme/dist/types/lib/theme-type.js").Space;
60
+ zIndex: import("node_modules/@elliemae/pui-theme/dist/types/lib/theme-type.js").ZIndex;
61
+ } | undefined;
62
+ host: import("../index.js").IMicroFEHost<Partial<import("@elliemae/pui-scripting-object").ScriptingObjectTypes>, import("@elliemae/pui-scripting-object").Events>;
63
+ hostName?: string;
64
+ hostUrl?: string;
65
+ manifestPath?: string;
66
+ homeRoute?: string;
67
+ initialRoute?: import("history").To;
68
+ prevState?: Record<string, unknown> | null;
69
+ hostBreakpoint?: import("@elliemae/pui-theme").BreakPoint;
70
+ hostViewportSize?: import("../typings/guest.js").ViewportSize;
71
+ };
10
72
  export declare const getMajorMinorVersion: (version: string) => string;
11
73
  export declare const sendJS: (res: Params[1], ctx: Params[2], filePath: string) => Promise<import("msw").MockedResponse<import("msw").DefaultBodyType>>;
12
74
  export declare const sendJSText: (res: Params[1], ctx: Params[2], fileContent: string) => Promise<import("msw").MockedResponse<import("msw").DefaultBodyType>>;
@@ -1,4 +1,4 @@
1
- import { LaunchMode } from '../config/app.js';
1
+ import type { LaunchMode } from '../config/app.js';
2
2
  export type AppInfo = {
3
3
  id: string;
4
4
  name: string;
@@ -1,4 +1,14 @@
1
+ import type { CallerInfo, GuestContext } from '@elliemae/microfe-common';
1
2
  export type ValueOf<T> = T[keyof T];
3
+ /** Context attached to scripting object function invocations. */
4
+ export type CallContext = {
5
+ guest?: GuestContext;
6
+ callChain?: CallerInfo[];
7
+ };
8
+ /** Function that may carry host-verified caller context. */
9
+ export type CallableWithCallContext = ((...args: unknown[]) => unknown) & {
10
+ callContext?: CallContext;
11
+ };
2
12
  /**
3
13
  * security context under which the guest application is running
4
14
  */
@@ -1,10 +1,10 @@
1
- import { History, To } from 'history';
2
- import { DefaultTheme } from 'styled-components';
3
- import { Logger } from '@elliemae/pui-diagnostics';
4
- import { BreakPoint } from '@elliemae/pui-theme';
5
- import { ScriptingObjectTypes, Events } from '@elliemae/pui-scripting-object';
1
+ import type { History, To } from 'history';
2
+ import type { DefaultTheme } from 'styled-components';
3
+ import type { Logger } from '@elliemae/pui-diagnostics';
4
+ import type { BreakPoint } from '@elliemae/pui-theme';
5
+ import type { ScriptingObjectTypes, Events } from '@elliemae/pui-scripting-object';
6
6
  import type { EventListeners, ScriptingObjects } from '@elliemae/microfe-common';
7
- import { IMicroFEHost } from './host.js';
7
+ import type { IMicroFEHost } from './host.js';
8
8
  /**
9
9
  * Viewport size
10
10
  */
@@ -1,8 +1,8 @@
1
- import { History } from 'history';
2
- import { DefaultTheme } from 'styled-components';
3
- import { ScriptingObjectTypes, Events } from '@elliemae/pui-scripting-object';
1
+ import type { History } from 'history';
2
+ import type { DefaultTheme } from 'styled-components';
3
+ import type { ScriptingObjectTypes, Events } from '@elliemae/pui-scripting-object';
4
4
  import type { EventListeners, ScriptingObjects, SubscribeParam, UnsubscribeParam } from '@elliemae/microfe-common';
5
- import { FrameOptions } from '../frame.js';
5
+ import type { FrameOptions } from '../frame.js';
6
6
  export type AppWindowSize = {
7
7
  appId: string;
8
8
  size: {
@@ -1,2 +1,2 @@
1
- import { IScriptingObject } from '@elliemae/pui-scripting-object';
1
+ import type { IScriptingObject } from '@elliemae/pui-scripting-object';
2
2
  export type ScriptingObjects = Record<string, IScriptingObject>;
@@ -1,7 +1,7 @@
1
- import { BreakPoint } from '@elliemae/pui-theme';
2
- import { Logger } from '@elliemae/pui-diagnostics';
3
- import { IMicroFEGuest } from './guest.js';
4
- import { IMicroFEHost } from './host.js';
1
+ import { type BreakPoint } from '@elliemae/pui-theme';
2
+ import type { Logger } from '@elliemae/pui-diagnostics';
3
+ import type { IMicroFEGuest } from './guest.js';
4
+ import type { IMicroFEHost } from './host.js';
5
5
  export type EMUI = {
6
6
  [key: string]: Omit<IMicroFEGuest, 'guestWindow'> | Omit<IMicroFEGuest, 'guestWindow'>[];
7
7
  } & {