@vercel/board 0.34.0 → 0.36.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-CdBcYPQH.mjs → access-BsP0hvcC.mjs} +1 -1
- package/dist/access.d.mts +2 -2
- package/dist/access.mjs +4 -4
- package/dist/{actors-MrIEr9LI.mjs → actors-DFOpTw89.mjs} +2 -2
- package/dist/{auth-aaoKt5DK.d.mts → auth-C21V0EK1.d.mts} +1 -1
- package/dist/{auth-DjoJygbG.mjs → auth-CrjXLgOb.mjs} +2 -2
- package/dist/{backend-u1sVvybh.d.mts → backend-D21q8mdm.d.mts} +3 -3
- package/dist/backend-local.d.mts +1 -1
- package/dist/backend-local.mjs +1 -1
- package/dist/{chat-provider-9hCT654s.mjs → chat-provider-Bb-jeJLY.mjs} +2 -2
- package/dist/{chat-provider-De0iDnUB.d.mts → chat-provider-DmZCmBkb.d.mts} +2 -2
- 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 +1 -1
- package/dist/cli.mjs +5 -5
- package/dist/{commands-B8oZEByR.mjs → commands-BLtqSwha.mjs} +324 -26
- package/dist/{commands-BkVMdXP1.d.mts → commands-DGID-4Z2.d.mts} +175 -0
- package/dist/{conformance-gqYBkXFS.mjs → conformance-CKrwglzA.mjs} +480 -87
- package/dist/conformance.d.mts +20 -2
- package/dist/conformance.mjs +1 -1
- package/dist/{engine-rtOVWsiF.mjs → engine-B_prP0b8.mjs} +4 -4
- package/dist/{errors-D8ifv16L.mjs → errors-rYDxZEuN.mjs} +98 -4
- package/dist/{events-IQg0k281.mjs → events-AEKh9tJm.mjs} +1 -1
- package/dist/exports-BxljH73E.d.mts +4 -0
- package/dist/{exports-Bx2dGpzr.mjs → exports-Ck4Xu3OV.mjs} +135 -24
- package/dist/{external-CYe424fO.mjs → external-BA2aCC_3.mjs} +1 -1
- package/dist/{index-D6mK0Ial.d.mts → index-LREsSZb2.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 +32 -32
- package/dist/{local-CPz22MQ8.mjs → local-DJ_qI9q7.mjs} +10 -10
- package/dist/{main-DScDKwQN.mjs → main-Jz4nbNJi.mjs} +409 -24
- package/dist/{memory-7RRnLa4X.mjs → memory-DqwXlyK4.mjs} +2 -2
- package/dist/{middleware-BjYpk4yq.mjs → middleware-BxgizazV.mjs} +1 -1
- package/dist/{provider-hB8QNrwm.d.mts → provider-DEOfc4Ls.d.mts} +21 -3
- package/dist/{routes-De4W6lEs.d.mts → routes-BpKdMvgX.d.mts} +19 -8
- package/dist/{serve-B1noQRkn.mjs → serve-Puf3I-oI.mjs} +4 -4
- package/dist/{server-Ov6GBJ8j.mjs → server-CS-1aeTl.mjs} +6 -6
- package/dist/{serving-2s7lqSBS.mjs → serving-6_bhBNAW.mjs} +1 -1
- package/dist/{sql-BQzKUqQt.mjs → sql-aetuEBZC.mjs} +1 -1
- package/dist/{sqlite-DCtZFEVm.mjs → sqlite-DvsB8ENQ.mjs} +2 -2
- package/dist/{sqlite-db-qLTs52Ny.mjs → sqlite-db-BPwRoDI7.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 +2 -2
- package/dist/sync-slack.d.mts +3 -3
- package/dist/sync-slack.mjs +3 -3
- package/dist/sync.d.mts +2 -2
- package/dist/sync.mjs +2 -2
- package/dist/{targets-aMdbp84G.mjs → targets-Dk_xgS9q.mjs} +10 -6
- package/dist/{tokens-LHLrnV_P.mjs → tokens-Dn4cPZIr.mjs} +2 -2
- package/docs/01-board/01-mounting.md +7 -2
- package/docs/01-board/03-identity.md +1 -1
- package/docs/01-board/09-access.md +31 -0
- package/docs/03-guides/03-ci.md +5 -3
- package/docs/04-reference/01-cli.md +98 -14
- package/docs/04-reference/02-board.md +28 -3
- package/docs/04-reference/03-http.md +1 -1
- package/docs/04-reference/05-conformance.md +31 -5
- package/package.json +1 -1
- package/dist/exports-uwRl5qIj.d.mts +0 -4
package/dist/conformance.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as Board } from "./backend-
|
|
1
|
+
import { d as Board } from "./backend-D21q8mdm.mjs";
|
|
2
2
|
//#region src/conformance/index.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Checks that a board speaks the protocol, through a handle on it (`conformance(board())`), as
|
|
@@ -30,7 +30,25 @@ export type ConformanceOptions = {
|
|
|
30
30
|
* that check is skipped.
|
|
31
31
|
*/
|
|
32
32
|
withToken?: (secret: string) => Board;
|
|
33
|
+
/**
|
|
34
|
+
* Whom the grants checks name. A board that verifies tokens itself (`vb serve`) takes the made-up
|
|
35
|
+
* IDs they use without it; one that looks names up, as Vercel's API does, needs real ones on its
|
|
36
|
+
* team, or skips the checks that name them: a `project` (its name or ID), a GitHub `repository`
|
|
37
|
+
* no grant names, a `viewer` (a person's email or ID whose team role is viewer), to check
|
|
38
|
+
* that a role caps what grants give, and an `app` installed on the board's team (its slug or
|
|
39
|
+
* client ID), which a local board has none of. None may be the run's own: it throws before it
|
|
40
|
+
* writes.
|
|
41
|
+
*/
|
|
42
|
+
principals?: {
|
|
43
|
+
project?: string;
|
|
44
|
+
repository?: string;
|
|
45
|
+
viewer?: string;
|
|
46
|
+
app?: string;
|
|
47
|
+
};
|
|
33
48
|
};
|
|
34
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* Runs the checks against `board`, in order, and reports each. It never throws for what the board
|
|
51
|
+
* answers; it throws before it writes anything when `principals` names the run itself.
|
|
52
|
+
*/
|
|
35
53
|
export declare function conformance(board: Board, options?: ConformanceOptions): Promise<ConformanceReport>;
|
|
36
54
|
//#endregion
|
package/dist/conformance.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as conformance } from "./conformance-
|
|
1
|
+
import { t as conformance } from "./conformance-CKrwglzA.mjs";
|
|
2
2
|
export { conformance };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { _ as fileSize, h as IMPORT_BYTES_MAX, p as ATTACHMENT_BYTES_MAX, r as badRequest, s as notFound, t as HttpError, y as typeOf } from "./errors-
|
|
1
|
+
import { _ as fileSize, h as IMPORT_BYTES_MAX, p as ATTACHMENT_BYTES_MAX, r as badRequest, s as notFound, t as HttpError, y as typeOf } from "./errors-rYDxZEuN.mjs";
|
|
2
2
|
import { a as ChannelPath, b as toStorable, d as MESSAGE_TEXT_MAX } from "./schemas-BG205xds.mjs";
|
|
3
|
-
import { l as isThreadTarget, s as channelOf } from "./external-
|
|
3
|
+
import { l as isThreadTarget, s as channelOf } from "./external-BA2aCC_3.mjs";
|
|
4
4
|
import { t as canonicalEmoji } from "./emoji-CTLpvH-A.mjs";
|
|
5
|
-
import { i as waitUntil, o as derivedId, t as DroppedError } from "./middleware-
|
|
5
|
+
import { i as waitUntil, o as derivedId, t as DroppedError } from "./middleware-BxgizazV.mjs";
|
|
6
6
|
import { n as replaceMentions } from "./mentions-CB6ShY4R.mjs";
|
|
7
7
|
import { t as afterRetry } from "./attempts-HXcskN1w.mjs";
|
|
8
|
-
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 { a as immutable, d as routesFor, l as UnreadableError, n as SyncOverrides, o as ReceivedEvent, s as ResolvedTarget, u as channelMissing } from "./events-AEKh9tJm.mjs";
|
|
9
9
|
import { t as displayText } from "./bots-CGkO76qH.mjs";
|
|
10
10
|
//#region src/sync/engine.ts
|
|
11
11
|
/** `files`: a message with files may have no text. */
|
|
@@ -163,6 +163,34 @@ function queryString(query) {
|
|
|
163
163
|
const text = params.toString();
|
|
164
164
|
return text ? `?${text}` : "";
|
|
165
165
|
}
|
|
166
|
+
/** A `can` as the wire takes it: `'none'` at a pattern is `[]`. */
|
|
167
|
+
function wireCan(can) {
|
|
168
|
+
if (can === null || typeof can !== "object" || Array.isArray(can)) return can;
|
|
169
|
+
return Object.fromEntries(Object.entries(can).map(([pattern, grant]) => [pattern, grant === "none" ? [] : grant]));
|
|
170
|
+
}
|
|
171
|
+
/** A principal to grant as the wire takes it: a project's environments, and every project's, are production when left out. */
|
|
172
|
+
const withEnvironments = (principal) => (principal.kind === "project" || principal.kind === "all-projects") && principal.environments === void 0 ? {
|
|
173
|
+
...principal,
|
|
174
|
+
environments: ["production"]
|
|
175
|
+
} : principal;
|
|
176
|
+
/**
|
|
177
|
+
* The principal a private channel lets its creator in as, from what `/me` says it is: a person's
|
|
178
|
+
* user, or a deployment's project in the environment it runs in. Anyone else is refused before
|
|
179
|
+
* anything is written.
|
|
180
|
+
*/
|
|
181
|
+
function creatorOf(me, path) {
|
|
182
|
+
const [source, kind, id, environment] = me.principal.split(":");
|
|
183
|
+
if ((source === "vercel" || source === "local") && kind === "user" && id) return {
|
|
184
|
+
kind: "user",
|
|
185
|
+
userId: me.principal.split(":").slice(2).join(":")
|
|
186
|
+
};
|
|
187
|
+
if (source === "vercel" && kind === "project" && id && environment) return {
|
|
188
|
+
kind: "project",
|
|
189
|
+
project: id,
|
|
190
|
+
environments: [environment]
|
|
191
|
+
};
|
|
192
|
+
throw new BoardError("no_own_principal", `A private channel lets its creator in, as a person or a project's deployment, and ${me.principal} is neither, so ${path} wasn't made.`, 400, { hint: "Make it as a person or a deployment, or make it and its grants yourself." });
|
|
193
|
+
}
|
|
166
194
|
const written = (value, unknownMentions) => unknownMentions?.length ? {
|
|
167
195
|
...value,
|
|
168
196
|
unknownMentions
|
|
@@ -236,8 +264,64 @@ function createBoardClient(options) {
|
|
|
236
264
|
/**
|
|
237
265
|
* Makes a channel before anything posts to it, as a first post would. Needs `read` and `post`
|
|
238
266
|
* there. `created` is false when it was there already; it's left as it is.
|
|
267
|
+
*
|
|
268
|
+
* `private` makes it closed to everyone but you, from the protocol's own methods: a grant
|
|
269
|
+
* letting you in at `<path>/`, then one closing `<path>/` to everyone else, then the channel,
|
|
270
|
+
* answering the two grants as `grants`. A failure part way leaves the channel open with a grant
|
|
271
|
+
* too many, or closed and not made yet, and never shuts you out. Before it writes anything, it
|
|
272
|
+
* refuses a caller that's neither a person nor a project's deployment (400 `no_own_principal`),
|
|
273
|
+
* one that can't list grants, a path a grant other than `*`'s reaches already (409
|
|
274
|
+
* `channel_granted`: the channel, `<path>/`, or a pattern under it, whose grants would still let
|
|
275
|
+
* in whoever they name), and a path where it or a channel under it is there already (409
|
|
276
|
+
* `channel_exists`), since closing `security/` closes `security/incidents` too. A board that
|
|
277
|
+
* keeps no grants fails on the listing, with nothing made. Once its own grant is made it lists
|
|
278
|
+
* them again, and takes its own back when another reaches the path, so of two callers making
|
|
279
|
+
* the same channel at once, at most one keeps a way in; and once the lock is made, it lists them
|
|
280
|
+
* a last time, and takes both back when a grant made in between still reaches the path, or its
|
|
281
|
+
* own two aren't as it made them (someone added themselves to its grant, or opened the lock).
|
|
239
282
|
*/
|
|
240
|
-
createChannel: (path
|
|
283
|
+
createChannel: async (path, options = {}) => {
|
|
284
|
+
if (!options.private) return call("POST", "/channels", { body: { path } });
|
|
285
|
+
const creator = creatorOf(await call("GET", "/me"), path);
|
|
286
|
+
const pattern = `${path}/`;
|
|
287
|
+
const reaching = async () => (await call("GET", "/grants")).grants.filter((grant) => Object.keys(grant.can).some((at) => at === path || at.startsWith(pattern)));
|
|
288
|
+
const granted = (grants, mine = []) => {
|
|
289
|
+
const changed = grants.filter((grant) => mine.some((ours) => ours.id === grant.id)).map((grant) => grant.id);
|
|
290
|
+
if (changed.length === grants.length) return new BoardError("channel_granted", `${changed.join(" and ")} changed while ${path} was being made, so a private ${path} wouldn't be yours alone: nothing was made.`, 409);
|
|
291
|
+
const named = grants.filter((grant) => !changed.includes(grant.id)).map((grant) => grant.id);
|
|
292
|
+
return new BoardError("channel_granted", `${named.length === 1 ? named[0] : `${named.slice(0, -1).join(", ")} and ${named.at(-1)}`} already ${named.length === 1 ? "grants" : "grant"} in ${path}, so a private ${path} wouldn't be yours alone: nothing was made.`, 409, { hint: named.length === 1 ? `Revoke it first: vb grants revoke ${named[0]}` : "Revoke them first, each with vb grants revoke <id>." });
|
|
293
|
+
};
|
|
294
|
+
const before = await reaching();
|
|
295
|
+
if (before.length > 0) throw granted(before);
|
|
296
|
+
const there = (await call("GET", "/channels")).channels.find((channel) => channel.path === path || channel.path.startsWith(pattern));
|
|
297
|
+
if (there) throw new BoardError("channel_exists", there.path === path ? `${path} is a channel already, so it stays as it is.` : `${there.path} is a channel already, and a private ${path} would close it too, so nothing was made.`, 409, { hint: `Close it with a grant: everyone at ${pattern} with 'none'.` });
|
|
298
|
+
const own = await call("POST", "/grants", { body: {
|
|
299
|
+
principals: [creator],
|
|
300
|
+
can: { [pattern]: "all" }
|
|
301
|
+
} });
|
|
302
|
+
const others = (grants, mine) => grants.filter((grant) => {
|
|
303
|
+
const made = mine.find((ours) => ours.id === grant.id);
|
|
304
|
+
return made === void 0 || JSON.stringify([grant.principals, grant.can]) !== JSON.stringify([made.principals, made.can]);
|
|
305
|
+
});
|
|
306
|
+
const raced = others(await reaching(), [own.grant]);
|
|
307
|
+
if (raced.length > 0) {
|
|
308
|
+
await call("POST", `/grants/${encodeURIComponent(own.grant.id)}/revoke`, { body: {} });
|
|
309
|
+
throw granted(raced, [own.grant]);
|
|
310
|
+
}
|
|
311
|
+
const closed = await call("POST", "/grants", { body: {
|
|
312
|
+
principals: [{ kind: "everyone" }],
|
|
313
|
+
can: { [pattern]: [] }
|
|
314
|
+
} });
|
|
315
|
+
const late = others(await reaching(), [own.grant, closed.grant]);
|
|
316
|
+
if (late.length > 0) {
|
|
317
|
+
for (const id of [closed.grant.id, own.grant.id]) await call("POST", `/grants/${encodeURIComponent(id)}/revoke`, { body: {} });
|
|
318
|
+
throw granted(late, [own.grant, closed.grant]);
|
|
319
|
+
}
|
|
320
|
+
return {
|
|
321
|
+
...await call("POST", "/channels", { body: { path } }),
|
|
322
|
+
grants: [own.grant, closed.grant]
|
|
323
|
+
};
|
|
324
|
+
},
|
|
241
325
|
actors: async () => (await call("GET", "/actors")).actors,
|
|
242
326
|
messages: (query = {}) => call("GET", `/messages${queryString(query)}`),
|
|
243
327
|
thread: (id) => call("GET", `/messages/${path(id)}`),
|
|
@@ -282,9 +366,16 @@ function createBoardClient(options) {
|
|
|
282
366
|
* specific pattern among the grants that name a caller decides, then the closest principal,
|
|
283
367
|
* and grants tied there add up. Needs manage at each pattern `can` names.
|
|
284
368
|
*/
|
|
285
|
-
createGrant: (input) => call("POST", "/grants", { body:
|
|
369
|
+
createGrant: (input) => call("POST", "/grants", { body: {
|
|
370
|
+
principals: input.principals.map(withEnvironments),
|
|
371
|
+
can: wireCan(input.can)
|
|
372
|
+
} }),
|
|
286
373
|
/** Adds and removes principals (by who they are, environments aside), or replaces its `can`. Needs what `checkGrantChange` says, for the grant as it was and as it'd be. */
|
|
287
|
-
updateGrant: (id,
|
|
374
|
+
updateGrant: (id, { add, remove, can }) => call("PATCH", `/grants/${path(id)}`, { body: {
|
|
375
|
+
...add ? { add: add.map(withEnvironments) } : {},
|
|
376
|
+
...remove ? { remove } : {},
|
|
377
|
+
...can ? { can: wireCan(can) } : {}
|
|
378
|
+
} }),
|
|
288
379
|
/**
|
|
289
380
|
* Which grants decide `channel`, and what they give: for you, or with manage at `*`, for the
|
|
290
381
|
* principal `principal` names (`{ user }`, `{ project, environment }`, `{ github, workflow,
|
|
@@ -306,7 +397,10 @@ function createBoardClient(options) {
|
|
|
306
397
|
* given: for a widget, a sandbox, a script. `secret` shows only here. It lives 30 days, or
|
|
307
398
|
* `expires`, at most 90.
|
|
308
399
|
*/
|
|
309
|
-
createToken: (input) => call("POST", "/tokens", { body: input
|
|
400
|
+
createToken: (input) => call("POST", "/tokens", { body: input.can === void 0 ? input : {
|
|
401
|
+
...input,
|
|
402
|
+
can: wireCan(input.can)
|
|
403
|
+
} }),
|
|
310
404
|
/** Your live tokens, or everyone's with manage in every channel. Never their secrets. */
|
|
311
405
|
tokens: async () => (await call("GET", "/tokens")).tokens,
|
|
312
406
|
/** It and every token minted with it stop. `revoked` is false when it was already revoked. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as LabelKey, u as Labels } from "./schemas-BG205xds.mjs";
|
|
2
|
-
import { n as ExternalEvent, r as ExternalLocation } from "./external-
|
|
2
|
+
import { n as ExternalEvent, r as ExternalLocation } from "./external-BA2aCC_3.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/sync/fn.ts
|
|
5
5
|
const ROUTES = Symbol.for("board.syncRoutes");
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { a as forbidden, c as toErrorResponse, d as createBoardClient, f as duration, g as fileName, h as IMPORT_BYTES_MAX, l as unauthorized, n as RejectedError, o as json, p as ATTACHMENT_BYTES_MAX, r as badRequest, s as notFound, t as HttpError, u as BoardError, v as mediaType } from "./errors-
|
|
1
|
+
import { a as forbidden, c as toErrorResponse, d as createBoardClient, f as duration, g as fileName, h as IMPORT_BYTES_MAX, l as unauthorized, n as RejectedError, o as json, p as ATTACHMENT_BYTES_MAX, r as badRequest, s as notFound, t as HttpError, u as BoardError, v as mediaType } from "./errors-rYDxZEuN.mjs";
|
|
2
2
|
import { m as RemoteWatcherId } from "./schemas-BG205xds.mjs";
|
|
3
|
-
import { A as MessagesQuery, B as SyncCopiesQuery, C as InboxAckBody, D as LabelBody, E as InboxQuery, F as ScheduleBody, G as TokenBody, H as SyncImportBody, I as SchedulesQuery, J as UploadStartBody, K as TypingBody, L as SourceJoinBody, M as ReactBody, N as Ref, O as LinkedQuery, P as RegisterBody, R as SourceReadQuery, S as GrantBody, T as InboxPushBody, U as SyncReceiptBody, V as SyncFindQuery, W as ThreadsQuery, _ as CreateChannelBody, a as compileWatcher, b as EventsQuery, c as METHODS, d as queryObject, f as readCapped, g as AckBody, h as VERSION, i as canonicalWatchers, j as PostBody, k as MatchesQuery, l as createRouter, m as SYNC, n as syncTarget, p as readJson, q as UpdateGrantBody, r as withEmailMentions, t as mentionsEmails, u as openapi, v as DeleteBody, w as InboxNextQuery, x as ExplainQuery, y as EditBody, z as SyncBody } from "./targets-
|
|
4
|
-
import { i as waitUntil, l as sha256, o as derivedId, r as runMiddleware, t as DroppedError } from "./middleware-
|
|
5
|
-
import { d as scopeOf, l as parsePattern, r as PERMISSIONS, s as compileAccess, u as parseScope } from "./access-
|
|
6
|
-
import { S as verifiesTokens, T as explainGrants, a as VERCEL_ISSUER, d as fromTokens, f as grantIssuers, p as hostPrincipal, u as createAuthority, x as verifiedIssuers, y as tokenHash } from "./auth-
|
|
7
|
-
import { i as resolveActor, r as claimsOf, t as KNOWN_AGENTS } from "./actors-
|
|
3
|
+
import { A as MessagesQuery, B as SyncCopiesQuery, C as InboxAckBody, D as LabelBody, E as InboxQuery, F as ScheduleBody, G as TokenBody, H as SyncImportBody, I as SchedulesQuery, J as UploadStartBody, K as TypingBody, L as SourceJoinBody, M as ReactBody, N as Ref, O as LinkedQuery, P as RegisterBody, R as SourceReadQuery, S as GrantBody, T as InboxPushBody, U as SyncReceiptBody, V as SyncFindQuery, W as ThreadsQuery, _ as CreateChannelBody, a as compileWatcher, b as EventsQuery, c as METHODS, d as queryObject, f as readCapped, g as AckBody, h as VERSION, i as canonicalWatchers, j as PostBody, k as MatchesQuery, l as createRouter, m as SYNC, n as syncTarget, p as readJson, q as UpdateGrantBody, r as withEmailMentions, t as mentionsEmails, u as openapi, v as DeleteBody, w as InboxNextQuery, x as ExplainQuery, y as EditBody, z as SyncBody } from "./targets-Dk_xgS9q.mjs";
|
|
4
|
+
import { i as waitUntil, l as sha256, o as derivedId, r as runMiddleware, t as DroppedError } from "./middleware-BxgizazV.mjs";
|
|
5
|
+
import { d as scopeOf, l as parsePattern, r as PERMISSIONS, s as compileAccess, u as parseScope } from "./access-BsP0hvcC.mjs";
|
|
6
|
+
import { S as verifiesTokens, T as explainGrants, a as VERCEL_ISSUER, d as fromTokens, f as grantIssuers, p as hostPrincipal, u as createAuthority, x as verifiedIssuers, y as tokenHash } from "./auth-CrjXLgOb.mjs";
|
|
7
|
+
import { i as resolveActor, r as claimsOf, t as KNOWN_AGENTS } from "./actors-DFOpTw89.mjs";
|
|
8
8
|
//#region src/server/registrant.ts
|
|
9
9
|
/** Registering again this soon after the same registration only repeats it. */
|
|
10
10
|
const REGISTER_EVERY_MS = 1e4;
|
|
@@ -258,6 +258,17 @@ function operationId() {
|
|
|
258
258
|
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
|
|
259
259
|
}
|
|
260
260
|
const iso = (ms) => new Date(ms).toISOString();
|
|
261
|
+
/** A grant as the API answers it, its `at` in milliseconds, as the protocol has it: an ISO string. */
|
|
262
|
+
const grantFrom = (grant) => ({
|
|
263
|
+
...grant,
|
|
264
|
+
at: expiryOf(grant.at)
|
|
265
|
+
});
|
|
266
|
+
/** A token as the API answers it, its times in milliseconds, as the protocol has them. */
|
|
267
|
+
const tokenFrom = (token) => ({
|
|
268
|
+
...token,
|
|
269
|
+
at: expiryOf(token.at) ?? token.at,
|
|
270
|
+
expiresAt: expiryOf(token.expiresAt) ?? token.expiresAt
|
|
271
|
+
});
|
|
261
272
|
const idAt = (threadId, sequence) => `msg_${threadId.slice(4)}_${sequence}`;
|
|
262
273
|
/** Where a message ID points: its thread and its place in it. Null for one that isn't a message's. */
|
|
263
274
|
function locate(id) {
|
|
@@ -351,6 +362,10 @@ function createVercel(options, environment) {
|
|
|
351
362
|
} catch {}
|
|
352
363
|
if (response.ok) return body;
|
|
353
364
|
const error = body?.error;
|
|
365
|
+
if (error?.code === "board_token_scope") throw new HttpError(403, "board_token_scope", "a board token reaches only its own board, by its ID.", {
|
|
366
|
+
hint: "Name its board by URL or ID: BOARD_URL, --url, or vercel({ board }).",
|
|
367
|
+
origin: "handle"
|
|
368
|
+
});
|
|
354
369
|
throw new HttpError(response.status, error?.code ?? "remote_error", error?.message ?? `Vercel's API answered ${response.status}`);
|
|
355
370
|
}
|
|
356
371
|
/** Every page of a list, in order. */
|
|
@@ -392,7 +407,7 @@ function createVercel(options, environment) {
|
|
|
392
407
|
} });
|
|
393
408
|
return made.id;
|
|
394
409
|
} catch (error) {
|
|
395
|
-
if (error instanceof HttpError && error.code === "board_not_granted") throw notLetIn(
|
|
410
|
+
if (error instanceof HttpError && error.code === "board_not_granted") throw notLetIn(name, principal);
|
|
396
411
|
if (error instanceof HttpError && error.code === "board_name_taken") throw new HttpError(409, "board_name_taken", `the board name ${name} is taken.`, {
|
|
397
412
|
hint: "Pick another name, or ask whoever can see it for access.",
|
|
398
413
|
origin: "handle"
|
|
@@ -400,11 +415,23 @@ function createVercel(options, environment) {
|
|
|
400
415
|
throw error;
|
|
401
416
|
}
|
|
402
417
|
}
|
|
403
|
-
/**
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
418
|
+
/**
|
|
419
|
+
* A project a board's grants don't let in, the one `name`s or the team's (null): they were narrowed,
|
|
420
|
+
* since every project on the team gets in by default. Its way out is the grant that lets it back in,
|
|
421
|
+
* naming the project by ID, since `/me` carries no name.
|
|
422
|
+
*/
|
|
423
|
+
const notLetIn = (name, principal) => {
|
|
424
|
+
const board = name === null ? "the team's board" : `board ${name}`;
|
|
425
|
+
if (principal.type !== "project") return new HttpError(403, "board_not_granted", `this project has no access to ${board}.`, {
|
|
426
|
+
hint: "Someone who manages the board can grant it.",
|
|
427
|
+
origin: "handle"
|
|
428
|
+
});
|
|
429
|
+
const grant = `vb grants create --project ${principal.projectId} --environment ${principal.environment}${name === null ? "" : ` --name ${name}`} --can '*=read,post,react,label'`;
|
|
430
|
+
return new HttpError(403, "board_not_granted", `this project has no access to ${board} (${principal.projectId}, ${principal.environment}).`, {
|
|
431
|
+
hint: `Grant it: ${grant}`,
|
|
432
|
+
origin: "handle"
|
|
433
|
+
});
|
|
434
|
+
};
|
|
408
435
|
let board = null;
|
|
409
436
|
/**
|
|
410
437
|
* The board's ID: the one given, the one `board({ name })` names, or the team's, which the API
|
|
@@ -415,7 +442,7 @@ function createVercel(options, environment) {
|
|
|
415
442
|
const boardId = (who) => (board ??= options.board ? Promise.resolve(options.board) : boardName() ? boardNamed(who, boardName()) : api(who, "GET", "/boards").then(async ({ defaultBoardId }) => {
|
|
416
443
|
if (defaultBoardId) return defaultBoardId;
|
|
417
444
|
const { principal } = (await self(who)).actor;
|
|
418
|
-
if (principal.type === "project") throw notLetIn(
|
|
445
|
+
if (principal.type === "project") throw notLetIn(null, principal);
|
|
419
446
|
const { board: made } = await api(who, "POST", "/boards/default", { body: { operationId: operationId() } });
|
|
420
447
|
return made.id;
|
|
421
448
|
})).catch((error) => {
|
|
@@ -834,13 +861,49 @@ function createVercel(options, environment) {
|
|
|
834
861
|
});
|
|
835
862
|
}
|
|
836
863
|
}
|
|
837
|
-
messages.sort(
|
|
864
|
+
messages.sort(byTime);
|
|
838
865
|
return {
|
|
839
866
|
messages,
|
|
840
867
|
feeds,
|
|
841
868
|
newest
|
|
842
869
|
};
|
|
843
870
|
}
|
|
871
|
+
/** A thread's messages in order; across threads, by time, as a person reads a channel. */
|
|
872
|
+
const byTime = (a, b) => a.message.createdAt - b.message.createdAt || a.message.threadId.localeCompare(b.message.threadId) || a.message.sequence - b.message.sequence;
|
|
873
|
+
/**
|
|
874
|
+
* The latest `limit` in `listed`, unfiltered: each channel's latest page from the API's message
|
|
875
|
+
* list, all at once, never a thread at a time. The list goes back one page, so a full page cuts the
|
|
876
|
+
* answer off at its oldest message: every message newer than the oldest it answers with is in it,
|
|
877
|
+
* even when that's fewer than `limit`. Each page's cursor is its channel's feed then, which the
|
|
878
|
+
* read's cursor goes on from.
|
|
879
|
+
*/
|
|
880
|
+
async function latest(who, listed, limit, signal) {
|
|
881
|
+
const path = await onBoard(who, "/messages");
|
|
882
|
+
const asked = Math.min(limit, PAGE_MAX);
|
|
883
|
+
const pages = await Promise.all(listed.map(async (channel) => ({
|
|
884
|
+
channel,
|
|
885
|
+
...await api(who, "GET", path, {
|
|
886
|
+
query: {
|
|
887
|
+
channelId: channel.id,
|
|
888
|
+
limit: String(asked)
|
|
889
|
+
},
|
|
890
|
+
signal
|
|
891
|
+
})
|
|
892
|
+
})));
|
|
893
|
+
const full = pages.filter((page) => page.messages.length === asked);
|
|
894
|
+
const cutoff = Math.max(-Infinity, ...full.map((page) => Math.min(...page.messages.map((message) => message.createdAt))));
|
|
895
|
+
return {
|
|
896
|
+
messages: pages.flatMap(({ channel, messages }) => messages.map((message) => ({
|
|
897
|
+
message,
|
|
898
|
+
channel
|
|
899
|
+
}))).filter(({ message }) => message.createdAt >= cutoff).sort(byTime).slice(-limit),
|
|
900
|
+
feeds: Object.fromEntries(pages.map((page) => [page.channel.id, {
|
|
901
|
+
at: page.cursor,
|
|
902
|
+
skip: 0
|
|
903
|
+
}])),
|
|
904
|
+
newest: Math.max(0, ...pages.flatMap((page) => page.messages.map((message) => message.createdAt)))
|
|
905
|
+
};
|
|
906
|
+
}
|
|
844
907
|
/** A change in the API's feed as a board event, with the message as it is now. Null for what isn't a message's. */
|
|
845
908
|
async function eventOf(who, change, channel, cursor, filters, me, given, threads = threadReader(who)) {
|
|
846
909
|
if (!change.messageId || !change.type.startsWith("message.")) return null;
|
|
@@ -1197,11 +1260,20 @@ function createVercel(options, environment) {
|
|
|
1197
1260
|
when: spec.when ?? "matches"
|
|
1198
1261
|
}]));
|
|
1199
1262
|
const filters = Object.fromEntries(await Promise.all(Object.entries(specs).map(async ([id, spec]) => [id, await filterOf(who, id, spec)])));
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1263
|
+
let made;
|
|
1264
|
+
try {
|
|
1265
|
+
made = await api(who, "PUT", await onBoard(who, "/watchers"), { body: {
|
|
1266
|
+
...where,
|
|
1267
|
+
watch: filters,
|
|
1268
|
+
tag: await tagOf(specs)
|
|
1269
|
+
} });
|
|
1270
|
+
} catch (error) {
|
|
1271
|
+
if (error instanceof HttpError && error.code === "board_token_unsupported") throw new HttpError(403, "board_token_unsupported", "a board token can't register watchers yet.", {
|
|
1272
|
+
hint: "Register them with a person's or a deployment's own credentials.",
|
|
1273
|
+
origin: "handle"
|
|
1274
|
+
});
|
|
1275
|
+
throw error;
|
|
1276
|
+
}
|
|
1205
1277
|
return {
|
|
1206
1278
|
owner: made.owner,
|
|
1207
1279
|
...whereOf(made),
|
|
@@ -1365,10 +1437,20 @@ function createVercel(options, environment) {
|
|
|
1365
1437
|
};
|
|
1366
1438
|
}
|
|
1367
1439
|
if (query.after !== void 0 && API_CURSOR.test(query.after)) throw new HttpError(400, "invalid_request", `after: ${query.after} is one channel's cursor: read that channel`);
|
|
1440
|
+
const limit = query.limit ?? 50;
|
|
1441
|
+
if (query.re === void 0 && query.after === void 0 && query.before === void 0 && !filtered(query)) {
|
|
1442
|
+
const { messages, feeds, newest } = await latest(who, await channelsFor(who, query.channel), limit, signal);
|
|
1443
|
+
return {
|
|
1444
|
+
messages: await Promise.all(messages.map(({ message, channel }) => view(who, message, channel.name))),
|
|
1445
|
+
cursor: cursorOf({
|
|
1446
|
+
t: newest,
|
|
1447
|
+
feeds
|
|
1448
|
+
})
|
|
1449
|
+
};
|
|
1450
|
+
}
|
|
1368
1451
|
const { messages, feeds, newest } = await collect(who, query, signal);
|
|
1369
1452
|
const after = query.after !== void 0 ? await timeOf(who, query.after) : void 0;
|
|
1370
1453
|
const before = query.before !== void 0 ? await timeOf(who, query.before) : void 0;
|
|
1371
|
-
const limit = query.limit ?? 50;
|
|
1372
1454
|
const bounded = messages.filter(({ message }) => (after === void 0 || message.createdAt > after) && (before === void 0 || message.createdAt < before));
|
|
1373
1455
|
const page = after !== void 0 ? bounded.slice(0, limit) : bounded.slice(-limit);
|
|
1374
1456
|
return {
|
|
@@ -1637,17 +1719,41 @@ function createVercel(options, environment) {
|
|
|
1637
1719
|
},
|
|
1638
1720
|
async grants(caller, _input, signal) {
|
|
1639
1721
|
const who = whoOf(caller);
|
|
1640
|
-
|
|
1722
|
+
const { grants } = await api(who, "GET", await onBoard(who, "/grants"), signal ? { signal } : {});
|
|
1723
|
+
return { grants: grants.map(grantFrom) };
|
|
1641
1724
|
},
|
|
1642
1725
|
async createGrant(caller, input, signal) {
|
|
1643
1726
|
const who = whoOf(caller);
|
|
1644
|
-
|
|
1727
|
+
const { grant } = await api(who, "POST", await onBoard(who, "/grants"), {
|
|
1645
1728
|
body: {
|
|
1646
1729
|
operationId: operationId(),
|
|
1647
1730
|
...input
|
|
1648
1731
|
},
|
|
1649
1732
|
...signal ? { signal } : {}
|
|
1650
1733
|
});
|
|
1734
|
+
return { grant: grantFrom(grant) };
|
|
1735
|
+
},
|
|
1736
|
+
async updateGrant(caller, { id, ...change }, signal) {
|
|
1737
|
+
const who = whoOf(caller);
|
|
1738
|
+
const { grant } = await api(who, "PATCH", await onBoard(who, `/grants/${encodeURIComponent(id)}`), {
|
|
1739
|
+
body: {
|
|
1740
|
+
operationId: operationId(),
|
|
1741
|
+
...change
|
|
1742
|
+
},
|
|
1743
|
+
...signal ? { signal } : {}
|
|
1744
|
+
});
|
|
1745
|
+
return { grant: grantFrom(grant) };
|
|
1746
|
+
},
|
|
1747
|
+
async explain(caller, { claim, ...query }, signal) {
|
|
1748
|
+
const who = whoOf(caller);
|
|
1749
|
+
const params = new URLSearchParams();
|
|
1750
|
+
for (const [name, value] of Object.entries(query)) if (value !== void 0) params.set(name, value);
|
|
1751
|
+
for (const pair of claim ?? []) params.append("claim", pair);
|
|
1752
|
+
const explained = await api(who, "GET", await onBoard(who, `/grants/explain?${params}`), signal ? { signal } : {});
|
|
1753
|
+
return {
|
|
1754
|
+
...explained,
|
|
1755
|
+
grants: explained.grants.map(grantFrom)
|
|
1756
|
+
};
|
|
1651
1757
|
},
|
|
1652
1758
|
async revokeGrant(caller, { id }, signal) {
|
|
1653
1759
|
const who = whoOf(caller);
|
|
@@ -1658,17 +1764,22 @@ function createVercel(options, environment) {
|
|
|
1658
1764
|
},
|
|
1659
1765
|
async tokens(caller, _input, signal) {
|
|
1660
1766
|
const who = whoOf(caller);
|
|
1661
|
-
|
|
1767
|
+
const { tokens } = await api(who, "GET", await onBoard(who, "/tokens"), signal ? { signal } : {});
|
|
1768
|
+
return { tokens: tokens.map(tokenFrom) };
|
|
1662
1769
|
},
|
|
1663
1770
|
async createToken(caller, input, signal) {
|
|
1664
1771
|
const who = whoOf(caller);
|
|
1665
|
-
|
|
1772
|
+
const created = await api(who, "POST", await onBoard(who, "/tokens"), {
|
|
1666
1773
|
body: {
|
|
1667
1774
|
operationId: operationId(),
|
|
1668
1775
|
...input
|
|
1669
1776
|
},
|
|
1670
1777
|
...signal ? { signal } : {}
|
|
1671
1778
|
});
|
|
1779
|
+
return {
|
|
1780
|
+
...created,
|
|
1781
|
+
token: tokenFrom(created.token)
|
|
1782
|
+
};
|
|
1672
1783
|
},
|
|
1673
1784
|
async revokeToken(caller, { id }, signal) {
|
|
1674
1785
|
const who = whoOf(caller);
|
|
@@ -4,7 +4,7 @@ import { z } from "zod";
|
|
|
4
4
|
/**
|
|
5
5
|
* An external thread or channel, prefixed with its sync key:
|
|
6
6
|
* `slack:C0123ABC` (a channel), `slack:C0123ABC:1727.1234` (a thread),
|
|
7
|
-
* `github:
|
|
7
|
+
* `github:acme/web:12` (a PR thread).
|
|
8
8
|
*/
|
|
9
9
|
const ExternalTarget = z.string().min(3).max(300);
|
|
10
10
|
/** Where a message came from on a platform. `thread` is grouped (GitHub review threads fold into their PR). */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as Board, f as BoardOptions } from "./backend-
|
|
2
|
-
import "./exports-
|
|
1
|
+
import { d as Board, f as BoardOptions } from "./backend-D21q8mdm.mjs";
|
|
2
|
+
import "./exports-BxljH73E.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`
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { i as Claims, r as CallerRequest } from "./auth-
|
|
3
|
-
import { C as Protocol, S as Method, _ as MiddlewareContext, a as Identity, b as WriteSource, c as SelfCaller, d as Board, f as BoardOptions, g as Middleware, h as DroppedError, i as Caller, l as Subscription, m as WatcherContext, n as BackendRoute, o as InboxDelivery, p as Watcher, r as BoardBinding, s as ProtocolMethods, t as Backend, u as VerifiedCaller, v as Write, x as HttpError, y as WritePatch } from "./backend-
|
|
4
|
-
import { B as ScheduleTiming, F as Filters, H as WaitOptions, I as PostOptions, L as ProfileOption, N as BoardError, R as ReplyOptions, U as Written, V as UploadInput, W as duration, z as ScheduleOptions } from "./provider-
|
|
5
|
-
import "./exports-
|
|
1
|
+
import { $ as ScheduleInput, A as LinkedQuery, At as TypingResult, B as PostInput, C as InboxItem, Ct as ThreadsPage, D as LABEL_CONDITIONS_MAX, Dt as TokenInput, E as InboxQuery, Et as TokenBody, F as MessagesPage, Ft as routes, G as Ref, H as PrincipalView, I as MessagesQuery, J as RegistrationView, K as RegisterBody, L as MessagesQueryInput, M as MatchesQuery, Mt as UpdateGrantInput, N as Me, Nt as UploadStartBody, O as LabelBody, Ot as TokenView, P as MessageView, Pt as UploadTicket, Q as ScheduleBodyOutput, R as ParsedFilters, S as InboxEntry, St as ThreadView, T as InboxPushBody, Tt as ThreadsQueryInput, U as REGISTERED_WATCHERS_MAX, V as PrincipalInput, W as ReactBody, X as RouteName, Y as ResolvedSyncTarget, Z as ScheduleBody, _ as GrantBody, _t as SyncReceiptBody, a as CanAt, at as SourceJoinBody, b as GrantView, bt as SyncedView, c as DeleteBody, ct as SourceReadQuery, d as EventsPage, dt as SyncCopiesView, en as Attachment, et as ScheduleView, f as EventsQuery, ft as SyncFindInput, g as FiltersInput, gt as SyncImportInput, h as Explanation, ht as SyncImportBody, i as BoardEventView, it as SourceJoin, j as MatchView, jt as UpdateGrantBody, k as LinkView, kt as TypingBody, l as Discovery, lt as SyncBody, m as ExplainQuery, mt as SyncFindView, n as ActorView, nt as SchedulesQueryInput, o as ChannelView, ot as SourceMessage, p as EventsQueryInput, pt as SyncFindQuery, q as RegisterInput, r as ApiError, rt as SchedulesQueryOutput, s as CreateChannelBody, st as SourceRead, t as AckBody, tt as SchedulesQuery, u as EditBody, ut as SyncCopiesQuery, v as GrantCan, vt as SyncReceiptInput, w as InboxNextQuery, wt as ThreadsQuery, x as InboxAckBody, xt as ThreadSummaryView, y as GrantInput, yt as SyncThreadView, z as PostBody } from "./routes-BpKdMvgX.mjs";
|
|
2
|
+
import { i as Claims, r as CallerRequest } from "./auth-C21V0EK1.mjs";
|
|
3
|
+
import { C as Protocol, S as Method, _ as MiddlewareContext, a as Identity, b as WriteSource, c as SelfCaller, d as Board, f as BoardOptions, g as Middleware, h as DroppedError, i as Caller, l as Subscription, m as WatcherContext, n as BackendRoute, o as InboxDelivery, p as Watcher, r as BoardBinding, s as ProtocolMethods, t as Backend, u as VerifiedCaller, v as Write, x as HttpError, y as WritePatch } from "./backend-D21q8mdm.mjs";
|
|
4
|
+
import { B as ScheduleTiming, F as Filters, H as WaitOptions, I as PostOptions, L as ProfileOption, N as BoardError, R as ReplyOptions, U as Written, V as UploadInput, W as duration, z as ScheduleOptions } from "./provider-DEOfc4Ls.mjs";
|
|
5
|
+
import "./exports-BxljH73E.mjs";
|
|
6
6
|
//#region src/server/index.default.d.ts
|
|
7
7
|
/**
|
|
8
8
|
* The handle on a board. Without a `backend`, it's Vercel's board for the team, the one `name`
|
|
@@ -12,4 +12,4 @@ import "./exports-uwRl5qIj.mjs";
|
|
|
12
12
|
*/
|
|
13
13
|
export declare function board(options?: BoardOptions): Board;
|
|
14
14
|
//#endregion
|
|
15
|
-
export { type AckBody, type ActorView, type ApiError, type Attachment, type Backend, type BackendRoute, type Board, type BoardBinding, BoardError, type BoardEventView, type BoardOptions, type Caller, type CallerRequest, type ChannelView, type Claims, type CreateChannelBody, type DeleteBody, type Discovery, DroppedError, type EditBody, type EventsPage, type EventsQuery, type EventsQueryInput, type ExplainQuery, type Explanation, type Filters, type FiltersInput, type GrantBody, type GrantCan, type GrantInput, type GrantView, HttpError, type Identity, type InboxAckBody, type InboxDelivery, type InboxEntry, type InboxItem, type InboxNextQuery, type InboxPushBody, type InboxQuery, type LABEL_CONDITIONS_MAX, type LabelBody, type LinkView, type LinkedQuery, type MatchView, type MatchesQuery, type Me, type MessageView, type MessagesPage, type MessagesQuery, type MessagesQueryInput, type Method, type Middleware, type MiddlewareContext, type ParsedFilters, type PostBody, type PostInput, type PostOptions, type PrincipalInput, type PrincipalView, type ProfileOption, type Protocol, type ProtocolMethods, type REGISTERED_WATCHERS_MAX, type ReactBody, type Ref, type RegisterBody, type RegisterInput, type RegistrationView, type ReplyOptions, type ResolvedSyncTarget, type RouteName, type ScheduleBody, type ScheduleBodyOutput, type ScheduleInput, type ScheduleOptions, type ScheduleTiming, type ScheduleView, type SchedulesQuery, type SchedulesQueryInput, type SchedulesQueryOutput, type SelfCaller, type SourceJoin, type SourceJoinBody, type SourceMessage, type SourceRead, type SourceReadQuery, type Subscription, type SyncBody, type SyncCopiesQuery, type SyncCopiesView, type SyncFindInput, type SyncFindQuery, type SyncFindView, type SyncImportBody, type SyncImportInput, type SyncReceiptBody, type SyncReceiptInput, type SyncThreadView, type SyncedView, type ThreadSummaryView, type ThreadView, type ThreadsPage, type ThreadsQuery, type ThreadsQueryInput, type TokenBody, type TokenInput, type TokenView, type TypingBody, type TypingResult, type UpdateGrantBody, type UpdateGrantInput, type UploadInput, type UploadStartBody, type UploadTicket, type VerifiedCaller, type WaitOptions, type Watcher, type WatcherContext, type Write, type WritePatch, type WriteSource, type Written, duration, type routes };
|
|
15
|
+
export { type AckBody, type ActorView, type ApiError, type Attachment, type Backend, type BackendRoute, type Board, type BoardBinding, BoardError, type BoardEventView, type BoardOptions, type Caller, type CallerRequest, type CanAt, type ChannelView, type Claims, type CreateChannelBody, type DeleteBody, type Discovery, DroppedError, type EditBody, type EventsPage, type EventsQuery, type EventsQueryInput, type ExplainQuery, type Explanation, type Filters, type FiltersInput, type GrantBody, type GrantCan, type GrantInput, type GrantView, HttpError, type Identity, type InboxAckBody, type InboxDelivery, type InboxEntry, type InboxItem, type InboxNextQuery, type InboxPushBody, type InboxQuery, type LABEL_CONDITIONS_MAX, type LabelBody, type LinkView, type LinkedQuery, type MatchView, type MatchesQuery, type Me, type MessageView, type MessagesPage, type MessagesQuery, type MessagesQueryInput, type Method, type Middleware, type MiddlewareContext, type ParsedFilters, type PostBody, type PostInput, type PostOptions, type PrincipalInput, type PrincipalView, type ProfileOption, type Protocol, type ProtocolMethods, type REGISTERED_WATCHERS_MAX, type ReactBody, type Ref, type RegisterBody, type RegisterInput, type RegistrationView, type ReplyOptions, type ResolvedSyncTarget, type RouteName, type ScheduleBody, type ScheduleBodyOutput, type ScheduleInput, type ScheduleOptions, type ScheduleTiming, type ScheduleView, type SchedulesQuery, type SchedulesQueryInput, type SchedulesQueryOutput, type SelfCaller, type SourceJoin, type SourceJoinBody, type SourceMessage, type SourceRead, type SourceReadQuery, type Subscription, type SyncBody, type SyncCopiesQuery, type SyncCopiesView, type SyncFindInput, type SyncFindQuery, type SyncFindView, type SyncImportBody, type SyncImportInput, type SyncReceiptBody, type SyncReceiptInput, type SyncThreadView, type SyncedView, type ThreadSummaryView, type ThreadView, type ThreadsPage, type ThreadsQuery, type ThreadsQueryInput, type TokenBody, type TokenInput, type TokenView, type TypingBody, type TypingResult, type UpdateGrantBody, type UpdateGrantInput, type UploadInput, type UploadStartBody, type UploadTicket, type VerifiedCaller, type WaitOptions, type Watcher, type WatcherContext, type Write, type WritePatch, type WriteSource, type Written, duration, type routes };
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { f as duration, t as HttpError, u as BoardError } from "./errors-
|
|
2
|
-
import { t as DroppedError } from "./middleware-
|
|
3
|
-
import { r as createVercel, t as createBoard } from "./exports-
|
|
1
|
+
import { f as duration, t as HttpError, u as BoardError } from "./errors-rYDxZEuN.mjs";
|
|
2
|
+
import { t as DroppedError } from "./middleware-BxgizazV.mjs";
|
|
3
|
+
import { r as createVercel, t as createBoard } from "./exports-Ck4Xu3OV.mjs";
|
|
4
4
|
//#region src/backend-vercel/index.default.ts
|
|
5
5
|
/**
|
|
6
6
|
* Your team's board, in Vercel's API. Outside Node there's no environment to find credentials or
|
|
@@ -23,7 +23,7 @@ function board(options = {}) {
|
|
|
23
23
|
if (!fetch) throw new Error("board: pass a fetch that sends credentials Vercel's API takes, or a backend: outside Node there's no environment to find them in");
|
|
24
24
|
return vercel({ fetch });
|
|
25
25
|
},
|
|
26
|
-
sync: () => import("./engine-
|
|
26
|
+
sync: () => import("./engine-B_prP0b8.mjs"),
|
|
27
27
|
serving: null
|
|
28
28
|
});
|
|
29
29
|
}
|
package/dist/index.node.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { i as Claims, r as CallerRequest } from "./auth-
|
|
3
|
-
import { C as Protocol, S as Method, _ as MiddlewareContext, a as Identity, b as WriteSource, c as SelfCaller, d as Board, f as BoardOptions, g as Middleware, h as DroppedError, i as Caller, l as Subscription, m as WatcherContext, n as BackendRoute, o as InboxDelivery, p as Watcher, r as BoardBinding, s as ProtocolMethods, t as Backend, u as VerifiedCaller, v as Write, x as HttpError, y as WritePatch } from "./backend-
|
|
4
|
-
import { B as ScheduleTiming, F as Filters, H as WaitOptions, I as PostOptions, L as ProfileOption, N as BoardError, R as ReplyOptions, U as Written, V as UploadInput, W as duration, z as ScheduleOptions } from "./provider-
|
|
5
|
-
import { t as board } from "./index-
|
|
6
|
-
export { type AckBody, type ActorView, type ApiError, type Attachment, type Backend, type BackendRoute, type Board, type BoardBinding, BoardError, type BoardEventView, type BoardOptions, type Caller, type CallerRequest, type ChannelView, type Claims, type CreateChannelBody, type DeleteBody, type Discovery, DroppedError, type EditBody, type EventsPage, type EventsQuery, type EventsQueryInput, type ExplainQuery, type Explanation, type Filters, type FiltersInput, type GrantBody, type GrantCan, type GrantInput, type GrantView, HttpError, type Identity, type InboxAckBody, type InboxDelivery, type InboxEntry, type InboxItem, type InboxNextQuery, type InboxPushBody, type InboxQuery, type LABEL_CONDITIONS_MAX, type LabelBody, type LinkView, type LinkedQuery, type MatchView, type MatchesQuery, type Me, type MessageView, type MessagesPage, type MessagesQuery, type MessagesQueryInput, type Method, type Middleware, type MiddlewareContext, type ParsedFilters, type PostBody, type PostInput, type PostOptions, type PrincipalInput, type PrincipalView, type ProfileOption, type Protocol, type ProtocolMethods, type REGISTERED_WATCHERS_MAX, type ReactBody, type Ref, type RegisterBody, type RegisterInput, type RegistrationView, type ReplyOptions, type ResolvedSyncTarget, type RouteName, type ScheduleBody, type ScheduleBodyOutput, type ScheduleInput, type ScheduleOptions, type ScheduleTiming, type ScheduleView, type SchedulesQuery, type SchedulesQueryInput, type SchedulesQueryOutput, type SelfCaller, type SourceJoin, type SourceJoinBody, type SourceMessage, type SourceRead, type SourceReadQuery, type Subscription, type SyncBody, type SyncCopiesQuery, type SyncCopiesView, type SyncFindInput, type SyncFindQuery, type SyncFindView, type SyncImportBody, type SyncImportInput, type SyncReceiptBody, type SyncReceiptInput, type SyncThreadView, type SyncedView, type ThreadSummaryView, type ThreadView, type ThreadsPage, type ThreadsQuery, type ThreadsQueryInput, type TokenBody, type TokenInput, type TokenView, type TypingBody, type TypingResult, type UpdateGrantBody, type UpdateGrantInput, type UploadInput, type UploadStartBody, type UploadTicket, type VerifiedCaller, type WaitOptions, type Watcher, type WatcherContext, type Write, type WritePatch, type WriteSource, type Written, board, duration, type routes };
|
|
1
|
+
import { $ as ScheduleInput, A as LinkedQuery, At as TypingResult, B as PostInput, C as InboxItem, Ct as ThreadsPage, D as LABEL_CONDITIONS_MAX, Dt as TokenInput, E as InboxQuery, Et as TokenBody, F as MessagesPage, Ft as routes, G as Ref, H as PrincipalView, I as MessagesQuery, J as RegistrationView, K as RegisterBody, L as MessagesQueryInput, M as MatchesQuery, Mt as UpdateGrantInput, N as Me, Nt as UploadStartBody, O as LabelBody, Ot as TokenView, P as MessageView, Pt as UploadTicket, Q as ScheduleBodyOutput, R as ParsedFilters, S as InboxEntry, St as ThreadView, T as InboxPushBody, Tt as ThreadsQueryInput, U as REGISTERED_WATCHERS_MAX, V as PrincipalInput, W as ReactBody, X as RouteName, Y as ResolvedSyncTarget, Z as ScheduleBody, _ as GrantBody, _t as SyncReceiptBody, a as CanAt, at as SourceJoinBody, b as GrantView, bt as SyncedView, c as DeleteBody, ct as SourceReadQuery, d as EventsPage, dt as SyncCopiesView, en as Attachment, et as ScheduleView, f as EventsQuery, ft as SyncFindInput, g as FiltersInput, gt as SyncImportInput, h as Explanation, ht as SyncImportBody, i as BoardEventView, it as SourceJoin, j as MatchView, jt as UpdateGrantBody, k as LinkView, kt as TypingBody, l as Discovery, lt as SyncBody, m as ExplainQuery, mt as SyncFindView, n as ActorView, nt as SchedulesQueryInput, o as ChannelView, ot as SourceMessage, p as EventsQueryInput, pt as SyncFindQuery, q as RegisterInput, r as ApiError, rt as SchedulesQueryOutput, s as CreateChannelBody, st as SourceRead, t as AckBody, tt as SchedulesQuery, u as EditBody, ut as SyncCopiesQuery, v as GrantCan, vt as SyncReceiptInput, w as InboxNextQuery, wt as ThreadsQuery, x as InboxAckBody, xt as ThreadSummaryView, y as GrantInput, yt as SyncThreadView, z as PostBody } from "./routes-BpKdMvgX.mjs";
|
|
2
|
+
import { i as Claims, r as CallerRequest } from "./auth-C21V0EK1.mjs";
|
|
3
|
+
import { C as Protocol, S as Method, _ as MiddlewareContext, a as Identity, b as WriteSource, c as SelfCaller, d as Board, f as BoardOptions, g as Middleware, h as DroppedError, i as Caller, l as Subscription, m as WatcherContext, n as BackendRoute, o as InboxDelivery, p as Watcher, r as BoardBinding, s as ProtocolMethods, t as Backend, u as VerifiedCaller, v as Write, x as HttpError, y as WritePatch } from "./backend-D21q8mdm.mjs";
|
|
4
|
+
import { B as ScheduleTiming, F as Filters, H as WaitOptions, I as PostOptions, L as ProfileOption, N as BoardError, R as ReplyOptions, U as Written, V as UploadInput, W as duration, z as ScheduleOptions } from "./provider-DEOfc4Ls.mjs";
|
|
5
|
+
import { t as board } from "./index-LREsSZb2.mjs";
|
|
6
|
+
export { type AckBody, type ActorView, type ApiError, type Attachment, type Backend, type BackendRoute, type Board, type BoardBinding, BoardError, type BoardEventView, type BoardOptions, type Caller, type CallerRequest, type CanAt, type ChannelView, type Claims, type CreateChannelBody, type DeleteBody, type Discovery, DroppedError, type EditBody, type EventsPage, type EventsQuery, type EventsQueryInput, type ExplainQuery, type Explanation, type Filters, type FiltersInput, type GrantBody, type GrantCan, type GrantInput, type GrantView, HttpError, type Identity, type InboxAckBody, type InboxDelivery, type InboxEntry, type InboxItem, type InboxNextQuery, type InboxPushBody, type InboxQuery, type LABEL_CONDITIONS_MAX, type LabelBody, type LinkView, type LinkedQuery, type MatchView, type MatchesQuery, type Me, type MessageView, type MessagesPage, type MessagesQuery, type MessagesQueryInput, type Method, type Middleware, type MiddlewareContext, type ParsedFilters, type PostBody, type PostInput, type PostOptions, type PrincipalInput, type PrincipalView, type ProfileOption, type Protocol, type ProtocolMethods, type REGISTERED_WATCHERS_MAX, type ReactBody, type Ref, type RegisterBody, type RegisterInput, type RegistrationView, type ReplyOptions, type ResolvedSyncTarget, type RouteName, type ScheduleBody, type ScheduleBodyOutput, type ScheduleInput, type ScheduleOptions, type ScheduleTiming, type ScheduleView, type SchedulesQuery, type SchedulesQueryInput, type SchedulesQueryOutput, type SelfCaller, type SourceJoin, type SourceJoinBody, type SourceMessage, type SourceRead, type SourceReadQuery, type Subscription, type SyncBody, type SyncCopiesQuery, type SyncCopiesView, type SyncFindInput, type SyncFindQuery, type SyncFindView, type SyncImportBody, type SyncImportInput, type SyncReceiptBody, type SyncReceiptInput, type SyncThreadView, type SyncedView, type ThreadSummaryView, type ThreadView, type ThreadsPage, type ThreadsQuery, type ThreadsQueryInput, type TokenBody, type TokenInput, type TokenView, type TypingBody, type TypingResult, type UpdateGrantBody, type UpdateGrantInput, type UploadInput, type UploadStartBody, type UploadTicket, type VerifiedCaller, type WaitOptions, type Watcher, type WatcherContext, type Write, type WritePatch, type WriteSource, type Written, board, duration, type routes };
|
package/dist/index.node.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as duration, t as HttpError, u as BoardError } from "./errors-
|
|
2
|
-
import { t as DroppedError } from "./middleware-
|
|
3
|
-
import { t as board } from "./server-
|
|
1
|
+
import { f as duration, t as HttpError, u as BoardError } from "./errors-rYDxZEuN.mjs";
|
|
2
|
+
import { t as DroppedError } from "./middleware-BxgizazV.mjs";
|
|
3
|
+
import { t as board } from "./server-CS-1aeTl.mjs";
|
|
4
4
|
export { BoardError, DroppedError, HttpError, board, duration };
|