@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,6 +1,372 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { U as MessageView, _ as BoardEventView, dt as SourceJoin, mt as SourceRead, t as BoardClient } from "./client-COfYrgfV.mjs";
|
|
1
|
+
import { $ as ScheduleView, $t as Attachment, A as MatchView, Dt as TokenView, Et as TokenInput, I as MessagesQueryInput, K as RegisterInput, M as Me, N as MessageView, P as MessagesPage, Qt as ExternalCopy, S as InboxItem, St as ThreadsPage, Zt as Actor, _t as SyncReceiptInput, a as ChannelView, an as ExternalLink, c as Discovery, dt as SyncFindInput, h as FiltersInput, ht as SyncImportInput, i as BoardEventView, in as ExternalFile, jt as UpdateGrantInput, m as Explanation, nn as ExternalAuthor, on as Link, ot as SourceRead, pt as SyncFindView, q as RegistrationView, rn as ExternalEvent, rt as SourceJoin, tt as SchedulesQueryInput, u as EventsPage, v as GrantInput, vt as SyncThreadView, wt as ThreadsQueryInput, x as InboxEntry, xt as ThreadView, y as GrantView, yt as SyncedView } from "./routes-De4W6lEs.mjs";
|
|
3
2
|
import { z } from "zod";
|
|
3
|
+
//#region src/client/client.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Where an error came from: `handle`, raised by the handle on this machine (no Vercel login,
|
|
6
|
+
* Deployment Protection), or `board`, a board's answer, whose words are its own whatever code it
|
|
7
|
+
* names.
|
|
8
|
+
*/
|
|
9
|
+
type ErrorOrigin = 'handle' | 'board';
|
|
10
|
+
/**
|
|
11
|
+
* What went wrong: `message` says what and why, `code` is what to branch on, `hint`, when there's
|
|
12
|
+
* one, what fixes it, and `origin` who said so. Trust a `board` one's message and hint as you would
|
|
13
|
+
* the board.
|
|
14
|
+
*/
|
|
15
|
+
declare class BoardError extends Error {
|
|
16
|
+
readonly code: string;
|
|
17
|
+
readonly status: number;
|
|
18
|
+
readonly hint: string | undefined;
|
|
19
|
+
readonly origin: ErrorOrigin;
|
|
20
|
+
constructor(code: string, message: string, status: number, options?: {
|
|
21
|
+
hint?: string;
|
|
22
|
+
origin?: ErrorOrigin;
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
type Resolvable<T> = T | (() => T | Promise<T>);
|
|
26
|
+
/** A profile name, `{ name, avatar }`, or null for no profile. */
|
|
27
|
+
type ProfileOption = string | {
|
|
28
|
+
name: string;
|
|
29
|
+
avatar?: string;
|
|
30
|
+
} | null;
|
|
31
|
+
type ClientOptions = {
|
|
32
|
+
/** The board's URL, e.g. `https://www.example.com/api/board`. */
|
|
33
|
+
url: string;
|
|
34
|
+
/** An OIDC token whose audience is the board's URL, or a function returning one. Without one, `fetch` brings the credentials. */
|
|
35
|
+
token?: Resolvable<string>;
|
|
36
|
+
profile?: Resolvable<ProfileOption>;
|
|
37
|
+
/** Runtime session, recorded on writes and used to scope read cursors. */
|
|
38
|
+
session?: Resolvable<string | null>;
|
|
39
|
+
/** A person's handle; the board falls back to one derived from their user ID. */
|
|
40
|
+
handle?: Resolvable<string | null>;
|
|
41
|
+
/** Your display name and avatar, shown when you write as yourself (not as a profile). */
|
|
42
|
+
person?: Resolvable<{
|
|
43
|
+
name?: string | null;
|
|
44
|
+
avatar?: string | null;
|
|
45
|
+
} | null>;
|
|
46
|
+
/** Extra headers on every request. */
|
|
47
|
+
headers?: Resolvable<Record<string, string>>;
|
|
48
|
+
fetch?: typeof fetch;
|
|
49
|
+
/**
|
|
50
|
+
* How a direct upload's bytes go to the blob store's signed URL: `fetch` by default, never the
|
|
51
|
+
* board's own, which brings the board's credentials and would hand them to the store.
|
|
52
|
+
*/
|
|
53
|
+
storeFetch?: typeof fetch;
|
|
54
|
+
};
|
|
55
|
+
type PostOptions = {
|
|
56
|
+
text: string;
|
|
57
|
+
labels?: Record<string, string>;
|
|
58
|
+
/** Keep this message on the board: no configured sync targets. */
|
|
59
|
+
noSync?: boolean;
|
|
60
|
+
/** External targets the new thread starts with: `slack:#incidents` starts one, `github:owner/repo:12` joins one. */
|
|
61
|
+
sync?: string[];
|
|
62
|
+
/** Makes retries idempotent: the same id never posts twice. */
|
|
63
|
+
id?: string;
|
|
64
|
+
/** Files from `upload`, or their IDs. */
|
|
65
|
+
attachments?: (Attachment | string)[];
|
|
66
|
+
};
|
|
67
|
+
type ReplyOptions = Omit<PostOptions, 'sync'> & {
|
|
68
|
+
/**
|
|
69
|
+
* Posts only while this is the thread's newest message: the ID of the last one you read. If
|
|
70
|
+
* another has come after it, nothing is posted, and it throws a 409 `newer_message`.
|
|
71
|
+
*/
|
|
72
|
+
after?: string;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* When a scheduled message goes out: once `in` a while or `at` a time, or
|
|
76
|
+
* `every` so often (first at `at`, `in`, or one `every` from now), stopping
|
|
77
|
+
* `until` a time, `for` a while after the first send, or after `times` sends.
|
|
78
|
+
* A repeat with no stop runs until it's canceled.
|
|
79
|
+
*/
|
|
80
|
+
type ScheduleTiming = {
|
|
81
|
+
in?: string;
|
|
82
|
+
at?: Date | string;
|
|
83
|
+
every?: string;
|
|
84
|
+
until?: Date | string;
|
|
85
|
+
for?: string;
|
|
86
|
+
times?: number;
|
|
87
|
+
};
|
|
88
|
+
type ScheduleOptions = Omit<PostOptions, 'sync' | 'id'> & ScheduleTiming;
|
|
89
|
+
/** What `upload` takes: the bytes, and what to call them. */
|
|
90
|
+
type UploadInput = {
|
|
91
|
+
data: Blob | Uint8Array<ArrayBuffer>;
|
|
92
|
+
name: string;
|
|
93
|
+
/** A MIME type; a `Blob`'s own type, or one from the name's extension, otherwise. */
|
|
94
|
+
type?: string;
|
|
95
|
+
};
|
|
96
|
+
type WaitOptions = {
|
|
97
|
+
/** `'30s'`, `'10m'`, `'1h'`, or milliseconds. Default `'30m'`. */
|
|
98
|
+
timeout?: string | number;
|
|
99
|
+
signal?: AbortSignal;
|
|
100
|
+
};
|
|
101
|
+
declare function duration(value: string | number): number;
|
|
102
|
+
type Filters = Omit<FiltersInput, 'label'> & {
|
|
103
|
+
/** `{ status: 'open' }` or `['status=open']`. */
|
|
104
|
+
label?: Record<string, string> | string[];
|
|
105
|
+
};
|
|
106
|
+
type BoardClient = ReturnType<typeof createBoardClient>;
|
|
107
|
+
/** Whom `explain` asks about: nobody for yourself, or one principal as people name it. */
|
|
108
|
+
type ExplainPrincipal = {
|
|
109
|
+
user?: string;
|
|
110
|
+
project?: string;
|
|
111
|
+
/** Where the project's deployment runs: production when left out. */
|
|
112
|
+
environment?: string;
|
|
113
|
+
github?: string;
|
|
114
|
+
workflow?: string;
|
|
115
|
+
branch?: string;
|
|
116
|
+
event?: string;
|
|
117
|
+
oidc?: string;
|
|
118
|
+
claims?: Record<string, string>;
|
|
119
|
+
/** An app on the team, by its slug or client ID. */
|
|
120
|
+
app?: string;
|
|
121
|
+
};
|
|
122
|
+
/** What a write returns, with the handles in it that matched nobody and stayed plain text. */
|
|
123
|
+
type Written<T> = T & {
|
|
124
|
+
unknownMentions?: string[];
|
|
125
|
+
};
|
|
126
|
+
declare function createBoardClient(options: ClientOptions): {
|
|
127
|
+
url: string;
|
|
128
|
+
/**
|
|
129
|
+
* The board's HTTP API with this client's credentials, and the response as
|
|
130
|
+
* the board sent it, errors included: for proxies like `vb inspect`.
|
|
131
|
+
*/
|
|
132
|
+
request: (path: string, init?: {
|
|
133
|
+
method?: string;
|
|
134
|
+
body?: Uint8Array<ArrayBuffer>;
|
|
135
|
+
headers?: Record<string, string>;
|
|
136
|
+
signal?: AbortSignal;
|
|
137
|
+
/** Act as this profile (`null` for yourself) instead of the client's. */
|
|
138
|
+
as?: ProfileOption;
|
|
139
|
+
}) => Promise<Response>;
|
|
140
|
+
discovery: () => Promise<Discovery>;
|
|
141
|
+
me: () => Promise<Me>;
|
|
142
|
+
channels: () => Promise<ChannelView[]>;
|
|
143
|
+
/**
|
|
144
|
+
* Makes a channel before anything posts to it, as a first post would. Needs `read` and `post`
|
|
145
|
+
* there. `created` is false when it was there already; it's left as it is.
|
|
146
|
+
*/
|
|
147
|
+
createChannel: (path: string) => Promise<{
|
|
148
|
+
channel: ChannelView;
|
|
149
|
+
created: boolean;
|
|
150
|
+
}>;
|
|
151
|
+
actors: () => Promise<Actor[]>;
|
|
152
|
+
messages: (query?: Filters & Omit<MessagesQueryInput, keyof FiltersInput>) => Promise<MessagesPage>;
|
|
153
|
+
thread: (id: string) => Promise<ThreadView>;
|
|
154
|
+
/** Your own post with the client ID you gave it, as posting it answered: 404 `post_not_found` when there's none. */
|
|
155
|
+
posted: (id: string) => Promise<MessageView>;
|
|
156
|
+
/** Threads with a matching message, one summary each (root, reply count, latest reply), by latest activity. `limit` counts threads. */
|
|
157
|
+
threads: (query?: Filters & Omit<ThreadsQueryInput, keyof FiltersInput>) => Promise<ThreadsPage>;
|
|
158
|
+
/** `unknownMentions` lists the handles that matched nobody: they posted as plain text. */
|
|
159
|
+
post(channel: string, input: string | PostOptions): Promise<Written<MessageView>>;
|
|
160
|
+
reply(id: string, input: string | ReplyOptions): Promise<Written<MessageView>>;
|
|
161
|
+
/**
|
|
162
|
+
* Posts later, as you: a new thread when `target` is a channel, a reply when it's
|
|
163
|
+
* `{ re }`, any message's ID in the thread. Each message it posts carries
|
|
164
|
+
* `schedule: { id, n }`. Needs a board with a scheduler.
|
|
165
|
+
*/
|
|
166
|
+
schedule(target: string | {
|
|
167
|
+
re: string;
|
|
168
|
+
}, input: ScheduleOptions): Promise<Written<ScheduleView>>;
|
|
169
|
+
/** Pending schedules (`all` for done and canceled too), oldest first. `re` is any message in a thread. */
|
|
170
|
+
schedules: (query?: Omit<SchedulesQueryInput, 'all'> & {
|
|
171
|
+
all?: boolean;
|
|
172
|
+
}) => Promise<ScheduleView[]>;
|
|
173
|
+
/** Stops a schedule: yours, or any with manage in its channel. `canceled` is false when it was already done or canceled. */
|
|
174
|
+
cancelSchedule: (id: string) => Promise<{
|
|
175
|
+
schedule: ScheduleView;
|
|
176
|
+
canceled: boolean;
|
|
177
|
+
}>;
|
|
178
|
+
/**
|
|
179
|
+
* A new grant: `principals` may do what `can` says, a map from channel pattern to permissions
|
|
180
|
+
* (`[]` for none). The same principals again are another grant. At each channel, the most
|
|
181
|
+
* specific pattern among the grants that name a caller decides, then the closest principal,
|
|
182
|
+
* and grants tied there add up. Needs manage at each pattern `can` names.
|
|
183
|
+
*/
|
|
184
|
+
createGrant: (input: GrantInput) => Promise<{
|
|
185
|
+
grant: GrantView;
|
|
186
|
+
}>;
|
|
187
|
+
/** 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. */
|
|
188
|
+
updateGrant: (id: string, input: UpdateGrantInput) => Promise<{
|
|
189
|
+
grant: GrantView;
|
|
190
|
+
}>;
|
|
191
|
+
/**
|
|
192
|
+
* Which grants decide `channel`, and what they give: for you, or with manage at `*`, for the
|
|
193
|
+
* principal `principal` names (`{ user }`, `{ project, environment }`, `{ github, workflow,
|
|
194
|
+
* branch, event }`, or `{ oidc, claims }`).
|
|
195
|
+
*/
|
|
196
|
+
explain: (channel: string, principal?: ExplainPrincipal) => Promise<Explanation>;
|
|
197
|
+
/** The board's grants. Needs manage at `*`, or a team owner. */
|
|
198
|
+
grants: () => Promise<GrantView[]>;
|
|
199
|
+
/** `revoked` is false when it was already gone. Its principals' next requests are refused. */
|
|
200
|
+
revokeGrant: (id: string) => Promise<{
|
|
201
|
+
revoked: boolean;
|
|
202
|
+
}>;
|
|
203
|
+
/**
|
|
204
|
+
* A token that acts as you, narrowed to `can`, writing as `profile` and `session` when they're
|
|
205
|
+
* given: for a widget, a sandbox, a script. `secret` shows only here. It lives 30 days, or
|
|
206
|
+
* `expires`, at most 90.
|
|
207
|
+
*/
|
|
208
|
+
createToken: (input: TokenInput) => Promise<{
|
|
209
|
+
token: TokenView;
|
|
210
|
+
secret: string;
|
|
211
|
+
}>;
|
|
212
|
+
/** Your live tokens, or everyone's with manage in every channel. Never their secrets. */
|
|
213
|
+
tokens: () => Promise<TokenView[]>;
|
|
214
|
+
/** It and every token minted with it stop. `revoked` is false when it was already revoked. */
|
|
215
|
+
revokeToken: (id: string) => Promise<{
|
|
216
|
+
revoked: boolean;
|
|
217
|
+
}>;
|
|
218
|
+
/**
|
|
219
|
+
* Stores a file on the board, for a post or reply's `attachments`. Up to 4 MB goes in one
|
|
220
|
+
* request; bigger, up to 100 MB, goes straight to the board's blob store on a URL the board
|
|
221
|
+
* signs, where its store can (`no_direct_uploads` where it can't).
|
|
222
|
+
*/
|
|
223
|
+
upload(input: UploadInput): Promise<Attachment>;
|
|
224
|
+
/** An attachment's bytes, as the board serves them: `content-type` is the file's type. */
|
|
225
|
+
download: (id: string, opts?: {
|
|
226
|
+
signal?: AbortSignal;
|
|
227
|
+
}) => Promise<Response>;
|
|
228
|
+
/**
|
|
229
|
+
* `revision` is the message's as you read it: if it's been edited or deleted since, nothing
|
|
230
|
+
* changes, and it throws a 409 `revision_conflict`.
|
|
231
|
+
*/
|
|
232
|
+
edit: (id: string, text: string, opts?: {
|
|
233
|
+
revision?: number;
|
|
234
|
+
}) => Promise<{
|
|
235
|
+
ok: true;
|
|
236
|
+
unknownMentions?: string[];
|
|
237
|
+
}>;
|
|
238
|
+
delete: (id: string, opts?: {
|
|
239
|
+
revision?: number;
|
|
240
|
+
}) => Promise<{
|
|
241
|
+
ok: true;
|
|
242
|
+
}>;
|
|
243
|
+
/** `emoji` is a short name, `:name:`, or the character itself. */
|
|
244
|
+
react: (id: string, emoji: string, opts?: {
|
|
245
|
+
remove?: boolean;
|
|
246
|
+
}) => Promise<{
|
|
247
|
+
ok: true;
|
|
248
|
+
}>;
|
|
249
|
+
/**
|
|
250
|
+
* `if` is what the labels must be now, a value or null for one that mustn't be set: if one
|
|
251
|
+
* isn't, nothing changes, and it throws a 409 `label_conflict`.
|
|
252
|
+
*/
|
|
253
|
+
label: (id: string, change: {
|
|
254
|
+
set?: Record<string, string>;
|
|
255
|
+
unset?: string[];
|
|
256
|
+
if?: Record<string, string | null>;
|
|
257
|
+
}) => Promise<{
|
|
258
|
+
ok: true;
|
|
259
|
+
}>;
|
|
260
|
+
/**
|
|
261
|
+
* Shows typing in the platform threads the message's thread is synced to.
|
|
262
|
+
* Ephemeral: nothing goes in the log. Answers the external threads that took it.
|
|
263
|
+
* `status` replaces "Typing…" on Slack ("running tests…").
|
|
264
|
+
*/
|
|
265
|
+
typing: (id: string, status?: string) => Promise<string[]>;
|
|
266
|
+
/**
|
|
267
|
+
* With a target, attaches the message's thread to it, backfilling it: attaching twice is a no-op.
|
|
268
|
+
* Without one, where the thread is synced, and this message's copy on each target, with its link.
|
|
269
|
+
*/
|
|
270
|
+
sync: {
|
|
271
|
+
(id: string): Promise<SyncedView>;
|
|
272
|
+
(id: string, target: string): Promise<{
|
|
273
|
+
target: string;
|
|
274
|
+
attached: boolean;
|
|
275
|
+
}>;
|
|
276
|
+
};
|
|
277
|
+
/**
|
|
278
|
+
* The thread of the board message a platform link names (a Slack permalink, a GitHub comment's
|
|
279
|
+
* URL), from what the board synced: the platform is never asked. 404 for one it didn't sync.
|
|
280
|
+
*/
|
|
281
|
+
linked: (url: string) => Promise<ThreadView>;
|
|
282
|
+
/** Raw platform events for a sync entry, newest first. */
|
|
283
|
+
inbox: (key: string, opts?: {
|
|
284
|
+
channel?: string;
|
|
285
|
+
limit?: number;
|
|
286
|
+
}) => Promise<InboxEntry[]>;
|
|
287
|
+
/** Registers the caller's watchers, replacing its last registration: what a board on `http()` does. */
|
|
288
|
+
register: (input: RegisterInput) => Promise<RegistrationView>;
|
|
289
|
+
/** Registered watchers: every one to `manage` everywhere, the caller's own to anyone else. */
|
|
290
|
+
watchers: () => Promise<RegistrationView[]>;
|
|
291
|
+
/** The caller's matches it can run now, each leased to it until it acks. `wait` holds the request up to that many seconds for one. */
|
|
292
|
+
matches: (opts?: {
|
|
293
|
+
limit?: number;
|
|
294
|
+
wait?: number;
|
|
295
|
+
signal?: AbortSignal;
|
|
296
|
+
}) => Promise<MatchView[]>;
|
|
297
|
+
/** How a pulled match went: done, an error to try again, or `skip` to drop it. */
|
|
298
|
+
ack: (id: string, body: {
|
|
299
|
+
lease: string;
|
|
300
|
+
error?: string;
|
|
301
|
+
skip?: boolean;
|
|
302
|
+
}) => Promise<{
|
|
303
|
+
ok: true;
|
|
304
|
+
}>;
|
|
305
|
+
/**
|
|
306
|
+
* Reads a platform channel (`#name`, an ID), thread (`C0123:1727000000.123456`),
|
|
307
|
+
* or message permalink on demand, without syncing or storing it. Full access only.
|
|
308
|
+
*/
|
|
309
|
+
readSource: (key: string, target: string, opts?: {
|
|
310
|
+
limit?: number;
|
|
311
|
+
after?: string;
|
|
312
|
+
}) => Promise<SourceRead>;
|
|
313
|
+
/** Adds the app to a public channel so `readSource` can read it, where the sync opted in with `join`. Full access only. */
|
|
314
|
+
joinSource: (key: string, target: string) => Promise<SourceJoin>;
|
|
315
|
+
poll: (query?: Filters & {
|
|
316
|
+
after?: string;
|
|
317
|
+
wait?: number;
|
|
318
|
+
all?: boolean;
|
|
319
|
+
}, signal?: AbortSignal) => Promise<EventsPage>;
|
|
320
|
+
/** A platform's write, as its platform author: idempotent per platform event for a post, found from its origin otherwise. */
|
|
321
|
+
syncImport: (body: SyncImportInput) => Promise<{
|
|
322
|
+
message: string | null;
|
|
323
|
+
dropped?: string[];
|
|
324
|
+
}>;
|
|
325
|
+
/** What sync did on a platform: a delivery, its files, a failure, or a thread's new target. */
|
|
326
|
+
syncReceipt: (body: SyncReceiptInput) => Promise<{
|
|
327
|
+
ok: true;
|
|
328
|
+
attached?: boolean;
|
|
329
|
+
}>;
|
|
330
|
+
/** A board thread's sync, by its key. */
|
|
331
|
+
syncThread: (thread: string) => Promise<SyncThreadView>;
|
|
332
|
+
/** What platform IDs are on the board: a thread, or a message. */
|
|
333
|
+
syncFind: (query: SyncFindInput, opts?: {
|
|
334
|
+
signal?: AbortSignal;
|
|
335
|
+
}) => Promise<SyncFindView>;
|
|
336
|
+
/** Messages' copies on platforms, by message and target. */
|
|
337
|
+
syncCopies: (messages: string[]) => Promise<Record<string, Record<string, ExternalCopy>>>;
|
|
338
|
+
/** Pushes platform events into your inbox for sync key `key`; each platform ID lands once. */
|
|
339
|
+
inboxPush: (key: string, events: {
|
|
340
|
+
id: string;
|
|
341
|
+
event: InboxItem['event'];
|
|
342
|
+
raw: unknown;
|
|
343
|
+
}[]) => Promise<{
|
|
344
|
+
ok: true;
|
|
345
|
+
}>;
|
|
346
|
+
/** Your next inbox events for `key`, leased to you until you ack them, one platform thread at a time. */
|
|
347
|
+
inboxNext: (key: string, opts?: {
|
|
348
|
+
limit?: number;
|
|
349
|
+
}) => Promise<InboxItem[]>;
|
|
350
|
+
/** How an inbox event went: done, or an error to try it again. */
|
|
351
|
+
inboxAck: (key: string, id: string, body: {
|
|
352
|
+
lease: string;
|
|
353
|
+
error?: string;
|
|
354
|
+
}) => Promise<{
|
|
355
|
+
ok: true;
|
|
356
|
+
}>;
|
|
357
|
+
/** Live events. Reconnects from the last seen index whenever the stream closes. */
|
|
358
|
+
events(query?: Filters & {
|
|
359
|
+
after?: string;
|
|
360
|
+
all?: boolean;
|
|
361
|
+
}, opts?: {
|
|
362
|
+
signal?: AbortSignal;
|
|
363
|
+
}): AsyncGenerator<BoardEventView>;
|
|
364
|
+
/** The next matching event after `after` (default: now), or null on timeout. */
|
|
365
|
+
wait(query?: Filters & {
|
|
366
|
+
after?: string;
|
|
367
|
+
}, opts?: WaitOptions): Promise<BoardEventView | null>;
|
|
368
|
+
};
|
|
369
|
+
//#endregion
|
|
4
370
|
//#region src/sync/events.d.ts
|
|
5
371
|
declare const EventBase: z.ZodObject<{
|
|
6
372
|
channel: z.ZodString;
|
|
@@ -662,4 +1028,4 @@ declare abstract class SyncProvider<E extends ProviderEvent = ProviderEvent> {
|
|
|
662
1028
|
render(input: RenderInput): string;
|
|
663
1029
|
}
|
|
664
1030
|
//#endregion
|
|
665
|
-
export { envelope as A, render as C, SyncOverrides as D, RootOverride as E, SyncResult as O, mirror as S, ProviderEvent as T, SyncIn as _, ProviderOptions as a, channels as b, ReceivedEvent as c, ResolvedTarget as d, SyncContext as f, SyncFn as g, Sync as h, ProviderFile as i, eventSchema as j, SyncRoot as k, RenderInput as l, UnreadableError as m, FileDelivery as n, ProviderPost as o, SyncProvider as p, ProviderDelivery as r, Receive as s, FetchedLink as t, Renderer as u, SyncOut as v, EventBase as w, into as x, SyncUnit as y };
|
|
1031
|
+
export { envelope as A, ScheduleTiming as B, render as C, SyncOverrides as D, RootOverride as E, Filters as F, WaitOptions as H, PostOptions as I, ProfileOption as L, BoardClient as M, BoardError as N, SyncResult as O, ErrorOrigin as P, ReplyOptions as R, mirror as S, ProviderEvent as T, Written as U, UploadInput as V, duration as W, SyncIn as _, ProviderOptions as a, channels as b, ReceivedEvent as c, ResolvedTarget as d, SyncContext as f, SyncFn as g, Sync as h, ProviderFile as i, eventSchema as j, SyncRoot as k, RenderInput as l, UnreadableError as m, FileDelivery as n, ProviderPost as o, SyncProvider as p, ProviderDelivery as r, Receive as s, FetchedLink as t, Renderer as u, SyncOut as v, EventBase as w, into as x, SyncUnit as y, ScheduleOptions as z };
|