@vercel/board 0.43.0 → 0.44.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.d.mts +2 -2
- package/dist/{auth-Bn8J_1F2.d.mts → auth-C8jxty0C.d.mts} +1 -1
- package/dist/{backend-DMrK55mU.d.mts → backend-_3W_5g6y.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-DZ4DsAZ7.mjs} +6 -4
- package/dist/{chat-provider-Cgkh9xJw.d.mts → chat-provider-HQo68RWL.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 +6 -6
- package/dist/{commands-C4fR0md0.mjs → commands-B75pBXIV.mjs} +1 -1
- package/dist/{commands-BlM-ckFS.d.mts → commands-DHGZWeSZ.d.mts} +1 -1
- package/dist/{conformance-BORt5nky.mjs → conformance-CHqXZoGe.mjs} +66 -0
- 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-D07DTYSi.mjs} +16 -9
- package/dist/{events-BT8y_81j.mjs → events-voButVQW.mjs} +3 -1
- package/dist/{exports-S2AJNE_O.mjs → exports-BNk4w-b2.mjs} +10 -12
- package/dist/exports-DFwXKst5.d.mts +4 -0
- package/dist/{index-CydxnBND.d.mts → index-CwOOIT0e.d.mts} +2 -2
- package/dist/index.d.mts +6 -6
- package/dist/index.mjs +2 -2
- package/dist/index.node.d.mts +6 -6
- package/dist/index.node.mjs +1 -1
- package/dist/inspect/app.js +94 -94
- package/dist/inspect/engine.js +5 -5
- package/dist/inspect-DBLdh9NM.mjs +2 -0
- package/dist/{inspect-ByIt7CxV.mjs → inspect-dtQlHBcq.mjs} +1 -1
- package/dist/{local-0TVbQkzW.mjs → local-CnGNTReZ.mjs} +3 -1
- package/dist/{main-CM0_uZ7w.mjs → main-CpsAmpEy.mjs} +22 -37
- package/dist/origin-D4ER_Tze.mjs +428 -0
- package/dist/{provider-dY54GFNz.d.mts → provider-CVI-DlWl.d.mts} +27 -2
- package/dist/{routes-By9lmvUD.d.mts → routes-CErTwlSZ.d.mts} +3 -1
- package/dist/{origin-DoRR9yql.mjs → routes-DrByOCc1.mjs} +4 -426
- package/dist/schemas.mjs +1 -1
- package/dist/{serve-p_KKFTWm.mjs → serve-BQT5quKD.mjs} +2 -2
- package/dist/{server-CD7qe_Pl.mjs → server-FlDE6BDt.mjs} +4 -3
- 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 +206 -10
- package/dist/sync.d.mts +3 -3
- package/dist/sync.mjs +1 -1
- 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/04-reference/01-cli.md +2 -2
- package/docs/04-reference/02-board.md +1 -1
- package/docs/04-reference/03-http.md +9 -3
- package/docs/04-reference/05-conformance.md +2 -3
- package/package.json +3 -1
- package/dist/exports-Bw_OYNRl.d.mts +0 -4
- package/dist/inspect-BjDlPHjE.mjs +0 -2
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 parseCan, Bt as Can, Gt as GrantChangeRefusal, Ht as FULL_ACCESS, Kt as GrantShape, Qt as compileAccess, Rt as Access, Ut as Grant, Vt as ChannelPattern, Wt as GrantChange, Yt as Permission, Zt as checkGrantChange, an as CAN_MAX, en as union, in as Author, qt as InvalidCan, tn as Actor, zt as AccessSummary } from "./routes-CErTwlSZ.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-C8jxty0C.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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Bt as Can, Jt as Level, Rt as Access, Xt as WrittenCan, Yt as Permission } from "./routes-CErTwlSZ.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,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, Yt as Permission, a as BoardEventView, bt as SyncImportBody, c as CreateChannelBody, cn as ExternalEvent, 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 Author, jt as TypingBody, kt as ThreadsQuery, l as DeleteBody, lt as SourceJoin, n as ActorView, nt as ScheduleView, on as Labels, ot as SchemaBody, p as EventsQuery, pt as SourceReadQuery, rn as Attachment, rt as SchedulesQuery, s as ChannelView, t as AckBody, tn as Actor, 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-CErTwlSZ.mjs";
|
|
2
|
+
import { l as Known, o as Granted, p as StoredGrant, t as Authenticate } from "./auth-C8jxty0C.mjs";
|
|
3
|
+
import { I as ErrorOrigin, P as BoardClient, m as SyncProvider, z as ProfileOption } from "./provider-CVI-DlWl.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-CnGNTReZ.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
1
|
import "./external-DymyhUzl.mjs";
|
|
2
|
-
import { c as SyncProvider, s as ResolvedTarget } from "./events-
|
|
2
|
+
import { c as SyncProvider, s as ResolvedTarget } from "./events-voButVQW.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 {
|
|
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 { ft as SourceRead, ln as ExternalFile, lt as SourceJoin, sn as ExternalAuthor, tn as Actor, un as ExternalLink } from "./routes-CErTwlSZ.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-CVI-DlWl.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-DHGZWeSZ.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-B75pBXIV.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-_3W_5g6y.mjs";
|
|
2
|
+
import "./index-CwOOIT0e.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-BNk4w-b2.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-CpsAmpEy.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-B75pBXIV.mjs";
|
|
3
|
+
import { f as projectDir } from "./server-FlDE6BDt.mjs";
|
|
4
|
+
import { r as main } from "./main-CpsAmpEy.mjs";
|
|
5
|
+
import { n as stopped, r as startInspector } from "./inspect-dtQlHBcq.mjs";
|
|
6
6
|
import { appendFile, readFile } from "node:fs/promises";
|
|
7
7
|
import { join } from "node:path";
|
|
8
8
|
//#region src/cli/local.ts
|
|
@@ -30,7 +30,7 @@ const local = {
|
|
|
30
30
|
},
|
|
31
31
|
async run(args, context) {
|
|
32
32
|
if (args.length > 0) throw context.usage("inspect takes no arguments: pass its port with --port.");
|
|
33
|
-
return (await import("./inspect-
|
|
33
|
+
return (await import("./inspect-DBLdh9NM.mjs")).inspect(context);
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
serve: {
|
|
@@ -53,7 +53,7 @@ const local = {
|
|
|
53
53
|
if (args.length > 0) throw usage("serve takes no arguments: pass its port with --port, and its directory with --dir.");
|
|
54
54
|
const port = portFlag();
|
|
55
55
|
const root = projectDir();
|
|
56
|
-
const { serveLocal } = await import("./serve-
|
|
56
|
+
const { serveLocal } = await import("./serve-BQT5quKD.mjs");
|
|
57
57
|
const local = await serveLocal({
|
|
58
58
|
dir: flags.dir ?? join(root, ".board"),
|
|
59
59
|
...port !== void 0 ? { port } : {}
|
|
@@ -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';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { u as BoardError } from "./errors-DUzpDSrJ.mjs";
|
|
2
2
|
import { c as canonical, t as block } from "./blocks-CVoBC7ur.mjs";
|
|
3
|
+
import "./routes-DrByOCc1.mjs";
|
|
3
4
|
import { a as canText, c as compileAccess } from "./access-BgBiaCyx.mjs";
|
|
4
5
|
//#region src/conformance/index.ts
|
|
5
6
|
var Mismatch = class extends Error {};
|
|
@@ -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-CHqXZoGe.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
|
}
|
|
@@ -4,8 +4,8 @@ import { l as isThreadTarget, s as channelOf } from "./external-DymyhUzl.mjs";
|
|
|
4
4
|
import { t as canonicalEmoji } from "./emoji-CTLpvH-A.mjs";
|
|
5
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-0DUFrav-.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-voButVQW.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) {
|
|
@@ -228,6 +228,8 @@ var SyncProvider = class {
|
|
|
228
228
|
return `**${input.label}**: ${input.message.text}`;
|
|
229
229
|
}
|
|
230
230
|
};
|
|
231
|
+
/** Whether a text opens a block (a code fence, a list, a heading, a quote, a table), which is one only at a line's start. */
|
|
232
|
+
const opensBlock = (text) => /^(```|~~~|[-*+] |\d+[.)] |#{1,6} |>|\|)/.test(text);
|
|
231
233
|
//#endregion
|
|
232
234
|
//#region src/sync/events.ts
|
|
233
235
|
const EventBase = z.object({
|
|
@@ -300,4 +302,4 @@ function immutable(value) {
|
|
|
300
302
|
return value;
|
|
301
303
|
}
|
|
302
304
|
//#endregion
|
|
303
|
-
export { immutable as a, SyncProvider as c,
|
|
305
|
+
export { withRoutes as _, immutable as a, SyncProvider as c, opensBlock as d, routesFor as f, render as g, mirror as h, eventSchema as i, UnreadableError as l, into as m, SyncOverrides as n, ReceivedEvent as o, channels as p, envelope as r, ResolvedTarget as s, EventBase as t, channelMissing as u };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { _ as IMPORT_BYTES_MAX, a as forbidden, b as mediaType, c as toErrorResponse, d as createBoardClient, f as duration, h as ATTACHMENT_BYTES_MAX, l as unauthorized, n as RejectedError, o as json, p as formatProfileHeader, r as badRequest, s as notFound, t as HttpError, u as BoardError, v as fileName } from "./errors-DUzpDSrJ.mjs";
|
|
2
2
|
import { h as RemoteWatcherId } from "./schemas-DAzSsgWk.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { A as
|
|
3
|
+
import { n as blocksIn, r as findBlocks } from "./blocks-CVoBC7ur.mjs";
|
|
4
|
+
import { A as SyncReceiptBody, C as SchemaBody, D as SyncCopiesQuery, E as SyncBody, F as routes, M as TypingBody, N as UpdateGrantBody, O as SyncFindQuery, P as UploadStartBody, S as SchedulesQuery, T as SourceReadQuery, _ as PostBody, a as EventsQuery, b as RegisterBody, c as GrantBody, d as InboxPushBody, f as InboxQuery, g as MessagesQuery, h as MatchesQuery, i as EditBody, j as ThreadsQuery, k as SyncImportBody, l as InboxAckBody, m as LinkedQuery, n as CreateChannelBody, o as ExplainQuery, p as LabelBody, r as DeleteBody, t as AckBody, u as InboxNextQuery, v as ReactBody, w as SourceJoinBody, x as ScheduleBody, y as Ref } from "./routes-DrByOCc1.mjs";
|
|
5
5
|
import { _ as sha256, a as waitUntil, c as platformProfile, d as userIdOf, m as derivedId, o as actorParts, r as runMiddleware, s as importedHandle, t as DroppedError, u as underPrincipal } from "./middleware-0DUFrav-.mjs";
|
|
6
|
+
import { a as compileWatcher, c as METHODS, d as queryObject, f as readCapped, h as VERSION, i as runMatch, l as createRouter, m as SYNC, n as syncTarget, p as readJson, r as canonicalWatchers, t as SYNC_ACTOR, u as openapi } from "./origin-D4ER_Tze.mjs";
|
|
6
7
|
import { a as canText, c as compileAccess, d as parsePattern, n as InvalidCan, r as PERMISSIONS, t as FULL_ACCESS, u as parseCan } from "./access-BgBiaCyx.mjs";
|
|
7
8
|
import { C as explainGrants, b as verifiesTokens, d as grantIssuers, f as hostPrincipal, i as VERCEL_ISSUER, l as createAuthority, t as DEFAULT_CAN$1, u as fromTokens, y as verifiedIssuers } from "./auth-Ft4AJptx.mjs";
|
|
8
9
|
import { a as resolveActor, o as viaOf, r as claimsOf, t as KNOWN_AGENTS } from "./actors-DkZsnMgA.mjs";
|
|
9
|
-
import { t as checkValue } from "./data-values-
|
|
10
|
+
import { t as checkValue } from "./data-values-CoTP0SQG.mjs";
|
|
10
11
|
//#region src/server/registrant.ts
|
|
11
12
|
/** Registering again this soon after the same registration only repeats it. */
|
|
12
13
|
const REGISTER_EVERY_MS = 1e4;
|
|
@@ -2793,21 +2794,18 @@ function createVercel(options, environment) {
|
|
|
2793
2794
|
});
|
|
2794
2795
|
},
|
|
2795
2796
|
async schemas(caller, _input, signal) {
|
|
2796
|
-
const
|
|
2797
|
+
const who = whoOf(caller);
|
|
2798
|
+
const schemas = (await all(who, await onBoard(who, "/schemas"), "schemas", {}, signal)).map(schemaFrom);
|
|
2797
2799
|
const order = (schema) => schema.builtIn ? 0 : 1;
|
|
2798
2800
|
return { schemas: schemas.sort((a, b) => order(a) - order(b) || (a.builtIn ? 0 : a.name < b.name ? -1 : a.name > b.name ? 1 : a.version - b.version)) };
|
|
2799
2801
|
},
|
|
2800
2802
|
async schema(caller, { id }, signal) {
|
|
2801
|
-
const
|
|
2803
|
+
const who = whoOf(caller);
|
|
2804
|
+
const { schema } = await api(who, "GET", await onBoard(who, `/schemas/${encodeURIComponent(id)}`), signal ? { signal } : {});
|
|
2802
2805
|
return { schema: schemaFrom(schema) };
|
|
2803
2806
|
},
|
|
2804
2807
|
async createSchema(caller, input, signal) {
|
|
2805
|
-
const
|
|
2806
|
-
const there = await api(who, "GET", `/schemas/${encodeURIComponent(schemaId(input.name, input.version))}`, signal ? { signal } : {}).then(() => true, (error) => {
|
|
2807
|
-
if (error instanceof HttpError && error.code === "schema_not_found") return false;
|
|
2808
|
-
throw error;
|
|
2809
|
-
});
|
|
2810
|
-
const { schema } = await api(who, "POST", "/schemas", {
|
|
2808
|
+
const { schema, created } = await api(whoOf(caller), "POST", "/schemas", {
|
|
2811
2809
|
body: {
|
|
2812
2810
|
operationId: operationId(),
|
|
2813
2811
|
...input
|
|
@@ -2816,7 +2814,7 @@ function createVercel(options, environment) {
|
|
|
2816
2814
|
});
|
|
2817
2815
|
return {
|
|
2818
2816
|
schema: schemaFrom(schema),
|
|
2819
|
-
created
|
|
2817
|
+
created
|
|
2820
2818
|
};
|
|
2821
2819
|
},
|
|
2822
2820
|
async schedule(caller, input, signal) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { f as Board, p as BoardOptions } from "./backend-
|
|
2
|
-
import "./exports-
|
|
1
|
+
import { f as Board, p as BoardOptions } from "./backend-_3W_5g6y.mjs";
|
|
2
|
+
import "./exports-DFwXKst5.mjs";
|
|
3
3
|
//#region src/server/index.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* The handle on a board. Without a `backend`, it's Vercel's board for your team, the one `name`
|