@openfin/workspace-platform 13.1.1 → 13.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/client-api/src/integrations/microsoft.d.ts +5 -63
- package/client-api/src/integrations/microsoft.shapes.d.ts +8 -9
- package/client-api/src/integrations/microsoft.utils.d.ts +6 -0
- package/client-api/src/shapes/integrations.d.ts +1 -3
- package/client-api-platform/src/shapes.d.ts +1 -0
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,25 +1,19 @@
|
|
|
1
|
+
import { HomeSearchListenerResponse } from '../../../client-api/src/shapes/home';
|
|
1
2
|
import { WorkflowIntegration } from '../../../client-api/src/shapes/integrations';
|
|
2
|
-
import { Microsoft365ConnectionConfig, Microsoft365IntegrationConfig, Microsoft365Workflows,
|
|
3
|
+
import { Microsoft365ConnectionConfig, Microsoft365IntegrationConfig, Microsoft365Workflows, MicrosoftEntityTypeConfig, MicrosoftSearchWorkflowConfig } from './microsoft.shapes';
|
|
3
4
|
export type { Microsoft365IntegrationConfig, Microsoft365ConnectionConfig, Microsoft365Workflows, MicrosoftSearchWorkflowConfig, MicrosoftEntityTypeConfig };
|
|
4
5
|
/**
|
|
5
6
|
* The Microsoft365WorkflowIntegration class is a WorkflowIntegration that provides Microsoft 365 integration.
|
|
6
7
|
* This integration allows you to search for Microsoft 365 entities and perform actions on them using Home.
|
|
7
8
|
*/
|
|
8
9
|
export declare class Microsoft365WorkflowIntegration extends WorkflowIntegration {
|
|
9
|
-
|
|
10
|
-
private connection;
|
|
10
|
+
#private;
|
|
11
11
|
/** The configuration object for the integration. */
|
|
12
12
|
config: Microsoft365IntegrationConfig;
|
|
13
13
|
/** The name of the integration. Used for Analytics */
|
|
14
14
|
workflowIntegrationName: string;
|
|
15
15
|
/** The current searchResponse. This can be used to update results. */
|
|
16
|
-
|
|
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;
|
|
16
|
+
searchResponse: HomeSearchListenerResponse | undefined;
|
|
23
17
|
/**
|
|
24
18
|
* Creates an instance of Microsoft365WorkflowIntegration.
|
|
25
19
|
*
|
|
@@ -56,13 +50,6 @@ export declare class Microsoft365WorkflowIntegration extends WorkflowIntegration
|
|
|
56
50
|
* ```
|
|
57
51
|
*/
|
|
58
52
|
connect: (config?: Microsoft365ConnectionConfig) => Promise<void>;
|
|
59
|
-
/**
|
|
60
|
-
* Gets the Microsoft365Connection instance.
|
|
61
|
-
*
|
|
62
|
-
* @returns The Microsoft365Connection instance.
|
|
63
|
-
*/
|
|
64
|
-
private getConnection;
|
|
65
|
-
private handleTokenExpiry;
|
|
66
53
|
/**
|
|
67
54
|
* Wrapper around the Microsoft365Connection.executeApiRequest method.
|
|
68
55
|
* If the request fails due to an expired auth token, this method will reconnect and retry the request.
|
|
@@ -72,51 +59,6 @@ export declare class Microsoft365WorkflowIntegration extends WorkflowIntegration
|
|
|
72
59
|
* @returns The response from the Microsoft365Connection.executeApiRequest method.
|
|
73
60
|
*/
|
|
74
61
|
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
62
|
/**
|
|
121
63
|
* Initializes a given workflow.
|
|
122
64
|
*
|
|
@@ -151,5 +93,5 @@ export declare class Microsoft365WorkflowIntegration extends WorkflowIntegration
|
|
|
151
93
|
* await microsoft365WorkflowIntegration.initializeWorkflow('search');
|
|
152
94
|
* ```
|
|
153
95
|
*/
|
|
154
|
-
initializeWorkflow: (workflow:
|
|
96
|
+
initializeWorkflow: (workflow: string) => Promise<void>;
|
|
155
97
|
}
|
|
@@ -27,7 +27,7 @@ export interface MicrosoftEntityTypeConfig {
|
|
|
27
27
|
*
|
|
28
28
|
* @default true
|
|
29
29
|
*/
|
|
30
|
-
message
|
|
30
|
+
message?: boolean;
|
|
31
31
|
/**
|
|
32
32
|
* Whether or not to include messages (Teams Messages) in the search results.
|
|
33
33
|
*
|
|
@@ -39,12 +39,12 @@ export interface MicrosoftEntityTypeConfig {
|
|
|
39
39
|
*
|
|
40
40
|
* @default true
|
|
41
41
|
*/
|
|
42
|
-
chatMessage
|
|
42
|
+
chatMessage?: boolean;
|
|
43
43
|
/**
|
|
44
44
|
* Whether or not to include files (OneDrive Files) in the search results.
|
|
45
45
|
* @default true
|
|
46
46
|
*/
|
|
47
|
-
drive
|
|
47
|
+
drive?: boolean;
|
|
48
48
|
/**
|
|
49
49
|
* Whether or not to include events (Outlook Calendar Events) in the search results.
|
|
50
50
|
*
|
|
@@ -53,7 +53,7 @@ export interface MicrosoftEntityTypeConfig {
|
|
|
53
53
|
*
|
|
54
54
|
* @default true
|
|
55
55
|
*/
|
|
56
|
-
event
|
|
56
|
+
event?: boolean;
|
|
57
57
|
/**
|
|
58
58
|
* Whether or not to include users (People) in the search results.
|
|
59
59
|
*
|
|
@@ -62,7 +62,7 @@ export interface MicrosoftEntityTypeConfig {
|
|
|
62
62
|
*
|
|
63
63
|
* @default true
|
|
64
64
|
*/
|
|
65
|
-
user
|
|
65
|
+
user?: boolean;
|
|
66
66
|
/**
|
|
67
67
|
* Whether or not to include contacts (Outlook Contacts) in the search results.
|
|
68
68
|
*
|
|
@@ -71,14 +71,14 @@ export interface MicrosoftEntityTypeConfig {
|
|
|
71
71
|
*
|
|
72
72
|
* @default true
|
|
73
73
|
*/
|
|
74
|
-
contact
|
|
74
|
+
contact?: boolean;
|
|
75
75
|
/**
|
|
76
76
|
* Whether or not to include lists (SharePoint Lists) in the search results.
|
|
77
77
|
*
|
|
78
78
|
* `'Sites.Read.All' OR 'Sites.ReadWrite.All' AND 'Mail.ReadWrite.Shared'` OAuth scope is required to access this data.
|
|
79
79
|
* @default true
|
|
80
80
|
*/
|
|
81
|
-
list
|
|
81
|
+
list?: boolean;
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
84
|
* Configuration object for the Microsoft 365 Search workflow integration.
|
|
@@ -101,7 +101,7 @@ export interface MicrosoftSearchWorkflowConfig extends WorkflowConfig {
|
|
|
101
101
|
*
|
|
102
102
|
* See {@link MicrosoftEntityTypeConfig} for configuration options.
|
|
103
103
|
*/
|
|
104
|
-
|
|
104
|
+
microsoftEntityTypeConfig?: MicrosoftEntityTypeConfig;
|
|
105
105
|
/**
|
|
106
106
|
* The `msteams://` deep link can be used to open a Microsoft Teams chat in the Microsoft Teams desktop application.
|
|
107
107
|
*
|
|
@@ -144,4 +144,3 @@ export interface Microsoft365IntegrationConfig extends WorkflowIntegrationConfig
|
|
|
144
144
|
connect: Microsoft365ConnectionConfig;
|
|
145
145
|
workflows?: Microsoft365Workflows;
|
|
146
146
|
}
|
|
147
|
-
export declare type Microsoft365WorkflowType = 'search';
|
|
@@ -37,6 +37,12 @@ export declare const MICROSOFT_365_SEARCH_RESULT_ACTIONS: {
|
|
|
37
37
|
* @returns An array of CLIFilter objects representing the validated filters.
|
|
38
38
|
*/
|
|
39
39
|
export declare const getValidFilters: (req: Parameters<HomeProvider['onUserInput']>[0], searchTypePossibleFilters: Set<Microsoft365DocumentType>) => CLIFilter[];
|
|
40
|
+
export declare const getValidContactFilters: (users: MicrosoftGraphTypes.User[], req: Parameters<HomeProvider['onUserInput']>[0]) => CLIFilter[];
|
|
41
|
+
export declare const getContactFiltersFromRequest: (req: Parameters<HomeProvider['onUserInput']>[0]) => {
|
|
42
|
+
department: string[];
|
|
43
|
+
jobTitle: string[];
|
|
44
|
+
};
|
|
45
|
+
export declare const filterContactFromRequest: (items: MicrosoftGraphTypes.User[], filter: ReturnType<typeof getContactFiltersFromRequest>) => MicrosoftGraphTypes.User[];
|
|
40
46
|
/**
|
|
41
47
|
* Extracts type filters from the input request.
|
|
42
48
|
*
|
|
@@ -22,13 +22,11 @@ export interface WorkflowDependencies {
|
|
|
22
22
|
export interface WorkflowIntegrationConfig {
|
|
23
23
|
connect: unknown;
|
|
24
24
|
workflows?: IntegrationWorkflows;
|
|
25
|
-
dependencies?: WorkflowDependencies;
|
|
26
25
|
}
|
|
27
26
|
export declare abstract class WorkflowIntegration {
|
|
28
|
-
|
|
27
|
+
#private;
|
|
29
28
|
workflowIntegrationName: string;
|
|
30
29
|
config: WorkflowIntegrationConfig;
|
|
31
|
-
private initializedWorkflows;
|
|
32
30
|
constructor(config: WorkflowIntegrationConfig);
|
|
33
31
|
connect: (config?: any) => Promise<void>;
|
|
34
32
|
_initializeWorkflows: (config?: WorkflowIntegrationConfig) => Promise<void>;
|
|
@@ -13,6 +13,7 @@ export type { AttachedPage, Page, PageLayout, PageLayoutDetails, PageWithUpdatab
|
|
|
13
13
|
export { PanelPosition } from '../../common/src/api/pages/shapes';
|
|
14
14
|
export type { CustomThemes, CustomThemeOptions, CustomThemeOptionsWithScheme, CustomPaletteSet } from '../../common/src/api/theming';
|
|
15
15
|
export type { AnalyticsEvent } from '../../common/src/utils/usage-register';
|
|
16
|
+
export type { WorkflowIntegration } from '../../client-api/src/shapes/integrations';
|
|
16
17
|
/**
|
|
17
18
|
* Request for creating a saved page in persistent storage.
|
|
18
19
|
*/
|