gscdump 0.28.0 → 0.28.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.
@@ -1677,7 +1677,7 @@ function isQueryParam(value) {
1677
1677
  }
1678
1678
  new Set(Object.values(SearchTypes));
1679
1679
  function extractSpecialFilters(filter) {
1680
- if (!filter) return {};
1680
+ if (!filter || !Array.isArray(filter._filters)) return {};
1681
1681
  let startDate;
1682
1682
  let endDate;
1683
1683
  let searchType;
package/dist/index.mjs CHANGED
@@ -2364,7 +2364,7 @@ function isQueryParam(value) {
2364
2364
  }
2365
2365
  new Set(Object.values(SearchTypes));
2366
2366
  function extractSpecialFilters(filter) {
2367
- if (!filter) return {};
2367
+ if (!filter || !Array.isArray(filter._filters)) return {};
2368
2368
  let startDate;
2369
2369
  let endDate;
2370
2370
  let searchType;
@@ -1791,14 +1791,14 @@ function isWireFilter(input) {
1791
1791
  function normalizeFilter(input) {
1792
1792
  if (!input) return void 0;
1793
1793
  if (isWireFilter(input)) return convertWireGroup(input) ?? void 0;
1794
- return input;
1794
+ if (typeof input === "object" && Array.isArray(input._filters)) return input;
1795
1795
  }
1796
1796
  function normalizeBuilderStateResult(state) {
1797
1797
  if (!state || typeof state !== "object") return err(queryErrors.invalidBuilderState(state));
1798
1798
  const s = state;
1799
1799
  const normalized = {
1800
- dimensions: s.dimensions,
1801
- metrics: s.metrics,
1800
+ dimensions: Array.isArray(s.dimensions) ? s.dimensions : [],
1801
+ metrics: Array.isArray(s.metrics) ? s.metrics : [],
1802
1802
  filter: normalizeFilter(s.filter),
1803
1803
  orderBy: s.orderBy,
1804
1804
  rowLimit: s.rowLimit,
@@ -1813,7 +1813,7 @@ function normalizeBuilderState(state) {
1813
1813
  return unwrapResult(normalizeBuilderStateResult(state), queryErrorToException);
1814
1814
  }
1815
1815
  function extractSpecialFilters(filter) {
1816
- if (!filter) return {};
1816
+ if (!filter || !Array.isArray(filter._filters)) return {};
1817
1817
  let startDate;
1818
1818
  let endDate;
1819
1819
  let searchType;
@@ -1730,10 +1730,10 @@ function isWireFilter(input) {
1730
1730
  function normalizeFilter(input) {
1731
1731
  if (!input) return void 0;
1732
1732
  if (isWireFilter(input)) return convertWireGroup(input) ?? void 0;
1733
- return input;
1733
+ if (typeof input === "object" && Array.isArray(input._filters)) return input;
1734
1734
  }
1735
1735
  function extractSpecialFilters(filter) {
1736
- if (!filter) return {};
1736
+ if (!filter || !Array.isArray(filter._filters)) return {};
1737
1737
  let startDate;
1738
1738
  let endDate;
1739
1739
  let searchType;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gscdump",
3
3
  "type": "module",
4
- "version": "0.28.0",
4
+ "version": "0.28.1",
5
5
  "description": "Google Search Console API wrapper with typed query builder, streaming pagination, and SEO analysis functions",
6
6
  "author": {
7
7
  "name": "Harlan Wilton",
@@ -98,7 +98,7 @@
98
98
  "defu": "^6.1.7",
99
99
  "ofetch": "^1.5.1",
100
100
  "ufo": "^1.6.4",
101
- "@gscdump/contracts": "0.28.0"
101
+ "@gscdump/contracts": "0.28.1"
102
102
  },
103
103
  "devDependencies": {
104
104
  "@googleapis/indexing": "^6.0.1",