@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.
- package/CHANGELOG.md +45 -0
- package/dist/{accounts-CVonEkdb.d.ts → accounts-DoabriBX.d.ts} +4 -1
- package/dist/{integrations-DrbKQSTD.d.ts → announcements-CHx3-HBw.d.ts} +48 -42
- package/dist/{attempt-captures-DBj-rxak.d.ts → attempt-captures-DYnJVkfg.d.ts} +1 -1
- package/dist/authoring.d.ts +161 -29
- package/dist/authoring.js +116 -36
- package/dist/{automatic-outcomes-FS9okvBP.d.ts → automatic-outcomes-If88LR9f.d.ts} +1 -1
- package/dist/avatar.d.ts +1 -1
- package/dist/browser.d.ts +19 -10
- package/dist/browser.js +12 -10
- package/dist/{capability-error-DDJl0LY-.d.ts → capability-error-DufwG3G0.d.ts} +21 -1
- package/dist/{chunk-2LKGAL63.js → chunk-24I4R732.js} +39 -2
- package/dist/{chunk-UEMLYPKJ.js → chunk-3Y3L2F54.js} +34 -5
- package/dist/{chunk-YRSU2X2P.js → chunk-5I54XBK2.js} +2 -2
- package/dist/{chunk-KBCTII6C.js → chunk-7A4J67ZL.js} +1 -1
- package/dist/{chunk-LDLOB2UZ.js → chunk-DHXDBAJF.js} +4 -4
- package/dist/{chunk-W42KMMH5.js → chunk-DYXDZFKA.js} +5 -2
- package/dist/{chunk-TZJT5CRF.js → chunk-EN3M5Z4J.js} +1 -1
- package/dist/{chunk-IBROKMFV.js → chunk-L77O64I4.js} +1 -1
- package/dist/{chunk-EQF4ID47.js → chunk-PPB7HALD.js} +12 -2
- package/dist/{chunk-KYUQEZZA.js → chunk-QEAS4ZGS.js} +1 -1
- package/dist/{chunk-6U5WWH3W.js → chunk-QNUHWK7R.js} +9 -4
- package/dist/{chunk-YMWRLAAP.js → chunk-RHBS5FJL.js} +8 -2
- package/dist/chunk-SE4PFJPT.js +247 -0
- package/dist/{chunk-577DG2IT.js → chunk-SKGTNTLF.js} +12 -12
- package/dist/{chunk-M2JQPDUX.js → chunk-VURRFVNP.js} +9 -9
- package/dist/{chunk-R4S6BFOH.js → chunk-XBV2CK2H.js} +1 -1
- package/dist/{chunk-AWWCEP7F.js → chunk-ZDJLPN4L.js} +815 -592
- package/dist/{client-3b9HjSzZ.d.ts → client-C51w7fMb.d.ts} +12 -7
- package/dist/{deployments-BydFVj4Q.d.ts → deployments-kWoHFaqj.d.ts} +786 -2
- package/dist/{groups-CFuTfFqG.d.ts → groups-CqcA2Ycs.d.ts} +4 -1
- package/dist/index.d.ts +10 -10
- package/dist/index.js +9 -9
- package/dist/{analytics-URV-mxjH.d.ts → integrations-B3y36OaB.d.ts} +55 -1
- package/dist/internal.d.ts +11 -11
- package/dist/internal.js +8 -8
- package/dist/{offers-DAfe1O3_.d.ts → offers-BoV4ryUc.d.ts} +3 -2
- package/dist/{pages-ChDVLrgR.d.ts → pages-K7-KjSXw.d.ts} +147 -2
- package/dist/{participant-activity-iciCEs_8.d.ts → participant-activity-DHL8QYks.d.ts} +4 -0
- package/dist/portal-proxy.js +3 -3
- package/dist/react/index.d.ts +20 -15
- package/dist/react/index.js +143 -14
- package/dist/runtime/authoring.js +1 -1
- package/dist/runtime/chunks/5QVFB4TU.js +1 -0
- package/dist/runtime/manifest.json +3 -3
- package/dist/runtime/schema.js +1 -1
- package/dist/{schema-BA0nRRlt.d.ts → schema-CZ6Rj0ZF.d.ts} +142 -2
- package/dist/schema.d.ts +113 -18
- package/dist/schema.js +37 -21
- package/dist/server/index.d.ts +11 -11
- package/dist/server/index.js +346 -41
- package/dist/{submission-input-DxQ6RnKo.d.ts → submission-input-C54Q8yAD.d.ts} +2 -2
- package/dist/{telegram-browser-o3OIxGrJ.d.ts → telegram-browser-BUceZIGZ.d.ts} +7 -4
- package/dist/testing.d.ts +7 -7
- package/dist/testing.js +8 -8
- package/dist/{transport-D_Eqf78J.d.ts → transport-BrX9pIGN.d.ts} +5374 -62
- package/dist/{wallet-B06zvDXp.d.ts → wallet-CIqFoxdm.d.ts} +8 -1
- package/dist/{x-C28SNifw.d.ts → x-D1PGi8Sq.d.ts} +2 -2
- package/package.json +1 -1
- package/dist/chunk-XGXDINGM.js +0 -357
- package/dist/runtime/chunks/BG43KQ2T.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,50 @@
|
|
|
1
1
|
# @domino-sdk/relay
|
|
2
2
|
|
|
3
|
+
## 1.61.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- f0ce453: `RelayProvider` follows the EVM wallet a participant signed in with through `useSignIn().withWallet()` or a wallet option of `useSignInOptions()`, so the starters need no code for it. When the wallet switches to another account (`accountsChanged`, compared case-insensitively) or reports none because it was locked or disconnected, the provider signs out as `useSignOut()` does and the app shows its sign-in again; it does not sign the new account in. The same account, including the event wallets send on first connect, changes nothing. After a reload the provider finds the wallet again by name and checks `eth_accounts` without a prompt. `WalletSigner` gains an optional `watchAccounts(listener)`, which `evmSigner()` implements, and `Eip1193Provider` an optional `on` and `removeListener`.
|
|
8
|
+
- b369a75: A project connects a Discord server that another project of its organization already connects, ready, in the same environment, without installing Domino's bot again. Any credential with `publish` permission can: an automation key, a CLI session, a personal API key or Console (**Integrations**, **Or reuse**). Installing the bot into a new server stays with an organization administrator in Console.
|
|
9
|
+
|
|
10
|
+
- `management.discord.servers()` and `domino integrations discord servers` list the servers the project can connect.
|
|
11
|
+
- `management.discord.connect(server)` and `domino integrations discord connect --server <id>` connect one, once the bot still sees it. They refuse with 409 `server-not-connected-in-organization` for any other server, 409 `integration-connected` when the project already has a Discord connection, and 422 `server-not-reachable` when the bot lost the server. Connecting the server the project already connects changes nothing.
|
|
12
|
+
- `management.discord.connection()` and `domino integrations discord status` read the project's Discord connection.
|
|
13
|
+
|
|
14
|
+
The project's audit records each connection as `discord-server-connected`, with who connected it and the project whose connection it reused. An automation key and a CLI session connect only in test.
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- e71f881: `domino check` runs each badge, point ledger, offer, leaderboard, referral, dashboard and tracker entry in a separate Node process and parses its export with the schema Relay parses it with at deployment. A definition that fails, such as an offer without `stock`, reports a `DEFINITION_INVALID` error diagnostic with its `file`, `export`, field `path` and message, and fails the check instead of failing later in staging.
|
|
19
|
+
`defineOffer`, `defineBadge`, `defineLedger`, `defineLeaderboard`, `defineReferral`, `defineDashboard` and `defineTracker` still throw a `ZodError` for invalid input, and its message now names the kind, key and fields, for example `Offer "ladder" is invalid: stock: Invalid input: expected number, received undefined`. Staging shows that message when its data setup fails.
|
|
20
|
+
A deployment, preview or staging activation with an inline or described definition that fails its schema now answers 422 `validation-failed` with that message, where it answered 400 `Invalid request`.
|
|
21
|
+
|
|
22
|
+
## 1.60.0
|
|
23
|
+
|
|
24
|
+
### Minor Changes
|
|
25
|
+
|
|
26
|
+
- d258795: A budget can cap what one person gives, not only what one member receives. `budget({ key, scope: "author", period, limit, cost })` counts per tracker record author: the account that caused the record, such as a reaction's reactor, whether or not a member linked it. Put it in a tracker quest's `budgets` beside a `"member"` budget to cap both sides, for example a tip paid to a message's author with `beneficiary: "messageAuthor"`: at most 20 tips a day per receiver and 10 a day per reactor. A tip over either cap is rejected with `budget-exhausted`, permanently; other reactors' tips keep paying. It works on `telegram.reactions()`, `discord.reactions()`, kudos recipients and X `inReplyTo` replies. Author budgets share keys, calendar periods and the atomic commit with the other budgets, and imported completions don't count toward them.
|
|
27
|
+
|
|
28
|
+
An author budget needs a tracker trigger. `domino check` reports `AUTHOR_BUDGET_TRACKER_REQUIRED` on another quest, `domino build` and `domino deploy` refuse it, and Relay refuses its publication.
|
|
29
|
+
|
|
30
|
+
The types SDK 1.x code reads are unchanged: `Budget` keeps `scope: "member" | "project"`, and a quest's description lists author budgets in the new optional `authorBudgets` (`AuthorBudget`, `authorBudgetSchema` from `@domino-sdk/relay/schema`), apart from `budgets`. `budget()` returns an `AuthorBudget` for `scope: "author"`. A member's quest `budgets` (`QuestBudgetView`) leave author budgets out, since they cap someone else's giving.
|
|
31
|
+
|
|
32
|
+
- d41f5da: `relay.me.get()` and `useMe()` now return the member's `clock: { now, offsetMs }`, the clock Relay judges their activity on. A test member's clock runs ahead after the staging toolbar's **Next day** or `domino test-members advance`; every other member's `offsetMs` is 0. New `memberTime(me, at?)` from `@domino-sdk/relay/browser` turns a real instant into the member's time, so an app that shows campaign phases or open quests by date follows an advanced test member. `clock` is optional, and `memberTime` returns real time when a Relay older than it omits it. On staging, the toolbar's `domino:test-state-changed` event now carries `detail: { change, actingAs }`: what changed and which test member the page is signed in as.
|
|
33
|
+
- e899f47: Member imports carry referrals. A row's optional `referral` names the member's inviter (another row's `ref`, or the sign-in identity of an existing member), when they accepted, and the referral programs they already qualified in (`qualified: [{ program, at }]`). Applying records the referral and the qualifications without paying any referral reward, milestone or bonus; they count toward the inviter's qualified friends, and the friend's later points pay the program's bonus. An inviter's row applies before the rows that name it. New refusal codes: `unknown-inviter`, `self-referral`, `inviter-already-accepted`, `referral-cycle`, `inviter-refused` and `unknown-referral-program`. The check summary adds `referrals` (`accepted`, and `qualified` by program), `management.referrals.participants()` names the import that recorded a relationship or qualification in `import`, and `management.members.get()` returns the member's accepted referral in an optional `referral` (`inviter`, `acceptedAt`, `suspended`, `import`).
|
|
34
|
+
- 8ee2000: A member import vouches for Telegram and Discord accounts too. A row's `accounts` takes `{ kind: "telegram", subject }` and `{ kind: "discord", subject }`, each a numeric user ID, at most one of each per member, from `domino import` and `management.memberImports.addRows`. They work like a vouched X account: Telegram and Discord tracker records, quest checks and Discord role checks trust them from when the import attached them, nobody else can link them, and the member's own Telegram or Discord link replaces them. They never sign in: a Telegram or Discord sign-in with one is refused with `sign-in-method-disabled`. A row naming a second account of a kind, or another one than the member's, is refused with the new `MemberImportRefusalCode.TelegramAccountSelected` (`telegram-account-selected`) or `DiscordAccountSelected` (`discord-account-selected`).
|
|
35
|
+
|
|
36
|
+
`@domino-sdk/relay/server` adds `memberImportVouchedAccountSchema`, `memberImportFullRowSchema` and `memberImportFullRowsInputSchema`, with the types `MemberImportVouchedAccount`, `MemberImportFullRow`, `MemberImportFullRowInput` and `MemberImportFullRowsInput`, for rows with every kind of vouched account; `addRows` takes `MemberImportFullRowInput[]`. `memberImportAccountSchema`, `memberImportRowSchema` and `memberImportRowsInputSchema` stay the X-and-wallet form. Member identity states carry `imported: true` for an X, Discord or Telegram account an import attached, and so does a connected `ManagedTelegramAccount`.
|
|
37
|
+
|
|
38
|
+
An imported X, Telegram or Discord account now pays tracker records from the moment it was imported. Before, a vouched X account had no link time, so its records were skipped as historical. Members imported before this release keep that unknown link time until they link their X account themselves.
|
|
39
|
+
|
|
40
|
+
- f0d5b8e: Offers can be archived and restored. `management.offers.archive` and `unarchive` (`POST /management/v1/offers/OFFER/archive|unarchive`), `domino offers archive|unarchive OFFER --reason`, Console **Settings → Resources** and the offer's card in Console **Rewards** archive one in test, and a promotion carries it to live. Each returns `{ resource, changed }`, typed by the new `offerLifecycleResultSchema`, with `resource.kind` `offer`. An archived offer leaves member offer reads and refuses redemption with `offer-paused`; management reads keep it, with the new `archivedAt` field on `Offer`, and its redemptions can still be canceled. `management.resources.list()` and `domino resources list` list offers in a new `offers` array (`managedResourceListSchema`), beside the existing kinds. A rollback now archives an offer the earlier promotion did not carry.
|
|
41
|
+
- 6b5228b: Quests can announce a completion in a connected Telegram chat or Discord channel. List `telegram.postMessage({ chat, text, replyToTriggeringMessage })` or `discord.postMessage({ channel, text, replyToTriggeringMessage })` in the new optional `announcements` of `defineQuest`, beside `rewards` (at most three; an array or a function of the settings). The text is a template with the placeholders `{beneficiary}`, `{author}`, `{points}`, `{rewards}` and `{quest}` (`announcementPlaceholders`); people are mentioned through their linked account on that platform. Relay posts after the rewards commit, as a reward delivery with the new `RewardDeliveryAction.PostMessage` action and an empty `roleId`, retried with backoff and paced per chat; a failed post never undoes the rewards, and `management.retryRewardDelivery(id)` retries one. Descriptions carry them in the new optional `announcements` field (`announcementSchema`). `discord.channels({ postable: true })` lists channels the bot can't post in as unavailable, and `TelegramChat` gains an optional `canPost`. The CLI's authoring reference documents announcements.
|
|
42
|
+
- ea1f033: Revert an applied or stopped member import: `management.memberImports.revert(id, { reason })` starts it, and `domino imports revert IMPORT --reason TEXT` starts it and waits. In the background, one row at a time, it reverses the applied rows' opening balances (taking only points members still have; `unreversedPoints` lists the rest), revokes their imported completions (reason `import-reverted`, freeing the occurrence) and removes the wallets, accounts and identities they linked unless the member signed in with one since (`keptLinks`). Members stay in the project. A reverting or reverted import reads as `applied` with `revert` set, and is reverted once; the same `actionId` answers the import again. Rows applied before imports recorded their links keep them (`linksUntracked`). Reverting needs `publish` permission and works in live from API keys and CLI sessions too. Console shows **Revert import** on applied and stopped imports.
|
|
43
|
+
`MemberImport` gains `revert`: the reason, who asked and when, rows reverted so far, then `revertedAt` and the `outcome`.
|
|
44
|
+
- 9a7ad11: Stop a member import while it applies: `management.memberImports.stop(id)` and `domino imports stop IMPORT` let the row being applied finish, apply no more rows, and end the import: it reads as `applied` with `appliedAt` null and `stoppedAt` and `stoppedBy` set, and its remaining rows stay `ready`. A stopped import can't be applied again; import the remaining rows in a new import. Stopping needs `publish` permission and works in live from API keys and CLI sessions too. Console shows **Stop import** on an applying import.
|
|
45
|
+
`MemberImport` gains `stoppedAt` and `stoppedBy`; check `stoppedAt` to tell a stopped import from a fully applied one.
|
|
46
|
+
- df3a08c: A test member's clock moves by hours and minutes, or to an instant, so time-of-day rules can be tested: block edges, or midnight in the project's time zone. `management.testMembers.advance(member, input)` takes `{ actionId }` with one of `days` (1–30, unchanged: project-calendar days that keep the time of day), `hours` (1–720), `minutes` (1–43200) or `to`, an ISO 8601 instant with an offset that must be later than the member's clock (else 422 `test-member-clock-past`). From the CLI, `domino test-members advance MEMBER` takes one of `--days`, `--hours`, `--minutes` or `--to`. The 90-day limit holds across units (422 `test-member-clock-limit`): `days` still add up to at most 90 and land no later than the 90th date, and hours, minutes and `to` never move the clock past 90 days from now. `offsetDays` still counts the days advanced with `days`; hours, minutes and `to` leave it unchanged, so read the member's date from `today`. `@domino-sdk/relay/server` exports `testMemberClockAdvanceSchema` and `TestMemberClockAdvanceInput` for every form; `testMemberAdvanceSchema` and `TestMemberAdvanceInput` stay the `days` form.
|
|
47
|
+
|
|
3
48
|
## 1.59.0
|
|
4
49
|
|
|
5
50
|
### Minor Changes
|
|
@@ -77,6 +77,7 @@ declare const discordResourceSourceSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
77
77
|
text: "text";
|
|
78
78
|
announcement: "announcement";
|
|
79
79
|
}>>;
|
|
80
|
+
postable: z.ZodOptional<z.ZodLiteral<true>>;
|
|
80
81
|
}, z.core.$strict>, z.ZodObject<{
|
|
81
82
|
provider: z.ZodLiteral<"discord">;
|
|
82
83
|
resource: z.ZodLiteral<"role">;
|
|
@@ -136,6 +137,7 @@ declare const telegramChatSchema: z.ZodObject<{
|
|
|
136
137
|
username: z.ZodNullable<z.ZodString>;
|
|
137
138
|
status: z.ZodString;
|
|
138
139
|
issue: z.ZodNullable<z.ZodString>;
|
|
140
|
+
canPost: z.ZodOptional<z.ZodBoolean>;
|
|
139
141
|
connectedAt: z.ZodNumber;
|
|
140
142
|
}, z.core.$strip>;
|
|
141
143
|
type TelegramChat = z.infer<typeof telegramChatSchema>;
|
|
@@ -157,6 +159,7 @@ declare const telegramChatsSchema: z.ZodObject<{
|
|
|
157
159
|
username: z.ZodNullable<z.ZodString>;
|
|
158
160
|
status: z.ZodString;
|
|
159
161
|
issue: z.ZodNullable<z.ZodString>;
|
|
162
|
+
canPost: z.ZodOptional<z.ZodBoolean>;
|
|
160
163
|
connectedAt: z.ZodNumber;
|
|
161
164
|
}, z.core.$strip>>;
|
|
162
165
|
}, z.core.$strip>;
|
|
@@ -300,4 +303,4 @@ interface DiscordReader {
|
|
|
300
303
|
}): Promise<DiscordMessage | null>;
|
|
301
304
|
}
|
|
302
305
|
|
|
303
|
-
export { type AccountConnection as A,
|
|
306
|
+
export { type AccountConnection as A, discordReactionDataSchema as B, discordResourceSourceSchema as C, type DiscordMessageData as D, discordRewardSchema as E, telegramAccountConnectionSchema as F, telegramChatConnectionSchema as G, telegramChatIdSchema as H, telegramChatSchema as I, telegramChatsSchema as J, telegramInitDataSchema as K, telegramMemberInputSchema as L, telegramMessageDataSchema as M, telegramMiniAppSignInSchema as N, telegramReactionDataSchema as O, telegramSignInMethodsSchema as P, type TelegramAccountConnection as T, type AuthProvider as a, type TelegramSignInMethods as b, type DiscordMessageTextData as c, discordMessagesSourceSchema as d, discordReactionsSourceSchema as e, type DiscordReactionData as f, type TelegramReader as g, type DiscordReader as h, type TelegramChatMember as i, type TelegramChatMemberStatus as j, type TelegramMessageData as k, type TelegramReactionData as l, discordMemberSchema as m, discordMessageSchema as n, type DiscordMember as o, type DiscordMessage as p, type TelegramChat as q, type TelegramChatConnection as r, type TelegramChats as s, telegramChatMemberSchema as t, accountConnectionSchema as u, authProviderSchema as v, discordMemberInputSchema as w, discordMessageDataSchema as x, discordMessageInputSchema as y, discordMessageTextDataSchema as z };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
|
-
import { H as WalletBalanceQuery } from './wallet-
|
|
3
|
-
import { y as ResourceHandle } from './schema-
|
|
4
|
-
import { A as AnalyticsMetricId, a as analyticsCatalog } from './
|
|
2
|
+
import { H as WalletBalanceQuery } from './wallet-CIqFoxdm.js';
|
|
3
|
+
import { y as ResourceHandle } from './schema-CZ6Rj0ZF.js';
|
|
4
|
+
import { A as AnalyticsMetricId, a as analyticsCatalog } from './integrations-B3y36OaB.js';
|
|
5
5
|
|
|
6
6
|
declare const resourceSourceSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
7
7
|
provider: z.ZodLiteral<"domino">;
|
|
@@ -13,6 +13,7 @@ declare const resourceSourceSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
13
13
|
text: "text";
|
|
14
14
|
announcement: "announcement";
|
|
15
15
|
}>>;
|
|
16
|
+
postable: z.ZodOptional<z.ZodLiteral<true>>;
|
|
16
17
|
}, z.core.$strict>, z.ZodObject<{
|
|
17
18
|
provider: z.ZodLiteral<"discord">;
|
|
18
19
|
resource: z.ZodLiteral<"role">;
|
|
@@ -30,6 +31,7 @@ declare const resourceRequestSchema: z.ZodObject<{
|
|
|
30
31
|
text: "text";
|
|
31
32
|
announcement: "announcement";
|
|
32
33
|
}>>;
|
|
34
|
+
postable: z.ZodOptional<z.ZodLiteral<true>>;
|
|
33
35
|
}, z.core.$strict>, z.ZodObject<{
|
|
34
36
|
provider: z.ZodLiteral<"discord">;
|
|
35
37
|
resource: z.ZodLiteral<"role">;
|
|
@@ -76,6 +78,7 @@ declare const settingFieldSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
76
78
|
text: "text";
|
|
77
79
|
announcement: "announcement";
|
|
78
80
|
}>>;
|
|
81
|
+
postable: z.ZodOptional<z.ZodLiteral<true>>;
|
|
79
82
|
}, z.core.$strict>, z.ZodObject<{
|
|
80
83
|
provider: z.ZodLiteral<"discord">;
|
|
81
84
|
resource: z.ZodLiteral<"role">;
|
|
@@ -149,6 +152,7 @@ declare const settingsFieldsSchema: z.ZodRecord<z.ZodString, z.ZodDiscriminatedU
|
|
|
149
152
|
text: "text";
|
|
150
153
|
announcement: "announcement";
|
|
151
154
|
}>>;
|
|
155
|
+
postable: z.ZodOptional<z.ZodLiteral<true>>;
|
|
152
156
|
}, z.core.$strict>, z.ZodObject<{
|
|
153
157
|
provider: z.ZodLiteral<"discord">;
|
|
154
158
|
resource: z.ZodLiteral<"role">;
|
|
@@ -562,43 +566,45 @@ declare function defineDashboard(input: DashboardInput): {
|
|
|
562
566
|
position?: number | undefined;
|
|
563
567
|
} & ResourceHandle<"dashboard">;
|
|
564
568
|
|
|
565
|
-
/**
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
569
|
+
/**
|
|
570
|
+
* An announcement's text, at most 1000 characters, with `{placeholder}`s (`announcementPlaceholders`)
|
|
571
|
+
* that Relay fills when it posts. `{{` and `}}` are literal braces.
|
|
572
|
+
*/
|
|
573
|
+
declare const announcementTextSchema: z.ZodString;
|
|
574
|
+
/** An announcement Domino's bot posts in one of the project's connected Telegram chats. */
|
|
575
|
+
declare const telegramAnnouncementSchema: z.ZodObject<{
|
|
576
|
+
action: z.ZodLiteral<"post-message">;
|
|
577
|
+
text: z.ZodString;
|
|
578
|
+
replyToTriggeringMessage: z.ZodOptional<z.ZodBoolean>;
|
|
579
|
+
provider: z.ZodLiteral<"telegram">;
|
|
580
|
+
chat: z.ZodString;
|
|
581
|
+
}, z.core.$strict>;
|
|
582
|
+
/** An announcement Domino's bot posts in a channel of the project's connected Discord server. */
|
|
583
|
+
declare const discordAnnouncementSchema: z.ZodObject<{
|
|
584
|
+
action: z.ZodLiteral<"post-message">;
|
|
585
|
+
text: z.ZodString;
|
|
586
|
+
replyToTriggeringMessage: z.ZodOptional<z.ZodBoolean>;
|
|
587
|
+
provider: z.ZodLiteral<"discord">;
|
|
588
|
+
channel: z.ZodString;
|
|
589
|
+
}, z.core.$strict>;
|
|
590
|
+
/**
|
|
591
|
+
* A message Relay posts when a completion of the quest pays, after its rewards commit. A failed
|
|
592
|
+
* post never undoes the rewards. Build one with `telegram.postMessage()` or
|
|
593
|
+
* `discord.postMessage()`.
|
|
594
|
+
*/
|
|
595
|
+
declare const announcementSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
596
|
+
action: z.ZodLiteral<"post-message">;
|
|
597
|
+
text: z.ZodString;
|
|
598
|
+
replyToTriggeringMessage: z.ZodOptional<z.ZodBoolean>;
|
|
599
|
+
provider: z.ZodLiteral<"telegram">;
|
|
600
|
+
chat: z.ZodString;
|
|
601
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
602
|
+
action: z.ZodLiteral<"post-message">;
|
|
603
|
+
text: z.ZodString;
|
|
604
|
+
replyToTriggeringMessage: z.ZodOptional<z.ZodBoolean>;
|
|
605
|
+
provider: z.ZodLiteral<"discord">;
|
|
606
|
+
channel: z.ZodString;
|
|
607
|
+
}, z.core.$strict>], "provider">;
|
|
608
|
+
type Announcement = z.infer<typeof announcementSchema>;
|
|
603
609
|
|
|
604
|
-
export {
|
|
610
|
+
export { type AmountSetting as A, type BalanceChain as B, discordAnnouncementSchema as C, type DashboardInput as D, isAmount as E, isBalanceChain as F, isBoundSetting as G, missingResourceSettings as H, type IntegerSettings as I, normalizeDashboard as J, parseSettings as K, resourceOptionsSchema as L, resourceRequestSchema as M, resourceSourceSchema as N, settingFieldSchema as O, settingsFieldsSchema as P, settingsValuesSchema as Q, type ResourceSource as R, type Setting as S, type TikTokVideoBody as T, telegramAnnouncementSchema as U, textSettingSchema as V, tiktokVideoBodySchema as W, tiktokVideoMetrics as X, type YouTubeShortBody as Y, youtubeShortBodySchema as Z, youtubeShortMetrics as _, type BoundSettings as a, type Announcement as b, type DashboardPanelInput as c, type TikTokVideoMetric as d, type YouTubeShortMetric as e, defineDashboard as f, type DashboardAuthoring as g, type DashboardDefinition as h, type DashboardIssue as i, type DashboardPanel as j, type DashboardPreview as k, type ResourceOption as l, type SettingField as m, type SettingsValues as n, announcementSchema as o, announcementTextSchema as p, compatibleSettingKinds as q, dashboardArtifactSchema as r, dashboardAuthoringSchema as s, dashboardDefinitionSchema as t, dashboardIssue as u, dashboardLimits as v, dashboardPanelAuthoringSchema as w, dashboardPanels as x, dashboardPreviewSchema as y, defaultPanelWidths as z };
|
package/dist/authoring.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { B as xContentBodySchema, I as IdentityKind, C as customSourceSchema, W as WithRecordData, D as WithContent, F as WithAccountRoles, y as ResourceHandle, x as QuestHandle, L as LedgerReference, G as GroupHandle, H as pointLedgerDeclarationSchema, J as TrackerSource, N as trackerDefinitionSchema, U as Tracker, V as TrackerData, X as SourceRoles, Y as LedgerHandle, Z as TrackerDataSchema, _ as xSearchSourceSchema, $ as XTweet, a0 as XContentMetric, a1 as TrackerTriggerPolicy, a2 as Where, a3 as MemberIdentity, P as PointBalance, a4 as ReferralHandle, a5 as TrackerTriggerContext, a6 as TrackerReader, a7 as TextReviewInput, a8 as TextResult, z as PhotoResult, a9 as Decision, aa as rewardSchema, ab as TrackerTriggerMode, ac as RoleOf, ad as WhereSetting, ae as ContentBody, af as BadgeHandle, ag as ContentMetricName, ah as triggerSchema, k as QuestPresentation, l as QuestProfile, m as QuizEvidence, ai as TieredRewardDefinition } from './schema-
|
|
2
|
-
export { aj as LedgerSetting, ak as TrackerPage, al as TrackerReadQuery, am as trackerDataSchema, an as trackerTriggerContextSchema } from './schema-
|
|
3
|
-
import { M as MemberCompletion, B as Budget } from './capability-error-
|
|
4
|
-
export { C as CapabilityError, a as CapabilityErrorCode, c as capabilityErrorCodes } from './capability-error-
|
|
5
|
-
import { N as NftCollection, o as ContractCall, p as ContractEvent, S as SolanaProgram, q as WalletBalanceSourceQuery, r as WalletTransaction, s as WalletInstruction, e as ProfileReferral, t as WalletReader } from './wallet-
|
|
6
|
-
export { u as ContractCallParts, v as ContractCallReturnType, w as ContractEventInput, x as ContractEventParts, y as ContractFunction, z as CosmosDenom, a as CosmosNetwork, E as EvmChainId, B as NftCollectionParts, D as NftStandard, F as WalletBalance, G as WalletBalanceChange, H as WalletBalanceQuery, I as WalletBalanceSample, J as WalletCall, K as WalletCallArgument, M as WalletCallQuery, Q as WalletDelegations, R as WalletDelegationsQuery, T as WalletEventCondition, U as WalletEventValue, V as WalletEvents, X as WalletEventsQuery, Y as WalletNfts, Z as WalletNftsQuery, _ as WalletTransactions, $ as WalletTransactionsQuery, a0 as cosmosDenomSchema, a1 as cosmosNetworkSchema, a2 as isContractCall, a3 as isContractEvent, a4 as isEvmChainId, a5 as isNftCollection, a6 as isSolanaProgram, a7 as maxWalletEventLogs, a8 as maxWalletEventLookback, a9 as maxWalletTransactionLookback, aa as maxWalletTransactions, ab as parseContractCall, ac as parseContractEvent, ad as parseContractFunction, ae as parseNftCollection } from './wallet-
|
|
1
|
+
import { B as xContentBodySchema, I as IdentityKind, C as customSourceSchema, W as WithRecordData, D as WithContent, F as WithAccountRoles, y as ResourceHandle, x as QuestHandle, L as LedgerReference, G as GroupHandle, H as pointLedgerDeclarationSchema, J as TrackerSource, N as trackerDefinitionSchema, U as Tracker, V as TrackerData, X as SourceRoles, Y as LedgerHandle, Z as TrackerDataSchema, _ as xSearchSourceSchema, $ as XTweet, a0 as XContentMetric, a1 as TrackerTriggerPolicy, a2 as Where, a3 as MemberIdentity, P as PointBalance, a4 as ReferralHandle, a5 as TrackerTriggerContext, a6 as TrackerReader, a7 as TextReviewInput, a8 as TextResult, z as PhotoResult, a9 as Decision, aa as rewardSchema, ab as TrackerTriggerMode, ac as RoleOf, ad as WhereSetting, ae as ContentBody, af as BadgeHandle, ag as ContentMetricName, ah as triggerSchema, k as QuestPresentation, l as QuestProfile, m as QuizEvidence, ai as TieredRewardDefinition } from './schema-CZ6Rj0ZF.js';
|
|
2
|
+
export { aj as LedgerSetting, ak as TrackerPage, al as TrackerReadQuery, am as trackerDataSchema, an as trackerTriggerContextSchema } from './schema-CZ6Rj0ZF.js';
|
|
3
|
+
import { M as MemberCompletion, B as Budget, A as AuthorBudget } from './capability-error-DufwG3G0.js';
|
|
4
|
+
export { C as CapabilityError, a as CapabilityErrorCode, c as capabilityErrorCodes } from './capability-error-DufwG3G0.js';
|
|
5
|
+
import { N as NftCollection, o as ContractCall, p as ContractEvent, S as SolanaProgram, q as WalletBalanceSourceQuery, r as WalletTransaction, s as WalletInstruction, e as ProfileReferral, t as WalletReader } from './wallet-CIqFoxdm.js';
|
|
6
|
+
export { u as ContractCallParts, v as ContractCallReturnType, w as ContractEventInput, x as ContractEventParts, y as ContractFunction, z as CosmosDenom, a as CosmosNetwork, E as EvmChainId, B as NftCollectionParts, D as NftStandard, F as WalletBalance, G as WalletBalanceChange, H as WalletBalanceQuery, I as WalletBalanceSample, J as WalletCall, K as WalletCallArgument, M as WalletCallQuery, Q as WalletDelegations, R as WalletDelegationsQuery, T as WalletEventCondition, U as WalletEventValue, V as WalletEvents, X as WalletEventsQuery, Y as WalletNfts, Z as WalletNftsQuery, _ as WalletTransactions, $ as WalletTransactionsQuery, a0 as cosmosDenomSchema, a1 as cosmosNetworkSchema, a2 as isContractCall, a3 as isContractEvent, a4 as isEvmChainId, a5 as isNftCollection, a6 as isSolanaProgram, a7 as maxWalletEventLogs, a8 as maxWalletEventLookback, a9 as maxWalletTransactionLookback, aa as maxWalletTransactions, ab as parseContractCall, ac as parseContractEvent, ad as parseContractFunction, ae as parseNftCollection } from './wallet-CIqFoxdm.js';
|
|
7
7
|
import * as z from 'zod';
|
|
8
8
|
export { z } from 'zod';
|
|
9
|
-
import { f as badgeDeclarationSchema, B as Badge } from './offers-
|
|
10
|
-
export { g as defineOffer } from './offers-
|
|
11
|
-
import { E as EngagementBudget, m as leaderboardDefinitionSchema, l as AuthoringIdentity, r as referralAuthoringSchema, C as CampaignDefinition, A as AvailabilityWindow } from './groups-
|
|
12
|
-
export { n as defineCampaign, o as defineGroup } from './groups-
|
|
13
|
-
import { d as discordMessagesSourceSchema, D as DiscordMessageData, c as DiscordMessageTextData, e as discordReactionsSourceSchema, f as DiscordReactionData, g as TelegramReader, h as DiscordReader } from './accounts-
|
|
14
|
-
export { i as TelegramChatMember, j as TelegramChatMemberStatus, k as TelegramMessageData, l as TelegramReactionData } from './accounts-
|
|
9
|
+
import { f as badgeDeclarationSchema, B as Badge } from './offers-BoV4ryUc.js';
|
|
10
|
+
export { g as defineOffer } from './offers-BoV4ryUc.js';
|
|
11
|
+
import { E as EngagementBudget, m as leaderboardDefinitionSchema, l as AuthoringIdentity, r as referralAuthoringSchema, C as CampaignDefinition, A as AvailabilityWindow } from './groups-CqcA2Ycs.js';
|
|
12
|
+
export { n as defineCampaign, o as defineGroup } from './groups-CqcA2Ycs.js';
|
|
13
|
+
import { d as discordMessagesSourceSchema, D as DiscordMessageData, c as DiscordMessageTextData, e as discordReactionsSourceSchema, f as DiscordReactionData, g as TelegramReader, h as DiscordReader } from './accounts-DoabriBX.js';
|
|
14
|
+
export { i as TelegramChatMember, j as TelegramChatMemberStatus, k as TelegramMessageData, l as TelegramReactionData } from './accounts-DoabriBX.js';
|
|
15
15
|
import { a as StreakPolicy, Q as QuizContent } from './streaks-0YuipsUQ.js';
|
|
16
|
-
import { R as ResourceSource, S as Setting, A as AmountSetting, B as BalanceChain,
|
|
17
|
-
export { D as DashboardInput,
|
|
18
|
-
import { P as Prerequisite, T as TextEvidence, U as UrlEvidence, a as TextOptions, b as UrlOptions } from './submission-input-
|
|
19
|
-
export { c as balanceAtLeast, d as completed, i as inGroup } from './submission-input-
|
|
20
|
-
import { I as ImageReader, X as XReader } from './x-
|
|
16
|
+
import { R as ResourceSource, S as Setting, A as AmountSetting, B as BalanceChain, a as BoundSettings, b as Announcement } from './announcements-CHx3-HBw.js';
|
|
17
|
+
export { D as DashboardInput, c as DashboardPanelInput, T as TikTokVideoBody, d as TikTokVideoMetric, Y as YouTubeShortBody, e as YouTubeShortMetric, f as defineDashboard } from './announcements-CHx3-HBw.js';
|
|
18
|
+
import { P as Prerequisite, T as TextEvidence, U as UrlEvidence, a as TextOptions, b as UrlOptions } from './submission-input-C54Q8yAD.js';
|
|
19
|
+
export { c as balanceAtLeast, d as completed, i as inGroup } from './submission-input-C54Q8yAD.js';
|
|
20
|
+
import { I as ImageReader, X as XReader } from './x-D1PGi8Sq.js';
|
|
21
|
+
import { I as IntegrationModule } from './integrations-B3y36OaB.js';
|
|
21
22
|
export { f as formatUnits, p as parseUnits } from './units-CwgsPB_r.js';
|
|
22
|
-
import './analytics-URV-mxjH.js';
|
|
23
23
|
|
|
24
24
|
declare function defineBadge(input: z.input<typeof badgeDeclarationSchema>): {
|
|
25
25
|
name: string;
|
|
@@ -446,13 +446,36 @@ declare const discord: {
|
|
|
446
446
|
action: "grant-role";
|
|
447
447
|
roleId: string;
|
|
448
448
|
};
|
|
449
|
+
/**
|
|
450
|
+
* An announcement Domino's bot posts in a channel of the project's Discord server when a
|
|
451
|
+
* completion pays, such as `"{beneficiary} got +{points} XP from {author}"`. Placeholders are
|
|
452
|
+
* `announcementPlaceholders`; `{beneficiary}` and `{author}` mention linked Discord accounts.
|
|
453
|
+
* Pass it in the quest's `announcements`, and declare the `discord` integration.
|
|
454
|
+
*/
|
|
455
|
+
postMessage(options: {
|
|
456
|
+
channel: string;
|
|
457
|
+
text: string;
|
|
458
|
+
replyToTriggeringMessage?: boolean;
|
|
459
|
+
}): {
|
|
460
|
+
action: "post-message";
|
|
461
|
+
text: string;
|
|
462
|
+
provider: "discord";
|
|
463
|
+
channel: string;
|
|
464
|
+
replyToTriggeringMessage?: boolean | undefined;
|
|
465
|
+
};
|
|
449
466
|
messages: typeof messages;
|
|
450
467
|
reactions: typeof reactions;
|
|
451
468
|
roles(options?: {
|
|
452
469
|
assignable?: boolean;
|
|
453
470
|
}): ResourceSource;
|
|
471
|
+
/**
|
|
472
|
+
* A channel of the project's Discord server, for a resource setting. With `postable: true`,
|
|
473
|
+
* Console lists channels Domino's bot cannot post in as unavailable, as an announcement's
|
|
474
|
+
* channel needs.
|
|
475
|
+
*/
|
|
454
476
|
channels(options?: {
|
|
455
477
|
types?: ChannelTypes;
|
|
478
|
+
postable?: boolean;
|
|
456
479
|
}): ResourceSource;
|
|
457
480
|
};
|
|
458
481
|
/**
|
|
@@ -470,11 +493,30 @@ declare const discord: {
|
|
|
470
493
|
* Pay the message's author with `automatic({ tracker, beneficiary: "messageAuthor" })`.
|
|
471
494
|
* - Quests read membership with `ctx.telegram.member({ chat })`, naming the chat with
|
|
472
495
|
* `settings.telegramChat()`.
|
|
496
|
+
* - `telegram.postMessage({ chat, text })`: an announcement the bot posts in a connected chat
|
|
497
|
+
* when a completion pays, listed in the quest's `announcements`.
|
|
473
498
|
*
|
|
474
499
|
* In SDK 1.x both sources are custom sources whose namespaces Relay reserves: only Relay writes
|
|
475
500
|
* their records, and the accounts on them are Telegram accounts whatever `identities` says.
|
|
476
501
|
*/
|
|
477
502
|
declare const telegram: {
|
|
503
|
+
/**
|
|
504
|
+
* An announcement Domino's bot posts in a connected chat when a completion pays, such as
|
|
505
|
+
* `"{beneficiary} got +{points} XP from {author}"`. Name the chat with `settings.telegramChat()`.
|
|
506
|
+
* Placeholders are `announcementPlaceholders`; `{beneficiary}` and `{author}` mention Telegram
|
|
507
|
+
* accounts. Pass it in the quest's `announcements`.
|
|
508
|
+
*/
|
|
509
|
+
postMessage(options: {
|
|
510
|
+
chat: string;
|
|
511
|
+
text: string;
|
|
512
|
+
replyToTriggeringMessage?: boolean;
|
|
513
|
+
}): {
|
|
514
|
+
action: "post-message";
|
|
515
|
+
text: string;
|
|
516
|
+
provider: "telegram";
|
|
517
|
+
chat: string;
|
|
518
|
+
replyToTriggeringMessage?: boolean | undefined;
|
|
519
|
+
};
|
|
478
520
|
messages(): {
|
|
479
521
|
kind: "custom";
|
|
480
522
|
namespace: string;
|
|
@@ -1068,19 +1110,21 @@ type QuestKeyedContext<S, G> = Omit<KeyedContext, "tracker"> & {
|
|
|
1068
1110
|
/** The pinned tracker observation: non-null and typed for a tracker trigger, null for others. */
|
|
1069
1111
|
tracker: ContextTracker<G>;
|
|
1070
1112
|
};
|
|
1071
|
-
|
|
1113
|
+
type BudgetDefinition<B extends Budget | AuthorBudget> = Omit<B, "id" | "cost"> & {
|
|
1072
1114
|
key: string;
|
|
1073
1115
|
cost: number | {
|
|
1074
1116
|
ledger: LedgerReference;
|
|
1075
1117
|
};
|
|
1076
|
-
}
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1118
|
+
};
|
|
1119
|
+
/**
|
|
1120
|
+
* A named cap on a quest's completions or awarded points, per member (`scope: "member"`), for
|
|
1121
|
+
* everyone together (`"project"`), or per tracker record author (`"author"`): the account that
|
|
1122
|
+
* caused the record, such as a reaction's reactor, whether or not a member linked it. An author
|
|
1123
|
+
* budget caps what one person gives when the quest pays someone else, and needs a tracker trigger.
|
|
1124
|
+
*/
|
|
1125
|
+
declare const budget: {
|
|
1126
|
+
(definition: BudgetDefinition<Budget>): Budget;
|
|
1127
|
+
(definition: BudgetDefinition<AuthorBudget>): AuthorBudget;
|
|
1084
1128
|
};
|
|
1085
1129
|
declare const keyed: (key: (ctx: KeyedContext) => string) => {
|
|
1086
1130
|
kind: "keyed";
|
|
@@ -1464,7 +1508,8 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
|
|
|
1464
1508
|
* (`relay.profiles.completions`). Hidden by default.
|
|
1465
1509
|
*/
|
|
1466
1510
|
profile?: QuestProfile;
|
|
1467
|
-
|
|
1511
|
+
/** Its {@link budget}s; an author budget needs a tracker trigger. */
|
|
1512
|
+
budgets?: (Budget | AuthorBudget)[];
|
|
1468
1513
|
/**
|
|
1469
1514
|
* Milliseconds a member waits after an attempt is rejected, by the evaluator or a
|
|
1470
1515
|
* reviewer, before submitting again: `300_000` lets a quiz be retried every five minutes.
|
|
@@ -1522,6 +1567,26 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
|
|
|
1522
1567
|
})[] | ((ctx: {
|
|
1523
1568
|
settings: z.core.$InferObjectOutput<T, {}>;
|
|
1524
1569
|
}) => Reward[]);
|
|
1570
|
+
/**
|
|
1571
|
+
* Messages Relay posts when a completion pays, after its rewards commit, such as
|
|
1572
|
+
* `telegram.postMessage({ chat, text: "{beneficiary} got +{points} XP from {author}" })`.
|
|
1573
|
+
* At most three. Return none while a setting they need is empty.
|
|
1574
|
+
*/
|
|
1575
|
+
announcements?: ({
|
|
1576
|
+
action: "post-message";
|
|
1577
|
+
text: string;
|
|
1578
|
+
provider: "telegram";
|
|
1579
|
+
chat: string;
|
|
1580
|
+
replyToTriggeringMessage?: boolean | undefined;
|
|
1581
|
+
} | {
|
|
1582
|
+
action: "post-message";
|
|
1583
|
+
text: string;
|
|
1584
|
+
provider: "discord";
|
|
1585
|
+
channel: string;
|
|
1586
|
+
replyToTriggeringMessage?: boolean | undefined;
|
|
1587
|
+
})[] | ((ctx: {
|
|
1588
|
+
settings: z.core.$InferObjectOutput<T, {}>;
|
|
1589
|
+
}) => Announcement[]) | undefined;
|
|
1525
1590
|
evaluate?: Evaluator<z.core.$InferObjectOutput<T, {}>, QuestInput<G>, NoInfer<G>, NoInfer<D>> | undefined;
|
|
1526
1591
|
/**
|
|
1527
1592
|
* A content quest's performance stage: once content evaluation accepts an item, each later
|
|
@@ -1596,6 +1661,7 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
|
|
|
1596
1661
|
provider: "discord";
|
|
1597
1662
|
resource: "channel";
|
|
1598
1663
|
types: ("text" | "announcement")[];
|
|
1664
|
+
postable?: true | undefined;
|
|
1599
1665
|
} | {
|
|
1600
1666
|
provider: "discord";
|
|
1601
1667
|
resource: "role";
|
|
@@ -1814,6 +1880,19 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
|
|
|
1814
1880
|
balance: string;
|
|
1815
1881
|
};
|
|
1816
1882
|
}[];
|
|
1883
|
+
announcements?: ({
|
|
1884
|
+
action: "post-message";
|
|
1885
|
+
text: string;
|
|
1886
|
+
provider: "telegram";
|
|
1887
|
+
chat: string;
|
|
1888
|
+
replyToTriggeringMessage?: boolean | undefined;
|
|
1889
|
+
} | {
|
|
1890
|
+
action: "post-message";
|
|
1891
|
+
text: string;
|
|
1892
|
+
provider: "discord";
|
|
1893
|
+
channel: string;
|
|
1894
|
+
replyToTriggeringMessage?: boolean | undefined;
|
|
1895
|
+
})[] | undefined;
|
|
1817
1896
|
performance?: {
|
|
1818
1897
|
metrics: string[];
|
|
1819
1898
|
maxAgeMs: number;
|
|
@@ -1831,6 +1910,15 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
|
|
|
1831
1910
|
from: number;
|
|
1832
1911
|
until: number;
|
|
1833
1912
|
} | undefined;
|
|
1913
|
+
authorBudgets?: {
|
|
1914
|
+
id: string;
|
|
1915
|
+
period: "lifetime" | "day" | "week" | "month";
|
|
1916
|
+
limit: number;
|
|
1917
|
+
cost: number | {
|
|
1918
|
+
balance: string;
|
|
1919
|
+
};
|
|
1920
|
+
scope: "author";
|
|
1921
|
+
}[] | undefined;
|
|
1834
1922
|
retryCooldownMs?: number | undefined;
|
|
1835
1923
|
completionCooldownMs?: number | undefined;
|
|
1836
1924
|
};
|
|
@@ -1914,7 +2002,8 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
|
|
|
1914
2002
|
* (`relay.profiles.completions`). Hidden by default.
|
|
1915
2003
|
*/
|
|
1916
2004
|
profile?: QuestProfile;
|
|
1917
|
-
|
|
2005
|
+
/** Its {@link budget}s; an author budget needs a tracker trigger. */
|
|
2006
|
+
budgets?: (Budget | AuthorBudget)[];
|
|
1918
2007
|
/**
|
|
1919
2008
|
* Milliseconds a member waits after an attempt is rejected, by the evaluator or a
|
|
1920
2009
|
* reviewer, before submitting again: `300_000` lets a quiz be retried every five minutes.
|
|
@@ -1972,6 +2061,26 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
|
|
|
1972
2061
|
})[] | ((ctx: {
|
|
1973
2062
|
settings: z.core.$InferObjectOutput<T, {}>;
|
|
1974
2063
|
}) => Reward[]);
|
|
2064
|
+
/**
|
|
2065
|
+
* Messages Relay posts when a completion pays, after its rewards commit, such as
|
|
2066
|
+
* `telegram.postMessage({ chat, text: "{beneficiary} got +{points} XP from {author}" })`.
|
|
2067
|
+
* At most three. Return none while a setting they need is empty.
|
|
2068
|
+
*/
|
|
2069
|
+
announcements?: ({
|
|
2070
|
+
action: "post-message";
|
|
2071
|
+
text: string;
|
|
2072
|
+
provider: "telegram";
|
|
2073
|
+
chat: string;
|
|
2074
|
+
replyToTriggeringMessage?: boolean | undefined;
|
|
2075
|
+
} | {
|
|
2076
|
+
action: "post-message";
|
|
2077
|
+
text: string;
|
|
2078
|
+
provider: "discord";
|
|
2079
|
+
channel: string;
|
|
2080
|
+
replyToTriggeringMessage?: boolean | undefined;
|
|
2081
|
+
})[] | ((ctx: {
|
|
2082
|
+
settings: z.core.$InferObjectOutput<T, {}>;
|
|
2083
|
+
}) => Announcement[]) | undefined;
|
|
1975
2084
|
evaluate?: Evaluator<z.core.$InferObjectOutput<T, {}>, QuestInput<G>, NoInfer<G>, NoInfer<D>> | undefined;
|
|
1976
2085
|
/**
|
|
1977
2086
|
* A content quest's performance stage: once content evaluation accepts an item, each later
|
|
@@ -2046,6 +2155,7 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
|
|
|
2046
2155
|
provider: "discord";
|
|
2047
2156
|
resource: "channel";
|
|
2048
2157
|
types: ("text" | "announcement")[];
|
|
2158
|
+
postable?: true | undefined;
|
|
2049
2159
|
} | {
|
|
2050
2160
|
provider: "discord";
|
|
2051
2161
|
resource: "role";
|
|
@@ -2264,6 +2374,19 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
|
|
|
2264
2374
|
balance: string;
|
|
2265
2375
|
};
|
|
2266
2376
|
}[];
|
|
2377
|
+
announcements?: ({
|
|
2378
|
+
action: "post-message";
|
|
2379
|
+
text: string;
|
|
2380
|
+
provider: "telegram";
|
|
2381
|
+
chat: string;
|
|
2382
|
+
replyToTriggeringMessage?: boolean | undefined;
|
|
2383
|
+
} | {
|
|
2384
|
+
action: "post-message";
|
|
2385
|
+
text: string;
|
|
2386
|
+
provider: "discord";
|
|
2387
|
+
channel: string;
|
|
2388
|
+
replyToTriggeringMessage?: boolean | undefined;
|
|
2389
|
+
})[] | undefined;
|
|
2267
2390
|
performance?: {
|
|
2268
2391
|
metrics: string[];
|
|
2269
2392
|
maxAgeMs: number;
|
|
@@ -2281,6 +2404,15 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
|
|
|
2281
2404
|
from: number;
|
|
2282
2405
|
until: number;
|
|
2283
2406
|
} | undefined;
|
|
2407
|
+
authorBudgets?: {
|
|
2408
|
+
id: string;
|
|
2409
|
+
period: "lifetime" | "day" | "week" | "month";
|
|
2410
|
+
limit: number;
|
|
2411
|
+
cost: number | {
|
|
2412
|
+
balance: string;
|
|
2413
|
+
};
|
|
2414
|
+
scope: "author";
|
|
2415
|
+
}[] | undefined;
|
|
2284
2416
|
retryCooldownMs?: number | undefined;
|
|
2285
2417
|
completionCooldownMs?: number | undefined;
|
|
2286
2418
|
};
|