@gscdump/sdk 2.1.0 → 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({
@@ -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.1.0";
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.1.0";
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.1.0";
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.1.0",
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.1.0",
150
- "@gscdump/engine": "^2.1.0",
151
- "gscdump": "^2.1.0"
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",