@ecency/sdk 2.3.14 → 2.3.15

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.
@@ -4942,12 +4942,22 @@ interface UseStatsQueryOptions {
4942
4942
  * landed on it. The API route validates this against an allow-list.
4943
4943
  */
4944
4944
  filterBy?: "event:page" | "visit:entry_page";
4945
+ /**
4946
+ * Plausible `date_range`. Pass a tuple `[from, to]` (ISO `YYYY-MM-DD`) to scope
4947
+ * the query — e.g. a post's creation date through today. Scoping is essential:
4948
+ * ClickHouse orders events by `(site_id, toDate(timestamp), …)` and partitions
4949
+ * by month, so a bounded range prunes to a few granules instead of scanning the
4950
+ * whole history. Omitting it falls back to the route default (`"all"`), which on
4951
+ * a high-traffic site is a multi-second full scan. Plausible also accepts the
4952
+ * relative keywords `"day"`, `"7d"`, `"30d"`, `"all"`.
4953
+ */
4954
+ dateRange?: string | [string, string];
4945
4955
  enabled?: boolean;
4946
4956
  }
4947
- declare function getStatsQueryOptions({ url, dimensions, metrics, filterBy, enabled, }: UseStatsQueryOptions): _tanstack_react_query.OmitKeyof<_tanstack_react_query.UseQueryOptions<StatsResponse, Error, StatsResponse, (string | string[])[]>, "queryFn"> & {
4948
- queryFn?: _tanstack_react_query.QueryFunction<StatsResponse, (string | string[])[], never> | undefined;
4957
+ declare function getStatsQueryOptions({ url, dimensions, metrics, filterBy, dateRange, enabled, }: UseStatsQueryOptions): _tanstack_react_query.OmitKeyof<_tanstack_react_query.UseQueryOptions<StatsResponse, Error, StatsResponse, (string | string[] | undefined)[]>, "queryFn"> & {
4958
+ queryFn?: _tanstack_react_query.QueryFunction<StatsResponse, (string | string[] | undefined)[], never> | undefined;
4949
4959
  } & {
4950
- queryKey: (string | string[])[] & {
4960
+ queryKey: (string | string[] | undefined)[] & {
4951
4961
  [dataTagSymbol]: StatsResponse;
4952
4962
  [dataTagErrorSymbol]: Error;
4953
4963
  };