@elliemae/microfe-common 2.4.0 → 2.5.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.
@@ -1,6 +1,7 @@
1
+ import { ScriptingObjectTypes, Events } from '@elliemae/pui-scripting-object';
1
2
  import { LogLevels } from '@elliemae/pui-diagnostics';
2
- import type { IScriptingObjectProxy } from '@elliemae/pui-scripting-object';
3
3
  import { EventListeners, Listener } from './common.js';
4
+ import { ScriptingObjects } from './scriptingObjectManager.js';
4
5
  /**
5
6
  * parameters for connecting to the host
6
7
  */
@@ -39,7 +40,7 @@ export type UnsubscribeParam<EventId> = {
39
40
  /**
40
41
  * Interface for SSF guest
41
42
  */
42
- export interface ISSFGuest<AppEvents extends EventListeners> {
43
+ export interface ISSFGuest<AppObjects extends ScriptingObjects = Partial<ScriptingObjectTypes>, AppEvents extends EventListeners = Events> {
43
44
  /**
44
45
  * Initialize guest using script
45
46
  * @param scriptUri uri of the script
@@ -55,12 +56,17 @@ export interface ISSFGuest<AppEvents extends EventListeners> {
55
56
  * @param {ConnectParam} param - reference to the guest window or parameters
56
57
  */
57
58
  connect: (param?: ConnectParam) => Promise<void>;
59
+ /**
60
+ * Get bearer token to access api
61
+ * @returns auth token
62
+ */
63
+ getAuthToken: () => Promise<string | null>;
58
64
  /**
59
65
  * Get scripting object proxy by id
60
66
  * @param objectId unique id of the scripting object
61
67
  * @returns scripting object proxy
62
68
  */
63
- getObject: (objectId: string) => Promise<IScriptingObjectProxy>;
69
+ getObject: <Id extends Extract<keyof AppObjects, string>>(objectId: Id) => Promise<AppObjects[Id]>;
64
70
  /**
65
71
  * remove the guest from the host
66
72
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/microfe-common",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "common micro frontend functional modules",
5
5
  "repository": {
6
6
  "type": "git",
@@ -39,7 +39,7 @@
39
39
  "devDependencies": {
40
40
  "@elliemae/browserslist-config-elliemae-latest-browsers": "~1.8.0",
41
41
  "@elliemae/pui-diagnostics": "~3.4.1",
42
- "@elliemae/pui-scripting-object": "~1.31.3",
42
+ "@elliemae/pui-scripting-object": "~1.32.2",
43
43
  "@types/uuid": "~9.0.7"
44
44
  },
45
45
  "scripts": {