@openfin/core 28.71.17 → 28.71.18

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/core",
3
- "version": "28.71.17",
3
+ "version": "28.71.18",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./src/mock.js",
6
6
  "types": "./src/mock.d.ts",
@@ -315,6 +315,9 @@ class InteropBroker extends base_1.Base {
315
315
  this.wire.sendAction('interop-broker-join-context-group').catch((e) => {
316
316
  // don't expose, analytics-only call
317
317
  });
318
+ if (this.sessionContextGroupMap.has(contextGroupId)) {
319
+ throw new Error(utils_1.BROKER_ERRORS.joinSessionContextGroupWithJoinContextGroup);
320
+ }
318
321
  if (target) {
319
322
  // If an endpointId is provided, use that. This will likely be used by external adapters.
320
323
  if (InteropBroker.hasEndpointId(target)) {
@@ -160,7 +160,17 @@ 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
- this.fin.me.interop.joinContextGroup(channelId);
163
+ try {
164
+ await this.fin.me.interop.joinContextGroup(channelId);
165
+ }
166
+ catch (error) {
167
+ if (error.message === utils_2.BROKER_ERRORS.joinSessionContextGroupWithJoinContextGroup) {
168
+ throw new Error('The Channel you have tried to join is an App Channel. Custom Channels can only be defined by the Interop Broker through code or manifest configuration. Please use getOrCreateChannel.');
169
+ }
170
+ else {
171
+ throw new Error(error.message);
172
+ }
173
+ }
164
174
  }
165
175
  /**
166
176
  * Removes the specified target from a context group.
@@ -8,5 +8,6 @@ export declare const BROKER_ERRORS: {
8
8
  fireIntentForContext: string;
9
9
  getInfoForIntent: string;
10
10
  getInfoForIntentsByContext: string;
11
+ joinSessionContextGroupWithJoinContextGroup: string;
11
12
  };
12
13
  export declare const wrapIntentHandler: (handler: OpenFin.IntentHandler, handlerId: string) => (intent: OpenFin.Intent) => Promise<void>;
@@ -32,7 +32,8 @@ exports.BROKER_ERRORS = {
32
32
  fireIntent: exports.generateOverrideError('fireIntent', 'handleFiredIntent'),
33
33
  fireIntentForContext: exports.generateOverrideError('fireIntentForContext', 'handleFiredIntentForContext'),
34
34
  getInfoForIntent: exports.generateOverrideError('getInfoForIntent', 'handleInfoForIntent'),
35
- getInfoForIntentsByContext: exports.generateOverrideError('getInfoForIntentsByContext', 'handleInfoForIntentsByContext')
35
+ getInfoForIntentsByContext: exports.generateOverrideError('getInfoForIntentsByContext', 'handleInfoForIntentsByContext'),
36
+ joinSessionContextGroupWithJoinContextGroup: 'The Context Group you have tried to join is a Session Context Group. Custom Context Groups can only be defined by the Interop Broker through code or manifest configuration. Please use joinSessionContextGroup.'
36
37
  };
37
38
  exports.wrapIntentHandler = (handler, handlerId) => {
38
39
  return async (intent) => {