@openfin/workspace-platform 13.0.7 → 13.1.0
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/index.d.ts +5 -0
- package/client-api/src/integrations/microsoft.d.ts +155 -0
- package/client-api/src/integrations/microsoft.shapes.d.ts +147 -0
- package/client-api/src/integrations/microsoft.utils.d.ts +80 -0
- package/client-api/src/integrations.d.ts +3 -0
- package/client-api/src/internal.d.ts +2 -2
- package/client-api/src/shapes/home.d.ts +71 -3
- package/client-api/src/shapes/integrations.d.ts +36 -0
- package/client-api-platform/src/api/context-menu/utils.d.ts +4 -0
- package/client-api-platform/src/api/dock/idb.d.ts +0 -1
- package/client-api-platform/src/shapes.d.ts +46 -9
- package/common/src/api/pages/shapes.d.ts +2 -0
- package/common/src/api/protocol/shapes/workspace.d.ts +157 -0
- package/common/src/api/protocol/workspace.d.ts +12 -58
- package/common/src/api/provider.d.ts +5 -1
- package/common/src/api/search.d.ts +1 -3
- package/common/src/api/storefront.d.ts +11 -0
- package/common/src/api/theming.d.ts +6 -0
- package/common/src/utils/a11y/search.a11y.d.ts +1 -0
- package/common/src/utils/global-context-menu.d.ts +3 -1
- package/common/src/utils/lru-cache.d.ts +11 -0
- package/common/src/utils/menu-window-provider.d.ts +14 -16
- package/common/src/utils/route.d.ts +22 -34
- package/common/src/utils/router/base.d.ts +2 -2
- package/common/src/utils/shared-emitter.d.ts +7 -6
- package/common/src/utils/types.d.ts +7 -0
- package/common/src/utils/usage-register.d.ts +3 -1
- package/common/src/utils/window.d.ts +27 -14
- package/index.js +56 -59
- package/index.js.map +1 -1
- package/package.json +4 -2
- package/search-api/src/client/index.d.ts +2 -2
- package/search-api/src/client/internal.d.ts +6 -6
- package/search-api/src/client/remote/channel-client-factory.d.ts +1 -2
- package/search-api/src/client/remote/channel-client.d.ts +4 -8
- package/search-api/src/client/remote/data.d.ts +3 -4
- package/search-api/src/client/remote/disconnect.d.ts +1 -4
- package/search-api/src/client/remote/dispatch.d.ts +2 -3
- package/search-api/src/client/remote/requests.d.ts +1 -4
- package/search-api/src/client/remote/search-close.d.ts +2 -5
- package/search-api/src/common.d.ts +19 -29
- package/search-api/src/fin/index.d.ts +2 -2
- package/search-api/src/fin/shapes.d.ts +4 -4
- package/search-api/src/index.d.ts +1 -1
- package/search-api/src/internal-shapes.d.ts +0 -19
- package/search-api/src/provider/index.d.ts +2 -3
- package/search-api/src/provider/internal.d.ts +5 -9
- package/search-api/src/provider/remote/channel-factory.d.ts +1 -2
- package/search-api/src/provider/remote/channel.d.ts +4 -11
- package/search-api/src/provider/remote/connection.d.ts +5 -8
- package/search-api/src/provider/remote/data.d.ts +3 -5
- package/search-api/src/provider/remote/deregistration.d.ts +1 -2
- package/search-api/src/provider/remote/disconnect.d.ts +1 -1
- package/search-api/src/provider/remote/disconnection.d.ts +5 -4
- package/search-api/src/provider/remote/dispatch.d.ts +2 -3
- package/search-api/src/provider/remote/info.d.ts +1 -1
- package/search-api/src/provider/remote/registration.d.ts +6 -8
- package/search-api/src/provider/remote/search-close.d.ts +3 -4
- package/search-api/src/provider/remote/search.d.ts +3 -4
- package/search-api/src/shapes.d.ts +6 -45
- package/common/src/api/home.d.ts +0 -19
- package/common/src/api/pages/legacy.d.ts +0 -16
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as DockAPI from './dock';
|
|
2
2
|
import * as HomeAPI from './home';
|
|
3
|
+
import * as IntegrationsAPI from './integrations';
|
|
3
4
|
import * as LegacyAPI from './legacy';
|
|
4
5
|
import * as StorefrontAPI from './store';
|
|
5
6
|
export * from './shapes/common';
|
|
@@ -23,3 +24,7 @@ export { DockAPI as Dock };
|
|
|
23
24
|
Namespace for Legacy integrations.
|
|
24
25
|
*/
|
|
25
26
|
export { LegacyAPI as Legacy };
|
|
27
|
+
/**
|
|
28
|
+
Namespace for Microflows integrations.
|
|
29
|
+
*/
|
|
30
|
+
export { IntegrationsAPI as Integrations };
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { WorkflowIntegration } from '../../../client-api/src/shapes/integrations';
|
|
2
|
+
import { Microsoft365ConnectionConfig, Microsoft365IntegrationConfig, Microsoft365Workflows, Microsoft365WorkflowType, MicrosoftEntityTypeConfig, MicrosoftSearchWorkflowConfig } from './microsoft.shapes';
|
|
3
|
+
export type { Microsoft365IntegrationConfig, Microsoft365ConnectionConfig, Microsoft365Workflows, MicrosoftSearchWorkflowConfig, MicrosoftEntityTypeConfig };
|
|
4
|
+
/**
|
|
5
|
+
* The Microsoft365WorkflowIntegration class is a WorkflowIntegration that provides Microsoft 365 integration.
|
|
6
|
+
* This integration allows you to search for Microsoft 365 entities and perform actions on them using Home.
|
|
7
|
+
*/
|
|
8
|
+
export declare class Microsoft365WorkflowIntegration extends WorkflowIntegration {
|
|
9
|
+
/** Instance of the Microsoft365Connection class. */
|
|
10
|
+
private connection;
|
|
11
|
+
/** The configuration object for the integration. */
|
|
12
|
+
config: Microsoft365IntegrationConfig;
|
|
13
|
+
/** The name of the integration. Used for Analytics */
|
|
14
|
+
workflowIntegrationName: string;
|
|
15
|
+
/** The current searchResponse. This can be used to update results. */
|
|
16
|
+
private searchResponse;
|
|
17
|
+
/** The minimum length of a query before the search will be triggered. */
|
|
18
|
+
private readonly minQueryLength;
|
|
19
|
+
/** Set of all possible filters that can be applied to the search results. This is based on the config provided. */
|
|
20
|
+
private readonly searchTypePossibleFilters;
|
|
21
|
+
/** A LRU cache of profile pictures. */
|
|
22
|
+
private readonly profilePictureCache;
|
|
23
|
+
/**
|
|
24
|
+
* Creates an instance of Microsoft365WorkflowIntegration.
|
|
25
|
+
*
|
|
26
|
+
* @param config The configuration object for the integration.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* const microsoft365Integration = new Microsoft365WorkflowIntegration({
|
|
31
|
+
* connect: {
|
|
32
|
+
* clientId: microsoft365Config.clientId, // Client ID of the registered app
|
|
33
|
+
* tenantId: microsoft365Config.tenantId, // Tenant ID of the registered app
|
|
34
|
+
* redirectUri: microsoft365Config.redirectUri // Redirect URI of the registered app. This _must_ be the same domain as the app (providerUrl).
|
|
35
|
+
* },
|
|
36
|
+
* });
|
|
37
|
+
*
|
|
38
|
+
* await WorkspacePlatform.init({
|
|
39
|
+
* browserOptions: {},
|
|
40
|
+
* integrations: [microsoft365Integration]
|
|
41
|
+
* })
|
|
42
|
+
*/
|
|
43
|
+
constructor(config: Microsoft365IntegrationConfig);
|
|
44
|
+
/**
|
|
45
|
+
* Connects to the Microsoft 365 API using the provided configuration.
|
|
46
|
+
*
|
|
47
|
+
* @param config Defaults to the config provided to the constructor, but can be overridden here.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* await microsoft365Integration.connect({
|
|
52
|
+
* clientId: microsoft365Config.clientId,
|
|
53
|
+
* tenantId: microsoft365Config.tenantId,
|
|
54
|
+
* redirectUri: microsoft365Config.redirectUri
|
|
55
|
+
* });
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
connect: (config?: Microsoft365ConnectionConfig) => Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Gets the Microsoft365Connection instance.
|
|
61
|
+
* If we are not connected, this method will connect before returning the connection.
|
|
62
|
+
*
|
|
63
|
+
* @returns The Microsoft365Connection instance.
|
|
64
|
+
*/
|
|
65
|
+
private getConnection;
|
|
66
|
+
/**
|
|
67
|
+
* Wrapper around the Microsoft365Connection.executeApiRequest method.
|
|
68
|
+
* If the request fails due to an expired auth token, this method will reconnect and retry the request.
|
|
69
|
+
* If we are not connected, this method will connect before executing the request.
|
|
70
|
+
*
|
|
71
|
+
* @param args Arguments to pass to the Microsoft365Connection.executeApiRequest method.
|
|
72
|
+
* @returns The response from the Microsoft365Connection.executeApiRequest method.
|
|
73
|
+
*/
|
|
74
|
+
private executeApiRequest;
|
|
75
|
+
private executeBatchApiRequest;
|
|
76
|
+
/**
|
|
77
|
+
* Executes a batch API request and maps the response to search results.
|
|
78
|
+
*
|
|
79
|
+
* If the request fails, we return an a single error result.
|
|
80
|
+
*/
|
|
81
|
+
private executeBatchQuery;
|
|
82
|
+
/**
|
|
83
|
+
* Maps the response from a batch API request to search results.
|
|
84
|
+
*
|
|
85
|
+
* @param batchResponse The response from a batch API request.
|
|
86
|
+
* @returns An array of search results.
|
|
87
|
+
*/
|
|
88
|
+
private mapBatchResponseToSearchResults;
|
|
89
|
+
/**
|
|
90
|
+
* Handles a search result being focused.
|
|
91
|
+
* @param result The search result that was focused.
|
|
92
|
+
*/
|
|
93
|
+
private handleResultFocus;
|
|
94
|
+
private launchUrlInBrowser;
|
|
95
|
+
/**
|
|
96
|
+
* Handles a search result (ChatMessage) action being clicked.
|
|
97
|
+
* @param result The search result that was clicked.
|
|
98
|
+
* @returns A promise that resolves when the action has been handled.
|
|
99
|
+
*/
|
|
100
|
+
private handleChatMessageUserAction;
|
|
101
|
+
/**
|
|
102
|
+
* Handles a search result (User) action being clicked.
|
|
103
|
+
* @param result The search result that was clicked.
|
|
104
|
+
* @returns A promise that resolves when the action has been handled.
|
|
105
|
+
*/
|
|
106
|
+
private handleUserAction;
|
|
107
|
+
/**
|
|
108
|
+
* Handles a search result being actioned by the user.
|
|
109
|
+
* @param result The search result that was actioned.
|
|
110
|
+
*/
|
|
111
|
+
private handleAction;
|
|
112
|
+
/**
|
|
113
|
+
* Creates a search result for a user.
|
|
114
|
+
* Called when a `user` search result is focused in the search results.
|
|
115
|
+
* @param res The search result to create a user result for.
|
|
116
|
+
*/
|
|
117
|
+
private createUserResult;
|
|
118
|
+
private onUserInput;
|
|
119
|
+
private onResultDispatch;
|
|
120
|
+
/**
|
|
121
|
+
* Initializes a given workflow.
|
|
122
|
+
*
|
|
123
|
+
* This method is automatically called when `disableAutoInitialize` is set to `false` in the workflow configuration.
|
|
124
|
+
*
|
|
125
|
+
* Use this method if you need to call it manually (not at platform initialization).
|
|
126
|
+
*
|
|
127
|
+
*
|
|
128
|
+
* @param workflow The workflow to initialize.
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```ts
|
|
132
|
+
* const microsoft365WorkflowIntegration = new Microsoft365WorkflowIntegration({
|
|
133
|
+
* connect: {
|
|
134
|
+
* clientId: microsoft365Config.clientId,
|
|
135
|
+
* tenantId: microsoft365Config.tenantId,
|
|
136
|
+
* redirectUri: microsoft365Config.redirectUri
|
|
137
|
+
* },
|
|
138
|
+
* workflows: {
|
|
139
|
+
* search: {
|
|
140
|
+
* disableAutoInitialize: true
|
|
141
|
+
* }
|
|
142
|
+
* }
|
|
143
|
+
* });
|
|
144
|
+
*
|
|
145
|
+
* await platformInit({
|
|
146
|
+
* overrideCallback,
|
|
147
|
+
* browserOptions: {},
|
|
148
|
+
* integrations: [microsoft365WorkflowIntegration]
|
|
149
|
+
* });
|
|
150
|
+
*
|
|
151
|
+
* await microsoft365WorkflowIntegration.initializeWorkflow('search');
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
initializeWorkflow: (workflow: Microsoft365WorkflowType) => Promise<void>;
|
|
155
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { HomeProvider } from '../../../client-api/src/shapes/home';
|
|
2
|
+
import { IntegrationWorkflows, WorkflowConfig, WorkflowIntegrationConfig } from '../../../client-api/src/shapes/integrations';
|
|
3
|
+
/**
|
|
4
|
+
* Configuration object for the Microsoft 365 workflow integration.
|
|
5
|
+
*
|
|
6
|
+
* Used for choosing which Microsoft 365 entities to include in the search results.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const config: MicrosoftEntityTypeConfig = {
|
|
11
|
+
* message: true,
|
|
12
|
+
* chatMessage: true,
|
|
13
|
+
* drive: false,
|
|
14
|
+
* event: false,
|
|
15
|
+
* user: true,
|
|
16
|
+
* contact: false,
|
|
17
|
+
* list: false,
|
|
18
|
+
* };
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export interface MicrosoftEntityTypeConfig {
|
|
22
|
+
/**
|
|
23
|
+
* Whether or not to include messages (Outlook Emails) in the search results.
|
|
24
|
+
*
|
|
25
|
+
* `'Mail.ReadWrite.Shared'` OAuth scopes are required to access this data.
|
|
26
|
+
* If these scopes are not provided, user Authentication will fail.
|
|
27
|
+
*
|
|
28
|
+
* @default true
|
|
29
|
+
*/
|
|
30
|
+
message: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Whether or not to include messages (Teams Messages) in the search results.
|
|
33
|
+
*
|
|
34
|
+
* `'Chat.Read' OR 'Chat.ReadWrite' AND 'ChannelMessage.Read.All'` OAuth scopes are required to access this data.
|
|
35
|
+
* If these scopes are not provided, user Authentication will fail.
|
|
36
|
+
*
|
|
37
|
+
* Futhermore, the `openUrlWithBrowser` permission must be enabled in the application manifest. This should support the `msteams` protocols. This is used for opening the Teams client when action-ing a Teams message.
|
|
38
|
+
* See the [Developer Guide](https://developers.openfin.co/of-docs/docs/api-security) for more information.
|
|
39
|
+
*
|
|
40
|
+
* @default true
|
|
41
|
+
*/
|
|
42
|
+
chatMessage: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Whether or not to include files (OneDrive Files) in the search results.
|
|
45
|
+
* @default true
|
|
46
|
+
*/
|
|
47
|
+
drive: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Whether or not to include events (Outlook Calendar Events) in the search results.
|
|
50
|
+
*
|
|
51
|
+
* `'Calendars.Read' OR 'Calendars.ReadWrite'` OAuth scopes are required to access this data.
|
|
52
|
+
* If these scopes are not provided, user Authentication will fail.
|
|
53
|
+
*
|
|
54
|
+
* @default true
|
|
55
|
+
*/
|
|
56
|
+
event: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Whether or not to include users (People) in the search results.
|
|
59
|
+
*
|
|
60
|
+
* `'User.Read.All' AND 'Presence.Read.All'` OAuth scopes are required to access this data.
|
|
61
|
+
* If these scopes are not provided, user Authentication will fail.
|
|
62
|
+
*
|
|
63
|
+
* @default true
|
|
64
|
+
*/
|
|
65
|
+
user: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Whether or not to include contacts (Outlook Contacts) in the search results.
|
|
68
|
+
*
|
|
69
|
+
* `'Contacts.Read.Shared'` OAuth scopes are required to access this data.
|
|
70
|
+
* If these scopes are not provided, user Authentication will fail.
|
|
71
|
+
*
|
|
72
|
+
* @default true
|
|
73
|
+
*/
|
|
74
|
+
contact: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Whether or not to include lists (SharePoint Lists) in the search results.
|
|
77
|
+
*
|
|
78
|
+
* `'Sites.Read.All' OR 'Sites.ReadWrite.All' AND 'Mail.ReadWrite.Shared'` OAuth scope is required to access this data.
|
|
79
|
+
* @default true
|
|
80
|
+
*/
|
|
81
|
+
list: boolean;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Configuration object for the Microsoft 365 Search workflow integration.
|
|
85
|
+
*
|
|
86
|
+
* All properties are optional. If they are omitted, the default values will be used.
|
|
87
|
+
*/
|
|
88
|
+
export interface MicrosoftSearchWorkflowConfig extends WorkflowConfig {
|
|
89
|
+
/**
|
|
90
|
+
* Configuration object for the HomeProvider.
|
|
91
|
+
*
|
|
92
|
+
* Use this to configure the HomeProvider for example, adding a custom logo or name.
|
|
93
|
+
*
|
|
94
|
+
* See {@link HomeProvider} for configuration options.
|
|
95
|
+
*/
|
|
96
|
+
homeProvider?: Omit<HomeProvider, 'onUserInput' | 'onResultDispatch'>;
|
|
97
|
+
/**
|
|
98
|
+
* Configuration object for the Microsoft 365 entity types to include in the search results.
|
|
99
|
+
*
|
|
100
|
+
* Use this to enable/disable the different Microsoft 365 entity types.
|
|
101
|
+
*
|
|
102
|
+
* See {@link MicrosoftEntityTypeConfig} for configuration options.
|
|
103
|
+
*/
|
|
104
|
+
MicrosoftEntityTypeConfig?: MicrosoftEntityTypeConfig;
|
|
105
|
+
/**
|
|
106
|
+
* The `msteams://` deep link can be used to open a Microsoft Teams chat in the Microsoft Teams desktop application.
|
|
107
|
+
*
|
|
108
|
+
* This _requires_ that the user has the Microsoft Teams desktop application installed. Else the call will silently fail.
|
|
109
|
+
*
|
|
110
|
+
* @default true
|
|
111
|
+
*/
|
|
112
|
+
useTeamsDeepLink?: boolean;
|
|
113
|
+
}
|
|
114
|
+
export interface Microsoft365Workflows extends IntegrationWorkflows {
|
|
115
|
+
/**
|
|
116
|
+
* The Search workflow for the Microsoft 365 integration.
|
|
117
|
+
*
|
|
118
|
+
* This workflow is used to search for Microsoft 365 entities.
|
|
119
|
+
*
|
|
120
|
+
* To disable the Search workflow, set the disabled property in the workflow config to `false`.
|
|
121
|
+
*
|
|
122
|
+
* See {@link MicrosoftSearchWorkflowConfig} for configuration options.
|
|
123
|
+
*/
|
|
124
|
+
search?: MicrosoftSearchWorkflowConfig;
|
|
125
|
+
}
|
|
126
|
+
export interface Microsoft365ConnectionConfig {
|
|
127
|
+
/**
|
|
128
|
+
* The client ID of the Microsoft 365 application.
|
|
129
|
+
*/
|
|
130
|
+
clientId: string;
|
|
131
|
+
/**
|
|
132
|
+
* The tenant ID of the Microsoft 365 application.
|
|
133
|
+
*/
|
|
134
|
+
tenantId: string;
|
|
135
|
+
/**
|
|
136
|
+
* The redirect URI of the Microsoft 365 application.
|
|
137
|
+
*/
|
|
138
|
+
redirectUri: string;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Configuration object for the Microsoft 365 workflow integration.
|
|
142
|
+
*/
|
|
143
|
+
export interface Microsoft365IntegrationConfig extends WorkflowIntegrationConfig {
|
|
144
|
+
connect: Microsoft365ConnectionConfig;
|
|
145
|
+
workflows?: Microsoft365Workflows;
|
|
146
|
+
}
|
|
147
|
+
export declare type Microsoft365WorkflowType = 'search';
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { CLIFilter } from '../../../client-api/src/index';
|
|
2
|
+
import { CLISearchResultContact, HomeProvider } from '../../../client-api/src/shapes/home';
|
|
3
|
+
import type { Presence } from '@microsoft/microsoft-graph-types';
|
|
4
|
+
import type * as MicrosoftGraphTypes from '@microsoft/microsoft-graph-types';
|
|
5
|
+
import { Microsoft365DocumentType, MicrosoftEntityTypeConfig, MicrosoftSearchWorkflowConfig } from './microsoft.shapes';
|
|
6
|
+
export declare const getDefaultMicrosoftConfig: () => {
|
|
7
|
+
workflows: {
|
|
8
|
+
search: MicrosoftSearchWorkflowConfig;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
/** Map of MicrosoftEntityTypeConfig keys to their corresponding Microsoft365DocumentType. */
|
|
12
|
+
export declare const SEARCH_FILTER_TYPE_MAP: {
|
|
13
|
+
[K in keyof MicrosoftEntityTypeConfig]: Microsoft365DocumentType;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Some Microsoft 365 APIs require specific OAuth scopes to be provided. This map contains the required scopes for each MicrosoftEntityTypeConfig key.
|
|
17
|
+
* For Example. If the `chatMessage: true` key is set, then the `Chat.Read` and `ChannelMessage.Read.All` scopes are required.
|
|
18
|
+
*/
|
|
19
|
+
export declare const MICROSOFT_365_REQUIRED_SCOPES: {
|
|
20
|
+
[K in keyof MicrosoftEntityTypeConfig]?: string[];
|
|
21
|
+
};
|
|
22
|
+
export declare const MICROSOFT_365_SEARCH_RESULT_ACTIONS: {
|
|
23
|
+
readonly teamsCall: "Teams Call";
|
|
24
|
+
readonly teamsChat: "Teams Chat";
|
|
25
|
+
readonly email: "Email";
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Extracts the selected filters from the given user input request and constructs a new filter array.
|
|
29
|
+
*
|
|
30
|
+
* The function looks for an existing filter with the ID matching `this.searchTypeFilterId` in the request.
|
|
31
|
+
* If such a filter is found, its selected options are preserved in the new filter array.
|
|
32
|
+
*
|
|
33
|
+
* The returned filter array includes one filter object for 'Type', which is a multi-select filter with options for 'Document', 'Contact', 'Message', 'Email', and 'Event'.
|
|
34
|
+
* The 'isSelected' status of these options is determined by their 'isSelected' status in the original request (if present).
|
|
35
|
+
*
|
|
36
|
+
* @param req The user input request object from which to extract the selected filters.
|
|
37
|
+
* @returns An array of CLIFilter objects representing the validated filters.
|
|
38
|
+
*/
|
|
39
|
+
export declare const getValidFilters: (req: Parameters<HomeProvider['onUserInput']>[0], searchTypePossibleFilters: Set<Microsoft365DocumentType>) => CLIFilter[];
|
|
40
|
+
/**
|
|
41
|
+
* Extracts type filters from the input request.
|
|
42
|
+
*
|
|
43
|
+
* @param req - The user input request.
|
|
44
|
+
*
|
|
45
|
+
* @returns An object containing boolean flags indicating whether
|
|
46
|
+
* each of the types (Documents, Contacts, Messages, Emails, Events) should be shown.
|
|
47
|
+
* If none of the types are selected in the request, all types are marked to be shown.
|
|
48
|
+
*
|
|
49
|
+
* @remarks
|
|
50
|
+
* The function first checks if the `selectedFilters` field in the request's context contains the search type filter ID.
|
|
51
|
+
* If it does, it extracts the filter options and checks which types have been selected by the user.
|
|
52
|
+
* If no types are selected or all types are deselected, the function marks all types to be shown.
|
|
53
|
+
* Otherwise, it marks only the selected types to be shown.
|
|
54
|
+
*/
|
|
55
|
+
export declare const getTypeFiltersFromRequest: (req: Parameters<HomeProvider['onUserInput']>[0], searchTypePossibleFilters: Set<Microsoft365DocumentType>) => {
|
|
56
|
+
readonly showDocuments: boolean;
|
|
57
|
+
readonly showContacts: boolean;
|
|
58
|
+
/** Teams Messages */
|
|
59
|
+
readonly showChatMessages: boolean;
|
|
60
|
+
/** Outlook Emails */
|
|
61
|
+
readonly showMessages: boolean;
|
|
62
|
+
/** Outlook Events */
|
|
63
|
+
readonly showEvents: boolean;
|
|
64
|
+
/** SharePoint Lists */
|
|
65
|
+
readonly showLists: boolean;
|
|
66
|
+
};
|
|
67
|
+
export declare const getDocumentFiltersFromRequest: (req: Parameters<HomeProvider['onUserInput']>[0]) => {
|
|
68
|
+
readonly filterFiles: boolean;
|
|
69
|
+
readonly showWord: boolean;
|
|
70
|
+
readonly showExcel: boolean;
|
|
71
|
+
readonly showPowerPoint: boolean;
|
|
72
|
+
readonly showPDF: boolean;
|
|
73
|
+
readonly showOneNote: boolean;
|
|
74
|
+
};
|
|
75
|
+
export declare const filterDocumentsFromRequest: (items: MicrosoftGraphTypes.DriveItem[], filter: ReturnType<typeof getDocumentFiltersFromRequest>) => MicrosoftGraphTypes.DriveItem[];
|
|
76
|
+
export declare const getFileType: (fileName?: string) => string;
|
|
77
|
+
export declare const getFileIcon: (fileName?: string) => string;
|
|
78
|
+
export declare const mapMicrosoftAvailabilityToPresence: (availability: Presence) => CLISearchResultContact['templateContent']['onlineStatus'] | undefined;
|
|
79
|
+
/** base64IdToUrl converts a base64 encoded id to a url safe id */
|
|
80
|
+
export declare const base64IdToUrl: (b64Id: string) => string;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { Microsoft365WorkflowIntegration } from './integrations/microsoft';
|
|
2
|
+
export type { Microsoft365IntegrationConfig, Microsoft365ConnectionConfig, Microsoft365Workflows, MicrosoftEntityTypeConfig, MicrosoftSearchWorkflowConfig } from './integrations/microsoft';
|
|
3
|
+
export type { WorkflowIntegrationConfig } from './shapes/integrations';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WorkspaceChannelAction } from '../../common/src/api/protocol/workspace';
|
|
1
|
+
import { WorkspaceChannelAction } from '../../common/src/api/protocol/shapes/workspace';
|
|
2
2
|
export interface ChannelDispatch {
|
|
3
3
|
action: WorkspaceChannelAction;
|
|
4
4
|
payload?: any;
|
|
@@ -11,7 +11,7 @@ export interface ChannelDispatch {
|
|
|
11
11
|
* @param action The contemporary action for the provider.
|
|
12
12
|
* @param fallback The deprecated action for the provider.
|
|
13
13
|
* @param fallbackResponse optional response for the fallback action.
|
|
14
|
-
* @returns channel response is returned if action was
|
|
14
|
+
* @returns channel response is returned if action was successful. If fallback was used, fallbackResponse is returned instead.
|
|
15
15
|
*/
|
|
16
16
|
export declare function tryDispatch(action: ChannelDispatch, fallback: ChannelDispatch): Promise<void>;
|
|
17
17
|
export declare function tryDispatch<T = undefined>(action: ChannelDispatch, fallback: ChannelDispatch, fallbackResponse: T): Promise<T>;
|
|
@@ -129,7 +129,7 @@ export declare enum CLITemplate {
|
|
|
129
129
|
*/
|
|
130
130
|
Loading = "Loading",
|
|
131
131
|
/**
|
|
132
|
-
* A Template that indicates that a problem
|
|
132
|
+
* A Template that indicates that a problem occurred with the search result details.
|
|
133
133
|
*/
|
|
134
134
|
Error = "Error"
|
|
135
135
|
}
|
|
@@ -160,11 +160,79 @@ export interface ContactInfo {
|
|
|
160
160
|
* A flag to indicate that the contact card should display the contact's initials as profile photo if the photo url is undefined.
|
|
161
161
|
*/
|
|
162
162
|
useInitials?: boolean;
|
|
163
|
+
/**
|
|
164
|
+
* The contact's online status.
|
|
165
|
+
*/
|
|
166
|
+
onlineStatus?: 'offline' | 'do-not-disturb' | 'busy' | 'away' | 'available';
|
|
163
167
|
/**
|
|
164
168
|
* An array of detail list objects that can be used for logical grouping of contact details.
|
|
165
169
|
*/
|
|
166
170
|
details: ListPairs[];
|
|
171
|
+
/**
|
|
172
|
+
* An array of buttons to display on the contact card.
|
|
173
|
+
*/
|
|
174
|
+
buttons?: ContactInfoButtons[];
|
|
167
175
|
}
|
|
176
|
+
export declare type ButtonIcon =
|
|
177
|
+
/**
|
|
178
|
+
* The icon used for the button.
|
|
179
|
+
*/
|
|
180
|
+
string | {
|
|
181
|
+
/**
|
|
182
|
+
* The icon used for the button in light mode.
|
|
183
|
+
*/
|
|
184
|
+
light: string;
|
|
185
|
+
/**
|
|
186
|
+
* The icon used for the button in dark mode.
|
|
187
|
+
*/
|
|
188
|
+
dark: string;
|
|
189
|
+
};
|
|
190
|
+
export declare type ContactInfoButtons = {
|
|
191
|
+
type: 'button';
|
|
192
|
+
/**
|
|
193
|
+
* The icon to display on the button.
|
|
194
|
+
*/
|
|
195
|
+
icon: ButtonIcon;
|
|
196
|
+
/**
|
|
197
|
+
* The tooltip to display on the button.
|
|
198
|
+
*/
|
|
199
|
+
tooltip: string;
|
|
200
|
+
/**
|
|
201
|
+
* The action to execute when the button is clicked.
|
|
202
|
+
*/
|
|
203
|
+
action: string;
|
|
204
|
+
} | {
|
|
205
|
+
type: 'dropdown';
|
|
206
|
+
/**
|
|
207
|
+
* The icon to display on the button.
|
|
208
|
+
*/
|
|
209
|
+
icon?: ButtonIcon;
|
|
210
|
+
/**
|
|
211
|
+
* The tooltip to display on the button.
|
|
212
|
+
*/
|
|
213
|
+
tooltip: string;
|
|
214
|
+
/**
|
|
215
|
+
* The action to execute when the button is clicked.
|
|
216
|
+
*/
|
|
217
|
+
action?: string;
|
|
218
|
+
/**
|
|
219
|
+
* The list of options to display in the dropdown.
|
|
220
|
+
*/
|
|
221
|
+
options: {
|
|
222
|
+
/**
|
|
223
|
+
* The icon to display on the button.
|
|
224
|
+
*/
|
|
225
|
+
icon?: ButtonIcon;
|
|
226
|
+
/**
|
|
227
|
+
* The tooltip to display on the button.
|
|
228
|
+
*/
|
|
229
|
+
tooltip: string;
|
|
230
|
+
/**
|
|
231
|
+
* The action to execute when the button is clicked.
|
|
232
|
+
*/
|
|
233
|
+
action: string;
|
|
234
|
+
}[];
|
|
235
|
+
};
|
|
168
236
|
/**
|
|
169
237
|
* Contact Info Search Result
|
|
170
238
|
*/
|
|
@@ -276,7 +344,7 @@ export interface CLIProvider extends SearchProvider {
|
|
|
276
344
|
* return getAllData();
|
|
277
345
|
* }
|
|
278
346
|
*
|
|
279
|
-
* // Provide an
|
|
347
|
+
* // Provide an implementation to fetch query-filtered search results
|
|
280
348
|
* return getResultsByQuery(query);
|
|
281
349
|
* }
|
|
282
350
|
* ```
|
|
@@ -299,7 +367,7 @@ export interface CLIProvider extends SearchProvider {
|
|
|
299
367
|
* const availableCommands = await getAvailableCommands();
|
|
300
368
|
* const commandToExecute = availableCommands.find((command) => command.key === result.key);
|
|
301
369
|
*
|
|
302
|
-
* if (
|
|
370
|
+
* if (commandToExecute != undefined) {
|
|
303
371
|
* await commandToExecute.action();
|
|
304
372
|
* }
|
|
305
373
|
* } catch (err) {
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { WorkspacePlatformModule } from '../../../client-api-platform/src/shapes';
|
|
2
|
+
export interface WorkflowConfig extends Record<string, unknown> {
|
|
3
|
+
/**
|
|
4
|
+
* If false, will automatically initialize the workflow when the Workspace Platform is initialized.
|
|
5
|
+
* Else, will need to be initialized by calling initializeWorkflow.
|
|
6
|
+
*
|
|
7
|
+
* @default false
|
|
8
|
+
*/
|
|
9
|
+
disableAutoInitialize?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* If true, will disable this workflow.
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface IntegrationWorkflows {
|
|
17
|
+
[key: string]: WorkflowConfig;
|
|
18
|
+
}
|
|
19
|
+
export interface WorkflowDependencies {
|
|
20
|
+
workspacePlatformAPI: WorkspacePlatformModule;
|
|
21
|
+
}
|
|
22
|
+
export interface WorkflowIntegrationConfig {
|
|
23
|
+
connect: unknown;
|
|
24
|
+
workflows?: IntegrationWorkflows;
|
|
25
|
+
dependencies?: WorkflowDependencies;
|
|
26
|
+
}
|
|
27
|
+
export declare abstract class WorkflowIntegration {
|
|
28
|
+
workspacePlatformAPI: any;
|
|
29
|
+
workflowIntegrationName: string;
|
|
30
|
+
config: WorkflowIntegrationConfig;
|
|
31
|
+
private initializedWorkflows;
|
|
32
|
+
constructor(config: WorkflowIntegrationConfig);
|
|
33
|
+
connect: (config?: any) => Promise<void>;
|
|
34
|
+
_initializeWorkflows: (config?: WorkflowIntegrationConfig) => Promise<void>;
|
|
35
|
+
initializeWorkflow(workflow: string): Promise<void>;
|
|
36
|
+
}
|
|
@@ -14,3 +14,7 @@ export declare const savePageHandler: (identity: OpenFin.Identity, pageId?: stri
|
|
|
14
14
|
export declare const savePageAsHandler: (identity: OpenFin.Identity, pageId?: string) => Promise<void>;
|
|
15
15
|
export declare const switchWorkspaceHandler: (winIdentity: OpenFin.Identity, workspaceItemData: WorkspaceContextMenuItemData) => Promise<void>;
|
|
16
16
|
export declare const deleteWorkspaceHandler: (winIdentity: OpenFin.Identity, workspaceItemData: WorkspaceContextMenuItemData) => Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* @param viewIdentities Array of views to execute print on.
|
|
19
|
+
*/
|
|
20
|
+
export declare const printSelectedViews: (viewIdentities: OpenFin.Identity[]) => Promise<void>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { DockProviderConfigWithIdentity } from '../../../../client-api/src/shapes';
|
|
2
|
-
export declare const store: import("idb-keyval").UseStore;
|
|
3
2
|
export declare function getDockProviderConfig(providerId: string): Promise<DockProviderConfigWithIdentity | undefined>;
|
|
4
3
|
export declare function saveDockProviderConfig(config: DockProviderConfigWithIdentity): Promise<void>;
|