@interopio/browser-platform 3.0.1
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/browser.platform.d.ts +455 -0
- package/changelog.md +69 -0
- package/dist/browser.platform.es.js +46074 -0
- package/dist/browser.platform.es.js.map +1 -0
- package/dist/browser.platform.umd.js +46082 -0
- package/dist/browser.platform.umd.js.map +1 -0
- package/license.md +21 -0
- package/package.json +78 -0
- package/readme.md +9 -0
- package/rollup.config.js +45 -0
- package/src/common/constants.ts +46 -0
- package/src/common/defaultConfig.ts +56 -0
- package/src/common/gateway.d.ts +32 -0
- package/src/common/types.ts +222 -0
- package/src/connection/gateway.ts +132 -0
- package/src/connection/no-gateway.ts +1 -0
- package/src/connection/portsBridge.ts +441 -0
- package/src/connection/preferred.ts +247 -0
- package/src/controllers/domains.ts +156 -0
- package/src/controllers/glue.ts +604 -0
- package/src/controllers/interception.ts +53 -0
- package/src/controllers/license.ts +50 -0
- package/src/controllers/main.ts +256 -0
- package/src/controllers/plugins.ts +121 -0
- package/src/controllers/serviceWorker.ts +193 -0
- package/src/controllers/state.ts +84 -0
- package/src/controllers/system.ts +99 -0
- package/src/controllers/transactions.ts +80 -0
- package/src/factory.ts +40 -0
- package/src/fallbacks/browser.ts +47 -0
- package/src/fallbacks/dekstop.ts +21 -0
- package/src/index.ts +18 -0
- package/src/libs/applications/appStore/directory.ts +235 -0
- package/src/libs/applications/appStore/remoteWatcher.ts +112 -0
- package/src/libs/applications/controller.ts +469 -0
- package/src/libs/applications/decoders.ts +98 -0
- package/src/libs/applications/defaults.ts +6 -0
- package/src/libs/applications/types.ts +98 -0
- package/src/libs/channels/controller.ts +109 -0
- package/src/libs/channels/decoders.ts +19 -0
- package/src/libs/extension/controller.ts +120 -0
- package/src/libs/extension/decoders.ts +18 -0
- package/src/libs/extension/types.ts +11 -0
- package/src/libs/intents/constants.ts +9 -0
- package/src/libs/intents/controller.ts +500 -0
- package/src/libs/intents/decoders.ts +96 -0
- package/src/libs/intents/resolverHelper.ts +264 -0
- package/src/libs/intents/types.ts +119 -0
- package/src/libs/layouts/constants.ts +3 -0
- package/src/libs/layouts/controller.ts +476 -0
- package/src/libs/layouts/decoders.ts +132 -0
- package/src/libs/layouts/global/builder.ts +400 -0
- package/src/libs/layouts/global/resetter.ts +116 -0
- package/src/libs/layouts/global/restorer.ts +217 -0
- package/src/libs/layouts/global/validator.ts +169 -0
- package/src/libs/layouts/idbStore.ts +63 -0
- package/src/libs/layouts/types.ts +133 -0
- package/src/libs/manager/controller.ts +175 -0
- package/src/libs/manager/decoders.ts +6 -0
- package/src/libs/manager/defaults.ts +5 -0
- package/src/libs/manager/identity.ts +92 -0
- package/src/libs/manager/session.ts +195 -0
- package/src/libs/manager/types.ts +51 -0
- package/src/libs/notifications/controller.ts +447 -0
- package/src/libs/notifications/decoders.ts +166 -0
- package/src/libs/notifications/types.ts +49 -0
- package/src/libs/notifications/utils.ts +7 -0
- package/src/libs/search/controller.ts +232 -0
- package/src/libs/search/decoders.ts +6 -0
- package/src/libs/search/repositories/applications.ts +62 -0
- package/src/libs/search/repositories/layouts.ts +48 -0
- package/src/libs/search/repositories/workspaces.ts +47 -0
- package/src/libs/search/types.ts +9 -0
- package/src/libs/themes/constants.ts +9 -0
- package/src/libs/themes/controller.ts +153 -0
- package/src/libs/themes/decoders.ts +28 -0
- package/src/libs/themes/types.ts +28 -0
- package/src/libs/windows/controller.ts +498 -0
- package/src/libs/windows/decoders.ts +64 -0
- package/src/libs/windows/types.ts +59 -0
- package/src/libs/workspaces/controller.ts +922 -0
- package/src/libs/workspaces/decoders.ts +868 -0
- package/src/libs/workspaces/defaultConfig.ts +11 -0
- package/src/libs/workspaces/frames.ts +239 -0
- package/src/libs/workspaces/hibernationWatcher.ts +231 -0
- package/src/libs/workspaces/types.ts +506 -0
- package/src/platform.ts +156 -0
- package/src/shared/decoders.ts +479 -0
- package/src/shared/fetchTimeout.ts +25 -0
- package/src/shared/ioc.ts +580 -0
- package/src/shared/logger.ts +19 -0
- package/src/shared/promisePlus.ts +62 -0
- package/src/shared/sequelizer.ts +48 -0
- package/src/shared/utils.ts +86 -0
- package/src/storage/local.ts +111 -0
- package/src/storage/session.ts +436 -0
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { IOConnectCore } from "@interopio/core";
|
|
2
|
+
import { IOConnectBrowser } from "@interopio/browser";
|
|
3
|
+
import shortid from "shortid";
|
|
4
|
+
import logger from "../../shared/logger";
|
|
5
|
+
import { GlueController } from "../../controllers/glue";
|
|
6
|
+
import { intentResolverResponseDecoder } from "./decoders";
|
|
7
|
+
import { INTENTS_RESOLVER_HEIGHT, INTENTS_RESOLVER_INTEROP_PREFIX, INTENTS_RESOLVER_WIDTH } from "./constants";
|
|
8
|
+
import { IntentResolverResponse, IntentsResolverResponse, IntentsResolverResponsePromise, IntentsResolverStartContext, StartResolverAppArgs } from "./types";
|
|
9
|
+
import { WorkspacesController } from "../workspaces/controller";
|
|
10
|
+
import { PromisePlus } from "../../shared/promisePlus";
|
|
11
|
+
import { WindowsController } from "../windows/controller";
|
|
12
|
+
import { SimpleWindowCommand, WindowBoundsResult } from "../windows/types";
|
|
13
|
+
|
|
14
|
+
export class IntentsResolverHelper {
|
|
15
|
+
private intentsResolverResponsePromises: { [instanceId: string]: IntentsResolverResponsePromise } = {};
|
|
16
|
+
|
|
17
|
+
constructor(
|
|
18
|
+
private readonly glueController: GlueController,
|
|
19
|
+
private readonly workspacesController: WorkspacesController,
|
|
20
|
+
private readonly windowsController: WindowsController
|
|
21
|
+
) { }
|
|
22
|
+
|
|
23
|
+
private get logger(): IOConnectCore.Logger.API | undefined {
|
|
24
|
+
return logger.get("intents.resolver.controller");
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
public async startResolverApp({ requestWithResolverInfo, commandId, callerId, resolverInstance }: StartResolverAppArgs): Promise<IOConnectBrowser.Intents.IntentHandler> {
|
|
28
|
+
const { intentRequest, resolverConfig } = requestWithResolverInfo;
|
|
29
|
+
|
|
30
|
+
this.logger?.trace(`[${commandId}] Intents Resolver UI with app name ${resolverConfig.appName} will be used for request: ${JSON.stringify(intentRequest)}`);
|
|
31
|
+
|
|
32
|
+
const responseMethodName = await this.registerResponseMethod();
|
|
33
|
+
|
|
34
|
+
this.logger?.trace(`[${commandId}] Registered interop method ${responseMethodName}`);
|
|
35
|
+
|
|
36
|
+
const startContext = this.buildStartContext(intentRequest, responseMethodName);
|
|
37
|
+
|
|
38
|
+
const startOptions = await this.buildStartOptions(callerId, commandId);
|
|
39
|
+
|
|
40
|
+
this.logger?.trace(`[${commandId}] Starting Intents Resolver UI with context: ${JSON.stringify(startContext)} and options: ${startOptions}`);
|
|
41
|
+
|
|
42
|
+
const instance = await this.glueController.clientGlue.appManager.application(resolverConfig.appName).start(startContext, startOptions);
|
|
43
|
+
|
|
44
|
+
if (resolverInstance) {
|
|
45
|
+
resolverInstance.instanceId = instance.id;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
this.logger?.trace(`[${commandId}] Intents Resolver instance with id ${instance.id} opened`);
|
|
49
|
+
|
|
50
|
+
this.subscribeOnInstanceStopped(instance);
|
|
51
|
+
|
|
52
|
+
this.createResponsePromise(intentRequest.intent, instance.id, responseMethodName, resolverConfig.waitResponseTimeout);
|
|
53
|
+
|
|
54
|
+
const handler = await this.handleInstanceResponse(instance.id, commandId);
|
|
55
|
+
|
|
56
|
+
return handler;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
public stopResolverInstance(instanceId: string): void {
|
|
60
|
+
const searchedInstance = this.glueController.clientGlue.appManager.instances().find(inst => inst.id === instanceId);
|
|
61
|
+
|
|
62
|
+
if (!searchedInstance) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
searchedInstance.stop().catch(err => this.logger?.error(err));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
private async handleInstanceResponse(instanceId: string, commandId: string): Promise<IOConnectBrowser.Intents.IntentHandler> {
|
|
70
|
+
try {
|
|
71
|
+
const { handler, intent } = await this.intentsResolverResponsePromises[instanceId].promise;
|
|
72
|
+
|
|
73
|
+
this.logger?.trace(`[${commandId}] Intent handler chosen for intent ${intent}: ${JSON.stringify(handler)}. Stopping resolver instance with id ${instanceId}`);
|
|
74
|
+
|
|
75
|
+
this.stopResolverInstance(instanceId);
|
|
76
|
+
|
|
77
|
+
this.logger?.trace(`[${commandId}] Instance with id ${instanceId} successfully stopped`);
|
|
78
|
+
|
|
79
|
+
return handler;
|
|
80
|
+
|
|
81
|
+
} catch (error) {
|
|
82
|
+
this.stopResolverInstance(instanceId);
|
|
83
|
+
|
|
84
|
+
throw new Error(error as string);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
private async registerResponseMethod(): Promise<string> {
|
|
89
|
+
const methodName = INTENTS_RESOLVER_INTEROP_PREFIX + shortid();
|
|
90
|
+
|
|
91
|
+
await this.glueController.clientGlue.interop.register(methodName, this.responseHandler.bind(this));
|
|
92
|
+
|
|
93
|
+
return methodName;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
private createResponsePromise(intent: string, instanceId: string, methodName: string, timeout: number): void {
|
|
97
|
+
let resolve: (arg: IntentsResolverResponse) => void = () => { };
|
|
98
|
+
let reject: (reason: string) => void = () => { };
|
|
99
|
+
|
|
100
|
+
const promise = PromisePlus<IntentResolverResponse>((res, rej) => {
|
|
101
|
+
resolve = res;
|
|
102
|
+
reject = rej;
|
|
103
|
+
}, timeout, `Timeout of ${timeout}ms hit waiting for the user to choose a handler for intent ${intent}`);
|
|
104
|
+
|
|
105
|
+
this.intentsResolverResponsePromises[instanceId] = { intent, resolve, reject, promise, methodName };
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
private buildStartContext(requestObj: IOConnectBrowser.Intents.IntentRequest, methodName: string) {
|
|
109
|
+
const startContext: IntentsResolverStartContext = {
|
|
110
|
+
intent: requestObj,
|
|
111
|
+
callerId: this.glueController.clientGlue.interop.instance.instance!,
|
|
112
|
+
methodName
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
return startContext;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
private async buildStartOptions(windowId: string, commandId: string): Promise<IOConnectBrowser.AppManager.ApplicationStartOptions> {
|
|
119
|
+
const bounds = await this.getTargetBounds(windowId, commandId);
|
|
120
|
+
|
|
121
|
+
if (!bounds) {
|
|
122
|
+
throw new Error(`[${commandId}] Cannot find window with id: ${windowId} - the client which sent the "raise" command is no longer opened`);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return {
|
|
126
|
+
top: (bounds.height - INTENTS_RESOLVER_HEIGHT) / 2 + bounds.top,
|
|
127
|
+
left: (bounds.width - INTENTS_RESOLVER_WIDTH) / 2 + bounds.left,
|
|
128
|
+
width: INTENTS_RESOLVER_WIDTH,
|
|
129
|
+
height: INTENTS_RESOLVER_HEIGHT
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
private async getTargetBounds(windowId: string, commandId: string): Promise<IOConnectBrowser.Windows.Bounds> {
|
|
134
|
+
const bounds = await this.tryGetWindowBasedBounds(windowId, commandId) || await this.tryGetWorkspaceBasedBounds(windowId, commandId);
|
|
135
|
+
|
|
136
|
+
if (bounds) {
|
|
137
|
+
this.logger?.trace(`[${commandId}] Opening Intents Resolver UI with bounds: ${JSON.stringify(bounds)}`);
|
|
138
|
+
|
|
139
|
+
return bounds;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const defaultBounds: IOConnectBrowser.Windows.Bounds = {
|
|
143
|
+
top: (window as any).screen.availTop || 0,
|
|
144
|
+
left: (window as any).screen.availLeft || 0,
|
|
145
|
+
width: window.screen.width,
|
|
146
|
+
height: window.screen.height
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
this.logger?.trace(`[${commandId}] Opening Intents Resolver UI relative to my screen bounds: ${JSON.stringify(defaultBounds)}`);
|
|
150
|
+
|
|
151
|
+
return defaultBounds;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
private async tryGetWindowBasedBounds(windowId: string, commandId: string): Promise<IOConnectBrowser.Windows.Bounds | undefined> {
|
|
155
|
+
const win = this.glueController.clientGlue.windows.findById(windowId);
|
|
156
|
+
|
|
157
|
+
const serverInstance = this.getServerInstanceByWindowId(windowId);
|
|
158
|
+
|
|
159
|
+
if (!win && !serverInstance) {
|
|
160
|
+
throw new Error(`Client with id "${windowId}" does not exist`);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
if (!win && serverInstance) {
|
|
164
|
+
return this.getWindowBoundsByServerInstance(serverInstance, windowId, commandId);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
if (!win) {
|
|
168
|
+
throw new Error(`Client with id "${windowId}" does not exist`);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
try {
|
|
172
|
+
const bounds = await win.getBounds();
|
|
173
|
+
|
|
174
|
+
this.logger?.trace(`[${commandId}] Opening the resolver UI with bounds: ${JSON.stringify(bounds)}, relative to a window with id: ${windowId}`);
|
|
175
|
+
|
|
176
|
+
return bounds;
|
|
177
|
+
} catch (error) {
|
|
178
|
+
this.logger?.trace(`[${commandId}] Failure to get bounds of a window with id ${windowId}. Error: ${JSON.stringify(error)}`);
|
|
179
|
+
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
private getServerInstanceByWindowId(windowId: string): IOConnectCore.AGM.Instance | undefined {
|
|
185
|
+
return this.glueController.clientGlue.interop.servers().find(server => server.instance === windowId);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
private async getWindowBoundsByServerInstance(serverInstance: IOConnectCore.Interop.Instance, windowId: string, commandId: string): Promise<IOConnectBrowser.Windows.Bounds | undefined> {
|
|
189
|
+
try {
|
|
190
|
+
const { bounds } = await this.glueController.callWindow<SimpleWindowCommand, WindowBoundsResult>("windows", this.windowsController.getBoundsOperation, { windowId }, { instance: serverInstance.instance as string });
|
|
191
|
+
|
|
192
|
+
return bounds;
|
|
193
|
+
} catch (error) {
|
|
194
|
+
this.logger?.trace(`[${commandId}] Failure to get bounds of a window with instance ${serverInstance.instance}. Error: ${JSON.stringify(error)}`);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
private async tryGetWorkspaceBasedBounds(windowId: string, commandId: string): Promise<IOConnectBrowser.Windows.Bounds | undefined> {
|
|
199
|
+
try {
|
|
200
|
+
const { bounds } = await this.workspacesController.getWorkspaceWindowFrameBounds({ itemId: windowId }, commandId);
|
|
201
|
+
|
|
202
|
+
this.logger?.trace(`[${commandId}] Opening the resolver UI relative to my workspace frame window bounds: ${JSON.stringify(bounds)}`);
|
|
203
|
+
|
|
204
|
+
return bounds;
|
|
205
|
+
} catch (error) {
|
|
206
|
+
this.logger?.trace(`[${commandId}] Failure to get my workspace frame window bounds. Error: ${JSON.stringify(error)}`);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
private responseHandler(args: any, callerId: IOConnectBrowser.Interop.Instance): void {
|
|
211
|
+
const response = intentResolverResponseDecoder.run(args);
|
|
212
|
+
|
|
213
|
+
const instanceId = callerId.instance;
|
|
214
|
+
|
|
215
|
+
if (response.ok) {
|
|
216
|
+
this.logger?.trace(`Intent Resolver instance with id ${instanceId} send a valid response: ${JSON.stringify(response.result)}`);
|
|
217
|
+
|
|
218
|
+
return this.intentsResolverResponsePromises[instanceId!].resolve(response.result);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
this.logger?.trace(`Intent Resolver instance with id ${instanceId} sent an invalid response. Error: ${JSON.stringify(response.error)}`);
|
|
222
|
+
|
|
223
|
+
this.intentsResolverResponsePromises[instanceId!].reject(response.error.message);
|
|
224
|
+
|
|
225
|
+
this.stopResolverInstance(instanceId!);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
private subscribeOnInstanceStopped(instance: IOConnectBrowser.AppManager.Instance): void {
|
|
229
|
+
const { application } = instance;
|
|
230
|
+
|
|
231
|
+
const unsub = application.onInstanceStopped((inst: IOConnectBrowser.AppManager.Instance) => {
|
|
232
|
+
if (inst.id !== instance.id) {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
const intentPromise = this.intentsResolverResponsePromises[inst.id];
|
|
237
|
+
|
|
238
|
+
if (!intentPromise) {
|
|
239
|
+
return unsub();
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
intentPromise.reject(`Cannot resolve raised intent ${intentPromise.intent} - User closed ${application.name} app without choosing an intent handler`);
|
|
243
|
+
|
|
244
|
+
this.cleanUpIntentResolverPromise(inst.id);
|
|
245
|
+
|
|
246
|
+
unsub();
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
private async cleanUpIntentResolverPromise(instanceId: string): Promise<void> {
|
|
251
|
+
const intentPromise = this.intentsResolverResponsePromises[instanceId];
|
|
252
|
+
|
|
253
|
+
if (!intentPromise) {
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// typings are wrong and mark unregister as a sync method
|
|
258
|
+
const unregisterPromise = this.glueController.clientGlue.interop.unregister(intentPromise.methodName) as unknown as Promise<void>;
|
|
259
|
+
|
|
260
|
+
unregisterPromise.catch((error) => this.logger?.warn(error));
|
|
261
|
+
|
|
262
|
+
delete this.intentsResolverResponsePromises[instanceId];
|
|
263
|
+
}
|
|
264
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { IOConnectBrowser } from "@interopio/browser";
|
|
2
|
+
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
4
|
+
export type IntentsOperationTypes = "findIntent" | "getIntents" | "raiseIntent" | "operationCheck" | "raise";
|
|
5
|
+
|
|
6
|
+
export type IntentRequestResolverConfig = {
|
|
7
|
+
enabled?: boolean;
|
|
8
|
+
appName: string;
|
|
9
|
+
waitResponseTimeout: number
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type ResolverInstance = {
|
|
13
|
+
instanceId?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type ShouldResolverOpen = {
|
|
17
|
+
open: boolean;
|
|
18
|
+
reason?: string
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type IntentRequestTarget = "startNew" | "reuse" | { app?: string; instance?: string };
|
|
22
|
+
|
|
23
|
+
export interface IntentRequest {
|
|
24
|
+
intent: string;
|
|
25
|
+
target?: IntentRequestTarget;
|
|
26
|
+
context?: IOConnectBrowser.Intents.IntentContext;
|
|
27
|
+
options?: IOConnectBrowser.AppManager.ApplicationStartOptions;
|
|
28
|
+
handlers?: IOConnectBrowser.Intents.IntentHandler[];
|
|
29
|
+
timeout?: number,
|
|
30
|
+
waitUserResponseIndefinitely?: boolean;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface WaitForMethodOptions {
|
|
34
|
+
instanceId?: string;
|
|
35
|
+
waitTimeoutMs?: number;
|
|
36
|
+
errorMsg?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface ResolverIntentHandler {
|
|
40
|
+
applicationName: string;
|
|
41
|
+
applicationIcon?: string;
|
|
42
|
+
instanceId?: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface RaiseIntentRequestWithResolverConfig {
|
|
46
|
+
intentRequest: IntentRequest;
|
|
47
|
+
resolverConfig: IntentRequestResolverConfig;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface IntentInfo {
|
|
51
|
+
name: string;
|
|
52
|
+
displayName?: string;
|
|
53
|
+
contexts: string[];
|
|
54
|
+
resultType?: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface AppDefinitionWithIntents {
|
|
58
|
+
name: string;
|
|
59
|
+
title: string;
|
|
60
|
+
caption?: string;
|
|
61
|
+
icon?: string;
|
|
62
|
+
intents: IntentInfo[];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface IntentStore {
|
|
66
|
+
[name: string]: IOConnectBrowser.Intents.IntentHandler[];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface WrappedIntentFilter {
|
|
70
|
+
filter?: IOConnectBrowser.Intents.IntentFilter;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface WrappedIntents {
|
|
74
|
+
intents: IOConnectBrowser.Intents.Intent[];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface IntentsResolverResponse {
|
|
78
|
+
intent: string;
|
|
79
|
+
handler: IOConnectBrowser.Intents.IntentHandler;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface IntentsResolverResponsePromise {
|
|
83
|
+
intent: string;
|
|
84
|
+
methodName: string;
|
|
85
|
+
promise: Promise<IntentsResolverResponse>;
|
|
86
|
+
resolve: (arg: IntentsResolverResponse) => void;
|
|
87
|
+
reject: (reason: string) => void;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface IntentsResolverStartContext {
|
|
91
|
+
intent: string | IOConnectBrowser.Intents.IntentRequest;
|
|
92
|
+
callerId: string;
|
|
93
|
+
methodName: string;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface IntentResolverResponse {
|
|
97
|
+
intent: string;
|
|
98
|
+
handler: IOConnectBrowser.Intents.IntentHandler;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface IntentResolverTarget {
|
|
102
|
+
app?: string;
|
|
103
|
+
instance?: string;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface StartResolverAppArgs {
|
|
107
|
+
requestWithResolverInfo: RaiseIntentRequestWithResolverConfig;
|
|
108
|
+
callerId: string;
|
|
109
|
+
commandId: string;
|
|
110
|
+
resolverInstance?: ResolverInstance;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface CoreRaiseIntentArgs {
|
|
114
|
+
request: RaiseIntentRequestWithResolverConfig;
|
|
115
|
+
resolverInstance: ResolverInstance;
|
|
116
|
+
timeout: number;
|
|
117
|
+
commandId: string;
|
|
118
|
+
callerId: string
|
|
119
|
+
}
|