@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,584 @@
1
+ import * as z from 'zod';
2
+ import { k as WalletBalanceQuery } from './wallet-Ac7OFpOr.js';
3
+ import { C as ResourceHandle } from './schema-C4m9RhCR.js';
4
+ import { A as AnalyticsMetricId, a as analyticsCatalog } from './analytics-URV-mxjH.js';
5
+
6
+ declare const resourceSourceSchema: z.ZodUnion<readonly [z.ZodObject<{
7
+ provider: z.ZodLiteral<"domino">;
8
+ resource: z.ZodLiteral<"point-ledger">;
9
+ }, z.core.$strict>, z.ZodUnion<readonly [z.ZodObject<{
10
+ provider: z.ZodLiteral<"discord">;
11
+ resource: z.ZodLiteral<"channel">;
12
+ types: z.ZodArray<z.ZodEnum<{
13
+ text: "text";
14
+ announcement: "announcement";
15
+ }>>;
16
+ }, z.core.$strict>, z.ZodObject<{
17
+ provider: z.ZodLiteral<"discord">;
18
+ resource: z.ZodLiteral<"role">;
19
+ assignable: z.ZodDefault<z.ZodBoolean>;
20
+ }, z.core.$strict>]>]>;
21
+ type ResourceSource = z.infer<typeof resourceSourceSchema>;
22
+ declare const resourceRequestSchema: z.ZodObject<{
23
+ source: z.ZodUnion<readonly [z.ZodObject<{
24
+ provider: z.ZodLiteral<"domino">;
25
+ resource: z.ZodLiteral<"point-ledger">;
26
+ }, z.core.$strict>, z.ZodUnion<readonly [z.ZodObject<{
27
+ provider: z.ZodLiteral<"discord">;
28
+ resource: z.ZodLiteral<"channel">;
29
+ types: z.ZodArray<z.ZodEnum<{
30
+ text: "text";
31
+ announcement: "announcement";
32
+ }>>;
33
+ }, z.core.$strict>, z.ZodObject<{
34
+ provider: z.ZodLiteral<"discord">;
35
+ resource: z.ZodLiteral<"role">;
36
+ assignable: z.ZodDefault<z.ZodBoolean>;
37
+ }, z.core.$strict>]>]>;
38
+ query: z.ZodOptional<z.ZodString>;
39
+ cursor: z.ZodOptional<z.ZodString>;
40
+ ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
41
+ }, z.core.$strict>;
42
+ declare const resourceOptionsSchema: z.ZodObject<{
43
+ revision: z.ZodNumber;
44
+ options: z.ZodArray<z.ZodObject<{
45
+ id: z.ZodString;
46
+ label: z.ZodString;
47
+ description: z.ZodOptional<z.ZodString>;
48
+ group: z.ZodOptional<z.ZodString>;
49
+ disabledReason: z.ZodOptional<z.ZodString>;
50
+ }, z.core.$strip>>;
51
+ nextCursor: z.ZodDefault<z.ZodNullable<z.ZodString>>;
52
+ cursor: z.ZodNullable<z.ZodString>;
53
+ }, z.core.$strip>;
54
+ type ResourceOption = z.infer<typeof resourceOptionsSchema>["options"][number];
55
+
56
+ declare const settingFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
57
+ kind: z.ZodLiteral<"point-ledger">;
58
+ default: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>;
59
+ label: z.ZodString;
60
+ description: z.ZodOptional<z.ZodString>;
61
+ }, z.core.$strict>, z.ZodObject<{
62
+ kind: z.ZodLiteral<"datetime">;
63
+ default: z.ZodPipe<z.ZodISODateTime, z.ZodTransform<string, string>>;
64
+ label: z.ZodString;
65
+ description: z.ZodOptional<z.ZodString>;
66
+ }, z.core.$strict>, z.ZodObject<{
67
+ kind: z.ZodLiteral<"resource">;
68
+ default: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>;
69
+ source: z.ZodUnion<readonly [z.ZodObject<{
70
+ provider: z.ZodLiteral<"domino">;
71
+ resource: z.ZodLiteral<"point-ledger">;
72
+ }, z.core.$strict>, z.ZodUnion<readonly [z.ZodObject<{
73
+ provider: z.ZodLiteral<"discord">;
74
+ resource: z.ZodLiteral<"channel">;
75
+ types: z.ZodArray<z.ZodEnum<{
76
+ text: "text";
77
+ announcement: "announcement";
78
+ }>>;
79
+ }, z.core.$strict>, z.ZodObject<{
80
+ provider: z.ZodLiteral<"discord">;
81
+ resource: z.ZodLiteral<"role">;
82
+ assignable: z.ZodDefault<z.ZodBoolean>;
83
+ }, z.core.$strict>]>]>;
84
+ label: z.ZodString;
85
+ description: z.ZodOptional<z.ZodString>;
86
+ }, z.core.$strict>, z.ZodObject<{
87
+ kind: z.ZodLiteral<"quiz">;
88
+ default: z.ZodArray<z.ZodObject<{
89
+ id: z.ZodString;
90
+ prompt: z.ZodString;
91
+ choices: z.ZodArray<z.ZodObject<{
92
+ id: z.ZodString;
93
+ label: z.ZodString;
94
+ }, z.core.$strict>>;
95
+ correct: z.ZodString;
96
+ }, z.core.$strict>>;
97
+ label: z.ZodString;
98
+ description: z.ZodOptional<z.ZodString>;
99
+ }, z.core.$strict>, z.ZodObject<{
100
+ kind: z.ZodLiteral<"text">;
101
+ default: z.ZodString;
102
+ minLength: z.ZodNumber;
103
+ maxLength: z.ZodNumber;
104
+ multiline: z.ZodBoolean;
105
+ picker: z.ZodOptional<z.ZodString>;
106
+ decimals: z.ZodOptional<z.ZodNumber>;
107
+ label: z.ZodString;
108
+ description: z.ZodOptional<z.ZodString>;
109
+ }, z.core.$strict>, z.ZodObject<{
110
+ kind: z.ZodLiteral<"integer">;
111
+ default: z.ZodNumber;
112
+ min: z.ZodNumber;
113
+ max: z.ZodNumber;
114
+ label: z.ZodString;
115
+ description: z.ZodOptional<z.ZodString>;
116
+ }, z.core.$strict>, z.ZodObject<{
117
+ kind: z.ZodLiteral<"boolean">;
118
+ default: z.ZodBoolean;
119
+ label: z.ZodString;
120
+ description: z.ZodOptional<z.ZodString>;
121
+ }, z.core.$strict>, z.ZodObject<{
122
+ kind: z.ZodLiteral<"choice">;
123
+ default: z.ZodString;
124
+ options: z.ZodArray<z.ZodString>;
125
+ label: z.ZodString;
126
+ description: z.ZodOptional<z.ZodString>;
127
+ }, z.core.$strict>], "kind">;
128
+ type SettingField = z.infer<typeof settingFieldSchema>;
129
+ declare const settingsFieldsSchema: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
130
+ kind: z.ZodLiteral<"point-ledger">;
131
+ default: z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>;
132
+ label: z.ZodString;
133
+ description: z.ZodOptional<z.ZodString>;
134
+ }, z.core.$strict>, z.ZodObject<{
135
+ kind: z.ZodLiteral<"datetime">;
136
+ default: z.ZodPipe<z.ZodISODateTime, z.ZodTransform<string, string>>;
137
+ label: z.ZodString;
138
+ description: z.ZodOptional<z.ZodString>;
139
+ }, z.core.$strict>, z.ZodObject<{
140
+ kind: z.ZodLiteral<"resource">;
141
+ default: z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>;
142
+ source: z.ZodUnion<readonly [z.ZodObject<{
143
+ provider: z.ZodLiteral<"domino">;
144
+ resource: z.ZodLiteral<"point-ledger">;
145
+ }, z.core.$strict>, z.ZodUnion<readonly [z.ZodObject<{
146
+ provider: z.ZodLiteral<"discord">;
147
+ resource: z.ZodLiteral<"channel">;
148
+ types: z.ZodArray<z.ZodEnum<{
149
+ text: "text";
150
+ announcement: "announcement";
151
+ }>>;
152
+ }, z.core.$strict>, z.ZodObject<{
153
+ provider: z.ZodLiteral<"discord">;
154
+ resource: z.ZodLiteral<"role">;
155
+ assignable: z.ZodDefault<z.ZodBoolean>;
156
+ }, z.core.$strict>]>]>;
157
+ label: z.ZodString;
158
+ description: z.ZodOptional<z.ZodString>;
159
+ }, z.core.$strict>, z.ZodObject<{
160
+ kind: z.ZodLiteral<"quiz">;
161
+ default: z.ZodArray<z.ZodObject<{
162
+ id: z.ZodString;
163
+ prompt: z.ZodString;
164
+ choices: z.ZodArray<z.ZodObject<{
165
+ id: z.ZodString;
166
+ label: z.ZodString;
167
+ }, z.core.$strict>>;
168
+ correct: z.ZodString;
169
+ }, z.core.$strict>>;
170
+ label: z.ZodString;
171
+ description: z.ZodOptional<z.ZodString>;
172
+ }, z.core.$strict>, z.ZodObject<{
173
+ kind: z.ZodLiteral<"text">;
174
+ default: z.ZodString;
175
+ minLength: z.ZodNumber;
176
+ maxLength: z.ZodNumber;
177
+ multiline: z.ZodBoolean;
178
+ picker: z.ZodOptional<z.ZodString>;
179
+ decimals: z.ZodOptional<z.ZodNumber>;
180
+ label: z.ZodString;
181
+ description: z.ZodOptional<z.ZodString>;
182
+ }, z.core.$strict>, z.ZodObject<{
183
+ kind: z.ZodLiteral<"integer">;
184
+ default: z.ZodNumber;
185
+ min: z.ZodNumber;
186
+ max: z.ZodNumber;
187
+ label: z.ZodString;
188
+ description: z.ZodOptional<z.ZodString>;
189
+ }, z.core.$strict>, z.ZodObject<{
190
+ kind: z.ZodLiteral<"boolean">;
191
+ default: z.ZodBoolean;
192
+ label: z.ZodString;
193
+ description: z.ZodOptional<z.ZodString>;
194
+ }, z.core.$strict>, z.ZodObject<{
195
+ kind: z.ZodLiteral<"choice">;
196
+ default: z.ZodString;
197
+ options: z.ZodArray<z.ZodString>;
198
+ label: z.ZodString;
199
+ description: z.ZodOptional<z.ZodString>;
200
+ }, z.core.$strict>], "kind">>;
201
+ declare const settingsValuesSchema: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodObject<{
202
+ id: z.ZodString;
203
+ prompt: z.ZodString;
204
+ choices: z.ZodArray<z.ZodObject<{
205
+ id: z.ZodString;
206
+ label: z.ZodString;
207
+ }, z.core.$strict>>;
208
+ correct: z.ZodString;
209
+ }, z.core.$strict>>]>>;
210
+ type SettingsValues = z.infer<typeof settingsValuesSchema>;
211
+ /** Type-only marker of the builder that made a setting. It never exists at runtime. */
212
+ declare const settingKind: unique symbol;
213
+ /**
214
+ * A quest setting made by a `settings.*` builder, which records the field Console edits in the
215
+ * schema's metadata. Plain zod schemas are not settings.
216
+ */
217
+ type Setting<K extends SettingField["kind"] = SettingField["kind"], S extends z.ZodType = z.ZodType> = S & {
218
+ readonly [settingKind]: K;
219
+ };
220
+ /** The names of a settings shape's integer settings. */
221
+ type IntegerSettings<T> = {
222
+ [K in keyof T]: T[K] extends Setting<"integer"> ? K : never;
223
+ }[keyof T] & string;
224
+ /** Type-only marker of `settings.amount()`. It never exists at runtime. */
225
+ declare const amountSetting: unique symbol;
226
+ /** A `settings.amount()` setting: a text setting holding a base-unit integer string. */
227
+ type AmountSetting<S extends z.ZodType = z.ZodType> = Setting<"text", S> & {
228
+ readonly [amountSetting]: true;
229
+ };
230
+ /** The names of a settings shape's settings a tracker filter may compare with: integers and amounts. */
231
+ type BoundSettings<T> = {
232
+ [K in keyof T]: T[K] extends Setting<"integer"> ? K : T[K] extends AmountSetting ? K : never;
233
+ }[keyof T] & string;
234
+ /** The chains a `settings.chain()` setting holds: those `ctx.wallet.balance()` reads without a denom. */
235
+ type BalanceChain = Exclude<WalletBalanceQuery["chain"], `cosmos:${string}`>;
236
+ /** Whether `value` is a non-negative integer string in canonical form, such as a base-unit amount. */
237
+ declare function isAmount(value: string): boolean;
238
+ /** Whether `value` names a chain a `settings.chain()` setting may hold. */
239
+ declare function isBalanceChain(value: string): value is BalanceChain;
240
+ /** Whether a tracker filter may compare with `field`: an integer or amount setting. */
241
+ declare function isBoundSetting(field: SettingField | undefined): boolean;
242
+ /** The value schema of a text setting, with the checks its picker adds. */
243
+ declare function textSettingSchema(field: {
244
+ minLength: number;
245
+ maxLength: number;
246
+ picker?: string;
247
+ }): z.ZodString;
248
+ declare function parseSettings(fields: Record<string, SettingField>, input: unknown): SettingsValues;
249
+ declare function missingResourceSettings(fields: Record<string, SettingField>, values: SettingsValues): string[];
250
+ declare function compatibleSettingKinds(previous: SettingField, next: SettingField): boolean;
251
+
252
+ /**
253
+ * How many panels one dashboard holds and how many dashboards that are not archived a project
254
+ * holds. Panels are computed at read time without rollups, so the caps keep a read affordable.
255
+ */
256
+ declare const dashboardLimits: {
257
+ readonly panels: 24;
258
+ readonly dashboards: 20;
259
+ };
260
+ /** A panel's width on the 4-column grid when it sets none. */
261
+ declare const defaultPanelWidths: {
262
+ readonly number: 1;
263
+ readonly line: 2;
264
+ readonly bar: 2;
265
+ readonly table: 4;
266
+ };
267
+ /** One panel as authored: `width` defaults by chart (`defaultPanelWidths`). */
268
+ declare const dashboardPanelAuthoringSchema: z.ZodObject<{
269
+ width: z.ZodOptional<z.ZodNumber>;
270
+ key: z.ZodString;
271
+ title: z.ZodString;
272
+ description: z.ZodOptional<z.ZodString>;
273
+ /** A metric ID from the catalog (`analytics.catalog`). */
274
+ metric: z.ZodString;
275
+ breakdown: z.ZodOptional<z.ZodString>;
276
+ /** Each filter names one key or a list of keys; a list matches any of them. */
277
+ filter: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
278
+ /** The point ledger a points metric reads, by key. */
279
+ ledger: z.ZodOptional<z.ZodString>;
280
+ chart: z.ZodEnum<{
281
+ number: "number";
282
+ line: "line";
283
+ bar: "bar";
284
+ table: "table";
285
+ }>;
286
+ }, z.core.$strict>;
287
+ /** A dashboard as `defineDashboard` and a deployment take it, before defaults. */
288
+ declare const dashboardAuthoringSchema: z.ZodObject<{
289
+ key: z.ZodString;
290
+ title: z.ZodString;
291
+ description: z.ZodOptional<z.ZodString>;
292
+ /** The range the dashboard opens with. Defaults to `30d`. */
293
+ defaultRange: z.ZodOptional<z.ZodEnum<{
294
+ "7d": "7d";
295
+ "30d": "30d";
296
+ "90d": "90d";
297
+ all: "all";
298
+ }>>;
299
+ /** Orders dashboards in lists: by position, those without one last, then by title. */
300
+ position: z.ZodOptional<z.ZodNumber>;
301
+ sections: z.ZodArray<z.ZodObject<{
302
+ title: z.ZodOptional<z.ZodString>;
303
+ panels: z.ZodArray<z.ZodObject<{
304
+ width: z.ZodOptional<z.ZodNumber>;
305
+ key: z.ZodString;
306
+ title: z.ZodString;
307
+ description: z.ZodOptional<z.ZodString>;
308
+ /** A metric ID from the catalog (`analytics.catalog`). */
309
+ metric: z.ZodString;
310
+ breakdown: z.ZodOptional<z.ZodString>;
311
+ /** Each filter names one key or a list of keys; a list matches any of them. */
312
+ filter: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
313
+ /** The point ledger a points metric reads, by key. */
314
+ ledger: z.ZodOptional<z.ZodString>;
315
+ chart: z.ZodEnum<{
316
+ number: "number";
317
+ line: "line";
318
+ bar: "bar";
319
+ table: "table";
320
+ }>;
321
+ }, z.core.$strict>>;
322
+ }, z.core.$strict>>;
323
+ }, z.core.$strict>;
324
+ type DashboardAuthoring = z.input<typeof dashboardAuthoringSchema>;
325
+ /** A dashboard as Relay stores it: authored, with `defaultRange` and each panel's `width` filled in. */
326
+ declare const dashboardDefinitionSchema: z.ZodObject<{
327
+ key: z.ZodString;
328
+ title: z.ZodString;
329
+ description: z.ZodOptional<z.ZodString>;
330
+ defaultRange: z.ZodEnum<{
331
+ "7d": "7d";
332
+ "30d": "30d";
333
+ "90d": "90d";
334
+ all: "all";
335
+ }>;
336
+ position: z.ZodOptional<z.ZodNumber>;
337
+ sections: z.ZodArray<z.ZodObject<{
338
+ title: z.ZodOptional<z.ZodString>;
339
+ panels: z.ZodArray<z.ZodObject<{
340
+ width: z.ZodNumber;
341
+ key: z.ZodString;
342
+ title: z.ZodString;
343
+ description: z.ZodOptional<z.ZodString>;
344
+ /** A metric ID from the catalog (`analytics.catalog`). */
345
+ metric: z.ZodString;
346
+ breakdown: z.ZodOptional<z.ZodString>;
347
+ /** Each filter names one key or a list of keys; a list matches any of them. */
348
+ filter: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
349
+ /** The point ledger a points metric reads, by key. */
350
+ ledger: z.ZodOptional<z.ZodString>;
351
+ chart: z.ZodEnum<{
352
+ number: "number";
353
+ line: "line";
354
+ bar: "bar";
355
+ table: "table";
356
+ }>;
357
+ }, z.core.$strict>>;
358
+ }, z.core.$strict>>;
359
+ }, z.core.$strict>;
360
+ type DashboardDefinition = z.infer<typeof dashboardDefinitionSchema>;
361
+ type DashboardPanel = DashboardDefinition["sections"][number]["panels"][number];
362
+ /** What a deployment carries for one dashboard: a definition, or the bundled code that exports one. */
363
+ declare const dashboardArtifactSchema: z.ZodUnion<readonly [z.ZodObject<{
364
+ key: z.ZodString;
365
+ title: z.ZodString;
366
+ description: z.ZodOptional<z.ZodString>;
367
+ /** The range the dashboard opens with. Defaults to `30d`. */
368
+ defaultRange: z.ZodOptional<z.ZodEnum<{
369
+ "7d": "7d";
370
+ "30d": "30d";
371
+ "90d": "90d";
372
+ all: "all";
373
+ }>>;
374
+ /** Orders dashboards in lists: by position, those without one last, then by title. */
375
+ position: z.ZodOptional<z.ZodNumber>;
376
+ sections: z.ZodArray<z.ZodObject<{
377
+ title: z.ZodOptional<z.ZodString>;
378
+ panels: z.ZodArray<z.ZodObject<{
379
+ width: z.ZodOptional<z.ZodNumber>;
380
+ key: z.ZodString;
381
+ title: z.ZodString;
382
+ description: z.ZodOptional<z.ZodString>;
383
+ /** A metric ID from the catalog (`analytics.catalog`). */
384
+ metric: z.ZodString;
385
+ breakdown: z.ZodOptional<z.ZodString>;
386
+ /** Each filter names one key or a list of keys; a list matches any of them. */
387
+ filter: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
388
+ /** The point ledger a points metric reads, by key. */
389
+ ledger: z.ZodOptional<z.ZodString>;
390
+ chart: z.ZodEnum<{
391
+ number: "number";
392
+ line: "line";
393
+ bar: "bar";
394
+ table: "table";
395
+ }>;
396
+ }, z.core.$strict>>;
397
+ }, z.core.$strict>>;
398
+ }, z.core.$strict>, z.ZodObject<{
399
+ code: z.ZodString;
400
+ }, z.core.$strict>]>;
401
+ /**
402
+ * `input` with its defaults filled in and absent optional fields left out, so two deployments of
403
+ * the same source store the same JSON.
404
+ */
405
+ declare function normalizeDashboard(input: z.input<typeof dashboardAuthoringSchema>): DashboardDefinition;
406
+ /** Every panel of `dashboard`, in reading order. */
407
+ declare function dashboardPanels(dashboard: {
408
+ sections: readonly {
409
+ panels: readonly DashboardPanel[];
410
+ }[];
411
+ }): DashboardPanel[];
412
+ /**
413
+ * Why the metric catalog refuses a dashboard. `breakdown-not-accepted`: the metric takes no such
414
+ * breakdown, or a `number` panel has one. `breakdown-required`: a `table` panel has none.
415
+ * `duplicate-key`: two panels share a key. Every code but `too-many-panels` names its `panel`.
416
+ */
417
+ type DashboardIssue = {
418
+ code: "unknown-metric" | "breakdown-not-accepted" | "breakdown-required" | "filter-not-accepted" | "chart-not-accepted" | "ledger-required" | "ledger-not-accepted" | "duplicate-key" | "too-many-panels";
419
+ message: string;
420
+ panel?: string;
421
+ };
422
+ /**
423
+ * The first rule of the metric catalog `dashboard` breaks, or null. References (quests, ledgers,
424
+ * and so on) are the server's to check, since they name what the environment holds.
425
+ */
426
+ declare function dashboardIssue(dashboard: {
427
+ key: string;
428
+ sections: readonly {
429
+ panels: readonly z.input<typeof dashboardPanelAuthoringSchema>[];
430
+ }[];
431
+ }): DashboardIssue | null;
432
+ /** A deployment's dashboard: its stored definition and what publishing it does. */
433
+ declare const dashboardPreviewSchema: z.ZodObject<{
434
+ key: z.ZodString;
435
+ title: z.ZodString;
436
+ change: z.ZodEnum<{
437
+ created: "created";
438
+ updated: "updated";
439
+ unchanged: "unchanged";
440
+ }>;
441
+ definition: z.ZodObject<{
442
+ key: z.ZodString;
443
+ title: z.ZodString;
444
+ description: z.ZodOptional<z.ZodString>;
445
+ defaultRange: z.ZodEnum<{
446
+ "7d": "7d";
447
+ "30d": "30d";
448
+ "90d": "90d";
449
+ all: "all";
450
+ }>;
451
+ position: z.ZodOptional<z.ZodNumber>;
452
+ sections: z.ZodArray<z.ZodObject<{
453
+ title: z.ZodOptional<z.ZodString>;
454
+ panels: z.ZodArray<z.ZodObject<{
455
+ width: z.ZodNumber;
456
+ key: z.ZodString;
457
+ title: z.ZodString;
458
+ description: z.ZodOptional<z.ZodString>;
459
+ /** A metric ID from the catalog (`analytics.catalog`). */
460
+ metric: z.ZodString;
461
+ breakdown: z.ZodOptional<z.ZodString>;
462
+ /** Each filter names one key or a list of keys; a list matches any of them. */
463
+ filter: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
464
+ /** The point ledger a points metric reads, by key. */
465
+ ledger: z.ZodOptional<z.ZodString>;
466
+ chart: z.ZodEnum<{
467
+ number: "number";
468
+ line: "line";
469
+ bar: "bar";
470
+ table: "table";
471
+ }>;
472
+ }, z.core.$strict>>;
473
+ }, z.core.$strict>>;
474
+ }, z.core.$strict>;
475
+ }, z.core.$strip>;
476
+ /** @compat output */
477
+ type DashboardPreview = z.infer<typeof dashboardPreviewSchema>;
478
+ type Catalog = typeof analyticsCatalog;
479
+ type Charts<M extends AnalyticsMetricId> = Catalog[M]["charts"][number];
480
+ type Breakdowns<M extends AnalyticsMetricId> = Catalog[M]["breakdowns"][number];
481
+ type Filters<M extends AnalyticsMetricId> = Catalog[M]["filters"][number];
482
+ /** A key, or a handle a `define…` function returned. */
483
+ type Reference = string | {
484
+ readonly key: string;
485
+ };
486
+ /** The chart a metric allows, and the breakdown that chart needs or takes. */
487
+ type ChartChoice<M extends AnalyticsMetricId> = {
488
+ chart: Extract<Charts<M>, "number">;
489
+ breakdown?: never;
490
+ } | {
491
+ chart: Extract<Charts<M>, "line" | "bar">;
492
+ breakdown?: Breakdowns<M>;
493
+ } | ([Breakdowns<M>] extends [never] ? never : {
494
+ chart: Extract<Charts<M>, "table">;
495
+ breakdown: Breakdowns<M>;
496
+ });
497
+ /** One panel, typed by its metric: only the breakdowns, filters and charts the catalog allows it. */
498
+ type DashboardPanelInput = {
499
+ [M in AnalyticsMetricId]: {
500
+ key: string;
501
+ title: string;
502
+ description?: string;
503
+ metric: M;
504
+ filter?: [Filters<M>] extends [never] ? never : Partial<Record<Filters<M>, Reference | readonly Reference[]>>;
505
+ width?: 1 | 2 | 3 | 4;
506
+ } & ChartChoice<M> & (Catalog[M]["ledger"] extends true ? {
507
+ ledger: Reference;
508
+ } : {
509
+ ledger?: never;
510
+ });
511
+ }[AnalyticsMetricId];
512
+ type DashboardInput = Omit<DashboardAuthoring, "sections"> & {
513
+ sections: {
514
+ title?: string;
515
+ panels: DashboardPanelInput[];
516
+ }[];
517
+ };
518
+ /**
519
+ * Define one dashboard: panels of catalog metrics in sections, on a 4-column grid. List the file
520
+ * under `dashboards` in relay.json. A deployment checks each panel against the metric catalog and
521
+ * the environment, and answers a coded error for one it refuses.
522
+ */
523
+ declare function defineDashboard(input: DashboardInput): {
524
+ key: string;
525
+ title: string;
526
+ sections: {
527
+ panels: {
528
+ key: string;
529
+ title: string;
530
+ metric: string;
531
+ chart: "number" | "line" | "bar" | "table";
532
+ width?: number | undefined;
533
+ description?: string | undefined;
534
+ breakdown?: string | undefined;
535
+ filter?: Record<string, string | string[]> | undefined;
536
+ ledger?: string | undefined;
537
+ }[];
538
+ title?: string | undefined;
539
+ }[];
540
+ description?: string | undefined;
541
+ defaultRange?: "7d" | "30d" | "90d" | "all" | undefined;
542
+ position?: number | undefined;
543
+ } & ResourceHandle<"dashboard">;
544
+
545
+ /** Modules a quest can declare to enable provider readers. Project connections are separate. */
546
+ declare const evaluatorIntegrationProviderSchema: z.ZodEnum<{
547
+ discord: "discord";
548
+ x: "x";
549
+ }>;
550
+ type EvaluatorIntegrationProvider = z.infer<typeof evaluatorIntegrationProviderSchema>;
551
+ type IntegrationModule = {
552
+ readonly provider: EvaluatorIntegrationProvider;
553
+ };
554
+ declare const integrationProviderSchema: z.ZodEnum<{
555
+ discord: "discord";
556
+ }>;
557
+ type IntegrationProvider = z.infer<typeof integrationProviderSchema>;
558
+ declare const discordServerSchema: z.ZodObject<{
559
+ id: z.ZodString;
560
+ name: z.ZodString;
561
+ icon: z.ZodNullable<z.ZodString>;
562
+ }, z.core.$strip>;
563
+ declare const projectIntegrationSchema: z.ZodObject<{
564
+ provider: z.ZodEnum<{
565
+ discord: "discord";
566
+ }>;
567
+ configured: z.ZodBoolean;
568
+ status: z.ZodEnum<{
569
+ disconnected: "disconnected";
570
+ ready: "ready";
571
+ attention: "attention";
572
+ }>;
573
+ revision: z.ZodNumber;
574
+ server: z.ZodNullable<z.ZodObject<{
575
+ id: z.ZodString;
576
+ name: z.ZodString;
577
+ icon: z.ZodNullable<z.ZodString>;
578
+ }, z.core.$strip>>;
579
+ issue: z.ZodNullable<z.ZodString>;
580
+ connectedAt: z.ZodDefault<z.ZodNumber>;
581
+ }, z.core.$strip>;
582
+ type ProjectIntegration = z.infer<typeof projectIntegrationSchema>;
583
+
584
+ export { type AmountSetting as A, type BalanceChain as B, isAmount as C, type DashboardInput as D, type EvaluatorIntegrationProvider as E, isBalanceChain as F, isBoundSetting as G, missingResourceSettings as H, type IntegrationModule as I, normalizeDashboard as J, parseSettings as K, projectIntegrationSchema as L, resourceOptionsSchema as M, resourceRequestSchema as N, resourceSourceSchema as O, type ProjectIntegration as P, settingFieldSchema as Q, type ResourceSource as R, type Setting as S, settingsFieldsSchema as T, settingsValuesSchema as U, textSettingSchema as V, type BoundSettings as a, type DashboardPanelInput as b, type DashboardAuthoring as c, defineDashboard as d, type DashboardDefinition as e, type DashboardIssue as f, type DashboardPanel as g, type DashboardPreview as h, type IntegerSettings as i, type IntegrationProvider as j, type ResourceOption as k, type SettingField as l, type SettingsValues as m, compatibleSettingKinds as n, dashboardArtifactSchema as o, dashboardAuthoringSchema as p, dashboardDefinitionSchema as q, dashboardIssue as r, dashboardLimits as s, dashboardPanelAuthoringSchema as t, dashboardPanels as u, dashboardPreviewSchema as v, defaultPanelWidths as w, discordServerSchema as x, evaluatorIntegrationProviderSchema as y, integrationProviderSchema as z };
@@ -1,16 +1,17 @@
1
- export { I as IdentityKindClaim, M as ManagementTransportOptions, P as ParticipantRoute, R as REFERRAL_INTEGRATION_REWARD_ERROR, c as containsReferralIntegrationReward, i as identityIntegrationInputSchema, a as identityIntegrationSchema, b as identityIntegrationSecretSchema, d as identityKindClaimSchema, e as isIntegrationParticipantPath, f as isParticipantRoute, m as managementTransport, p as parseImageExtraction, g as parseImageResult, h as participantExchangeSchema, j as participantRoutePattern, k as participantRoutes, q as questConfiguration, s as sequenceCursorSchema, l as sourceDataSchema, n as sourceRoles, v as validateQuestShape } from './transport-C8BlCzmF.js';
2
- export { E as Extracted } from './x-BfQcsDp0.js';
1
+ export { I as IdentityKindClaim, M as ManagementTransportOptions, P as ParticipantRoute, R as REFERRAL_INTEGRATION_REWARD_ERROR, c as containsReferralIntegrationReward, i as identityIntegrationInputSchema, a as identityIntegrationSchema, b as identityIntegrationSecretSchema, d as identityKindClaimSchema, e as isIntegrationParticipantPath, f as isParticipantRoute, m as managementTransport, p as parseImageExtraction, g as parseImageResult, h as participantExchangeSchema, j as participantRoutePattern, k as participantRoutes, q as questConfiguration, s as sequenceCursorSchema, l as sourceDataSchema, n as sourceRoles, v as validateQuestShape } from './transport-CZJOW5Sr.js';
2
+ export { E as Extracted } from './x-1czZFVUW.js';
3
3
  import { c as RequestErrorKind } from './action-DBzILFx9.js';
4
- export { i as TrackerDataBudget, s as schemaCheckedReader, t as trackerDataBatchSteps, j as trackerDataIssue, k as trackerDataIssues, l as trackerDataPathTypes, m as trackerDataRecordSteps, w as whereSchemaIssue } from './schema-BJ9bOgpN.js';
4
+ export { p as TrackerDataBudget, s as schemaCheckedReader, t as trackerDataBatchSteps, q as trackerDataIssue, r as trackerDataIssues, u as trackerDataPathTypes, v as trackerDataRecordSteps, w as whereSchemaIssue } from './schema-C4m9RhCR.js';
5
5
  export { H as HostEnvironment, h as hostEnvironmentPath, a as hostEnvironmentSchema } from './host-environment-FN4zg3hw.js';
6
6
  import 'zod';
7
- import './pages-BTlOg8sl.js';
8
- import './offers-CH1RZekg.js';
9
- import './groups-B5R1RCsl.js';
10
- import './profiles-Cdv4BSd_.js';
11
- import './automatic-outcomes-CVyZHxir.js';
12
- import './attempt-captures-QC4kTA44.js';
13
- import './deployments-ovtqtAcx.js';
7
+ import './pages-BFloMpyQ.js';
8
+ import './offers-BMDNcvwB.js';
9
+ import './groups-O6onGPmC.js';
10
+ import './profiles-BoOK03cR.js';
11
+ import './automatic-outcomes-DxW_v5Wc.js';
12
+ import './attempt-captures-CxxO7DeD.js';
13
+ import './analytics-URV-mxjH.js';
14
+ import './deployments-B32QS1CI.js';
14
15
 
15
16
  /** The management client's and the CLI's default deadline per call. */
16
17
  declare const MANAGEMENT_TIMEOUT = 30000;
package/dist/internal.js CHANGED
@@ -9,17 +9,17 @@ import {
9
9
  participantExchangeSchema,
10
10
  questConfiguration,
11
11
  sequenceCursorSchema
12
- } from "./chunk-TL5TL5RD.js";
12
+ } from "./chunk-WUEQOKJH.js";
13
13
  import {
14
14
  parseImageExtraction,
15
15
  parseImageResult
16
- } from "./chunk-LPHXTZDA.js";
17
- import "./chunk-K6TVMNU4.js";
16
+ } from "./chunk-YE3XYB2F.js";
17
+ import "./chunk-YEVD4A5X.js";
18
18
  import {
19
19
  sourceDataSchema,
20
20
  sourceRoles,
21
21
  validateQuestShape
22
- } from "./chunk-S2PMKZSX.js";
22
+ } from "./chunk-SABMNPF2.js";
23
23
  import {
24
24
  isIntegrationParticipantPath,
25
25
  isParticipantRoute,
@@ -35,9 +35,9 @@ import {
35
35
  lifetime,
36
36
  retryAfter,
37
37
  retrying
38
- } from "./chunk-XFAYQFRO.js";
39
- import "./chunk-RP4LLEON.js";
40
- import "./chunk-53JMTUWG.js";
38
+ } from "./chunk-TLK2MD4S.js";
39
+ import "./chunk-VFBQVY4X.js";
40
+ import "./chunk-56DBFNR2.js";
41
41
  import {
42
42
  schemaCheckedReader,
43
43
  trackerDataBatchSteps,
@@ -46,7 +46,7 @@ import {
46
46
  trackerDataPathTypes,
47
47
  trackerDataRecordSteps,
48
48
  whereSchemaIssue
49
- } from "./chunk-IELNFM3V.js";
49
+ } from "./chunk-YCOKTQ4E.js";
50
50
  export {
51
51
  MANAGEMENT_TIMEOUT,
52
52
  REFERRAL_INTEGRATION_REWARD_ERROR,
@@ -1,6 +1,6 @@
1
1
  import * as z from 'zod';
2
- import { q as ResourceHandle } from './schema-BJ9bOgpN.js';
3
- import { t as AuthoringIdentity } from './groups-B5R1RCsl.js';
2
+ import { C as ResourceHandle } from './schema-C4m9RhCR.js';
3
+ import { m as AuthoringIdentity } from './groups-O6onGPmC.js';
4
4
 
5
5
  declare const badgePropertiesSchema: z.ZodObject<{
6
6
  name: z.ZodString;