@gscdump/analysis 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.
package/dist/browser.mjs CHANGED
@@ -3,9 +3,10 @@ import { pgResolverAdapter } from "@gscdump/engine/resolver";
3
3
  import { createAttachedTableSource } from "@gscdump/engine/source";
4
4
  async function analyzeInBrowser(runner, opts, params, registry) {
5
5
  opts.signal?.throwIfAborted();
6
- return runAnalyzerFromSource(createAttachedTableSource(runner, {
6
+ const source = createAttachedTableSource(runner, {
7
7
  adapter: pgResolverAdapter,
8
8
  ...opts
9
- }), params, registry);
9
+ });
10
+ return runAnalyzerFromSource(source, params, registry);
10
11
  }
11
12
  export { analyzeInBrowser };
@@ -229,7 +229,8 @@ function buildDataDetailRows(params) {
229
229
  return queries;
230
230
  }
231
231
  function shapeDataDetailRowResults(rowMap, params) {
232
- const { startDate, endDate } = extractDateRange(requireBuilderState(params.q, "data-detail").filter);
232
+ const state = requireBuilderState(params.q, "data-detail");
233
+ const { startDate, endDate } = extractDateRange(state.filter);
233
234
  const coerced = (rowMap.main ?? []).map((r) => coerceNumericCols(r));
234
235
  const daily = startDate && endDate ? padTimeseries(coerced, {
235
236
  startDate,
@@ -267,7 +268,8 @@ function buildDataDetailPlan(params, options) {
267
268
  };
268
269
  }
269
270
  function shapeDataDetailRows(rows, params, extras) {
270
- const { startDate: rangeStart, endDate: rangeEnd } = extractDateRange(requireBuilderState(params.q, "data-detail").filter);
271
+ const state = requireBuilderState(params.q, "data-detail");
272
+ const { startDate: rangeStart, endDate: rangeEnd } = extractDateRange(state.filter);
271
273
  const first = rows[0];
272
274
  const totals = {
273
275
  clicks: Number(first?.totalClicks ?? 0),
@@ -3,10 +3,11 @@ import { runAnalyzerFromSource } from "@gscdump/engine/analyzer";
3
3
  import { err, ok, unwrapResult } from "gscdump/result";
4
4
  import { computeInputHash } from "@gscdump/engine/report";
5
5
  async function executeStep(source, analyzers, step) {
6
- return runAnalyzerFromSource(source, {
6
+ const params = {
7
7
  ...step.params,
8
8
  type: step.type
9
- }, analyzers).then((result) => ({
9
+ };
10
+ return runAnalyzerFromSource(source, params, analyzers).then((result) => ({
10
11
  state: {
11
12
  key: step.key,
12
13
  type: step.type,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gscdump/analysis",
3
3
  "type": "module",
4
- "version": "2.1.0",
4
+ "version": "2.2.0",
5
5
  "description": "GSC analyzers — striking-distance, opportunity, movers, decay, brand, clustering, concentration, seasonality. Pure row-based + DuckDB-native.",
6
6
  "author": {
7
7
  "name": "Harlan Wilton",
@@ -57,9 +57,9 @@
57
57
  },
58
58
  "dependencies": {
59
59
  "pluralize": "^8.0.0",
60
- "@gscdump/engine": "^2.1.0",
61
- "@gscdump/engine-gsc-api": "^2.1.0",
62
- "gscdump": "^2.1.0"
60
+ "@gscdump/engine": "^2.2.0",
61
+ "@gscdump/engine-gsc-api": "^2.2.0",
62
+ "gscdump": "^2.2.0"
63
63
  },
64
64
  "devDependencies": {
65
65
  "vitest": "^4.1.10"