@vercel/board 0.32.0 → 0.34.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/README.md +25 -20
- package/dist/{access-CY5xVMIK.mjs → access-CdBcYPQH.mjs} +170 -13
- package/dist/access.d.mts +4 -5
- package/dist/access.mjs +5 -5
- package/dist/{actors-Bm-ojWWT.mjs → actors-MrIEr9LI.mjs} +3 -3
- package/dist/auth-DjoJygbG.mjs +599 -0
- package/dist/{auth-K8dY1nBY.d.mts → auth-aaoKt5DK.d.mts} +133 -100
- package/dist/backend-local.d.mts +28 -0
- package/dist/backend-local.mjs +2 -0
- package/dist/{backend-DxE9wGKm.d.mts → backend-u1sVvybh.d.mts} +108 -55
- package/dist/{chat-provider-DkFp2hrh.mjs → chat-provider-9hCT654s.mjs} +2 -2
- package/dist/{chat-provider-BChYrrA7.d.mts → chat-provider-De0iDnUB.d.mts} +2 -3
- 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 +6 -6
- package/dist/{commands-DsnQKTdB.mjs → commands-B8oZEByR.mjs} +37 -52
- package/dist/{commands-CpyPV_tk.d.mts → commands-BkVMdXP1.d.mts} +9 -6
- package/dist/{conformance-3RBKxwbp.mjs → conformance-gqYBkXFS.mjs} +79 -86
- package/dist/conformance.d.mts +1 -1
- package/dist/conformance.mjs +1 -1
- package/dist/{engine-DurYIRt8.mjs → engine-rtOVWsiF.mjs} +6 -8
- package/dist/{errors-CJXhhzvT.mjs → errors-D8ifv16L.mjs} +75 -6
- package/dist/{events-lujPA3gQ.mjs → events-IQg0k281.mjs} +2 -2
- package/dist/exports-Bx2dGpzr.mjs +3252 -0
- package/dist/exports-uwRl5qIj.d.mts +4 -0
- package/dist/{external-D3p5T57R.mjs → external-CYe424fO.mjs} +1 -1
- package/dist/index-D6mK0Ial.d.mts +11 -0
- package/dist/index.d.mts +10 -9
- package/dist/index.mjs +21 -8
- package/dist/index.node.d.mts +6 -7
- package/dist/index.node.mjs +3 -3
- package/dist/inspect/app.js +95 -95
- package/dist/{internal-CvsrprnU-zZMpDiRY.mjs → internal-CvsrprnU-CEPOUpAv.mjs} +63 -43
- package/dist/local-CPz22MQ8.mjs +9225 -0
- package/dist/{main-CcYDo9Hb.mjs → main-DScDKwQN.mjs} +129 -54
- package/dist/{backend-a2/store-memory.mjs → memory-7RRnLa4X.mjs} +3 -3
- package/dist/middleware-BjYpk4yq.mjs +103 -0
- package/dist/{provider-gynDUoyW.d.mts → provider-hB8QNrwm.d.mts} +369 -3
- package/dist/{client-COfYrgfV.d.mts → routes-De4W6lEs.d.mts} +997 -367
- package/dist/{schemas-DBmUO6pr.mjs → schemas-BG205xds.mjs} +2 -5
- package/dist/{serve-Bplieh0C.mjs → serve-B1noQRkn.mjs} +33 -24
- package/dist/{node-BgeGcwX0.mjs → server-Ov6GBJ8j.mjs} +419 -6
- package/dist/{serving-Y7s7VDjB.mjs → serving-2s7lqSBS.mjs} +1 -1
- package/dist/{sql-E1K5g_ih.mjs → sql-BQzKUqQt.mjs} +349 -114
- package/dist/sqlite-DCtZFEVm.mjs +30 -0
- package/dist/{sqlite-db-CzcD_FW8.mjs → sqlite-db-qLTs52Ny.mjs} +2 -3
- package/dist/{store-codec-pAG2oPgQ-SqDXlPBR.mjs → store-N8PXxDAS-BdL4Sq-f.mjs} +6 -2
- package/dist/{store-memory-B0PkVSuQ.mjs → store-memory-CKQVEzXN.mjs} +2 -4
- package/dist/store-memory-OdGsc-t_.mjs +2 -0
- package/dist/{store-polling-BZt2Rf3D-Div-bJ_D.mjs → store-polling-BZt2Rf3D-oh3aU_An.mjs} +1 -1
- package/dist/store-sqlite-CTxAVCcz.mjs +2 -0
- package/dist/{store-sqlite-D85t3tE7.mjs → store-sqlite-D6fIszST.mjs} +3 -4
- 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 +4 -4
- package/dist/sync.d.mts +2 -2
- package/dist/sync.mjs +2 -2
- package/dist/{watchers-hash-CurCzwhe.mjs → targets-aMdbp84G.mjs} +134 -16
- package/dist/{tokens-C7kYyrAG.mjs → tokens-LHLrnV_P.mjs} +15 -43
- package/docs/01-board/01-mounting.md +245 -288
- package/docs/01-board/03-identity.md +42 -50
- package/docs/01-board/04-messages.md +15 -14
- package/docs/01-board/05-reading.md +3 -3
- package/docs/01-board/06-watchers.md +58 -105
- package/docs/01-board/07-schedules.md +21 -41
- package/docs/01-board/08-middleware.md +11 -17
- package/docs/01-board/09-access.md +187 -343
- package/docs/01-board/10-local.md +81 -0
- package/docs/01-quickstart.md +49 -126
- package/docs/02-sync/01-overview.md +25 -80
- package/docs/02-sync/02-functions.md +10 -16
- package/docs/02-sync/03-slack.md +13 -26
- package/docs/02-sync/04-github.md +8 -20
- package/docs/02-sync/07-linear.md +6 -10
- package/docs/03-guides/02-inspector.md +3 -3
- package/docs/03-guides/03-ci.md +88 -128
- package/docs/03-guides/04-triage.md +7 -15
- package/docs/03-guides/05-agent-factory.md +29 -36
- package/docs/04-reference/01-cli.md +113 -38
- package/docs/04-reference/02-board.md +79 -82
- package/docs/04-reference/03-http.md +138 -69
- package/docs/04-reference/05-conformance.md +32 -46
- package/docs/index.md +41 -65
- package/package.json +12 -83
- package/dist/a2-DiDc77Uf.mjs +0 -4238
- package/dist/access-DPcrKIH_.d.mts +0 -37
- package/dist/auth-8pRZnF1M.mjs +0 -393
- package/dist/backend-a2/blob-vercel.d.mts +0 -8
- package/dist/backend-a2/blob-vercel.mjs +0 -81
- package/dist/backend-a2/contract.d.mts +0 -828
- package/dist/backend-a2/contract.mjs +0 -5
- package/dist/backend-a2/scheduler-local.d.mts +0 -11
- package/dist/backend-a2/scheduler-local.mjs +0 -2
- package/dist/backend-a2/scheduler-qstash.d.mts +0 -79
- package/dist/backend-a2/scheduler-qstash.mjs +0 -522
- package/dist/backend-a2/scheduler-vercel.d.mts +0 -38
- package/dist/backend-a2/scheduler-vercel.mjs +0 -204
- package/dist/backend-a2/store-memory.d.mts +0 -11
- package/dist/backend-a2/store-postgres.d.mts +0 -38
- package/dist/backend-a2/store-postgres.mjs +0 -2977
- package/dist/backend-a2/store-redis-http.d.mts +0 -17
- package/dist/backend-a2/store-redis-http.mjs +0 -520
- package/dist/backend-a2/store-redis.d.mts +0 -31
- package/dist/backend-a2/store-redis.mjs +0 -88
- package/dist/backend-a2/store-sqlite.d.mts +0 -12
- package/dist/backend-a2/store-sqlite.mjs +0 -31
- package/dist/backend-a2.d.mts +0 -2633
- package/dist/backend-a2.mjs +0 -3
- package/dist/backend-http-CaN06CaD.d.mts +0 -672
- package/dist/backend-http-CoaCghuJ.mjs +0 -18
- package/dist/backend-http-l5A8UmL-.mjs +0 -585
- package/dist/backend-http.d.mts +0 -10
- package/dist/backend-http.mjs +0 -2
- package/dist/backend-http.node.d.mts +0 -10
- package/dist/backend-http.node.mjs +0 -2
- package/dist/backend-vercel-BE65okBC.mjs +0 -86
- package/dist/backend-vercel-CVxoTNF2.mjs +0 -1744
- package/dist/backend-vercel-jg-6PAgD.d.mts +0 -674
- package/dist/backend-vercel.d.mts +0 -9
- package/dist/backend-vercel.mjs +0 -11
- package/dist/backend-vercel.node.d.mts +0 -17
- package/dist/backend-vercel.node.mjs +0 -2
- package/dist/blob-Bx8QPWEd.d.mts +0 -40
- package/dist/blob-WbB2DJKn.mjs +0 -201
- package/dist/errors-2vGs49Db.d.mts +0 -16
- package/dist/exports-BnUZuRm9.mjs +0 -1389
- package/dist/exports-u5mApVvn.d.mts +0 -5
- package/dist/files-SniSmeEr.mjs +0 -47
- package/dist/folds-DLUzfibJ.d.mts +0 -558
- package/dist/folds-DsWfIftc.mjs +0 -208
- package/dist/index-UXpTPWNc.d.mts +0 -11
- package/dist/index.default-Dp8gexln.mjs +0 -12
- package/dist/local-C76Fy5ad.mjs +0 -44
- package/dist/middleware-BavYSDUa.mjs +0 -62
- package/dist/platform-B4TnJtWu-Do3agKr5.mjs +0 -32
- package/dist/project-4Vl7_uy5.mjs +0 -124
- package/dist/redis-tables-BFRj_SEJ.mjs +0 -3895
- package/dist/reducer-Bswr11ar-P324o9vn.mjs +0 -74
- package/dist/reducer-CYPHsSmd-BXjGiptm.d.mts +0 -170
- package/dist/reducers-DQVSP3kk.mjs +0 -538
- package/dist/retryable-lazy-DZWmHpii-DpTc5PIP.mjs +0 -19
- package/dist/scheduler-task-X1SToDjP-D2Il2rln.mjs +0 -69
- package/dist/server-B9gu0qi1-DI1WvcVK.d.mts +0 -391
- package/dist/server-DX7mM6nm-D7N_7bug.mjs +0 -3611
- package/dist/server-wIpAEjpX.mjs +0 -17
- package/dist/session-clear-XJYpmUpg-2q8l_FJR.mjs +0 -63
- package/dist/store-DEzcHZOA-B-5vhxef.d.mts +0 -540
- package/dist/store-N8PXxDAS-DWWgv-Vz.mjs +0 -5
- package/dist/store-memory-4IBl0Ztu.mjs +0 -2
- package/dist/store-presence-polling-JuAy2Ck2-Dh-g_KYM.mjs +0 -109
- package/dist/store-sqlite-iBTYYKBj.mjs +0 -2
- package/dist/stream-buffer-DrTyiIuo-Be10yOBR.mjs +0 -53
- package/dist/targets-Cgjs29T0.mjs +0 -33
- package/dist/types-CmrFjpml.d.mts +0 -102
- package/dist/wait-until-Dw4XrIDQ.mjs +0 -42
- package/docs/01-board/02-database.md +0 -258
- package/docs/04-reference/04-log.md +0 -247
- package/sql/postgres/board.sql +0 -145
- package/sql/postgres/notifications.sql +0 -24
- package/sql/postgres/schema.sql +0 -451
|
@@ -1,585 +0,0 @@
|
|
|
1
|
-
import "./files-SniSmeEr.mjs";
|
|
2
|
-
import "./schemas-DBmUO6pr.mjs";
|
|
3
|
-
import { A as RegisterBody, W as routes, a as METHODS, n as compileWatcher, t as canonicalWatchers } from "./watchers-hash-CurCzwhe.mjs";
|
|
4
|
-
import { a as forbidden, d as createBoardClient, o as json, t as HttpError, u as BoardError } from "./errors-CJXhhzvT.mjs";
|
|
5
|
-
import { a as keyId, n as DERIVED_ID, o as sha256, r as derivedId, t as waitUntil } from "./wait-until-Dw4XrIDQ.mjs";
|
|
6
|
-
//#region src/server/registrant.ts
|
|
7
|
-
/** Registering again this soon after the same registration only repeats it. */
|
|
8
|
-
const REGISTER_EVERY_MS = 1e4;
|
|
9
|
-
/** How long one wake-up runs matches before it leaves the rest to the next. */
|
|
10
|
-
const DRAIN_MS = 24e4;
|
|
11
|
-
/** How long a wake-up waits for what it pulled to run before it answers: under the 3 seconds Vercel's API gives it. */
|
|
12
|
-
const WAKE_ANSWER_MS = 2e3;
|
|
13
|
-
/** A pull with nothing to hand out holds this long, when the board pulls on its own. */
|
|
14
|
-
const POLL_WAIT_S = 25;
|
|
15
|
-
const describe$1 = (error) => ((error instanceof Error ? error.message : String(error)) || "unknown error").slice(0, 500);
|
|
16
|
-
/** Only an https URL can be woken; anything else pulls on its own. */
|
|
17
|
-
const wakeable = (here) => here?.startsWith("https://") ? here : null;
|
|
18
|
-
/**
|
|
19
|
-
* A path on this Vercel project for a board that wakes by path, from `here`, this board's URL:
|
|
20
|
-
* from production, or from a preview of a branch, which it names. Null anywhere else (off Vercel,
|
|
21
|
-
* development, a custom environment), where only a URL wakes it.
|
|
22
|
-
*/
|
|
23
|
-
function wakePath(here) {
|
|
24
|
-
const env = typeof process !== "undefined" && process.env.VERCEL === "1" ? process.env : null;
|
|
25
|
-
const environment = env?.VERCEL_TARGET_ENV || env?.VERCEL_ENV;
|
|
26
|
-
const branch = environment === "preview" ? env?.VERCEL_GIT_COMMIT_REF || null : null;
|
|
27
|
-
if (!here || environment !== "production" && !branch) return null;
|
|
28
|
-
return {
|
|
29
|
-
path: new URL(here).pathname,
|
|
30
|
-
...branch ? { branch } : {}
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Runs a board's watchers on another board that matches them: it registers them there, is woken
|
|
35
|
-
* when one matches, with nothing in the wake-up but a hash, and pulls what matched with its own
|
|
36
|
-
* credentials, runs it, and acks it. When it can't be woken (no https URL of its own: a dev
|
|
37
|
-
* server, say), it pulls on its own. http() and vercel() run their watchers this way.
|
|
38
|
-
*/
|
|
39
|
-
function registrant(options) {
|
|
40
|
-
const { registry, rethrow } = options;
|
|
41
|
-
const bound = options.binding;
|
|
42
|
-
let last = null;
|
|
43
|
-
let registering = null;
|
|
44
|
-
/** Registers this board's watchers with the other board, as itself, replacing its last registration. */
|
|
45
|
-
async function register(here) {
|
|
46
|
-
const current = await options.hash();
|
|
47
|
-
if (last && last.url === here && last.result.hash === current && Date.now() - last.at < REGISTER_EVERY_MS) return last.result;
|
|
48
|
-
registering ??= options.wakeAt(here).then((where) => registry.register(where)).then((result) => {
|
|
49
|
-
last = {
|
|
50
|
-
url: here,
|
|
51
|
-
at: Date.now(),
|
|
52
|
-
result
|
|
53
|
-
};
|
|
54
|
-
return result;
|
|
55
|
-
}).finally(() => {
|
|
56
|
-
registering = null;
|
|
57
|
-
});
|
|
58
|
-
return registering;
|
|
59
|
-
}
|
|
60
|
-
/** Runs one match and acks it: done, its error, or a skip for a watcher this board no longer has. */
|
|
61
|
-
async function runOne(match) {
|
|
62
|
-
let outcome = {};
|
|
63
|
-
if (!bound().subscriptions[match.watcher]) outcome = { skip: true };
|
|
64
|
-
else try {
|
|
65
|
-
await bound().run(match.watcher, match.event, {
|
|
66
|
-
trigger: `watch:${match.watcher}:${match.id}`,
|
|
67
|
-
attempt: match.attempt + 1
|
|
68
|
-
});
|
|
69
|
-
} catch (error) {
|
|
70
|
-
console.error(`[board] watcher ${match.watcher} failed:`, error);
|
|
71
|
-
outcome = { error: describe$1(error) };
|
|
72
|
-
}
|
|
73
|
-
await registry.ack(match.id, {
|
|
74
|
-
lease: match.lease,
|
|
75
|
-
...outcome
|
|
76
|
-
}).catch((error) => console.error(`[board] couldn't ack a match:`, describe$1(error)));
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Pulls and runs what's matched until nothing's left, or this run's time is up, and what sync
|
|
80
|
-
* queued in its inbox. A thread's matches come one at a time.
|
|
81
|
-
*/
|
|
82
|
-
async function drain() {
|
|
83
|
-
let ran = 0;
|
|
84
|
-
const until = Date.now() + DRAIN_MS;
|
|
85
|
-
while (Date.now() < until) {
|
|
86
|
-
const matches = await registry.matches({ limit: 10 });
|
|
87
|
-
if (matches.length === 0) break;
|
|
88
|
-
await Promise.all(matches.map(runOne));
|
|
89
|
-
ran += matches.length;
|
|
90
|
-
}
|
|
91
|
-
return ran + await bound().pull();
|
|
92
|
-
}
|
|
93
|
-
let polling = null;
|
|
94
|
-
/** For a board that can't be woken: pulls on its own, each pull held open until something matches. */
|
|
95
|
-
function poll() {
|
|
96
|
-
if (polling) return;
|
|
97
|
-
const controller = polling = new AbortController();
|
|
98
|
-
(async () => {
|
|
99
|
-
for (let pause = 1e3; !controller.signal.aborted;) try {
|
|
100
|
-
await register(null);
|
|
101
|
-
const matches = await registry.matches({
|
|
102
|
-
limit: 10,
|
|
103
|
-
wait: POLL_WAIT_S,
|
|
104
|
-
signal: controller.signal
|
|
105
|
-
});
|
|
106
|
-
await Promise.all(matches.map(runOne));
|
|
107
|
-
await bound().pull();
|
|
108
|
-
pause = 1e3;
|
|
109
|
-
} catch (error) {
|
|
110
|
-
if (controller.signal.aborted) break;
|
|
111
|
-
console.error(`[board] couldn't pull matches from ${options.remote}:`, describe$1(error));
|
|
112
|
-
await new Promise((resolve) => setTimeout(resolve, pause));
|
|
113
|
-
pause = Math.min(pause * 2, 6e4);
|
|
114
|
-
}
|
|
115
|
-
})();
|
|
116
|
-
}
|
|
117
|
-
let started = null;
|
|
118
|
-
let failedAt = 0;
|
|
119
|
-
/**
|
|
120
|
-
* On first use, a board with watchers or sync registers them if it knows its URL. One on Vercel
|
|
121
|
-
* learns its mount path from a request (a `POST /watchers`, a webhook, or a wake-up); one that
|
|
122
|
-
* can't be woken registers without one and pulls instead. Resolves once the first try is done.
|
|
123
|
-
* One that fails tries again on a later use, at most every `REGISTER_EVERY_MS`: nothing would
|
|
124
|
-
* wake a board the other doesn't know.
|
|
125
|
-
*/
|
|
126
|
-
function start() {
|
|
127
|
-
if (started) return started;
|
|
128
|
-
if (!options.hasWork() || Date.now() - failedAt < REGISTER_EVERY_MS) return Promise.resolve();
|
|
129
|
-
const here = wakeable(bound().url());
|
|
130
|
-
if (!here && typeof process !== "undefined" && process.env.VERCEL === "1") return Promise.resolve();
|
|
131
|
-
started = register(here).then(() => {}, (error) => {
|
|
132
|
-
started = null;
|
|
133
|
-
failedAt = Date.now();
|
|
134
|
-
console.error(`[board] couldn't register with ${options.remote}:`, describe$1(error));
|
|
135
|
-
});
|
|
136
|
-
if (!here) poll();
|
|
137
|
-
return started;
|
|
138
|
-
}
|
|
139
|
-
return {
|
|
140
|
-
start,
|
|
141
|
-
routes: [{
|
|
142
|
-
method: "POST",
|
|
143
|
-
path: "/wake",
|
|
144
|
-
async handle(request) {
|
|
145
|
-
started ??= Promise.resolve();
|
|
146
|
-
const stale = request.headers.get("x-board-watchers") !== await options.hash();
|
|
147
|
-
const running = (async () => {
|
|
148
|
-
if (stale) await register(wakeable(bound().url()));
|
|
149
|
-
return drain();
|
|
150
|
-
})();
|
|
151
|
-
waitUntil(running.catch((error) => console.error(`[board] couldn't run what woke it:`, describe$1(error))));
|
|
152
|
-
let timer;
|
|
153
|
-
const waited = new Promise((resolve) => timer = setTimeout(() => resolve(null), WAKE_ANSWER_MS));
|
|
154
|
-
try {
|
|
155
|
-
const ran = await Promise.race([running.catch(rethrow), waited]);
|
|
156
|
-
return ran === null ? new Response(null, { status: 202 }) : json({ ran });
|
|
157
|
-
} finally {
|
|
158
|
-
clearTimeout(timer);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}, {
|
|
162
|
-
method: "POST",
|
|
163
|
-
path: "/watchers",
|
|
164
|
-
async handle(request, { caller }) {
|
|
165
|
-
if (caller) return options.registerFor(caller, request);
|
|
166
|
-
started ??= Promise.resolve();
|
|
167
|
-
const here = wakeable(bound().url());
|
|
168
|
-
const registration = await register(here).catch(rethrow);
|
|
169
|
-
if (!here) poll();
|
|
170
|
-
return json(registration);
|
|
171
|
-
}
|
|
172
|
-
}],
|
|
173
|
-
/** Registers this board's watchers with the other board now, as `POST /watchers` does. */
|
|
174
|
-
registerNow: () => register(wakeable(bound().url())),
|
|
175
|
-
/** Stops pulling, for a board that pulls on its own. */
|
|
176
|
-
close: () => {
|
|
177
|
-
polling?.abort();
|
|
178
|
-
polling = null;
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
//#endregion
|
|
183
|
-
//#region src/server/backend-http.ts
|
|
184
|
-
/** A watcher's or client's name is the profile its writes are by. */
|
|
185
|
-
const PROFILE = /^[A-Za-z][A-Za-z0-9-]{0,31}$/;
|
|
186
|
-
const PROFILE_RULE = "ids start with a letter and use up to 32 letters, numbers, and hyphens";
|
|
187
|
-
/**
|
|
188
|
-
* What a board's own callers can't do on the board it uses, where they act as its project: what's
|
|
189
|
-
* the project's own there (its registration, its sync, its links, who it trusts and the tokens it
|
|
190
|
-
* mints, which would act as the project), and what's anyone's own there by
|
|
191
|
-
* principal (editing, deleting, scheduling, and uploading, since a file is its uploader's to read
|
|
192
|
-
* and attach until a message carries it), which the board it uses can't tell them apart for.
|
|
193
|
-
*/
|
|
194
|
-
const PROJECTS_OWN = /* @__PURE__ */ new Set([
|
|
195
|
-
"edit",
|
|
196
|
-
"delete",
|
|
197
|
-
"schedule",
|
|
198
|
-
"cancelSchedule",
|
|
199
|
-
"upload",
|
|
200
|
-
"uploadStart",
|
|
201
|
-
"uploadFinish",
|
|
202
|
-
"watchers",
|
|
203
|
-
"register",
|
|
204
|
-
"matches",
|
|
205
|
-
"ack",
|
|
206
|
-
"grants",
|
|
207
|
-
"createGrant",
|
|
208
|
-
"revokeGrant",
|
|
209
|
-
"tokens",
|
|
210
|
-
"createToken",
|
|
211
|
-
"revokeToken",
|
|
212
|
-
"syncImport",
|
|
213
|
-
"syncReceipt",
|
|
214
|
-
"syncThread",
|
|
215
|
-
"syncFind",
|
|
216
|
-
"syncCopies",
|
|
217
|
-
"inboxPush",
|
|
218
|
-
"inboxNext",
|
|
219
|
-
"inboxAck",
|
|
220
|
-
"inbox"
|
|
221
|
-
]);
|
|
222
|
-
/**
|
|
223
|
-
* A caller's handle as a profile on the board this one uses: `ada`, `ada-lovelace` for
|
|
224
|
-
* `ada.lovelace`, under the project. It's a label, never who they are there.
|
|
225
|
-
*/
|
|
226
|
-
function profileOf(handle) {
|
|
227
|
-
let name = handle.replace(/[^A-Za-z0-9-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
228
|
-
if (!/^[A-Za-z]/.test(name)) name = `u-${name}`;
|
|
229
|
-
return name.slice(0, 32).replace(/-+$/, "");
|
|
230
|
-
}
|
|
231
|
-
/**
|
|
232
|
-
* A caller's profile there, never one this board's own code writes as (a watcher's ID, or the
|
|
233
|
-
* middleware's): a write by a watcher's profile never wakes that watcher. One that would be gets a
|
|
234
|
-
* number, `fix-2`.
|
|
235
|
-
*/
|
|
236
|
-
function callerProfile(handle, own) {
|
|
237
|
-
const taken = new Set([
|
|
238
|
-
...own,
|
|
239
|
-
"middleware",
|
|
240
|
-
"client"
|
|
241
|
-
].map((name) => name.toLowerCase()));
|
|
242
|
-
const base = profileOf(handle);
|
|
243
|
-
let name = base;
|
|
244
|
-
for (let n = 2; taken.has(name.toLowerCase()); n++) name = `${base.slice(0, 31 - String(n).length)}-${n}`;
|
|
245
|
-
return name;
|
|
246
|
-
}
|
|
247
|
-
/** What a caller may do, as `x-board-scope` says it: the board it uses narrows the project's access to it. Null for everything. */
|
|
248
|
-
function scopeOf(identity) {
|
|
249
|
-
const { access } = identity.principal;
|
|
250
|
-
if (access.everywhere("manage")) return null;
|
|
251
|
-
const entries = Object.entries(access.summary()).map(([pattern, permissions]) => `${pattern}=${permissions.join(",")}`);
|
|
252
|
-
return entries.length > 0 ? entries.join(";") : "*=";
|
|
253
|
-
}
|
|
254
|
-
const describe = (error) => ((error instanceof Error ? error.message : String(error)) || "unknown error").slice(0, 500);
|
|
255
|
-
/** The SDK's error, as the board answers it: the remote's own status and code, or 502 when it never answered. */
|
|
256
|
-
const rethrow = (error) => {
|
|
257
|
-
if (error instanceof BoardError) throw new HttpError(error.status >= 400 ? error.status : 502, error.code, error.message, {
|
|
258
|
-
...error.hint !== void 0 ? { hint: error.hint } : {},
|
|
259
|
-
origin: error.origin
|
|
260
|
-
});
|
|
261
|
-
if (error instanceof HttpError || error instanceof Error && error.name === "AbortError") throw error;
|
|
262
|
-
throw new HttpError(502, "unreachable", `the board didn't answer: ${describe(error)}`);
|
|
263
|
-
};
|
|
264
|
-
/** A parsed input, back on the wire as a query string. */
|
|
265
|
-
function queryString(input) {
|
|
266
|
-
const params = new URLSearchParams();
|
|
267
|
-
for (const [key, value] of Object.entries(input)) {
|
|
268
|
-
if (value === void 0 || value === null || value === false) continue;
|
|
269
|
-
if (key === "label" && Array.isArray(value)) for (const [name, values] of value) params.append("label", values === null ? name : `${name}=${values.join("|")}`);
|
|
270
|
-
else if (Array.isArray(value)) for (const item of value) params.append(key, String(item));
|
|
271
|
-
else params.set(key, String(value));
|
|
272
|
-
}
|
|
273
|
-
const text = params.toString();
|
|
274
|
-
return text ? `?${text}` : "";
|
|
275
|
-
}
|
|
276
|
-
/** A file the remote served, as the board stored it: its headers say what it is. */
|
|
277
|
-
function attachmentOf(id, response) {
|
|
278
|
-
const encoded = (response.headers.get("content-disposition") ?? "").match(/filename\*=UTF-8''([^;]+)/)?.[1];
|
|
279
|
-
let name = "file";
|
|
280
|
-
try {
|
|
281
|
-
if (encoded) name = decodeURIComponent(encoded);
|
|
282
|
-
} catch {}
|
|
283
|
-
return {
|
|
284
|
-
attachment: {
|
|
285
|
-
id,
|
|
286
|
-
name,
|
|
287
|
-
type: response.headers.get("content-type") ?? "application/octet-stream",
|
|
288
|
-
size: Number(response.headers.get("content-length") ?? 0)
|
|
289
|
-
},
|
|
290
|
-
data: response.body ?? /* @__PURE__ */ new Uint8Array()
|
|
291
|
-
};
|
|
292
|
-
}
|
|
293
|
-
/**
|
|
294
|
-
* Another board that speaks the protocol, at `url` (in Node, the one the environment points at
|
|
295
|
-
* by default): this board keeps nothing, and this deployment reads and writes that one as itself.
|
|
296
|
-
* Its watchers' tails are registered there. The remote wakes it when one matches, with nothing in
|
|
297
|
-
* the wake-up but a hash, and it pulls what matched with its own credentials, runs it, and acks
|
|
298
|
-
* it. When it can't be woken (no https URL of its own: a dev server, say), it pulls on its own.
|
|
299
|
-
*/
|
|
300
|
-
function createHttp(url, options, environment) {
|
|
301
|
-
if (url !== void 0 && !/^https?:\/\/[^/]/.test(url)) throw new Error(`http: ${url} isn't a URL: pass the board's, like https://board.example.com/api/board`);
|
|
302
|
-
if (url === void 0 && !environment) throw new Error("http: pass the board's URL: outside Node there's no environment to find it in");
|
|
303
|
-
const remote = (url ?? environment.url()).replace(/\/+$/, "");
|
|
304
|
-
const doFetch = options.fetch ?? environment?.fetch(remote) ?? ((input, init) => globalThis.fetch(input, init));
|
|
305
|
-
let binding = null;
|
|
306
|
-
const specs = {};
|
|
307
|
-
/** This board's sync entries, registered there when it syncs. */
|
|
308
|
-
let sync = [];
|
|
309
|
-
let hash = null;
|
|
310
|
-
/** What every wake-up carries, so the board it uses can tell it's stale. */
|
|
311
|
-
const watchersHash = () => hash ??= sha256(canonicalWatchers(specs, sync)).then((hex) => hex.slice(0, 32));
|
|
312
|
-
const bound = () => {
|
|
313
|
-
if (!binding) throw new Error("http: this backend isn't serving a board yet: pass it to board({ backend })");
|
|
314
|
-
return binding;
|
|
315
|
-
};
|
|
316
|
-
/**
|
|
317
|
-
* The SDK against the remote, as this deployment with `profile`. `quiet` names no session: this
|
|
318
|
-
* deployment's own code. Otherwise a profile chosen in code keeps the environment's session, and
|
|
319
|
-
* yourself (`null`) has none. Who the token's holder is, `fetch` says.
|
|
320
|
-
*/
|
|
321
|
-
const sdk = (profile, quiet) => createBoardClient({
|
|
322
|
-
url: remote,
|
|
323
|
-
fetch: doFetch,
|
|
324
|
-
profile: profile !== void 0 ? profile : () => environment?.profile().profile ?? null,
|
|
325
|
-
session: quiet || profile === null ? null : () => environment?.profile().session ?? null
|
|
326
|
-
});
|
|
327
|
-
const own = sdk(null, true);
|
|
328
|
-
const profiles = /* @__PURE__ */ new Map();
|
|
329
|
-
/** This deployment as `profile`: a watcher's ID, or the middleware. */
|
|
330
|
-
function asProfile(profile) {
|
|
331
|
-
if (!PROFILE.test(profile)) throw new HttpError(400, "invalid_request", `as: ${profile}: profiles start with a letter and use up to 32 letters, numbers, and hyphens`);
|
|
332
|
-
let client = profiles.get(profile);
|
|
333
|
-
if (!client) profiles.set(profile, client = sdk(profile, true));
|
|
334
|
-
return client;
|
|
335
|
-
}
|
|
336
|
-
const holders = /* @__PURE__ */ new Map();
|
|
337
|
-
/** The token's holder, with `profile` (`undefined`: the environment's). */
|
|
338
|
-
function holder(profile) {
|
|
339
|
-
const key = JSON.stringify(profile ?? (profile === null ? null : "\0"));
|
|
340
|
-
let client = holders.get(key);
|
|
341
|
-
if (!client) holders.set(key, client = sdk(profile, false));
|
|
342
|
-
return client;
|
|
343
|
-
}
|
|
344
|
-
/**
|
|
345
|
-
* The client a call of this deployment's own code goes through: a handle's, as the token's holder
|
|
346
|
-
* with its profile; a watcher's or the middleware's, as this deployment with theirs; and sync's,
|
|
347
|
-
* as the deployment itself.
|
|
348
|
-
*/
|
|
349
|
-
function clientOf(caller) {
|
|
350
|
-
if (caller.origin.via?.kind === "engine") return own;
|
|
351
|
-
if (caller.origin.via?.kind === "client") {
|
|
352
|
-
if (caller.self !== null) asProfile(caller.self);
|
|
353
|
-
return holder("profile" in caller ? caller.profile : caller.self ?? void 0);
|
|
354
|
-
}
|
|
355
|
-
return asProfile(caller.self ?? "client");
|
|
356
|
-
}
|
|
357
|
-
let discovered = null;
|
|
358
|
-
/** The board it uses' discovery, for a handle here: who it is, and the sync entries it lists. */
|
|
359
|
-
const discovery = () => (discovered ??= doFetch(remote).then(async (response) => {
|
|
360
|
-
if (!response.ok) throw new HttpError(response.status >= 400 ? response.status : 502, "no_board", `There's no board at ${remote}: it answered ${response.status}.`, { origin: "handle" });
|
|
361
|
-
return await response.json();
|
|
362
|
-
}, rethrow)).catch((error) => {
|
|
363
|
-
discovered = null;
|
|
364
|
-
throw error;
|
|
365
|
-
});
|
|
366
|
-
let principal = null;
|
|
367
|
-
/** This deployment's principal on the remote, asked once. */
|
|
368
|
-
const self = () => principal ??= own.me().then((me) => me.principal).catch((error) => {
|
|
369
|
-
principal = null;
|
|
370
|
-
throw error;
|
|
371
|
-
});
|
|
372
|
-
/**
|
|
373
|
-
* A post's ID, from the one board() derived for it, under this deployment's own principal: the
|
|
374
|
-
* remote takes a `key:<principal>:` ID only from that principal, so no one can post with it first.
|
|
375
|
-
*/
|
|
376
|
-
const ownKey = async (derived) => keyId(await self(), derived);
|
|
377
|
-
/** One protocol call on the remote, as `client`: the same route, with the input back on the wire. */
|
|
378
|
-
async function call(client, method, input, signal) {
|
|
379
|
-
const route = routes[method];
|
|
380
|
-
const fields = { ...input };
|
|
381
|
-
const path = route.path.replace(/:(\w+)/g, (_, name) => {
|
|
382
|
-
const value = fields[name];
|
|
383
|
-
delete fields[name];
|
|
384
|
-
return encodeURIComponent(String(value));
|
|
385
|
-
});
|
|
386
|
-
let response;
|
|
387
|
-
if (method === "upload") {
|
|
388
|
-
const { data, name, type } = input;
|
|
389
|
-
if (data.byteLength > 4194304) {
|
|
390
|
-
const attachment = await client.upload({
|
|
391
|
-
data,
|
|
392
|
-
name: name ?? "file",
|
|
393
|
-
...type ? { type } : {}
|
|
394
|
-
}).catch(rethrow);
|
|
395
|
-
return Response.json({ attachment });
|
|
396
|
-
}
|
|
397
|
-
response = await client.request(path, {
|
|
398
|
-
method: "POST",
|
|
399
|
-
body: data,
|
|
400
|
-
headers: {
|
|
401
|
-
...type ? { "content-type": type } : {},
|
|
402
|
-
...name !== null ? { "x-board-filename": encodeURIComponent(name) } : {}
|
|
403
|
-
},
|
|
404
|
-
signal
|
|
405
|
-
}).catch(rethrow);
|
|
406
|
-
} else if (route.method === "GET") response = await client.request(`${path}${queryString(fields)}`, { signal }).catch(rethrow);
|
|
407
|
-
else response = await client.request(path, {
|
|
408
|
-
method: "POST",
|
|
409
|
-
body: new TextEncoder().encode(JSON.stringify(fields)),
|
|
410
|
-
headers: { "content-type": "application/json" },
|
|
411
|
-
signal
|
|
412
|
-
}).catch(rethrow);
|
|
413
|
-
if (response.ok) return response;
|
|
414
|
-
try {
|
|
415
|
-
const body = await response.json();
|
|
416
|
-
if (body.error?.message) throw new HttpError(response.status, body.error.code ?? "error", body.error.message, typeof body.error.hint === "string" ? { hint: body.error.hint } : {});
|
|
417
|
-
} catch (error) {
|
|
418
|
-
if (error instanceof HttpError) throw error;
|
|
419
|
-
}
|
|
420
|
-
throw new HttpError(502, "remote_error", `${remote} answered ${response.status}`);
|
|
421
|
-
}
|
|
422
|
-
/**
|
|
423
|
-
* A call of one of this board's own callers, which board() verified and limited, on the board it
|
|
424
|
-
* uses: as this deployment, with the caller's handle as its profile, a label there and never who
|
|
425
|
-
* it is, narrowed to what the caller may do. Its post IDs are its own, under its principal here.
|
|
426
|
-
* Who it is here, the board answers itself.
|
|
427
|
-
*/
|
|
428
|
-
async function asProject(method, identity, input, signal) {
|
|
429
|
-
if (method === "me") {
|
|
430
|
-
const { principal, author, actor } = identity;
|
|
431
|
-
return {
|
|
432
|
-
actor: actor.id,
|
|
433
|
-
principal: principal.id,
|
|
434
|
-
kind: actor.kind,
|
|
435
|
-
handle: actor.handle,
|
|
436
|
-
name: actor.name,
|
|
437
|
-
avatar: actor.avatar,
|
|
438
|
-
profile: author.profile,
|
|
439
|
-
session: author.session,
|
|
440
|
-
expiresAt: principal.expiresAt?.toISOString() ?? null,
|
|
441
|
-
can: principal.access.summary()
|
|
442
|
-
};
|
|
443
|
-
}
|
|
444
|
-
if (PROJECTS_OWN.has(method)) throw forbidden(`this board's callers act as its project on ${remote}, which can't tell them apart: ${method} is the project's own to do there`);
|
|
445
|
-
const scope = scopeOf(identity);
|
|
446
|
-
const avatar = identity.actor.avatar?.startsWith("https://") ? identity.actor.avatar : void 0;
|
|
447
|
-
const client = createBoardClient({
|
|
448
|
-
url: remote,
|
|
449
|
-
fetch: doFetch,
|
|
450
|
-
profile: {
|
|
451
|
-
name: callerProfile(identity.actor.handle, Object.keys(specs)),
|
|
452
|
-
...avatar ? { avatar } : {}
|
|
453
|
-
},
|
|
454
|
-
session: null,
|
|
455
|
-
...scope !== null ? { headers: { "x-board-scope": scope } } : {}
|
|
456
|
-
});
|
|
457
|
-
if ((method === "post" || method === "posted") && typeof input.id === "string") input = {
|
|
458
|
-
...input,
|
|
459
|
-
id: await ownKey(await derivedId("board-gateway", identity.principal.id, input.id)).catch(rethrow)
|
|
460
|
-
};
|
|
461
|
-
const response = await call(client, method, input, signal);
|
|
462
|
-
return method === "attachment" ? attachmentOf(String(input.id), response) : response.json();
|
|
463
|
-
}
|
|
464
|
-
/** A protocol method, called on the board it uses, as `caller`. */
|
|
465
|
-
async function remoteCall(method, caller, input, signal) {
|
|
466
|
-
const registering = start();
|
|
467
|
-
if ("identity" in caller) return asProject(method, caller.identity, input, signal);
|
|
468
|
-
const client = clientOf(caller);
|
|
469
|
-
if ("self" in caller && caller.origin.via?.kind === "engine") await registering;
|
|
470
|
-
if ((method === "post" || method === "posted") && "self" in caller && typeof input.id === "string" && DERIVED_ID.test(input.id)) input = {
|
|
471
|
-
...input,
|
|
472
|
-
id: await ownKey(input.id).catch(rethrow)
|
|
473
|
-
};
|
|
474
|
-
const response = await call(client, method, input, signal);
|
|
475
|
-
return method === "attachment" ? attachmentOf(String(input.id), response) : response.json();
|
|
476
|
-
}
|
|
477
|
-
const methods = {
|
|
478
|
-
...Object.fromEntries(METHODS.map((method) => [method, (caller, input, signal) => remoteCall(method, caller, input, signal)])),
|
|
479
|
-
async discovery() {
|
|
480
|
-
return discovery();
|
|
481
|
-
},
|
|
482
|
-
async readSource(caller, input, signal) {
|
|
483
|
-
if ("self" in caller && bound().sync.some((entry) => entry.key === input.key)) return bound().readSource(input.key, input.target, input.limit ?? 50, input.after ?? null);
|
|
484
|
-
return remoteCall("readSource", caller, input, signal);
|
|
485
|
-
},
|
|
486
|
-
async joinSource(caller, input, signal) {
|
|
487
|
-
if ("self" in caller && bound().sync.some((entry) => entry.key === input.key)) return bound().joinSource(input.key, input.target);
|
|
488
|
-
return remoteCall("joinSource", caller, input, signal);
|
|
489
|
-
},
|
|
490
|
-
async synced(caller, input, signal) {
|
|
491
|
-
const { targets } = await remoteCall("synced", caller, input, signal);
|
|
492
|
-
return { targets: await Promise.all(targets.map(async (row) => ({
|
|
493
|
-
...row,
|
|
494
|
-
url: row.url ?? (row.thread !== null && row.message !== null ? await bound().linkOf(row.key, row.thread, row.message) : null)
|
|
495
|
-
}))) };
|
|
496
|
-
},
|
|
497
|
-
async linked(caller, input, signal) {
|
|
498
|
-
const missing = () => new HttpError(404, "message_not_found", "no message on this board for that link");
|
|
499
|
-
const first = async () => {
|
|
500
|
-
for (const { platform, thread, message } of bound().locate(input.url)) for (const entry of bound().sync.filter((candidate) => candidate.platform === platform)) {
|
|
501
|
-
const at = await own.syncFind({
|
|
502
|
-
thread: `${entry.key}:${thread}`,
|
|
503
|
-
...message !== null ? { message } : {}
|
|
504
|
-
}, { signal }).catch(rethrow);
|
|
505
|
-
const found = message !== null ? at.message : at.thread === null ? null : (await own.syncThread(at.thread).catch(rethrow)).root;
|
|
506
|
-
if (found !== null) return found;
|
|
507
|
-
}
|
|
508
|
-
return null;
|
|
509
|
-
};
|
|
510
|
-
const id = await first();
|
|
511
|
-
if (id === null) return remoteCall("linked", caller, input, signal);
|
|
512
|
-
try {
|
|
513
|
-
return await methods.message(caller, { id }, signal);
|
|
514
|
-
} catch (error) {
|
|
515
|
-
if (error instanceof HttpError && error.status === 404) throw missing();
|
|
516
|
-
throw error;
|
|
517
|
-
}
|
|
518
|
-
},
|
|
519
|
-
async typing(caller, input, signal) {
|
|
520
|
-
const { targets } = await remoteCall("typing", caller, input, signal);
|
|
521
|
-
if (!("self" in caller) || bound().sync.length === 0) return { targets };
|
|
522
|
-
const { message, replies } = await methods.message(caller, { id: input.id }, signal);
|
|
523
|
-
const here = await bound().typing([message, ...replies], input.status).catch((error) => {
|
|
524
|
-
console.warn("[board] skipped typing where this board syncs:", describe(error));
|
|
525
|
-
return [];
|
|
526
|
-
});
|
|
527
|
-
return { targets: [...targets, ...here] };
|
|
528
|
-
}
|
|
529
|
-
};
|
|
530
|
-
/**
|
|
531
|
-
* Where the remote wakes this board: on a board that wakes by path, the path on this project,
|
|
532
|
-
* which gets through its Deployment Protection (`wakePath`); anywhere else, its URL.
|
|
533
|
-
*/
|
|
534
|
-
async function wakeAt(here) {
|
|
535
|
-
const path = wakePath(here);
|
|
536
|
-
return path && (await discovery()).wake_by_path ? path : { url: here };
|
|
537
|
-
}
|
|
538
|
-
const runner = registrant({
|
|
539
|
-
remote,
|
|
540
|
-
registry: {
|
|
541
|
-
register: (where) => own.register({
|
|
542
|
-
...where,
|
|
543
|
-
watch: specs,
|
|
544
|
-
...sync.length > 0 ? { sync } : {}
|
|
545
|
-
}),
|
|
546
|
-
matches: (query) => own.matches(query),
|
|
547
|
-
ack: (id, body) => own.ack(id, body)
|
|
548
|
-
},
|
|
549
|
-
wakeAt,
|
|
550
|
-
binding: bound,
|
|
551
|
-
hash: watchersHash,
|
|
552
|
-
hasWork: () => Object.keys(specs).length > 0 || sync.length > 0,
|
|
553
|
-
rethrow,
|
|
554
|
-
registerFor: async (caller, request) => json(await methods.register(caller, RegisterBody.parse(await request.json()), request.signal))
|
|
555
|
-
});
|
|
556
|
-
const start = runner.start;
|
|
557
|
-
return {
|
|
558
|
-
...methods,
|
|
559
|
-
routes: runner.routes,
|
|
560
|
-
keeps: false,
|
|
561
|
-
bind(next) {
|
|
562
|
-
if (binding) throw new Error("http: this backend already serves a board: create one http() per board()");
|
|
563
|
-
for (const [id, spec] of Object.entries(next.subscriptions)) {
|
|
564
|
-
if (spec.kind === "sync") {
|
|
565
|
-
if (id === "@sync") sync = next.sync.map((entry) => ({ ...entry }));
|
|
566
|
-
continue;
|
|
567
|
-
}
|
|
568
|
-
if (!PROFILE.test(id)) throw new Error(`watch ${id}: ${PROFILE_RULE}`);
|
|
569
|
-
compileWatcher(id, spec);
|
|
570
|
-
specs[id] = {
|
|
571
|
-
tail: spec.tail,
|
|
572
|
-
when: spec.when
|
|
573
|
-
};
|
|
574
|
-
}
|
|
575
|
-
hash = null;
|
|
576
|
-
binding = next;
|
|
577
|
-
},
|
|
578
|
-
/** Registers this board's watchers with the board it uses now, as `POST /watchers` does. */
|
|
579
|
-
registerWatchers: runner.registerNow,
|
|
580
|
-
/** Stops pulling, for a board that pulls on its own. */
|
|
581
|
-
close: runner.close
|
|
582
|
-
};
|
|
583
|
-
}
|
|
584
|
-
//#endregion
|
|
585
|
-
export { wakePath as a, registrant as i, callerProfile as n, createHttp as r, PROJECTS_OWN as t };
|
package/dist/backend-http.d.mts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { n as HttpOptions, t as HttpBackend } from "./backend-http-CaN06CaD.mjs";
|
|
2
|
-
//#region src/backend-http/index.default.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* The board at `url`, which keeps the log. Outside Node there's no environment to find it or a
|
|
5
|
-
* token in: `fetch` (the global one by default) sends the page's own session, which the board's
|
|
6
|
-
* `authenticate` recognizes.
|
|
7
|
-
*/
|
|
8
|
-
export declare function http(url?: string, options?: HttpOptions): HttpBackend;
|
|
9
|
-
//#endregion
|
|
10
|
-
export type { HttpBackend, HttpOptions };
|
package/dist/backend-http.mjs
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { n as HttpOptions, t as HttpBackend } from "./backend-http-CaN06CaD.mjs";
|
|
2
|
-
//#region src/backend-http/index.d.ts
|
|
3
|
-
/**
|
|
4
|
-
* The board at `url`, which keeps the log: this board uses it as this deployment. Without a
|
|
5
|
-
* `url`, the one the environment points at: `BOARD_URL`.
|
|
6
|
-
* Without a `fetch`, it sends the credentials `vb` would.
|
|
7
|
-
*/
|
|
8
|
-
export declare function http(url?: string, options?: HttpOptions): HttpBackend;
|
|
9
|
-
//#endregion
|
|
10
|
-
export type { HttpBackend, HttpOptions };
|