@openfin/core 30.73.5 → 30.73.7
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/OpenFin.d.ts +1 -1729
- package/fin.d.ts +3 -4
- package/package.json +1 -1
- package/src/GlobalOpenFin.d.ts +4 -0
- package/src/OpenFin.d.ts +2938 -0
- package/src/OpenFin.js +4 -0
- package/src/api/application/Factory.d.ts +2 -0
- package/src/api/application/Factory.js +4 -3
- package/src/api/application/Instance.d.ts +3 -1
- package/src/api/application/Instance.js +1 -0
- package/src/api/application/index.js +7 -3
- package/src/api/base.d.ts +19 -15
- package/src/api/base.js +20 -22
- package/src/api/clipboard/index.d.ts +2 -0
- package/src/api/clipboard/index.js +1 -0
- package/src/api/events/application.d.ts +66 -56
- package/src/api/events/base.d.ts +33 -15
- package/src/api/events/channel.d.ts +13 -8
- package/src/api/events/eventAggregator.js +1 -9
- package/src/api/events/externalApplication.d.ts +10 -5
- package/src/api/events/frame.d.ts +13 -7
- package/src/api/events/globalHotkey.d.ts +11 -10
- package/src/api/events/platform.d.ts +10 -16
- package/src/api/events/system.d.ts +48 -18
- package/src/api/events/typedEventEmitter.d.ts +20 -0
- package/src/api/events/typedEventEmitter.js +2 -0
- package/src/api/events/view.d.ts +38 -54
- package/src/api/events/webcontents.d.ts +55 -28
- package/src/api/events/window.d.ts +148 -134
- package/src/api/external-application/Factory.d.ts +1 -0
- package/src/api/external-application/Instance.d.ts +2 -1
- package/src/api/external-application/index.js +7 -3
- package/src/api/fin.d.ts +3 -1
- package/src/api/fin.js +2 -2
- package/src/api/frame/Factory.d.ts +1 -0
- package/src/api/frame/Factory.js +2 -2
- package/src/api/frame/Instance.d.ts +3 -1
- package/src/api/frame/index.js +7 -3
- package/src/api/global-hotkey/index.d.ts +2 -2
- package/src/api/global-hotkey/index.js +6 -0
- package/src/api/interappbus/channel/channel.d.ts +6 -4
- package/src/api/interappbus/channel/channels-docs.d.ts +22 -0
- package/src/api/interappbus/channel/channels-docs.js +22 -0
- package/src/api/interappbus/channel/client.d.ts +2 -1
- package/src/api/interappbus/channel/client.js +24 -26
- package/src/api/interappbus/channel/connection-manager.d.ts +1 -0
- package/src/api/interappbus/channel/connection-manager.js +30 -28
- package/src/api/interappbus/channel/index.d.ts +6 -4
- package/src/api/interappbus/channel/index.js +34 -19
- package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +3 -1
- package/src/api/interappbus/channel/protocols/classic/strategy.js +21 -22
- package/src/api/interappbus/channel/protocols/index.d.ts +3 -0
- package/src/api/interappbus/channel/protocols/protocol-manager.d.ts +1 -1
- package/src/api/interappbus/channel/protocols/rtc/endpoint.d.ts +3 -1
- package/src/api/interappbus/channel/protocols/rtc/endpoint.js +25 -27
- package/src/api/interappbus/channel/protocols/rtc/ice-manager.js +0 -1
- package/src/api/interappbus/channel/protocols/rtc/strategy.d.ts +3 -1
- package/src/api/interappbus/channel/protocols/rtc/strategy.js +29 -31
- package/src/api/interappbus/channel/protocols/strategy.d.ts +3 -1
- package/src/api/interappbus/channel/provider.d.ts +8 -4
- package/src/api/interappbus/channel/provider.js +140 -139
- package/src/api/interappbus/index.js +1 -1
- package/src/api/interop/Factory.d.ts +2 -0
- package/src/api/interop/Factory.js +20 -2
- package/src/api/interop/InteropBroker.d.ts +62 -39
- package/src/api/interop/InteropBroker.js +114 -55
- package/src/api/interop/InteropClient.d.ts +9 -0
- package/src/api/interop/InteropClient.js +46 -40
- package/src/api/interop/SessionContextGroupBroker.d.ts +1 -0
- package/src/api/interop/SessionContextGroupClient.d.ts +1 -0
- package/src/api/interop/SessionContextGroupClient.js +22 -24
- package/src/api/interop/fdc3/PrivateChannelClient.d.ts +9 -7
- package/src/api/interop/fdc3/PrivateChannelClient.js +6 -6
- package/src/api/interop/fdc3/PrivateChannelProvider.d.ts +1 -0
- package/src/api/interop/fdc3/fdc3-1.2.d.ts +14 -13
- package/src/api/interop/fdc3/fdc3-1.2.js +3 -14
- package/src/api/interop/fdc3/fdc3-2.0.d.ts +24 -21
- package/src/api/interop/fdc3/fdc3-2.0.js +27 -27
- package/src/api/interop/fdc3/fdc3.d.ts +12 -0
- package/src/api/interop/fdc3/overrideCheck.d.ts +4 -0
- package/src/api/interop/fdc3/overrideCheck.js +32 -0
- package/src/api/interop/fdc3/shapes/fdc3v1.d.ts +53 -0
- package/src/api/interop/fdc3/shapes/fdc3v1.js +4 -0
- package/src/api/interop/fdc3/shapes/fdc3v2.d.ts +75 -0
- package/src/api/interop/fdc3/shapes/fdc3v2.js +2 -0
- package/src/api/interop/fdc3/utils.d.ts +15 -5
- package/src/api/interop/fdc3/utils.js +29 -11
- package/src/api/interop/fdc3/versions.d.ts +1 -0
- package/src/api/interop/fdc3/versions.js +2 -0
- package/src/api/interop/index.js +7 -3
- package/src/api/interop/utils.d.ts +2 -0
- package/src/api/interop/utils.js +29 -15
- package/src/api/me.d.ts +3 -1
- package/src/api/platform/Factory.d.ts +6 -0
- package/src/api/platform/Factory.js +14 -5
- package/src/api/platform/Instance.d.ts +18 -3
- package/src/api/platform/Instance.js +30 -13
- package/src/api/platform/common-utils.d.ts +2 -1
- package/src/api/platform/index.js +7 -3
- package/src/api/platform/layout/Factory.d.ts +7 -1
- package/src/api/platform/layout/Factory.js +22 -20
- package/src/api/platform/layout/Instance.d.ts +6 -4
- package/src/api/platform/layout/Instance.js +2 -3
- package/src/api/platform/layout/controllers/splitter-controller.js +1 -1
- package/src/api/platform/layout/controllers/tab-drag-controller.d.ts +1 -0
- package/src/api/platform/layout/controllers/tab-drag-controller.js +1 -1
- package/src/api/platform/layout/index.js +7 -3
- package/src/api/platform/layout/shapes.d.ts +3 -1
- package/src/api/platform/layout/utils/bounds-observer.d.ts +1 -1
- package/src/api/platform/layout/utils/bounds-observer.js +7 -5
- package/src/api/platform/layout/utils/view-overlay.d.ts +1 -0
- package/src/api/platform/provider.d.ts +162 -0
- package/src/api/platform/provider.js +2 -0
- package/src/api/snapshot-source/Factory.d.ts +2 -0
- package/src/api/snapshot-source/Factory.js +2 -1
- package/src/api/snapshot-source/Instance.d.ts +1 -0
- package/src/api/snapshot-source/Instance.js +33 -35
- package/src/api/snapshot-source/index.js +7 -3
- package/src/api/snapshot-source/utils.d.ts +1 -0
- package/src/api/snapshot-source/utils.js +2 -1
- package/src/api/system/index.d.ts +76 -16
- package/src/api/system/index.js +127 -3
- package/src/api/view/Factory.d.ts +1 -0
- package/src/api/view/Factory.js +2 -2
- package/src/api/view/Instance.d.ts +17 -3
- package/src/api/view/Instance.js +20 -0
- package/src/api/view/index.js +7 -3
- package/src/api/webcontents/main.d.ts +20 -5
- package/src/api/webcontents/main.js +10 -0
- package/src/api/window/Factory.d.ts +1 -0
- package/src/api/window/Factory.js +2 -2
- package/src/api/window/Instance.d.ts +26 -3
- package/src/api/window/Instance.js +26 -1
- package/src/api/window/index.js +7 -3
- package/src/browser.d.ts +4 -4
- package/src/environment/browser.d.ts +3 -1
- package/src/environment/environment.d.ts +3 -1
- package/src/environment/node-env.d.ts +3 -1
- package/src/environment/node-env.js +2 -2
- package/src/environment/openfin-env.d.ts +3 -1
- package/src/environment/openfin-env.js +15 -17
- package/src/fdc3.d.ts +3 -0
- package/src/fdc3.js +1 -1
- package/src/mock.d.ts +2 -2
- package/src/mock.js +3 -3
- package/src/namespaces.d.ts +21 -0
- package/src/namespaces.js +24 -0
- package/src/shapes/WebOptions.d.ts +1 -0
- package/src/shapes/WindowOptions.d.ts +1 -0
- package/src/shapes/protocol.d.ts +34 -26
- package/src/transport/transport.d.ts +6 -5
- package/src/transport/transport.js +26 -28
- package/src/transport/wire.d.ts +9 -7
- package/src/util/http.d.ts +1 -1
- package/src/util/http.js +16 -11
- package/src/util/inaccessibleObject.d.ts +2 -0
- package/src/util/inaccessibleObject.js +49 -0
- package/src/util/normalize-config.js +5 -5
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver,
|
|
3
|
-
if (
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return value;
|
|
2
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
8
7
|
};
|
|
9
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver,
|
|
10
|
-
if (!
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return privateMap.get(receiver);
|
|
8
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
14
12
|
};
|
|
15
|
-
var
|
|
13
|
+
var _InteropClient_clientPromise, _InteropClient_sessionContextGroups;
|
|
16
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
15
|
exports.InteropClient = void 0;
|
|
18
16
|
const base_1 = require("../base");
|
|
19
17
|
const SessionContextGroupClient_1 = require("./SessionContextGroupClient");
|
|
20
18
|
const utils_1 = require("./utils");
|
|
21
19
|
/**
|
|
20
|
+
* @PORTED
|
|
22
21
|
* @typedef { object } Intent
|
|
23
22
|
* @summary The combination of an action and a context that is passed to an application for resolution.
|
|
24
23
|
* @property { string } name Name of the intent.
|
|
25
24
|
* @property { Context } context Data associated with the intent
|
|
26
25
|
*/
|
|
27
26
|
/**
|
|
27
|
+
* @REMOVED
|
|
28
28
|
* @typedef { object } Subscription
|
|
29
29
|
* @summary Object returned when subscribing a handler.
|
|
30
30
|
* @property { function } unsubscribe Function to unsubscribe the handler.
|
|
@@ -38,6 +38,7 @@ const utils_1 = require("./utils");
|
|
|
38
38
|
* @summary Subscription function for registerIntentHandler
|
|
39
39
|
*/
|
|
40
40
|
/**
|
|
41
|
+
* @PORTED
|
|
41
42
|
* @typedef { object } ClientIdentity
|
|
42
43
|
* @summary The Identity for a Channel Client. Includes endpointId to differentiate between different connections for an entity.
|
|
43
44
|
* @property {string} uuid GUID of an application.
|
|
@@ -45,12 +46,14 @@ const utils_1 = require("./utils");
|
|
|
45
46
|
* @property {string} endpointId Unique differentiator for different Channel connections for an entity.
|
|
46
47
|
*/
|
|
47
48
|
/**
|
|
49
|
+
* @PORTED
|
|
48
50
|
* @typedef { object } ContextGroupInfo
|
|
49
51
|
* @summary Information for a Context Group. Contains metadata for displaying the group properly.
|
|
50
52
|
* @property {string} id Name of the context group
|
|
51
53
|
* @property {DisplayMetadata} displayMetadata Metadata for the Context Group. Contains the group's human-readable name, color, and an image, as defined by the Interop Broker.
|
|
52
54
|
*/
|
|
53
55
|
/**
|
|
56
|
+
* @PORTED
|
|
54
57
|
* @typedef { object } DisplayMetadata
|
|
55
58
|
* @summary The display data for a Context Group.
|
|
56
59
|
* @property {string} name A user-readable name for this context group, e.g: `"Red"`
|
|
@@ -58,6 +61,7 @@ const utils_1 = require("./utils");
|
|
|
58
61
|
* @property {string} [glyph] A URL of an image that can be used to display this context group
|
|
59
62
|
*/
|
|
60
63
|
/**
|
|
64
|
+
* @PORTED
|
|
61
65
|
* @typedef { object } Context
|
|
62
66
|
* @summary Data passed between entities and applications.
|
|
63
67
|
* @property {object} [id] An object containing string key-value pairs for the bulk of the data for the context. Differs between context types.
|
|
@@ -65,6 +69,7 @@ const utils_1 = require("./utils");
|
|
|
65
69
|
* @property {string} type Conserved type for the context (e.g. `instrument` or `country`)
|
|
66
70
|
*/
|
|
67
71
|
/**
|
|
72
|
+
* @REMOVED
|
|
68
73
|
* @typedef { object } ContextForIntent
|
|
69
74
|
* @summary Data passed between entities and applications, including an optional metadata.
|
|
70
75
|
* @property {object} [id] An object containing string key-value pairs for the bulk of the data for the context. Differs between context types.
|
|
@@ -73,6 +78,7 @@ const utils_1 = require("./utils");
|
|
|
73
78
|
* @property {any} [metadata]
|
|
74
79
|
*/
|
|
75
80
|
/**
|
|
81
|
+
* @REMOVED
|
|
76
82
|
* @typedef { object } SessionContextGroup
|
|
77
83
|
* @summary An instance of a SessionContextGroup
|
|
78
84
|
* @property {string} id The SessionContextGroup's id.
|
|
@@ -157,14 +163,14 @@ const utils_1 = require("./utils");
|
|
|
157
163
|
class InteropClient extends base_1.Base {
|
|
158
164
|
constructor(wire, name, interopConfig = {}) {
|
|
159
165
|
super(wire);
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
__classPrivateFieldSet(this,
|
|
163
|
-
__classPrivateFieldSet(this,
|
|
166
|
+
_InteropClient_clientPromise.set(this, void 0);
|
|
167
|
+
_InteropClient_sessionContextGroups.set(this, void 0);
|
|
168
|
+
__classPrivateFieldSet(this, _InteropClient_sessionContextGroups, new Map(), "f");
|
|
169
|
+
__classPrivateFieldSet(this, _InteropClient_clientPromise, this.wire.environment.whenReady().then(() => {
|
|
164
170
|
return this.fin.InterApplicationBus.Channel.connect(`interop-broker-${name}`, {
|
|
165
171
|
payload: interopConfig
|
|
166
172
|
});
|
|
167
|
-
}));
|
|
173
|
+
}), "f");
|
|
168
174
|
}
|
|
169
175
|
/*
|
|
170
176
|
Client APIs
|
|
@@ -179,7 +185,7 @@ class InteropClient extends base_1.Base {
|
|
|
179
185
|
this.wire.sendAction('interop-client-set-context').catch((e) => {
|
|
180
186
|
// don't expose, analytics-only call
|
|
181
187
|
});
|
|
182
|
-
const client = await __classPrivateFieldGet(this,
|
|
188
|
+
const client = await __classPrivateFieldGet(this, _InteropClient_clientPromise, "f");
|
|
183
189
|
return client.dispatch('setContext', { context });
|
|
184
190
|
}
|
|
185
191
|
/**
|
|
@@ -196,16 +202,16 @@ class InteropClient extends base_1.Base {
|
|
|
196
202
|
if (typeof handler !== 'function') {
|
|
197
203
|
throw new Error("Non-function argument passed to the first parameter 'handler'. Be aware that the argument order does not match the FDC3 standard.");
|
|
198
204
|
}
|
|
199
|
-
const client = await __classPrivateFieldGet(this,
|
|
205
|
+
const client = await __classPrivateFieldGet(this, _InteropClient_clientPromise, "f");
|
|
200
206
|
let handlerId;
|
|
201
207
|
if (contextType) {
|
|
202
|
-
handlerId = `invokeContextHandler-${contextType}-${utils_1.generateId()}`;
|
|
208
|
+
handlerId = `invokeContextHandler-${contextType}-${(0, utils_1.generateId)()}`;
|
|
203
209
|
console.warn(`Warning: By providing a contextType (${contextType}), you are using the experimental addContextHandler. To avoid issues, make sure you are adding your context handlers at the top level in your application.`);
|
|
204
210
|
}
|
|
205
211
|
else {
|
|
206
212
|
handlerId = 'invokeContextHandler';
|
|
207
213
|
}
|
|
208
|
-
const wrappedHandler = utils_1.wrapContextHandler(handler, handlerId);
|
|
214
|
+
const wrappedHandler = (0, utils_1.wrapContextHandler)(handler, handlerId);
|
|
209
215
|
client.register(handlerId, wrappedHandler);
|
|
210
216
|
await client.dispatch('contextHandlerRegistered', { handlerId, contextType });
|
|
211
217
|
return {
|
|
@@ -228,7 +234,7 @@ class InteropClient extends base_1.Base {
|
|
|
228
234
|
this.wire.sendAction('interop-client-get-context-groups').catch((e) => {
|
|
229
235
|
// don't expose, analytics-only call
|
|
230
236
|
});
|
|
231
|
-
const client = await __classPrivateFieldGet(this,
|
|
237
|
+
const client = await __classPrivateFieldGet(this, _InteropClient_clientPromise, "f");
|
|
232
238
|
return client.dispatch('getContextGroups');
|
|
233
239
|
}
|
|
234
240
|
/**
|
|
@@ -247,7 +253,7 @@ class InteropClient extends base_1.Base {
|
|
|
247
253
|
this.wire.sendAction('interop-client-join-context-group').catch((e) => {
|
|
248
254
|
// don't expose, analytics-only call
|
|
249
255
|
});
|
|
250
|
-
const client = await __classPrivateFieldGet(this,
|
|
256
|
+
const client = await __classPrivateFieldGet(this, _InteropClient_clientPromise, "f");
|
|
251
257
|
if (!contextGroupId) {
|
|
252
258
|
throw new Error('No contextGroupId specified for joinContextGroup.');
|
|
253
259
|
}
|
|
@@ -265,7 +271,7 @@ class InteropClient extends base_1.Base {
|
|
|
265
271
|
this.wire.sendAction('interop-client-remove-from-context-group').catch((e) => {
|
|
266
272
|
// don't expose, analytics-only call
|
|
267
273
|
});
|
|
268
|
-
const client = await __classPrivateFieldGet(this,
|
|
274
|
+
const client = await __classPrivateFieldGet(this, _InteropClient_clientPromise, "f");
|
|
269
275
|
return client.dispatch('removeFromContextGroup', { target });
|
|
270
276
|
}
|
|
271
277
|
/**
|
|
@@ -279,7 +285,7 @@ class InteropClient extends base_1.Base {
|
|
|
279
285
|
this.wire.sendAction('interop-client-get-all-clients-in-context-group').catch((e) => {
|
|
280
286
|
// don't expose, analytics-only call
|
|
281
287
|
});
|
|
282
|
-
const client = await __classPrivateFieldGet(this,
|
|
288
|
+
const client = await __classPrivateFieldGet(this, _InteropClient_clientPromise, "f");
|
|
283
289
|
if (!contextGroupId) {
|
|
284
290
|
throw new Error('No contextGroupId specified for getAllClientsInContextGroup.');
|
|
285
291
|
}
|
|
@@ -296,7 +302,7 @@ class InteropClient extends base_1.Base {
|
|
|
296
302
|
this.wire.sendAction('interop-client-get-info-for-context-group').catch((e) => {
|
|
297
303
|
// don't expose, analytics-only call
|
|
298
304
|
});
|
|
299
|
-
const client = await __classPrivateFieldGet(this,
|
|
305
|
+
const client = await __classPrivateFieldGet(this, _InteropClient_clientPromise, "f");
|
|
300
306
|
if (!contextGroupId) {
|
|
301
307
|
throw new Error('No contextGroupId specified for getInfoForContextGroup.');
|
|
302
308
|
}
|
|
@@ -313,7 +319,7 @@ class InteropClient extends base_1.Base {
|
|
|
313
319
|
this.wire.sendAction('interop-client-fire-intent').catch((e) => {
|
|
314
320
|
// don't expose, this is only for api analytics purposes
|
|
315
321
|
});
|
|
316
|
-
const client = await __classPrivateFieldGet(this,
|
|
322
|
+
const client = await __classPrivateFieldGet(this, _InteropClient_clientPromise, "f");
|
|
317
323
|
return client.dispatch('fireIntent', intent);
|
|
318
324
|
}
|
|
319
325
|
/**
|
|
@@ -328,9 +334,9 @@ class InteropClient extends base_1.Base {
|
|
|
328
334
|
this.wire.sendAction('interop-client-register-intent-handler').catch((e) => {
|
|
329
335
|
// don't expose, this is only for api analytics purposes
|
|
330
336
|
});
|
|
331
|
-
const client = await __classPrivateFieldGet(this,
|
|
337
|
+
const client = await __classPrivateFieldGet(this, _InteropClient_clientPromise, "f");
|
|
332
338
|
const handlerId = `intent-handler-${intentName}`;
|
|
333
|
-
const wrappedHandler = utils_1.wrapIntentHandler(handler, handlerId);
|
|
339
|
+
const wrappedHandler = (0, utils_1.wrapIntentHandler)(handler, handlerId);
|
|
334
340
|
try {
|
|
335
341
|
await client.register(handlerId, wrappedHandler);
|
|
336
342
|
await client.dispatch('intentHandlerRegistered', { handlerId, ...options });
|
|
@@ -356,7 +362,7 @@ class InteropClient extends base_1.Base {
|
|
|
356
362
|
this.wire.sendAction('interop-client-get-current-context').catch((e) => {
|
|
357
363
|
// don't expose, analytics-only call
|
|
358
364
|
});
|
|
359
|
-
const client = await __classPrivateFieldGet(this,
|
|
365
|
+
const client = await __classPrivateFieldGet(this, _InteropClient_clientPromise, "f");
|
|
360
366
|
return client.dispatch('getCurrentContext', { contextType });
|
|
361
367
|
}
|
|
362
368
|
/**
|
|
@@ -370,7 +376,7 @@ class InteropClient extends base_1.Base {
|
|
|
370
376
|
this.wire.sendAction('interop-client-get-info-for-intent').catch((e) => {
|
|
371
377
|
// don't expose, analytics-only call
|
|
372
378
|
});
|
|
373
|
-
const client = await __classPrivateFieldGet(this,
|
|
379
|
+
const client = await __classPrivateFieldGet(this, _InteropClient_clientPromise, "f");
|
|
374
380
|
return client.dispatch('getInfoForIntent', options);
|
|
375
381
|
}
|
|
376
382
|
/**
|
|
@@ -384,7 +390,7 @@ class InteropClient extends base_1.Base {
|
|
|
384
390
|
this.wire.sendAction('interop-client-get-info-for-intents-by-context').catch((e) => {
|
|
385
391
|
// don't expose, analytics-only call
|
|
386
392
|
});
|
|
387
|
-
const client = await __classPrivateFieldGet(this,
|
|
393
|
+
const client = await __classPrivateFieldGet(this, _InteropClient_clientPromise, "f");
|
|
388
394
|
return client.dispatch('getInfoForIntentsByContext', context);
|
|
389
395
|
}
|
|
390
396
|
/**
|
|
@@ -399,7 +405,7 @@ class InteropClient extends base_1.Base {
|
|
|
399
405
|
this.wire.sendAction('interop-client-fire-intent-for-context').catch((e) => {
|
|
400
406
|
// don't expose, analytics-only call
|
|
401
407
|
});
|
|
402
|
-
const client = await __classPrivateFieldGet(this,
|
|
408
|
+
const client = await __classPrivateFieldGet(this, _InteropClient_clientPromise, "f");
|
|
403
409
|
return client.dispatch('fireIntentForContext', context);
|
|
404
410
|
}
|
|
405
411
|
/**
|
|
@@ -413,19 +419,19 @@ class InteropClient extends base_1.Base {
|
|
|
413
419
|
*/
|
|
414
420
|
async joinSessionContextGroup(sessionContextGroupId) {
|
|
415
421
|
try {
|
|
416
|
-
const currentSessionContextGroup = __classPrivateFieldGet(this,
|
|
422
|
+
const currentSessionContextGroup = __classPrivateFieldGet(this, _InteropClient_sessionContextGroups, "f").get(sessionContextGroupId);
|
|
417
423
|
if (currentSessionContextGroup) {
|
|
418
424
|
return currentSessionContextGroup.getUserInstance();
|
|
419
425
|
}
|
|
420
|
-
const client = await __classPrivateFieldGet(this,
|
|
426
|
+
const client = await __classPrivateFieldGet(this, _InteropClient_clientPromise, "f");
|
|
421
427
|
const { hasConflict } = await client.dispatch('sessionContextGroup:createIfNeeded', {
|
|
422
428
|
sessionContextGroupId
|
|
423
429
|
});
|
|
424
430
|
if (hasConflict) {
|
|
425
431
|
console.warn(`A (non-session) context group with the name "${sessionContextGroupId}" already exists. If you are trying to join a Context Group, call joinContextGroup instead.`);
|
|
426
432
|
}
|
|
427
|
-
const newSessionContextGroup = new SessionContextGroupClient_1.default(this.wire, __classPrivateFieldGet(this,
|
|
428
|
-
__classPrivateFieldGet(this,
|
|
433
|
+
const newSessionContextGroup = new SessionContextGroupClient_1.default(this.wire, __classPrivateFieldGet(this, _InteropClient_clientPromise, "f"), sessionContextGroupId);
|
|
434
|
+
__classPrivateFieldGet(this, _InteropClient_sessionContextGroups, "f").set(sessionContextGroupId, newSessionContextGroup);
|
|
429
435
|
return newSessionContextGroup.getUserInstance();
|
|
430
436
|
}
|
|
431
437
|
catch (error) {
|
|
@@ -444,7 +450,7 @@ class InteropClient extends base_1.Base {
|
|
|
444
450
|
this.wire.sendAction('interop-client-add-ondisconnection-listener').catch((e) => {
|
|
445
451
|
// don't expose, analytics-only call
|
|
446
452
|
});
|
|
447
|
-
const client = await __classPrivateFieldGet(this,
|
|
453
|
+
const client = await __classPrivateFieldGet(this, _InteropClient_clientPromise, "f");
|
|
448
454
|
return client.onDisconnection((event) => {
|
|
449
455
|
const { uuid } = event;
|
|
450
456
|
listener({ type: 'interop-broker', topic: 'disconnected', brokerName: uuid });
|
|
@@ -452,9 +458,9 @@ class InteropClient extends base_1.Base {
|
|
|
452
458
|
}
|
|
453
459
|
// used to ferry fdc3-only calls from the fdc3 shim to the Interop Broker
|
|
454
460
|
static async ferryFdc3Call(interopClient, action, payload) {
|
|
455
|
-
const client = await __classPrivateFieldGet(interopClient,
|
|
461
|
+
const client = await __classPrivateFieldGet(interopClient, _InteropClient_clientPromise, "f");
|
|
456
462
|
return client.dispatch(action, payload || null);
|
|
457
463
|
}
|
|
458
464
|
}
|
|
459
465
|
exports.InteropClient = InteropClient;
|
|
460
|
-
|
|
466
|
+
_InteropClient_clientPromise = new WeakMap(), _InteropClient_sessionContextGroups = new WeakMap();
|
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver,
|
|
3
|
-
if (
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return value;
|
|
2
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
8
7
|
};
|
|
9
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver,
|
|
10
|
-
if (!
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return privateMap.get(receiver);
|
|
8
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
14
12
|
};
|
|
15
|
-
var
|
|
13
|
+
var _SessionContextGroupClient_clientPromise;
|
|
16
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
15
|
const base_1 = require("../base");
|
|
18
16
|
const utils_1 = require("./utils");
|
|
19
17
|
class SessionContextGroupClient extends base_1.Base {
|
|
20
18
|
constructor(wire, client, id) {
|
|
21
19
|
super(wire);
|
|
22
|
-
|
|
20
|
+
_SessionContextGroupClient_clientPromise.set(this, void 0);
|
|
23
21
|
this.id = id;
|
|
24
|
-
__classPrivateFieldSet(this,
|
|
22
|
+
__classPrivateFieldSet(this, _SessionContextGroupClient_clientPromise, client, "f");
|
|
25
23
|
}
|
|
26
24
|
/**
|
|
27
25
|
* Sets a context for the session context group.
|
|
@@ -33,7 +31,7 @@ class SessionContextGroupClient extends base_1.Base {
|
|
|
33
31
|
this.wire.sendAction('interop-session-context-group-set-context').catch((e) => {
|
|
34
32
|
// don't expose, analytics-only call
|
|
35
33
|
});
|
|
36
|
-
const client = await __classPrivateFieldGet(this,
|
|
34
|
+
const client = await __classPrivateFieldGet(this, _SessionContextGroupClient_clientPromise, "f");
|
|
37
35
|
return client.dispatch(`sessionContextGroup:setContext-${this.id}`, {
|
|
38
36
|
sessionContextGroupId: this.id,
|
|
39
37
|
context
|
|
@@ -43,7 +41,7 @@ class SessionContextGroupClient extends base_1.Base {
|
|
|
43
41
|
this.wire.sendAction('interop-session-context-group-get-context').catch((e) => {
|
|
44
42
|
// don't expose, analytics-only call
|
|
45
43
|
});
|
|
46
|
-
const client = await __classPrivateFieldGet(this,
|
|
44
|
+
const client = await __classPrivateFieldGet(this, _SessionContextGroupClient_clientPromise, "f");
|
|
47
45
|
return client.dispatch(`sessionContextGroup:getContext-${this.id}`, {
|
|
48
46
|
sessionContextGroupId: this.id,
|
|
49
47
|
type
|
|
@@ -56,20 +54,20 @@ class SessionContextGroupClient extends base_1.Base {
|
|
|
56
54
|
if (typeof contextHandler !== 'function') {
|
|
57
55
|
throw new Error("Non-function argument passed to the first parameter 'handler'. Be aware that the argument order does not match the FDC3 standard.");
|
|
58
56
|
}
|
|
59
|
-
const client = await __classPrivateFieldGet(this,
|
|
57
|
+
const client = await __classPrivateFieldGet(this, _SessionContextGroupClient_clientPromise, "f");
|
|
60
58
|
let handlerId;
|
|
61
59
|
if (contextType) {
|
|
62
|
-
handlerId = `sessionContextHandler:invoke-${this.id}-${contextType}-${utils_1.generateId()}`;
|
|
60
|
+
handlerId = `sessionContextHandler:invoke-${this.id}-${contextType}-${(0, utils_1.generateId)()}`;
|
|
63
61
|
}
|
|
64
62
|
else {
|
|
65
63
|
handlerId = `sessionContextHandler:invoke-${this.id}`;
|
|
66
64
|
}
|
|
67
|
-
client.register(handlerId, utils_1.wrapContextHandler(contextHandler, handlerId));
|
|
65
|
+
client.register(handlerId, (0, utils_1.wrapContextHandler)(contextHandler, handlerId));
|
|
68
66
|
client.dispatch(`sessionContextGroup:handlerAdded-${this.id}`, { handlerId, contextType });
|
|
69
67
|
return { unsubscribe: await this.createUnsubscribeCb(handlerId) };
|
|
70
68
|
}
|
|
71
69
|
async createUnsubscribeCb(handlerId) {
|
|
72
|
-
const client = await __classPrivateFieldGet(this,
|
|
70
|
+
const client = await __classPrivateFieldGet(this, _SessionContextGroupClient_clientPromise, "f");
|
|
73
71
|
return async () => {
|
|
74
72
|
client.remove(handlerId);
|
|
75
73
|
await client.dispatch(`sessionContextGroup:handlerRemoved-${this.id}`, { handlerId });
|
|
@@ -78,11 +76,11 @@ class SessionContextGroupClient extends base_1.Base {
|
|
|
78
76
|
getUserInstance() {
|
|
79
77
|
return {
|
|
80
78
|
id: this.id,
|
|
81
|
-
setContext: utils_1.wrapInTryCatch(this.setContext.bind(this), 'Failed to set context: '),
|
|
82
|
-
getCurrentContext: utils_1.wrapInTryCatch(this.getCurrentContext.bind(this), 'Failed to get context: '),
|
|
83
|
-
addContextHandler: utils_1.wrapInTryCatch(this.addContextHandler.bind(this), 'Failed to add context handler: ')
|
|
79
|
+
setContext: (0, utils_1.wrapInTryCatch)(this.setContext.bind(this), 'Failed to set context: '),
|
|
80
|
+
getCurrentContext: (0, utils_1.wrapInTryCatch)(this.getCurrentContext.bind(this), 'Failed to get context: '),
|
|
81
|
+
addContextHandler: (0, utils_1.wrapInTryCatch)(this.addContextHandler.bind(this), 'Failed to add context handler: ')
|
|
84
82
|
};
|
|
85
83
|
}
|
|
86
84
|
}
|
|
87
85
|
exports.default = SessionContextGroupClient;
|
|
88
|
-
|
|
86
|
+
_SessionContextGroupClient_clientPromise = new WeakMap();
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
+
import type * as OpenFin from '../../../OpenFin';
|
|
2
|
+
import type { Listener, Context, ContextHandler } from './shapes/fdc3v2';
|
|
1
3
|
declare type HandlerId = string;
|
|
2
4
|
export declare class PrivateChannelClient {
|
|
3
5
|
id: string;
|
|
4
6
|
client: OpenFin.ChannelClient;
|
|
5
|
-
listeners: Map<HandlerId,
|
|
7
|
+
listeners: Map<HandlerId, Listener>;
|
|
6
8
|
constructor(client: OpenFin.ChannelClient, id: string);
|
|
7
|
-
broadcast(context:
|
|
8
|
-
getCurrentContext(contextType?: string): Promise<
|
|
9
|
-
addContextListener(contextType: string | null, handler:
|
|
9
|
+
broadcast(context: Context): Promise<void>;
|
|
10
|
+
getCurrentContext(contextType?: string): Promise<Context | null>;
|
|
11
|
+
addContextListener(contextType: string | null, handler: ContextHandler): Promise<Listener>;
|
|
10
12
|
private createNonStandardUnsubscribeCb;
|
|
11
13
|
private createContextUnsubscribeCb;
|
|
12
|
-
onAddContextListener(handler: (contextType?: string) => void):
|
|
13
|
-
onDisconnect(handler: () => void):
|
|
14
|
-
onUnsubscribe(handler: (contextType?: string) => void):
|
|
14
|
+
onAddContextListener(handler: (contextType?: string) => void): Listener;
|
|
15
|
+
onDisconnect(handler: () => void): Listener;
|
|
16
|
+
onUnsubscribe(handler: (contextType?: string) => void): Listener;
|
|
15
17
|
disconnect(): Promise<void>;
|
|
16
18
|
}
|
|
17
19
|
export {};
|
|
@@ -20,12 +20,12 @@ class PrivateChannelClient {
|
|
|
20
20
|
}
|
|
21
21
|
let handlerId;
|
|
22
22
|
if (contextType) {
|
|
23
|
-
handlerId = `contextHandler:invoke-${this.id}-${contextType}-${utils_1.generateId()}`;
|
|
23
|
+
handlerId = `contextHandler:invoke-${this.id}-${contextType}-${(0, utils_1.generateId)()}`;
|
|
24
24
|
}
|
|
25
25
|
else {
|
|
26
|
-
handlerId = `contextHandler:invoke-${this.id}-${utils_1.generateId()}`;
|
|
26
|
+
handlerId = `contextHandler:invoke-${this.id}-${(0, utils_1.generateId)()}`;
|
|
27
27
|
}
|
|
28
|
-
this.client.register(handlerId, utils_1.wrapContextHandler(handler, handlerId));
|
|
28
|
+
this.client.register(handlerId, (0, utils_1.wrapContextHandler)(handler, handlerId));
|
|
29
29
|
const listener = { unsubscribe: await this.createContextUnsubscribeCb(handlerId) };
|
|
30
30
|
this.listeners.set(handlerId, listener);
|
|
31
31
|
await this.client.dispatch(`contextHandlerAdded`, { handlerId, contextType });
|
|
@@ -46,7 +46,7 @@ class PrivateChannelClient {
|
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
onAddContextListener(handler) {
|
|
49
|
-
const handlerId = `onContextHandlerAdded:invoke-${this.id}-${utils_1.generateId()}`;
|
|
49
|
+
const handlerId = `onContextHandlerAdded:invoke-${this.id}-${(0, utils_1.generateId)()}`;
|
|
50
50
|
this.client.register(handlerId, handler);
|
|
51
51
|
const listener = { unsubscribe: this.createNonStandardUnsubscribeCb(handlerId) };
|
|
52
52
|
this.listeners.set(handlerId, listener);
|
|
@@ -54,7 +54,7 @@ class PrivateChannelClient {
|
|
|
54
54
|
return listener;
|
|
55
55
|
}
|
|
56
56
|
onDisconnect(handler) {
|
|
57
|
-
const handlerId = `onDisconnect:invoke-${this.id}-${utils_1.generateId()}`;
|
|
57
|
+
const handlerId = `onDisconnect:invoke-${this.id}-${(0, utils_1.generateId)()}`;
|
|
58
58
|
this.client.register(handlerId, handler);
|
|
59
59
|
const listener = { unsubscribe: this.createNonStandardUnsubscribeCb(handlerId) };
|
|
60
60
|
this.listeners.set(handlerId, listener);
|
|
@@ -62,7 +62,7 @@ class PrivateChannelClient {
|
|
|
62
62
|
return listener;
|
|
63
63
|
}
|
|
64
64
|
onUnsubscribe(handler) {
|
|
65
|
-
const handlerId = `onUnsubscribe:invoke-${this.id}-${utils_1.generateId()}`;
|
|
65
|
+
const handlerId = `onUnsubscribe:invoke-${this.id}-${(0, utils_1.generateId)()}`;
|
|
66
66
|
this.client.register(handlerId, handler);
|
|
67
67
|
const listener = { unsubscribe: this.createNonStandardUnsubscribeCb(handlerId) };
|
|
68
68
|
this.listeners.set(handlerId, listener);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type * as FDC3v1 from './shapes/fdc3v1';
|
|
1
2
|
import { Base } from '../../base';
|
|
2
3
|
/**
|
|
3
4
|
* @typedef { object } Listener
|
|
@@ -88,7 +89,7 @@ import { Base } from '../../base';
|
|
|
88
89
|
* }
|
|
89
90
|
* ```
|
|
90
91
|
*/
|
|
91
|
-
export default class Fdc3Module extends Base implements
|
|
92
|
+
export default class Fdc3Module extends Base implements FDC3v1.DesktopAgent {
|
|
92
93
|
/**
|
|
93
94
|
* Add a context handler for incoming context. If an entity is part of a context group, and then sets its context handler, it will receive all of its declared contexts. If you wish to listen for all incoming contexts, pass `null` for the contextType argument.
|
|
94
95
|
* @param { string | null } contextType - The type of context you wish to handle.
|
|
@@ -97,7 +98,7 @@ export default class Fdc3Module extends Base implements FDC3.DesktopAgent {
|
|
|
97
98
|
* @tutorial fdc3.addContextListener
|
|
98
99
|
* @static
|
|
99
100
|
*/
|
|
100
|
-
addContextListener(contextType: string | null, handler:
|
|
101
|
+
addContextListener(contextType: string | null, handler: FDC3v1.ContextHandler): FDC3v1.Listener & Promise<FDC3v1.Listener>;
|
|
101
102
|
/**
|
|
102
103
|
* Broadcasts a context for the channel of the current entity.
|
|
103
104
|
* @param { Context } context - New context to set.
|
|
@@ -105,14 +106,14 @@ export default class Fdc3Module extends Base implements FDC3.DesktopAgent {
|
|
|
105
106
|
* @tutorial fdc3.broadcast
|
|
106
107
|
* @static
|
|
107
108
|
*/
|
|
108
|
-
broadcast(context:
|
|
109
|
+
broadcast(context: FDC3v1.Context): Promise<void>;
|
|
109
110
|
/**
|
|
110
111
|
* Returns the Interop-Broker-defined context groups available for an entity to join.
|
|
111
112
|
* @returns { Promise<Channel[]>}
|
|
112
113
|
* @tutorial fdc3.getSystemChannels
|
|
113
114
|
* @static
|
|
114
115
|
*/
|
|
115
|
-
getSystemChannels(): Promise<
|
|
116
|
+
getSystemChannels(): Promise<FDC3v1.SystemChannel[]>;
|
|
116
117
|
/**
|
|
117
118
|
* Join all Interop Clients at the given identity to context group `contextGroupId`.
|
|
118
119
|
* If no target is specified, it adds the sender to the context group.
|
|
@@ -141,7 +142,7 @@ export default class Fdc3Module extends Base implements FDC3.DesktopAgent {
|
|
|
141
142
|
* @tutorial fdc3.addIntentListener
|
|
142
143
|
* @static
|
|
143
144
|
*/
|
|
144
|
-
addIntentListener(intent: string, handler:
|
|
145
|
+
addIntentListener(intent: string, handler: FDC3v1.ContextHandler): FDC3v1.Listener & Promise<FDC3v1.Listener>;
|
|
145
146
|
/**
|
|
146
147
|
* Raises a specific intent.
|
|
147
148
|
* @param { string } intent Name of the Intent.
|
|
@@ -151,13 +152,13 @@ export default class Fdc3Module extends Base implements FDC3.DesktopAgent {
|
|
|
151
152
|
* @tutorial fdc3.raiseIntent
|
|
152
153
|
* @static
|
|
153
154
|
*/
|
|
154
|
-
raiseIntent(intent: string, context:
|
|
155
|
+
raiseIntent(intent: string, context: FDC3v1.Context, app?: FDC3v1.TargetApp): Promise<FDC3v1.IntentResolution>;
|
|
155
156
|
/**
|
|
156
157
|
* Returns the Channel that the entity is subscribed to. Returns null if not joined to a channel.
|
|
157
158
|
* @returns { Channel | null }
|
|
158
159
|
* @tutorial fdc3.getCurrentChannel
|
|
159
160
|
*/
|
|
160
|
-
getCurrentChannel(): Promise<
|
|
161
|
+
getCurrentChannel(): Promise<FDC3v1.Channel | null>;
|
|
161
162
|
/**
|
|
162
163
|
* Find out more information about a particular intent by passing its name, and optionally its context.
|
|
163
164
|
* @param { string } intent Name of the Intent
|
|
@@ -165,14 +166,14 @@ export default class Fdc3Module extends Base implements FDC3.DesktopAgent {
|
|
|
165
166
|
* @return { Promise<AppIntent> }
|
|
166
167
|
* @tutorial fdc3.findIntent
|
|
167
168
|
*/
|
|
168
|
-
findIntent(intent: string, context?:
|
|
169
|
+
findIntent(intent: string, context?: FDC3v1.Context): Promise<FDC3v1.AppIntent>;
|
|
169
170
|
/**
|
|
170
171
|
* Find all the available intents for a particular context.
|
|
171
172
|
* @param { Context } context
|
|
172
173
|
* @return { Promise<Array<AppIntent>> }
|
|
173
174
|
* @tutorial fdc3.findIntentsByContext
|
|
174
175
|
*/
|
|
175
|
-
findIntentsByContext(context:
|
|
176
|
+
findIntentsByContext(context: FDC3v1.Context): Promise<Array<FDC3v1.AppIntent>>;
|
|
176
177
|
/**
|
|
177
178
|
* Finds and raises an intent against a target app based purely on context data.
|
|
178
179
|
* @param { Context } context
|
|
@@ -180,20 +181,20 @@ export default class Fdc3Module extends Base implements FDC3.DesktopAgent {
|
|
|
180
181
|
* @return { Promise<IntentResolution> }
|
|
181
182
|
* @tutorial fdc3.raiseIntentForContext
|
|
182
183
|
*/
|
|
183
|
-
raiseIntentForContext(context:
|
|
184
|
+
raiseIntentForContext(context: FDC3v1.Context, app?: FDC3v1.TargetApp): Promise<FDC3v1.IntentResolution>;
|
|
184
185
|
/**
|
|
185
186
|
* Returns a Channel object for the specified channel, creating it as an App Channel if it does not exist.
|
|
186
187
|
* @param channelId
|
|
187
188
|
* @returns { Promise<Channel> }
|
|
188
189
|
* @tutorial fdc3.getOrCreateChannel
|
|
189
190
|
*/
|
|
190
|
-
getOrCreateChannel(channelId: string): Promise<
|
|
191
|
+
getOrCreateChannel(channelId: string): Promise<FDC3v1.Channel>;
|
|
191
192
|
/**
|
|
192
193
|
* Returns metadata relating to the FDC3 object and its provider, including the supported version of the FDC3 specification and the name of the provider of the implementation.
|
|
193
194
|
* @return { Promise<ImplementationMetadata> }
|
|
194
195
|
* @tutorial fdc3.getInfo
|
|
195
196
|
*/
|
|
196
|
-
getInfo():
|
|
197
|
+
getInfo(): FDC3v1.ImplementationMetadata;
|
|
197
198
|
/**
|
|
198
199
|
* Launches an app with target information, which can either be a string or an AppMetadata object.
|
|
199
200
|
* @param { TargetApp } app
|
|
@@ -201,7 +202,7 @@ export default class Fdc3Module extends Base implements FDC3.DesktopAgent {
|
|
|
201
202
|
* @return { Promise<void> }
|
|
202
203
|
* @tutorial fdc3.open
|
|
203
204
|
*/
|
|
204
|
-
open(app:
|
|
205
|
+
open(app: FDC3v1.TargetApp, context?: FDC3v1.Context): Promise<void>;
|
|
205
206
|
private getCurrentContextGroupInfo;
|
|
206
207
|
private buildChannelObject;
|
|
207
208
|
}
|
|
@@ -143,21 +143,10 @@ class Fdc3Module extends base_1.Base {
|
|
|
143
143
|
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
144
144
|
});
|
|
145
145
|
const channels = await this.fin.me.interop.getContextGroups();
|
|
146
|
-
const unsupportedChannelApis = {
|
|
147
|
-
addContextListener: () => {
|
|
148
|
-
throw new utils_1.UnsupportedChannelApiError('Channel.addContextListener');
|
|
149
|
-
},
|
|
150
|
-
broadcast: () => {
|
|
151
|
-
throw new utils_1.UnsupportedChannelApiError('Channel.broadcast');
|
|
152
|
-
},
|
|
153
|
-
getCurrentChannel: () => {
|
|
154
|
-
throw new utils_1.UnsupportedChannelApiError('Channel.getCurrentChannel');
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
146
|
// fdc3 implementation of getSystemChannels returns on array of channels, have to decorate over
|
|
158
147
|
// this so people know that these APIs are not supported
|
|
159
148
|
return channels.map((channel) => {
|
|
160
|
-
return { ...channel, type: 'system', ...
|
|
149
|
+
return { ...channel, type: 'system', ...(0, utils_1.getUnsupportedChannelApis)() };
|
|
161
150
|
});
|
|
162
151
|
}
|
|
163
152
|
/**
|
|
@@ -329,7 +318,7 @@ class Fdc3Module extends base_1.Base {
|
|
|
329
318
|
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
330
319
|
});
|
|
331
320
|
const sessionContextGroup = await this.fin.me.interop.joinSessionContextGroup(channelId);
|
|
332
|
-
return utils_1.buildAppChannelObject(sessionContextGroup);
|
|
321
|
+
return (0, utils_1.buildAppChannelObject)(sessionContextGroup);
|
|
333
322
|
}
|
|
334
323
|
/**
|
|
335
324
|
* Returns metadata relating to the FDC3 object and its provider, including the supported version of the FDC3 specification and the name of the provider of the implementation.
|
|
@@ -362,7 +351,7 @@ class Fdc3Module extends base_1.Base {
|
|
|
362
351
|
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
363
352
|
});
|
|
364
353
|
try {
|
|
365
|
-
return await InteropClient_1.InteropClient.ferryFdc3Call(fin.me.interop, 'fdc3Open', { app, context });
|
|
354
|
+
return await InteropClient_1.InteropClient.ferryFdc3Call(this.fin.me.interop, 'fdc3Open', { app, context });
|
|
366
355
|
}
|
|
367
356
|
catch (error) {
|
|
368
357
|
const errorToThrow = error.message === utils_2.BROKER_ERRORS.fdc3Open ? 'ResolverUnavailable' : error;
|