@openfin/cloud-interop-core-api 0.0.1-alpha.e7138f8 → 0.0.1-alpha.ebcbdf6

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/dist/api.d.ts CHANGED
@@ -1,17 +1,7 @@
1
- import { Intent, IntentResultEvent } from '@openfin/shared-utils';
1
+ import { AppIdentifier, AppIntent, IntentResult } from '@openfin/shared-utils';
2
2
  import mqtt from 'mqtt';
3
- import { CloudInteropSettings, ConnectParameters } from './interfaces/connect.interface';
4
- import { EventMap } from './interfaces';
5
- type CreateSessionResponse = {
6
- sessionId: string;
7
- sessionRootTopic: string;
8
- url: string;
9
- token: string;
10
- orgId: string;
11
- sub: string;
12
- platformId: string;
13
- sourceId: string;
14
- };
3
+ import { CloudInteropSettings, ConnectParameters, CreateSessionResponse } from './interfaces/connect.interface';
4
+ import { EventMap, RaiseIntentAPIOptions, StartIntentDiscoveryOptions } from './interfaces';
15
5
  /**
16
6
  * Represents a single connection to a Cloud Interop service
17
7
  *
@@ -58,19 +48,12 @@ export declare class CloudInteropAPI {
58
48
  * @memberof CloudInteropAPI
59
49
  * @throws {CloudInteropAPIError} - If an error occurs during intent discovery
60
50
  */
61
- startIntentDiscovery(): Promise<void>;
62
- /**
63
- * Ends an intent discovery operation
64
- *
65
- * @return {*} {Promise<void>}
66
- * @memberof CloudInteropAPI
67
- * @throws {CloudInteropAPIError} - If an error occurs during stopping intent discovery
68
- */
69
- endIntentDiscovery(): Promise<void>;
70
- raiseIntent(intent: Intent, targetSessionId: string): Promise<void>;
71
- reportSupportedIntents(discoveryId: string, intents: Intent[]): Promise<void>;
72
- sendIntentResult(resultEvent: IntentResultEvent): Promise<void>;
51
+ startIntentDiscovery(options: StartIntentDiscoveryOptions): Promise<void>;
52
+ raiseIntent(options: RaiseIntentAPIOptions): Promise<void>;
53
+ reportAppIntents(discoveryId: string, intents: AppIntent[]): Promise<boolean>;
54
+ sendIntentResult(initiatingSessionId: string, result: IntentResult): Promise<void>;
55
+ parseSessionId(appId: AppIdentifier | string): string;
73
56
  addEventListener<K extends keyof EventMap>(type: K, callback: EventMap[K]): void;
74
57
  removeEventListener<K extends keyof EventMap>(type: K, callback: EventMap[K]): void;
58
+ once<K extends keyof EventMap>(type: K, callback: EventMap[K]): void;
75
59
  }
76
- export {};
@@ -0,0 +1,8 @@
1
+ import { EventMap } from '../interfaces';
2
+ export declare class EventController {
3
+ #private;
4
+ addEventListener<K extends keyof EventMap>(type: K, callback: EventMap[K]): void;
5
+ removeEventListener<K extends keyof EventMap>(type: K, callback: EventMap[K]): void;
6
+ once<K extends keyof EventMap>(type: K, callback: EventMap[K]): void;
7
+ emitEvent<K extends keyof EventMap>(type: K, ...args: Parameters<EventMap[K]>): void;
8
+ }
@@ -0,0 +1,2 @@
1
+ export * from './event.controller';
2
+ export * from './intent.controller';
@@ -0,0 +1,13 @@
1
+ import { AppIntent, CommandMessage, IntentResult } from '@openfin/shared-utils';
2
+ import mqtt from 'mqtt';
3
+ import { CloudInteropLogger, ConnectParameters, CreateSessionResponse, RaiseIntentAPIOptions, StartIntentDiscoveryOptions } from '../interfaces';
4
+ import { EventController } from './event.controller';
5
+ export declare class IntentController {
6
+ #private;
7
+ constructor(url: string, mqttClient: mqtt.MqttClient, sessionDetails: CreateSessionResponse, connectionParameters: ConnectParameters, events: EventController, logger: CloudInteropLogger);
8
+ startIntentDiscovery(options: StartIntentDiscoveryOptions): Promise<void>;
9
+ raiseIntent({ raiseOptions, appId }: RaiseIntentAPIOptions): Promise<void>;
10
+ reportAppIntents(discoveryId: string, intents: AppIntent[]): Promise<boolean>;
11
+ sendIntentResult(initiatingSessionId: string, result: IntentResult): Promise<void>;
12
+ handleCommandMessage(message: CommandMessage): void;
13
+ }