@interopio/browser 4.4.0 → 4.5.0-beta.0

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.
@@ -1804,22 +1804,26 @@
1804
1804
  /** See `Decoder.succeed` */
1805
1805
  Decoder$1.succeed;
1806
1806
  /** See `Decoder.fail` */
1807
- Decoder$1.fail;
1807
+ var fail$1 = Decoder$1.fail;
1808
1808
  /** See `Decoder.lazy` */
1809
1809
  Decoder$1.lazy;
1810
1810
 
1811
1811
  const nonEmptyStringDecoder$3 = string$1().where((s) => s.length > 0, "Expected a non-empty string");
1812
1812
  const nonNegativeNumberDecoder$3 = number$1().where((num) => num >= 0, "Expected a non-negative number");
1813
1813
  const regexDecoder = anyJson$1().andThen((value) => {
1814
- return value instanceof RegExp ? anyJson$1() : fail(`expected a regex, got a ${typeof value}`);
1814
+ return value instanceof RegExp ? anyJson$1() : fail$1(`expected a regex, got a ${typeof value}`);
1815
1815
  });
1816
- const urlDecoder = nonEmptyStringDecoder$3.andThen((url) => {
1816
+ const urlDecoder$1 = nonEmptyStringDecoder$3.andThen((url) => {
1817
1817
  try {
1818
- new URL(url);
1818
+ const { protocol } = new URL(url);
1819
+ const disallowedProtocols = ["data:", "javascript:", "vbscript:"];
1820
+ if (disallowedProtocols.includes(protocol)) {
1821
+ return fail$1(`Expected a URL with a safe protocol, got: ${protocol} (disallowed protocols: ${disallowedProtocols.join(", ")})`);
1822
+ }
1819
1823
  return nonEmptyStringDecoder$3;
1820
1824
  }
1821
1825
  catch {
1822
- return fail("Should be a valid URL");
1826
+ return fail$1("Expected a valid URL");
1823
1827
  }
1824
1828
  });
1825
1829
 
@@ -1831,7 +1835,7 @@
1831
1835
  });
1832
1836
  const v2TypeDecoder = oneOf(constant$1("web"), constant$1("native"), constant$1("citrix"), constant$1("onlineNative"), constant$1("other"));
1833
1837
  const v2DetailsDecoder = object$1({
1834
- url: nonEmptyStringDecoder$3
1838
+ url: urlDecoder$1
1835
1839
  });
1836
1840
  const v2IconDecoder = object$1({
1837
1841
  src: nonEmptyStringDecoder$3,
@@ -1859,18 +1863,19 @@
1859
1863
  listensFor: optional$1(array$1(nonEmptyStringDecoder$3))
1860
1864
  });
1861
1865
  const v2AppChannelDecoder = object$1({
1862
- name: nonEmptyStringDecoder$3,
1866
+ name: optional$1(nonEmptyStringDecoder$3),
1867
+ id: optional$1(nonEmptyStringDecoder$3),
1863
1868
  description: optional$1(nonEmptyStringDecoder$3),
1864
1869
  broadcasts: optional$1(array$1(nonEmptyStringDecoder$3)),
1865
1870
  listensFor: optional$1(array$1(nonEmptyStringDecoder$3))
1866
- });
1871
+ }).where((appChannel) => Boolean(appChannel.name || appChannel.id), "Expected at least a name or an id property to be present in the app channel definition");
1867
1872
  const v2InteropDecoder = object$1({
1868
1873
  intents: optional$1(v2IntentsDecoder),
1869
1874
  userChannels: optional$1(v2UserChannelDecoder),
1870
1875
  appChannels: optional$1(array$1(v2AppChannelDecoder))
1871
1876
  });
1872
1877
  const glue42ApplicationDetailsDecoder = object$1({
1873
- url: optional$1(nonEmptyStringDecoder$3),
1878
+ url: optional$1(urlDecoder$1),
1874
1879
  top: optional$1(number$1()),
1875
1880
  left: optional$1(number$1()),
1876
1881
  width: optional$1(nonNegativeNumberDecoder$3),
@@ -2150,7 +2155,7 @@
2150
2155
  nonEmptyStringDecoder: nonEmptyStringDecoder$3,
2151
2156
  nonNegativeNumberDecoder: nonNegativeNumberDecoder$3,
2152
2157
  regexDecoder,
2153
- urlDecoder
2158
+ urlDecoder: urlDecoder$1
2154
2159
  },
2155
2160
  fdc3: {
2156
2161
  allDefinitionsDecoder,
@@ -2199,9 +2204,10 @@
2199
2204
  const decoders = ioc.decoders;
2200
2205
  ioc.errors;
2201
2206
 
2202
- const nonEmptyStringDecoder$2 = string$2().where((s) => s.length > 0, "Expected a non-empty string");
2203
- const nonNegativeNumberDecoder$2 = number$2().where((num) => num >= 0, "Expected a non-negative number");
2207
+ const nonEmptyStringDecoder$2 = decoders.common.nonEmptyStringDecoder;
2208
+ const nonNegativeNumberDecoder$2 = decoders.common.nonNegativeNumberDecoder;
2204
2209
  const optionalNonEmptyStringDecoder = optional$2(nonEmptyStringDecoder$2);
2210
+ const urlDecoder = decoders.common.urlDecoder;
2205
2211
  const libDomainDecoder = oneOf$1(constant$2("system"), constant$2("windows"), constant$2("appManager"), constant$2("layouts"), constant$2("intents"), constant$2("notifications"), constant$2("channels"), constant$2("extension"), constant$2("themes"), constant$2("prefs"), constant$2("ui"));
2206
2212
  const windowOperationTypesDecoder = oneOf$1(constant$2("openWindow"), constant$2("windowHello"), constant$2("windowAdded"), constant$2("windowRemoved"), constant$2("getBounds"), constant$2("getFrameBounds"), constant$2("getUrl"), constant$2("moveResize"), constant$2("focus"), constant$2("close"), constant$2("getTitle"), constant$2("setTitle"), constant$2("focusChange"), constant$2("getChannel"), constant$2("notifyChannelsChanged"), constant$2("setZoomFactor"), constant$2("zoomFactorChange"), constant$2("refresh"), constant$2("operationCheck"));
2207
2213
  const appManagerOperationTypesDecoder = oneOf$1(constant$2("appHello"), constant$2("appDirectoryStateChange"), constant$2("instanceStarted"), constant$2("instanceStopped"), constant$2("applicationStart"), constant$2("instanceStop"), constant$2("clear"), constant$2("operationCheck"));
@@ -2228,7 +2234,7 @@
2228
2234
  }));
2229
2235
  const openWindowConfigDecoder = object$2({
2230
2236
  name: nonEmptyStringDecoder$2,
2231
- url: nonEmptyStringDecoder$2,
2237
+ url: urlDecoder,
2232
2238
  options: windowOpenSettingsDecoder
2233
2239
  });
2234
2240
  const windowHelloDecoder = object$2({
@@ -2280,7 +2286,7 @@
2280
2286
  });
2281
2287
  const windowUrlResultDecoder = object$2({
2282
2288
  windowId: nonEmptyStringDecoder$2,
2283
- url: nonEmptyStringDecoder$2
2289
+ url: urlDecoder
2284
2290
  });
2285
2291
  const windowZoomFactorConfigDecoder = object$2({
2286
2292
  windowId: nonEmptyStringDecoder$2,
@@ -2311,7 +2317,7 @@
2311
2317
  enabled: boolean$2(),
2312
2318
  });
2313
2319
  const applicationDetailsDecoder = object$2({
2314
- url: nonEmptyStringDecoder$2,
2320
+ url: urlDecoder,
2315
2321
  top: optional$2(number$2()),
2316
2322
  left: optional$2(number$2()),
2317
2323
  width: optional$2(nonNegativeNumberDecoder$2),
@@ -2386,7 +2392,7 @@
2386
2392
  bounds: windowBoundsDecoder,
2387
2393
  createArgs: object$2({
2388
2394
  name: optional$2(nonEmptyStringDecoder$2),
2389
- url: optional$2(nonEmptyStringDecoder$2),
2395
+ url: optional$2(urlDecoder),
2390
2396
  context: optional$2(anyJson$2())
2391
2397
  }),
2392
2398
  windowState: optional$2(nonEmptyStringDecoder$2),
@@ -2410,7 +2416,7 @@
2410
2416
  type: constant$2("window"),
2411
2417
  config: object$2({
2412
2418
  appName: nonEmptyStringDecoder$2,
2413
- url: optional$2(nonEmptyStringDecoder$2),
2419
+ url: optional$2(urlDecoder),
2414
2420
  title: optional$2(string$2()),
2415
2421
  allowExtract: optional$2(boolean$2()),
2416
2422
  allowReorder: optional$2(boolean$2()),
@@ -3812,7 +3818,7 @@
3812
3818
  }
3813
3819
  async open(name, url, options) {
3814
3820
  runDecoderWithIOError(nonEmptyStringDecoder$2, name);
3815
- runDecoderWithIOError(nonEmptyStringDecoder$2, url);
3821
+ runDecoderWithIOError(urlDecoder, url);
3816
3822
  const settings = runDecoderWithIOError(windowOpenSettingsDecoder, options);
3817
3823
  const windowSuccess = await this.bridge.send("windows", operations$a.openWindow, { name, url, options: settings });
3818
3824
  return this.waitForWindowAdded(windowSuccess.windowId);
@@ -5973,11 +5979,8 @@
5973
5979
  }
5974
5980
  return channelContext;
5975
5981
  }
5976
- async getMyChannels() {
5977
- return Promise.all(this.storage.channels.map((channelName) => {
5978
- const contextName = this.createContextName(channelName);
5979
- return this.contexts.get(contextName);
5980
- }));
5982
+ async getMyChannels(options) {
5983
+ return Promise.all(this.storage.channels.map((channelName) => this.get(channelName, options)));
5981
5984
  }
5982
5985
  myChannels() {
5983
5986
  return this.storage.channels;
@@ -7783,7 +7786,7 @@
7783
7786
  }
7784
7787
  }
7785
7788
 
7786
- var version$1 = "4.4.0";
7789
+ var version$1 = "4.5.0-beta.0";
7787
7790
 
7788
7791
  const setupGlobalSystem = (io, bridge) => {
7789
7792
  return {
@@ -17043,7 +17046,7 @@
17043
17046
  /** See `Decoder.succeed` */
17044
17047
  Decoder.succeed;
17045
17048
  /** See `Decoder.fail` */
17046
- var fail$1 = Decoder.fail;
17049
+ var fail = Decoder.fail;
17047
17050
  /** See `Decoder.lazy` */
17048
17051
  Decoder.lazy;
17049
17052
 
@@ -17051,7 +17054,7 @@
17051
17054
  const providedType = typeof input;
17052
17055
  return providedType === "function" ?
17053
17056
  anyJson() :
17054
- fail$1(`The provided argument as ${propDescription} should be of type function, provided: ${providedType}`);
17057
+ fail(`The provided argument as ${propDescription} should be of type function, provided: ${providedType}`);
17055
17058
  };
17056
17059
  const nonEmptyStringDecoder = string().where((s) => s.length > 0, "Expected a non-empty string");
17057
17060
  const nonNegativeNumberDecoder = number().where((num) => num >= 0, "Expected a non-negative number or 0");