@openfin/core 27.70.10 → 27.70.13
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/package.json
CHANGED
|
@@ -208,7 +208,7 @@ export declare class InteropClient extends Base {
|
|
|
208
208
|
* @tutorial interop.fireIntent
|
|
209
209
|
* @experimental
|
|
210
210
|
*/
|
|
211
|
-
fireIntent(intent: OpenFin.Intent): Promise<
|
|
211
|
+
fireIntent<T = unknown>(intent: OpenFin.Intent): Promise<T>;
|
|
212
212
|
/**
|
|
213
213
|
* Adds an intent handler for incoming intents. The last intent sent of the name subscribed to will be received.
|
|
214
214
|
* @param { IntentHandler } handler - Registered function meant to handle a specific intent type.
|
|
@@ -236,7 +236,7 @@ export declare class InteropClient extends Base {
|
|
|
236
236
|
* @tutorial interop.getInfoForIntent
|
|
237
237
|
* @experimental
|
|
238
238
|
*/
|
|
239
|
-
getInfoForIntent(options: OpenFin.InfoForIntentOptions): Promise<
|
|
239
|
+
getInfoForIntent<T = unknown>(options: OpenFin.InfoForIntentOptions): Promise<T>;
|
|
240
240
|
/**
|
|
241
241
|
* Get information from the Interop Broker on all Intents that are meant to handle a particular context.
|
|
242
242
|
* @param { Context } context
|
|
@@ -244,7 +244,7 @@ export declare class InteropClient extends Base {
|
|
|
244
244
|
* @tutorial interop.getInfoForIntentsByContext
|
|
245
245
|
* @experimental
|
|
246
246
|
*/
|
|
247
|
-
getInfoForIntentsByContext(context: OpenFin.Context): Promise<
|
|
247
|
+
getInfoForIntentsByContext<T = unknown>(context: OpenFin.Context): Promise<T>;
|
|
248
248
|
/**
|
|
249
249
|
* Sends a Context that will be resolved to an Intent by the Interop Broker.
|
|
250
250
|
* This context accepts a metadata property.
|
|
@@ -253,7 +253,7 @@ export declare class InteropClient extends Base {
|
|
|
253
253
|
* @tutorial interop.fireIntentForContext
|
|
254
254
|
* @experimental
|
|
255
255
|
*/
|
|
256
|
-
fireIntentForContext(context: OpenFin.ContextForIntent): Promise<
|
|
256
|
+
fireIntentForContext<T = unknown>(context: OpenFin.ContextForIntent): Promise<T>;
|
|
257
257
|
/**
|
|
258
258
|
* Join the current entity to session context group `sessionContextGroupId` and return a sessionContextGroup instance.
|
|
259
259
|
* If the sessionContextGroup doesn't exist, one will get created.
|
|
@@ -94,10 +94,10 @@ class Fdc3Module extends base_1.Base {
|
|
|
94
94
|
let listener;
|
|
95
95
|
if (typeof contextType === 'function') {
|
|
96
96
|
console.warn('addContextListener(handler) has been deprecated. Please use addContextListener(null, handler)');
|
|
97
|
-
listener =
|
|
97
|
+
listener = this.fin.me.interop.addContextHandler(contextType);
|
|
98
98
|
}
|
|
99
99
|
else {
|
|
100
|
-
listener =
|
|
100
|
+
listener = this.fin.me.interop.addContextHandler(handler, contextType === null ? undefined : contextType);
|
|
101
101
|
}
|
|
102
102
|
return {
|
|
103
103
|
...listener,
|
|
@@ -115,7 +115,7 @@ class Fdc3Module extends base_1.Base {
|
|
|
115
115
|
this.wire.sendAction('fdc3-broadcast').catch((e) => {
|
|
116
116
|
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
117
117
|
});
|
|
118
|
-
|
|
118
|
+
this.fin.me.interop.setContext(context);
|
|
119
119
|
}
|
|
120
120
|
/**
|
|
121
121
|
* Returns the Interop-Broker-defined context groups available for an entity to join.
|
|
@@ -127,7 +127,7 @@ class Fdc3Module extends base_1.Base {
|
|
|
127
127
|
this.wire.sendAction('fdc3-get-system-channels').catch((e) => {
|
|
128
128
|
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
129
129
|
});
|
|
130
|
-
const channels = await
|
|
130
|
+
const channels = await this.fin.me.interop.getContextGroups();
|
|
131
131
|
const unsupportedChannelApis = {
|
|
132
132
|
addContextListener: () => {
|
|
133
133
|
throw new utils_1.UnsupportedChannelApiError('Channel.addContextListener');
|
|
@@ -160,7 +160,7 @@ class Fdc3Module extends base_1.Base {
|
|
|
160
160
|
this.wire.sendAction('fdc3-join-channel').catch((e) => {
|
|
161
161
|
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
162
162
|
});
|
|
163
|
-
|
|
163
|
+
this.fin.me.interop.joinContextGroup(channelId);
|
|
164
164
|
}
|
|
165
165
|
/**
|
|
166
166
|
* Removes the specified target from a context group.
|
|
@@ -173,7 +173,7 @@ class Fdc3Module extends base_1.Base {
|
|
|
173
173
|
this.wire.sendAction('fdc3-leave-current-channel').catch((e) => {
|
|
174
174
|
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
175
175
|
});
|
|
176
|
-
|
|
176
|
+
this.fin.me.interop.removeFromContextGroup();
|
|
177
177
|
}
|
|
178
178
|
/**
|
|
179
179
|
* Adds a listener for incoming Intents.
|
|
@@ -190,7 +190,7 @@ class Fdc3Module extends base_1.Base {
|
|
|
190
190
|
const contextHandler = (raisedIntent) => {
|
|
191
191
|
handler(raisedIntent.context);
|
|
192
192
|
};
|
|
193
|
-
const listener =
|
|
193
|
+
const listener = this.fin.me.interop.registerIntentHandler(contextHandler, intent);
|
|
194
194
|
return {
|
|
195
195
|
...listener,
|
|
196
196
|
unsubscribe: () => listener.then((l) => l.unsubscribe())
|
|
@@ -213,7 +213,7 @@ class Fdc3Module extends base_1.Base {
|
|
|
213
213
|
? { name: intent, context, metadata: { target: app } }
|
|
214
214
|
: { name: intent, context };
|
|
215
215
|
try {
|
|
216
|
-
return await
|
|
216
|
+
return await this.fin.me.interop.fireIntent(intentObj);
|
|
217
217
|
}
|
|
218
218
|
catch (error) {
|
|
219
219
|
const errorToThrow = error.message === utils_2.BROKER_ERRORS.fireIntent ? 'ResolverUnavailable' : error;
|
|
@@ -247,7 +247,7 @@ class Fdc3Module extends base_1.Base {
|
|
|
247
247
|
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
248
248
|
});
|
|
249
249
|
try {
|
|
250
|
-
return await
|
|
250
|
+
return await this.fin.me.interop.getInfoForIntent({ name: intent, context });
|
|
251
251
|
}
|
|
252
252
|
catch (error) {
|
|
253
253
|
const errorToThrow = error.message === utils_2.BROKER_ERRORS.getInfoForIntent ? 'ResolverUnavailable' : error;
|
|
@@ -265,7 +265,7 @@ class Fdc3Module extends base_1.Base {
|
|
|
265
265
|
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
266
266
|
});
|
|
267
267
|
try {
|
|
268
|
-
return await
|
|
268
|
+
return await this.fin.me.interop.getInfoForIntentsByContext(context);
|
|
269
269
|
}
|
|
270
270
|
catch (error) {
|
|
271
271
|
const errorToThrow = error.message === utils_2.BROKER_ERRORS.getInfoForIntentsByContext ? 'ResolverUnavailable' : error;
|
|
@@ -284,7 +284,7 @@ class Fdc3Module extends base_1.Base {
|
|
|
284
284
|
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
285
285
|
});
|
|
286
286
|
try {
|
|
287
|
-
return await
|
|
287
|
+
return await this.fin.me.interop.fireIntentForContext({ ...context, metadata: { target: app } });
|
|
288
288
|
}
|
|
289
289
|
catch (error) {
|
|
290
290
|
const errorToThrow = error.message === utils_2.BROKER_ERRORS.fireIntentForContext ? 'ResolverUnavailable' : error;
|
|
@@ -301,7 +301,7 @@ class Fdc3Module extends base_1.Base {
|
|
|
301
301
|
this.wire.sendAction('fdc3-get-or-create-channel').catch((e) => {
|
|
302
302
|
// we do not want to expose this error, just continue if this analytics-only call fails
|
|
303
303
|
});
|
|
304
|
-
const sessionContextGroup = await
|
|
304
|
+
const sessionContextGroup = await this.fin.me.interop.joinSessionContextGroup(channelId);
|
|
305
305
|
return this.buildAppChannelObject(sessionContextGroup);
|
|
306
306
|
}
|
|
307
307
|
/**
|
|
@@ -330,15 +330,15 @@ class Fdc3Module extends base_1.Base {
|
|
|
330
330
|
// utils
|
|
331
331
|
// eslint-disable-next-line class-methods-use-this
|
|
332
332
|
async getCurrentContextGroupInfo() {
|
|
333
|
-
const contextGroups = await
|
|
333
|
+
const contextGroups = await this.fin.me.interop.getContextGroups();
|
|
334
334
|
const clientsInCtxGroupsPromise = contextGroups.map(async (ctxGroup) => {
|
|
335
|
-
return
|
|
335
|
+
return this.fin.me.interop.getAllClientsInContextGroup(ctxGroup.id);
|
|
336
336
|
});
|
|
337
337
|
const clientsInCtxGroups = await Promise.all(clientsInCtxGroupsPromise);
|
|
338
338
|
const clientIdx = clientsInCtxGroups.findIndex((clientIdentityArr) => {
|
|
339
339
|
return clientIdentityArr.some((clientIdentity) => {
|
|
340
340
|
const { uuid, name } = clientIdentity;
|
|
341
|
-
return
|
|
341
|
+
return this.fin.me.uuid === uuid && this.fin.me.name === name;
|
|
342
342
|
});
|
|
343
343
|
});
|
|
344
344
|
return contextGroups[clientIdx];
|
|
@@ -350,7 +350,7 @@ class Fdc3Module extends base_1.Base {
|
|
|
350
350
|
addContextListener: this.addContextListener.bind(this),
|
|
351
351
|
broadcast: this.broadcast.bind(this),
|
|
352
352
|
getCurrentContext: async (contextType) => {
|
|
353
|
-
const context = await
|
|
353
|
+
const context = await this.fin.me.interop.getCurrentContext(contextType);
|
|
354
354
|
return context === undefined ? null : context;
|
|
355
355
|
}
|
|
356
356
|
};
|