@domino-sdk/relay 1.54.0 → 1.55.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 (64) hide show
  1. package/CHANGELOG.md +1848 -0
  2. package/dist/analytics-URV-mxjH.d.ts +482 -0
  3. package/dist/{attempt-captures-QC4kTA44.d.ts → attempt-captures-CxxO7DeD.d.ts} +1 -1
  4. package/dist/authoring.d.ts +233 -78
  5. package/dist/authoring.js +112 -14
  6. package/dist/{automatic-outcomes-CVyZHxir.d.ts → automatic-outcomes-DxW_v5Wc.d.ts} +5 -2
  7. package/dist/avatar.d.ts +1 -1
  8. package/dist/browser.d.ts +7 -7
  9. package/dist/browser.js +10 -10
  10. package/dist/{capability-error-FQGGb5xS.d.ts → capability-error-DSd8EMQC.d.ts} +76 -2
  11. package/dist/{chunk-53JMTUWG.js → chunk-56DBFNR2.js} +1 -1
  12. package/dist/chunk-C7QZ4UBB.js +937 -0
  13. package/dist/chunk-F6HECAXA.js +661 -0
  14. package/dist/{chunk-JL7J3EQQ.js → chunk-GL43VQ5D.js} +16 -16
  15. package/dist/{chunk-GTQJSDBS.js → chunk-IUF7DW76.js} +27 -16
  16. package/dist/{chunk-QIDQWXSF.js → chunk-IZRITLVV.js} +2 -2
  17. package/dist/{chunk-S2PMKZSX.js → chunk-SABMNPF2.js} +21 -2
  18. package/dist/{chunk-XFAYQFRO.js → chunk-TLK2MD4S.js} +1 -1
  19. package/dist/{chunk-ZJ3FVZRP.js → chunk-UY6KMLQG.js} +10 -3
  20. package/dist/{chunk-RP4LLEON.js → chunk-VFBQVY4X.js} +1 -1
  21. package/dist/{chunk-YVC3B72P.js → chunk-WHG5WE43.js} +1 -1
  22. package/dist/chunk-WHMXXHPX.js +344 -0
  23. package/dist/{chunk-TL5TL5RD.js → chunk-WUEQOKJH.js} +4 -4
  24. package/dist/{chunk-7BNCLWAO.js → chunk-XALIFNMD.js} +1 -1
  25. package/dist/{chunk-IELNFM3V.js → chunk-YCOKTQ4E.js} +96 -7
  26. package/dist/{chunk-LPHXTZDA.js → chunk-YE3XYB2F.js} +2 -2
  27. package/dist/{chunk-K6TVMNU4.js → chunk-YEVD4A5X.js} +1 -1
  28. package/dist/{client-CzNtl8UO.d.ts → client-C4zUZKpj.d.ts} +35 -7
  29. package/dist/{deployments-ovtqtAcx.d.ts → deployments-B32QS1CI.d.ts} +1060 -233
  30. package/dist/{groups-B5R1RCsl.d.ts → groups-O6onGPmC.d.ts} +131 -137
  31. package/dist/index.d.ts +8 -8
  32. package/dist/index.js +9 -9
  33. package/dist/integrations-C6_uUh-s.d.ts +584 -0
  34. package/dist/internal.d.ts +11 -10
  35. package/dist/internal.js +8 -8
  36. package/dist/{offers-CH1RZekg.d.ts → offers-BMDNcvwB.d.ts} +2 -2
  37. package/dist/{pages-BTlOg8sl.d.ts → pages-BFloMpyQ.d.ts} +25 -1
  38. package/dist/portal-proxy.d.ts +11 -1
  39. package/dist/portal-proxy.js +26 -5
  40. package/dist/{profiles-Cdv4BSd_.d.ts → profiles-BoOK03cR.d.ts} +2 -0
  41. package/dist/react/index.d.ts +488 -13
  42. package/dist/react/index.js +50 -15
  43. package/dist/runtime/authoring.js +1 -1
  44. package/dist/runtime/chunks/WKATKZXE.js +1 -0
  45. package/dist/runtime/manifest.json +3 -3
  46. package/dist/runtime/schema.js +1 -1
  47. package/dist/{schema-BJ9bOgpN.d.ts → schema-C4m9RhCR.d.ts} +166 -6
  48. package/dist/schema.d.ts +392 -334
  49. package/dist/schema.js +84 -40
  50. package/dist/server/index.d.ts +11 -10
  51. package/dist/server/index.js +1109 -854
  52. package/dist/{submission-input-BNah53go.d.ts → submission-input-BbdawqVy.d.ts} +2 -2
  53. package/dist/{telegram-browser-C36j_6v-.d.ts → telegram-browser-CwaxROAZ.d.ts} +1 -1
  54. package/dist/testing.d.ts +85 -12
  55. package/dist/testing.js +322 -37
  56. package/dist/{transport-C8BlCzmF.d.ts → transport-CZJOW5Sr.d.ts} +7648 -3529
  57. package/dist/vite.d.ts +54 -1
  58. package/dist/vite.js +35 -0
  59. package/dist/{x-BfQcsDp0.d.ts → x-1czZFVUW.d.ts} +1 -1
  60. package/package.json +3 -2
  61. package/dist/chunk-2NUD237O.js +0 -102
  62. package/dist/chunk-CCE2JWES.js +0 -1083
  63. package/dist/integrations-CllF-kWg.d.ts +0 -314
  64. package/dist/runtime/chunks/AVRVSLHX.js +0 -1
@@ -0,0 +1,482 @@
1
+ import * as z from 'zod';
2
+
3
+ /**
4
+ * The ranges `analytics.read` covers. Each ends now: `7d`, `30d` and `90d` are that many project
5
+ * calendar days, today included, and `all` starts on the day of the project's earliest dated record:
6
+ * its first membership, or an older record such as a completion imported with its original date.
7
+ */
8
+ declare const analyticsRanges: readonly ["7d", "30d", "90d", "all"];
9
+ type AnalyticsRange = (typeof analyticsRanges)[number];
10
+ /** What `analytics.read` reads: one range and, for the points section, one point ledger. */
11
+ declare const analyticsQuerySchema: z.ZodObject<{
12
+ range: z.ZodEnum<{
13
+ "7d": "7d";
14
+ "30d": "30d";
15
+ "90d": "90d";
16
+ all: "all";
17
+ }>;
18
+ ledger: z.ZodOptional<z.ZodString>;
19
+ }, z.core.$strict>;
20
+ /** @compat input */
21
+ type AnalyticsQuery = z.input<typeof analyticsQuerySchema>;
22
+ /**
23
+ * A project's activity in one environment over one range, bucketed by project-calendar day (`7d`,
24
+ * `30d`) or week (`90d`, `all`, weeks from Monday, the first and last clipped to the range). Every
25
+ * metric counts what Relay's records say now: a completion revoked later, or a redemption
26
+ * canceled later, leaves the bucket it was in.
27
+ */
28
+ declare const analyticsReadSchema: z.ZodObject<{
29
+ range: z.ZodObject<{
30
+ key: z.ZodEnum<{
31
+ "7d": "7d";
32
+ "30d": "30d";
33
+ "90d": "90d";
34
+ all: "all";
35
+ }>;
36
+ from: z.ZodISODateTime;
37
+ to: z.ZodISODateTime;
38
+ bucket: z.ZodEnum<{
39
+ day: "day";
40
+ week: "week";
41
+ }>;
42
+ timeZone: z.ZodString;
43
+ buckets: z.ZodArray<z.ZodObject<{
44
+ key: z.ZodString;
45
+ start: z.ZodISODateTime;
46
+ end: z.ZodISODateTime;
47
+ }, z.core.$strip>>;
48
+ }, z.core.$strip>;
49
+ previous: z.ZodOptional<z.ZodObject<{
50
+ from: z.ZodISODateTime;
51
+ to: z.ZodISODateTime;
52
+ }, z.core.$strip>>;
53
+ members: z.ZodObject<{
54
+ signUps: z.ZodObject<{
55
+ total: z.ZodNumber;
56
+ previousTotal: z.ZodOptional<z.ZodNumber>;
57
+ series: z.ZodArray<z.ZodNumber>;
58
+ }, z.core.$strip>;
59
+ active: z.ZodObject<{
60
+ total: z.ZodNumber;
61
+ previousTotal: z.ZodOptional<z.ZodNumber>;
62
+ series: z.ZodArray<z.ZodNumber>;
63
+ }, z.core.$strip>;
64
+ }, z.core.$strip>;
65
+ quests: z.ZodObject<{
66
+ attempts: z.ZodObject<{
67
+ total: z.ZodNumber;
68
+ previousTotal: z.ZodOptional<z.ZodNumber>;
69
+ series: z.ZodArray<z.ZodNumber>;
70
+ }, z.core.$strip>;
71
+ completions: z.ZodObject<{
72
+ total: z.ZodNumber;
73
+ previousTotal: z.ZodOptional<z.ZodNumber>;
74
+ series: z.ZodArray<z.ZodNumber>;
75
+ }, z.core.$strip>;
76
+ rejections: z.ZodObject<{
77
+ total: z.ZodNumber;
78
+ previousTotal: z.ZodOptional<z.ZodNumber>;
79
+ series: z.ZodArray<z.ZodNumber>;
80
+ }, z.core.$strip>;
81
+ needsReview: z.ZodObject<{
82
+ total: z.ZodNumber;
83
+ previousTotal: z.ZodOptional<z.ZodNumber>;
84
+ series: z.ZodArray<z.ZodNumber>;
85
+ }, z.core.$strip>;
86
+ byQuest: z.ZodArray<z.ZodObject<{
87
+ quest: z.ZodString;
88
+ title: z.ZodString;
89
+ attempts: z.ZodNumber;
90
+ completions: z.ZodNumber;
91
+ decided: z.ZodNumber;
92
+ rejected: z.ZodNumber;
93
+ needsReview: z.ZodNumber;
94
+ rejectionRate: z.ZodNullable<z.ZodNumber>;
95
+ topReasons: z.ZodArray<z.ZodObject<{
96
+ reason: z.ZodString;
97
+ code: z.ZodNullable<z.ZodString>;
98
+ count: z.ZodNumber;
99
+ }, z.core.$strip>>;
100
+ rejectionsBySource: z.ZodObject<{
101
+ evaluator: z.ZodNumber;
102
+ staff: z.ZodNumber;
103
+ budget: z.ZodNumber;
104
+ expired: z.ZodNumber;
105
+ }, z.core.$strip>;
106
+ series: z.ZodObject<{
107
+ attempts: z.ZodArray<z.ZodNumber>;
108
+ completions: z.ZodArray<z.ZodNumber>;
109
+ }, z.core.$strip>;
110
+ }, z.core.$strip>>;
111
+ }, z.core.$strip>;
112
+ points: z.ZodObject<{
113
+ ledgers: z.ZodArray<z.ZodObject<{
114
+ key: z.ZodString;
115
+ name: z.ZodString;
116
+ archived: z.ZodBoolean;
117
+ }, z.core.$strip>>;
118
+ ledger: z.ZodNullable<z.ZodString>;
119
+ hasSpending: z.ZodBoolean;
120
+ awarded: z.ZodObject<{
121
+ total: z.ZodNumber;
122
+ previousTotal: z.ZodOptional<z.ZodNumber>;
123
+ series: z.ZodArray<z.ZodNumber>;
124
+ }, z.core.$strip>;
125
+ spent: z.ZodOptional<z.ZodObject<{
126
+ total: z.ZodNumber;
127
+ previousTotal: z.ZodOptional<z.ZodNumber>;
128
+ series: z.ZodArray<z.ZodNumber>;
129
+ }, z.core.$strip>>;
130
+ net: z.ZodOptional<z.ZodObject<{
131
+ total: z.ZodNumber;
132
+ previousTotal: z.ZodOptional<z.ZodNumber>;
133
+ series: z.ZodArray<z.ZodNumber>;
134
+ }, z.core.$strip>>;
135
+ membersEarning: z.ZodObject<{
136
+ total: z.ZodNumber;
137
+ previousTotal: z.ZodOptional<z.ZodNumber>;
138
+ series: z.ZodArray<z.ZodNumber>;
139
+ }, z.core.$strip>;
140
+ }, z.core.$strip>;
141
+ offers: z.ZodOptional<z.ZodObject<{
142
+ redemptions: z.ZodObject<{
143
+ total: z.ZodNumber;
144
+ previousTotal: z.ZodOptional<z.ZodNumber>;
145
+ series: z.ZodArray<z.ZodNumber>;
146
+ }, z.core.$strip>;
147
+ byOffer: z.ZodArray<z.ZodObject<{
148
+ offer: z.ZodString;
149
+ title: z.ZodString;
150
+ redemptions: z.ZodNumber;
151
+ series: z.ZodArray<z.ZodNumber>;
152
+ }, z.core.$strip>>;
153
+ }, z.core.$strip>>;
154
+ referrals: z.ZodOptional<z.ZodObject<{
155
+ accepted: z.ZodObject<{
156
+ total: z.ZodNumber;
157
+ previousTotal: z.ZodOptional<z.ZodNumber>;
158
+ series: z.ZodArray<z.ZodNumber>;
159
+ }, z.core.$strip>;
160
+ qualified: z.ZodObject<{
161
+ total: z.ZodNumber;
162
+ previousTotal: z.ZodOptional<z.ZodNumber>;
163
+ series: z.ZodArray<z.ZodNumber>;
164
+ }, z.core.$strip>;
165
+ acceptedQualified: z.ZodObject<{
166
+ total: z.ZodNumber;
167
+ previousTotal: z.ZodOptional<z.ZodNumber>;
168
+ }, z.core.$strip>;
169
+ }, z.core.$strip>>;
170
+ testEnvironment: z.ZodOptional<z.ZodObject<{
171
+ lastResetAt: z.ZodNullable<z.ZodISODateTime>;
172
+ shiftedClockMembers: z.ZodNumber;
173
+ }, z.core.$strip>>;
174
+ }, z.core.$strip>;
175
+ type AnalyticsRead = z.infer<typeof analyticsReadSchema>;
176
+ /** One metric over the range: `{ total, previousTotal?, series }`. */
177
+ type AnalyticsMetric = AnalyticsRead["members"]["signUps"];
178
+ /** One quest's activity over the range. */
179
+ type AnalyticsQuest = AnalyticsRead["quests"]["byQuest"][number];
180
+ /**
181
+ * How a breakdown splits a metric: by quest, offer, referral program, group, tracker or
182
+ * leaderboard; for rejections by `source` (evaluator, staff, budget, expired) or `reason` (the
183
+ * rejection code, else the exact text); for tracker outcomes by `outcome` (admitted or skipped).
184
+ */
185
+ declare const analyticsBreakdowns: readonly ["quest", "source", "reason", "offer", "program", "group", "tracker", "outcome", "leaderboard"];
186
+ type AnalyticsBreakdown = (typeof analyticsBreakdowns)[number];
187
+ /**
188
+ * What a filter narrows to: quests, offers, referral programs or leaderboards by key or ID, the
189
+ * quests a tracker triggers (on `trackers.records`, that tracker's outcomes), or the members
190
+ * currently in a group (on `groups.joins` and `groups.leaves`, the changes in that group).
191
+ */
192
+ declare const analyticsFilters: readonly ["quest", "tracker", "group", "offer", "program", "leaderboard"];
193
+ type AnalyticsFilter = (typeof analyticsFilters)[number];
194
+ /** How a panel can draw a metric. `bar` stacks a breakdown's rows. */
195
+ declare const analyticsCharts: readonly ["number", "line", "bar", "table"];
196
+ type AnalyticsChart = (typeof analyticsCharts)[number];
197
+ /**
198
+ * How a metric's total relates to its buckets: `count` sums them, `distinct` counts each member
199
+ * once over the range, and `rate` divides a numerator by a denominator, empty (`null`) below
200
+ * `minimumDenominator`.
201
+ */
202
+ type AnalyticsMetricKind = "count" | "distinct" | "rate";
203
+ /** One metric of the catalog: what it counts, how it can be split and narrowed, and drawn. */
204
+ type AnalyticsCatalogEntry = {
205
+ readonly definition: string;
206
+ readonly kind: AnalyticsMetricKind;
207
+ readonly breakdowns: readonly AnalyticsBreakdown[];
208
+ readonly filters: readonly AnalyticsFilter[];
209
+ readonly charts: readonly AnalyticsChart[];
210
+ /** Points metrics read one point ledger, which every query of them names. */
211
+ readonly ledger: boolean;
212
+ readonly minimumDenominator?: number;
213
+ };
214
+ /**
215
+ * Relay's closed metric catalog (docs/adr/0021-closed-metric-catalog.md). `analytics.query` reads
216
+ * one of these by ID, and `analytics.catalog` lists them; there is no other analytics query.
217
+ */
218
+ declare const analyticsCatalog: {
219
+ readonly "members.signUps": {
220
+ readonly definition: "Members who joined the project, by when they joined.";
221
+ readonly kind: "count";
222
+ readonly breakdowns: readonly [];
223
+ readonly filters: readonly ["group"];
224
+ readonly charts: readonly ["number", "line", "bar", "table"];
225
+ readonly ledger: false;
226
+ };
227
+ readonly "members.active": {
228
+ readonly definition: "Distinct members with an attempt, by when it was created; the total counts each member once.";
229
+ readonly kind: "distinct";
230
+ readonly breakdowns: readonly [];
231
+ readonly filters: readonly ["group"];
232
+ readonly charts: readonly ["number", "line", "bar", "table"];
233
+ readonly ledger: false;
234
+ };
235
+ readonly "quests.attempts": {
236
+ readonly definition: "Attempts, by when they were created.";
237
+ readonly kind: "count";
238
+ readonly breakdowns: readonly ["quest"];
239
+ readonly filters: readonly ["quest", "group", "tracker"];
240
+ readonly charts: readonly ["number", "line", "bar", "table"];
241
+ readonly ledger: false;
242
+ };
243
+ readonly "quests.completions": {
244
+ readonly definition: "Quest completions never revoked, by when they completed.";
245
+ readonly kind: "count";
246
+ readonly breakdowns: readonly ["quest"];
247
+ readonly filters: readonly ["quest", "group", "tracker"];
248
+ readonly charts: readonly ["number", "line", "bar", "table"];
249
+ readonly ledger: false;
250
+ };
251
+ readonly "quests.needsReview": {
252
+ readonly definition: "Attempts the evaluator sent to staff review, by when they were created, whatever staff decided later.";
253
+ readonly kind: "count";
254
+ readonly breakdowns: readonly ["quest"];
255
+ readonly filters: readonly ["quest", "group", "tracker"];
256
+ readonly charts: readonly ["number", "line", "bar", "table"];
257
+ readonly ledger: false;
258
+ };
259
+ readonly "quests.rejections": {
260
+ readonly definition: "Rejected attempts, by when they were decided.";
261
+ readonly kind: "count";
262
+ readonly breakdowns: readonly ["quest", "source", "reason"];
263
+ readonly filters: readonly ["quest", "group", "tracker"];
264
+ readonly charts: readonly ["number", "line", "bar", "table"];
265
+ readonly ledger: false;
266
+ };
267
+ readonly "quests.rejectionRate": {
268
+ readonly definition: "Rejected attempts divided by decided attempts (accepted, progressed or rejected), by when they were decided; empty below 10 decided.";
269
+ readonly kind: "rate";
270
+ readonly breakdowns: readonly ["quest"];
271
+ readonly filters: readonly ["quest", "group", "tracker"];
272
+ readonly charts: readonly ["number", "line", "table"];
273
+ readonly ledger: false;
274
+ readonly minimumDenominator: 10;
275
+ };
276
+ readonly "points.awarded": {
277
+ readonly definition: "Points in the ledger's award entries, by effective date.";
278
+ readonly kind: "count";
279
+ readonly breakdowns: readonly [];
280
+ readonly filters: readonly ["group"];
281
+ readonly charts: readonly ["number", "line", "bar", "table"];
282
+ readonly ledger: true;
283
+ };
284
+ readonly "points.spent": {
285
+ readonly definition: "Points in the ledger's spend entries, as a positive number, by effective date.";
286
+ readonly kind: "count";
287
+ readonly breakdowns: readonly [];
288
+ readonly filters: readonly ["group"];
289
+ readonly charts: readonly ["number", "line", "bar", "table"];
290
+ readonly ledger: true;
291
+ };
292
+ readonly "points.net": {
293
+ readonly definition: "Every entry's signed amount in the ledger, by effective date; a reversal takes its original entry's date.";
294
+ readonly kind: "count";
295
+ readonly breakdowns: readonly [];
296
+ readonly filters: readonly ["group"];
297
+ readonly charts: readonly ["number", "line", "bar", "table"];
298
+ readonly ledger: true;
299
+ };
300
+ readonly "points.membersEarning": {
301
+ readonly definition: "Distinct members awarded more than 0 points in the ledger, by effective date; the total counts each member once.";
302
+ readonly kind: "distinct";
303
+ readonly breakdowns: readonly [];
304
+ readonly filters: readonly ["group"];
305
+ readonly charts: readonly ["number", "line", "bar", "table"];
306
+ readonly ledger: true;
307
+ };
308
+ readonly "offers.redemptions": {
309
+ readonly definition: "Fulfilled offer redemptions, by when they were redeemed.";
310
+ readonly kind: "count";
311
+ readonly breakdowns: readonly ["offer"];
312
+ readonly filters: readonly ["offer", "group"];
313
+ readonly charts: readonly ["number", "line", "bar", "table"];
314
+ readonly ledger: false;
315
+ };
316
+ readonly "referrals.accepted": {
317
+ readonly definition: "Accepted referrals, by when they were accepted. A referral belongs to no program, so it takes no program breakdown or filter.";
318
+ readonly kind: "count";
319
+ readonly breakdowns: readonly [];
320
+ readonly filters: readonly [];
321
+ readonly charts: readonly ["number", "line", "bar", "table"];
322
+ readonly ledger: false;
323
+ };
324
+ readonly "referrals.qualified": {
325
+ readonly definition: "Active referral qualifications, one per program and friend, by when they first qualified; suspended referrals count.";
326
+ readonly kind: "count";
327
+ readonly breakdowns: readonly ["program"];
328
+ readonly filters: readonly ["program"];
329
+ readonly charts: readonly ["number", "line", "bar", "table"];
330
+ readonly ledger: false;
331
+ };
332
+ readonly "referrals.qualificationRate": {
333
+ readonly definition: "Of the referrals accepted in a bucket, the share whose friend has an active qualification now (in the program, for a program row or filter), by acceptance; empty below 10 accepted.";
334
+ readonly kind: "rate";
335
+ readonly breakdowns: readonly ["program"];
336
+ readonly filters: readonly ["program"];
337
+ readonly charts: readonly ["number", "line", "table"];
338
+ readonly ledger: false;
339
+ readonly minimumDenominator: 10;
340
+ };
341
+ readonly "groups.joins": {
342
+ readonly definition: "Members added to a group, by when they were added. A change that left membership as it was, and a membership recorded without a date, don't count. The group filter keeps changes in those groups.";
343
+ readonly kind: "count";
344
+ readonly breakdowns: readonly ["group"];
345
+ readonly filters: readonly ["group"];
346
+ readonly charts: readonly ["number", "line", "bar", "table"];
347
+ readonly ledger: false;
348
+ };
349
+ readonly "groups.leaves": {
350
+ readonly definition: "Members removed from a group, by when they were removed. A change that left membership as it was, and a membership recorded without a date, don't count. The group filter keeps changes in those groups.";
351
+ readonly kind: "count";
352
+ readonly breakdowns: readonly ["group"];
353
+ readonly filters: readonly ["group"];
354
+ readonly charts: readonly ["number", "line", "bar", "table"];
355
+ readonly ledger: false;
356
+ };
357
+ readonly "trackers.records": {
358
+ readonly definition: "Tracker trigger outcomes, one per quest and record observation, by when the record was observed, counted by their current outcome (admitted or skipped). A retry overwrites an outcome, so a bucket shows today's outcome of its records, not the outcome they had then.";
359
+ readonly kind: "count";
360
+ readonly breakdowns: readonly ["outcome", "tracker"];
361
+ readonly filters: readonly ["tracker"];
362
+ readonly charts: readonly ["number", "line", "bar", "table"];
363
+ readonly ledger: false;
364
+ };
365
+ readonly "leaderboards.settledParticipants": {
366
+ readonly definition: "Participants in leaderboard settlements, one per member and settlement, by the settlement's cutoff. Pending and approved settlements count; a rejected settlement leaves its bucket.";
367
+ readonly kind: "count";
368
+ readonly breakdowns: readonly ["leaderboard"];
369
+ readonly filters: readonly ["leaderboard"];
370
+ readonly charts: readonly ["number", "bar", "table"];
371
+ readonly ledger: false;
372
+ };
373
+ };
374
+ type AnalyticsMetricId = keyof typeof analyticsCatalog;
375
+ declare const analyticsMetricIds: AnalyticsMetricId[];
376
+ /** `analytics.catalog`: every metric with its definition, breakdowns, filters and charts. */
377
+ declare const analyticsCatalogSchema: z.ZodObject<{
378
+ metrics: z.ZodArray<z.ZodObject<{
379
+ id: z.ZodString;
380
+ definition: z.ZodString;
381
+ kind: z.ZodEnum<{
382
+ count: "count";
383
+ distinct: "distinct";
384
+ rate: "rate";
385
+ }>;
386
+ breakdowns: z.ZodArray<z.ZodString>;
387
+ filters: z.ZodArray<z.ZodString>;
388
+ charts: z.ZodArray<z.ZodString>;
389
+ ledger: z.ZodBoolean;
390
+ minimumDenominator: z.ZodOptional<z.ZodNumber>;
391
+ }, z.core.$strip>>;
392
+ }, z.core.$strip>;
393
+ type AnalyticsCatalog = z.infer<typeof analyticsCatalogSchema>;
394
+ /** A breakdown or query returns up to this many rows; the rest are summed into `other`. */
395
+ declare const analyticsQueryLimit = 100;
396
+ /**
397
+ * What `analytics.query` reads on the wire. The metric, breakdown and filter names are checked by
398
+ * Relay against the catalog, which answers a coded 422, so the schema takes any name here; the
399
+ * typed input is `AnalyticsMetricQuery`.
400
+ */
401
+ declare const analyticsMetricQuerySchema: z.ZodObject<{
402
+ metric: z.ZodString;
403
+ range: z.ZodEnum<{
404
+ "7d": "7d";
405
+ "30d": "30d";
406
+ "90d": "90d";
407
+ all: "all";
408
+ }>;
409
+ breakdown: z.ZodOptional<z.ZodString>;
410
+ filter: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
411
+ ledger: z.ZodOptional<z.ZodString>;
412
+ limit: z.ZodOptional<z.ZodNumber>;
413
+ }, z.core.$strict>;
414
+ /** One metric over a range, at most one breakdown, filters, and for points metrics the ledger. */
415
+ type AnalyticsMetricQuery = {
416
+ metric: AnalyticsMetricId;
417
+ range: AnalyticsRange;
418
+ breakdown?: AnalyticsBreakdown;
419
+ filter?: Partial<Record<AnalyticsFilter, string | readonly string[]>>;
420
+ ledger?: string;
421
+ limit?: number;
422
+ };
423
+ /** `analytics.query`: one metric over the range, and its breakdown rows when it is broken down. */
424
+ declare const analyticsMetricResultSchema: z.ZodObject<{
425
+ metric: z.ZodString;
426
+ kind: z.ZodEnum<{
427
+ count: "count";
428
+ distinct: "distinct";
429
+ rate: "rate";
430
+ }>;
431
+ range: z.ZodObject<{
432
+ key: z.ZodEnum<{
433
+ "7d": "7d";
434
+ "30d": "30d";
435
+ "90d": "90d";
436
+ all: "all";
437
+ }>;
438
+ from: z.ZodISODateTime;
439
+ to: z.ZodISODateTime;
440
+ bucket: z.ZodEnum<{
441
+ day: "day";
442
+ week: "week";
443
+ }>;
444
+ timeZone: z.ZodString;
445
+ buckets: z.ZodArray<z.ZodObject<{
446
+ key: z.ZodString;
447
+ start: z.ZodISODateTime;
448
+ end: z.ZodISODateTime;
449
+ }, z.core.$strip>>;
450
+ }, z.core.$strip>;
451
+ previous: z.ZodOptional<z.ZodObject<{
452
+ from: z.ZodISODateTime;
453
+ to: z.ZodISODateTime;
454
+ }, z.core.$strip>>;
455
+ ledger: z.ZodOptional<z.ZodString>;
456
+ value: z.ZodObject<{
457
+ total: z.ZodNullable<z.ZodNumber>;
458
+ previousTotal: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
459
+ series: z.ZodArray<z.ZodNullable<z.ZodNumber>>;
460
+ }, z.core.$strip>;
461
+ breakdown: z.ZodOptional<z.ZodObject<{
462
+ dimension: z.ZodString;
463
+ rows: z.ZodArray<z.ZodObject<{
464
+ total: z.ZodNullable<z.ZodNumber>;
465
+ previousTotal: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
466
+ series: z.ZodArray<z.ZodNullable<z.ZodNumber>>;
467
+ key: z.ZodString;
468
+ title: z.ZodString;
469
+ archived: z.ZodBoolean;
470
+ }, z.core.$strip>>;
471
+ other: z.ZodOptional<z.ZodObject<{
472
+ total: z.ZodNullable<z.ZodNumber>;
473
+ previousTotal: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
474
+ series: z.ZodArray<z.ZodNullable<z.ZodNumber>>;
475
+ rows: z.ZodNumber;
476
+ }, z.core.$strip>>;
477
+ }, z.core.$strip>>;
478
+ }, z.core.$strip>;
479
+ type AnalyticsMetricResult = z.infer<typeof analyticsMetricResultSchema>;
480
+ type AnalyticsBreakdownRow = NonNullable<AnalyticsMetricResult["breakdown"]>["rows"][number];
481
+
482
+ export { type AnalyticsMetricId as A, analyticsCatalog as a, type AnalyticsQuery as b, type AnalyticsRead as c, type AnalyticsCatalog as d, type AnalyticsMetricQuery as e, type AnalyticsMetricResult as f, type AnalyticsBreakdown as g, type AnalyticsBreakdownRow as h, type AnalyticsCatalogEntry as i, type AnalyticsChart as j, type AnalyticsFilter as k, type AnalyticsMetric as l, type AnalyticsMetricKind as m, type AnalyticsQuest as n, type AnalyticsRange as o, analyticsBreakdowns as p, analyticsCatalogSchema as q, analyticsCharts as r, analyticsFilters as s, analyticsMetricIds as t, analyticsMetricQuerySchema as u, analyticsMetricResultSchema as v, analyticsQueryLimit as w, analyticsQuerySchema as x, analyticsRanges as y, analyticsReadSchema as z };
@@ -1,4 +1,4 @@
1
- import { O as OpenIdentityKind } from './schema-BJ9bOgpN.js';
1
+ import { O as OpenIdentityKind } from './schema-C4m9RhCR.js';
2
2
  import * as z from 'zod';
3
3
 
4
4
  /** One capability call of the captured evaluation run, as Relay stored it. */