@resconet/jsbridge 18.2.0 → 19.0.0-beta.2

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": "18.2.0",
3
+ "version": "19.0.0-beta.2",
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
@@ -241,6 +241,8 @@ declare namespace MobileCRM {
241
241
  syncFilterHash: string;
242
242
  /**Gets or sets the current user GUID (given by the server).*/
243
243
  systemUserId: string;
244
+ /**Gets or sets the current user name (given by the server).*/
245
+ systemUserName: string;
244
246
  /**Gets or sets the last active entity in the Tourplan (Calendar).*/
245
247
  tourplanInitialEntity: string;
246
248
  /**Gets or sets whether to update entity objectypecodes on first sync.*/
@@ -2730,6 +2732,13 @@ declare module MobileCRM.UI {
2730
2732
  * @param scope A scope for calling the callbacks.
2731
2733
  */
2732
2734
  public static repeatGroup(id: string, copyValues?: boolean, errorCallback?: (err: string) => void, scope?: any);
2735
+ /**
2736
+ * Duplicates repeatable group with all its questions. The name of the group will contain the lowest available repeatIndex and suffix in form #00X.
2737
+ * @param id Id of the source group
2738
+ * @param copyValues Optional parameter determining whether the source group values should be copied to the new instance of the group.
2739
+ * @returns A promise resolved when the operation is completed.
2740
+ */
2741
+ public static repeatGroupAsync(id: string, copyValues?: boolean): Promise<void>;
2733
2742
  /**
2734
2743
  * Deletes an instance of repeatable group with all its questions and adjusts the repeatIndex for all instances of the same template group with higher index.
2735
2744
  * @param id Id of the source group
@@ -2879,11 +2888,17 @@ declare module MobileCRM.UI {
2879
2888
 
2880
2889
  /**
2881
2890
  * Duplicates repeatable group with all its questions. The name of the group will contain the lowest available repeatIndex and suffix in form #00X.
2882
- * @param copyValues Optional paramater determining whether the group values should be copied to the new instance of this group.
2891
+ * @param copyValues Optional parameter determining whether the group values should be copied to the new instance of this group.
2883
2892
  * @param errorCallback A callback which is called in case of error.
2884
2893
  * @param scope A scope for calling the callbacks.
2885
2894
  */
2886
2895
  repeatGroup(copyValues?: boolean, errorCallback?: (err: string) => void, scope?: any);
2896
+ /**
2897
+ * Duplicates repeatable group with all its questions. The name of the group will contain the lowest available repeatIndex and suffix in form #00X.
2898
+ * @param copyValues Optional parameter determining whether the group values should be copied to the new instance of this group.
2899
+ * @returns A promise resolved when the operation is completed.
2900
+ */
2901
+ repeatGroupAsync(copyValues?: boolean): Promise<void>;
2887
2902
  /**
2888
2903
  * Deletes this instance of repeatable group with all its questions and adjusts the repeatIndex for all instances of the same template group with higher index.
2889
2904
  * @param errorCallback A callback which is called in case of error.
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 = 18.0;
4
+ var _scriptVersion = 19.0;
5
5
  // Private objects & functions
6
6
  var _inherit = (function () {
7
7
  function _() {
@@ -1805,6 +1805,7 @@
1805
1805
  /// <field name="showPersonalContacts" type="Boolean">Gets or sets whether to show contacts from the user's personal address book.</field>
1806
1806
  /// <field name="showSystemCalendars" type="Boolean">Gets or sets whether to show private calendars in calendars.</field>
1807
1807
  /// <field name="systemUserId" type="String">Gets or sets the current user id (given by the server).</field>
1808
+ /// <field name="systemUserName" type="String">Gets or sets the current user name (given by the server).</field>
1808
1809
  /// <field name="teams" type="Array<String>">Gets the array of ids of teams the current user is member of.</field>
1809
1810
  /// <field name="useCrmEmail" type="Boolean">Gets or sets whether to create a CRM email entity or use the platform email service.</field>
1810
1811
  /// <field name="useDatabaseBlobStore" type="Boolean">Gets or sets whether to store attachment blobs in database or in files. If you change this setting you must perform a full sync!</field>
@@ -5381,12 +5382,21 @@
5381
5382
  MobileCRM.bridge.invokeMethodAsync("QuestionnaireForm", "ChangeLookupViews", [questionName, xml], null, errorCallback, scope);
5382
5383
  };
5383
5384
  MobileCRM.UI.QuestionnaireForm.repeatGroup = function (groupId, copyValues, errorCallback, scope) {
5385
+ ///<summary>Duplicates repeatable group with all its questions. The name of the group will contain the lowest available repeatIndex and suffix in form #00X.</summary>
5386
+ /// <param name="id" type="String">Id of the source group.</param>
5387
+ /// <param name="copyValues" type="Boolean">Optional paramater determining whether the group values should be copied to the new instance of this group.</param>
5388
+ /// <returns type="Promise">A promise that resolves when the group is duplicated.</returns>
5389
+ MobileCRM.bridge.invokeMethodAsync("QuestionnaireForm", "RepeatGroup", [groupId, copyValues], null, errorCallback, scope);
5390
+ };
5391
+ MobileCRM.UI.QuestionnaireForm.repeatGroupAsync = function (groupId, copyValues) {
5384
5392
  ///<summary>Duplicates repeatable group with all its questions. The name of the group will contain the lowest available repeatIndex and suffix in form #00X.</summary>
5385
5393
  /// <param name="id" type="String">Id of the source group.</param>
5386
5394
  /// <param name="copyValues" type="Boolean">Optional paramater determining whether the group values should be copied to the new instance of this group.</param>
5387
5395
  /// <param name="errorCallback" type="function(errorMsg)">The errorCallback which is called in case of error.</param>
5388
5396
  /// <param name="scope" type="Object">The scope for callbacks.</param>
5389
- MobileCRM.bridge.invokeMethodAsync("QuestionnaireForm", "RepeatGroup", [groupId, copyValues], null, errorCallback, scope);
5397
+ return new Promise(function (resolve, reject) {
5398
+ MobileCRM.bridge.invokeMethodAsync("QuestionnaireForm", "RepeatGroup", [groupId, copyValues], resolve, reject);
5399
+ });
5390
5400
  };
5391
5401
  MobileCRM.UI.QuestionnaireForm.deleteGroup = function (groupId, errorCallback, scope) {
5392
5402
  ///<summary>Deletes an instance of repeatable group with all its questions and adjusts the repeatIndex for all instances of the same template group with higher index.</summary>
@@ -5417,6 +5427,12 @@
5417
5427
  /// <param name="scope" type="Object">The scope for callbacks.</param>
5418
5428
  MobileCRM.UI.QuestionnaireForm.repeatGroup(this.id, copyValues, errorCallback, scope);
5419
5429
  };
5430
+ MobileCRM.UI.QuestionnaireForm.Group.prototype.repeatGroupAsync = function (copyValues) {
5431
+ ///<summary>Duplicates repeatable group with all its questions. The name of the group will contain the lowest available repeatIndex and suffix in form #00X.</summary>
5432
+ /// <param name="copyValues" type="Boolean">Optional parameter determining whether the group values should be copied to the new instance of this group.</param>
5433
+ // <returns type="Promise">A promise that resolves when the group is duplicated.</returns>
5434
+ return MobileCRM.UI.QuestionnaireForm.repeatGroupAsync(this.id, copyValues);
5435
+ };
5420
5436
  MobileCRM.UI.QuestionnaireForm.Group.prototype.deleteGroup = function (errorCallback, scope) {
5421
5437
  ///<summary>Deletes this instance of repeatable group with all its questions and adjusts the repeatIndex for all instances of the same template group with higher index.</summary>
5422
5438
  /// <param name="errorCallback" type="function(errorMsg)">The errorCallback which is called in case of error.</param>
@@ -6821,9 +6837,10 @@
6821
6837
  } else {
6822
6838
  if ("chrome" in window && "webview" in window["chrome"]) {
6823
6839
  // Windows UWP with WebView2 (Edge)
6840
+ var msgWindow = parent && "HiddenIframeContainer" in parent ? parent : chrome.webview;
6824
6841
  MobileCRM.Bridge.prototype.command = function (command, params, success, failed, scope) {
6825
6842
  var cmdId = this._createCmdObject(success, failed, scope);
6826
- chrome.webview.postMessage(cmdId + ";" + command + ":" + params);
6843
+ msgWindow.postMessage(cmdId + ";" + command + ":" + params);
6827
6844
  };
6828
6845
  MobileCRM.Bridge.prototype.alert = function (text, callback, scope) {
6829
6846
  MobileCRM.bridge.command("alert", text, callback, callback, scope);