@domino-sdk/relay 1.54.0 → 1.56.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 +1859 -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 +277 -40
  5. package/dist/authoring.js +142 -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-RP4LLEON.js → chunk-ABJ4G47X.js} +1 -1
  12. package/dist/{chunk-IELNFM3V.js → chunk-BHHUSBSD.js} +97 -8
  13. package/dist/chunk-BJYMTCWG.js +950 -0
  14. package/dist/{chunk-K6TVMNU4.js → chunk-CK7HO32Z.js} +1 -1
  15. package/dist/{chunk-GTQJSDBS.js → chunk-CXKXPB7K.js} +32 -16
  16. package/dist/{chunk-TL5TL5RD.js → chunk-G6XVBYH7.js} +4 -4
  17. package/dist/{chunk-S2PMKZSX.js → chunk-H2MD6E7Z.js} +21 -2
  18. package/dist/{chunk-YVC3B72P.js → chunk-INSWI2VZ.js} +1 -1
  19. package/dist/{chunk-XFAYQFRO.js → chunk-KBVH4XZC.js} +1 -1
  20. package/dist/{chunk-MLIXJPKL.js → chunk-MHPKEVEW.js} +1 -0
  21. package/dist/{chunk-7BNCLWAO.js → chunk-MNU6UPXY.js} +1 -1
  22. package/dist/{chunk-JL7J3EQQ.js → chunk-NK6EER33.js} +46 -16
  23. package/dist/{chunk-QIDQWXSF.js → chunk-OTITLABX.js} +2 -2
  24. package/dist/{chunk-53JMTUWG.js → chunk-QNQNKIAA.js} +1 -1
  25. package/dist/{chunk-ZJ3FVZRP.js → chunk-RBPMT53S.js} +132 -99
  26. package/dist/chunk-ULQU7KC4.js +704 -0
  27. package/dist/chunk-VSHV7FEA.js +344 -0
  28. package/dist/{chunk-LPHXTZDA.js → chunk-W5U2WXG3.js} +2 -2
  29. package/dist/{client-CzNtl8UO.d.ts → client-bX3oTpRu.d.ts} +111 -8
  30. package/dist/{deployments-ovtqtAcx.d.ts → deployments-D3lxfQMB.d.ts} +1436 -185
  31. package/dist/{groups-B5R1RCsl.d.ts → groups-DPE004_V.d.ts} +135 -139
  32. package/dist/index.d.ts +8 -8
  33. package/dist/index.js +9 -9
  34. package/dist/integrations-CcD5NPEA.d.ts +633 -0
  35. package/dist/internal.d.ts +11 -10
  36. package/dist/internal.js +9 -9
  37. package/dist/{offers-CH1RZekg.d.ts → offers-CtzMeB7O.d.ts} +207 -2
  38. package/dist/{pages-BTlOg8sl.d.ts → pages-BlLqB8ZQ.d.ts} +82 -2
  39. package/dist/portal-proxy.d.ts +11 -1
  40. package/dist/portal-proxy.js +27 -6
  41. package/dist/{profiles-Cdv4BSd_.d.ts → profiles-BoOK03cR.d.ts} +2 -0
  42. package/dist/react/index.d.ts +566 -13
  43. package/dist/react/index.js +105 -15
  44. package/dist/runtime/authoring.js +1 -1
  45. package/dist/runtime/chunks/NDB42VFF.js +1 -0
  46. package/dist/runtime/manifest.json +3 -3
  47. package/dist/runtime/schema.js +1 -1
  48. package/dist/{schema-BJ9bOgpN.d.ts → schema-C4m9RhCR.d.ts} +166 -6
  49. package/dist/schema.d.ts +383 -79
  50. package/dist/schema.js +105 -41
  51. package/dist/server/index.d.ts +11 -10
  52. package/dist/server/index.js +1590 -1175
  53. package/dist/{submission-input-BNah53go.d.ts → submission-input-wTiYGdgA.d.ts} +2 -2
  54. package/dist/{telegram-browser-C36j_6v-.d.ts → telegram-browser-Bh3i0HiH.d.ts} +1 -1
  55. package/dist/testing.d.ts +85 -12
  56. package/dist/testing.js +322 -37
  57. package/dist/{transport-C8BlCzmF.d.ts → transport-CnKA-_RL.d.ts} +7625 -1265
  58. package/dist/vite.d.ts +54 -1
  59. package/dist/vite.js +35 -0
  60. package/dist/{x-BfQcsDp0.d.ts → x-1czZFVUW.d.ts} +1 -1
  61. package/package.json +3 -2
  62. package/dist/chunk-2NUD237O.js +0 -102
  63. package/dist/chunk-CCE2JWES.js +0 -1083
  64. package/dist/integrations-CllF-kWg.d.ts +0 -314
  65. package/dist/runtime/chunks/AVRVSLHX.js +0 -1
@@ -1,7 +1,9 @@
1
1
  import {
2
- badgeSchema,
2
+ badgeSchema
3
+ } from "./chunk-BJYMTCWG.js";
4
+ import {
3
5
  pointLedgerReferenceSchema
4
- } from "./chunk-CCE2JWES.js";
6
+ } from "./chunk-VSHV7FEA.js";
5
7
  import {
6
8
  authoringIdentityShape,
7
9
  entitlementSchema,
@@ -23,7 +25,7 @@ import {
23
25
  storedQuestDescriptionSchema,
24
26
  storedReviewModeSchema,
25
27
  tieredRewardReferenceSchema
26
- } from "./chunk-IELNFM3V.js";
28
+ } from "./chunk-BHHUSBSD.js";
27
29
 
28
30
  // src/participant-activity.ts
29
31
  import * as z from "zod";
@@ -166,6 +168,11 @@ var questInstanceSchema = z2.object({
166
168
  * no cooldown. Omitted: the quest type's own `retryCooldownMs`.
167
169
  */
168
170
  retryCooldownMs: retryCooldownMsSchema.nullable().optional(),
171
+ /**
172
+ * Milliseconds a member waits after an accepted completion before submitting again, or `null`
173
+ * for no cooldown. Omitted: the quest type's own `completionCooldownMs`.
174
+ */
175
+ completionCooldownMs: retryCooldownMsSchema.nullable().optional(),
169
176
  status: z2.enum(["active", "paused", "archived"])
170
177
  }).strict();
171
178
  var questDraftChangesSchema = z2.object({
@@ -283,30 +290,52 @@ var questPublicationPreviewSchema = responseShape(
283
290
  var allocateQuestSchema = z2.object({ actionId: identifier }).strict();
284
291
  var allocatedQuestSchema = z2.object({ id: identifier });
285
292
 
286
- // src/collection.ts
293
+ // src/creator-accounts.ts
287
294
  import * as z3 from "zod";
288
- var collectionCodeSchema = z3.string().regex(/^relay:collect:[a-f0-9]{64}$/);
289
- var collectionPassSchema = z3.object({
295
+ var knownCreatorAccountProviders = ["youtube", "tiktok"];
296
+ var creatorAccountProviderSchema = z3.custom(
297
+ (value) => typeof value === "string" && /^[a-z][a-z0-9-]{0,39}$/.test(value)
298
+ );
299
+ var creatorAccountSchema = z3.object({
300
+ provider: creatorAccountProviderSchema,
301
+ configured: z3.boolean(),
302
+ status: z3.enum(["disconnected", "connected", "reconnect"]),
303
+ subject: z3.string().nullable(),
304
+ revision: z3.number().int().nonnegative(),
305
+ profile: z3.object({
306
+ name: z3.string().optional(),
307
+ username: z3.string().optional(),
308
+ imageUrl: z3.string().optional()
309
+ }).nullable()
310
+ });
311
+ var creatorAccountsSchema = z3.object({
312
+ accounts: z3.array(creatorAccountSchema)
313
+ });
314
+
315
+ // src/collection.ts
316
+ import * as z4 from "zod";
317
+ var collectionCodeSchema = z4.string().regex(/^relay:collect:[a-f0-9]{64}$/);
318
+ var collectionPassSchema = z4.object({
290
319
  code: collectionCodeSchema,
291
- expiresAt: z3.number(),
320
+ expiresAt: z4.number(),
292
321
  entitlement: identifier
293
322
  });
294
- var collectionResolveSchema = z3.object({ code: collectionCodeSchema }).strict();
323
+ var collectionResolveSchema = z4.object({ code: collectionCodeSchema }).strict();
295
324
  var collectionBeginSchema = collectionResolveSchema.extend({
296
325
  actionId: identifier,
297
- revision: z3.number().int().positive(),
326
+ revision: z4.number().int().positive(),
298
327
  selection: pickupSelectionSchema.optional()
299
328
  });
300
- var collectionPreviewSchema = z3.object({
329
+ var collectionPreviewSchema = z4.object({
301
330
  entitlement: entitlementSchema,
302
331
  inventory: pickupAvailabilitySchema,
303
- expiresAt: z3.number()
332
+ expiresAt: z4.number()
304
333
  });
305
334
 
306
335
  // src/outcomes.ts
307
- import * as z4 from "zod";
308
- var timestamp = z4.number().int().safe().nonnegative();
309
- var questEnrollmentInputSchema = z4.strictObject({
336
+ import * as z5 from "zod";
337
+ var timestamp = z5.number().int().safe().nonnegative();
338
+ var questEnrollmentInputSchema = z5.strictObject({
310
339
  actionId: identifier,
311
340
  /** Quest key or ID. */
312
341
  quest: identifier
@@ -314,26 +343,26 @@ var questEnrollmentInputSchema = z4.strictObject({
314
343
  var memberEnrollmentInputSchema = questEnrollmentInputSchema.extend({
315
344
  member: identifier
316
345
  });
317
- var questEnrollmentSchema = z4.object({
346
+ var questEnrollmentSchema = z5.object({
318
347
  /** Stable quest ID. */
319
348
  quest: identifier,
320
349
  member: identifier,
321
350
  enrolledAt: timestamp
322
351
  });
323
- var questClaimInputSchema = z4.strictObject({
352
+ var questClaimInputSchema = z5.strictObject({
324
353
  actionId: identifier,
325
354
  /** Quest key or ID. */
326
355
  quest: identifier,
327
356
  /** The outcome's tracker, as `QuestOutcome.tracker` names it. */
328
357
  tracker: identifier,
329
- record: z4.string().min(1).max(256),
358
+ record: z5.string().min(1).max(256),
330
359
  observedAt: timestamp
331
360
  });
332
361
  var QuestOutcomeState = {
333
362
  Admitted: "admitted",
334
363
  Skipped: "skipped"
335
364
  };
336
- var questOutcomeSchema = z4.object({
365
+ var questOutcomeSchema = z5.object({
337
366
  /** Prerequisite transition identity; absent on older tracker responses. */
338
367
  automatic: identifier.optional(),
339
368
  /** Stable quest ID. */
@@ -341,161 +370,161 @@ var questOutcomeSchema = z4.object({
341
370
  /** Stable tracker ID of the record decided. */
342
371
  tracker: identifier.nullable(),
343
372
  /** The record's ID in its tracker. */
344
- record: z4.string().nullable(),
373
+ record: z5.string().nullable(),
345
374
  /** Which observation of the record was decided. */
346
375
  observedAt: timestamp.nullable(),
347
- state: z4.enum(["admitted", "skipped"]),
376
+ state: z5.enum(["admitted", "skipped"]),
348
377
  /**
349
378
  * Why it was skipped, one of `trackerSkipCodes` or a code a newer Relay sends; null when
350
379
  * admitted. Show an unknown code by its `reason`.
351
380
  */
352
- code: z4.string().nullable(),
381
+ code: z5.string().nullable(),
353
382
  /** Why it was skipped, for people; null when admitted. */
354
- reason: z4.string().nullable(),
383
+ reason: z5.string().nullable(),
355
384
  /** Which window refused admission when `code` is `outside-window`. */
356
- window: z4.enum(["tracker", "quest"]).optional(),
385
+ window: z5.enum(["tracker", "quest"]).optional(),
357
386
  /** The admitted attempt. */
358
387
  attempt: identifier.nullable(),
359
388
  /** The member can claim it with `relay.quests.claim()`. */
360
- claimable: z4.boolean(),
389
+ claimable: z5.boolean(),
361
390
  createdAt: timestamp,
362
391
  updatedAt: timestamp
363
392
  });
364
- var questOutcomeQuerySchema = z4.strictObject({
393
+ var questOutcomeQuerySchema = z5.strictObject({
365
394
  /** Quest key or ID. */
366
395
  quest: identifier.optional(),
367
- state: z4.enum(["admitted", "skipped"]).optional(),
396
+ state: z5.enum(["admitted", "skipped"]).optional(),
368
397
  /** Only skips with this code, such as `historical`. */
369
- code: z4.string().min(1).max(100).optional(),
398
+ code: z5.string().min(1).max(100).optional(),
370
399
  cursor: pageCursorSchema.optional()
371
400
  });
372
- var questOutcomePageSchema = z4.object({
373
- items: z4.array(questOutcomeSchema),
401
+ var questOutcomePageSchema = z5.object({
402
+ items: z5.array(questOutcomeSchema),
374
403
  nextCursor: pageCursorSchema.nullable()
375
404
  });
376
405
 
377
406
  // src/participant-rewards.ts
378
- import * as z5 from "zod";
379
- var participantEntitlementsSchema = z5.object({
380
- items: z5.array(entitlementSchema)
407
+ import * as z6 from "zod";
408
+ var participantEntitlementsSchema = z6.object({
409
+ items: z6.array(entitlementSchema)
381
410
  });
382
411
  var base2 = {
383
- id: z5.string(),
384
- status: z5.string(),
385
- at: z5.number().nullable(),
386
- quest: z5.string().nullable(),
387
- completion: z5.string().nullable()
412
+ id: z6.string(),
413
+ status: z6.string(),
414
+ at: z6.number().nullable(),
415
+ quest: z6.string().nullable(),
416
+ completion: z6.string().nullable()
388
417
  };
389
- var known = z5.discriminatedUnion("kind", [
390
- z5.object({
418
+ var known = z6.discriminatedUnion("kind", [
419
+ z6.object({
391
420
  ...base2,
392
- kind: z5.literal("points"),
421
+ kind: z6.literal("points"),
393
422
  ledger: pointLedgerReferenceSchema,
394
- amount: z5.number(),
395
- reversed: z5.number()
396
- }).catchall(z5.json()),
397
- z5.object({
423
+ amount: z6.number(),
424
+ reversed: z6.number()
425
+ }).catchall(z6.json()),
426
+ z6.object({
398
427
  ...base2,
399
- kind: z5.literal("tier"),
428
+ kind: z6.literal("tier"),
400
429
  entitlement: entitlementSchema
401
- }).catchall(z5.json().transform((value) => value)),
402
- z5.object({
430
+ }).catchall(z6.json().transform((value) => value)),
431
+ z6.object({
403
432
  ...base2,
404
- kind: z5.literal("integration"),
405
- provider: z5.string(),
406
- action: z5.string(),
407
- roleId: z5.string().optional(),
408
- deliveredAt: z5.number().nullable(),
409
- revokedAt: z5.number().nullable(),
410
- reconciliation: z5.object({ status: z5.string(), ownership: z5.string(), at: z5.number() }).catchall(z5.json()).nullable()
411
- }).catchall(z5.json().optional())
433
+ kind: z6.literal("integration"),
434
+ provider: z6.string(),
435
+ action: z6.string(),
436
+ roleId: z6.string().optional(),
437
+ deliveredAt: z6.number().nullable(),
438
+ revokedAt: z6.number().nullable(),
439
+ reconciliation: z6.object({ status: z6.string(), ownership: z6.string(), at: z6.number() }).catchall(z6.json()).nullable()
440
+ }).catchall(z6.json().optional())
412
441
  ]);
413
- var participantDeliverySchema = z5.union([
442
+ var participantDeliverySchema = z6.union([
414
443
  known,
415
- z5.object({
444
+ z6.object({
416
445
  ...base2,
417
- kind: z5.string().refine((kind) => !["points", "tier", "integration"].includes(kind))
418
- }).catchall(z5.json()).transform(({ kind, ...item }) => ({
446
+ kind: z6.string().refine((kind) => !["points", "tier", "integration"].includes(kind))
447
+ }).catchall(z6.json()).transform(({ kind, ...item }) => ({
419
448
  ...item,
420
449
  kind: "unknown",
421
450
  reportedKind: kind
422
451
  }))
423
452
  ]);
424
- var participantDeliveriesSchema = z5.object({
425
- items: z5.array(participantDeliverySchema)
453
+ var participantDeliveriesSchema = z6.object({
454
+ items: z6.array(participantDeliverySchema)
426
455
  });
427
456
 
428
457
  // src/reward-deliveries.ts
429
- import * as z6 from "zod";
458
+ import * as z7 from "zod";
430
459
  var RewardDeliveryAction = {
431
460
  /** Delivers a quest's Discord role reward. */
432
461
  GrantRole: "grant-role"
433
462
  };
434
- var rewardDeliveryActionSchema = z6.string().min(1).max(64);
435
- var roleReconciliationSchema = z6.object({
436
- status: z6.enum(["pending", "granted", "removed", "preserved", "failed"]),
437
- ownership: z6.enum(["unclaimed", "relay", "external"]),
438
- at: z6.number(),
439
- reason: z6.string().nullable()
463
+ var rewardDeliveryActionSchema = z7.string().min(1).max(64);
464
+ var roleReconciliationSchema = z7.object({
465
+ status: z7.enum(["pending", "granted", "removed", "preserved", "failed"]),
466
+ ownership: z7.enum(["unclaimed", "relay", "external"]),
467
+ at: z7.number(),
468
+ reason: z7.string().nullable()
440
469
  });
441
- var knownRewardDeliverySchema = z6.object({
442
- id: z6.string(),
443
- quest: z6.string(),
444
- completion: z6.string(),
445
- member: z6.string(),
446
- provider: z6.literal("discord"),
470
+ var knownRewardDeliverySchema = z7.object({
471
+ id: z7.string(),
472
+ quest: z7.string(),
473
+ completion: z7.string(),
474
+ member: z7.string(),
475
+ provider: z7.literal("discord"),
447
476
  /** `RewardDeliveryAction`, such as `grant-role`. */
448
477
  action: rewardDeliveryActionSchema,
449
- roleId: z6.string(),
478
+ roleId: z7.string(),
450
479
  /**
451
480
  * `failed` is terminal: Discord rejected the grant permanently (unknown role,
452
481
  * member left the server, missing permissions) or retries ran out after about
453
482
  * a day. An operator can retry it once the cause is fixed, unless revokedAt is set.
454
483
  * Revoke stops pending grants; a late success records deliveredAt but leaves status failed.
455
484
  */
456
- status: z6.enum(["pending", "delivered", "failed"]),
485
+ status: z7.enum(["pending", "delivered", "failed"]),
457
486
  /** Provider attempts in the current round; an operator retry starts a new round at zero. */
458
- attempts: z6.number().int(),
487
+ attempts: z7.number().int(),
459
488
  /** While pending with a `lastError`, when the next attempt is scheduled. */
460
- nextAt: z6.number(),
461
- lastError: z6.string().nullable(),
462
- createdAt: z6.number(),
463
- deliveredAt: z6.number().nullable(),
489
+ nextAt: z7.number(),
490
+ lastError: z7.string().nullable(),
491
+ createdAt: z7.number(),
492
+ deliveredAt: z7.number().nullable(),
464
493
  /** First dispatch attempt, retained across retries. Legacy rows use creation time when dispatch timing is unknown. */
465
- dispatchedAt: z6.number().nullable().optional(),
494
+ dispatchedAt: z7.number().nullable().optional(),
466
495
  /** Completion revocation stops retries, including deliveries that had already failed. */
467
- revokedAt: z6.number().nullable().optional(),
496
+ revokedAt: z7.number().nullable().optional(),
468
497
  /** Current reconciliation of the pinned Discord membership; original delivery and revoke history stay intact. */
469
498
  reconciliation: roleReconciliationSchema.nullable().optional()
470
499
  });
471
500
  var futureRewardDeliverySchema = knownRewardDeliverySchema.extend({
472
- provider: z6.string(),
473
- status: z6.string(),
474
- roleId: z6.string().optional(),
475
- reconciliation: z6.object({
476
- status: z6.string(),
477
- ownership: z6.string(),
478
- at: z6.number(),
479
- reason: z6.string().nullable()
480
- }).catchall(z6.json()).nullable().optional()
481
- }).catchall(z6.json().optional()).refine(
501
+ provider: z7.string(),
502
+ status: z7.string(),
503
+ roleId: z7.string().optional(),
504
+ reconciliation: z7.object({
505
+ status: z7.string(),
506
+ ownership: z7.string(),
507
+ at: z7.number(),
508
+ reason: z7.string().nullable()
509
+ }).catchall(z7.json()).nullable().optional()
510
+ }).catchall(z7.json().optional()).refine(
482
511
  (delivery) => delivery.provider !== "discord" || !["pending", "delivered", "failed"].includes(delivery.status) || delivery.reconciliation && (!["pending", "granted", "removed", "preserved", "failed"].includes(
483
512
  delivery.reconciliation.status
484
513
  ) || !["unclaimed", "relay", "external"].includes(
485
514
  delivery.reconciliation.ownership
486
515
  ))
487
516
  );
488
- var rewardDeliverySchema = z6.union([
489
- knownRewardDeliverySchema.catchall(z6.json().optional()),
517
+ var rewardDeliverySchema = z7.union([
518
+ knownRewardDeliverySchema.catchall(z7.json().optional()),
490
519
  futureRewardDeliverySchema
491
520
  ]);
492
- var rewardDeliveriesSchema = z6.object({
493
- deliveries: z6.array(rewardDeliverySchema),
521
+ var rewardDeliveriesSchema = z7.object({
522
+ deliveries: z7.array(rewardDeliverySchema),
494
523
  nextCursor: pageCursorSchema.nullable().default(null)
495
524
  });
496
- var rewardDeliveryQuerySchema = z6.strictObject({
525
+ var rewardDeliveryQuerySchema = z7.strictObject({
497
526
  cursor: pageCursorSchema.optional(),
498
- limit: z6.coerce.number().int().min(1).max(500).optional()
527
+ limit: z7.coerce.number().int().min(1).max(500).optional()
499
528
  });
500
529
 
501
530
  export {
@@ -524,6 +553,10 @@ export {
524
553
  questPublicationPreviewSchema,
525
554
  allocateQuestSchema,
526
555
  allocatedQuestSchema,
556
+ knownCreatorAccountProviders,
557
+ creatorAccountProviderSchema,
558
+ creatorAccountSchema,
559
+ creatorAccountsSchema,
527
560
  collectionCodeSchema,
528
561
  collectionPassSchema,
529
562
  collectionResolveSchema,