@xuda.io/xuda-worker-bundle-min 1.3.244 → 1.3.246
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/index.js +11 -471
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -2766,13 +2766,7 @@ func.datasource.get_field_init_count = async function (
|
|
|
2766
2766
|
func.utils.debug_report(
|
|
2767
2767
|
SESSION_ID,
|
|
2768
2768
|
"_ds.get_field_init_count",
|
|
2769
|
-
|
|
2770
|
-
fieldId +
|
|
2771
|
-
" prog:" +
|
|
2772
|
-
_ds.v.viewSourceDesc +
|
|
2773
|
-
" row:" +
|
|
2774
|
-
rowIdP +
|
|
2775
|
-
" reason:missing action",
|
|
2769
|
+
`Error initiating event for field: ${fieldId} prog: ${_ds.v.viewSourceDesc} row: ${rowIdP} reason: missing action`,
|
|
2776
2770
|
"E"
|
|
2777
2771
|
);
|
|
2778
2772
|
break;
|
|
@@ -2896,11 +2890,7 @@ func.datasource.get_view_events_count = async function (
|
|
|
2896
2890
|
func.utils.debug_report(
|
|
2897
2891
|
SESSION_ID,
|
|
2898
2892
|
"get_view_events_count",
|
|
2899
|
-
|
|
2900
|
-
typeP +
|
|
2901
|
-
" prog:" +
|
|
2902
|
-
_ds.v.viewSourceDesc +
|
|
2903
|
-
" reason:missing action",
|
|
2893
|
+
`Error initiating ${typeP} prog:${_ds.v.viewSourceDesc} reason: missing action`,
|
|
2904
2894
|
"E"
|
|
2905
2895
|
);
|
|
2906
2896
|
break;
|
|
@@ -2912,11 +2902,7 @@ func.datasource.get_view_events_count = async function (
|
|
|
2912
2902
|
func.utils.debug_report(
|
|
2913
2903
|
SESSION_ID,
|
|
2914
2904
|
"get_view_events_count",
|
|
2915
|
-
|
|
2916
|
-
typeP +
|
|
2917
|
-
" prog:" +
|
|
2918
|
-
_ds.v.viewSourceDesc +
|
|
2919
|
-
" reason:missing reference",
|
|
2905
|
+
`Error initiating ${typeP} prog: ${_ds.v.viewSourceDesc} reason: missing reference`,
|
|
2920
2906
|
"E"
|
|
2921
2907
|
);
|
|
2922
2908
|
break;
|
|
@@ -3907,8 +3893,8 @@ func.datasource.reset_jobs = function (SESSION_ID, dsSessionP, sourceP, errP) {
|
|
|
3907
3893
|
func.utils.debug_report(
|
|
3908
3894
|
SESSION_ID,
|
|
3909
3895
|
sourceP + "Missing datasource: " + dsSessionP,
|
|
3910
|
-
"W",
|
|
3911
3896
|
errP,
|
|
3897
|
+
"W",
|
|
3912
3898
|
null
|
|
3913
3899
|
);
|
|
3914
3900
|
};
|
|
@@ -7910,7 +7896,7 @@ func.events.execute = async function (
|
|
|
7910
7896
|
func.utils.debug_report(
|
|
7911
7897
|
SESSION_ID,
|
|
7912
7898
|
"func.events.execute",
|
|
7913
|
-
elementP
|
|
7899
|
+
`${elementP} > ${triggerP} > ${functionP} > program ${prog} is missing`,
|
|
7914
7900
|
"E"
|
|
7915
7901
|
);
|
|
7916
7902
|
func.events.delete_job(SESSION_ID, jobNoP);
|
|
@@ -8107,7 +8093,7 @@ func.events.execute = async function (
|
|
|
8107
8093
|
func.utils.debug_report(
|
|
8108
8094
|
SESSION_ID,
|
|
8109
8095
|
"func.events.execute",
|
|
8110
|
-
elementP
|
|
8096
|
+
`${elementP} > ${triggerP} > ${functionP} > program is missing`,
|
|
8111
8097
|
"E"
|
|
8112
8098
|
);
|
|
8113
8099
|
func.events.delete_job(SESSION_ID, jobNoP);
|
|
@@ -8120,13 +8106,7 @@ func.events.execute = async function (
|
|
|
8120
8106
|
func.utils.debug_report(
|
|
8121
8107
|
SESSION_ID,
|
|
8122
8108
|
"func.events.execute",
|
|
8123
|
-
elementP
|
|
8124
|
-
">" +
|
|
8125
|
-
triggerP +
|
|
8126
|
-
">" +
|
|
8127
|
-
functionP +
|
|
8128
|
-
">" +
|
|
8129
|
-
"Output field missing",
|
|
8109
|
+
`${elementP} >${triggerP} >${functionP} > Output field is missing`,
|
|
8130
8110
|
"E"
|
|
8131
8111
|
);
|
|
8132
8112
|
func.events.delete_job(SESSION_ID, jobNoP);
|
|
@@ -8645,11 +8625,9 @@ func.expression.get = async function (
|
|
|
8645
8625
|
}
|
|
8646
8626
|
if (val.fieldId && val.value && typeof val.value === "string") {
|
|
8647
8627
|
if (
|
|
8648
|
-
|
|
8649
|
-
|
|
8650
|
-
|
|
8651
|
-
sourceP === "sort" ||
|
|
8652
|
-
sourceP === "locate"
|
|
8628
|
+
["query", "condition", "range", "sort", "locate"].includes(
|
|
8629
|
+
sourceP
|
|
8630
|
+
)
|
|
8653
8631
|
) {
|
|
8654
8632
|
if (val.value.indexOf("↵") > -1) {
|
|
8655
8633
|
res[key] = val.value.split("↵").join("");
|
|
@@ -8657,11 +8635,7 @@ func.expression.get = async function (
|
|
|
8657
8635
|
res[key] = res[key].replace(/(\r\n|\n|\r)/gm, ""); //.replace(/"/g,'\"');//.replace(/'/g,"");
|
|
8658
8636
|
}
|
|
8659
8637
|
|
|
8660
|
-
if (
|
|
8661
|
-
sourceP === "init" ||
|
|
8662
|
-
sourceP === "update" ||
|
|
8663
|
-
sourceP === "virtual"
|
|
8664
|
-
) {
|
|
8638
|
+
if (["init", "update", "virtual"].includes(sourceP)) {
|
|
8665
8639
|
if (val.value.indexOf("↵") > -1)
|
|
8666
8640
|
res[key] = val.value.split("↵").join("\n");
|
|
8667
8641
|
res[key] = res[key].replace(/(\r\n|\n|\r)/gm, "\\n");
|
|
@@ -8784,440 +8758,6 @@ func.expression.get = async function (
|
|
|
8784
8758
|
return new_class.get();
|
|
8785
8759
|
};
|
|
8786
8760
|
|
|
8787
|
-
// func.expression.get = async function (
|
|
8788
|
-
// SESSION_ID,
|
|
8789
|
-
// valP,
|
|
8790
|
-
// dsSessionP,
|
|
8791
|
-
// sourceP,
|
|
8792
|
-
// rowIdP,
|
|
8793
|
-
// sourceActionP,
|
|
8794
|
-
// secondPassP,
|
|
8795
|
-
// calling_fieldIdP,
|
|
8796
|
-
// fieldsP,
|
|
8797
|
-
// debug_infoP,
|
|
8798
|
-
// iterate_info,
|
|
8799
|
-
// js_script_callback,
|
|
8800
|
-
// jobNo
|
|
8801
|
-
// ) {
|
|
8802
|
-
// var ret;
|
|
8803
|
-
// var fields = {};
|
|
8804
|
-
// var error;
|
|
8805
|
-
// var warning;
|
|
8806
|
-
|
|
8807
|
-
// function evalJson(text) {
|
|
8808
|
-
// return eval("(" + text + ")");
|
|
8809
|
-
// }
|
|
8810
|
-
|
|
8811
|
-
// if (valP === null) {
|
|
8812
|
-
// ret = "";
|
|
8813
|
-
// } else {
|
|
8814
|
-
// switch (typeof valP) {
|
|
8815
|
-
// case "string":
|
|
8816
|
-
// ret = valP;
|
|
8817
|
-
// break;
|
|
8818
|
-
|
|
8819
|
-
// case "undefined":
|
|
8820
|
-
// ret = "";
|
|
8821
|
-
// break;
|
|
8822
|
-
|
|
8823
|
-
// case "boolean":
|
|
8824
|
-
// ret = valP ? "Y" : "N";
|
|
8825
|
-
// break;
|
|
8826
|
-
|
|
8827
|
-
// default:
|
|
8828
|
-
// ret = valP.toString();
|
|
8829
|
-
// break;
|
|
8830
|
-
// }
|
|
8831
|
-
// }
|
|
8832
|
-
|
|
8833
|
-
// ret = ret.replace(/\&/g, "&");
|
|
8834
|
-
// const end_results = function () {
|
|
8835
|
-
// const replace_quotes = function (ret) {
|
|
8836
|
-
// for (const [key, val] of Object.entries(fields)) {
|
|
8837
|
-
// if (typeof val === "string")
|
|
8838
|
-
// ret = ret.replace('"' + val + '"', val.replace(/"/gi, ""));
|
|
8839
|
-
// }
|
|
8840
|
-
// return ret;
|
|
8841
|
-
// };
|
|
8842
|
-
// if (sourceP === "update" || sourceP === "javascript") {
|
|
8843
|
-
// if (typeof ret === "string") ret = replace_quotes(ret);
|
|
8844
|
-
// }
|
|
8845
|
-
// const log_error = function () {
|
|
8846
|
-
// if (SESSION_OBJ[SESSION_ID].DS_GLB[dsSessionP]) {
|
|
8847
|
-
// func.utils.debug.log(
|
|
8848
|
-
// SESSION_ID,
|
|
8849
|
-
// SESSION_OBJ[SESSION_ID].DS_GLB[dsSessionP].nodeId,
|
|
8850
|
-
// {
|
|
8851
|
-
// module: "expression",
|
|
8852
|
-
// action: sourceP,
|
|
8853
|
-
// source: calling_fieldIdP,
|
|
8854
|
-
// prop: ret,
|
|
8855
|
-
// details: ret,
|
|
8856
|
-
// result: ret,
|
|
8857
|
-
// error: error,
|
|
8858
|
-
// warning: warning,
|
|
8859
|
-
// fields: null,
|
|
8860
|
-
// type: "exp",
|
|
8861
|
-
// prog_id: SESSION_OBJ[SESSION_ID].DS_GLB[dsSessionP].prog_id,
|
|
8862
|
-
// debug_info: debug_infoP,
|
|
8863
|
-
// }
|
|
8864
|
-
// );
|
|
8865
|
-
// }
|
|
8866
|
-
// };
|
|
8867
|
-
// if (error) log_error();
|
|
8868
|
-
// // if (error || warning) log_error();
|
|
8869
|
-
// return {
|
|
8870
|
-
// result: ret,
|
|
8871
|
-
// fields: fields,
|
|
8872
|
-
// res: res,
|
|
8873
|
-
// explain: result,
|
|
8874
|
-
// error: error,
|
|
8875
|
-
// warning: warning,
|
|
8876
|
-
// req: valP,
|
|
8877
|
-
// var_error_found: var_error_found,
|
|
8878
|
-
// };
|
|
8879
|
-
// };
|
|
8880
|
-
// const variable_not_exist = async function () {
|
|
8881
|
-
// try {
|
|
8882
|
-
// if (sourceP !== "arguments") {
|
|
8883
|
-
// if (ret && ret.substr(0, 6) === "_DATE_") {
|
|
8884
|
-
// ret = ret.substr(6);
|
|
8885
|
-
// } else if (
|
|
8886
|
-
// (ret &&
|
|
8887
|
-
// ret.length === 10 &&
|
|
8888
|
-
// ret.substr(4, 1) === "-" &&
|
|
8889
|
-
// ret.substr(7, 1) === "-") ||
|
|
8890
|
-
// ret === "self" // bypass eval for date 2017-03-22
|
|
8891
|
-
// ) {
|
|
8892
|
-
// ret = ret;
|
|
8893
|
-
// } else {
|
|
8894
|
-
// // ret = secure_eval(ret); //eval(ret);
|
|
8895
|
-
// ret = await func.expression.secure_eval(
|
|
8896
|
-
// SESSION_ID,
|
|
8897
|
-
// sourceP,
|
|
8898
|
-
// ret,
|
|
8899
|
-
// jobNo,
|
|
8900
|
-
// dsSessionP,
|
|
8901
|
-
// js_script_callback
|
|
8902
|
-
// );
|
|
8903
|
-
// }
|
|
8904
|
-
// // console.log("AFTER OK", ret)
|
|
8905
|
-
// return end_results();
|
|
8906
|
-
// } else {
|
|
8907
|
-
// // do eval for arithmetic vals
|
|
8908
|
-
// ret = ret.replace(/_NULL/gi, "");
|
|
8909
|
-
// return end_results();
|
|
8910
|
-
// }
|
|
8911
|
-
// } catch (err) {
|
|
8912
|
-
// // console.error(err);
|
|
8913
|
-
// return end_results();
|
|
8914
|
-
// }
|
|
8915
|
-
// };
|
|
8916
|
-
// if (!func.expression.validate_variables(valP)) {
|
|
8917
|
-
// return await variable_not_exist();
|
|
8918
|
-
// }
|
|
8919
|
-
// var split = [];
|
|
8920
|
-
// var var_Arr = [];
|
|
8921
|
-
// split = func.expression.parse(ret);
|
|
8922
|
-
// for await (const [arr_key, val] of Object.entries(split)) {
|
|
8923
|
-
// // run each field
|
|
8924
|
-
// const key = Number(arr_key);
|
|
8925
|
-
// var_Arr[key] = {};
|
|
8926
|
-
// var_Arr[key].value = val.value;
|
|
8927
|
-
// //--------------
|
|
8928
|
-
// const replace_value_in_string = function (retP, fieldIdP) {
|
|
8929
|
-
// if (
|
|
8930
|
-
// iterate_info?.iterator_key === fieldIdP ||
|
|
8931
|
-
// iterate_info?.iterator_val === fieldIdP
|
|
8932
|
-
// ) {
|
|
8933
|
-
// if (iterate_info.iterator_key === fieldIdP) {
|
|
8934
|
-
// retP.value = iterate_info._key;
|
|
8935
|
-
// }
|
|
8936
|
-
// if (iterate_info.iterator_val === fieldIdP) {
|
|
8937
|
-
// retP.value = iterate_info._val;
|
|
8938
|
-
// }
|
|
8939
|
-
// }
|
|
8940
|
-
|
|
8941
|
-
// const set_value = function (valP) {
|
|
8942
|
-
// if (typeof valP !== "undefined") {
|
|
8943
|
-
// var_Arr[key].value = valP;
|
|
8944
|
-
// if (typeof valP === "string") var_Arr[key].type = "string";
|
|
8945
|
-
// } else {
|
|
8946
|
-
// if (retP.type === "object") {
|
|
8947
|
-
// var_Arr[key].value = "";
|
|
8948
|
-
// var_Arr[key].type = "string";
|
|
8949
|
-
// }
|
|
8950
|
-
// }
|
|
8951
|
-
// };
|
|
8952
|
-
|
|
8953
|
-
// if (sourceP === "exp" && retP.type !== "exp") {
|
|
8954
|
-
// var_Arr[key].type = retP.type;
|
|
8955
|
-
// return;
|
|
8956
|
-
// }
|
|
8957
|
-
// if (typeof retP.value !== "undefined") {
|
|
8958
|
-
// var_Arr[key].type = retP.type;
|
|
8959
|
-
// var_Arr[key].value = retP.value;
|
|
8960
|
-
// if ((val.value.indexOf("[") > -1) | (val.value.indexOf(".") > -1)) {
|
|
8961
|
-
// //get values from array '@var==="sss" && @var_B==="sss" && @obj.property===5 && @objA["value"]===123 | @objB["value"].property===1234'
|
|
8962
|
-
// var data = retP.prop;
|
|
8963
|
-
// if (retP.type === "object") data = retP.value;
|
|
8964
|
-
// var property1, property2;
|
|
8965
|
-
// //check for split situation: @objB[@var].property 1: @objB[ 2:@var].property
|
|
8966
|
-
// if (
|
|
8967
|
-
// val.value.indexOf("[") === -1 &&
|
|
8968
|
-
// val.value.indexOf("]") > -1 &&
|
|
8969
|
-
// val.value.substr(0, 1) === "@"
|
|
8970
|
-
// ) {
|
|
8971
|
-
// //check situation 2
|
|
8972
|
-
// var prevData = var_Arr[key - 1].value;
|
|
8973
|
-
// var_Arr[key].value = prevData[data]; // @objB[@var]
|
|
8974
|
-
// if (val.value.indexOf(".") > -1) {
|
|
8975
|
-
// property2 = func.expression.get_property(val.value).property2; //val.value.substr(val.value.indexOf(".") + 1, val.value.length); // get .
|
|
8976
|
-
// if (prevData[data]) set_value(prevData[data][property2]);
|
|
8977
|
-
// // var_Arr[key].value = prevData[data][property2]; //@objB[@var].property
|
|
8978
|
-
// }
|
|
8979
|
-
// delete var_Arr[key - 1];
|
|
8980
|
-
// } else {
|
|
8981
|
-
// property1 = func.expression.get_property(val.value).property1;
|
|
8982
|
-
// property2 = func.expression.get_property(val.value).property2;
|
|
8983
|
-
// if (property1) {
|
|
8984
|
-
// var_Arr[key].value = data[property1]; // @var["value"] or @var.property
|
|
8985
|
-
// if (property2) {
|
|
8986
|
-
// if (data[property1]) set_value(data[property1][property2]);
|
|
8987
|
-
// }
|
|
8988
|
-
// }
|
|
8989
|
-
// if (property2 && !property1) {
|
|
8990
|
-
// if (
|
|
8991
|
-
// data //data[property2]
|
|
8992
|
-
// ) {
|
|
8993
|
-
// set_value(data[property2]);
|
|
8994
|
-
// }
|
|
8995
|
-
// }
|
|
8996
|
-
// }
|
|
8997
|
-
// fields[fieldIdP] = var_Arr[key].value; // added 051017 to allow @SYS_GLOBAL_OBJ_WIDGET_INFO.doc_id
|
|
8998
|
-
// var_Arr[key].fieldId = fieldIdP;
|
|
8999
|
-
// } else {
|
|
9000
|
-
// fields[fieldIdP] = var_Arr[key].value; // update flat no warpers
|
|
9001
|
-
// var_Arr[key].fieldId = fieldIdP;
|
|
9002
|
-
// }
|
|
9003
|
-
// }
|
|
9004
|
-
// };
|
|
9005
|
-
// //>>>>>>>>>>>>>>>>>>
|
|
9006
|
-
// //>>>> start here >>
|
|
9007
|
-
// //>>>>>>>>>>>>>>>>>>
|
|
9008
|
-
// if (val.fieldId) {
|
|
9009
|
-
// // @_THIS
|
|
9010
|
-
// if (
|
|
9011
|
-
// val.fieldId &&
|
|
9012
|
-
// val.fieldId.substr(0, 5) === "_THIS" &&
|
|
9013
|
-
// calling_fieldIdP &&
|
|
9014
|
-
// (val.fieldId.length === 5 ||
|
|
9015
|
-
// (val.fieldId.length > 5 && val.fieldId.substr(5, 1) === "."))
|
|
9016
|
-
// ) {
|
|
9017
|
-
// if (val.fieldId.length === 5) val.fieldId = calling_fieldIdP;
|
|
9018
|
-
// else
|
|
9019
|
-
// val.fieldId =
|
|
9020
|
-
// calling_fieldIdP + val.fieldId(5, val.fieldId.length - 1);
|
|
9021
|
-
// }
|
|
9022
|
-
// if (!sourceP === "exp") {
|
|
9023
|
-
// var_Arr[key].value = '""';
|
|
9024
|
-
// } // put default
|
|
9025
|
-
// fields[val.fieldId] = var_Arr[key].value;
|
|
9026
|
-
|
|
9027
|
-
// const ret = await func.datasource.get_value(
|
|
9028
|
-
// SESSION_ID,
|
|
9029
|
-
// val.fieldId,
|
|
9030
|
-
// dsSessionP,
|
|
9031
|
-
|
|
9032
|
-
// rowIdP
|
|
9033
|
-
// ); // find field in dataSources
|
|
9034
|
-
|
|
9035
|
-
// replace_value_in_string(ret.ret, ret.fieldIdP);
|
|
9036
|
-
// }
|
|
9037
|
-
// }
|
|
9038
|
-
// try {
|
|
9039
|
-
// // eval the expression
|
|
9040
|
-
// var res = [];
|
|
9041
|
-
// var exp_exist;
|
|
9042
|
-
// var var_error_found;
|
|
9043
|
-
// // merge arr values
|
|
9044
|
-
// _.forEach(var_Arr, function (val, key) {
|
|
9045
|
-
// if (sourceP === "UI Property EXP") {
|
|
9046
|
-
// let ret = func.utils.get_drive_url(SESSION_ID, val.value, true);
|
|
9047
|
-
// if (ret.changed) {
|
|
9048
|
-
// res[key] = ret.value;
|
|
9049
|
-
// return true;
|
|
9050
|
-
// }
|
|
9051
|
-
// }
|
|
9052
|
-
|
|
9053
|
-
// if (sourceP === "UI Attr EXP") {
|
|
9054
|
-
// let ret = func.utils.get_drive_url(
|
|
9055
|
-
// SESSION_ID,
|
|
9056
|
-
// val.value,
|
|
9057
|
-
// var_Arr.length == 1 ? false : true
|
|
9058
|
-
// );
|
|
9059
|
-
// if (ret.changed) {
|
|
9060
|
-
// res[key] = ret.value;
|
|
9061
|
-
// return true;
|
|
9062
|
-
// }
|
|
9063
|
-
// }
|
|
9064
|
-
|
|
9065
|
-
// if (val.type === "exp") {
|
|
9066
|
-
// exp_exist = true;
|
|
9067
|
-
// }
|
|
9068
|
-
// res[key] = val.value;
|
|
9069
|
-
// if (
|
|
9070
|
-
// sourceP !== "DbQuery" &&
|
|
9071
|
-
// sourceP !== "alert" &&
|
|
9072
|
-
// sourceP !== "exp" &&
|
|
9073
|
-
// sourceP !== "api_rendered_output" &&
|
|
9074
|
-
// (val.type === "string" || val.type === "date" || val.type === "time") &&
|
|
9075
|
-
// var_Arr.length > 1
|
|
9076
|
-
// ) {
|
|
9077
|
-
// res[key] = "`" + val.value + "`"; //res[key] = "'" + val.value + "'"; //
|
|
9078
|
-
// }
|
|
9079
|
-
// if (val.fieldId && val.value && typeof val.value === "string") {
|
|
9080
|
-
// if (
|
|
9081
|
-
// sourceP === "query" ||
|
|
9082
|
-
// sourceP === "condition" ||
|
|
9083
|
-
// sourceP === "range" ||
|
|
9084
|
-
// sourceP === "sort" ||
|
|
9085
|
-
// sourceP === "locate"
|
|
9086
|
-
// ) {
|
|
9087
|
-
// if (val.value.indexOf("↵") > -1) {
|
|
9088
|
-
// res[key] = val.value.split("↵").join("");
|
|
9089
|
-
// }
|
|
9090
|
-
// res[key] = res[key].replace(/(\r\n|\n|\r)/gm, ""); //.replace(/"/g,'\"');//.replace(/'/g,"");
|
|
9091
|
-
// }
|
|
9092
|
-
|
|
9093
|
-
// if (
|
|
9094
|
-
// sourceP === "init" ||
|
|
9095
|
-
// sourceP === "update" ||
|
|
9096
|
-
// sourceP === "virtual"
|
|
9097
|
-
// ) {
|
|
9098
|
-
// if (val.value.indexOf("↵") > -1)
|
|
9099
|
-
// res[key] = val.value.split("↵").join("\n");
|
|
9100
|
-
// res[key] = res[key].replace(/(\r\n|\n|\r)/gm, "\\n");
|
|
9101
|
-
// }
|
|
9102
|
-
|
|
9103
|
-
// if (typeof IS_PROCESS_SERVER !== "undefined") {
|
|
9104
|
-
// res[key] = res[key].replace(/(\r\n|\n|\r)/gm, "<br>");
|
|
9105
|
-
// }
|
|
9106
|
-
|
|
9107
|
-
// fields[val.fieldId] = res[key];
|
|
9108
|
-
// }
|
|
9109
|
-
// // extract object
|
|
9110
|
-
// if (typeof val.value === "object" && var_Arr.length > 1) {
|
|
9111
|
-
// if (
|
|
9112
|
-
// !Array.isArray(val.value) &&
|
|
9113
|
-
// !var_Arr[key + 1].value?.includes(".")
|
|
9114
|
-
// ) {
|
|
9115
|
-
// // prevent cast on single value expression
|
|
9116
|
-
// res[key] = "(" + JSON.stringify(val.value) + ")";
|
|
9117
|
-
// } else {
|
|
9118
|
-
// res[key] = JSON.stringify(val.value);
|
|
9119
|
-
// }
|
|
9120
|
-
// }
|
|
9121
|
-
|
|
9122
|
-
// if (
|
|
9123
|
-
// !exp_exist &&
|
|
9124
|
-
// sourceP !== "exp" &&
|
|
9125
|
-
// val.value &&
|
|
9126
|
-
// typeof val.value === "string" &&
|
|
9127
|
-
// val.value.substr(0, 1) === "@"
|
|
9128
|
-
// ) {
|
|
9129
|
-
// warning = "Error encoding " + val.value;
|
|
9130
|
-
// var_error_found = true;
|
|
9131
|
-
// res[key] = 0;
|
|
9132
|
-
// }
|
|
9133
|
-
// });
|
|
9134
|
-
// var join = function (arrP) {
|
|
9135
|
-
// return arrP.join("");
|
|
9136
|
-
// };
|
|
9137
|
-
// var exp = undefined;
|
|
9138
|
-
// if (exp_exist && sourceP !== "exp") {
|
|
9139
|
-
// exp = await func.expression.get(
|
|
9140
|
-
// SESSION_ID,
|
|
9141
|
-
// join(res),
|
|
9142
|
-
// dsSessionP,
|
|
9143
|
-
// sourceP,
|
|
9144
|
-
// rowIdP,
|
|
9145
|
-
// sourceActionP,
|
|
9146
|
-
// true,
|
|
9147
|
-
// calling_fieldIdP,
|
|
9148
|
-
// fields,
|
|
9149
|
-
// debug_infoP
|
|
9150
|
-
// );
|
|
9151
|
-
// if (exp.res) res = exp.res;
|
|
9152
|
-
// // do second pass when exp exist
|
|
9153
|
-
// else res = [exp.result];
|
|
9154
|
-
// fields = _.assignIn(exp.fields, fieldsP);
|
|
9155
|
-
// }
|
|
9156
|
-
// var result = join(res); //res.join("");
|
|
9157
|
-
|
|
9158
|
-
// if (res.length === 1) {
|
|
9159
|
-
// // bypass join for single value expression
|
|
9160
|
-
// result = res[0];
|
|
9161
|
-
// }
|
|
9162
|
-
|
|
9163
|
-
// if (secondPassP) {
|
|
9164
|
-
// ret = result;
|
|
9165
|
-
// } else if (sourceP !== "exp") {
|
|
9166
|
-
// // no eval for second pass
|
|
9167
|
-
// // return single value
|
|
9168
|
-
// if (
|
|
9169
|
-
// res.length === 1 &&
|
|
9170
|
-
// typeof res[0] === "string" &&
|
|
9171
|
-
// typeof res[0] !== "object"
|
|
9172
|
-
// ) {
|
|
9173
|
-
// // avoid eval when query leading zeros problem
|
|
9174
|
-
// ret = join(res); // res.join("");
|
|
9175
|
-
// if (ret && ret.substr(0, 1) === "@") {
|
|
9176
|
-
// error = "Error encoding @ var";
|
|
9177
|
-
// var_error_found = true;
|
|
9178
|
-
// }
|
|
9179
|
-
// } else {
|
|
9180
|
-
// if (
|
|
9181
|
-
// sourceP !== "arguments" &&
|
|
9182
|
-
// sourceP !== "alert" &&
|
|
9183
|
-
// sourceP !== "api_rendered_output" &&
|
|
9184
|
-
// sourceP !== "DbQuery"
|
|
9185
|
-
// ) {
|
|
9186
|
-
// // ret = secure_eval(result); // eval(result);
|
|
9187
|
-
// ret = await func.expression.secure_eval(
|
|
9188
|
-
// SESSION_ID,
|
|
9189
|
-
// sourceP,
|
|
9190
|
-
// result,
|
|
9191
|
-
// jobNo,
|
|
9192
|
-
// dsSessionP,
|
|
9193
|
-
// js_script_callback
|
|
9194
|
-
// );
|
|
9195
|
-
// } else {
|
|
9196
|
-
// if (sourceP === "DbQuery") {
|
|
9197
|
-
// ret = JSON.stringify(evalJson(result));
|
|
9198
|
-
// } else {
|
|
9199
|
-
// // try eval
|
|
9200
|
-
// ret = result;
|
|
9201
|
-
// }
|
|
9202
|
-
// }
|
|
9203
|
-
// }
|
|
9204
|
-
// }
|
|
9205
|
-
// // console.log("AAAA")
|
|
9206
|
-
// return end_results();
|
|
9207
|
-
// } catch (err) {
|
|
9208
|
-
// ret = result; // skip eval on error
|
|
9209
|
-
// error = err.message;
|
|
9210
|
-
|
|
9211
|
-
// return end_results();
|
|
9212
|
-
// }
|
|
9213
|
-
// // }
|
|
9214
|
-
// // else {
|
|
9215
|
-
// // return variable_not_exist();
|
|
9216
|
-
// // //===========================
|
|
9217
|
-
// // // variable not exist
|
|
9218
|
-
// // }
|
|
9219
|
-
// // >>>> return results <<<<<<<<<
|
|
9220
|
-
// };
|
|
9221
8761
|
func.expression.parse = function (strP) {
|
|
9222
8762
|
var extract_str = function (strP, posP) {
|
|
9223
8763
|
if (!posP) posP = 0;
|