@openfin/workspace 45.1.1 → 45.1.3-alpha.5060c47c
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-platform/src/api/app-directory.d.ts +1 -1
- 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/shapes.d.ts +77 -7
- 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/utils/env.d.ts +1 -1
- package/common/src/utils/layout.d.ts +7 -1
- 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 +5 -1
- package/common/src/utils/window.d.ts +3 -1
- package/externals.report.json +27 -27
- 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
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { StorefrontAllowedWindowOptions } from '../shapes/shapes';
|
|
2
|
+
import { StorefrontVpwProvider } from './provider';
|
|
3
|
+
/** Creates the platform channel and {@link StorefrontVpwProvider} instance if not already running. */
|
|
4
|
+
export declare const ensureStorefrontVpwChannel: () => Promise<StorefrontVpwProvider>;
|
|
5
|
+
/** Launches the browser-zone Storefront VPW window and waits for the client `ready` handshake. */
|
|
6
|
+
export declare const launchStorefrontVpwWindow: (windowOptions?: StorefrontAllowedWindowOptions) => Promise<void>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { register, deregister, showWhenReady, type StorefrontRegistration, type StorefrontRegisterOptions } from './register';
|
|
2
|
+
export { show, hide } from './visibility';
|
|
3
|
+
export { StorefrontVpwProvider } from './provider';
|
|
4
|
+
export { getStorefrontVpwChannelName, STOREFRONT_VPW_WINDOW_NAME } from './constants';
|
|
5
|
+
export type { StorefrontAllowedWindowOptions, StorefrontProvider } from '../shapes/shapes';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RegisterMetaInfoInternal, StorefrontProvider } from '../../../../client-api/src/shapes';
|
|
2
|
+
import { StorefrontVpwProvidersMap } from './providers-map';
|
|
3
|
+
/** VPW storefront providers — separate from legacy Storefront provider registration in client-api. */
|
|
4
|
+
export declare const StorefrontVpwProviders: StorefrontVpwProvidersMap<StorefrontProvider>;
|
|
5
|
+
export declare const registerStorefrontVpwProviderInternal: (provider: StorefrontProvider) => Promise<RegisterMetaInfoInternal>;
|
|
6
|
+
export declare const deregisterStorefrontVpwProviderInternal: (providerId: string) => Promise<void>;
|
|
7
|
+
export declare const hasAnyRegisteredStorefrontVpwProvider: () => boolean;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { PlatformError } from '../../../../common/src/errors';
|
|
2
|
+
type StorefrontVpwProviderRecord = {
|
|
3
|
+
id: string;
|
|
4
|
+
};
|
|
5
|
+
export declare class StorefrontVpwProviderAlreadyRegisteredError extends PlatformError {
|
|
6
|
+
constructor(id: string);
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* In-process registry for Storefront VPW provider callbacks.
|
|
10
|
+
* VPW-only — not shared with legacy Storefront provider registration in client-api.
|
|
11
|
+
*/
|
|
12
|
+
export declare class StorefrontVpwProvidersMap<T extends StorefrontVpwProviderRecord> {
|
|
13
|
+
private readonly providersMap;
|
|
14
|
+
getProvider(id: string): T | undefined;
|
|
15
|
+
hasProvider(id: string): boolean;
|
|
16
|
+
assertNotAlreadyRegistered(id: string): void;
|
|
17
|
+
hasProviderMatching(predicate: (id: string) => boolean): boolean;
|
|
18
|
+
addProvider(provider: T): void;
|
|
19
|
+
deleteProvider(id: string): void;
|
|
20
|
+
listProviders(): T[];
|
|
21
|
+
getProviderOrFail(id: string): T;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { OpenFin } from '@openfin/core';
|
|
2
|
+
import type { App, StorefrontFooter, StorefrontLandingPage, StorefrontNavigationItemAppGrid, StorefrontNavigationSection } from '../../../client-api/src/shapes';
|
|
3
|
+
type ChannelActionMap = {
|
|
4
|
+
[action: string]: (...args: any[]) => any;
|
|
5
|
+
};
|
|
6
|
+
type TypedChannelClient<ProviderActions extends ChannelActionMap, ClientActions extends ChannelActionMap> = Omit<OpenFin.ChannelClient, 'dispatch' | 'register'> & {
|
|
7
|
+
dispatch: <T extends keyof ProviderActions>(action: T, payload: Parameters<ProviderActions[T]>[0]) => Promise<Awaited<ReturnType<ProviderActions[T]>>>;
|
|
8
|
+
register: <T extends keyof ClientActions>(action: T, handler: (payload: Parameters<ClientActions[T]>[0], id: OpenFin.ProviderIdentity | OpenFin.ClientIdentity) => Promise<Awaited<ReturnType<ClientActions[T]>>>) => boolean;
|
|
9
|
+
};
|
|
10
|
+
type TypedChannelProvider<ProviderActions extends ChannelActionMap, ClientActions extends ChannelActionMap> = Omit<OpenFin.ChannelProvider, 'dispatch' | 'register'> & {
|
|
11
|
+
dispatch: <T extends keyof ClientActions>(to: OpenFin.ClientIdentity, action: T, payload: Parameters<ClientActions[T]>[0]) => Promise<Awaited<ReturnType<ClientActions[T]>>>;
|
|
12
|
+
register: <T extends keyof ProviderActions>(action: T, handler: (payload: Parameters<ProviderActions[T]>[0], id: OpenFin.ProviderIdentity | OpenFin.ClientIdentity) => Promise<Awaited<ReturnType<ProviderActions[T]>>>) => boolean;
|
|
13
|
+
};
|
|
14
|
+
export type UpdateAppCardButtonConfigPayload = {
|
|
15
|
+
id: string;
|
|
16
|
+
appId: string;
|
|
17
|
+
primaryButton?: unknown;
|
|
18
|
+
secondaryButtons?: unknown[];
|
|
19
|
+
};
|
|
20
|
+
export type StorefrontVpwProviderListItem = {
|
|
21
|
+
id: string;
|
|
22
|
+
title: string;
|
|
23
|
+
icon: string;
|
|
24
|
+
identity: OpenFin.Identity;
|
|
25
|
+
buttonVisibility?: 'hidden' | 'visible';
|
|
26
|
+
cardClickBehavior?: 'show-app-details' | 'perform-primary-button-action';
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Actions the VPW window dispatches TO the platform provider.
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
export type StorefrontVpwChannelProviderChannelActions = {
|
|
33
|
+
'ready': () => void;
|
|
34
|
+
'get-apps': (payload: {
|
|
35
|
+
providerId: string;
|
|
36
|
+
}) => Promise<App[]>;
|
|
37
|
+
'get-navigation': (payload: {
|
|
38
|
+
providerId: string;
|
|
39
|
+
}) => Promise<[StorefrontNavigationSection?, StorefrontNavigationSection?, StorefrontNavigationSection?]>;
|
|
40
|
+
'get-landing-page': (payload: {
|
|
41
|
+
providerId: string;
|
|
42
|
+
}) => Promise<StorefrontLandingPage | undefined>;
|
|
43
|
+
'get-footer': (payload: {
|
|
44
|
+
providerId: string;
|
|
45
|
+
}) => Promise<StorefrontFooter>;
|
|
46
|
+
'get-template': (payload: {
|
|
47
|
+
providerId: string;
|
|
48
|
+
templateId: string;
|
|
49
|
+
}) => Promise<StorefrontNavigationItemAppGrid | undefined>;
|
|
50
|
+
'launch-app': (payload: {
|
|
51
|
+
providerId: string;
|
|
52
|
+
app: App;
|
|
53
|
+
}) => Promise<void>;
|
|
54
|
+
'list-providers': () => Promise<StorefrontVpwProviderListItem[]>;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Actions the platform provider dispatches TO the VPW window.
|
|
58
|
+
* @internal
|
|
59
|
+
*/
|
|
60
|
+
export type StorefrontVpwChannelClientChannelActions = {
|
|
61
|
+
'show': () => void;
|
|
62
|
+
'show-when-ready': () => void;
|
|
63
|
+
'update-app-card-button-config': (payload: UpdateAppCardButtonConfigPayload) => void;
|
|
64
|
+
};
|
|
65
|
+
export type StorefrontVpwChannelProvider = TypedChannelProvider<StorefrontVpwChannelProviderChannelActions, StorefrontVpwChannelClientChannelActions>;
|
|
66
|
+
export type StorefrontVpwChannelClient = TypedChannelClient<StorefrontVpwChannelProviderChannelActions, StorefrontVpwChannelClientChannelActions>;
|
|
67
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { OpenFin } from '@openfin/core';
|
|
2
|
+
import type { StorefrontVpwChannelProvider } from './protocol';
|
|
3
|
+
export declare class StorefrontVpwProvider {
|
|
4
|
+
#private;
|
|
5
|
+
static instance: StorefrontVpwProvider | null;
|
|
6
|
+
constructor(channel: StorefrontVpwChannelProvider);
|
|
7
|
+
get ready(): Promise<void>;
|
|
8
|
+
private ensureClientConnected;
|
|
9
|
+
show(): Promise<void>;
|
|
10
|
+
showWhenReady(): Promise<void>;
|
|
11
|
+
hide(): Promise<void>;
|
|
12
|
+
shutdown(): Promise<void>;
|
|
13
|
+
getWindowSync(): OpenFin.Window;
|
|
14
|
+
private getProviderOrFail;
|
|
15
|
+
private resolveTemplate;
|
|
16
|
+
private registerChannelActions;
|
|
17
|
+
updateAppCardButtons(payload: {
|
|
18
|
+
providerId: string;
|
|
19
|
+
appId: string;
|
|
20
|
+
primaryButton?: unknown;
|
|
21
|
+
secondaryButtons?: unknown[];
|
|
22
|
+
}): Promise<void>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { RegisterMetaInfoInternal, StorefrontProvider, UpdateButtonConfigRequest } from '../../../client-api/src/shapes';
|
|
2
|
+
import { showWhenReady } from './visibility';
|
|
3
|
+
import type { StorefrontAllowedWindowOptions } from '../shapes/shapes';
|
|
4
|
+
/**
|
|
5
|
+
* Response from {@link register} which includes workspace metadata and a helper to update app card buttons.
|
|
6
|
+
*/
|
|
7
|
+
export type StorefrontRegistration = RegisterMetaInfoInternal & {
|
|
8
|
+
/** Client SDK version active at registration time. */
|
|
9
|
+
clientAPIVersion: string;
|
|
10
|
+
/**
|
|
11
|
+
* Updates primary and secondary button configuration for an app card in the Storefront VPW UI.
|
|
12
|
+
*
|
|
13
|
+
* @param request App id and button configs to apply.
|
|
14
|
+
*/
|
|
15
|
+
updateAppCardButtons: (request: UpdateButtonConfigRequest) => Promise<void>;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Options for {@link register}.
|
|
19
|
+
*/
|
|
20
|
+
export type StorefrontRegisterOptions = {
|
|
21
|
+
/** Window creation options applied when launching the browser-zone Storefront VPW window. */
|
|
22
|
+
windowOptions?: StorefrontAllowedWindowOptions;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Registers a Storefront VPW integrator.
|
|
26
|
+
*
|
|
27
|
+
* Creates the VPW channel (if needed), launches the browser-zone Storefront window hidden,
|
|
28
|
+
* then adds the provider to the in-process registry.
|
|
29
|
+
*
|
|
30
|
+
* @remarks Call from the **provider process** (the platform/provider window), not from
|
|
31
|
+
* arbitrary content views. The channel and host singleton are bound to the caller's
|
|
32
|
+
* `fin.me.identity` — same constraint as legacy `Storefront.register()`.
|
|
33
|
+
*
|
|
34
|
+
* @throws Error if `provider.icon` is missing.
|
|
35
|
+
* @throws {@link StorefrontVpwProviderAlreadyRegisteredError} if a provider with the same id is already registered.
|
|
36
|
+
*
|
|
37
|
+
* @param provider Storefront integrator implementation.
|
|
38
|
+
* @param options Optional launch options for the VPW window.
|
|
39
|
+
* @returns Registration metadata and an `updateAppCardButtons` helper.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* import { Storefront, type StorefrontProvider } from '@openfin/workspace-platform';
|
|
44
|
+
*
|
|
45
|
+
* const provider: StorefrontProvider = {
|
|
46
|
+
* id: 'my-store',
|
|
47
|
+
* title: 'My Store',
|
|
48
|
+
* icon: 'https://example.com/icon.png',
|
|
49
|
+
* getApps: async () => [],
|
|
50
|
+
* getNavigation: async () => [],
|
|
51
|
+
* getLandingPage: async () => undefined,
|
|
52
|
+
* getFooter: async () => ({ logo: { src: '' } }),
|
|
53
|
+
* launchApp: async () => undefined
|
|
54
|
+
* };
|
|
55
|
+
*
|
|
56
|
+
* await Storefront.register(provider);
|
|
57
|
+
* await Storefront.show();
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare const register: (provider: StorefrontProvider, options?: StorefrontRegisterOptions) => Promise<StorefrontRegistration>;
|
|
61
|
+
/**
|
|
62
|
+
* Deregisters a Storefront VPW integrator by id.
|
|
63
|
+
*
|
|
64
|
+
* Removes the provider from the in-process registry. Shuts down the VPW channel and window
|
|
65
|
+
* when no providers remain registered.
|
|
66
|
+
*
|
|
67
|
+
* @remarks Call from the **provider process**, matching {@link register}.
|
|
68
|
+
*
|
|
69
|
+
* @param providerId Id of the provider to remove.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* import { Storefront } from '@openfin/workspace-platform';
|
|
74
|
+
*
|
|
75
|
+
* await Storefront.deregister('my-store');
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export declare const deregister: (providerId: string) => Promise<void>;
|
|
79
|
+
export { showWhenReady };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shows the Storefront VPW window and brings it to the foreground.
|
|
3
|
+
*
|
|
4
|
+
* @remarks At least one provider must be registered. Call from the **provider process**,
|
|
5
|
+
* matching {@link register}.
|
|
6
|
+
*
|
|
7
|
+
* @returns A promise that resolves once the VPW window is shown.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { Storefront } from '@openfin/workspace-platform';
|
|
12
|
+
*
|
|
13
|
+
* await Storefront.show();
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare const show: () => Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Hides the Storefront VPW window.
|
|
19
|
+
*
|
|
20
|
+
* @remarks At least one provider must be registered. Call from the **provider process**,
|
|
21
|
+
* matching {@link register}.
|
|
22
|
+
*
|
|
23
|
+
* @returns A promise that resolves once the VPW window is hidden.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* import { Storefront } from '@openfin/workspace-platform';
|
|
28
|
+
*
|
|
29
|
+
* await Storefront.hide();
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare const hide: () => Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Shows the Storefront VPW window after the client `ready` handshake completes.
|
|
35
|
+
*
|
|
36
|
+
* Unlike {@link show}, this does not focus the window.
|
|
37
|
+
*
|
|
38
|
+
* @remarks At least one provider must be registered. Call from the **provider process**,
|
|
39
|
+
* matching {@link register}.
|
|
40
|
+
*
|
|
41
|
+
* @returns A promise that resolves once the VPW window is shown.
|
|
42
|
+
*/
|
|
43
|
+
export declare const showWhenReady: () => Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './shapes';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { OpenFin } from '@openfin/core';
|
|
2
|
+
import type { StorefrontProvider } from '../../../client-api/src/shapes';
|
|
3
|
+
export type StorefrontAllowedWindowOptions = Pick<OpenFin.PlatformWindowCreationOptions, 'defaultLeft' | 'defaultTop' | 'defaultWidth' | 'defaultHeight' | 'taskbarIconGroup' | 'saveWindowState'>;
|
|
4
|
+
export type { StorefrontProvider };
|