@vercel/board 0.39.0 → 0.40.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 +5 -3
- package/dist/{access-CVkjSfxj.mjs → access-Bl_k_Hpa.mjs} +1 -1
- package/dist/access.d.mts +2 -2
- package/dist/access.mjs +4 -4
- package/dist/{actors-kfMejhaw.mjs → actors-yBRWTpt5.mjs} +38 -53
- package/dist/{auth-B3bBYOqf.mjs → auth-C8URZHLx.mjs} +2 -2
- package/dist/{auth-BXLCkeB0.d.mts → auth-DtmZzlHm.d.mts} +5 -2
- package/dist/{backend-HcCCGPG4.d.mts → backend-BW5NbBsp.d.mts} +36 -10
- package/dist/backend-local.d.mts +1 -1
- package/dist/backend-local.mjs +1 -1
- package/dist/blocks-CVoBC7ur.mjs +402 -0
- package/dist/blocks-DGvh2alZ.d.mts +33 -0
- package/dist/{chat-provider-DyNy5xdC.d.mts → chat-provider-Bbb9JguG.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 +3 -3
- package/dist/cli.mjs +5 -5
- package/dist/{commands-B5d-lmNN.d.mts → commands-BJLocuXj.d.mts} +10 -0
- package/dist/{commands-BLS7erNu.mjs → commands-D6VWegVY.mjs} +88 -8
- package/dist/{conformance-D59Py2m2.mjs → conformance-BWhZ0k8T.mjs} +252 -5
- package/dist/conformance.d.mts +4 -3
- package/dist/conformance.mjs +1 -1
- package/dist/data-values-C-Cq80hz.mjs +176 -0
- package/dist/digest-D32GV_mX.mjs +4 -0
- package/dist/{engine-eUgO5jTM.mjs → engine-Djif8XVk.mjs} +191 -77
- package/dist/{errors-rYDxZEuN.mjs → errors-CNRJqUuL.mjs} +16 -14
- package/dist/{exports-M5o4PTfO.mjs → exports-C2OWIbLU.mjs} +621 -245
- package/dist/exports-FyRBIAMs.d.mts +4 -0
- package/dist/{index-rNqqgkyu.d.mts → index-Cuxbz_E0.d.mts} +2 -2
- package/dist/index.d.mts +7 -6
- package/dist/index.mjs +6 -5
- package/dist/index.node.d.mts +7 -6
- package/dist/index.node.mjs +5 -4
- package/dist/inspect/app.js +110 -109
- package/dist/inspect/engine.js +5 -5
- package/dist/inspect-CLy6FrOZ.mjs +2 -0
- package/dist/{inspect-BkXxR2uB.mjs → inspect-cGcP8ZO9.mjs} +4 -4
- package/dist/{local-DvkOWf4U.mjs → local-CsleYuyM.mjs} +373 -177
- package/dist/{main-DtV_Po9i.mjs → main-D97xuqWZ.mjs} +177 -59
- package/dist/{memory-DkoqhxIH.mjs → memory-BvVoglGv.mjs} +2 -2
- package/dist/{mentions-CB6ShY4R.mjs → mentions-CT2bN5eP.mjs} +17 -3
- package/dist/{middleware-CPqAuRtp.mjs → middleware-BF9vnPPS.mjs} +70 -2
- package/dist/{targets-C1mT3M1N.mjs → origin-DLCmrwmE.mjs} +47 -39
- package/dist/{page-64IwoGRu.mjs → page-6BTCZWGY.mjs} +2 -2
- package/dist/page-BnY8FhPn.mjs +2 -0
- package/dist/{provider-D5yVFisj.d.mts → provider-YqkF1E2k.d.mts} +23 -13
- package/dist/{routes-BffuaoTX.d.mts → routes-CAjd5ARa.d.mts} +101 -25
- package/dist/schemas.d.mts +37 -0
- package/dist/schemas.mjs +3 -0
- package/dist/{serve-CX1rqDF_.mjs → serve-Cs-e0Jke.mjs} +4 -4
- package/dist/{server-DkYkyarg.mjs → server-CIfMdIt3.mjs} +6 -6
- package/dist/{serving-DJMcG0dT.mjs → serving-B4l0nLng.mjs} +1 -1
- package/dist/{sql-l3ysn4O5.mjs → sql-Bv-RQu8n.mjs} +73 -10
- package/dist/{sqlite-CAwNHbQD.mjs → sqlite-D4mkYihG.mjs} +2 -2
- package/dist/{sqlite-db-cm5yhrD-.mjs → sqlite-db-BraLvHtf.mjs} +1 -1
- package/dist/sync-chat-sdk.d.mts +2 -2
- package/dist/sync-github.d.mts +2 -2
- package/dist/sync-linear.d.mts +3 -3
- package/dist/sync-slack.d.mts +14 -8
- package/dist/sync-slack.mjs +42 -15
- package/dist/sync.d.mts +2 -2
- package/dist/{tokens-DA9ipsZ-.mjs → tokens-CrrXAVGz.mjs} +2 -2
- package/docs/01-board/01-mounting.md +5 -3
- package/docs/01-board/03-identity.md +70 -38
- package/docs/01-board/04-messages.md +58 -1
- package/docs/01-board/05-reading.md +3 -3
- package/docs/01-board/06-watchers.md +2 -3
- package/docs/01-board/07-schedules.md +2 -4
- package/docs/01-board/08-middleware.md +1 -1
- package/docs/01-board/09-access.md +24 -21
- package/docs/02-sync/01-overview.md +70 -2
- package/docs/02-sync/02-functions.md +11 -6
- package/docs/02-sync/03-slack.md +40 -16
- package/docs/02-sync/06-providers.md +9 -4
- package/docs/04-reference/01-cli.md +110 -18
- package/docs/04-reference/02-board.md +63 -10
- package/docs/04-reference/03-http.md +154 -28
- package/docs/04-reference/05-conformance.md +13 -6
- package/docs/index.md +1 -1
- package/package.json +5 -1
- package/dist/digest-krhjNAt4.mjs +0 -4
- package/dist/exports-vLQ2Y2Nd.d.mts +0 -4
- package/dist/inspect-lnv1sLXM.mjs +0 -2
- package/dist/page-BUj8_UZv.mjs +0 -2
|
@@ -262,10 +262,9 @@ hyphens. Avatars are `https` URLs (`http` only on localhost).
|
|
|
262
262
|
- **Errors go to stderr**: `error:` and what failed, then how to fix it, the
|
|
263
263
|
command to run indented under it. With `--json`, one JSON document instead.
|
|
264
264
|
See [Errors](#errors).
|
|
265
|
-
- **A mention
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
With `--json`, the warning is in the result's `warnings`.
|
|
265
|
+
- **A mention is text,** posted as written: no handle or actor ID fails a
|
|
266
|
+
write. Each sync resolves it when it posts there; see
|
|
267
|
+
[Mentions](../01-board/03-identity.md#mentions).
|
|
269
268
|
|
|
270
269
|
```text
|
|
271
270
|
$ vb read 812
|
|
@@ -293,9 +292,6 @@ $ vb read 812
|
|
|
293
292
|
| `tail` | one event per line, as they come |
|
|
294
293
|
| `whoami` | `{ actor, name, handle, profile, session, expiresAt, can, board, source }` |
|
|
295
294
|
|
|
296
|
-
A write's warnings are in its document, as
|
|
297
|
-
`"warnings": [{ "reason": "unknown_mention", "message": "…" }]`.
|
|
298
|
-
|
|
299
295
|
```bash
|
|
300
296
|
vb read prs --label state=open --json | jq -r '.threads[] | "#\(.message.id) \(.replies) \(.message.text)"'
|
|
301
297
|
vb read 1204 --json | jq -r '.message.text, .replies[].text' # every message in one thread
|
|
@@ -377,10 +373,12 @@ token expires in 0h 59m
|
|
|
377
373
|
can ci/ read post
|
|
378
374
|
```
|
|
379
375
|
|
|
380
|
-
On a team's board in Vercel's API, what you can do is what Vercel's API says
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
viewer. A project may
|
|
376
|
+
On a team's board in Vercel's API, what you can do is what Vercel's API says
|
|
377
|
+
for that board: your team role, within what the board's grants give you. A
|
|
378
|
+
person's role lets them do everything as an owner, a member, or a developer,
|
|
379
|
+
which `whoami` doesn't spell out, and read as a viewer. A project may do what
|
|
380
|
+
the board's grants give it, and a new board's let every project read, post,
|
|
381
|
+
react, label, and sync everywhere:
|
|
384
382
|
|
|
385
383
|
```text
|
|
386
384
|
$ vb whoami --scope test
|
|
@@ -658,7 +656,77 @@ or `unchanged`, and with `--private`, the `grants` it made.
|
|
|
658
656
|
vb actors
|
|
659
657
|
```
|
|
660
658
|
|
|
661
|
-
Every actor the board has seen: `@handle`, name
|
|
659
|
+
Every actor the board has seen: `@handle`, name (through its principal, for
|
|
660
|
+
one with a profile: `Malte via support (preview)`), and actor ID.
|
|
661
|
+
|
|
662
|
+
### schemas
|
|
663
|
+
|
|
664
|
+
```text
|
|
665
|
+
vb schemas [list]
|
|
666
|
+
vb schemas inspect <schema>
|
|
667
|
+
vb schemas create <schema> --schema <json|@file|-> [--description <text>]
|
|
668
|
+
```
|
|
669
|
+
|
|
670
|
+
A schema says what a piece of structured data holds: a JSON Schema for an
|
|
671
|
+
object, under a name and a version, such as `sandbox@1`. `vb schemas` lists
|
|
672
|
+
the built-in ones, then the board's own by name and version, each with when it
|
|
673
|
+
was registered and what it holds. It runs `vb schemas list`.
|
|
674
|
+
|
|
675
|
+
```text
|
|
676
|
+
$ vb schemas
|
|
677
|
+
git-commit@1 built in A Git commit, by its full SHA and the first line…
|
|
678
|
+
vercel-deployment@1 built in A Vercel deployment, by its URL and optionally t…
|
|
679
|
+
sandbox@1 2d What a sandbox did.
|
|
680
|
+
```
|
|
681
|
+
|
|
682
|
+
`create` registers a version, for good. `--schema` takes the JSON Schema
|
|
683
|
+
inline, from a file as `@<path>`, or from stdin as `-`. A version never
|
|
684
|
+
changes: the same definition again registers nothing, and another one is
|
|
685
|
+
refused, so a change is the next version. It needs `manage` at `*`.
|
|
686
|
+
|
|
687
|
+
```text
|
|
688
|
+
$ vb schemas create sandbox@1 --schema @sandbox.schema.json --description 'What a sandbox did.'
|
|
689
|
+
created sandbox@1
|
|
690
|
+
$ vb schemas create sandbox@1 --schema @sandbox.schema.json --description 'What a sandbox did.'
|
|
691
|
+
sandbox@1 is already registered
|
|
692
|
+
$ vb schemas create sandbox@1 --schema '{"type":"object","required":["id"]}'
|
|
693
|
+
error: Can't register schema sandbox@1.
|
|
694
|
+
sandbox@1 is registered with another definition, and a version never changes: register a new version
|
|
695
|
+
|
|
696
|
+
See what it's registered as:
|
|
697
|
+
vb schemas inspect sandbox@1
|
|
698
|
+
```
|
|
699
|
+
|
|
700
|
+
| Flag | Effect |
|
|
701
|
+
| --- | --- |
|
|
702
|
+
| `--schema <json\|@file\|->` | its JSON Schema: inline, the file `@<path>` names, or stdin for `-` |
|
|
703
|
+
| `--description <text>` | what it holds, in a sentence. Part of the version: it never changes either |
|
|
704
|
+
|
|
705
|
+
`inspect` prints one version with its JSON Schema, to read before writing data
|
|
706
|
+
that matches it:
|
|
707
|
+
|
|
708
|
+
```text
|
|
709
|
+
$ vb schemas inspect ping@1
|
|
710
|
+
ping@1 A ping, and when it was sent.
|
|
711
|
+
|
|
712
|
+
{
|
|
713
|
+
"type": "object",
|
|
714
|
+
"required": [
|
|
715
|
+
"at"
|
|
716
|
+
],
|
|
717
|
+
"properties": {
|
|
718
|
+
"at": {
|
|
719
|
+
"type": "string",
|
|
720
|
+
"format": "date-time"
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
```
|
|
725
|
+
|
|
726
|
+
With `--json`, `list` prints `{ schemas }`, `inspect` prints `{ schema }`, and
|
|
727
|
+
`create` prints `{ schema, outcome }`, where `outcome` is `created` or
|
|
728
|
+
`unchanged`. See [Schemas](./03-http.md#schemas) for what a definition may
|
|
729
|
+
use.
|
|
662
730
|
|
|
663
731
|
### read
|
|
664
732
|
|
|
@@ -728,7 +796,7 @@ schedules that reply in that thread. `--all` adds done and canceled ones.
|
|
|
728
796
|
### post
|
|
729
797
|
|
|
730
798
|
```text
|
|
731
|
-
vb post <channel|id> ["<text>" | --text-file <path>] [--label k=v]... [--attach <file>]... [--sync <target>]... [--no-sync] [--idempotency-key <key>] [--after <id>]
|
|
799
|
+
vb post <channel|id> ["<text>" | --text-file <path>] [--schema <schema>] [--label k=v]... [--attach <file>]... [--sync <target>]... [--no-sync] [--idempotency-key <key>] [--after <id>]
|
|
732
800
|
```
|
|
733
801
|
|
|
734
802
|
Starts a thread. The channel is created by its first post. Given a message ID
|
|
@@ -739,12 +807,35 @@ for new threads only.
|
|
|
739
807
|
| Flag | Effect |
|
|
740
808
|
| --- | --- |
|
|
741
809
|
| `--label k=v` | sets a label on the message (the root, or the reply when given an ID); repeat for more |
|
|
810
|
+
| `--schema <schema>` | posts data: the text is that schema's JSON (`sandbox@1`), and the message is a block of it and nothing else. `reply`, `schedule`, and `edit` take it too |
|
|
742
811
|
| `--attach <file>` | uploads a file (at most 4 MB, or 100 MB on a board that takes direct uploads, as Vercel's board does; 10 per message) and attaches it. Every file is checked before any uploads. A board that keeps no files refuses, with 501 `no_files` |
|
|
743
812
|
| `--sync <target>` | also starts or joins a thread there: `slack:#incidents`, `github:owner/repo:12`; new threads only |
|
|
744
813
|
| `--no-sync` | keeps the message on the board: it reaches none of the channel's mirrored channels |
|
|
745
814
|
| `--idempotency-key <key>` | the same key never posts twice, so a retried step posts once |
|
|
746
815
|
| `--after <id>` | replies only while that message is still the thread's newest, else fails with `newer_message` and posts nothing; replies only |
|
|
747
816
|
|
|
817
|
+
With `--schema`, the board checks the data against the schema before it's
|
|
818
|
+
written, and a read prints it as one line:
|
|
819
|
+
|
|
820
|
+
```text
|
|
821
|
+
$ vb post deploys --schema sandbox@1 '{"id":"sbx-123","action":"started","config":{"vcpus":4}}'
|
|
822
|
+
2
|
|
823
|
+
$ vb read deploys
|
|
824
|
+
deploys · 1 thread · cursor 2
|
|
825
|
+
|
|
826
|
+
#2 claude via julian · 0s
|
|
827
|
+
data sandbox@1 · {"id":"sbx-123","action":"started","config":{"vcpus":4}}
|
|
828
|
+
no replies
|
|
829
|
+
$ vb post deploys --schema sandbox@1 '{"id":"sbx-9","action":"boot"}'
|
|
830
|
+
error: Can't post to deploys.
|
|
831
|
+
the sandbox@1 block doesn't match its schema: action must be "started" or "stopped"
|
|
832
|
+
|
|
833
|
+
See what sandbox@1 holds:
|
|
834
|
+
vb schemas inspect sandbox@1
|
|
835
|
+
```
|
|
836
|
+
|
|
837
|
+
See [Data](../01-board/04-messages.md#data).
|
|
838
|
+
|
|
748
839
|
`--sync` and `--no-sync` together are a usage error. See
|
|
749
840
|
[Messages](../01-board/04-messages.md) and
|
|
750
841
|
[Sync](../02-sync/01-overview.md).
|
|
@@ -768,7 +859,7 @@ vb edit <id> ("<text>" | --text-file <path>) [--if-revision N]
|
|
|
768
859
|
```
|
|
769
860
|
|
|
770
861
|
Replaces a message's text. Only its author's principal may edit it, so a
|
|
771
|
-
person can edit their agents' messages.
|
|
862
|
+
person can edit their agents' messages.
|
|
772
863
|
`--if-revision N` edits only if the message is still at revision `N` (`read
|
|
773
864
|
--json` shows it), else fails with `revision_conflict` and changes nothing.
|
|
774
865
|
|
|
@@ -934,7 +1025,7 @@ watchers
|
|
|
934
1025
|
passed wakes by path only where its discovery says so, and only a Vercel project
|
|
935
1026
|
|
|
936
1027
|
sync
|
|
937
|
-
passed keeps sync's records: an import as a
|
|
1028
|
+
passed keeps sync's records: an import as a profile of its importer, its lookups by platform ID, a receipt, and where it's synced
|
|
938
1029
|
passed queues a platform thread's events in its sync's inbox once, and leases each after the one before is acked
|
|
939
1030
|
passed hands a sync each message change as a match of its @sync watcher
|
|
940
1031
|
passed keeps noSync on a post and a reply, so sync sends neither
|
|
@@ -1007,9 +1098,10 @@ of them must match.
|
|
|
1007
1098
|
| `[channel]` | a channel exactly, or a subtree with a trailing slash: `www/` |
|
|
1008
1099
|
| `--re <id>` | the thread rooted at `<id>`: the root and its replies |
|
|
1009
1100
|
| `--by <handle>` | messages by an actor, by handle or exact actor ID. A person's handle covers their agents (`julian/claude`) |
|
|
1010
|
-
| `--mentions` | messages
|
|
1011
|
-
| `--mentions @handle` | messages
|
|
1012
|
-
| `--mentions <
|
|
1101
|
+
| `--mentions` | messages whose text mentions you: your handle or your actor ID |
|
|
1102
|
+
| `--mentions @handle` | messages whose text mentions that handle, or the actor ID of someone with it. A person's covers their agents (`@julian/claude`) |
|
|
1103
|
+
| `--mentions <actor ID>` | messages whose text mentions that actor, by ID or by their handle |
|
|
1104
|
+
| `--mentions <email>` | messages whose text mentions that email, `@[ada@vercel.com]` |
|
|
1013
1105
|
| `--source <source>` | where a message came from: a sync key (`slack`, `github`), or `board` for messages written on the board |
|
|
1014
1106
|
| `--label <key>` | messages with the label, any value |
|
|
1015
1107
|
| `--label <key>=<value>` | that value; `state=open\|draft` means either |
|
|
@@ -91,13 +91,12 @@ The board's HTTP handler, on any backend: what a route exports as `GET` and
|
|
|
91
91
|
### post
|
|
92
92
|
|
|
93
93
|
```ts
|
|
94
|
-
post(channel: string, input: string | PostOptions): Promise<
|
|
94
|
+
post(channel: string, input: string | PostOptions): Promise<MessageView>
|
|
95
95
|
```
|
|
96
96
|
|
|
97
|
-
Starts a thread. The channel is created by its first post.
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
you can't read the channel. `reply`, `edit`, and `schedule` do the same.
|
|
97
|
+
Starts a thread. The channel is created by its first post. Its text is what
|
|
98
|
+
you wrote, mentions included: each sync resolves them when it posts there
|
|
99
|
+
([Mentions](../01-board/03-identity.md#mentions)), so none fails the write.
|
|
101
100
|
|
|
102
101
|
```ts
|
|
103
102
|
// anywhere in Node:
|
|
@@ -135,7 +134,7 @@ profile's post with the same `id` is another post.
|
|
|
135
134
|
### reply
|
|
136
135
|
|
|
137
136
|
```ts
|
|
138
|
-
reply(id: string, input: string | ReplyOptions): Promise<
|
|
137
|
+
reply(id: string, input: string | ReplyOptions): Promise<MessageView>
|
|
139
138
|
```
|
|
140
139
|
|
|
141
140
|
Replies in a thread. `id` may be any message in it: the board stores the root
|
|
@@ -153,7 +152,7 @@ await team.reply(msg.id, 'rolled back to d4e5f6')
|
|
|
153
152
|
### edit and delete
|
|
154
153
|
|
|
155
154
|
```ts
|
|
156
|
-
edit(id: string, text: string, opts?: { revision?: number }): Promise<{ ok: true
|
|
155
|
+
edit(id: string, text: string, opts?: { revision?: number }): Promise<{ ok: true }>
|
|
157
156
|
delete(id: string, opts?: { revision?: number }): Promise<{ ok: true }>
|
|
158
157
|
```
|
|
159
158
|
|
|
@@ -275,7 +274,7 @@ the sync it runs, so the CLI's handle shows it on the board it links. It needs
|
|
|
275
274
|
### schedule
|
|
276
275
|
|
|
277
276
|
```ts
|
|
278
|
-
schedule(target: string | { re: string }, input: ScheduleOptions): Promise<
|
|
277
|
+
schedule(target: string | { re: string }, input: ScheduleOptions): Promise<ScheduleView>
|
|
279
278
|
schedules(query?: { re?: string; channel?: string; by?: string; all?: boolean }): Promise<ScheduleView[]>
|
|
280
279
|
cancelSchedule(id: string): Promise<{ schedule: ScheduleView; canceled: boolean }>
|
|
281
280
|
```
|
|
@@ -358,6 +357,60 @@ await team.revokeToken(token.id)
|
|
|
358
357
|
|
|
359
358
|
See [Tokens](../01-board/09-access.md#tokens).
|
|
360
359
|
|
|
360
|
+
### block
|
|
361
|
+
|
|
362
|
+
```ts
|
|
363
|
+
block(id: string, data: Record<string, unknown>): string
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
A block as text: `data` in a fence that names schema `id`, such as
|
|
367
|
+
`sandbox@1`. It's a function, not a method: what it returns is a message's
|
|
368
|
+
text, alone or among prose. The board checks it against the schema when it's
|
|
369
|
+
written, and the message a write answers, like any read, has its `blocks`,
|
|
370
|
+
each `{ schema, version, data }`.
|
|
371
|
+
|
|
372
|
+
```ts
|
|
373
|
+
// anywhere in Node:
|
|
374
|
+
import { board, block } from '@vercel/board'
|
|
375
|
+
|
|
376
|
+
const team = board()
|
|
377
|
+
const message = await team.post('deploys', block('sandbox@1', { id: 'sbx-123', action: 'started' }))
|
|
378
|
+
const [{ data }] = message.blocks
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
A block that doesn't match throws `invalid_block`, and one that names a schema
|
|
382
|
+
the board doesn't have, `schema_not_found`. See
|
|
383
|
+
[Data](../01-board/04-messages.md#data).
|
|
384
|
+
|
|
385
|
+
### createSchema
|
|
386
|
+
|
|
387
|
+
```ts
|
|
388
|
+
createSchema(input: { name: string; version: number; description?: string; schema: Record<string, unknown> }): Promise<{ schema: SchemaView; created: boolean }>
|
|
389
|
+
schemas(): Promise<SchemaView[]>
|
|
390
|
+
schema(id: string): Promise<SchemaView>
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
`createSchema` registers a schema version, for good: `schema` is a JSON Schema
|
|
394
|
+
for an object, and `name` and `version` are its ID, `sandbox@1`. It needs
|
|
395
|
+
`manage` at `*`. A version never changes: the same definition again answers
|
|
396
|
+
it with `created: false`, and another definition throws `schema_immutable`, so
|
|
397
|
+
a change is the next version. `schemas` lists the built-in ones, then the
|
|
398
|
+
board's own by name and version, and `schema` reads one by its ID. Anyone the
|
|
399
|
+
board lets in reads them.
|
|
400
|
+
|
|
401
|
+
```ts
|
|
402
|
+
const { schema, created } = await team.createSchema({
|
|
403
|
+
name: 'sandbox',
|
|
404
|
+
version: 1,
|
|
405
|
+
description: 'What a sandbox did.',
|
|
406
|
+
schema: { type: 'object', required: ['id', 'action'], properties: { id: { type: 'string' }, action: { enum: ['started', 'stopped'] } } },
|
|
407
|
+
})
|
|
408
|
+
const sandbox = await team.schema('sandbox@1')
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
A `SchemaView` is `{ id, name, version, description, schema, builtIn, by, at }`.
|
|
412
|
+
See [Schemas](./03-http.md#schemas) for what a definition may use.
|
|
413
|
+
|
|
361
414
|
## Reading
|
|
362
415
|
|
|
363
416
|
### messages
|
|
@@ -385,9 +438,9 @@ const page = await team.messages({ channel: 'errors-www', label: { status: 'open
|
|
|
385
438
|
| `channel` | a channel, or a subtree with a trailing slash: `'www/'` |
|
|
386
439
|
| `re` | the thread rooted at that ID |
|
|
387
440
|
| `by` | an actor, by handle or actor ID |
|
|
388
|
-
| `mentions` | `'me'`, a handle,
|
|
441
|
+
| `mentions` | `'me'`, a handle, an actor ID, or an email, as the text mentions them |
|
|
389
442
|
| `label` | `{ status: 'open' }`, or `['status=open', 'pr']`; a value may be `a\|b`. Matches the message or its root |
|
|
390
|
-
| `from` | a sync key (`'slack'`), or `'board'` |
|
|
443
|
+
| `from` | a sync key (`'slack'`), or `'board'`. On Vercel's board, another project's key is `'www/slack'`, by its name or its ID |
|
|
391
444
|
| `text` | a case-insensitive substring |
|
|
392
445
|
|
|
393
446
|
### threads
|