@openfin/cloud-interop-core-api 0.0.1-alpha.05b30e4
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/LICENSE.md +4 -0
- package/README.md +14 -0
- package/dist/api.d.ts +76 -0
- package/dist/errors/api.error.d.ts +7 -0
- package/dist/index.cjs +487 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.mjs +483 -0
- package/dist/interfaces/connect.interface.d.ts +95 -0
- package/dist/interfaces/event.interface.d.ts +15 -0
- package/dist/interfaces/index.d.ts +2 -0
- package/package.json +231 -0
package/LICENSE.md
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# @openfin/cloud-interop-core-api
|
|
2
|
+
|
|
3
|
+
This package contains the core interop library that handles all interactions with the Here™ Cloud Interop Service.
|
|
4
|
+
|
|
5
|
+
It is callable via browser or node applications.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Authentication
|
|
9
|
+
|
|
10
|
+
The library supports authentication with the Here™ Cloud Interop Service using the following methods:
|
|
11
|
+
- Basic Authentication
|
|
12
|
+
- JWT Token Authentication
|
|
13
|
+
- Default Authentication i.e. Interactive session based authentication using cookies
|
|
14
|
+
|
package/dist/api.d.ts
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Intent, IntentResultEvent } from '@openfin/shared-utils';
|
|
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
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Represents a single connection to a Cloud Interop service
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @class CloudInteropAPI
|
|
20
|
+
* @implements {Client}
|
|
21
|
+
*/
|
|
22
|
+
export declare class CloudInteropAPI {
|
|
23
|
+
#private;
|
|
24
|
+
constructor(cloudInteropSettings: CloudInteropSettings);
|
|
25
|
+
get sessionDetails(): CreateSessionResponse | undefined;
|
|
26
|
+
get mqttClient(): mqtt.MqttClient | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Connects and creates a session on the Cloud Interop service
|
|
29
|
+
*
|
|
30
|
+
* @param {ConnectParameters} parameters - The parameters to use to connect
|
|
31
|
+
* @return {*} {Promise<void>}
|
|
32
|
+
* @memberof CloudInteropAPI
|
|
33
|
+
* @throws {CloudInteropAPIError} - If an error occurs during connection
|
|
34
|
+
* @throws {AuthorizationError} - If the connection is unauthorized
|
|
35
|
+
*/
|
|
36
|
+
connect(parameters: ConnectParameters): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Disconnects from the Cloud Interop service
|
|
39
|
+
*
|
|
40
|
+
* @return {*} {Promise<void>}
|
|
41
|
+
* @memberof CloudInteropAPI
|
|
42
|
+
* @throws {CloudInteropAPIError} - If an error occurs during disconnection
|
|
43
|
+
*/
|
|
44
|
+
disconnect(): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Publishes a new context for the given context group to the other connected sessions
|
|
47
|
+
*
|
|
48
|
+
* @param {string} contextGroup - The context group to publish to
|
|
49
|
+
* @param {object} context - The context to publish
|
|
50
|
+
* @return {*} {Promise<void>}
|
|
51
|
+
* @memberof CloudInteropAPI
|
|
52
|
+
*/
|
|
53
|
+
setContext(contextGroup: string, context: object): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Starts an intent discovery operation
|
|
56
|
+
*
|
|
57
|
+
* @return {*} {Promise<void>}
|
|
58
|
+
* @memberof CloudInteropAPI
|
|
59
|
+
* @throws {CloudInteropAPIError} - If an error occurs during intent discovery
|
|
60
|
+
*/
|
|
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>;
|
|
73
|
+
addEventListener<K extends keyof EventMap>(type: K, callback: EventMap[K]): void;
|
|
74
|
+
removeEventListener<K extends keyof EventMap>(type: K, callback: EventMap[K]): void;
|
|
75
|
+
}
|
|
76
|
+
export {};
|