@gscdump/sdk 2.0.6 → 2.1.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.
@@ -83,7 +83,8 @@ function builderStateToArchetype(siteId, state, opts = {}) {
83
83
  }
84
84
  if (dims.length === 2 && dims.includes("date")) {
85
85
  if (matches.size > 0) return null;
86
- return multiSeriesStackedDaily(siteId, range, dims.find((d) => d !== "date"), {
86
+ const series = dims.find((d) => d !== "date");
87
+ return multiSeriesStackedDaily(siteId, range, series, {
87
88
  searchType,
88
89
  compareRange: cmp
89
90
  });
package/dist/period.mjs CHANGED
@@ -52,7 +52,8 @@ function startOfQuarter(date) {
52
52
  return `${year}-${String(quarterMonth).padStart(2, "0")}-01`;
53
53
  }
54
54
  function startOfWeek(date) {
55
- return addDays(date, -(((/* @__PURE__ */ new Date(`${date}T00:00:00Z`)).getUTCDay() + 6) % 7));
55
+ const day = (/* @__PURE__ */ new Date(`${date}T00:00:00Z`)).getUTCDay();
56
+ return addDays(date, -((day + 6) % 7));
56
57
  }
57
58
  function buildResultFromIso(start, end) {
58
59
  const startDate = /* @__PURE__ */ new Date(`${start}T00:00:00`);
@@ -95,7 +96,8 @@ function periodToDateRange(period, stableDataOrOptions = true) {
95
96
  };
96
97
  return result;
97
98
  }
98
- const endIso = addDays(todayInTimezone(options.timezone, options.now), -(stableData ? 3 : 1));
99
+ const today = todayInTimezone(options.timezone, options.now);
100
+ const endIso = addDays(today, -(stableData ? 3 : 1));
99
101
  const upstreamPreset = ROLLING_TO_UPSTREAM[period] ?? CALENDAR_TO_UPSTREAM[period];
100
102
  if (upstreamPreset) {
101
103
  const win = resolveWindow({
@@ -112,8 +112,6 @@ interface GscdumpV1Client {
112
112
  deleteUser: (input: GscdumpV1OperationInput<'partner.users.delete'>, options?: GscdumpV1ExecuteOptions) => Promise<GscdumpV1OperationResponse<'partner.users.delete'>>;
113
113
  createVerificationToken: (input: GscdumpV1OperationInput<'partner.users.verification.token.create'>, options?: GscdumpV1ExecuteOptions) => Promise<GscdumpV1OperationResponse<'partner.users.verification.token.create'>>;
114
114
  addAndVerifySite: (input: GscdumpV1OperationInput<'partner.users.sites.verify.create'>, options?: GscdumpV1ExecuteOptions) => Promise<GscdumpV1OperationResponse<'partner.users.sites.verify.create'>>;
115
- queryCrossSource: (input: GscdumpV1OperationInput<'partner.sites.cross.source.query'>, options?: GscdumpV1ExecuteOptions) => Promise<GscdumpV1OperationResponse<'partner.sites.cross.source.query'>>;
116
- enrichKeywords: (input: GscdumpV1OperationInput<'partner.keywords.enrich.query'>, options?: GscdumpV1ExecuteOptions) => Promise<GscdumpV1OperationResponse<'partner.keywords.enrich.query'>>;
117
115
  queryAnalyticsRows: (input: GscdumpV1OperationInput<'analytics.rows.query'>, options?: GscdumpV1ExecuteOptions) => Promise<GscdumpV1OperationResponse<'analytics.rows.query'>>;
118
116
  queryAnalyticsReport: (input: GscdumpV1OperationInput<'analytics.reports.query'>, options?: GscdumpV1ExecuteOptions) => Promise<GscdumpV1OperationResponse<'analytics.reports.query'>>;
119
117
  queryAnalyticsReportDetail: (input: GscdumpV1OperationInput<'analytics.reports.detail.query'>, options?: GscdumpV1ExecuteOptions) => Promise<GscdumpV1OperationResponse<'analytics.reports.detail.query'>>;
package/dist/v1/http.mjs CHANGED
@@ -418,8 +418,6 @@ function createGscdumpV1Client(options) {
418
418
  deleteUser: (input, executeOptions) => execute("partner.users.delete", input, executeOptions),
419
419
  createVerificationToken: (input, executeOptions) => execute("partner.users.verification.token.create", input, executeOptions),
420
420
  addAndVerifySite: (input, executeOptions) => execute("partner.users.sites.verify.create", input, executeOptions),
421
- queryCrossSource: (input, executeOptions) => execute("partner.sites.cross.source.query", input, executeOptions),
422
- enrichKeywords: (input, executeOptions) => execute("partner.keywords.enrich.query", input, executeOptions),
423
421
  queryAnalyticsRows: (input, executeOptions) => execute("analytics.rows.query", input, executeOptions),
424
422
  queryAnalyticsReport: (input, executeOptions) => execute("analytics.reports.query", input, executeOptions),
425
423
  queryAnalyticsReportDetail: (input, executeOptions) => execute("analytics.reports.detail.query", input, executeOptions),
@@ -1,6 +1,6 @@
1
1
  import { RealtimeV1Cursor, RealtimeV1Event, RealtimeV1StreamHead, RealtimeV1StreamId } from "@gscdump/contracts/v1/realtime";
2
2
  type MaybePromise<T> = T | Promise<T>;
3
- declare const GSCDUMP_REALTIME_V1_SDK_VERSION: "2.0.6";
3
+ declare const GSCDUMP_REALTIME_V1_SDK_VERSION: "2.1.1";
4
4
  type GscdumpRealtimeV1TransportState = 'idle' | 'ticketing' | 'connecting' | 'handshaking' | 'replaying' | 'live' | 'waiting' | 'stopped' | 'terminal';
5
5
  type GscdumpRealtimeV1Freshness = 'unknown' | 'stale' | 'applying' | 'fresh' | 'resyncing' | 'degraded';
6
6
  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';
@@ -1,6 +1,6 @@
1
1
  import { utf8Size } from "../utf8.mjs";
2
2
  import { GSCDUMP_REALTIME_ACK_POLICY, GSCDUMP_REALTIME_CLOSE_CODES, GSCDUMP_REALTIME_CONNECTION_POLICY, GSCDUMP_REALTIME_LIMITS, GSCDUMP_REALTIME_PING, GSCDUMP_REALTIME_PONG, GSCDUMP_REALTIME_PROTOCOL_VERSION, GSCDUMP_REALTIME_SUBPROTOCOL, REALTIME_V1_EVENT_NAMES, REALTIME_V1_RESOURCE_TYPES, createRealtimeV1Schemas } from "@gscdump/contracts/v1/realtime";
3
- const GSCDUMP_REALTIME_V1_SDK_VERSION = "2.0.6";
3
+ const GSCDUMP_REALTIME_V1_SDK_VERSION = "2.1.1";
4
4
  var GscdumpRealtimeV1Error = class extends Error {
5
5
  tag = "GscdumpRealtimeV1Error";
6
6
  code;
@@ -87,7 +87,7 @@ function createGscdumpRealtimeV1Client(options) {
87
87
  const schemas = createRealtimeV1Schemas();
88
88
  const runtime = options.runtime ?? defaultRuntime();
89
89
  const cursorStore = options.cursorStore ?? createMemoryCursorStore();
90
- const sdkVersion = options.sdkVersion ?? "2.0.6";
90
+ const sdkVersion = options.sdkVersion ?? "2.1.1";
91
91
  if (!sdkVersion) throw new TypeError("sdkVersion cannot be empty.");
92
92
  let running = false;
93
93
  let epoch = 0;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gscdump/sdk",
3
3
  "type": "module",
4
- "version": "2.0.6",
4
+ "version": "2.1.1",
5
5
  "description": "Consumer SDK for hosted gscdump.com integrations.",
6
6
  "author": {
7
7
  "name": "Harlan Wilton",
@@ -146,9 +146,9 @@
146
146
  "dependencies": {
147
147
  "ofetch": "^1.5.1",
148
148
  "zod": "^4.4.3",
149
- "@gscdump/contracts": "^2.0.6",
150
- "@gscdump/engine": "^2.0.6",
151
- "gscdump": "^2.0.6"
149
+ "@gscdump/contracts": "^2.1.1",
150
+ "@gscdump/engine": "^2.1.1",
151
+ "gscdump": "^2.1.1"
152
152
  },
153
153
  "devDependencies": {
154
154
  "typescript": "^7.0.2",