@homespunapps/core 1.6.57 → 1.6.58

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/client.d.ts CHANGED
@@ -676,6 +676,19 @@ export declare class HomespunClient {
676
676
  where?: ListWhereCondition[];
677
677
  sort?: ListSortSpec[];
678
678
  }): Promise<AppRowsPage>;
679
+ /**
680
+ * GET /v1/apps/:id/collections/:name/count: live row count (spec B4,
681
+ * issue #1056), the same aggregate the browser `/_hs/count/:name` door and
682
+ * the `count` MCP tool / CLI verb call through. Gated by the collection's
683
+ * `countRead` opt-in, INDEPENDENT of `read`: a caller who cannot list the
684
+ * rows can still get the count when the manifest opted the collection in,
685
+ * and a collection that never declared `countRead` refuses with
686
+ * `collection_count_forbidden` even for a caller who could otherwise list.
687
+ * No filter and no paging: it is a whole-scope total.
688
+ */
689
+ countAppRows(appId: string, collection: string): Promise<{
690
+ count: number;
691
+ }>;
679
692
  /**
680
693
  * GET /v1/apps/:id/collections/:name/:key — read one row. A dedicated
681
694
  * route (not a client-side scan like v1's `getRecord`) — spec-cli §8
package/dist/client.js CHANGED
@@ -1144,6 +1144,22 @@ export class HomespunClient {
1144
1144
  this.fail(r);
1145
1145
  return this.asObject(r);
1146
1146
  }
1147
+ /**
1148
+ * GET /v1/apps/:id/collections/:name/count: live row count (spec B4,
1149
+ * issue #1056), the same aggregate the browser `/_hs/count/:name` door and
1150
+ * the `count` MCP tool / CLI verb call through. Gated by the collection's
1151
+ * `countRead` opt-in, INDEPENDENT of `read`: a caller who cannot list the
1152
+ * rows can still get the count when the manifest opted the collection in,
1153
+ * and a collection that never declared `countRead` refuses with
1154
+ * `collection_count_forbidden` even for a caller who could otherwise list.
1155
+ * No filter and no paging: it is a whole-scope total.
1156
+ */
1157
+ async countAppRows(appId, collection) {
1158
+ const r = await this.call("GET", `/v1/apps/${encodeURIComponent(appId)}/collections/${encodeURIComponent(collection)}/count`);
1159
+ if (!r.ok)
1160
+ this.fail(r);
1161
+ return this.asObject(r);
1162
+ }
1147
1163
  /**
1148
1164
  * GET /v1/apps/:id/collections/:name/:key — read one row. A dedicated
1149
1165
  * route (not a client-side scan like v1's `getRecord`) — spec-cli §8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homespunapps/core",
3
- "version": "1.6.57",
3
+ "version": "1.6.58",
4
4
  "description": "Homespun relay client: typed HTTP + WebSocket operations against a Homespun relay. Framework-free.",
5
5
  "license": "MIT",
6
6
  "type": "module",