@openfin/cloud-interop-core-api 0.0.1-alpha.e6793f0 → 0.0.1-alpha.e7138f8
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 +22 -16
- package/dist/index.cjs +359 -127
- package/dist/index.d.ts +3 -1
- package/dist/index.mjs +351 -3885
- package/dist/{interfaces.d.ts → interfaces/connect.interface.d.ts} +14 -52
- package/dist/interfaces/event.interface.d.ts +15 -0
- package/dist/interfaces/index.d.ts +2 -0
- package/package.json +4 -4
|
@@ -9,27 +9,27 @@ export type CloudInteropLogger = (level: LogLevel, message: string) => void;
|
|
|
9
9
|
export type ConnectParameters = {
|
|
10
10
|
/**
|
|
11
11
|
* ID for a group of shared applications.
|
|
12
|
+
* This acts as a namespace for the interop messages that allows separation of messages between different groups of applications for the same user
|
|
12
13
|
*/
|
|
13
14
|
platformId: string;
|
|
14
15
|
/**
|
|
15
16
|
* An identifier for the source environment e.g. a hostname, a browser name etc.
|
|
16
17
|
*/
|
|
17
|
-
sourceId
|
|
18
|
+
sourceId: string;
|
|
18
19
|
/**
|
|
19
20
|
* A display name for the source environment e.g. Andys Mobile
|
|
20
21
|
*/
|
|
21
22
|
sourceDisplayName?: string;
|
|
22
|
-
/**
|
|
23
|
-
* Specifies an optional extra divider to use that allows separation of interop messages for the
|
|
24
|
-
* same user
|
|
25
|
-
* defaults to "default"
|
|
26
|
-
*/
|
|
27
|
-
realm?: string;
|
|
28
23
|
/**
|
|
29
24
|
* The maximum number of times to retry connecting to the cloud interop service when the connection is dropped
|
|
30
25
|
* defaults to 30
|
|
31
26
|
*/
|
|
32
27
|
reconnectRetryLimit?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Specifies how often keep alive messages should be sent to the cloud interop service in seconds
|
|
30
|
+
* defaults to 30
|
|
31
|
+
*/
|
|
32
|
+
keepAliveIntervalSeconds?: number;
|
|
33
33
|
/**
|
|
34
34
|
* Optional function to call with any logging messages to allow integration with the host application's logging
|
|
35
35
|
*
|
|
@@ -83,51 +83,13 @@ export type CloudInteropSettings = {
|
|
|
83
83
|
export type InteropSession = {
|
|
84
84
|
sessionId: string;
|
|
85
85
|
};
|
|
86
|
-
|
|
87
|
-
* Represents a source session
|
|
88
|
-
*/
|
|
89
|
-
export type Source = {
|
|
90
|
-
/**
|
|
91
|
-
* Source session id
|
|
92
|
-
*/
|
|
86
|
+
export type CreateSessionResponse = {
|
|
93
87
|
sessionId: string;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
88
|
+
sessionRootTopic: string;
|
|
89
|
+
url: string;
|
|
90
|
+
token: string;
|
|
91
|
+
orgId: string;
|
|
92
|
+
sub: string;
|
|
93
|
+
platformId: string;
|
|
97
94
|
sourceId: string;
|
|
98
|
-
/**
|
|
99
|
-
* source environment display name
|
|
100
|
-
*/
|
|
101
|
-
sourceDisplayName: string;
|
|
102
|
-
};
|
|
103
|
-
/**
|
|
104
|
-
* Represents the details of an intent found during discovery
|
|
105
|
-
*/
|
|
106
|
-
export type IntentDetail = {
|
|
107
|
-
/**
|
|
108
|
-
* The location of the intent implementation
|
|
109
|
-
*/
|
|
110
|
-
source: Source;
|
|
111
|
-
/**
|
|
112
|
-
* The instance id of the intent
|
|
113
|
-
*/
|
|
114
|
-
intentInstanceId: string;
|
|
115
|
-
/**
|
|
116
|
-
* The name of the intent
|
|
117
|
-
*/
|
|
118
|
-
intentName: string;
|
|
119
|
-
};
|
|
120
|
-
/**
|
|
121
|
-
* Represents a context received from another cloud interop publisher
|
|
122
|
-
*
|
|
123
|
-
* @export
|
|
124
|
-
* @type ContextEvent
|
|
125
|
-
* @property {string} contextGroup - The context group
|
|
126
|
-
* @property {object} context - The context
|
|
127
|
-
* @property {Source} source - The source of the context
|
|
128
|
-
*/
|
|
129
|
-
export type ContextEvent = {
|
|
130
|
-
contextGroup: string;
|
|
131
|
-
context: object;
|
|
132
|
-
source: Source;
|
|
133
95
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ContextEvent, EndReportIntentsEvent, IntentDetailsEvent, IntentResultEvent, InvokeIntentEvent, ReportIntentsEvent } from '@openfin/shared-utils';
|
|
2
|
+
export type EventMap = {
|
|
3
|
+
reconnected: () => void;
|
|
4
|
+
disconnected: () => void;
|
|
5
|
+
context: (event: ContextEvent) => void;
|
|
6
|
+
reconnecting: (attemptNo: number) => void;
|
|
7
|
+
error: (error: Error) => void;
|
|
8
|
+
'session-expired': () => void;
|
|
9
|
+
'report-intents': (event: ReportIntentsEvent) => void;
|
|
10
|
+
'end-report-intents': (event: EndReportIntentsEvent) => void;
|
|
11
|
+
'intent-details': (event: IntentDetailsEvent) => void;
|
|
12
|
+
'invoke-intent': (event: InvokeIntentEvent) => void;
|
|
13
|
+
'intent-result': (event: IntentResultEvent) => void;
|
|
14
|
+
};
|
|
15
|
+
export type EventListenersMap = Map<keyof EventMap, Array<(...args: Parameters<EventMap[keyof EventMap]>) => void>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfin/cloud-interop-core-api",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.e7138f8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "",
|
|
6
6
|
"files": [
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"browser": "./dist/index.mjs",
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"scripts": {
|
|
13
|
-
"build": "rollup -c",
|
|
13
|
+
"build": "rimraf dist && rollup -c",
|
|
14
14
|
"build:watch": "rollup -c --watch",
|
|
15
15
|
"typecheck": "tsc --noEmit",
|
|
16
16
|
"test": "jest --coverage",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
26
26
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
27
27
|
"@types/jest": "^29.5.14",
|
|
28
|
-
"@types/node": "^
|
|
28
|
+
"@types/node": "^22.7.7",
|
|
29
29
|
"@typescript-eslint/eslint-plugin": "^7.5.0",
|
|
30
30
|
"@typescript-eslint/parser": "^7.15.0",
|
|
31
31
|
"eslint": "^8.57.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"typescript": "^5.6.3"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"
|
|
45
|
+
"@openfin/shared-utils": "file:../shared-utils",
|
|
46
46
|
"mqtt": "^5.3.1"
|
|
47
47
|
},
|
|
48
48
|
"eslintConfig": {
|