@elliemae/pui-app-bridge 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.
Files changed (115) hide show
  1. package/dist/cjs/appBridge.js +380 -93
  2. package/dist/cjs/appRegistry.js +136 -0
  3. package/dist/cjs/config/app.js +15 -2
  4. package/dist/cjs/config/microFE.js +3 -3
  5. package/dist/cjs/eventManager.js +16 -16
  6. package/dist/cjs/frame.html +2 -2
  7. package/dist/cjs/frame.js +39 -14
  8. package/dist/cjs/index.html +1 -1
  9. package/dist/cjs/loaders/script.js +5 -5
  10. package/dist/cjs/loaders/style.js +1 -0
  11. package/dist/cjs/microfeHost.js +51 -31
  12. package/dist/cjs/tests/flights/23.1/app.checksum1.js +25 -24
  13. package/dist/cjs/tests/flights/latest/app.checksum.js +25 -24
  14. package/dist/cjs/tests/hotels/23.1/app.checksum.js +27 -24
  15. package/dist/cjs/tests/hotels/latest/app.checksum.js +27 -24
  16. package/dist/cjs/tests/loan/latest/index.js +49 -57
  17. package/dist/cjs/tests/scriptingObjects/analytics.js +7 -7
  18. package/dist/cjs/tests/scriptingObjects/appraisalServiceModule.js +8 -8
  19. package/dist/cjs/tests/scriptingObjects/global.js +1 -2
  20. package/dist/cjs/tests/task/latest/index.dev.js +29 -28
  21. package/dist/cjs/tests/task/latest/index.js +29 -28
  22. package/dist/cjs/tests/travelhub/23.1/app.checksum.js +24 -26
  23. package/dist/cjs/tests/travelhub/23.1/landing.checksum1.js +5 -7
  24. package/dist/cjs/utils.js +31 -1
  25. package/dist/esm/appBridge.js +390 -95
  26. package/dist/esm/appRegistry.js +116 -0
  27. package/dist/esm/config/app.js +15 -2
  28. package/dist/esm/config/microFE.js +3 -3
  29. package/dist/esm/eventManager.js +16 -16
  30. package/dist/esm/frame.html +2 -2
  31. package/dist/esm/frame.js +29 -14
  32. package/dist/esm/index.html +1 -1
  33. package/dist/esm/loaders/script.js +5 -5
  34. package/dist/esm/loaders/style.js +1 -0
  35. package/dist/esm/microfeHost.js +55 -31
  36. package/dist/esm/tests/flights/23.1/app.checksum1.js +25 -24
  37. package/dist/esm/tests/flights/latest/app.checksum.js +25 -24
  38. package/dist/esm/tests/hotels/23.1/app.checksum.js +27 -24
  39. package/dist/esm/tests/hotels/latest/app.checksum.js +27 -24
  40. package/dist/esm/tests/loan/latest/index.js +49 -57
  41. package/dist/esm/tests/scriptingObjects/analytics.js +7 -7
  42. package/dist/esm/tests/scriptingObjects/appraisalServiceModule.js +8 -8
  43. package/dist/esm/tests/scriptingObjects/global.js +1 -2
  44. package/dist/esm/tests/task/latest/index.dev.js +29 -28
  45. package/dist/esm/tests/task/latest/index.js +29 -28
  46. package/dist/esm/tests/travelhub/23.1/app.checksum.js +24 -26
  47. package/dist/esm/tests/travelhub/23.1/landing.checksum1.js +5 -7
  48. package/dist/esm/utils.js +31 -1
  49. package/dist/public/assets/frame.671d9de68be598da64ca.html +47 -0
  50. package/dist/public/creditService/latest/creditService.checksum.js.gz +0 -0
  51. package/dist/public/frame.html +1 -1
  52. package/dist/public/guest/businessObjects.js.gz +0 -0
  53. package/dist/public/guest/util.js.gz +0 -0
  54. package/dist/public/index.html +1 -1
  55. package/dist/public/init.js.gz +0 -0
  56. package/dist/public/js/emuiAppBridge.2993b666256d6dd7148d.js +51 -0
  57. package/dist/public/js/emuiAppBridge.2993b666256d6dd7148d.js.br +0 -0
  58. package/dist/public/js/emuiAppBridge.2993b666256d6dd7148d.js.gz +0 -0
  59. package/dist/public/js/emuiAppBridge.2993b666256d6dd7148d.js.map +1 -0
  60. package/dist/public/loan-object.js +1 -1
  61. package/dist/public/loan-object.js.br +0 -0
  62. package/dist/public/loan-object.js.gz +0 -0
  63. package/dist/public/loan-object.js.map +1 -1
  64. package/dist/public/loanValidation/latest/loanValidation.checksum.js.gz +0 -0
  65. package/dist/public/pricingService/latest/pricingService.checksum.js.gz +0 -0
  66. package/dist/public/utils.js.gz +0 -0
  67. package/dist/types/lib/appBridge.d.ts +38 -28
  68. package/dist/types/lib/appRegistry.d.ts +41 -0
  69. package/dist/types/lib/eventManager.d.ts +4 -4
  70. package/dist/types/lib/frame.d.ts +45 -4
  71. package/dist/types/lib/index.d.ts +3 -3
  72. package/dist/types/lib/loaders/script.d.ts +2 -1
  73. package/dist/types/lib/microfeHost.d.ts +15 -25
  74. package/dist/types/lib/tests/flights/23.1/app.checksum1.d.ts +7 -0
  75. package/dist/types/lib/tests/flights/latest/app.checksum.d.ts +7 -0
  76. package/dist/types/lib/tests/hotels/23.1/app.checksum.d.ts +7 -0
  77. package/dist/types/lib/tests/hotels/latest/app.checksum.d.ts +7 -0
  78. package/dist/types/lib/tests/loan/latest/index.d.ts +11 -0
  79. package/dist/types/lib/tests/scriptingObjects/analytics.d.ts +3 -3
  80. package/dist/types/lib/tests/scriptingObjects/appraisalServiceModule.d.ts +2 -1
  81. package/dist/types/lib/tests/task/latest/index.d.ts +10 -0
  82. package/dist/types/lib/tests/task/latest/index.dev.d.ts +10 -0
  83. package/dist/types/lib/tests/travelhub/23.1/app.checksum.d.ts +7 -0
  84. package/dist/types/lib/tests/travelhub/23.1/landing.checksum1.d.ts +2 -0
  85. package/dist/types/lib/typings/appInfo.d.ts +1 -0
  86. package/dist/types/lib/typings/common.d.ts +0 -66
  87. package/dist/types/lib/typings/guest.d.ts +10 -3
  88. package/dist/types/lib/typings/host.d.ts +32 -32
  89. package/dist/types/lib/typings/window.d.ts +6 -1
  90. package/dist/types/lib/utils.d.ts +7 -0
  91. package/dist/types/tsconfig.tsbuildinfo +1 -1
  92. package/dist/umd/671d9de68be598da64ca.html +47 -0
  93. package/dist/umd/creditService/latest/creditService.checksum.js.gz +0 -0
  94. package/dist/umd/frame.html +1 -1
  95. package/dist/umd/guest/businessObjects.js.gz +0 -0
  96. package/dist/umd/guest/util.js.gz +0 -0
  97. package/dist/umd/index.html +1 -1
  98. package/dist/umd/index.js +35 -9
  99. package/dist/umd/index.js.br +0 -0
  100. package/dist/umd/index.js.gz +0 -0
  101. package/dist/umd/index.js.map +1 -1
  102. package/dist/umd/init.js.gz +0 -0
  103. package/dist/umd/loan-object.js +1 -1
  104. package/dist/umd/loan-object.js.br +0 -0
  105. package/dist/umd/loan-object.js.gz +0 -0
  106. package/dist/umd/loan-object.js.map +1 -1
  107. package/dist/umd/loanValidation/latest/loanValidation.checksum.js.gz +0 -0
  108. package/dist/umd/pricingService/latest/pricingService.checksum.js.gz +0 -0
  109. package/dist/umd/utils.js.gz +0 -0
  110. package/package.json +9 -12
  111. package/dist/public/js/emuiAppBridge.530390c3bb03f32357f7.js +0 -25
  112. package/dist/public/js/emuiAppBridge.530390c3bb03f32357f7.js.br +0 -0
  113. package/dist/public/js/emuiAppBridge.530390c3bb03f32357f7.js.gz +0 -0
  114. package/dist/public/js/emuiAppBridge.530390c3bb03f32357f7.js.map +0 -1
  115. package/dist/types/lib/tests/pubsubAPI.test.d.ts +0 -1
@@ -1,16 +1,8 @@
1
1
  import { History } from 'history';
2
2
  import { DefaultTheme } from 'styled-components';
3
3
  import { ScriptingObjectTypes, Events } from '@elliemae/pui-scripting-object';
4
- import type { EventListeners } from '@elliemae/microfe-common';
5
- import { ScriptingObjects, SubscribeParam, UnsubscribeParam } from './common.js';
4
+ import type { EventListeners, ScriptingObjects, SubscribeParam, UnsubscribeParam } from '@elliemae/microfe-common';
6
5
  import { FrameOptions } from '../frame.js';
7
- /**
8
- * event listner callback function
9
- * @typeParam T - type of the data
10
- * @param message - message
11
- * @param data - data
12
- */
13
- export type SubscriptionListener<T> = (message: string, data?: T) => void;
14
6
  export type AppWindowSize = {
15
7
  appId: string;
16
8
  size: {
@@ -22,11 +14,34 @@ export type AppWindowSize = {
22
14
  * Parameters to open a guest application
23
15
  */
24
16
  export type OpenAppParams = {
17
+ /**
18
+ * Unique identifier for the application
19
+ * This should be a globally unique identifier to avoid conflicts
20
+ * across different applications in the micro frontend ecosystem.
21
+ */
25
22
  id: string;
23
+ /**
24
+ * iframe options for the application
25
+ */
26
26
  frameOptions?: Partial<FrameOptions>;
27
+ /**
28
+ * browser history object to use for navigation
29
+ */
27
30
  history?: History;
31
+ /**
32
+ * ui theme for the application
33
+ */
28
34
  theme?: DefaultTheme;
29
- allowedScriptingObjects?: string[];
35
+ /**
36
+ * home route for the application
37
+ */
38
+ homeRoute?: string;
39
+ /**
40
+ * default route to navigate to when the application is opened.
41
+ * by default it is the home route defined by the application.
42
+ * This setting is useful only when the application doesn't share parent history
43
+ */
44
+ initialRoute?: string;
30
45
  };
31
46
  /**
32
47
  * Interface to connect and communicate with parent host
@@ -38,41 +53,26 @@ export interface IMicroFEHost<AppObjects extends ScriptingObjects = Partial<Scri
38
53
  * application release version
39
54
  */
40
55
  version: string;
41
- /**
42
- * add listener to the scripting object event
43
- * @param {SubscribeParam<EventId, EventType>} params - parameters to add event listener
44
- * @returns subscription id
45
- */
46
- addEventListener: <EventId extends Extract<keyof AppEvents, string>>(params: SubscribeParam<EventId, AppEvents[EventId]>) => string;
47
56
  /**
48
57
  * Get reference to the scripting object (or proxy) by name
49
58
  * @param name unique name of the scripting object
50
59
  * @returns scripting object reference
51
60
  */
52
61
  getObject<ObjectId extends Extract<keyof AppObjects, string>>(objectId: ObjectId): Promise<AppObjects[ObjectId] | null>;
53
- /**
54
- * removes listener from the scripting object event
55
- * @param {UnsubscribeParam<EventId>} params - parameters to remove event listener
56
- */
57
- removeEventListener: <EventId extends Extract<keyof AppEvents, string>>(params: UnsubscribeParam<EventId>) => void;
58
62
  /**
59
63
  * set the size of the guest application iframe window
60
64
  * @param {AppWindowSize} appSize window size of the application
61
65
  */
62
66
  setAppWindowSize(appSize: AppWindowSize): void;
63
67
  /**
64
- * subscribe to an scripting object event (deprecated)
65
- * @deprecated use addEventListener instead
66
- * @param eventId unique id of the event. The format is [scripting object name].[event name]
67
- * @param listener callback function to be called when the event is fired
68
- * @returns token to be used to unsubscribe
68
+ * add listener to the scripting object event
69
+ * @param {SubscribeParam<EventId, EventType>} params - parameters to add event listener
70
+ * @returns subscription id
69
71
  */
70
- subscribe<T>(eventId: string | symbol, listener: SubscriptionListener<T>): string;
72
+ subscribe: <EventId extends Extract<keyof AppEvents, string>>(params: SubscribeParam<EventId, AppEvents[EventId]>) => string;
71
73
  /**
72
- * unsubscribe from an scripting object event (deprecated)
73
- * @deprecated use removeEventListener instead
74
- * @param token unique token returned by subscribe
75
- * @param eventId unique id of the event. The format is [scripting object name].[event name]
74
+ * removes listener from the scripting object event
75
+ * @param {UnsubscribeParam<EventId>} params - parameters to remove event listener
76
76
  */
77
- unsubscribe(token: string, eventId?: string): void;
77
+ unsubscribe: <EventId extends Extract<keyof AppEvents, string>>(params: UnsubscribeParam<EventId>) => void;
78
78
  }
@@ -3,7 +3,7 @@ import { Logger } from '@elliemae/pui-diagnostics';
3
3
  import { IMicroFEGuest } from './guest.js';
4
4
  import { IMicroFEHost } from './host.js';
5
5
  export type EMUI = {
6
- [key: string]: Omit<IMicroFEGuest, 'guestWindow'>;
6
+ [key: string]: Omit<IMicroFEGuest, 'guestWindow'> | Omit<IMicroFEGuest, 'guestWindow'>[];
7
7
  } & {
8
8
  _BASE_PATH: string;
9
9
  _ASSET_PATH: string;
@@ -11,6 +11,11 @@ export type EMUI = {
11
11
  MicroAppHost?: IMicroFEHost;
12
12
  logger?: Logger;
13
13
  appId?: string;
14
+ registerApp?: (options: {
15
+ appId: string;
16
+ app: IMicroFEGuest;
17
+ }) => void;
18
+ unregisterApp?: (instanceId: string) => void;
14
19
  };
15
20
  declare global {
16
21
  interface Window {
@@ -1,4 +1,11 @@
1
+ import { IApplication } from '@elliemae/pui-scripting-object';
2
+ import { Logger } from '@elliemae/pui-diagnostics';
1
3
  export declare const removeDoubleSlash: (url: string) => string;
2
4
  export declare const getAbsoluteUrl: (url: string) => string;
3
5
  export declare const appendTrailingSlash: (url: string) => string;
6
+ export declare const appendPath: (base: string, path: string) => string;
4
7
  export declare const isJSDOM: () => boolean;
8
+ export declare const startKeepSessionAlive: ({ appObj, logger, }: {
9
+ appObj: IApplication;
10
+ logger: Logger;
11
+ }) => void;