@elliemae/pui-app-sdk 5.21.0-beta.3 → 5.21.0-beta.5

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.
@@ -23,14 +23,18 @@ __export(app_bridge_exports, {
23
23
  module.exports = __toCommonJS(app_bridge_exports);
24
24
  var import_pui_app_bridge = require("@elliemae/pui-app-bridge");
25
25
  var import_logger = require("../logger.js");
26
+ var import_analytics = require("./scripting-objects/analytics.js");
26
27
  let appBridge = null;
27
28
  const getAppBridge = async () => {
28
29
  if (!appBridge) {
30
+ const logger = (0, import_logger.getLogger)();
31
+ const version = window.emui?.version || "latest";
29
32
  appBridge = new import_pui_app_bridge.CAppBridge({
30
- logger: (0, import_logger.getLogger)(),
31
- version: window.emui?.version || "latest"
33
+ logger,
34
+ version
32
35
  });
33
36
  await appBridge.init();
37
+ appBridge.addScriptingObject(new import_analytics.Analytics({ logger }));
34
38
  }
35
39
  return appBridge;
36
40
  };
@@ -108,7 +108,7 @@ class CMicroAppGuest {
108
108
  }
109
109
  static getInstance(params) {
110
110
  if (!this.instance) {
111
- this.instance = new this(params);
111
+ this.instance = new CMicroAppGuest(params);
112
112
  }
113
113
  return this.instance;
114
114
  }
@@ -107,7 +107,7 @@ class CMicroAppHost {
107
107
  }
108
108
  static getInstance(params) {
109
109
  if (!this.instance) {
110
- this.instance = new this(params);
110
+ this.instance = new CMicroAppHost(params);
111
111
  }
112
112
  return this.instance;
113
113
  }
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  var __export = (target, all) => {
9
7
  for (var name in all)
@@ -17,25 +15,17 @@ var __copyProps = (to, from, except, desc) => {
17
15
  }
18
16
  return to;
19
17
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
19
  var analytics_exports = {};
30
20
  __export(analytics_exports, {
31
21
  Analytics: () => Analytics
32
22
  });
33
23
  module.exports = __toCommonJS(analytics_exports);
34
- var import_em_ssf_host = __toESM(require("@elliemae/em-ssf-host"));
24
+ var import_ssf_host = require("@elliemae/ssf-host");
35
25
  var import_web_analytics = require("./web-analytics.js");
36
26
  var import_helpers = require("../../helpers.js");
37
27
  var import_headSampler = require("../../headSampler.js");
38
- class Analytics extends import_em_ssf_host.default.ScriptingObject {
28
+ class Analytics extends import_ssf_host.ScriptingObject {
39
29
  /**
40
30
  * logger instance
41
31
  */
@@ -1,13 +1,17 @@
1
1
  import { CAppBridge } from "@elliemae/pui-app-bridge";
2
2
  import { getLogger } from "../logger.js";
3
+ import { Analytics } from "./scripting-objects/analytics.js";
3
4
  let appBridge = null;
4
5
  const getAppBridge = async () => {
5
6
  if (!appBridge) {
7
+ const logger = getLogger();
8
+ const version = window.emui?.version || "latest";
6
9
  appBridge = new CAppBridge({
7
- logger: getLogger(),
8
- version: window.emui?.version || "latest"
10
+ logger,
11
+ version
9
12
  });
10
13
  await appBridge.init();
14
+ appBridge.addScriptingObject(new Analytics({ logger }));
11
15
  }
12
16
  return appBridge;
13
17
  };
@@ -75,7 +75,7 @@ class CMicroAppGuest {
75
75
  }
76
76
  static getInstance(params) {
77
77
  if (!this.instance) {
78
- this.instance = new this(params);
78
+ this.instance = new CMicroAppGuest(params);
79
79
  }
80
80
  return this.instance;
81
81
  }
@@ -92,7 +92,7 @@ class CMicroAppHost {
92
92
  }
93
93
  static getInstance(params) {
94
94
  if (!this.instance) {
95
- this.instance = new this(params);
95
+ this.instance = new CMicroAppHost(params);
96
96
  }
97
97
  return this.instance;
98
98
  }
@@ -1,8 +1,8 @@
1
- import ssfHost from "@elliemae/em-ssf-host";
1
+ import { ScriptingObject } from "@elliemae/ssf-host";
2
2
  import { getBAEventParameters } from "./web-analytics.js";
3
3
  import { getProductAppDetails } from "../../helpers.js";
4
4
  import { HeadSampler } from "../../headSampler.js";
5
- class Analytics extends ssfHost.ScriptingObject {
5
+ class Analytics extends ScriptingObject {
6
6
  /**
7
7
  * logger instance
8
8
  */
@@ -35,7 +35,7 @@ export declare class CMicroAppGuest<AppObjects extends ScriptingObjects = Partia
35
35
  private readonly onUnmount?;
36
36
  private readonly onGetRef?;
37
37
  private constructor();
38
- static getInstance(params?: ConstructorParams): CMicroAppGuest<Partial<ScriptingObjectTypes>, Events>;
38
+ static getInstance<AppObjects extends ScriptingObjects = Partial<ScriptingObjectTypes>, AppEvents extends EventListeners = Events>(params?: ConstructorParams): CMicroAppGuest<AppObjects, AppEvents>;
39
39
  static isInitialized(): boolean;
40
40
  static isHosted(): boolean;
41
41
  getHost(): IMicroAppHost<Partial<ScriptingObjectTypes>, Events> | IMicroFEHost<Partial<ScriptingObjectTypes>, Events> | SSFGuest<Partial<ScriptingObjectTypes>, Events> | undefined;
@@ -1,7 +1,7 @@
1
1
  import { History, To } from 'history';
2
2
  import { DefaultTheme } from 'styled-components';
3
3
  import { IMicroAppHost, ResizeEventHandler, BreakpointChangeEventHandler, SubscriptionListener } from '@elliemae/pui-micro-frontend-base';
4
- import ssfHost from '@elliemae/em-ssf-host';
4
+ import { SSFHost } from '@elliemae/ssf-host';
5
5
  import { BAEvent, ScriptingObjectTypes, Events } from '@elliemae/pui-scripting-object';
6
6
  import type { ScriptingObjects, EventListeners, AddScriptingObjectParams, DispatchEventParam, EventOptions } from '@elliemae/microfe-common';
7
7
  import { MicroFrontEndLogger } from '../types.js';
@@ -20,7 +20,7 @@ type ConstructorParams = {
20
20
  scriptingObjects?: Record<string, any>;
21
21
  onRenewSessionTimer?: () => void;
22
22
  onInit?: OnInitCallback;
23
- ssfHostRef?: typeof ssfHost.Host;
23
+ ssfHostRef?: SSFHost<ScriptingObjectTypes, Events> | null;
24
24
  analytics?: Analytics;
25
25
  };
26
26
  export declare class CMicroAppHost<AppObjects extends ScriptingObjects = Partial<ScriptingObjectTypes>, AppEvents extends EventListeners = Events> implements IMicroAppHost<AppObjects, AppEvents> {
@@ -35,25 +35,25 @@ export declare class CMicroAppHost<AppObjects extends ScriptingObjects = Partial
35
35
  private readonly throttleRenewSessionTimer;
36
36
  scriptingObjects: Record<string, any>;
37
37
  private constructor();
38
- static getInstance(params?: ConstructorParams): CMicroAppHost<Partial<ScriptingObjectTypes>, Events>;
38
+ static getInstance<AppObjects extends ScriptingObjects = Partial<ScriptingObjectTypes>, AppEvents extends EventListeners = Events>(params?: ConstructorParams): CMicroAppHost<AppObjects, AppEvents>;
39
39
  static isInitialized(): boolean;
40
- getProps(this: CMicroAppHost): HostOptions;
41
- getLogger(this: CMicroAppHost): MicroFrontEndLogger;
40
+ getProps(): HostOptions;
41
+ getLogger(): MicroFrontEndLogger;
42
42
  getItem(key: string): string | null;
43
43
  setItem(key: string, value: string): void;
44
- getGuests(this: CMicroAppHost): Record<string, unknown>;
44
+ getGuests(): Record<string, unknown>;
45
45
  getGuest<T>(id: string): T | null;
46
46
  publish<Type>(message: string | symbol, data?: Type): boolean;
47
47
  subscribe<T>(message: string | symbol, func: SubscriptionListener<T>): string;
48
48
  unsubscribe(token: string): void;
49
- navigate(this: CMicroAppHost, url: To, state?: any): void;
49
+ navigate(url: To, state?: any): void;
50
50
  openWaitMessage(): void;
51
51
  closeWaitMessage(): void;
52
52
  openErrorBanner(message: string): void;
53
53
  getAuthToken(): string;
54
54
  renewAuthToken(): string;
55
55
  logout(): void;
56
- renewSessionTimer(this: CMicroAppHost): Promise<void>;
56
+ renewSessionTimer(): Promise<void>;
57
57
  getBreakpoint(): keyof import("@elliemae/pui-theme").BreakPoints;
58
58
  getViewportSize(): {
59
59
  width: number;
@@ -1,4 +1,4 @@
1
- import ssfHost from '@elliemae/em-ssf-host';
1
+ import { ScriptingObject } from '@elliemae/ssf-host';
2
2
  import { IAnalytics, BAEvent, TimingOptions } from '@elliemae/pui-scripting-object';
3
3
  import { MicroFrontEndLogger } from '../../types.js';
4
4
  /**
@@ -19,7 +19,7 @@ type AnalyticsParams = {
19
19
  /**
20
20
  * Analytics scripting object
21
21
  */
22
- export declare class Analytics extends ssfHost.ScriptingObject implements IAnalytics {
22
+ export declare class Analytics extends ScriptingObject implements IAnalytics {
23
23
  #private;
24
24
  /**
25
25
  * Creates new instance of Analytics scripting object