@gscdump/sdk 1.0.0 → 1.0.2

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/README.md CHANGED
@@ -10,22 +10,8 @@ Consumer SDK for hosted gscdump.com integrations.
10
10
 
11
11
  This package is for partner applications that consume gscdump.com APIs,
12
12
  webhooks, and realtime events. Callers inject the HTTP transport and auth they
13
- want to use; route construction stays inside the hosted adapter.
14
-
15
- ```ts
16
- import { createPartnerClient } from '@gscdump/sdk'
17
-
18
- const gscdump = createPartnerClient({
19
- apiBase: 'https://example.com/api',
20
- apiKey: process.env.GSCDUMP_API_KEY,
21
- fetch: $fetch,
22
- })
23
-
24
- const { sites } = await gscdump.getUserSites(userId)
25
- ```
26
-
27
- The initial v1 slice uses a server-held Bearer credential and exposes both a
28
- generic operation executor and four convenience methods:
13
+ want to use; route construction stays inside the hosted adapter. New hosted
14
+ HTTP integrations should import the stable v1 client:
29
15
 
30
16
  ```ts
31
17
  import { createGscdumpV1Client } from '@gscdump/sdk/v1'
@@ -40,6 +26,23 @@ const lifecycle = await gscdump.getUserLifecycle({
40
26
  })
41
27
  ```
42
28
 
29
+ The v1 surface uses a server-held Bearer credential and exposes a generic
30
+ operation executor plus typed convenience methods for all 18 registered HTTP
31
+ operations across partner, analytics, and realtime.
32
+
33
+ The root `createPartnerClient` export remains only for operations still in the
34
+ compatibility inventory. Do not use it for an operation already available from
35
+ `@gscdump/sdk/v1`.
36
+
37
+ For example, a typed hosted report query is:
38
+
39
+ ```ts
40
+ const report = await gscdump.queryAnalyticsReport({
41
+ params: { siteId: 's_01' },
42
+ body: { state: { dimensions: ['query'], searchType: 'web' } },
43
+ })
44
+ ```
45
+
43
46
  ## Scope
44
47
 
45
48
  - Partner user lifecycle
package/dist/index.mjs CHANGED
@@ -5,7 +5,13 @@ import { entityDailyTimeseries, multiSeriesStackedDaily, siteDailyTimeseries, to
5
5
  import { extractDateRange, normalizeFilter } from "gscdump/query";
6
6
  import { partnerEndpoints } from "@gscdump/contracts/partner";
7
7
  import { resolveWindow } from "@gscdump/engine/period";
8
- import { endOfMonth, format, startOfMonth, startOfQuarter, startOfWeek, subDays, subMonths } from "date-fns";
8
+ import { endOfMonth } from "date-fns/endOfMonth";
9
+ import { format } from "date-fns/format";
10
+ import { startOfMonth } from "date-fns/startOfMonth";
11
+ import { startOfQuarter } from "date-fns/startOfQuarter";
12
+ import { startOfWeek } from "date-fns/startOfWeek";
13
+ import { subDays } from "date-fns/subDays";
14
+ import { subMonths } from "date-fns/subMonths";
9
15
  import { CANONICAL_WEBHOOK_EVENTS, VALID_WEBHOOK_EVENTS, WEBHOOK_CONTRACT_VERSION, WEBHOOK_CONTRACT_VERSION_HEADER, WEBHOOK_CONTRACT_VERSION_HEADER as WEBHOOK_CONTRACT_VERSION_HEADER$1, WEBHOOK_DELIVERY_HEADER, WEBHOOK_DELIVERY_HEADER as WEBHOOK_DELIVERY_HEADER$1, WEBHOOK_EVENT_HEADER, WEBHOOK_EVENT_HEADER as WEBHOOK_EVENT_HEADER$1, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_SIGNATURE_HEADER as WEBHOOK_SIGNATURE_HEADER$1, WEBHOOK_TIMESTAMP_HEADER, WEBHOOK_TIMESTAMP_HEADER as WEBHOOK_TIMESTAMP_HEADER$1, partnerWebhookEnvelopeSchema } from "@gscdump/contracts";
10
16
  const DEFAULT_SEARCH_TYPE = "web";
11
17
  function isAnalysisSourcesOptions(value) {
@@ -92,7 +92,7 @@ interface GscdumpV1Client {
92
92
  /** Create one framework-neutral client whose behavior is driven by the v1 registry. */
93
93
  declare function createGscdumpV1Client(options: CreateGscdumpV1ClientOptions): GscdumpV1Client;
94
94
  type MaybePromise<T> = T | Promise<T>;
95
- declare const GSCDUMP_REALTIME_V1_SDK_VERSION: "0.37.7";
95
+ declare const GSCDUMP_REALTIME_V1_SDK_VERSION: "1.0.2";
96
96
  type GscdumpRealtimeV1TransportState = 'idle' | 'ticketing' | 'connecting' | 'handshaking' | 'replaying' | 'live' | 'waiting' | 'stopped' | 'terminal';
97
97
  type GscdumpRealtimeV1Freshness = 'unknown' | 'stale' | 'applying' | 'fresh' | 'resyncing' | 'degraded';
98
98
  type GscdumpRealtimeV1ErrorCode = 'cursor_store_failed' | 'effect_failed' | 'heartbeat_stale' | 'integration_failed' | 'protocol_error' | 'resync_failed' | 'runtime_unavailable' | 'socket_error' | 'ticket_invalid' | 'ticket_provider_failed' | 'upgrade_rejected';
package/dist/v1/index.mjs CHANGED
@@ -395,7 +395,7 @@ function utf8Size(value) {
395
395
  }
396
396
  return bytes;
397
397
  }
398
- const GSCDUMP_REALTIME_V1_SDK_VERSION = "0.37.7";
398
+ const GSCDUMP_REALTIME_V1_SDK_VERSION = "1.0.2";
399
399
  var GscdumpRealtimeV1Error = class extends Error {
400
400
  tag = "GscdumpRealtimeV1Error";
401
401
  code;
@@ -482,7 +482,7 @@ function createGscdumpRealtimeV1Client(options) {
482
482
  const protocol = createGscdumpV1Protocol();
483
483
  const runtime = options.runtime ?? defaultRuntime();
484
484
  const cursorStore = options.cursorStore ?? createMemoryCursorStore();
485
- const sdkVersion = options.sdkVersion ?? "0.37.7";
485
+ const sdkVersion = options.sdkVersion ?? "1.0.2";
486
486
  if (!sdkVersion) throw new TypeError("sdkVersion cannot be empty.");
487
487
  let running = false;
488
488
  let epoch = 0;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gscdump/sdk",
3
3
  "type": "module",
4
- "version": "1.0.0",
4
+ "version": "1.0.2",
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/contracts": "^1.0.0",
48
- "@gscdump/analysis": "^1.0.0",
49
- "@gscdump/engine": "^1.0.0",
50
- "gscdump": "^1.0.0"
47
+ "@gscdump/contracts": "^1.0.2",
48
+ "@gscdump/analysis": "^1.0.2",
49
+ "gscdump": "^1.0.2",
50
+ "@gscdump/engine": "^1.0.2"
51
51
  },
52
52
  "devDependencies": {
53
53
  "typescript": "^6.0.3",