@xuda.io/xuda-worker-bundle-min 1.3.1077 → 1.3.1079

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 +48 -12
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1036,7 +1036,7 @@ func.api.set_field_value = async function (field_id, value) {
1036
1036
  SESSION_OBJ,
1037
1037
  SESSION_ID,
1038
1038
  APP_OBJ,
1039
- dsSession: Object.keys(SESSION_OBJ[SESSION_ID].DS_GLB).length - 1,
1039
+ dsSession: Object.keys(SESSION_OBJ[SESSION_ID].DS_GLB).at(-1),
1040
1040
  }
1041
1041
  );
1042
1042
 
@@ -1053,7 +1053,7 @@ func.api.get_field_value = async function (field_id) {
1053
1053
  SESSION_OBJ,
1054
1054
  SESSION_ID,
1055
1055
  APP_OBJ,
1056
- dsSession: Object.keys(SESSION_OBJ[SESSION_ID].DS_GLB).length - 1,
1056
+ dsSession: Object.keys(SESSION_OBJ[SESSION_ID].DS_GLB).at(-1),
1057
1057
  }
1058
1058
  );
1059
1059
 
@@ -1070,7 +1070,7 @@ func.api.invoke_event = async function (event_id) {
1070
1070
  SESSION_OBJ,
1071
1071
  SESSION_ID,
1072
1072
  APP_OBJ,
1073
- dsSession: Object.keys(SESSION_OBJ[SESSION_ID].DS_GLB).length - 1,
1073
+ dsSession: Object.keys(SESSION_OBJ[SESSION_ID].DS_GLB).at(-1),
1074
1074
  }
1075
1075
  );
1076
1076
 
@@ -1087,7 +1087,7 @@ func.api.call_project_api = async function (prog_id, params) {
1087
1087
  SESSION_OBJ,
1088
1088
  SESSION_ID,
1089
1089
  APP_OBJ,
1090
- dsSession: Object.keys(SESSION_OBJ[SESSION_ID].DS_GLB).length - 1,
1090
+ dsSession: Object.keys(SESSION_OBJ[SESSION_ID].DS_GLB).at(-1),
1091
1091
  }
1092
1092
  );
1093
1093
 
@@ -1104,7 +1104,7 @@ func.api.call_system_api = async function (api_method, payload) {
1104
1104
  SESSION_OBJ,
1105
1105
  SESSION_ID,
1106
1106
  APP_OBJ,
1107
- dsSession: Object.keys(SESSION_OBJ[SESSION_ID].DS_GLB).length - 1,
1107
+ dsSession: Object.keys(SESSION_OBJ[SESSION_ID].DS_GLB).at(-1),
1108
1108
  }
1109
1109
  );
1110
1110
 
@@ -1121,7 +1121,7 @@ func.api.call_external_api = async function (method, url, payload) {
1121
1121
  SESSION_OBJ,
1122
1122
  SESSION_ID,
1123
1123
  APP_OBJ,
1124
- dsSession: Object.keys(SESSION_OBJ[SESSION_ID].DS_GLB).length - 1,
1124
+ dsSession: Object.keys(SESSION_OBJ[SESSION_ID].DS_GLB).at(-1),
1125
1125
  }
1126
1126
  );
1127
1127
 
@@ -1487,7 +1487,7 @@ glb.lifecycle = {
1487
1487
  SESSION_OBJ,
1488
1488
  SESSION_ID,
1489
1489
  APP_OBJ,
1490
- dsSession: Object.keys(SESSION_OBJ[SESSION_ID].DS_GLB).length - 1,
1490
+ dsSession: Object.keys(SESSION_OBJ[SESSION_ID].DS_GLB).at(-1),
1491
1491
  }
1492
1492
  );
1493
1493
 
@@ -2368,10 +2368,32 @@ func.datasource.execute = async function (
2368
2368
  _ds.v,
2369
2369
  _ds
2370
2370
  );
2371
+
2372
+ let filterModelMongo = _ds.progDataSource.filterModelMongo;
2373
+ if (_ds.progDataSource.filterModelMongoFx) {
2374
+ let ret = await func.expression.get(
2375
+ SESSION_ID,
2376
+ _ds.progDataSource.filterModelMongoFx,
2377
+ dataSourceSession,
2378
+ "query"
2379
+ );
2380
+ filterModelMongo = ret.result;
2381
+ }
2382
+ let filterModelSql = _ds.progDataSource.filterModelSql;
2383
+ if (_ds.progDataSource.filterModelSqlFx) {
2384
+ let ret = await func.expression.get(
2385
+ SESSION_ID,
2386
+ _ds.progDataSource.filterModelSqlFx,
2387
+ dataSourceSession,
2388
+ "query"
2389
+ );
2390
+ filterModelSql = ret.result;
2391
+ }
2392
+
2371
2393
  const filterModel = {
2372
2394
  filterModelNative: _ds.progDataSource.filterModelNative,
2373
- filterModelMongo: _ds.progDataSource.filterModelMongo,
2374
- filterModelSql: _ds.progDataSource.filterModelSql,
2395
+ filterModelMongo,
2396
+ filterModelSql,
2375
2397
  filterModelUserMongo: _ds.progDataSource.filterModelUserMongo,
2376
2398
  filterModelUserSql: _ds.progDataSource.filterModelUserSql,
2377
2399
  };
@@ -8194,7 +8216,12 @@ func.events.execute = async function (
8194
8216
  );
8195
8217
  };
8196
8218
  const get_property_value = async function (fieldIdP, val) {
8197
- var value = props[fieldIdP];
8219
+ // var value = props[fieldIdP];
8220
+
8221
+ var value =
8222
+ props[fieldIdP] || typeof val.defaultValue === "function"
8223
+ ? val?.defaultValue?.()
8224
+ : val?.defaultValue;
8198
8225
 
8199
8226
  if (props[`xu-exp:${fieldIdP}`]) {
8200
8227
  value = (
@@ -9496,11 +9523,20 @@ func.expression.get = async function (
9496
9523
  !["DbQuery", "alert", "exp", "api_rendered_output"].includes(
9497
9524
  sourceP
9498
9525
  ) &&
9499
- ["string", "date", "time"].includes(val.type) &&
9526
+ ["string", "date"].includes(val.type) &&
9527
+ var_Arr.length > 1
9528
+ ) {
9529
+ res[key] = "`" + val.value + "`";
9530
+ }
9531
+ // new Dec 18 2024 for Ishai
9532
+ if (
9533
+ ["api_rendered_output"].includes(sourceP) &&
9534
+ ["string", "date"].includes(val.type) &&
9500
9535
  var_Arr.length > 1
9501
9536
  ) {
9502
- res[key] = "`" + val.value + "`"; //res[key] = "'" + val.value + "'"; //
9537
+ res[key] = `"` + val.value + `"`;
9503
9538
  }
9539
+
9504
9540
  if (val.fieldId && val.value && typeof val.value === "string") {
9505
9541
  if (
9506
9542
  ["query", "condition", "range", "sort", "locate"].includes(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/xuda-worker-bundle-min",
3
- "version": "1.3.1077",
3
+ "version": "1.3.1079",
4
4
  "description": "xuda framework min",
5
5
  "main": "index.js",
6
6
  "scripts": {