@interopio/desktop 6.7.0 → 6.8.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.
package/changelog.md CHANGED
@@ -1,3 +1,5 @@
1
+ 6.8.0
2
+ - feat: introduces onChannelRestrictionsChanged, isPinned, pin, unpin, executeCode, clearMany, setStates, snoozeMany
1
3
  6.7.0
2
4
  - feat: Extend channels methods with fdc3 options
3
5
  6.6.0
@@ -44,7 +46,7 @@
44
46
  - feat: intens - pass caller as a second arg to io.intents.register handler
45
47
  - feat: windows - introduce dock method and onDockingChanged
46
48
  - feat: windows - introduce autoArrange method
47
- - feat: notifications - add support for updating notification data field and listening for updates
49
+ - feat: notifications - add support for updating notification data field and listening for updates
48
50
  - fix: windows - fix isHibernated to return the correct value
49
51
  - fix: windows - memory leak
50
52
  - 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.1";
2937
2937
 
2938
2938
  function prepareConfig$1 (configuration, ext, glue42gd) {
2939
2939
  let nodeStartingContext;
@@ -13161,6 +13161,7 @@
13161
13161
  let _frameId = options.frameId;
13162
13162
  let _isLocked = options.isLocked;
13163
13163
  let _allowWorkspaceDrop = options.allowWorkspaceDrop;
13164
+ let _isPinned = options.isPinned;
13164
13165
  let _group;
13165
13166
  let _frameButtons = (_d = options.frameButtons) !== null && _d !== void 0 ? _d : [];
13166
13167
  let _zoomFactor = options.zoomFactor;
@@ -13280,6 +13281,12 @@
13280
13281
  }
13281
13282
  return executor.setAllowWorkspaceDrop(resultWindow, allowWorkspaceDrop);
13282
13283
  }
13284
+ function pin() {
13285
+ return executor.pin(resultWindow);
13286
+ }
13287
+ function unpin() {
13288
+ return executor.unpin(resultWindow);
13289
+ }
13283
13290
  function moveResize(bounds, success, error) {
13284
13291
  return Utils.callbackifyPromise(() => {
13285
13292
  if (isUndefinedOrNull(bounds)) {
@@ -13647,6 +13654,16 @@
13647
13654
  async function clone(cloneOptions) {
13648
13655
  return executor.clone(resultWindow, cloneOptions);
13649
13656
  }
13657
+ async function executeCode(code) {
13658
+ if (!code) {
13659
+ throw new Error("Code argument is missing");
13660
+ }
13661
+ if (typeof code !== "string") {
13662
+ throw new Error("Code argument must be a valid string");
13663
+ }
13664
+ const response = await executor.executeCode(resultWindow, code);
13665
+ return response.result;
13666
+ }
13650
13667
  function onTitleChanged(callback) {
13651
13668
  if (!isFunction(callback)) {
13652
13669
  throw new Error("callback should be a function");
@@ -13759,6 +13776,12 @@
13759
13776
  function onTabSelectionChanged(callback) {
13760
13777
  return onEventCore("tab-selection-changed", callback);
13761
13778
  }
13779
+ function onChannelRestrictionsChanged(callback) {
13780
+ if (!isFunction(callback)) {
13781
+ throw new Error("callback must be a function");
13782
+ }
13783
+ return onEventCore("channel-restrictions-changed", callback);
13784
+ }
13762
13785
  function onClosing(callback) {
13763
13786
  if (!isFunction(callback)) {
13764
13787
  throw new Error("callback must be a function");
@@ -13863,6 +13886,7 @@
13863
13886
  _frameId = updated.frameId;
13864
13887
  _isLocked = updated.isLocked;
13865
13888
  _allowWorkspaceDrop = updated.allowWorkspaceDrop;
13889
+ _isPinned = updated.isPinned;
13866
13890
  _zoomFactor = updated.zoomFactor;
13867
13891
  _placementSettings = updated.placementSettings;
13868
13892
  }
@@ -13986,6 +14010,10 @@
13986
14010
  _allowWorkspaceDrop = allowWorkspaceDrop;
13987
14011
  _registry.execute("allow-workspace-drop-changed", resultWindow);
13988
14012
  }
14013
+ function handleIsPinnedChanged(isPinned) {
14014
+ _isPinned = isPinned;
14015
+ _registry.execute("is-pinned-changed", resultWindow);
14016
+ }
13989
14017
  function handleGroupHeaderVisibilityChanged(isGroupHeaderVisible) {
13990
14018
  _isGroupHeaderVisible = isGroupHeaderVisible;
13991
14019
  }
@@ -14078,6 +14106,9 @@
14078
14106
  claimScreenArea: data.claimScreenArea
14079
14107
  });
14080
14108
  }
14109
+ function handleChannelRestrictionsChanged(data) {
14110
+ _registry.execute("channel-restrictions-changed", data);
14111
+ }
14081
14112
  function handleGroupChanged(newGroup, oldGroup) {
14082
14113
  _group = newGroup;
14083
14114
  _groupId = newGroup === null || newGroup === void 0 ? void 0 : newGroup.id;
@@ -14326,6 +14357,9 @@
14326
14357
  get allowWorkspaceDrop() {
14327
14358
  return _allowWorkspaceDrop;
14328
14359
  },
14360
+ get isPinned() {
14361
+ return _isPinned;
14362
+ },
14329
14363
  maximize,
14330
14364
  restore,
14331
14365
  minimize,
@@ -14377,6 +14411,8 @@
14377
14411
  flashTab,
14378
14412
  setSticky,
14379
14413
  setAllowWorkspaceDrop,
14414
+ pin,
14415
+ unpin,
14380
14416
  print,
14381
14417
  printToPDF,
14382
14418
  place,
@@ -14390,6 +14426,7 @@
14390
14426
  getDockingPlacement,
14391
14427
  dock,
14392
14428
  clone,
14429
+ executeCode,
14393
14430
  getChannel: async () => {
14394
14431
  var _a;
14395
14432
  const wins = await getChannels().getWindowsWithChannels({ windowIds: [_id] });
@@ -14429,6 +14466,7 @@
14429
14466
  onNeighboursChanged,
14430
14467
  onDockingChanged,
14431
14468
  onNavigating,
14469
+ onChannelRestrictionsChanged,
14432
14470
  get tabs() {
14433
14471
  return getAllTabs();
14434
14472
  },
@@ -14509,6 +14547,7 @@
14509
14547
  handleFrameSelectionChanged,
14510
14548
  handleCompositionChanged,
14511
14549
  handleAllowWorkspaceDropChanged,
14550
+ handleIsPinnedChanged,
14512
14551
  handleGroupHeaderVisibilityChanged,
14513
14552
  handleTabHeaderVisibilityChanged,
14514
14553
  handleGroupChanged,
@@ -14519,7 +14558,8 @@
14519
14558
  handleZoomFactorChanged,
14520
14559
  handleIsStickyChanged,
14521
14560
  handlePlacementSettingsChanged,
14522
- handleDockingChanged
14561
+ handleDockingChanged,
14562
+ handleChannelRestrictionsChanged
14523
14563
  };
14524
14564
  const groupArgs = {
14525
14565
  get isGroupHibernated() {
@@ -14730,6 +14770,20 @@
14730
14770
  await this.execute("setAllowWorkspaceDrop", options);
14731
14771
  return w;
14732
14772
  }
14773
+ async pin(windowToPin) {
14774
+ const options = {
14775
+ windowId: windowToPin.id
14776
+ };
14777
+ await this.execute("pinTab", options);
14778
+ return windowToPin;
14779
+ }
14780
+ async unpin(pinnedWindow) {
14781
+ const options = {
14782
+ windowId: pinnedWindow.id
14783
+ };
14784
+ await this.execute("unpinTab", options);
14785
+ return pinnedWindow;
14786
+ }
14733
14787
  async moveResize(w, bounds) {
14734
14788
  if (typeof window !== "undefined" && window.glueDesktop.versionNum < 31200) {
14735
14789
  return new Promise(async (res, rej) => {
@@ -15246,6 +15300,15 @@
15246
15300
  const win = await windowStore.waitFor(result.id);
15247
15301
  return win.API;
15248
15302
  }
15303
+ async executeCode(targetWindow, code) {
15304
+ const args = {
15305
+ windowId: targetWindow.id,
15306
+ options: {
15307
+ code
15308
+ }
15309
+ };
15310
+ return this.execute("executeCode", args);
15311
+ }
15249
15312
  async goBack(resultWindow) {
15250
15313
  await this.execute("goBack", { windowId: resultWindow.id });
15251
15314
  }
@@ -15781,6 +15844,12 @@
15781
15844
  if (windowInfo.type === "AllowWorkspaceDropChanged") {
15782
15845
  theWindowEvents.handleAllowWorkspaceDropChanged(windowInfo.data);
15783
15846
  }
15847
+ if (windowInfo.type === "IsPinnedChanged") {
15848
+ theWindowEvents.handleIsPinnedChanged(windowInfo.data);
15849
+ }
15850
+ if (windowInfo.type === "WindowChannelRestrictionsChanged") {
15851
+ theWindowEvents.handleChannelRestrictionsChanged(windowInfo.data);
15852
+ }
15784
15853
  this._registry.execute("window-event", extendedStreamEvent);
15785
15854
  }
15786
15855
  createWindow(windowId, options) {
@@ -15837,7 +15906,8 @@
15837
15906
  frameButtons: args.frameButtons,
15838
15907
  jumpListOptions: args.jumpList,
15839
15908
  applicationName: args.applicationName,
15840
- allowWorkspaceDrop: args.allowWorkspaceDrop
15909
+ allowWorkspaceDrop: args.allowWorkspaceDrop,
15910
+ isPinned: args.isPinned
15841
15911
  };
15842
15912
  }
15843
15913
  mapToGroupCreationArgs(args) {
@@ -18356,7 +18426,7 @@
18356
18426
  };
18357
18427
  }
18358
18428
 
18359
- var version = "6.6.0";
18429
+ var version = "6.8.0";
18360
18430
 
18361
18431
  var prepareConfig = (options) => {
18362
18432
  function getLibConfig(value, defaultMode, trueMode) {
@@ -18691,12 +18761,26 @@
18691
18761
  }
18692
18762
  await this.interop.invoke(this.NotificationsExecuteMethod, { command: "clear", data: { id } });
18693
18763
  }
18764
+ async clearMany(notifications) {
18765
+ this.validateNotificationsArr(notifications);
18766
+ await this.interop.invoke(this.NotificationsExecuteMethod, { command: "clearMany", data: { notifications } });
18767
+ }
18694
18768
  async click(id, action, options) {
18695
18769
  await this.interop.invoke(this.NotificationsExecuteMethod, { command: "click", data: { id, action, options } });
18696
18770
  }
18697
18771
  async snooze(id, duration) {
18698
18772
  await this.interop.invoke(this.NotificationsExecuteMethod, { command: "snooze", data: { id, duration } });
18699
18773
  }
18774
+ async snoozeMany(notifications, duration) {
18775
+ if (!duration) {
18776
+ throw new Error("The 'duration' argument cannot be null or undefined");
18777
+ }
18778
+ if (typeof duration !== "number") {
18779
+ throw new Error("The 'duration' argument must be a valid number");
18780
+ }
18781
+ this.validateNotificationsArr(notifications);
18782
+ await this.interop.invoke(this.NotificationsExecuteMethod, { command: "snoozeMany", data: { notifications, duration } });
18783
+ }
18700
18784
  async setState(id, state) {
18701
18785
  if (!id) {
18702
18786
  throw new Error("The 'id' argument cannot be null or undefined");
@@ -18710,6 +18794,16 @@
18710
18794
  this.validateState(state);
18711
18795
  await this.interop.invoke(this.NotificationsExecuteMethod, { command: "updateState", data: { id, state } });
18712
18796
  }
18797
+ async setStates(notifications, state) {
18798
+ if (!state) {
18799
+ throw new Error("The 'state' argument cannot be null or undefined");
18800
+ }
18801
+ if (typeof state !== "string") {
18802
+ throw new Error("The 'state' argument must be a valid string");
18803
+ }
18804
+ this.validateNotificationsArr(notifications);
18805
+ await this.interop.invoke(this.NotificationsExecuteMethod, { command: "updateStates", data: { notifications, state } });
18806
+ }
18713
18807
  toAPI() {
18714
18808
  return {
18715
18809
  maxActions: this.maxActions,
@@ -18732,7 +18826,10 @@
18732
18826
  click: this.click.bind(this),
18733
18827
  setState: this.setState.bind(this),
18734
18828
  updateData: this.updateData.bind(this),
18735
- snooze: this.snooze.bind(this)
18829
+ snooze: this.snooze.bind(this),
18830
+ snoozeMany: this.snoozeMany.bind(this),
18831
+ clearMany: this.clearMany.bind(this),
18832
+ setStates: this.setStates.bind(this)
18736
18833
  };
18737
18834
  }
18738
18835
  onStreamEventCore(key, callback) {
@@ -19114,6 +19211,14 @@
19114
19211
  this.subscriptionForCounter = undefined;
19115
19212
  }
19116
19213
  }
19214
+ validateNotificationsArr(notifications) {
19215
+ if (!Array.isArray(notifications)) {
19216
+ throw new Error("The 'notifications' argument must be an array with valid notification IDs");
19217
+ }
19218
+ if (notifications.some((n) => typeof n !== "string")) {
19219
+ throw new Error("The 'notifications' argument must contain only valid string notification IDs");
19220
+ }
19221
+ }
19117
19222
  }
19118
19223
 
19119
19224
  const ThemesConfigurationMethodName = "T42.Themes.Configuration";