@xuda.io/xuda-worker-bundle-min 1.3.654 → 1.3.656
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 +44 -44
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -188,7 +188,7 @@ func.common.get_custom_icon = async function (
|
|
|
188
188
|
if (get_image_onlyP) {
|
|
189
189
|
return tree_ret2.rPTH;
|
|
190
190
|
} else {
|
|
191
|
-
const app_obj = APP_OBJ[SESSION_OBJ[SESSION_ID].
|
|
191
|
+
const app_obj = APP_OBJ[SESSION_OBJ[SESSION_ID].app_id];
|
|
192
192
|
const url = func.common.get_url(
|
|
193
193
|
SESSION_ID,
|
|
194
194
|
"studio-drive",
|
|
@@ -217,7 +217,7 @@ func.common.db = async function (
|
|
|
217
217
|
) {
|
|
218
218
|
return new Promise(async function (resolve, reject) {
|
|
219
219
|
var _session = SESSION_OBJ[SESSION_ID];
|
|
220
|
-
const app_id = _session.
|
|
220
|
+
const app_id = _session.app_id;
|
|
221
221
|
|
|
222
222
|
var data = {
|
|
223
223
|
app_id: app_id,
|
|
@@ -1092,7 +1092,7 @@ func.common.perform_rpi_request = async function (
|
|
|
1092
1092
|
|
|
1093
1093
|
var url = func.common.get_url(SESSION_ID, "rpi", "");
|
|
1094
1094
|
var _session = SESSION_OBJ[SESSION_ID];
|
|
1095
|
-
const app_id = _session.
|
|
1095
|
+
const app_id = _session.app_id;
|
|
1096
1096
|
|
|
1097
1097
|
if (
|
|
1098
1098
|
APP_OBJ[app_id].is_deployment &&
|
|
@@ -1405,7 +1405,7 @@ glb.lifecycle = {
|
|
|
1405
1405
|
var params = {
|
|
1406
1406
|
SESSION_ID,
|
|
1407
1407
|
session_data: _session,
|
|
1408
|
-
app_obj: APP_OBJ[_session.
|
|
1408
|
+
app_obj: APP_OBJ[_session.app_id],
|
|
1409
1409
|
xu_api,
|
|
1410
1410
|
};
|
|
1411
1411
|
|
|
@@ -1738,19 +1738,19 @@ func.datasource.prepare = async function (
|
|
|
1738
1738
|
const build_GLOBAL_SYS_fields = function () {
|
|
1739
1739
|
if (!_ds.data_system) _ds.data_system = {};
|
|
1740
1740
|
_ds.data_system["SYS_GLOBAL_UTC"] = -new Date().getTimezoneOffset() / 60;
|
|
1741
|
-
_ds.data_system["SYS_GLOBAL_STR_APP_ID"] = APP_OBJ[_session.
|
|
1741
|
+
_ds.data_system["SYS_GLOBAL_STR_APP_ID"] = APP_OBJ[_session.app_id]._id;
|
|
1742
1742
|
_ds.data_system["SYS_GLOBAL_STR_SESSION_ID"] = SESSION_ID;
|
|
1743
1743
|
_ds.data_system["SYS_GLOBAL_STR_LOGIN_USER_ID"] = _session.USR_OBJ._id;
|
|
1744
1744
|
|
|
1745
1745
|
if (
|
|
1746
1746
|
_session.engine_mode !== "live_preview" &&
|
|
1747
|
-
PROJECT_OBJ[_session.
|
|
1747
|
+
PROJECT_OBJ[_session.app_id].info
|
|
1748
1748
|
) {
|
|
1749
1749
|
_ds.data_system["SYS_GLOBAL_OBJ_APP_INFO"] = {
|
|
1750
|
-
build: PROJECT_OBJ[_session.
|
|
1751
|
-
author: PROJECT_OBJ[_session.
|
|
1752
|
-
date: PROJECT_OBJ[_session.
|
|
1753
|
-
name: APP_OBJ[_session.
|
|
1750
|
+
build: PROJECT_OBJ[_session.app_id].info.build_id,
|
|
1751
|
+
author: PROJECT_OBJ[_session.app_id].info.author,
|
|
1752
|
+
date: PROJECT_OBJ[_session.app_id].info.build_date,
|
|
1753
|
+
name: APP_OBJ[_session.app_id].app_name,
|
|
1754
1754
|
};
|
|
1755
1755
|
}
|
|
1756
1756
|
_ds.data_system["SYS_GLOBAL_OBJ_LOGIN_USER_INFO"] = {
|
|
@@ -4860,7 +4860,7 @@ func.utils.DOCS_OBJ.get = async function (SESSION_ID, idP) {
|
|
|
4860
4860
|
if (!idP || idP === "0") return;
|
|
4861
4861
|
|
|
4862
4862
|
var _session = SESSION_OBJ[SESSION_ID];
|
|
4863
|
-
const _app_id = _session.
|
|
4863
|
+
const _app_id = _session.app_id;
|
|
4864
4864
|
if (!DOCS_OBJ[_app_id]) {
|
|
4865
4865
|
DOCS_OBJ[_app_id] = {};
|
|
4866
4866
|
}
|
|
@@ -5382,21 +5382,21 @@ func.utils.ws_worker.functions = {
|
|
|
5382
5382
|
init: async function (data) {
|
|
5383
5383
|
var SESSION_ID = data.SESSION_ID;
|
|
5384
5384
|
|
|
5385
|
-
APP_OBJ[data.
|
|
5386
|
-
PROJECT_OBJ[data.
|
|
5385
|
+
APP_OBJ[data.app_id] = data.APP_OBJ;
|
|
5386
|
+
PROJECT_OBJ[data.app_id] = data.PROJECT_OBJ;
|
|
5387
5387
|
|
|
5388
5388
|
if (data.SESSION_INFO.engine_mode === "live_preview") {
|
|
5389
|
-
DOCS_OBJ[data.
|
|
5389
|
+
DOCS_OBJ[data.app_id] = data.DOCS_OBJ;
|
|
5390
5390
|
} else if (
|
|
5391
5391
|
typeof IS_DOCKER === "undefined" &&
|
|
5392
5392
|
typeof IS_PROCESS_SERVER === "undefined"
|
|
5393
5393
|
) {
|
|
5394
|
-
if (!DOCS_OBJ[data.
|
|
5395
|
-
DOCS_OBJ[data.
|
|
5394
|
+
if (!DOCS_OBJ[data.app_id]) {
|
|
5395
|
+
DOCS_OBJ[data.app_id] = {};
|
|
5396
5396
|
}
|
|
5397
5397
|
}
|
|
5398
5398
|
|
|
5399
|
-
glb.APP_INFO[data.
|
|
5399
|
+
glb.APP_INFO[data.app_id] = data.APP_INFO;
|
|
5400
5400
|
glb.DEBUG_MODE = data.DEBUG_MODE;
|
|
5401
5401
|
glb.DEBUG_INFO_OBJ = data.DEBUG_INFO_OBJ;
|
|
5402
5402
|
|
|
@@ -5430,7 +5430,7 @@ func.utils.ws_worker.functions = {
|
|
|
5430
5430
|
_session.WORKER_OBJ.fx = new func.utils.job_worker(SESSION_ID);
|
|
5431
5431
|
_session.WORKER_OBJ.fx.init();
|
|
5432
5432
|
|
|
5433
|
-
if (_session.
|
|
5433
|
+
if (_session.app_id === "unknown") {
|
|
5434
5434
|
worker_post_message({
|
|
5435
5435
|
fx_to_execute: "init_done",
|
|
5436
5436
|
worker_id: ws_worker_id,
|
|
@@ -5461,7 +5461,7 @@ func.utils.ws_worker.functions = {
|
|
|
5461
5461
|
if (show_log) {
|
|
5462
5462
|
console.log(
|
|
5463
5463
|
"DATASOURCE EXECUTING SESSION_ID: " + SESSION_ID,
|
|
5464
|
-
APP_OBJ[_session.
|
|
5464
|
+
APP_OBJ[_session.app_id].app_name
|
|
5465
5465
|
);
|
|
5466
5466
|
}
|
|
5467
5467
|
if (
|
|
@@ -5498,7 +5498,7 @@ func.utils.ws_worker.functions = {
|
|
|
5498
5498
|
" " +
|
|
5499
5499
|
_session.DS_GLB[ret.dsSessionP]?.tree_obj?.menuName ||
|
|
5500
5500
|
"" + " SESSION_ID: " + SESSION_ID,
|
|
5501
|
-
APP_OBJ[_session.
|
|
5501
|
+
APP_OBJ[_session.app_id].app_name
|
|
5502
5502
|
);
|
|
5503
5503
|
var obj = func.utils.clean_returned_datasource(SESSION_ID, ret.dsSessionP);
|
|
5504
5504
|
obj.dataSourceSessionGlobal = _session.dataSourceSessionGlobal;
|
|
@@ -5525,7 +5525,7 @@ func.utils.ws_worker.functions = {
|
|
|
5525
5525
|
if (show_log)
|
|
5526
5526
|
console.log(
|
|
5527
5527
|
"DATASOURCE DELETE SESSION_ID: " + SESSION_ID,
|
|
5528
|
-
APP_OBJ[_session.
|
|
5528
|
+
APP_OBJ[_session.app_id].app_name,
|
|
5529
5529
|
params.dssession
|
|
5530
5530
|
);
|
|
5531
5531
|
// debugger;
|
|
@@ -5546,14 +5546,14 @@ func.utils.ws_worker.functions = {
|
|
|
5546
5546
|
var _session = SESSION_OBJ[SESSION_ID];
|
|
5547
5547
|
if (!_session) {
|
|
5548
5548
|
_session = {};
|
|
5549
|
-
_session.
|
|
5549
|
+
_session.app_id = params.app_id;
|
|
5550
5550
|
_session.dataSourceSessionGlobal = -1;
|
|
5551
5551
|
_session.DS_GLB = {};
|
|
5552
5552
|
}
|
|
5553
5553
|
if (show_log)
|
|
5554
5554
|
console.log(
|
|
5555
5555
|
"DATASOURCE UPDATE SESSION_ID: " + SESSION_ID,
|
|
5556
|
-
APP_OBJ[_session.
|
|
5556
|
+
APP_OBJ[_session.app_id].app_name,
|
|
5557
5557
|
params.dssession
|
|
5558
5558
|
);
|
|
5559
5559
|
|
|
@@ -5732,7 +5732,7 @@ func.utils.ws_worker.functions = {
|
|
|
5732
5732
|
if (typeof show_log !== "undefined" && show_log)
|
|
5733
5733
|
console.log(
|
|
5734
5734
|
"DATASOURCE GET GRID TOTALS SESSION_ID: " + SESSION_ID,
|
|
5735
|
-
APP_OBJ[_session.
|
|
5735
|
+
APP_OBJ[_session.app_id].app_name,
|
|
5736
5736
|
params.dssession
|
|
5737
5737
|
);
|
|
5738
5738
|
|
|
@@ -5819,7 +5819,7 @@ func.utils.ws_worker.functions = {
|
|
|
5819
5819
|
// if (show_log)
|
|
5820
5820
|
// console.log(
|
|
5821
5821
|
// "DATASOURCE GET VALUE SESSION_ID: " + SESSION_ID,
|
|
5822
|
-
// APP_OBJ[_session.
|
|
5822
|
+
// APP_OBJ[_session.app_id].app_name,
|
|
5823
5823
|
// params.dssession
|
|
5824
5824
|
// );
|
|
5825
5825
|
// const ret = await func.datasource.get_value(
|
|
@@ -5852,7 +5852,7 @@ func.utils.ws_worker.functions = {
|
|
|
5852
5852
|
params.dssession +
|
|
5853
5853
|
" SESSION_ID: " +
|
|
5854
5854
|
SESSION_ID,
|
|
5855
|
-
APP_OBJ[_session.
|
|
5855
|
+
APP_OBJ[_session.app_id].app_name
|
|
5856
5856
|
);
|
|
5857
5857
|
_session.DS_GLB[params.dssession].v.onscreen_events_active =
|
|
5858
5858
|
params.onscreen_events_active;
|
|
@@ -5867,7 +5867,7 @@ func.utils.ws_worker.functions = {
|
|
|
5867
5867
|
DS +
|
|
5868
5868
|
" SESSION_ID: " +
|
|
5869
5869
|
SESSION_ID,
|
|
5870
|
-
APP_OBJ[_session.
|
|
5870
|
+
APP_OBJ[_session.app_id].app_name
|
|
5871
5871
|
);
|
|
5872
5872
|
var obj = func.utils.clean_returned_datasource(SESSION_ID, DS);
|
|
5873
5873
|
obj.dataSourceSessionGlobal = _session.dataSourceSessionGlobal;
|
|
@@ -5897,7 +5897,7 @@ func.utils.ws_worker.functions = {
|
|
|
5897
5897
|
params.dssession +
|
|
5898
5898
|
" SESSION_ID: " +
|
|
5899
5899
|
SESSION_ID,
|
|
5900
|
-
APP_OBJ[_session.
|
|
5900
|
+
APP_OBJ[_session.app_id].app_name
|
|
5901
5901
|
);
|
|
5902
5902
|
ds.eventChangesResults_done = true;
|
|
5903
5903
|
},
|
|
@@ -5911,7 +5911,7 @@ func.utils.ws_worker.functions = {
|
|
|
5911
5911
|
params.dssession +
|
|
5912
5912
|
" SESSION_ID: " +
|
|
5913
5913
|
SESSION_ID,
|
|
5914
|
-
APP_OBJ[_session.
|
|
5914
|
+
APP_OBJ[_session.app_id].app_name
|
|
5915
5915
|
);
|
|
5916
5916
|
debugger;
|
|
5917
5917
|
var callback = func.utils.get_callback_queue(
|
|
@@ -5930,7 +5930,7 @@ func.utils.ws_worker.functions = {
|
|
|
5930
5930
|
params.dssession +
|
|
5931
5931
|
" SESSION_ID: " +
|
|
5932
5932
|
SESSION_ID,
|
|
5933
|
-
APP_OBJ[_session.
|
|
5933
|
+
APP_OBJ[_session.app_id].app_name
|
|
5934
5934
|
);
|
|
5935
5935
|
func.utils.get_callback_queue(SESSION_ID, params.callback_id)();
|
|
5936
5936
|
},
|
|
@@ -6147,7 +6147,7 @@ func.utils.get_drive_url = function (SESSION_ID, val, wrap) {
|
|
|
6147
6147
|
|
|
6148
6148
|
var _session = SESSION_OBJ[SESSION_ID];
|
|
6149
6149
|
function replaceFiletoURL(fileString) {
|
|
6150
|
-
const _app = APP_OBJ[_session.
|
|
6150
|
+
const _app = APP_OBJ[_session.app_id];
|
|
6151
6151
|
let _domain = _session.domain;
|
|
6152
6152
|
if (_session.is_deployment) {
|
|
6153
6153
|
_domain =
|
|
@@ -6163,7 +6163,7 @@ func.utils.get_drive_url = function (SESSION_ID, val, wrap) {
|
|
|
6163
6163
|
const FILE_REPLACE_URL = `${url}${val}?token=${_session.app_token}`;
|
|
6164
6164
|
|
|
6165
6165
|
let match = `drv_${
|
|
6166
|
-
_app.app_replicate || _session.
|
|
6166
|
+
_app.app_replicate || _session.app_id
|
|
6167
6167
|
}_[0-9a-f\\-]+\\.[a-zA-Z0-9]+`;
|
|
6168
6168
|
|
|
6169
6169
|
let pat = new RegExp(match, "g");
|
|
@@ -6253,7 +6253,7 @@ func.utils.debug_report = async function (
|
|
|
6253
6253
|
typeof IS_PROCESS_SERVER !== "undefined"
|
|
6254
6254
|
) {
|
|
6255
6255
|
return __.rpi.write_log(
|
|
6256
|
-
SESSION_OBJ[SESSION_ID].
|
|
6256
|
+
SESSION_OBJ[SESSION_ID].app_id,
|
|
6257
6257
|
"error",
|
|
6258
6258
|
"worker",
|
|
6259
6259
|
"runtime",
|
|
@@ -6272,7 +6272,7 @@ func.utils.debug_report = async function (
|
|
|
6272
6272
|
id: STUDIO_WEBSOCKET_CONNECTION_ID,
|
|
6273
6273
|
uid: _session.USR_OBJ._id,
|
|
6274
6274
|
source: "runtime",
|
|
6275
|
-
app_id: _session.
|
|
6275
|
+
app_id: _session.app_id,
|
|
6276
6276
|
gtp_token: _session.gtp_token,
|
|
6277
6277
|
app_token: _session.app_token,
|
|
6278
6278
|
};
|
|
@@ -7188,7 +7188,7 @@ func.utils.get_plugin_setup = function (SESSION_ID, plugin_name) {
|
|
|
7188
7188
|
};
|
|
7189
7189
|
|
|
7190
7190
|
func.utils.connect_pouchdb = async function (SESSION_ID) {
|
|
7191
|
-
const app_id = SESSION_OBJ[SESSION_ID].
|
|
7191
|
+
const app_id = SESSION_OBJ[SESSION_ID].app_id;
|
|
7192
7192
|
return new PouchDB("xuda_rt_" + app_id);
|
|
7193
7193
|
};
|
|
7194
7194
|
|
|
@@ -7210,7 +7210,7 @@ func.utils.call_plugin_api = function (SESSION_ID, plugin_nameP, dataP) {
|
|
|
7210
7210
|
};
|
|
7211
7211
|
return new Promise(async (resolve) => {
|
|
7212
7212
|
var data = {
|
|
7213
|
-
app_id: APP_OBJ[_session.
|
|
7213
|
+
app_id: APP_OBJ[_session.app_id]._id,
|
|
7214
7214
|
debug: glb.DEBUG_MODE,
|
|
7215
7215
|
uid: _session.USR_OBJ._id,
|
|
7216
7216
|
gtp_token: _session.gtp_token,
|
|
@@ -7271,9 +7271,9 @@ func.utils.get_plugin_resource = function (
|
|
|
7271
7271
|
return `../../plugins/${plugin_name}/${resource}`;
|
|
7272
7272
|
}
|
|
7273
7273
|
if (typeof IS_PROCESS_SERVER !== "undefined") {
|
|
7274
|
-
return `${_conf.plugins_drive_path}/${_session.
|
|
7274
|
+
return `${_conf.plugins_drive_path}/${_session.app_id}/node_modules/${plugin_name}/${resource}`;
|
|
7275
7275
|
} else {
|
|
7276
|
-
return `https://${_session.domain}/plugins/${plugin_name}/${resource}?app_id=${_session.
|
|
7276
|
+
return `https://${_session.domain}/plugins/${plugin_name}/${resource}?app_id=${_session.app_id}`;
|
|
7277
7277
|
}
|
|
7278
7278
|
};
|
|
7279
7279
|
|
|
@@ -7343,7 +7343,7 @@ func.utils.get_plugin_npm_cdn = async function (
|
|
|
7343
7343
|
return `../../plugins/${plugin_name}/${resource}`;
|
|
7344
7344
|
}
|
|
7345
7345
|
|
|
7346
|
-
return `https://${_session.domain}/plugins/${plugin_name}/${resource}?app_id=${_session.
|
|
7346
|
+
return `https://${_session.domain}/plugins/${plugin_name}/${resource}?app_id=${_session.app_id}`;
|
|
7347
7347
|
};
|
|
7348
7348
|
|
|
7349
7349
|
return get_path(resource);
|
|
@@ -7363,7 +7363,7 @@ func.utils.write_log = async function (
|
|
|
7363
7363
|
typeof IS_DOCKER !== "undefined" ||
|
|
7364
7364
|
typeof IS_PROCESS_SERVER !== "undefined"
|
|
7365
7365
|
) {
|
|
7366
|
-
return __.rpi.write_log(_session.
|
|
7366
|
+
return __.rpi.write_log(_session.app_id, log_type, source, msg, details);
|
|
7367
7367
|
}
|
|
7368
7368
|
|
|
7369
7369
|
await func.common.db(SESSION_ID, "write_log", {
|
|
@@ -8842,7 +8842,7 @@ func.events.execute_PENDING_OPEN_URL_EVENTS = async function () {
|
|
|
8842
8842
|
"pendingUrlEvent_embed"
|
|
8843
8843
|
);
|
|
8844
8844
|
} else {
|
|
8845
|
-
console.error("Program not exist", params_obj.
|
|
8845
|
+
console.error("Program not exist", params_obj.prog_id);
|
|
8846
8846
|
func.UI.utils.progressScreen.show(
|
|
8847
8847
|
SESSION_ID,
|
|
8848
8848
|
"Program not exist",
|
|
@@ -9533,7 +9533,7 @@ func.expression.secure_eval = async function (
|
|
|
9533
9533
|
) {
|
|
9534
9534
|
if (SESSION_OBJ[SESSION_ID].crawler) return;
|
|
9535
9535
|
return __.rpi.write_log(
|
|
9536
|
-
SESSION_OBJ[SESSION_ID].
|
|
9536
|
+
SESSION_OBJ[SESSION_ID].app_id,
|
|
9537
9537
|
"error",
|
|
9538
9538
|
"worker",
|
|
9539
9539
|
"vm error",
|
|
@@ -9547,7 +9547,7 @@ func.expression.secure_eval = async function (
|
|
|
9547
9547
|
try {
|
|
9548
9548
|
const dir = path.join(
|
|
9549
9549
|
_conf.studio_drive_path,
|
|
9550
|
-
SESSION_OBJ[SESSION_ID].
|
|
9550
|
+
SESSION_OBJ[SESSION_ID].app_id,
|
|
9551
9551
|
"node_modules",
|
|
9552
9552
|
"/"
|
|
9553
9553
|
);
|
|
@@ -9584,7 +9584,7 @@ func.expression.secure_eval = async function (
|
|
|
9584
9584
|
|
|
9585
9585
|
if (typeof IS_PROCESS_SERVER !== "undefined") {
|
|
9586
9586
|
func.events.delete_job(SESSION_ID, jobNo);
|
|
9587
|
-
return __.db.add_error_log(SESSION_OBJ[SESSION_ID].
|
|
9587
|
+
return __.db.add_error_log(SESSION_OBJ[SESSION_ID].app_id, "api", err);
|
|
9588
9588
|
}
|
|
9589
9589
|
}
|
|
9590
9590
|
} else {
|