@interopio/browser 3.5.8 → 3.5.9

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/changelog.md CHANGED
@@ -1,3 +1,5 @@
1
+ 3.5.9
2
+ feat: Introduce REST Stores for Prefs and Layouts
1
3
  3.5.8
2
4
  feat: Interception of starting an application as a result from raised intent
3
5
  3.5.7
@@ -2818,6 +2818,9 @@ const getPrefsResultDecoder = object$1({
2818
2818
  const getAllPrefsResultDecoder = object$1({
2819
2819
  all: array$1(appPreferencesDecoder),
2820
2820
  });
2821
+ const subscriberRegisterConfigDecoder = object$1({
2822
+ interopId: nonEmptyStringDecoder,
2823
+ });
2821
2824
  const changePrefsDataDecoder = object$1({
2822
2825
  app: nonEmptyStringDecoder,
2823
2826
  data: object$1(),
@@ -6428,6 +6431,7 @@ const operations$1 = {
6428
6431
  update: { name: "update", dataDecoder: changePrefsDataDecoder },
6429
6432
  prefsChanged: { name: "prefsChanged", dataDecoder: getPrefsResultDecoder },
6430
6433
  prefsHello: { name: "prefsHello", resultDecoder: prefsHelloSuccessDecoder },
6434
+ registerSubscriber: { name: "registerSubscriber", dataDecoder: subscriberRegisterConfigDecoder },
6431
6435
  };
6432
6436
 
6433
6437
  class PrefsController {
@@ -6438,6 +6442,8 @@ class PrefsController {
6438
6442
  platformAppName;
6439
6443
  registry = CallbackRegistryFactory$1();
6440
6444
  validNonExistentApps;
6445
+ signaledSubscription = false;
6446
+ interopId;
6441
6447
  handlePlatformShutdown() {
6442
6448
  this.registry.clear();
6443
6449
  }
@@ -6445,6 +6451,7 @@ class PrefsController {
6445
6451
  this.logger = coreGlue.logger.subLogger("prefs.controller.web");
6446
6452
  this.logger.trace("starting the web prefs controller");
6447
6453
  this.addOperationsExecutors();
6454
+ this.interopId = coreGlue.interop.instance.instance;
6448
6455
  this.bridge = ioc.bridge;
6449
6456
  this.config = ioc.config;
6450
6457
  this.appManagerController = ioc.appManagerController;
@@ -6541,6 +6548,14 @@ class PrefsController {
6541
6548
  if (typeof callback !== "function") {
6542
6549
  return ioError.raiseError("Cannot subscribe to prefs, because the provided callback is not a function!");
6543
6550
  }
6551
+ if (!this.signaledSubscription) {
6552
+ this.bridge.send("prefs", operations$1.registerSubscriber, { interopId: this.interopId }, undefined, { includeOperationCheck: true })
6553
+ .catch((error) => {
6554
+ this.logger.warn("Failed to register subscriber for prefs");
6555
+ this.logger.error(error);
6556
+ });
6557
+ this.signaledSubscription = true;
6558
+ }
6544
6559
  const subscriptionKey = this.getSubscriptionKey(verifiedApp);
6545
6560
  this.get(verifiedApp).then(callback);
6546
6561
  return this.registry.add(subscriptionKey, callback);
@@ -7038,7 +7053,7 @@ class IoC {
7038
7053
  }
7039
7054
  }
7040
7055
 
7041
- var version$1 = "3.5.8";
7056
+ var version$1 = "3.5.9";
7042
7057
 
7043
7058
  const createFactoryFunction = (coreFactoryFunction) => {
7044
7059
  let cachedApiPromise;