@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 +9 -26
- package/dist/controllers/event.controller.d.ts +8 -0
- package/dist/controllers/index.d.ts +2 -0
- package/dist/controllers/intent.controller.d.ts +13 -0
- package/dist/index.cjs +359 -210
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +356 -201
- package/dist/interfaces/connect.interface.d.ts +1 -11
- package/dist/interfaces/event.interface.d.ts +3 -3
- package/dist/interfaces/index.d.ts +1 -0
- package/dist/interfaces/intents.interface.d.ts +22 -0
- package/dist/utils.d.ts +25 -0
- package/package.json +1 -1
|
@@ -13,13 +13,9 @@ export type ConnectParameters = {
|
|
|
13
13
|
*/
|
|
14
14
|
platformId: string;
|
|
15
15
|
/**
|
|
16
|
-
* An identifier for the source
|
|
16
|
+
* An user-friendly identifier for the source session e.g. Windows Desktop, Android Phone, etc.
|
|
17
17
|
*/
|
|
18
18
|
sourceId: string;
|
|
19
|
-
/**
|
|
20
|
-
* A display name for the source environment e.g. Andys Mobile
|
|
21
|
-
*/
|
|
22
|
-
sourceDisplayName?: string;
|
|
23
19
|
/**
|
|
24
20
|
* The maximum number of times to retry connecting to the cloud interop service when the connection is dropped
|
|
25
21
|
* defaults to 30
|
|
@@ -77,12 +73,6 @@ export type ConnectParameters = {
|
|
|
77
73
|
export type CloudInteropSettings = {
|
|
78
74
|
url: string;
|
|
79
75
|
};
|
|
80
|
-
/**
|
|
81
|
-
* Represents a session
|
|
82
|
-
*/
|
|
83
|
-
export type InteropSession = {
|
|
84
|
-
sessionId: string;
|
|
85
|
-
};
|
|
86
76
|
export type CreateSessionResponse = {
|
|
87
77
|
sessionId: string;
|
|
88
78
|
sessionRootTopic: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AggregateIntentDetailsEvent, ContextEvent, IntentDetailsEvent, IntentResultEvent, RaiseIntentEvent, ReportIntentsEvent } from '@openfin/shared-utils';
|
|
2
2
|
export type EventMap = {
|
|
3
3
|
reconnected: () => void;
|
|
4
4
|
disconnected: () => void;
|
|
@@ -7,9 +7,9 @@ export type EventMap = {
|
|
|
7
7
|
error: (error: Error) => void;
|
|
8
8
|
'session-expired': () => void;
|
|
9
9
|
'report-intents': (event: ReportIntentsEvent) => void;
|
|
10
|
-
'end-report-intents': (event: EndReportIntentsEvent) => void;
|
|
11
10
|
'intent-details': (event: IntentDetailsEvent) => void;
|
|
12
|
-
'
|
|
11
|
+
'aggregate-intent-details': (event: AggregateIntentDetailsEvent) => void;
|
|
12
|
+
'raise-intent': (event: RaiseIntentEvent) => void;
|
|
13
13
|
'intent-result': (event: IntentResultEvent) => void;
|
|
14
14
|
};
|
|
15
15
|
export type EventListenersMap = Map<keyof EventMap, Array<(...args: Parameters<EventMap[keyof EventMap]>) => void>>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AppIdentifier, FindIntentOptions, RaiseIntentOptions } from '@openfin/shared-utils';
|
|
2
|
+
/**
|
|
3
|
+
* Options used to start an Intent Discovery Operation, with possible constraints for the responses
|
|
4
|
+
*/
|
|
5
|
+
export type StartIntentDiscoveryOptions = {
|
|
6
|
+
findOptions: FindIntentOptions;
|
|
7
|
+
/**
|
|
8
|
+
* The timeout in ms.
|
|
9
|
+
*
|
|
10
|
+
* Discovery will wait for all connected sessions to respond or until the timeout is reached.
|
|
11
|
+
*
|
|
12
|
+
* Defaults to 3000ms if not provided, minimum value 500ms
|
|
13
|
+
*/
|
|
14
|
+
timeout?: number;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Options used to raise an Intent
|
|
18
|
+
*/
|
|
19
|
+
export type RaiseIntentAPIOptions = {
|
|
20
|
+
raiseOptions: RaiseIntentOptions;
|
|
21
|
+
appId: AppIdentifier | string;
|
|
22
|
+
};
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AppIdentifier, AppIntent, Source } from '@openfin/shared-utils';
|
|
2
|
+
import { ConnectParameters, CreateSessionResponse } from './interfaces';
|
|
3
|
+
export declare const APP_ID_DELIM = "::";
|
|
4
|
+
export declare const getRequestHeaders: (connectionParameters: ConnectParameters) => HeadersInit;
|
|
5
|
+
/**
|
|
6
|
+
* Encodes all app intents in the format: `appId::sourceId::sessionId`,
|
|
7
|
+
* where sourceId and sessionId are URI encoded
|
|
8
|
+
* @param appIntents
|
|
9
|
+
* @param source
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
export declare const encodeAppIntents: (appIntents: AppIntent[], { sessionId, sourceId }: Source) => AppIntent[];
|
|
13
|
+
/**
|
|
14
|
+
* Decodes all app intents by URI decoding the parts previously encoded by `encodeAppIntents`
|
|
15
|
+
* @param appIntents
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
18
|
+
export declare const decodeAppIntents: (appIntents: AppIntent[]) => AppIntent[];
|
|
19
|
+
/**
|
|
20
|
+
* Decodes the app id to extract the sessionId, returns '' if not able to parse
|
|
21
|
+
* @param app
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
export declare const parseSessionId: (appId: AppIdentifier | string) => any;
|
|
25
|
+
export declare const getSourceFromSession: (sessionDetails: CreateSessionResponse) => Source;
|