@openfin/workspace-platform 20.1.1 → 20.1.2

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@openfin/workspace-platform",
3
3
  "description": "An API for creating your own Workspace platform.",
4
4
  "contributors": [],
5
- "version": "20.1.1",
5
+ "version": "20.1.2",
6
6
  "main": "index.js",
7
7
  "keywords": [
8
8
  "client",
@@ -12,7 +12,7 @@
12
12
  ],
13
13
  "license": "SEE LICENSE IN LICENSE.MD",
14
14
  "peerDependencies": {
15
- "@openfin/core": "40.100.7"
15
+ "@openfin/core": "40.101.1"
16
16
  },
17
17
  "dependencies": {
18
18
  "@openfin/microsoft365": "^1.0.1",
@@ -31,7 +31,7 @@
31
31
  "lodash.merge": "^4.6.2",
32
32
  "next": "^12.3.4",
33
33
  "nprogress": "0.2.0",
34
- "openfin-notifications": "2.8.0-alpha-3743",
34
+ "openfin-notifications": "2.9.0-alpha-3761",
35
35
  "react": "17.0.2",
36
36
  "react-color": "2.19.3",
37
37
  "react-dom": "17.0.2",
@@ -1,11 +1,11 @@
1
- import { ChannelClient } from '../../../search-api/src/fin/shapes';
1
+ import type { OpenFin } from '@openfin/core';
2
2
  import type { DispatchedAction, RegistrationMetaInfo, SearchProvider, SearchProviderInfo, SearchProviderResponseGeneratorExtended, SearchRequest, SearchResult } from '../shapes';
3
3
  /**
4
4
  * Register a remote search provider.
5
5
  * @param namespacedTopic the namespaced search topic to register the provider on.
6
6
  * @param provider the search provider to register.
7
7
  */
8
- export declare function register(provider: SearchProvider, channel?: ChannelClient): Promise<RegistrationMetaInfo>;
8
+ export declare function register(provider: SearchProvider, channel?: OpenFin.ChannelClient): Promise<RegistrationMetaInfo>;
9
9
  /**
10
10
  * Deregister a remote search provider.
11
11
  * @param topic the search topic to deregister the provider from.
@@ -14,12 +14,12 @@ export declare function register(provider: SearchProvider, channel?: ChannelClie
14
14
  export declare function deregister(id: string): Promise<void>;
15
15
  /**
16
16
  * Dispatch a search result back to the respective provider.
17
- * @param namespacedTopic the namespaced search topic.
18
17
  * @param providerId the name of the provider to dispatch the result back to.
19
18
  * @param result the search result to dispatch back to the provider.
20
19
  * @param action the action to dispatch the search result with.
20
+ * @param identity optionally provide the identity of the dispatcher, otherwise the current identity will be used.
21
21
  */
22
- export declare function dispatch(providerId: string, result: SearchResult, action: DispatchedAction): Promise<any>;
22
+ export declare function dispatch(providerId: string, result: SearchResult, action: DispatchedAction, identity?: OpenFin.Identity): Promise<any>;
23
23
  /**
24
24
  * Returns an extended search generator object.
25
25
  * @param namespacedTopic the namespaced search topic.
@@ -1 +1,2 @@
1
- export declare function create(): Promise<import("../../fin/shapes").ChannelClient>;
1
+ import type { OpenFin } from '@openfin/core';
2
+ export declare function create(): Promise<OpenFin.ChannelClient>;
@@ -1,5 +1,5 @@
1
- import type { ChannelClient } from '../../fin/shapes';
2
- export declare function getOrFail(): Promise<ChannelClient>;
3
- export declare function get(): Promise<ChannelClient>;
4
- export declare function set(newChannelPromise: Promise<ChannelClient>): void;
1
+ import type { OpenFin } from '@openfin/core';
2
+ export declare function getOrFail(): Promise<OpenFin.ChannelClient>;
3
+ export declare function get(): Promise<OpenFin.ChannelClient>;
4
+ export declare function set(newChannelPromise: Promise<OpenFin.ChannelClient>): void;
5
5
  export declare function remove(): void;
@@ -1,6 +1,5 @@
1
1
  import type OpenFin from '@openfin/core';
2
- import type { Channel, ChannelClient } from './shapes';
3
2
  export declare function getIdentity(): OpenFin.Identity;
4
3
  export declare function getPlatformNamespace(): string | undefined;
5
- export declare function connectToChannel(name: string): Promise<ChannelClient | never>;
6
- export declare function createChannel(name: string): Promise<Channel>;
4
+ export declare function connectToChannel(name: string): Promise<OpenFin.ChannelClient | never>;
5
+ export declare function createChannel(name: string): Promise<OpenFin.ChannelProvider>;
@@ -3,5 +3,5 @@ import * as provider from './provider';
3
3
  export declare const create: typeof provider.create;
4
4
  export declare const subscribe: typeof client.subscribe;
5
5
  export declare const defaultTopic = "all";
6
- export type { SearchProviderResponse, SearchRequest, SearchTopicClient, SearchTopic, SearchProviderInfo, ScoreOrder, Action, ActionTrigger, SearchResult, SearchListenerRequest, SearchListenerResponse, UserInputListener, DispatchedSearchResult, DispatchedAction, ResultDispatchListener, SearchProvider, SearchTag, SearchResponse } from './shapes';
6
+ export type { SearchProviderResponse, SearchRequest, SearchTopicClient, SearchTopic, SearchProviderInfo, ScoreOrder, Action, ActionTrigger, SearchResult, SearchListenerRequest, SearchListenerResponse, UserInputListener, DispatchedSearchResult, DispatchedAction, ResultDispatchListener, SearchProvider, SearchTag, SearchResponse, DeregisterListener, DisconnectListener, RegisterListener, SubscriptionListener } from './shapes';
7
7
  export { SearchTagBackground } from './shapes';
@@ -110,7 +110,7 @@ export interface InternalSearchListenerResponse {
110
110
  getRevokedBuffer(): string[];
111
111
  setRevokedBuffer(resultIds: string[]): void;
112
112
  getUpdatedContext(): any;
113
- setUpdatedContext(context: any): void;
113
+ setUpdatedContext(context: any | null): void;
114
114
  onChange(): void;
115
115
  getStatus(): InternalSearchListenerResponseStatus;
116
116
  res: SearchListenerResponse;
@@ -1,3 +1,4 @@
1
+ import type { OpenFin } from '@openfin/core';
1
2
  import { DispatchedAction, RegistrationMetaInfo, SearchProvider, SearchProviderInfo, SearchProviderResponseGeneratorExtended, SearchRequest, SearchResult } from '../shapes';
2
3
  /**
3
4
  * Get all registered providers' info for an topic.
@@ -19,8 +20,9 @@ export declare function deregister(name: string): Promise<void>;
19
20
  * @param providerId the name of the provider to dispatch the result back to.
20
21
  * @param result the search result to dispatch back to the provider.
21
22
  * @param action the action to dispatch the search result with.
23
+ * @param identity optionally provide the identity of the dispatcher, otherwise the current identity will be used.
22
24
  */
23
- export declare function dispatch(providerId: string, result: SearchResult, action: DispatchedAction): Promise<void>;
25
+ export declare function dispatch(providerId: string, result: SearchResult, action: DispatchedAction, identity?: OpenFin.Identity): Promise<void>;
24
26
  /**
25
27
  * Returns an extended search generator object.
26
28
  * @param ctx the search topic context.
@@ -1,5 +1,6 @@
1
+ import type { OpenFin } from '@openfin/core';
1
2
  /**
2
3
  * Create a channel for interacting with remote search providers.
3
4
  * @param ctx the context of the search topic to create the channel for.
4
5
  */
5
- export declare function create(): Promise<import("../../fin/shapes").Channel>;
6
+ export declare function create(): Promise<OpenFin.ChannelProvider>;
@@ -1,16 +1,16 @@
1
- import type { Channel } from '../../fin/shapes';
1
+ import type { OpenFin } from '@openfin/core';
2
2
  /**
3
3
  * Get the OpenFin channel that represents a topic.
4
4
  * If not found, will throw an error.
5
5
  */
6
- export declare function getOrFail(): Channel;
6
+ export declare function getOrFail(): OpenFin.ChannelProvider;
7
7
  /**
8
8
  * Get the OpenFin channel that represents a topic.
9
9
  */
10
- export declare function get(): Channel;
10
+ export declare function get(): OpenFin.ChannelProvider;
11
11
  /**
12
12
  * Set the OpenFin channel for a search topic.
13
13
  * @param channel the channel for the search topic.
14
14
  */
15
- export declare function set(newChannel: Channel): void;
15
+ export declare function set(newChannel: OpenFin.ChannelProvider): void;
16
16
  export declare function remove(): void;
@@ -155,24 +155,37 @@ export interface SearchTopicClient {
155
155
  * @experimental
156
156
  */
157
157
  search(request: SearchRequest): Promise<SearchProviderResponseGeneratorExtended>;
158
+ /**
159
+ * Register a search provider.
160
+ * @param provider the search provider to register.
161
+ */
162
+ register(provider: SearchProvider): Promise<RegistrationMetaInfo>;
163
+ /**
164
+ * Deregister a search provider by its name.
165
+ * @param name the name of the search provider to deregister
166
+ */
167
+ deregister(name: string): Promise<void>;
158
168
  /**
159
169
  * Dispatch a search result back to the search provider.
160
170
  * It is then the search providers duty to perform what ever action was chosen.
161
171
  * @param providerId the id of the search provider to send the search result back to.
162
172
  * @param result the search result to send back to the search provider.
163
173
  * @param action the action for the search provider to perform with the search result.
174
+ * @param identity optionally provide the identity of the dispatcher, otherwise the current identity will be used.
164
175
  */
165
- dispatch(providerId: string, result: SearchResult, action: Action): Promise<any>;
176
+ dispatch(providerId: string, result: SearchResult, action: Action, identity?: OpenFin.Identity): Promise<any>;
166
177
  /**
167
178
  * Disconnect from the search topic.
168
179
  * NOTE: All search providers registered by this search client will be deregistered.
169
180
  */
170
181
  disconnect(): Promise<void>;
182
+ /** The channel client for the search topic. */
183
+ channel: OpenFin.ChannelClient;
171
184
  }
172
185
  /**
173
186
  * A search topic created by the primary node.
174
187
  */
175
- export interface SearchTopic extends SearchTopicClient {
188
+ export interface SearchTopic extends Omit<SearchTopicClient, 'channel'> {
176
189
  /**
177
190
  * Add a subscription listener that will be called when ever a search client subscribes
178
191
  * to this topic.
@@ -201,6 +214,8 @@ export interface SearchTopic extends SearchTopicClient {
201
214
  * @param listener the listener to add.
202
215
  */
203
216
  onDeregister(listener: DeregisterListener): void;
217
+ /** The channel provider for the search topic. */
218
+ channel: OpenFin.ChannelProvider;
204
219
  }
205
220
  /**
206
221
  * Information about a search provider.
Binary file
@@ -1,23 +0,0 @@
1
- import type OpenFin from '@openfin/core';
2
- export type MessageListener = (message: any, identity: OpenFin.Identity) => any;
3
- export type ConnectionListener = (identity: OpenFin.Identity) => Promise<void>;
4
- /**
5
- * Represents a channel client.
6
- */
7
- export interface ChannelClient {
8
- register(topic: string, listener: MessageListener): void;
9
- dispatch(topic: string, message: any): Promise<any>;
10
- disconnect(): Promise<void>;
11
- onDisconnection(listeber: ConnectionListener): void;
12
- }
13
- /**
14
- * Represents a channel.
15
- */
16
- export interface Channel {
17
- register(topic: string, listener: MessageListener): void;
18
- publish(topic: string, message: any): Promise<void>;
19
- dispatch(to: OpenFin.Identity, topic: string, message: any): Promise<any>;
20
- onConnection(listener: ConnectionListener): void;
21
- onDisconnection(listener: ConnectionListener): void;
22
- destroy(): Promise<void>;
23
- }