@gscdump/engine-gsc-api 0.22.4 → 0.23.1

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.
Files changed (2) hide show
  1. package/dist/index.mjs +9 -6
  2. package/package.json +3 -3
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { googleSearchConsole } from "gscdump";
2
- import { between, clicks, date, extractMetricFilters, extractSpecialOperatorFilters, gsc } from "gscdump/query";
2
+ import { between, clicks, date, extractMetricFilters, extractSpecialOperatorFilters, gsc, normalizeFilter } from "gscdump/query";
3
3
  import { assertDimensionsSupported, getDimensionFilters, getFilterDimensions, matchesDimensionFilter, matchesMetricFilter, matchesTopLevelPage, metricValue } from "@gscdump/engine/resolver";
4
4
  import { buildLogicalPlan } from "gscdump/query/plan";
5
5
  const METRIC_NAMES = [
@@ -117,16 +117,19 @@ function canProxyToGsc(state) {
117
117
  return true;
118
118
  }
119
119
  function withSearchType(state, searchType) {
120
- const existing = state.filter;
121
- const existingFilters = existing?._filters ?? [];
122
- if (existingFilters.some((f) => f.dimension === "searchType")) return state;
120
+ const normalized = normalizeFilter(state.filter);
121
+ const existingFilters = normalized?._filters ?? [];
122
+ if (existingFilters.some((f) => f.dimension === "searchType")) return normalized === state.filter ? state : {
123
+ ...state,
124
+ filter: normalized
125
+ };
123
126
  const newEntry = {
124
127
  dimension: "searchType",
125
128
  operator: "eq",
126
129
  expression: searchType
127
130
  };
128
- const merged = existing ? {
129
- ...existing,
131
+ const merged = normalized ? {
132
+ ...normalized,
130
133
  _filters: [...existingFilters, newEntry]
131
134
  } : {
132
135
  _filters: [newEntry],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gscdump/engine-gsc-api",
3
3
  "type": "module",
4
- "version": "0.22.4",
4
+ "version": "0.23.1",
5
5
  "description": "GSC live-API engine adapter — wraps the Search Analytics REST API as an AnalysisQuerySource for typed analyzer dispatch.",
6
6
  "author": {
7
7
  "name": "Harlan Wilton",
@@ -36,8 +36,8 @@
36
36
  "node": ">=18"
37
37
  },
38
38
  "dependencies": {
39
- "@gscdump/engine": "0.22.4",
40
- "gscdump": "0.22.4"
39
+ "@gscdump/engine": "0.23.1",
40
+ "gscdump": "0.23.1"
41
41
  },
42
42
  "devDependencies": {
43
43
  "vitest": "^4.1.7"