@interopio/desktop 6.7.0 → 6.8.1

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
+ 6.8.1
2
+ - fix: ignore peerID when invocation target has instance
3
+ 6.8.0
4
+ - feat: introduces onChannelRestrictionsChanged, isPinned, pin, unpin, executeCode, clearMany, setStates, snoozeMany
1
5
  6.7.0
2
6
  - feat: Extend channels methods with fdc3 options
3
7
  6.6.0
@@ -44,7 +48,7 @@
44
48
  - feat: intens - pass caller as a second arg to io.intents.register handler
45
49
  - feat: windows - introduce dock method and onDockingChanged
46
50
  - feat: windows - introduce autoArrange method
47
- - feat: notifications - add support for updating notification data field and listening for updates
51
+ - feat: notifications - add support for updating notification data field and listening for updates
48
52
  - fix: windows - fix isHibernated to return the correct value
49
53
  - fix: windows - memory leak
50
54
  - chore: notifications - add prefix to the logger
package/desktop.d.ts CHANGED
@@ -5215,6 +5215,13 @@ export declare namespace IOConnectDesktop {
5215
5215
  */
5216
5216
  allowWorkspaceDrop: boolean;
5217
5217
 
5218
+ /**
5219
+ * Flag indicating whether the tab of the current window is pinned. Pinned tabs are placed before the regular tab windows and they contain only the window title.
5220
+ * Pinned tab windows don't have a "Close" button, effectively preventing the user from closing them. Available only for tab windows in web groups.
5221
+ * @since io.Connect Desktop 9.5
5222
+ */
5223
+ isPinned: boolean;
5224
+
5218
5225
  /**
5219
5226
  * Attaches a tab window to the current tab window.
5220
5227
  * @param tab The instance or the name of the tab window to attach.
@@ -5935,11 +5942,38 @@ export declare namespace IOConnectDesktop {
5935
5942
  */
5936
5943
  onDockingChanged(callback: (window: IOConnectDesktop.Windows.IOConnectWindow, dockingPlacement: DockingPlacement) => void): UnsubscribeFunction
5937
5944
 
5945
+ /**
5946
+ * Notifies when the restrictions for any existing Channel have changed. Returns an unsubscribe function.
5947
+ * @param callback Callback function for handling the event.
5948
+ * @since io.Connect Desktop 9.5
5949
+ */
5950
+ onChannelRestrictionsChanged(callback: (restrictions: IOConnectDesktop.Channels.Restrictions) => void): () => void;
5951
+
5938
5952
  /**
5939
5953
  * Duplicates the current io.Connect Window.
5940
5954
  * @param options Optional start options that will override the default start options when cloning the window.
5941
5955
  */
5942
5956
  clone(options?: IOConnectDesktop.AppManager.ApplicationStartOptions): Promise<IOConnectWindow>
5957
+
5958
+ /**
5959
+ * Pins the tab of the current window. Pinned tabs are placed before the regular tab windows and contain only the window title.
5960
+ * Pinned tab windows don't have a "Close" button preventing the user from closing them. Available only for tab windows in web groups.
5961
+ * @since io.Connect Desktop 9.5
5962
+ */
5963
+ pin(): Promise<void>;
5964
+
5965
+ /**
5966
+ * Unpins the tab of the current window. The previously pinned tab reverts to a normal tab window containing a "Close" button. Available only for tab windows in web groups.
5967
+ * @since io.Connect Desktop 9.5
5968
+ */
5969
+ unpin(): Promise<void>;
5970
+
5971
+ /**
5972
+ * Executes code in the context of the io.Connect Window.
5973
+ * @param code Code to be executed in the context of the window. The code must be supplied as a string.
5974
+ * @since io.Connect Desktop 9.5
5975
+ */
5976
+ executeCode(code: string): Promise<any>
5943
5977
  }
5944
5978
 
5945
5979
  /**
@@ -6921,6 +6955,13 @@ export declare namespace IOConnectDesktop {
6921
6955
  */
6922
6956
  clear(id: string): Promise<void>;
6923
6957
 
6958
+ /**
6959
+ * Clears multiple notifications using a list of IDs.
6960
+ * @param notifications List of IDs of the notifications to clear.
6961
+ * @since io.Connect Desktop 9.5
6962
+ */
6963
+ clearMany(notifications: string[]): Promise<void>;
6964
+
6924
6965
  /**
6925
6966
  * Clicks programmatically a notification or a notification action.
6926
6967
  * @param id ID of the notification to click.
@@ -6936,6 +6977,14 @@ export declare namespace IOConnectDesktop {
6936
6977
  */
6937
6978
  setState(id: string, state: State): Promise<void>;
6938
6979
 
6980
+ /**
6981
+ * Sets multiple notifications to the same notification state.
6982
+ * @param notifications List of IDs of the notifications whose state to set.
6983
+ * @param state Value for the new notification state.
6984
+ * @since io.Connect Desktop 9.5
6985
+ */
6986
+ setStates(notifications: string[], state: IOConnectDesktop.Notifications.State): Promise<void>;
6987
+
6939
6988
  /**
6940
6989
  * Sets or updates the arbitrary data associated with the notification which is available in the `data` property of the notification.
6941
6990
  * @param id ID of the notification whose data to update.
@@ -6950,6 +6999,14 @@ export declare namespace IOConnectDesktop {
6950
6999
  */
6951
7000
  snooze(id: string, duration: number): Promise<void>;
6952
7001
 
7002
+ /**
7003
+ * Snoozes multiple notifications for the same duration.
7004
+ * @param notifications List of IDs of the notifications to snooze.
7005
+ * @param duration Interval in milliseconds for which to snooze the notifications.
7006
+ * @since io.Connect Desktop 9.5
7007
+ */
7008
+ snoozeMany(notifications: string[], duration: number): Promise<void>;
7009
+
6953
7010
  /**
6954
7011
  * Notifies when a new notification is raised.
6955
7012
  * @param callback Callback function for handling the event.
@@ -7813,4 +7870,4 @@ export declare namespace IOConnectDesktop {
7813
7870
  value: string;
7814
7871
  }
7815
7872
  }
7816
- }
7873
+ }
@@ -2933,7 +2933,7 @@
2933
2933
  }
2934
2934
  };
2935
2935
 
2936
- var version$1 = "6.4.0";
2936
+ var version$1 = "6.4.2";
2937
2937
 
2938
2938
  function prepareConfig$1 (configuration, ext, glue42gd) {
2939
2939
  let nodeStartingContext;
@@ -6164,6 +6164,10 @@
6164
6164
  return [];
6165
6165
  }
6166
6166
  instanceMatch(instanceFilter, instanceDefinition) {
6167
+ if (instanceFilter?.peerId && instanceFilter?.instance) {
6168
+ instanceFilter = { ...instanceFilter };
6169
+ delete instanceFilter.peerId;
6170
+ }
6167
6171
  return this.containsProps(instanceFilter, instanceDefinition);
6168
6172
  }
6169
6173
  methodMatch(methodFilter, methodDefinition) {
@@ -13161,6 +13165,7 @@
13161
13165
  let _frameId = options.frameId;
13162
13166
  let _isLocked = options.isLocked;
13163
13167
  let _allowWorkspaceDrop = options.allowWorkspaceDrop;
13168
+ let _isPinned = options.isPinned;
13164
13169
  let _group;
13165
13170
  let _frameButtons = (_d = options.frameButtons) !== null && _d !== void 0 ? _d : [];
13166
13171
  let _zoomFactor = options.zoomFactor;
@@ -13280,6 +13285,12 @@
13280
13285
  }
13281
13286
  return executor.setAllowWorkspaceDrop(resultWindow, allowWorkspaceDrop);
13282
13287
  }
13288
+ function pin() {
13289
+ return executor.pin(resultWindow);
13290
+ }
13291
+ function unpin() {
13292
+ return executor.unpin(resultWindow);
13293
+ }
13283
13294
  function moveResize(bounds, success, error) {
13284
13295
  return Utils.callbackifyPromise(() => {
13285
13296
  if (isUndefinedOrNull(bounds)) {
@@ -13647,6 +13658,16 @@
13647
13658
  async function clone(cloneOptions) {
13648
13659
  return executor.clone(resultWindow, cloneOptions);
13649
13660
  }
13661
+ async function executeCode(code) {
13662
+ if (!code) {
13663
+ throw new Error("Code argument is missing");
13664
+ }
13665
+ if (typeof code !== "string") {
13666
+ throw new Error("Code argument must be a valid string");
13667
+ }
13668
+ const response = await executor.executeCode(resultWindow, code);
13669
+ return response.result;
13670
+ }
13650
13671
  function onTitleChanged(callback) {
13651
13672
  if (!isFunction(callback)) {
13652
13673
  throw new Error("callback should be a function");
@@ -13759,6 +13780,12 @@
13759
13780
  function onTabSelectionChanged(callback) {
13760
13781
  return onEventCore("tab-selection-changed", callback);
13761
13782
  }
13783
+ function onChannelRestrictionsChanged(callback) {
13784
+ if (!isFunction(callback)) {
13785
+ throw new Error("callback must be a function");
13786
+ }
13787
+ return onEventCore("channel-restrictions-changed", callback);
13788
+ }
13762
13789
  function onClosing(callback) {
13763
13790
  if (!isFunction(callback)) {
13764
13791
  throw new Error("callback must be a function");
@@ -13863,6 +13890,7 @@
13863
13890
  _frameId = updated.frameId;
13864
13891
  _isLocked = updated.isLocked;
13865
13892
  _allowWorkspaceDrop = updated.allowWorkspaceDrop;
13893
+ _isPinned = updated.isPinned;
13866
13894
  _zoomFactor = updated.zoomFactor;
13867
13895
  _placementSettings = updated.placementSettings;
13868
13896
  }
@@ -13986,6 +14014,10 @@
13986
14014
  _allowWorkspaceDrop = allowWorkspaceDrop;
13987
14015
  _registry.execute("allow-workspace-drop-changed", resultWindow);
13988
14016
  }
14017
+ function handleIsPinnedChanged(isPinned) {
14018
+ _isPinned = isPinned;
14019
+ _registry.execute("is-pinned-changed", resultWindow);
14020
+ }
13989
14021
  function handleGroupHeaderVisibilityChanged(isGroupHeaderVisible) {
13990
14022
  _isGroupHeaderVisible = isGroupHeaderVisible;
13991
14023
  }
@@ -14078,6 +14110,9 @@
14078
14110
  claimScreenArea: data.claimScreenArea
14079
14111
  });
14080
14112
  }
14113
+ function handleChannelRestrictionsChanged(data) {
14114
+ _registry.execute("channel-restrictions-changed", data);
14115
+ }
14081
14116
  function handleGroupChanged(newGroup, oldGroup) {
14082
14117
  _group = newGroup;
14083
14118
  _groupId = newGroup === null || newGroup === void 0 ? void 0 : newGroup.id;
@@ -14326,6 +14361,9 @@
14326
14361
  get allowWorkspaceDrop() {
14327
14362
  return _allowWorkspaceDrop;
14328
14363
  },
14364
+ get isPinned() {
14365
+ return _isPinned;
14366
+ },
14329
14367
  maximize,
14330
14368
  restore,
14331
14369
  minimize,
@@ -14377,6 +14415,8 @@
14377
14415
  flashTab,
14378
14416
  setSticky,
14379
14417
  setAllowWorkspaceDrop,
14418
+ pin,
14419
+ unpin,
14380
14420
  print,
14381
14421
  printToPDF,
14382
14422
  place,
@@ -14390,6 +14430,7 @@
14390
14430
  getDockingPlacement,
14391
14431
  dock,
14392
14432
  clone,
14433
+ executeCode,
14393
14434
  getChannel: async () => {
14394
14435
  var _a;
14395
14436
  const wins = await getChannels().getWindowsWithChannels({ windowIds: [_id] });
@@ -14429,6 +14470,7 @@
14429
14470
  onNeighboursChanged,
14430
14471
  onDockingChanged,
14431
14472
  onNavigating,
14473
+ onChannelRestrictionsChanged,
14432
14474
  get tabs() {
14433
14475
  return getAllTabs();
14434
14476
  },
@@ -14509,6 +14551,7 @@
14509
14551
  handleFrameSelectionChanged,
14510
14552
  handleCompositionChanged,
14511
14553
  handleAllowWorkspaceDropChanged,
14554
+ handleIsPinnedChanged,
14512
14555
  handleGroupHeaderVisibilityChanged,
14513
14556
  handleTabHeaderVisibilityChanged,
14514
14557
  handleGroupChanged,
@@ -14519,7 +14562,8 @@
14519
14562
  handleZoomFactorChanged,
14520
14563
  handleIsStickyChanged,
14521
14564
  handlePlacementSettingsChanged,
14522
- handleDockingChanged
14565
+ handleDockingChanged,
14566
+ handleChannelRestrictionsChanged
14523
14567
  };
14524
14568
  const groupArgs = {
14525
14569
  get isGroupHibernated() {
@@ -14730,6 +14774,20 @@
14730
14774
  await this.execute("setAllowWorkspaceDrop", options);
14731
14775
  return w;
14732
14776
  }
14777
+ async pin(windowToPin) {
14778
+ const options = {
14779
+ windowId: windowToPin.id
14780
+ };
14781
+ await this.execute("pinTab", options);
14782
+ return windowToPin;
14783
+ }
14784
+ async unpin(pinnedWindow) {
14785
+ const options = {
14786
+ windowId: pinnedWindow.id
14787
+ };
14788
+ await this.execute("unpinTab", options);
14789
+ return pinnedWindow;
14790
+ }
14733
14791
  async moveResize(w, bounds) {
14734
14792
  if (typeof window !== "undefined" && window.glueDesktop.versionNum < 31200) {
14735
14793
  return new Promise(async (res, rej) => {
@@ -15246,6 +15304,15 @@
15246
15304
  const win = await windowStore.waitFor(result.id);
15247
15305
  return win.API;
15248
15306
  }
15307
+ async executeCode(targetWindow, code) {
15308
+ const args = {
15309
+ windowId: targetWindow.id,
15310
+ options: {
15311
+ code
15312
+ }
15313
+ };
15314
+ return this.execute("executeCode", args);
15315
+ }
15249
15316
  async goBack(resultWindow) {
15250
15317
  await this.execute("goBack", { windowId: resultWindow.id });
15251
15318
  }
@@ -15781,6 +15848,12 @@
15781
15848
  if (windowInfo.type === "AllowWorkspaceDropChanged") {
15782
15849
  theWindowEvents.handleAllowWorkspaceDropChanged(windowInfo.data);
15783
15850
  }
15851
+ if (windowInfo.type === "IsPinnedChanged") {
15852
+ theWindowEvents.handleIsPinnedChanged(windowInfo.data);
15853
+ }
15854
+ if (windowInfo.type === "WindowChannelRestrictionsChanged") {
15855
+ theWindowEvents.handleChannelRestrictionsChanged(windowInfo.data);
15856
+ }
15784
15857
  this._registry.execute("window-event", extendedStreamEvent);
15785
15858
  }
15786
15859
  createWindow(windowId, options) {
@@ -15837,7 +15910,8 @@
15837
15910
  frameButtons: args.frameButtons,
15838
15911
  jumpListOptions: args.jumpList,
15839
15912
  applicationName: args.applicationName,
15840
- allowWorkspaceDrop: args.allowWorkspaceDrop
15913
+ allowWorkspaceDrop: args.allowWorkspaceDrop,
15914
+ isPinned: args.isPinned
15841
15915
  };
15842
15916
  }
15843
15917
  mapToGroupCreationArgs(args) {
@@ -18356,7 +18430,7 @@
18356
18430
  };
18357
18431
  }
18358
18432
 
18359
- var version = "6.6.0";
18433
+ var version = "6.8.1";
18360
18434
 
18361
18435
  var prepareConfig = (options) => {
18362
18436
  function getLibConfig(value, defaultMode, trueMode) {
@@ -18691,12 +18765,26 @@
18691
18765
  }
18692
18766
  await this.interop.invoke(this.NotificationsExecuteMethod, { command: "clear", data: { id } });
18693
18767
  }
18768
+ async clearMany(notifications) {
18769
+ this.validateNotificationsArr(notifications);
18770
+ await this.interop.invoke(this.NotificationsExecuteMethod, { command: "clearMany", data: { notifications } });
18771
+ }
18694
18772
  async click(id, action, options) {
18695
18773
  await this.interop.invoke(this.NotificationsExecuteMethod, { command: "click", data: { id, action, options } });
18696
18774
  }
18697
18775
  async snooze(id, duration) {
18698
18776
  await this.interop.invoke(this.NotificationsExecuteMethod, { command: "snooze", data: { id, duration } });
18699
18777
  }
18778
+ async snoozeMany(notifications, duration) {
18779
+ if (!duration) {
18780
+ throw new Error("The 'duration' argument cannot be null or undefined");
18781
+ }
18782
+ if (typeof duration !== "number") {
18783
+ throw new Error("The 'duration' argument must be a valid number");
18784
+ }
18785
+ this.validateNotificationsArr(notifications);
18786
+ await this.interop.invoke(this.NotificationsExecuteMethod, { command: "snoozeMany", data: { notifications, duration } });
18787
+ }
18700
18788
  async setState(id, state) {
18701
18789
  if (!id) {
18702
18790
  throw new Error("The 'id' argument cannot be null or undefined");
@@ -18710,6 +18798,16 @@
18710
18798
  this.validateState(state);
18711
18799
  await this.interop.invoke(this.NotificationsExecuteMethod, { command: "updateState", data: { id, state } });
18712
18800
  }
18801
+ async setStates(notifications, state) {
18802
+ if (!state) {
18803
+ throw new Error("The 'state' argument cannot be null or undefined");
18804
+ }
18805
+ if (typeof state !== "string") {
18806
+ throw new Error("The 'state' argument must be a valid string");
18807
+ }
18808
+ this.validateNotificationsArr(notifications);
18809
+ await this.interop.invoke(this.NotificationsExecuteMethod, { command: "updateStates", data: { notifications, state } });
18810
+ }
18713
18811
  toAPI() {
18714
18812
  return {
18715
18813
  maxActions: this.maxActions,
@@ -18732,7 +18830,10 @@
18732
18830
  click: this.click.bind(this),
18733
18831
  setState: this.setState.bind(this),
18734
18832
  updateData: this.updateData.bind(this),
18735
- snooze: this.snooze.bind(this)
18833
+ snooze: this.snooze.bind(this),
18834
+ snoozeMany: this.snoozeMany.bind(this),
18835
+ clearMany: this.clearMany.bind(this),
18836
+ setStates: this.setStates.bind(this)
18736
18837
  };
18737
18838
  }
18738
18839
  onStreamEventCore(key, callback) {
@@ -19114,6 +19215,14 @@
19114
19215
  this.subscriptionForCounter = undefined;
19115
19216
  }
19116
19217
  }
19218
+ validateNotificationsArr(notifications) {
19219
+ if (!Array.isArray(notifications)) {
19220
+ throw new Error("The 'notifications' argument must be an array with valid notification IDs");
19221
+ }
19222
+ if (notifications.some((n) => typeof n !== "string")) {
19223
+ throw new Error("The 'notifications' argument must contain only valid string notification IDs");
19224
+ }
19225
+ }
19117
19226
  }
19118
19227
 
19119
19228
  const ThemesConfigurationMethodName = "T42.Themes.Configuration";