@xuda.io/xuda-worker-bundle-min 1.3.91 → 1.3.92
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 +45 -43
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -7366,6 +7366,39 @@ func.events.execute = async function (
|
|
|
7366
7366
|
}
|
|
7367
7367
|
return params_obj;
|
|
7368
7368
|
};
|
|
7369
|
+
|
|
7370
|
+
const get_prog_id = async function () {
|
|
7371
|
+
let _prop = args?.calling_trigger_prop?.data?.name?.properties;
|
|
7372
|
+
let _prog_id = args.prog_id;
|
|
7373
|
+
if (_prop?.["xu-exp:prog"]) {
|
|
7374
|
+
_prog_id = (
|
|
7375
|
+
await func.expression.get(
|
|
7376
|
+
SESSION_ID,
|
|
7377
|
+
_prop["xu-exp:prog"],
|
|
7378
|
+
dsSession,
|
|
7379
|
+
"prog_id expression"
|
|
7380
|
+
)
|
|
7381
|
+
).result;
|
|
7382
|
+
}
|
|
7383
|
+
|
|
7384
|
+
return _prog_id;
|
|
7385
|
+
};
|
|
7386
|
+
const get_args_property_value = async function (prop_name) {
|
|
7387
|
+
let _prop = args?.calling_trigger_prop?.data?.name?.properties;
|
|
7388
|
+
let _value = _prop[prop_name];
|
|
7389
|
+
if (_prop?.[`xu-exp:${prop_name}`]) {
|
|
7390
|
+
_value = (
|
|
7391
|
+
await func.expression.get(
|
|
7392
|
+
SESSION_ID,
|
|
7393
|
+
_prop[`xu-exp:${prop_name}`],
|
|
7394
|
+
dsSession,
|
|
7395
|
+
`${prop_name} expression`
|
|
7396
|
+
)
|
|
7397
|
+
).result;
|
|
7398
|
+
}
|
|
7399
|
+
|
|
7400
|
+
return _value;
|
|
7401
|
+
};
|
|
7369
7402
|
var args = {
|
|
7370
7403
|
prog_id: refIdP?.prog,
|
|
7371
7404
|
screenIdP: refIdP?.prog,
|
|
@@ -7948,17 +7981,10 @@ func.events.execute = async function (
|
|
|
7948
7981
|
);
|
|
7949
7982
|
let _field_id = ret_field_id.result;
|
|
7950
7983
|
let _value = ret_value.result;
|
|
7951
|
-
|
|
7984
|
+
|
|
7952
7985
|
updates.push({ _field_id, _value });
|
|
7953
7986
|
}
|
|
7954
7987
|
|
|
7955
|
-
// const drill_datasource = async function (ds_number) {
|
|
7956
|
-
// if (!_session.DS_GLB[ds_number]) {
|
|
7957
|
-
// return;
|
|
7958
|
-
// }
|
|
7959
|
-
// const _ds = _session.DS_GLB[ds_number];
|
|
7960
|
-
// };
|
|
7961
|
-
|
|
7962
7988
|
let datasource_changes = {};
|
|
7963
7989
|
for await (const change of updates) {
|
|
7964
7990
|
let ret_get_value = await func.datasource.get_value(
|
|
@@ -7980,34 +8006,9 @@ func.events.execute = async function (
|
|
|
7980
8006
|
datasource_changes[_ds.dsSession][ret_get_value.currentRecordId][
|
|
7981
8007
|
change._field_id
|
|
7982
8008
|
] = change._value;
|
|
7983
|
-
// break;
|
|
7984
8009
|
}
|
|
7985
8010
|
}
|
|
7986
|
-
|
|
7987
|
-
// for await (const [key, val] of Object.entries(
|
|
7988
|
-
// Object.assign([], _session.DS_GLB).reverse()
|
|
7989
|
-
// )) {
|
|
7990
|
-
// let ret_get_value = await func.datasource.get_value(
|
|
7991
|
-
// SESSION_ID,
|
|
7992
|
-
// change._field_id,
|
|
7993
|
-
// val.dsSession
|
|
7994
|
-
// );
|
|
7995
|
-
// if (ret_get_value.found) {
|
|
7996
|
-
// ret = ret_get_value;
|
|
7997
|
-
// let _ds = _session.DS_GLB[ret.dsSessionP];
|
|
7998
|
-
// if (!datasource_changes[_ds.dsSession]) {
|
|
7999
|
-
// datasource_changes[_ds.dsSession] = {};
|
|
8000
|
-
// }
|
|
8001
|
-
// if (!datasource_changes[_ds.dsSession][ret.currentRecordId]) {
|
|
8002
|
-
// datasource_changes[_ds.dsSession][ret.currentRecordId] = {};
|
|
8003
|
-
// }
|
|
8004
|
-
// datasource_changes[_ds.dsSession][ret.currentRecordId][
|
|
8005
|
-
// change._field_id
|
|
8006
|
-
// ] = change._value;
|
|
8007
|
-
// break;
|
|
8008
|
-
// }
|
|
8009
|
-
// }
|
|
8010
|
-
// }
|
|
8011
|
+
|
|
8011
8012
|
await func.datasource.update(SESSION_ID, datasource_changes);
|
|
8012
8013
|
if (jobNoP) func.events.delete_job(SESSION_ID, jobNoP);
|
|
8013
8014
|
// return changes;
|
|
@@ -8044,21 +8045,22 @@ func.events.execute = async function (
|
|
|
8044
8045
|
if (jobNoP) func.events.delete_job(SESSION_ID, jobNoP);
|
|
8045
8046
|
},
|
|
8046
8047
|
call_api: async function () {
|
|
8047
|
-
// console.log(args);
|
|
8048
|
-
// debugger;
|
|
8049
8048
|
const params_obj = await get_params_obj();
|
|
8049
|
+
let _prog_id = await get_prog_id();
|
|
8050
8050
|
|
|
8051
|
-
if (!
|
|
8051
|
+
if (!_prog_id) {
|
|
8052
8052
|
func.utils.debug_report(
|
|
8053
8053
|
SESSION_ID,
|
|
8054
8054
|
"func.events.execute",
|
|
8055
8055
|
elementP + ">" + triggerP + ">" + functionP + ">" + "program missing",
|
|
8056
8056
|
"E"
|
|
8057
8057
|
);
|
|
8058
|
+
func.events.delete_job(SESSION_ID, jobNoP);
|
|
8059
|
+
return;
|
|
8058
8060
|
}
|
|
8059
|
-
|
|
8060
|
-
|
|
8061
|
-
|
|
8061
|
+
|
|
8062
|
+
let output_field = await get_args_property_value("outputField");
|
|
8063
|
+
|
|
8062
8064
|
if (!output_field) {
|
|
8063
8065
|
func.utils.debug_report(
|
|
8064
8066
|
SESSION_ID,
|
|
@@ -8072,11 +8074,11 @@ func.events.execute = async function (
|
|
|
8072
8074
|
"Output field missing",
|
|
8073
8075
|
"E"
|
|
8074
8076
|
);
|
|
8075
|
-
|
|
8077
|
+
func.events.delete_job(SESSION_ID, jobNoP);
|
|
8076
8078
|
return;
|
|
8077
8079
|
}
|
|
8078
|
-
|
|
8079
|
-
const api_ret = await func.api.call_api_program(
|
|
8080
|
+
|
|
8081
|
+
const api_ret = await func.api.call_api_program(_prog_id, params_obj);
|
|
8080
8082
|
// {
|
|
8081
8083
|
// dsSession: dsSessionP,
|
|
8082
8084
|
// }
|