@domino-sdk/relay 1.22.0 → 1.23.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 (50) hide show
  1. package/dist/accounts-B31dWEYD.d.ts +292 -0
  2. package/dist/{attempt-captures-ByzZyggX.d.ts → attempt-captures-JDIgz2lY.d.ts} +1 -1
  3. package/dist/authoring.d.ts +112 -49
  4. package/dist/authoring.js +37 -3
  5. package/dist/{automatic-outcomes-BBSdMf0R.d.ts → automatic-outcomes-T9lEIvTj.d.ts} +1 -1
  6. package/dist/browser.d.ts +8 -8
  7. package/dist/browser.js +10 -9
  8. package/dist/{chunk-VJ7TTLFL.js → chunk-57KARWUC.js} +1 -1
  9. package/dist/{chunk-EMLDFUTV.js → chunk-6UFXPKLA.js} +6 -1
  10. package/dist/{chunk-GMKJPHN4.js → chunk-AXQYGVOP.js} +1 -1
  11. package/dist/{chunk-JIQHUDVZ.js → chunk-B4EZ76WX.js} +1 -1
  12. package/dist/{chunk-T47OFHHX.js → chunk-E7MVYASS.js} +1 -1
  13. package/dist/{chunk-CVQG2AZZ.js → chunk-ENBQ6UEE.js} +2 -2
  14. package/dist/{chunk-NGP2NMZ4.js → chunk-G75JVB4D.js} +1 -1
  15. package/dist/{chunk-5ZRDK4KQ.js → chunk-GB26FIZT.js} +96 -118
  16. package/dist/{chunk-YXAK2637.js → chunk-JUQ2GNMD.js} +1 -1
  17. package/dist/{chunk-XSLRNFIY.js → chunk-MRU7GX2V.js} +1 -1
  18. package/dist/{chunk-H2QDYEA4.js → chunk-RPEGZW27.js} +2 -2
  19. package/dist/{chunk-4LKSBBWD.js → chunk-SMUYGCGP.js} +4 -4
  20. package/dist/{chunk-7YRXDG7R.js → chunk-UCZGXYCN.js} +9 -7
  21. package/dist/chunk-W33PYWYQ.js +102 -0
  22. package/dist/{chunk-5P5PTZ3T.js → chunk-WOGCRDFT.js} +1 -1
  23. package/dist/{chunk-NSLQLGHF.js → chunk-XQE22UKY.js} +13 -11
  24. package/dist/{client-DSlycgar.d.ts → client-HG0uMG0Q.d.ts} +6 -6
  25. package/dist/{deployments-nNS4spO9.d.ts → deployments-B--Shwgx.d.ts} +121 -109
  26. package/dist/{groups-jLLG7MML.d.ts → groups-CfyRewkJ.d.ts} +1 -1
  27. package/dist/{images-BPiPqVKn.d.ts → images-DwNmzqWv.d.ts} +1 -1
  28. package/dist/index.d.ts +9 -9
  29. package/dist/index.js +9 -8
  30. package/dist/{integrations-Cr9EhGI_.d.ts → integrations-BMNtARU_.d.ts} +2 -0
  31. package/dist/internal.d.ts +9 -9
  32. package/dist/internal.js +8 -8
  33. package/dist/{offers-CPqiF3dZ.d.ts → offers-CEwkAGsB.d.ts} +2 -2
  34. package/dist/{pages-1h1387a3.d.ts → pages-D1xrbGJl.d.ts} +6 -1
  35. package/dist/{telegram-DALZ7GdF.d.ts → participant-activity-DYdUUhw2.d.ts} +1 -40
  36. package/dist/portal-proxy.js +3 -3
  37. package/dist/react/index.d.ts +11 -11
  38. package/dist/react/index.js +10 -9
  39. package/dist/{schema-Br3c1GOu.d.ts → schema-D57mhL2q.d.ts} +1427 -1422
  40. package/dist/schema.d.ts +325 -323
  41. package/dist/schema.js +29 -11
  42. package/dist/server/index.d.ts +9 -9
  43. package/dist/server/index.js +57 -13
  44. package/dist/{submission-input-BEJ9qENg.d.ts → submission-input-DjXg0o-r.d.ts} +2 -2
  45. package/dist/{telegram-browser-CGB01TaB.d.ts → telegram-browser-DaP0Rawg.d.ts} +2 -3
  46. package/dist/testing.d.ts +18 -6
  47. package/dist/testing.js +42 -7
  48. package/dist/{transport-C6QJseIM.d.ts → transport-BZbTTtBk.d.ts} +2214 -2005
  49. package/package.json +1 -1
  50. package/dist/accounts-5ciAkCMP.d.ts +0 -147
@@ -0,0 +1,292 @@
1
+ import { z } from 'zod';
2
+
3
+ /** A Discord message as `ctx.discord.message()` reads it, from the project's Discord server. */
4
+ declare const discordMessageSchema: z.ZodObject<{
5
+ guildId: z.ZodString;
6
+ channelId: z.ZodString;
7
+ messageId: z.ZodString;
8
+ userId: z.ZodString;
9
+ content: z.ZodNullable<z.ZodString>;
10
+ replyTo: z.ZodNullable<z.ZodString>;
11
+ publishedAt: z.ZodNumber;
12
+ }, z.core.$strict>;
13
+ type DiscordMessage = z.infer<typeof discordMessageSchema>;
14
+ /**
15
+ * Messages posted in the project's Discord server, written by the Discord gateway. The record's
16
+ * `author` is the message author's Discord account. Message text is stored only with `text: true`.
17
+ * Edits update stored text. Deleting a message, or turning text off, removes retained text.
18
+ */
19
+ declare const discordMessagesSourceSchema: z.ZodObject<{
20
+ kind: z.ZodLiteral<"discord-messages">;
21
+ /** Store each message's text in `data.text`. Off unless set. */
22
+ text: z.ZodOptional<z.ZodBoolean>;
23
+ }, z.core.$strict>;
24
+ /**
25
+ * Reactions added in the project's Discord server, written by the Discord gateway. The record's
26
+ * `author` is the reactor's Discord account and its `messageAuthor` account is the message's
27
+ * author, when Discord could name it.
28
+ */
29
+ declare const discordReactionsSourceSchema: z.ZodObject<{
30
+ kind: z.ZodLiteral<"discord-reactions">;
31
+ }, z.core.$strict>;
32
+ /** The `data` of a `discord.messages()` record. IDs are Discord snowflakes. */
33
+ declare const discordMessageDataSchema: z.ZodObject<{
34
+ guildId: z.ZodString;
35
+ channelId: z.ZodString;
36
+ messageId: z.ZodString;
37
+ replyTo: z.ZodNullable<z.ZodString>;
38
+ publishedAt: z.ZodNumber;
39
+ }, z.core.$strip>;
40
+ type DiscordMessageData = z.infer<typeof discordMessageDataSchema>;
41
+ /**
42
+ * The `data` of a `discord.messages({ text: true })` record. `text` is null when the platform's
43
+ * bot does not receive message content.
44
+ */
45
+ declare const discordMessageTextDataSchema: z.ZodObject<{
46
+ guildId: z.ZodString;
47
+ channelId: z.ZodString;
48
+ messageId: z.ZodString;
49
+ replyTo: z.ZodNullable<z.ZodString>;
50
+ publishedAt: z.ZodNumber;
51
+ text: z.ZodNullable<z.ZodString>;
52
+ }, z.core.$strip>;
53
+ type DiscordMessageTextData = z.infer<typeof discordMessageTextDataSchema>;
54
+ /** The `data` of a `discord.reactions()` record. IDs are Discord snowflakes. */
55
+ declare const discordReactionDataSchema: z.ZodObject<{
56
+ guildId: z.ZodString;
57
+ channelId: z.ZodString;
58
+ messageId: z.ZodString;
59
+ emoji: z.ZodObject<{
60
+ id: z.ZodNullable<z.ZodString>;
61
+ name: z.ZodString;
62
+ }, z.core.$strip>;
63
+ reactorRoles: z.ZodArray<z.ZodString>;
64
+ messagePublishedAt: z.ZodNumber;
65
+ }, z.core.$strip>;
66
+ type DiscordReactionData = z.infer<typeof discordReactionDataSchema>;
67
+ /** Rewards and resource selectors supported by the Discord integration. */
68
+ declare const discordRewardSchema: z.ZodObject<{
69
+ kind: z.ZodLiteral<"integration">;
70
+ provider: z.ZodLiteral<"discord">;
71
+ action: z.ZodLiteral<"grant-role">;
72
+ roleId: z.ZodString;
73
+ }, z.core.$strict>;
74
+ declare const discordResourceSourceSchema: z.ZodUnion<readonly [z.ZodObject<{
75
+ provider: z.ZodLiteral<"discord">;
76
+ resource: z.ZodLiteral<"channel">;
77
+ types: z.ZodArray<z.ZodEnum<{
78
+ text: "text";
79
+ announcement: "announcement";
80
+ }>>;
81
+ }, z.core.$strict>, z.ZodObject<{
82
+ provider: z.ZodLiteral<"discord">;
83
+ resource: z.ZodLiteral<"role">;
84
+ assignable: z.ZodDefault<z.ZodBoolean>;
85
+ }, z.core.$strict>]>;
86
+
87
+ /**
88
+ * The Telegram sign-in a project offers, beside `providers` in `relay.auth.providers()`.
89
+ *
90
+ * @compat output
91
+ */
92
+ declare const telegramSignInMethodsSchema: z.ZodObject<{
93
+ login: z.ZodBoolean;
94
+ miniApp: z.ZodBoolean;
95
+ }, z.core.$strip>;
96
+ type TelegramSignInMethods = z.infer<typeof telegramSignInMethodsSchema>;
97
+ /**
98
+ * The member's Telegram account, as `AccountConnection` describes the other providers'. `subject`
99
+ * is the numeric Telegram user ID; `configured` is whether Telegram Login is.
100
+ *
101
+ * @compat output
102
+ */
103
+ declare const telegramAccountConnectionSchema: z.ZodObject<{
104
+ configured: z.ZodBoolean;
105
+ status: z.ZodEnum<{
106
+ disconnected: "disconnected";
107
+ connected: "connected";
108
+ reconnect: "reconnect";
109
+ }>;
110
+ subject: z.ZodNullable<z.ZodString>;
111
+ revision: z.ZodNumber;
112
+ provider: z.ZodLiteral<"telegram">;
113
+ }, z.core.$strip>;
114
+ type TelegramAccountConnection = z.infer<typeof telegramAccountConnectionSchema>;
115
+ /** The signed launch data a Telegram Mini App receives, `Telegram.WebApp.initData`. */
116
+ declare const telegramInitDataSchema: z.ZodString;
117
+ /** `POST /v1/auth/telegram/mini-app`: sign in, or connect Telegram to the signed-in member. */
118
+ declare const telegramMiniAppSignInSchema: z.ZodObject<{
119
+ initData: z.ZodString;
120
+ mode: z.ZodEnum<{
121
+ "sign-in": "sign-in";
122
+ connect: "connect";
123
+ }>;
124
+ }, z.core.$strict>;
125
+ /** A Telegram chat ID as a decimal string: negative for groups, supergroups and channels. */
126
+ declare const telegramChatIdSchema: z.ZodString;
127
+ /**
128
+ * A chat bound to the project through Domino's bot. `status` is `ready` while the bot can read
129
+ * the chat as an administrator, `attention` with an `issue` once it cannot.
130
+ *
131
+ * @compat output
132
+ */
133
+ declare const telegramChatSchema: z.ZodObject<{
134
+ id: z.ZodString;
135
+ type: z.ZodString;
136
+ title: z.ZodString;
137
+ username: z.ZodNullable<z.ZodString>;
138
+ status: z.ZodString;
139
+ issue: z.ZodNullable<z.ZodString>;
140
+ connectedAt: z.ZodNumber;
141
+ }, z.core.$strip>;
142
+ type TelegramChat = z.infer<typeof telegramChatSchema>;
143
+ /**
144
+ * The project's Telegram chats in this environment, and Domino's bot. `configured` is whether
145
+ * Domino configured its bot; without it no chat can be added.
146
+ *
147
+ * @compat output
148
+ */
149
+ declare const telegramChatsSchema: z.ZodObject<{
150
+ configured: z.ZodBoolean;
151
+ bot: z.ZodNullable<z.ZodObject<{
152
+ username: z.ZodString;
153
+ }, z.core.$strip>>;
154
+ chats: z.ZodArray<z.ZodObject<{
155
+ id: z.ZodString;
156
+ type: z.ZodString;
157
+ title: z.ZodString;
158
+ username: z.ZodNullable<z.ZodString>;
159
+ status: z.ZodString;
160
+ issue: z.ZodNullable<z.ZodString>;
161
+ connectedAt: z.ZodNumber;
162
+ }, z.core.$strip>>;
163
+ }, z.core.$strip>;
164
+ type TelegramChats = z.infer<typeof telegramChatsSchema>;
165
+ /**
166
+ * A chat installation in progress: open `url` in Telegram, start Domino's bot and choose the chat.
167
+ * It expires at `expiresAt`, epoch milliseconds.
168
+ *
169
+ * @compat output
170
+ */
171
+ declare const telegramChatConnectionSchema: z.ZodObject<{
172
+ url: z.ZodString;
173
+ expiresAt: z.ZodNumber;
174
+ }, z.core.$strip>;
175
+ type TelegramChatConnection = z.infer<typeof telegramChatConnectionSchema>;
176
+ /** `ctx.telegram.member({ chat })`: a chat the project bound, by its numeric ID or @username. */
177
+ declare const telegramMemberInputSchema: z.ZodObject<{
178
+ chat: z.ZodString;
179
+ }, z.core.$strict>;
180
+ /** A member's status in a chat as Telegram reports it; a later Telegram may add others. */
181
+ type TelegramChatMemberStatus = "creator" | "administrator" | "member" | "restricted" | (string & {});
182
+ /**
183
+ * The member's place in a Telegram chat, read with Domino's bot when quest code asks.
184
+ *
185
+ * @compat output
186
+ */
187
+ declare const telegramChatMemberSchema: z.ZodObject<{
188
+ userId: z.ZodString;
189
+ username: z.ZodNullable<z.ZodString>;
190
+ status: z.ZodCustom<TelegramChatMemberStatus, TelegramChatMemberStatus>;
191
+ isMember: z.ZodBoolean;
192
+ isAdmin: z.ZodBoolean;
193
+ untilDate: z.ZodNullable<z.ZodNumber>;
194
+ }, z.core.$strip>;
195
+ type TelegramChatMember = z.infer<typeof telegramChatMemberSchema>;
196
+ /**
197
+ * Reads a chat the project connected, for the member's linked Telegram account. The account is
198
+ * pinned at the attempt's first Telegram call, so later links and unlinks do not change the
199
+ * attempt; each call reads the chat as it is then. A chat the project has not connected, or whose bot lost access,
200
+ * throws `CapabilityError` with code `"integration-required"`; a Telegram outage throws
201
+ * `"provider-unavailable"`.
202
+ */
203
+ interface TelegramReader {
204
+ /** The member in `chat`; null when they are not in it or have not linked Telegram. */
205
+ member(input: {
206
+ chat: string;
207
+ }): Promise<TelegramChatMember | null>;
208
+ }
209
+ /**
210
+ * The namespace of the tracker source `telegram.reactions()` makes. Relay alone writes its
211
+ * records; ingestion into it is refused.
212
+ */
213
+ declare const telegramReactionsNamespace = "telegram-reactions";
214
+ /**
215
+ * One reaction a Telegram user added to a message, as a `telegram.reactions()` record's `data`.
216
+ * Every field is a scalar, so a trigger's `where` can select on it.
217
+ *
218
+ * @compat output
219
+ */
220
+ declare const telegramReactionDataSchema: z.ZodObject<{
221
+ chatId: z.ZodString;
222
+ chatType: z.ZodString;
223
+ messageId: z.ZodNumber;
224
+ reactionType: z.ZodString;
225
+ emoji: z.ZodNullable<z.ZodString>;
226
+ customEmojiId: z.ZodNullable<z.ZodString>;
227
+ reactorStatus: z.ZodString;
228
+ reactorIsAdmin: z.ZodBoolean;
229
+ }, z.core.$strip>;
230
+ type TelegramReactionData = z.infer<typeof telegramReactionDataSchema>;
231
+
232
+ declare const authProviderSchema: z.ZodEnum<{
233
+ discord: "discord";
234
+ google: "google";
235
+ apple: "apple";
236
+ x: "x";
237
+ }>;
238
+ type AuthProvider = z.infer<typeof authProviderSchema>;
239
+ declare const accountConnectionSchema: z.ZodObject<{
240
+ provider: z.ZodEnum<{
241
+ discord: "discord";
242
+ google: "google";
243
+ apple: "apple";
244
+ x: "x";
245
+ }>;
246
+ configured: z.ZodBoolean;
247
+ status: z.ZodEnum<{
248
+ disconnected: "disconnected";
249
+ connected: "connected";
250
+ reconnect: "reconnect";
251
+ }>;
252
+ subject: z.ZodNullable<z.ZodString>;
253
+ revision: z.ZodNumber;
254
+ }, z.core.$strip>;
255
+ type AccountConnection = z.infer<typeof accountConnectionSchema>;
256
+ declare const discordMemberInputSchema: z.ZodObject<{}, z.core.$strict>;
257
+ declare const discordMessageInputSchema: z.ZodObject<{
258
+ channelId: z.ZodString;
259
+ messageId: z.ZodString;
260
+ }, z.core.$strict>;
261
+ declare const discordMemberSchema: z.ZodObject<{
262
+ userId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
263
+ nickname: z.ZodDefault<z.ZodNullable<z.ZodString>>;
264
+ displayName: z.ZodDefault<z.ZodNullable<z.ZodString>>;
265
+ boostingSince: z.ZodDefault<z.ZodNullable<z.ZodString>>;
266
+ roles: z.ZodArray<z.ZodString>;
267
+ joinedAt: z.ZodNullable<z.ZodString>;
268
+ pending: z.ZodBoolean;
269
+ }, z.core.$strip>;
270
+ type DiscordMember = z.infer<typeof discordMemberSchema>;
271
+ /**
272
+ * Reads the project's connected Discord server for the member's linked Discord account. The
273
+ * account and the integration are pinned at the attempt's first Discord read: later links and
274
+ * unlinks do not change the attempt. Provider failures, and an integration that is not ready,
275
+ * throw `CapabilityError` with code `"provider-unavailable"`.
276
+ */
277
+ interface DiscordReader {
278
+ /** The member's server membership; null when they are not in the server or have not linked Discord. */
279
+ member(): Promise<DiscordMember | null>;
280
+ /**
281
+ * A message in the connected server; null when it does not exist. The bot reads it, so the
282
+ * member needs no linked Discord account. A channel outside the connected server, or one the
283
+ * bot cannot see, throws
284
+ * `CapabilityError` with code `"author-error"`.
285
+ */
286
+ message(input: {
287
+ channelId: string;
288
+ messageId: string;
289
+ }): Promise<DiscordMessage | null>;
290
+ }
291
+
292
+ export { type AccountConnection as A, discordRewardSchema as B, telegramAccountConnectionSchema as C, type DiscordMessageData as D, telegramChatConnectionSchema as E, telegramChatIdSchema as F, telegramChatMemberSchema as G, telegramChatSchema as H, telegramChatsSchema as I, telegramInitDataSchema as J, telegramMemberInputSchema as K, telegramMiniAppSignInSchema as L, telegramReactionDataSchema as M, telegramReactionsNamespace as N, telegramSignInMethodsSchema as O, type TelegramAccountConnection as T, type AuthProvider as a, type TelegramSignInMethods as b, type DiscordMessageTextData as c, discordMessagesSourceSchema as d, discordReactionsSourceSchema as e, type DiscordReactionData as f, type TelegramReader as g, type DiscordReader as h, type TelegramChatMember as i, type TelegramChatMemberStatus as j, type TelegramReactionData as k, type DiscordMember as l, type DiscordMessage as m, type TelegramChat as n, type TelegramChatConnection as o, type TelegramChats as p, accountConnectionSchema as q, authProviderSchema as r, discordMemberInputSchema as s, discordMemberSchema as t, discordMessageDataSchema as u, discordMessageInputSchema as v, discordMessageSchema as w, discordMessageTextDataSchema as x, discordReactionDataSchema as y, discordResourceSourceSchema as z };
@@ -1,4 +1,4 @@
1
- import { O as OpenIdentityKind } from './schema-Br3c1GOu.js';
1
+ import { O as OpenIdentityKind } from './schema-D57mhL2q.js';
2
2
  import { z } from 'zod';
3
3
 
4
4
  /** One capability call of the captured evaluation run, as Relay stored it. */
@@ -1,17 +1,18 @@
1
- import { x as xContentBodySchema, I as IdentityKind, n as customSourceSchema, W as WithRecordData, o as WithContent, p as WithAccountRoles, q as ResourceHandle, r as QuestHandle, L as LedgerReference, G as GroupHandle, u as TrackerSource, v as trackerDefinitionSchema, y as Tracker, z as TrackerData, B as SourceRoles, C as LedgerHandle, D as xSearchSourceSchema, X as XTweet, F as XContentMetric, H as TrackerTriggerPolicy, J as Where, N as MemberIdentity, U as TrackerTriggerContext, V as TrackerReader, Y as TextReviewInput, Z as TextResult, P as PhotoResult, _ as Decision, $ as rewardSchema, a0 as TrackerTriggerMode, a1 as RoleOf, a2 as WhereSetting, a3 as ContentBody, a4 as BadgeHandle, a5 as ContentMetricName, a6 as triggerSchema, d as QuestPresentation, e as QuestProfile, f as QuizEvidence, a7 as TieredRewardDefinition } from './schema-Br3c1GOu.js';
2
- export { a8 as LedgerSetting, a9 as TrackerDataSchema, aa as TrackerPage, ab as TrackerReadQuery, ac as trackerDataSchema, ad as trackerTriggerContextSchema } from './schema-Br3c1GOu.js';
1
+ import { x as xContentBodySchema, I as IdentityKind, n as customSourceSchema, W as WithRecordData, o as WithContent, p as WithAccountRoles, q as ResourceHandle, r as QuestHandle, L as LedgerReference, G as GroupHandle, u as TrackerSource, v as trackerDefinitionSchema, y as Tracker, z as TrackerData, B as SourceRoles, C as LedgerHandle, D as TrackerDataSchema, F as xSearchSourceSchema, X as XTweet, H as XContentMetric, J as TrackerTriggerPolicy, N as Where, U as MemberIdentity, V as TrackerTriggerContext, Y as TrackerReader, Z as TextReviewInput, _ as TextResult, P as PhotoResult, $ as Decision, a0 as rewardSchema, a1 as TrackerTriggerMode, a2 as RoleOf, a3 as WhereSetting, a4 as ContentBody, a5 as BadgeHandle, a6 as ContentMetricName, a7 as triggerSchema, d as QuestPresentation, e as QuestProfile, f as QuizEvidence, a8 as TieredRewardDefinition } from './schema-D57mhL2q.js';
2
+ export { a9 as LedgerSetting, aa as TrackerPage, ab as TrackerReadQuery, ac as trackerDataSchema, ad as trackerTriggerContextSchema } from './schema-D57mhL2q.js';
3
3
  import { z } from 'zod';
4
4
  export { z } from 'zod';
5
- import { f as badgeDeclarationSchema, B as Badge } from './offers-CPqiF3dZ.js';
6
- export { g as defineOffer } from './offers-CPqiF3dZ.js';
7
- import { E as EngagementBudget, q as leaderboardDefinitionSchema, r as AuthoringIdentity, s as pointLedgerDeclarationSchema, t as referralAuthoringSchema, C as CampaignDefinition, A as AvailabilityWindow } from './groups-jLLG7MML.js';
8
- export { u as defineCampaign, v as defineGroup } from './groups-jLLG7MML.js';
9
- import { d as discordMessagesSourceSchema, D as DiscordMessageData, b as DiscordMessageTextData, c as discordReactionsSourceSchema, e as DiscordReactionData, f as DiscordReader } from './accounts-5ciAkCMP.js';
5
+ import { f as badgeDeclarationSchema, B as Badge } from './offers-CEwkAGsB.js';
6
+ export { g as defineOffer } from './offers-CEwkAGsB.js';
7
+ import { E as EngagementBudget, q as leaderboardDefinitionSchema, r as AuthoringIdentity, s as pointLedgerDeclarationSchema, t as referralAuthoringSchema, C as CampaignDefinition, A as AvailabilityWindow } from './groups-CfyRewkJ.js';
8
+ export { u as defineCampaign, v as defineGroup } from './groups-CfyRewkJ.js';
9
+ import { d as discordMessagesSourceSchema, D as DiscordMessageData, c as DiscordMessageTextData, e as discordReactionsSourceSchema, f as DiscordReactionData, g as TelegramReader, h as DiscordReader } from './accounts-B31dWEYD.js';
10
+ export { i as TelegramChatMember, j as TelegramChatMemberStatus, k as TelegramReactionData } from './accounts-B31dWEYD.js';
10
11
  import { Q as QuizContent, a as StreakPolicy } from './streaks-CWyq8Px5.js';
11
- import { R as ResourceSource, S as Setting, I as IntegrationModule, B as Budget, a as IntegerSettings } from './integrations-Cr9EhGI_.js';
12
- import { P as Prerequisite, T as TextEvidence, U as UrlEvidence, a as TextOptions, b as UrlOptions } from './submission-input-BEJ9qENg.js';
13
- export { c as balanceAtLeast, d as completed, i as inGroup } from './submission-input-BEJ9qENg.js';
14
- import { I as ImageReader } from './images-BPiPqVKn.js';
12
+ import { R as ResourceSource, S as Setting, I as IntegrationModule, B as Budget, a as IntegerSettings } from './integrations-BMNtARU_.js';
13
+ import { P as Prerequisite, T as TextEvidence, U as UrlEvidence, a as TextOptions, b as UrlOptions } from './submission-input-DjXg0o-r.js';
14
+ export { c as balanceAtLeast, d as completed, i as inGroup } from './submission-input-DjXg0o-r.js';
15
+ import { I as ImageReader } from './images-DwNmzqWv.js';
15
16
  import { X as XReader } from './capability-error-oTd3eYFH.js';
16
17
  export { C as CapabilityError, a as CapabilityErrorCode, c as capabilityErrorCodes } from './capability-error-oTd3eYFH.js';
17
18
  import { h as WalletReader } from './wallet-CDyo-U4n.js';
@@ -257,8 +258,8 @@ declare function defineLeaderboard(input: Omit<LeaderboardInput, "key" | "id" |
257
258
  kind: "earned";
258
259
  }> | ReturnType<typeof earned>;
259
260
  }): {
260
- title: string;
261
261
  balance: string;
262
+ title: string;
262
263
  access: "participants" | "public";
263
264
  score: {
264
265
  kind: "balance";
@@ -427,6 +428,41 @@ declare const discord: {
427
428
  types?: ChannelTypes;
428
429
  }): ResourceSource;
429
430
  };
431
+ /**
432
+ * Telegram, through Domino's bot in the chats a project connects in Console.
433
+ *
434
+ * - `telegram.reactions()`: a tracker source of the reactions members add to messages in those
435
+ * groups and supergroups. Each record is one added reaction: its `author` is the reactor and
436
+ * its `messageAuthor` account is the message's author, both Telegram accounts. `data` is
437
+ * `TelegramReactionData`, so a trigger can select an emoji or an administrator's reactions.
438
+ * Pay the message's author with `automatic({ tracker, beneficiary: "messageAuthor" })`.
439
+ * - Quests read membership with `ctx.telegram.member({ chat })`, naming the chat with
440
+ * `settings.telegramChat()`.
441
+ *
442
+ * In SDK 1.x the reactions source is a custom source whose namespace Relay reserves: only Relay
443
+ * writes its records, and the accounts on them are Telegram accounts whatever `identities` says.
444
+ */
445
+ declare const telegram: {
446
+ reactions(): {
447
+ kind: "custom";
448
+ namespace: string;
449
+ identities?: ("discord" | "wallet" | "x" | "member" | `app:${string}`)[] | undefined;
450
+ accounts?: string[] | undefined;
451
+ data?: TrackerDataSchema | undefined;
452
+ content?: {
453
+ metrics: string[];
454
+ } | undefined;
455
+ } & WithRecordData<{
456
+ chatId: string;
457
+ chatType: string;
458
+ messageId: number;
459
+ reactionType: string;
460
+ emoji: string | null;
461
+ customEmojiId: string | null;
462
+ reactorStatus: string;
463
+ reactorIsAdmin: boolean;
464
+ }> & WithAccountRoles<"author" | "messageAuthor">;
465
+ };
430
466
  declare const pointLedgers: () => ResourceSource;
431
467
  type Label = {
432
468
  label: string;
@@ -460,6 +496,13 @@ declare const settings: {
460
496
  maxLength?: number;
461
497
  multiline?: boolean;
462
498
  }): Setting<"text", z.ZodDefault<z.ZodString>>;
499
+ /**
500
+ * A Telegram chat the project connected, by its numeric ID: Console lists the connected chats
501
+ * to choose from. Pass it to `ctx.telegram.member({ chat })`.
502
+ */
503
+ telegramChat(options: Label & {
504
+ default?: string;
505
+ }): Setting<"text", z.ZodDefault<z.ZodString>>;
463
506
  integer(options: Label & {
464
507
  default: number;
465
508
  min: number;
@@ -930,6 +973,12 @@ type EvaluationContext<T, I = {
930
973
  }): Promise<PhotoResult>;
931
974
  };
932
975
  wallet: WalletReader;
976
+ /**
977
+ * Telegram membership in the chats the project connected. It needs no `integrations` entry;
978
+ * Relay provides it to every quest from SDK 1.22.0 on, and it is absent from older runtimes and
979
+ * test contexts that do not supply it.
980
+ */
981
+ telegram?: TelegramReader;
933
982
  } & IntegrationReaders<D>;
934
983
  type Evaluator<T, I = {
935
984
  photo: string;
@@ -1048,15 +1097,15 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1048
1097
  badge?: string | undefined;
1049
1098
  };
1050
1099
  tier: string;
1100
+ } | {
1101
+ kind: "points";
1102
+ balance: string;
1103
+ amount: number;
1051
1104
  } | {
1052
1105
  kind: "integration";
1053
1106
  provider: "discord";
1054
1107
  action: "grant-role";
1055
1108
  roleId: string;
1056
- } | {
1057
- kind: "points";
1058
- balance: string;
1059
- amount: number;
1060
1109
  })[] | ((ctx: {
1061
1110
  settings: z.core.$InferObjectOutput<T, {}>;
1062
1111
  }) => Reward[]);
@@ -1131,6 +1180,9 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1131
1180
  kind: "resource";
1132
1181
  default: string;
1133
1182
  source: {
1183
+ provider: "domino";
1184
+ resource: "point-ledger";
1185
+ } | {
1134
1186
  provider: "discord";
1135
1187
  resource: "channel";
1136
1188
  types: ("text" | "announcement")[];
@@ -1138,9 +1190,6 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1138
1190
  provider: "discord";
1139
1191
  resource: "role";
1140
1192
  assignable: boolean;
1141
- } | {
1142
- provider: "domino";
1143
- resource: "point-ledger";
1144
1193
  };
1145
1194
  label: string;
1146
1195
  description?: string | undefined;
@@ -1164,6 +1213,7 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1164
1213
  maxLength: number;
1165
1214
  multiline: boolean;
1166
1215
  label: string;
1216
+ picker?: string | undefined;
1167
1217
  description?: string | undefined;
1168
1218
  } | {
1169
1219
  kind: "integer";
@@ -1213,15 +1263,15 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1213
1263
  badge?: string | undefined;
1214
1264
  };
1215
1265
  tier: string;
1266
+ } | {
1267
+ kind: "points";
1268
+ balance: string;
1269
+ amount: number;
1216
1270
  } | {
1217
1271
  kind: "integration";
1218
1272
  provider: "discord";
1219
1273
  action: "grant-role";
1220
1274
  roleId: string;
1221
- } | {
1222
- kind: "points";
1223
- balance: string;
1224
- amount: number;
1225
1275
  })[];
1226
1276
  humanReview: boolean;
1227
1277
  trigger: {
@@ -1243,7 +1293,7 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1243
1293
  actor?: "staff" | "member" | undefined;
1244
1294
  } | {
1245
1295
  kind: "manual";
1246
- input: "none" | "quiz" | "photo";
1296
+ input: "photo" | "quiz" | "none";
1247
1297
  actor?: "staff" | "member" | undefined;
1248
1298
  } | {
1249
1299
  kind: "automatic";
@@ -1287,9 +1337,9 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1287
1337
  path: string;
1288
1338
  equals: string | number | boolean;
1289
1339
  })[] | undefined;
1290
- enrollment?: "none" | "required" | undefined;
1340
+ enrollment?: "required" | "none" | undefined;
1291
1341
  since?: "activation" | "window" | "enrollment" | undefined;
1292
- historical?: "staff" | "claim" | "automatic" | undefined;
1342
+ historical?: "automatic" | "staff" | "claim" | undefined;
1293
1343
  content?: true | undefined;
1294
1344
  } | undefined;
1295
1345
  };
@@ -1312,6 +1362,9 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1312
1362
  title: string;
1313
1363
  })[];
1314
1364
  completion: {
1365
+ kind: "streak";
1366
+ days: number;
1367
+ } | {
1315
1368
  kind: "progress";
1316
1369
  goal: {
1317
1370
  kind: "count";
@@ -1328,9 +1381,6 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1328
1381
  durationMs: number;
1329
1382
  };
1330
1383
  repeat: "repeat" | "once";
1331
- } | {
1332
- kind: "streak";
1333
- days: number;
1334
1384
  } | {
1335
1385
  kind: "once";
1336
1386
  } | {
@@ -1356,7 +1406,7 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1356
1406
  campaign?: {
1357
1407
  key: string;
1358
1408
  title: string;
1359
- enrollment: "none" | "required";
1409
+ enrollment: "required" | "none";
1360
1410
  window?: {
1361
1411
  from: number;
1362
1412
  until: number;
@@ -1406,6 +1456,12 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1406
1456
  }): Promise<PhotoResult>;
1407
1457
  };
1408
1458
  wallet: WalletReader;
1459
+ /**
1460
+ * Telegram membership in the chats the project connected. It needs no `integrations` entry;
1461
+ * Relay provides it to every quest from SDK 1.22.0 on, and it is absent from older runtimes and
1462
+ * test contexts that do not supply it.
1463
+ */
1464
+ telegram?: TelegramReader;
1409
1465
  } & IntegrationReaders<readonly IntegrationModule[]> & {
1410
1466
  rewards: Reward[];
1411
1467
  humanReview: boolean;
@@ -1465,15 +1521,15 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1465
1521
  badge?: string | undefined;
1466
1522
  };
1467
1523
  tier: string;
1524
+ } | {
1525
+ kind: "points";
1526
+ balance: string;
1527
+ amount: number;
1468
1528
  } | {
1469
1529
  kind: "integration";
1470
1530
  provider: "discord";
1471
1531
  action: "grant-role";
1472
1532
  roleId: string;
1473
- } | {
1474
- kind: "points";
1475
- balance: string;
1476
- amount: number;
1477
1533
  })[] | ((ctx: {
1478
1534
  settings: z.core.$InferObjectOutput<T, {}>;
1479
1535
  }) => Reward[]);
@@ -1548,6 +1604,9 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1548
1604
  kind: "resource";
1549
1605
  default: string;
1550
1606
  source: {
1607
+ provider: "domino";
1608
+ resource: "point-ledger";
1609
+ } | {
1551
1610
  provider: "discord";
1552
1611
  resource: "channel";
1553
1612
  types: ("text" | "announcement")[];
@@ -1555,9 +1614,6 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1555
1614
  provider: "discord";
1556
1615
  resource: "role";
1557
1616
  assignable: boolean;
1558
- } | {
1559
- provider: "domino";
1560
- resource: "point-ledger";
1561
1617
  };
1562
1618
  label: string;
1563
1619
  description?: string | undefined;
@@ -1581,6 +1637,7 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1581
1637
  maxLength: number;
1582
1638
  multiline: boolean;
1583
1639
  label: string;
1640
+ picker?: string | undefined;
1584
1641
  description?: string | undefined;
1585
1642
  } | {
1586
1643
  kind: "integer";
@@ -1630,15 +1687,15 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1630
1687
  badge?: string | undefined;
1631
1688
  };
1632
1689
  tier: string;
1690
+ } | {
1691
+ kind: "points";
1692
+ balance: string;
1693
+ amount: number;
1633
1694
  } | {
1634
1695
  kind: "integration";
1635
1696
  provider: "discord";
1636
1697
  action: "grant-role";
1637
1698
  roleId: string;
1638
- } | {
1639
- kind: "points";
1640
- balance: string;
1641
- amount: number;
1642
1699
  })[];
1643
1700
  humanReview: boolean;
1644
1701
  trigger: {
@@ -1660,7 +1717,7 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1660
1717
  actor?: "staff" | "member" | undefined;
1661
1718
  } | {
1662
1719
  kind: "manual";
1663
- input: "none" | "quiz" | "photo";
1720
+ input: "photo" | "quiz" | "none";
1664
1721
  actor?: "staff" | "member" | undefined;
1665
1722
  } | {
1666
1723
  kind: "automatic";
@@ -1704,9 +1761,9 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1704
1761
  path: string;
1705
1762
  equals: string | number | boolean;
1706
1763
  })[] | undefined;
1707
- enrollment?: "none" | "required" | undefined;
1764
+ enrollment?: "required" | "none" | undefined;
1708
1765
  since?: "activation" | "window" | "enrollment" | undefined;
1709
- historical?: "staff" | "claim" | "automatic" | undefined;
1766
+ historical?: "automatic" | "staff" | "claim" | undefined;
1710
1767
  content?: true | undefined;
1711
1768
  } | undefined;
1712
1769
  };
@@ -1729,6 +1786,9 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1729
1786
  title: string;
1730
1787
  })[];
1731
1788
  completion: {
1789
+ kind: "streak";
1790
+ days: number;
1791
+ } | {
1732
1792
  kind: "progress";
1733
1793
  goal: {
1734
1794
  kind: "count";
@@ -1745,9 +1805,6 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1745
1805
  durationMs: number;
1746
1806
  };
1747
1807
  repeat: "repeat" | "once";
1748
- } | {
1749
- kind: "streak";
1750
- days: number;
1751
1808
  } | {
1752
1809
  kind: "once";
1753
1810
  } | {
@@ -1773,7 +1830,7 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1773
1830
  campaign?: {
1774
1831
  key: string;
1775
1832
  title: string;
1776
- enrollment: "none" | "required";
1833
+ enrollment: "required" | "none";
1777
1834
  window?: {
1778
1835
  from: number;
1779
1836
  until: number;
@@ -1823,6 +1880,12 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1823
1880
  }): Promise<PhotoResult>;
1824
1881
  };
1825
1882
  wallet: WalletReader;
1883
+ /**
1884
+ * Telegram membership in the chats the project connected. It needs no `integrations` entry;
1885
+ * Relay provides it to every quest from SDK 1.22.0 on, and it is absent from older runtimes and
1886
+ * test contexts that do not supply it.
1887
+ */
1888
+ telegram?: TelegramReader;
1826
1889
  } & IntegrationReaders<readonly IntegrationModule[]> & {
1827
1890
  rewards: Reward[];
1828
1891
  humanReview: boolean;
@@ -1830,4 +1893,4 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1830
1893
  }): Promise<Decision>;
1831
1894
  } & ResourceHandle<"quest">;
1832
1895
 
1833
- export { ContentBody, type ContentData, ContentMetricName, type ContentTrigger, type ContentTriggerInput, DiscordMessageData, DiscordMessageTextData, DiscordReactionData, DiscordReader, type EvaluationCalendar, type EvaluationCalendarDay, type EvaluationContext, type EvaluationMember, GroupHandle, IdentityKind, ImageReader, IntegrationModule, type KeyedContext, LedgerHandle, LedgerReference, MemberIdentity, type Outcome, type PerformanceContext, type PerformanceOutcome, QuestHandle, RoleOf, Setting, Tracker, TrackerData, TrackerReader, type TrackerTrigger, TrackerTriggerContext, type TrackerTriggerInput, type TriggerAdmission, WalletReader, Where, type XContentBody, XReader, automatic, automaticFulfillment, badge, budget, calendar, content, count, customSource, decision, defineBadge, defineEngagementReward, defineLeaderboard, defineLedger, defineQuest, defineQuestType, defineReferral, defineTieredReward, defineTracker, discord, earned, evaluators, evidence, keyed, manual, once, pointLedgers, points, progress, questCompleted, rolling, settings, staffHandover, streak, untracked, x };
1896
+ export { ContentBody, type ContentData, ContentMetricName, type ContentTrigger, type ContentTriggerInput, DiscordMessageData, DiscordMessageTextData, DiscordReactionData, DiscordReader, type EvaluationCalendar, type EvaluationCalendarDay, type EvaluationContext, type EvaluationMember, GroupHandle, IdentityKind, ImageReader, IntegrationModule, type KeyedContext, LedgerHandle, LedgerReference, MemberIdentity, type Outcome, type PerformanceContext, type PerformanceOutcome, QuestHandle, RoleOf, Setting, TelegramReader, Tracker, TrackerData, TrackerDataSchema, TrackerReader, type TrackerTrigger, TrackerTriggerContext, type TrackerTriggerInput, type TriggerAdmission, WalletReader, Where, type XContentBody, XReader, automatic, automaticFulfillment, badge, budget, calendar, content, count, customSource, decision, defineBadge, defineEngagementReward, defineLeaderboard, defineLedger, defineQuest, defineQuestType, defineReferral, defineTieredReward, defineTracker, discord, earned, evaluators, evidence, keyed, manual, once, pointLedgers, points, progress, questCompleted, rolling, settings, staffHandover, streak, telegram, untracked, x };