@openfin/workspace-platform 13.0.7 → 13.1.1
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/client-api/src/index.d.ts +5 -0
- package/client-api/src/integrations/microsoft.d.ts +155 -0
- package/client-api/src/integrations/microsoft.shapes.d.ts +147 -0
- package/client-api/src/integrations/microsoft.utils.d.ts +80 -0
- package/client-api/src/integrations.d.ts +3 -0
- package/client-api/src/internal.d.ts +2 -2
- package/client-api/src/shapes/home.d.ts +71 -3
- package/client-api/src/shapes/integrations.d.ts +36 -0
- package/client-api-platform/src/api/context-menu/utils.d.ts +4 -0
- package/client-api-platform/src/api/dock/idb.d.ts +0 -1
- package/client-api-platform/src/shapes.d.ts +46 -9
- package/common/src/api/pages/shapes.d.ts +2 -0
- package/common/src/api/protocol/shapes/workspace.d.ts +157 -0
- package/common/src/api/protocol/workspace.d.ts +12 -58
- package/common/src/api/provider.d.ts +5 -1
- package/common/src/api/search.d.ts +1 -3
- package/common/src/api/storefront.d.ts +11 -0
- package/common/src/api/theming.d.ts +6 -0
- package/common/src/utils/a11y/search.a11y.d.ts +1 -0
- package/common/src/utils/global-context-menu.d.ts +3 -1
- package/common/src/utils/lru-cache.d.ts +11 -0
- package/common/src/utils/menu-window-provider.d.ts +14 -16
- package/common/src/utils/route.d.ts +22 -34
- package/common/src/utils/router/base.d.ts +2 -2
- package/common/src/utils/shared-emitter.d.ts +7 -6
- package/common/src/utils/types.d.ts +7 -0
- package/common/src/utils/usage-register.d.ts +3 -1
- package/common/src/utils/window.d.ts +27 -14
- package/index.js +56 -59
- package/index.js.map +1 -1
- package/package.json +4 -2
- package/search-api/src/client/index.d.ts +2 -2
- package/search-api/src/client/internal.d.ts +6 -6
- package/search-api/src/client/remote/channel-client-factory.d.ts +1 -2
- package/search-api/src/client/remote/channel-client.d.ts +4 -8
- package/search-api/src/client/remote/data.d.ts +3 -4
- package/search-api/src/client/remote/disconnect.d.ts +1 -4
- package/search-api/src/client/remote/dispatch.d.ts +2 -3
- package/search-api/src/client/remote/requests.d.ts +1 -4
- package/search-api/src/client/remote/search-close.d.ts +2 -5
- package/search-api/src/common.d.ts +19 -29
- package/search-api/src/fin/index.d.ts +2 -2
- package/search-api/src/fin/shapes.d.ts +4 -4
- package/search-api/src/index.d.ts +1 -1
- package/search-api/src/internal-shapes.d.ts +0 -19
- package/search-api/src/provider/index.d.ts +2 -3
- package/search-api/src/provider/internal.d.ts +5 -9
- package/search-api/src/provider/remote/channel-factory.d.ts +1 -2
- package/search-api/src/provider/remote/channel.d.ts +4 -11
- package/search-api/src/provider/remote/connection.d.ts +5 -8
- package/search-api/src/provider/remote/data.d.ts +3 -5
- package/search-api/src/provider/remote/deregistration.d.ts +1 -2
- package/search-api/src/provider/remote/disconnect.d.ts +1 -1
- package/search-api/src/provider/remote/disconnection.d.ts +5 -4
- package/search-api/src/provider/remote/dispatch.d.ts +2 -3
- package/search-api/src/provider/remote/info.d.ts +1 -1
- package/search-api/src/provider/remote/registration.d.ts +6 -8
- package/search-api/src/provider/remote/search-close.d.ts +3 -4
- package/search-api/src/provider/remote/search.d.ts +3 -4
- package/search-api/src/shapes.d.ts +6 -45
- package/common/src/api/home.d.ts +0 -19
- package/common/src/api/pages/legacy.d.ts +0 -16
|
@@ -5,6 +5,7 @@ import { CustomActionSpecifier, CustomButtonConfig } from '../../common/src/api/
|
|
|
5
5
|
import type { AttachedPage, Page, PageWithUpdatableRuntimeAttribs } from '../../common/src/api/pages/shapes';
|
|
6
6
|
import type { CustomThemes } from '../../common/src/api/theming';
|
|
7
7
|
import type { App, DockProviderConfigWithIdentity, StoreButtonConfig } from '../../client-api/src/shapes';
|
|
8
|
+
import { WorkflowIntegration } from '../../client-api/src/shapes/integrations';
|
|
8
9
|
export { AppManifestType } from '../../client-api/src/shapes';
|
|
9
10
|
export type { App, AppIntent, Image } from '../../client-api/src/shapes';
|
|
10
11
|
export type { CustomActionSpecifier, CustomButtonConfig } from '../../common/src/api/action';
|
|
@@ -45,6 +46,8 @@ export interface OpenGlobalContextMenuRequest {
|
|
|
45
46
|
y: number;
|
|
46
47
|
/** Miscellaneous options necessary for implementing custom logic in the provider override. */
|
|
47
48
|
customData?: any;
|
|
49
|
+
/** Identities of the currently selected views */
|
|
50
|
+
selectedViews?: OpenFin.Identity[];
|
|
48
51
|
}
|
|
49
52
|
/**Shape of the data property of a context menu template item */
|
|
50
53
|
export interface ContextMenuItemData {
|
|
@@ -58,6 +61,9 @@ export declare enum GlobalContextMenuOptionType {
|
|
|
58
61
|
NewPage = "NewPage",
|
|
59
62
|
SavePage = "SavePage",
|
|
60
63
|
SavePageAs = "SavePageAs",
|
|
64
|
+
Print = "Print",
|
|
65
|
+
PrintAll = "PrintAll",
|
|
66
|
+
PrintScreen = "PrintScreen",
|
|
61
67
|
CloseWindow = "CloseWindow",
|
|
62
68
|
RestoreChanges = "RestoreChanges",
|
|
63
69
|
SaveWorkspace = "SaveWorkspace",
|
|
@@ -213,6 +219,14 @@ export declare enum ViewTabMenuOptionType {
|
|
|
213
219
|
* Print the selected view.
|
|
214
220
|
*/
|
|
215
221
|
Print = "Print",
|
|
222
|
+
/**
|
|
223
|
+
* Prints visible views.
|
|
224
|
+
*/
|
|
225
|
+
PrintAll = "PrintAll",
|
|
226
|
+
/**
|
|
227
|
+
* Prints a screenshot of the browser window.
|
|
228
|
+
*/
|
|
229
|
+
PrintScreen = "PrintScreen",
|
|
216
230
|
/**
|
|
217
231
|
* Custom context menu option defined by API client.
|
|
218
232
|
*/
|
|
@@ -319,7 +333,7 @@ export interface CustomDropdownItemActionPayload {
|
|
|
319
333
|
* Custom browser buttons
|
|
320
334
|
*/
|
|
321
335
|
export interface CustomBrowserButtonConfig extends CustomButtonConfig {
|
|
322
|
-
/** Type of
|
|
336
|
+
/** Type of custom browser button */
|
|
323
337
|
type: BrowserButtonType.Custom;
|
|
324
338
|
}
|
|
325
339
|
/**
|
|
@@ -786,7 +800,7 @@ export interface BrowserWindowFactory {
|
|
|
786
800
|
* pages: [page],
|
|
787
801
|
* title: 'My Window Title',
|
|
788
802
|
* favicon: 'https://google.com/favicon.ico',
|
|
789
|
-
* disableMultiplePages: true, // disable page
|
|
803
|
+
* disableMultiplePages: true, // disable page functionality for the window
|
|
790
804
|
* toolbarOptions: { // configure the set of tray icons for the window
|
|
791
805
|
* buttons: [
|
|
792
806
|
* { // adding a custom tray icon for the window
|
|
@@ -826,7 +840,7 @@ export interface BrowserWindowFactory {
|
|
|
826
840
|
* disabled: false,
|
|
827
841
|
* iconUrl: 'https://www.openfin.co/favicon.ico',
|
|
828
842
|
* action: {
|
|
829
|
-
* // This action needs to be
|
|
843
|
+
* // This action needs to be registered in customActions property in the call WorkspacePlatform.init
|
|
830
844
|
* id: 'sample-window-state-custom-action',
|
|
831
845
|
* customData: {
|
|
832
846
|
* message: 'Clicked on custom Window State button'
|
|
@@ -1355,7 +1369,7 @@ export interface ApplyWorkspaceOptions {
|
|
|
1355
1369
|
*/
|
|
1356
1370
|
promptContainerWindowIdentity?: OpenFin.Identity;
|
|
1357
1371
|
/**
|
|
1358
|
-
* Options to apply the workspace
|
|
1372
|
+
* Options to apply the workspace snapshot with.
|
|
1359
1373
|
*/
|
|
1360
1374
|
applySnapshotOptions?: ApplySnapshotOptions;
|
|
1361
1375
|
}
|
|
@@ -1397,7 +1411,7 @@ export interface AnalyticsConfig {
|
|
|
1397
1411
|
export interface WorkspacePlatformInitConfig {
|
|
1398
1412
|
customActions?: CustomActionsMap;
|
|
1399
1413
|
/** Config for overriding browser options and behavior.
|
|
1400
|
-
* Set to null to
|
|
1414
|
+
* Set to null to initialize the platform without the browser
|
|
1401
1415
|
*/
|
|
1402
1416
|
browser?: BrowserInitConfig | null;
|
|
1403
1417
|
/** Custom Themes object
|
|
@@ -1458,6 +1472,29 @@ export interface WorkspacePlatformInitConfig {
|
|
|
1458
1472
|
* Config for Workspace Platform analytics
|
|
1459
1473
|
*/
|
|
1460
1474
|
analytics?: AnalyticsConfig;
|
|
1475
|
+
/**
|
|
1476
|
+
* Config for Workspace Platform Integrations
|
|
1477
|
+
*
|
|
1478
|
+
* @example
|
|
1479
|
+
* ```ts
|
|
1480
|
+
* import * as WorkspacePlatform from '@openfin/workspace-platform';
|
|
1481
|
+
* import { Integrations } from '@openfin/workspace';
|
|
1482
|
+
*
|
|
1483
|
+
* const microsoftIntegration = new Integrations.Microsoft365WorkflowIntegration({
|
|
1484
|
+
* connect: {
|
|
1485
|
+
* clientId: '',
|
|
1486
|
+
* redirectUri: '',
|
|
1487
|
+
* tenantId: ''
|
|
1488
|
+
* }
|
|
1489
|
+
* });
|
|
1490
|
+
*
|
|
1491
|
+
* await WorkspacePlatform.init({
|
|
1492
|
+
* browser: { },
|
|
1493
|
+
* integrations: [microsoftIntegration]
|
|
1494
|
+
* });
|
|
1495
|
+
* ```
|
|
1496
|
+
*/
|
|
1497
|
+
integrations?: WorkflowIntegration[];
|
|
1461
1498
|
}
|
|
1462
1499
|
/**
|
|
1463
1500
|
* Extend or replace default functionality in order to customize behavior of a Workspace Platform Provider.
|
|
@@ -1472,7 +1509,7 @@ export interface WorkspacePlatformInitConfig {
|
|
|
1472
1509
|
* WorkspacePlatformProvider
|
|
1473
1510
|
* ) => {
|
|
1474
1511
|
* class Override extends WorkspacePlatformProvider {
|
|
1475
|
-
* //
|
|
1512
|
+
* // Override the default behavior of updateSavedPage
|
|
1476
1513
|
* updateSavedPage = async (req: UpdateSavedPageRequest): Promise<void> => {
|
|
1477
1514
|
* console.log(`saving page ${req.page.pageId}`);
|
|
1478
1515
|
* // calling custom function to the save page here
|
|
@@ -1490,7 +1527,7 @@ export interface WorkspacePlatformInitConfig {
|
|
|
1490
1527
|
* data: {
|
|
1491
1528
|
* type: GlobalContextMenuOptionType.Custom,
|
|
1492
1529
|
* action: {
|
|
1493
|
-
* // This action needs to be
|
|
1530
|
+
* // This action needs to be registered in customActions property in the call WorkspacePlatform.init
|
|
1494
1531
|
* id: 'sample-custom-global-menu-action'
|
|
1495
1532
|
* }
|
|
1496
1533
|
* }
|
|
@@ -1516,7 +1553,7 @@ export interface WorkspacePlatformInitConfig {
|
|
|
1516
1553
|
* data: {
|
|
1517
1554
|
* type: ViewTabMenuOptionType.Custom,
|
|
1518
1555
|
* action: {
|
|
1519
|
-
* // This action needs to be
|
|
1556
|
+
* // This action needs to be registered in customActions property in the call WorkspacePlatform.init
|
|
1520
1557
|
* id: 'sample-viewtab-action',
|
|
1521
1558
|
* customData: 'Custom View Tab Action'
|
|
1522
1559
|
* }
|
|
@@ -1573,7 +1610,7 @@ export interface WorkspacePlatformInitConfig {
|
|
|
1573
1610
|
*
|
|
1574
1611
|
* await WorkspacePlatform.init({
|
|
1575
1612
|
* browser: {
|
|
1576
|
-
* title: "My
|
|
1613
|
+
* title: "My Workspace Platform"
|
|
1577
1614
|
* }
|
|
1578
1615
|
* overrideCallback,
|
|
1579
1616
|
* customActions: {
|
|
@@ -67,6 +67,8 @@ export interface Page {
|
|
|
67
67
|
};
|
|
68
68
|
/** Used to configure fixed views on the edges of the browser window. Only one panel per side is supported. */
|
|
69
69
|
panels?: PanelConfig[];
|
|
70
|
+
/** Optional property to attach custom metadata to the page object, such as version or timestamp. Must be serializable. */
|
|
71
|
+
customData?: any;
|
|
70
72
|
}
|
|
71
73
|
declare type AttachedPageMetadata = {
|
|
72
74
|
/** The window the page is currently attached to. */
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import type OpenFin from '@openfin/core';
|
|
2
|
+
import type { Awaitable } from '../../../../../common/src/utils/types';
|
|
3
|
+
import type { dockOFIdentity, homeOFIdentity, storefrontOFIdentity } from '../../../../../common/src/utils/window';
|
|
4
|
+
import type { ProviderChannelPayload, ProviderDeregisterPayload, ProviderInfoInternal, ProviderRegisterPayload, ProviderUpdatePayload } from '../../../../../common/src/api/provider';
|
|
5
|
+
import type { ClientAPILaunchStorefrontProviderAppRequest, LaunchStorefrontProviderAppRequest } from '../../../../../common/src/api/storefront';
|
|
6
|
+
import type { WorkspaceComponentSetSelectedSchemePayload } from '../../../../../common/src/api/theming';
|
|
7
|
+
import type { Workspace as LegacyWorkspace } from '../../../../../common/src/api/workspaces';
|
|
8
|
+
import type { HomeSearchListenerRequest, SearchQueryWithProviderID } from '../../../../../client-api/src/home';
|
|
9
|
+
import type { RegisterMetaInfoInternal } from '../../../../../client-api/src/index';
|
|
10
|
+
import type { StorefrontFooter, StorefrontLandingPage, StorefrontNavigationSection, UpdateButtonConfigRequest } from '../../../../../client-api/src/store';
|
|
11
|
+
import type { App, ColorSchemeOptionType, Page } from '../../../../../client-api-platform/src/shapes';
|
|
12
|
+
export declare type WorkspaceChannelAction = keyof WorkspaceChannelTypes;
|
|
13
|
+
/****** API Client Channel Actions ******/
|
|
14
|
+
/**
|
|
15
|
+
* Channel actions, related to store, **registered** by the Workspace Platform Provider e.g. Studio.
|
|
16
|
+
*/
|
|
17
|
+
declare type StoreAPIClientChannelActions = {
|
|
18
|
+
'get-storefront-provider-apps': (id: string) => Promise<App[]>;
|
|
19
|
+
'get-storefront-provider-footer': (id: string) => Promise<StorefrontFooter>;
|
|
20
|
+
'get-storefront-provider-landing-page': (id: string) => Promise<StorefrontLandingPage>;
|
|
21
|
+
'get-storefront-provider-navigation': (id: string) => Promise<[StorefrontNavigationSection?, StorefrontNavigationSection?, StorefrontNavigationSection?]>;
|
|
22
|
+
'launch-storefront-provider-app': (payload: ClientAPILaunchStorefrontProviderAppRequest) => Promise<void>;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Channel actions, related to dock, **registered** by the Workspace Platform Provider e.g. Studio.
|
|
26
|
+
*/
|
|
27
|
+
declare type DockAPIClientChannelActions = Record<string, never>;
|
|
28
|
+
/**
|
|
29
|
+
* Channel actions, related to home, **registered** by the Workspace Platform Provider e.g. Studio.
|
|
30
|
+
*/
|
|
31
|
+
declare type HomeAPIClientChannelActions = Record<string, never>;
|
|
32
|
+
declare type WorkspaceAPIClientChannelActions = StoreAPIClientChannelActions | DockAPIClientChannelActions | HomeAPIClientChannelActions;
|
|
33
|
+
/****** End of API Client Channel Actions ******/
|
|
34
|
+
/****** Workspace Component Channel Actions ******/
|
|
35
|
+
/**
|
|
36
|
+
* Channel Actions **registered** by all workspace components.
|
|
37
|
+
*/
|
|
38
|
+
declare type SharedChannelActions = {
|
|
39
|
+
'set-selected-scheme': (ctx: WorkspaceComponentSetSelectedSchemePayload) => Promise<void>;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Channel Actions **registered** by the Home workspace component.
|
|
43
|
+
*/
|
|
44
|
+
declare type HomeChannelActions = {
|
|
45
|
+
'assign-home-search-context': (payload: Partial<HomeSearchListenerRequest['context']>) => Promise<void>;
|
|
46
|
+
'set-search-query': (payload: SearchQueryWithProviderID) => Promise<void>;
|
|
47
|
+
'open-home-and-set-search-query': (payload: SearchQueryWithProviderID) => Promise<void>;
|
|
48
|
+
'temporary-is-home-ready': () => Promise<boolean>;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Channel Actions **registered** by the Storefront workspace component.
|
|
52
|
+
*/
|
|
53
|
+
declare type StoreChannelActions = {
|
|
54
|
+
'update-app-card-button-config': (payload: UpdateButtonConfigRequest & ProviderInfoInternal<'storefront'>) => Promise<void>;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Channel Actions **registered** by the Dock workspace component.
|
|
58
|
+
*/
|
|
59
|
+
interface DockChannelActions {
|
|
60
|
+
}
|
|
61
|
+
declare type WorkspaceComponentChannelActions = SharedChannelActions & HomeChannelActions & StoreChannelActions & DockChannelActions;
|
|
62
|
+
/****** End of Workspace Component Channel Actions ******/
|
|
63
|
+
/****** Workspace Provider Channel Actions ******/
|
|
64
|
+
/**
|
|
65
|
+
* These are channel actions that can be accessed by the client API OR the workspace component.
|
|
66
|
+
* In other words these are channel actions that are **registered** by the workspace provider.
|
|
67
|
+
*
|
|
68
|
+
* The handlers for these actions are defined [here](https://github.com/openfin/workspace/blob/develop/provider/src/api/protocol.ts#L32)
|
|
69
|
+
*/
|
|
70
|
+
declare type WorkspaceChannelTypes = {
|
|
71
|
+
'register-provider': (payload: ProviderRegisterPayload) => RegisterMetaInfoInternal;
|
|
72
|
+
'deregister-provider': (payload: ProviderDeregisterPayload) => Promise<void>;
|
|
73
|
+
'get-providers': (payload: ProviderChannelPayload) => Promise<ProviderInfoInternal[]>;
|
|
74
|
+
'show-provider-window': (payload: ProviderChannelPayload) => Promise<void>;
|
|
75
|
+
'hide-provider-window': (payload: ProviderChannelPayload) => Promise<void>;
|
|
76
|
+
'update-provider': (payload: ProviderUpdatePayload) => Promise<void>;
|
|
77
|
+
'get-storefront-provider-apps': (payload: ProviderInfoInternal<'storefront'>) => Promise<App[]>;
|
|
78
|
+
'get-storefront-provider-landing-page': (payload: ProviderInfoInternal<'storefront'>) => Promise<StorefrontLandingPage | undefined>;
|
|
79
|
+
'get-storefront-provider-footer': (payload: ProviderInfoInternal<'storefront'>) => Promise<StorefrontFooter>;
|
|
80
|
+
'get-storefront-provider-navigation': (payload: ProviderInfoInternal<'storefront'>) => Promise<Promise<[StorefrontNavigationSection?, StorefrontNavigationSection?]>>;
|
|
81
|
+
'launch-storefront-provider-app': (payload: LaunchStorefrontProviderAppRequest) => Promise<void>;
|
|
82
|
+
'update-app-card-button-config': (payload: UpdateButtonConfigRequest & Omit<ProviderInfoInternal<'storefront'>, 'uniqueId'>) => Promise<void>;
|
|
83
|
+
'show-home': (payload: undefined) => Promise<void>;
|
|
84
|
+
'hide-home': (payload: undefined) => Promise<void>;
|
|
85
|
+
'set-search-query': (payload: SearchQueryWithProviderID) => Promise<void>;
|
|
86
|
+
'assign-home-search-context': (payload: Partial<HomeSearchListenerRequest['context']>) => Promise<void>;
|
|
87
|
+
'set-selected-scheme': (ctx: ColorSchemeOptionType) => Promise<void>;
|
|
88
|
+
'get-legacy-pages': () => Promise<Page[]>;
|
|
89
|
+
'get-legacy-workspaces': (payload: undefined) => Promise<LegacyWorkspace[]>;
|
|
90
|
+
'register-storefront-provider': () => Promise<void>;
|
|
91
|
+
'deregister-storefront-provider': () => Promise<void>;
|
|
92
|
+
'hide-storefront': () => Promise<void>;
|
|
93
|
+
'show-storefront': () => Promise<void>;
|
|
94
|
+
};
|
|
95
|
+
/****** End of Workspace Provider Channel Actions ******/
|
|
96
|
+
/**
|
|
97
|
+
* This is a shared interface between the client API and the workspace components.
|
|
98
|
+
*
|
|
99
|
+
* Since all actions are dispatched to the channel provider, the `dispatch` function is the same for both the client API and the workspace components.
|
|
100
|
+
*/
|
|
101
|
+
interface WorkspaceChannelClientBase extends Omit<OpenFin.ChannelClient, 'dispatch' | 'register'> {
|
|
102
|
+
/**
|
|
103
|
+
* Dispatches an action to the Workspace Provider.
|
|
104
|
+
* @param action The action to dispatch
|
|
105
|
+
* @param payload The payload to send with the action
|
|
106
|
+
*/
|
|
107
|
+
dispatch: <T extends WorkspaceChannelAction>(action: T, payload: Parameters<WorkspaceChannelTypes[T]>[0]) => Promise<Awaited<ReturnType<WorkspaceChannelTypes[T]>>>;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* This is the Workspace Component Channel Client.
|
|
111
|
+
* This is used to communicate with the workspace provider from a workspace component (home, storefront, dock).
|
|
112
|
+
*
|
|
113
|
+
* This extends `WorkspaceChannelClientBase`.
|
|
114
|
+
*/
|
|
115
|
+
export interface WorkspaceComponentChannelClient extends WorkspaceChannelClientBase {
|
|
116
|
+
/**
|
|
117
|
+
* Registers a handler for a channel action.
|
|
118
|
+
* @param action
|
|
119
|
+
* @param handler
|
|
120
|
+
* @returns
|
|
121
|
+
*/
|
|
122
|
+
register: <T extends keyof WorkspaceComponentChannelActions>(action: T, handler: (payload: Parameters<WorkspaceComponentChannelActions[T]>[0], id: OpenFin.ProviderIdentity | OpenFin.ClientIdentity) => Awaitable<ReturnType<WorkspaceComponentChannelActions[T]>>) => boolean;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* This is the Client API channel client.
|
|
126
|
+
* This is used to communicate with the Workspace Provider from the client API. (`@openfin/workspace` / `client-api`)
|
|
127
|
+
*
|
|
128
|
+
* This extends `WorkspaceChannelClientBase`.
|
|
129
|
+
*/
|
|
130
|
+
export interface WorkspaceAPIClientChannelClient extends WorkspaceChannelClientBase {
|
|
131
|
+
/**
|
|
132
|
+
* Registers a handler for a channel action.
|
|
133
|
+
* This function is ONLY used from within `client-api` and should not be used by the workspace components.
|
|
134
|
+
*
|
|
135
|
+
* @param action The action to register a handler for.
|
|
136
|
+
* @param handler The handler to register.
|
|
137
|
+
*/
|
|
138
|
+
register: <T extends keyof WorkspaceAPIClientChannelActions>(action: T, handler: (payload: Parameters<WorkspaceAPIClientChannelActions[T]>[0], id: OpenFin.ProviderIdentity | OpenFin.ClientIdentity) => Awaitable<ReturnType<WorkspaceAPIClientChannelActions[T]>>) => boolean;
|
|
139
|
+
}
|
|
140
|
+
export interface WorkspaceChannelProvider extends Omit<OpenFin.ChannelProvider, 'register' | 'dispatch'> {
|
|
141
|
+
/**
|
|
142
|
+
* Used for dispatching a channel action to a channel client
|
|
143
|
+
*
|
|
144
|
+
* @param to The identity of the client to send the action to.
|
|
145
|
+
* @param action The action to send.
|
|
146
|
+
* @param payload The payload to send with the action.
|
|
147
|
+
*/
|
|
148
|
+
dispatch: <I extends OpenFin.ClientIdentity | OpenFin.Identity, T extends I['name'] extends (typeof homeOFIdentity)['name'] ? keyof SharedChannelActions | keyof HomeChannelActions : I['name'] extends (typeof dockOFIdentity)['name'] ? keyof SharedChannelActions | keyof DockChannelActions : I['name'] extends (typeof storefrontOFIdentity)['name'] ? keyof SharedChannelActions | keyof StoreChannelActions : keyof SharedChannelActions | keyof WorkspaceAPIClientChannelActions>(to: I, action: T, payload: T extends keyof SharedChannelActions ? Parameters<SharedChannelActions[T]>[0] : I['name'] extends (typeof homeOFIdentity)['name'] ? T extends keyof HomeChannelActions ? Parameters<HomeChannelActions[T]>[0] : never : I['name'] extends (typeof dockOFIdentity)['name'] ? T extends keyof DockChannelActions ? Parameters<DockChannelActions[T]>[0] : never : I['name'] extends (typeof storefrontOFIdentity)['name'] ? T extends keyof StoreChannelActions ? Parameters<StoreChannelActions[T]>[0] : never : T extends keyof WorkspaceAPIClientChannelActions ? Parameters<WorkspaceAPIClientChannelActions[T]>[0] : never) => Promise<Awaited<I['name'] extends (typeof homeOFIdentity)['name'] ? T extends keyof HomeChannelActions ? ReturnType<HomeChannelActions[T]> : never : I['name'] extends (typeof dockOFIdentity)['name'] ? T extends keyof DockChannelActions ? ReturnType<DockChannelActions[T]> : never : I['name'] extends (typeof storefrontOFIdentity)['name'] ? T extends keyof StoreChannelActions ? ReturnType<StoreChannelActions[T]> : never : never>>;
|
|
149
|
+
/**
|
|
150
|
+
* Used for registering a channel action handler for a channel client
|
|
151
|
+
*
|
|
152
|
+
* @param action The action to register a handler for.
|
|
153
|
+
* @param handler The handler to register.
|
|
154
|
+
*/
|
|
155
|
+
register: <T extends WorkspaceChannelAction>(action: T, handler: (payload: Parameters<WorkspaceChannelTypes[T]>[0], id: OpenFin.ProviderIdentity | OpenFin.ClientIdentity) => Awaitable<ReturnType<WorkspaceChannelTypes[T]>>) => boolean;
|
|
156
|
+
}
|
|
157
|
+
export {};
|
|
@@ -1,61 +1,9 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type { WorkspaceAPIClientChannelClient, WorkspaceChannelProvider, WorkspaceComponentChannelClient } from './shapes/workspace';
|
|
2
|
+
export type { WorkspaceAPIClientChannelClient, WorkspaceComponentChannelClient, WorkspaceChannelProvider };
|
|
2
3
|
/** The name of the channel for the centralized workspace protocol. */
|
|
3
|
-
export declare const channelName
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* Workspace Provider's address space.
|
|
7
|
-
*
|
|
8
|
-
* When adding a new channel action make sure to register a
|
|
9
|
-
* handler for the remote procedure in the Workspace Provider.
|
|
10
|
-
* All of the registered channel action handlers can be found here:
|
|
11
|
-
* @see link: [Provider Protocol Handlers](https://github.com/openfin/workspace/provider/src/api/protocol.ts)
|
|
12
|
-
*/
|
|
13
|
-
export declare enum WorkspaceChannelAction {
|
|
14
|
-
RegisterProvider = "register-provider",
|
|
15
|
-
DeregisterProvider = "deregister-provider",
|
|
16
|
-
UpdateProvider = "update-provider",
|
|
17
|
-
CreateProviderWindow = "create-provider-window",
|
|
18
|
-
GetProviders = "get-providers",
|
|
19
|
-
ShowProviderWindow = "show-provider-window",
|
|
20
|
-
HideProviderWindow = "hide-provider-window",
|
|
21
|
-
GetStorefrontProviderApps = "get-storefront-provider-apps",
|
|
22
|
-
GetStorefrontProviderLandingPage = "get-storefront-provider-landing-page",
|
|
23
|
-
GetStorefrontProviderFooter = "get-storefront-provider-footer",
|
|
24
|
-
GetStorefrontProviderNavigation = "get-storefront-provider-navigation",
|
|
25
|
-
LaunchStorefrontProviderApp = "launch-storefront-provider-app",
|
|
26
|
-
UpdateAppCardButtonConfig = "update-app-card-button-config",
|
|
27
|
-
ShowHome = "show-home",
|
|
28
|
-
HideHome = "hide-home",
|
|
29
|
-
AssignHomeSearchContext = "assign-home-search-context",
|
|
30
|
-
SetSearchQuery = "set-search-query",
|
|
31
|
-
OpenHomeAndSetSearchQuery = "open-home-and-set-search-query",
|
|
32
|
-
TemporaryIsHomeReady = "temporary-is-home-ready",
|
|
33
|
-
GetLegacyPages = "get-legacy-pages",
|
|
34
|
-
GetLegacyWorkspaces = "get-legacy-workspaces",
|
|
35
|
-
GetComputedPlatformTheme = "get-computed-platform-theme",
|
|
36
|
-
SetSelectedScheme = "set-selected-scheme",
|
|
37
|
-
RegisterStorefrontProvider = "register-storefront-provider",
|
|
38
|
-
DeregisterStorefrontProvider = "deregister-storefront-provider",
|
|
39
|
-
HideStorefront = "hide-storefront",
|
|
40
|
-
ShowStorefront = "show-storefront"
|
|
41
|
-
}
|
|
42
|
-
export interface ChannelClient extends OpenFin.ChannelClient {
|
|
43
|
-
dispatch: (action: WorkspaceChannelAction, payload: any) => Promise<any>;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Get a channel client for the centralized Workspace protocol.
|
|
47
|
-
*
|
|
48
|
-
* The channel client is automatically connected to the Workspace Provider,
|
|
49
|
-
* in which acts as a centralized location for executing Workspace API logic.
|
|
50
|
-
*
|
|
51
|
-
* The channel client can execute remote procedures on the provider via its `dispatch` function.
|
|
52
|
-
* A call to the `dispatch` function will block until the channel action has concluded execution
|
|
53
|
-
* in the Workspace Provider's address space.
|
|
54
|
-
* For a list of supported procedures, see the `WorkspaceChannelAction` enum.
|
|
55
|
-
*
|
|
56
|
-
* @returns the channel client for the centralized workspace protocol.
|
|
57
|
-
*/
|
|
58
|
-
export declare const getChannelClient: () => Promise<ChannelClient>;
|
|
4
|
+
export declare const channelName: "__of_workspace_protocol__";
|
|
5
|
+
export declare const getChannelClient: () => Promise<WorkspaceComponentChannelClient>;
|
|
6
|
+
export declare const getClientAPIChannelClient: () => Promise<WorkspaceAPIClientChannelClient>;
|
|
59
7
|
/**
|
|
60
8
|
* Launches the Workspace Provider.
|
|
61
9
|
* If the Workspace Provider is already running, does nothing.
|
|
@@ -66,4 +14,10 @@ export declare const launchProvider: () => Promise<void>;
|
|
|
66
14
|
* Then gets a Channel Client that is connected to the Workspace Provider.
|
|
67
15
|
* @returns the Channel Client that is connected to the Workspace Provider.
|
|
68
16
|
*/
|
|
69
|
-
export declare const getChannelClientAndLaunchProvider: () => Promise<
|
|
17
|
+
export declare const getChannelClientAndLaunchProvider: () => Promise<WorkspaceComponentChannelClient>;
|
|
18
|
+
/**
|
|
19
|
+
* Launches the Workspace provider if it is not running.
|
|
20
|
+
* Then gets a Channel Client that is connected to the Workspace Provider.
|
|
21
|
+
* @returns the Channel Client that is connected to the Workspace Provider.
|
|
22
|
+
*/
|
|
23
|
+
export declare const getClientAPIChannelClientAndLaunchProvider: () => Promise<WorkspaceAPIClientChannelClient>;
|
|
@@ -71,6 +71,10 @@ export declare type ProviderDisconnectionPayload = {
|
|
|
71
71
|
provider: StorefrontProviderInternal;
|
|
72
72
|
};
|
|
73
73
|
export interface ProviderUpdatePayload {
|
|
74
|
+
providerType: 'dock';
|
|
75
|
+
provider: RemoveFunctions<DockProvider> | DockProviderInternal;
|
|
76
|
+
}
|
|
77
|
+
export interface ProviderUpdateEventPayload {
|
|
74
78
|
providerType: 'dock';
|
|
75
79
|
provider: DockProviderInternal;
|
|
76
80
|
}
|
|
@@ -88,7 +92,7 @@ export declare const getProviders: <T extends ProviderType>(providerType: T) =>
|
|
|
88
92
|
* A function to dispatch showing the component window of current OF identity
|
|
89
93
|
* @returns action to show Component Window
|
|
90
94
|
*/
|
|
91
|
-
export declare const showProviderWindow: (providerType: ProviderType) => Promise<
|
|
95
|
+
export declare const showProviderWindow: (providerType: ProviderType) => Promise<void>;
|
|
92
96
|
/**
|
|
93
97
|
* A function to dispatch hiding the component window of current OF identity
|
|
94
98
|
* @returns action to hide Component Window
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { searchTopic as homeSearchTopic } from '../../../common/src/api/home';
|
|
2
1
|
import { CLISearchResultWithTemplate } from '../../../client-api/src/shapes';
|
|
3
2
|
import { DispatchedAction, SearchProviderInfo, SearchProviderResponse, SearchTopicClient } from '../../../search-api/src/shapes';
|
|
4
3
|
export declare type TemplateActionMap = Record<string, Action>;
|
|
@@ -15,6 +14,5 @@ export interface SearchItem {
|
|
|
15
14
|
onFocus?: () => any;
|
|
16
15
|
requestReload?: () => any;
|
|
17
16
|
}
|
|
18
|
-
export declare type Topic = typeof homeSearchTopic;
|
|
19
17
|
export declare function getHomeSearchTopic(): Promise<SearchTopicClient>;
|
|
20
|
-
export declare function mapSearchResponsesToItems(
|
|
18
|
+
export declare function mapSearchResponsesToItems(responses: SearchProviderResponse[]): SearchItem[];
|
|
@@ -2,6 +2,7 @@ import { App, StorefrontFooter, StorefrontLandingPage, StorefrontNavigationItemA
|
|
|
2
2
|
import { ProviderInfoInternal } from './provider';
|
|
3
3
|
/**
|
|
4
4
|
* Request object to launch an app.
|
|
5
|
+
* Passed from Storefront to Provider.
|
|
5
6
|
*/
|
|
6
7
|
export interface LaunchStorefrontProviderAppRequest extends ProviderInfoInternal<'storefront'> {
|
|
7
8
|
/**
|
|
@@ -9,6 +10,16 @@ export interface LaunchStorefrontProviderAppRequest extends ProviderInfoInternal
|
|
|
9
10
|
*/
|
|
10
11
|
app: App;
|
|
11
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Request object to launch an app.
|
|
15
|
+
* Passed from Workspace Provider to the Workspace Platform
|
|
16
|
+
*/
|
|
17
|
+
export interface ClientAPILaunchStorefrontProviderAppRequest extends Pick<ProviderInfoInternal<'storefront'>, 'id' | 'platformIdentity'> {
|
|
18
|
+
/**
|
|
19
|
+
* App to launch.
|
|
20
|
+
*/
|
|
21
|
+
app: App;
|
|
22
|
+
}
|
|
12
23
|
/**
|
|
13
24
|
* Launch a Storefront app.
|
|
14
25
|
* @param req LaunchStorefrontProviderAppRequest request object.
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
2
|
import type { ThemePaletteSet } from '@openfin/ui-library';
|
|
3
3
|
import { ColorSchemeOptionType } from '../../../client-api-platform/src/shapes';
|
|
4
|
+
export declare type WorkspaceComponentSetSelectedSchemePayload = {
|
|
5
|
+
newScheme: ColorSchemeOptionType;
|
|
6
|
+
identity: OpenFin.Identity;
|
|
7
|
+
};
|
|
8
|
+
export declare type BrowserSetSelectedSchemePayload = string;
|
|
4
9
|
export interface ComputedThemes extends Array<ComputedTheme> {
|
|
5
10
|
}
|
|
6
11
|
export interface ComputedTheme {
|
|
@@ -62,6 +67,7 @@ export interface CustomPaletteSet extends DefaultPaletteSet {
|
|
|
62
67
|
inputPlaceholder?: string;
|
|
63
68
|
inputDisabled?: string;
|
|
64
69
|
inputFocused?: string;
|
|
70
|
+
inputBorder?: string;
|
|
65
71
|
textDefault?: string;
|
|
66
72
|
textHelp?: string;
|
|
67
73
|
textInactive?: string;
|
|
@@ -2,6 +2,7 @@ import type OpenFin from '@openfin/core';
|
|
|
2
2
|
import { MenuItemType } from '../../../common/src/utils/context-menu';
|
|
3
3
|
import * as WP from '../../../client-api-platform/src/index';
|
|
4
4
|
import { GlobalContextMenuItemTemplate, GlobalContextMenuOptionType, Workspace } from '../../../client-api-platform/src/shapes';
|
|
5
|
+
export declare const isOSWindows: () => Promise<boolean>;
|
|
5
6
|
export declare const savePage: {
|
|
6
7
|
type: MenuItemType;
|
|
7
8
|
label: string;
|
|
@@ -30,6 +31,7 @@ export declare const saveWorkspaceAs: {
|
|
|
30
31
|
type: WP.GlobalContextMenuOptionType;
|
|
31
32
|
};
|
|
32
33
|
};
|
|
34
|
+
export declare const printMenuOptions: (isViewSelected: boolean) => Promise<GlobalContextMenuItemTemplate>;
|
|
33
35
|
export declare const getSavedWorkspaceContextMenuOptions: (activeWorkspace: Workspace, savedWorkspaces: Workspace[], contextMenuOptionType: GlobalContextMenuOptionType) => {
|
|
34
36
|
label: string;
|
|
35
37
|
type: MenuItemType;
|
|
@@ -49,4 +51,4 @@ export declare const getAppearanceContextMenuOptions: () => Promise<{
|
|
|
49
51
|
scheme: WP.ColorSchemeOptionType;
|
|
50
52
|
};
|
|
51
53
|
}[]>;
|
|
52
|
-
export declare const getGlobalContextMenuTemplate: (winIdentity: OpenFin.Identity) => Promise<GlobalContextMenuItemTemplate[]>;
|
|
54
|
+
export declare const getGlobalContextMenuTemplate: (winIdentity: OpenFin.Identity, selectedViews?: OpenFin.Identity[]) => Promise<GlobalContextMenuItemTemplate[]>;
|
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
2
|
import { ModalResponseContent } from '../../../common/src/utils/menu-config';
|
|
3
|
-
import { Listener } from '../../../common/src/utils/shared-emitter';
|
|
4
3
|
import type { OptionalExceptFor } from '../../../common/src/utils/types';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
Affirmative = "affirmative"
|
|
4
|
+
declare type MenuEventTypes = {
|
|
5
|
+
response: [ModalResponseEvent];
|
|
6
|
+
ready: [OpenFin.Identity];
|
|
7
|
+
update: [string, Partial<OpenFin.Bounds>, string];
|
|
8
|
+
};
|
|
9
|
+
export interface ModalResponseEvent {
|
|
10
|
+
data: 'canceled' | 'negative' | 'affirmative';
|
|
11
|
+
name: string;
|
|
14
12
|
}
|
|
15
13
|
export declare const menuEvents: {
|
|
16
|
-
emit: (event:
|
|
17
|
-
addListener: (event:
|
|
18
|
-
removeListener: (event:
|
|
19
|
-
once: (event:
|
|
14
|
+
emit: <EventKey extends keyof MenuEventTypes>(event: EventKey, ...payload: MenuEventTypes[EventKey]) => Promise<void>;
|
|
15
|
+
addListener: <EventKey_1 extends keyof MenuEventTypes>(event: EventKey_1, listener: (...payload: MenuEventTypes[EventKey_1]) => void) => void;
|
|
16
|
+
removeListener: <EventKey_2 extends keyof MenuEventTypes>(event: EventKey_2, listener: (...payload: MenuEventTypes[EventKey_2]) => void) => void;
|
|
17
|
+
once: <EventKey_3 extends keyof MenuEventTypes>(event: EventKey_3, listener: (...payload: MenuEventTypes[EventKey_3]) => void) => void;
|
|
20
18
|
};
|
|
21
|
-
export declare const emitMenuResponse: (data:
|
|
19
|
+
export declare const emitMenuResponse: (data: ModalResponseEvent['data']) => Promise<void>;
|
|
22
20
|
declare type WindowOptionsWithBounds = OptionalExceptFor<OpenFin.WindowOptions, 'name' | 'url'> & {
|
|
23
21
|
top: number;
|
|
24
22
|
left: number;
|
|
@@ -38,6 +36,6 @@ export declare function createMenuPosition(windowOptions: OptionalExceptFor<Open
|
|
|
38
36
|
}>;
|
|
39
37
|
export declare function showChildWindow({ options, parameters }: ShowChildOptions): Promise<OpenFin.Window>;
|
|
40
38
|
export declare const waitForModalResponse: ({ options, content }: ResponseModalOptions) => Promise<{
|
|
41
|
-
data:
|
|
39
|
+
data: ModalResponseEvent['data'];
|
|
42
40
|
}>;
|
|
43
41
|
export {};
|
|
@@ -23,43 +23,31 @@ export declare enum PageRoute {
|
|
|
23
23
|
DeprecatedAlert = "/provider/deprecated-alert/",
|
|
24
24
|
Analytics = "/provider/analytics/"
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
export declare const Assets: {
|
|
27
|
+
readonly IconOpenFinLogo: "/icons/openfinlogo.svg";
|
|
28
|
+
readonly IconFilter: "/icons/filter.svg";
|
|
29
|
+
readonly LightStorefront: "/icons/lightstorefront.png";
|
|
30
|
+
readonly DarkStorefront: "/icons/darkstorefront.png";
|
|
31
|
+
readonly CallIconLight: "/icons/call-icon-light.svg";
|
|
32
|
+
readonly CallIconDark: "/icons/call-icon-dark.svg";
|
|
33
|
+
readonly ChatIconLight: "/icons/chat-icon-light.svg";
|
|
34
|
+
readonly ChatIconDark: "/icons/chat-icon-dark.svg";
|
|
35
|
+
readonly MessageIconLight: "/icons/message-icon-light.svg";
|
|
36
|
+
readonly MessageIconDark: "/icons/message-icon-dark.svg";
|
|
37
|
+
readonly Microsoft365Assets: {
|
|
38
|
+
readonly Microsoft365DocumentIcon: "/microsoft-365-integration-assets/microsoft-365-document-icon.svg";
|
|
39
|
+
readonly Microsoft365ExcelIcon: "/microsoft-365-integration-assets/microsoft-365-excel-icon.svg";
|
|
40
|
+
readonly Microsoft365PowerpointIcon: "/microsoft-365-integration-assets/microsoft-365-powerpoint-icon.svg";
|
|
41
|
+
readonly Microsoft365OutlookIcon: "/microsoft-365-integration-assets/microsoft-365-outlook-icon.svg";
|
|
42
|
+
readonly Microsoft365TeamsIcon: "/microsoft-365-integration-assets/microsoft-365-teams-icon.svg";
|
|
43
|
+
readonly Microsoft365Icon: "/microsoft-365-integration-assets/microsoft-365-icon.svg";
|
|
44
|
+
readonly PDFFileIcon: "/microsoft-365-integration-assets/pdf-file-icon.svg";
|
|
45
|
+
};
|
|
46
|
+
};
|
|
35
47
|
/**
|
|
36
48
|
* Home DeepLink Options
|
|
37
49
|
*/
|
|
38
50
|
export declare enum HomeDeepLink {
|
|
39
51
|
Search = "search"
|
|
40
52
|
}
|
|
41
|
-
|
|
42
|
-
Home: PageRoute.Home;
|
|
43
|
-
HomeSearch: PageRoute.HomeSearch;
|
|
44
|
-
HomePagesRename: PageRoute.HomePagesRename;
|
|
45
|
-
Dock: PageRoute.Dock;
|
|
46
|
-
HomeIndicator: PageRoute.HomeIndicator;
|
|
47
|
-
Browser: PageRoute.Browser;
|
|
48
|
-
BrowserPopupMenu: PageRoute.BrowserPopupMenu;
|
|
49
|
-
Provider: PageRoute.Provider;
|
|
50
|
-
BrowserPopupMenuSharePage: PageRoute.BrowserPopupMenuSharePage;
|
|
51
|
-
BrowserPopupMenuSaveModal: PageRoute.BrowserPopupMenuSaveModal;
|
|
52
|
-
BrowserPopupMenuLayouts: PageRoute.BrowserPopupMenuLayouts;
|
|
53
|
-
BrowserPopupMenuColorLinking: PageRoute.BrowserPopupMenuColorLinking;
|
|
54
|
-
BrowserIndicator: PageRoute.BrowserIndicator;
|
|
55
|
-
ResponseModal: PageRoute.ResponseModal;
|
|
56
|
-
Docs: PageRoute.Docs;
|
|
57
|
-
Storefront: PageRoute.Storefront;
|
|
58
|
-
DeprecatedAlert: PageRoute.DeprecatedAlert;
|
|
59
|
-
Analytics: PageRoute.Analytics;
|
|
60
|
-
IconOpenFinLogo: AssetRoute.IconOpenFinLogo;
|
|
61
|
-
IconFilter: AssetRoute.IconFilter;
|
|
62
|
-
LightStorefront: AssetRoute.LightStorefront;
|
|
63
|
-
DarkStorefront: AssetRoute.DarkStorefront;
|
|
64
|
-
};
|
|
65
|
-
export default _default;
|
|
53
|
+
export default PageRoute;
|