@domino-sdk/relay 1.56.0 → 1.60.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 (65) hide show
  1. package/CHANGELOG.md +100 -0
  2. package/dist/{accounts-DRPENuZe.d.ts → accounts-DoabriBX.d.ts} +21 -7
  3. package/dist/{attempt-captures-CxxO7DeD.d.ts → attempt-captures-W2dgzGqE.d.ts} +1 -1
  4. package/dist/authoring.d.ts +323 -39
  5. package/dist/authoring.js +312 -18
  6. package/dist/{automatic-outcomes-DxW_v5Wc.d.ts → automatic-outcomes-Cmou89IS.d.ts} +1 -1
  7. package/dist/avatar.d.ts +1 -2
  8. package/dist/browser.d.ts +19 -11
  9. package/dist/browser.js +12 -10
  10. package/dist/{capability-error-DSd8EMQC.d.ts → capability-error-DufwG3G0.d.ts} +21 -7
  11. package/dist/{chunk-OTITLABX.js → chunk-2FHNY52R.js} +8 -2
  12. package/dist/{chunk-QNQNKIAA.js → chunk-422J3QRW.js} +12 -2
  13. package/dist/{chunk-INSWI2VZ.js → chunk-4OFH4BNX.js} +1 -1
  14. package/dist/{chunk-KBVH4XZC.js → chunk-6ZG7WNYX.js} +1 -1
  15. package/dist/{chunk-BHHUSBSD.js → chunk-GBSDAD3N.js} +1627 -887
  16. package/dist/{chunk-W5U2WXG3.js → chunk-KUPVQXUJ.js} +2 -2
  17. package/dist/{chunk-G6XVBYH7.js → chunk-KWFY7L7X.js} +4 -4
  18. package/dist/{chunk-BJYMTCWG.js → chunk-MJEJQH5A.js} +18 -6
  19. package/dist/{chunk-ULQU7KC4.js → chunk-N3LJ6GFK.js} +1 -5
  20. package/dist/{chunk-ABJ4G47X.js → chunk-N7YOS4ZU.js} +1 -1
  21. package/dist/{chunk-MNU6UPXY.js → chunk-OTEUP2SG.js} +1 -1
  22. package/dist/{chunk-NK6EER33.js → chunk-VVRQQRMQ.js} +12 -12
  23. package/dist/{chunk-H2MD6E7Z.js → chunk-VWMIA2TT.js} +8 -2
  24. package/dist/{chunk-RBPMT53S.js → chunk-XQKUJL7H.js} +25 -5
  25. package/dist/{chunk-CXKXPB7K.js → chunk-Y2IGFLD2.js} +36 -11
  26. package/dist/{chunk-VSHV7FEA.js → chunk-YNW2ZUUP.js} +56 -153
  27. package/dist/{chunk-CK7HO32Z.js → chunk-YOAPPIWN.js} +2 -2
  28. package/dist/{client-bX3oTpRu.d.ts → client-Cw1pB5sv.d.ts} +121 -117
  29. package/dist/{deployments-D3lxfQMB.d.ts → deployments-DI-W7fBq.d.ts} +1105 -182
  30. package/dist/{groups-DPE004_V.d.ts → groups-9Jm3peq3.d.ts} +14 -7
  31. package/dist/index.d.ts +10 -11
  32. package/dist/index.js +9 -9
  33. package/dist/{integrations-CcD5NPEA.d.ts → integrations-CmIkP1Gi.d.ts} +48 -32
  34. package/dist/internal.d.ts +10 -10
  35. package/dist/internal.js +8 -8
  36. package/dist/{offers-CtzMeB7O.d.ts → offers-CqXfMIxq.d.ts} +7 -2
  37. package/dist/{pages-BlLqB8ZQ.d.ts → pages-Bti7g5mX.d.ts} +184 -10
  38. package/dist/{participant-activity-iciCEs_8.d.ts → participant-activity-DHL8QYks.d.ts} +4 -0
  39. package/dist/portal-proxy.js +3 -3
  40. package/dist/react/index.d.ts +74 -74
  41. package/dist/react/index.js +10 -10
  42. package/dist/runtime/authoring.js +1 -1
  43. package/dist/runtime/chunks/ADUMK6CR.js +1 -0
  44. package/dist/runtime/chunks/EWU4OKSY.js +62 -0
  45. package/dist/runtime/manifest.json +5 -5
  46. package/dist/runtime/schema.js +1 -1
  47. package/dist/runtime/zod.js +1 -1
  48. package/dist/{schema-C4m9RhCR.d.ts → schema-CwbRkmlr.d.ts} +324 -35
  49. package/dist/schema.d.ts +854 -437
  50. package/dist/schema.js +103 -25
  51. package/dist/server/index.d.ts +10 -10
  52. package/dist/server/index.js +711 -81
  53. package/dist/{submission-input-wTiYGdgA.d.ts → submission-input-D9EGH_yb.d.ts} +2 -2
  54. package/dist/{telegram-browser-Bh3i0HiH.d.ts → telegram-browser-CTJh4Ro_.d.ts} +4 -4
  55. package/dist/testing.d.ts +89 -9
  56. package/dist/testing.js +218 -13
  57. package/dist/{transport-CnKA-_RL.d.ts → transport-B8Ss5lcz.d.ts} +9189 -2009
  58. package/dist/wallet-DZWL7lJH.d.ts +972 -0
  59. package/dist/{x-1czZFVUW.d.ts → x-KFJD2x8y.d.ts} +3 -3
  60. package/package.json +2 -2
  61. package/dist/profiles-BoOK03cR.d.ts +0 -299
  62. package/dist/runtime/chunks/IDOMZWRY.js +0 -40
  63. package/dist/runtime/chunks/NDB42VFF.js +0 -1
  64. package/dist/util.d-w9f9t3ua.d.ts +0 -5
  65. package/dist/wallet-Ac7OFpOr.d.ts +0 -228
@@ -1,8 +1,7 @@
1
1
  import {
2
- accountConnectionSchema,
3
2
  identifier,
4
3
  pageCursorSchema
5
- } from "./chunk-BHHUSBSD.js";
4
+ } from "./chunk-GBSDAD3N.js";
6
5
 
7
6
  // src/point-ledgers.ts
8
7
  import * as z from "zod";
@@ -70,217 +69,133 @@ var pointHistoryPageSchema = z.object({
70
69
  nextCursor: pageCursorSchema.nullable()
71
70
  });
72
71
 
73
- // src/telegram.ts
74
- import * as z2 from "zod";
75
- var telegramSignInMethodsSchema = z2.object({
76
- /** Telegram Login, the OpenID Connect sign-in Domino configures for the platform. */
77
- login: z2.boolean(),
78
- /** Mini App sign-in, which the project enables in Console with its bot's ID. */
79
- miniApp: z2.boolean()
80
- });
81
- var telegramAccountConnectionSchema = accountConnectionSchema.extend({
82
- provider: z2.literal("telegram")
83
- });
84
- var telegramInitDataSchema = z2.string().min(1, "Pass the Mini App's Telegram.WebApp.initData").max(8192);
85
- var telegramMiniAppSignInSchema = z2.object({
86
- initData: telegramInitDataSchema,
87
- mode: z2.enum(["sign-in", "connect"])
88
- }).strict();
89
- var telegramChatIdSchema = z2.string().regex(
90
- /^-?[1-9][0-9]{0,19}$/,
91
- "Use the chat's numeric ID, such as -1001234567890"
92
- );
93
- var telegramChatSchema = z2.object({
94
- /** The numeric chat ID, as a string. */
95
- id: telegramChatIdSchema,
96
- /** `group`, `supergroup` or `channel`; a later Telegram may add others. */
97
- type: z2.string(),
98
- title: z2.string(),
99
- /** The public @username, without the @, or null for a private chat. */
100
- username: z2.string().nullable(),
101
- status: z2.string(),
102
- issue: z2.string().nullable(),
103
- connectedAt: z2.number()
104
- });
105
- var telegramChatsSchema = z2.object({
106
- configured: z2.boolean(),
107
- /** Domino's bot, the one operators add to their chats. */
108
- bot: z2.object({ username: z2.string() }).nullable(),
109
- chats: z2.array(telegramChatSchema)
110
- });
111
- var telegramChatConnectionSchema = z2.object({
112
- url: z2.string(),
113
- expiresAt: z2.number()
114
- });
115
- var telegramMemberInputSchema = z2.object({
116
- chat: z2.string().regex(
117
- /^(-?[1-9][0-9]{0,19}|@[A-Za-z][A-Za-z0-9_]{3,31})$/,
118
- "Name a chat the project connected, by its numeric ID or @username"
119
- )
120
- }).strict();
121
- var telegramChatMemberSchema = z2.object({
122
- /** The numeric Telegram user ID. */
123
- userId: z2.string(),
124
- username: z2.string().nullable(),
125
- status: z2.custom(
126
- (value) => typeof value === "string"
127
- ),
128
- /** Whether they are in the chat now: a creator, administrator, member, or restricted member. */
129
- isMember: z2.boolean(),
130
- /** Whether they are its creator or an administrator. */
131
- isAdmin: z2.boolean(),
132
- /** When a paid subscription or a restriction ends, epoch milliseconds; null when it does not. */
133
- untilDate: z2.number().nullable()
134
- });
135
- var telegramReactionsNamespace = "telegram-reactions";
136
- var telegramReactionDataSchema = z2.object({
137
- /** The chat's numeric ID, as a string. */
138
- chatId: z2.string(),
139
- /** `group` or `supergroup`: channel reactions are anonymous and never recorded. */
140
- chatType: z2.string(),
141
- messageId: z2.number(),
142
- /** `emoji`, `custom_emoji` or `paid`. */
143
- reactionType: z2.string(),
144
- /** The emoji, such as "❤", for an `emoji` reaction; null otherwise. */
145
- emoji: z2.string().nullable(),
146
- /** The custom emoji's ID for a `custom_emoji` reaction; null otherwise. */
147
- customEmojiId: z2.string().nullable(),
148
- /**
149
- * `creator` or `administrator` for one of the chat's administrators, read at most ten minutes
150
- * before Relay recorded the reaction; `member` for anyone else.
151
- */
152
- reactorStatus: z2.string(),
153
- /** Whether the reactor was the chat's creator or an administrator then. */
154
- reactorIsAdmin: z2.boolean()
155
- });
156
-
157
72
  // src/profiles.ts
158
- import * as z3 from "zod";
159
- var count = z3.number().int().nonnegative().safe();
160
- var profileVisibilitySchema = z3.enum([
73
+ import * as z2 from "zod";
74
+ var count = z2.number().int().nonnegative().safe();
75
+ var profileVisibilitySchema = z2.enum([
161
76
  "private",
162
77
  "participants",
163
78
  "public"
164
79
  ]);
165
- var avatarProviderSchema = z3.enum(["x", "discord", "google"]);
166
- var profileDefaultProviderSchema = z3.enum(["x", "discord"]);
167
- var profileDefaultsSchema = z3.array(profileDefaultProviderSchema).max(profileDefaultProviderSchema.options.length).refine(
80
+ var avatarProviderSchema = z2.enum(["x", "discord", "google"]);
81
+ var profileDefaultProviderSchema = z2.enum(["x", "discord"]);
82
+ var profileDefaultsSchema = z2.array(profileDefaultProviderSchema).max(profileDefaultProviderSchema.options.length).refine(
168
83
  (providers) => new Set(providers).size === providers.length,
169
84
  "List each provider once"
170
85
  );
171
- var avatarSeedSchema = z3.string().min(1).max(100);
172
- var profileAvatarSchema = z3.discriminatedUnion("source", [
173
- z3.object({
174
- source: z3.literal("upload"),
175
- url: z3.string().url(),
86
+ var avatarSeedSchema = z2.string().min(1).max(100);
87
+ var profileAvatarSchema = z2.discriminatedUnion("source", [
88
+ z2.object({
89
+ source: z2.literal("upload"),
90
+ url: z2.string().url(),
176
91
  seed: avatarSeedSchema
177
92
  }),
178
- z3.object({
179
- source: z3.literal("account"),
93
+ z2.object({
94
+ source: z2.literal("account"),
180
95
  provider: avatarProviderSchema,
181
- url: z3.string().url(),
96
+ url: z2.string().url(),
182
97
  seed: avatarSeedSchema
183
98
  }),
184
- z3.object({ source: z3.literal("generated"), seed: avatarSeedSchema })
99
+ z2.object({ source: z2.literal("generated"), seed: avatarSeedSchema })
185
100
  ]);
186
- var profileSummarySchema = z3.object({
101
+ var profileSummarySchema = z2.object({
187
102
  id: identifier,
188
- name: z3.string(),
103
+ name: z2.string(),
189
104
  avatar: profileAvatarSchema
190
105
  });
191
106
  var invisible = /[\p{Cc}؜᠎​-‏‪-‮⁠-⁤⁦-⁩]/u;
192
- var displayNameSchema = z3.string().max(200).transform((value) => value.normalize("NFC").replace(/\s+/g, " ").trim()).pipe(
193
- z3.string().min(1, "Enter a name").max(40, "Use at most 40 characters").refine((value) => !invisible.test(value), "Use visible characters only")
107
+ var displayNameSchema = z2.string().max(200).transform((value) => value.normalize("NFC").replace(/\s+/g, " ").trim()).pipe(
108
+ z2.string().min(1, "Enter a name").max(40, "Use at most 40 characters").refine((value) => !invisible.test(value), "Use visible characters only")
194
109
  );
195
- var profileUpdateSchema = z3.object({
110
+ var profileUpdateSchema = z2.object({
196
111
  displayName: displayNameSchema.nullable().optional(),
197
- avatar: z3.discriminatedUnion("source", [
198
- z3.object({
199
- source: z3.literal("account"),
112
+ avatar: z2.discriminatedUnion("source", [
113
+ z2.object({
114
+ source: z2.literal("account"),
200
115
  provider: avatarProviderSchema
201
116
  }).strict(),
202
- z3.object({ source: z3.literal("generated") }).strict()
117
+ z2.object({ source: z2.literal("generated") }).strict()
203
118
  ]).nullable().optional(),
204
- hidden: z3.boolean().optional()
119
+ hidden: z2.boolean().optional()
205
120
  }).strict().refine(
206
121
  (value) => Object.values(value).some((field) => field !== void 0),
207
122
  "Change at least one field"
208
123
  );
209
124
  var ownProfileSchema = profileSummarySchema.extend({
210
125
  /** The name the member chose, or null for the default. */
211
- displayName: z3.string().nullable(),
126
+ displayName: z2.string().nullable(),
212
127
  /** The avatar the member chose: `default` follows the project's defaults. */
213
- avatarChoice: z3.enum(["default", "upload", "account", "generated"]),
128
+ avatarChoice: z2.enum(["default", "upload", "account", "generated"]),
214
129
  /** The account of an `account` choice. */
215
130
  avatarProvider: avatarProviderSchema.nullable(),
216
- hidden: z3.boolean(),
131
+ hidden: z2.boolean(),
217
132
  /** An operator locked the name and avatar; the member can still hide the profile. */
218
- locked: z3.boolean(),
133
+ locked: z2.boolean(),
219
134
  /** Who can see profiles in this project, so the app can explain it. */
220
135
  visibility: profileVisibilitySchema,
221
136
  /** The member's connected accounts a picture or name can come from. */
222
- options: z3.array(
223
- z3.object({
137
+ options: z2.array(
138
+ z2.object({
224
139
  provider: avatarProviderSchema,
225
- name: z3.string().nullable(),
140
+ name: z2.string().nullable(),
226
141
  /**
227
142
  * The account's first name, where the provider sends one (Google does; X and Discord don't).
228
143
  * Only the member's own profile carries it.
229
144
  */
230
- givenName: z3.string().nullable().default(null),
231
- imageUrl: z3.string().url().nullable()
145
+ givenName: z2.string().nullable().default(null),
146
+ imageUrl: z2.string().url().nullable()
232
147
  })
233
148
  )
234
149
  });
235
- var cursor = z3.string().min(1).max(512);
236
- var profileCompletionQuerySchema = z3.object({
237
- limit: z3.coerce.number().int().min(1).max(100).default(20),
150
+ var cursor = z2.string().min(1).max(512);
151
+ var profileCompletionQuerySchema = z2.object({
152
+ limit: z2.coerce.number().int().min(1).max(100).default(20),
238
153
  cursor: cursor.optional()
239
154
  }).strict();
240
- var profileCompletionSchema = z3.object({
155
+ var profileCompletionSchema = z2.object({
241
156
  quest: identifier,
242
157
  key: identifier.optional(),
243
- title: z3.string(),
158
+ title: z2.string(),
244
159
  completions: count.positive(),
245
160
  /** Null for completions recorded before completion times were. */
246
161
  lastCompletedAt: count.nullable()
247
162
  });
248
- var profileCompletionPageSchema = z3.object({
249
- items: z3.array(profileCompletionSchema),
163
+ var profileCompletionPageSchema = z2.object({
164
+ items: z2.array(profileCompletionSchema),
250
165
  nextCursor: cursor.nullable()
251
166
  });
252
- var profileReferralSchema = z3.object({
167
+ var profileReferralSchema = z2.object({
253
168
  program: identifier,
254
169
  key: identifier.optional(),
255
- title: z3.string(),
170
+ title: z2.string(),
256
171
  /** Members this member invited. Invitations are shared by every program. */
257
172
  invited: count,
258
173
  /** Invited members who qualified in this program. */
259
174
  qualified: count,
260
- milestones: z3.array(
261
- z3.object({ id: identifier, count, reached: z3.boolean() })
175
+ milestones: z2.array(
176
+ z2.object({ id: identifier, count, reached: z2.boolean() })
262
177
  )
263
178
  });
264
- var profileSettingsSchema = z3.object({
179
+ var profileSettingsSchema = z2.object({
265
180
  visibility: profileVisibilitySchema,
266
181
  defaults: profileDefaultsSchema,
267
182
  revision: count,
268
- actor: z3.string().nullable(),
183
+ actor: z2.string().nullable(),
269
184
  updatedAt: count.nullable()
270
185
  });
271
186
  var profileSettingsInputSchema = profileSettingsSchema.omit({ revision: true, actor: true, updatedAt: true }).extend({
272
187
  actionId: identifier,
273
188
  /** The revision the change was made against; a newer one is a 409. */
274
189
  expectedRevision: count,
275
- reason: z3.string().trim().min(1).max(500)
190
+ reason: z2.string().trim().min(1).max(500)
276
191
  }).strict();
277
- var profileModerationSchema = z3.object({
192
+ var profileModerationSchema = z2.object({
278
193
  actionId: identifier,
279
- resetName: z3.boolean().default(false),
280
- removeAvatar: z3.boolean().default(false),
194
+ resetName: z2.boolean().default(false),
195
+ removeAvatar: z2.boolean().default(false),
281
196
  /** True locks the name and avatar, false unlocks them. */
282
- lock: z3.boolean().optional(),
283
- reason: z3.string().trim().min(1).max(1e3)
197
+ lock: z2.boolean().optional(),
198
+ reason: z2.string().trim().min(1).max(1e3)
284
199
  }).strict().refine(
285
200
  (value) => value.resetName || value.removeAvatar || value.lock !== void 0,
286
201
  "Choose an action"
@@ -288,8 +203,8 @@ var profileModerationSchema = z3.object({
288
203
  var managedProfileSchema = ownProfileSchema.omit({ options: true }).extend({
289
204
  member: identifier,
290
205
  lockedAt: count.nullable(),
291
- lockedBy: z3.string().nullable(),
292
- lockedReason: z3.string().nullable(),
206
+ lockedBy: z2.string().nullable(),
207
+ lockedReason: z2.string().nullable(),
293
208
  updatedAt: count
294
209
  });
295
210
  var AVATAR_UPLOAD_LIMIT = 5 * 1024 * 1024;
@@ -309,18 +224,6 @@ export {
309
224
  pointEntrySchema,
310
225
  pointHistoryQuerySchema,
311
226
  pointHistoryPageSchema,
312
- telegramSignInMethodsSchema,
313
- telegramAccountConnectionSchema,
314
- telegramInitDataSchema,
315
- telegramMiniAppSignInSchema,
316
- telegramChatIdSchema,
317
- telegramChatSchema,
318
- telegramChatsSchema,
319
- telegramChatConnectionSchema,
320
- telegramMemberInputSchema,
321
- telegramChatMemberSchema,
322
- telegramReactionsNamespace,
323
- telegramReactionDataSchema,
324
227
  profileVisibilitySchema,
325
228
  avatarProviderSchema,
326
229
  profileDefaultProviderSchema,
@@ -2,7 +2,7 @@ import {
2
2
  identifier,
3
3
  responseShape,
4
4
  xTweetSchema
5
- } from "./chunk-BHHUSBSD.js";
5
+ } from "./chunk-GBSDAD3N.js";
6
6
 
7
7
  // src/x.ts
8
8
  import * as z from "zod";
@@ -41,7 +41,7 @@ var xPostSchema = xTweetSchema.extend({
41
41
  * projection (migration 0056), a list with any malformed item is dropped whole, so positions
42
42
  * never shift and a bad entry never fails the post read.
43
43
  */
44
- media: z.unknown().transform(
44
+ media: z.unknown().optional().transform(
45
45
  (value) => z.array(z.object({ type: z.string(), url: z.string() })).safeParse(value).data ?? []
46
46
  )
47
47
  });