@interopio/browser 3.4.4 → 3.4.5

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.4.5
2
+ feat: update prefs api to support non-existent apps
1
3
  3.4.4
2
4
  fix: Added missing fdc3 dependency
3
5
  3.4.3
@@ -2758,6 +2758,7 @@ const prefsHelloSuccessDecoder = object$1({
2758
2758
  platform: object$1({
2759
2759
  app: nonEmptyStringDecoder,
2760
2760
  }),
2761
+ validNonExistentApps: optional$1(array$1(nonEmptyStringDecoder)),
2761
2762
  });
2762
2763
  const clientErrorDataDecoder = object$1({
2763
2764
  message: nonEmptyStringDecoder
@@ -6007,6 +6008,7 @@ class PrefsController {
6007
6008
  appManagerController;
6008
6009
  platformAppName;
6009
6010
  registry = CallbackRegistryFactory$1();
6011
+ validNonExistentApps;
6010
6012
  handlePlatformShutdown() {
6011
6013
  this.registry.clear();
6012
6014
  }
@@ -6020,6 +6022,7 @@ class PrefsController {
6020
6022
  try {
6021
6023
  const prefsHelloSuccess = await this.bridge.send("prefs", operations.prefsHello, undefined, undefined, { includeOperationCheck: true });
6022
6024
  this.platformAppName = prefsHelloSuccess.platform.app;
6025
+ this.validNonExistentApps = prefsHelloSuccess.validNonExistentApps ?? [];
6023
6026
  }
6024
6027
  catch (error) {
6025
6028
  this.logger.warn("The platform of this client is outdated and does not support Prefs API.");
@@ -6042,12 +6045,12 @@ class PrefsController {
6042
6045
  return await operation.execute(operationData);
6043
6046
  }
6044
6047
  async get(app) {
6045
- const verifiedApp = app === undefined || app === null ? this.getMyAppName() : nonEmptyStringDecoder.runWithException(app);
6048
+ const verifiedApp = app === undefined || app === null ? this.getMyAppName() : runDecoderWithIOError(nonEmptyStringDecoder, app);
6046
6049
  const { prefs } = await this.bridge.send("prefs", operations.get, { app: verifiedApp }, undefined, { includeOperationCheck: true });
6047
6050
  return prefs;
6048
6051
  }
6049
6052
  async update(data, options) {
6050
- const verifiedOptions = optional$1(basePrefsConfigDecoder).runWithException(options);
6053
+ const verifiedOptions = runDecoderWithIOError(optional$1(basePrefsConfigDecoder), options);
6051
6054
  const app = verifiedOptions?.app ?? this.getMyAppName();
6052
6055
  await this.updateFor(app, data);
6053
6056
  }
@@ -6102,7 +6105,7 @@ class PrefsController {
6102
6105
  subscribeFor(app, callback) {
6103
6106
  const verifiedApp = runDecoderWithIOError(nonEmptyStringDecoder, app);
6104
6107
  const applications = this.appManagerController.getApplications();
6105
- const isValidApp = verifiedApp === this.platformAppName || applications.some((application) => application.name === verifiedApp);
6108
+ const isValidApp = verifiedApp === this.platformAppName || applications.some((application) => application.name === verifiedApp) || this.validNonExistentApps.includes(verifiedApp);
6106
6109
  if (!isValidApp) {
6107
6110
  return ioError.raiseError(`The provided app name "${app}" is not valid.`);
6108
6111
  }
@@ -6293,7 +6296,7 @@ class IoC {
6293
6296
  }
6294
6297
  }
6295
6298
 
6296
- var version$1 = "3.4.4";
6299
+ var version$1 = "3.4.5";
6297
6300
 
6298
6301
  const createFactoryFunction = (coreFactoryFunction) => {
6299
6302
  return async (userConfig) => {