@interopio/desktop 6.8.2 → 6.9.0-rc.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,5 +1,3 @@
1
- 6.8.2
2
- - chore: Update ChannelContext's data type
3
1
  6.8.1
4
2
  - fix: ignore peerID when invocation target has instance
5
3
  6.8.0
package/desktop.d.ts CHANGED
@@ -224,6 +224,11 @@ export declare namespace IOConnectDesktop {
224
224
  * Cookies API.
225
225
  */
226
226
  cookies: IOConnectDesktop.Cookies.API;
227
+
228
+ /**
229
+ * Interception API.
230
+ */
231
+ interception: IOConnectDesktop.Interception.API;
227
232
  }
228
233
 
229
234
  /**
@@ -5961,13 +5966,13 @@ export declare namespace IOConnectDesktop {
5961
5966
  * Pinned tab windows don't have a "Close" button preventing the user from closing them. Available only for tab windows in web groups.
5962
5967
  * @since io.Connect Desktop 9.5
5963
5968
  */
5964
- pin(): Promise<void>;
5969
+ pin(): Promise<IOConnectWindow>;
5965
5970
 
5966
5971
  /**
5967
5972
  * 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.
5968
5973
  * @since io.Connect Desktop 9.5
5969
5974
  */
5970
- unpin(): Promise<void>;
5975
+ unpin(): Promise<IOConnectWindow>;
5971
5976
 
5972
5977
  /**
5973
5978
  * Executes code in the context of the io.Connect Window.
@@ -6433,6 +6438,18 @@ export declare namespace IOConnectDesktop {
6433
6438
  */
6434
6439
  addIntentListener(intent: string | AddIntentListenerRequest, handler: (context: IntentContext) => any): { unsubscribe: UnsubscribeFunction };
6435
6440
 
6441
+ /**
6442
+ * Notifies when a handler for the an Intent is added.
6443
+ * @param callback Callback function for handling the event.
6444
+ */
6445
+ onHandlerAdded(callback: (handler: IOConnectDesktop.Intents.ResolverIntentHandler) => void, intentName: string): UnsubscribeFunction;
6446
+
6447
+ /**
6448
+ * Notifies when a handler for the an Intent is removed.
6449
+ * @param callback Callback function for handling the event.
6450
+ */
6451
+ onHandlerRemoved(callback: (handler: IOConnectDesktop.Intents.ResolverIntentHandler)=> void, intentName: string): UnsubscribeFunction;
6452
+
6436
6453
  /**
6437
6454
  * Registers an Intent handler. If your app is already registered as an Intent handler through its configuration,
6438
6455
  * use this method to supply a handler for the specified Intent. Otherwise, you can use it to register your app as an Intent handler
@@ -7382,6 +7399,18 @@ export declare namespace IOConnectDesktop {
7382
7399
  * Settings for invoking an Interop method when the notification action is clicked.
7383
7400
  */
7384
7401
  interop?: InteropActionSettings;
7402
+
7403
+ /**
7404
+ * Unique ID for the notification action. This ID can be used in the `displayPath` property of another notification action to determine the position of the latter within the notification action menu.
7405
+ */
7406
+ displayId: string;
7407
+
7408
+ /**
7409
+ * List of `displayId` values or titles of other notification actions describing the path within the notification action menu where the current notification action will be placed (e.g., `[ "main-action-id", "My Nested Action" ]`).
7410
+ * The display ID takes precedence over the title when the framework searches for the respective item. If the provided display ID or title doesn't exist, an empty notification action will be created
7411
+ * (the action will have a dropdown menu that will contain other actions, but when the user clicks on the action itself, nothing will happen).
7412
+ */
7413
+ displayPath: string[];
7385
7414
  }
7386
7415
 
7387
7416
  /**
@@ -7877,4 +7906,129 @@ export declare namespace IOConnectDesktop {
7877
7906
  value: string;
7878
7907
  }
7879
7908
  }
7909
+
7910
+ /**
7911
+ * @intro
7912
+ * The Interception API enables apps to register interception handlers with which to modify the low-level platform operations.
7913
+ * Interception handlers can be executed before and/or after the default implementations of the platform operations,
7914
+ * and the execution of the default implementation for a platform operation can be prevented entirely.
7915
+ * This allows for finer control over the platform operations.
7916
+ * It's possible to register only a single interception handler per platform operation within an API domain.
7917
+ *
7918
+ * For an app to be able to register interception handlers, interception must be enabled
7919
+ * in the system configuration of **io.Connect Desktop** and the name of the app must be specified in the list of apps allowed to register interception handlers.
7920
+ *
7921
+ * *Available since io.Connect Desktop 9.6.*
7922
+ */
7923
+ export namespace Interception {
7924
+ /**
7925
+ * Interception API.
7926
+ */
7927
+ export interface API {
7928
+ /**
7929
+ * Registers an interception handler. It's possible to register only a single interception handler per platform operation within an API domain.
7930
+ * @param config Object containing the interception handler to register and settings describing the platform operations to intercept.
7931
+ */
7932
+ register(config: InterceptionRegistrationConfig): Promise<void>;
7933
+ /**
7934
+ * Unregisters all interception handlers for the specified platform operations.
7935
+ * @param config Object specifying the platform operations which to stop intercepting.
7936
+ */
7937
+ unregister(config: InterceptionUnregistrationConfig): Promise<void>;
7938
+ }
7939
+
7940
+ /**
7941
+ * Settings for registering an interception handler for the targeted platform operations.
7942
+ */
7943
+ export interface InterceptionRegistrationConfig {
7944
+ /**
7945
+ * Method implementation to be registered as a handler for the specified platform operations.
7946
+ * It's possible to register only a single interception handler per platform operation within an API domain.
7947
+ * @param message Object describing the intercepted platform operation.
7948
+ */
7949
+ handler: (message: InterceptionMessage) => Promise<InterceptionResponse | void>;
7950
+ /**
7951
+ * List of objects each describing a platform operation to intercept.
7952
+ */
7953
+ interceptions: Interception[];
7954
+ }
7955
+
7956
+ /**
7957
+ * Settings for unregistering the interception handlers for the targeted platform operations.
7958
+ */
7959
+ export interface InterceptionUnregistrationConfig {
7960
+ /**
7961
+ * List of objects each describing a platform operation which to stop intercepting.
7962
+ */
7963
+ interceptions: Interception[];
7964
+ }
7965
+
7966
+ /**
7967
+ * Describes an intercepted platform operation.
7968
+ */
7969
+ export interface InterceptionMessage {
7970
+ /**
7971
+ * The io.Connect API domain in which the platform operation has been intercepted.
7972
+ */
7973
+ domain: string;
7974
+ /**
7975
+ * The io.Connect platform operation that has been intercepted.
7976
+ */
7977
+ operation: string;
7978
+ /**
7979
+ * ID of the app that has invoked the platform operation. Can be used for tracking purposes.
7980
+ */
7981
+ callerId: string;
7982
+ /**
7983
+ * Specifies whether the platform operation has been intercepted before or after its execution.
7984
+ */
7985
+ phase: "before" | "after";
7986
+ /**
7987
+ * Arguments with which the intercepted platform operation was invoked.
7988
+ */
7989
+ operationArgs?: any[];
7990
+ }
7991
+
7992
+ /**
7993
+ * Describes the response returned by an interception handler.
7994
+ * If the platform operation has been intercepted before the execution of its default implementation and the interception handler returns `undefined` or an empty object,
7995
+ * the platform will proceed with the execution of the default operation implementation.
7996
+ * If the platform operation has been intercepted after the execution of its default implementation and the interception handler returns `undefined` or an empty object,
7997
+ * the platform will return the already calculated result.
7998
+ */
7999
+ export interface InterceptionResponse {
8000
+ /**
8001
+ * Arguments with which to proceed the execution of the intercepted platform operation.
8002
+ * This property is taken into account only when the platform operation is intercepted before the execution of its default implementation.
8003
+ */
8004
+ operationArgs?: any[];
8005
+ /**
8006
+ * Result from the platform operation. Use this property to return a result from your interception handler
8007
+ * when the platform operation has been intercepted after the execution of its default implementation.
8008
+ * If the platform operation has been intercepted before the execution of its default implementation and this property is set,
8009
+ * the execution of the default implementation will be prevented and the platform will return the specified result.
8010
+ */
8011
+ operationResult?: any;
8012
+ }
8013
+
8014
+ /**
8015
+ * Describes a platform operation to intercept and provides settings for its interception.
8016
+ */
8017
+ export interface Interception {
8018
+ /**
8019
+ * io.Connect API domain of the platform operation.
8020
+ */
8021
+ domain: string | "all";
8022
+ /**
8023
+ * Name of the io.Connect platform operation within the specified io.Connect API domain.
8024
+ * Set to `"all"` to intercept all operations within the domain.
8025
+ */
8026
+ operation: string | "all";
8027
+ /**
8028
+ * Specifies whether to intercept the platform operation before or after the execution of its default implementation.
8029
+ * Set to `"all"` to intercept the platform operation both before and after the execution of its default implementation.
8030
+ */
8031
+ phase?: "before" | "after" | "all";
8032
+ }
8033
+ }
7880
8034
  }