@gscdump/sdk 0.35.2 → 0.35.3

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.d.mts CHANGED
@@ -317,7 +317,12 @@ interface GscDailySummary {
317
317
  impressions: number;
318
318
  }>;
319
319
  }
320
- /** Fill `sum_position` from `(position - 1) * impressions` when the row only carries `position`. */
320
+ /**
321
+ * Fill `sum_position` from `(position - 1) * impressions` when the row only
322
+ * carries `position`. GSC positions are 1-based and 0/absent is a no-data
323
+ * sentinel — the old `Math.max(1, …)` clamp synthesized rank #1 (sum 0 with
324
+ * full impression weight) for such rows instead of contributing nothing.
325
+ */
321
326
  declare function coerceRowMetrics<T extends {
322
327
  impressions: number;
323
328
  sum_position?: number;
package/dist/index.mjs CHANGED
@@ -985,9 +985,10 @@ const GSC_COLUMN_OPTIONS = [
985
985
  }
986
986
  ];
987
987
  function coerceRowMetrics(row) {
988
+ const position = row.position ?? 0;
988
989
  return {
989
990
  ...row,
990
- sum_position: row.sum_position ?? (Math.max(1, row.position ?? 0) - 1) * row.impressions
991
+ sum_position: row.sum_position ?? (position > 0 ? (position - 1) * row.impressions : 0)
991
992
  };
992
993
  }
993
994
  function summarizeDailyRows(raw) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gscdump/sdk",
3
3
  "type": "module",
4
- "version": "0.35.2",
4
+ "version": "0.35.3",
5
5
  "description": "Consumer SDK for hosted gscdump.com integrations.",
6
6
  "author": {
7
7
  "name": "Harlan Wilton",
@@ -44,10 +44,10 @@
44
44
  "date-fns": "^4.4.0",
45
45
  "ofetch": "^1.5.1",
46
46
  "zod": "^4.4.3",
47
- "@gscdump/analysis": "0.35.2",
48
- "@gscdump/contracts": "0.35.2",
49
- "@gscdump/engine": "0.35.2",
50
- "gscdump": "0.35.2"
47
+ "@gscdump/analysis": "0.35.3",
48
+ "@gscdump/contracts": "0.35.3",
49
+ "@gscdump/engine": "0.35.3",
50
+ "gscdump": "0.35.3"
51
51
  },
52
52
  "devDependencies": {
53
53
  "typescript": "^6.0.3",