@vercel/board 0.58.0 → 0.59.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{backend-9H57DlQt.d.mts → backend-BtQfimL9.d.mts} +33 -15
- package/dist/backend-local.d.mts +1 -1
- package/dist/backend-local.mjs +1 -1
- package/dist/backend-postgres.d.mts +1 -1
- package/dist/backend-postgres.mjs +2 -2
- package/dist/{chat-provider-BiJ8G6KY.d.mts → chat-provider-CW-YpGWe.d.mts} +4 -3
- package/dist/{chat-provider-Br2RXgLV.mjs → chat-provider-eRYSL4XG.mjs} +4 -4
- package/dist/cli-commands.mjs +1 -1
- package/dist/cli-embedded.d.mts +2 -2
- package/dist/cli-embedded.mjs +2 -2
- package/dist/cli.mjs +6 -6
- package/dist/{commands-totPnoCC.mjs → commands-CkRYuvpd.mjs} +1 -0
- package/dist/conformance.d.mts +1 -1
- package/dist/{exports-WtqjdQwb.mjs → exports-CVn4-cJw.mjs} +9 -3
- package/dist/{exports-Bh09j6Bd.d.mts → exports-D87KpsSi.d.mts} +27 -2
- package/dist/index-CEhxdS5w.d.mts +19 -0
- package/dist/index.d.mts +9 -3
- package/dist/index.mjs +16 -4
- package/dist/index.node.d.mts +4 -4
- package/dist/index.node.mjs +3 -3
- package/dist/inspect/app.js +27 -27
- package/dist/inspect-Dpo80DCM.mjs +2 -0
- package/dist/{inspect-CtPZz0WG.mjs → inspect-FiqR2gH8.mjs} +2 -2
- package/dist/inspect.mjs +1 -1
- package/dist/{local-B7Yp-B2z.mjs → local-BEBMGqdU.mjs} +2 -2
- package/dist/{local-BPiDCkA4.mjs → local-PquD719G.mjs} +2 -2
- package/dist/{main-BvkLqpUX.mjs → main-CKjm9hso.mjs} +14 -8
- package/dist/{serve-ChlJ955x.mjs → serve-DwpXzLhp.mjs} +3 -3
- package/dist/{server-CRdVLqny.mjs → server-CKCAEME6.mjs} +18 -5
- package/dist/{shell-hTUuAc6A.mjs → shell-953VaBzO.mjs} +1 -1
- package/dist/sync-chat-sdk.d.mts +1 -1
- package/dist/sync-chat-sdk.mjs +1 -1
- package/dist/sync-github.d.mts +1 -1
- package/dist/sync-github.mjs +1 -1
- package/dist/sync-linear.d.mts +1 -1
- package/dist/sync-linear.mjs +1 -1
- package/dist/sync-slack.d.mts +21 -4
- package/dist/sync-slack.mjs +33 -2
- package/dist/{task-batch-CnRhVsh6.mjs → task-batch-BfE8TCBM.mjs} +2 -2
- package/dist/{version-rlZkE9nc.mjs → version-yDZzeoWl.mjs} +1 -1
- package/docs/01-board/01-mounting.md +16 -0
- package/docs/02-sync/03-slack.md +5 -0
- package/docs/02-sync/05-managed.md +2 -2
- package/docs/04-reference/01-cli.md +4 -4
- package/package.json +1 -1
- package/dist/index-mgNwCwJ4.d.mts +0 -11
- package/dist/inspect-wkA_8iyU.mjs +0 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as ATTACHMENT_BYTES_MAX, r as parseProfileHeader, t as InvalidProfileHeader } from "./profile-header-O8wC8yk8.mjs";
|
|
2
2
|
import "./schemas-CUSTEFIy.mjs";
|
|
3
|
-
import { t as Failed, u as who } from "./main-
|
|
4
|
-
import { n as relative, r as shell, t as CSP } from "./shell-
|
|
3
|
+
import { t as Failed, u as who } from "./main-CKjm9hso.mjs";
|
|
4
|
+
import { n as relative, r as shell, t as CSP } from "./shell-953VaBzO.mjs";
|
|
5
5
|
import { t as page } from "./page-7KWSGxyC.mjs";
|
|
6
6
|
import { randomBytes, timingSafeEqual } from "node:crypto";
|
|
7
7
|
import { createServer } from "node:http";
|
package/dist/inspect.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as ATTACHMENT_BYTES_MAX, r as parseProfileHeader, t as InvalidProfileHeader } from "./profile-header-O8wC8yk8.mjs";
|
|
2
2
|
import "./schemas-CUSTEFIy.mjs";
|
|
3
|
-
import { n as relative, r as shell, t as CSP } from "./shell-
|
|
3
|
+
import { n as relative, r as shell, t as CSP } from "./shell-953VaBzO.mjs";
|
|
4
4
|
import { t as page } from "./page-7KWSGxyC.mjs";
|
|
5
5
|
//#region src/inspect/handler.ts
|
|
6
6
|
/**
|
|
@@ -5,9 +5,9 @@ import { a as duplicateId, c as notFound, f as BoardError, i as batchTooLarge, l
|
|
|
5
5
|
import { a as SCHEMA_DESCRIPTION_MAX, c as canonical, d as parseSchemaId, f as schemaId, i as BUILT_IN_SCHEMAS, l as checkDefinition, n as blocksIn, o as SCHEMA_NAME, s as SCHEMA_VERSION_MAX, u as isBuiltInName } from "./blocks-CVoBC7ur.mjs";
|
|
6
6
|
import { i as mentionTerm, n as isEmail, o as mentionsIn, r as meTerms, s as replaceMentions, t as extractMentions } from "./mentions-DBGmqkr2.mjs";
|
|
7
7
|
import { a as waitUntil, c as platformProfile, d as userIdOf, l as shownName, n as MIDDLEWARE_ACTOR, o as actorParts, s as importedHandle, t as DroppedError } from "./middleware-DVBOEd8G.mjs";
|
|
8
|
-
import { t as VERSION } from "./version-
|
|
8
|
+
import { t as VERSION } from "./version-yDZzeoWl.mjs";
|
|
9
9
|
import { c as compileAccess, i as authorize, o as checkGrantChange, t as FULL_ACCESS, u as parseCan } from "./access-D1AHzFSP.mjs";
|
|
10
|
-
import { _ as uploadName, a as runMatch, g as carried, i as canonicalWatchers, n as SYNC_ACTOR, o as compileWatcher, r as syncTarget, s as hasCriteria, t as batchPlan, u as METHODS, v as SYNC } from "./task-batch-
|
|
10
|
+
import { _ as uploadName, a as runMatch, g as carried, i as canonicalWatchers, n as SYNC_ACTOR, o as compileWatcher, r as syncTarget, s as hasCriteria, t as batchPlan, u as METHODS, v as SYNC } from "./task-batch-BfE8TCBM.mjs";
|
|
11
11
|
import { n as setOwn, t as own } from "./own-OwgPWdmh.mjs";
|
|
12
12
|
import { E as wroteAs, T as workflowPath, b as removes, c as checkCan, g as joined, h as issuerName, l as checkGrant, n as GITHUB_ISSUER, p as grantIssuers, s as authenticates, u as checkPrincipal } from "./auth-Cc5_pdi7.mjs";
|
|
13
13
|
import { i as ownedActor, n as actorSeen, o as viaOf } from "./actors-CCth21rU.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as HttpError } from "./errors-Ce_-E3_C.mjs";
|
|
2
|
-
import { u as METHODS } from "./task-batch-
|
|
3
|
-
import { i as memoryBlob, n as a2, r as fsBlob, t as localScheduler } from "./local-
|
|
2
|
+
import { u as METHODS } from "./task-batch-BfE8TCBM.mjs";
|
|
3
|
+
import { i as memoryBlob, n as a2, r as fsBlob, t as localScheduler } from "./local-BEBMGqdU.mjs";
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
5
5
|
import { join, resolve } from "node:path";
|
|
6
6
|
//#region src/server/local.ts
|
|
@@ -5,12 +5,12 @@ import { n as displayEmoji, r as normalizeEmoji } from "./emoji-CTLpvH-A.mjs";
|
|
|
5
5
|
import { d as parseSchemaId, r as findBlocks, t as block } from "./blocks-CVoBC7ur.mjs";
|
|
6
6
|
import { n as isEmail, s as replaceMentions, t as extractMentions } from "./mentions-DBGmqkr2.mjs";
|
|
7
7
|
import { l as shownName } from "./middleware-DVBOEd8G.mjs";
|
|
8
|
-
import { t as VERSION } from "./version-
|
|
8
|
+
import { t as VERSION } from "./version-yDZzeoWl.mjs";
|
|
9
9
|
import { r as PERMISSIONS } from "./access-D1AHzFSP.mjs";
|
|
10
|
-
import { c as mentionValue, l as withMentions } from "./task-batch-
|
|
11
|
-
import { a as isBoardName, l as isApiMessageId, n as createTasksInChunks, s as apiThreadRoot, t as TasksInChunksError } from "./exports-
|
|
12
|
-
import { i as groups, n as filters$1, o as options, r as globalOptions, s as usage$1, t as commands } from "./commands-
|
|
13
|
-
import { a as
|
|
10
|
+
import { c as mentionValue, l as withMentions } from "./task-batch-BfE8TCBM.mjs";
|
|
11
|
+
import { a as isBoardName, l as isApiMessageId, n as createTasksInChunks, s as apiThreadRoot, t as TasksInChunksError } from "./exports-CVn4-cJw.mjs";
|
|
12
|
+
import { i as groups, n as filters$1, o as options, r as globalOptions, s as usage$1, t as commands } from "./commands-CkRYuvpd.mjs";
|
|
13
|
+
import { a as handProgram, c as http, d as configDir, f as connect, g as handToken, h as handLogin, i as credentialed, m as handFetch, o as handTeam, p as environmentProfile, r as credentialSource, s as vercel, t as board, u as boardUrl, y as vercelProjectFile } from "./server-CKCAEME6.mjs";
|
|
14
14
|
import { n as everyChannel, t as conformance } from "./conformance-D9XutDay.mjs";
|
|
15
15
|
import { n as displayText, t as byVercelBot } from "./bots-CqPYxkqK.mjs";
|
|
16
16
|
import { spawn } from "node:child_process";
|
|
@@ -1139,7 +1139,11 @@ function commandHelp(name, path) {
|
|
|
1139
1139
|
"",
|
|
1140
1140
|
...wrap(command.description, COLUMNS)
|
|
1141
1141
|
];
|
|
1142
|
-
if (command.aliases?.length) lines.push("", `also: ${command.aliases.map((alias) =>
|
|
1142
|
+
if (command.aliases?.length) lines.push("", `also: ${command.aliases.map((alias) => [
|
|
1143
|
+
name,
|
|
1144
|
+
...path.slice(0, -1).map((above) => above.name),
|
|
1145
|
+
alias
|
|
1146
|
+
].join(" ")).join(", ")}`);
|
|
1143
1147
|
const section = (title, entries) => {
|
|
1144
1148
|
if (entries.length) lines.push("", `${title}:`, ...rows(entries));
|
|
1145
1149
|
};
|
|
@@ -1174,7 +1178,7 @@ function commandPath(words, all) {
|
|
|
1174
1178
|
const command = all.find((candidate) => candidate.name === words[0] || candidate.aliases?.includes(words[0]));
|
|
1175
1179
|
if (!command) return null;
|
|
1176
1180
|
const at = command.argumentsBeforeSubcommand ? command.arguments.length + 1 : 1;
|
|
1177
|
-
const sub = command.subcommands?.find((candidate) => candidate.name === words[at]);
|
|
1181
|
+
const sub = command.subcommands?.find((candidate) => candidate.name === words[at] || candidate.aliases?.includes(words[at]));
|
|
1178
1182
|
return sub ? [command, sub] : [command];
|
|
1179
1183
|
}
|
|
1180
1184
|
//#endregion
|
|
@@ -5033,8 +5037,10 @@ async function runOnce(argv, options) {
|
|
|
5033
5037
|
out(help(positionals));
|
|
5034
5038
|
return 0;
|
|
5035
5039
|
}
|
|
5036
|
-
const [word, ...
|
|
5040
|
+
const [word, ...words] = positionals;
|
|
5037
5041
|
const command = canonical(word);
|
|
5042
|
+
const sub = subcommandOf(command);
|
|
5043
|
+
const args = sub && words[0] !== sub.name ? [sub.name, ...words.slice(1)] : words;
|
|
5038
5044
|
current = {
|
|
5039
5045
|
command,
|
|
5040
5046
|
args
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { f as BoardError, p as createBoardClient, t as HttpError } from "./errors-Ce_-E3_C.mjs";
|
|
2
|
-
import { i as hostCheckedBy } from "./exports-
|
|
2
|
+
import { i as hostCheckedBy } from "./exports-CVn4-cJw.mjs";
|
|
3
3
|
import { i as LOGINS, r as LOGIN } from "./auth-Cc5_pdi7.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { _ as localTokenFile, t as board } from "./server-CKCAEME6.mjs";
|
|
5
5
|
import { t as oidcTokens } from "./tokens-XagdeYrv.mjs";
|
|
6
|
-
import { t as local } from "./local-
|
|
6
|
+
import { t as local } from "./local-PquD719G.mjs";
|
|
7
7
|
import { mkdir, rename, rm, stat, writeFile } from "node:fs/promises";
|
|
8
8
|
import { userInfo } from "node:os";
|
|
9
9
|
import { dirname, join, resolve } from "node:path";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { n as formatProfileHeader } from "./profile-header-O8wC8yk8.mjs";
|
|
2
2
|
import "./schemas-CUSTEFIy.mjs";
|
|
3
3
|
import { Ct as routes, _ as DERIVED_ID, b as keyId, f as BoardError, g as refusalCode, p as createBoardClient, t as HttpError } from "./errors-Ce_-E3_C.mjs";
|
|
4
|
-
import { t as VERSION } from "./version-
|
|
5
|
-
import { o as compileWatcher, u as METHODS } from "./task-batch-
|
|
6
|
-
import { c as createVercel, d as withoutToken, f as tailWatchers, p as deployedOnVercel, r as createBoard, u as PROTOCOL_ROUTES } from "./exports-
|
|
4
|
+
import { t as VERSION } from "./version-yDZzeoWl.mjs";
|
|
5
|
+
import { o as compileWatcher, u as METHODS } from "./task-batch-BfE8TCBM.mjs";
|
|
6
|
+
import { c as createVercel, d as withoutToken, f as tailWatchers, p as deployedOnVercel, r as createBoard, u as PROTOCOL_ROUTES } from "./exports-CVn4-cJw.mjs";
|
|
7
7
|
import { execFile } from "node:child_process";
|
|
8
8
|
import { createHash } from "node:crypto";
|
|
9
9
|
import { mkdir, readFile, readdir, stat, unlink, writeFile } from "node:fs/promises";
|
|
@@ -1128,11 +1128,24 @@ function vercel(options = {}) {
|
|
|
1128
1128
|
*/
|
|
1129
1129
|
function board(options = {}) {
|
|
1130
1130
|
return createBoard(options, {
|
|
1131
|
-
backend: (fetch) => process.env.BOARD_URL?.trim() ? http() : vercel(
|
|
1131
|
+
backend: (fetch, id) => process.env.BOARD_URL?.trim() ? http() : vercel({
|
|
1132
|
+
...fetch ? { fetch } : {},
|
|
1133
|
+
...id ? { board: id } : {}
|
|
1134
|
+
}),
|
|
1132
1135
|
sync: () => import("./engine-DVWbcEIB.mjs"),
|
|
1133
1136
|
serving: () => import("./serving-BVtrFzK4.mjs"),
|
|
1134
1137
|
sandbox: (url, token) => sandboxHeaders(url, url, token)
|
|
1135
1138
|
});
|
|
1136
1139
|
}
|
|
1140
|
+
/**
|
|
1141
|
+
* The team's boards in Vercel's API that your credentials may use, every page of them, and the ID
|
|
1142
|
+
* of its default board when you may use it: what `vb list` lists. `team` is a team's ID (`team_…`)
|
|
1143
|
+
* or slug, by default the one the environment finds, and the credentials are the ones `board()`
|
|
1144
|
+
* finds. Pass a board's `name` to `board()` to use one. `BOARD_URL` names a board of its own, with
|
|
1145
|
+
* no team's boards to list, so it doesn't change what this lists.
|
|
1146
|
+
*/
|
|
1147
|
+
function listBoards(options = {}) {
|
|
1148
|
+
return vercel(options).boards();
|
|
1149
|
+
}
|
|
1137
1150
|
//#endregion
|
|
1138
|
-
export {
|
|
1151
|
+
export { localTokenFile as _, handProgram as a, http as c, configDir as d, connect as f, handToken as g, handLogin as h, credentialed as i, PASSED as l, handFetch as m, listBoards as n, handTeam as o, environmentProfile as p, credentialSource as r, vercel as s, board as t, boardUrl as u, projectDir as v, vercelProjectFile as y };
|
package/dist/sync-chat-sdk.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as SyncFn, m as SyncProvider, x as channels } from "./provider-BnK0Bif7.mjs";
|
|
2
|
-
import { r as ChatTransport, t as ChatInput } from "./chat-provider-
|
|
2
|
+
import { r as ChatTransport, t as ChatInput } from "./chat-provider-CW-YpGWe.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { ReactionEvent } from "chat";
|
|
5
5
|
//#region src/sync/chat-sdk.d.ts
|
package/dist/sync-chat-sdk.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as eventSchema, p as channels, r as envelope } from "./events-mWKc1uvZ.mjs";
|
|
2
|
-
import { t as ChatSyncProvider } from "./chat-provider-
|
|
2
|
+
import { t as ChatSyncProvider } from "./chat-provider-eRYSL4XG.mjs";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
//#region src/sync/chat-sdk.ts
|
|
5
5
|
const schemaOf = (platform) => eventSchema(platform, "message");
|
package/dist/sync-github.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as SyncFn, b as SyncUnit, p as SyncContext } from "./provider-BnK0Bif7.mjs";
|
|
2
|
-
import { n as ChatSyncProvider } from "./chat-provider-
|
|
2
|
+
import { n as ChatSyncProvider } from "./chat-provider-CW-YpGWe.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { Adapter } from "chat";
|
|
5
5
|
//#region src/sync/github.d.ts
|
package/dist/sync-github.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as withRoutes, i as eventSchema, m as into, r as envelope } from "./events-mWKc1uvZ.mjs";
|
|
2
|
-
import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-
|
|
2
|
+
import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-eRYSL4XG.mjs";
|
|
3
3
|
import { n as tagOf, t as slug } from "./tags-CxDCF_tt.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { connectGitHubAdapter } from "@vercel/connect/chat";
|
package/dist/sync-linear.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { qt as SourceRead } from "./routes-D5FtKOP_.mjs";
|
|
2
2
|
import { _ as SyncFn, b as SyncUnit, f as ResolvedTarget, l as ReceivedEvent, o as ProviderPost, p as SyncContext, r as ProviderDelivery } from "./provider-BnK0Bif7.mjs";
|
|
3
|
-
import { n as ChatSyncProvider, t as ChatInput } from "./chat-provider-
|
|
3
|
+
import { n as ChatSyncProvider, t as ChatInput } from "./chat-provider-CW-YpGWe.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { Adapter } from "chat";
|
|
6
6
|
//#region src/sync/linear.d.ts
|
package/dist/sync-linear.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as eventSchema, l as UnreadableError, p as channels, r as envelope } from "./events-mWKc1uvZ.mjs";
|
|
2
|
-
import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-
|
|
2
|
+
import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-eRYSL4XG.mjs";
|
|
3
3
|
import { n as tagOf, t as slug } from "./tags-CxDCF_tt.mjs";
|
|
4
4
|
import "zod";
|
|
5
5
|
import { connectLinearAdapter } from "@vercel/connect/chat";
|
package/dist/sync-slack.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { nr as ExternalLink } from "./routes-D5FtKOP_.mjs";
|
|
2
2
|
import { _ as SyncFn, f as ResolvedTarget, o as ProviderPost, p as SyncContext, r as ProviderDelivery, s as ProviderSender, x as channels } from "./provider-BnK0Bif7.mjs";
|
|
3
|
-
import { n as ChatSyncProvider, t as ChatInput } from "./chat-provider-
|
|
3
|
+
import { n as ChatSyncProvider, t as ChatInput } from "./chat-provider-CW-YpGWe.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { Adapter } from "chat";
|
|
6
6
|
//#region src/sync/slack-deployments.d.ts
|
|
@@ -69,6 +69,14 @@ export type SlackClient = {
|
|
|
69
69
|
user?: SlackUser;
|
|
70
70
|
}>;
|
|
71
71
|
};
|
|
72
|
+
/** A bot's name and picture, for a message an app posts with no user of its own; needs `users:read`. */
|
|
73
|
+
bots?: {
|
|
74
|
+
info(args: {
|
|
75
|
+
bot: string;
|
|
76
|
+
}): Promise<{
|
|
77
|
+
bot?: SlackBot;
|
|
78
|
+
}>;
|
|
79
|
+
};
|
|
72
80
|
files?: {
|
|
73
81
|
delete(args: {
|
|
74
82
|
file: string;
|
|
@@ -190,14 +198,23 @@ type SlackFile = {
|
|
|
190
198
|
title?: string;
|
|
191
199
|
permalink?: string;
|
|
192
200
|
};
|
|
201
|
+
/** A bot as Slack describes it: in `bots.info`, and in a message's `bot_profile`. */
|
|
202
|
+
type SlackBot = {
|
|
203
|
+
name?: string;
|
|
204
|
+
icons?: {
|
|
205
|
+
image_72?: string;
|
|
206
|
+
image_48?: string;
|
|
207
|
+
};
|
|
208
|
+
};
|
|
193
209
|
type SlackMessage = {
|
|
194
210
|
ts?: string;
|
|
195
211
|
text?: string;
|
|
196
212
|
user?: string;
|
|
197
213
|
username?: string;
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
214
|
+
bot_id?: string;
|
|
215
|
+
bot_profile?: SlackBot;
|
|
216
|
+
/** The picture a message was posted under, where it names one. */
|
|
217
|
+
icons?: SlackBot['icons'];
|
|
201
218
|
files?: SlackFile[];
|
|
202
219
|
thread_ts?: string;
|
|
203
220
|
reply_count?: number;
|
package/dist/sync-slack.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { m as MESSAGE_TEXT_MAX } from "./schemas-CUSTEFIy.mjs";
|
|
|
2
2
|
import "./external-DkWafjn-.mjs";
|
|
3
3
|
import { t as extractMentions } from "./mentions-DBGmqkr2.mjs";
|
|
4
4
|
import { d as opensBlock, i as eventSchema, l as UnreadableError, p as channels, r as envelope } from "./events-mWKc1uvZ.mjs";
|
|
5
|
-
import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-
|
|
5
|
+
import { n as markdownOf, t as ChatSyncProvider } from "./chat-provider-eRYSL4XG.mjs";
|
|
6
6
|
import { r as formatVercelDeployments } from "./bots-CqPYxkqK.mjs";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
import { stringifyMarkdown } from "chat";
|
|
@@ -599,6 +599,21 @@ var SlackProvider = class extends ChatSyncProvider {
|
|
|
599
599
|
}
|
|
600
600
|
return promise;
|
|
601
601
|
}
|
|
602
|
+
const bots = /* @__PURE__ */ new Map();
|
|
603
|
+
function botOf(bot) {
|
|
604
|
+
let promise = bots.get(bot);
|
|
605
|
+
if (!promise) {
|
|
606
|
+
promise = client().then(async (web) => (await web?.bots?.info({ bot }))?.bot ?? null).catch(() => null);
|
|
607
|
+
bots.set(bot, promise);
|
|
608
|
+
}
|
|
609
|
+
return promise;
|
|
610
|
+
}
|
|
611
|
+
/** The message as a bot posted it with no user, or nothing: one a user wrote, or a bot's own user, is the adapter's to name. */
|
|
612
|
+
const fromBot = (raw) => {
|
|
613
|
+
const event = raw;
|
|
614
|
+
return event && !event.user && event.bot_id ? event : null;
|
|
615
|
+
};
|
|
616
|
+
const pictureOf = (icons) => icons?.image_72 ?? icons?.image_48 ?? null;
|
|
602
617
|
const converter = options.adapter.formatConverter;
|
|
603
618
|
const mrkdwn = (text) => {
|
|
604
619
|
try {
|
|
@@ -924,7 +939,23 @@ var SlackProvider = class extends ChatSyncProvider {
|
|
|
924
939
|
}
|
|
925
940
|
}];
|
|
926
941
|
},
|
|
927
|
-
|
|
942
|
+
async author(author, raw) {
|
|
943
|
+
const event = fromBot(raw);
|
|
944
|
+
if (!event) return null;
|
|
945
|
+
const name = event.username || event.bot_profile?.name || (await botOf(event.bot_id))?.name || event.bot_id;
|
|
946
|
+
return {
|
|
947
|
+
id: `slack:user:${author.userId}`,
|
|
948
|
+
handle: name,
|
|
949
|
+
name,
|
|
950
|
+
avatar: null,
|
|
951
|
+
isBot: true
|
|
952
|
+
};
|
|
953
|
+
},
|
|
954
|
+
async avatar(message) {
|
|
955
|
+
const event = fromBot(message.raw);
|
|
956
|
+
if (!event) return message.author.userId ? avatarOf(message.author.userId) : null;
|
|
957
|
+
return pictureOf(event.icons) ?? pictureOf(event.bot_profile?.icons) ?? pictureOf((await botOf(event.bot_id))?.icons);
|
|
958
|
+
},
|
|
928
959
|
groupThread: (thread) => thread,
|
|
929
960
|
isRoot: (thread, messageId) => thread.slice(thread.lastIndexOf(":") + 1) === messageId,
|
|
930
961
|
context: () => null,
|
|
@@ -3,9 +3,9 @@ import "./schemas-CUSTEFIy.mjs";
|
|
|
3
3
|
import { l as isThreadTarget } from "./external-DkWafjn-.mjs";
|
|
4
4
|
import { Ct as routes, H as Filters, r as badRequest, t as HttpError } from "./errors-Ce_-E3_C.mjs";
|
|
5
5
|
import { i as afterRetry } from "./middleware-DVBOEd8G.mjs";
|
|
6
|
-
import { t as VERSION } from "./version-
|
|
6
|
+
import { t as VERSION } from "./version-yDZzeoWl.mjs";
|
|
7
7
|
import { t as own } from "./own-OwgPWdmh.mjs";
|
|
8
|
-
import { o as options } from "./commands-
|
|
8
|
+
import { o as options } from "./commands-CkRYuvpd.mjs";
|
|
9
9
|
import { z } from "zod";
|
|
10
10
|
//#region src/server/backend.ts
|
|
11
11
|
/** The subscription sync's outbound runs on, in `BoardBinding.subscriptions`. No watcher's ID starts with `@`. */
|
|
@@ -180,6 +180,22 @@ export const acmeGeneral = board({ team: 'acme' })
|
|
|
180
180
|
someone who manages the board grants it. The team's default board says the
|
|
181
181
|
same.
|
|
182
182
|
|
|
183
|
+
To pick one at runtime, `listBoards()` lists the team's boards you may use,
|
|
184
|
+
each by its `id` and the `name` `board()` takes, with the ID of the default
|
|
185
|
+
board, as `vb list` does:
|
|
186
|
+
|
|
187
|
+
```ts
|
|
188
|
+
import { board, listBoards } from '@vercel/board'
|
|
189
|
+
|
|
190
|
+
const { boards } = await listBoards({ team: 'acme' })
|
|
191
|
+
const incidents = board({ team: 'acme', name: boards.find((b) => b.name === 'incidents')!.name, ensure: false })
|
|
192
|
+
```
|
|
193
|
+
A board's ID picks it too, in place of its name: `board({ id: 'brd_…' })`,
|
|
194
|
+
as `vb list` shows it. Every request names the board by that ID, so a
|
|
195
|
+
rename never moves it. `id` and `name` are one or the other, and `id` makes
|
|
196
|
+
no board, so it takes no `ensure`; with `BOARD_URL` set, the board is the one
|
|
197
|
+
at that URL, whatever the ID.
|
|
198
|
+
|
|
183
199
|
The backend reads them once, when `board()` binds it: `binding.name`, null for
|
|
184
200
|
the team's default board, `binding.team`, null for the environment's team, and
|
|
185
201
|
`binding.ensure`. `board({ ensure: true })` without a `name` throws. With
|
package/docs/02-sync/03-slack.md
CHANGED
|
@@ -87,6 +87,11 @@ most once a minute, while the other channels sync.
|
|
|
87
87
|
|
|
88
88
|
- **Messages, replies, edits, deletes, and reactions,** both ways. Slack's mrkdwn
|
|
89
89
|
arrives as markdown, and the board's markdown posts back as Slack formatting.
|
|
90
|
+
- **Who wrote it.** A person's message comes in under their Slack name, handle,
|
|
91
|
+
and picture. An app that posts with no user of its own, as it answers a slash
|
|
92
|
+
command or through an incoming webhook, is named as its message names it, then
|
|
93
|
+
from Slack's record of the bot (`bots.info`, under `users:read`), then by its
|
|
94
|
+
bot ID.
|
|
90
95
|
- **Mentions** sync both ways by the user's ID. `<@U0456>` comes in as a
|
|
91
96
|
mention of that user, `@[slack:user:U0456]` under key `slack`, and the board
|
|
92
97
|
meets them, by their Slack name, handle, and picture, though they never
|
|
@@ -45,7 +45,7 @@ prints the command to paste into the channel:
|
|
|
45
45
|
|
|
46
46
|
```text
|
|
47
47
|
$ vb sync alerts slack/vercel:#alerts
|
|
48
|
-
syn_9c2f7b alerts slack/vercel:#alerts pending:
|
|
48
|
+
syn_9c2f7b alerts slack/vercel:#alerts pending: someone in its Slack channel has to accept it with /vercel board sync accept syn_9c2f7b
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
Running that command in Slack starts nothing yet. It shows whoever ran it,
|
|
@@ -84,7 +84,7 @@ channel's. One that isn't running says so, and why:
|
|
|
84
84
|
```text
|
|
85
85
|
$ vb syncs
|
|
86
86
|
syn_4f9a2c support slack/vercel:#support
|
|
87
|
-
syn_9c2f7b alerts slack/vercel:#alerts pending:
|
|
87
|
+
syn_9c2f7b alerts slack/vercel:#alerts pending: someone in its Slack channel has to accept it with /vercel board sync accept syn_9c2f7b
|
|
88
88
|
syn_1b77e0 ops slack/vercel:#ops paused: Vercel's Slack app can no longer reach the channel. Once it's back in it, mirror the channel again.
|
|
89
89
|
```
|
|
90
90
|
|
|
@@ -1336,11 +1336,11 @@ goes through. Each takes `sync` in the channel.
|
|
|
1336
1336
|
|
|
1337
1337
|
```text
|
|
1338
1338
|
$ vb sync alerts slack/vercel:#alerts
|
|
1339
|
-
syn_9c2f7b alerts slack/vercel:#alerts pending:
|
|
1339
|
+
syn_9c2f7b alerts slack/vercel:#alerts pending: someone in its Slack channel has to accept it with /vercel board sync accept syn_9c2f7b
|
|
1340
1340
|
$ vb syncs alerts
|
|
1341
|
-
syn_9c2f7b alerts slack/vercel:#alerts pending:
|
|
1341
|
+
syn_9c2f7b alerts slack/vercel:#alerts pending: someone in its Slack channel has to accept it with /vercel board sync accept syn_9c2f7b
|
|
1342
1342
|
$ vb sync remove syn_9c2f7b
|
|
1343
|
-
removed syn_9c2f7b alerts slack/vercel:#alerts pending:
|
|
1343
|
+
removed syn_9c2f7b alerts slack/vercel:#alerts pending: someone in its Slack channel has to accept it with /vercel board sync accept syn_9c2f7b
|
|
1344
1344
|
```
|
|
1345
1345
|
|
|
1346
1346
|
With `--json`, making one prints `{ sync, outcome }`, where `outcome` is
|
|
@@ -1356,7 +1356,7 @@ vb syncs [channel]
|
|
|
1356
1356
|
Lists the syncs the board runs itself, oldest first: every channel's, or one's.
|
|
1357
1357
|
A row is a sync's ID, its channel, and what it syncs with, as the command that
|
|
1358
1358
|
made it says it. One that isn't running ends with its state and why:
|
|
1359
|
-
`pending:
|
|
1359
|
+
`pending: someone in its Slack channel has to accept it with /vercel board sync accept <id>`,
|
|
1360
1360
|
`paused: Vercel's Slack app can no longer reach the channel. Once it's back in it, mirror the channel again.`
|
|
1361
1361
|
|
|
1362
1362
|
### sources
|
package/package.json
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { f as Board, p as BoardOptions } from "./backend-9H57DlQt.mjs";
|
|
2
|
-
import "./exports-Bh09j6Bd.mjs";
|
|
3
|
-
//#region src/server/index.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* The handle on a board. Without a `backend`, it's Vercel's board for your team, the one `name`
|
|
6
|
-
* names, reached with the credentials the Vercel CLI or the deployment has (or `fetch`'s). With
|
|
7
|
-
* `BOARD_URL` set, it's the board at that URL instead: `vb serve`'s, say.
|
|
8
|
-
*/
|
|
9
|
-
declare function board(options?: BoardOptions): Board;
|
|
10
|
-
//#endregion
|
|
11
|
-
export { board as t };
|