@rebasepro/server-postgres 0.9.1-canary.e3f810f → 0.9.1-canary.eab7ae2

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/dist/index.es.js CHANGED
@@ -6524,27 +6524,8 @@ function coerceDeclaredNumbers(row, collection) {
6524
6524
  return out;
6525
6525
  }
6526
6526
  /** Render one target row in the requested style. */
6527
- /**
6528
- * Drop every column the collection marked `excludeFromApi`.
6529
- *
6530
- * Password hashes and verification tokens have to be readable server-side but
6531
- * must never reach a client — and "never" has to mean every exit from this
6532
- * pipeline, including relation targets, or a secret leaks through whichever
6533
- * path was overlooked. Keyed by both the property name and its column name,
6534
- * since a row can arrive keyed either way depending on the caller.
6535
- */
6536
- function stripExcluded(row, collection) {
6537
- const properties = collection.properties;
6538
- if (!properties) return row;
6539
- for (const [key, property] of Object.entries(properties)) {
6540
- if (!property?.excludeFromApi) continue;
6541
- delete row[key];
6542
- if (property.columnName) delete row[property.columnName];
6543
- }
6544
- return row;
6545
- }
6546
6527
  function renderTarget(targetRow, targetCollection, style, registry) {
6547
- if (style === "inline") return stripExcluded(coerceDeclaredNumbers({ ...targetRow }, targetCollection), targetCollection);
6528
+ if (style === "inline") return coerceDeclaredNumbers({ ...targetRow }, targetCollection);
6548
6529
  const address = relationTargetAddress(targetRow, targetCollection, registry);
6549
6530
  const path = targetCollection.slug;
6550
6531
  return createRelationRefWithData(address, path, {
@@ -6586,7 +6567,7 @@ function toCmsRow(row, collection, registry) {
6586
6567
  normalized[key] = relData.map((item) => renderTarget(isJunctionRelation(relation) ? unwrapJunctionRow(item) : item, targetCollection, "ref", registry));
6587
6568
  } else if (relation.cardinality === "one" && typeof relData === "object" && !Array.isArray(relData)) normalized[key] = renderTarget(relData, relation.target(), "ref", registry);
6588
6569
  }
6589
- return stripExcluded(normalized, collection);
6570
+ return normalized;
6590
6571
  }
6591
6572
  /**
6592
6573
  * The row REST serves: every column under its own name, with the value Postgres
@@ -6611,7 +6592,7 @@ function toRestRow(row, collection, registry) {
6611
6592
  else if (relation && typeof value === "object" && value !== null) flat[key] = renderTarget(value, relation.target(), "inline", registry);
6612
6593
  else flat[key] = coerceDeclaredNumber(value, collection.properties?.[key]);
6613
6594
  }
6614
- return stripExcluded(flat, collection);
6595
+ return flat;
6615
6596
  }
6616
6597
  //#endregion
6617
6598
  //#region src/services/FetchService.ts