@xuda.io/xuda-worker-bundle-min 1.3.259 → 1.3.261
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 +4 -117
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -672,26 +672,6 @@ func.common.get_url = function (SESSION_ID, method, path) {
|
|
|
672
672
|
var UI_FRAMEWORK_INSTALLED = null;
|
|
673
673
|
var UI_FRAMEWORK_PLUGIN = {};
|
|
674
674
|
|
|
675
|
-
func.common.reset_LIVE_PREVIEW_APP = function () {
|
|
676
|
-
if (typeof LIVE_PREVIEW_APP_ACTIVE !== "undefined") {
|
|
677
|
-
live_preview_vibrate();
|
|
678
|
-
live_preview_delete_cookies();
|
|
679
|
-
live_preview_setCookie("refresh_ts", "");
|
|
680
|
-
|
|
681
|
-
func.utils.clean_cache_data(SESSION_ID);
|
|
682
|
-
$("#progressScreen2").css("background-color", "rgba(255,255,255,0.5)");
|
|
683
|
-
func.UI.utils.progressScreen.show(
|
|
684
|
-
SESSION_ID,
|
|
685
|
-
"Opps! something went wrong, restarting Xuda Live Preview app in a minute..",
|
|
686
|
-
null,
|
|
687
|
-
true
|
|
688
|
-
);
|
|
689
|
-
setTimeout(function () {
|
|
690
|
-
location.reload();
|
|
691
|
-
}, 5000);
|
|
692
|
-
}
|
|
693
|
-
};
|
|
694
|
-
|
|
695
675
|
func.common.get_cast_val = async function (
|
|
696
676
|
SESSION_ID,
|
|
697
677
|
source,
|
|
@@ -1013,14 +993,7 @@ var CLIENT_ACTIVITY_TS;
|
|
|
1013
993
|
glb.REFERENCE_LESS_FUNCTIONS = [
|
|
1014
994
|
"update",
|
|
1015
995
|
"raise_event",
|
|
1016
|
-
// "create_ui_element",
|
|
1017
|
-
// "alter_ui_element",
|
|
1018
|
-
// "remove_ui_element",
|
|
1019
|
-
// "empty_ui_element",
|
|
1020
|
-
// "info_ui_element",
|
|
1021
996
|
"call_library",
|
|
1022
|
-
"cache_ui_element",
|
|
1023
|
-
"load_ui_element",
|
|
1024
997
|
"invoke_action",
|
|
1025
998
|
"loader_on",
|
|
1026
999
|
"loader_off",
|
|
@@ -1885,9 +1858,6 @@ func.datasource.execute = async function (
|
|
|
1885
1858
|
_ds.v,
|
|
1886
1859
|
_ds
|
|
1887
1860
|
);
|
|
1888
|
-
if (IS_DATASOURCE_REFRESH) {
|
|
1889
|
-
func.db.reset_CACHE_REQ(SESSION_ID, _ds._dataSourceTableId);
|
|
1890
|
-
}
|
|
1891
1861
|
|
|
1892
1862
|
_ds.v.raw_data = await func.db.get_query(
|
|
1893
1863
|
SESSION_ID,
|
|
@@ -4394,7 +4364,7 @@ func.utils.DOCS_OBJ.get = async function (SESSION_ID, idP) {
|
|
|
4394
4364
|
DOCS_OBJ[_app_id][idP] = await module.DOCS_OBJ_get(SESSION_ID, idP);
|
|
4395
4365
|
if (DOCS_OBJ[_app_id][idP] && _.isEmpty(DOCS_OBJ[_app_id][idP])) {
|
|
4396
4366
|
await func.utils.remove_cached_objects(SESSION_ID);
|
|
4397
|
-
|
|
4367
|
+
|
|
4398
4368
|
delete DOCS_OBJ[_app_id][idP];
|
|
4399
4369
|
}
|
|
4400
4370
|
return DOCS_OBJ[_app_id][idP];
|
|
@@ -4511,13 +4481,6 @@ func.utils.get_dateTime = async function (SESSION_ID, typeP, dateP) {
|
|
|
4511
4481
|
};
|
|
4512
4482
|
func.utils.is_onscreen_event = function (functionP) {
|
|
4513
4483
|
const arr = [
|
|
4514
|
-
// "create_ui_element",
|
|
4515
|
-
// "alter_ui_element",
|
|
4516
|
-
// "remove_ui_element",
|
|
4517
|
-
// "empty_ui_element",
|
|
4518
|
-
// "info_ui_element",
|
|
4519
|
-
// "cache_ui_element",
|
|
4520
|
-
// "load_ui_element",
|
|
4521
4484
|
"invoke_action",
|
|
4522
4485
|
"cache_refresh",
|
|
4523
4486
|
"call_popover",
|
|
@@ -5393,18 +5356,6 @@ func.utils.ws_worker.functions = {
|
|
|
5393
5356
|
done(SESSION_ID, params.dssession);
|
|
5394
5357
|
},
|
|
5395
5358
|
|
|
5396
|
-
reset_CACHE_REQ: function (params) {
|
|
5397
|
-
let SESSION_ID = params.session_id;
|
|
5398
|
-
var _session = SESSION_OBJ[SESSION_ID];
|
|
5399
|
-
for (let [key, val] of Object.entries(_session.CACHE_REQ)) {
|
|
5400
|
-
if (val.table_id === params.table_id) {
|
|
5401
|
-
delete _session.CACHE_REQ[key];
|
|
5402
|
-
}
|
|
5403
|
-
}
|
|
5404
|
-
|
|
5405
|
-
return;
|
|
5406
|
-
},
|
|
5407
|
-
|
|
5408
5359
|
acknowledged_worker_with_eventChangesResults_done: function (params) {
|
|
5409
5360
|
var SESSION_ID = params.session_id;
|
|
5410
5361
|
var _session = SESSION_OBJ[SESSION_ID];
|
|
@@ -5507,7 +5458,6 @@ func.utils.set_callback_queue = function (SESSION_ID, func) {
|
|
|
5507
5458
|
} catch (e) {
|
|
5508
5459
|
console.error(id);
|
|
5509
5460
|
func.utils.remove_cached_objects(SESSION_ID);
|
|
5510
|
-
// func.utils.remove_objects_cache(SESSION_ID);
|
|
5511
5461
|
}
|
|
5512
5462
|
return t;
|
|
5513
5463
|
};
|
|
@@ -5612,76 +5562,27 @@ func.utils.remove_js_css_file = function (filename, filetype) {
|
|
|
5612
5562
|
// return build_id;
|
|
5613
5563
|
// };
|
|
5614
5564
|
|
|
5615
|
-
func.utils.remove_all_pouch_dbs = async function () {
|
|
5616
|
-
await func.utils.load_js_on_demand(
|
|
5617
|
-
func.common.get_url(
|
|
5618
|
-
SESSION_ID,
|
|
5619
|
-
"dist",
|
|
5620
|
-
"runtime/node_modules/pouchdb-all-dbs/dist/pouchdb.all-dbs.min.js"
|
|
5621
|
-
)
|
|
5622
|
-
);
|
|
5623
|
-
|
|
5624
|
-
PouchDB.allDbs(function (err, dbs) {
|
|
5625
|
-
console.log(err, dbs);
|
|
5626
|
-
if (err) {
|
|
5627
|
-
return;
|
|
5628
|
-
}
|
|
5629
|
-
$.each(dbs, function (key, val) {
|
|
5630
|
-
const db = new PouchDB(val);
|
|
5631
|
-
db.destroy(function (err, response) {});
|
|
5632
|
-
});
|
|
5633
|
-
});
|
|
5634
|
-
};
|
|
5635
|
-
func.utils.clean_cache_data = function (SESSION_ID) {
|
|
5636
|
-
const clean_pouch_data = async function () {
|
|
5637
|
-
const db = await func.utils.connect_pouchdb(SESSION_ID);
|
|
5638
|
-
db.find({ selector: { _id: { $gt: null } } }, function (err, body) {
|
|
5639
|
-
// console.log(body);
|
|
5640
|
-
for (let val of body.docs) {
|
|
5641
|
-
try {
|
|
5642
|
-
db.remove(val);
|
|
5643
|
-
} catch (e) {
|
|
5644
|
-
// debugger;
|
|
5645
|
-
}
|
|
5646
|
-
}
|
|
5647
|
-
});
|
|
5648
|
-
};
|
|
5649
|
-
|
|
5650
|
-
if (window.CacheClear) {
|
|
5651
|
-
window.CacheClear();
|
|
5652
|
-
}
|
|
5653
|
-
clean_pouch_data();
|
|
5654
|
-
};
|
|
5655
|
-
|
|
5656
5565
|
func.utils.get_drive_url = function (SESSION_ID, val, wrap) {
|
|
5657
5566
|
// wrap = false; // tbd bypass
|
|
5658
5567
|
|
|
5659
5568
|
var _session = SESSION_OBJ[SESSION_ID];
|
|
5660
5569
|
function replaceFiletoURL(fileString) {
|
|
5661
|
-
// const NEGATIVE_URL = `https://${_session.opt.domain}/workspace-drive/`; //func.common.get_url(SESSION_ID, "workspace-drive");
|
|
5662
5570
|
const _app = APP_OBJ[_session.APP_ID];
|
|
5663
5571
|
let url = `https://${_session.domain}/workspace-drive/${
|
|
5664
5572
|
_app.is_deployment ? _app.app_datacenter_id : _app.app_id_reference
|
|
5665
5573
|
}/`;
|
|
5666
|
-
|
|
5667
|
-
// _app.is_deployment ? _app.app_datacenter_id : _app.app_id_reference
|
|
5668
|
-
// }/`;
|
|
5574
|
+
|
|
5669
5575
|
const FILE_REPLACE_URL = `${url}${val}?token=${_session.opt.token}`;
|
|
5670
5576
|
|
|
5671
5577
|
let match = `drv_${
|
|
5672
5578
|
_app.app_replicate || _session.APP_ID
|
|
5673
5579
|
}_[0-9a-f\\-]+\\.[a-zA-Z0-9]+`;
|
|
5674
|
-
// let match = `drv_${
|
|
5675
|
-
// APP_OBJ[_session.APP_ID].app_id_reference
|
|
5676
|
-
// }_[0-9a-f\\-]+\\.[a-zA-Z0-9]+`;
|
|
5677
|
-
|
|
5678
|
-
//APP_OBJ[_session.APP_ID].app_replicate
|
|
5679
5580
|
|
|
5680
5581
|
let pat = new RegExp(match, "g");
|
|
5681
5582
|
let URLString = fileString.replace(pat, function (match, idx) {
|
|
5682
5583
|
// debugger;
|
|
5683
5584
|
const hasURLbefore = fileString.substring(idx - url.length, idx) === url;
|
|
5684
|
-
|
|
5585
|
+
|
|
5685
5586
|
if (hasURLbefore) {
|
|
5686
5587
|
return match;
|
|
5687
5588
|
}
|
|
@@ -5701,7 +5602,6 @@ func.utils.get_drive_url = function (SESSION_ID, val, wrap) {
|
|
|
5701
5602
|
} else {
|
|
5702
5603
|
return { value: ret, changed: true };
|
|
5703
5604
|
}
|
|
5704
|
-
// return { value: ret, changed: true };
|
|
5705
5605
|
} else {
|
|
5706
5606
|
return { value: val, changed: false };
|
|
5707
5607
|
}
|
|
@@ -6685,13 +6585,7 @@ func.utils.get_plugin_setup = function (SESSION_ID, plugin_name) {
|
|
|
6685
6585
|
|
|
6686
6586
|
func.utils.connect_pouchdb = async function (SESSION_ID) {
|
|
6687
6587
|
const app_id = SESSION_OBJ[SESSION_ID].APP_ID;
|
|
6688
|
-
|
|
6689
|
-
|
|
6690
|
-
// var db = new PouchDB(db_name);
|
|
6691
|
-
|
|
6692
|
-
// return db;
|
|
6693
|
-
|
|
6694
|
-
return new PouchDB("rt_" + app_id);
|
|
6588
|
+
return new PouchDB("xuda_rt_" + app_id);
|
|
6695
6589
|
};
|
|
6696
6590
|
|
|
6697
6591
|
func.utils.call_plugin_api = function (SESSION_ID, plugin_nameP, dataP) {
|
|
@@ -6711,11 +6605,6 @@ func.utils.call_plugin_api = function (SESSION_ID, plugin_nameP, dataP) {
|
|
|
6711
6605
|
});
|
|
6712
6606
|
};
|
|
6713
6607
|
return new Promise(async (resolve) => {
|
|
6714
|
-
// const db = await func.utils.connect_pouchdb(SESSION_ID);
|
|
6715
|
-
// try {
|
|
6716
|
-
// let ret = await db.get(`cache_plugin_${plugin_nameP}`);
|
|
6717
|
-
// return resolve(ret.data);
|
|
6718
|
-
// } catch (err) {
|
|
6719
6608
|
var data = {
|
|
6720
6609
|
app_id: APP_OBJ[_session.APP_ID]._id,
|
|
6721
6610
|
debug: glb.DEBUG_MODE,
|
|
@@ -9030,8 +8919,6 @@ func.expression.secure_eval = async function (
|
|
|
9030
8919
|
|
|
9031
8920
|
const xu = api_utils;
|
|
9032
8921
|
|
|
9033
|
-
console.log("dsSessionP", dsSessionP);
|
|
9034
|
-
|
|
9035
8922
|
if (
|
|
9036
8923
|
typeof IS_PROCESS_SERVER === "undefined" &&
|
|
9037
8924
|
typeof IS_DOCKER === "undefined"
|