@openfin/cloud-interop-core-api 0.0.1-alpha.e7138f8 → 0.0.1-alpha.e84a83c
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/bundle.d.ts +882 -0
- package/index.cjs +665 -0
- package/index.mjs +661 -0
- package/package.json +16 -229
- package/dist/api.d.ts +0 -76
- package/dist/errors/api.error.d.ts +0 -7
- package/dist/index.cjs +0 -487
- package/dist/index.d.ts +0 -5
- package/dist/index.mjs +0 -483
- package/dist/interfaces/connect.interface.d.ts +0 -95
- package/dist/interfaces/event.interface.d.ts +0 -15
- package/dist/interfaces/index.d.ts +0 -2
package/package.json
CHANGED
|
@@ -1,231 +1,18 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"lint:fix": "eslint . --fix --max-warnings 0"
|
|
19
|
-
},
|
|
20
|
-
"author": "",
|
|
21
|
-
"license": "SEE LICENSE IN LICENSE.md",
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"@rollup/plugin-commonjs": "^28.0.1",
|
|
24
|
-
"@rollup/plugin-inject": "^5.0.5",
|
|
25
|
-
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
26
|
-
"@rollup/plugin-typescript": "^11.1.6",
|
|
27
|
-
"@types/jest": "^29.5.14",
|
|
28
|
-
"@types/node": "^22.7.7",
|
|
29
|
-
"@typescript-eslint/eslint-plugin": "^7.5.0",
|
|
30
|
-
"@typescript-eslint/parser": "^7.15.0",
|
|
31
|
-
"eslint": "^8.57.0",
|
|
32
|
-
"eslint-config-prettier": "^9.1.0",
|
|
33
|
-
"eslint-plugin-check-file": "^2.8.0",
|
|
34
|
-
"eslint-plugin-prettier": "^5.2.1",
|
|
35
|
-
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
36
|
-
"eslint-plugin-unicorn": "^55.0.0",
|
|
37
|
-
"eslint-plugin-unused-imports": "^4.1.4",
|
|
38
|
-
"jest": "^29.7.0",
|
|
39
|
-
"prettier": "^3.3.3",
|
|
40
|
-
"rollup": "^4.9.6",
|
|
41
|
-
"ts-jest": "^29.2.5",
|
|
42
|
-
"typescript": "^5.6.3"
|
|
43
|
-
},
|
|
44
|
-
"dependencies": {
|
|
45
|
-
"@openfin/shared-utils": "file:../shared-utils",
|
|
46
|
-
"mqtt": "^5.3.1"
|
|
47
|
-
},
|
|
48
|
-
"eslintConfig": {
|
|
49
|
-
"env": {
|
|
50
|
-
"browser": true,
|
|
51
|
-
"node": true
|
|
52
|
-
},
|
|
53
|
-
"parser": "@typescript-eslint/parser",
|
|
54
|
-
"parserOptions": {
|
|
55
|
-
"ecmaVersion": "latest",
|
|
56
|
-
"project": true,
|
|
57
|
-
"sourceType": "module"
|
|
58
|
-
},
|
|
59
|
-
"extends": [
|
|
60
|
-
"eslint:recommended",
|
|
61
|
-
"plugin:@typescript-eslint/recommended",
|
|
62
|
-
"plugin:@typescript-eslint/strict",
|
|
63
|
-
"plugin:unicorn/recommended",
|
|
64
|
-
"plugin:prettier/recommended"
|
|
65
|
-
],
|
|
66
|
-
"plugins": [
|
|
67
|
-
"prettier",
|
|
68
|
-
"check-file",
|
|
69
|
-
"simple-import-sort",
|
|
70
|
-
"unused-imports"
|
|
71
|
-
],
|
|
72
|
-
"rules": {
|
|
73
|
-
"unused-imports/no-unused-imports": "warn",
|
|
74
|
-
"unicorn/prevent-abbreviations": [
|
|
75
|
-
"error",
|
|
76
|
-
{
|
|
77
|
-
"replacements": {
|
|
78
|
-
"props": false,
|
|
79
|
-
"prop": false,
|
|
80
|
-
"ref": false,
|
|
81
|
-
"args": false,
|
|
82
|
-
"arg": false,
|
|
83
|
-
"src": false,
|
|
84
|
-
"dev": false,
|
|
85
|
-
"str": false,
|
|
86
|
-
"req": false,
|
|
87
|
-
"res": false
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
],
|
|
91
|
-
"@typescript-eslint/no-non-null-assertion": "error",
|
|
92
|
-
"unicorn/no-nested-ternary": "off",
|
|
93
|
-
"unicorn/no-array-for-each": "off",
|
|
94
|
-
"unicorn/no-useless-undefined": "off",
|
|
95
|
-
"unicorn/no-null": "off",
|
|
96
|
-
"eqeqeq": [
|
|
97
|
-
"error",
|
|
98
|
-
"always"
|
|
99
|
-
],
|
|
100
|
-
"no-alert": "error",
|
|
101
|
-
"no-eval": "error",
|
|
102
|
-
"prettier/prettier": "warn",
|
|
103
|
-
"simple-import-sort/imports": [
|
|
104
|
-
"error",
|
|
105
|
-
{
|
|
106
|
-
"groups": [
|
|
107
|
-
[
|
|
108
|
-
"^react$"
|
|
109
|
-
],
|
|
110
|
-
[
|
|
111
|
-
"^react"
|
|
112
|
-
],
|
|
113
|
-
[
|
|
114
|
-
"^next"
|
|
115
|
-
],
|
|
116
|
-
[
|
|
117
|
-
"^zod"
|
|
118
|
-
],
|
|
119
|
-
[
|
|
120
|
-
"^@radix-ui/"
|
|
121
|
-
],
|
|
122
|
-
[
|
|
123
|
-
"^[^.]"
|
|
124
|
-
],
|
|
125
|
-
[
|
|
126
|
-
"@/components/ui/.*"
|
|
127
|
-
],
|
|
128
|
-
[
|
|
129
|
-
"@/components/.*"
|
|
130
|
-
],
|
|
131
|
-
[
|
|
132
|
-
"@/config/.*"
|
|
133
|
-
],
|
|
134
|
-
[
|
|
135
|
-
"@/lib/.*"
|
|
136
|
-
],
|
|
137
|
-
[
|
|
138
|
-
"^\\.\\.(?!/?$)",
|
|
139
|
-
"^\\.\\./?$"
|
|
140
|
-
],
|
|
141
|
-
[
|
|
142
|
-
"^\\./(?=.*/)(?!/?$)",
|
|
143
|
-
"^\\.(?!/?$)",
|
|
144
|
-
"^\\./?$"
|
|
145
|
-
],
|
|
146
|
-
[
|
|
147
|
-
"^.+\\.s?css$"
|
|
148
|
-
]
|
|
149
|
-
]
|
|
150
|
-
}
|
|
151
|
-
],
|
|
152
|
-
"check-file/no-index": "off",
|
|
153
|
-
"check-file/filename-naming-convention": [
|
|
154
|
-
"error",
|
|
155
|
-
{
|
|
156
|
-
"**/*.{jsx,tsx}": "KEBAB_CASE",
|
|
157
|
-
"**/*.{js,ts}": "KEBAB_CASE"
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
"ignoreMiddleExtensions": true
|
|
161
|
-
}
|
|
162
|
-
],
|
|
163
|
-
"check-file/filename-blocklist": [
|
|
164
|
-
"error",
|
|
165
|
-
{
|
|
166
|
-
"**/*.spec.js": "*.test.js",
|
|
167
|
-
"**/*.spec.jsx": "*.test.jsx",
|
|
168
|
-
"**/*.spec.ts": "*.test.ts",
|
|
169
|
-
"**/*.spec.tsx": "*.test.tsx"
|
|
170
|
-
}
|
|
171
|
-
],
|
|
172
|
-
"no-restricted-syntax": [
|
|
173
|
-
"error",
|
|
174
|
-
{
|
|
175
|
-
"selector": "TSEnumDeclaration",
|
|
176
|
-
"message": "Prefer string unions to enums."
|
|
177
|
-
}
|
|
178
|
-
],
|
|
179
|
-
"curly": [
|
|
180
|
-
"error",
|
|
181
|
-
"multi-line"
|
|
182
|
-
],
|
|
183
|
-
"@typescript-eslint/consistent-type-definitions": [
|
|
184
|
-
"error",
|
|
185
|
-
"type"
|
|
186
|
-
],
|
|
187
|
-
"@typescript-eslint/no-unused-vars": [
|
|
188
|
-
"warn",
|
|
189
|
-
{
|
|
190
|
-
"argsIgnorePattern": "^_",
|
|
191
|
-
"varsIgnorePattern": "^_"
|
|
192
|
-
}
|
|
193
|
-
],
|
|
194
|
-
"@typescript-eslint/no-explicit-any": "warn"
|
|
195
|
-
},
|
|
196
|
-
"ignorePatterns": [
|
|
197
|
-
"node_modules",
|
|
198
|
-
"out",
|
|
199
|
-
"build",
|
|
200
|
-
"dist",
|
|
201
|
-
"coverage",
|
|
202
|
-
"tests",
|
|
203
|
-
"rollup.config.mjs",
|
|
204
|
-
"examples"
|
|
205
|
-
]
|
|
206
|
-
},
|
|
207
|
-
"jest": {
|
|
208
|
-
"collectCoverage": true,
|
|
209
|
-
"collectCoverageFrom": [
|
|
210
|
-
"src/**/*.ts"
|
|
211
|
-
],
|
|
212
|
-
"coverageReporters": [
|
|
213
|
-
"lcov",
|
|
214
|
-
"text-summary"
|
|
215
|
-
],
|
|
216
|
-
"preset": "ts-jest",
|
|
217
|
-
"restoreMocks": true,
|
|
218
|
-
"setupFiles": [],
|
|
219
|
-
"testMatch": [
|
|
220
|
-
"**/tests/*.test.ts"
|
|
221
|
-
],
|
|
222
|
-
"testTimeout": 100000
|
|
223
|
-
},
|
|
224
|
-
"prettier": {
|
|
225
|
-
"printWidth": 160,
|
|
226
|
-
"semi": true,
|
|
227
|
-
"singleQuote": true,
|
|
228
|
-
"tabWidth": 4,
|
|
229
|
-
"trailingComma": "all"
|
|
230
|
-
}
|
|
2
|
+
"name": "@openfin/cloud-interop-core-api",
|
|
3
|
+
"version": "0.0.1-alpha.e84a83c",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "",
|
|
6
|
+
"main": "./index.cjs",
|
|
7
|
+
"browser": "./index.mjs",
|
|
8
|
+
"types": "./bundle.d.ts",
|
|
9
|
+
"author": "",
|
|
10
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
|
11
|
+
"optionalDependencies": {
|
|
12
|
+
"@rollup/rollup-linux-x64-gnu": "*"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"mqtt": "^5.3.1",
|
|
16
|
+
"zod": "^3.24.1"
|
|
17
|
+
}
|
|
231
18
|
}
|
package/dist/api.d.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
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 {};
|