@domino-sdk/relay 1.61.0 → 1.63.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 (88) hide show
  1. package/CHANGELOG.md +276 -8
  2. package/README.md +3 -2
  3. package/dist/{schema-CZ6Rj0ZF.d.ts → accounts-nz3mzfRQ.d.ts} +3146 -1765
  4. package/dist/action-9Xl0StBg.d.ts +33 -0
  5. package/dist/{attempt-captures-DYnJVkfg.d.ts → attempt-captures-DMi8oR9T.d.ts} +1 -1
  6. package/dist/authoring.d.ts +171 -49
  7. package/dist/authoring.js +158 -49
  8. package/dist/{automatic-outcomes-If88LR9f.d.ts → automatic-outcomes-C_LLQU1p.d.ts} +15 -1
  9. package/dist/avatar.d.ts +1 -1
  10. package/dist/browser.d.ts +15 -11
  11. package/dist/browser.js +18 -12
  12. package/dist/capability-error-CuI_F7yM.d.ts +296 -0
  13. package/dist/{pages-K7-KjSXw.d.ts → catalog-BaTOKpNw.d.ts} +56 -567
  14. package/dist/{chunk-XBV2CK2H.js → chunk-3RFP6GT5.js} +15 -3
  15. package/dist/{chunk-VURRFVNP.js → chunk-4GQW43UU.js} +239 -361
  16. package/dist/chunk-4NOFSGAL.js +320 -0
  17. package/dist/{chunk-24I4R732.js → chunk-5XLZ34PV.js} +34 -19
  18. package/dist/{chunk-L77O64I4.js → chunk-7X67QLPB.js} +43 -43
  19. package/dist/{chunk-RHBS5FJL.js → chunk-7Z4SZ6YM.js} +3 -3
  20. package/dist/{chunk-QEAS4ZGS.js → chunk-AQOL3SK5.js} +1 -1
  21. package/dist/chunk-EHUSD3O2.js +377 -0
  22. package/dist/chunk-FO2LCZTL.js +19 -0
  23. package/dist/{chunk-DYXDZFKA.js → chunk-FU5CGNTR.js} +166 -178
  24. package/dist/chunk-FWLQ5XCS.js +21 -0
  25. package/dist/chunk-GLH6MEI2.js +193 -0
  26. package/dist/chunk-ICXZZNPS.js +199 -0
  27. package/dist/{chunk-ZDJLPN4L.js → chunk-ID3BZXFZ.js} +2696 -2693
  28. package/dist/chunk-KP2MCX3R.js +587 -0
  29. package/dist/{chunk-SKGTNTLF.js → chunk-LZWXCBUB.js} +213 -297
  30. package/dist/chunk-MTKRIQEU.js +31 -0
  31. package/dist/{chunk-4OC7REYX.js → chunk-MWMCQLCG.js} +3 -3
  32. package/dist/{chunk-PPB7HALD.js → chunk-N4BDKS6Y.js} +27 -26
  33. package/dist/{chunk-5I54XBK2.js → chunk-N4LNEGQX.js} +2 -2
  34. package/dist/chunk-NQDEWJWE.js +554 -0
  35. package/dist/chunk-QR6HH4DI.js +508 -0
  36. package/dist/chunk-TLSQETTY.js +41 -0
  37. package/dist/{chunk-MHPKEVEW.js → chunk-U66GUVSG.js} +7 -2
  38. package/dist/{chunk-KDR2VAJP.js → chunk-UYVJZR33.js} +2 -2
  39. package/dist/chunk-UZ765UGH.js +18 -0
  40. package/dist/{chunk-7A4J67ZL.js → chunk-VWQGWGCH.js} +7 -7
  41. package/dist/chunk-W7YSMSGC.js +725 -0
  42. package/dist/{client-C51w7fMb.d.ts → client-DHmG7rn6.d.ts} +126 -93
  43. package/dist/{announcements-CHx3-HBw.d.ts → dashboards-CLemT6kj.d.ts} +14 -137
  44. package/dist/{deployments-kWoHFaqj.d.ts → deployments-DTULi7dF.d.ts} +450 -18
  45. package/dist/identity-integration-DOeNZaxF.d.ts +1271 -0
  46. package/dist/index.d.ts +13 -11
  47. package/dist/index.js +16 -11
  48. package/dist/internal.d.ts +29 -13
  49. package/dist/internal.js +57 -17
  50. package/dist/{integrations-B3y36OaB.d.ts → limits-kNzYdZ00.d.ts} +464 -53
  51. package/dist/{offers-BoV4ryUc.d.ts → offers-CYeN_I0Y.d.ts} +22 -4
  52. package/dist/{participant-activity-DHL8QYks.d.ts → participant-activity-D-Drp24G.d.ts} +16 -3
  53. package/dist/portal-proxy.d.ts +75 -2
  54. package/dist/portal-proxy.js +153 -25
  55. package/dist/react/index.d.ts +214 -27
  56. package/dist/react/index.js +196 -42
  57. package/dist/{action-DBzILFx9.d.ts → request-error-D_dUPLwo.d.ts} +1 -31
  58. package/dist/reward-deliveries-drp-x1G-.d.ts +782 -0
  59. package/dist/runtime/authoring.js +1 -1
  60. package/dist/runtime/chunks/UGDV5W4N.js +1 -0
  61. package/dist/runtime/manifest.json +3 -3
  62. package/dist/runtime/schema.js +1 -1
  63. package/dist/schema.d.ts +330 -31
  64. package/dist/schema.js +147 -91
  65. package/dist/server/index.d.ts +14 -12
  66. package/dist/server/index.js +6425 -6260
  67. package/dist/sign-in-providers-B1Q9eDRm.d.ts +44 -0
  68. package/dist/submission-input-DZCbjQUH.d.ts +343 -0
  69. package/dist/{telegram-browser-BUceZIGZ.d.ts → telegram-browser-NL0Asmsi.d.ts} +46 -6
  70. package/dist/telegram.d.ts +64 -0
  71. package/dist/telegram.js +23 -0
  72. package/dist/testing.d.ts +326 -27
  73. package/dist/testing.js +440 -90
  74. package/dist/tracker-data-esm3WG8R.d.ts +1881 -0
  75. package/dist/{transport-BrX9pIGN.d.ts → transport-Czht_irp.d.ts} +43483 -38512
  76. package/dist/{wallet-CIqFoxdm.d.ts → wallet-B7e06v4m.d.ts} +32 -9
  77. package/package.json +5 -1
  78. package/dist/accounts-DoabriBX.d.ts +0 -306
  79. package/dist/capability-error-DufwG3G0.d.ts +0 -159
  80. package/dist/chunk-3Y3L2F54.js +0 -982
  81. package/dist/chunk-DHXDBAJF.js +0 -544
  82. package/dist/chunk-EN3M5Z4J.js +0 -13
  83. package/dist/chunk-QNUHWK7R.js +0 -602
  84. package/dist/chunk-SE4PFJPT.js +0 -247
  85. package/dist/groups-CqcA2Ycs.d.ts +0 -2827
  86. package/dist/runtime/chunks/5QVFB4TU.js +0 -1
  87. package/dist/submission-input-C54Q8yAD.d.ts +0 -146
  88. package/dist/x-D1PGi8Sq.d.ts +0 -331
@@ -0,0 +1,320 @@
1
+ import {
2
+ badgeSchema,
3
+ pointLedgerReferenceSchema
4
+ } from "./chunk-W7YSMSGC.js";
5
+ import {
6
+ authoringIdentityShape,
7
+ entitlementSchema,
8
+ identifier,
9
+ limits,
10
+ mediaUrlSchema,
11
+ memberProgressSchema,
12
+ pageCursorSchema,
13
+ prerequisiteSchema,
14
+ publishedReleaseSchema,
15
+ questPresentationContentSchema,
16
+ responseShape,
17
+ retryCooldownMsSchema,
18
+ reviewModeSchema,
19
+ sdkRuntimeReferenceSchema,
20
+ settingsValuesSchema,
21
+ storedQuestDescriptionSchema,
22
+ storedReviewModeSchema,
23
+ tieredRewardReferenceSchema
24
+ } from "./chunk-ID3BZXFZ.js";
25
+
26
+ // src/participant-activity.ts
27
+ import * as z from "zod";
28
+ var base = /* @__PURE__ */ (() => ({ id: z.string(), at: z.number() }))();
29
+ var attempt = /* @__PURE__ */ (() => ({
30
+ ...base,
31
+ quest: z.string(),
32
+ attempt: z.string(),
33
+ completion: z.string().nullable()
34
+ }))();
35
+ var kinds = [
36
+ "attempt.accepted",
37
+ "attempt.rejected",
38
+ "attempt.review",
39
+ "points.awarded",
40
+ "entitlement.granted",
41
+ "entitlement.collected",
42
+ "delivery.updated",
43
+ "referral.qualified"
44
+ ];
45
+ var knownRelayEventSchema = /* @__PURE__ */ (() => z.discriminatedUnion("kind", [
46
+ z.object({ ...attempt, kind: z.literal("attempt.accepted") }),
47
+ z.object({ ...attempt, kind: z.literal("attempt.rejected") }),
48
+ z.object({ ...attempt, kind: z.literal("attempt.review") }),
49
+ z.object({
50
+ ...base,
51
+ kind: z.literal("points.awarded"),
52
+ entry: z.string(),
53
+ ledger: z.string(),
54
+ amount: z.number(),
55
+ quest: z.string().nullable(),
56
+ completion: z.string().nullable()
57
+ }),
58
+ z.object({
59
+ ...base,
60
+ kind: z.literal("entitlement.granted"),
61
+ entitlement: z.string(),
62
+ tier: z.string(),
63
+ status: z.string()
64
+ }),
65
+ z.object({
66
+ ...base,
67
+ kind: z.literal("entitlement.collected"),
68
+ entitlement: z.string()
69
+ }),
70
+ z.object({
71
+ ...base,
72
+ kind: z.literal("delivery.updated"),
73
+ delivery: z.string(),
74
+ quest: z.string(),
75
+ completion: z.string(),
76
+ status: z.string()
77
+ }),
78
+ z.object({
79
+ ...base,
80
+ kind: z.literal("referral.qualified"),
81
+ program: z.string()
82
+ })
83
+ ]))();
84
+ var relayEventSchema = /* @__PURE__ */ (() => z.union([
85
+ knownRelayEventSchema,
86
+ z.object({
87
+ ...base,
88
+ kind: z.string().refine((kind) => !kinds.includes(kind))
89
+ }).catchall(z.json()).transform(({ kind, ...event }) => ({
90
+ ...event,
91
+ kind: "unknown",
92
+ reportedKind: kind
93
+ }))
94
+ ]))();
95
+ var participantActivityQuerySchema = /* @__PURE__ */ (() => z.object({
96
+ cursor: pageCursorSchema.optional(),
97
+ /** `latest` answers no events and the cursor of the newest one, to follow only what comes next. */
98
+ start: z.literal("latest").optional(),
99
+ limit: z.number().int().min(1).max(100).default(50)
100
+ }).strict().refine((query) => !(query.cursor && query.start), {
101
+ message: "Pass either cursor or start, not both"
102
+ }))();
103
+ var participantActivitySchema = /* @__PURE__ */ (() => z.object({
104
+ member: z.string(),
105
+ items: z.array(relayEventSchema),
106
+ /**
107
+ * Never null: the feed has no last page, so an empty page still answers the cursor to read
108
+ * from next. A loop over it, such as `paginate`, stops on its own condition, such as an empty
109
+ * page or a count.
110
+ */
111
+ nextCursor: pageCursorSchema
112
+ }))();
113
+
114
+ // src/catalog.ts
115
+ import * as z2 from "zod";
116
+ var interactionSchema = /* @__PURE__ */ (() => z2.enum([
117
+ "photo",
118
+ "text",
119
+ "url",
120
+ "quiz",
121
+ "claim",
122
+ "staff",
123
+ "automatic"
124
+ ]))();
125
+ function questInteraction(trigger) {
126
+ return trigger.kind === "automatic" ? "automatic" : trigger.actor === "staff" ? "staff" : trigger.input === "none" ? "claim" : trigger.input;
127
+ }
128
+ var questTypeVersionSchema = /* @__PURE__ */ (() => z2.object({
129
+ archivedAt: z2.number().int().nonnegative().nullable().optional(),
130
+ key: identifier.optional(),
131
+ id: identifier,
132
+ version: identifier,
133
+ code: z2.string(),
134
+ /** The SDK runtime `code` imports. Absent, the code bundles its own SDK. */
135
+ runtime: sdkRuntimeReferenceSchema.optional(),
136
+ definition: storedQuestDescriptionSchema,
137
+ provider: storedReviewModeSchema,
138
+ createdAt: z2.number()
139
+ }))();
140
+ var collectionSlotSchema = /* @__PURE__ */ (() => z2.object({
141
+ archivedAt: z2.number().int().nonnegative().nullable().optional(),
142
+ id: identifier,
143
+ key: identifier.optional(),
144
+ title: z2.string().trim().min(1).max(120),
145
+ description: z2.string().max(4e3).optional(),
146
+ image: mediaUrlSchema.optional(),
147
+ imageAlt: z2.string().max(500).optional()
148
+ }))();
149
+ var collectionSlotDeclarationSchema = /* @__PURE__ */ (() => collectionSlotSchema.omit({ id: true, archivedAt: true }).extend(authoringIdentityShape).strict())();
150
+ var questCollectionSchema = /* @__PURE__ */ (() => collectionSlotSchema.extend({
151
+ quests: z2.array(identifier).max(100).refine(
152
+ (v) => new Set(v).size === v.length,
153
+ "A collection can contain a quest only once"
154
+ )
155
+ }))();
156
+ var questInstanceSchema = /* @__PURE__ */ (() => z2.object({
157
+ badges: z2.array(identifier).max(10).refine(
158
+ (items) => new Set(items).size === items.length,
159
+ "Choose each badge once"
160
+ ).optional(),
161
+ id: identifier,
162
+ title: z2.string().trim().min(1).max(120),
163
+ typeVersion: identifier,
164
+ presentation: questPresentationContentSchema.optional(),
165
+ settings: settingsValuesSchema,
166
+ requires: z2.array(prerequisiteSchema).max(30),
167
+ /**
168
+ * Milliseconds a member waits after a rejected attempt before submitting again, or `null` for
169
+ * no cooldown. Omitted: the quest type's own `retryCooldownMs`.
170
+ */
171
+ retryCooldownMs: retryCooldownMsSchema.nullable().optional(),
172
+ /**
173
+ * Milliseconds a member waits after an accepted completion before submitting again, or `null`
174
+ * for no cooldown. Omitted: the quest type's own `completionCooldownMs`.
175
+ */
176
+ completionCooldownMs: retryCooldownMsSchema.nullable().optional(),
177
+ status: z2.enum(["active", "paused", "archived"])
178
+ }).strict())();
179
+ var questDraftChangesSchema = /* @__PURE__ */ (() => z2.object({
180
+ quests: z2.array(
181
+ questInstanceSchema.extend({ expectedRelease: identifier.nullable() })
182
+ ).max(limits.quests),
183
+ collections: z2.array(questCollectionSchema.omit({ archivedAt: true }).strict()).max(limits.collections)
184
+ }).strict())();
185
+ var draftBase = /* @__PURE__ */ (() => z2.object({
186
+ id: identifier,
187
+ revision: z2.number().int().positive(),
188
+ baseRevision: z2.number().int().nonnegative(),
189
+ changes: questDraftChangesSchema
190
+ }))();
191
+ var questDraftSchema = /* @__PURE__ */ (() => responseShape(
192
+ z2.discriminatedUnion("status", [
193
+ draftBase.extend({ status: z2.literal("draft") }),
194
+ draftBase.extend({
195
+ status: z2.literal("published"),
196
+ releaseIds: z2.array(identifier)
197
+ })
198
+ ])
199
+ ))();
200
+ var questCatalogSchema = /* @__PURE__ */ (() => responseShape(
201
+ z2.object({
202
+ revision: z2.number().int().nonnegative(),
203
+ types: z2.array(questTypeVersionSchema),
204
+ collections: z2.array(questCollectionSchema),
205
+ quests: z2.array(questInstanceSchema),
206
+ drafts: z2.array(questDraftSchema),
207
+ releases: z2.array(publishedReleaseSchema).default([]),
208
+ supportedInteractions: z2.array(interactionSchema)
209
+ })
210
+ ))();
211
+ var catalogDeploymentSchema = /* @__PURE__ */ (() => z2.object({
212
+ expectedRevision: z2.number().int().nonnegative(),
213
+ types: z2.array(
214
+ z2.object({
215
+ code: z2.string().min(1).max(1e6),
216
+ runtime: sdkRuntimeReferenceSchema.optional(),
217
+ provider: reviewModeSchema
218
+ })
219
+ ).max(limits.questTypes).default([]),
220
+ collections: z2.array(collectionSlotDeclarationSchema).max(limits.collections).default([]),
221
+ supportedInteractions: z2.array(interactionSchema).min(1).optional()
222
+ }).strict())();
223
+ var catalogDeploymentPreviewSchema = /* @__PURE__ */ (() => responseShape(
224
+ z2.object({
225
+ revision: z2.number().int().nonnegative(),
226
+ types: z2.array(questTypeVersionSchema),
227
+ collections: z2.array(collectionSlotSchema),
228
+ supportedInteractions: z2.array(interactionSchema)
229
+ })
230
+ ))();
231
+ var saveQuestDraftSchema = /* @__PURE__ */ (() => z2.object({
232
+ id: identifier.optional(),
233
+ actionId: identifier,
234
+ expectedRevision: z2.number().int().nonnegative(),
235
+ baseRevision: z2.number().int().nonnegative(),
236
+ changes: questDraftChangesSchema
237
+ }).strict())();
238
+ var publishQuestDraftSchema = /* @__PURE__ */ (() => z2.object({ id: identifier, expectedRevision: z2.number().int().positive() }).strict())();
239
+ var questRewardViewSchema = /* @__PURE__ */ (() => z2.discriminatedUnion("kind", [
240
+ z2.object({
241
+ kind: z2.literal("points"),
242
+ label: z2.string(),
243
+ amount: z2.number().int().nonnegative(),
244
+ ledger: pointLedgerReferenceSchema
245
+ }),
246
+ z2.object({
247
+ kind: z2.literal("tier"),
248
+ label: z2.string(),
249
+ reward: tieredRewardReferenceSchema.extend({
250
+ title: z2.string(),
251
+ badge: badgeSchema.optional(),
252
+ /** The group the reward adds the member to: its key and the title the quest names it by. */
253
+ group: z2.object({ key: identifier, title: z2.string() }).optional()
254
+ }),
255
+ tier: identifier
256
+ }),
257
+ z2.object({ kind: z2.literal("integration"), label: z2.string() })
258
+ ]))();
259
+ var questViewSchema = /* @__PURE__ */ (() => responseShape(
260
+ memberProgressSchema.shape.quests.element.extend({
261
+ release: identifier,
262
+ interaction: interactionSchema,
263
+ lifecycle: z2.enum(["active", "paused", "archived"]),
264
+ rewards: z2.array(questRewardViewSchema)
265
+ })
266
+ ))();
267
+ var collectionViewSchema = /* @__PURE__ */ (() => z2.object({
268
+ key: identifier.optional(),
269
+ id: identifier,
270
+ title: z2.string(),
271
+ description: z2.string().optional(),
272
+ image: mediaUrlSchema.optional(),
273
+ imageAlt: z2.string().optional(),
274
+ quests: z2.array(questViewSchema)
275
+ }))();
276
+ var questExperienceSchema = /* @__PURE__ */ (() => responseShape(
277
+ z2.object({
278
+ entitlements: z2.array(entitlementSchema).default([]),
279
+ member: identifier,
280
+ quests: z2.array(questViewSchema),
281
+ collections: z2.array(collectionViewSchema)
282
+ })
283
+ ))();
284
+ var questPublicationPreviewSchema = /* @__PURE__ */ (() => responseShape(
285
+ z2.object({
286
+ draft: questDraftSchema,
287
+ releases: z2.array(publishedReleaseSchema),
288
+ affectedCollections: z2.array(questCollectionSchema)
289
+ })
290
+ ))();
291
+ var allocateQuestSchema = /* @__PURE__ */ (() => z2.object({ actionId: identifier }).strict())();
292
+ var allocatedQuestSchema = /* @__PURE__ */ (() => z2.object({ id: identifier }))();
293
+
294
+ export {
295
+ knownRelayEventSchema,
296
+ relayEventSchema,
297
+ participantActivityQuerySchema,
298
+ participantActivitySchema,
299
+ interactionSchema,
300
+ questInteraction,
301
+ questTypeVersionSchema,
302
+ collectionSlotSchema,
303
+ collectionSlotDeclarationSchema,
304
+ questCollectionSchema,
305
+ questInstanceSchema,
306
+ questDraftChangesSchema,
307
+ questDraftSchema,
308
+ questCatalogSchema,
309
+ catalogDeploymentSchema,
310
+ catalogDeploymentPreviewSchema,
311
+ saveQuestDraftSchema,
312
+ publishQuestDraftSchema,
313
+ questRewardViewSchema,
314
+ questViewSchema,
315
+ collectionViewSchema,
316
+ questExperienceSchema,
317
+ questPublicationPreviewSchema,
318
+ allocateQuestSchema,
319
+ allocatedQuestSchema
320
+ };
@@ -1,12 +1,14 @@
1
1
  import {
2
2
  createRelayClient
3
- } from "./chunk-SKGTNTLF.js";
3
+ } from "./chunk-LZWXCBUB.js";
4
+ import {
5
+ cosmosChain
6
+ } from "./chunk-ID3BZXFZ.js";
4
7
  import {
5
8
  RelayErrorCode,
6
9
  asRelayError,
7
- clientError,
8
- cosmosChain
9
- } from "./chunk-ZDJLPN4L.js";
10
+ clientError
11
+ } from "./chunk-GLH6MEI2.js";
10
12
 
11
13
  // src/base58.ts
12
14
  var alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
@@ -370,6 +372,10 @@ var providerLabels = {
370
372
  x: "X",
371
373
  discord: "Discord"
372
374
  };
375
+ var signInProviderLabels = /* @__PURE__ */ (() => new Map([
376
+ ...Object.entries(providerLabels),
377
+ ["telegram", "Telegram"]
378
+ ]))();
373
379
  var familyLabels = {
374
380
  solana: "Solana",
375
381
  eip155: "EVM",
@@ -462,8 +468,22 @@ function signInOptionsFrom(methods, wallets, input) {
462
468
  });
463
469
  }
464
470
  const telegram = actions.telegram;
471
+ const start = actions.provider;
472
+ const configured = methods.signInProviders ?? [
473
+ ...methods.providers,
474
+ ...methods.telegram?.login ? ["telegram"] : []
475
+ ];
465
476
  return {
466
477
  options,
478
+ ...start ? {
479
+ signInProviders: configured.map((provider) => ({
480
+ kind: "provider",
481
+ id: provider,
482
+ label: signInProviderLabels.get(provider) ?? provider,
483
+ icon: provider,
484
+ start: () => start(provider)
485
+ }))
486
+ } : {},
467
487
  unavailable,
468
488
  ...methods.telegram?.login && telegram ? {
469
489
  telegram: {
@@ -482,6 +502,9 @@ async function readSignInMethods(relay) {
482
502
  const result = await relay.auth.providers();
483
503
  return {
484
504
  providers: result.providers.filter((entry) => entry.configured).map((entry) => entry.provider),
505
+ ...result.signInProviders ? {
506
+ signInProviders: result.signInProviders.filter((entry) => entry.configured).map((entry) => entry.provider)
507
+ } : {},
485
508
  email: result.email,
486
509
  wallets: result.wallets,
487
510
  ...result.telegram ? { telegram: result.telegram } : {}
@@ -512,6 +535,13 @@ async function signInOptions(relay, input = {}) {
512
535
  const { url } = await relay.auth.start(provider, "sign-in");
513
536
  window.location.assign(url);
514
537
  },
538
+ async provider(provider) {
539
+ const { url } = await relay.auth.start(
540
+ provider,
541
+ "sign-in"
542
+ );
543
+ window.location.assign(url);
544
+ },
515
545
  async sendCode(email) {
516
546
  challenge = null;
517
547
  challenge = (await relay.auth.emailStart(email)).challenge;
@@ -537,20 +567,6 @@ async function signInOptions(relay, input = {}) {
537
567
  });
538
568
  }
539
569
 
540
- // src/telegram-browser.ts
541
- function telegramMiniAppInitData() {
542
- const scope = globalThis;
543
- const fromScript = scope.Telegram?.WebApp?.initData;
544
- if (typeof fromScript === "string" && fromScript.length > 0) {
545
- return fromScript;
546
- }
547
- const hash = scope.location?.hash;
548
- if (!hash) {
549
- return null;
550
- }
551
- return new URLSearchParams(hash.replace(/^#/, "")).get("tgWebAppData") || null;
552
- }
553
-
554
570
  // src/member-time.ts
555
571
  function memberTime(me, at = Date.now()) {
556
572
  return at + (me.clock?.offsetMs ?? 0);
@@ -734,7 +750,6 @@ export {
734
750
  signInOptionsFrom,
735
751
  readSignInMethods,
736
752
  signInOptions,
737
- telegramMiniAppInitData,
738
753
  memberTime,
739
754
  createBrowserRelayClient,
740
755
  browserSubmissionStore
@@ -2,13 +2,13 @@ import {
2
2
  identifier,
3
3
  responseShape,
4
4
  xTweetSchema
5
- } from "./chunk-ZDJLPN4L.js";
5
+ } from "./chunk-ID3BZXFZ.js";
6
6
 
7
7
  // src/x.ts
8
8
  import * as z from "zod";
9
- var xIdSchema = z.string().regex(/^[0-9]{1,20}$/);
10
- var xConnectionSchema = z.object({ userId: xIdSchema });
11
- var xProfileSchema = z.object({
9
+ var xIdSchema = /* @__PURE__ */ (() => z.string().regex(/^[0-9]{1,20}$/))();
10
+ var xConnectionSchema = /* @__PURE__ */ (() => z.object({ userId: xIdSchema }))();
11
+ var xProfileSchema = /* @__PURE__ */ (() => z.object({
12
12
  id: xIdSchema,
13
13
  username: z.string(),
14
14
  name: z.string(),
@@ -16,22 +16,22 @@ var xProfileSchema = z.object({
16
16
  profileImageUrl: z.string().url().nullable(),
17
17
  followersCount: z.number().int().nonnegative().nullable(),
18
18
  verified: z.boolean().nullable()
19
- });
20
- var xUsernameSchema = z.string().trim().transform((value) => value.replace(/^@/, "")).pipe(
19
+ }))();
20
+ var xUsernameSchema = /* @__PURE__ */ (() => z.string().trim().transform((value) => value.replace(/^@/, "")).pipe(
21
21
  z.string().regex(
22
22
  /^[A-Za-z0-9_]{1,15}$/,
23
23
  "Use an X handle: 1 to 15 letters, digits or underscores"
24
24
  )
25
- );
26
- var xUserLookupInputSchema = z.object({ username: xUsernameSchema }).strict();
27
- var xUserSchema = z.object({
25
+ ))();
26
+ var xUserLookupInputSchema = /* @__PURE__ */ (() => z.object({ username: xUsernameSchema }).strict())();
27
+ var xUserSchema = /* @__PURE__ */ (() => z.object({
28
28
  id: xIdSchema,
29
29
  /** The handle as X shows it, without `@`. */
30
30
  username: z.string(),
31
31
  /** The display name. */
32
32
  name: z.string()
33
- });
34
- var xPostSchema = xTweetSchema.extend({
33
+ }))();
34
+ var xPostSchema = /* @__PURE__ */ (() => xTweetSchema.extend({
35
35
  quotedTweetId: xIdSchema.nullish().transform((v) => v ?? null),
36
36
  inReplyToUserId: xIdSchema.nullish().transform((v) => v ?? null),
37
37
  inReplyToStatusId: xIdSchema.nullish().transform((v) => v ?? null),
@@ -44,18 +44,18 @@ var xPostSchema = xTweetSchema.extend({
44
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
- });
48
- var xRequestSchema = z.discriminatedUnion("operation", [
47
+ }))();
48
+ var xRequestSchema = /* @__PURE__ */ (() => z.discriminatedUnion("operation", [
49
49
  z.object({ operation: z.literal("connection") }).strict(),
50
50
  z.object({ operation: z.literal("profile") }).strict(),
51
51
  z.object({ operation: z.literal("post"), postId: xIdSchema }).strict(),
52
52
  z.object({ operation: z.literal("follows"), userId: xIdSchema }).strict(),
53
53
  z.object({ operation: z.literal("reposted"), postId: xIdSchema }).strict()
54
- ]);
54
+ ]))();
55
55
 
56
56
  // src/images.ts
57
57
  import * as z2 from "zod";
58
- var imageReferenceSchema = z2.union([
58
+ var imageReferenceSchema = /* @__PURE__ */ (() => z2.union([
59
59
  z2.strictObject({ evidence: z2.string().min(1).max(256) }),
60
60
  z2.strictObject({ x: z2.literal("profile") }),
61
61
  z2.strictObject({
@@ -64,17 +64,17 @@ var imageReferenceSchema = z2.union([
64
64
  index: z2.number().int().min(0).max(3).default(0)
65
65
  }),
66
66
  z2.strictObject({ asset: identifier })
67
- ]);
68
- var criteria = z2.string().trim().min(1).max(2e3);
69
- var imageFieldSchema = z2.strictObject({
67
+ ]))();
68
+ var criteria = /* @__PURE__ */ (() => z2.string().trim().min(1).max(2e3))();
69
+ var imageFieldSchema = /* @__PURE__ */ (() => z2.strictObject({
70
70
  type: z2.enum(["string", "number", "boolean"]),
71
71
  description: z2.string().trim().min(1).max(500)
72
- });
73
- var imageFieldsSchema = z2.record(z2.string().regex(/^[a-zA-Z][a-zA-Z0-9_]{0,39}$/), imageFieldSchema).refine((fields) => {
72
+ }))();
73
+ var imageFieldsSchema = /* @__PURE__ */ (() => z2.record(z2.string().regex(/^[a-zA-Z][a-zA-Z0-9_]{0,39}$/), imageFieldSchema).refine((fields) => {
74
74
  const count = Object.keys(fields).length;
75
75
  return count >= 1 && count <= 12;
76
- }, "Declare between 1 and 12 fields");
77
- var imageRequestSchema = z2.discriminatedUnion("operation", [
76
+ }, "Declare between 1 and 12 fields"))();
77
+ var imageRequestSchema = /* @__PURE__ */ (() => z2.discriminatedUnion("operation", [
78
78
  z2.strictObject({
79
79
  operation: z2.literal("inspect"),
80
80
  image: imageReferenceSchema
@@ -98,9 +98,9 @@ var imageRequestSchema = z2.discriminatedUnion("operation", [
98
98
  image: imageReferenceSchema,
99
99
  maxDistance: z2.number().int().min(0).max(8).default(8)
100
100
  })
101
- ]);
102
- var hash = z2.string().regex(/^[0-9a-f]{16}$/);
103
- var imageInspectionSchema = responseShape(
101
+ ]))();
102
+ var hash = /* @__PURE__ */ (() => z2.string().regex(/^[0-9a-f]{16}$/))();
103
+ var imageInspectionSchema = /* @__PURE__ */ (() => responseShape(
104
104
  z2.strictObject({
105
105
  width: z2.number().int().positive(),
106
106
  height: z2.number().int().positive(),
@@ -110,16 +110,16 @@ var imageInspectionSchema = responseShape(
110
110
  phash: hash,
111
111
  dhash: hash
112
112
  })
113
- );
114
- var distance = z2.number().int().min(0).max(64);
115
- var imageComparisonSchema = responseShape(
113
+ ))();
114
+ var distance = /* @__PURE__ */ (() => z2.number().int().min(0).max(64))();
115
+ var imageComparisonSchema = /* @__PURE__ */ (() => responseShape(
116
116
  z2.strictObject({
117
117
  identical: z2.boolean(),
118
118
  phashDistance: distance,
119
119
  dhashDistance: distance
120
120
  })
121
- );
122
- var imageExtractionSchema = responseShape(
121
+ ))();
122
+ var imageExtractionSchema = /* @__PURE__ */ (() => responseShape(
123
123
  z2.strictObject({
124
124
  values: z2.record(
125
125
  z2.string(),
@@ -127,23 +127,23 @@ var imageExtractionSchema = responseShape(
127
127
  ),
128
128
  reason: z2.string().min(1).max(2e3)
129
129
  })
130
- );
131
- var imageSightingsSchema = responseShape(
130
+ ))();
131
+ var imageSightingsSchema = /* @__PURE__ */ (() => responseShape(
132
132
  z2.strictObject({
133
133
  matches: z2.number().int().nonnegative(),
134
134
  closestDistance: distance.nullable(),
135
135
  firstSeenAt: z2.number().int().nonnegative().nullable()
136
136
  })
137
- );
138
- var sha256 = z2.string().regex(/^[0-9a-f]{64}$/);
139
- var imageSize = z2.number().int().positive().max(5 * 1024 * 1024);
140
- var imageAssetArtifactSchema = z2.strictObject({
137
+ ))();
138
+ var sha256 = /* @__PURE__ */ (() => z2.string().regex(/^[0-9a-f]{64}$/))();
139
+ var imageSize = /* @__PURE__ */ (() => z2.number().int().positive().max(5 * 1024 * 1024))();
140
+ var imageAssetArtifactSchema = /* @__PURE__ */ (() => z2.strictObject({
141
141
  key: identifier,
142
142
  sha256,
143
143
  size: imageSize,
144
144
  path: z2.string().min(1).max(500).optional()
145
- });
146
- var imageUploadRequestSchema = z2.strictObject({
145
+ }))();
146
+ var imageUploadRequestSchema = /* @__PURE__ */ (() => z2.strictObject({
147
147
  images: z2.array(
148
148
  z2.strictObject({
149
149
  sha256,
@@ -151,8 +151,8 @@ var imageUploadRequestSchema = z2.strictObject({
151
151
  type: z2.enum(["image/jpeg", "image/png", "image/webp"])
152
152
  })
153
153
  ).min(1).max(10)
154
- });
155
- var imageUploadsSchema = responseShape(
154
+ }))();
155
+ var imageUploadsSchema = /* @__PURE__ */ (() => responseShape(
156
156
  z2.strictObject({
157
157
  images: z2.array(
158
158
  z2.strictObject({
@@ -165,8 +165,8 @@ var imageUploadsSchema = responseShape(
165
165
  })
166
166
  )
167
167
  })
168
- );
169
- var publishedImageSchema = responseShape(
168
+ ))();
169
+ var publishedImageSchema = /* @__PURE__ */ (() => responseShape(
170
170
  z2.strictObject({
171
171
  key: identifier,
172
172
  sha256,
@@ -175,7 +175,7 @@ var publishedImageSchema = responseShape(
175
175
  width: z2.number().int().positive(),
176
176
  height: z2.number().int().positive()
177
177
  })
178
- );
178
+ ))();
179
179
 
180
180
  export {
181
181
  xIdSchema,
@@ -5,7 +5,7 @@ import {
5
5
  isKnownTrackerSource,
6
6
  trackerDataSchema,
7
7
  xAccountRoles
8
- } from "./chunk-ZDJLPN4L.js";
8
+ } from "./chunk-ID3BZXFZ.js";
9
9
 
10
10
  // src/quest-shape.ts
11
11
  function validateQuestShape(description, options = {}) {
@@ -29,7 +29,7 @@ function validateQuestShape(description, options = {}) {
29
29
  );
30
30
  }
31
31
  if (content) {
32
- if (completion.kind !== "keyed") {
32
+ if (completion.kind !== "keyed" || completion.across) {
33
33
  throw new Error("Content quests complete once per content item");
34
34
  }
35
35
  if (tracker.beneficiary !== "author" || tracker.on !== "new-record") {
@@ -83,7 +83,7 @@ function sourceRoles(source) {
83
83
  return ["author", ...source.accounts ?? []];
84
84
  }
85
85
  }
86
- var discordSchemas = /* @__PURE__ */ new Map();
86
+ var discordSchemas = /* @__PURE__ */ (() => /* @__PURE__ */ new Map())();
87
87
  function discordDataSchema(source) {
88
88
  const key = source.kind === "discord-messages" && source.text ? "messages-text" : source.kind;
89
89
  let schema = discordSchemas.get(key);
@@ -2,7 +2,7 @@ import {
2
2
  RelayErrorCode,
3
3
  clientError,
4
4
  isRequestError
5
- } from "./chunk-ZDJLPN4L.js";
5
+ } from "./chunk-GLH6MEI2.js";
6
6
 
7
7
  // src/action.ts
8
8
  function withActionId(value) {