@openfin/workspace 13.1.1 → 13.1.3

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.
@@ -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, Microsoft365WorkflowType, MicrosoftEntityTypeConfig, MicrosoftSearchWorkflowConfig } from './microsoft.shapes';
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
- /** Instance of the Microsoft365Connection class. */
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
- 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;
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: Microsoft365WorkflowType) => Promise<void>;
96
+ initializeWorkflow: (workflow: string) => Promise<void>;
155
97
  }
@@ -1,3 +1,4 @@
1
+ import { DeepPartial } from '../../../common/src/utils/types';
1
2
  import { HomeProvider } from '../../../client-api/src/shapes/home';
2
3
  import { IntegrationWorkflows, WorkflowConfig, WorkflowIntegrationConfig } from '../../../client-api/src/shapes/integrations';
3
4
  /**
@@ -27,7 +28,7 @@ export interface MicrosoftEntityTypeConfig {
27
28
  *
28
29
  * @default true
29
30
  */
30
- message: boolean;
31
+ message?: boolean;
31
32
  /**
32
33
  * Whether or not to include messages (Teams Messages) in the search results.
33
34
  *
@@ -39,12 +40,12 @@ export interface MicrosoftEntityTypeConfig {
39
40
  *
40
41
  * @default true
41
42
  */
42
- chatMessage: boolean;
43
+ chatMessage?: boolean;
43
44
  /**
44
45
  * Whether or not to include files (OneDrive Files) in the search results.
45
46
  * @default true
46
47
  */
47
- drive: boolean;
48
+ drive?: boolean;
48
49
  /**
49
50
  * Whether or not to include events (Outlook Calendar Events) in the search results.
50
51
  *
@@ -53,7 +54,7 @@ export interface MicrosoftEntityTypeConfig {
53
54
  *
54
55
  * @default true
55
56
  */
56
- event: boolean;
57
+ event?: boolean;
57
58
  /**
58
59
  * Whether or not to include users (People) in the search results.
59
60
  *
@@ -62,7 +63,7 @@ export interface MicrosoftEntityTypeConfig {
62
63
  *
63
64
  * @default true
64
65
  */
65
- user: boolean;
66
+ user?: boolean;
66
67
  /**
67
68
  * Whether or not to include contacts (Outlook Contacts) in the search results.
68
69
  *
@@ -71,14 +72,14 @@ export interface MicrosoftEntityTypeConfig {
71
72
  *
72
73
  * @default true
73
74
  */
74
- contact: boolean;
75
+ contact?: boolean;
75
76
  /**
76
77
  * Whether or not to include lists (SharePoint Lists) in the search results.
77
78
  *
78
79
  * `'Sites.Read.All' OR 'Sites.ReadWrite.All' AND 'Mail.ReadWrite.Shared'` OAuth scope is required to access this data.
79
80
  * @default true
80
81
  */
81
- list: boolean;
82
+ list?: boolean;
82
83
  }
83
84
  /**
84
85
  * Configuration object for the Microsoft 365 Search workflow integration.
@@ -93,7 +94,7 @@ export interface MicrosoftSearchWorkflowConfig extends WorkflowConfig {
93
94
  *
94
95
  * See {@link HomeProvider} for configuration options.
95
96
  */
96
- homeProvider?: Omit<HomeProvider, 'onUserInput' | 'onResultDispatch'>;
97
+ homeProvider?: DeepPartial<Omit<HomeProvider, 'onUserInput' | 'onResultDispatch'>>;
97
98
  /**
98
99
  * Configuration object for the Microsoft 365 entity types to include in the search results.
99
100
  *
@@ -101,7 +102,7 @@ export interface MicrosoftSearchWorkflowConfig extends WorkflowConfig {
101
102
  *
102
103
  * See {@link MicrosoftEntityTypeConfig} for configuration options.
103
104
  */
104
- MicrosoftEntityTypeConfig?: MicrosoftEntityTypeConfig;
105
+ microsoftEntityTypeConfig?: MicrosoftEntityTypeConfig;
105
106
  /**
106
107
  * The `msteams://` deep link can be used to open a Microsoft Teams chat in the Microsoft Teams desktop application.
107
108
  *
@@ -144,7 +145,6 @@ export interface Microsoft365IntegrationConfig extends WorkflowIntegrationConfig
144
145
  connect: Microsoft365ConnectionConfig;
145
146
  workflows?: Microsoft365Workflows;
146
147
  }
147
- export declare type Microsoft365WorkflowType = 'search';
148
148
  /**
149
149
  * @internal
150
150
  */
@@ -189,7 +189,7 @@ export declare type GraphListResponse<T = unknown> = {
189
189
  value: T[];
190
190
  };
191
191
  /** @internal */
192
- export declare type Microsoft365DocumentType = 'Message' | 'Chat Message' | 'Event' | 'Document' | 'Contact' | 'User' | 'List';
192
+ export declare type Microsoft365DocumentType = 'Email' | 'Chat Message' | 'Event' | 'Document' | 'Contact' | 'User' | 'List';
193
193
  /** @internal */
194
194
  declare type Microsoft365TypeFilterType = 'Document' | 'Contact' | 'Chat Message' | 'Message' | 'Event' | 'List';
195
195
  /** @internal */
@@ -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
- workspacePlatformAPI: any;
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>;
@@ -5,4 +5,4 @@ import type { LaunchAppRequest } from '../shapes';
5
5
  * @param app the app directory entry.
6
6
  * @param opts launch options.
7
7
  */
8
- export declare function launchApp({ app, target }: LaunchAppRequest): Promise<void | OpenFin.View | OpenFin.Identity | OpenFin.Platform | OpenFin.Application>;
8
+ export declare function launchApp({ app, target }: LaunchAppRequest): Promise<void | OpenFin.Identity | OpenFin.Platform | OpenFin.View | OpenFin.Application>;
@@ -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
  */
@@ -11,7 +11,7 @@ export declare const isDocumentDefined: boolean;
11
11
  export declare const isWindowDefinedWithIndexDB: boolean;
12
12
  export declare const finUUID: string;
13
13
  export declare const finName: string;
14
- export declare const finEntityType: "" | "window" | "view" | "iframe" | "external connection" | "unknown";
14
+ export declare const finEntityType: "" | "view" | "window" | "iframe" | "external connection" | "unknown";
15
15
  export declare const isEnvLocal: boolean;
16
16
  export declare const isEnvDev: boolean;
17
17
  export declare const isEnvStaging: boolean;