@xuda.io/xuda-worker-bundle-min 1.3.2452 → 1.3.2454

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.
Files changed (2) hide show
  1. package/index.js +24 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -8823,6 +8823,29 @@ func.events.execute = async function (
8823
8823
  return result;
8824
8824
  },
8825
8825
  update: async function () {
8826
+ const resolve_update_field_id = async function (field_expr, iterate_info) {
8827
+ let trimmed = field_expr?.trim?.() || '';
8828
+ if (!trimmed) {
8829
+ return trimmed;
8830
+ }
8831
+
8832
+ const first = trimmed.substring(0, 1);
8833
+ const last = trimmed.substring(trimmed.length - 1);
8834
+ if ((first === "'" || first === '"' || first === '`') && last === first) {
8835
+ trimmed = trimmed.substring(1, trimmed.length - 1).trim();
8836
+ }
8837
+
8838
+ if (/^@?[A-Za-z_][\w\-\:\.]*$/.test(trimmed)) {
8839
+ return trimmed.substring(0, 1) === '@' ? trimmed.substring(1) : trimmed;
8840
+ }
8841
+
8842
+ let ret_field_id = await func.expression.get(SESSION_ID, trimmed, dsSessionP, 'update', null, null, null, null, null, null, iterate_info);
8843
+ if (typeof ret_field_id?.result === 'string' && ret_field_id.result.substring(0, 1) === '@') {
8844
+ return ret_field_id.result.substring(1);
8845
+ }
8846
+ return ret_field_id?.result;
8847
+ };
8848
+
8826
8849
  const obj_values_to_update = func.datasource.get_viewFields_for_update_function(SESSION_ID, calling_trigger_prop, null, dsSessionP);
8827
8850
  if (!obj_values_to_update || xu_isEmpty(obj_values_to_update)) {
8828
8851
  func.utils.debug_report(SESSION_ID, 'Update values object is empty', '', 'W');
@@ -8840,9 +8863,8 @@ func.events.execute = async function (
8840
8863
  iterate_info = element_meta?.iterate_info || null;
8841
8864
  }
8842
8865
 
8843
- let ret_field_id = await func.expression.get(SESSION_ID, val.id.trim(), dsSessionP, 'update', null, null, null, null, null, null, iterate_info);
8844
8866
  let ret_value = await func.expression.get(SESSION_ID, val.val.trim(), dsSessionP, 'update', null, null, null, null, null, null, iterate_info);
8845
- let _field_id = ret_field_id.result;
8867
+ let _field_id = await resolve_update_field_id(val.id, iterate_info);
8846
8868
  let _value = ret_value.result;
8847
8869
 
8848
8870
  updates.push({ _field_id, _value });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/xuda-worker-bundle-min",
3
- "version": "1.3.2452",
3
+ "version": "1.3.2454",
4
4
  "description": "xuda framework min",
5
5
  "main": "index.js",
6
6
  "scripts": {