@resconet/jsbridge 15.2.0 → 15.3.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.2.0",
3
+ "version": "15.3.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,4 @@
1
1
  // JSBridge.js TypeScript definition file
2
- // v15.2
3
2
  // (c) 2022 Resco
4
3
 
5
4
  declare module MobileCRM {
@@ -50,7 +49,7 @@ declare module MobileCRM {
50
49
 
51
50
  public static requestObject(callback: (config: Configuration) => void, erroCallback?: (error: string) => void, scope?: any);
52
51
  }
53
-
52
+
54
53
  class Settings {
55
54
  /**Gets the absolute URL (including the CrmOrganization).*/
56
55
  absoluteUrl: string;
@@ -127,7 +126,7 @@ declare module MobileCRM {
127
126
  forcedFullSyncDate: Date;
128
127
  /**Prevents remembered password to be used for next login.*/
129
128
  forgetPassword: boolean;
130
- /**Gets or sets the option for generating the entity full name (contact, lead)
129
+ /**Gets or sets the option for generating the entity full name (contact, lead)
131
130
  e.g. how to combine the first, middle and last name (0="L,F", 1="F L", 2="L,F m", 3="F m L", 4="L,F M", 5="F M L", 6="L F", 7="LF").*/
132
131
  fullNameConventionCode: number;
133
132
  /**Gets whether there were any synchronization errors encountered.*/
@@ -150,7 +149,7 @@ declare module MobileCRM {
150
149
  isDemoUser: boolean;
151
150
  /**Gets whether the login is for a CRM Online instance.*/
152
151
  isCrmOnline: boolean
153
- /**Gets whether the login information is valid and complete.
152
+ /**Gets whether the login information is valid and complete.
154
153
  Indicates whether the user name and password are non-empty.
155
154
  Whether they are correct is up to the we service. Also checks whether the web service url is non-empty.*/
156
155
  isValid: boolean;
@@ -661,12 +660,12 @@ declare module MobileCRM {
661
660
  }
662
661
 
663
662
  class Application {
664
- public static synchronize(backgroundOnly: boolean, ifNotSyncedBefore: Date);
665
- public static synchronizeOnForeground(forceLogin: boolean);
666
- public static getAppColor(colName: string, success: (url: string) => void, failed?: (err: string) => void, scope?: any);
667
- public static getAppImage(imageName: string, colorize: string, success: (url: string) => void, failed?: (err: string) => void, scope?: any);
663
+ static synchronize(backgroundOnly: boolean, ifNotSyncedBefore: Date);
664
+ static synchronizeOnForeground(forceLogin: boolean);
665
+ static getAppColor(colName: string, success: (url: string) => void, failed?: (err: string) => void, scope?: any);
666
+ static getAppImage(imageName: string, colorize: string, success: (url: string) => void, failed?: (err: string) => void, scope?: any);
668
667
  /** Display application login form. */
669
- public static showAppLogin();
668
+ static showAppLogin();
670
669
  /**
671
670
  * Sets the application colors.
672
671
  * @since 11.2.2
@@ -675,7 +674,7 @@ declare module MobileCRM {
675
674
  * @param failed The error callback which is called asynchronously in case of error.
676
675
  * @param scope The scope for callbacks.
677
676
  */
678
- public static setAppColors(colors: { [colorName: string]: number | string }, success?: () => void, failed?: (err: string) => void, scope?: any);
677
+ static setAppColors(colors: { [colorName: string]: number | string }, success?: () => void, failed?: (err: string) => void, scope?: any);
679
678
  /**
680
679
  * Gets the last detected time change.
681
680
  * @since 13.3.1
@@ -683,19 +682,42 @@ declare module MobileCRM {
683
682
  * @param failed The error callback which is called asynchronously in case of error.
684
683
  * @param scope Optional scope for callbacks.
685
684
  */
686
- public static getLastSignificantTimeChange(success: (timeChange: ITimeChange) => void, failed?: (err: string) => void, scope?: any);
687
- public static fileExists(path: string, success: (exist: boolean) => void, failed?: (err: string) => void, scope?: any);
688
- public static directoryExists(path: string, success: (exist: boolean) => void, failed?: (err: string) => void, scope?: any);
689
- public static createDirectory(path: string, success?: () => void, failed?: (err: string) => void, scope?: any);
690
- public static deleteDirectory(path: string, success?: () => void, failed?: (err: string) => void, scope?: any);
691
- public static getDirectories(path: string, success: (directoriesList: Array<string>) => void, failed?: (err: string) => void, scope?: any);
692
- public static deleteFile(path: string, success?: () => void, failed?: (error: string) => void, scope?: any);
693
- public static getFiles(path: string, success: (filesList: Array<string>) => void, failed?: (err: string) => void, scope?: any);
694
- public static moveFile(src: string, dst: string, success?: () => void, failed?: (err: string) => void, scope?: any);
695
- public static readFile(path: string, success: (fileContent: string) => void, failed?: (err: string) => void, scope?: any);
696
- public static writeFile(path: string, text: string, append: boolean, success?: () => void, failed?: (err: string) => void, scope?: any);
697
- public static readFileAsBase64(path: string, success: (base64: string) => void, failed?: (err: string) => void, scope?: any);
698
- public static writeFileFromBase64(path: string, base64: string, success?: () => void, failed?: (err: string) => void, scope?: any);
685
+ static getLastSignificantTimeChange(success: (timeChange: ITimeChange) => void, failed?: (err: string) => void, scope?: any);
686
+ static fileExists(path: string, success: (exist: boolean) => void, failed?: (err: string) => void, scope?: any);
687
+ static fileExistsAsync(path: string): Promise<boolean>;
688
+ static directoryExists(path: string, success: (exist: boolean) => void, failed?: (err: string) => void, scope?: any);
689
+ static directoryExistsAsync(path: string): Promise<boolean>;
690
+ static createDirectory(path: string, success?: () => void, failed?: (err: string) => void, scope?: any);
691
+ static createDirectoryAsync(path: string): Promise<void>;
692
+ static deleteDirectory(path: string, success?: () => void, failed?: (err: string) => void, scope?: any);
693
+ static deleteDirectoryAsync(path: string): Promise<void>;
694
+ static getDirectories(path: string, success: (directoriesList: Array<string>) => void, failed?: (err: string) => void, scope?: any);
695
+ static getDirectoriesAsync(path: string): Promise<string[]>;
696
+ static deleteFile(path: string, success?: () => void, failed?: (error: string) => void, scope?: any);
697
+ static deleteFileAsync(path: string): Promise<void>;
698
+ static getFiles(path: string, success: (filesList: Array<string>) => void, failed?: (err: string) => void, scope?: any);
699
+ static getFilesAsync(path: string): Promise<string[]>;
700
+ static moveFile(src: string, dst: string, success?: () => void, failed?: (err: string) => void, scope?: any);
701
+ static moveFileAsync(src: string, dst: string): Promise<void>;
702
+ static readFile(path: string, success: (fileContent: string) => void, failed?: (err: string) => void, scope?: any);
703
+ /**
704
+ * @since 15.3
705
+ * Reads the file from the application local data and asynchronously gets its content.
706
+ * @param path Defines the relative path of the file in the application local data.
707
+ * @param encoding Defines the text encoding for file content (default is UTF8). Use base64 for binary files. Supported values: UTF8, UTF16 ASCII, BASE64.
708
+ */
709
+ static readFileAsync(path: string, encoding?: "UTF8" | "UTF16" | "ASCII" | "base64"): Promise<string>;
710
+ static writeFile(path: string, text: string, append: boolean, success?: () => void, failed?: (err: string) => void, scope?: any);
711
+ /**
712
+ * @since 15.3
713
+ * Asynchronously writes data into the file from the application local data.
714
+ * @param path Defines the relative path of the file in the application local data.
715
+ * @param text Defines the file content (in corresponding text encoding) to be written.
716
+ * @param encoding Defines the text encoding for file content (default is UTF8). Use base64 for binary files. Supported values: UTF8, UTF16 ASCII, BASE64.
717
+ */
718
+ static writeFileAsync(path: string, text: string, encoding?: "UTF8" | "UTF16" | "ASCII" | "base64"): Promise<void>;
719
+ static readFileAsBase64(path: string, success: (base64: string) => void, failed?: (err: string) => void, scope?: any);
720
+ static writeFileFromBase64(path: string, base64: string, success?: () => void, failed?: (err: string) => void, scope?: any);
699
721
  /**
700
722
  * @since 9.0.2
701
723
  * Asynchronously writes the text into the file from the application local data.
@@ -707,7 +729,7 @@ declare module MobileCRM {
707
729
  * @param errorCallback The errorCallback which is called asynchronously in case of error.
708
730
  * @param scope The scope for callback.
709
731
  */
710
- public static writeFileWithEncoding(path: string, text: string, encoding: string, append: boolean, success: () => void, failed?: (err: string) => void, scope?: any);
732
+ static writeFileWithEncoding(path: string, text: string, encoding: string, append: boolean, success: () => void, failed?: (err: string) => void, scope?: any);
711
733
  /**
712
734
  * @since 12.1
713
735
  * Asynchronously refresh access token using saved token in protected settings and send serialized token to success callback
@@ -716,7 +738,7 @@ declare module MobileCRM {
716
738
  * @param errorCallback The errorCallback which is called asynchronously in case of error.
717
739
  * @param scope The scope for callback.
718
740
  */
719
- public static getAccessToken(resource, success: (textAccessToken: string) => void, failed?: (err: string) => void, scope?: any);
741
+ static getAccessToken(resource, success: (textAccessToken: string) => void, failed?: (err: string) => void, scope?: any);
720
742
  /**
721
743
  * Checks whether the current user is member of the passed roles. Role can be either the Guid (aeb33d0f-89b4-e111-9c9a-00155d0b710a) or the role Name.
722
744
  * @param roles Defines the roles to check.
@@ -724,7 +746,7 @@ declare module MobileCRM {
724
746
  * @param failed A callback function for command failure. The error argument will carry the error message.
725
747
  * @param scope A scope for calling the callback.
726
748
  */
727
- public static checkUserRoles(roles: [string], success?: (roles: number) => void, failed?: (err: string) => void, scope?: any);
749
+ static checkUserRoles(roles: [string], success?: (roles: number) => void, failed?: (err: string) => void, scope?: any);
728
750
  }
729
751
 
730
752
  class AboutInfo {
@@ -742,13 +764,13 @@ declare module MobileCRM {
742
764
 
743
765
  /**
744
766
  * @since 13.0
745
- * Encapsulate methods and properties what can be used for integration.
767
+ * Encapsulate methods and properties what can be used for integration.
746
768
  */
747
769
  class Integration {
748
770
  /**
749
771
  * @since 13.0
750
772
  * Asynchronously gets the token using passed OAuth settings and parameters. Configuration name is used to find already settings.
751
- * @param configurationName Define the name of oauth configuration, what is key for saved setting if any.
773
+ * @param configurationName Define the name of oauth configuration, what is key for saved setting if any.
752
774
  * @param oauthSettings Defines the OAuth settings for authentication.
753
775
  * @param prompt Whether to force the user to enter credentials again.
754
776
  * @param success A callback function for successful asynchronous result. The <b>result</b> will carry a string with the access token.
@@ -759,8 +781,8 @@ declare module MobileCRM {
759
781
  }
760
782
 
761
783
  /**
762
- * @since 13.0
763
- * Represents the settings what are used to authenticate using OAuth server account
784
+ * @since 13.0
785
+ * Represents the settings what are used to authenticate using OAuth server account
764
786
  */
765
787
  class OAuthSettings {
766
788
  /**
@@ -768,7 +790,6 @@ declare module MobileCRM {
768
790
  * @param configName The Configuration name.
769
791
  */
770
792
  constructor();
771
-
772
793
  /** Gets or sets the OAuth token url. */
773
794
  public authorityEndPoint: string;
774
795
  /** Gets or sets the authorization url to get authorization code. */
@@ -1538,7 +1559,7 @@ declare module MobileCRM.UI {
1538
1559
  */
1539
1560
  cancelValidation(errorMsg: string);
1540
1561
  /**
1541
- * @since 8.0
1562
+ * @since 8.0
1542
1563
  * Selects the form tab by its name.
1543
1564
  * @param tabName The name of the tab.
1544
1565
  * @param errorCallback The errorCallback which is called asynchronously in case of error.
@@ -1546,7 +1567,7 @@ declare module MobileCRM.UI {
1546
1567
  */
1547
1568
  selectTab(tabName: string, errorCallback?: (err: string) => void, scope?: any);
1548
1569
  /**
1549
- * @since 8.0
1570
+ * @since 8.0
1550
1571
  * Selects the form tab by its name using static method.
1551
1572
  * @param tabName The name of the tab.
1552
1573
  * @param errorCallback The errorCallback which is called asynchronously in case of error.
@@ -1604,7 +1625,7 @@ declare module MobileCRM.UI {
1604
1625
  /**
1605
1626
  * Binds or unbinds the handler for onSave event on EntityForm.
1606
1627
  * @param handler The handler function that has to be bound or unbound.
1607
- * @param bind Determines whether to bind or unbind the handler.
1628
+ * @param bind Determines whether to bind or unbind the handler.
1608
1629
  * @param scope The scope for callbacks.
1609
1630
  */
1610
1631
  public static onSave(handler: (entityForm: EntityForm) => void, bind: boolean, scope?: any);
@@ -1624,7 +1645,7 @@ declare module MobileCRM.UI {
1624
1645
  */
1625
1646
  public static onProcessLoaded(handler: (entityForm: EntityForm) => void, bind: boolean, scope?: any);
1626
1647
  /**
1627
- * @since 11.2
1648
+ * @since 11.2
1628
1649
  * Binds or unbinds the handler for specific item change event on EntityForm.
1629
1650
  * @param itemName The name of desired detail item (mostly logical name of the field).
1630
1651
  * @param handler The handler function that has to be bound or unbound.
@@ -2083,7 +2104,7 @@ declare module MobileCRM.UI {
2083
2104
  public static trySetAnswer(questionName: string, answer: any, errorCallback?: (err: string) => void, scope?: any);
2084
2105
  /**
2085
2106
  * Asynchronously sets the image as answer value for this question
2086
- * @param imageQuestionName
2107
+ * @param imageQuestionName
2087
2108
  * @param base64Data A value that us used to create image answer.
2088
2109
  * @param mimeType The valid mime type of corresponding base64Data.
2089
2110
  * @param errorCallback A callback which is called in case of error.
@@ -2135,7 +2156,7 @@ declare module MobileCRM.UI {
2135
2156
  /**
2136
2157
  * Binds or unbinds the handler for onSave event on QuestionnaireForm.
2137
2158
  * @param handler The handler function that has to be bound or unbound.
2138
- * @param bind Determines whether to bind or unbind the handler.
2159
+ * @param bind Determines whether to bind or unbind the handler.
2139
2160
  * @param scope The scope for callbacks.
2140
2161
  */
2141
2162
  public static onSave(handler: (questionnaireForm: QuestionnaireForm) => void, bind: boolean, scope?: any);
@@ -2147,7 +2168,7 @@ declare module MobileCRM.UI {
2147
2168
  */
2148
2169
  public static onChange(handler: (questionnaireForm: QuestionnaireForm) => void, bind: boolean, scope?: any);
2149
2170
  /**
2150
- * @since 11.2
2171
+ * @since 11.2
2151
2172
  * Binds or unbinds the handler for specific question change event on QuestionnaireForm.
2152
2173
  * @param questionName The name of desired question.
2153
2174
  * @param handler The handler function that has to be bound or unbound.
package/src/JSBridge.js CHANGED
@@ -1,6 +1,5 @@
1
- // v15.2
2
1
  (function () {
3
- var _scriptVersion = 15.2
2
+ var _scriptVersion = 15.3
4
3
  // Private objects & functions
5
4
  var _inherit = (function () {
6
5
  function _() { }
@@ -2883,6 +2882,11 @@
2883
2882
  /// <param name="scope" type="">A scope for calling the callbacks; set &quot;null&quot; to call the callbacks in global scope.</param>
2884
2883
  MobileCRM.bridge.invokeStaticMethodAsync("MobileCrm.Data", "MobileCrm.Configuration", "Instance.FileExists", [path], success, failed, scope);
2885
2884
  };
2885
+ MobileCRM.Application.fileExistsAsync = function (path) {
2886
+ /// <summary>Checks whether the file with given path exists in application local data.</summary>
2887
+ /// <param name="path" type="String">Defines the relative path of the file located in the application local data.</param>
2888
+ return MobileCRM.bridge.invokeStaticMethodPromise("MobileCrm.Data", "MobileCrm.Configuration", "Instance.FileExists", [path]);
2889
+ };
2886
2890
 
2887
2891
  MobileCRM.Application.directoryExists = function (path, success, failed, scope) {
2888
2892
  /// <summary>Checks whether the directory with given path exists in the application local data.</summary>
@@ -2892,6 +2896,11 @@
2892
2896
  /// <param name="scope" type="">A scope for calling the callbacks; set &quot;null&quot; to call the callbacks in global scope.</param>
2893
2897
  MobileCRM.bridge.invokeStaticMethodAsync("MobileCrm.Data", "MobileCrm.Configuration", "Instance.DirectoryExists", [path], success, failed, scope);
2894
2898
  };
2899
+ MobileCRM.Application.directoryExistsAsync = function (path) {
2900
+ /// <summary>Checks whether the directory with given path exists in the application local data.</summary>
2901
+ /// <param name="path" type="String">Defines the relative path of the directory located in the application local data.</param>
2902
+ return MobileCRM.bridge.invokeStaticMethodPromise("MobileCrm.Data", "MobileCrm.Configuration", "Instance.DirectoryExists", [path]);
2903
+ };
2895
2904
 
2896
2905
  MobileCRM.Application.createDirectory = function (path, success, failed, scope) {
2897
2906
  /// <summary>Asynchronously creates the directory in the application local data.</summary>
@@ -2901,6 +2910,11 @@
2901
2910
  /// <param name="scope" type="">A scope for calling the callbacks; set &quot;null&quot; to call the callbacks in global scope.</param>
2902
2911
  MobileCRM.bridge.invokeStaticMethodAsync("MobileCrm.Data", "MobileCrm.Configuration", "Instance.CreateDirectory", [path], success, failed, scope);
2903
2912
  };
2913
+ MobileCRM.Application.createDirectoryAsync = function (path) {
2914
+ /// <summary>Asynchronously creates the directory in the application local data.</summary>
2915
+ /// <param name="path" type="String">Defines the relative path of the directory in the application local data.</param>
2916
+ return MobileCRM.bridge.invokeStaticMethodPromise("MobileCrm.Data", "MobileCrm.Configuration", "Instance.CreateDirectory", [path]);
2917
+ };
2904
2918
 
2905
2919
  MobileCRM.Application.deleteDirectory = function (path, success, failed, scope) {
2906
2920
  /// <summary>Asynchronously deletes the empty directory from the application local data.</summary>
@@ -2910,7 +2924,13 @@
2910
2924
  /// <param name="scope" type="">A scope for calling the callbacks; set &quot;null&quot; to call the callbacks in global scope.</param>
2911
2925
  MobileCRM.bridge.invokeStaticMethodAsync("MobileCrm.Data", "MobileCrm.Configuration", "Instance.DeleteDirectory", [path], success, failed, scope);
2912
2926
  };
2913
- MobileCRM.Application.getDirectories = function (path, success, failed, scope) {
2927
+ MobileCRM.Application.deleteDirectoryAsync = function (path) {
2928
+ /// <summary>Asynchronously deletes the empty directory from the application local data.</summary>
2929
+ /// <param name="path" type="String">Defines the relative path of the directory in the application local data.</param>
2930
+ return MobileCRM.bridge.invokeStaticMethodPromise("MobileCrm.Data", "MobileCrm.Configuration", "Instance.DeleteDirectory", [path]);
2931
+ };
2932
+
2933
+ MobileCRM.Application.getDirectories = function (path, success, failed, scope) {
2914
2934
  /// <summary>Asynchronously gets the list of directories from the application local data.</summary>
2915
2935
  /// <param name="path" type="String">Defines the relative path of the Directory in the application local data.</param>
2916
2936
  /// <param name="success" type="function(result)">A callback function which carry the array of directories names.</param>
@@ -2919,6 +2939,11 @@
2919
2939
 
2920
2940
  MobileCRM.bridge.invokeStaticMethodAsync("MobileCrm.Data", "MobileCrm.Configuration", "Instance.GetDirectories", [path], success, failed, scope);
2921
2941
  };
2942
+ MobileCRM.Application.getDirectoriesAsync = function (path) {
2943
+ /// <summary>Asynchronously gets the list of directories from the application local data.</summary>
2944
+ /// <param name="path" type="String">Defines the relative path of the Directory in the application local data.</param>
2945
+ return MobileCRM.bridge.invokeStaticMethodPromise("MobileCrm.Data", "MobileCrm.Configuration", "Instance.GetDirectories", [path]);
2946
+ };
2922
2947
 
2923
2948
  MobileCRM.Application.deleteFile = function (path, success, failed, scope) {
2924
2949
  /// <summary>Asynchronously deletes the file from the application local data.</summary>
@@ -2929,6 +2954,11 @@
2929
2954
 
2930
2955
  MobileCRM.bridge.invokeStaticMethodAsync("MobileCrm.Data", "MobileCrm.Configuration", "Instance.DeleteFile", [path], success, failed, scope);
2931
2956
  };
2957
+ MobileCRM.Application.deleteFileAsync = function (path) {
2958
+ /// <summary>Asynchronously deletes the file from the application local data.</summary>
2959
+ /// <param name="path" type="String">Defines the relative path of the file in the application local data.</param>
2960
+ return MobileCRM.bridge.invokeStaticMethodPromise("MobileCrm.Data", "MobileCrm.Configuration", "Instance.DeleteFile", [path]);
2961
+ };
2932
2962
 
2933
2963
  MobileCRM.Application.getFiles = function (path, success, failed, scope) {
2934
2964
  /// <summary>Asynchronously gets the list of files from the application local data.</summary>
@@ -2939,6 +2969,11 @@
2939
2969
 
2940
2970
  MobileCRM.bridge.invokeStaticMethodAsync("MobileCrm.Data", "MobileCrm.Configuration", "Instance.GetFiles", [path], success, failed, scope);
2941
2971
  };
2972
+ MobileCRM.Application.getFilesAsync = function (path) {
2973
+ /// <summary>Asynchronously gets the list of files from the application local data.</summary>
2974
+ /// <param name="path" type="String">Defines the relative path of the Directory in the application local data.</param>
2975
+ return MobileCRM.bridge.invokeStaticMethodPromise("MobileCrm.Data", "MobileCrm.Configuration", "Instance.GetFiles", [path]);
2976
+ };
2942
2977
 
2943
2978
  MobileCRM.Application.moveFile = function (src, dst, success, failed, scope) {
2944
2979
  /// <summary>Asynchronously moves the application local file to another location.</summary>
@@ -2949,6 +2984,12 @@
2949
2984
  /// <param name="scope" type="">A scope for calling the callbacks; set &quot;null&quot; to call the callbacks in global scope.</param>
2950
2985
  MobileCRM.bridge.invokeStaticMethodAsync("MobileCrm.Data", "MobileCrm.Configuration", "Instance.MoveFile", [src, dst], success, failed, scope);
2951
2986
  };
2987
+ MobileCRM.Application.moveFileAsync = function (src, dst) {
2988
+ /// <summary>Asynchronously moves the application local file to another location.</summary>
2989
+ /// <param name="src" type="String">Defines the relative path of the source file in the application local data.</param>
2990
+ /// <param name="dst" type="String">Defines the relative path of the destination file in the application local data.</param>
2991
+ return MobileCRM.bridge.invokeStaticMethodPromise("MobileCrm.Data", "MobileCrm.Configuration", "Instance.MoveFile", [src, dst]);
2992
+ };
2952
2993
 
2953
2994
  MobileCRM.Application.readFile = function (path, success, failed, scope) {
2954
2995
  /// <summary>Reads the file from the application local data and asynchronously gets its content.</summary>
@@ -2971,6 +3012,12 @@
2971
3012
  reader.release();
2972
3013
  }
2973
3014
  };
3015
+ MobileCRM.Application.readFileAsync = function(path, encoding) {
3016
+ /// <summary>[v15.3] Reads the file from the application local data and asynchronously gets its content.</summary>
3017
+ /// <param name="path" type="String">Defines the relative path of the file in the application local data.</param>
3018
+ /// <param name="encoding" type="String">Defines the text encoding for file content (default is UTF8). Use base64 for binary files. Supported values: UTF8, UTF16 ASCII, BASE64.</param>
3019
+ return MobileCRM.bridge.invokeCommandPromise("readFromLocalStorage", JSON.stringify({path: path, encoding: encoding}));
3020
+ };
2974
3021
 
2975
3022
  MobileCRM.Application.writeFile = function (path, text, append, success, failed, scope) {
2976
3023
  /// <summary>Asynchronously writes the text into the file from the application local data.</summary>
@@ -2993,6 +3040,13 @@
2993
3040
  reader.release();
2994
3041
  }
2995
3042
  };
3043
+ MobileCRM.Application.writeFileAsync = function(path, text, encoding) {
3044
+ /// <summary>[v15.3] Asynchronously writes data into the file from the application local data.</summary>
3045
+ /// <param name="path" type="String">Defines the relative path of the file in the application local data.</param>
3046
+ /// <param name="text" type="String">Defines the file content (in corresponding text encoding) to be written.</param>
3047
+ /// <param name="encoding" type="String">Defines the text encoding for file content data. Use base64 for binary files. Supported values: UTF8, ASCII, BASE64.</param>
3048
+ return MobileCRM.bridge.invokeCommandPromise("writeToLocalStorage", JSON.stringify({path: path, text: text, encoding: encoding}));
3049
+ };
2996
3050
 
2997
3051
  MobileCRM.Application.writeFileWithEncoding = function (path, text, encoding, append, success, failed, scope) {
2998
3052
  /// <summary>[v9.0.2] Asynchronously writes the text into the file from the application local data.</summary>