@vercel/board 0.50.0 → 0.51.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/LICENSE +201 -0
- package/README.md +128 -118
- package/dist/{access-BbgmsAFF.mjs → access-DdojoPZm.mjs} +1 -1
- package/dist/access.d.mts +2 -2
- package/dist/access.mjs +4 -4
- package/dist/{actors-CX2D22hL.mjs → actors-CDkNgWUL.mjs} +3 -3
- package/dist/{auth-Z9-Khvvw.d.mts → auth-C4VxPLYz.d.mts} +1 -1
- package/dist/{auth-DJDTfgAL.mjs → auth-zPqFJocD.mjs} +10 -3
- package/dist/{backend-CcaaS9Xl.d.mts → backend-Da_YEltI.d.mts} +16 -13
- package/dist/backend-local.d.mts +1 -1
- package/dist/backend-local.mjs +1 -1
- package/dist/{chat-provider-DQ1GHm4o.d.mts → chat-provider-BHyX6H8H.d.mts} +2 -2
- package/dist/{chat-provider-HJ7y_ipp.mjs → chat-provider-Br2RXgLV.mjs} +4 -3
- package/dist/cli-commands.d.mts +1 -1
- package/dist/cli-commands.mjs +1 -1
- package/dist/cli-embedded.d.mts +15 -7
- package/dist/cli-embedded.mjs +9 -6
- package/dist/cli.mjs +6 -6
- package/dist/{client-C2T4eaXd.d.mts → client-C4-r10SA.d.mts} +25 -4
- package/dist/{commands-Cm4sODIu.d.mts → commands-B6pgzwTI.d.mts} +10 -0
- package/dist/{commands-nN8WpvCe.mjs → commands-DB1T8vT9.mjs} +37 -10
- package/dist/{conformance-Cr-umDl0.mjs → conformance-DW4-9Dwf.mjs} +176 -64
- package/dist/conformance.d.mts +4 -3
- package/dist/conformance.mjs +1 -1
- package/dist/{engine-DJZ8Xy_g.mjs → engine-D8YAsQS_.mjs} +17 -9
- package/dist/{errors-DYF4hhIc.mjs → errors-DbCKqGXp.mjs} +35 -7
- package/dist/{events-BdOCmnZh.mjs → events-mWKc1uvZ.mjs} +1 -1
- package/dist/{exports-CuD-Mxkw.mjs → exports-BDE3eV7B.mjs} +593 -261
- package/dist/{exports-lmr6UHHc.d.mts → exports-BUtR_AHa.d.mts} +4 -4
- package/dist/{external-D2jq_DEQ.mjs → external-DkWafjn-.mjs} +5 -1
- package/dist/{index-_KxJu15n.d.mts → index-BTuTaBaK.d.mts} +2 -2
- package/dist/index.d.mts +6 -6
- package/dist/index.mjs +4 -4
- package/dist/index.node.d.mts +7 -7
- package/dist/index.node.mjs +4 -4
- package/dist/inspect/app.js +41 -41
- package/dist/inspect/engine.js +4 -4
- package/dist/inspect-BXvdLMET.mjs +2 -0
- package/dist/{inspect-CZeoSm7E.mjs → inspect-Nd_TlU1s.mjs} +3 -3
- package/dist/inspect.d.mts +1 -1
- package/dist/inspect.mjs +2 -2
- package/dist/{local-BVSFSSYf.mjs → local-BsYjQrl_.mjs} +113 -35
- package/dist/{main-B016auoG.mjs → main-CSIXhZ_b.mjs} +117 -36
- package/dist/{memory-C2lzMV_t.mjs → memory-wmUDblhm.mjs} +2 -2
- package/dist/{middleware-DUKIITFZ.mjs → middleware-iVTNf5Su.mjs} +1 -1
- package/dist/{profile-header-Cj0Cb1cf.mjs → profile-header-O8wC8yk8.mjs} +12 -1
- package/dist/{provider-Dwb_9mnu.d.mts → provider-CGicSMdu.d.mts} +4 -2
- package/dist/{routes-BE0y6wCk.mjs → routes-C85Sbhtm.mjs} +44 -11
- package/dist/{routes-B6SEA9yw.d.mts → routes-ChGBn0K3.d.mts} +60 -23
- package/dist/{serve-B10e7QaY.mjs → serve-Cp0qM4jk.mjs} +9 -8
- package/dist/{server-ViWNvg5q.mjs → server-HPq6MO3_.mjs} +50 -33
- package/dist/{serving-SbqeWqlA.mjs → serving-aOQsBok0.mjs} +1 -1
- package/dist/{shell-DmpmgOPC.mjs → shell-CUR5woOP.mjs} +1 -1
- package/dist/{sql-iABdyCiz.mjs → sql-D0MqINA6.mjs} +1 -1
- package/dist/{sqlite-28EMrmk7.mjs → sqlite-Dj2ZEtgy.mjs} +2 -2
- package/dist/{sqlite-db-Ckd-ceNe.mjs → sqlite-db-DjbTlUwN.mjs} +1 -1
- package/dist/sync-chat-sdk.d.mts +2 -2
- package/dist/sync-chat-sdk.mjs +2 -2
- package/dist/sync-github.d.mts +2 -2
- package/dist/sync-github.mjs +3 -3
- package/dist/sync-linear.d.mts +3 -3
- package/dist/sync-linear.mjs +3 -3
- package/dist/sync-slack.d.mts +21 -4
- package/dist/sync-slack.mjs +35 -11
- package/dist/sync.d.mts +2 -2
- package/dist/sync.mjs +2 -2
- package/dist/{tags-D0qra0Qy.mjs → tags-CxDCF_tt.mjs} +1 -1
- package/dist/{task-batch-9lVDG3d-.mjs → task-batch-D3ASL5_-.mjs} +53 -9
- package/dist/{tokens-C-iK0Cku.mjs → tokens-C-T0B1uF.mjs} +31 -7
- package/dist/{version-C70RLVEK.mjs → version-BJH1vWR0.mjs} +1 -1
- package/docs/01-board/01-mounting.md +20 -7
- package/docs/01-board/03-identity.md +1 -1
- package/docs/01-board/04-messages.md +5 -0
- package/docs/01-board/05-reading.md +71 -16
- package/docs/01-board/07-schedules.md +1 -1
- package/docs/01-board/10-local.md +1 -1
- package/docs/02-sync/01-overview.md +3 -3
- package/docs/02-sync/03-slack.md +4 -3
- package/docs/03-guides/01-coding-agents.md +1 -1
- package/docs/03-guides/02-inspector.md +13 -5
- package/docs/03-guides/07-build-a-ui.md +15 -11
- package/docs/04-reference/01-cli.md +64 -25
- package/docs/04-reference/02-board.md +48 -23
- package/docs/04-reference/03-http.md +33 -14
- package/docs/04-reference/05-conformance.md +11 -10
- package/docs/index.md +1 -1
- package/package.json +14 -2
- package/dist/inspect-UCcPViyA.mjs +0 -2
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { a as DIRECT_UPLOAD_BYTES_MAX,
|
|
1
|
+
import { a as DIRECT_UPLOAD_BYTES_MAX, l as fileSize } from "./profile-header-O8wC8yk8.mjs";
|
|
2
2
|
import { m as MESSAGE_TEXT_MAX, r as AttachmentId } from "./schemas-CUSTEFIy.mjs";
|
|
3
|
-
import "./routes-
|
|
3
|
+
import "./routes-C85Sbhtm.mjs";
|
|
4
4
|
import { n as displayEmoji, r as normalizeEmoji } from "./emoji-CTLpvH-A.mjs";
|
|
5
|
-
import { f as BoardError } from "./errors-
|
|
6
|
-
import { l as shownName } from "./middleware-
|
|
5
|
+
import { f as BoardError } from "./errors-DbCKqGXp.mjs";
|
|
6
|
+
import { l as shownName } from "./middleware-iVTNf5Su.mjs";
|
|
7
7
|
import { d as parseSchemaId, r as findBlocks, t as block } from "./blocks-CVoBC7ur.mjs";
|
|
8
8
|
import { a as replaceMentions, n as isEmail, t as extractMentions } from "./mentions-CnWt9Z5b.mjs";
|
|
9
|
-
import { t as VERSION } from "./version-
|
|
10
|
-
import { r as PERMISSIONS } from "./access-
|
|
11
|
-
import { c as withMentions } from "./task-batch-
|
|
12
|
-
import {
|
|
13
|
-
import { i as groups, n as filters$1, o as options, r as globalOptions, s as usage$1, t as commands } from "./commands-
|
|
14
|
-
import { _ as vercelProjectFile, a as vercel, c as boardUrl, d as environmentProfile, f as handFetch, i as handTeam, l as configDir, m as handToken, n as credentialSource, o as http, p as handLogin, r as credentialed, t as board, u as connect } from "./server-
|
|
15
|
-
import { t as conformance } from "./conformance-
|
|
9
|
+
import { t as VERSION } from "./version-BJH1vWR0.mjs";
|
|
10
|
+
import { r as PERMISSIONS } from "./access-DdojoPZm.mjs";
|
|
11
|
+
import { c as withMentions } from "./task-batch-D3ASL5_-.mjs";
|
|
12
|
+
import { a as isBoardName, c as isApiMessageId, n as createTasksInChunks, t as TasksInChunksError } from "./exports-BDE3eV7B.mjs";
|
|
13
|
+
import { i as groups, n as filters$1, o as options, r as globalOptions, s as usage$1, t as commands } from "./commands-DB1T8vT9.mjs";
|
|
14
|
+
import { _ as vercelProjectFile, a as vercel, c as boardUrl, d as environmentProfile, f as handFetch, i as handTeam, l as configDir, m as handToken, n as credentialSource, o as http, p as handLogin, r as credentialed, t as board, u as connect } from "./server-HPq6MO3_.mjs";
|
|
15
|
+
import { n as everyChannel, t as conformance } from "./conformance-DW4-9Dwf.mjs";
|
|
16
16
|
import { n as displayText, t as byVercelBot } from "./bots-CqPYxkqK.mjs";
|
|
17
17
|
import { spawn } from "node:child_process";
|
|
18
18
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -942,7 +942,8 @@ const AGENTS = {
|
|
|
942
942
|
file: () => join(process.env.PI_CODING_AGENT_DIR || join(homedir(), ".pi", "agent"), "extensions", "board.ts")
|
|
943
943
|
}
|
|
944
944
|
};
|
|
945
|
-
|
|
945
|
+
/** A command an install wrote: `<vb> hook stop --agent <one of AGENTS>`, with whatever flags followed. Another tool's `hook stop` isn't ours. */
|
|
946
|
+
const ours = (entry) => / hook stop --agent (?:claude|codex|cursor|pi)(?:\s|$)/.test(entry.command ?? "");
|
|
946
947
|
function readConfig(path) {
|
|
947
948
|
try {
|
|
948
949
|
return JSON.parse(readFileSync(path, "utf8"));
|
|
@@ -989,7 +990,8 @@ function installedHook(agent) {
|
|
|
989
990
|
const spec = AGENTS[agent];
|
|
990
991
|
if (spec.shape === "extension") try {
|
|
991
992
|
const line = PI_COMMAND.exec(readFileSync(spec.file(), "utf8"));
|
|
992
|
-
|
|
993
|
+
const command = line ? JSON.parse(line[1]) : null;
|
|
994
|
+
return command !== null && ours({ command }) ? command : null;
|
|
993
995
|
} catch {
|
|
994
996
|
return null;
|
|
995
997
|
}
|
|
@@ -1599,7 +1601,7 @@ const TERMINAL = {
|
|
|
1599
1601
|
if (info.size > 104857600) throw tooLarge(path);
|
|
1600
1602
|
return new Uint8Array(await readFile(path));
|
|
1601
1603
|
},
|
|
1602
|
-
writeFile: (path, data) => writeFile(path, data),
|
|
1604
|
+
writeFile: (path, data, { exclusive = false } = {}) => writeFile(path, data, { flag: exclusive ? "wx" : "w" }),
|
|
1603
1605
|
stdin: readStdin,
|
|
1604
1606
|
tty: process.stdout.isTTY === true
|
|
1605
1607
|
};
|
|
@@ -1619,6 +1621,21 @@ function messageId(value, what = "message ID") {
|
|
|
1619
1621
|
if (!/^[^\s/]+$/.test(id)) throw usage(`${value} isn't a ${what}.`);
|
|
1620
1622
|
return id;
|
|
1621
1623
|
}
|
|
1624
|
+
/** Characters that change how a name reads without showing: invisible formatting (bidi overrides, zero-width), and line and paragraph separators. */
|
|
1625
|
+
const INVISIBLE = /[\p{Cf}\u2028\u2029]/gu;
|
|
1626
|
+
/** A download that would replace a file, which only a path given to download may. */
|
|
1627
|
+
const exists = (path) => usage(`${path} is already here, and download keeps it: give download a path to save the attachment elsewhere.`, {
|
|
1628
|
+
reason: "file_exists",
|
|
1629
|
+
next: [{
|
|
1630
|
+
instruction: "Save it under another name",
|
|
1631
|
+
argv: [
|
|
1632
|
+
...cli(),
|
|
1633
|
+
"download",
|
|
1634
|
+
"<ID>",
|
|
1635
|
+
"<PATH>"
|
|
1636
|
+
]
|
|
1637
|
+
}]
|
|
1638
|
+
});
|
|
1622
1639
|
/** A file over what a direct upload takes. */
|
|
1623
1640
|
const tooLarge = (path) => new Failed({
|
|
1624
1641
|
class: "limit",
|
|
@@ -1631,6 +1648,31 @@ const bareId = (value) => /^\d+$/.test(value) || isApiMessageId(value);
|
|
|
1631
1648
|
const isMessageRef = (value) => /^#[^\s/]+$/.test(value) || bareId(value);
|
|
1632
1649
|
/** A message's ID as it's passed back: bare when it goes bare, `#<id>` when it could be a channel's name. */
|
|
1633
1650
|
const messageRef = (id) => bareId(id) ? id : `#${id}`;
|
|
1651
|
+
/**
|
|
1652
|
+
* A thread's replies as `--after` and `--label` narrow them, from the replies its read answered: those after the
|
|
1653
|
+
* message `--after` names, which is one of the thread's, and those that wear every `--label`, or whose root does.
|
|
1654
|
+
*/
|
|
1655
|
+
function narrowedReplies(thread, cut) {
|
|
1656
|
+
let replies = thread.replies;
|
|
1657
|
+
if (flags.after !== void 0) {
|
|
1658
|
+
const id = flags.after.replace(/^#/, "");
|
|
1659
|
+
const at = [thread.message, ...replies].findIndex((message) => message.id === id);
|
|
1660
|
+
if (at === -1 && cut.after) throw usage(`--after ${flags.after} isn't a message of this thread. On one thread, it takes one of its messages.`);
|
|
1661
|
+
if (at !== -1) replies = replies.slice(at);
|
|
1662
|
+
}
|
|
1663
|
+
const labels = (flags.label ?? []).map((label) => {
|
|
1664
|
+
const eq = label.indexOf("=");
|
|
1665
|
+
return eq === -1 ? {
|
|
1666
|
+
key: label,
|
|
1667
|
+
values: null
|
|
1668
|
+
} : {
|
|
1669
|
+
key: label.slice(0, eq),
|
|
1670
|
+
values: label.slice(eq + 1).split("|")
|
|
1671
|
+
};
|
|
1672
|
+
});
|
|
1673
|
+
const wears = (message, { key, values }) => Object.hasOwn(message.labels, key) && (values === null || values.includes(message.labels[key]));
|
|
1674
|
+
return replies.filter((reply) => labels.every((label) => wears(reply, label) || wears(thread.message, label)));
|
|
1675
|
+
}
|
|
1634
1676
|
/** `--if-revision N`, as an edit or a delete takes it. */
|
|
1635
1677
|
function ifRevision() {
|
|
1636
1678
|
const given = flags["if-revision"];
|
|
@@ -2160,8 +2202,16 @@ function failureOf(error) {
|
|
|
2160
2202
|
...theirs("limit", "payload_too_large", `Can't ${doing()}. A message's text is at most ${MESSAGE_TEXT_MAX.toLocaleString("en-US")} characters.`, [{ instruction: current.command === "edit" ? "Keep the edit short, and reply with the long part in a file with --attach" : current.command === "tasks" ? "Keep it short, and reply to the task with the long part in a file with --attach" : "Put the long part in a file and --attach it, with a short summary as the text" }]),
|
|
2161
2203
|
details: []
|
|
2162
2204
|
};
|
|
2205
|
+
if (code === "too_many_boards") return theirs("limit", code, `Can't ${doing()}. The team has all the boards it can.`, flags.name !== void 0 ? [{
|
|
2206
|
+
instruction: "Use the team's board instead",
|
|
2207
|
+
argv: rerunWithout(["--name"]).filter((arg) => arg !== "--ensure")
|
|
2208
|
+
}] : process.env.BOARD_NAME ? [{
|
|
2209
|
+
instruction: "Use the team's board instead: unset BOARD_NAME, then run",
|
|
2210
|
+
argv: rerunWithout([]).filter((arg) => arg !== "--ensure")
|
|
2211
|
+
}] : []);
|
|
2212
|
+
if (code === "private_boards_unavailable") return theirs("limit", code, `Can't ${doing()}. This team's plan has no private boards.`, [{ instruction: "Keep the board open to the whole team, or move the team to a plan with private boards" }]);
|
|
2163
2213
|
if (status === 400) return theirs("usage", specific("invalid_arguments"), `Can't ${doing()}.`);
|
|
2164
|
-
if (status === 401) return theirs("auth", "login_required", "The board didn't accept your credentials.", sent() === "the token you passed" ? [{ instruction: "Pass a token it accepts" }] :
|
|
2214
|
+
if (status === 401) return theirs("auth", "login_required", "The board didn't accept your credentials.", sent() === "the token you passed" ? [{ instruction: "Pass a token it accepts" }] : sent() === "BOARD_TOKEN" ? [{ instruction: "Pass a token it accepts in BOARD_TOKEN, or unset it" }] : [{
|
|
2165
2215
|
instruction: "Log in again",
|
|
2166
2216
|
argv: ["vercel", "login"]
|
|
2167
2217
|
}]);
|
|
@@ -2544,11 +2594,21 @@ async function run(command, args) {
|
|
|
2544
2594
|
} else out(created ? `created ${channel.path}` : `${channel.path} already exists`);
|
|
2545
2595
|
return 0;
|
|
2546
2596
|
}
|
|
2547
|
-
if (sub !== void 0 && sub !== "list") throw usage(`Unknown command ${sub} for ${named()} channels.`, { reason: "unknown_command" });
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
if (flags.
|
|
2551
|
-
|
|
2597
|
+
if (sub !== void 0 && sub !== "list" && rest.length > 0) throw usage(`Unknown command ${sub} for ${named()} channels.`, { reason: "unknown_command" });
|
|
2598
|
+
const [prefix, extra] = sub === "list" ? rest : args;
|
|
2599
|
+
if (extra !== void 0) throw usage(`channels list takes one prefix: ${extra} is one too many.`);
|
|
2600
|
+
if (flags.limit !== void 0 && !(/^[1-9]\d*$/.test(flags.limit) && Number(flags.limit) <= 500)) throw usage(`--limit takes 1 to 500 channels, and ${flags.limit} isn't one.`);
|
|
2601
|
+
const listed = await client().channels({
|
|
2602
|
+
...prefix !== void 0 ? { prefix } : {},
|
|
2603
|
+
...flags.limit !== void 0 ? { limit: Number(flags.limit) } : {},
|
|
2604
|
+
...flags.after !== void 0 ? { after: flags.after } : {}
|
|
2605
|
+
});
|
|
2606
|
+
if (flags.json) return result({
|
|
2607
|
+
channels: listed.channels,
|
|
2608
|
+
next: listed.next
|
|
2609
|
+
}), 0;
|
|
2610
|
+
const channels = [...listed.channels].sort((a, b) => a.path < b.path ? -1 : a.path > b.path ? 1 : 0);
|
|
2611
|
+
if (channels.length === 0) return out(prefix === void 0 && flags.after === void 0 ? "no channels yet" : `no channels${prefix !== void 0 ? ` under ${prefix}` : ""}${flags.after !== void 0 ? " after that page" : ""}`), 0;
|
|
2552
2612
|
let group = "";
|
|
2553
2613
|
for (const channel of channels) {
|
|
2554
2614
|
const prefix = channel.path.includes("/") ? channel.path.slice(0, channel.path.lastIndexOf("/") + 1) : "";
|
|
@@ -2561,6 +2621,7 @@ async function run(command, args) {
|
|
|
2561
2621
|
const counted = threads !== void 0 && messages !== void 0 ? ` ${count(threads, "thread", "threads")} · ${count(messages, "message", "messages")}${lastIndex ? ` · last #${lastIndex}` : ""}` : "";
|
|
2562
2622
|
out(`${prefix ? " " : ""}${channel.path}${counted}`);
|
|
2563
2623
|
}
|
|
2624
|
+
if (listed.next !== null) out(`\n(more not shown: ${commandLine(rerunWithout(["--after"], "--after", listed.next))})`);
|
|
2564
2625
|
return 0;
|
|
2565
2626
|
}
|
|
2566
2627
|
case "actors": {
|
|
@@ -2574,14 +2635,23 @@ async function run(command, args) {
|
|
|
2574
2635
|
const board = client();
|
|
2575
2636
|
const link = target !== void 0 && /^https?:\/\//i.test(target);
|
|
2576
2637
|
if (target && (link || isMessageRef(target))) {
|
|
2577
|
-
const
|
|
2638
|
+
const across = [
|
|
2639
|
+
"by",
|
|
2640
|
+
"text",
|
|
2641
|
+
"mentions",
|
|
2642
|
+
"source",
|
|
2643
|
+
"re",
|
|
2644
|
+
"before"
|
|
2645
|
+
].find((name) => flags[name] !== void 0);
|
|
2646
|
+
if (across !== void 0) throw usage(`Can't use --${across} on one thread. It's read whole: --after and --label narrow its replies.`);
|
|
2647
|
+
const after = !link && flags.after !== void 0 ? flags.after.replace(/^#/, "") : void 0;
|
|
2648
|
+
const thread = link ? await board.linked(target) : await board.thread(messageId(target), after !== void 0 && isMessageRef(after) ? { after: messageId(after) } : {}).catch((error) => {
|
|
2649
|
+
if (error instanceof BoardError && error.status === 400 && /isn't a message of this thread/.test(error.message)) throw usage(`--after ${flags.after} isn't a message of this thread. On one thread, it takes one of its messages.`);
|
|
2650
|
+
throw error;
|
|
2651
|
+
});
|
|
2578
2652
|
if (link && !Array.isArray(thread.replies)) throw outdated("This board can't read links.");
|
|
2579
|
-
const narrowed =
|
|
2580
|
-
const replies = narrowed ? (
|
|
2581
|
-
...filters(),
|
|
2582
|
-
re: thread.message.id,
|
|
2583
|
-
limit: 500
|
|
2584
|
-
})).messages.filter((m) => m.re !== null) : thread.replies;
|
|
2653
|
+
const narrowed = flags.after !== void 0 || (flags.label?.length ?? 0) > 0;
|
|
2654
|
+
const replies = narrowed ? narrowedReplies(thread, { after: link || after === void 0 || !isMessageRef(after) }) : thread.replies;
|
|
2585
2655
|
if (flags.json) return result({
|
|
2586
2656
|
...thread,
|
|
2587
2657
|
replies
|
|
@@ -2601,9 +2671,11 @@ async function run(command, args) {
|
|
|
2601
2671
|
return 0;
|
|
2602
2672
|
}
|
|
2603
2673
|
const limit = flags.limit ? Number(flags.limit) : 50;
|
|
2604
|
-
|
|
2674
|
+
if (flags.before !== void 0 && flags.after !== void 0) throw usage("Can't use --before with --after. One pages back, the other reads forward.");
|
|
2675
|
+
const peek = !(target !== void 0 && !target.endsWith("/") && Object.keys(filters()).length === 0) && !flags.json && flags.before === void 0 && Number.isInteger(limit) && limit >= 1 && limit < 500;
|
|
2605
2676
|
const query = {
|
|
2606
2677
|
...filters(target),
|
|
2678
|
+
...flags.before !== void 0 ? { before: flags.before } : {},
|
|
2607
2679
|
...peek ? { limit: limit + 1 } : flags.limit ? { limit } : {}
|
|
2608
2680
|
};
|
|
2609
2681
|
const old = outdated("This board can't list threads.");
|
|
@@ -2611,13 +2683,14 @@ async function run(command, args) {
|
|
|
2611
2683
|
throw error instanceof BoardError && error.status === 404 && /^no route: /.test(error.message) ? old : error;
|
|
2612
2684
|
});
|
|
2613
2685
|
if (!Array.isArray(listed.threads)) throw old;
|
|
2614
|
-
const
|
|
2686
|
+
const older = !peek && typeof listed.older === "string" ? listed.older : void 0;
|
|
2687
|
+
const more = peek ? listed.threads.length > limit : listed.older === null ? false : older !== void 0 || listed.threads.length === limit;
|
|
2615
2688
|
const page = listed.threads.length > limit ? {
|
|
2616
2689
|
...listed,
|
|
2617
2690
|
threads: flags.after !== void 0 ? listed.threads.slice(0, limit) : listed.threads.slice(-limit)
|
|
2618
2691
|
} : listed;
|
|
2619
2692
|
if (!page.threads.length && target) {
|
|
2620
|
-
const channels = (await board
|
|
2693
|
+
const channels = (await everyChannel(board)).map((c) => c.path);
|
|
2621
2694
|
if (!channels.some((path) => path === target || path.startsWith(target.replace(/\/?$/, "/")))) {
|
|
2622
2695
|
const guess = closest(target, channels);
|
|
2623
2696
|
throw new Failed({
|
|
@@ -2655,10 +2728,11 @@ async function run(command, args) {
|
|
|
2655
2728
|
"text"
|
|
2656
2729
|
].some((key) => key in query)) out(`\nmore since then: ${commandLine(rerunWithout(["--after"], "--after", (latest.last ?? latest.message).id))}`);
|
|
2657
2730
|
else if (limit < 500) out(`\nmore since then: ${commandLine(rerunWithout(["--limit", "-n"], "--limit", String(Math.min(500, limit * 2))))}`);
|
|
2658
|
-
else out(`\n(more not shown: 500 is the most a read lists, so narrow it with --label
|
|
2731
|
+
else out(`\n(more not shown: 500 is the most a read lists, so narrow it with --label)`);
|
|
2659
2732
|
return 0;
|
|
2660
2733
|
}
|
|
2661
|
-
if (more) out(limit < 500 ? `\n(older not shown: ${commandLine(rerunWithout(["--limit", "-n"], "--limit", String(Math.min(500, limit * 2))))})` : `\n(older not shown: 500 is the most a read lists, so
|
|
2734
|
+
if (more) out(older !== void 0 ? `\n(older not shown: ${commandLine(rerunWithout(["--before"], "--before", older))})` : limit < 500 ? `\n(older not shown: ${commandLine(rerunWithout(["--limit", "-n"], "--limit", String(Math.min(500, limit * 2))))})` : `\n(older not shown: 500 is the most a read lists, so read one channel and page back with --before, or narrow it with --label)`);
|
|
2735
|
+
if (flags.before !== void 0) return 0;
|
|
2662
2736
|
out(`\nnew since then: ${commandLine(rerunWithout(["--after"], "--after", String(page.cursor)))}`);
|
|
2663
2737
|
return 0;
|
|
2664
2738
|
}
|
|
@@ -3037,8 +3111,14 @@ async function run(command, args) {
|
|
|
3037
3111
|
if (args[1] === "-") return io.write(data), 0;
|
|
3038
3112
|
const disposition = response.headers.get("content-disposition") ?? "";
|
|
3039
3113
|
const filename = /filename\*=UTF-8''([^;]+)/.exec(disposition)?.[1];
|
|
3040
|
-
const
|
|
3041
|
-
|
|
3114
|
+
const saveAs = basename(filename ? decodeURIComponent(filename) : id).replace(INVISIBLE, "").replace(/^[.\s]+/, "");
|
|
3115
|
+
const path = args[1] ?? (saveAs || id);
|
|
3116
|
+
try {
|
|
3117
|
+
await io.writeFile(path, data, { exclusive: args[1] === void 0 });
|
|
3118
|
+
} catch (error) {
|
|
3119
|
+
if (error.code === "EEXIST") throw exists(path);
|
|
3120
|
+
throw error;
|
|
3121
|
+
}
|
|
3042
3122
|
if (flags.json) result({
|
|
3043
3123
|
attachment: { id },
|
|
3044
3124
|
path,
|
|
@@ -3096,7 +3176,8 @@ async function run(command, args) {
|
|
|
3096
3176
|
try {
|
|
3097
3177
|
for await (const event of client().events({
|
|
3098
3178
|
...filters(args[0]),
|
|
3099
|
-
...flags.all ? { all: true } : {}
|
|
3179
|
+
...flags.all ? { all: true } : {},
|
|
3180
|
+
...flags.last !== void 0 ? { last: Number(flags.last) } : {}
|
|
3100
3181
|
}, { signal: controller.signal })) if (flags.json) line(event);
|
|
3101
3182
|
else out(formatEvent(event));
|
|
3102
3183
|
} finally {
|
|
@@ -3530,7 +3611,7 @@ async function tasks(args) {
|
|
|
3530
3611
|
limit
|
|
3531
3612
|
});
|
|
3532
3613
|
if (page.tasks.length === 0 && verb && flags.after === void 0) {
|
|
3533
|
-
const channels = (await board
|
|
3614
|
+
const channels = (await everyChannel(board)).map((c) => c.path);
|
|
3534
3615
|
const name = verb.replace(/\/$/, "");
|
|
3535
3616
|
if (!channels.some((path) => path === name || path.startsWith(`${name}/`))) {
|
|
3536
3617
|
const meant = closest(verb, TASK_VERBS);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as sqlTables } from "./sql-
|
|
1
|
+
import { r as sqlTables } from "./sql-D0MqINA6.mjs";
|
|
2
2
|
import { t as memory$1 } from "./store-memory-CKQVEzXN.mjs";
|
|
3
|
-
import { t as sqliteDb } from "./sqlite-db-
|
|
3
|
+
import { t as sqliteDb } from "./sqlite-db-DjbTlUwN.mjs";
|
|
4
4
|
//#region src/store/memory.ts
|
|
5
5
|
/**
|
|
6
6
|
* A board that lives in memory, for tests: its log in A2's memory store, its
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as NewLabels, m as MESSAGE_TEXT_MAX } from "./schemas-CUSTEFIy.mjs";
|
|
2
|
-
import { t as HttpError } from "./errors-
|
|
2
|
+
import { t as HttpError } from "./errors-DbCKqGXp.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/client/ids.ts
|
|
5
5
|
const hex = (bytes) => Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
@@ -47,6 +47,17 @@ function typeOf(name) {
|
|
|
47
47
|
function fileName(name) {
|
|
48
48
|
return (name ?? "").split(/[\\/]/).pop().replace(/[\u0000-\u001f\u007f]/g, "").trim().slice(0, 255) || "file";
|
|
49
49
|
}
|
|
50
|
+
/** Characters a name can't hold: invisible formatting (bidi overrides, zero-width), and line and paragraph separators. */
|
|
51
|
+
const INVISIBLE = /[\p{Cf}\u2028\u2029]/u;
|
|
52
|
+
/** Why a stored name can't be `name`, which `fileName` gave: a dotfile, or one that shows other than it reads. */
|
|
53
|
+
function fileNameProblem(name) {
|
|
54
|
+
if (name.startsWith(".")) return `attachment names can't start with a dot: ${JSON.stringify(name)}`;
|
|
55
|
+
if (INVISIBLE.test(name)) return `attachment names can't hold invisible formatting characters: ${JSON.stringify(name)}`;
|
|
56
|
+
}
|
|
57
|
+
/** A platform's file name as sync brings it over: without a leading dot or invisible characters, which no one is there to rename. */
|
|
58
|
+
function importedFileName(name) {
|
|
59
|
+
return fileName(fileName(name).replace(new RegExp(INVISIBLE.source, "gu"), "").replace(/^[.\s]+/, ""));
|
|
60
|
+
}
|
|
50
61
|
/** `image/png`, or `application/octet-stream` when the type isn't one. */
|
|
51
62
|
function mediaType(type) {
|
|
52
63
|
const value = (type ?? "").split(";")[0].trim().toLowerCase();
|
|
@@ -160,4 +171,4 @@ function parseProfileHeader(value) {
|
|
|
160
171
|
};
|
|
161
172
|
}
|
|
162
173
|
//#endregion
|
|
163
|
-
export { DIRECT_UPLOAD_BYTES_MAX as a,
|
|
174
|
+
export { DIRECT_UPLOAD_BYTES_MAX as a, fileNameProblem as c, mediaType as d, typeOf as f, ATTACHMENT_BYTES_MAX as i, fileSize as l, formatProfileHeader as n, IMPORT_BYTES_MAX as o, parseProfileHeader as r, fileName as s, InvalidProfileHeader as t, importedFileName as u };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as BoardClient } from "./client-
|
|
1
|
+
import { Ft as SourceJoin, Gn as ExternalEvent, Jn as Link, Kn as ExternalFile, Rn as Actor, Rt as SourceRead, Wn as ExternalAuthor, qn as ExternalLink, s as BoardEventView, st as MessageView } from "./routes-ChGBn0K3.mjs";
|
|
2
|
+
import { t as BoardClient } from "./client-C4-r10SA.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/contract/bots.d.ts
|
|
5
5
|
/**
|
|
@@ -516,6 +516,8 @@ type ProviderPost = {
|
|
|
516
516
|
files?: ProviderFile[];
|
|
517
517
|
as?: ProviderSender;
|
|
518
518
|
deployments?: VercelDeployment[];
|
|
519
|
+
/** Written on another platform, not on the board: markup in it that notifies people here is the platform's to keep inert. */
|
|
520
|
+
external?: boolean;
|
|
519
521
|
};
|
|
520
522
|
type ProviderDelivery = {
|
|
521
523
|
thread: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as DIRECT_UPLOAD_BYTES_MAX } from "./profile-header-
|
|
1
|
+
import { a as DIRECT_UPLOAD_BYTES_MAX } from "./profile-header-O8wC8yk8.mjs";
|
|
2
2
|
import { C as SentTaskNote, M as platformAvatar, N as storable, S as SentTaskHoldKind, _ as NewLabels, c as EDITED_HOLD, d as LabelKey, f as LabelValue, g as MessageText, k as TaskState, l as Emoji, m as MESSAGE_TEXT_MAX, o as CHANNEL_PATTERN_MAX, p as Labels, r as AttachmentId, s as ChannelPath, t as ActorId, w as SentText } from "./schemas-CUSTEFIy.mjs";
|
|
3
|
-
import { a as Link, i as ExternalTarget, n as ExternalEvent, o as Origin, t as ExternalAuthor } from "./external-
|
|
3
|
+
import { a as Link, i as ExternalTarget, n as ExternalEvent, o as Origin, t as ExternalAuthor } from "./external-DkWafjn-.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/api/routes.ts
|
|
6
6
|
/**
|
|
@@ -33,7 +33,7 @@ const ResolvedSyncTarget = z.object({
|
|
|
33
33
|
target: ExternalTarget,
|
|
34
34
|
kind: z.enum(["channel", "thread"])
|
|
35
35
|
});
|
|
36
|
-
/** Shared by `/
|
|
36
|
+
/** Shared by `/threads` and `/events`. */
|
|
37
37
|
const Filters = z.object({
|
|
38
38
|
channel: z.string().optional(),
|
|
39
39
|
re: id.optional(),
|
|
@@ -48,9 +48,31 @@ const Filters = z.object({
|
|
|
48
48
|
/** Case-insensitive words the text contains. */
|
|
49
49
|
text: z.string().min(1).max(200).optional()
|
|
50
50
|
});
|
|
51
|
-
|
|
51
|
+
/**
|
|
52
|
+
* One channel's messages across its threads, oldest first: the newest `limit`, or with `after`, a cursor a read of
|
|
53
|
+
* this channel answered, the ones posted since. The channel is one channel by its whole name, never a pattern: a board
|
|
54
|
+
* lists no messages across channels.
|
|
55
|
+
*/
|
|
56
|
+
const ChannelMessagesQuery = z.strictObject({
|
|
57
|
+
channel: ChannelPath,
|
|
52
58
|
after: Ref.optional(),
|
|
53
|
-
|
|
59
|
+
limit: z.coerce.number().int().min(1).max(500).optional()
|
|
60
|
+
});
|
|
61
|
+
/**
|
|
62
|
+
* A page of the board's channels: those whose path starts with `prefix` (`dev/` is every channel under `dev`, and
|
|
63
|
+
* not `dev` itself), `limit` of them, after a page's `next`.
|
|
64
|
+
*/
|
|
65
|
+
const ChannelsQuery = z.strictObject({
|
|
66
|
+
prefix: z.string().min(1).max(501).optional(),
|
|
67
|
+
after: z.string().min(1).max(1024).optional(),
|
|
68
|
+
limit: z.coerce.number().int().min(1).max(500).optional()
|
|
69
|
+
});
|
|
70
|
+
/**
|
|
71
|
+
* A thread read in part: the root, and of its replies the ones after one of its messages (`after`), `limit` of
|
|
72
|
+
* them. With `after` they're the first after it, to read on from; without, the newest.
|
|
73
|
+
*/
|
|
74
|
+
const ThreadQuery = z.strictObject({
|
|
75
|
+
after: id.optional(),
|
|
54
76
|
limit: z.coerce.number().int().min(1).max(500).optional()
|
|
55
77
|
});
|
|
56
78
|
/**
|
|
@@ -65,10 +87,18 @@ const ThreadsQuery = Filters.extend({
|
|
|
65
87
|
message: "`before` pages back from a page's `older`, and `after` reads forward: pass one",
|
|
66
88
|
path: ["before"]
|
|
67
89
|
});
|
|
90
|
+
/**
|
|
91
|
+
* A read of the feed after `after`, or from now. `last` reads its newest events instead, oldest first, with the
|
|
92
|
+
* feed's end as the cursor: it answers at once, so it takes no `after` or `wait`.
|
|
93
|
+
*/
|
|
68
94
|
const EventsQuery = Filters.extend({
|
|
69
95
|
after: Ref.optional(),
|
|
70
96
|
wait: z.coerce.number().min(0).max(300).optional(),
|
|
71
|
-
all: flag.optional()
|
|
97
|
+
all: flag.optional(),
|
|
98
|
+
last: z.coerce.number().int().min(1).max(100).optional()
|
|
99
|
+
}).refine((query) => query.last === void 0 || query.after === void 0 && query.wait === void 0, {
|
|
100
|
+
message: "`last` reads the newest events at once: it takes no `after` or `wait`",
|
|
101
|
+
path: ["last"]
|
|
72
102
|
});
|
|
73
103
|
const PostBody = z.object({
|
|
74
104
|
channel: ChannelPath.optional(),
|
|
@@ -668,7 +698,8 @@ const routes = {
|
|
|
668
698
|
},
|
|
669
699
|
channels: {
|
|
670
700
|
method: "GET",
|
|
671
|
-
path: "/channels"
|
|
701
|
+
path: "/channels",
|
|
702
|
+
query: ChannelsQuery
|
|
672
703
|
},
|
|
673
704
|
/** Makes a channel before anything posts to it: needs `read` and `post` there. One that's there already is left as it is. */
|
|
674
705
|
createChannel: {
|
|
@@ -680,14 +711,16 @@ const routes = {
|
|
|
680
711
|
method: "GET",
|
|
681
712
|
path: "/actors"
|
|
682
713
|
},
|
|
683
|
-
messages:
|
|
714
|
+
/** One channel's messages across its threads: the newest, or those after one of its cursors. */
|
|
715
|
+
channelMessages: {
|
|
684
716
|
method: "GET",
|
|
685
717
|
path: "/messages",
|
|
686
|
-
query:
|
|
718
|
+
query: ChannelMessagesQuery
|
|
687
719
|
},
|
|
688
720
|
message: {
|
|
689
721
|
method: "GET",
|
|
690
|
-
path: "/messages/:id"
|
|
722
|
+
path: "/messages/:id",
|
|
723
|
+
query: ThreadQuery
|
|
691
724
|
},
|
|
692
725
|
/** Threads with a matching message, one summary each, by latest activity. `before` takes a page's `older`. */
|
|
693
726
|
threads: {
|
|
@@ -1031,4 +1064,4 @@ const routes = {
|
|
|
1031
1064
|
}
|
|
1032
1065
|
};
|
|
1033
1066
|
//#endregion
|
|
1034
|
-
export {
|
|
1067
|
+
export { routes as $, ReactBody as A, SourceReadQuery as B, InboxNextQuery as C, LinkedQuery as D, LabelBody as E, RevokeGrantBody as F, SyncReceiptBody as G, SyncCopiesQuery as H, ScheduleBody as I, ThreadQuery as J, TaskNeedsBody as K, SchedulesQuery as L, RegisterBody as M, ReleaseTaskBody as N, MatchesQuery as O, RenewTaskBody as P, UploadStartBody as Q, SchemaBody as R, InboxAckBody as S, InboxQuery as T, SyncFindQuery as U, SyncBody as V, SyncImportBody as W, TypingBody as X, ThreadsQuery as Y, UpdateGrantBody as Z, EventsQuery as _, ChannelMessagesQuery as a, Filters as b, ClaimTaskBody as c, CreateGrantsBody as d, CreateTaskBody as f, EditBody as g, DeleteBody as h, CancelTaskBody as i, Ref as j, PostBody as k, CompleteTaskBody as l, CreatedTasksQuery as m, AssignTaskBody as n, ChannelsQuery as o, CreateTasksBody as p, TasksQuery as q, BlockTaskBody as r, ClaimReadyTaskBody as s, AckBody as t, CreateChannelBody as u, ExplainQuery as v, InboxPushBody as w, GrantBody as x, FailTaskBody as y, SourceJoinBody as z };
|
|
@@ -901,7 +901,7 @@ declare const ResolvedSyncTarget: z.ZodObject<{
|
|
|
901
901
|
thread: "thread";
|
|
902
902
|
}>;
|
|
903
903
|
}, z.core.$strip>;
|
|
904
|
-
/** Shared by `/
|
|
904
|
+
/** Shared by `/threads` and `/events`. */
|
|
905
905
|
declare const Filters: z.ZodObject<{
|
|
906
906
|
channel: z.ZodOptional<z.ZodString>;
|
|
907
907
|
re: z.ZodOptional<z.ZodString>;
|
|
@@ -913,18 +913,36 @@ declare const Filters: z.ZodObject<{
|
|
|
913
913
|
}, z.core.$strip>;
|
|
914
914
|
/** The filters a query asks for, as the board parsed them. */
|
|
915
915
|
type ParsedFilters = z.output<typeof Filters>;
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
text: z.ZodOptional<z.ZodString>;
|
|
916
|
+
/**
|
|
917
|
+
* One channel's messages across its threads, oldest first: the newest `limit`, or with `after`, a cursor a read of
|
|
918
|
+
* this channel answered, the ones posted since. The channel is one channel by its whole name, never a pattern: a board
|
|
919
|
+
* lists no messages across channels.
|
|
920
|
+
*/
|
|
921
|
+
declare const ChannelMessagesQuery: z.ZodObject<{
|
|
922
|
+
channel: z.ZodString;
|
|
924
923
|
after: z.ZodOptional<z.ZodString>;
|
|
925
|
-
before: z.ZodOptional<z.ZodString>;
|
|
926
924
|
limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
927
|
-
}, z.core.$
|
|
925
|
+
}, z.core.$strict>;
|
|
926
|
+
/** How many channels a list answers without a `limit`, and with one at most. */
|
|
927
|
+
declare const CHANNELS_LIMIT_DEFAULT = 100;
|
|
928
|
+
declare const CHANNELS_LIMIT_MAX = 500;
|
|
929
|
+
/**
|
|
930
|
+
* A page of the board's channels: those whose path starts with `prefix` (`dev/` is every channel under `dev`, and
|
|
931
|
+
* not `dev` itself), `limit` of them, after a page's `next`.
|
|
932
|
+
*/
|
|
933
|
+
declare const ChannelsQuery: z.ZodObject<{
|
|
934
|
+
prefix: z.ZodOptional<z.ZodString>;
|
|
935
|
+
after: z.ZodOptional<z.ZodString>;
|
|
936
|
+
limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
937
|
+
}, z.core.$strict>;
|
|
938
|
+
/**
|
|
939
|
+
* A thread read in part: the root, and of its replies the ones after one of its messages (`after`), `limit` of
|
|
940
|
+
* them. With `after` they're the first after it, to read on from; without, the newest.
|
|
941
|
+
*/
|
|
942
|
+
declare const ThreadQuery: z.ZodObject<{
|
|
943
|
+
after: z.ZodOptional<z.ZodString>;
|
|
944
|
+
limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
945
|
+
}, z.core.$strict>;
|
|
928
946
|
/** How many threads a read lists without a `limit`, and with one at most. */
|
|
929
947
|
declare const THREADS_LIMIT_DEFAULT = 50;
|
|
930
948
|
declare const THREADS_LIMIT_MAX = 500;
|
|
@@ -944,6 +962,12 @@ declare const ThreadsQuery: z.ZodObject<{
|
|
|
944
962
|
before: z.ZodOptional<z.ZodString>;
|
|
945
963
|
limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
946
964
|
}, z.core.$strip>;
|
|
965
|
+
/** The most of a feed's newest events one read answers for (`last`). */
|
|
966
|
+
declare const EVENTS_LAST_MAX = 100;
|
|
967
|
+
/**
|
|
968
|
+
* A read of the feed after `after`, or from now. `last` reads its newest events instead, oldest first, with the
|
|
969
|
+
* feed's end as the cursor: it answers at once, so it takes no `after` or `wait`.
|
|
970
|
+
*/
|
|
947
971
|
declare const EventsQuery: z.ZodObject<{
|
|
948
972
|
channel: z.ZodOptional<z.ZodString>;
|
|
949
973
|
re: z.ZodOptional<z.ZodString>;
|
|
@@ -960,6 +984,7 @@ declare const EventsQuery: z.ZodObject<{
|
|
|
960
984
|
false: "false";
|
|
961
985
|
true: "true";
|
|
962
986
|
}>, z.ZodTransform<boolean, "0" | "1" | "false" | "true">>>;
|
|
987
|
+
last: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
963
988
|
}, z.core.$strip>;
|
|
964
989
|
declare const PostBody: z.ZodObject<{
|
|
965
990
|
channel: z.ZodOptional<z.ZodString>;
|
|
@@ -1830,7 +1855,9 @@ type FiltersInput = z.input<typeof Filters>;
|
|
|
1830
1855
|
type SyncImportInput = z.input<typeof SyncImportBody>;
|
|
1831
1856
|
type SyncReceiptInput = z.input<typeof SyncReceiptBody>;
|
|
1832
1857
|
type SyncFindInput = z.input<typeof SyncFindQuery>;
|
|
1833
|
-
type
|
|
1858
|
+
type ChannelMessagesQueryInput = z.input<typeof ChannelMessagesQuery>;
|
|
1859
|
+
type ThreadQueryInput = z.input<typeof ThreadQuery>;
|
|
1860
|
+
type ChannelsQueryInput = z.input<typeof ChannelsQuery>;
|
|
1834
1861
|
type ThreadsQueryInput = z.input<typeof ThreadsQuery>;
|
|
1835
1862
|
type EventsQueryInput = z.input<typeof EventsQuery>;
|
|
1836
1863
|
type PostInput = z.input<typeof PostBody>;
|
|
@@ -2202,6 +2229,12 @@ type InboxItem = {
|
|
|
2202
2229
|
type ChannelView = {
|
|
2203
2230
|
path: string;
|
|
2204
2231
|
} & Partial<Omit<Channel, 'path'>>;
|
|
2232
|
+
/** A page of channels. `next` reads the page after it, as `after`: null when this is the last. `cursor` is where the board is now. */
|
|
2233
|
+
type ChannelsPage = {
|
|
2234
|
+
channels: ChannelView[];
|
|
2235
|
+
cursor: string;
|
|
2236
|
+
next: string | null;
|
|
2237
|
+
};
|
|
2205
2238
|
type MessagesPage = {
|
|
2206
2239
|
messages: MessageView[];
|
|
2207
2240
|
cursor: string;
|
|
@@ -2330,6 +2363,11 @@ declare const routes: {
|
|
|
2330
2363
|
readonly channels: {
|
|
2331
2364
|
readonly method: 'GET';
|
|
2332
2365
|
readonly path: '/channels';
|
|
2366
|
+
readonly query: z.ZodObject<{
|
|
2367
|
+
prefix: z.ZodOptional<z.ZodString>;
|
|
2368
|
+
after: z.ZodOptional<z.ZodString>;
|
|
2369
|
+
limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
2370
|
+
}, z.core.$strict>;
|
|
2333
2371
|
};
|
|
2334
2372
|
/** Makes a channel before anything posts to it: needs `read` and `post` there. One that's there already is left as it is. */
|
|
2335
2373
|
readonly createChannel: {
|
|
@@ -2343,25 +2381,23 @@ declare const routes: {
|
|
|
2343
2381
|
readonly method: 'GET';
|
|
2344
2382
|
readonly path: '/actors';
|
|
2345
2383
|
};
|
|
2346
|
-
|
|
2384
|
+
/** One channel's messages across its threads: the newest, or those after one of its cursors. */
|
|
2385
|
+
readonly channelMessages: {
|
|
2347
2386
|
readonly method: 'GET';
|
|
2348
2387
|
readonly path: '/messages';
|
|
2349
2388
|
readonly query: z.ZodObject<{
|
|
2350
|
-
channel: z.
|
|
2351
|
-
re: z.ZodOptional<z.ZodString>;
|
|
2352
|
-
by: z.ZodOptional<z.ZodString>;
|
|
2353
|
-
mentions: z.ZodOptional<z.ZodString>;
|
|
2354
|
-
label: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<string[], string | string[]>>, z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<readonly [string, null] | readonly [string, string[]], string>>>>>;
|
|
2355
|
-
from: z.ZodOptional<z.ZodString>;
|
|
2356
|
-
text: z.ZodOptional<z.ZodString>;
|
|
2389
|
+
channel: z.ZodString;
|
|
2357
2390
|
after: z.ZodOptional<z.ZodString>;
|
|
2358
|
-
before: z.ZodOptional<z.ZodString>;
|
|
2359
2391
|
limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
2360
|
-
}, z.core.$
|
|
2392
|
+
}, z.core.$strict>;
|
|
2361
2393
|
};
|
|
2362
2394
|
readonly message: {
|
|
2363
2395
|
readonly method: 'GET';
|
|
2364
2396
|
readonly path: '/messages/:id';
|
|
2397
|
+
readonly query: z.ZodObject<{
|
|
2398
|
+
after: z.ZodOptional<z.ZodString>;
|
|
2399
|
+
limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
2400
|
+
}, z.core.$strict>;
|
|
2365
2401
|
};
|
|
2366
2402
|
/** Threads with a matching message, one summary each, by latest activity. `before` takes a page's `older`. */
|
|
2367
2403
|
readonly threads: {
|
|
@@ -3313,6 +3349,7 @@ declare const routes: {
|
|
|
3313
3349
|
false: "false";
|
|
3314
3350
|
true: "true";
|
|
3315
3351
|
}>, z.ZodTransform<boolean, "0" | "1" | "false" | "true">>>;
|
|
3352
|
+
last: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
3316
3353
|
}, z.core.$strip>;
|
|
3317
3354
|
};
|
|
3318
3355
|
readonly avatar: {
|
|
@@ -3407,4 +3444,4 @@ declare const routes: {
|
|
|
3407
3444
|
};
|
|
3408
3445
|
type RouteName = keyof typeof routes;
|
|
3409
3446
|
//#endregion
|
|
3410
|
-
export {
|
|
3447
|
+
export { LABEL_CONDITIONS_MAX as $, THREADS_LIMIT_MAX as $t, Discovery as A, Level as An, SchedulesQueryInput as At, GRANT_BATCH_MAX as B, Attachment as Bn, SyncBody as Bt, CreateGrantsBody as C, ChannelPattern as Cn, RevokeGrantBody as Ct, CreateTasksInput as D, GrantChangeRefusal as Dn, ScheduleInput as Dt, CreateTasksBody as E, GrantChange as En, ScheduleBodyOutput as Et, EventsQueryInput as F, compileAccess as Fn, SourceJoin as Ft, GrantWriteOptions as G, ExternalEvent as Gn, SyncFindView as Gt, GrantCan as H, CAN_MAX as Hn, SyncCopiesView as Ht, ExplainQuery as I, parseCan as In, SourceJoinBody as It, InboxEntry as J, Link as Jn, SyncReceiptBody as Jt, INBOX_EVENT_ID_MAX as K, ExternalFile as Kn, SyncImportBody as Kt, Explanation as L, union as Ln, SourceMessage as Lt, EditBody as M, Permission as Mn, SchemaBody as Mt, EventsPage as N, WrittenCan as Nn, SchemaInput as Nt, CreatedTasksQuery as O, GrantShape as On, ScheduleView as Ot, EventsQuery as P, checkGrantChange as Pn, SchemaView as Pt, InboxQuery as Q, THREADS_LIMIT_DEFAULT as Qt, FailTaskBody as R, Actor as Rn, SourceRead as Rt, CreateChannelBody as S, Can as Sn, ResolvedSyncTarget as St, CreateTaskInput as T, Grant as Tn, ScheduleBody as Tt, GrantInput as U, Labels as Un, SyncFindInput as Ut, GrantBody as V, Author as Vn, SyncCopiesQuery as Vt, GrantView as W, ExternalAuthor as Wn, SyncFindQuery as Wt, InboxNextQuery as X, SyncThreadView as Xt, InboxItem as Y, SyncReceiptInput as Yt, InboxPushBody as Z, SyncedView as Zt, ChannelsQueryInput as _, UploadStartBody as _n, RegisterBody as _t, BlockTaskBody as a, TasksQueryInput as an, MatchesQuery as at, ClaimTaskBody as b, Access as bn, ReleaseTaskBody as bt, CHANNELS_LIMIT_DEFAULT as c, ThreadSummaryView as cn, MessagesPage as ct, CancelTaskBody as d, ThreadsQuery as dn, PostInput as dt, TaskClaim as en, LEASE_DEFAULT_S as et, ChannelMessagesQuery as f, ThreadsQueryInput as fn, PrincipalInput as ft, ChannelsQuery as g, UpdateGrantInput as gn, Ref as gt, ChannelsPage as h, UpdateGrantBody as hn, ReactBody as ht, AssignTaskBody as i, TasksQuery as in, MatchView as it, EVENTS_LAST_MAX as j, PERMISSIONS as jn, SchedulesQueryOutput as jt, DeleteBody as k, InvalidCan as kn, SchedulesQuery as kt, CHANNELS_LIMIT_MAX as l, ThreadView as ln, ParsedFilters as lt, ChannelView as m, TypingResult as mn, REGISTERED_WATCHERS_MAX as mt, ActorView as n, TaskView as nn, LinkView as nt, BlockView as o, ThreadQuery as on, Me as ot, ChannelMessagesQueryInput as p, TypingBody as pn, PrincipalView as pt, InboxAckBody as q, ExternalLink as qn, SyncImportInput as qt, ApiError as r, TasksPage as rn, LinkedQuery as rt, BoardEventView as s, ThreadQueryInput as sn, MessageView as st, AckBody as t, TaskNeedsBody as tn, LabelBody as tt, CanAt as u, ThreadsPage as un, PostBody as ut, ClaimReadyTaskBody as v, UploadTicket as vn, RegisterInput as vt, CreateTaskBody as w, FULL_ACCESS as wn, RouteName as wt, CompleteTaskBody as x, AccessSummary as xn, RenewTaskBody as xt, ClaimReadyTaskInput as y, routes as yn, RegistrationView as yt, FiltersInput as z, ExternalCopy as zn, SourceReadQuery as zt };
|