@gscdump/sdk 7.11.0 → 7.12.0
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/package.mjs +1 -1
- package/dist/v1/http.d.mts +3 -0
- package/dist/v1/http.mjs +9 -2
- package/package.json +3 -3
package/dist/package.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var version = "7.
|
|
1
|
+
var version = "7.12.0";
|
|
2
2
|
export { version };
|
package/dist/v1/http.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ZodTypeAny, z } from "zod";
|
|
2
|
+
import { AgentRequestContext } from "@gscdump/contracts";
|
|
2
3
|
import { GscdumpV1ErrorEnvelope, GscdumpV1Operation as GscdumpV1Operation$1, GscdumpV1OperationId as GscdumpV1OperationId$1, createGscdumpV1Protocol } from "@gscdump/contracts/v1/http";
|
|
3
4
|
type MaybePromise<T> = T | Promise<T>;
|
|
4
5
|
type ValueOf<T> = T[keyof T];
|
|
@@ -48,6 +49,8 @@ export interface CreateGscdumpV1ClientOptions {
|
|
|
48
49
|
credential: GscdumpV1CredentialResolver;
|
|
49
50
|
fetch?: typeof fetch;
|
|
50
51
|
headers?: GscdumpV1HeadersResolver;
|
|
52
|
+
/** Declared correlation only. The server derives ownership from the credential. */
|
|
53
|
+
requestContext?: AgentRequestContext;
|
|
51
54
|
retry?: GscdumpV1RetryOptions;
|
|
52
55
|
/** Share concurrent identical queries within this client. Defaults to true. */
|
|
53
56
|
dedupe?: boolean;
|
package/dist/v1/http.mjs
CHANGED
|
@@ -150,6 +150,9 @@ async function buildRequestHeaders(options, operation, prepared, executeOptions)
|
|
|
150
150
|
try {
|
|
151
151
|
const [baseHeaders, credential] = await Promise.all([resolveBaseHeaders(options.headers), resolveCredential(options.credential)]);
|
|
152
152
|
const headers = new Headers(baseHeaders);
|
|
153
|
+
const { parseRequestContext, requestContextHeaders } = await getRuntime();
|
|
154
|
+
const requestContext = parseRequestContext(options.requestContext ?? {});
|
|
155
|
+
for (const key of Object.keys(requestContextHeaders)) if (requestContext[key] !== void 0) headers.set(requestContextHeaders[key], requestContext[key]);
|
|
153
156
|
for (const [key, value] of Object.entries(prepared.headers)) if (value !== void 0) headers.set(key, String(value));
|
|
154
157
|
headers.delete("x-api-key");
|
|
155
158
|
headers.set("accept", "application/json");
|
|
@@ -237,12 +240,14 @@ function requestIdFrom(response) {
|
|
|
237
240
|
}
|
|
238
241
|
let runtimePromise;
|
|
239
242
|
function getRuntime() {
|
|
240
|
-
return runtimePromise ??= import("@gscdump/contracts/v1/http").then(({ createGscdumpV1Protocol, createHttpV1Registry, isUnknownHttpV1OperationError }) => {
|
|
243
|
+
return runtimePromise ??= import("@gscdump/contracts/v1/http").then(({ createGscdumpV1Protocol, createHttpV1Registry, isUnknownHttpV1OperationError, agentRequestContextSchema, AGENT_REQUEST_HEADERS }) => {
|
|
241
244
|
const protocol = createGscdumpV1Protocol();
|
|
242
245
|
return {
|
|
243
246
|
isUnknownOperationError: isUnknownHttpV1OperationError,
|
|
244
247
|
protocol,
|
|
245
|
-
registry: createHttpV1Registry(protocol)
|
|
248
|
+
registry: createHttpV1Registry(protocol),
|
|
249
|
+
parseRequestContext: (input) => agentRequestContextSchema.parse(input),
|
|
250
|
+
requestContextHeaders: AGENT_REQUEST_HEADERS
|
|
246
251
|
};
|
|
247
252
|
});
|
|
248
253
|
}
|
|
@@ -468,6 +473,7 @@ function createGscdumpV1Client(options) {
|
|
|
468
473
|
getTeamCatalog: (input, executeOptions) => execute("partner.teams.catalog.get", input, executeOptions),
|
|
469
474
|
bindTeamCatalog: (input, executeOptions) => execute("partner.teams.catalog.bind", input, executeOptions),
|
|
470
475
|
getSiteIntIdCrosswalk: (input, executeOptions) => execute("partner.users.sites.crosswalk.get", input, executeOptions),
|
|
476
|
+
getUserIntegrationActivity: (input, executeOptions) => execute("partner.users.integration_activity.get", input, executeOptions),
|
|
471
477
|
deleteUser: (input, executeOptions) => execute("partner.users.delete", input, executeOptions),
|
|
472
478
|
createVerificationToken: (input, executeOptions) => execute("partner.users.verification.token.create", input, executeOptions),
|
|
473
479
|
addAndVerifySite: (input, executeOptions) => execute("partner.users.sites.verify.create", input, executeOptions),
|
|
@@ -475,6 +481,7 @@ function createGscdumpV1Client(options) {
|
|
|
475
481
|
listUserApiKeys: (input, executeOptions) => execute("partner.users.api_keys.list", input, executeOptions),
|
|
476
482
|
revokeUserApiKey: (input, executeOptions) => execute("partner.users.api_keys.revoke", input, executeOptions),
|
|
477
483
|
queryAnalyticsRows: (input, executeOptions) => execute("analytics.rows.query", input, executeOptions),
|
|
484
|
+
runReport: (input, executeOptions) => execute("analytics.reports.run", input, executeOptions),
|
|
478
485
|
queryAnalyticsReport: (input, executeOptions) => execute("analytics.reports.query", input, executeOptions),
|
|
479
486
|
queryAnalyticsReportDetail: (input, executeOptions) => execute("analytics.reports.detail.query", input, executeOptions),
|
|
480
487
|
getRealtimeStreamHead: (input = {}, executeOptions) => execute("realtime.stream.head.get", input, executeOptions),
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gscdump/sdk",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.12.0",
|
|
5
5
|
"description": "Consumer SDK for hosted gscdump.com integrations.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Harlan Wilton",
|
|
@@ -144,8 +144,8 @@
|
|
|
144
144
|
"node": ">=22.13.0"
|
|
145
145
|
},
|
|
146
146
|
"dependencies": {
|
|
147
|
-
"@gscdump/contracts": "^7.
|
|
148
|
-
"gscdump": "^7.
|
|
147
|
+
"@gscdump/contracts": "^7.12.0",
|
|
148
|
+
"gscdump": "^7.12.0",
|
|
149
149
|
"ofetch": "^1.5.1",
|
|
150
150
|
"zod": "^4.6.5"
|
|
151
151
|
},
|