@openfin/workspace 14.1.0 → 14.1.2

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/README.md CHANGED
@@ -4,8 +4,8 @@ The Workspace Client APIs enable custom integrations with OpenFin Workspace.
4
4
 
5
5
  ## Prerequisites
6
6
 
7
- - [Node.js](https://nodejs.org/en/) v16.0.0 or higher
8
- - [npm](https://www.npmjs.com/)
7
+ - [Node.js](https://nodejs.org/en/) v16.0.0 or higher
8
+ - [npm](https://www.npmjs.com/)
9
9
 
10
10
  ## Install
11
11
 
@@ -27,8 +27,8 @@ Prior to using Workspace, a Workspace Platform must be initialized.
27
27
 
28
28
  ### Home API
29
29
 
30
- - [Overview](https://developers.openfin.co/of-docs/docs/cli-providers)
31
- - [API Reference](https://developer.openfin.co/workspace/docs/api/latest/modules/home.html)
30
+ - [Overview](https://developers.openfin.co/of-docs/docs/cli-providers)
31
+ - [API Reference](https://developer.openfin.co/workspace/docs/api/latest/modules/home.html)
32
32
 
33
33
  ```ts
34
34
  import Home, CLIProvider from '@openfin/workspace';
@@ -64,8 +64,8 @@ searchButton.addEventListener('click', () => {
64
64
 
65
65
  ### Storefront API
66
66
 
67
- - [Overview](https://developers.openfin.co/of-docs/docs/provide-storefront-content)
68
- - [API Reference](https://developer.openfin.co/workspace/docs/api/latest/modules/store.html)
67
+ - [Overview](https://developers.openfin.co/of-docs/docs/provide-storefront-content)
68
+ - [API Reference](https://developer.openfin.co/workspace/docs/api/latest/modules/store.html)
69
69
 
70
70
  ```ts
71
71
  import { Storefront, StorefrontProvider } from "@openfin/workspace";
@@ -97,8 +97,8 @@ await Storefront.show();
97
97
 
98
98
  ### Dock API
99
99
 
100
- - [Overview](https://developers.openfin.co/of-docs/docs/dock-overview)
101
- - [API Reference](https://developer.openfin.co/workspace/docs/api/latest/modules/dock.html)
100
+ - [Overview](https://developers.openfin.co/of-docs/docs/dock-overview)
101
+ - [API Reference](https://developer.openfin.co/workspace/docs/api/latest/modules/dock.html)
102
102
 
103
103
  ```ts
104
104
  const provider: DockProvider = {
@@ -154,7 +154,7 @@ await Dock.show();
154
154
 
155
155
  ## For more information
156
156
 
157
- - [Developer guide](https://developers.openfin.co/of-docs/docs/overview-of-workspace).
158
- - [API reference](https://developer.openfin.co/workspace/docs/api/latest/index.html).
159
- - See the [workspace-starter](https://github.com/built-on-openfin/workspace-starter) project for example code.
160
- - See the [versions page](https://developer.openfin.co/versions/#/?product=Workspace) for a list of all available versions.
157
+ - [Developer guide](https://developers.openfin.co/of-docs/docs/overview-of-workspace).
158
+ - [API reference](https://developer.openfin.co/workspace/docs/api/latest/index.html).
159
+ - See the [workspace-starter](https://github.com/built-on-openfin/workspace-starter) project for example code.
160
+ - See the [versions page](https://developer.openfin.co/versions/#/?product=Workspace) for a list of all available versions.
@@ -1,5 +1,5 @@
1
1
  import type { DockProvider } from './shapes/dock';
2
- import { DockProviderRegistration } from './shapes/dock';
2
+ import { type DockProviderRegistration } from './shapes/dock';
3
3
  export * from './shapes/dock';
4
4
  /**
5
5
  * API function to register a Dock provider.
@@ -1,5 +1,6 @@
1
+ import { withDisconnectListener } from '../../../../../common/src/utils/channels';
1
2
  import { SearchAPIClientChannelClient } from '../../../../../common/src/api/protocol/shapes/search';
2
- type HomeWorkspaceAPIClientChannelClient = SearchAPIClientChannelClient & {
3
+ type HomeWorkspaceAPIClientChannelClient = withDisconnectListener<SearchAPIClientChannelClient> & {
3
4
  homeChannelActionsRegistered?: boolean;
4
5
  };
5
6
  export declare function registerHomeChannelClientActions(channel: HomeWorkspaceAPIClientChannelClient): void;
@@ -1,12 +1,12 @@
1
- import type { NotificationsPlatform, NotificationsRegistration } from './shapes/notifications';
2
- export * from 'openfin-notifications';
1
+ import * as Notifications from 'openfin-notifications/dist/client/without-auto-launch';
2
+ import type { NotificationsPlatform, NotificationsRegisterOptions } from './shapes/notifications';
3
+ export * from 'openfin-notifications/dist/client/without-auto-launch';
3
4
  export * from './shapes/notifications';
4
5
  /**
5
- * Registers notifications platform. Throws if workspace platform is not initialized or if you run version of notifications-service which doesn't support platforms.
6
- *
7
- * @param platform {@link NotificationsPlatform} object
6
+ * @deprecated
8
7
  */
9
- export declare const register: (platform: NotificationsPlatform) => Promise<NotificationsRegistration>;
8
+ export declare function register(platform?: NotificationsPlatform): Promise<Notifications.NotificationsRegistration>;
9
+ export declare function register(platform?: NotificationsRegisterOptions): Promise<Notifications.NotificationsRegistration>;
10
10
  /**
11
11
  * Deregisters notifications platform. Throws if you run version of notifications-service which doesn't support platforms.
12
12
  * @param platformId id of the platform to deregister
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * This module exports only notifications types that are not defined in 'openfin-notifications' npm package
3
3
  */
4
- import type { NotificationPlatform as NotificationsPlatformInternal } from 'openfin-notifications';
5
4
  /**
6
5
  * Platform object to pass to `register` function.
7
6
  *
@@ -17,11 +16,24 @@ import type { NotificationPlatform as NotificationsPlatformInternal } from 'open
17
16
  * await register(platform);
18
17
  * ```
19
18
  */
20
- export type NotificationsPlatform = Omit<NotificationsPlatformInternal, 'theme'>;
21
- /**
22
- * Registration meta info returned by {@link register}
23
- */
24
- export type NotificationsRegistration = {
25
- clientAPIVersion: string;
26
- notificationsVersion: string;
27
- };
19
+ export interface NotificationsPlatform {
20
+ /**
21
+ * Unique identifier of the platform.
22
+ */
23
+ id: string;
24
+ /**
25
+ * Stream title.
26
+ *
27
+ * Providing a different displayName for an existing stream id will update the
28
+ * displayName of the stream stored in Notification Center.
29
+ *
30
+ */
31
+ title: string;
32
+ /**
33
+ * URL of the icon to be displayed for this platform.
34
+ */
35
+ icon: string;
36
+ }
37
+ export interface NotificationsRegisterOptions {
38
+ notificationsPlatformOptions?: NotificationsPlatform;
39
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Get the browser base url override if it exists
3
+ *
4
+ * @returns The browser base url override if it exists, otherwise null
5
+ */
6
+ export declare function getBrowserBaseUrl(): Promise<string | null>;
@@ -1525,6 +1525,8 @@ export interface WorkspacePlatformInitConfig {
1525
1525
  /**
1526
1526
  * Customize the Looks and Feel of the Workspace Platform by providing a custom palette.
1527
1527
  *
1528
+ * The `backgroundPrimary` color **must** be either a hex, rgb, rgba, hsl, or hsla value.
1529
+ *
1528
1530
  * Two palettes are provided by default: `light` and `dark`.
1529
1531
  * The `dark` palette is used by default.
1530
1532
  *
@@ -14,6 +14,7 @@ export interface Overrides {
14
14
  [key: string]: boolean;
15
15
  };
16
16
  disableRuntimeValidation: boolean;
17
+ browserBaseUrl: string;
17
18
  disableOpenFinAnalytics: boolean;
18
19
  analyticsEndpoint: string;
19
20
  }
@@ -1,7 +1,7 @@
1
1
  import type OpenFin from '@openfin/core';
2
2
  export declare const getWindowChannelId: (identity: OpenFin.Identity) => string;
3
3
  export interface ChannelClient extends OpenFin.ChannelClient {
4
- dispatch: (action: typeof BrowserChannelAction[keyof BrowserChannelAction], payload?: any) => Promise<any>;
4
+ dispatch: (action: (typeof BrowserChannelAction)[keyof BrowserChannelAction], payload?: any) => Promise<any>;
5
5
  }
6
6
  export declare const getChannelClient: (identity: OpenFin.Identity) => Promise<ChannelClient>;
7
7
  /**
@@ -29,7 +29,8 @@ declare enum GeneralBrowserChannelActions {
29
29
  RemoveFromChannel = "remove-from-channel",
30
30
  OpenSaveModalInternal = "open-save-modal-internal",
31
31
  DuplicatePage = "duplicate-page",
32
- SetSelectedScheme = "set-selected-scheme"
32
+ SetSelectedScheme = "set-selected-scheme",
33
+ ShowBrowserIndicator = "show-browser-indicator"
33
34
  }
34
35
  /**
35
36
  * All of the remote procedures that can be called in the
@@ -68,6 +69,7 @@ export declare const BrowserChannelAction: {
68
69
  OpenSaveModalInternal: GeneralBrowserChannelActions.OpenSaveModalInternal;
69
70
  DuplicatePage: GeneralBrowserChannelActions.DuplicatePage;
70
71
  SetSelectedScheme: GeneralBrowserChannelActions.SetSelectedScheme;
72
+ ShowBrowserIndicator: GeneralBrowserChannelActions.ShowBrowserIndicator;
71
73
  };
72
74
  export type BrowserChannelAction = typeof BrowserChannelAction;
73
75
  export {};
@@ -1,3 +1,4 @@
1
+ import { withDisconnectListener } from '../../../../common/src/utils/channels';
1
2
  import { SearchAPIClientChannelClient } from '../../../../common/src/api/protocol/shapes/search';
2
3
  import type { WorkspaceAPIClientChannelClient, WorkspaceChannelProvider, WorkspaceComponentChannelClient } from './shapes/workspace';
3
4
  export type { WorkspaceAPIClientChannelClient, WorkspaceComponentChannelClient, WorkspaceChannelProvider };
@@ -5,7 +6,7 @@ export type { WorkspaceAPIClientChannelClient, WorkspaceComponentChannelClient,
5
6
  export declare const channelName: "__of_workspace_protocol__";
6
7
  export declare const getChannelClient: () => Promise<WorkspaceComponentChannelClient>;
7
8
  export declare const getClientAPIChannelClient: () => Promise<WorkspaceAPIClientChannelClient>;
8
- export declare const getSearchClientAPIChannelClient: () => Promise<SearchAPIClientChannelClient>;
9
+ export declare const getSearchClientAPIChannelClient: () => Promise<withDisconnectListener<SearchAPIClientChannelClient>>;
9
10
  /**
10
11
  * Launches the Workspace Provider.
11
12
  * If the Workspace Provider is already running, does nothing.
@@ -6,7 +6,7 @@ export interface InternalSearchListenerResponse {
6
6
  getRevokedBuffer(): string[];
7
7
  setRevokedBuffer(resultIds: string[]): void;
8
8
  getUpdatedContext(): any;
9
- setUpdatedContext(context: any): void;
9
+ setUpdatedContext(context: any | null): void;
10
10
  onChange(): void;
11
11
  getStatus(): InternalSearchListenerResponseStatus;
12
12
  res: HomeSearchListenerResponse;
@@ -1,4 +1,7 @@
1
1
  import type OpenFin from '@openfin/core';
2
+ export type withDisconnectListener<T> = T & {
3
+ addDisconnectionListener: (listener: () => void) => void;
4
+ };
2
5
  /**
3
6
  * Make a function that connects to a channel.
4
7
  * If already connected to the channel, will return the channel connection.
@@ -6,4 +9,4 @@ import type OpenFin from '@openfin/core';
6
9
  * @param channelName the name of the channel to connect to.
7
10
  * @returns the function to connect to the channel.
8
11
  */
9
- export default function makeGetChannelClient(channelName: string): () => Promise<OpenFin.ChannelClient>;
12
+ export default function makeGetChannelClient(channelName: string): () => Promise<withDisconnectListener<OpenFin.ChannelClient>>;
@@ -1,16 +1,27 @@
1
+ import { IndicatorType } from '../../../../common/src/components/Indicator/Indicator.constants';
1
2
  export declare enum BrowserIndicatorIcon {
2
3
  Locked = "LockClosedIcon",
3
4
  Unlocked = "LockOpen1Icon"
4
5
  }
6
+ export interface ShowBrowserIndicatorPayload {
7
+ type: IndicatorType;
8
+ message: string;
9
+ parentBrowserName?: string;
10
+ icon?: BrowserIndicatorIcon;
11
+ }
12
+ /**
13
+ * Creates a window containing a visual indicator
14
+ */
15
+ export declare function showBrowserIndicator(type: IndicatorType, message: string, parentBrowserName?: string, icon?: BrowserIndicatorIcon): Promise<any>;
5
16
  /**
6
17
  * Creates a window containing an error indicator
7
18
  */
8
- export declare function showBrowserError(message: string, parentBrowserName?: string, icon?: BrowserIndicatorIcon): Promise<void>;
19
+ export declare function showBrowserError(message: string, parentBrowserName?: string, icon?: BrowserIndicatorIcon): Promise<any>;
9
20
  /**
10
21
  * Creates a window containing a success indicator
11
22
  */
12
- export declare function showBrowserSuccess(message: string, parentBrowserName?: string, icon?: BrowserIndicatorIcon): Promise<void>;
23
+ export declare function showBrowserSuccess(message: string, parentBrowserName?: string, icon?: BrowserIndicatorIcon): Promise<any>;
13
24
  /**
14
25
  * Creates a window containing an info indicator
15
26
  */
16
- export declare function showBrowserInfo(message: string, parentBrowserName?: string, icon?: BrowserIndicatorIcon): Promise<void>;
27
+ export declare function showBrowserInfo(message: string, parentBrowserName?: string, icon?: BrowserIndicatorIcon): Promise<any>;
@@ -0,0 +1,18 @@
1
+ type WorkspacePerformanceMarks = 'home-registration' | 'dock-registration' | 'store-registration';
2
+ /**
3
+ * @classdesc
4
+ * WorkspacePerformance is a class that provides a set of methods to measure performance of workspace
5
+ *
6
+ */
7
+ declare class WorkspacePerformance {
8
+ markStart(markName: WorkspacePerformanceMarks): void;
9
+ markEnd(markName: WorkspacePerformanceMarks): void;
10
+ markEndAndMeasure(markName: WorkspacePerformanceMarks): void;
11
+ reportWorkspacePerformanceEntries(): PerformanceEntry[];
12
+ reportWorkspacePerformance(): {
13
+ name: string;
14
+ duration: number;
15
+ }[];
16
+ }
17
+ declare const workspacePerformance: WorkspacePerformance;
18
+ export default workspacePerformance;