@interopio/browser 3.4.2 → 3.4.3

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.d.ts CHANGED
@@ -7,6 +7,7 @@ import { IOConnectDesktop } from "@interopio/desktop";
7
7
  import { IOConnectWorkspaces } from "@interopio/workspaces-api";
8
8
  import { IOConnectSearch } from "@interopio/search-api";
9
9
  import { IOBrowserWidget } from "@interopio/widget";
10
+ import { Context as FDC3Context } from "@finos/fdc3";
10
11
 
11
12
  /**
12
13
  * Factory function that creates a new ioconnect instance.
@@ -1121,7 +1122,13 @@ export namespace IOConnectBrowser {
1121
1122
  /** Channel meta data (display name, color, image, etc.) */
1122
1123
  meta: any;
1123
1124
  /** Channel data. */
1124
- data: any;
1125
+ data: {
1126
+ /**
1127
+ * FDC3 context data. Will be present only if FDC3 context data has been published to the respective Channel.
1128
+ */
1129
+ fdc3?: FDC3Context;
1130
+ [key: string]: any
1131
+ };
1125
1132
  }
1126
1133
 
1127
1134
  /**
package/changelog.md CHANGED
@@ -1,3 +1,6 @@
1
+ 3.4.3
2
+ chore: Update ChannelContext's data type
3
+ fix: unsupported client error operation in the system controller
1
4
  3.4.0
2
5
  feat: Extend channels methods with fdc3 options
3
6
  feat: Add error events
@@ -1699,7 +1699,7 @@ const v2InteropDecoder = object({
1699
1699
  appChannels: optional(array(v2AppChannelDecoder))
1700
1700
  });
1701
1701
  const glue42ApplicationDetailsDecoder = object({
1702
- url: nonEmptyStringDecoder$1,
1702
+ url: optional(nonEmptyStringDecoder$1),
1703
1703
  top: optional(number()),
1704
1704
  left: optional(number()),
1705
1705
  width: optional(nonNegativeNumberDecoder$1),
@@ -1717,10 +1717,6 @@ const glue42HostManifestsBrowserDecoder = object({
1717
1717
  intents: optional(array(intentDefinitionDecoder$1)),
1718
1718
  hidden: optional(boolean())
1719
1719
  });
1720
- const hostManifestsBrowserDecoder = oneOf(object({
1721
- "ioConnect": optional(oneOf(glue42HostManifestsBrowserDecoder, anyJson())),
1722
- "Glue42": optional(oneOf(glue42HostManifestsBrowserDecoder, anyJson()))
1723
- }), anyJson());
1724
1720
  const v1DefinitionDecoder = object({
1725
1721
  name: nonEmptyStringDecoder$1,
1726
1722
  appId: nonEmptyStringDecoder$1,
@@ -1755,7 +1751,7 @@ const v2LocalizedDefinitionDecoder = object({
1755
1751
  moreInfo: optional(nonEmptyStringDecoder$1),
1756
1752
  publisher: optional(nonEmptyStringDecoder$1),
1757
1753
  customConfig: optional(array(anyJson())),
1758
- hostManifests: optional(hostManifestsBrowserDecoder),
1754
+ hostManifests: optional(anyJson()),
1759
1755
  interop: optional(v2InteropDecoder)
1760
1756
  });
1761
1757
  const v2DefinitionDecoder = object({
@@ -1776,7 +1772,7 @@ const v2DefinitionDecoder = object({
1776
1772
  moreInfo: optional(nonEmptyStringDecoder$1),
1777
1773
  publisher: optional(nonEmptyStringDecoder$1),
1778
1774
  customConfig: optional(array(anyJson())),
1779
- hostManifests: optional(hostManifestsBrowserDecoder),
1775
+ hostManifests: optional(anyJson()),
1780
1776
  interop: optional(v2InteropDecoder),
1781
1777
  localizedVersions: optional(dict(v2LocalizedDefinitionDecoder))
1782
1778
  });
@@ -2035,7 +2031,7 @@ const windowOperationTypesDecoder = oneOf$1(constant$1("openWindow"), constant$1
2035
2031
  const appManagerOperationTypesDecoder = oneOf$1(constant$1("appHello"), constant$1("appDirectoryStateChange"), constant$1("instanceStarted"), constant$1("instanceStopped"), constant$1("applicationStart"), constant$1("instanceStop"), constant$1("clear"));
2036
2032
  const layoutsOperationTypesDecoder = oneOf$1(constant$1("layoutAdded"), constant$1("layoutChanged"), constant$1("layoutRemoved"), constant$1("layoutRenamed"), constant$1("get"), constant$1("getAll"), constant$1("export"), constant$1("import"), constant$1("remove"), constant$1("rename"), constant$1("clientSaveRequest"), constant$1("getGlobalPermissionState"), constant$1("checkGlobalActivated"), constant$1("requestGlobalPermission"), constant$1("getDefaultGlobal"), constant$1("setDefaultGlobal"), constant$1("clearDefaultGlobal"), constant$1("updateMetadata"));
2037
2033
  const notificationsOperationTypesDecoder = oneOf$1(constant$1("raiseNotification"), constant$1("requestPermission"), constant$1("notificationShow"), constant$1("notificationClick"), constant$1("getPermission"), constant$1("list"), constant$1("notificationRaised"), constant$1("notificationClosed"), constant$1("click"), constant$1("clear"), constant$1("clearAll"), constant$1("configure"), constant$1("getConfiguration"), constant$1("configurationChanged"), constant$1("setState"), constant$1("clearOld"), constant$1("activeCountChange"), constant$1("stateChange"));
2038
- const systemOperationTypesDecoder = oneOf$1(constant$1("getEnvironment"), constant$1("getBase"), constant$1("platformShutdown"), constant$1("isFdc3DataWrappingSupported"), constant$1("clientError"));
2034
+ const systemOperationTypesDecoder = oneOf$1(constant$1("getEnvironment"), constant$1("getBase"), constant$1("platformShutdown"), constant$1("isFdc3DataWrappingSupported"), constant$1("clientError"), constant$1("systemHello"));
2039
2035
  const windowRelativeDirectionDecoder = oneOf$1(constant$1("top"), constant$1("left"), constant$1("right"), constant$1("bottom"));
2040
2036
  const windowBoundsDecoder = object$1({
2041
2037
  top: number$1(),
@@ -2766,6 +2762,9 @@ const prefsHelloSuccessDecoder = object$1({
2766
2762
  const clientErrorDataDecoder = object$1({
2767
2763
  message: nonEmptyStringDecoder
2768
2764
  });
2765
+ const systemHelloSuccessDecoder = object$1({
2766
+ isClientErrorOperationSupported: boolean$1()
2767
+ });
2769
2768
 
2770
2769
  const operations$9 = {
2771
2770
  openWindow: { name: "openWindow", dataDecoder: openWindowConfigDecoder, resultDecoder: coreWindowDataDecoder },
@@ -5207,17 +5206,32 @@ const operations$3 = {
5207
5206
  platformShutdown: { name: "platformShutdown" },
5208
5207
  isFdc3DataWrappingSupported: { name: "isFdc3DataWrappingSupported" },
5209
5208
  clientError: { name: "clientError", dataDecoder: clientErrorDataDecoder },
5209
+ systemHello: { name: "systemHello", resultDecoder: systemHelloSuccessDecoder },
5210
5210
  };
5211
5211
 
5212
5212
  class SystemController {
5213
5213
  bridge;
5214
5214
  ioc;
5215
+ logger;
5215
5216
  errorPort = errorChannel.port2;
5216
5217
  async start(coreGlue, ioc) {
5218
+ this.logger = coreGlue.logger.subLogger("system.controller.web");
5219
+ this.logger.trace("starting the web system controller");
5217
5220
  this.bridge = ioc.bridge;
5218
5221
  this.ioc = ioc;
5219
5222
  this.addOperationsExecutors();
5223
+ let isClientErrorOperationSupported = false;
5224
+ try {
5225
+ const systemHelloSuccess = await this.bridge.send("system", operations$3.systemHello, undefined, undefined, { includeOperationCheck: true });
5226
+ isClientErrorOperationSupported = systemHelloSuccess.isClientErrorOperationSupported;
5227
+ }
5228
+ catch (error) {
5229
+ this.logger.warn("The platform of this client is outdated and does not support some system operations.");
5230
+ }
5220
5231
  this.errorPort.onmessage = async (event) => {
5232
+ if (!isClientErrorOperationSupported) {
5233
+ return;
5234
+ }
5221
5235
  await this.bridge.send("system", operations$3.clientError, { message: event.data }, undefined, { includeOperationCheck: true });
5222
5236
  };
5223
5237
  await this.setEnvironment();
@@ -6279,7 +6293,7 @@ class IoC {
6279
6293
  }
6280
6294
  }
6281
6295
 
6282
- var version$1 = "3.4.2";
6296
+ var version$1 = "3.4.3";
6283
6297
 
6284
6298
  const createFactoryFunction = (coreFactoryFunction) => {
6285
6299
  return async (userConfig) => {