@reopt-ai/data-contract 0.2.0 → 0.5.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.
Files changed (56) hide show
  1. package/README.md +11 -4
  2. package/dist/{chunk-IKOEYZVT.js → chunk-2LZBZXBF.js} +9 -3
  3. package/dist/chunk-2LZBZXBF.js.map +1 -0
  4. package/dist/{chunk-LBSBZO7O.cjs → chunk-4B4AY44F.cjs} +33 -7
  5. package/dist/chunk-4B4AY44F.cjs.map +1 -0
  6. package/dist/{chunk-2SJPZP2D.js → chunk-AHXPQQKO.js} +30 -4
  7. package/dist/chunk-AHXPQQKO.js.map +1 -0
  8. package/dist/{chunk-SC7TFGTO.js → chunk-BCGR27G2.js} +130 -14
  9. package/dist/chunk-BCGR27G2.js.map +1 -0
  10. package/dist/{chunk-FRJK7OCQ.js → chunk-MFZEIH5Z.js} +7 -4
  11. package/dist/chunk-MFZEIH5Z.js.map +1 -0
  12. package/dist/{chunk-CSTC3ADG.cjs → chunk-OLSMH4RY.cjs} +9 -3
  13. package/dist/chunk-OLSMH4RY.cjs.map +1 -0
  14. package/dist/{chunk-GCLUMVPA.cjs → chunk-VQ2CD5MG.cjs} +138 -22
  15. package/dist/chunk-VQ2CD5MG.cjs.map +1 -0
  16. package/dist/{chunk-HRKELGGH.cjs → chunk-XI3VP5DN.cjs} +7 -4
  17. package/dist/chunk-XI3VP5DN.cjs.map +1 -0
  18. package/dist/client.cjs +94 -44
  19. package/dist/client.cjs.map +1 -1
  20. package/dist/client.d.cts +8 -4
  21. package/dist/client.d.ts +8 -4
  22. package/dist/client.js +58 -8
  23. package/dist/client.js.map +1 -1
  24. package/dist/control.cjs +14 -4
  25. package/dist/control.cjs.map +1 -1
  26. package/dist/control.d.cts +49 -7
  27. package/dist/control.d.ts +49 -7
  28. package/dist/control.js +15 -5
  29. package/dist/index.cjs +2 -2
  30. package/dist/index.d.cts +15 -4
  31. package/dist/index.d.ts +15 -4
  32. package/dist/index.js +1 -1
  33. package/dist/ingest.cjs +2 -2
  34. package/dist/ingest.d.cts +9 -7
  35. package/dist/ingest.d.ts +9 -7
  36. package/dist/ingest.js +1 -1
  37. package/dist/query.cjs +29 -3
  38. package/dist/query.cjs.map +1 -1
  39. package/dist/query.d.cts +317 -21
  40. package/dist/query.d.ts +317 -21
  41. package/dist/query.js +30 -4
  42. package/dist/report.cjs +85 -0
  43. package/dist/report.cjs.map +1 -0
  44. package/dist/report.d.cts +167 -0
  45. package/dist/report.d.ts +167 -0
  46. package/dist/report.js +85 -0
  47. package/dist/report.js.map +1 -0
  48. package/package.json +7 -2
  49. package/dist/chunk-2SJPZP2D.js.map +0 -1
  50. package/dist/chunk-CSTC3ADG.cjs.map +0 -1
  51. package/dist/chunk-FRJK7OCQ.js.map +0 -1
  52. package/dist/chunk-GCLUMVPA.cjs.map +0 -1
  53. package/dist/chunk-HRKELGGH.cjs.map +0 -1
  54. package/dist/chunk-IKOEYZVT.js.map +0 -1
  55. package/dist/chunk-LBSBZO7O.cjs.map +0 -1
  56. package/dist/chunk-SC7TFGTO.js.map +0 -1
package/dist/query.cjs CHANGED
@@ -23,11 +23,9 @@
23
23
 
24
24
 
25
25
 
26
- var _chunkGCLUMVPAcjs = require('./chunk-GCLUMVPA.cjs');
27
26
 
28
27
 
29
28
 
30
- var _chunkCSTC3ADGcjs = require('./chunk-CSTC3ADG.cjs');
31
29
 
32
30
 
33
31
 
@@ -38,9 +36,11 @@ var _chunkCSTC3ADGcjs = require('./chunk-CSTC3ADG.cjs');
38
36
 
39
37
 
40
38
 
39
+ var _chunkVQ2CD5MGcjs = require('./chunk-VQ2CD5MG.cjs');
41
40
 
42
41
 
43
42
 
43
+ var _chunkOLSMH4RYcjs = require('./chunk-OLSMH4RY.cjs');
44
44
 
45
45
 
46
46
 
@@ -55,5 +55,31 @@ var _chunkCSTC3ADGcjs = require('./chunk-CSTC3ADG.cjs');
55
55
 
56
56
 
57
57
 
58
- exports.QUERY_API_PATHS = _chunkGCLUMVPAcjs.QUERY_API_PATHS; exports.QUERY_ERROR_CODES = _chunkGCLUMVPAcjs.QUERY_ERROR_CODES; exports.isValidTimeZone = _chunkGCLUMVPAcjs.isValidTimeZone; exports.zChannelFilter = _chunkGCLUMVPAcjs.zChannelFilter; exports.zDate = _chunkCSTC3ADGcjs.zDate; exports.zEventsTimeseriesData = _chunkGCLUMVPAcjs.zEventsTimeseriesData; exports.zEventsTimeseriesInput = _chunkGCLUMVPAcjs.zEventsTimeseriesInput; exports.zEventsTimeseriesResponse = _chunkGCLUMVPAcjs.zEventsTimeseriesResponse; exports.zFunnelData = _chunkGCLUMVPAcjs.zFunnelData; exports.zFunnelInput = _chunkGCLUMVPAcjs.zFunnelInput; exports.zFunnelResponse = _chunkGCLUMVPAcjs.zFunnelResponse; exports.zFunnelStep = _chunkGCLUMVPAcjs.zFunnelStep; exports.zGranularity = _chunkGCLUMVPAcjs.zGranularity; exports.zInstant = _chunkCSTC3ADGcjs.zInstant; exports.zQueryEnvelope = _chunkGCLUMVPAcjs.zQueryEnvelope; exports.zQueryError = _chunkGCLUMVPAcjs.zQueryError; exports.zQueryErrorCode = _chunkGCLUMVPAcjs.zQueryErrorCode; exports.zQueryMeta = _chunkGCLUMVPAcjs.zQueryMeta; exports.zRetentionCell = _chunkGCLUMVPAcjs.zRetentionCell; exports.zRetentionData = _chunkGCLUMVPAcjs.zRetentionData; exports.zRetentionInput = _chunkGCLUMVPAcjs.zRetentionInput; exports.zRetentionInterval = _chunkGCLUMVPAcjs.zRetentionInterval; exports.zRetentionResponse = _chunkGCLUMVPAcjs.zRetentionResponse; exports.zTimeseriesBreakdown = _chunkGCLUMVPAcjs.zTimeseriesBreakdown; exports.zTimeseriesPoint = _chunkGCLUMVPAcjs.zTimeseriesPoint; exports.zTimezone = _chunkGCLUMVPAcjs.zTimezone;
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+
82
+
83
+
84
+ exports.QUERY_API_PATHS = _chunkVQ2CD5MGcjs.QUERY_API_PATHS; exports.QUERY_ERROR_CODES = _chunkVQ2CD5MGcjs.QUERY_ERROR_CODES; exports.isValidTimeZone = _chunkVQ2CD5MGcjs.isValidTimeZone; exports.zBucketStart = _chunkVQ2CD5MGcjs.zBucketStart; exports.zChannelFilter = _chunkVQ2CD5MGcjs.zChannelFilter; exports.zDate = _chunkOLSMH4RYcjs.zDate; exports.zEventPropertyFilter = _chunkVQ2CD5MGcjs.zEventPropertyFilter; exports.zEventsTimeseriesData = _chunkVQ2CD5MGcjs.zEventsTimeseriesData; exports.zEventsTimeseriesInput = _chunkVQ2CD5MGcjs.zEventsTimeseriesInput; exports.zEventsTimeseriesResponse = _chunkVQ2CD5MGcjs.zEventsTimeseriesResponse; exports.zFunnelData = _chunkVQ2CD5MGcjs.zFunnelData; exports.zFunnelInput = _chunkVQ2CD5MGcjs.zFunnelInput; exports.zFunnelResponse = _chunkVQ2CD5MGcjs.zFunnelResponse; exports.zFunnelStep = _chunkVQ2CD5MGcjs.zFunnelStep; exports.zGranularity = _chunkVQ2CD5MGcjs.zGranularity; exports.zInstant = _chunkOLSMH4RYcjs.zInstant; exports.zQueryEnvelope = _chunkVQ2CD5MGcjs.zQueryEnvelope; exports.zQueryError = _chunkVQ2CD5MGcjs.zQueryError; exports.zQueryErrorCode = _chunkVQ2CD5MGcjs.zQueryErrorCode; exports.zQueryMeta = _chunkVQ2CD5MGcjs.zQueryMeta; exports.zQuerySource = _chunkVQ2CD5MGcjs.zQuerySource; exports.zRetentionCell = _chunkVQ2CD5MGcjs.zRetentionCell; exports.zRetentionData = _chunkVQ2CD5MGcjs.zRetentionData; exports.zRetentionInput = _chunkVQ2CD5MGcjs.zRetentionInput; exports.zRetentionInterval = _chunkVQ2CD5MGcjs.zRetentionInterval; exports.zRetentionResponse = _chunkVQ2CD5MGcjs.zRetentionResponse; exports.zTimeseriesBreakdown = _chunkVQ2CD5MGcjs.zTimeseriesBreakdown; exports.zTimeseriesPoint = _chunkVQ2CD5MGcjs.zTimeseriesPoint; exports.zTimezone = _chunkVQ2CD5MGcjs.zTimezone; exports.zTrafficDimension = _chunkVQ2CD5MGcjs.zTrafficDimension; exports.zTrafficOverviewData = _chunkVQ2CD5MGcjs.zTrafficOverviewData; exports.zTrafficOverviewInput = _chunkVQ2CD5MGcjs.zTrafficOverviewInput; exports.zTrafficOverviewResponse = _chunkVQ2CD5MGcjs.zTrafficOverviewResponse; exports.zTrafficSeriesPoint = _chunkVQ2CD5MGcjs.zTrafficSeriesPoint; exports.zTrafficSourceRow = _chunkVQ2CD5MGcjs.zTrafficSourceRow; exports.zTrafficSourcesData = _chunkVQ2CD5MGcjs.zTrafficSourcesData; exports.zTrafficSourcesInput = _chunkVQ2CD5MGcjs.zTrafficSourcesInput; exports.zTrafficSourcesResponse = _chunkVQ2CD5MGcjs.zTrafficSourcesResponse; exports.zTrafficTotals = _chunkVQ2CD5MGcjs.zTrafficTotals;
59
85
  //# sourceMappingURL=query.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/eric/reopt-ai/reopt-data/packages/data-contract/dist/query.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,uhDAAC","file":"/Users/eric/reopt-ai/reopt-data/packages/data-contract/dist/query.cjs"}
1
+ {"version":3,"sources":["/Users/eric/reopt-ai/reopt-data/packages/data-contract/dist/query.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,s4EAAC","file":"/Users/eric/reopt-ai/reopt-data/packages/data-contract/dist/query.cjs"}
package/dist/query.d.cts CHANGED
@@ -16,10 +16,10 @@ export { zDate, zInstant } from './index.cjs';
16
16
 
17
17
  /** Bucket width for a time series. */
18
18
  declare const zGranularity: z.ZodEnum<{
19
- hour: "hour";
19
+ month: "month";
20
20
  day: "day";
21
+ hour: "hour";
21
22
  week: "week";
22
- month: "month";
23
23
  }>;
24
24
  type Granularity = z.infer<typeof zGranularity>;
25
25
  /**
@@ -54,13 +54,29 @@ type ChannelFilter = z.infer<typeof zChannelFilter>;
54
54
  * TTL, while ingest lag means the read model is genuinely behind and the right
55
55
  * response is an "aggregating" badge, not a refresh.
56
56
  */
57
+ declare const zQuerySource: z.ZodEnum<{
58
+ rollup: "rollup";
59
+ raw: "raw";
60
+ mixed: "mixed";
61
+ }>;
62
+ type QuerySource = z.infer<typeof zQuerySource>;
57
63
  declare const zQueryMeta: z.ZodObject<{
58
64
  projectId: z.ZodString;
59
65
  computedAt: z.ZodString;
60
66
  cacheAgeSeconds: z.ZodNumber;
61
- ingestLagSeconds: z.ZodNumber;
67
+ ingestLagSeconds: z.ZodNullable<z.ZodNumber>;
68
+ ingestLagStatus: z.ZodEnum<{
69
+ unknown: "unknown";
70
+ known: "known";
71
+ }>;
72
+ ingestDeadLetterCount: z.ZodNullable<z.ZodNumber>;
62
73
  cached: z.ZodBoolean;
63
74
  timezone: z.ZodString;
75
+ source: z.ZodEnum<{
76
+ rollup: "rollup";
77
+ raw: "raw";
78
+ mixed: "mixed";
79
+ }>;
64
80
  requestId: z.ZodString;
65
81
  }, z.core.$strip>;
66
82
  type QueryMeta = z.infer<typeof zQueryMeta>;
@@ -71,9 +87,19 @@ declare function zQueryEnvelope<T extends z.ZodTypeAny>(data: T): z.ZodObject<{
71
87
  projectId: z.ZodString;
72
88
  computedAt: z.ZodString;
73
89
  cacheAgeSeconds: z.ZodNumber;
74
- ingestLagSeconds: z.ZodNumber;
90
+ ingestLagSeconds: z.ZodNullable<z.ZodNumber>;
91
+ ingestLagStatus: z.ZodEnum<{
92
+ unknown: "unknown";
93
+ known: "known";
94
+ }>;
95
+ ingestDeadLetterCount: z.ZodNullable<z.ZodNumber>;
75
96
  cached: z.ZodBoolean;
76
97
  timezone: z.ZodString;
98
+ source: z.ZodEnum<{
99
+ rollup: "rollup";
100
+ raw: "raw";
101
+ mixed: "mixed";
102
+ }>;
77
103
  requestId: z.ZodString;
78
104
  }, z.core.$strip>;
79
105
  }, z.core.$strip>;
@@ -88,17 +114,29 @@ declare const zTimeseriesBreakdown: z.ZodObject<{
88
114
  topN: z.ZodDefault<z.ZodNumber>;
89
115
  }, z.core.$strip>;
90
116
  type TimeseriesBreakdown = z.infer<typeof zTimeseriesBreakdown>;
117
+ /** Exact-match filter for a top-level event `properties` key. Multiple filters are ANDed. */
118
+ declare const zEventPropertyFilter: z.ZodObject<{
119
+ key: z.ZodString;
120
+ operator: z.ZodDefault<z.ZodLiteral<"eq">>;
121
+ value: z.ZodString;
122
+ }, z.core.$strip>;
123
+ type EventPropertyFilter = z.infer<typeof zEventPropertyFilter>;
91
124
  declare const zEventsTimeseriesInput: z.ZodObject<{
92
125
  projectId: z.ZodString;
93
126
  startDate: z.ZodString;
94
127
  endDate: z.ZodString;
95
128
  granularity: z.ZodDefault<z.ZodEnum<{
96
- hour: "hour";
129
+ month: "month";
97
130
  day: "day";
131
+ hour: "hour";
98
132
  week: "week";
99
- month: "month";
100
133
  }>>;
101
134
  eventName: z.ZodOptional<z.ZodString>;
135
+ propertyFilters: z.ZodOptional<z.ZodArray<z.ZodObject<{
136
+ key: z.ZodString;
137
+ operator: z.ZodDefault<z.ZodLiteral<"eq">>;
138
+ value: z.ZodString;
139
+ }, z.core.$strip>>>;
102
140
  breakdown: z.ZodOptional<z.ZodObject<{
103
141
  kind: z.ZodLiteral<"property">;
104
142
  key: z.ZodString;
@@ -106,8 +144,23 @@ declare const zEventsTimeseriesInput: z.ZodObject<{
106
144
  }, z.core.$strip>>;
107
145
  segmentId: z.ZodOptional<z.ZodString>;
108
146
  timezone: z.ZodOptional<z.ZodString>;
147
+ includeInternal: z.ZodDefault<z.ZodBoolean>;
109
148
  }, z.core.$strip>;
110
149
  type EventsTimeseriesInput = z.input<typeof zEventsTimeseriesInput>;
150
+ /**
151
+ * Bucket start as wall-clock time in `meta.timezone`, `YYYY-MM-DD HH:MM:SS`.
152
+ *
153
+ * Pinned rather than left to the backend, because a consumer keys its chart on
154
+ * this string: an unspecified format is one where two backends, or two
155
+ * granularities, can quietly disagree and produce two different keys for the
156
+ * same bucket.
157
+ *
158
+ * It is wall time, not an instant — for `Asia/Seoul` a day bucket reads
159
+ * `2026-08-24 00:00:00`, which is `2026-08-23T15:00:00Z`. Day, week and month
160
+ * buckets always carry `00:00:00`, so slicing the first ten characters is a
161
+ * safe way to get a date key.
162
+ */
163
+ declare const zBucketStart: z.ZodString;
111
164
  declare const zTimeseriesPoint: z.ZodObject<{
112
165
  date: z.ZodString;
113
166
  count: z.ZodNumber;
@@ -115,10 +168,10 @@ declare const zTimeseriesPoint: z.ZodObject<{
115
168
  type TimeseriesPoint = z.infer<typeof zTimeseriesPoint>;
116
169
  declare const zEventsTimeseriesData: z.ZodObject<{
117
170
  granularity: z.ZodEnum<{
118
- hour: "hour";
171
+ month: "month";
119
172
  day: "day";
173
+ hour: "hour";
120
174
  week: "week";
121
- month: "month";
122
175
  }>;
123
176
  timezone: z.ZodString;
124
177
  series: z.ZodArray<z.ZodObject<{
@@ -137,10 +190,10 @@ type EventsTimeseriesData = z.infer<typeof zEventsTimeseriesData>;
137
190
  declare const zEventsTimeseriesResponse: z.ZodObject<{
138
191
  data: z.ZodObject<{
139
192
  granularity: z.ZodEnum<{
140
- hour: "hour";
193
+ month: "month";
141
194
  day: "day";
195
+ hour: "hour";
142
196
  week: "week";
143
- month: "month";
144
197
  }>;
145
198
  timezone: z.ZodString;
146
199
  series: z.ZodArray<z.ZodObject<{
@@ -159,9 +212,19 @@ declare const zEventsTimeseriesResponse: z.ZodObject<{
159
212
  projectId: z.ZodString;
160
213
  computedAt: z.ZodString;
161
214
  cacheAgeSeconds: z.ZodNumber;
162
- ingestLagSeconds: z.ZodNumber;
215
+ ingestLagSeconds: z.ZodNullable<z.ZodNumber>;
216
+ ingestLagStatus: z.ZodEnum<{
217
+ unknown: "unknown";
218
+ known: "known";
219
+ }>;
220
+ ingestDeadLetterCount: z.ZodNullable<z.ZodNumber>;
163
221
  cached: z.ZodBoolean;
164
222
  timezone: z.ZodString;
223
+ source: z.ZodEnum<{
224
+ rollup: "rollup";
225
+ raw: "raw";
226
+ mixed: "mixed";
227
+ }>;
165
228
  requestId: z.ZodString;
166
229
  }, z.core.$strip>;
167
230
  }, z.core.$strip>;
@@ -181,6 +244,7 @@ declare const zFunnelInput: z.ZodObject<{
181
244
  utmCampaigns: z.ZodOptional<z.ZodArray<z.ZodString>>;
182
245
  }, z.core.$strip>>;
183
246
  timezone: z.ZodOptional<z.ZodString>;
247
+ includeInternal: z.ZodDefault<z.ZodBoolean>;
184
248
  }, z.core.$strip>;
185
249
  type FunnelInput = z.input<typeof zFunnelInput>;
186
250
  declare const zFunnelStep: z.ZodObject<{
@@ -221,26 +285,36 @@ declare const zFunnelResponse: z.ZodObject<{
221
285
  projectId: z.ZodString;
222
286
  computedAt: z.ZodString;
223
287
  cacheAgeSeconds: z.ZodNumber;
224
- ingestLagSeconds: z.ZodNumber;
288
+ ingestLagSeconds: z.ZodNullable<z.ZodNumber>;
289
+ ingestLagStatus: z.ZodEnum<{
290
+ unknown: "unknown";
291
+ known: "known";
292
+ }>;
293
+ ingestDeadLetterCount: z.ZodNullable<z.ZodNumber>;
225
294
  cached: z.ZodBoolean;
226
295
  timezone: z.ZodString;
296
+ source: z.ZodEnum<{
297
+ rollup: "rollup";
298
+ raw: "raw";
299
+ mixed: "mixed";
300
+ }>;
227
301
  requestId: z.ZodString;
228
302
  }, z.core.$strip>;
229
303
  }, z.core.$strip>;
230
304
  type FunnelResponse = z.infer<typeof zFunnelResponse>;
231
305
  declare const zRetentionInterval: z.ZodEnum<{
306
+ month: "month";
232
307
  day: "day";
233
308
  week: "week";
234
- month: "month";
235
309
  }>;
236
310
  declare const zRetentionInput: z.ZodObject<{
237
311
  projectId: z.ZodString;
238
312
  startDate: z.ZodString;
239
313
  endDate: z.ZodString;
240
314
  interval: z.ZodDefault<z.ZodEnum<{
315
+ month: "month";
241
316
  day: "day";
242
317
  week: "week";
243
- month: "month";
244
318
  }>>;
245
319
  periods: z.ZodDefault<z.ZodNumber>;
246
320
  startEvent: z.ZodOptional<z.ZodString>;
@@ -262,6 +336,7 @@ declare const zRetentionInput: z.ZodObject<{
262
336
  utmCampaigns: z.ZodOptional<z.ZodArray<z.ZodString>>;
263
337
  }, z.core.$strip>>;
264
338
  timezone: z.ZodOptional<z.ZodString>;
339
+ includeInternal: z.ZodDefault<z.ZodBoolean>;
265
340
  }, z.core.$strip>;
266
341
  type RetentionInput = z.input<typeof zRetentionInput>;
267
342
  declare const zRetentionCell: z.ZodObject<{
@@ -284,9 +359,9 @@ declare const zRetentionData: z.ZodObject<{
284
359
  rate: z.ZodNumber;
285
360
  }, z.core.$strip>>;
286
361
  interval: z.ZodEnum<{
362
+ month: "month";
287
363
  day: "day";
288
364
  week: "week";
289
- month: "month";
290
365
  }>;
291
366
  periods: z.ZodNumber;
292
367
  retentionType: z.ZodEnum<{
@@ -312,9 +387,9 @@ declare const zRetentionResponse: z.ZodObject<{
312
387
  rate: z.ZodNumber;
313
388
  }, z.core.$strip>>;
314
389
  interval: z.ZodEnum<{
390
+ month: "month";
315
391
  day: "day";
316
392
  week: "week";
317
- month: "month";
318
393
  }>;
319
394
  periods: z.ZodNumber;
320
395
  retentionType: z.ZodEnum<{
@@ -327,19 +402,237 @@ declare const zRetentionResponse: z.ZodObject<{
327
402
  projectId: z.ZodString;
328
403
  computedAt: z.ZodString;
329
404
  cacheAgeSeconds: z.ZodNumber;
330
- ingestLagSeconds: z.ZodNumber;
405
+ ingestLagSeconds: z.ZodNullable<z.ZodNumber>;
406
+ ingestLagStatus: z.ZodEnum<{
407
+ unknown: "unknown";
408
+ known: "known";
409
+ }>;
410
+ ingestDeadLetterCount: z.ZodNullable<z.ZodNumber>;
331
411
  cached: z.ZodBoolean;
332
412
  timezone: z.ZodString;
413
+ source: z.ZodEnum<{
414
+ rollup: "rollup";
415
+ raw: "raw";
416
+ mixed: "mixed";
417
+ }>;
333
418
  requestId: z.ZodString;
334
419
  }, z.core.$strip>;
335
420
  }, z.core.$strip>;
336
421
  type RetentionResponse = z.infer<typeof zRetentionResponse>;
337
- declare const QUERY_ERROR_CODES: readonly ["unauthorized", "project_scope_mismatch", "query_scope_missing", "validation_failed", "unsupported_combination", "rate_limited", "query_timeout", "internal_error"];
422
+ /**
423
+ * Session-level traffic for a brand site, served from the hourly rollups.
424
+ * `newVisitors` counts sessions whose device was first seen inside them;
425
+ * `returningVisitors` is the rest. Both are session counts, not people —
426
+ * "visitor" is the vocabulary the dashboards already use.
427
+ */
428
+ declare const zTrafficOverviewInput: z.ZodObject<{
429
+ projectId: z.ZodString;
430
+ startDate: z.ZodString;
431
+ endDate: z.ZodString;
432
+ granularity: z.ZodDefault<z.ZodEnum<{
433
+ month: "month";
434
+ day: "day";
435
+ hour: "hour";
436
+ week: "week";
437
+ }>>;
438
+ timezone: z.ZodOptional<z.ZodString>;
439
+ }, z.core.$strip>;
440
+ type TrafficOverviewInput = z.input<typeof zTrafficOverviewInput>;
441
+ declare const zTrafficTotals: z.ZodObject<{
442
+ sessions: z.ZodNumber;
443
+ pageviews: z.ZodNumber;
444
+ newVisitors: z.ZodNumber;
445
+ returningVisitors: z.ZodNumber;
446
+ bounceRate: z.ZodNumber;
447
+ }, z.core.$strip>;
448
+ type TrafficTotals = z.infer<typeof zTrafficTotals>;
449
+ declare const zTrafficSeriesPoint: z.ZodObject<{
450
+ sessions: z.ZodNumber;
451
+ pageviews: z.ZodNumber;
452
+ newVisitors: z.ZodNumber;
453
+ returningVisitors: z.ZodNumber;
454
+ bounceRate: z.ZodNumber;
455
+ date: z.ZodString;
456
+ }, z.core.$strip>;
457
+ declare const zTrafficOverviewData: z.ZodObject<{
458
+ granularity: z.ZodEnum<{
459
+ month: "month";
460
+ day: "day";
461
+ hour: "hour";
462
+ week: "week";
463
+ }>;
464
+ timezone: z.ZodString;
465
+ totals: z.ZodObject<{
466
+ sessions: z.ZodNumber;
467
+ pageviews: z.ZodNumber;
468
+ newVisitors: z.ZodNumber;
469
+ returningVisitors: z.ZodNumber;
470
+ bounceRate: z.ZodNumber;
471
+ }, z.core.$strip>;
472
+ series: z.ZodArray<z.ZodObject<{
473
+ sessions: z.ZodNumber;
474
+ pageviews: z.ZodNumber;
475
+ newVisitors: z.ZodNumber;
476
+ returningVisitors: z.ZodNumber;
477
+ bounceRate: z.ZodNumber;
478
+ date: z.ZodString;
479
+ }, z.core.$strip>>;
480
+ }, z.core.$strip>;
481
+ type TrafficOverviewData = z.infer<typeof zTrafficOverviewData>;
482
+ declare const zTrafficOverviewResponse: z.ZodObject<{
483
+ data: z.ZodObject<{
484
+ granularity: z.ZodEnum<{
485
+ month: "month";
486
+ day: "day";
487
+ hour: "hour";
488
+ week: "week";
489
+ }>;
490
+ timezone: z.ZodString;
491
+ totals: z.ZodObject<{
492
+ sessions: z.ZodNumber;
493
+ pageviews: z.ZodNumber;
494
+ newVisitors: z.ZodNumber;
495
+ returningVisitors: z.ZodNumber;
496
+ bounceRate: z.ZodNumber;
497
+ }, z.core.$strip>;
498
+ series: z.ZodArray<z.ZodObject<{
499
+ sessions: z.ZodNumber;
500
+ pageviews: z.ZodNumber;
501
+ newVisitors: z.ZodNumber;
502
+ returningVisitors: z.ZodNumber;
503
+ bounceRate: z.ZodNumber;
504
+ date: z.ZodString;
505
+ }, z.core.$strip>>;
506
+ }, z.core.$strip>;
507
+ meta: z.ZodObject<{
508
+ projectId: z.ZodString;
509
+ computedAt: z.ZodString;
510
+ cacheAgeSeconds: z.ZodNumber;
511
+ ingestLagSeconds: z.ZodNullable<z.ZodNumber>;
512
+ ingestLagStatus: z.ZodEnum<{
513
+ unknown: "unknown";
514
+ known: "known";
515
+ }>;
516
+ ingestDeadLetterCount: z.ZodNullable<z.ZodNumber>;
517
+ cached: z.ZodBoolean;
518
+ timezone: z.ZodString;
519
+ source: z.ZodEnum<{
520
+ rollup: "rollup";
521
+ raw: "raw";
522
+ mixed: "mixed";
523
+ }>;
524
+ requestId: z.ZodString;
525
+ }, z.core.$strip>;
526
+ }, z.core.$strip>;
527
+ type TrafficOverviewResponse = z.infer<typeof zTrafficOverviewResponse>;
528
+ declare const zTrafficDimension: z.ZodEnum<{
529
+ channel: "channel";
530
+ referrer: "referrer";
531
+ utm: "utm";
532
+ }>;
533
+ type TrafficDimension = z.infer<typeof zTrafficDimension>;
534
+ declare const zTrafficSourcesInput: z.ZodObject<{
535
+ projectId: z.ZodString;
536
+ startDate: z.ZodString;
537
+ endDate: z.ZodString;
538
+ dimension: z.ZodEnum<{
539
+ channel: "channel";
540
+ referrer: "referrer";
541
+ utm: "utm";
542
+ }>;
543
+ limit: z.ZodDefault<z.ZodNumber>;
544
+ timezone: z.ZodOptional<z.ZodString>;
545
+ }, z.core.$strip>;
546
+ type TrafficSourcesInput = z.input<typeof zTrafficSourcesInput>;
547
+ declare const zTrafficSourceRow: z.ZodObject<{
548
+ sessions: z.ZodNumber;
549
+ pageviews: z.ZodNumber;
550
+ newVisitors: z.ZodNumber;
551
+ returningVisitors: z.ZodNumber;
552
+ bounceRate: z.ZodNumber;
553
+ key: z.ZodString;
554
+ channelType: z.ZodOptional<z.ZodString>;
555
+ referrerName: z.ZodOptional<z.ZodString>;
556
+ referrerType: z.ZodOptional<z.ZodString>;
557
+ utmSource: z.ZodOptional<z.ZodString>;
558
+ utmMedium: z.ZodOptional<z.ZodString>;
559
+ utmCampaign: z.ZodOptional<z.ZodString>;
560
+ }, z.core.$strip>;
561
+ type TrafficSourceRow = z.infer<typeof zTrafficSourceRow>;
562
+ declare const zTrafficSourcesData: z.ZodObject<{
563
+ dimension: z.ZodEnum<{
564
+ channel: "channel";
565
+ referrer: "referrer";
566
+ utm: "utm";
567
+ }>;
568
+ timezone: z.ZodString;
569
+ rows: z.ZodArray<z.ZodObject<{
570
+ sessions: z.ZodNumber;
571
+ pageviews: z.ZodNumber;
572
+ newVisitors: z.ZodNumber;
573
+ returningVisitors: z.ZodNumber;
574
+ bounceRate: z.ZodNumber;
575
+ key: z.ZodString;
576
+ channelType: z.ZodOptional<z.ZodString>;
577
+ referrerName: z.ZodOptional<z.ZodString>;
578
+ referrerType: z.ZodOptional<z.ZodString>;
579
+ utmSource: z.ZodOptional<z.ZodString>;
580
+ utmMedium: z.ZodOptional<z.ZodString>;
581
+ utmCampaign: z.ZodOptional<z.ZodString>;
582
+ }, z.core.$strip>>;
583
+ }, z.core.$strip>;
584
+ type TrafficSourcesData = z.infer<typeof zTrafficSourcesData>;
585
+ declare const zTrafficSourcesResponse: z.ZodObject<{
586
+ data: z.ZodObject<{
587
+ dimension: z.ZodEnum<{
588
+ channel: "channel";
589
+ referrer: "referrer";
590
+ utm: "utm";
591
+ }>;
592
+ timezone: z.ZodString;
593
+ rows: z.ZodArray<z.ZodObject<{
594
+ sessions: z.ZodNumber;
595
+ pageviews: z.ZodNumber;
596
+ newVisitors: z.ZodNumber;
597
+ returningVisitors: z.ZodNumber;
598
+ bounceRate: z.ZodNumber;
599
+ key: z.ZodString;
600
+ channelType: z.ZodOptional<z.ZodString>;
601
+ referrerName: z.ZodOptional<z.ZodString>;
602
+ referrerType: z.ZodOptional<z.ZodString>;
603
+ utmSource: z.ZodOptional<z.ZodString>;
604
+ utmMedium: z.ZodOptional<z.ZodString>;
605
+ utmCampaign: z.ZodOptional<z.ZodString>;
606
+ }, z.core.$strip>>;
607
+ }, z.core.$strip>;
608
+ meta: z.ZodObject<{
609
+ projectId: z.ZodString;
610
+ computedAt: z.ZodString;
611
+ cacheAgeSeconds: z.ZodNumber;
612
+ ingestLagSeconds: z.ZodNullable<z.ZodNumber>;
613
+ ingestLagStatus: z.ZodEnum<{
614
+ unknown: "unknown";
615
+ known: "known";
616
+ }>;
617
+ ingestDeadLetterCount: z.ZodNullable<z.ZodNumber>;
618
+ cached: z.ZodBoolean;
619
+ timezone: z.ZodString;
620
+ source: z.ZodEnum<{
621
+ rollup: "rollup";
622
+ raw: "raw";
623
+ mixed: "mixed";
624
+ }>;
625
+ requestId: z.ZodString;
626
+ }, z.core.$strip>;
627
+ }, z.core.$strip>;
628
+ type TrafficSourcesResponse = z.infer<typeof zTrafficSourcesResponse>;
629
+ declare const QUERY_ERROR_CODES: readonly ["unauthorized", "project_scope_mismatch", "query_scope_missing", "validation_failed", "unsupported_combination", "project_purging", "rate_limited", "query_timeout", "internal_error"];
338
630
  declare const zQueryErrorCode: z.ZodEnum<{
339
- validation_failed: "validation_failed";
340
631
  unauthorized: "unauthorized";
632
+ validation_failed: "validation_failed";
341
633
  rate_limited: "rate_limited";
342
634
  internal_error: "internal_error";
635
+ project_purging: "project_purging";
343
636
  project_scope_mismatch: "project_scope_mismatch";
344
637
  query_scope_missing: "query_scope_missing";
345
638
  unsupported_combination: "unsupported_combination";
@@ -349,10 +642,11 @@ type QueryErrorCode = z.infer<typeof zQueryErrorCode>;
349
642
  declare const zQueryError: z.ZodObject<{
350
643
  status: z.ZodNumber;
351
644
  code: z.ZodEnum<{
352
- validation_failed: "validation_failed";
353
645
  unauthorized: "unauthorized";
646
+ validation_failed: "validation_failed";
354
647
  rate_limited: "rate_limited";
355
648
  internal_error: "internal_error";
649
+ project_purging: "project_purging";
356
650
  project_scope_mismatch: "project_scope_mismatch";
357
651
  query_scope_missing: "query_scope_missing";
358
652
  unsupported_combination: "unsupported_combination";
@@ -369,6 +663,8 @@ declare const QUERY_API_PATHS: {
369
663
  readonly eventsTimeseries: "/api/v1/query/events/timeseries";
370
664
  readonly funnel: "/api/v1/query/funnel";
371
665
  readonly retention: "/api/v1/query/retention";
666
+ readonly trafficOverview: "/api/v1/query/traffic/overview";
667
+ readonly trafficSources: "/api/v1/query/traffic/sources";
372
668
  };
373
669
 
374
- export { type ChannelFilter, type EventsTimeseriesData, type EventsTimeseriesInput, type EventsTimeseriesResponse, type FunnelData, type FunnelInput, type FunnelResponse, type Granularity, QUERY_API_PATHS, QUERY_ERROR_CODES, type QueryError, type QueryErrorCode, type QueryMeta, type RetentionData, type RetentionInput, type RetentionResponse, type TimeseriesBreakdown, type TimeseriesPoint, isValidTimeZone, zChannelFilter, zEventsTimeseriesData, zEventsTimeseriesInput, zEventsTimeseriesResponse, zFunnelData, zFunnelInput, zFunnelResponse, zFunnelStep, zGranularity, zQueryEnvelope, zQueryError, zQueryErrorCode, zQueryMeta, zRetentionCell, zRetentionData, zRetentionInput, zRetentionInterval, zRetentionResponse, zTimeseriesBreakdown, zTimeseriesPoint, zTimezone };
670
+ export { type ChannelFilter, type EventPropertyFilter, type EventsTimeseriesData, type EventsTimeseriesInput, type EventsTimeseriesResponse, type FunnelData, type FunnelInput, type FunnelResponse, type Granularity, QUERY_API_PATHS, QUERY_ERROR_CODES, type QueryError, type QueryErrorCode, type QueryMeta, type QuerySource, type RetentionData, type RetentionInput, type RetentionResponse, type TimeseriesBreakdown, type TimeseriesPoint, type TrafficDimension, type TrafficOverviewData, type TrafficOverviewInput, type TrafficOverviewResponse, type TrafficSourceRow, type TrafficSourcesData, type TrafficSourcesInput, type TrafficSourcesResponse, type TrafficTotals, isValidTimeZone, zBucketStart, zChannelFilter, zEventPropertyFilter, zEventsTimeseriesData, zEventsTimeseriesInput, zEventsTimeseriesResponse, zFunnelData, zFunnelInput, zFunnelResponse, zFunnelStep, zGranularity, zQueryEnvelope, zQueryError, zQueryErrorCode, zQueryMeta, zQuerySource, zRetentionCell, zRetentionData, zRetentionInput, zRetentionInterval, zRetentionResponse, zTimeseriesBreakdown, zTimeseriesPoint, zTimezone, zTrafficDimension, zTrafficOverviewData, zTrafficOverviewInput, zTrafficOverviewResponse, zTrafficSeriesPoint, zTrafficSourceRow, zTrafficSourcesData, zTrafficSourcesInput, zTrafficSourcesResponse, zTrafficTotals };