@vercel/board 0.43.1 → 0.45.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/{access-BgBiaCyx.mjs → access-3udXjJAg.mjs} +2 -2
- package/dist/access.d.mts +3 -3
- package/dist/access.mjs +6 -6
- package/dist/{actors-DkZsnMgA.mjs → actors-DasGZnfb.mjs} +3 -3
- package/dist/{auth-Bn8J_1F2.d.mts → auth-BG_whr9_.d.mts} +1 -1
- package/dist/{auth-Ft4AJptx.mjs → auth-aiOVE82-.mjs} +2 -2
- package/dist/{backend-DMrK55mU.d.mts → backend-D6yTo8Un.d.mts} +3 -3
- package/dist/backend-local.d.mts +1 -1
- package/dist/backend-local.mjs +1 -1
- package/dist/{bots-CGkO76qH.mjs → bots-CLKKMgYf.mjs} +6 -1
- package/dist/{chat-provider-CPZg2MQb.mjs → chat-provider-BvNqOQFL.mjs} +7 -5
- package/dist/{chat-provider-Cgkh9xJw.d.mts → chat-provider-V2jnjVLq.d.mts} +4 -4
- package/dist/cli-commands.d.mts +1 -1
- 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 +14 -7
- package/dist/{commands-C4fR0md0.mjs → commands-CqdnjUkm.mjs} +7 -1
- package/dist/{commands-BlM-ckFS.d.mts → commands-DewS14_P.d.mts} +7 -1
- package/dist/{conformance-BORt5nky.mjs → conformance-BInS4_6b.mjs} +68 -2
- package/dist/conformance.d.mts +1 -1
- package/dist/conformance.mjs +1 -1
- package/dist/{data-values-C-Cq80hz.mjs → data-values-CoTP0SQG.mjs} +43 -54
- package/dist/{engine-BVHSH2Kn.mjs → engine-XVBt02Bl.mjs} +20 -13
- package/dist/{errors-DUzpDSrJ.mjs → errors-ZazTZh-s.mjs} +20 -3
- package/dist/{events-BT8y_81j.mjs → events-D17RndlV.mjs} +5 -3
- package/dist/{exports-BVgUNVsP.mjs → exports-DCf75prP.mjs} +184 -45
- package/dist/exports-Gspe1eEq.d.mts +4 -0
- package/dist/{external-DymyhUzl.mjs → external-DfhN7lKK.mjs} +1 -1
- package/dist/{index-CydxnBND.d.mts → index-Djmr4GzQ.d.mts} +2 -2
- package/dist/index.d.mts +6 -6
- package/dist/index.mjs +4 -4
- package/dist/index.node.d.mts +6 -6
- package/dist/index.node.mjs +3 -3
- package/dist/inspect/app.js +88 -88
- package/dist/inspect/engine.js +5 -5
- package/dist/{inspect-ZGkTJl3f.mjs → inspect-B0_aKQM8.mjs} +23 -7
- package/dist/inspect-CULoD54F.mjs +2 -0
- package/dist/{local-yB2DFcRi.mjs → local-Bel_oeFa.mjs} +26 -13
- package/dist/{main-DjEJPCgo.mjs → main-DmsdcUZ_.mjs} +36 -13
- package/dist/{memory-DhduVbUu.mjs → memory-DyEL0fvN.mjs} +2 -2
- package/dist/{middleware-0DUFrav-.mjs → middleware-BHHKHA9q.mjs} +2 -2
- package/dist/origin-BHmEdok7.mjs +428 -0
- package/dist/{provider-dY54GFNz.d.mts → provider-BC9mPYVh.d.mts} +39 -6
- package/dist/{origin-9Ch-Zonv.mjs → routes-CkUetTO2.mjs} +14 -437
- package/dist/{routes-By9lmvUD.d.mts → routes-zm4TXKCC.d.mts} +8 -1
- package/dist/{schemas-DAzSsgWk.mjs → schemas-BhZaystC.mjs} +8 -2
- package/dist/schemas.mjs +1 -1
- package/dist/{serve-Cnb4TpaJ.mjs → serve-bPSEx_8X.mjs} +4 -4
- package/dist/{server-BHpUqip5.mjs → server-CcvxkXzG.mjs} +8 -7
- package/dist/{serving-hcxzaCCO.mjs → serving-BLVRrJ7P.mjs} +1 -1
- package/dist/{sql-P9g-rLIF.mjs → sql-CyVcjw8x.mjs} +2 -2
- package/dist/{sqlite-B3rCcIof.mjs → sqlite-Con-8duk.mjs} +2 -2
- package/dist/{sqlite-db-D0Fyju-4.mjs → sqlite-db-BdzxtUOV.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 +2 -2
- package/dist/sync-linear.d.mts +3 -3
- package/dist/sync-linear.mjs +3 -3
- package/dist/sync-slack.d.mts +27 -4
- package/dist/sync-slack.mjs +208 -12
- package/dist/sync.d.mts +3 -3
- package/dist/sync.mjs +2 -2
- package/dist/{tokens-BSMpTPEe.mjs → tokens-BErYXuHZ.mjs} +2 -2
- package/docs/01-board/04-messages.md +1 -1
- package/docs/01-board/09-access.md +8 -0
- package/docs/02-sync/02-functions.md +4 -1
- package/docs/02-sync/03-slack.md +24 -1
- package/docs/02-sync/04-github.md +5 -2
- package/docs/02-sync/06-providers.md +1 -1
- package/docs/03-guides/02-inspector.md +16 -0
- package/docs/04-reference/01-cli.md +1 -1
- package/docs/04-reference/02-board.md +24 -3
- package/docs/04-reference/03-http.md +8 -2
- package/docs/04-reference/05-conformance.md +1 -1
- package/package.json +3 -1
- package/dist/exports-Bw_OYNRl.d.mts +0 -4
- package/dist/inspect-DRPRCOaV.mjs +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as forbidden } from "./errors-
|
|
2
|
-
import { a as CAN_MAX,
|
|
1
|
+
import { a as forbidden } from "./errors-ZazTZh-s.mjs";
|
|
2
|
+
import { a as CAN_MAX, s as ChannelPath } from "./schemas-BhZaystC.mjs";
|
|
3
3
|
//#region src/server/access.ts
|
|
4
4
|
/**
|
|
5
5
|
* What a principal may do in a channel. `read` covers messages, threads,
|
package/dist/access.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $t as
|
|
2
|
-
import { _ as GrantFacts, a as DEFAULT_CAN, b as grantAccess, c as IssuerConfig, d as Principal, f as PrincipalKind, g as GrantExplanation, h as DecidingGrant, i as Claims, l as Known, m as Caller, n as AuthenticateContext, r as CallerRequest, s as HostPrincipal, t as Authenticate, u as OidcTokensOptions, v as GrantSource, y as explainGrants } from "./auth-
|
|
1
|
+
import { $t as compileAccess, Bt as Can, Gt as GrantChangeRefusal, Ht as FULL_ACCESS, Kt as GrantShape, Qt as checkGrantChange, Rt as Access, Ut as Grant, Vt as ChannelPattern, Wt as GrantChange, Xt as Permission, Yt as PERMISSIONS, an as Author, en as parseCan, nn as Actor, on as CAN_MAX, qt as InvalidCan, tn as union, zt as AccessSummary } from "./routes-zm4TXKCC.mjs";
|
|
2
|
+
import { _ as GrantFacts, a as DEFAULT_CAN, b as grantAccess, c as IssuerConfig, d as Principal, f as PrincipalKind, g as GrantExplanation, h as DecidingGrant, i as Claims, l as Known, m as Caller, n as AuthenticateContext, r as CallerRequest, s as HostPrincipal, t as Authenticate, u as OidcTokensOptions, v as GrantSource, y as explainGrants } from "./auth-BG_whr9_.mjs";
|
|
3
3
|
//#region src/server/tokens.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* The OIDC tokens made out to this board: a request's bearer token, from Vercel (people and
|
|
@@ -25,4 +25,4 @@ type ResolvedActor = {
|
|
|
25
25
|
*/
|
|
26
26
|
export declare function resolveActor(principal: Principal, claims: Claims): ResolvedActor;
|
|
27
27
|
//#endregion
|
|
28
|
-
export { type Access, type AccessSummary, type Authenticate, type AuthenticateContext, CAN_MAX, type Caller, type CallerRequest, type Can, type ChannelPattern, type Claims, DEFAULT_CAN, type DecidingGrant, FULL_ACCESS, type Grant, type GrantChange, type GrantChangeRefusal, type GrantExplanation, type GrantFacts, type GrantShape, type GrantSource, type HostPrincipal, InvalidCan, type IssuerConfig, type Known, type OidcTokensOptions, type Permission, type Principal, type PrincipalKind, checkGrantChange, compileAccess, explainGrants, grantAccess, parseCan, union };
|
|
28
|
+
export { type Access, type AccessSummary, type Authenticate, type AuthenticateContext, CAN_MAX, type Caller, type CallerRequest, type Can, type ChannelPattern, type Claims, DEFAULT_CAN, type DecidingGrant, FULL_ACCESS, type Grant, type GrantChange, type GrantChangeRefusal, type GrantExplanation, type GrantFacts, type GrantShape, type GrantSource, type HostPrincipal, InvalidCan, type IssuerConfig, type Known, type OidcTokensOptions, PERMISSIONS, type Permission, type Principal, type PrincipalKind, checkGrantChange, compileAccess, explainGrants, grantAccess, parseCan, union };
|
package/dist/access.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as CAN_MAX } from "./schemas-
|
|
2
|
-
import { c as compileAccess, f as union, n as InvalidCan, o as checkGrantChange, t as FULL_ACCESS, u as parseCan } from "./access-
|
|
3
|
-
import { C as explainGrants, t as DEFAULT_CAN, w as grantAccess } from "./auth-
|
|
4
|
-
import { a as resolveActor } from "./actors-
|
|
5
|
-
import { t as oidcTokens } from "./tokens-
|
|
6
|
-
export { CAN_MAX, DEFAULT_CAN, FULL_ACCESS, InvalidCan, checkGrantChange, compileAccess, explainGrants, grantAccess, oidcTokens, parseCan, resolveActor, union };
|
|
1
|
+
import { a as CAN_MAX } from "./schemas-BhZaystC.mjs";
|
|
2
|
+
import { c as compileAccess, f as union, n as InvalidCan, o as checkGrantChange, r as PERMISSIONS, t as FULL_ACCESS, u as parseCan } from "./access-3udXjJAg.mjs";
|
|
3
|
+
import { C as explainGrants, t as DEFAULT_CAN, w as grantAccess } from "./auth-aiOVE82-.mjs";
|
|
4
|
+
import { a as resolveActor } from "./actors-DasGZnfb.mjs";
|
|
5
|
+
import { t as oidcTokens } from "./tokens-BErYXuHZ.mjs";
|
|
6
|
+
export { CAN_MAX, DEFAULT_CAN, FULL_ACCESS, InvalidCan, PERMISSIONS, checkGrantChange, compileAccess, explainGrants, grantAccess, oidcTokens, parseCan, resolveActor, union };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { u as parseCan } from "./access-
|
|
1
|
+
import { g as parseProfileHeader, r as badRequest } from "./errors-ZazTZh-s.mjs";
|
|
2
|
+
import { C as toStorable } from "./schemas-BhZaystC.mjs";
|
|
3
|
+
import { u as parseCan } from "./access-3udXjJAg.mjs";
|
|
4
4
|
import { t as own } from "./own-OwgPWdmh.mjs";
|
|
5
5
|
//#region src/server/actors.ts
|
|
6
6
|
/** Agents whose marks the board serves at `/avatars/<name>`, for a caller to pass as an avatar. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Bt as Can, Jt as Level, Rt as Access, Xt as Permission, Zt as WrittenCan } from "./routes-zm4TXKCC.mjs";
|
|
2
2
|
import { JWTVerifyGetKey } from "jose";
|
|
3
3
|
//#region src/server/grants.d.ts
|
|
4
4
|
/** Who asks, as a verified token says, in the terms grants name them by. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as forbidden,
|
|
2
|
-
import { c as compileAccess, l as decide, p as writtenCan, s as combine, t as FULL_ACCESS, u as parseCan } from "./access-
|
|
1
|
+
import { a as forbidden, r as badRequest, t as HttpError, u as unauthorized } from "./errors-ZazTZh-s.mjs";
|
|
2
|
+
import { c as compileAccess, l as decide, p as writtenCan, s as combine, t as FULL_ACCESS, u as parseCan } from "./access-3udXjJAg.mjs";
|
|
3
3
|
//#region src/server/grants.ts
|
|
4
4
|
/**
|
|
5
5
|
* How close `principal` is to the caller, or null when it doesn't name it: `principal` for its own
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { l as Known, o as Granted, p as StoredGrant, t as Authenticate } from "./auth-
|
|
3
|
-
import {
|
|
1
|
+
import { $ as ScheduleBody, A as LabelBody, Bt as Can, C as InboxAckBody, D as InboxPushBody, Dt as ThreadView, E as InboxNextQuery, F as Me, Ft as UploadStartBody, I as MessageView, It as UploadTicket, J as RegisterBody, Jt as Level, K as ReactBody, L as MessagesPage, M as LinkedQuery, N as MatchView, Nt as UpdateGrantBody, O as InboxQuery, Ot as ThreadsPage, P as MatchesQuery, R as MessagesQuery, Rt as Access, St as SyncReceiptBody, T as InboxItem, Tt as SyncedView, V as PostBody, X as RegistrationView, Xt as Permission, a as BoardEventView, an as Author, bt as SyncImportBody, c as CreateChannelBody, ct as SchemaView, d as EditBody, f as EventsPage, ft as SourceRead, g as Explanation, gt as SyncCopiesView, h as ExplainQuery, ht as SyncCopiesQuery, in as Attachment, jt as TypingBody, kt as ThreadsQuery, l as DeleteBody, ln as ExternalEvent, lt as SourceJoin, n as ActorView, nn as Actor, nt as ScheduleView, ot as SchemaBody, p as EventsQuery, pt as SourceReadQuery, rt as SchedulesQuery, s as ChannelView, sn as Labels, t as AckBody, u as Discovery, ut as SourceJoinBody, v as GrantBody, vt as SyncFindQuery, w as InboxEntry, wt as SyncThreadView, x as GrantView, yt as SyncFindView } from "./routes-zm4TXKCC.mjs";
|
|
2
|
+
import { l as Known, o as Granted, p as StoredGrant, t as Authenticate } from "./auth-BG_whr9_.mjs";
|
|
3
|
+
import { H as ProfileOption, I as ErrorOrigin, P as BoardClient, m as SyncProvider } from "./provider-BC9mPYVh.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/server/sandbox.d.ts
|
|
6
6
|
/** How a rule matches a value: a regular expression (RE2), or the value exactly. */
|
package/dist/backend-local.d.mts
CHANGED
package/dist/backend-local.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as local } from "./local-
|
|
1
|
+
import { t as local } from "./local-Bel_oeFa.mjs";
|
|
2
2
|
export { local };
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
//#region src/contract/bots.ts
|
|
2
|
+
/** Vercel for GitHub's bot account (`vercel[bot]`), as the board names it. */
|
|
3
|
+
const VERCEL_BOT = "github:user:35613825";
|
|
1
4
|
const VERCEL_MARKER = /^\[vc\]: #\S*\r?\n/;
|
|
2
5
|
const LINK = /\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)/g;
|
|
3
6
|
const STATUS = /!\[([^\]]+)\]\(https:\/\/vercel\.com\/static\/status\/[^)]+\)\s*(?:\[[^\]]*\]\((https?:\/\/[^)\s]+)\))?/;
|
|
@@ -20,6 +23,7 @@ function vercelDeployments(text) {
|
|
|
20
23
|
if (!project) continue;
|
|
21
24
|
const preview = cells[2] ? [...cells[2].matchAll(LINK)].find((link) => /preview/i.test(link[1])) : void 0;
|
|
22
25
|
const updated = cells[3]?.match(/<relative-time[^>]*>([^<]+)<\/relative-time>/)?.[1]?.trim() ?? (cells[3]?.replace(/<[^>]*>/g, "").trim() || null);
|
|
26
|
+
const time = cells[3]?.match(/<relative-time[^>]*\sdatetime="([^"]+)"/)?.[1] ?? null;
|
|
23
27
|
deployments.push({
|
|
24
28
|
project,
|
|
25
29
|
projectUrl: projectLink?.[2] ?? null,
|
|
@@ -27,6 +31,7 @@ function vercelDeployments(text) {
|
|
|
27
31
|
deploymentUrl: status[2] ?? null,
|
|
28
32
|
previewUrl: preview?.[2] ?? null,
|
|
29
33
|
updated,
|
|
34
|
+
updatedAt: time !== null && !Number.isNaN(Date.parse(time)) ? time : null,
|
|
30
35
|
skipped: skippedAt !== -1 && at > skippedAt
|
|
31
36
|
});
|
|
32
37
|
}
|
|
@@ -64,4 +69,4 @@ function displayText(text, actor) {
|
|
|
64
69
|
return deployments ? `**▲ Vercel**\n${formatVercelDeployments(deployments)}` : text;
|
|
65
70
|
}
|
|
66
71
|
//#endregion
|
|
67
|
-
export { displayText as t };
|
|
72
|
+
export { vercelDeployments as i, displayText as n, formatVercelDeployments as r, VERCEL_BOT as t };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import "./external-
|
|
2
|
-
import { c as SyncProvider, s as ResolvedTarget } from "./events-
|
|
1
|
+
import "./external-DfhN7lKK.mjs";
|
|
2
|
+
import { c as SyncProvider, s as ResolvedTarget } from "./events-D17RndlV.mjs";
|
|
3
|
+
import { createHash } from "node:crypto";
|
|
3
4
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
5
|
import { Chat, stringifyMarkdown } from "chat";
|
|
5
6
|
//#region src/sync/chat.ts
|
|
@@ -198,7 +199,8 @@ var ChatSyncProvider = class extends SyncProvider {
|
|
|
198
199
|
if (input.kind === "deleted") return `deleted:${key}:${this.toNative(input.thread)}|${input.message}`;
|
|
199
200
|
const message = input.message;
|
|
200
201
|
const location = `${key}:${this.toNative(message.threadId)}|${message.id}`;
|
|
201
|
-
|
|
202
|
+
if (input.kind === "message") return `message:${location}`;
|
|
203
|
+
return `edited:${location}|${createHash("sha256").update(message.text).digest("base64url")}`;
|
|
202
204
|
}
|
|
203
205
|
author(author, raw) {
|
|
204
206
|
return this.transport.author?.(author, raw) ?? externalAuthor(this.platform, author);
|
|
@@ -386,7 +388,7 @@ var ChatSyncProvider = class extends SyncProvider {
|
|
|
386
388
|
const data = await fetch();
|
|
387
389
|
return data instanceof ArrayBuffer ? new Uint8Array(data) : new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
|
|
388
390
|
}
|
|
389
|
-
async post(target, kind, { as: _sender, files, ...body }) {
|
|
391
|
+
async post(target, kind, { as: _sender, deployments: _listed, files, ...body }) {
|
|
390
392
|
if (kind === "channel" && !this.canStartThreads) throw new Error(`${this.platform} cannot start threads`);
|
|
391
393
|
await this.ready();
|
|
392
394
|
const sent = await (kind === "channel" ? this.chat.channel(this.toChat(target)) : this.chat.thread(this.toChat(target))).post(files?.length ? {
|
|
@@ -399,7 +401,7 @@ var ChatSyncProvider = class extends SyncProvider {
|
|
|
399
401
|
...files?.length ? { files: this.transport.fileIds?.(sent.raw) ?? [] } : {}
|
|
400
402
|
};
|
|
401
403
|
}
|
|
402
|
-
async edit(thread, message, { as: _sender, files, ...body }) {
|
|
404
|
+
async edit(thread, message, { as: _sender, deployments: _listed, files, ...body }) {
|
|
403
405
|
await (await this.ready()).editMessage(this.toChat(thread), message, files ? {
|
|
404
406
|
...body,
|
|
405
407
|
files: this.named(files)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { A as SyncRoot, E as ProviderEvent, _ as SyncFn, a as ProviderOptions, c as Receive, f as ResolvedTarget, i as ProviderFile, l as ReceivedEvent, m as SyncProvider, n as FileDelivery, o as ProviderPost, r as ProviderDelivery, t as FetchedLink } from "./provider-
|
|
1
|
+
import { cn as ExternalAuthor, dn as ExternalLink, ft as SourceRead, lt as SourceJoin, nn as Actor, un as ExternalFile } from "./routes-zm4TXKCC.mjs";
|
|
2
|
+
import { A as SyncRoot, E as ProviderEvent, _ as SyncFn, a as ProviderOptions, c as Receive, f as ResolvedTarget, i as ProviderFile, l as ReceivedEvent, m as SyncProvider, n as FileDelivery, o as ProviderPost, r as ProviderDelivery, t as FetchedLink } from "./provider-BC9mPYVh.mjs";
|
|
3
3
|
import { Adapter, Author, FileUpload, Message, ReactionEvent, StateAdapter } from "chat";
|
|
4
4
|
//#region src/sync/chat-provider.d.ts
|
|
5
5
|
type ChatInput = {
|
|
@@ -146,8 +146,8 @@ declare abstract class ChatSyncProvider<E extends ProviderEvent = ProviderEvent>
|
|
|
146
146
|
}): Promise<SourceRead>;
|
|
147
147
|
join(target: string): Promise<SourceJoin>;
|
|
148
148
|
fetchFile(file: ExternalFile): Promise<Uint8Array | null>;
|
|
149
|
-
post(target: string, kind: ResolvedTarget['kind'], { as: _sender, files, ...body }: ProviderPost): Promise<ProviderDelivery>;
|
|
150
|
-
edit(thread: string, message: string, { as: _sender, files, ...body }: ProviderPost): Promise<void>;
|
|
149
|
+
post(target: string, kind: ResolvedTarget['kind'], { as: _sender, deployments: _listed, files, ...body }: ProviderPost): Promise<ProviderDelivery>;
|
|
150
|
+
edit(thread: string, message: string, { as: _sender, deployments: _listed, files, ...body }: ProviderPost): Promise<void>;
|
|
151
151
|
delete(thread: string, message: string): Promise<void>;
|
|
152
152
|
react(thread: string, message: string, emoji: string, added: boolean): Promise<void>;
|
|
153
153
|
startTyping(thread: string, latest: string | null, status?: string): Promise<void>;
|
package/dist/cli-commands.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as OptionName, c as globalOptions, d as options, f as usage, i as CliOption, l as groups, n as CliCommand, o as commands, r as CliExample, s as filters, t as CliArgument, u as option } from "./commands-
|
|
1
|
+
import { a as OptionName, c as globalOptions, d as options, f as usage, i as CliOption, l as groups, n as CliCommand, o as commands, r as CliExample, s as filters, t as CliArgument, u as option } from "./commands-DewS14_P.mjs";
|
|
2
2
|
export { CliArgument, CliCommand, CliExample, CliOption, OptionName, commands, filters, globalOptions, groups, option, options, usage };
|
package/dist/cli-commands.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as option, i as groups, n as filters, o as options, r as globalOptions, s as usage, t as commands } from "./commands-
|
|
1
|
+
import { a as option, i as groups, n as filters, o as options, r as globalOptions, s as usage, t as commands } from "./commands-CqdnjUkm.mjs";
|
|
2
2
|
export { commands, filters, globalOptions, groups, option, options, usage };
|
package/dist/cli-embedded.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { f as Board } from "./backend-
|
|
2
|
-
import "./index-
|
|
1
|
+
import { f as Board } from "./backend-D6yTo8Un.mjs";
|
|
2
|
+
import "./index-Djmr4GzQ.mjs";
|
|
3
3
|
//#region src/cli/failure.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* What kind of failure it is, which fixes the exit code: 2 for `usage` and `missing_input`, 130
|
package/dist/cli-embedded.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as stoppedBy } from "./exports-
|
|
2
|
-
import { a as commandLine, c as failureLines, i as mainWith, l as formatFailure, n as commandWord, o as exitCode, r as main, s as failureDocument, t as Failed } from "./main-
|
|
1
|
+
import { r as stoppedBy } from "./exports-DCf75prP.mjs";
|
|
2
|
+
import { a as commandLine, c as failureLines, i as mainWith, l as formatFailure, n as commandWord, o as exitCode, r as main, s as failureDocument, t as Failed } from "./main-DmsdcUZ_.mjs";
|
|
3
3
|
//#region src/cli/embedded.ts
|
|
4
4
|
/**
|
|
5
5
|
* Board's CLI as `appName` names it in help, usage, and errors (`vercel board`). With no board
|
package/dist/cli.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as option } from "./commands-
|
|
3
|
-
import { f as projectDir } from "./server-
|
|
4
|
-
import { r as main } from "./main-
|
|
5
|
-
import { n as stopped, r as startInspector } from "./inspect-
|
|
2
|
+
import { a as option } from "./commands-CqdnjUkm.mjs";
|
|
3
|
+
import { f as projectDir } from "./server-CcvxkXzG.mjs";
|
|
4
|
+
import { r as main } from "./main-DmsdcUZ_.mjs";
|
|
5
|
+
import { n as stopped, r as startInspector } from "./inspect-B0_aKQM8.mjs";
|
|
6
6
|
import { appendFile, readFile } from "node:fs/promises";
|
|
7
7
|
import { join } from "node:path";
|
|
8
8
|
//#region src/cli/local.ts
|
|
@@ -22,15 +22,22 @@ const local = {
|
|
|
22
22
|
name: "inspect",
|
|
23
23
|
description: "the board in your browser, as you: read, post, react (local only)",
|
|
24
24
|
arguments: [],
|
|
25
|
-
options: [
|
|
25
|
+
options: [
|
|
26
|
+
option("port", "the port to listen on (default: a free one)"),
|
|
27
|
+
option("no-open"),
|
|
28
|
+
option("allow-host")
|
|
29
|
+
],
|
|
26
30
|
examples: [{
|
|
27
31
|
name: "open the board in your browser",
|
|
28
32
|
value: "inspect"
|
|
33
|
+
}, {
|
|
34
|
+
name: "serve it behind a proxy on another name",
|
|
35
|
+
value: "inspect --allow-host box.tailnet.ts.net"
|
|
29
36
|
}]
|
|
30
37
|
},
|
|
31
38
|
async run(args, context) {
|
|
32
39
|
if (args.length > 0) throw context.usage("inspect takes no arguments: pass its port with --port.");
|
|
33
|
-
return (await import("./inspect-
|
|
40
|
+
return (await import("./inspect-CULoD54F.mjs")).inspect(context);
|
|
34
41
|
}
|
|
35
42
|
},
|
|
36
43
|
serve: {
|
|
@@ -53,7 +60,7 @@ const local = {
|
|
|
53
60
|
if (args.length > 0) throw usage("serve takes no arguments: pass its port with --port, and its directory with --dir.");
|
|
54
61
|
const port = portFlag();
|
|
55
62
|
const root = projectDir();
|
|
56
|
-
const { serveLocal } = await import("./serve-
|
|
63
|
+
const { serveLocal } = await import("./serve-bPSEx_8X.mjs");
|
|
57
64
|
const local = await serveLocal({
|
|
58
65
|
dir: flags.dir ?? join(root, ".board"),
|
|
59
66
|
...port !== void 0 ? { port } : {}
|
|
@@ -112,7 +112,7 @@ const options = {
|
|
|
112
112
|
type: "string",
|
|
113
113
|
multiple: true,
|
|
114
114
|
value: "file",
|
|
115
|
-
description: "attach a file"
|
|
115
|
+
description: "attach a file, up to 10 per message"
|
|
116
116
|
},
|
|
117
117
|
"text-file": {
|
|
118
118
|
type: "string",
|
|
@@ -165,6 +165,12 @@ const options = {
|
|
|
165
165
|
type: "boolean",
|
|
166
166
|
description: "don't open the browser"
|
|
167
167
|
},
|
|
168
|
+
"allow-host": {
|
|
169
|
+
type: "string",
|
|
170
|
+
multiple: true,
|
|
171
|
+
value: "host",
|
|
172
|
+
description: "also answer requests for this host, from a proxy in front: whoever reaches it there acts as you"
|
|
173
|
+
},
|
|
168
174
|
in: {
|
|
169
175
|
type: "string",
|
|
170
176
|
value: "duration",
|
|
@@ -162,7 +162,7 @@ declare const options: {
|
|
|
162
162
|
readonly type: 'string';
|
|
163
163
|
readonly multiple: true;
|
|
164
164
|
readonly value: 'file';
|
|
165
|
-
readonly description: 'attach a file';
|
|
165
|
+
readonly description: 'attach a file, up to 10 per message';
|
|
166
166
|
};
|
|
167
167
|
readonly 'text-file': {
|
|
168
168
|
readonly type: 'string';
|
|
@@ -215,6 +215,12 @@ declare const options: {
|
|
|
215
215
|
readonly type: 'boolean';
|
|
216
216
|
readonly description: "don't open the browser";
|
|
217
217
|
};
|
|
218
|
+
readonly 'allow-host': {
|
|
219
|
+
readonly type: 'string';
|
|
220
|
+
readonly multiple: true;
|
|
221
|
+
readonly value: 'host';
|
|
222
|
+
readonly description: 'also answer requests for this host, from a proxy in front: whoever reaches it there acts as you';
|
|
223
|
+
};
|
|
218
224
|
readonly in: {
|
|
219
225
|
readonly type: 'string';
|
|
220
226
|
readonly value: 'duration';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as BoardError } from "./errors-ZazTZh-s.mjs";
|
|
2
|
+
import "./routes-CkUetTO2.mjs";
|
|
2
3
|
import { c as canonical, t as block } from "./blocks-CVoBC7ur.mjs";
|
|
3
|
-
import { a as canText, c as compileAccess } from "./access-
|
|
4
|
+
import { a as canText, c as compileAccess } from "./access-3udXjJAg.mjs";
|
|
4
5
|
//#region src/conformance/index.ts
|
|
5
6
|
var Mismatch = class extends Error {};
|
|
6
7
|
const show = (value) => JSON.stringify(value) ?? String(value);
|
|
@@ -1576,6 +1577,71 @@ const CHECKS = [
|
|
|
1576
1577
|
}
|
|
1577
1578
|
}
|
|
1578
1579
|
},
|
|
1580
|
+
{
|
|
1581
|
+
group: "sync",
|
|
1582
|
+
name: "takes an edit of a long message in its sync's inbox, under the longest event ID the protocol allows, and refuses a longer one",
|
|
1583
|
+
run: async (ctx) => {
|
|
1584
|
+
const registered = await registerSync(ctx);
|
|
1585
|
+
if ("skip" in registered) return registered.skip;
|
|
1586
|
+
try {
|
|
1587
|
+
const run = ctx.labels.conformance;
|
|
1588
|
+
const author = {
|
|
1589
|
+
id: `${SYNC_KEY}:user:${run}`,
|
|
1590
|
+
handle: "conformance",
|
|
1591
|
+
name: "Conformance",
|
|
1592
|
+
avatar: null,
|
|
1593
|
+
isBot: false
|
|
1594
|
+
};
|
|
1595
|
+
const thread = `${SYNC_KEY}:${run}:long`;
|
|
1596
|
+
const location = {
|
|
1597
|
+
channel: `${SYNC_KEY}:${run}`,
|
|
1598
|
+
thread,
|
|
1599
|
+
subthread: null,
|
|
1600
|
+
message: "1",
|
|
1601
|
+
author
|
|
1602
|
+
};
|
|
1603
|
+
const text = (status) => `conformance: ${status}\n${"| project | deployment | preview | updated |\n".repeat(250)}`;
|
|
1604
|
+
const idOf = (kind) => `conformance-inbox-${run}-long-${kind}-`.padEnd(300, "x");
|
|
1605
|
+
const pushed = [{
|
|
1606
|
+
id: idOf("message"),
|
|
1607
|
+
event: {
|
|
1608
|
+
kind: "message",
|
|
1609
|
+
...location,
|
|
1610
|
+
isRoot: true,
|
|
1611
|
+
text: text("Building"),
|
|
1612
|
+
context: null
|
|
1613
|
+
},
|
|
1614
|
+
raw: null
|
|
1615
|
+
}, {
|
|
1616
|
+
id: idOf("edited"),
|
|
1617
|
+
event: {
|
|
1618
|
+
kind: "edited",
|
|
1619
|
+
...location,
|
|
1620
|
+
text: text("Ready")
|
|
1621
|
+
},
|
|
1622
|
+
raw: null
|
|
1623
|
+
}];
|
|
1624
|
+
for (const event of pushed) await ctx.board.inboxPush(SYNC_KEY, [event]);
|
|
1625
|
+
await refused(ctx.board.inboxPush(SYNC_KEY, [{
|
|
1626
|
+
...pushed[1],
|
|
1627
|
+
id: `${pushed[1].id}x`
|
|
1628
|
+
}]), 400, `an inbox event ID over 300 characters`);
|
|
1629
|
+
for (const { event } of pushed) {
|
|
1630
|
+
const leased = (await ctx.board.inboxNext(SYNC_KEY, { limit: 50 })).filter((item) => item.thread === thread);
|
|
1631
|
+
same(leased.length, 1, `the events leased from the platform thread, for its ${event.kind} event`);
|
|
1632
|
+
const item = leased[0];
|
|
1633
|
+
same(item.event.kind, event.kind, "the platform event leased next");
|
|
1634
|
+
same("text" in item.event ? item.event.text : null, event.text, `the ${event.kind} event's text`);
|
|
1635
|
+
await ctx.board.inboxAck(SYNC_KEY, item.id, { lease: item.lease });
|
|
1636
|
+
}
|
|
1637
|
+
} finally {
|
|
1638
|
+
await ctx.board.register({
|
|
1639
|
+
...registered.where,
|
|
1640
|
+
watch: {}
|
|
1641
|
+
}).catch(() => {});
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
},
|
|
1579
1645
|
{
|
|
1580
1646
|
group: "sync",
|
|
1581
1647
|
name: "hands a sync each message change as a match of its @sync watcher",
|
package/dist/conformance.d.mts
CHANGED
package/dist/conformance.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as conformance } from "./conformance-
|
|
1
|
+
import { t as conformance } from "./conformance-BInS4_6b.mjs";
|
|
2
2
|
export { conformance };
|
|
@@ -19,10 +19,30 @@ function same(a, b) {
|
|
|
19
19
|
const keys = Object.keys(a);
|
|
20
20
|
return keys.length === Object.keys(b).length && keys.every((key) => Object.hasOwn(b, key) && same(a[key], b[key]));
|
|
21
21
|
}
|
|
22
|
-
const DATE = /^(\d
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
const DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
|
|
23
|
+
const DAYS = [
|
|
24
|
+
0,
|
|
25
|
+
31,
|
|
26
|
+
28,
|
|
27
|
+
31,
|
|
28
|
+
30,
|
|
29
|
+
31,
|
|
30
|
+
30,
|
|
31
|
+
31,
|
|
32
|
+
31,
|
|
33
|
+
30,
|
|
34
|
+
31,
|
|
35
|
+
30,
|
|
36
|
+
31
|
|
37
|
+
];
|
|
38
|
+
const TIME = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;
|
|
39
|
+
const EMAIL = /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i;
|
|
40
|
+
const HOSTNAME = /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i;
|
|
41
|
+
const IPV4 = /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/;
|
|
42
|
+
const IPV6 = /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i;
|
|
43
|
+
const UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;
|
|
44
|
+
const URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
|
|
45
|
+
const NOT_A_FRAGMENT = /\/|:/;
|
|
26
46
|
function isDate(text) {
|
|
27
47
|
const found = DATE.exec(text);
|
|
28
48
|
if (!found) return false;
|
|
@@ -31,64 +51,32 @@ function isDate(text) {
|
|
|
31
51
|
Number(found[2]),
|
|
32
52
|
Number(found[3])
|
|
33
53
|
];
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0) ? 29 : 28,
|
|
37
|
-
31,
|
|
38
|
-
30,
|
|
39
|
-
31,
|
|
40
|
-
30,
|
|
41
|
-
31,
|
|
42
|
-
31,
|
|
43
|
-
30,
|
|
44
|
-
31,
|
|
45
|
-
30,
|
|
46
|
-
31
|
|
47
|
-
][month - 1];
|
|
48
|
-
return days !== void 0 && day >= 1 && day <= days;
|
|
54
|
+
const leap = year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
|
55
|
+
return month >= 1 && month <= 12 && day >= 1 && day <= (month === 2 && leap ? 29 : DAYS[month]);
|
|
49
56
|
}
|
|
50
57
|
function isTime(text) {
|
|
51
58
|
const found = TIME.exec(text);
|
|
52
59
|
if (!found) return false;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return parts.length === 4 && parts.every((part) => /^(?:0|[1-9]\d{0,2})$/.test(part) && Number(part) <= 255);
|
|
60
|
-
};
|
|
61
|
-
function isIpv6(text) {
|
|
62
|
-
let groups = text;
|
|
63
|
-
if (text.includes(".")) {
|
|
64
|
-
const tail = text.lastIndexOf(":");
|
|
65
|
-
if (tail === -1 || !isIpv4(text.slice(tail + 1))) return false;
|
|
66
|
-
groups = `${text.slice(0, tail + 1)}0:0`;
|
|
67
|
-
}
|
|
68
|
-
const halves = groups.split("::");
|
|
69
|
-
if (halves.length > 2) return false;
|
|
70
|
-
const parts = halves.flatMap((half) => half === "" ? [] : half.split(":"));
|
|
71
|
-
if (!parts.every((part) => /^[0-9a-f]{1,4}$/i.test(part))) return false;
|
|
72
|
-
return halves.length === 2 ? parts.length <= 7 : parts.length === 8;
|
|
60
|
+
const [hour, minute, second] = [
|
|
61
|
+
Number(found[1]),
|
|
62
|
+
Number(found[2]),
|
|
63
|
+
Number(found[3])
|
|
64
|
+
];
|
|
65
|
+
return hour <= 23 && minute <= 59 && second <= 59 || hour === 23 && minute === 59 && second === 60;
|
|
73
66
|
}
|
|
74
|
-
/** What each format takes, each in time linear in the text. */
|
|
75
67
|
const FORMATS = {
|
|
76
68
|
date: isDate,
|
|
77
69
|
time: isTime,
|
|
78
70
|
"date-time": (text) => {
|
|
79
|
-
const
|
|
80
|
-
return
|
|
81
|
-
},
|
|
82
|
-
email: (text) => {
|
|
83
|
-
const at = text.lastIndexOf("@");
|
|
84
|
-
const domain = text.slice(at + 1);
|
|
85
|
-
return at > 0 && EMAIL_NAME.test(text.slice(0, at)) && domain.includes(".") && !domain.endsWith(".") && isHostname(domain);
|
|
71
|
+
const parts = text.split(/t|\s/i);
|
|
72
|
+
return parts.length === 2 && isDate(parts[0]) && isTime(parts[1]);
|
|
86
73
|
},
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
74
|
+
email: (text) => EMAIL.test(text),
|
|
75
|
+
uri: (text) => NOT_A_FRAGMENT.test(text) && URI.test(text),
|
|
76
|
+
uuid: (text) => UUID.test(text),
|
|
77
|
+
hostname: (text) => HOSTNAME.test(text),
|
|
78
|
+
ipv4: (text) => IPV4.test(text),
|
|
79
|
+
ipv6: (text) => IPV6.test(text)
|
|
92
80
|
};
|
|
93
81
|
/** A value as a refusal shows it: its JSON, cut short. */
|
|
94
82
|
const shown = (value) => {
|
|
@@ -138,8 +126,9 @@ function problemIn(schema, value, at) {
|
|
|
138
126
|
if (Array.isArray(value)) {
|
|
139
127
|
if (typeof schema.minItems === "number" && value.length < schema.minItems) return `${it} must have at least ${schema.minItems} items`;
|
|
140
128
|
if (typeof schema.maxItems === "number" && value.length > schema.maxItems) return `${it} must have at most ${schema.maxItems} items`;
|
|
141
|
-
|
|
142
|
-
|
|
129
|
+
const places = Array.isArray(schema.items) ? schema.items : null;
|
|
130
|
+
if (schema.items !== void 0) for (let index = 0; index < (places ? Math.min(places.length, value.length) : value.length); index++) {
|
|
131
|
+
const problem = problemIn(places ? places[index] : schema.items, value[index], within(index));
|
|
143
132
|
if (problem !== null) return problem;
|
|
144
133
|
}
|
|
145
134
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { l as isThreadTarget, s as channelOf } from "./external-
|
|
1
|
+
import { C as typeOf, _ as ATTACHMENT_BYTES_MAX, r as badRequest, s as notFound, t as HttpError, x as fileSize, y as IMPORT_BYTES_MAX } from "./errors-ZazTZh-s.mjs";
|
|
2
|
+
import { C as toStorable, p as MESSAGE_TEXT_MAX, s as ChannelPath } from "./schemas-BhZaystC.mjs";
|
|
3
|
+
import { l as isThreadTarget, s as channelOf } from "./external-DfhN7lKK.mjs";
|
|
4
4
|
import { t as canonicalEmoji } from "./emoji-CTLpvH-A.mjs";
|
|
5
|
-
import { a as waitUntil, c as platformProfile, f as viaText, i as afterRetry, l as shownName, m as derivedId, o as actorParts, t as DroppedError } from "./middleware-
|
|
5
|
+
import { a as waitUntil, c as platformProfile, f as viaText, i as afterRetry, l as shownName, m as derivedId, o as actorParts, t as DroppedError } from "./middleware-BHHKHA9q.mjs";
|
|
6
6
|
import { a as replaceMentions, n as isEmail, t as extractMentions } from "./mentions-DfZGp3B-.mjs";
|
|
7
|
-
import { a as immutable, d as routesFor, l as UnreadableError, n as SyncOverrides, o as ReceivedEvent, s as ResolvedTarget, u as channelMissing } from "./events-
|
|
8
|
-
import {
|
|
7
|
+
import { a as immutable, d as opensBlock, f as routesFor, l as UnreadableError, n as SyncOverrides, o as ReceivedEvent, s as ResolvedTarget, u as channelMissing } from "./events-D17RndlV.mjs";
|
|
8
|
+
import { i as vercelDeployments, n as displayText } from "./bots-CLKKMgYf.mjs";
|
|
9
9
|
//#region src/sync/engine.ts
|
|
10
10
|
/** `files`: a message with files may have no text. */
|
|
11
11
|
const clampText = (raw, files = false) => {
|
|
@@ -312,6 +312,10 @@ function createSyncEngine(entries) {
|
|
|
312
312
|
try {
|
|
313
313
|
response = await platform.receive(key, request, (received) => intake(key, received));
|
|
314
314
|
} catch (error) {
|
|
315
|
+
if (error instanceof HttpError && error.status === 400) {
|
|
316
|
+
console.error("[board] dropped an event the board refuses", error);
|
|
317
|
+
return new Response(null, { status: 200 });
|
|
318
|
+
}
|
|
315
319
|
console.error("[board] intake failed", error);
|
|
316
320
|
return new Response("intake failed", { status: 500 });
|
|
317
321
|
}
|
|
@@ -997,15 +1001,18 @@ function createSyncEngine(entries) {
|
|
|
997
1001
|
target
|
|
998
1002
|
}));
|
|
999
1003
|
if (typeof body !== "string") throw badRequest("a provider renderer must return markdown");
|
|
1000
|
-
const
|
|
1001
|
-
|
|
1004
|
+
const labeled = `**${name}**: `;
|
|
1005
|
+
const markdown = await textFor(key, message, actors, body.startsWith(labeled) && opensBlock(body.slice(labeled.length)) ? `**${name}**:\n\n${body.slice(labeled.length)}` : body);
|
|
1006
|
+
const deployments = message.by.actor === "github:user:35613825" ? vercelDeployments(message.text) : null;
|
|
1007
|
+
return {
|
|
1002
1008
|
markdown,
|
|
1003
|
-
as: {
|
|
1009
|
+
...actor?.verified ? { as: {
|
|
1004
1010
|
name,
|
|
1005
1011
|
avatar: senderAvatar(message, actor),
|
|
1006
1012
|
attribution
|
|
1007
|
-
}
|
|
1008
|
-
|
|
1013
|
+
} } : {},
|
|
1014
|
+
...deployments ? { deployments } : {}
|
|
1015
|
+
};
|
|
1009
1016
|
}
|
|
1010
1017
|
/** An author's own picture, or for one with none or the board's built-in one, its person's Vercel avatar: `claude via julian` shows Julian. */
|
|
1011
1018
|
function senderAvatar(message, actor) {
|
|
@@ -1025,10 +1032,10 @@ function createSyncEngine(entries) {
|
|
|
1025
1032
|
*/
|
|
1026
1033
|
const renderFor = async (target, message, actors, noted = false, renderer) => {
|
|
1027
1034
|
const key = keyOf(target);
|
|
1028
|
-
const { markdown,
|
|
1035
|
+
const { markdown, ...rest } = await render(key, target, message, actors, renderer);
|
|
1029
1036
|
return {
|
|
1030
1037
|
markdown: message.attachments.length > 0 && (noted || !platformOf(key).uploadsFiles) ? `${markdown}\n${attachmentNotes(message)}` : markdown,
|
|
1031
|
-
...
|
|
1038
|
+
...rest
|
|
1032
1039
|
};
|
|
1033
1040
|
};
|
|
1034
1041
|
async function postReply(message, target, externalThread, actors, renderer) {
|