@sincpro/client-framework 2.1.0 → 2.2.0

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.
@@ -3,7 +3,7 @@ import { announced, processChanges } from "../services/changes.js";
3
3
  import { definitionOf, modelAt, } from "../services/discovery.js";
4
4
  import { bindableTransport } from "../services/propagation.js";
5
5
  import { valuesOf } from "../../common/serialization.js";
6
- import { readProblem } from "@sincpro/criteria";
6
+ import { readProblem, } from "@sincpro/criteria";
7
7
  import { RestError, restSource } from "@sincpro/criteria/rest";
8
8
  /** The keys of an answer that are not the record: what is left is the record's own field. */
9
9
  const ENVELOPE = new Set(["cursor", "count", "model_version", "dropped", "draft", "missing"]);
@@ -188,7 +188,12 @@ export function restTransport(options = {}) {
188
188
  ...(decoders.length === 0 ? {} : { decode }),
189
189
  });
190
190
  try {
191
- const page = await source.read(criteria, signal);
191
+ // A grouped question is answered with the groups, as sincpro_framework's `Search`
192
+ // answers it on the same route (3.37.2) and `memoryTransport` does: read by name.
193
+ const grouped = (criteria.grouping?.group_by?.length ?? 0) > 0;
194
+ const page = grouped
195
+ ? (await source.group(criteria, signal))
196
+ : await source.read(criteria, signal);
192
197
  return {
193
198
  ...page,
194
199
  meta: page.meta ?? (await definitionAt(`${base}${route}`, "get", page.version)),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sincpro/client-framework",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "The client side of sincpro_framework, for every platform: Feature and ApplicationService traced and reported by default, applications made of domains, and the typed client generated from a service's contract. No React, no DOM.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",