@interopio/desktop 6.3.1 → 6.4.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,7 @@
1
+ 6.4.0
2
+ - feat: channels - add support for channel restrictions
3
+ - chore: update types
4
+ - chore: update schemas to 9.3.0 (was 9.2.0)
1
5
  6.3.1
2
6
  - chore: update core to 6.2.1 (was 6.1.0)
3
7
  6.3.0
package/desktop.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable @typescript-eslint/no-shadow */
2
- import { ApplicationConfig } from "@glue42/schemas";
2
+ import { ApplicationConfig } from "@interopio/schemas";
3
3
  import { IOConnectCore } from "@interopio/core";
4
4
  import { IOConnectWorkspaces } from "@interopio/workspaces-api";
5
5
  import { UnsubscribeFunction } from "callback-registry";
@@ -1070,7 +1070,7 @@ export declare namespace IOConnectDesktop {
1070
1070
  * Retrieves an app by name.
1071
1071
  * @param name Name of the desired app.
1072
1072
  */
1073
- application(name: string): Application;
1073
+ application(name: string): Application | undefined;
1074
1074
 
1075
1075
  /**
1076
1076
  * Retrieves a collection of the available apps.
@@ -2662,16 +2662,23 @@ export declare namespace IOConnectDesktop {
2662
2662
  borderColor?: string;
2663
2663
 
2664
2664
  /**
2665
- * Name of the Channel which the window will join.
2665
+ * Deprecated. Use `channelSelector` instead. Name of the Channel which the window will join.
2666
+ * @ignore
2666
2667
  */
2667
2668
  channelId?: string;
2668
2669
 
2669
2670
  /**
2670
- * If `true`, Channels will be enabled for the window and it will show the Channel Selector.
2671
+ * Deprecated. Use `channelSelector` instead. If `true`, Channels will be enabled for the window and it will show the Channel Selector.
2671
2672
  * @default false
2673
+ * @ignore
2672
2674
  */
2673
2675
  allowChannels?: boolean;
2674
2676
 
2677
+ /**
2678
+ * Settings for the Channel Selector UI.
2679
+ */
2680
+ channelSelector?: ChannelSelector;
2681
+
2675
2682
  /**
2676
2683
  * Defines the height of the window when collapsed.
2677
2684
  * @default -1
@@ -2962,6 +2969,36 @@ export declare namespace IOConnectDesktop {
2962
2969
  preloadScripts?: string[];
2963
2970
  }
2964
2971
 
2972
+ /**
2973
+ * Settings for the Channel Selector UI.
2974
+ */
2975
+ export interface ChannelSelector {
2976
+ /**
2977
+ * If `true`, will allow showing the Channel Selector.
2978
+ * @default false
2979
+ */
2980
+ enabled?: boolean;
2981
+
2982
+ /**
2983
+ * Type of the Channel Selector to show on the io.Connect Windows. A single Channel Selector (default) allows the window to join a single Channel
2984
+ * to which it can subscribe and publish data unrestrictedly. A directional single Channel Selector allows the window to join a single Channel,
2985
+ * but also enables the user to restrict the window from publishing or from subscribing to the current Channel.
2986
+ * @default "single"
2987
+ */
2988
+ type?: "single" | "directionalSingle";
2989
+
2990
+ /**
2991
+ * Name of the Channel to which the window will be joined by default when it's started.
2992
+ */
2993
+ channelId: string;
2994
+
2995
+ /**
2996
+ * If `true`, the Channel Selector will be visible, but the user won't be able to switch between Channels from it.
2997
+ * @default false
2998
+ */
2999
+ readOnly: boolean;
3000
+ }
3001
+
2965
3002
  /**
2966
3003
  * Options for loading a window URL.
2967
3004
  */
@@ -2982,8 +3019,7 @@ export declare namespace IOConnectDesktop {
2982
3019
  extraHeaders?: string;
2983
3020
 
2984
3021
  /**
2985
- * Data for the POST request. Either an array of `UploadFile` objects describing the location and other properties of the file to upload,
2986
- * or an array of `UploadBase64Data` objects containing data encoded as a Base64 string.
3022
+ * Data for the POST request. The list can contain both `UploadFile` objects (describing the location and other properties of the file to upload) and `UploadBase64Data` objects (containing data encoded as a Base64 string).
2987
3023
  */
2988
3024
  postData?: ((UploadBase64Data) | (UploadFile))[];
2989
3025
 
@@ -4256,7 +4292,7 @@ export declare namespace IOConnectDesktop {
4256
4292
  * @param options Options for closing the group that can be used to prevent closing the group and control whether to show a confirmation dialog before closing it.
4257
4293
  * @since io.Connect Desktop 9.3
4258
4294
  */
4259
- close(group: Group | string, options: CloseOptions): Promise<void>;
4295
+ close(group: Group | string, options?: CloseOptions): Promise<void>;
4260
4296
 
4261
4297
  /**
4262
4298
  * Lists all window groups.
@@ -4376,6 +4412,11 @@ export declare namespace IOConnectDesktop {
4376
4412
  */
4377
4413
  message: string;
4378
4414
 
4415
+ /**
4416
+ * Title for the message that will be displayed in the dialog.
4417
+ */
4418
+ messageTitle: string;
4419
+
4379
4420
  /**
4380
4421
  * If `true`, the user will be able to move the dialog.
4381
4422
  * @default true
@@ -4389,7 +4430,7 @@ export declare namespace IOConnectDesktop {
4389
4430
  transparent?: boolean;
4390
4431
 
4391
4432
  /**
4392
- * Title for the dialog to show.
4433
+ * Title for the dialog that will be displayed in the dialog header.
4393
4434
  */
4394
4435
  title?: string;
4395
4436
 
@@ -4567,7 +4608,7 @@ export declare namespace IOConnectDesktop {
4567
4608
  * @param window Window ID or a window object by which to find a window in the group.
4568
4609
  * @param success Callback function for handling the successfully returned result.
4569
4610
  */
4570
- find(window: string | IOConnectWindow, success?: (window: IOConnectWindow) => void): IOConnectWindow;
4611
+ find(window: string | IOConnectWindow, success?: (window: IOConnectWindow) => void): IOConnectWindow | undefined;
4571
4612
 
4572
4613
  /**
4573
4614
  * Restores a window group.
@@ -4626,11 +4667,11 @@ export declare namespace IOConnectDesktop {
4626
4667
  hide(): Promise<void>;
4627
4668
 
4628
4669
  /**
4629
- * Close a window group.
4630
- * @since 9.3.0
4631
- * @param options Options for closing the group that can be used to prevent closing the window and control whether to show a confirmation dialog before closing it.
4670
+ * Closes the window group.
4671
+ * @param options Options for closing the group that can be used to prevent closing the group and control whether to show a confirmation dialog before closing it.
4672
+ * @since io.Connect Desktop 9.3
4632
4673
  */
4633
- close(options: CloseOptions): Promise<void>;
4674
+ close(options?: CloseOptions): Promise<void>;
4634
4675
 
4635
4676
  /**
4636
4677
  * Creates a popup window.
@@ -4683,7 +4724,7 @@ export declare namespace IOConnectDesktop {
4683
4724
  /**
4684
4725
  * Retrieves the current window.
4685
4726
  */
4686
- my(): IOConnectWindow;
4727
+ my(): IOConnectWindow | undefined;
4687
4728
 
4688
4729
  /**
4689
4730
  * Opens a new io.Connect Window.
@@ -4701,7 +4742,7 @@ export declare namespace IOConnectDesktop {
4701
4742
  * @param success Callback function for handling the successfully returned result.
4702
4743
  * @param error Callback function for handling errors.
4703
4744
  */
4704
- find(name: string, success?: (window: IOConnectWindow) => void, error?: (error: string) => void): IOConnectWindow;
4745
+ find(name: string, success?: (window: IOConnectWindow) => void, error?: (error: string) => void): IOConnectWindow | undefined;
4705
4746
 
4706
4747
  /**
4707
4748
  * Finds a window by ID.
@@ -4709,7 +4750,7 @@ export declare namespace IOConnectDesktop {
4709
4750
  * @param success Callback function for handling the successfully returned result.
4710
4751
  * @param error Callback function for handling errors.
4711
4752
  */
4712
- findById(id: string, success?: (window: IOConnectWindow) => void, error?: (error: string) => void): IOConnectWindow;
4753
+ findById(id: string, success?: (window: IOConnectWindow) => void, error?: (error: string) => void): IOConnectWindow | undefined;
4713
4754
 
4714
4755
  /**
4715
4756
  * Lists all windows.
@@ -6822,15 +6863,16 @@ export declare namespace IOConnectDesktop {
6822
6863
  }
6823
6864
 
6824
6865
  /**
6825
- * Notification state.
6826
- * - `"Active"` - based on configuration, the notification is either visible as a toast, or is raised only in the Notification Panel, but the user hasn't seen it yet.
6827
- * When the toast is hidden, the user clicks on the toast, or sees the notification in the Notification Panel, the state will change;
6828
- * - `"Acknowledged"` - the user has seen the notification in the Notification Panel;
6829
- * - `"Closed"` - the notification has either been closed from its "Close" button, or the user has clicked on it or on an action in it;
6830
- * - `"Stale"` - the time specified in `toastExpiry` has elapsed;
6866
+ * Notification states that are used by the platform when handling notifications. These states can also be used in your custom logic for processing notifications on the client or on the server side. Defaults to `"Active"`.
6867
+ * - `"Active"` - a notification can be marked as active when it is raised, but the user hasn't seen it, or interacted in any way with it yet;
6868
+ * - `"Acknowledged"` - a notification can be marked as acknowledged when the user has interacted with it by clicking on the notification or on an action in it;
6869
+ * - `"Seen"` - a notification can be marked as seen when the user has seen it (e.g., by opening the Notification Panel);
6870
+ * - `"Closed"` - a notification can be marked as closed when the user has closed the notification in the Notification Panel;
6871
+ * - `"Stale"` - a notification can be marked as stale after a predefined period of time;
6872
+ * - `"Snoozed"` - a notification can be marked as snoozed when the user snoozes it from the UI;
6873
+ * - `"Processing"` - a notification can be marked as `"Processing"` when its state is in the process of changing (e.g., the user interacts with a notification from the UI, you make a request to a remote service to update the notification state, and you are still waiting for a response);
6831
6874
  */
6832
- export type State = "Active" | "Acknowledged" | "Closed" | "Stale";
6833
-
6875
+ export type State = "Active" | "Acknowledged" | "Seen" | "Closed" | "Stale" | "Snoozed" | "Processing";
6834
6876
  /**
6835
6877
  * Options for the clicked notification.
6836
6878
  */
@@ -18508,12 +18508,12 @@
18508
18508
  }
18509
18509
  async function setRestrictions(restrictions) {
18510
18510
  var _a;
18511
- const result = await interop.invoke(T42_ANNOUNCE_METHOD_NAME, {
18511
+ await interop.invoke(T42_ANNOUNCE_METHOD_NAME, {
18512
18512
  swId: (_a = restrictions.windowId) !== null && _a !== void 0 ? _a : windowId,
18513
18513
  command: "restrict",
18514
18514
  data: restrictions
18515
18515
  });
18516
- return result.returned;
18516
+ return;
18517
18517
  }
18518
18518
  async function getRestrictionsByWindow(id) {
18519
18519
  try {
@@ -18529,12 +18529,12 @@
18529
18529
  }
18530
18530
  async function setRestrictionsForAllChannels(restrictions) {
18531
18531
  var _a;
18532
- const result = await interop.invoke(T42_ANNOUNCE_METHOD_NAME, {
18532
+ await interop.invoke(T42_ANNOUNCE_METHOD_NAME, {
18533
18533
  swId: (_a = restrictions.windowId) !== null && _a !== void 0 ? _a : windowId,
18534
18534
  command: "restrictAll",
18535
18535
  data: restrictions
18536
18536
  });
18537
- return result.returned;
18537
+ return;
18538
18538
  }
18539
18539
  async function getWindowsWithChannels(filter) {
18540
18540
  const result = await interop.invoke(T42_ANNOUNCE_METHOD_NAME, { command: "getChannelsInfo", data: { filter } });
@@ -19059,7 +19059,7 @@
19059
19059
  };
19060
19060
  }
19061
19061
 
19062
- var version = "6.3.1";
19062
+ var version = "6.4.0";
19063
19063
 
19064
19064
  var prepareConfig = (options) => {
19065
19065
  function getLibConfig(value, defaultMode, trueMode) {