@domino-sdk/relay 1.59.0 → 1.61.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 (61) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/dist/{accounts-CVonEkdb.d.ts → accounts-DoabriBX.d.ts} +4 -1
  3. package/dist/{integrations-DrbKQSTD.d.ts → announcements-CHx3-HBw.d.ts} +48 -42
  4. package/dist/{attempt-captures-DBj-rxak.d.ts → attempt-captures-DYnJVkfg.d.ts} +1 -1
  5. package/dist/authoring.d.ts +161 -29
  6. package/dist/authoring.js +116 -36
  7. package/dist/{automatic-outcomes-FS9okvBP.d.ts → automatic-outcomes-If88LR9f.d.ts} +1 -1
  8. package/dist/avatar.d.ts +1 -1
  9. package/dist/browser.d.ts +19 -10
  10. package/dist/browser.js +12 -10
  11. package/dist/{capability-error-DDJl0LY-.d.ts → capability-error-DufwG3G0.d.ts} +21 -1
  12. package/dist/{chunk-2LKGAL63.js → chunk-24I4R732.js} +39 -2
  13. package/dist/{chunk-UEMLYPKJ.js → chunk-3Y3L2F54.js} +34 -5
  14. package/dist/{chunk-YRSU2X2P.js → chunk-5I54XBK2.js} +2 -2
  15. package/dist/{chunk-KBCTII6C.js → chunk-7A4J67ZL.js} +1 -1
  16. package/dist/{chunk-LDLOB2UZ.js → chunk-DHXDBAJF.js} +4 -4
  17. package/dist/{chunk-W42KMMH5.js → chunk-DYXDZFKA.js} +5 -2
  18. package/dist/{chunk-TZJT5CRF.js → chunk-EN3M5Z4J.js} +1 -1
  19. package/dist/{chunk-IBROKMFV.js → chunk-L77O64I4.js} +1 -1
  20. package/dist/{chunk-EQF4ID47.js → chunk-PPB7HALD.js} +12 -2
  21. package/dist/{chunk-KYUQEZZA.js → chunk-QEAS4ZGS.js} +1 -1
  22. package/dist/{chunk-6U5WWH3W.js → chunk-QNUHWK7R.js} +9 -4
  23. package/dist/{chunk-YMWRLAAP.js → chunk-RHBS5FJL.js} +8 -2
  24. package/dist/chunk-SE4PFJPT.js +247 -0
  25. package/dist/{chunk-577DG2IT.js → chunk-SKGTNTLF.js} +12 -12
  26. package/dist/{chunk-M2JQPDUX.js → chunk-VURRFVNP.js} +9 -9
  27. package/dist/{chunk-R4S6BFOH.js → chunk-XBV2CK2H.js} +1 -1
  28. package/dist/{chunk-AWWCEP7F.js → chunk-ZDJLPN4L.js} +815 -592
  29. package/dist/{client-3b9HjSzZ.d.ts → client-C51w7fMb.d.ts} +12 -7
  30. package/dist/{deployments-BydFVj4Q.d.ts → deployments-kWoHFaqj.d.ts} +786 -2
  31. package/dist/{groups-CFuTfFqG.d.ts → groups-CqcA2Ycs.d.ts} +4 -1
  32. package/dist/index.d.ts +10 -10
  33. package/dist/index.js +9 -9
  34. package/dist/{analytics-URV-mxjH.d.ts → integrations-B3y36OaB.d.ts} +55 -1
  35. package/dist/internal.d.ts +11 -11
  36. package/dist/internal.js +8 -8
  37. package/dist/{offers-DAfe1O3_.d.ts → offers-BoV4ryUc.d.ts} +3 -2
  38. package/dist/{pages-ChDVLrgR.d.ts → pages-K7-KjSXw.d.ts} +147 -2
  39. package/dist/{participant-activity-iciCEs_8.d.ts → participant-activity-DHL8QYks.d.ts} +4 -0
  40. package/dist/portal-proxy.js +3 -3
  41. package/dist/react/index.d.ts +20 -15
  42. package/dist/react/index.js +143 -14
  43. package/dist/runtime/authoring.js +1 -1
  44. package/dist/runtime/chunks/5QVFB4TU.js +1 -0
  45. package/dist/runtime/manifest.json +3 -3
  46. package/dist/runtime/schema.js +1 -1
  47. package/dist/{schema-BA0nRRlt.d.ts → schema-CZ6Rj0ZF.d.ts} +142 -2
  48. package/dist/schema.d.ts +113 -18
  49. package/dist/schema.js +37 -21
  50. package/dist/server/index.d.ts +11 -11
  51. package/dist/server/index.js +346 -41
  52. package/dist/{submission-input-DxQ6RnKo.d.ts → submission-input-C54Q8yAD.d.ts} +2 -2
  53. package/dist/{telegram-browser-o3OIxGrJ.d.ts → telegram-browser-BUceZIGZ.d.ts} +7 -4
  54. package/dist/testing.d.ts +7 -7
  55. package/dist/testing.js +8 -8
  56. package/dist/{transport-D_Eqf78J.d.ts → transport-BrX9pIGN.d.ts} +5374 -62
  57. package/dist/{wallet-B06zvDXp.d.ts → wallet-CIqFoxdm.d.ts} +8 -1
  58. package/dist/{x-C28SNifw.d.ts → x-D1PGi8Sq.d.ts} +2 -2
  59. package/package.json +1 -1
  60. package/dist/chunk-XGXDINGM.js +0 -357
  61. package/dist/runtime/chunks/BG43KQ2T.js +0 -1
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  attemptCaptureSchema,
3
3
  capturedFactSchema
4
- } from "../chunk-KBCTII6C.js";
4
+ } from "../chunk-7A4J67ZL.js";
5
5
  import {
6
6
  activityTypeSchema,
7
7
  activityTypes,
@@ -27,7 +27,7 @@ import {
27
27
  publishDeploymentSchema,
28
28
  rejectDeploymentSchema,
29
29
  submitDeploymentSchema
30
- } from "../chunk-M2JQPDUX.js";
30
+ } from "../chunk-VURRFVNP.js";
31
31
  import {
32
32
  analyticsBreakdowns,
33
33
  analyticsCatalog,
@@ -42,7 +42,7 @@ import {
42
42
  analyticsRanges,
43
43
  analyticsReadSchema,
44
44
  dashboardDefinitionSchema
45
- } from "../chunk-W42KMMH5.js";
45
+ } from "../chunk-DYXDZFKA.js";
46
46
  import "../chunk-4OC7REYX.js";
47
47
  import {
48
48
  DEFAULT_MANAGEMENT_TIMEOUT,
@@ -63,22 +63,22 @@ import {
63
63
  participantExchangeSchema,
64
64
  questConfiguration,
65
65
  sequenceCursorSchema
66
- } from "../chunk-LDLOB2UZ.js";
66
+ } from "../chunk-DHXDBAJF.js";
67
67
  import {
68
68
  parseImageExtraction,
69
69
  parseImageResult
70
- } from "../chunk-YRSU2X2P.js";
70
+ } from "../chunk-5I54XBK2.js";
71
71
  import {
72
72
  imageAssetArtifactSchema,
73
73
  xUserLookupInputSchema,
74
74
  xUserSchema,
75
75
  xUsernameSchema
76
- } from "../chunk-IBROKMFV.js";
76
+ } from "../chunk-L77O64I4.js";
77
77
  import {
78
78
  sourceDataSchema,
79
79
  sourceRoles,
80
80
  validateQuestShape
81
- } from "../chunk-YMWRLAAP.js";
81
+ } from "../chunk-RHBS5FJL.js";
82
82
  import {
83
83
  isIntegrationParticipantPath,
84
84
  isParticipantRoute,
@@ -87,7 +87,7 @@ import {
87
87
  } from "../chunk-MHPKEVEW.js";
88
88
  import {
89
89
  withActionId
90
- } from "../chunk-KYUQEZZA.js";
90
+ } from "../chunk-QEAS4ZGS.js";
91
91
  import {
92
92
  allocateQuestSchema,
93
93
  allocatedQuestSchema,
@@ -108,7 +108,7 @@ import {
108
108
  rewardDeliveryQuerySchema,
109
109
  rewardDeliverySchema,
110
110
  saveQuestDraftSchema
111
- } from "../chunk-6U5WWH3W.js";
111
+ } from "../chunk-QNUHWK7R.js";
112
112
  import {
113
113
  badgeMutationResultSchema,
114
114
  badgeMutationSchema,
@@ -156,7 +156,7 @@ import {
156
156
  referralQualificationSchema,
157
157
  referralRewardResolutionSchema,
158
158
  referralSuspensionSchema
159
- } from "../chunk-UEMLYPKJ.js";
159
+ } from "../chunk-3Y3L2F54.js";
160
160
  import {
161
161
  createPointLedgerSchema,
162
162
  managedPointLedgerSchema,
@@ -165,14 +165,11 @@ import {
165
165
  pointLedgerSchema,
166
166
  profileModerationSchema,
167
167
  profileSettingsInputSchema,
168
- profileSettingsSchema,
169
- telegramChatConnectionSchema,
170
- telegramChatIdSchema,
171
- telegramChatsSchema
172
- } from "../chunk-XGXDINGM.js";
173
- import "../chunk-R4S6BFOH.js";
174
- import "../chunk-TZJT5CRF.js";
175
- import "../chunk-EQF4ID47.js";
168
+ profileSettingsSchema
169
+ } from "../chunk-SE4PFJPT.js";
170
+ import "../chunk-XBV2CK2H.js";
171
+ import "../chunk-EN3M5Z4J.js";
172
+ import "../chunk-PPB7HALD.js";
176
173
  import {
177
174
  CompletionSourceKind,
178
175
  acceptAnywaySchema,
@@ -198,6 +195,7 @@ import {
198
195
  counterModerationSchema,
199
196
  createGroupSchema,
200
197
  createStockItemSchema,
198
+ discordServerSchema,
201
199
  entitlementCorrectionSchema,
202
200
  entitlementSchema,
203
201
  eventSchema,
@@ -221,6 +219,7 @@ import {
221
219
  memberIdentitySchema,
222
220
  memberProgressSchema,
223
221
  offsetDateTimeSchema,
222
+ organizationDiscordServersSchema,
224
223
  pageCursorSchema,
225
224
  pageQuerySchema,
226
225
  pickupAvailabilitySchema,
@@ -228,6 +227,7 @@ import {
228
227
  projectCalendarInputSchema,
229
228
  projectCalendarSchema,
230
229
  projectGroupKey,
230
+ projectIntegrationSchema,
231
231
  publishedReleaseSchema,
232
232
  questSettingsInputSchema,
233
233
  questSubmissionSchema,
@@ -240,6 +240,9 @@ import {
240
240
  stockItemSchema,
241
241
  streakProgressSchema,
242
242
  submitSchema,
243
+ telegramChatConnectionSchema,
244
+ telegramChatIdSchema,
245
+ telegramChatsSchema,
243
246
  trackerContentReadSchema,
244
247
  trackerContentSchema,
245
248
  trackerControlSchema,
@@ -266,7 +269,7 @@ import {
266
269
  walletSignInNetworksSchema,
267
270
  walletUnlinkInputSchema,
268
271
  whereSchemaIssue
269
- } from "../chunk-AWWCEP7F.js";
272
+ } from "../chunk-ZDJLPN4L.js";
270
273
 
271
274
  // src/server/identity-links.ts
272
275
  import * as z from "zod";
@@ -362,10 +365,18 @@ var state2 = {
362
365
  */
363
366
  signIn: z2.boolean().nullable()
364
367
  };
368
+ var account = {
369
+ /**
370
+ * True for an X, Discord or Telegram account a member import attached on the organization's
371
+ * word, until the member links that provider's account through Domino. Absent from Relay
372
+ * versions without it.
373
+ */
374
+ imported: z2.boolean().optional()
375
+ };
365
376
  var memberIdentityStateSchema = z2.discriminatedUnion("kind", [
366
377
  walletIdentitySelectorSchema.strip().extend(state2),
367
- oauthIdentitySelectorSchema.strip().extend(state2),
368
- telegramIdentitySelectorSchema.strip().extend(state2),
378
+ oauthIdentitySelectorSchema.strip().extend({ ...state2, ...account }),
379
+ telegramIdentitySelectorSchema.strip().extend({ ...state2, ...account }),
369
380
  appIdentitySelectorSchema.strip().extend(state2)
370
381
  ]);
371
382
  var memberIdentityStatePageSchema = z2.object({
@@ -576,7 +587,10 @@ var testMemberSchema = z7.object({
576
587
  test: z7.literal(true),
577
588
  /** Current project-calendar date (YYYY-MM-DD), computed by the server. */
578
589
  today: z7.iso.date().optional(),
579
- /** Number of calendar days advanced; absent means zero for older servers. */
590
+ /**
591
+ * Number of calendar days advanced with `days`; absent means zero for older servers. Hours,
592
+ * minutes and `to` leave it unchanged, so read the member's date from `today`.
593
+ */
580
594
  offsetDays: z7.number().int().min(0).optional(),
581
595
  /** Linked wallet addresses, by chain then newest first; absent from older servers. */
582
596
  wallets: z7.array(testMemberWalletSchema).optional(),
@@ -614,6 +628,19 @@ var testMemberAdvanceSchema = z7.object({
614
628
  actionId: identifier,
615
629
  days: z7.number().int().min(1).max(30)
616
630
  }).strict();
631
+ var testMemberClockAdvanceSchema = z7.union([
632
+ testMemberAdvanceSchema,
633
+ z7.object({ actionId: identifier, hours: z7.number().int().min(1).max(720) }).strict(),
634
+ z7.object({
635
+ actionId: identifier,
636
+ minutes: z7.number().int().min(1).max(43200)
637
+ }).strict(),
638
+ z7.object({
639
+ actionId: identifier,
640
+ /** An ISO 8601 instant with an offset, such as `2026-10-10T00:00:00+02:00`. */
641
+ to: z7.iso.datetime({ offset: true })
642
+ }).strict()
643
+ ]);
617
644
  var testMemberResetResultSchema = z7.object({
618
645
  member: identifier,
619
646
  deleted: z7.literal(true)
@@ -787,6 +814,14 @@ var importXSchema = z8.object({
787
814
  kind: z8.literal("x"),
788
815
  subject: z8.string().regex(/^[1-9][0-9]{0,19}$/, "Use the numeric X user ID")
789
816
  }).strict();
817
+ var importTelegramSchema = z8.object({
818
+ kind: z8.literal("telegram"),
819
+ subject: z8.string().regex(/^[1-9][0-9]{0,19}$/, "Use the numeric Telegram user ID")
820
+ }).strict();
821
+ var importDiscordSchema = z8.object({
822
+ kind: z8.literal("discord"),
823
+ subject: z8.string().regex(/^[1-9][0-9]{0,19}$/, "Use the numeric Discord user ID")
824
+ }).strict();
790
825
  var importAppIdentitySchema = z8.object({ kind: appIdentityKindSchema, subject: z8.string().min(1).max(256) }).strict();
791
826
  var memberImportIdentitySchema = z8.union([
792
827
  importAppIdentitySchema,
@@ -797,10 +832,32 @@ var memberImportAccountSchema = z8.union([
797
832
  importWalletSchema,
798
833
  importXSchema
799
834
  ]);
835
+ var memberImportVouchedAccountSchema = z8.union([
836
+ importWalletSchema,
837
+ importXSchema,
838
+ importTelegramSchema,
839
+ importDiscordSchema
840
+ ]);
800
841
  var memberImportActionSchema = z8.object({
801
842
  at: importTimeSchema,
802
843
  key: z8.string().min(1).max(200).optional()
803
844
  }).strict();
845
+ var memberImportReferralSchema = z8.object({
846
+ /**
847
+ * The inviter: the `ref` of another row of this import, or the sign-in identity of a member
848
+ * who already exists in this environment.
849
+ */
850
+ inviter: z8.union([
851
+ z8.string().trim().min(1).max(200),
852
+ memberImportIdentitySchema
853
+ ]),
854
+ /** When the member accepted the invitation. */
855
+ acceptedAt: importTimeSchema,
856
+ /** Referral programs, by authoring key or ID, the member qualified in, and when. */
857
+ qualified: z8.array(
858
+ z8.object({ program: z8.string().min(1).max(200), at: importTimeSchema }).strict()
859
+ ).max(50).default([])
860
+ }).strict();
804
861
  var memberImportRowSchema = z8.object({
805
862
  /** The member's ID on the platform they come from. Unique within an import. */
806
863
  ref: z8.string().trim().min(1).max(200),
@@ -819,7 +876,11 @@ var memberImportRowSchema = z8.object({
819
876
  quest: z8.string().min(1).max(200),
820
877
  actions: z8.array(memberImportActionSchema).min(1).max(3660)
821
878
  }).strict()
822
- ).max(200).default([])
879
+ ).max(200).default([]),
880
+ referral: memberImportReferralSchema.optional()
881
+ }).strict();
882
+ var memberImportFullRowSchema = memberImportRowSchema.extend({
883
+ accounts: z8.array(memberImportVouchedAccountSchema).max(20).default([])
823
884
  }).strict();
824
885
  var memberImportCreateSchema = z8.object({
825
886
  actionId: identifier,
@@ -827,6 +888,7 @@ var memberImportCreateSchema = z8.object({
827
888
  source: z8.string().trim().min(1).max(100)
828
889
  }).strict();
829
890
  var memberImportRowsInputSchema = z8.object({ rows: z8.array(memberImportRowSchema).min(1).max(500) }).strict();
891
+ var memberImportFullRowsInputSchema = z8.object({ rows: z8.array(memberImportFullRowSchema).min(1).max(500) }).strict();
830
892
  var MemberImportRefusalCode = {
831
893
  /** An account or identity belongs to another member in the project. */
832
894
  AccountLinkedElsewhere: "account-linked-elsewhere",
@@ -834,8 +896,12 @@ var MemberImportRefusalCode = {
834
896
  IdentityUnlinked: "identity-unlinked",
835
897
  /** An earlier row of the import names the same account. */
836
898
  DuplicateAccount: "duplicate-account",
837
- /** The member already has another X account selected. */
899
+ /** The row names two X accounts, or the member already has another X account selected. */
838
900
  XAccountSelected: "x-account-selected",
901
+ /** The row names two Telegram accounts, or the member already has another one selected. */
902
+ TelegramAccountSelected: "telegram-account-selected",
903
+ /** The row names two Discord accounts, or the member already has another one selected. */
904
+ DiscordAccountSelected: "discord-account-selected",
839
905
  /** The member would hold more wallets of a chain family than a member can link. */
840
906
  LimitReached: "limit-reached",
841
907
  UnknownLedger: "unknown-ledger",
@@ -850,8 +916,20 @@ var MemberImportRefusalCode = {
850
916
  FutureAction: "future-action",
851
917
  /** The row's sign-in wallet or X account is linked to its member without sign-in. */
852
918
  SignInDisabled: "sign-in-disabled",
853
- /** The row names one point ledger or quest twice, by any of its names. */
854
- DuplicateEntry: "duplicate-entry"
919
+ /** The row names one point ledger, quest or referral program twice, by any of its names. */
920
+ DuplicateEntry: "duplicate-entry",
921
+ /** The inviter is no row of this import, and no member of the environment signs in with it. */
922
+ UnknownInviter: "unknown-inviter",
923
+ /** The row names its own member as the inviter. */
924
+ SelfReferral: "self-referral",
925
+ /** The member already has an inviter. An import never replaces one. */
926
+ InviterAlreadyAccepted: "inviter-already-accepted",
927
+ /** The inviter was invited, directly or through others, by this row's member. */
928
+ ReferralCycle: "referral-cycle",
929
+ /** The row that names the inviter was refused, so the inviter is never imported. */
930
+ InviterRefused: "inviter-refused",
931
+ /** No referral program of that key or ID in this environment, or it is archived. */
932
+ UnknownReferralProgram: "unknown-referral-program"
855
933
  };
856
934
  var refusalCodeSchema = z8.string();
857
935
  var memberImportRefusalSchema = z8.object({
@@ -895,11 +973,79 @@ var memberImportSummarySchema = z8.object({
895
973
  actions: z8.array(
896
974
  z8.object({ quest: z8.string(), total: z8.number().int().nonnegative() })
897
975
  ),
976
+ /**
977
+ * Accepted referrals the ready rows record, and their qualifications by program as the rows
978
+ * name it. Absent from a summary written before imports carried referrals.
979
+ */
980
+ referrals: z8.object({
981
+ accepted: z8.number().int().nonnegative(),
982
+ qualified: z8.array(
983
+ z8.object({
984
+ program: z8.string(),
985
+ total: z8.number().int().nonnegative()
986
+ })
987
+ )
988
+ }).optional(),
898
989
  /** Refused rows, by refusal code. A row can have several. */
899
990
  refusals: z8.array(
900
991
  z8.object({ code: refusalCodeSchema, rows: z8.number().int().nonnegative() })
901
992
  )
902
993
  });
994
+ var memberImportRevertInputSchema = z8.object({
995
+ actionId: identifier,
996
+ reason: z8.string().trim().min(1).max(500)
997
+ }).strict();
998
+ var memberImportRevertOutcomeSchema = z8.object({
999
+ reversed: z8.object({
1000
+ /** Applied rows the revert went through. */
1001
+ rows: z8.number().int().nonnegative(),
1002
+ /** Opening balance entries reversed. */
1003
+ entries: z8.number().int().nonnegative(),
1004
+ /** Imported completions revoked. */
1005
+ completions: z8.number().int().nonnegative(),
1006
+ /** Links the rows created that the revert removed. */
1007
+ links: z8.number().int().nonnegative()
1008
+ }),
1009
+ /**
1010
+ * Imported points the revert could not take back, by member and point ledger: the member had
1011
+ * spent or reserved them. A revert takes only free points, as a completion's revocation does,
1012
+ * so no balance goes below zero and Relay records no debt.
1013
+ */
1014
+ unreversedPoints: z8.array(
1015
+ z8.object({
1016
+ member: identifier,
1017
+ ledger: identifier,
1018
+ amount: z8.number().int().positive()
1019
+ })
1020
+ ),
1021
+ /**
1022
+ * Links the rows created that stay, because the member relied on them since: `signed-in` with
1023
+ * it, or `proved` a vouched wallet. `kind` is `wallet`, the provider (`x`, `telegram`,
1024
+ * `discord`) or `app:<name>`; `account` is the address or subject.
1025
+ */
1026
+ keptLinks: z8.array(
1027
+ z8.object({
1028
+ member: identifier,
1029
+ kind: z8.string(),
1030
+ account: z8.string(),
1031
+ reason: z8.string()
1032
+ })
1033
+ ),
1034
+ /**
1035
+ * True when rows were applied before imports recorded the links they created: those rows'
1036
+ * links all stay, and only their balances and completions were reversed.
1037
+ */
1038
+ linksUntracked: z8.boolean()
1039
+ });
1040
+ var memberImportRevertSchema = z8.object({
1041
+ reason: z8.string(),
1042
+ requestedAt: z8.number().int(),
1043
+ requestedBy: z8.string().nullable(),
1044
+ /** Applied rows reverted so far. */
1045
+ rows: z8.number().int().nonnegative(),
1046
+ revertedAt: z8.number().int().nullable(),
1047
+ outcome: memberImportRevertOutcomeSchema.nullable()
1048
+ });
903
1049
  var memberImportSchema = z8.object({
904
1050
  id: identifier,
905
1051
  source: z8.string(),
@@ -914,7 +1060,7 @@ var memberImportSchema = z8.object({
914
1060
  rows: z8.number().int().nonnegative(),
915
1061
  /** The latest check's summary, or null before the first check and after rows change. */
916
1062
  summary: memberImportSummarySchema.nullable(),
917
- /** While applying and after: rows applied and refused so far. */
1063
+ /** While applying and after, stopped included: rows applied and refused so far. */
918
1064
  progress: z8.object({
919
1065
  applied: z8.number().int().nonnegative(),
920
1066
  refused: z8.number().int().nonnegative()
@@ -925,7 +1071,12 @@ var memberImportSchema = z8.object({
925
1071
  appliedAt: z8.number().int().nullable(),
926
1072
  appliedBy: z8.string().nullable(),
927
1073
  canceledAt: z8.number().int().nullable(),
928
- canceledBy: z8.string().nullable()
1074
+ canceledBy: z8.string().nullable(),
1075
+ /** Set when the import was stopped while applying; it then reads as `applied` with `appliedAt` null. */
1076
+ stoppedAt: z8.number().int().nullish(),
1077
+ stoppedBy: z8.string().nullish(),
1078
+ /** Set once a revert was asked for; the import still reads as `applied`. */
1079
+ revert: memberImportRevertSchema.nullish()
929
1080
  });
930
1081
  var memberImportPageSchema = z8.object({
931
1082
  items: z8.array(memberImportSchema),
@@ -1093,6 +1244,24 @@ var resourceLifecycleResultSchema = z10.object({
1093
1244
  resource: managedResourceSchema,
1094
1245
  changed: z10.boolean()
1095
1246
  });
1247
+ var managedOfferSchema = managedResourceSchema.extend({
1248
+ kind: z10.literal("offer")
1249
+ });
1250
+ var managedResourceListSchema = z10.object({
1251
+ resources: z10.array(managedResourceSchema),
1252
+ offers: z10.array(managedOfferSchema).default([])
1253
+ });
1254
+ var offerLifecycleResultSchema = z10.object({
1255
+ resource: managedOfferSchema,
1256
+ changed: z10.boolean()
1257
+ });
1258
+ var offerLifecycleInputSchema = z10.strictObject({
1259
+ actionId: z10.string().uuid(),
1260
+ offer: identifier,
1261
+ archived: z10.boolean(),
1262
+ reason: z10.string().trim().min(1).max(500),
1263
+ expectedArchivedAt: z10.number().int().nonnegative().nullable().optional()
1264
+ });
1096
1265
  var resourceLifecyclePaths = {
1097
1266
  tracker: "/trackers",
1098
1267
  referral: "/referral-programs",
@@ -2642,7 +2811,12 @@ var managedTelegramAccountSchema = z19.discriminatedUnion("status", [
2642
2811
  status: z19.literal("connected"),
2643
2812
  /** The numeric Telegram user ID. */
2644
2813
  subject: z19.string().min(1),
2645
- linkedAt: z19.number()
2814
+ linkedAt: z19.number(),
2815
+ /**
2816
+ * True when a member import attached the account with the organization's word for it, not the
2817
+ * member's proof. Absent from Relay versions without it.
2818
+ */
2819
+ imported: z19.boolean().optional()
2646
2820
  }),
2647
2821
  managedTelegramAccountBaseSchema.extend({
2648
2822
  status: z19.literal("disconnected")
@@ -2668,8 +2842,9 @@ var managedWalletSchema = linkedWalletSchema.extend({
2668
2842
  });
2669
2843
  var managedMemberIdentitySchema = memberIdentitySchema.extend({
2670
2844
  /**
2671
- * True for an X account a member import attached, until the member links or signs in with it
2672
- * through X. Absent from Relay versions without imports.
2845
+ * True for an X or Discord account a member import attached, until the member links that
2846
+ * provider's account, or signs in with the X account, through Domino. Absent from Relay versions
2847
+ * without imports.
2673
2848
  */
2674
2849
  imported: z19.boolean().optional(),
2675
2850
  /**
@@ -2800,7 +2975,17 @@ var memberDetailSchema = z19.object({
2800
2975
  * The creator accounts the member linked (a YouTube channel), whose content managed tracker
2801
2976
  * sources attribute to them. Absent from Relay versions without creator accounts.
2802
2977
  */
2803
- creatorAccounts: z19.array(managedCreatorAccountSchema).optional()
2978
+ creatorAccounts: z19.array(managedCreatorAccountSchema).optional(),
2979
+ /**
2980
+ * Who invited the member, when they accepted, and the member import that recorded it, or null
2981
+ * when nobody invited them. Absent from Relay versions before imported referrals.
2982
+ */
2983
+ referral: z19.object({
2984
+ inviter: identifier,
2985
+ acceptedAt: z19.number().int().nonnegative(),
2986
+ suspended: z19.boolean(),
2987
+ import: identifier.nullable()
2988
+ }).nullable().optional()
2804
2989
  });
2805
2990
  var managedMemberProgressSchema = z19.object({
2806
2991
  member: identifier,
@@ -4437,6 +4622,25 @@ function managementClient(options) {
4437
4622
  )
4438
4623
  },
4439
4624
  offers: {
4625
+ /**
4626
+ * Archive an offer in test, with a reason the audit log records: members stop seeing it and
4627
+ * redeeming it fails with `offer-paused`, while its redemptions stay cancelable and it stays
4628
+ * archived when its code deploys again. Live gets the change through a promotion. Requires
4629
+ * `publish` permission.
4630
+ */
4631
+ archive: (offer, input, call) => post(
4632
+ `/offers/${identifier.parse(offer)}/archive`,
4633
+ offerLifecycleResultSchema,
4634
+ resourceArchiveInputSchema.parse(withActionId(input)),
4635
+ call
4636
+ ),
4637
+ /** Restore an archived offer in test. Requires `publish` permission. */
4638
+ unarchive: (offer, input, call) => post(
4639
+ `/offers/${identifier.parse(offer)}/unarchive`,
4640
+ offerLifecycleResultSchema,
4641
+ resourceArchiveInputSchema.parse(withActionId(input)),
4642
+ call
4643
+ ),
4440
4644
  pause: (offer, input, call) => post(
4441
4645
  `/offers/${identifier.parse(offer)}/pause`,
4442
4646
  offerSchema,
@@ -4810,11 +5014,7 @@ function managementClient(options) {
4810
5014
  questTypes: resourceArchiveMethods("quest-type"),
4811
5015
  images: resourceArchiveMethods("image"),
4812
5016
  resources: {
4813
- list: (call) => get(
4814
- "/resources",
4815
- z19.object({ resources: z19.array(managedResourceSchema) }),
4816
- call
4817
- ),
5017
+ list: (call) => get("/resources", managedResourceListSchema, call),
4818
5018
  /** @deprecated Use the resource archive/unarchive methods. Removed in 2.0.0. */
4819
5019
  lifecycle: (input, call) => post(
4820
5020
  "/resources/lifecycle",
@@ -4924,11 +5124,15 @@ function managementClient(options) {
4924
5124
  testMemberAcceptAnywaySchema.parse(withActionId(input)),
4925
5125
  call
4926
5126
  ),
4927
- /** Move forward 1–30 project-calendar days, up to 90 total. Reset deletes the member. */
5127
+ /**
5128
+ * Move the member's clock forward by 1–30 project-calendar days, 1–720 hours, 1–43200
5129
+ * minutes, or `to` a later instant; at most 90 days ahead of real time. Reset deletes the
5130
+ * member.
5131
+ */
4928
5132
  advance: (member, input, call) => post(
4929
5133
  `/test-members/${identifier.parse(member)}/clock`,
4930
5134
  testMemberSchema,
4931
- testMemberAdvanceSchema.parse(withActionId(input)),
5135
+ testMemberClockAdvanceSchema.parse(withActionId(input)),
4932
5136
  call
4933
5137
  ),
4934
5138
  /**
@@ -5003,7 +5207,8 @@ function managementClient(options) {
5003
5207
  * this project and environment. Add rows, `check` them (the dry run), read the summary and the
5004
5208
  * refused rows, then `apply`. Checking and applying run in the background: read the import
5005
5209
  * until its status is `checked` or `applied`. Needs `publish` permission. In live, only a
5006
- * person signed in to Console applies an import; keys and CLI sessions prepare and check it.
5210
+ * person signed in to Console applies an import; keys and CLI sessions prepare, check, cancel,
5211
+ * stop and revert it.
5007
5212
  */
5008
5213
  memberImports: {
5009
5214
  create: (input, call) => post(
@@ -5035,7 +5240,7 @@ function managementClient(options) {
5035
5240
  addRows: (id, rows, call) => post(
5036
5241
  `/member-imports/${identifier.parse(id)}/rows`,
5037
5242
  memberImportSchema,
5038
- memberImportRowsInputSchema.parse({ rows }),
5243
+ memberImportFullRowsInputSchema.parse({ rows }),
5039
5244
  call
5040
5245
  ),
5041
5246
  /** Starts the dry run: every row is checked against the project, and nothing changes. */
@@ -5058,6 +5263,31 @@ function managementClient(options) {
5058
5263
  memberImportSchema,
5059
5264
  {},
5060
5265
  call
5266
+ ),
5267
+ /**
5268
+ * Stops an applying import: the row being applied finishes, no further row is applied, and
5269
+ * the import reads as `applied` with `appliedAt` null and `stoppedAt` set. Its remaining rows
5270
+ * stay `ready`; a stopped import can't be applied again, so import the rest in a new import. Stopping a stopped import changes nothing.
5271
+ */
5272
+ stop: (id, call) => post(
5273
+ `/member-imports/${identifier.parse(id)}/stop`,
5274
+ memberImportSchema,
5275
+ {},
5276
+ call
5277
+ ),
5278
+ /**
5279
+ * Starts reverting an applied or stopped import, in the background: each applied row's
5280
+ * opening balances are reversed as far as the member still has the points, its imported
5281
+ * completions revoked, and the links it created removed unless the member signed in with
5282
+ * one since. Members stay in the project. Read the import until `revert.revertedAt` is set;
5283
+ * `revert.outcome` then lists the points members had spent and the links kept. An import is
5284
+ * reverted once; the same `actionId` answers the import again.
5285
+ */
5286
+ revert: (id, input, call) => post(
5287
+ `/member-imports/${identifier.parse(id)}/revert`,
5288
+ memberImportSchema,
5289
+ memberImportRevertInputSchema.parse(withActionId(input)),
5290
+ call
5061
5291
  )
5062
5292
  },
5063
5293
  /** The project's members, as operators see them. */
@@ -5636,6 +5866,45 @@ function managementClient(options) {
5636
5866
  call
5637
5867
  )
5638
5868
  },
5869
+ /**
5870
+ * This project and environment's Discord connection. An organization administrator installs
5871
+ * Domino's bot into a new server in Console; once one project of the organization connects a
5872
+ * server, `connect` connects it to another project of the same organization and environment.
5873
+ */
5874
+ discord: {
5875
+ /** The project's Discord connection: its server and status; requires `read` permission. */
5876
+ connection: async (call) => {
5877
+ const list = await get("/integrations", z19.array(z19.unknown()), call);
5878
+ return projectIntegrationSchema.parse(
5879
+ list.find(
5880
+ (item) => z19.object({ provider: z19.literal("discord") }).safeParse(item).success
5881
+ )
5882
+ );
5883
+ },
5884
+ /**
5885
+ * The servers other projects of the organization connect and keep ready in this environment,
5886
+ * which `connect` accepts; requires `read` permission.
5887
+ */
5888
+ servers: (call) => get(
5889
+ "/integrations/discord/servers",
5890
+ organizationDiscordServersSchema,
5891
+ call
5892
+ ),
5893
+ /**
5894
+ * Connects a server from `servers()` to this project and environment, without installing
5895
+ * the bot again; requires `publish` permission. Domino's bot must still see the server.
5896
+ * Fails with 409 `server-not-connected-in-organization` for any other server (an
5897
+ * administrator installs it in Console), 409 `integration-connected` when the project
5898
+ * already has a Discord connection, and 422 `server-not-reachable` when the bot lost it.
5899
+ * Connecting the server the project already connects changes nothing.
5900
+ */
5901
+ connect: (server, call) => post(
5902
+ `/integrations/discord/servers/${encodeURIComponent(discordServerSchema.shape.id.parse(server))}/connect`,
5903
+ projectIntegrationSchema,
5904
+ {},
5905
+ call
5906
+ )
5907
+ },
5639
5908
  /**
5640
5909
  * The Telegram chats this project and environment connected through Domino's bot, which
5641
5910
  * `ctx.telegram.member()` and `telegram.reactions()` read. Telegram is not one of the
@@ -5962,6 +6231,12 @@ var managementResponseSchemas = lazyResponseReaders({
5962
6231
  get telegramChatsSchema() {
5963
6232
  return knownResponse(telegramChatsSchema);
5964
6233
  },
6234
+ get organizationDiscordServersSchema() {
6235
+ return knownResponse(organizationDiscordServersSchema);
6236
+ },
6237
+ get projectIntegrationSchema() {
6238
+ return knownResponse(projectIntegrationSchema);
6239
+ },
5965
6240
  get telegramChatConnectionSchema() {
5966
6241
  return knownResponse(telegramChatConnectionSchema);
5967
6242
  },
@@ -5977,6 +6252,12 @@ var managementResponseSchemas = lazyResponseReaders({
5977
6252
  get managedResourceSchema() {
5978
6253
  return knownResponse(managedResourceSchema);
5979
6254
  },
6255
+ get managedResourceListSchema() {
6256
+ return knownResponse(managedResourceListSchema);
6257
+ },
6258
+ get offerLifecycleResultSchema() {
6259
+ return knownResponse(offerLifecycleResultSchema);
6260
+ },
5980
6261
  get managedStockItemSchema() {
5981
6262
  return knownResponse(managedStockItemSchema);
5982
6263
  },
@@ -6450,6 +6731,12 @@ var managementResponses = lazyResponseReaders({
6450
6731
  get telegramChatsSchema() {
6451
6732
  return responseSchema(telegramChatsSchema);
6452
6733
  },
6734
+ get organizationDiscordServersSchema() {
6735
+ return responseSchema(organizationDiscordServersSchema);
6736
+ },
6737
+ get projectIntegrationSchema() {
6738
+ return responseSchema(projectIntegrationSchema);
6739
+ },
6453
6740
  get telegramChatConnectionSchema() {
6454
6741
  return responseSchema(telegramChatConnectionSchema);
6455
6742
  },
@@ -6465,6 +6752,12 @@ var managementResponses = lazyResponseReaders({
6465
6752
  get managedResourceSchema() {
6466
6753
  return responseSchema(managedResourceSchema);
6467
6754
  },
6755
+ get managedResourceListSchema() {
6756
+ return responseSchema(managedResourceListSchema);
6757
+ },
6758
+ get offerLifecycleResultSchema() {
6759
+ return responseSchema(offerLifecycleResultSchema);
6760
+ },
6468
6761
  get managedStockItemSchema() {
6469
6762
  return responseSchema(managedStockItemSchema);
6470
6763
  },
@@ -6853,11 +7146,13 @@ export {
6853
7146
  managedMemberProgressSchema,
6854
7147
  managedMemberQuerySchema,
6855
7148
  managedOAuthAccountSchema,
7149
+ managedOfferSchema,
6856
7150
  managedPointHistoryPageSchema,
6857
7151
  managedQuestEnrollmentPageSchema,
6858
7152
  managedQuestEnrollmentSchema,
6859
7153
  managedReleasePageSchema,
6860
7154
  managedReleaseQuerySchema,
7155
+ managedResourceListSchema,
6861
7156
  managedResourceSchema,
6862
7157
  managedStockItemSchema,
6863
7158
  managedTelegramAccountSchema,
@@ -6881,10 +7176,16 @@ export {
6881
7176
  memberImportAccountSchema,
6882
7177
  memberImportActionSchema,
6883
7178
  memberImportCreateSchema,
7179
+ memberImportFullRowSchema,
7180
+ memberImportFullRowsInputSchema,
6884
7181
  memberImportIdentitySchema,
6885
7182
  memberImportListQuerySchema,
6886
7183
  memberImportPageSchema,
7184
+ memberImportReferralSchema,
6887
7185
  memberImportRefusalSchema,
7186
+ memberImportRevertInputSchema,
7187
+ memberImportRevertOutcomeSchema,
7188
+ memberImportRevertSchema,
6888
7189
  memberImportRowPageSchema,
6889
7190
  memberImportRowQuerySchema,
6890
7191
  memberImportRowResultSchema,
@@ -6892,6 +7193,7 @@ export {
6892
7193
  memberImportRowsInputSchema,
6893
7194
  memberImportSchema,
6894
7195
  memberImportSummarySchema,
7196
+ memberImportVouchedAccountSchema,
6895
7197
  memberLookupSchema,
6896
7198
  memberOAuthUnlinkInputSchema,
6897
7199
  memberSchema,
@@ -6901,6 +7203,8 @@ export {
6901
7203
  metricsSchema,
6902
7204
  nextScheduleRun,
6903
7205
  oauthIdentitySelectorSchema,
7206
+ offerLifecycleInputSchema,
7207
+ offerLifecycleResultSchema,
6904
7208
  offeredStarterSchema,
6905
7209
  operationInputSchema,
6906
7210
  operationSchema,
@@ -6994,6 +7298,7 @@ export {
6994
7298
  testMemberAccountUnlinkSchema,
6995
7299
  testMemberActionSchema,
6996
7300
  testMemberAdvanceSchema,
7301
+ testMemberClockAdvanceSchema,
6997
7302
  testMemberCreateSchema,
6998
7303
  testMemberDiscordMessageSchema,
6999
7304
  testMemberDiscordReactionSchema,