@rpcbase/server 0.518.0 → 0.519.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.
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ import { dirname, posix, sep } from "path";
9
9
  import fs, { createReadStream, readFileSync } from "node:fs";
10
10
  import { createInterface } from "node:readline";
11
11
  import { AsyncLocalStorage } from "node:async_hooks";
12
- import { g as getDerivedKey, r as resolveRtsRequestTenantId, i as isRtsRequestAuthorized, b as buildRtsAbilityFromRequest, n as normalizeRtsQueryOptions, a as runRtsQuery } from "./queryExecutor-B7lb2FR1.js";
12
+ import { g as getDerivedKey, r as resolveRtsRequestTenantId, i as isRtsRequestAuthorized, b as buildRtsAbilityFromRequest, n as normalizeRtsQueryOptions, a as runRtsQuery } from "./queryExecutor-Bg1GGL3j.js";
13
13
  import httpProxy from "http-proxy-3";
14
14
  import fsPromises from "node:fs/promises";
15
15
  import inspector from "node:inspector";
@@ -4570,6 +4570,7 @@ const createRtsSsrCollector = (req, opts) => {
4570
4570
  const registrations = /* @__PURE__ */ new Map();
4571
4571
  const resolved = /* @__PURE__ */ new Map();
4572
4572
  const resolvedPageInfo = /* @__PURE__ */ new Map();
4573
+ const resolvedTotalCount = /* @__PURE__ */ new Map();
4573
4574
  const runtime = {
4574
4575
  registerQuery(query) {
4575
4576
  const modelName = typeof query.modelName === "string" ? query.modelName.trim() : "";
@@ -4590,6 +4591,9 @@ const createRtsSsrCollector = (req, opts) => {
4590
4591
  },
4591
4592
  getQueryPageInfo(modelName, queryKey) {
4592
4593
  return resolvedPageInfo.get(makeRegistrationKey(modelName, queryKey));
4594
+ },
4595
+ getQueryTotalCount(modelName, queryKey) {
4596
+ return resolvedTotalCount.get(makeRegistrationKey(modelName, queryKey));
4593
4597
  }
4594
4598
  };
4595
4599
  const resolve = async () => {
@@ -4621,6 +4625,9 @@ const createRtsSsrCollector = (req, opts) => {
4621
4625
  data: boundedData,
4622
4626
  ...result.pageInfo ? {
4623
4627
  pageInfo: result.pageInfo
4628
+ } : {},
4629
+ ...typeof result.totalCount === "number" ? {
4630
+ totalCount: result.totalCount
4624
4631
  } : {}
4625
4632
  });
4626
4633
  } catch {
@@ -4644,9 +4651,11 @@ const createRtsSsrCollector = (req, opts) => {
4644
4651
  }
4645
4652
  resolved.clear();
4646
4653
  resolvedPageInfo.clear();
4654
+ resolvedTotalCount.clear();
4647
4655
  for (const entry of payload.queries) {
4648
4656
  resolved.set(makeRegistrationKey(entry.modelName, entry.queryKey), entry.data);
4649
4657
  resolvedPageInfo.set(makeRegistrationKey(entry.modelName, entry.queryKey), entry.pageInfo);
4658
+ resolvedTotalCount.set(makeRegistrationKey(entry.modelName, entry.queryKey), entry.totalCount);
4650
4659
  }
4651
4660
  return payload.queries.length ? payload : null;
4652
4661
  };