@domino-sdk/relay 1.55.0 → 1.59.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 +85 -0
  2. package/dist/{accounts-DRPENuZe.d.ts → accounts-CVonEkdb.d.ts} +18 -7
  3. package/dist/{attempt-captures-CxxO7DeD.d.ts → attempt-captures-DBj-rxak.d.ts} +1 -1
  4. package/dist/authoring.d.ts +306 -72
  5. package/dist/authoring.js +264 -9
  6. package/dist/{automatic-outcomes-DxW_v5Wc.d.ts → automatic-outcomes-FS9okvBP.d.ts} +1 -1
  7. package/dist/avatar.d.ts +1 -2
  8. package/dist/browser.d.ts +8 -9
  9. package/dist/browser.js +10 -10
  10. package/dist/{capability-error-DSd8EMQC.d.ts → capability-error-DDJl0LY-.d.ts} +0 -6
  11. package/dist/{chunk-IZRITLVV.js → chunk-2LKGAL63.js} +2 -2
  12. package/dist/{chunk-GL43VQ5D.js → chunk-577DG2IT.js} +38 -8
  13. package/dist/{chunk-UY6KMLQG.js → chunk-6U5WWH3W.js} +141 -100
  14. package/dist/{chunk-YCOKTQ4E.js → chunk-AWWCEP7F.js} +1403 -882
  15. package/dist/{chunk-56DBFNR2.js → chunk-EQF4ID47.js} +1 -1
  16. package/dist/{chunk-YEVD4A5X.js → chunk-IBROKMFV.js} +2 -2
  17. package/dist/{chunk-XALIFNMD.js → chunk-KBCTII6C.js} +1 -1
  18. package/dist/{chunk-WHG5WE43.js → chunk-KYUQEZZA.js} +1 -1
  19. package/dist/{chunk-WUEQOKJH.js → chunk-LDLOB2UZ.js} +4 -4
  20. package/dist/{chunk-IUF7DW76.js → chunk-M2JQPDUX.js} +39 -9
  21. package/dist/{chunk-MLIXJPKL.js → chunk-MHPKEVEW.js} +1 -0
  22. package/dist/{chunk-TLK2MD4S.js → chunk-R4S6BFOH.js} +1 -1
  23. package/dist/{chunk-VFBQVY4X.js → chunk-TZJT5CRF.js} +1 -1
  24. package/dist/{chunk-C7QZ4UBB.js → chunk-UEMLYPKJ.js} +21 -5
  25. package/dist/{chunk-F6HECAXA.js → chunk-W42KMMH5.js} +140 -101
  26. package/dist/{chunk-WHMXXHPX.js → chunk-XGXDINGM.js} +16 -3
  27. package/dist/{chunk-SABMNPF2.js → chunk-YMWRLAAP.js} +1 -1
  28. package/dist/{chunk-YE3XYB2F.js → chunk-YRSU2X2P.js} +2 -2
  29. package/dist/{client-C4zUZKpj.d.ts → client-3b9HjSzZ.d.ts} +191 -117
  30. package/dist/{deployments-B32QS1CI.d.ts → deployments-BydFVj4Q.d.ts} +798 -235
  31. package/dist/{groups-O6onGPmC.d.ts → groups-CFuTfFqG.d.ts} +15 -9
  32. package/dist/index.d.ts +9 -10
  33. package/dist/index.js +9 -9
  34. package/dist/{integrations-C6_uUh-s.d.ts → integrations-DrbKQSTD.d.ts} +42 -22
  35. package/dist/internal.d.ts +10 -10
  36. package/dist/internal.js +9 -9
  37. package/dist/{offers-BMDNcvwB.d.ts → offers-DAfe1O3_.d.ts} +211 -2
  38. package/dist/{pages-BFloMpyQ.d.ts → pages-ChDVLrgR.d.ts} +95 -10
  39. package/dist/portal-proxy.js +4 -4
  40. package/dist/react/index.d.ts +149 -72
  41. package/dist/react/index.js +65 -10
  42. package/dist/runtime/authoring.js +1 -1
  43. package/dist/runtime/chunks/BG43KQ2T.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-BA0nRRlt.d.ts} +184 -35
  49. package/dist/schema.d.ts +1265 -697
  50. package/dist/schema.js +96 -12
  51. package/dist/server/index.d.ts +10 -10
  52. package/dist/server/index.js +1644 -1105
  53. package/dist/{submission-input-BbdawqVy.d.ts → submission-input-DxQ6RnKo.d.ts} +2 -2
  54. package/dist/{telegram-browser-CwaxROAZ.d.ts → telegram-browser-o3OIxGrJ.d.ts} +3 -3
  55. package/dist/testing.d.ts +89 -9
  56. package/dist/testing.js +215 -10
  57. package/dist/{transport-CZJOW5Sr.d.ts → transport-D_Eqf78J.d.ts} +8592 -4384
  58. package/dist/wallet-B06zvDXp.d.ts +972 -0
  59. package/dist/{x-1czZFVUW.d.ts → x-C28SNifw.d.ts} +2 -2
  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/WKATKZXE.js +0 -1
  64. package/dist/util.d-w9f9t3ua.d.ts +0 -5
  65. package/dist/wallet-Ac7OFpOr.d.ts +0 -228
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  badgeSchema
3
- } from "./chunk-C7QZ4UBB.js";
3
+ } from "./chunk-UEMLYPKJ.js";
4
4
  import {
5
5
  pointLedgerReferenceSchema
6
- } from "./chunk-WHMXXHPX.js";
6
+ } from "./chunk-XGXDINGM.js";
7
7
  import {
8
8
  authoringIdentityShape,
9
9
  entitlementSchema,
@@ -25,7 +25,7 @@ import {
25
25
  storedQuestDescriptionSchema,
26
26
  storedReviewModeSchema,
27
27
  tieredRewardReferenceSchema
28
- } from "./chunk-YCOKTQ4E.js";
28
+ } from "./chunk-AWWCEP7F.js";
29
29
 
30
30
  // src/participant-activity.ts
31
31
  import * as z from "zod";
@@ -290,30 +290,52 @@ var questPublicationPreviewSchema = responseShape(
290
290
  var allocateQuestSchema = z2.object({ actionId: identifier }).strict();
291
291
  var allocatedQuestSchema = z2.object({ id: identifier });
292
292
 
293
- // src/collection.ts
293
+ // src/creator-accounts.ts
294
294
  import * as z3 from "zod";
295
- var collectionCodeSchema = z3.string().regex(/^relay:collect:[a-f0-9]{64}$/);
296
- 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({
297
319
  code: collectionCodeSchema,
298
- expiresAt: z3.number(),
320
+ expiresAt: z4.number(),
299
321
  entitlement: identifier
300
322
  });
301
- var collectionResolveSchema = z3.object({ code: collectionCodeSchema }).strict();
323
+ var collectionResolveSchema = z4.object({ code: collectionCodeSchema }).strict();
302
324
  var collectionBeginSchema = collectionResolveSchema.extend({
303
325
  actionId: identifier,
304
- revision: z3.number().int().positive(),
326
+ revision: z4.number().int().positive(),
305
327
  selection: pickupSelectionSchema.optional()
306
328
  });
307
- var collectionPreviewSchema = z3.object({
329
+ var collectionPreviewSchema = z4.object({
308
330
  entitlement: entitlementSchema,
309
331
  inventory: pickupAvailabilitySchema,
310
- expiresAt: z3.number()
332
+ expiresAt: z4.number()
311
333
  });
312
334
 
313
335
  // src/outcomes.ts
314
- import * as z4 from "zod";
315
- var timestamp = z4.number().int().safe().nonnegative();
316
- var questEnrollmentInputSchema = z4.strictObject({
336
+ import * as z5 from "zod";
337
+ var timestamp = z5.number().int().safe().nonnegative();
338
+ var questEnrollmentInputSchema = z5.strictObject({
317
339
  actionId: identifier,
318
340
  /** Quest key or ID. */
319
341
  quest: identifier
@@ -321,26 +343,26 @@ var questEnrollmentInputSchema = z4.strictObject({
321
343
  var memberEnrollmentInputSchema = questEnrollmentInputSchema.extend({
322
344
  member: identifier
323
345
  });
324
- var questEnrollmentSchema = z4.object({
346
+ var questEnrollmentSchema = z5.object({
325
347
  /** Stable quest ID. */
326
348
  quest: identifier,
327
349
  member: identifier,
328
350
  enrolledAt: timestamp
329
351
  });
330
- var questClaimInputSchema = z4.strictObject({
352
+ var questClaimInputSchema = z5.strictObject({
331
353
  actionId: identifier,
332
354
  /** Quest key or ID. */
333
355
  quest: identifier,
334
356
  /** The outcome's tracker, as `QuestOutcome.tracker` names it. */
335
357
  tracker: identifier,
336
- record: z4.string().min(1).max(256),
358
+ record: z5.string().min(1).max(256),
337
359
  observedAt: timestamp
338
360
  });
339
361
  var QuestOutcomeState = {
340
362
  Admitted: "admitted",
341
363
  Skipped: "skipped"
342
364
  };
343
- var questOutcomeSchema = z4.object({
365
+ var questOutcomeSchema = z5.object({
344
366
  /** Prerequisite transition identity; absent on older tracker responses. */
345
367
  automatic: identifier.optional(),
346
368
  /** Stable quest ID. */
@@ -348,161 +370,174 @@ var questOutcomeSchema = z4.object({
348
370
  /** Stable tracker ID of the record decided. */
349
371
  tracker: identifier.nullable(),
350
372
  /** The record's ID in its tracker. */
351
- record: z4.string().nullable(),
373
+ record: z5.string().nullable(),
352
374
  /** Which observation of the record was decided. */
353
375
  observedAt: timestamp.nullable(),
354
- state: z4.enum(["admitted", "skipped"]),
376
+ state: z5.enum(["admitted", "skipped"]),
355
377
  /**
356
378
  * Why it was skipped, one of `trackerSkipCodes` or a code a newer Relay sends; null when
357
379
  * admitted. Show an unknown code by its `reason`.
358
380
  */
359
- code: z4.string().nullable(),
381
+ code: z5.string().nullable(),
360
382
  /** Why it was skipped, for people; null when admitted. */
361
- reason: z4.string().nullable(),
383
+ reason: z5.string().nullable(),
362
384
  /** Which window refused admission when `code` is `outside-window`. */
363
- window: z4.enum(["tracker", "quest"]).optional(),
385
+ window: z5.enum(["tracker", "quest"]).optional(),
364
386
  /** The admitted attempt. */
365
387
  attempt: identifier.nullable(),
366
388
  /** The member can claim it with `relay.quests.claim()`. */
367
- claimable: z4.boolean(),
389
+ claimable: z5.boolean(),
368
390
  createdAt: timestamp,
369
391
  updatedAt: timestamp
370
392
  });
371
- var questOutcomeQuerySchema = z4.strictObject({
393
+ var questOutcomeQuerySchema = z5.strictObject({
372
394
  /** Quest key or ID. */
373
395
  quest: identifier.optional(),
374
- state: z4.enum(["admitted", "skipped"]).optional(),
396
+ state: z5.enum(["admitted", "skipped"]).optional(),
375
397
  /** Only skips with this code, such as `historical`. */
376
- code: z4.string().min(1).max(100).optional(),
398
+ code: z5.string().min(1).max(100).optional(),
377
399
  cursor: pageCursorSchema.optional()
378
400
  });
379
- var questOutcomePageSchema = z4.object({
380
- items: z4.array(questOutcomeSchema),
401
+ var questOutcomePageSchema = z5.object({
402
+ items: z5.array(questOutcomeSchema),
381
403
  nextCursor: pageCursorSchema.nullable()
382
404
  });
383
405
 
384
406
  // src/participant-rewards.ts
385
- import * as z5 from "zod";
386
- var participantEntitlementsSchema = z5.object({
387
- items: z5.array(entitlementSchema)
407
+ import * as z6 from "zod";
408
+ var participantEntitlementsSchema = z6.object({
409
+ items: z6.array(entitlementSchema)
388
410
  });
389
411
  var base2 = {
390
- id: z5.string(),
391
- status: z5.string(),
392
- at: z5.number().nullable(),
393
- quest: z5.string().nullable(),
394
- 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()
395
417
  };
396
- var known = z5.discriminatedUnion("kind", [
397
- z5.object({
418
+ var known = z6.discriminatedUnion("kind", [
419
+ z6.object({
398
420
  ...base2,
399
- kind: z5.literal("points"),
421
+ kind: z6.literal("points"),
400
422
  ledger: pointLedgerReferenceSchema,
401
- amount: z5.number(),
402
- reversed: z5.number()
403
- }).catchall(z5.json()),
404
- z5.object({
423
+ amount: z6.number(),
424
+ reversed: z6.number()
425
+ }).catchall(z6.json()),
426
+ z6.object({
405
427
  ...base2,
406
- kind: z5.literal("tier"),
428
+ kind: z6.literal("tier"),
407
429
  entitlement: entitlementSchema
408
- }).catchall(z5.json().transform((value) => value)),
409
- z5.object({
430
+ }).catchall(z6.json().transform((value) => value)),
431
+ z6.object({
410
432
  ...base2,
411
- kind: z5.literal("integration"),
412
- provider: z5.string(),
413
- action: z5.string(),
414
- roleId: z5.string().optional(),
415
- deliveredAt: z5.number().nullable(),
416
- revokedAt: z5.number().nullable(),
417
- reconciliation: z5.object({ status: z5.string(), ownership: z5.string(), at: z5.number() }).catchall(z5.json()).nullable()
418
- }).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())
419
441
  ]);
420
- var participantDeliverySchema = z5.union([
442
+ var participantDeliverySchema = z6.union([
421
443
  known,
422
- z5.object({
444
+ z6.object({
423
445
  ...base2,
424
- kind: z5.string().refine((kind) => !["points", "tier", "integration"].includes(kind))
425
- }).catchall(z5.json()).transform(({ kind, ...item }) => ({
446
+ kind: z6.string().refine((kind) => !["points", "tier", "integration"].includes(kind))
447
+ }).catchall(z6.json()).transform(({ kind, ...item }) => ({
426
448
  ...item,
427
449
  kind: "unknown",
428
450
  reportedKind: kind
429
451
  }))
430
452
  ]);
431
- var participantDeliveriesSchema = z5.object({
432
- items: z5.array(participantDeliverySchema)
453
+ var participantDeliveriesSchema = z6.object({
454
+ items: z6.array(participantDeliverySchema)
433
455
  });
434
456
 
435
457
  // src/reward-deliveries.ts
436
- import * as z6 from "zod";
458
+ import * as z7 from "zod";
437
459
  var RewardDeliveryAction = {
438
460
  /** Delivers a quest's Discord role reward. */
439
461
  GrantRole: "grant-role"
440
462
  };
441
- var rewardDeliveryActionSchema = z6.string().min(1).max(64);
442
- var roleReconciliationSchema = z6.object({
443
- status: z6.enum(["pending", "granted", "removed", "preserved", "failed"]),
444
- ownership: z6.enum(["unclaimed", "relay", "external"]),
445
- at: z6.number(),
446
- 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()
447
469
  });
448
- var knownRewardDeliverySchema = z6.object({
449
- id: z6.string(),
450
- quest: z6.string(),
451
- completion: z6.string(),
452
- member: z6.string(),
453
- 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"),
454
476
  /** `RewardDeliveryAction`, such as `grant-role`. */
455
477
  action: rewardDeliveryActionSchema,
456
- roleId: z6.string(),
478
+ roleId: z7.string(),
457
479
  /**
458
480
  * `failed` is terminal: Discord rejected the grant permanently (unknown role,
459
481
  * member left the server, missing permissions) or retries ran out after about
460
482
  * a day. An operator can retry it once the cause is fixed, unless revokedAt is set.
461
483
  * Revoke stops pending grants; a late success records deliveredAt but leaves status failed.
462
484
  */
463
- status: z6.enum(["pending", "delivered", "failed"]),
485
+ status: z7.enum(["pending", "delivered", "failed"]),
464
486
  /** Provider attempts in the current round; an operator retry starts a new round at zero. */
465
- attempts: z6.number().int(),
487
+ attempts: z7.number().int(),
466
488
  /** While pending with a `lastError`, when the next attempt is scheduled. */
467
- nextAt: z6.number(),
468
- lastError: z6.string().nullable(),
469
- createdAt: z6.number(),
470
- deliveredAt: z6.number().nullable(),
489
+ nextAt: z7.number(),
490
+ lastError: z7.string().nullable(),
491
+ createdAt: z7.number(),
492
+ deliveredAt: z7.number().nullable(),
471
493
  /** First dispatch attempt, retained across retries. Legacy rows use creation time when dispatch timing is unknown. */
472
- dispatchedAt: z6.number().nullable().optional(),
494
+ dispatchedAt: z7.number().nullable().optional(),
473
495
  /** Completion revocation stops retries, including deliveries that had already failed. */
474
- revokedAt: z6.number().nullable().optional(),
496
+ revokedAt: z7.number().nullable().optional(),
475
497
  /** Current reconciliation of the pinned Discord membership; original delivery and revoke history stay intact. */
476
498
  reconciliation: roleReconciliationSchema.nullable().optional()
477
499
  });
478
500
  var futureRewardDeliverySchema = knownRewardDeliverySchema.extend({
479
- provider: z6.string(),
480
- status: z6.string(),
481
- roleId: z6.string().optional(),
482
- reconciliation: z6.object({
483
- status: z6.string(),
484
- ownership: z6.string(),
485
- at: z6.number(),
486
- reason: z6.string().nullable()
487
- }).catchall(z6.json()).nullable().optional()
488
- }).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(
489
511
  (delivery) => delivery.provider !== "discord" || !["pending", "delivered", "failed"].includes(delivery.status) || delivery.reconciliation && (!["pending", "granted", "removed", "preserved", "failed"].includes(
490
512
  delivery.reconciliation.status
491
513
  ) || !["unclaimed", "relay", "external"].includes(
492
514
  delivery.reconciliation.ownership
493
515
  ))
494
516
  );
495
- var rewardDeliverySchema = z6.union([
496
- knownRewardDeliverySchema.catchall(z6.json().optional()),
517
+ var rewardDeliverySchema = z7.union([
518
+ knownRewardDeliverySchema.catchall(z7.json().optional()),
497
519
  futureRewardDeliverySchema
498
520
  ]);
499
- var rewardDeliveriesSchema = z6.object({
500
- deliveries: z6.array(rewardDeliverySchema),
521
+ var rewardDeliveriesSchema = z7.object({
522
+ deliveries: z7.array(rewardDeliverySchema),
501
523
  nextCursor: pageCursorSchema.nullable().default(null)
502
524
  });
503
- var rewardDeliveryQuerySchema = z6.strictObject({
525
+ var rewardDeliveryQuerySchema = z7.strictObject({
504
526
  cursor: pageCursorSchema.optional(),
505
- limit: z6.coerce.number().int().min(1).max(500).optional()
527
+ limit: z7.coerce.number().int().min(1).max(500).optional()
528
+ });
529
+ var discordRoleRewardSchema = z7.object({
530
+ roleId: z7.string(),
531
+ quests: z7.array(z7.string()),
532
+ /** Delivery records of this role by `RewardDelivery.status`. */
533
+ deliveries: z7.object({
534
+ pending: z7.number().int(),
535
+ delivered: z7.number().int(),
536
+ failed: z7.number().int()
537
+ })
538
+ });
539
+ var discordRoleRewardsSchema = z7.object({
540
+ roles: z7.array(discordRoleRewardSchema)
506
541
  });
507
542
 
508
543
  export {
@@ -531,6 +566,10 @@ export {
531
566
  questPublicationPreviewSchema,
532
567
  allocateQuestSchema,
533
568
  allocatedQuestSchema,
569
+ knownCreatorAccountProviders,
570
+ creatorAccountProviderSchema,
571
+ creatorAccountSchema,
572
+ creatorAccountsSchema,
534
573
  collectionCodeSchema,
535
574
  collectionPassSchema,
536
575
  collectionResolveSchema,
@@ -552,5 +591,7 @@ export {
552
591
  knownRewardDeliverySchema,
553
592
  rewardDeliverySchema,
554
593
  rewardDeliveriesSchema,
555
- rewardDeliveryQuerySchema
594
+ rewardDeliveryQuerySchema,
595
+ discordRoleRewardSchema,
596
+ discordRoleRewardsSchema
556
597
  };