@resconet/jsbridge 15.2.0 → 15.3.2-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 +1 -1
- package/src/JSBridge.d.ts +453 -361
- package/src/JSBridge.js +61 -11
package/src/JSBridge.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
// v15.2
|
|
2
1
|
(function () {
|
|
3
|
-
var _scriptVersion = 15.
|
|
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 "null" 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 "null" 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 "null" 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 "null" 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.
|
|
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 "null" 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>
|
|
@@ -3970,7 +4024,7 @@
|
|
|
3970
4024
|
MobileCRM.MobileReport.runReportAsync = function (fetch, reportXML, reportFormat, isExportOnly, isOnline, outputFile) {
|
|
3971
4025
|
/// <summary>[v9.1] Executes the mobile reporting request which produces the mobile report document of given format.</summary>
|
|
3972
4026
|
/// <param name="fetch" type="String">The fetch XML defining the entity (entities) query used as report input.</param>
|
|
3973
|
-
/// <param name="reportXML" type="String">The mobile report XML definition which can be loaded from the
|
|
4027
|
+
/// <param name="reportXML" type="String">The mobile report XML definition which can be loaded from the resco_mobilereport entity or constructed dynamically. Ignored if IsExportOnly parameter is true.</param>
|
|
3974
4028
|
/// <param name="reportFormat" type="String">Report format: Pdf (default), Html, Excel, Text.</param>
|
|
3975
4029
|
/// <param name="isExportOnly" type="Boolean">If true then ReportXml is optional. The default is false.</param>
|
|
3976
4030
|
/// <param name="isOnline" type="Boolean">Indicates whether the report should be run against the online data or local database. The default is current application mode.</param>
|
|
@@ -3980,19 +4034,15 @@
|
|
|
3980
4034
|
MobileCRM.MobileReport.runReport(fetch, reportXML, reportFormat, isExportOnly, isOnline, outputFile, resolve, function (err) { reject(new Error(err)); });
|
|
3981
4035
|
});
|
|
3982
4036
|
};
|
|
3983
|
-
MobileCRM.MobileReport.showForm = function (
|
|
4037
|
+
MobileCRM.MobileReport.showForm = function (report, source, fetchXml, failed, scope) {
|
|
3984
4038
|
/// <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
4039
|
/// <remarks>If both types of source are passed, user can select which one to use.</remarks>
|
|
3986
|
-
/// <param name="
|
|
4040
|
+
/// <param name="report" type="MobileCRM.Reference">Optional reference to the resco_mobilereport entity that will be pre-selected.</param>
|
|
3987
4041
|
/// <param name="source" type="MobileCRM.Reference[]">The list of entity references used as report input.</param>
|
|
3988
4042
|
/// <param name="fetchXML" type="String">The fetch XML defining the entity (entities) query used as report input.</param>
|
|
3989
4043
|
/// <param name="failed" type="function(errorMsg)">A callback which is called in case of error.</param>
|
|
3990
4044
|
/// <param name="scope" type="Object">The scope for callbacks.</param>
|
|
3991
|
-
|
|
3992
|
-
if (typeof (entity) == "string")
|
|
3993
|
-
entity = new MobileCRM.Reference(entity, null, null);
|
|
3994
|
-
|
|
3995
|
-
var params = { fetchXml: fetchXml, entityName: entity.entityName, entity: entity, source: source };
|
|
4045
|
+
var params = { fetchXml: fetchXml, report: report, source: source };
|
|
3996
4046
|
MobileCRM.bridge.command("showMobileReportForm", JSON.stringify(params), null, failed, scope);
|
|
3997
4047
|
};
|
|
3998
4048
|
// MobileCRM.UI.Questionnaire
|