@resconet/jsbridge 17.1.9 → 18.0.0-beta.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@resconet/jsbridge",
3
- "version": "17.1.9",
3
+ "version": "18.0.0-beta.1",
4
4
  "main": "./src/JSBridge.js",
5
5
  "types": "./src/JSBridge.d.ts",
6
6
  "description": "Install npm JSBridge module",
package/src/JSBridge.d.ts CHANGED
@@ -70,6 +70,16 @@ declare namespace MobileCRM {
70
70
  public static requestObject(callback: (config: Configuration) => void, erroCallback?: (error: string) => void, scope?: any);
71
71
  }
72
72
 
73
+ class GlobalConstants {
74
+ /**Gets the JSON object representing the GlobalConstants variables. */
75
+ public static getAllAsync(): Promise<Object>;
76
+ /**
77
+ *Gets the constant associated with specified key in the GlobalConstants variables.
78
+ * @param key The key of the constant to get.
79
+ */
80
+ public static getAsync(key: String): Promise<Object>;
81
+ }
82
+
73
83
  class Settings {
74
84
  /**Gets the absolute URL (including the CrmOrganization).*/
75
85
  absoluteUrl: string;
@@ -2118,7 +2128,21 @@ declare module MobileCRM.UI {
2118
2128
  */
2119
2129
  public static openSalesEntityDetail(detail: MobileCRM.DynamicEntity, errorCallback: (err?: string) => void);
2120
2130
  /**
2121
- * @ since 9.3
2131
+ * @since 18.0
2132
+ * The clearance must be dutifully released using leaveUiTransaction() when manipulation is finished.
2133
+ * The clearance will not be obtained if background sync is running and form sync behavior is configured to 'Block save during sync'
2134
+ * or 'Block save during sync and prevent sync while form is open'".
2135
+ * If form sync behavior is configured as 'No action', the clearance is always obtained.
2136
+ * @returns true if form can give the clearance, false if it is not possible at this time.
2137
+ */
2138
+ public static tryEnterUiTransaction(): Promise<boolean>;
2139
+ /**
2140
+ * @since 18.0
2141
+ * Notifies UI form that clearance obtained using successful call to tryEnterUiTransaction() is no longer needed, because data manipulation is complete.
2142
+ */
2143
+ public static leaveUiTransaction(): Promise;
2144
+ /**
2145
+ * @since 9.3
2122
2146
  * Binds or unbinds the handler for onSelectedViewChanged event on EntityForm.
2123
2147
  * @description Bound handler is called with the EntityForm object as an argument. The EntityForm context object contains 'selectedView' property with the name of currently selected view.
2124
2148
  * @param handler The handler function that has to be bound or unbound.
package/src/JSBridge.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable @typescript-eslint/no-this-alias */
2
2
  /* globals MobileCRM:writable, MobileCrmException:writable, CrmBridge, webkit, chrome */
3
3
  (function () {
4
- var _scriptVersion = 17.1;
4
+ var _scriptVersion = 18.0;
5
5
  // Private objects & functions
6
6
  var _inherit = (function () {
7
7
  function _() {
@@ -219,6 +219,9 @@
219
219
  /// <field name="settings" type="MobileCRM._Settings">Gets the application settings.</field>
220
220
  /// <field name="storageDirectory" type="String">Gets the root folder of the application storage.</field>
221
221
  },
222
+ GlobalConstants: function () {
223
+ /// <summary>Provides access to the global constants.</summary>
224
+ },
222
225
  CultureInfo: function () {
223
226
  /// <summary>[v10.2] Provides information about current device culture. The information includes the names for the culture, the writing system, the calendar used, and formatting for dates.</summary>
224
227
  /// <field name="name" type="String">Gets the culture name in the format languageCode/region (e.g. &quot;en-US&quot;). languageCode is a lowercase two-letter code derived from ISO 639-1. regioncode is derived from ISO 3166 and usually consists of two uppercase letters.</field>
@@ -1680,6 +1683,18 @@
1680
1683
  scope
1681
1684
  );
1682
1685
  };
1686
+ //MobileCRM.GlobalConstants
1687
+ MobileCRM.GlobalConstants.getAllAsync = function () {
1688
+ /// <summary>Asynchronously returns the JSON object representing the GlobalConstants variables.</summary>
1689
+ /// <returns type="Promise&lt;Object&gt;">A Promise object that will be resolved with the properties representing the constant variables.</returns>
1690
+ return MobileCRM.bridge.invokeCommandPromise("getGlobalConstants", "");
1691
+ };
1692
+ MobileCRM.GlobalConstants.getAsync = function (key) {
1693
+ /// <summary>Asynchronously returns the constant associated with the specified key in the GlobalConstants variables.</summary>
1694
+ /// <param name="key" type="String">The key of the constant to get.</param>
1695
+ /// <returns type="Promise&lt;Object&gt;">A Promise object that will be resolved with an object representing the constant variable.</returns>
1696
+ return MobileCRM.bridge.invokeCommandPromise("getGlobalConstants", key);
1697
+ };
1683
1698
  // MobileCRM._Settings
1684
1699
  MobileCRM._Settings = {
1685
1700
  /// <summary>MobileCRM configuration settings class.</summary>
@@ -5746,6 +5761,20 @@
5746
5761
  /// <param name="errorCallback" type="function(errorMsg)">The errorCallback which is called asynchronously in case of error.</param>
5747
5762
  MobileCRM.bridge.invokeMethodAsync("EntityForm", "ShowEntityDetailDialog", [detail.id], null, errorCallback, null);
5748
5763
  };
5764
+ /// <summary>[v18.0] Obtains a clearance to perform manipulation with data.
5765
+ /// The clearance must be dutifully released using leaveUiTransaction() when manipulation is finished.
5766
+ /// The clearance will not be obtained if background sync is running and form sync behavior is configured to 'Block save during sync'
5767
+ /// or 'Block save during sync and prevent sync while form is open'".
5768
+ /// If form sync behavior is configured as 'No action', the clearance is always obtained.
5769
+ /// </summary>
5770
+ /// <returns>Returns true if form can give the clearance, false if it is not possible at this time.</returns>
5771
+ MobileCRM.UI.EntityForm.tryEnterUiTransaction = function () {
5772
+ return MobileCRM.bridge.invokeCommandPromise("tryEnterUiTransaction");
5773
+ };
5774
+ /// <summary>[v18.0] Notifies UI form that clearance obtained using successful call to tryEnterUiTransaction() is no longer needed, because data manipulation is complete.</summary>
5775
+ MobileCRM.UI.EntityForm.leaveUiTransaction = function () {
5776
+ return MobileCRM.bridge.invokeCommandPromise("leaveUiTransaction");
5777
+ };
5749
5778
  // MobileCRM.UI.EntityForm.DetailCollection
5750
5779
  MobileCRM.UI.EntityForm.DetailCollection = function () {
5751
5780
  /// <summary>Provides functions accessing the collection of the sales entity details (e.g. Order details)</summary>