@xuda.io/xuda-worker-bundle 1.3.1189 → 1.3.1191
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 +26 -6
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -181,7 +181,7 @@ glb.SYS_DATE_ARR = [
|
|
|
181
181
|
"SYS_TIME",
|
|
182
182
|
];
|
|
183
183
|
|
|
184
|
-
glb.API_OUTPUT_ARR = ["json", "html", "xml", "text", "css"];
|
|
184
|
+
glb.API_OUTPUT_ARR = ["json", "html", "xml", "text", "css", "javascript"];
|
|
185
185
|
|
|
186
186
|
const PROTECTED_NAMES_ARR = ["THIS", "ROWID"]; //tbd
|
|
187
187
|
|
|
@@ -261,7 +261,7 @@ func.common.db = async function (
|
|
|
261
261
|
) {
|
|
262
262
|
data.device_name = firebase.auth().currentUser.displayName;
|
|
263
263
|
}
|
|
264
|
-
} catch (error) {}
|
|
264
|
+
} catch (error) { }
|
|
265
265
|
|
|
266
266
|
for (const [key, val] of Object.entries(dataP)) {
|
|
267
267
|
data[key] = val;
|
|
@@ -412,7 +412,7 @@ func.common.db = async function (
|
|
|
412
412
|
});
|
|
413
413
|
}
|
|
414
414
|
func.db.pouch.set_db_replication_from_server(SESSION_ID);
|
|
415
|
-
} catch (err) {}
|
|
415
|
+
} catch (err) { }
|
|
416
416
|
}
|
|
417
417
|
return json;
|
|
418
418
|
}
|
|
@@ -853,9 +853,8 @@ func.common.getContrast_color = function (hexcolor) {
|
|
|
853
853
|
};
|
|
854
854
|
|
|
855
855
|
func.common.get_url = function (SESSION_ID, method, path) {
|
|
856
|
-
return `https://${SESSION_OBJ[SESSION_ID].domain}/${method}${
|
|
857
|
-
|
|
858
|
-
}`;
|
|
856
|
+
return `https://${SESSION_OBJ[SESSION_ID].domain}/${method}${path ? "/" + path : "/"
|
|
857
|
+
}`;
|
|
859
858
|
};
|
|
860
859
|
|
|
861
860
|
var UI_FRAMEWORK_INSTALLED = null;
|
|
@@ -1127,6 +1126,25 @@ func.api.call_external_api = async function (method, url, payload) {
|
|
|
1127
1126
|
|
|
1128
1127
|
return await api_utils.call_external_api(method, url, payload, null);
|
|
1129
1128
|
};
|
|
1129
|
+
|
|
1130
|
+
func.api.call_javascript = async function (prog_id, params, evaluate) {
|
|
1131
|
+
const SESSION_ID = Object.keys(SESSION_OBJ)[0];
|
|
1132
|
+
const api_utils = await func.common.get_module(
|
|
1133
|
+
SESSION_ID,
|
|
1134
|
+
"xuda-api-library.mjs",
|
|
1135
|
+
{
|
|
1136
|
+
func,
|
|
1137
|
+
glb,
|
|
1138
|
+
SESSION_OBJ,
|
|
1139
|
+
SESSION_ID,
|
|
1140
|
+
APP_OBJ,
|
|
1141
|
+
dsSession: Object.keys(SESSION_OBJ[SESSION_ID].DS_GLB).at(-1),
|
|
1142
|
+
}
|
|
1143
|
+
);
|
|
1144
|
+
|
|
1145
|
+
return await api_utils.call_javascript(prog_id, params, evaluate);
|
|
1146
|
+
};
|
|
1147
|
+
|
|
1130
1148
|
glb.rpi_request_queue_num = 0;
|
|
1131
1149
|
func.common.perform_rpi_request = async function (
|
|
1132
1150
|
SESSION_ID,
|
|
@@ -2516,6 +2534,8 @@ func.datasource.execute = async function (
|
|
|
2516
2534
|
break;
|
|
2517
2535
|
}
|
|
2518
2536
|
|
|
2537
|
+
|
|
2538
|
+
|
|
2519
2539
|
case "csv":
|
|
2520
2540
|
let data = await get_data_from_source();
|
|
2521
2541
|
if (data === null) {
|