@openfin/workspace 45.0.15 → 45.1.0-alpha.2539edb0
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/internal/providers.d.ts +4 -3
- package/client-api-platform/src/api/app-directory.d.ts +1 -1
- package/client-api-platform/src/api/language.d.ts +12 -2
- package/client-api-platform/src/index.d.ts +2 -0
- package/client-api-platform/src/init/override-callback/view-defaults.d.ts +2 -1
- package/client-api-platform/src/init/view-tab-new-tab-shortcut-usage.d.ts +4 -0
- package/client-api-platform/src/shapes.d.ts +123 -10
- package/common/src/api/home-search-host.d.ts +8 -0
- package/common/src/api/home-vpw-search-channel.d.ts +2 -0
- package/common/src/api/home-vpw-search-host.d.ts +4 -0
- package/common/src/api/i18next.d.ts +2 -2
- package/common/src/api/protocol/shapes/workspace.d.ts +6 -0
- package/common/src/api/protocol/workspace-platform.d.ts +1 -0
- package/common/src/api/protocol/workspace.d.ts +1 -0
- package/common/src/api/workspace-events.d.ts +53 -0
- package/common/src/errors/AppError.d.ts +37 -0
- package/common/src/errors/errors.d.ts +23 -0
- package/common/src/errors/index.d.ts +6 -0
- package/common/src/errors/result.d.ts +23 -0
- package/common/src/errors/toAppError.d.ts +14 -0
- package/common/src/utils/color-channels.d.ts +42 -0
- package/common/src/utils/color-linking.d.ts +1 -1
- package/common/src/utils/context-menu.d.ts +2 -1
- package/common/src/utils/env.d.ts +1 -1
- package/common/src/utils/layout.d.ts +22 -3
- package/common/src/utils/navigate.d.ts +32 -0
- package/common/src/utils/popup-window.d.ts +9 -0
- package/common/src/utils/route.d.ts +6 -0
- package/common/src/utils/usage-register.d.ts +15 -1
- package/common/src/utils/window.d.ts +34 -2
- package/externals.report.json +25 -25
- package/home-vpw/src/api/constants.d.ts +3 -0
- package/home-vpw/src/api/ensure-infrastructure.d.ts +6 -0
- package/home-vpw/src/api/index.d.ts +3 -0
- package/home-vpw/src/api/internal/channel-handlers.d.ts +23 -0
- package/home-vpw/src/api/internal/provider-registration.d.ts +8 -0
- package/home-vpw/src/api/internal/providers-map.d.ts +22 -0
- package/home-vpw/src/api/launch.d.ts +6 -0
- package/home-vpw/src/api/protocol.d.ts +44 -0
- package/home-vpw/src/api/provider.d.ts +19 -0
- package/home-vpw/src/api/register.d.ts +10 -0
- package/home-vpw/src/api/visibility.d.ts +3 -0
- package/home.js +1 -1
- package/home.js.map +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/notifications.js +1 -1
- package/notifications.js.map +1 -1
- package/package.json +3 -3
- package/store.js +1 -1
- package/store.js.map +1 -1
- package/storefront-vpw/src/api/constants.d.ts +2 -0
- package/storefront-vpw/src/api/ensure-infrastructure.d.ts +6 -0
- package/storefront-vpw/src/api/index.d.ts +5 -0
- package/storefront-vpw/src/api/internal/assert-provider-process.d.ts +2 -0
- package/storefront-vpw/src/api/internal/provider-registration.d.ts +7 -0
- package/storefront-vpw/src/api/internal/providers-map.d.ts +23 -0
- package/storefront-vpw/src/api/launch.d.ts +2 -0
- package/storefront-vpw/src/api/protocol.d.ts +67 -0
- package/storefront-vpw/src/api/provider.d.ts +23 -0
- package/storefront-vpw/src/api/register.d.ts +79 -0
- package/storefront-vpw/src/api/visibility.d.ts +43 -0
- package/storefront-vpw/src/shapes/index.d.ts +1 -0
- package/storefront-vpw/src/shapes/shapes.d.ts +4 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PlatformError } from '../../../common/src/errors';
|
|
1
2
|
import { ProviderType } from '../../../common/src/api/provider';
|
|
2
3
|
/**
|
|
3
4
|
* Error thrown when attempting to use a provider that is not registered.
|
|
@@ -7,7 +8,7 @@ import { ProviderType } from '../../../common/src/api/provider';
|
|
|
7
8
|
* // Error: Dock Provider. Dock Provider with id my-dock-id is not currently registered.
|
|
8
9
|
* ```
|
|
9
10
|
*/
|
|
10
|
-
export declare class ProviderNotRegisteredError extends
|
|
11
|
+
export declare class ProviderNotRegisteredError extends PlatformError {
|
|
11
12
|
constructor(providerType: ProviderType, id?: string);
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
@@ -19,7 +20,7 @@ export declare class ProviderNotRegisteredError extends Error {
|
|
|
19
20
|
* // Error: Home Provider. Home Provider with id my-home-id is already registered.
|
|
20
21
|
* ```
|
|
21
22
|
*/
|
|
22
|
-
export declare class ProviderAlreadyRegisteredError extends
|
|
23
|
+
export declare class ProviderAlreadyRegisteredError extends PlatformError {
|
|
23
24
|
constructor(providerType: ProviderType, id?: string);
|
|
24
25
|
}
|
|
25
26
|
/**
|
|
@@ -31,7 +32,7 @@ export declare class ProviderAlreadyRegisteredError extends Error {
|
|
|
31
32
|
* // Error: Failed to get Storefront Provider. Storefront Provider with id unknown-id is not currently registered.
|
|
32
33
|
* ```
|
|
33
34
|
*/
|
|
34
|
-
export declare class FailedToGetProviderError extends
|
|
35
|
+
export declare class FailedToGetProviderError extends PlatformError {
|
|
35
36
|
constructor(providerType: ProviderType, id?: string);
|
|
36
37
|
}
|
|
37
38
|
/**
|
|
@@ -7,7 +7,7 @@ import type { LaunchAppRequest, SearchSitesRequest, SearchSitesResponse, Site }
|
|
|
7
7
|
* @param app the app directory entry.
|
|
8
8
|
* @param opts launch options.
|
|
9
9
|
*/
|
|
10
|
-
export declare function launchApp({ app, target }: LaunchAppRequest): Promise<void | OpenFin.
|
|
10
|
+
export declare function launchApp({ app, target }: LaunchAppRequest): Promise<void | OpenFin.Identity | OpenFin.Platform | OpenFin.View | OpenFin.Application>;
|
|
11
11
|
export declare const enterpriseAppDirectoryChannelClient: () => Promise<OpenFin.ChannelClient>;
|
|
12
12
|
export declare function getResults(payload: {
|
|
13
13
|
req: SearchSitesRequest;
|
|
@@ -1,13 +1,23 @@
|
|
|
1
|
+
import type { PlatformCapabilities } from '../../../client-api-platform/src/shapes';
|
|
1
2
|
import { Locale } from '../../../client-api-platform/src/shapes';
|
|
2
3
|
export declare function getLanguage(): Locale;
|
|
3
4
|
export declare const dispatchLanguageToBrowserWindows: (language: Locale) => Promise<void[]>;
|
|
4
5
|
export declare const setLanguage: (locale: Locale) => Promise<void>;
|
|
5
6
|
export declare function getLanguageResourcesInternal(): {
|
|
6
|
-
currentLanguage:
|
|
7
|
+
currentLanguage: string;
|
|
7
8
|
resources: import("i18next").Resource;
|
|
8
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* This API returns what functionality is supported by the platform.
|
|
12
|
+
* This is useful when Home/Dock/NC is of a higher version
|
|
13
|
+
* and may depend on functionality that is not available
|
|
14
|
+
* in the current Workspace Platform version.
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export declare function getCapabilitiesInternal(): PlatformCapabilities;
|
|
9
18
|
/**
|
|
10
19
|
* initLanguage()
|
|
11
|
-
* @param language - optional - ISO language code
|
|
20
|
+
* @param language - optional - ISO language code. Built-in languages are always accepted.
|
|
21
|
+
* Any language code defined in the external `translation-override.json` is also accepted.
|
|
12
22
|
*/
|
|
13
23
|
export default function initLanguage(language?: Locale): Promise<void>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export * from './shapes';
|
|
2
2
|
export * as Dock from '../../dock3/src/api';
|
|
3
|
+
export * as HomeVpw from '../../home-vpw/src/api';
|
|
4
|
+
export * as StorefrontVpw from '../../storefront-vpw/src/api';
|
|
3
5
|
export { init } from './init';
|
|
4
6
|
export { getCurrentSync, wrapSync } from './api';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
|
+
import type { BrowserCreateViewRequest } from '../../../../client-api-platform/src/shapes';
|
|
2
3
|
type DefaultViewOptions = Partial<OpenFin.MutableViewOptions> & {
|
|
3
4
|
downloadShelf?: OpenFin.ConstWindowOptions['downloadShelf'];
|
|
4
5
|
hotkeys?: OpenFin.ViewOptions['hotkeys'];
|
|
5
6
|
};
|
|
6
7
|
export declare const DEFAULT_VIEW_OPTIONS: DefaultViewOptions;
|
|
7
|
-
export declare function applyViewDefaults(options: Partial<
|
|
8
|
+
export declare function applyViewDefaults(options: Partial<BrowserCreateViewRequest>, initViewOptions?: Partial<BrowserCreateViewRequest>): Promise<any>;
|
|
8
9
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
|
-
import type { IconProps, IconType
|
|
3
|
-
import type { ModalResponseEvent } from '../../common/src/utils/menu-window-provider';
|
|
2
|
+
import type { IconProps, IconType } from '@openfin/ui-library';
|
|
4
3
|
import type { WorkspaceIndicatorConfig } from '../../common/src/utils/indicators/workspace-indicators';
|
|
4
|
+
import type { ModalResponseEvent } from '../../common/src/utils/menu-window-provider';
|
|
5
5
|
import type { AnalyticsEvent, AnalyticsEventInternal } from '../../common/src/utils/usage-register';
|
|
6
6
|
import type { BaseCustomDropdownItem, CustomActionSpecifier, CustomButtonConfig } from '../../common/src/api/action';
|
|
7
7
|
import type { Resource } from '../../common/src/api/i18next';
|
|
@@ -14,6 +14,7 @@ import type { WorkflowIntegration } from '../../client-api/src/shapes/integratio
|
|
|
14
14
|
import type { DockCompanionButton } from '../../dock3/src/shapes/index';
|
|
15
15
|
import type { AddPagesOptions, BasePageOpts, PageOpts } from '../../enterprise-api/src/shapes';
|
|
16
16
|
export * from '../../dock3/src/shapes';
|
|
17
|
+
export * from '../../storefront-vpw/src/shapes';
|
|
17
18
|
export { AppManifestType } from '../../client-api/src/shapes';
|
|
18
19
|
export type { App, AppIntent, Image } from '../../client-api/src/shapes';
|
|
19
20
|
export type { CustomActionSpecifier, CustomButtonConfig } from '../../common/src/api/action';
|
|
@@ -22,6 +23,17 @@ export { PanelPosition } from '../../common/src/api/pages/shapes';
|
|
|
22
23
|
export type { CustomThemes, CustomThemeOptions, ThemeOptions, CustomThemeOptionsWithScheme, CustomPaletteSet, BaseThemeOptions, ThemeExtension, WorkspaceThemeSet, NotificationIndicatorColorsSet, NotificationIndicatorColorsSetDarkScheme, NotificationIndicatorColorsSetLightScheme, NotificationIndicatorColorsWithScheme } from '../../common/src/api/theming';
|
|
23
24
|
export type { AnalyticsEvent } from '../../common/src/utils/usage-register';
|
|
24
25
|
export type { WorkflowIntegration } from '../../client-api/src/shapes/integrations';
|
|
26
|
+
/**
|
|
27
|
+
* Platform capabilities for feature detection by workspace components (Home, Dock).
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
export interface PlatformCapabilities {
|
|
31
|
+
languageBroadcast?: {
|
|
32
|
+
home?: boolean;
|
|
33
|
+
dock?: boolean;
|
|
34
|
+
notifications?: boolean;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
25
37
|
/**
|
|
26
38
|
* Request for creating a saved page in persistent storage.
|
|
27
39
|
*/
|
|
@@ -388,6 +400,14 @@ export declare enum ViewTabMenuOptionType {
|
|
|
388
400
|
* Prints a screenshot of the browser window.
|
|
389
401
|
*/
|
|
390
402
|
PrintScreen = "PrintScreen",
|
|
403
|
+
/**
|
|
404
|
+
* Translate the selected view's content to the detected target language.
|
|
405
|
+
*/
|
|
406
|
+
TranslatePage = "TranslatePage",
|
|
407
|
+
/**
|
|
408
|
+
* Revert translated content back to the original language.
|
|
409
|
+
*/
|
|
410
|
+
RevertTranslation = "RevertTranslation",
|
|
391
411
|
/**
|
|
392
412
|
* Custom context menu option defined by API client.
|
|
393
413
|
*/
|
|
@@ -2076,9 +2096,9 @@ export interface WorkspacePlatformModule extends OpenFin.Platform {
|
|
|
2076
2096
|
*/
|
|
2077
2097
|
restoreLastSavedWorkspace(options?: ApplyWorkspaceOptions): Promise<RestoreLastSavedWorkspaceResult>;
|
|
2078
2098
|
/**
|
|
2079
|
-
* Returns ISO language code of
|
|
2099
|
+
* Returns the ISO language code of the currently active language.
|
|
2080
2100
|
*
|
|
2081
|
-
* @returns
|
|
2101
|
+
* @returns The active language code (e.g. `'en-US'`, `'es-ES'`).
|
|
2082
2102
|
*
|
|
2083
2103
|
* @example Example of how to get the current language on Browser
|
|
2084
2104
|
*
|
|
@@ -2096,6 +2116,11 @@ export interface WorkspacePlatformModule extends OpenFin.Platform {
|
|
|
2096
2116
|
currentLanguage: Locale;
|
|
2097
2117
|
resources: Resource;
|
|
2098
2118
|
}>;
|
|
2119
|
+
/**
|
|
2120
|
+
* Returns platform capabilities for feature detection by workspace components.
|
|
2121
|
+
* @internal
|
|
2122
|
+
*/
|
|
2123
|
+
_getCapabilities(): Promise<PlatformCapabilities>;
|
|
2099
2124
|
/**
|
|
2100
2125
|
* Sets the language to ISO language code passed in
|
|
2101
2126
|
* @param locale the ISO language code
|
|
@@ -2633,8 +2658,73 @@ export interface AnalyticsConfig {
|
|
|
2633
2658
|
*/
|
|
2634
2659
|
sendToOpenFin: boolean;
|
|
2635
2660
|
}
|
|
2661
|
+
/**
|
|
2662
|
+
* The built-in language codes supported by the Workspace Platform out of the box.
|
|
2663
|
+
*
|
|
2664
|
+
* @deprecated No longer used for language validation. The platform now accepts any language
|
|
2665
|
+
* code that has a resource bundle registered in i18next, including codes defined in an
|
|
2666
|
+
* external `translation-override.json`. This export will be removed in a future major version.
|
|
2667
|
+
*/
|
|
2636
2668
|
export declare const SUPPORTED_LANGUAGES: string[];
|
|
2637
|
-
|
|
2669
|
+
/**
|
|
2670
|
+
* An ISO language code accepted by the Workspace Platform.
|
|
2671
|
+
*
|
|
2672
|
+
* **Built-in languages** (supported out of the box):
|
|
2673
|
+
* - `en-US` — English (default)
|
|
2674
|
+
* - `de-DE` — German
|
|
2675
|
+
* - `ja-JP` — Japanese
|
|
2676
|
+
* - `ko-KR` — Korean
|
|
2677
|
+
* - `ru-RU` — Russian
|
|
2678
|
+
* - `zh-CN` — Chinese (Simplified)
|
|
2679
|
+
* - `zh-Hant` — Chinese (Traditional)
|
|
2680
|
+
*
|
|
2681
|
+
* **Adding custom languages** via `translationOverridesUrl`:
|
|
2682
|
+
*
|
|
2683
|
+
* Supply a `translationOverridesUrl` in your Desktop Owner Settings (DOS) or application manifest
|
|
2684
|
+
* pointing to a `translation-override.json` file. Any language code defined in that file will be
|
|
2685
|
+
* accepted at runtime in addition to the built-in list above.
|
|
2686
|
+
*
|
|
2687
|
+
* Example `translation-override.json`:
|
|
2688
|
+
* ```json
|
|
2689
|
+
* {
|
|
2690
|
+
* "x.x.x": {
|
|
2691
|
+
* "es-ES": {
|
|
2692
|
+
* "global.save": "Guardar",
|
|
2693
|
+
* "contextMenu.newWindow": "Nueva ventana"
|
|
2694
|
+
* }
|
|
2695
|
+
* }
|
|
2696
|
+
* }
|
|
2697
|
+
* ```
|
|
2698
|
+
*
|
|
2699
|
+
* The `translationOverridesUrl` can be configured in two ways:
|
|
2700
|
+
*
|
|
2701
|
+
* _Via Desktop Owner Settings_ (`dos.json` on macOS, registry on Windows):
|
|
2702
|
+
* ```json
|
|
2703
|
+
* {
|
|
2704
|
+
* "desktopSettings": {
|
|
2705
|
+
* "systemApps": {
|
|
2706
|
+
* "workspace": {
|
|
2707
|
+
* "customConfig": {
|
|
2708
|
+
* "translationOverridesUrl": "https://example.com/translation-override.json"
|
|
2709
|
+
* }
|
|
2710
|
+
* }
|
|
2711
|
+
* }
|
|
2712
|
+
* }
|
|
2713
|
+
* }
|
|
2714
|
+
* ```
|
|
2715
|
+
*
|
|
2716
|
+
* _Via the application manifest_ (under `platform.workspace`):
|
|
2717
|
+
* ```json
|
|
2718
|
+
* {
|
|
2719
|
+
* "platform": {
|
|
2720
|
+
* "workspace": {
|
|
2721
|
+
* "translationOverridesUrl": "https://example.com/translation-override.json"
|
|
2722
|
+
* }
|
|
2723
|
+
* }
|
|
2724
|
+
* }
|
|
2725
|
+
* ```
|
|
2726
|
+
*/
|
|
2727
|
+
export type Locale = string;
|
|
2638
2728
|
/**
|
|
2639
2729
|
* Configures the workspace to self-host using an asar bundle at the
|
|
2640
2730
|
* specified path.
|
|
@@ -2722,8 +2812,12 @@ export interface WorkspacePlatformInitConfig {
|
|
|
2722
2812
|
*/
|
|
2723
2813
|
theme?: CustomThemes;
|
|
2724
2814
|
/**
|
|
2725
|
-
* Set
|
|
2726
|
-
*
|
|
2815
|
+
* Set the initial language for the Browser.
|
|
2816
|
+
*
|
|
2817
|
+
* The built-in ISO language codes are `'en-US'`, `'ja-JP'`, `'zh-CN'`, `'ko-KR'`,
|
|
2818
|
+
* `'ru-RU'`, `'de-DE'`, and `'zh-Hant'`. Any additional language code defined in an
|
|
2819
|
+
* external `translation-override.json` (configured via `translationOverridesUrl`) is
|
|
2820
|
+
* also accepted.
|
|
2727
2821
|
*
|
|
2728
2822
|
* @example
|
|
2729
2823
|
* ```ts
|
|
@@ -2736,7 +2830,7 @@ export interface WorkspacePlatformInitConfig {
|
|
|
2736
2830
|
* }
|
|
2737
2831
|
* });
|
|
2738
2832
|
* ```
|
|
2739
|
-
* @default 'en-
|
|
2833
|
+
* @default 'en-US'
|
|
2740
2834
|
*
|
|
2741
2835
|
*/
|
|
2742
2836
|
language?: {
|
|
@@ -2996,9 +3090,28 @@ export interface BrowserInitConfig {
|
|
|
2996
3090
|
/** Default options when creating a new page. If `iconUrl`, `unsavedIconUrl`, `panels` or `closeButton` are not defined when creating a page, setting will default to `defaultPageOptions`. */
|
|
2997
3091
|
defaultPageOptions?: Pick<Page, 'iconUrl' | 'unsavedIconUrl' | 'closeButton' | 'panels'>;
|
|
2998
3092
|
/**
|
|
2999
|
-
* The default options when creating a new
|
|
3093
|
+
* The default options when creating a new view. Any option not included in WorkspacePlatform.getCurrentSync().Browser.createView(options) call will default to the value provided in this field.
|
|
3094
|
+
*
|
|
3095
|
+
* @example
|
|
3096
|
+
* ```ts
|
|
3097
|
+
* import * as WorkspacePlatform from '@openfin/workspace-platform';
|
|
3098
|
+
*
|
|
3099
|
+
* await WorkspacePlatform.init({
|
|
3100
|
+
* browser: {
|
|
3101
|
+
* defaultViewOptions: {
|
|
3102
|
+
* workspacePlatform: {
|
|
3103
|
+
* browserNavigationButtons: {
|
|
3104
|
+
* back: true,
|
|
3105
|
+
* forward: true,
|
|
3106
|
+
* reload: true
|
|
3107
|
+
* }
|
|
3108
|
+
* }
|
|
3109
|
+
* }
|
|
3110
|
+
* }
|
|
3111
|
+
* });
|
|
3112
|
+
* ```
|
|
3000
3113
|
*/
|
|
3001
|
-
defaultViewOptions?: Partial<
|
|
3114
|
+
defaultViewOptions?: Partial<BrowserCreateViewRequest>;
|
|
3002
3115
|
/**
|
|
3003
3116
|
* The platform title. UI friendly title for the platform in browser.
|
|
3004
3117
|
*/
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SearchProviderInfo, SearchTopic } from '../../../search-api/src/shapes';
|
|
2
|
+
export type HomeSearchHostCallbacks = {
|
|
3
|
+
onRegister?: (searchProvider?: SearchProviderInfo) => void | Promise<void>;
|
|
4
|
+
onDeregister?: (searchProvider?: SearchProviderInfo) => void | Promise<void>;
|
|
5
|
+
onDisconnect?: () => void | Promise<void>;
|
|
6
|
+
};
|
|
7
|
+
export declare const registerHomeSearchHost: (callbacks?: HomeSearchHostCallbacks) => Promise<SearchTopic | null>;
|
|
8
|
+
export declare const createVpwHomeSearchHostCallbacks: () => HomeSearchHostCallbacks;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SearchProviderInfo, SearchTopic } from '../../../search-api/src/shapes';
|
|
2
|
+
import type { HomeSearchHostCallbacks } from './home-search-host';
|
|
3
|
+
export declare const registerHomeVpwSearchHost: (callbacks?: HomeSearchHostCallbacks) => Promise<SearchTopic | null>;
|
|
4
|
+
export type { SearchProviderInfo };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import i18next, { type Resource } from 'i18next';
|
|
2
2
|
import { Locale } from '../../../client-api-platform/src/shapes';
|
|
3
|
-
declare function initI18next(language?: Locale): void
|
|
4
|
-
export declare const setLanguageInI18next: (locale: Locale) => void
|
|
3
|
+
declare function initI18next(language?: Locale): Promise<void>;
|
|
4
|
+
export declare const setLanguageInI18next: (locale: Locale) => Promise<void>;
|
|
5
5
|
declare const t: import("i18next").TFunction<["translation", ...string[]], undefined>;
|
|
6
6
|
export { initI18next, i18next, t, type Resource };
|
|
7
7
|
export { useTranslation } from 'react-i18next';
|
|
@@ -33,11 +33,16 @@ type HomeAPIClientChannelActions = Record<string, never>;
|
|
|
33
33
|
type WorkspaceAPIClientChannelActions = StoreAPIClientChannelActions | DockAPIClientChannelActions | HomeAPIClientChannelActions;
|
|
34
34
|
/****** End of API Client Channel Actions ******/
|
|
35
35
|
/****** Workspace Component Channel Actions ******/
|
|
36
|
+
export type WorkspaceComponentSetSelectedLanguagePayload = {
|
|
37
|
+
locale: string;
|
|
38
|
+
identity: OpenFin.Identity;
|
|
39
|
+
};
|
|
36
40
|
/**
|
|
37
41
|
* Channel Actions **registered** by all workspace components.
|
|
38
42
|
*/
|
|
39
43
|
type SharedChannelActions = {
|
|
40
44
|
'set-selected-scheme': (ctx: WorkspaceComponentSetSelectedSchemePayload) => Promise<void>;
|
|
45
|
+
'set-selected-language': (payload: WorkspaceComponentSetSelectedLanguagePayload) => Promise<void>;
|
|
41
46
|
};
|
|
42
47
|
/**
|
|
43
48
|
* Channel Actions **registered** by the Home workspace component.
|
|
@@ -93,6 +98,7 @@ type WorkspaceChannelTypes = {
|
|
|
93
98
|
dark: string;
|
|
94
99
|
};
|
|
95
100
|
}) => Promise<void>;
|
|
101
|
+
'set-selected-language': (locale: string) => Promise<void>;
|
|
96
102
|
'get-legacy-pages': () => Promise<Page[]>;
|
|
97
103
|
'get-legacy-workspaces': (payload: undefined) => Promise<LegacyWorkspace[]>;
|
|
98
104
|
'register-storefront-provider': () => Promise<void>;
|
|
@@ -61,6 +61,7 @@ export declare enum WorkspacePlatformChannelAction {
|
|
|
61
61
|
GetLanguage = "getLanguage",
|
|
62
62
|
GetLanguageResourcesInternal = "getLanguageResourcesInternal",
|
|
63
63
|
SetLanguage = "setLanguage",
|
|
64
|
+
GetCapabilitiesInternal = "getCapabilitiesInternal",
|
|
64
65
|
GetDockProviderConfig = "getDockProviderConfig",
|
|
65
66
|
SaveDockProviderConfig = "saveDockProviderConfig",
|
|
66
67
|
HandleSaveModalOnPageClose = "handleSaveModalOnPageClose",
|
|
@@ -7,6 +7,7 @@ export declare const channelName: "__of_workspace_protocol__";
|
|
|
7
7
|
export declare const getChannelClient: () => Promise<WorkspaceComponentChannelClient>;
|
|
8
8
|
export declare const getClientAPIChannelClient: () => Promise<WorkspaceAPIClientChannelClient>;
|
|
9
9
|
export declare const getSearchClientAPIChannelClient: () => Promise<withDisconnectListener<SearchAPIClientChannelClient>>;
|
|
10
|
+
export declare const getHomeVpwSearchClientAPIChannelClient: () => Promise<withDisconnectListener<SearchAPIClientChannelClient>>;
|
|
10
11
|
/**
|
|
11
12
|
* Launches the Workspace Provider.
|
|
12
13
|
* If the Workspace Provider is already running, does nothing.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { NavigatePayload } from '../../../common/src/utils/navigate';
|
|
2
|
+
import { ProviderConnectionPayload, ProviderDisconnectionPayload, ProviderUpdatePayload } from './provider';
|
|
3
|
+
/**
|
|
4
|
+
* All Workspace related events that can be emitted or listened to
|
|
5
|
+
* by the Workspace Provider or any of the workspace components
|
|
6
|
+
*/
|
|
7
|
+
type EventTypeTypes = {
|
|
8
|
+
/**
|
|
9
|
+
* Emitted when a search is invoked.
|
|
10
|
+
*/
|
|
11
|
+
'search-invoked': [string];
|
|
12
|
+
/**
|
|
13
|
+
* Emitted when a new provider is connected.
|
|
14
|
+
*
|
|
15
|
+
* For example, when a Dock Provider is successfully registered by the platform provider
|
|
16
|
+
*/
|
|
17
|
+
'provider-connected': [ProviderConnectionPayload];
|
|
18
|
+
/**
|
|
19
|
+
* Emitted when a provider is disconnected.
|
|
20
|
+
*
|
|
21
|
+
* For example, when a Dock Provider is deregistered by the platform provider
|
|
22
|
+
*/
|
|
23
|
+
'provider-disconnected': [ProviderDisconnectionPayload];
|
|
24
|
+
/**
|
|
25
|
+
* Emitted when a provider is updated.
|
|
26
|
+
*
|
|
27
|
+
* For example, when a Dock Provider is updated by the platform provider
|
|
28
|
+
*/
|
|
29
|
+
'provider-updated': [ProviderUpdatePayload];
|
|
30
|
+
/**
|
|
31
|
+
* Emmitted when notifications is created or destroyed.
|
|
32
|
+
*/
|
|
33
|
+
'update-notification-running-status': [];
|
|
34
|
+
/**
|
|
35
|
+
* Emitted when the list of search providers has been updated.
|
|
36
|
+
*/
|
|
37
|
+
'search-provider-list-updated': [];
|
|
38
|
+
/**
|
|
39
|
+
* Emitted when the list of Storefront VPW providers has been updated.
|
|
40
|
+
*/
|
|
41
|
+
'storefront-provider-list-updated': [];
|
|
42
|
+
/**
|
|
43
|
+
* Emmitted when a component is created or destroyed.
|
|
44
|
+
*/
|
|
45
|
+
'component-lifecycle-update': [];
|
|
46
|
+
/**
|
|
47
|
+
* Emitted when component should be navigated to.
|
|
48
|
+
* Contains the target provider ID and the component name.
|
|
49
|
+
*/
|
|
50
|
+
'component-navigation': [NavigatePayload];
|
|
51
|
+
};
|
|
52
|
+
export declare const addListener: <EventKey extends keyof EventTypeTypes>(event: EventKey, listener: (...payload: EventTypeTypes[EventKey]) => void) => void, removeListener: <EventKey extends keyof EventTypeTypes>(event: EventKey, listener: (...payload: EventTypeTypes[EventKey]) => void) => void, addListenerWithUUID: (uuid: string) => <EventKey extends keyof EventTypeTypes>(event: EventKey, listener: (...payload: EventTypeTypes[EventKey]) => void) => void, emit: <EventKey extends keyof EventTypeTypes>(event: EventKey, ...payload: EventTypeTypes[EventKey]) => Promise<void>;
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AppError — base class for all application errors.
|
|
3
|
+
*
|
|
4
|
+
* Use a subclass (NetworkError, PlatformError, etc.) — never instantiate AppError directly
|
|
5
|
+
* in production code. The class identity (`error.name`) is the category; `context` carries
|
|
6
|
+
* the specifics; `cause` chains the underlying error.
|
|
7
|
+
*
|
|
8
|
+
* `instanceof` is the supported way to branch on error type. `toJSON()` is what the
|
|
9
|
+
* existing logger's safeStringify uses to produce structured output, so logging an
|
|
10
|
+
* AppError preserves the full chain automatically.
|
|
11
|
+
*/
|
|
12
|
+
export interface ErrorContext {
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
}
|
|
15
|
+
export interface SerializedError {
|
|
16
|
+
name: string;
|
|
17
|
+
message: string;
|
|
18
|
+
context: ErrorContext;
|
|
19
|
+
stack?: string;
|
|
20
|
+
cause?: SerializedError;
|
|
21
|
+
timestamp: string;
|
|
22
|
+
}
|
|
23
|
+
export interface AppErrorOptions {
|
|
24
|
+
cause?: unknown;
|
|
25
|
+
context?: ErrorContext;
|
|
26
|
+
}
|
|
27
|
+
export declare class AppError extends Error {
|
|
28
|
+
readonly context: ErrorContext;
|
|
29
|
+
readonly timestamp: Date;
|
|
30
|
+
constructor(message: string, options?: AppErrorOptions);
|
|
31
|
+
serialize(): SerializedError;
|
|
32
|
+
/**
|
|
33
|
+
* Called automatically by JSON.stringify so `safeStringify({ error })` in the logger
|
|
34
|
+
* produces the full structured form without any logger changes.
|
|
35
|
+
*/
|
|
36
|
+
toJSON(): SerializedError;
|
|
37
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AppError, AppErrorOptions } from './AppError';
|
|
2
|
+
/** Put `{ url, status, method, timeoutMs }` in context as relevant. */
|
|
3
|
+
export declare class NetworkError extends AppError {
|
|
4
|
+
}
|
|
5
|
+
/** Put `{ field, received, expected }` in context. */
|
|
6
|
+
export declare class ValidationError extends AppError {
|
|
7
|
+
}
|
|
8
|
+
/** Put `{ status, scope, userId }` in context as available. */
|
|
9
|
+
export declare class AuthError extends AppError {
|
|
10
|
+
}
|
|
11
|
+
/** OpenFin / runtime / channel / provider failures. Put `{ providerId, channelName, identity }` in context. */
|
|
12
|
+
export declare class PlatformError extends AppError {
|
|
13
|
+
}
|
|
14
|
+
/** Read/write failures against persistent storage. Put `{ key, operation }` in context. */
|
|
15
|
+
export declare class StorageError extends AppError {
|
|
16
|
+
}
|
|
17
|
+
/** Bad or missing configuration discovered at runtime. Put `{ configKey, env }` in context. */
|
|
18
|
+
export declare class ConfigError extends AppError {
|
|
19
|
+
}
|
|
20
|
+
/** Catch-all. Prefer creating via `toAppError(unknown)` rather than directly. */
|
|
21
|
+
export declare class UnknownError extends AppError {
|
|
22
|
+
}
|
|
23
|
+
export type { AppErrorOptions };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { AppError } from './AppError';
|
|
2
|
+
export type { AppErrorOptions, ErrorContext, SerializedError } from './AppError';
|
|
3
|
+
export { NetworkError, ValidationError, AuthError, PlatformError, StorageError, ConfigError, UnknownError } from './errors';
|
|
4
|
+
export { toAppError } from './toAppError';
|
|
5
|
+
export { ok, err, isOk, isErr, unwrap, mapResult } from './result';
|
|
6
|
+
export type { Ok, Err, Result } from './result';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AppError } from './AppError';
|
|
2
|
+
/**
|
|
3
|
+
* Result<T, E> — opt-in alternative to throwing for operations whose callers
|
|
4
|
+
* genuinely need to branch on success vs failure (e.g., a save that has a clear
|
|
5
|
+
* fallback path). Don't blanket-replace throws — invariant violations and
|
|
6
|
+
* programmer errors should still throw.
|
|
7
|
+
*/
|
|
8
|
+
export type Ok<T> = {
|
|
9
|
+
readonly ok: true;
|
|
10
|
+
readonly value: T;
|
|
11
|
+
};
|
|
12
|
+
export type Err<E extends AppError = AppError> = {
|
|
13
|
+
readonly ok: false;
|
|
14
|
+
readonly error: E;
|
|
15
|
+
};
|
|
16
|
+
export type Result<T, E extends AppError = AppError> = Ok<T> | Err<E>;
|
|
17
|
+
export declare const ok: <T>(value: T) => Ok<T>;
|
|
18
|
+
export declare const err: <E extends AppError>(error: E) => Err<E>;
|
|
19
|
+
export declare const isOk: <T, E extends AppError>(r: Result<T, E>) => r is Ok<T>;
|
|
20
|
+
export declare const isErr: <T, E extends AppError>(r: Result<T, E>) => r is Err<E>;
|
|
21
|
+
/** Throw on Err, return value on Ok. Use sparingly — defeats the type-level branch. */
|
|
22
|
+
export declare const unwrap: <T, E extends AppError>(r: Result<T, E>) => T;
|
|
23
|
+
export declare const mapResult: <T, U, E extends AppError>(r: Result<T, E>, fn: (value: T) => U) => Result<U, E>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AppError } from './AppError';
|
|
2
|
+
/**
|
|
3
|
+
* Narrow `unknown` (the type of a catch variable when `useUnknownInCatchVariables` is on)
|
|
4
|
+
* to an AppError. Pass through existing AppErrors unchanged; wrap raw Errors and other
|
|
5
|
+
* values in UnknownError, preserving the original via `cause`.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* try {
|
|
9
|
+
* await doThing();
|
|
10
|
+
* } catch (e) {
|
|
11
|
+
* throw toAppError(e);
|
|
12
|
+
* }
|
|
13
|
+
*/
|
|
14
|
+
export declare const toAppError: (caught: unknown, fallbackMessage?: string) => AppError;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kept in a standalone module with type-only imports so consumers can pull it in
|
|
3
|
+
* via the `@openfin/enterprise-api/color-channels` subpath without bundling the SDK.
|
|
4
|
+
*/
|
|
5
|
+
export declare const ENTERPRISE_COLOR_CHANNELS: {
|
|
6
|
+
readonly blue: {
|
|
7
|
+
readonly name: "Blue";
|
|
8
|
+
readonly color: "#0091EB";
|
|
9
|
+
};
|
|
10
|
+
readonly indigo: {
|
|
11
|
+
readonly name: "Indigo";
|
|
12
|
+
readonly color: "#6450FF";
|
|
13
|
+
};
|
|
14
|
+
readonly pink: {
|
|
15
|
+
readonly name: "Pink";
|
|
16
|
+
readonly color: "#E878CF";
|
|
17
|
+
};
|
|
18
|
+
readonly teal: {
|
|
19
|
+
readonly name: "Teal";
|
|
20
|
+
readonly color: "#24D1D1";
|
|
21
|
+
};
|
|
22
|
+
readonly green: {
|
|
23
|
+
readonly name: "Green";
|
|
24
|
+
readonly color: "#00AF78";
|
|
25
|
+
};
|
|
26
|
+
readonly orange: {
|
|
27
|
+
readonly name: "Orange";
|
|
28
|
+
readonly color: "#FF7D37";
|
|
29
|
+
};
|
|
30
|
+
readonly red: {
|
|
31
|
+
readonly name: "Red";
|
|
32
|
+
readonly color: "#F94144";
|
|
33
|
+
};
|
|
34
|
+
readonly yellow: {
|
|
35
|
+
readonly name: "Yellow";
|
|
36
|
+
readonly color: "#F9C74F";
|
|
37
|
+
};
|
|
38
|
+
readonly gray: {
|
|
39
|
+
readonly name: "Gray";
|
|
40
|
+
readonly color: "#828788";
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
2
|
import { ViewTabContextMenuTemplate } from '../../../client-api-platform/src/shapes';
|
|
3
3
|
export declare const getChannelsMenuOptions: (channelsForViews: string[], colorGroups: OpenFin.ContextGroupInfo[]) => Promise<ViewTabContextMenuTemplate[]>;
|
|
4
|
-
export
|
|
4
|
+
export { ENTERPRISE_COLOR_CHANNELS } from './color-channels';
|
|
@@ -15,7 +15,7 @@ export type ShowContextMenuResponse = OpenFin.MenuResult & {
|
|
|
15
15
|
export declare function showContextMenu(opts: OpenFin.ShowPopupMenuOptions, win?: OpenFin.Window): Promise<ShowContextMenuResponse>;
|
|
16
16
|
export declare const showEnterpriseContextMenu: (opts: OpenFin.ShowPopupMenuOptions, type: PopupWindowMenuType, anchorBehavior: AnchorBehavior, win?: OpenFin.Window) => Promise<ShowContextMenuResponse>;
|
|
17
17
|
export declare const Separator: OpenFin.MenuItemTemplate;
|
|
18
|
-
export declare const
|
|
18
|
+
export declare const getEmptyContextMenuItem: () => OpenFin.MenuItemTemplate;
|
|
19
19
|
export declare const DefaultSaveMenuBounds: {
|
|
20
20
|
width: number;
|
|
21
21
|
height: number;
|
|
@@ -27,4 +27,5 @@ export declare const getBoundsBasedOnAnchorBehavior: (bounds: OpenFin.Bounds, an
|
|
|
27
27
|
height: number;
|
|
28
28
|
width: number;
|
|
29
29
|
};
|
|
30
|
+
export declare const getTranslateItems: (viewIdentities: OpenFin.Identity[]) => Promise<ViewTabContextMenuTemplate[]>;
|
|
30
31
|
export declare const getPrintOption: () => Promise<ViewTabContextMenuTemplate | PageTabContextMenuItemTemplate>;
|
|
@@ -11,7 +11,7 @@ export declare const isDocumentDefined: boolean;
|
|
|
11
11
|
export declare const isWindowDefinedWithIndexDB: boolean;
|
|
12
12
|
export declare const finUUID: string;
|
|
13
13
|
export declare const finName: string;
|
|
14
|
-
export declare const finEntityType: "" | "
|
|
14
|
+
export declare const finEntityType: "" | "view" | "window";
|
|
15
15
|
export declare const isEnvLocal: boolean;
|
|
16
16
|
export declare const isEnvDev: boolean;
|
|
17
17
|
export declare const isEnvStaging: boolean;
|