@gscdump/sdk 1.0.0 → 1.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.
- package/README.md +19 -16
- package/dist/v1/index.d.mts +1 -1
- package/dist/v1/index.mjs +2 -2
- package/package.json +5 -5
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/v1/index.d.mts
CHANGED
|
@@ -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.
|
|
95
|
+
declare const GSCDUMP_REALTIME_V1_SDK_VERSION: "1.0.0";
|
|
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.
|
|
398
|
+
const GSCDUMP_REALTIME_V1_SDK_VERSION = "1.0.0";
|
|
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.
|
|
485
|
+
const sdkVersion = options.sdkVersion ?? "1.0.0";
|
|
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.
|
|
4
|
+
"version": "1.0.1",
|
|
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.
|
|
48
|
-
"@gscdump/
|
|
49
|
-
"
|
|
50
|
-
"gscdump": "^1.0.
|
|
47
|
+
"@gscdump/contracts": "^1.0.1",
|
|
48
|
+
"@gscdump/engine": "^1.0.1",
|
|
49
|
+
"gscdump": "^1.0.1",
|
|
50
|
+
"@gscdump/analysis": "^1.0.1"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"typescript": "^6.0.3",
|