@resconet/jsbridge 15.1.1 → 15.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@resconet/jsbridge",
3
- "version": "15.1.1",
3
+ "version": "15.2.0",
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
@@ -1,5 +1,5 @@
1
1
  // JSBridge.js TypeScript definition file
2
- // v15.1
2
+ // v15.2
3
3
  // (c) 2022 Resco
4
4
 
5
5
  declare module MobileCRM {
@@ -252,12 +252,21 @@ declare module MobileCRM {
252
252
  }
253
253
 
254
254
  class CultureInfo {
255
+ /** Gets the culture name in the format languageCode/region (e.g. 'en-US'). 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.*/
255
256
  name: string;
257
+ /** Gets the full localized culture name.*/
256
258
  displayName: string;
259
+ /** Gets the culture name, consisting of the language, the country/region, and the optional script, that the culture is set to display.*/
257
260
  nativeName: string;
261
+ /** Gets the ISO 639-1 two-letter code for the language of the current CultureInfo.*/
258
262
  ISOName: string;
263
+ /** Gets selected localization language.*/
264
+ localization: string;
265
+ /** Gets a value indicating whether the current CultureInfo object represents a writing system where text flows from right to left.*/
259
266
  isRightToLeft: boolean;
267
+ /** Gets a DateTimeFormat that defines the culturally appropriate format of displaying dates and times.*/
260
268
  dateTimeFormat: DateTimeFormat;
269
+ /** Gets a NumberFormat that defines the culturally appropriate format of displaying numbers, currency, and percentage.*/
261
270
  numberFormat: NumberFormat;
262
271
 
263
272
  static initialize(callback: (cultureInfo: CultureInfo) => void, errorCallback?: (error: string) => void, scope?: any);
@@ -825,14 +834,16 @@ declare module MobileCRM.FetchXml {
825
834
  * @property count {number} The maximum number of records to retrieve.
826
835
  * @property page {number} 1-based index of the data page to retrieve.
827
836
  * @property aggregate {boolean} Indicates whether the fetch is aggregated.
837
+ * @property distinct {boolean} Indicates whether to return only distinct (different) values.
828
838
  */
829
839
  class Fetch {
830
- constructor(entity?: MobileCRM.FetchXml.Entity, count?: number, page?: number);
840
+ constructor(entity?: MobileCRM.FetchXml.Entity, count?: number, page?: number, distinct?: boolean);
831
841
 
832
842
  public entity: MobileCRM.FetchXml.Entity;
833
843
  count: number;
834
844
  page: number;
835
845
  aggregate: boolean;
846
+ distinct: boolean;
836
847
 
837
848
  /**
838
849
  * Performs the asynchronous CRM Fetch command.
package/src/JSBridge.js CHANGED
@@ -1,6 +1,6 @@
1
- // v15.1
1
+ // v15.2
2
2
  (function () {
3
- var _scriptVersion = 15.1
3
+ var _scriptVersion = 15.2
4
4
  // Private objects & functions
5
5
  var _inherit = (function () {
6
6
  function _() { }
@@ -208,6 +208,7 @@
208
208
  /// <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>
209
209
  /// <field name="displayName" type="String">Gets the full localized culture name.</field>
210
210
  /// <field name="nativeName" type="String">Gets the culture name, consisting of the language, the country/region, and the optional script, that the culture is set to display.</field>
211
+ /// <field name="localization" type="String">Gets selected localization language.</field>
211
212
  /// <field name="ISOName" type="String">Gets the ISO 639-1 two-letter code for the language of the current CultureInfo.</field>
212
213
  /// <field name="isRightToLeft" type="Boolean">Gets a value indicating whether the current CultureInfo object represents a writing system where text flows from right to left.</field>
213
214
  /// <field name="dateTimeFormat" type="MobileCRM.DateTimeFormat">Gets a DateTimeFormat that defines the culturally appropriate format of displaying dates and times.</field>
@@ -376,19 +377,22 @@
376
377
  },
377
378
 
378
379
  FetchXml: {
379
- Fetch: function (entity, count, page) {
380
+ Fetch: function (entity, count, page, distinct) {
380
381
  /// <summary>Represents a FetchXml query object.</summary>
381
382
  /// <param name="entity" type="MobileCRM.FetchXml.Entity">An entity object.</param>
382
383
  /// <param name="count" type="int">the maximum number of records to retrieve.</param>
383
384
  /// <param name="page" type="int">1-based index of the data page to retrieve.</param>
385
+ /// <param name="distinct" type="bool">Whether to return only distinct (different) values.</param>
384
386
  /// <field name="aggregate" type="Boolean">Indicates whether the fetch is aggregated.</field>
385
387
  /// <field name="count" type="int">the maximum number of records to retrieve.</field>
386
388
  /// <field name="entity" type="MobileCRM.FetchXml.Entity">An entity object.</field>
387
389
  /// <field name="page" type="int">1-based index of the data page to retrieve.</field>
390
+ /// <field name="distinct" type="Boolean">Whether to return only distinct (different) values.</field>
388
391
  this.entity = entity;
389
392
  this.count = count;
390
393
  this.page = page;
391
394
  this.aggregate = false;
395
+ this.distinct = distinct;
392
396
  },
393
397
  Entity: function (name) {
394
398
  /// <summary>Represents a FetchXml query root entity.</summary>
@@ -2433,8 +2437,8 @@
2433
2437
  /// <param name="output" type="String">A string defining the output format: Array, JSON, XML or DynamicEntities.</param>
2434
2438
  /// <param name="success" type="function(result)">A callback function for successful asynchronous result. The <b>result</b> argument will carry the objects array of type specified by <b>output</b> argument.</param>
2435
2439
  /// <param name="failed" type="function(error)">A callback function for command failure. The <b>error</b> argument will carry the error message.</param>
2436
- /// <param name="scope" type="">A scope for calling the callbacks; set &quot;null&quot; to call the callbacks in global scope.</param>
2437
- var reqParams = JSON.stringifyNotNull({ entity: this.entity, resultformat: output, page: this.page, count: this.count, aggregate: this.aggregate });
2440
+ /// <param name="scope" type="">A scope for calling the callbacks; set &quot;null&quot; to call the callbacks in global scope.</param>
2441
+ var reqParams = JSON.stringifyNotNull({ entity: this.entity, resultformat: output, page: this.page, count: this.count, aggregate: this.aggregate, distinct: this.distinct });
2438
2442
  MobileCRM.bridge.command('fetch', reqParams, success, failed, scope);
2439
2443
  };
2440
2444
  MobileCRM.FetchXml.Fetch.prototype.executeOnline = function (output, success, failed, scope) {
@@ -2496,13 +2500,13 @@
2496
2500
  /// <param name="success" type="function(String)">A callback function for successful asynchronous result. The <b>result</b> argument will carry the XML representation of the Fetch object.</param>
2497
2501
  /// <param name="failed" type="function(error)">A callback function for command failure. The <b>error</b> argument will carry the error message.</param>
2498
2502
  /// <param name="scope" type="">A scope for calling the callbacks; set &quot;null&quot; to call the callbacks in global scope.</param>
2499
- var reqParams = JSON.stringifyNotNull({ entity: this.entity, page: this.page, count: this.count, aggregate: this.aggregate });
2503
+ var reqParams = JSON.stringifyNotNull({ entity: this.entity, page: this.page, count: this.count, aggregate: this.aggregate, distinct: this.distinct });
2500
2504
  MobileCRM.bridge.command('fetchToXml', reqParams, success, failed, scope);
2501
2505
  };
2502
2506
  MobileCRM.FetchXml.Fetch.prototype.serializeToXmlAsync = function () {
2503
2507
  /// <summary>[v10.0] Serializes the Fetch object to XML.</summary>
2504
2508
  /// <returns type="Promise&lt;string&gt;">A Promise object which will be resolved with the XML representation of this Fetch object.</returns>
2505
- var reqParams = JSON.stringifyNotNull({ entity: this.entity, page: this.page, count: this.count, aggregate: this.aggregate });
2509
+ var reqParams = JSON.stringifyNotNull({ entity: this.entity, page: this.page, count: this.count, aggregate: this.aggregate, distinct: this.distinct });
2506
2510
  return MobileCRM.bridge.invokeCommandPromise('fetchToXml', reqParams);
2507
2511
  };
2508
2512
 
@@ -3977,10 +3981,11 @@
3977
3981
  });
3978
3982
  };
3979
3983
  MobileCRM.MobileReport.showForm = function (entity, source, fetchXml, failed, scope) {
3980
- /// <summary>[v10.1] Shows new MobileReport form.</summary>
3981
- /// <param name="entity" type="MobileCRM.Reference">Report Entity reference what the report is related to.</param>
3982
- /// <param name="source" type="MobileCRM.Reference[]">The list of entities that should be source of report.">Array of entity references .</param>
3983
- /// <param name="reportXML" type="String">The report source query.</param>
3984
+ /// <summary>[v10.1] Shows new MobileReport form. Source for the report can be defined either as list of <see cref="MobileCRM.Reference">MobileCRM.Reference</see> objects or as FetchXML query.</summary>
3985
+ /// <remarks>If both types of source are passed, user can select which one to use.</remarks>
3986
+ /// <param name="entity" type="MobileCRM.Reference">The reference to the entity that the report is related to.</param>
3987
+ /// <param name="source" type="MobileCRM.Reference[]">The list of entity references used as report input.</param>
3988
+ /// <param name="fetchXML" type="String">The fetch XML defining the entity (entities) query used as report input.</param>
3984
3989
  /// <param name="failed" type="function(errorMsg)">A callback which is called in case of error.</param>
3985
3990
  /// <param name="scope" type="Object">The scope for callbacks.</param>
3986
3991
 
@@ -5898,10 +5903,18 @@
5898
5903
  }
5899
5904
  }
5900
5905
  else {
5901
- if ("external" in window && external) {
5906
+ if ("chrome" in window && "webview" in window["chrome"]) {
5907
+ // Windows UWP with WebView2 (Edge)
5908
+ MobileCRM.Bridge.prototype.command = function (command, params, success, failed, scope) {
5909
+ var cmdId = this._createCmdObject(success, failed, scope);
5910
+ chrome.webview.postMessage(cmdId + ';' + command + ':' + params);
5911
+ };
5912
+ MobileCRM.bridge = new MobileCRM.Bridge('Windows');
5913
+ }
5914
+ else if ("external" in window && external) {
5902
5915
  var win10 = "win10version" in window;
5903
5916
  if ("notify" in external || win10) {
5904
- // WindowsPhone || WindowsRT || Windows10
5917
+ // WindowsPhone || WindowsRT || Windows10 with legacy WebView
5905
5918
  MobileCRM.Bridge.prototype.command = function (command, params, success, failed, scope) {
5906
5919
  var cmdId = this._createCmdObject(success, failed, scope);
5907
5920
  window.external.notify(cmdId + ';' + command + ':' + params);