@interopio/workspaces-api 3.5.4 → 3.5.6

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,7 @@
1
+ 3.5.6
2
+ feat: ability to embed a loading strategy within a workspaces layout upon saving
3
+ 3.5.5
4
+ feat: setup a workspace to open only once
1
5
  3.5.4
2
6
  chore: Increased the interop timeout to 2mins
3
7
  3.5.2
@@ -1164,7 +1164,8 @@ const workspaceConfigResultDecoder = object({
1164
1164
  widthInPx: optional(number()),
1165
1165
  heightInPx: optional(number()),
1166
1166
  isPinned: optional(boolean()),
1167
- windowDragMode: optional(windowDragModeDecoder)
1167
+ windowDragMode: optional(windowDragModeDecoder),
1168
+ loadingStrategy: optional(loadingStrategyDecoder)
1168
1169
  });
1169
1170
  const baseChildSnapshotConfigDecoder = object({
1170
1171
  frameId: nonEmptyStringDecoder,
@@ -1417,6 +1418,7 @@ const workspaceLayoutSaveConfigDecoder = object({
1417
1418
  name: nonEmptyStringDecoder,
1418
1419
  workspaceId: nonEmptyStringDecoder,
1419
1420
  saveContext: optional(boolean()),
1421
+ allowMultiple: optional(boolean()),
1420
1422
  metadata: optional(object())
1421
1423
  });
1422
1424
  const workspaceLockConfigDecoder = object({
@@ -1524,6 +1526,10 @@ const setWindowDragModeDecoder = object({
1524
1526
  itemId: nonEmptyStringDecoder,
1525
1527
  dragMode: windowDragModeDecoder
1526
1528
  });
1529
+ const setLoadingStrategyDecoder = object({
1530
+ itemId: nonEmptyStringDecoder,
1531
+ strategy: loadingStrategyDecoder
1532
+ });
1527
1533
 
1528
1534
  const webPlatformMethodName = "T42.Web.Platform.Control";
1529
1535
  const webPlatformWspStreamName = "T42.Web.Platform.WSP.Stream";
@@ -1597,7 +1603,8 @@ const OPERATIONS = {
1597
1603
  hideLoadingAnimation: { name: "hideLoadingAnimation", argsDecoder: loadingAnimationConfigDecoder, resultDecoder: voidResultDecoder },
1598
1604
  getPlatformFrameId: { name: "getPlatformFrameId", resultDecoder: getPlatformFrameIdResultDecoder },
1599
1605
  operationCheck: { name: "operationCheck", argsDecoder: operationCheckConfigDecoder, resultDecoder: operationCheckResultDecoder },
1600
- setWindowDragMode: { name: "setWindowDragMode", argsDecoder: setWindowDragModeDecoder, resultDecoder: voidResultDecoder }
1606
+ setWindowDragMode: { name: "setWindowDragMode", argsDecoder: setWindowDragModeDecoder, resultDecoder: voidResultDecoder },
1607
+ setLoadingStrategy: { name: "setLoadingStrategy", argsDecoder: setLoadingStrategyDecoder, resultDecoder: voidResultDecoder }
1601
1608
  };
1602
1609
 
1603
1610
  class PromiseWrapper {
@@ -2678,6 +2685,20 @@ class Workspace {
2678
2685
  }
2679
2686
  return getData$3(this).config.windowDragMode;
2680
2687
  }
2688
+ get loadingStrategy() {
2689
+ if (!isDesktop()) {
2690
+ console.warn("The workspace.loadingStrategy property is not supported in IO Connect Browser");
2691
+ }
2692
+ return getData$3(this).config.loadingStrategy;
2693
+ }
2694
+ async setLoadingStrategy(strategy) {
2695
+ if (!isDesktop()) {
2696
+ throw new Error("Not supported in IO Connect Browser");
2697
+ }
2698
+ const controller = getData$3(this).controller;
2699
+ await controller.setLoadingStrategy(this.id, strategy);
2700
+ await this.refreshReference();
2701
+ }
2681
2702
  async removeChild(predicate) {
2682
2703
  checkThrowCallback(predicate);
2683
2704
  const child = this.children.find(predicate);
@@ -2715,7 +2736,7 @@ class Workspace {
2715
2736
  }
2716
2737
  async saveLayout(name, config) {
2717
2738
  nonEmptyStringDecoder.runWithException(name);
2718
- await getData$3(this).controller.saveLayout({ name, workspaceId: this.id, saveContext: config?.saveContext, metadata: config?.metadata });
2739
+ await getData$3(this).controller.saveLayout({ name, workspaceId: this.id, saveContext: config?.saveContext, metadata: config?.metadata, allowMultiple: config?.allowMultiple });
2719
2740
  }
2720
2741
  async setTitle(title) {
2721
2742
  nonEmptyStringDecoder.runWithException(title);
@@ -4357,6 +4378,10 @@ class BaseController {
4357
4378
  return {};
4358
4379
  }
4359
4380
  }
4381
+ async setLoadingStrategy(workspaceId, strategy) {
4382
+ await this.isOperationSupported(OPERATIONS.setLoadingStrategy.name);
4383
+ return this.bridge.send(OPERATIONS.setLoadingStrategy.name, { itemId: workspaceId, strategy });
4384
+ }
4360
4385
  async isOperationSupported(operation) {
4361
4386
  if (isDesktop()) {
4362
4387
  return { isSupported: true };
@@ -4675,6 +4700,9 @@ class MainController {
4675
4700
  getPlatformFrameId() {
4676
4701
  return this.base.getPlatformFrameId();
4677
4702
  }
4703
+ setLoadingStrategy(workspaceId, strategy) {
4704
+ return this.base.setLoadingStrategy(workspaceId, strategy);
4705
+ }
4678
4706
  async handleCoreLocalSubscription(config, levelId) {
4679
4707
  await this.bridge.createCoreEventSubscription();
4680
4708
  config.scopeId = config.scopeId || levelId;
@@ -4934,7 +4962,7 @@ class IoC {
4934
4962
  }
4935
4963
  }
4936
4964
 
4937
- var version = "3.5.4";
4965
+ var version = "3.5.6";
4938
4966
 
4939
4967
  const composeAPI = (glue, ioc) => {
4940
4968
  const controller = ioc.controller;