spice-js 2.7.10 → 2.7.11

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.
@@ -1355,7 +1355,12 @@ class SpiceModel {
1355
1355
  buildJoinMetadata(nestings, args) {
1356
1356
  var _args$columns;
1357
1357
 
1358
- // Decide which aliases we can join: only when map.type===MODEL AND reference is a STRING keyspace.
1358
+ // Normalize any double backticks to single backticks early (handles URL encoding issues)
1359
+ if (args.columns && typeof args.columns === "string") {
1360
+ args.columns = args.columns.replace(/``/g, "`");
1361
+ } // Decide which aliases we can join: only when map.type===MODEL AND reference is a STRING keyspace.
1362
+
1363
+
1359
1364
  var mappedNestings = _.compact(_.uniq(nestings).map(alias => {
1360
1365
  var prop = this.props[alias];
1361
1366
  if (!(prop == null ? void 0 : prop.map) || prop.map.type !== _2.MapType.MODEL) return null;
@@ -1547,7 +1552,8 @@ class SpiceModel {
1547
1552
  yield _this12.run_hook(results.data, "list", "after");
1548
1553
  }
1549
1554
 
1550
- results.data = _this12.filterResultsByColumns(results.data, args.columns);
1555
+ results.data = _this12.filterResultsByColumns(results.data, args.columns); //console.log("results.data", results.data);
1556
+
1551
1557
  return results;
1552
1558
  });
1553
1559
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spice-js",
3
- "version": "2.7.10",
3
+ "version": "2.7.11",
4
4
  "description": "spice",
5
5
  "main": "build/index.js",
6
6
  "repository": {
@@ -1168,6 +1168,11 @@ export default class SpiceModel {
1168
1168
  * @returns {Object} - { mappedNestings, protectedAliases, arrayAliases }
1169
1169
  */
1170
1170
  buildJoinMetadata(nestings, args) {
1171
+ // Normalize any double backticks to single backticks early (handles URL encoding issues)
1172
+ if (args.columns && typeof args.columns === "string") {
1173
+ args.columns = args.columns.replace(/``/g, "`");
1174
+ }
1175
+
1171
1176
  // Decide which aliases we can join: only when map.type===MODEL AND reference is a STRING keyspace.
1172
1177
  const mappedNestings = _.compact(
1173
1178
  _.uniq(nestings).map((alias) => {
@@ -1204,7 +1209,10 @@ export default class SpiceModel {
1204
1209
  // Columns: first prepare (prefix base table, rewrite array alias.field → ARRAY proj),
1205
1210
  // then normalize names and add default aliases
1206
1211
  //console.log("Columns in BuildJoinMetadata", args.columns);
1212
+
1207
1213
  this[_columns] = args.columns ?? '';
1214
+
1215
+
1208
1216
  args.columns = this.prepColumns(
1209
1217
  args.columns,
1210
1218
  protectedAliases,
@@ -1384,6 +1392,7 @@ export default class SpiceModel {
1384
1392
  }
1385
1393
 
1386
1394
  results.data = this.filterResultsByColumns(results.data, args.columns);
1395
+ //console.log("results.data", results.data);
1387
1396
  return results;
1388
1397
  };
1389
1398
 
@@ -1573,8 +1582,8 @@ export default class SpiceModel {
1573
1582
  const childPath =
1574
1583
  this[_current_path] ?
1575
1584
  `${this[_current_path]}.${source_property}`
1576
- : source_property;
1577
-
1585
+ : source_property;
1586
+
1578
1587
  // ⚡ Wrap in profiler track() to ensure proper async context for child operations
1579
1588
  const fetchRelated = async () => {
1580
1589
  return await Promise.allSettled(