@openfin/workspace 13.1.5 → 14.0.11
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 +14 -14
- package/client-api/src/home.test.d.ts +1 -1
- package/client-api/src/integrations/microsoft.shapes.d.ts +9 -9
- package/client-api/src/internal/home/handlers/data.d.ts +3 -0
- package/client-api/src/internal/home/handlers/data.test.d.ts +1 -0
- package/client-api/src/internal/home/handlers/disconnect.d.ts +1 -0
- package/client-api/src/internal/home/handlers/disconnect.test.d.ts +1 -0
- package/client-api/src/internal/home/handlers/index.d.ts +6 -0
- package/client-api/src/internal/home/handlers/index.test.d.ts +1 -0
- package/client-api/src/internal/home/handlers/result-dispatch.d.ts +3 -0
- package/client-api/src/internal/home/handlers/result-dispatch.test.d.ts +1 -0
- package/client-api/src/internal/home/handlers/search-close.d.ts +5 -0
- package/client-api/src/internal/home/handlers/search-close.test.d.ts +1 -0
- package/client-api/src/internal/home/index.d.ts +4 -0
- package/client-api/src/internal/home/requests.d.ts +5 -0
- package/client-api/src/internal/providers.d.ts +63 -0
- package/client-api/src/internal/providers.test.d.ts +1 -0
- package/client-api/src/internal/storefront/handlers.d.ts +9 -0
- package/client-api/src/internal/storefront/index.d.ts +4 -0
- package/client-api/src/{internal.d.ts → internal/try-dispatch.d.ts} +1 -1
- package/client-api/src/shapes/common.d.ts +1 -1
- package/client-api/src/shapes/dock.d.ts +3 -3
- package/client-api/src/shapes/home.d.ts +18 -18
- package/client-api/src/shapes/notifications.d.ts +2 -2
- package/client-api/src/shapes/store.d.ts +6 -6
- package/client-api/src/shapes/templates.d.ts +11 -11
- package/client-api-platform/src/init/utils.d.ts +2 -2
- package/client-api-platform/src/shapes.d.ts +15 -15
- package/common/src/api/action.d.ts +1 -1
- package/common/src/api/home.d.ts +25 -0
- package/common/src/api/pages/shapes.d.ts +6 -6
- package/common/src/api/protocol/browser.d.ts +1 -1
- package/common/src/api/protocol/shapes/search.d.ts +96 -0
- package/common/src/api/protocol/shapes/workspace.d.ts +13 -13
- package/common/src/api/protocol/workspace-platform.d.ts +1 -1
- package/common/src/api/protocol/workspace.d.ts +2 -0
- package/common/src/api/provider.d.ts +24 -9
- package/common/src/api/search/aggregate-search-results.d.ts +10 -0
- package/common/src/api/search/common.d.ts +13 -0
- package/common/src/api/shapes/home.d.ts +186 -0
- package/common/src/api/theming.d.ts +2 -2
- package/common/src/utils/a11y/search.a11y.d.ts +10 -10
- package/common/src/utils/application.d.ts +2 -2
- package/common/src/utils/context-menu.d.ts +1 -1
- package/common/src/utils/layout.d.ts +3 -3
- package/common/src/utils/menu-window-provider.d.ts +2 -2
- package/common/src/utils/route.d.ts +0 -1
- package/common/src/utils/snapshot.d.ts +3 -3
- package/common/src/utils/types.d.ts +7 -7
- package/common/src/utils/usage-register.d.ts +2 -2
- package/home.js +128 -23
- package/home.js.map +1 -1
- package/index.js +127 -22
- package/index.js.map +1 -1
- package/notifications.js +124 -19
- package/notifications.js.map +1 -1
- package/package.json +3 -3
- package/search-api/src/fin/shapes.d.ts +2 -2
- package/search-api/src/provider/remote/deregistration.d.ts +2 -1
- package/search-api/src/provider/remote/info.d.ts +1 -1
- package/search-api/src/provider/remote/registration.d.ts +1 -1
- package/search-api/src/shapes.d.ts +11 -21
- package/store.js +130 -25
- package/store.js.map +1 -1
- package/common/src/api/search.d.ts +0 -18
|
@@ -138,7 +138,7 @@ export interface PageTabContextMenuOptionActionPayload {
|
|
|
138
138
|
/**
|
|
139
139
|
* Payload received by the openGlobalContextMenu provider override.
|
|
140
140
|
*/
|
|
141
|
-
export
|
|
141
|
+
export type OpenGlobalContextMenuPayload = OpenGlobalContextMenuRequest & {
|
|
142
142
|
/** Template defining the options to show in the context menu. */
|
|
143
143
|
template: GlobalContextMenuItemTemplate[];
|
|
144
144
|
/** Identity of the Browser window where context menu should be shown. */
|
|
@@ -249,7 +249,7 @@ export interface ViewTabCustomActionPayload {
|
|
|
249
249
|
/**
|
|
250
250
|
* Payload received by the openViewTabContextMenu provider override.
|
|
251
251
|
*/
|
|
252
|
-
export
|
|
252
|
+
export type OpenViewTabContextMenuPayload = OpenViewTabContextMenuRequest & {
|
|
253
253
|
/** Identity of the Browser window where context menu should be shown. */
|
|
254
254
|
identity: OpenFin.Identity;
|
|
255
255
|
/** Default function that handles stock context menu options. */
|
|
@@ -258,7 +258,7 @@ export declare type OpenViewTabContextMenuPayload = OpenViewTabContextMenuReques
|
|
|
258
258
|
/**
|
|
259
259
|
* Payload received by the openViewTabContextMenu provider override.
|
|
260
260
|
*/
|
|
261
|
-
export
|
|
261
|
+
export type OpenPageTabContextMenuPayload = OpenPageTabContextMenuRequest & {
|
|
262
262
|
/** Identity of the Browser window where context menu should be shown. */
|
|
263
263
|
identity: OpenFin.Identity;
|
|
264
264
|
/** Template defining the options to show in the context menu. */
|
|
@@ -361,7 +361,7 @@ export interface PreDefinedButtonConfig {
|
|
|
361
361
|
* };
|
|
362
362
|
* ```
|
|
363
363
|
*/
|
|
364
|
-
export
|
|
364
|
+
export type ShowHideTabsConfig = {
|
|
365
365
|
type: BrowserButtonType.ShowHideTabs;
|
|
366
366
|
disabled?: boolean;
|
|
367
367
|
};
|
|
@@ -376,21 +376,21 @@ export declare type ShowHideTabsConfig = {
|
|
|
376
376
|
* };
|
|
377
377
|
* ```
|
|
378
378
|
*/
|
|
379
|
-
export
|
|
379
|
+
export type LockUnlockPageConfig = {
|
|
380
380
|
type: BrowserButtonType.LockUnlockPage;
|
|
381
381
|
disabled?: boolean;
|
|
382
382
|
};
|
|
383
383
|
/**
|
|
384
384
|
* Buttons on the left of WindowStateButtonOptions
|
|
385
385
|
*/
|
|
386
|
-
export
|
|
386
|
+
export type ToolbarButton = ShowHideTabsConfig | LockUnlockPageConfig | CustomBrowserButtonConfig | PreDefinedButtonConfig;
|
|
387
387
|
export interface ToolbarOptions {
|
|
388
388
|
buttons: ToolbarButton[];
|
|
389
389
|
}
|
|
390
390
|
/**
|
|
391
391
|
* Buttons to the top far right of Browser
|
|
392
392
|
*/
|
|
393
|
-
export
|
|
393
|
+
export type WindowStateButton = CustomBrowserButtonConfig | PreDefinedButtonConfig;
|
|
394
394
|
export interface WindowStateButtonOptions {
|
|
395
395
|
buttons: WindowStateButton[];
|
|
396
396
|
}
|
|
@@ -431,7 +431,7 @@ export interface OpenSaveButtonContextMenuRequest {
|
|
|
431
431
|
/**
|
|
432
432
|
* Payload received by the openSaveButtonContextMenu provider override.
|
|
433
433
|
*/
|
|
434
|
-
export
|
|
434
|
+
export type OpenSaveButtonContextMenuPayload = OpenSaveButtonContextMenuRequest & {
|
|
435
435
|
/** Identity of the Browser window where context menu should be shown. */
|
|
436
436
|
identity: OpenFin.Identity;
|
|
437
437
|
/** Template defining the options to show in the context menu. */
|
|
@@ -507,7 +507,7 @@ export interface BrowserCreateWindowRequest extends Omit<OpenFin.PlatformWindowC
|
|
|
507
507
|
/**
|
|
508
508
|
* A window that is part of a browser snapshot.
|
|
509
509
|
*/
|
|
510
|
-
export
|
|
510
|
+
export type BrowserSnapshotWindow = OpenFin.WindowCreationOptions & BrowserCreateWindowRequest;
|
|
511
511
|
/**
|
|
512
512
|
* A browser snapshot.
|
|
513
513
|
*/
|
|
@@ -1403,7 +1403,7 @@ export declare enum CustomActionCallerType {
|
|
|
1403
1403
|
/**The payload received by a Custom Action.
|
|
1404
1404
|
* The `callerType` property can be used to determine what data is available in the payload and cast accordingly.
|
|
1405
1405
|
* When `callerType == CustomActionCallerType.API`, the payload is defined by the code directly invoking the action.*/
|
|
1406
|
-
export
|
|
1406
|
+
export type CustomActionPayload = {
|
|
1407
1407
|
callerType: CustomActionCallerType.API;
|
|
1408
1408
|
} | CustomButtonActionPayload | StoreCustomButtonActionPayload | CustomDropdownItemActionPayload | GlobalContextMenuOptionActionPayload | ViewTabCustomActionPayload | PageTabContextMenuOptionActionPayload | OpenSaveContextMenuOptionActionPayload;
|
|
1409
1409
|
/**
|
|
@@ -1447,7 +1447,7 @@ export interface ApplyWorkspaceOptions {
|
|
|
1447
1447
|
/**
|
|
1448
1448
|
* Options used within the {@link WorkspacePlatformModule.applyWorkspace applyWorkspace} method.
|
|
1449
1449
|
*
|
|
1450
|
-
* @
|
|
1450
|
+
* @inheritDoc OpenFin.ApplySnapshotOptions
|
|
1451
1451
|
*/
|
|
1452
1452
|
export interface ApplySnapshotOptions extends OpenFin.ApplySnapshotOptions {
|
|
1453
1453
|
/**
|
|
@@ -1461,7 +1461,7 @@ export interface ApplySnapshotOptions extends OpenFin.ApplySnapshotOptions {
|
|
|
1461
1461
|
/**
|
|
1462
1462
|
* Payload received by applyWorkspace platform provider method
|
|
1463
1463
|
*/
|
|
1464
|
-
export
|
|
1464
|
+
export type ApplyWorkspacePayload = Workspace & {
|
|
1465
1465
|
options?: ApplyWorkspaceOptions;
|
|
1466
1466
|
};
|
|
1467
1467
|
/**
|
|
@@ -1697,11 +1697,11 @@ export interface WorkspacePlatformInitConfig {
|
|
|
1697
1697
|
* });
|
|
1698
1698
|
* ```
|
|
1699
1699
|
*/
|
|
1700
|
-
export
|
|
1700
|
+
export type WorkspacePlatformOverrideCallback = OpenFin.OverrideCallback<WorkspacePlatformProvider>;
|
|
1701
1701
|
/**
|
|
1702
1702
|
* @deprecated
|
|
1703
1703
|
*/
|
|
1704
|
-
export
|
|
1704
|
+
export type BrowserOverrideCallback = WorkspacePlatformOverrideCallback;
|
|
1705
1705
|
/**
|
|
1706
1706
|
* Configuration for initializing a Browser.
|
|
1707
1707
|
*/
|
|
@@ -1772,7 +1772,7 @@ export declare enum SaveModalType {
|
|
|
1772
1772
|
* Request to create a save modal.
|
|
1773
1773
|
* @private
|
|
1774
1774
|
*/
|
|
1775
|
-
export
|
|
1775
|
+
export type OpenSaveMenuRequest = {
|
|
1776
1776
|
menuType: SaveModalType.SAVE_PAGE | SaveModalType.SAVE_PAGE_AS | SaveModalType.RENAME_PAGE;
|
|
1777
1777
|
id: string;
|
|
1778
1778
|
} | {
|
|
@@ -24,7 +24,7 @@ export interface BaseCustomDropdownItem extends BaseCustomButtonConfig {
|
|
|
24
24
|
/** icon URL for icon image */
|
|
25
25
|
action?: any;
|
|
26
26
|
}
|
|
27
|
-
export
|
|
27
|
+
export type BaseCustomDropdownItems = BaseCustomDropdownItem[] | (() => Promise<BaseCustomDropdownItem[]>);
|
|
28
28
|
/**
|
|
29
29
|
* Base Configuration for a custom dropdown
|
|
30
30
|
*/
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type OpenFin from '@openfin/core';
|
|
2
|
+
import { HomeSearchListenerRequest } from '../../../client-api/src/shapes';
|
|
3
|
+
export interface SearchQueryWithProviderID {
|
|
4
|
+
providerID: string;
|
|
5
|
+
query: string;
|
|
6
|
+
}
|
|
7
|
+
export interface SearchQueryWithProviderIdentity {
|
|
8
|
+
providerID: string;
|
|
9
|
+
platformIdentity: OpenFin.Identity;
|
|
10
|
+
query: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The ids of home providers that are built into Home.
|
|
14
|
+
*/
|
|
15
|
+
export declare enum HomeBuiltInProviderID {
|
|
16
|
+
/**
|
|
17
|
+
* Built in Home provider that provides commands.
|
|
18
|
+
*/
|
|
19
|
+
Commands = "home-commands"
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Assign a search context to Home.
|
|
23
|
+
* @param ctx the search context to assign.
|
|
24
|
+
*/
|
|
25
|
+
export declare function assignHomeSearchContext(ctx: Partial<HomeSearchListenerRequest['context']>): Promise<void>;
|
|
@@ -9,7 +9,7 @@ export interface PageLayoutDetails {
|
|
|
9
9
|
*/
|
|
10
10
|
machineName?: string;
|
|
11
11
|
}
|
|
12
|
-
export
|
|
12
|
+
export type PageLayout = OpenFin.LayoutOptions & {
|
|
13
13
|
layoutDetails?: PageLayoutDetails;
|
|
14
14
|
};
|
|
15
15
|
/**
|
|
@@ -70,7 +70,7 @@ export interface Page {
|
|
|
70
70
|
/** Optional property to attach custom metadata to the page object, such as version or timestamp. Must be serializable. */
|
|
71
71
|
customData?: any;
|
|
72
72
|
}
|
|
73
|
-
|
|
73
|
+
type AttachedPageMetadata = {
|
|
74
74
|
/** The window the page is currently attached to. */
|
|
75
75
|
parentIdentity?: OpenFin.Identity;
|
|
76
76
|
/** True if the page is the currently active page for its parent window. */
|
|
@@ -80,8 +80,8 @@ declare type AttachedPageMetadata = {
|
|
|
80
80
|
/** Panel config with all view identities in place */
|
|
81
81
|
panels?: ExtendedPanelConfig[];
|
|
82
82
|
};
|
|
83
|
-
export
|
|
84
|
-
export
|
|
83
|
+
export type AttachedPage = Page & AttachedPageMetadata;
|
|
84
|
+
export type PageWithUpdatableRuntimeAttribs = Page & Pick<AttachedPage, 'hasUnsavedChanges'>;
|
|
85
85
|
export interface DetachPagesFromWindowPayload {
|
|
86
86
|
/** The OF window identity to detach the pages from. */
|
|
87
87
|
identity: OpenFin.Identity;
|
|
@@ -176,11 +176,11 @@ export interface PanelConfigVertical {
|
|
|
176
176
|
* }
|
|
177
177
|
* ```
|
|
178
178
|
*/
|
|
179
|
-
export
|
|
179
|
+
export type PanelConfig = (PanelConfigHorizontal | PanelConfigVertical) & {
|
|
180
180
|
/** The options with which to initialize the panel view.*/
|
|
181
181
|
viewOptions: Omit<OpenFin.PlatformViewCreationOptions, 'bounds' | 'target'>;
|
|
182
182
|
};
|
|
183
|
-
export
|
|
183
|
+
export type ExtendedPanelConfig = PanelConfig & {
|
|
184
184
|
viewOptions: PanelConfig['viewOptions'] & OpenFin.Identity;
|
|
185
185
|
};
|
|
186
186
|
export {};
|
|
@@ -69,5 +69,5 @@ export declare const BrowserChannelAction: {
|
|
|
69
69
|
DuplicatePage: GeneralBrowserChannelActions.DuplicatePage;
|
|
70
70
|
SetSelectedScheme: GeneralBrowserChannelActions.SetSelectedScheme;
|
|
71
71
|
};
|
|
72
|
-
export
|
|
72
|
+
export type BrowserChannelAction = typeof BrowserChannelAction;
|
|
73
73
|
export {};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import OpenFin from '@openfin/core';
|
|
2
|
+
import { Awaitable, RemoveFunctions } from '../../../../../common/src/utils/types';
|
|
3
|
+
import { homeOFIdentity } from '../../../../../common/src/utils/window';
|
|
4
|
+
import type { HomeClientApiDataRequest, HomeClientApiDispatchRequest, HomeClientApiSearchCloseRequest, HomeInternalDataResponse, HomeInternalErrorResponse, InternalDataResponse, InternalDispatchRequest, InternalErrorResponse, InternalSearchRequest, InternalSearchResponse } from '../../../../../common/src/api/shapes/home';
|
|
5
|
+
import { HomeProvider } from '../../../../../client-api/src/home';
|
|
6
|
+
import { RegisterMetaInfoInternal } from '../../../../../client-api/src/index';
|
|
7
|
+
export declare const HomeChannelActions: {
|
|
8
|
+
/**
|
|
9
|
+
* The stream id that data is requested and transported back to the creator of a search topic on.
|
|
10
|
+
*/
|
|
11
|
+
readonly remoteProviderDataStreamId: "0";
|
|
12
|
+
/**
|
|
13
|
+
* The stream id that handles search request to the creator of a search topic from remote client like views.
|
|
14
|
+
*/
|
|
15
|
+
readonly remoteClientSearchStreamId: "1";
|
|
16
|
+
/**
|
|
17
|
+
* The stream id for registering a remote search provider with the creator of a search topic.
|
|
18
|
+
*/
|
|
19
|
+
readonly remoteProviderRegistrationStreamId: "2";
|
|
20
|
+
/**
|
|
21
|
+
* The stream id for deregistering a remote search provider with the creator of a search topic.
|
|
22
|
+
*/
|
|
23
|
+
readonly remoteProviderDeregistrationStreamId: "3";
|
|
24
|
+
/**
|
|
25
|
+
* The stream id for sharing remote search provider information with the creator of a search topic.
|
|
26
|
+
*/
|
|
27
|
+
readonly remoteProviderInfoStreamId: "4";
|
|
28
|
+
/**
|
|
29
|
+
* The stream id for dispatching search results back to a remote search provider.
|
|
30
|
+
*/
|
|
31
|
+
readonly remoteProviderDispatchStreamId: "5";
|
|
32
|
+
/**
|
|
33
|
+
* The stream id for notifying remote search providers that the request have closed.
|
|
34
|
+
*/
|
|
35
|
+
readonly remoteSearchCloseStreamId: "6";
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Registered ON the Client API
|
|
39
|
+
* Dispatched to by the Workspace Provider
|
|
40
|
+
*/
|
|
41
|
+
interface SearchAPIClientChannelActions {
|
|
42
|
+
[HomeChannelActions.remoteProviderDataStreamId]: (req: HomeClientApiDataRequest, identity: OpenFin.Identity) => Promise<HomeInternalDataResponse | HomeInternalErrorResponse>;
|
|
43
|
+
[HomeChannelActions.remoteSearchCloseStreamId]: (req: HomeClientApiSearchCloseRequest, identity: OpenFin.Identity) => void;
|
|
44
|
+
[HomeChannelActions.remoteProviderDispatchStreamId]: (req: HomeClientApiDispatchRequest, identity: OpenFin.Identity) => Promise<void> | void;
|
|
45
|
+
}
|
|
46
|
+
type HomeChannelActions = Record<string, never>;
|
|
47
|
+
/**
|
|
48
|
+
* Registered ON the WOrkspace Provider
|
|
49
|
+
* Dispatched to by Client API OR by Home.
|
|
50
|
+
*/
|
|
51
|
+
type SearchProviderChannelActions = {
|
|
52
|
+
[HomeChannelActions.remoteProviderDataStreamId]: (req: InternalDataResponse, identity: OpenFin.Identity) => void | Promise<void>;
|
|
53
|
+
[HomeChannelActions.remoteClientSearchStreamId]: (req: InternalSearchRequest, identity: OpenFin.Identity) => Promise<InternalSearchResponse | InternalErrorResponse>;
|
|
54
|
+
[HomeChannelActions.remoteProviderDeregistrationStreamId]: (providerId: string, identity: OpenFin.Identity) => Promise<void>;
|
|
55
|
+
[HomeChannelActions.remoteProviderRegistrationStreamId]: (req: RemoveFunctions<HomeProvider>, identity: OpenFin.Identity) => Promise<RegisterMetaInfoInternal>;
|
|
56
|
+
[HomeChannelActions.remoteProviderDispatchStreamId]: (req: InternalDispatchRequest, identity: OpenFin.Identity) => Promise<void>;
|
|
57
|
+
[HomeChannelActions.remoteSearchCloseStreamId]: (req: {
|
|
58
|
+
id: string;
|
|
59
|
+
}, identity: OpenFin.Identity) => Promise<void>;
|
|
60
|
+
};
|
|
61
|
+
interface SearchChannelClientBase extends Omit<OpenFin.ChannelClient, 'dispatch' | 'register'> {
|
|
62
|
+
/**
|
|
63
|
+
* Dispatches an action to the Workspace Provider.
|
|
64
|
+
* @param action The action to dispatch
|
|
65
|
+
* @param payload The payload to send with the action
|
|
66
|
+
*/
|
|
67
|
+
dispatch: <T extends keyof SearchProviderChannelActions>(action: T, payload: Parameters<SearchProviderChannelActions[T]>[0]) => Promise<Awaited<ReturnType<SearchProviderChannelActions[T]>>>;
|
|
68
|
+
}
|
|
69
|
+
export interface SearchAPIClientChannelClient extends SearchChannelClientBase {
|
|
70
|
+
/**
|
|
71
|
+
* Registers a handler for a channel action.
|
|
72
|
+
* This function is ONLY used from within `client-api` and should not be used by the workspace components.
|
|
73
|
+
*
|
|
74
|
+
* @param action The action to register a handler for.
|
|
75
|
+
* @param handler The handler to register.
|
|
76
|
+
*/
|
|
77
|
+
register: <T extends keyof SearchAPIClientChannelActions>(action: T, handler: (payload: Parameters<SearchAPIClientChannelActions[T]>[0], id: OpenFin.ProviderIdentity | OpenFin.ClientIdentity) => Awaitable<ReturnType<SearchAPIClientChannelActions[T]>>) => boolean;
|
|
78
|
+
}
|
|
79
|
+
export interface WorkspaceChannelProvider extends Omit<OpenFin.ChannelProvider, 'register' | 'dispatch'> {
|
|
80
|
+
/**
|
|
81
|
+
* Used for dispatching a channel action to a channel client
|
|
82
|
+
*
|
|
83
|
+
* @param to The identity of the client to send the action to.
|
|
84
|
+
* @param action The action to send.
|
|
85
|
+
* @param payload The payload to send with the action.
|
|
86
|
+
*/
|
|
87
|
+
dispatch: <I extends OpenFin.ClientIdentity | OpenFin.Identity, T extends I['name'] extends (typeof homeOFIdentity)['name'] ? keyof HomeChannelActions : keyof SearchAPIClientChannelClient>(to: I, action: T, payload: I['name'] extends (typeof homeOFIdentity)['name'] ? T extends keyof HomeChannelActions ? Parameters<HomeChannelActions[T]>[0] : never : T extends keyof SearchAPIClientChannelActions ? Parameters<SearchAPIClientChannelActions[T]>[0] : never) => I['name'] extends (typeof homeOFIdentity)['name'] ? T extends keyof HomeChannelActions ? Promise<Awaited<ReturnType<HomeChannelActions[T]>>> : T extends keyof SearchAPIClientChannelActions ? Promise<Awaited<ReturnType<SearchAPIClientChannelActions[T]>>> : never : never;
|
|
88
|
+
/**
|
|
89
|
+
* Used for registering a channel action handler for a channel client
|
|
90
|
+
*
|
|
91
|
+
* @param action The action to register a handler for.
|
|
92
|
+
* @param handler The handler to register.
|
|
93
|
+
*/
|
|
94
|
+
register: <T extends keyof SearchProviderChannelActions>(action: T, handler: (payload: Parameters<SearchProviderChannelActions[T]>[0], id: OpenFin.ProviderIdentity | OpenFin.ClientIdentity) => Awaitable<ReturnType<SearchProviderChannelActions[T]>>) => boolean;
|
|
95
|
+
}
|
|
96
|
+
export {};
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
2
|
import type { Awaitable } from '../../../../../common/src/utils/types';
|
|
3
3
|
import type { dockOFIdentity, homeOFIdentity, storefrontOFIdentity } from '../../../../../common/src/utils/window';
|
|
4
|
+
import type { SearchQueryWithProviderID, SearchQueryWithProviderIdentity } from '../../../../../common/src/api/home';
|
|
4
5
|
import type { ProviderChannelPayload, ProviderDeregisterPayload, ProviderInfoInternal, ProviderRegisterPayload, ProviderUpdatePayload } from '../../../../../common/src/api/provider';
|
|
5
6
|
import type { ClientAPILaunchStorefrontProviderAppRequest, LaunchStorefrontProviderAppRequest } from '../../../../../common/src/api/storefront';
|
|
6
7
|
import type { WorkspaceComponentSetSelectedSchemePayload } from '../../../../../common/src/api/theming';
|
|
7
8
|
import type { Workspace as LegacyWorkspace } from '../../../../../common/src/api/workspaces';
|
|
8
|
-
import type { HomeSearchListenerRequest
|
|
9
|
+
import type { HomeSearchListenerRequest } from '../../../../../client-api/src/home';
|
|
9
10
|
import type { RegisterMetaInfoInternal } from '../../../../../client-api/src/index';
|
|
10
11
|
import type { StorefrontFooter, StorefrontLandingPage, StorefrontNavigationSection, UpdateButtonConfigRequest } from '../../../../../client-api/src/store';
|
|
11
12
|
import type { App, ColorSchemeOptionType, Page } from '../../../../../client-api-platform/src/shapes';
|
|
12
|
-
export
|
|
13
|
+
export type WorkspaceChannelAction = keyof WorkspaceChannelTypes;
|
|
13
14
|
/****** API Client Channel Actions ******/
|
|
14
15
|
/**
|
|
15
16
|
* Channel actions, related to store, **registered** by the Workspace Platform Provider e.g. Studio.
|
|
16
17
|
*/
|
|
17
|
-
|
|
18
|
+
type StoreAPIClientChannelActions = {
|
|
18
19
|
'get-storefront-provider-apps': (id: string) => Promise<App[]>;
|
|
19
20
|
'get-storefront-provider-footer': (id: string) => Promise<StorefrontFooter>;
|
|
20
21
|
'get-storefront-provider-landing-page': (id: string) => Promise<StorefrontLandingPage>;
|
|
@@ -24,33 +25,32 @@ declare type StoreAPIClientChannelActions = {
|
|
|
24
25
|
/**
|
|
25
26
|
* Channel actions, related to dock, **registered** by the Workspace Platform Provider e.g. Studio.
|
|
26
27
|
*/
|
|
27
|
-
|
|
28
|
+
type DockAPIClientChannelActions = Record<string, never>;
|
|
28
29
|
/**
|
|
29
30
|
* Channel actions, related to home, **registered** by the Workspace Platform Provider e.g. Studio.
|
|
30
31
|
*/
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
type HomeAPIClientChannelActions = Record<string, never>;
|
|
33
|
+
type WorkspaceAPIClientChannelActions = StoreAPIClientChannelActions | DockAPIClientChannelActions | HomeAPIClientChannelActions;
|
|
33
34
|
/****** End of API Client Channel Actions ******/
|
|
34
35
|
/****** Workspace Component Channel Actions ******/
|
|
35
36
|
/**
|
|
36
37
|
* Channel Actions **registered** by all workspace components.
|
|
37
38
|
*/
|
|
38
|
-
|
|
39
|
+
type SharedChannelActions = {
|
|
39
40
|
'set-selected-scheme': (ctx: WorkspaceComponentSetSelectedSchemePayload) => Promise<void>;
|
|
40
41
|
};
|
|
41
42
|
/**
|
|
42
43
|
* Channel Actions **registered** by the Home workspace component.
|
|
43
44
|
*/
|
|
44
|
-
|
|
45
|
+
type HomeChannelActions = {
|
|
45
46
|
'assign-home-search-context': (payload: Partial<HomeSearchListenerRequest['context']>) => Promise<void>;
|
|
46
|
-
'set-search-query': (payload:
|
|
47
|
-
'open-home-and-set-search-query': (payload: SearchQueryWithProviderID) => Promise<void>;
|
|
47
|
+
'open-home-and-set-search-query': (payload: SearchQueryWithProviderIdentity) => Promise<void>;
|
|
48
48
|
'temporary-is-home-ready': () => Promise<boolean>;
|
|
49
49
|
};
|
|
50
50
|
/**
|
|
51
51
|
* Channel Actions **registered** by the Storefront workspace component.
|
|
52
52
|
*/
|
|
53
|
-
|
|
53
|
+
type StoreChannelActions = {
|
|
54
54
|
'update-app-card-button-config': (payload: UpdateButtonConfigRequest & ProviderInfoInternal<'storefront'>) => Promise<void>;
|
|
55
55
|
};
|
|
56
56
|
/**
|
|
@@ -58,7 +58,7 @@ declare type StoreChannelActions = {
|
|
|
58
58
|
*/
|
|
59
59
|
interface DockChannelActions {
|
|
60
60
|
}
|
|
61
|
-
|
|
61
|
+
type WorkspaceComponentChannelActions = SharedChannelActions & HomeChannelActions & StoreChannelActions & DockChannelActions;
|
|
62
62
|
/****** End of Workspace Component Channel Actions ******/
|
|
63
63
|
/****** Workspace Provider Channel Actions ******/
|
|
64
64
|
/**
|
|
@@ -67,7 +67,7 @@ declare type WorkspaceComponentChannelActions = SharedChannelActions & HomeChann
|
|
|
67
67
|
*
|
|
68
68
|
* The handlers for these actions are defined [here](https://github.com/openfin/workspace/blob/develop/provider/src/api/protocol.ts#L32)
|
|
69
69
|
*/
|
|
70
|
-
|
|
70
|
+
type WorkspaceChannelTypes = {
|
|
71
71
|
'register-provider': (payload: ProviderRegisterPayload) => RegisterMetaInfoInternal;
|
|
72
72
|
'deregister-provider': (payload: ProviderDeregisterPayload) => Promise<void>;
|
|
73
73
|
'get-providers': (payload: ProviderChannelPayload) => Promise<ProviderInfoInternal[]>;
|
|
@@ -55,7 +55,7 @@ export declare enum WorkspacePlatformChannelAction {
|
|
|
55
55
|
GetDockProviderConfig = "getDockProviderConfig",
|
|
56
56
|
SaveDockProviderConfig = "saveDockProviderConfig"
|
|
57
57
|
}
|
|
58
|
-
export
|
|
58
|
+
export type PlatFormSupportedFeatures = boolean | {
|
|
59
59
|
isWorkspacePlatform: boolean;
|
|
60
60
|
isBrowserInitialized: boolean;
|
|
61
61
|
analytics?: {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { SearchAPIClientChannelClient } from '../../../../common/src/api/protocol/shapes/search';
|
|
1
2
|
import type { WorkspaceAPIClientChannelClient, WorkspaceChannelProvider, WorkspaceComponentChannelClient } from './shapes/workspace';
|
|
2
3
|
export type { WorkspaceAPIClientChannelClient, WorkspaceComponentChannelClient, WorkspaceChannelProvider };
|
|
3
4
|
/** The name of the channel for the centralized workspace protocol. */
|
|
4
5
|
export declare const channelName: "__of_workspace_protocol__";
|
|
5
6
|
export declare const getChannelClient: () => Promise<WorkspaceComponentChannelClient>;
|
|
6
7
|
export declare const getClientAPIChannelClient: () => Promise<WorkspaceAPIClientChannelClient>;
|
|
8
|
+
export declare const getSearchClientAPIChannelClient: () => Promise<SearchAPIClientChannelClient>;
|
|
7
9
|
/**
|
|
8
10
|
* Launches the Workspace Provider.
|
|
9
11
|
* If the Workspace Provider is already running, does nothing.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
|
-
import { RemoveFunctions } from '../../../common/src/utils/types';
|
|
3
|
-
import { DockProvider, StorefrontProvider, WorkspaceButtonsConfig } from '../../../client-api/src/shapes';
|
|
2
|
+
import type { RemoveFunctions } from '../../../common/src/utils/types';
|
|
3
|
+
import type { CLIProvider, DockProvider, HomeProvider, StorefrontProvider, WorkspaceButtonsConfig } from '../../../client-api/src/shapes';
|
|
4
4
|
interface WithIdentity {
|
|
5
5
|
/**
|
|
6
6
|
* The platform identity that registered the Storefront Provider.
|
|
@@ -12,14 +12,18 @@ interface WithIdentity {
|
|
|
12
12
|
*/
|
|
13
13
|
uniqueId: string;
|
|
14
14
|
}
|
|
15
|
-
export
|
|
15
|
+
export type ProviderType = 'storefront' | 'dock'
|
|
16
|
+
/**
|
|
17
|
+
* Use with caution! This is not fully utilized everywhere in the codebase.
|
|
18
|
+
*/
|
|
19
|
+
| 'home';
|
|
16
20
|
/**
|
|
17
21
|
* The internal representation of the dock provider, which includes the identity of the provider
|
|
18
22
|
* All functions on the DockProvider type are removed, as they are handled through OpenFin Channels
|
|
19
23
|
*
|
|
20
24
|
* The `platformIdentity` is added in the register call [here](../../../provider/src/api/provider.ts)
|
|
21
25
|
*/
|
|
22
|
-
export
|
|
26
|
+
export type DockProviderInternal =
|
|
23
27
|
/**
|
|
24
28
|
* Remove all functions from the StorefrontProvider type, as they are handled through OpenFin Channels
|
|
25
29
|
*/
|
|
@@ -32,21 +36,32 @@ RemoveFunctions<Omit<DockProvider, 'workspaceComponents'>> & {
|
|
|
32
36
|
*
|
|
33
37
|
* The `platformIdentity` is added in the register call [here](../../../provider/src/api/provider.ts)
|
|
34
38
|
*/
|
|
35
|
-
export
|
|
39
|
+
export type StorefrontProviderInternal =
|
|
36
40
|
/**
|
|
37
41
|
* Remove all functions from the StorefrontProvider type, as they are handled through OpenFin Channels
|
|
38
42
|
*/
|
|
39
43
|
RemoveFunctions<StorefrontProvider> & WithIdentity;
|
|
44
|
+
/**
|
|
45
|
+
* The internal representation of the home provider, which includes the identity of the provider
|
|
46
|
+
* All functions on the HomeProvider/CLIProvider type are removed, as they are handled through OpenFin Channels
|
|
47
|
+
*
|
|
48
|
+
* The `platformIdentity` is added in the register call [here](../../../provider/src/api/provider.ts)
|
|
49
|
+
*/
|
|
50
|
+
export type HomeProviderInternal =
|
|
51
|
+
/**
|
|
52
|
+
* Remove all functions from the StorefrontProvider type, as they are handled through OpenFin Channels
|
|
53
|
+
*/
|
|
54
|
+
(RemoveFunctions<HomeProvider> | RemoveFunctions<CLIProvider>) & WithIdentity;
|
|
40
55
|
/**
|
|
41
56
|
* The internal representation of a provider, which includes the identity of the provider
|
|
42
57
|
* This should be used anywhere within 'dock/*' or 'storefront/*' and most places within 'provider/*'
|
|
43
58
|
* to ensure that the identity is included
|
|
44
59
|
*/
|
|
45
|
-
export
|
|
60
|
+
export type ProviderInfoInternal<T extends ProviderType = ProviderType> = T extends 'dock' ? DockProviderInternal : StorefrontProviderInternal;
|
|
46
61
|
export interface ProviderChannelPayload {
|
|
47
62
|
providerType: ProviderType;
|
|
48
63
|
}
|
|
49
|
-
export
|
|
64
|
+
export type ProviderRegisterPayload = {
|
|
50
65
|
providerType: 'dock';
|
|
51
66
|
info: RemoveFunctions<DockProvider>;
|
|
52
67
|
} | {
|
|
@@ -56,14 +71,14 @@ export declare type ProviderRegisterPayload = {
|
|
|
56
71
|
export interface ProviderDeregisterPayload extends ProviderChannelPayload {
|
|
57
72
|
id: string;
|
|
58
73
|
}
|
|
59
|
-
export
|
|
74
|
+
export type ProviderConnectionPayload = {
|
|
60
75
|
providerType: 'dock';
|
|
61
76
|
provider: DockProviderInternal;
|
|
62
77
|
} | {
|
|
63
78
|
providerType: 'storefront';
|
|
64
79
|
provider: StorefrontProviderInternal;
|
|
65
80
|
};
|
|
66
|
-
export
|
|
81
|
+
export type ProviderDisconnectionPayload = {
|
|
67
82
|
providerType: 'dock';
|
|
68
83
|
provider: DockProviderInternal;
|
|
69
84
|
} | {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HomeSearchResult, ScoreOrder } from '../../../../client-api/src/shapes';
|
|
2
|
+
/**
|
|
3
|
+
* Aggregates and sorts the search results from old and new result arrays.
|
|
4
|
+
*
|
|
5
|
+
* @param oldResults - An array of existing `HomeSearchResult` objects.
|
|
6
|
+
* @param newResults - An array of new `HomeSearchResult` objects to be merged with the existing results.
|
|
7
|
+
* @param order - The order in which to sort the results based on their scores ('ascending' or 'descending'). Default is 'ascending'.
|
|
8
|
+
* @returns An array of `HomeSearchResult` objects containing the merged and sorted search results.
|
|
9
|
+
*/
|
|
10
|
+
export declare function aggregate(oldResults?: HomeSearchResult[], newResults?: HomeSearchResult[], order?: ScoreOrder): HomeSearchResult[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HomeSearchListenerResponse, HomeSearchResult, ScoreOrder } from '../../../../client-api/src/shapes';
|
|
2
|
+
import { InternalSearchListenerRequest, InternalSearchListenerResponseStatus, SearchRequest } from '../shapes/home';
|
|
3
|
+
export interface InternalSearchListenerResponse {
|
|
4
|
+
getResultBuffer(): HomeSearchResult[];
|
|
5
|
+
setResultBuffer(results: HomeSearchResult[]): void;
|
|
6
|
+
getRevokedBuffer(): string[];
|
|
7
|
+
setRevokedBuffer(resultIds: string[]): void;
|
|
8
|
+
onChange(): void;
|
|
9
|
+
getStatus(): InternalSearchListenerResponseStatus;
|
|
10
|
+
res: HomeSearchListenerResponse;
|
|
11
|
+
}
|
|
12
|
+
export declare function makeInternalSearchListenerResponse(scoreOrder?: ScoreOrder): InternalSearchListenerResponse;
|
|
13
|
+
export declare function makeInternalSearchListenerRequest(id: string, req: SearchRequest): InternalSearchListenerRequest;
|