@openfin/workspace 45.0.13 → 45.1.0-alpha.147d0ebd
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/language.d.ts +3 -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 +106 -9
- 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/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-linking.d.ts +38 -1
- package/common/src/utils/context-menu.d.ts +1 -0
- package/common/src/utils/layout.d.ts +9 -3
- package/common/src/utils/navigate.d.ts +23 -0
- package/common/src/utils/route.d.ts +2 -0
- package/common/src/utils/usage-register.d.ts +15 -1
- package/common/src/utils/window.d.ts +3 -1
- package/externals.report.json +15 -15
- 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
|
/**
|
|
@@ -3,11 +3,12 @@ export declare function getLanguage(): Locale;
|
|
|
3
3
|
export declare const dispatchLanguageToBrowserWindows: (language: Locale) => Promise<void[]>;
|
|
4
4
|
export declare const setLanguage: (locale: Locale) => Promise<void>;
|
|
5
5
|
export declare function getLanguageResourcesInternal(): {
|
|
6
|
-
currentLanguage:
|
|
6
|
+
currentLanguage: string;
|
|
7
7
|
resources: import("i18next").Resource;
|
|
8
8
|
};
|
|
9
9
|
/**
|
|
10
10
|
* initLanguage()
|
|
11
|
-
* @param language - optional - ISO language code
|
|
11
|
+
* @param language - optional - ISO language code. Built-in languages are always accepted.
|
|
12
|
+
* Any language code defined in the external `translation-override.json` is also accepted.
|
|
12
13
|
*/
|
|
13
14
|
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,5 +1,5 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
|
-
import type { IconProps, IconType
|
|
2
|
+
import type { IconProps, IconType } from '@openfin/ui-library';
|
|
3
3
|
import type { ModalResponseEvent } from '../../common/src/utils/menu-window-provider';
|
|
4
4
|
import type { WorkspaceIndicatorConfig } from '../../common/src/utils/indicators/workspace-indicators';
|
|
5
5
|
import type { AnalyticsEvent, AnalyticsEventInternal } from '../../common/src/utils/usage-register';
|
|
@@ -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';
|
|
@@ -388,6 +389,14 @@ export declare enum ViewTabMenuOptionType {
|
|
|
388
389
|
* Prints a screenshot of the browser window.
|
|
389
390
|
*/
|
|
390
391
|
PrintScreen = "PrintScreen",
|
|
392
|
+
/**
|
|
393
|
+
* Translate the selected view's content to the detected target language.
|
|
394
|
+
*/
|
|
395
|
+
TranslatePage = "TranslatePage",
|
|
396
|
+
/**
|
|
397
|
+
* Revert translated content back to the original language.
|
|
398
|
+
*/
|
|
399
|
+
RevertTranslation = "RevertTranslation",
|
|
391
400
|
/**
|
|
392
401
|
* Custom context menu option defined by API client.
|
|
393
402
|
*/
|
|
@@ -2076,9 +2085,9 @@ export interface WorkspacePlatformModule extends OpenFin.Platform {
|
|
|
2076
2085
|
*/
|
|
2077
2086
|
restoreLastSavedWorkspace(options?: ApplyWorkspaceOptions): Promise<RestoreLastSavedWorkspaceResult>;
|
|
2078
2087
|
/**
|
|
2079
|
-
* Returns ISO language code of
|
|
2088
|
+
* Returns the ISO language code of the currently active language.
|
|
2080
2089
|
*
|
|
2081
|
-
* @returns
|
|
2090
|
+
* @returns The active language code (e.g. `'en-US'`, `'es-ES'`).
|
|
2082
2091
|
*
|
|
2083
2092
|
* @example Example of how to get the current language on Browser
|
|
2084
2093
|
*
|
|
@@ -2633,8 +2642,73 @@ export interface AnalyticsConfig {
|
|
|
2633
2642
|
*/
|
|
2634
2643
|
sendToOpenFin: boolean;
|
|
2635
2644
|
}
|
|
2645
|
+
/**
|
|
2646
|
+
* The built-in language codes supported by the Workspace Platform out of the box.
|
|
2647
|
+
*
|
|
2648
|
+
* @deprecated No longer used for language validation. The platform now accepts any language
|
|
2649
|
+
* code that has a resource bundle registered in i18next, including codes defined in an
|
|
2650
|
+
* external `translation-override.json`. This export will be removed in a future major version.
|
|
2651
|
+
*/
|
|
2636
2652
|
export declare const SUPPORTED_LANGUAGES: string[];
|
|
2637
|
-
|
|
2653
|
+
/**
|
|
2654
|
+
* An ISO language code accepted by the Workspace Platform.
|
|
2655
|
+
*
|
|
2656
|
+
* **Built-in languages** (supported out of the box):
|
|
2657
|
+
* - `en-US` — English (default)
|
|
2658
|
+
* - `de-DE` — German
|
|
2659
|
+
* - `ja-JP` — Japanese
|
|
2660
|
+
* - `ko-KR` — Korean
|
|
2661
|
+
* - `ru-RU` — Russian
|
|
2662
|
+
* - `zh-CN` — Chinese (Simplified)
|
|
2663
|
+
* - `zh-Hant` — Chinese (Traditional)
|
|
2664
|
+
*
|
|
2665
|
+
* **Adding custom languages** via `translationOverridesUrl`:
|
|
2666
|
+
*
|
|
2667
|
+
* Supply a `translationOverridesUrl` in your Desktop Owner Settings (DOS) or application manifest
|
|
2668
|
+
* pointing to a `translation-override.json` file. Any language code defined in that file will be
|
|
2669
|
+
* accepted at runtime in addition to the built-in list above.
|
|
2670
|
+
*
|
|
2671
|
+
* Example `translation-override.json`:
|
|
2672
|
+
* ```json
|
|
2673
|
+
* {
|
|
2674
|
+
* "x.x.x": {
|
|
2675
|
+
* "es-ES": {
|
|
2676
|
+
* "global.save": "Guardar",
|
|
2677
|
+
* "contextMenu.newWindow": "Nueva ventana"
|
|
2678
|
+
* }
|
|
2679
|
+
* }
|
|
2680
|
+
* }
|
|
2681
|
+
* ```
|
|
2682
|
+
*
|
|
2683
|
+
* The `translationOverridesUrl` can be configured in two ways:
|
|
2684
|
+
*
|
|
2685
|
+
* _Via Desktop Owner Settings_ (`dos.json` on macOS, registry on Windows):
|
|
2686
|
+
* ```json
|
|
2687
|
+
* {
|
|
2688
|
+
* "desktopSettings": {
|
|
2689
|
+
* "systemApps": {
|
|
2690
|
+
* "workspace": {
|
|
2691
|
+
* "customConfig": {
|
|
2692
|
+
* "translationOverridesUrl": "https://example.com/translation-override.json"
|
|
2693
|
+
* }
|
|
2694
|
+
* }
|
|
2695
|
+
* }
|
|
2696
|
+
* }
|
|
2697
|
+
* }
|
|
2698
|
+
* ```
|
|
2699
|
+
*
|
|
2700
|
+
* _Via the application manifest_ (under `platform.workspace`):
|
|
2701
|
+
* ```json
|
|
2702
|
+
* {
|
|
2703
|
+
* "platform": {
|
|
2704
|
+
* "workspace": {
|
|
2705
|
+
* "translationOverridesUrl": "https://example.com/translation-override.json"
|
|
2706
|
+
* }
|
|
2707
|
+
* }
|
|
2708
|
+
* }
|
|
2709
|
+
* ```
|
|
2710
|
+
*/
|
|
2711
|
+
export type Locale = string;
|
|
2638
2712
|
/**
|
|
2639
2713
|
* Configures the workspace to self-host using an asar bundle at the
|
|
2640
2714
|
* specified path.
|
|
@@ -2722,8 +2796,12 @@ export interface WorkspacePlatformInitConfig {
|
|
|
2722
2796
|
*/
|
|
2723
2797
|
theme?: CustomThemes;
|
|
2724
2798
|
/**
|
|
2725
|
-
* Set
|
|
2726
|
-
*
|
|
2799
|
+
* Set the initial language for the Browser.
|
|
2800
|
+
*
|
|
2801
|
+
* The built-in ISO language codes are `'en-US'`, `'ja-JP'`, `'zh-CN'`, `'ko-KR'`,
|
|
2802
|
+
* `'ru-RU'`, `'de-DE'`, and `'zh-Hant'`. Any additional language code defined in an
|
|
2803
|
+
* external `translation-override.json` (configured via `translationOverridesUrl`) is
|
|
2804
|
+
* also accepted.
|
|
2727
2805
|
*
|
|
2728
2806
|
* @example
|
|
2729
2807
|
* ```ts
|
|
@@ -2736,7 +2814,7 @@ export interface WorkspacePlatformInitConfig {
|
|
|
2736
2814
|
* }
|
|
2737
2815
|
* });
|
|
2738
2816
|
* ```
|
|
2739
|
-
* @default 'en-
|
|
2817
|
+
* @default 'en-US'
|
|
2740
2818
|
*
|
|
2741
2819
|
*/
|
|
2742
2820
|
language?: {
|
|
@@ -2996,9 +3074,28 @@ export interface BrowserInitConfig {
|
|
|
2996
3074
|
/** 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
3075
|
defaultPageOptions?: Pick<Page, 'iconUrl' | 'unsavedIconUrl' | 'closeButton' | 'panels'>;
|
|
2998
3076
|
/**
|
|
2999
|
-
* The default options when creating a new
|
|
3077
|
+
* 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.
|
|
3078
|
+
*
|
|
3079
|
+
* @example
|
|
3080
|
+
* ```ts
|
|
3081
|
+
* import * as WorkspacePlatform from '@openfin/workspace-platform';
|
|
3082
|
+
*
|
|
3083
|
+
* await WorkspacePlatform.init({
|
|
3084
|
+
* browser: {
|
|
3085
|
+
* defaultViewOptions: {
|
|
3086
|
+
* workspacePlatform: {
|
|
3087
|
+
* browserNavigationButtons: {
|
|
3088
|
+
* back: true,
|
|
3089
|
+
* forward: true,
|
|
3090
|
+
* reload: true
|
|
3091
|
+
* }
|
|
3092
|
+
* }
|
|
3093
|
+
* }
|
|
3094
|
+
* }
|
|
3095
|
+
* });
|
|
3096
|
+
* ```
|
|
3000
3097
|
*/
|
|
3001
|
-
defaultViewOptions?: Partial<
|
|
3098
|
+
defaultViewOptions?: Partial<BrowserCreateViewRequest>;
|
|
3002
3099
|
/**
|
|
3003
3100
|
* The platform title. UI friendly title for the platform in browser.
|
|
3004
3101
|
*/
|
|
@@ -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';
|
|
@@ -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;
|
|
@@ -1,4 +1,41 @@
|
|
|
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 declare const ENTERPRISE_COLOR_CHANNELS:
|
|
4
|
+
export declare const ENTERPRISE_COLOR_CHANNELS: {
|
|
5
|
+
readonly blue: {
|
|
6
|
+
readonly name: "Blue";
|
|
7
|
+
readonly color: "#0091EB";
|
|
8
|
+
};
|
|
9
|
+
readonly indigo: {
|
|
10
|
+
readonly name: "Indigo";
|
|
11
|
+
readonly color: "#6450FF";
|
|
12
|
+
};
|
|
13
|
+
readonly pink: {
|
|
14
|
+
readonly name: "Pink";
|
|
15
|
+
readonly color: "#E878CF";
|
|
16
|
+
};
|
|
17
|
+
readonly teal: {
|
|
18
|
+
readonly name: "Teal";
|
|
19
|
+
readonly color: "#24D1D1";
|
|
20
|
+
};
|
|
21
|
+
readonly green: {
|
|
22
|
+
readonly name: "Green";
|
|
23
|
+
readonly color: "#00AF78";
|
|
24
|
+
};
|
|
25
|
+
readonly orange: {
|
|
26
|
+
readonly name: "Orange";
|
|
27
|
+
readonly color: "#FF7D37";
|
|
28
|
+
};
|
|
29
|
+
readonly red: {
|
|
30
|
+
readonly name: "Red";
|
|
31
|
+
readonly color: "#F94144";
|
|
32
|
+
};
|
|
33
|
+
readonly yellow: {
|
|
34
|
+
readonly name: "Yellow";
|
|
35
|
+
readonly color: "#F9C74F";
|
|
36
|
+
};
|
|
37
|
+
readonly gray: {
|
|
38
|
+
readonly name: "Gray";
|
|
39
|
+
readonly color: "#828788";
|
|
40
|
+
};
|
|
41
|
+
};
|
|
@@ -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>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
|
-
import type { PagePinnedState } from '../../../common/src/api/pages/shapes';
|
|
3
2
|
import { WindowIdentity } from '../../../common/src/utils/window';
|
|
4
|
-
import {
|
|
3
|
+
import type { PagePinnedState } from '../../../common/src/api/pages/shapes';
|
|
4
|
+
import { AttachedPage, BrowserCreateViewRequest, PageLayout } from '../../../client-api-platform/src/shapes';
|
|
5
5
|
export type LayoutDOMEventType =
|
|
6
6
|
/**
|
|
7
7
|
* Fired when a tab is created in a container. (Emmitted by ??)
|
|
@@ -90,7 +90,7 @@ export declare const generateViewNameAndIdentifierNameIfNotExists: <T extends {
|
|
|
90
90
|
* @param layout The Layout to be cloned
|
|
91
91
|
* @returns A Promise resolving to a copy of the layout with view options converted
|
|
92
92
|
*/
|
|
93
|
-
export declare const cloneLayoutAndConvertViewOptions: (layout: PageLayout, initViewOptions?: Partial<
|
|
93
|
+
export declare const cloneLayoutAndConvertViewOptions: (layout: PageLayout, initViewOptions?: Partial<BrowserCreateViewRequest>) => Promise<PageLayout>;
|
|
94
94
|
export declare const cloneViewComponentWithoutName: (componentState: any) => any;
|
|
95
95
|
/**
|
|
96
96
|
* Deep clones a layout and removes generated view names.
|
|
@@ -155,6 +155,12 @@ export declare const findViewInLayout: (node: any, viewId: OpenFin.Identity) =>
|
|
|
155
155
|
export declare const countViews: (node: OpenFin.LayoutContent) => number;
|
|
156
156
|
export declare const getLayoutConfig: (layoutContainerKey: string) => Promise<any>;
|
|
157
157
|
export declare const findPageForView: (viewName: string, browserWindowIdentity?: WindowIdentity) => Promise<AttachedPage | undefined>;
|
|
158
|
+
/**
|
|
159
|
+
* Waits for a specific view to receive focus on the current window, resolving
|
|
160
|
+
* either when the matching `view-focused` event fires or after a timeout (default 150ms).
|
|
161
|
+
* Useful for ensuring focus is stable before opening popups that would auto-close on focus shift.
|
|
162
|
+
*/
|
|
163
|
+
export declare const waitForViewFocus: (viewName: string, timeoutMs?: number) => Promise<void>;
|
|
158
164
|
/**
|
|
159
165
|
* Only show the view tab icon when not on the landing page
|
|
160
166
|
*/
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type OpenFin from '@openfin/core';
|
|
2
|
+
import { ComponentName } from '../../../common/src/utils/usage-register';
|
|
3
|
+
/**
|
|
4
|
+
* Constants for navigation source identifiers
|
|
5
|
+
*/
|
|
6
|
+
export declare const NavigationSource: {
|
|
7
|
+
readonly DOCK_SEARCH_BUTTON: "dock-search-button";
|
|
8
|
+
readonly DOCK_STORE_BUTTON: "dock-store-button";
|
|
9
|
+
readonly HOME_ESC: "home-esc";
|
|
10
|
+
readonly HOME_COMMAND: "home-command";
|
|
11
|
+
};
|
|
12
|
+
export type NavigationSourceType = (typeof NavigationSource)[keyof typeof NavigationSource];
|
|
13
|
+
export interface NavigatePayload {
|
|
14
|
+
componentName: ComponentName;
|
|
15
|
+
platformIdentity: OpenFin.Identity;
|
|
16
|
+
providerId?: string;
|
|
17
|
+
source?: NavigationSourceType | null;
|
|
18
|
+
}
|
|
19
|
+
export interface NavigateToOptions {
|
|
20
|
+
providerId?: string;
|
|
21
|
+
source?: NavigationSourceType | null;
|
|
22
|
+
}
|
|
23
|
+
export declare const navigateTo: (componentName: ComponentName, platformIdentity: OpenFin.Identity, options?: NavigateToOptions) => Promise<void>;
|
|
@@ -16,6 +16,7 @@ declare enum WorkspaceRoute {
|
|
|
16
16
|
}
|
|
17
17
|
declare enum BrowserRoute {
|
|
18
18
|
Browser = "/browser/",
|
|
19
|
+
BrowserHome = "/home/",
|
|
19
20
|
BrowserPopupMenu = "/popup-menu/",
|
|
20
21
|
BrowserPopupMenuSaveModal = "/popup-menu/save-modal/",
|
|
21
22
|
BrowserPopupMenuLayouts = "/popup-menu/layouts/layouts/",
|
|
@@ -40,6 +41,7 @@ declare enum BrowserRoute {
|
|
|
40
41
|
}
|
|
41
42
|
declare const PageRoute: {
|
|
42
43
|
Browser: BrowserRoute.Browser;
|
|
44
|
+
BrowserHome: BrowserRoute.BrowserHome;
|
|
43
45
|
BrowserPopupMenu: BrowserRoute.BrowserPopupMenu;
|
|
44
46
|
BrowserPopupMenuSaveModal: BrowserRoute.BrowserPopupMenuSaveModal;
|
|
45
47
|
BrowserPopupMenuLayouts: BrowserRoute.BrowserPopupMenuLayouts;
|
|
@@ -11,22 +11,36 @@ export declare enum ComponentName {
|
|
|
11
11
|
Dock = "Dock",
|
|
12
12
|
EnterpriseDock = "EnterpriseDock",
|
|
13
13
|
Home = "Home",
|
|
14
|
+
HomeVpw = "HomeVpw",
|
|
14
15
|
Notification = "Notification",
|
|
15
16
|
Storefront = "Storefront",
|
|
16
17
|
Platform = "Platform",
|
|
17
18
|
Theming = "Theming",
|
|
18
19
|
Microflow = "Microflow",
|
|
19
|
-
|
|
20
|
+
SuppressWorkspaceSwitched = "SuppressWorkspaceSwitched",
|
|
21
|
+
SuppressWorkspaceSaved = "SuppressWorkspaceSaved",
|
|
22
|
+
AllowDuplicatePageTitles = "AllowDuplicatePageTitles",
|
|
23
|
+
PagePinning = "PagePinning",
|
|
24
|
+
ViewTabNewTabShortcut = "ViewTabNewTabShortcut",
|
|
25
|
+
SupertabHideShowTabs = "PRODM-318: Supertab Hide/Show Tab Headers",
|
|
26
|
+
StorefrontVpw = "PRODM-171: VPW Storefront"
|
|
20
27
|
}
|
|
21
28
|
export declare const registerBrowserUsage: (status: RegisterUsageStatus) => void;
|
|
22
29
|
export declare const registerHomeUsage: (status: RegisterUsageStatus) => void;
|
|
23
30
|
export declare const registerStorefrontUsage: (status: RegisterUsageStatus) => void;
|
|
31
|
+
export declare const registerHomeVpwUsage: (status: RegisterUsageStatus) => void;
|
|
24
32
|
export declare const registerDockUsage: (status: RegisterUsageStatus) => void;
|
|
25
33
|
export declare const registerNotificationUsage: (status: RegisterUsageStatus) => void;
|
|
26
34
|
export declare const registerPlatformUsage: (status: RegisterUsageStatus) => void;
|
|
27
35
|
export declare const registerThemingUsage: (status: RegisterUsageStatus) => void;
|
|
28
36
|
export declare const registerMicroflowUsage: (microflowName: string, status: RegisterUsageStatus) => void;
|
|
37
|
+
export declare const registerSuppressWorkspaceSwitchedUsage: (status: RegisterUsageStatus) => void;
|
|
38
|
+
export declare const registerSuppressWorkspaceSavedUsage: (status: RegisterUsageStatus) => void;
|
|
39
|
+
export declare const registerAllowDuplicatePageTitlesUsage: (status: RegisterUsageStatus) => void;
|
|
40
|
+
export declare const registerPagePinningUsage: (status: RegisterUsageStatus) => void;
|
|
41
|
+
export declare const registerViewTabNewTabShortcutUsage: (status: RegisterUsageStatus) => void;
|
|
29
42
|
export declare const registerSupertabHideShowTabsUsage: () => void;
|
|
43
|
+
export declare const registerStorefrontVpwUsage: (status: RegisterUsageStatus) => void;
|
|
30
44
|
export type AnalyticsSource = 'Browser' | 'Dock' | 'Home' | 'Notification' | 'Store' | 'Platform' | 'Theming' | 'Interop';
|
|
31
45
|
/**
|
|
32
46
|
* Event for analytics
|
|
@@ -26,7 +26,9 @@ export declare enum WindowName {
|
|
|
26
26
|
ApplyAndPublishModal = "here-apply-and-publish-modal",
|
|
27
27
|
PublishOnCloseModal = "here-publish-on-close-modal",
|
|
28
28
|
DesktopSignalsModal = "here-desktop-signals-modal",
|
|
29
|
-
IntentsResolverModal = "here-intents-resolver-modal"
|
|
29
|
+
IntentsResolverModal = "here-intents-resolver-modal",
|
|
30
|
+
/** Browser-zone Home VPW window (platform child window). */
|
|
31
|
+
HomeVpw = "home-vpw"
|
|
30
32
|
}
|
|
31
33
|
export interface WindowIdentity {
|
|
32
34
|
uuid: ApplicationUUID | string;
|