@domino-sdk/relay 1.62.0 → 1.65.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 (74) hide show
  1. package/CHANGELOG.md +145 -0
  2. package/dist/{accounts-CCqCKCVx.d.ts → accounts-_lNsiR2k.d.ts} +42 -4
  3. package/dist/{attempt-captures-Cm-5G0PC.d.ts → attempt-captures-BqPggxTU.d.ts} +1 -1
  4. package/dist/authoring.d.ts +54 -20
  5. package/dist/authoring.js +60 -31
  6. package/dist/{automatic-outcomes-pAsOyIVp.d.ts → automatic-outcomes-BzAvfcpd.d.ts} +11 -1
  7. package/dist/avatar.d.ts +1 -1
  8. package/dist/browser.d.ts +10 -10
  9. package/dist/browser.js +12 -13
  10. package/dist/capability-error-CuI_F7yM.d.ts +296 -0
  11. package/dist/{catalog--ZIlskAo.d.ts → catalog-ByZMRS7I.d.ts} +21 -10
  12. package/dist/{chunk-XNKSSE32.js → chunk-4NIV4NPV.js} +7 -7
  13. package/dist/chunk-7H4MRVQF.js +199 -0
  14. package/dist/{chunk-UPQPUJOU.js → chunk-CVQZ2YP7.js} +73 -202
  15. package/dist/{chunk-3PYYGFSB.js → chunk-DLABJSBO.js} +3 -3
  16. package/dist/{chunk-Y322OTCH.js → chunk-E22XSC4L.js} +1 -1
  17. package/dist/{chunk-E6IKQHTX.js → chunk-EDNKKVGU.js} +2 -2
  18. package/dist/{chunk-K2KS3JLY.js → chunk-EOUEAOWJ.js} +35 -4
  19. package/dist/{chunk-6WCIWXUV.js → chunk-EUEW2APU.js} +2 -2
  20. package/dist/{chunk-MK425RXJ.js → chunk-HNR6G3GV.js} +2335 -1538
  21. package/dist/{chunk-UW5232GG.js → chunk-KCUUHT2V.js} +5 -5
  22. package/dist/{chunk-CICDIBOF.js → chunk-MPTE7EIV.js} +76 -74
  23. package/dist/{chunk-4OC7REYX.js → chunk-MWMCQLCG.js} +3 -3
  24. package/dist/{chunk-GTDW453U.js → chunk-NG4GZ54I.js} +100 -114
  25. package/dist/chunk-R2KZFX6E.js +405 -0
  26. package/dist/{chunk-HTZHBTIL.js → chunk-RD3XJ4DH.js} +208 -376
  27. package/dist/{chunk-5TEYFX6X.js → chunk-SE7XHQFP.js} +2 -2
  28. package/dist/{chunk-CZFXGGEK.js → chunk-U66GUVSG.js} +2 -2
  29. package/dist/{chunk-KDR2VAJP.js → chunk-UYVJZR33.js} +2 -2
  30. package/dist/chunk-UZ765UGH.js +18 -0
  31. package/dist/{chunk-GKIFABGN.js → chunk-VBYOAT46.js} +100 -277
  32. package/dist/{chunk-QYPMPWVX.js → chunk-XVZ4YOF2.js} +43 -43
  33. package/dist/{chunk-3KLC4AMA.js → chunk-ZQ3IPCI6.js} +177 -176
  34. package/dist/chunk-ZXGBDLVB.js +1510 -0
  35. package/dist/{client-B-hbHX30.d.ts → client-D7IiwEq2.d.ts} +31 -62
  36. package/dist/{capability-error-DFMwSuSf.d.ts → dashboards-pVfclkyh.d.ts} +14 -294
  37. package/dist/{deployments-M4OHn7G3.d.ts → deployments-Cr1tfqrr.d.ts} +46 -3
  38. package/dist/{identity-integration-3mX6b5iH.d.ts → identity-integration-Ci2vGKtX.d.ts} +67 -2
  39. package/dist/index.d.ts +11 -11
  40. package/dist/index.js +11 -13
  41. package/dist/internal.d.ts +27 -13
  42. package/dist/internal.js +46 -13
  43. package/dist/{analytics-BwAKLi7O.d.ts → limits-pE04y9O2.d.ts} +131 -3
  44. package/dist/{offers-DhAtss4_.d.ts → offers-Hw2P6tcK.d.ts} +3 -2
  45. package/dist/{participant-activity-D-Drp24G.d.ts → participant-activity-DXRq4s6K.d.ts} +1 -0
  46. package/dist/portal-proxy.d.ts +21 -3
  47. package/dist/portal-proxy.js +72 -22
  48. package/dist/react/index.d.ts +29 -15
  49. package/dist/react/index.js +52 -29
  50. package/dist/{pages-B8q8Y_dQ.d.ts → reward-deliveries-BCV8hznc.d.ts} +300 -233
  51. package/dist/runtime/authoring.js +1 -1
  52. package/dist/runtime/chunks/6EBN6IZU.js +1 -0
  53. package/dist/runtime/manifest.json +3 -3
  54. package/dist/runtime/schema.js +1 -1
  55. package/dist/schema.d.ts +197 -19
  56. package/dist/schema.js +126 -124
  57. package/dist/server/index.d.ts +13 -13
  58. package/dist/server/index.js +5701 -6302
  59. package/dist/{sign-in-providers-BkjcDsFF.d.ts → sign-in-providers-BAkGjSXo.d.ts} +7 -2
  60. package/dist/{submission-input-DHGKhXfp.d.ts → submission-input-ChL1aYNH.d.ts} +3 -2
  61. package/dist/{telegram-browser-BCE7zdOb.d.ts → telegram-browser-K27t4TwM.d.ts} +5 -5
  62. package/dist/telegram.d.ts +9 -9
  63. package/dist/telegram.js +2 -2
  64. package/dist/testing.d.ts +229 -27
  65. package/dist/testing.js +146 -105
  66. package/dist/{tracker-data-Hb1uQnk5.d.ts → tracker-data-Bl-qPIvZ.d.ts} +37 -9
  67. package/dist/{transport-DkhX2Cbs.d.ts → transport-DC1m73Tp.d.ts} +40211 -37736
  68. package/dist/{wallet-DTO7SXj7.d.ts → wallet-B7e06v4m.d.ts} +14 -4
  69. package/package.json +1 -1
  70. package/dist/chunk-D26YNACF.js +0 -320
  71. package/dist/chunk-UAKYDVT3.js +0 -565
  72. package/dist/chunk-WSBYWVTZ.js +0 -717
  73. package/dist/chunk-XJFYAXET.js +0 -87
  74. package/dist/runtime/chunks/Y4OAVXFR.js +0 -1
@@ -1,14 +1,14 @@
1
- import { G as QuizEvidence, a as Attempt, s as MemberProgress, ak as referralAcceptSchema, q as LeaderboardQuery, b as AttemptStatus, V as AttemptCodeSource, f as CampaignEnrollmentInput, h as CampaignWithdrawalInput, J as SignInProvider, c as AuthProvider, I as SignInAccountStatus, x as PointHistoryQuery, v as PointEntryKind, n as LeaderboardHistoryQuery, al as submitSchema, am as engagementPageQuerySchema, an as contentPerformanceQuerySchema } from './accounts-CCqCKCVx.js';
2
- import { q as ResponseSchema, i as PageQuery, k as QuestEnrollmentInput, Q as QuestClaimInput, n as QuestOutcomeQuery, M as MemberConsent, a as ConsentInput, e as CreatorAccountProvider, r as RewardDeliveryQuery, s as RewardDeliveryAction, t as contentQualificationQuerySchema } from './pages-B8q8Y_dQ.js';
3
- import { M as MissingPrerequisite, V as ValueEvidence } from './submission-input-DHGKhXfp.js';
1
+ import { G as QuizEvidence, a as Attempt, s as MemberProgress, ak as referralAcceptSchema, q as LeaderboardQuery, b as AttemptStatus, V as AttemptCodeSource, f as CampaignEnrollmentInput, h as CampaignWithdrawalInput, J as SignInProvider, c as AuthProvider, I as SignInAccountStatus, x as PointHistoryQuery, v as PointEntryKind, n as LeaderboardHistoryQuery, al as submitSchema, am as engagementPageQuerySchema, an as contentPerformanceQuerySchema } from './accounts-_lNsiR2k.js';
2
+ import { M as MissingPrerequisite, V as ValueEvidence } from './submission-input-ChL1aYNH.js';
4
3
  import { R as RequestError, a as RequestErrorDetails, b as RequestErrorKind } from './request-error-D_dUPLwo.js';
5
- import { b as QuestView, q as questExperienceSchema } from './catalog--ZIlskAo.js';
6
- import { T as TrackerSkipCode } from './tracker-data-Hb1uQnk5.js';
7
- import { b as ParticipantSession, e as exchangeSchema, R as RelayEvent, P as ParticipantActivity, M as MemberSummary } from './participant-activity-D-Drp24G.js';
4
+ import { q as ResponseSchema, i as PageQuery, k as QuestEnrollmentInput, Q as QuestClaimInput, n as QuestOutcomeQuery, M as MemberConsent, a as ConsentInput, e as CreatorAccountProvider, r as RewardDeliveryQuery, s as RewardDeliveryPage, t as contentQualificationQuerySchema } from './reward-deliveries-BCV8hznc.js';
5
+ import { b as QuestView, q as questExperienceSchema } from './catalog-ByZMRS7I.js';
6
+ import { T as TrackerSkipCode, S as SkipEnrollment } from './tracker-data-Bl-qPIvZ.js';
7
+ import { b as ParticipantSession, e as exchangeSchema, R as RelayEvent, P as ParticipantActivity, M as MemberSummary } from './participant-activity-DXRq4s6K.js';
8
8
  import * as z from 'zod';
9
9
  import { c as createRelayAction, O as OptionalActionId } from './action-9Xl0StBg.js';
10
- import { A as AuthProviders } from './sign-in-providers-BkjcDsFF.js';
11
- import { ag as profileUpdateSchema, d as ProfileCompletionQuery, ah as walletAddressInputSchema, ai as walletSignatureSchema, L as LinkedWallet, m as WalletSigner } from './wallet-DTO7SXj7.js';
10
+ import { A as AuthProviders } from './sign-in-providers-BAkGjSXo.js';
11
+ import { ag as profileUpdateSchema, d as ProfileCompletionQuery, ah as walletAddressInputSchema, ai as walletSignatureSchema, L as LinkedWallet, m as WalletSigner } from './wallet-B7e06v4m.js';
12
12
 
13
13
  /** What happened, as in every Domino client error (see `RequestError`). */
14
14
  type RelayErrorKind = RequestErrorKind;
@@ -23,6 +23,11 @@ declare const RelayErrorCode: {
23
23
  readonly NotSignedIn: "not-signed-in";
24
24
  /** The session changed since the app read it (the `session` option). Reload before retrying. */
25
25
  readonly StaleSession: "stale-session";
26
+ /**
27
+ * A participant backend (`createParticipantBackend`) refused the call because the app's own
28
+ * sign-in ended. The SDK treats it like `not-signed-in`: the member is signed out.
29
+ */
30
+ readonly Unauthenticated: "unauthenticated";
26
31
  /** The input failed validation before it was sent. */
27
32
  readonly InvalidInput: "invalid-input";
28
33
  /** Relay's answer was not JSON or not the expected shape (kind `invalid-response`). */
@@ -101,6 +106,11 @@ declare const RelayErrorCode: {
101
106
  readonly QuestClosed: "quest-closed";
102
107
  /** An operator paused the quest. */
103
108
  readonly QuestPaused: "quest-paused";
109
+ /**
110
+ * The member is banned from the project, so their attempts, completions and invitations are
111
+ * refused. Relay gives no reason; `me()` answers `eligible: false`.
112
+ */
113
+ readonly MemberBanned: "member-banned";
104
114
  /** An operator locked the member's profile; hiding it is still allowed. */
105
115
  readonly ProfileLocked: "profile-locked";
106
116
  /** No member in the project has the invitation code the member accepted. */
@@ -2002,7 +2012,8 @@ declare function relayClient(options: RelayClientOptions): {
2002
2012
  * Claims one of the signed-in member's outcomes skipped as `historical`, on a quest whose
2003
2013
  * historical policy is `"claim"` (`outcome.claimable`). Relay decides it again with
2004
2014
  * historical activity released and returns the outcome; a rule that still fails rejects
2005
- * with a `RelayError` whose code is that rule's skip code.
2015
+ * with a `RelayError` whose code is that rule's skip code. This claim is of a skipped
2016
+ * outcome; `me.claim` submits an attempt.
2006
2017
  */
2007
2018
  claim: (value: OptionalActionId<QuestClaimInput>, requestOptions?: RelayRequestOptions) => Promise<{
2008
2019
  quest: string;
@@ -2018,6 +2029,7 @@ declare function relayClient(options: RelayClientOptions): {
2018
2029
  updatedAt: number;
2019
2030
  automatic?: string | undefined;
2020
2031
  window?: "quest" | "tracker" | undefined;
2032
+ enrollment?: SkipEnrollment | undefined;
2021
2033
  }>;
2022
2034
  /**
2023
2035
  * Why automatic quests did or did not run for the signed-in member's activity, newest first:
@@ -2038,6 +2050,7 @@ declare function relayClient(options: RelayClientOptions): {
2038
2050
  updatedAt: number;
2039
2051
  automatic?: string | undefined;
2040
2052
  window?: "quest" | "tracker" | undefined;
2053
+ enrollment?: SkipEnrollment | undefined;
2041
2054
  }[];
2042
2055
  nextCursor: string | null;
2043
2056
  }>;
@@ -4556,59 +4569,11 @@ declare function relayClient(options: RelayClientOptions): {
4556
4569
  }>;
4557
4570
  /**
4558
4571
  * The member's reward deliveries, newest first, one page at a time. Pass a page's
4559
- * `nextCursor` back as `cursor` for older ones; `limit` is 1 to 500, 500 by default.
4572
+ * `nextCursor` back as `cursor` for older ones; `limit` is 1 to 500, 500 by default. The
4573
+ * page answers its deliveries as `items` (and, for 1.x callers, as `deliveries`), so
4574
+ * `paginate((cursor) => relay.me.rewardDeliveries({ cursor }))` reads them all.
4560
4575
  */
4561
- rewardDeliveries: (requestOptions?: RelayRequestOptions & RewardDeliveryQuery) => Promise<{
4562
- deliveries: ({
4563
- [x: string]: z.core.util.JSONType | undefined;
4564
- id: string;
4565
- quest: string;
4566
- completion: string;
4567
- member: string;
4568
- action: RewardDeliveryAction;
4569
- attempts: number;
4570
- nextAt: number;
4571
- lastError: string | null;
4572
- createdAt: number;
4573
- deliveredAt: number | null;
4574
- provider: string;
4575
- status: string;
4576
- dispatchedAt?: number | null | undefined;
4577
- revokedAt?: number | null | undefined;
4578
- roleId?: string | undefined;
4579
- reconciliation?: {
4580
- [x: string]: z.core.util.JSONType;
4581
- status: string;
4582
- ownership: string;
4583
- at: number;
4584
- reason: string | null;
4585
- } | null | undefined;
4586
- } | {
4587
- [x: string]: z.core.util.JSONType | undefined;
4588
- id: string;
4589
- quest: string;
4590
- completion: string;
4591
- member: string;
4592
- provider: "discord";
4593
- action: RewardDeliveryAction;
4594
- roleId: string;
4595
- status: "pending" | "failed" | "delivered";
4596
- attempts: number;
4597
- nextAt: number;
4598
- lastError: string | null;
4599
- createdAt: number;
4600
- deliveredAt: number | null;
4601
- dispatchedAt?: number | null | undefined;
4602
- revokedAt?: number | null | undefined;
4603
- reconciliation?: {
4604
- status: "pending" | "removed" | "failed" | "preserved" | "granted";
4605
- ownership: "external" | "relay" | "unclaimed";
4606
- at: number;
4607
- reason: string | null;
4608
- } | null | undefined;
4609
- })[];
4610
- nextCursor: string | null;
4611
- }>;
4576
+ rewardDeliveries: (requestOptions?: RelayRequestOptions & RewardDeliveryQuery) => Promise<RewardDeliveryPage>;
4612
4577
  /**
4613
4578
  * `{ items }`: the member's balance in each of the project's point ledgers, in the project's
4614
4579
  * ledger order, zero in a ledger they have no entries in.
@@ -4661,7 +4626,11 @@ declare function relayClient(options: RelayClientOptions): {
4661
4626
  }[];
4662
4627
  nextCursor: string | null;
4663
4628
  }>;
4664
- /** Claims a quest for the signed-in member. Quest controllers (`quests.open`) call this. */
4629
+ /**
4630
+ * Submits an attempt at a quest for the signed-in member, whatever input the quest takes;
4631
+ * a quest whose interaction is `"claim"` takes none. Quest controllers (`quests.open`) call
4632
+ * this. `quests.claim` is different: it claims an outcome skipped as historical.
4633
+ */
4665
4634
  claim: (value: OptionalActionId<Omit<z.input<typeof submitSchema>, "member">>, requestOptions?: RelayRequestOptions) => Promise<{
4666
4635
  id: string;
4667
4636
  release: string;
@@ -1,146 +1,7 @@
1
1
  import * as z from 'zod';
2
- import { I as WalletBalanceQuery } from './wallet-DTO7SXj7.js';
3
- import { R as ResourceHandle } from './tracker-data-Hb1uQnk5.js';
4
- import { J as AnalyticsMetricId, K as analyticsCatalog } from './analytics-BwAKLi7O.js';
5
-
6
- declare const completionPolicySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7
- kind: z.ZodLiteral<"streak">;
8
- days: z.ZodNumber;
9
- }, z.core.$strip>, z.ZodObject<{
10
- kind: z.ZodLiteral<"progress">;
11
- goal: z.ZodObject<{
12
- kind: z.ZodLiteral<"count">;
13
- count: z.ZodNumber;
14
- }, z.core.$strict>;
15
- window: z.ZodDiscriminatedUnion<[z.ZodObject<{
16
- kind: z.ZodLiteral<"lifetime">;
17
- }, z.core.$strict>, z.ZodObject<{
18
- kind: z.ZodLiteral<"calendar">;
19
- period: z.ZodEnum<{
20
- day: "day";
21
- week: "week";
22
- month: "month";
23
- }>;
24
- latenessMs: z.ZodDefault<z.ZodNumber>;
25
- }, z.core.$strict>, z.ZodObject<{
26
- kind: z.ZodLiteral<"rolling">;
27
- durationMs: z.ZodNumber;
28
- }, z.core.$strict>], "kind">;
29
- repeat: z.ZodDefault<z.ZodEnum<{
30
- repeat: "repeat";
31
- once: "once";
32
- }>>;
33
- }, z.core.$strict>, z.ZodObject<{
34
- kind: z.ZodLiteral<"once">;
35
- }, z.core.$strict>, z.ZodObject<{
36
- kind: z.ZodLiteral<"keyed">;
37
- across: z.ZodOptional<z.ZodLiteral<"members">>;
38
- }, z.core.$strict>], "kind">;
39
- declare const completionKeySchema: z.ZodString;
40
- declare const budgetSchema: z.ZodObject<{
41
- id: z.ZodString;
42
- scope: z.ZodEnum<{
43
- member: "member";
44
- project: "project";
45
- }>;
46
- period: z.ZodEnum<{
47
- lifetime: "lifetime";
48
- day: "day";
49
- week: "week";
50
- month: "month";
51
- }>;
52
- limit: z.ZodNumber;
53
- cost: z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
54
- balance: z.ZodString;
55
- }, z.core.$strict>]>;
56
- }, z.core.$strict>;
57
- type Budget = z.infer<typeof budgetSchema>;
58
- /**
59
- * A budget counted per tracker record author: the account that caused the record, such as a
60
- * reaction's reactor, whether or not it belongs to a member. It caps what one person gives when a
61
- * quest pays someone else. Only quests with a tracker trigger take one, in their `authorBudgets`.
62
- */
63
- declare const authorBudgetSchema: z.ZodObject<{
64
- id: z.ZodString;
65
- period: z.ZodEnum<{
66
- lifetime: "lifetime";
67
- day: "day";
68
- week: "week";
69
- month: "month";
70
- }>;
71
- limit: z.ZodNumber;
72
- cost: z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
73
- balance: z.ZodString;
74
- }, z.core.$strict>]>;
75
- scope: z.ZodLiteral<"author">;
76
- }, z.core.$strict>;
77
- type AuthorBudget = z.infer<typeof authorBudgetSchema>;
78
- /**
79
- * One of the member's accepted, unrevoked quest completions, as `ctx.member.completions()` reads
80
- * it. `quest` is the quest's key and `key` the completion key. `completedAt` is when it was
81
- * recorded, in epoch milliseconds on the member's clock (a test member's advanced one); null for
82
- * older completions recorded without a time.
83
- */
84
- declare const memberCompletionSchema: z.ZodObject<{
85
- quest: z.ZodString;
86
- key: z.ZodString;
87
- completedAt: z.ZodNullable<z.ZodNumber>;
88
- }, z.core.$strip>;
89
- type MemberCompletion = z.infer<typeof memberCompletionSchema>;
90
- /** The most completions one `ctx.member.completions()` call returns, and its default `limit`. */
91
- declare const maxMemberCompletions = 100;
92
-
93
- declare const resourceSourceSchema: z.ZodUnion<readonly [z.ZodObject<{
94
- provider: z.ZodLiteral<"domino">;
95
- resource: z.ZodLiteral<"point-ledger">;
96
- }, z.core.$strict>, z.ZodUnion<readonly [z.ZodObject<{
97
- provider: z.ZodLiteral<"discord">;
98
- resource: z.ZodLiteral<"channel">;
99
- types: z.ZodArray<z.ZodEnum<{
100
- text: "text";
101
- announcement: "announcement";
102
- }>>;
103
- postable: z.ZodOptional<z.ZodLiteral<true>>;
104
- }, z.core.$strict>, z.ZodObject<{
105
- provider: z.ZodLiteral<"discord">;
106
- resource: z.ZodLiteral<"role">;
107
- assignable: z.ZodDefault<z.ZodBoolean>;
108
- }, z.core.$strict>]>]>;
109
- type ResourceSource = z.infer<typeof resourceSourceSchema>;
110
- declare const resourceRequestSchema: z.ZodObject<{
111
- source: z.ZodUnion<readonly [z.ZodObject<{
112
- provider: z.ZodLiteral<"domino">;
113
- resource: z.ZodLiteral<"point-ledger">;
114
- }, z.core.$strict>, z.ZodUnion<readonly [z.ZodObject<{
115
- provider: z.ZodLiteral<"discord">;
116
- resource: z.ZodLiteral<"channel">;
117
- types: z.ZodArray<z.ZodEnum<{
118
- text: "text";
119
- announcement: "announcement";
120
- }>>;
121
- postable: z.ZodOptional<z.ZodLiteral<true>>;
122
- }, z.core.$strict>, z.ZodObject<{
123
- provider: z.ZodLiteral<"discord">;
124
- resource: z.ZodLiteral<"role">;
125
- assignable: z.ZodDefault<z.ZodBoolean>;
126
- }, z.core.$strict>]>]>;
127
- query: z.ZodOptional<z.ZodString>;
128
- cursor: z.ZodOptional<z.ZodString>;
129
- ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
130
- }, z.core.$strict>;
131
- declare const resourceOptionsSchema: z.ZodObject<{
132
- revision: z.ZodNumber;
133
- options: z.ZodArray<z.ZodObject<{
134
- id: z.ZodString;
135
- label: z.ZodString;
136
- description: z.ZodOptional<z.ZodString>;
137
- group: z.ZodOptional<z.ZodString>;
138
- disabledReason: z.ZodOptional<z.ZodString>;
139
- }, z.core.$strip>>;
140
- nextCursor: z.ZodDefault<z.ZodNullable<z.ZodString>>;
141
- cursor: z.ZodNullable<z.ZodString>;
142
- }, z.core.$strip>;
143
- type ResourceOption = z.infer<typeof resourceOptionsSchema>["options"][number];
2
+ import { o as WalletBalanceQuery } from './wallet-B7e06v4m.js';
3
+ import { R as ResourceHandle } from './tracker-data-Bl-qPIvZ.js';
4
+ import { A as AnalyticsMetricId, a as analyticsCatalog } from './limits-pE04y9O2.js';
144
5
 
145
6
  declare const settingFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
146
7
  kind: z.ZodLiteral<"point-ledger">;
@@ -194,6 +55,7 @@ declare const settingFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
194
55
  multiline: z.ZodBoolean;
195
56
  picker: z.ZodOptional<z.ZodString>;
196
57
  decimals: z.ZodOptional<z.ZodNumber>;
58
+ secret: z.ZodOptional<z.ZodLiteral<true>>;
197
59
  label: z.ZodString;
198
60
  description: z.ZodOptional<z.ZodString>;
199
61
  }, z.core.$strict>, z.ZodObject<{
@@ -268,6 +130,7 @@ declare const settingsFieldsSchema: z.ZodRecord<z.ZodString, z.ZodDiscriminatedU
268
130
  multiline: z.ZodBoolean;
269
131
  picker: z.ZodOptional<z.ZodString>;
270
132
  decimals: z.ZodOptional<z.ZodNumber>;
133
+ secret: z.ZodOptional<z.ZodLiteral<true>>;
271
134
  label: z.ZodString;
272
135
  description: z.ZodOptional<z.ZodString>;
273
136
  }, z.core.$strict>, z.ZodObject<{
@@ -330,58 +193,26 @@ declare function isAmount(value: string): boolean;
330
193
  declare function isBalanceChain(value: string): value is BalanceChain;
331
194
  /** Whether a tracker filter may compare with `field`: an integer or amount setting. */
332
195
  declare function isBoundSetting(field: SettingField | undefined): boolean;
333
- /** The value schema of a text setting, with the checks its picker adds. */
196
+ /**
197
+ * The value schema of a text setting, with the checks its picker adds. A secret setting may also
198
+ * be `""`, its value until an operator sets it, whatever its `minLength`.
199
+ */
334
200
  declare function textSettingSchema(field: {
335
201
  minLength: number;
336
202
  maxLength: number;
337
203
  picker?: string;
204
+ secret?: true;
338
205
  }): z.ZodString;
339
206
  declare function parseSettings(fields: Record<string, SettingField>, input: unknown): SettingsValues;
340
207
  declare function missingResourceSettings(fields: Record<string, SettingField>, values: SettingsValues): string[];
341
208
  declare function compatibleSettingKinds(previous: SettingField, next: SettingField): boolean;
342
209
 
343
- /**
344
- * A YouTube Short's body, as `content()` quests read it in `ctx.tracker.content.body`. Every field
345
- * is what YouTube reported when Relay last read the video.
346
- *
347
- * @compat output
348
- */
349
- declare const youtubeShortBodySchema: z.ZodObject<{
350
- title: z.ZodString;
351
- description: z.ZodString;
352
- tags: z.ZodArray<z.ZodString>;
353
- durationSeconds: z.ZodNumber;
354
- publishedAt: z.ZodNumber;
355
- }, z.core.$strip>;
356
- type YouTubeShortBody = z.infer<typeof youtubeShortBodySchema>;
357
- /** The counters a YouTube Short's samples measure. A counter YouTube hides is unknown, never zero. */
358
- declare const youtubeShortMetrics: readonly ["views", "likes", "comments"];
359
- type YouTubeShortMetric = (typeof youtubeShortMetrics)[number];
360
-
361
- /**
362
- * A TikTok video's body, as `content()` quests read it in `ctx.tracker.content.body`. Every field
363
- * is what TikTok reported when Relay last read the video.
364
- *
365
- * @compat output
366
- */
367
- declare const tiktokVideoBodySchema: z.ZodObject<{
368
- title: z.ZodString;
369
- description: z.ZodString;
370
- durationSeconds: z.ZodNumber;
371
- width: z.ZodNumber;
372
- height: z.ZodNumber;
373
- createdAt: z.ZodNumber;
374
- shareUrl: z.ZodString;
375
- isAigc: z.ZodBoolean;
376
- }, z.core.$strip>;
377
- type TikTokVideoBody = z.infer<typeof tiktokVideoBodySchema>;
378
- /** The counters a TikTok video's samples measure. A counter TikTok omits is unknown, never zero. */
379
- declare const tiktokVideoMetrics: readonly ["views", "likes", "comments", "shares"];
380
- type TikTokVideoMetric = (typeof tiktokVideoMetrics)[number];
381
-
382
210
  /**
383
211
  * How many panels one dashboard holds and how many dashboards that are not archived a project
384
212
  * holds. Panels are computed at read time without rollups, so the caps keep a read affordable.
213
+ *
214
+ * @deprecated Use `limits.dashboardPanels` and `limits.dashboards`, which a 1.x release can
215
+ * raise.
385
216
  */
386
217
  declare const dashboardLimits: {
387
218
  readonly panels: 24;
@@ -653,115 +484,4 @@ declare function defineDashboard(input: DashboardInput): {
653
484
  position?: number | undefined;
654
485
  } & ResourceHandle<"dashboard">;
655
486
 
656
- /**
657
- * An announcement's text, at most 1000 characters, with `{placeholder}`s (`announcementPlaceholders`)
658
- * that Relay fills when it posts. `{{` and `}}` are literal braces.
659
- */
660
- declare const announcementTextSchema: z.ZodString;
661
- /** An announcement Domino's bot posts in one of the project's connected Telegram chats. */
662
- declare const telegramAnnouncementSchema: z.ZodObject<{
663
- action: z.ZodLiteral<"post-message">;
664
- text: z.ZodString;
665
- replyToTriggeringMessage: z.ZodOptional<z.ZodBoolean>;
666
- provider: z.ZodLiteral<"telegram">;
667
- chat: z.ZodString;
668
- }, z.core.$strict>;
669
- /** An announcement Domino's bot posts in a channel of the project's connected Discord server. */
670
- declare const discordAnnouncementSchema: z.ZodObject<{
671
- action: z.ZodLiteral<"post-message">;
672
- text: z.ZodString;
673
- replyToTriggeringMessage: z.ZodOptional<z.ZodBoolean>;
674
- provider: z.ZodLiteral<"discord">;
675
- channel: z.ZodString;
676
- }, z.core.$strict>;
677
- /**
678
- * A message Relay posts when a completion of the quest pays, after its rewards commit. A failed
679
- * post never undoes the rewards. Build one with `telegram.postMessage()` or
680
- * `discord.postMessage()`.
681
- */
682
- declare const announcementSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
683
- action: z.ZodLiteral<"post-message">;
684
- text: z.ZodString;
685
- replyToTriggeringMessage: z.ZodOptional<z.ZodBoolean>;
686
- provider: z.ZodLiteral<"telegram">;
687
- chat: z.ZodString;
688
- }, z.core.$strict>, z.ZodObject<{
689
- action: z.ZodLiteral<"post-message">;
690
- text: z.ZodString;
691
- replyToTriggeringMessage: z.ZodOptional<z.ZodBoolean>;
692
- provider: z.ZodLiteral<"discord">;
693
- channel: z.ZodString;
694
- }, z.core.$strict>], "provider">;
695
- type Announcement = z.infer<typeof announcementSchema>;
696
-
697
- /**
698
- * Why an evaluator capability could not answer:
699
- *
700
- * - `not-linked`: the call needs a member account that is not linked, and its result cannot be
701
- * null, such as an image check of the member's X profile picture. Readers of the member's own
702
- * accounts return `null` instead.
703
- * - `provider-unavailable`: the provider (X, Discord, a chain RPC, AI review) did not answer, or
704
- * the project's integration cannot reach it.
705
- * - `author-error`: the call cannot be answered as written: invalid input, an undeclared
706
- * integration, an unknown tracker, a chain Relay does not read, a wallet the member never
707
- * linked, or an image that does not exist.
708
- *
709
- * Later versions can add codes. Relay also sends codes this tuple does not list, as SDK 1.x keeps
710
- * it fixed:
711
- *
712
- * - `integration-required`: the project's integration needs configuration before the call can
713
- * answer.
714
- * - `capability-limit`: the evaluation run already made its eight capability calls, which all
715
- * capabilities share. Never retryable: the run makes the same calls again.
716
- *
717
- * Treat an unknown code as a failure its `message` explains.
718
- */
719
- declare const capabilityErrorCodes: readonly ["not-linked", "provider-unavailable", "author-error"];
720
- /** @compat open */
721
- type KnownCapabilityErrorCode = (typeof capabilityErrorCodes)[number];
722
- /** A known code, or one a newer Relay added. */
723
- type CapabilityErrorCode = KnownCapabilityErrorCode | (string & {});
724
- /**
725
- * A capability failure as it crosses the sandbox boundary and as Relay captures it. Open, so a
726
- * newer Relay can add codes and fields without breaking an older evaluator or Worker.
727
- */
728
- declare const capabilityFailureSchema: z.ZodObject<{
729
- code: z.ZodString;
730
- message: z.ZodString;
731
- retryable: z.ZodBoolean;
732
- }, z.core.$loose>;
733
- type CapabilityFailure = z.infer<typeof capabilityFailureSchema>;
734
- /**
735
- * Thrown by an evaluator capability (`ctx.x`, `ctx.discord`, `ctx.wallet`, `ctx.trackers`,
736
- * `ctx.images`, `ctx.review`) that could not answer. A capability whose subject is missing (an
737
- * account the member has not linked, a deleted post or message) returns `null` instead of
738
- * throwing.
739
- *
740
- * Catch it to decide yourself; rethrow anything else. An uncaught retryable error makes Relay
741
- * retry the attempt later; an uncaught one that is not retryable fails it.
742
- *
743
- * ```ts
744
- * try {
745
- * return (await ctx.x.follows({ userId })) ? decision.accept() : decision.reject({ reason })
746
- * } catch (error) {
747
- * if (error instanceof CapabilityError && error.code === "provider-unavailable")
748
- * return decision.review({ reason: "X is unavailable" })
749
- * throw error
750
- * }
751
- * ```
752
- */
753
- declare class CapabilityError extends Error {
754
- readonly code: CapabilityErrorCode;
755
- readonly retryable: boolean;
756
- constructor(code: CapabilityErrorCode, message: string, options?: {
757
- retryable?: boolean;
758
- });
759
- static [Symbol.hasInstance](value: unknown): boolean;
760
- /**
761
- * The error for a captured or transported failure. A code this SDK does not know is never
762
- * retryable: nothing tells it a retry would help.
763
- */
764
- static from(failure: CapabilityFailure): CapabilityError;
765
- }
766
-
767
- export { missingResourceSettings as $, type AmountSetting as A, type BalanceChain as B, CapabilityError as C, type DashboardInput as D, completionPolicySchema as E, dashboardArtifactSchema as F, dashboardAuthoringSchema as G, dashboardDefinitionSchema as H, type IntegerSettings as I, dashboardIssue as J, type KnownCapabilityErrorCode as K, dashboardLimits as L, type MemberCompletion as M, dashboardPanelAuthoringSchema as N, dashboardPanels as O, dashboardPreviewSchema as P, defaultPanelWidths as Q, type ResourceSource as R, type Setting as S, type TikTokVideoBody as T, discordAnnouncementSchema as U, isAmount as V, isBalanceChain as W, isBoundSetting as X, type YouTubeShortBody as Y, maxMemberCompletions as Z, memberCompletionSchema as _, type Budget as a, normalizeDashboard as a0, parseSettings as a1, resourceOptionsSchema as a2, resourceRequestSchema as a3, resourceSourceSchema as a4, settingFieldSchema as a5, settingsFieldsSchema as a6, settingsValuesSchema as a7, telegramAnnouncementSchema as a8, textSettingSchema as a9, tiktokVideoBodySchema as aa, tiktokVideoMetrics as ab, youtubeShortBodySchema as ac, youtubeShortMetrics as ad, type AuthorBudget as b, type BoundSettings as c, type Announcement as d, type CapabilityErrorCode as e, type DashboardPanelInput as f, type TikTokVideoMetric as g, type YouTubeShortMetric as h, capabilityErrorCodes as i, defineDashboard as j, type CapabilityFailure as k, type DashboardAuthoring as l, type DashboardDefinition as m, type DashboardIssue as n, type DashboardPanel as o, type DashboardPreview as p, type ResourceOption as q, type SettingField as r, type SettingsValues as s, announcementSchema as t, announcementTextSchema as u, authorBudgetSchema as v, budgetSchema as w, capabilityFailureSchema as x, compatibleSettingKinds as y, completionKeySchema as z };
487
+ export { type AmountSetting as A, type BalanceChain as B, settingFieldSchema as C, type DashboardInput as D, settingsFieldsSchema as E, settingsValuesSchema as F, textSettingSchema as G, type IntegerSettings as I, type Setting as S, type BoundSettings as a, type DashboardPanelInput as b, compatibleSettingKinds as c, dashboardIssue as d, defineDashboard as e, type DashboardAuthoring as f, type DashboardDefinition as g, type DashboardIssue as h, isBoundSetting as i, type DashboardPanel as j, type DashboardPreview as k, type SettingField as l, type SettingsValues as m, normalizeDashboard as n, dashboardArtifactSchema as o, dashboardAuthoringSchema as p, dashboardDefinitionSchema as q, dashboardLimits as r, dashboardPanelAuthoringSchema as s, dashboardPanels as t, dashboardPreviewSchema as u, defaultPanelWidths as v, isAmount as w, isBalanceChain as x, missingResourceSettings as y, parseSettings as z };