@openfin/cloud-interop 0.41.102 → 0.41.103

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,17 @@
1
+ import { LogLevel as CloudAPILogLevel } from '@openfin/cloud-interop-core-api';
2
+ export declare const enum LogLevel {
3
+ WARN = 0,
4
+ INFO = 1,
5
+ DEBUG = 2
6
+ }
7
+ export interface LogSink {
8
+ log: (logLevel: CloudAPILogLevel, message: string, ...args: unknown[]) => void;
9
+ }
10
+ /**
11
+ * This logger retrofits on top of the CloudAPILogger function signature so it must use CloudAPILogLevel inputs
12
+ */
13
+ export declare class Logger implements LogSink {
14
+ private readonly logLevel;
15
+ constructor(level?: CloudAPILogLevel);
16
+ log(logLevel: CloudAPILogLevel, message: string, ...args: unknown[]): void;
17
+ }
package/out/override.d.ts CHANGED
@@ -1,11 +1,43 @@
1
- import { ConnectParameters } from '@openfin/cloud-interop-core-api';
1
+ import { LogLevel as CloudAPILogLevel, ConnectParameters } from '@openfin/cloud-interop-core-api';
2
2
  import type OpenFin from '@openfin/core';
3
- export type CloudInteropOverrideParams = ConnectParameters & {
3
+ import { LogSink } from './logger';
4
+ type ConnectParametersNoLogger = Omit<ConnectParameters, 'logger'>;
5
+ export type CloudInteropOverrideParams = ConnectParametersNoLogger & {
6
+ /**
7
+ * URL of the Cloud Interop service
8
+ */
4
9
  url: string;
10
+ /**
11
+ * How long to wait for connected clients to respond, defaults to 3 seconds.
12
+ * Do not make this number too high, as it will block findIntent/findIntentsByContext calls
13
+ */
14
+ findIntentTimeout?: number;
15
+ /**
16
+ * If provided will defer to this logger, otherwise logs to console.debug, reduced by LogLevel
17
+ */
18
+ logger?: LogSink;
19
+ /**
20
+ * The level which cloud-interop override will log. Defaults to 'warn'
21
+ */
22
+ logLevel?: CloudAPILogLevel;
5
23
  };
6
24
  export type CloudInteropConnectionStates = 'connected' | 'reconnecting' | 'disconnected';
7
25
  /**
8
26
  * Enhances InteropBroker with Cloud Interop functionality
27
+ *
28
+ * Ensure that CloudInteropOverride comes first in the list of composable overrides, for example:
29
+ * ```
30
+ * const CloudInteropOverride = await cloudInteropOverride(settings);
31
+ * await fin.Platform.init({
32
+ * ...,
33
+ * interopOverride: [
34
+ * CloudInteropOverride, // <--- must come first
35
+ * (BaseProvider) => class MyCustomProvider extends BaseProvider { ... }
36
+ * ]
37
+ * });
38
+ * ```
39
+ *
9
40
  * @param {CloudInteropOverrideParams} config Configuration to connect to the Cloud Interop service
10
41
  */
11
42
  export declare function cloudInteropOverride(config: CloudInteropOverrideParams): Promise<OpenFin.ConstructorOverride<OpenFin.InteropBroker>>;
43
+ export {};
package/out/utils.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import type { v2_0 as FDC3v2 } from '@openfin/fdc3';
2
+ export declare const isContext: (chan: unknown) => chan is FDC3v2.Context;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/cloud-interop",
3
- "version": "0.41.102",
3
+ "version": "0.41.103",
4
4
  "description": "",
5
5
  "private": false,
6
6
  "files": [
@@ -11,6 +11,7 @@
11
11
  "scripts": {
12
12
  "prebuild": "rimraf out",
13
13
  "build": "rollup -c",
14
+ "watch": "rollup -c --watch",
14
15
  "ci:prepublish": "of-npm prepublish",
15
16
  "ci:postpublish": "of-npm postpublish",
16
17
  "ci:publish": "npm publish",
@@ -19,9 +20,9 @@
19
20
  "author": "",
20
21
  "license": "SEE LICENSE IN LICENSE.md",
21
22
  "peerDependencies": {
22
- "@openfin/core": "41.100.100"
23
+ "@openfin/core": "41.100.101"
23
24
  },
24
25
  "dependencies": {
25
- "@openfin/cloud-interop-core-api": "^0.0.1-alpha.fba3468"
26
+ "@openfin/cloud-interop-core-api": "0.0.1-alpha.79a6af0"
26
27
  }
27
28
  }