@openfin/workspace 13.1.2 → 13.1.4

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,19 +1,16 @@
1
- import { HomeSearchListenerResponse } from '../../../client-api/src/shapes/home';
2
- import { WorkflowIntegration } from '../../../client-api/src/shapes/integrations';
1
+ import { BaseWorkflowIntegration, WorkflowIntegration } from '../../../client-api/src/shapes/integrations';
3
2
  import { Microsoft365ConnectionConfig, Microsoft365IntegrationConfig, Microsoft365Workflows, MicrosoftEntityTypeConfig, MicrosoftSearchWorkflowConfig } from './microsoft.shapes';
4
3
  export type { Microsoft365IntegrationConfig, Microsoft365ConnectionConfig, Microsoft365Workflows, MicrosoftSearchWorkflowConfig, MicrosoftEntityTypeConfig };
5
4
  /**
6
5
  * The Microsoft365WorkflowIntegration class is a WorkflowIntegration that provides Microsoft 365 integration.
7
6
  * This integration allows you to search for Microsoft 365 entities and perform actions on them using Home.
8
7
  */
9
- export declare class Microsoft365WorkflowIntegration extends WorkflowIntegration {
8
+ export declare class Microsoft365WorkflowIntegration extends BaseWorkflowIntegration implements WorkflowIntegration {
10
9
  #private;
11
10
  /** The configuration object for the integration. */
12
11
  config: Microsoft365IntegrationConfig;
13
12
  /** The name of the integration. Used for Analytics */
14
13
  workflowIntegrationName: string;
15
- /** The current searchResponse. This can be used to update results. */
16
- searchResponse: HomeSearchListenerResponse | undefined;
17
14
  /**
18
15
  * Creates an instance of Microsoft365WorkflowIntegration.
19
16
  *
@@ -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
  /**
@@ -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
  *
@@ -23,12 +23,25 @@ export interface WorkflowIntegrationConfig {
23
23
  connect: unknown;
24
24
  workflows?: IntegrationWorkflows;
25
25
  }
26
- export declare abstract class WorkflowIntegration {
26
+ export interface WorkflowIntegration {
27
+ /**
28
+ * Name of the Workflow Integration
29
+ * @example "Microsoft365"
30
+ */
31
+ workflowIntegrationName: string;
32
+ /**
33
+ * The config for the Workflow Integration
34
+ */
35
+ config: WorkflowIntegrationConfig;
36
+ connect: (config?: any) => Promise<void>;
37
+ initializeWorkflow: (workflow: string) => Promise<void>;
38
+ _initializeWorkflows: (config?: WorkflowIntegrationConfig) => Promise<void>;
39
+ }
40
+ export declare abstract class BaseWorkflowIntegration {
27
41
  #private;
28
42
  workflowIntegrationName: string;
29
43
  config: WorkflowIntegrationConfig;
30
44
  constructor(config: WorkflowIntegrationConfig);
31
- connect: (config?: any) => Promise<void>;
32
45
  _initializeWorkflows: (config?: WorkflowIntegrationConfig) => Promise<void>;
33
46
  initializeWorkflow(workflow: string): Promise<void>;
34
47
  }
@@ -5,7 +5,7 @@ import { CustomActionSpecifier, CustomButtonConfig } from '../../common/src/api/
5
5
  import type { AttachedPage, Page, PageWithUpdatableRuntimeAttribs } from '../../common/src/api/pages/shapes';
6
6
  import type { CustomThemes } from '../../common/src/api/theming';
7
7
  import type { App, DockProviderConfigWithIdentity, StoreButtonConfig } from '../../client-api/src/shapes';
8
- import { WorkflowIntegration } from '../../client-api/src/shapes/integrations';
8
+ import type { WorkflowIntegration } from '../../client-api/src/shapes/integrations';
9
9
  export { AppManifestType } from '../../client-api/src/shapes';
10
10
  export type { App, AppIntent, Image } from '../../client-api/src/shapes';
11
11
  export type { CustomActionSpecifier, CustomButtonConfig } from '../../common/src/api/action';
@@ -0,0 +1,35 @@
1
+ /**
2
+ * TTLCache class that provides a simple cache mechanism with TTL (Time To Live) functionality.
3
+ * It also maintains a maximum capacity and evicts the oldest entry when the capacity is reached.
4
+ */
5
+ export default class TTLCache<T> {
6
+ #private;
7
+ /**
8
+ * TTLCache constructor.
9
+ * @param ttl - Time to live in milliseconds. Defaults to 300000 (5 minutes).
10
+ * @param capacity - Maximum capacity of the cache. Defaults to 100.
11
+ */
12
+ constructor(ttl?: number, capacity?: number);
13
+ /**
14
+ * Retrieves a value from the cache.
15
+ * @param key - The key to identify the cached item.
16
+ * @returns The cached item or null if the item does not exist or is expired.
17
+ */
18
+ get(key: string): T | null;
19
+ /**
20
+ * Stores a value in the cache.
21
+ * If the cache is at capacity, the oldest entry will be removed.
22
+ * @param key - The key to identify the item to be cached.
23
+ * @param value - The value to be cached.
24
+ */
25
+ put(key: string, value: T): void;
26
+ /**
27
+ * Removes a value from the cache.
28
+ * @param key - The key identifying the item to be removed.
29
+ */
30
+ remove(key: string): void;
31
+ /**
32
+ * Clears the entire cache.
33
+ */
34
+ clear(): void;
35
+ }