@gscdump/engine-gsc-api 3.8.0 → 4.0.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.
@@ -125,6 +125,13 @@ export interface RunGscSearchAppearanceContextSliceResult {
125
125
  totalRows: number;
126
126
  hasMore: boolean;
127
127
  continuation?: SearchAppearanceContinuation;
128
+ /**
129
+ * Metadata from the LAST GSC API page seen, across the discovery and
130
+ * context queries. With the default `dataState='all'` it carries
131
+ * `first_incomplete_date` / `first_incomplete_hour` so hosts can keep
132
+ * still-updating days pending.
133
+ */
134
+ metadata?: GscSearchAnalyticsMetadata;
128
135
  }
129
136
  export declare function runGscSyncSlice(opts: RunGscSyncSliceOptions): Promise<RunGscSyncSliceResult>;
130
137
  /**
@@ -159,6 +159,7 @@ async function runGscSearchAppearanceContextSlice(opts) {
159
159
  const appearances = opts.continuation?.appearances?.slice() ?? opts.appearances?.slice() ?? [];
160
160
  let totalRows = 0;
161
161
  let hasMore = false;
162
+ let metadata;
162
163
  if (!opts.appearances && opts.continuation?.phase !== "context") {
163
164
  const discovered = new Set(appearances);
164
165
  const discovery = await runGscSyncSlice({
@@ -184,6 +185,7 @@ async function runGscSearchAppearanceContextSlice(opts) {
184
185
  }
185
186
  });
186
187
  totalRows += discovery.totalRows;
188
+ metadata = discovery.metadata;
187
189
  if (discovery.hasMore) return {
188
190
  appearances: [...discovered],
189
191
  totalRows,
@@ -192,7 +194,8 @@ async function runGscSearchAppearanceContextSlice(opts) {
192
194
  phase: "discovery",
193
195
  appearances: [...discovered],
194
196
  nextStartRow: discovery.nextStartRow
195
- }
197
+ },
198
+ metadata
196
199
  };
197
200
  hasMore ||= discovery.hasMore;
198
201
  appearances.splice(0, appearances.length, ...discovered);
@@ -226,6 +229,7 @@ async function runGscSearchAppearanceContextSlice(opts) {
226
229
  })
227
230
  });
228
231
  totalRows += context.totalRows;
232
+ metadata = context.metadata;
229
233
  if (context.hasMore) return {
230
234
  appearances,
231
235
  totalRows,
@@ -235,14 +239,16 @@ async function runGscSearchAppearanceContextSlice(opts) {
235
239
  appearances,
236
240
  appearanceIndex: i,
237
241
  nextStartRow: context.nextStartRow
238
- }
242
+ },
243
+ metadata
239
244
  };
240
245
  hasMore ||= context.hasMore;
241
246
  }
242
247
  return {
243
248
  appearances,
244
249
  totalRows,
245
- hasMore
250
+ hasMore,
251
+ metadata
246
252
  };
247
253
  }
248
254
  export { runGscSearchAppearanceContextSlice, runGscSyncSlice };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gscdump/engine-gsc-api",
3
3
  "type": "module",
4
- "version": "3.8.0",
4
+ "version": "4.0.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",
@@ -33,14 +33,14 @@
33
33
  "dist"
34
34
  ],
35
35
  "engines": {
36
- "node": ">=22"
36
+ "node": ">=22.13.0"
37
37
  },
38
38
  "dependencies": {
39
- "@gscdump/engine": "^3.8.0",
40
- "gscdump": "^3.8.0"
39
+ "@gscdump/engine": "^4.0.1",
40
+ "gscdump": "^4.0.1"
41
41
  },
42
42
  "devDependencies": {
43
- "vitest": "^5.0.0"
43
+ "vitest": "^5.0.1"
44
44
  },
45
45
  "scripts": {
46
46
  "build": "obuild",