@interopio/browser 4.1.6 → 4.2.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.
@@ -1810,6 +1810,9 @@
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
+ const regexDecoder = anyJson$1().andThen((value) => {
1814
+ return value instanceof RegExp ? anyJson$1() : fail(`expected a regex, got a ${typeof value}`);
1815
+ });
1813
1816
 
1814
1817
  const intentDefinitionDecoder$1 = object$1({
1815
1818
  name: nonEmptyStringDecoder$3,
@@ -2136,7 +2139,8 @@
2136
2139
  const decoders$1 = {
2137
2140
  common: {
2138
2141
  nonEmptyStringDecoder: nonEmptyStringDecoder$3,
2139
- nonNegativeNumberDecoder: nonNegativeNumberDecoder$3
2142
+ nonNegativeNumberDecoder: nonNegativeNumberDecoder$3,
2143
+ regexDecoder
2140
2144
  },
2141
2145
  fdc3: {
2142
2146
  allDefinitionsDecoder,
@@ -2310,7 +2314,8 @@
2310
2314
  name: nonEmptyStringDecoder$2,
2311
2315
  displayName: optional$2(string$2()),
2312
2316
  contexts: optional$2(array$2(string$2())),
2313
- customConfig: optional$2(object$2())
2317
+ customConfig: optional$2(object$2()),
2318
+ resultType: optional$2(string$2())
2314
2319
  });
2315
2320
  const applicationDefinitionDecoder = object$2({
2316
2321
  name: nonEmptyStringDecoder$2,
@@ -2325,11 +2330,6 @@
2325
2330
  hidden: optional$2(boolean$2()),
2326
2331
  fdc3: optional$2(decoders.fdc3.v2DefinitionDecoder)
2327
2332
  });
2328
- const allApplicationDefinitionsDecoder = oneOf$1(applicationDefinitionDecoder, decoders.fdc3.v2DefinitionDecoder, decoders.fdc3.v1DefinitionDecoder);
2329
- object$2({
2330
- definitions: array$2(allApplicationDefinitionsDecoder),
2331
- mode: oneOf$1(constant$2("replace"), constant$2("merge"))
2332
- });
2333
2333
  const appRemoveConfigDecoder = object$2({
2334
2334
  name: nonEmptyStringDecoder$2
2335
2335
  });
@@ -2343,7 +2343,7 @@
2343
2343
  userProperties: optional$2(anyJson$2()),
2344
2344
  title: optional$2(nonEmptyStringDecoder$2),
2345
2345
  version: optional$2(nonEmptyStringDecoder$2),
2346
- icon: optional$2(nonEmptyStringDecoder$2),
2346
+ icon: optional$2(string$2()),
2347
2347
  caption: optional$2(nonEmptyStringDecoder$2)
2348
2348
  });
2349
2349
  const baseApplicationDataDecoder = object$2({
@@ -2352,7 +2352,7 @@
2352
2352
  userProperties: anyJson$2(),
2353
2353
  title: optional$2(nonEmptyStringDecoder$2),
2354
2354
  version: optional$2(nonEmptyStringDecoder$2),
2355
- icon: optional$2(nonEmptyStringDecoder$2),
2355
+ icon: optional$2(string$2()),
2356
2356
  caption: optional$2(nonEmptyStringDecoder$2)
2357
2357
  });
2358
2358
  const appDirectoryStateChangeDecoder = object$2({
@@ -2470,7 +2470,8 @@
2470
2470
  context: optional$2(anyJson$2()),
2471
2471
  metadata: optional$2(anyJson$2()),
2472
2472
  instances: optional$2(array$2(nonEmptyStringDecoder$2)),
2473
- ignoreInstances: optional$2(array$2(nonEmptyStringDecoder$2))
2473
+ ignoreInstances: optional$2(array$2(nonEmptyStringDecoder$2)),
2474
+ setAsCurrent: optional$2(boolean$2())
2474
2475
  });
2475
2476
  const restoreOptionsDecoder = object$2({
2476
2477
  name: nonEmptyStringDecoder$2,
@@ -2543,7 +2544,8 @@
2543
2544
  contextTypes: optional$2(array$2(nonEmptyStringDecoder$2)),
2544
2545
  instanceId: optional$2(string$2()),
2545
2546
  instanceTitle: optional$2(string$2()),
2546
- resultType: optional$2(string$2())
2547
+ resultType: optional$2(string$2()),
2548
+ customConfig: optional$2(object$2())
2547
2549
  });
2548
2550
  object$2({
2549
2551
  applicationName: string$2(),
@@ -2674,7 +2676,8 @@
2674
2676
  displayName: optional$2(string$2()),
2675
2677
  icon: optional$2(string$2()),
2676
2678
  description: optional$2(string$2()),
2677
- resultType: optional$2(string$2())
2679
+ resultType: optional$2(string$2()),
2680
+ customConfig: optional$2(object$2())
2678
2681
  });
2679
2682
  const AddIntentListenerDecoder = oneOf$1(nonEmptyStringDecoder$2, AddIntentListenerRequestDecoder);
2680
2683
  const intentInfoDecoder = object$2({
@@ -3258,6 +3261,7 @@
3258
3261
  ...config,
3259
3262
  isPlatformInternal,
3260
3263
  logger: config.systemLogger?.level ?? "info",
3264
+ customLogger: config.systemLogger?.customLogger,
3261
3265
  widget: deepmerge$1(defaultWidgetConfig, decodedWidgetConfigResult.result ?? {}),
3262
3266
  modals: deepmerge$1(defaultModalsConfig, decodedModalsConfigResult.result ?? {}),
3263
3267
  intentResolver: deepmerge$1(defaultIntentResolverConfig, decodedIntentResolverConfigResult.result ?? {}),
@@ -5431,7 +5435,8 @@
5431
5435
  applicationTitle: app.title,
5432
5436
  contextTypes: intent.contexts,
5433
5437
  displayName: intent.displayName,
5434
- resultType: intent.resultType
5438
+ resultType: intent.resultType,
5439
+ customConfig: intent.customConfig
5435
5440
  };
5436
5441
  return handler;
5437
5442
  }
@@ -5453,7 +5458,8 @@
5453
5458
  contextTypes: info?.contextTypes || appIntent?.contexts,
5454
5459
  instanceTitle: title,
5455
5460
  displayName: info?.displayName || appIntent?.displayName,
5456
- resultType: info?.resultType || appIntent?.resultType
5461
+ resultType: info?.resultType || appIntent?.resultType,
5462
+ customConfig: info?.customConfig
5457
5463
  };
5458
5464
  return handler;
5459
5465
  }
@@ -7744,7 +7750,7 @@
7744
7750
  }
7745
7751
  }
7746
7752
 
7747
- var version$1 = "4.1.6";
7753
+ var version$1 = "4.2.0";
7748
7754
 
7749
7755
  const setupGlobalSystem = (io, bridge) => {
7750
7756
  return {
@@ -9039,6 +9045,13 @@
9039
9045
  }
9040
9046
  seen.add(value);
9041
9047
  }
9048
+ if (value instanceof Error) {
9049
+ return {
9050
+ message: value.message,
9051
+ name: value.name,
9052
+ stack: value.stack
9053
+ };
9054
+ }
9042
9055
  return value;
9043
9056
  };
9044
9057
  reason = JSON.stringify(err, replacer);
@@ -9283,6 +9296,7 @@
9283
9296
  this.notifyStatusChanged(true);
9284
9297
  }
9285
9298
  close() {
9299
+ this.logger.debug(`closing connection - clientId: ${this.myClientId}, windowId: ${this.identity?.windowId || "unknown"}, client connected: ${this.iAmConnected}`);
9286
9300
  const message = {
9287
9301
  glue42core: {
9288
9302
  type: this.messages.gatewayDisconnect.name,
@@ -9355,7 +9369,7 @@
9355
9369
  selfAssignedWindowId: this.selfAssignedWindowId
9356
9370
  }
9357
9371
  };
9358
- this.logger.debug("sending connection request");
9372
+ this.logger.debug(`sending connection request - clientId: ${this.myClientId}`);
9359
9373
  if (this.extContentConnecting) {
9360
9374
  request.glue42core.clientType = "child";
9361
9375
  request.glue42core.bridgeInstanceId = this.myClientId;
@@ -9382,6 +9396,7 @@
9382
9396
  this.logger.debug("skipping generic message listener, because this is an internal client");
9383
9397
  return;
9384
9398
  }
9399
+ this.logger.debug("setting up window message listener");
9385
9400
  window.addEventListener("message", (event) => {
9386
9401
  const data = event.data?.glue42core;
9387
9402
  if (!data || this.rejected) {
@@ -9406,6 +9421,7 @@
9406
9421
  this.logger.debug("skipping unload event listener, because this is an internal client");
9407
9422
  return;
9408
9423
  }
9424
+ this.logger.debug("setting up unload event listeners");
9409
9425
  window.addEventListener("beforeunload", () => {
9410
9426
  if (this._connectionProtocolVersion) {
9411
9427
  return;
@@ -9423,6 +9439,7 @@
9423
9439
  if (this.extContentConnected) {
9424
9440
  return;
9425
9441
  }
9442
+ this.logger.debug(`signaling client disappearing for clientId: ${this.myClientId}`);
9426
9443
  const message = {
9427
9444
  glue42core: {
9428
9445
  type: this.messages.clientUnload.name,
@@ -9557,6 +9574,7 @@
9557
9574
  source.postMessage(message, event.origin);
9558
9575
  }
9559
9576
  setupPlatformUnloadListener() {
9577
+ this.logger.debug("setting up platform unload listener");
9560
9578
  this.onMessage((msg) => {
9561
9579
  if (msg.type === "platformUnload") {
9562
9580
  this.logger.debug("detected a web platform unload");
@@ -9566,6 +9584,7 @@
9566
9584
  });
9567
9585
  }
9568
9586
  handleManualUnload() {
9587
+ this.logger.debug("handling manual unload");
9569
9588
  const message = {
9570
9589
  glue42core: {
9571
9590
  type: this.messages.clientUnload.name,
@@ -9584,6 +9603,7 @@
9584
9603
  return;
9585
9604
  }
9586
9605
  notifyStatusChanged(status, reason) {
9606
+ this.logger.debug(`status changed - connected: ${status}, reason: ${reason || "none"}`);
9587
9607
  this.iAmConnected = status;
9588
9608
  this.registry.execute("onConnectedChanged", status, reason);
9589
9609
  }
@@ -10553,7 +10573,7 @@
10553
10573
  return authentication;
10554
10574
  }
10555
10575
  async logoutCore() {
10556
- this.logger.debug("logging out...");
10576
+ this.logger.debug("core logging out...");
10557
10577
  this.shouldTryLogin = false;
10558
10578
  if (this.pingTimer) {
10559
10579
  clearTimeout(this.pingTimer);
@@ -10784,7 +10804,7 @@
10784
10804
  }
10785
10805
  };
10786
10806
 
10787
- var version = "6.7.3";
10807
+ var version = "6.8.0";
10788
10808
 
10789
10809
  function prepareConfig (configuration, ext, glue42gd) {
10790
10810
  let nodeStartingContext;
@@ -14555,7 +14575,7 @@
14555
14575
  /** See `Decoder.succeed` */
14556
14576
  Decoder.succeed;
14557
14577
  /** See `Decoder.fail` */
14558
- var fail = Decoder.fail;
14578
+ var fail$1 = Decoder.fail;
14559
14579
  /** See `Decoder.lazy` */
14560
14580
  Decoder.lazy;
14561
14581
 
@@ -14563,7 +14583,7 @@
14563
14583
  const providedType = typeof input;
14564
14584
  return providedType === "function" ?
14565
14585
  anyJson() :
14566
- fail(`The provided argument as ${propDescription} should be of type function, provided: ${typeof providedType}`);
14586
+ fail$1(`The provided argument as ${propDescription} should be of type function, provided: ${typeof providedType}`);
14567
14587
  };
14568
14588
  const nonEmptyStringDecoder = string().where((s) => s.length > 0, "Expected a non-empty string");
14569
14589
  const nonNegativeNumberDecoder = number().where((num) => num >= 0, "Expected a non-negative number or 0");