@vercel/board 0.31.0 → 0.33.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.
Files changed (166) hide show
  1. package/README.md +25 -20
  2. package/dist/{access-CY5xVMIK.mjs → access-N3XmkKXg.mjs} +3 -3
  3. package/dist/access.d.mts +4 -5
  4. package/dist/access.mjs +5 -5
  5. package/dist/{actors-Bm-ojWWT.mjs → actors-ihyN47OV.mjs} +3 -3
  6. package/dist/{auth-DLYSt_-A.d.mts → auth-D6z3rMNj.d.mts} +11 -93
  7. package/dist/{auth-CyO2aw5n.mjs → auth-r-_PeZyw.mjs} +39 -151
  8. package/dist/{backend-Bob-5CM7.d.mts → backend-CWpyR1A7.d.mts} +81 -51
  9. package/dist/backend-local.d.mts +28 -0
  10. package/dist/backend-local.mjs +2 -0
  11. package/dist/{chat-provider-DkFp2hrh.mjs → chat-provider-9hCT654s.mjs} +2 -2
  12. package/dist/{chat-provider-BChYrrA7.d.mts → chat-provider-DJpFUaFv.d.mts} +2 -3
  13. package/dist/cli-commands.d.mts +1 -1
  14. package/dist/cli-commands.mjs +1 -1
  15. package/dist/cli-embedded.d.mts +2 -2
  16. package/dist/cli-embedded.mjs +2 -2
  17. package/dist/cli.mjs +6 -6
  18. package/dist/{commands-DK4W3HCJ.d.mts → commands-BOBQHVqM.d.mts} +14 -0
  19. package/dist/{commands-L1JSGz2Z.mjs → commands-CHoMl06v.mjs} +39 -12
  20. package/dist/{conformance-DK43HiHf.mjs → conformance-qKmGLTAT.mjs} +40 -5
  21. package/dist/conformance.d.mts +1 -1
  22. package/dist/conformance.mjs +1 -1
  23. package/dist/{engine-DurYIRt8.mjs → engine-JxgZiikU.mjs} +6 -8
  24. package/dist/{errors-CJXhhzvT.mjs → errors-Pk0XV1hK.mjs} +56 -2
  25. package/dist/{events-lujPA3gQ.mjs → events-IQg0k281.mjs} +2 -2
  26. package/dist/exports-BuKjVq2t.d.mts +4 -0
  27. package/dist/exports-gHDHlg0i.mjs +3207 -0
  28. package/dist/{external-D3p5T57R.mjs → external-CYe424fO.mjs} +1 -1
  29. package/dist/{folds-DLUzfibJ.d.mts → folds-DjFTiqIM.d.mts} +38 -44
  30. package/dist/index-CXvvYNYj.d.mts +11 -0
  31. package/dist/index.d.mts +9 -8
  32. package/dist/index.mjs +21 -8
  33. package/dist/index.node.d.mts +5 -6
  34. package/dist/index.node.mjs +3 -3
  35. package/dist/inspect/app.js +95 -95
  36. package/dist/{internal-CvsrprnU-zZMpDiRY.mjs → internal-CvsrprnU-CEPOUpAv.mjs} +63 -43
  37. package/dist/local-BbLjA5vI.mjs +8818 -0
  38. package/dist/{main-Dz-8komG.mjs → main-CQpCZJFw.mjs} +140 -36
  39. package/dist/{backend-a2/store-memory.mjs → memory-7RRnLa4X.mjs} +3 -3
  40. package/dist/middleware-BU7rVi9F.mjs +103 -0
  41. package/dist/{client-COfYrgfV.d.mts → provider-BlzUvcM9.d.mts} +665 -5
  42. package/dist/{schemas-DBmUO6pr.mjs → schemas-BG205xds.mjs} +2 -5
  43. package/dist/{serve-CTmow-YH.mjs → serve-D8_W4UN6.mjs} +33 -24
  44. package/dist/{node-BgeGcwX0.mjs → server-BiIUXWbU.mjs} +419 -6
  45. package/dist/{serving-DBFRo6U_.mjs → serving-D7rcUtSC.mjs} +1 -1
  46. package/dist/{sql-CT5xVuGr.mjs → sql-BQzKUqQt.mjs} +349 -114
  47. package/dist/sqlite-DCtZFEVm.mjs +30 -0
  48. package/dist/{sqlite-db-0WeSOEZN.mjs → sqlite-db-qLTs52Ny.mjs} +2 -3
  49. package/dist/{store-codec-pAG2oPgQ-SqDXlPBR.mjs → store-N8PXxDAS-BdL4Sq-f.mjs} +6 -2
  50. package/dist/{store-memory-B0PkVSuQ.mjs → store-memory-CKQVEzXN.mjs} +2 -4
  51. package/dist/store-memory-OdGsc-t_.mjs +2 -0
  52. package/dist/{store-polling-BZt2Rf3D-Div-bJ_D.mjs → store-polling-BZt2Rf3D-oh3aU_An.mjs} +1 -1
  53. package/dist/store-sqlite-CTxAVCcz.mjs +2 -0
  54. package/dist/{store-sqlite-D85t3tE7.mjs → store-sqlite-D6fIszST.mjs} +3 -4
  55. package/dist/sync-chat-sdk.d.mts +2 -2
  56. package/dist/sync-chat-sdk.mjs +2 -2
  57. package/dist/sync-github.d.mts +2 -2
  58. package/dist/sync-github.mjs +2 -2
  59. package/dist/sync-linear.d.mts +2 -3
  60. package/dist/sync-linear.mjs +2 -2
  61. package/dist/sync-slack.d.mts +3 -3
  62. package/dist/sync-slack.mjs +4 -4
  63. package/dist/sync.d.mts +2 -2
  64. package/dist/sync.mjs +2 -2
  65. package/dist/{watchers-hash-BjwlnGD9.mjs → targets-CknPGGVi.mjs} +40 -10
  66. package/dist/{tokens-Dnyd_y1n.mjs → tokens-DPKjl3jf.mjs} +15 -43
  67. package/docs/01-board/01-mounting.md +243 -288
  68. package/docs/01-board/03-identity.md +41 -50
  69. package/docs/01-board/04-messages.md +19 -16
  70. package/docs/01-board/05-reading.md +3 -3
  71. package/docs/01-board/06-watchers.md +58 -105
  72. package/docs/01-board/07-schedules.md +21 -41
  73. package/docs/01-board/08-middleware.md +11 -17
  74. package/docs/01-board/09-access.md +76 -313
  75. package/docs/01-board/10-local.md +81 -0
  76. package/docs/01-quickstart.md +49 -126
  77. package/docs/02-sync/01-overview.md +25 -80
  78. package/docs/02-sync/02-functions.md +10 -16
  79. package/docs/02-sync/03-slack.md +13 -26
  80. package/docs/02-sync/04-github.md +8 -20
  81. package/docs/02-sync/07-linear.md +6 -10
  82. package/docs/03-guides/02-inspector.md +3 -3
  83. package/docs/03-guides/03-ci.md +88 -128
  84. package/docs/03-guides/04-triage.md +7 -15
  85. package/docs/03-guides/05-agent-factory.md +30 -36
  86. package/docs/04-reference/01-cli.md +118 -32
  87. package/docs/04-reference/02-board.md +60 -74
  88. package/docs/04-reference/03-http.md +119 -57
  89. package/docs/04-reference/05-conformance.md +31 -45
  90. package/docs/index.md +41 -65
  91. package/package.json +12 -83
  92. package/dist/a2-DngWY2Eb.mjs +0 -4238
  93. package/dist/access-DPcrKIH_.d.mts +0 -37
  94. package/dist/backend-a2/blob-vercel.d.mts +0 -8
  95. package/dist/backend-a2/blob-vercel.mjs +0 -81
  96. package/dist/backend-a2/contract.d.mts +0 -828
  97. package/dist/backend-a2/contract.mjs +0 -5
  98. package/dist/backend-a2/scheduler-local.d.mts +0 -11
  99. package/dist/backend-a2/scheduler-local.mjs +0 -2
  100. package/dist/backend-a2/scheduler-qstash.d.mts +0 -79
  101. package/dist/backend-a2/scheduler-qstash.mjs +0 -522
  102. package/dist/backend-a2/scheduler-vercel.d.mts +0 -38
  103. package/dist/backend-a2/scheduler-vercel.mjs +0 -204
  104. package/dist/backend-a2/store-memory.d.mts +0 -11
  105. package/dist/backend-a2/store-postgres.d.mts +0 -38
  106. package/dist/backend-a2/store-postgres.mjs +0 -2977
  107. package/dist/backend-a2/store-redis-http.d.mts +0 -17
  108. package/dist/backend-a2/store-redis-http.mjs +0 -520
  109. package/dist/backend-a2/store-redis.d.mts +0 -31
  110. package/dist/backend-a2/store-redis.mjs +0 -88
  111. package/dist/backend-a2/store-sqlite.d.mts +0 -12
  112. package/dist/backend-a2/store-sqlite.mjs +0 -31
  113. package/dist/backend-a2.d.mts +0 -2633
  114. package/dist/backend-a2.mjs +0 -3
  115. package/dist/backend-http-BRrRbjRx.d.mts +0 -672
  116. package/dist/backend-http-CvUKOn-m.mjs +0 -585
  117. package/dist/backend-http-D8mUzuKQ.mjs +0 -18
  118. package/dist/backend-http.d.mts +0 -10
  119. package/dist/backend-http.mjs +0 -2
  120. package/dist/backend-http.node.d.mts +0 -10
  121. package/dist/backend-http.node.mjs +0 -2
  122. package/dist/backend-vercel-Ba8JDtqW.mjs +0 -86
  123. package/dist/backend-vercel-BaSEUdwg.d.mts +0 -674
  124. package/dist/backend-vercel-CmY9yZ9m.mjs +0 -1656
  125. package/dist/backend-vercel.d.mts +0 -9
  126. package/dist/backend-vercel.mjs +0 -11
  127. package/dist/backend-vercel.node.d.mts +0 -17
  128. package/dist/backend-vercel.node.mjs +0 -2
  129. package/dist/blob-Bx8QPWEd.d.mts +0 -40
  130. package/dist/blob-WbB2DJKn.mjs +0 -201
  131. package/dist/errors-2vGs49Db.d.mts +0 -16
  132. package/dist/exports-CWIdN0Ub.mjs +0 -1389
  133. package/dist/exports-FBOQWT7O.d.mts +0 -5
  134. package/dist/files-SniSmeEr.mjs +0 -47
  135. package/dist/folds-Cu9Q9zyQ.mjs +0 -207
  136. package/dist/index-Ho-ayyQL.d.mts +0 -11
  137. package/dist/index.default-BUcwDaAe.mjs +0 -12
  138. package/dist/local-C76Fy5ad.mjs +0 -44
  139. package/dist/middleware-BavYSDUa.mjs +0 -62
  140. package/dist/platform-B4TnJtWu-Do3agKr5.mjs +0 -32
  141. package/dist/project-CQ4VUibA.mjs +0 -124
  142. package/dist/provider-gynDUoyW.d.mts +0 -665
  143. package/dist/redis-tables-DHf85ixI.mjs +0 -3895
  144. package/dist/reducer-Bswr11ar-P324o9vn.mjs +0 -74
  145. package/dist/reducer-CYPHsSmd-BXjGiptm.d.mts +0 -170
  146. package/dist/reducers-DcENwtwZ.mjs +0 -538
  147. package/dist/retryable-lazy-DZWmHpii-DpTc5PIP.mjs +0 -19
  148. package/dist/scheduler-task-X1SToDjP-D2Il2rln.mjs +0 -69
  149. package/dist/server-B9gu0qi1-DI1WvcVK.d.mts +0 -391
  150. package/dist/server-DG8D6VV0.mjs +0 -17
  151. package/dist/server-DX7mM6nm-D7N_7bug.mjs +0 -3611
  152. package/dist/session-clear-XJYpmUpg-2q8l_FJR.mjs +0 -63
  153. package/dist/store-DEzcHZOA-B-5vhxef.d.mts +0 -540
  154. package/dist/store-N8PXxDAS-DWWgv-Vz.mjs +0 -5
  155. package/dist/store-memory-4IBl0Ztu.mjs +0 -2
  156. package/dist/store-presence-polling-JuAy2Ck2-Dh-g_KYM.mjs +0 -109
  157. package/dist/store-sqlite-iBTYYKBj.mjs +0 -2
  158. package/dist/stream-buffer-DrTyiIuo-Be10yOBR.mjs +0 -53
  159. package/dist/targets-Cgjs29T0.mjs +0 -33
  160. package/dist/types-CmrFjpml.d.mts +0 -102
  161. package/dist/wait-until-Dw4XrIDQ.mjs +0 -42
  162. package/docs/01-board/02-database.md +0 -258
  163. package/docs/04-reference/04-log.md +0 -247
  164. package/sql/postgres/board.sql +0 -145
  165. package/sql/postgres/notifications.sql +0 -24
  166. package/sql/postgres/schema.sql +0 -451
@@ -1,4 +1,4 @@
1
- import { h as MessageId, m as MESSAGE_TEXT_MAX } from "./schemas-DBmUO6pr.mjs";
1
+ import { d as MESSAGE_TEXT_MAX, f as MessageId } from "./schemas-BG205xds.mjs";
2
2
  import { z } from "zod";
3
3
  //#region src/contract/external.ts
4
4
  /**
@@ -1,20 +1,42 @@
1
1
  import { z } from "zod";
2
+ //#region src/server/access.d.ts
3
+ /**
4
+ * What a principal may do in a channel. `read` covers messages, threads,
5
+ * `/events`, and schedules; `post` starts threads and edits your own messages;
6
+ * `manage` is the board's own bookkeeping (inbox, sources).
7
+ */
8
+ declare const PERMISSIONS: readonly ['read', 'post', 'react', 'label', 'sync', 'manage'];
9
+ type Permission = (typeof PERMISSIONS)[number];
10
+ /** `*`, a channel (`feedback`), or a channel and its subtree (`feedback/`). */
11
+ type ChannelPattern = string;
12
+ type Grant = 'all' | readonly Permission[];
13
+ /** `'all'`, a list for every channel (`['post']` is `{ '*': ['post'] }`), or a map from pattern to grant. */
14
+ type Can = Grant | Readonly<Record<ChannelPattern, Grant>>;
15
+ /** Each pattern's whole answer, implications included. */
16
+ type AccessSummary = Readonly<Record<ChannelPattern, readonly Permission[]>>;
17
+ type Access = {
18
+ can(permission: Permission, channel: string): boolean;
19
+ /** The hot path for feeds: memoized per channel. */
20
+ readable(channel: string): boolean;
21
+ /** `read` in every channel, including ones that don't exist yet. */
22
+ readsAll: boolean;
23
+ /** `permission` in every channel, including ones that don't exist yet: `everywhere('manage')` is full access. */
24
+ everywhere(permission: Permission): boolean;
25
+ /** `permission` in some channel. */
26
+ anywhere(permission: Permission): boolean;
27
+ /** Only what both this and `scope` allow, channel by channel. It never widens. */
28
+ narrow(scope: Can | Access): Access;
29
+ /** Each pattern and its permissions, `*` first and the rest sorted; an empty `*` is left out. */
30
+ summary(): AccessSummary;
31
+ };
32
+ /** Access from config: `'all'`, a list for every channel, or a map from pattern to grant. Throws on a bad pattern or permission. */
33
+ declare function compileAccess(can: Can): Access;
34
+ declare const FULL_ACCESS: Access;
35
+ /** What any of `accesses` allows, channel by channel: grants that match one principal add up. */
36
+ declare function union(accesses: readonly Access[]): Access;
37
+ //#endregion
2
38
  //#region src/contract/schemas.d.ts
3
- declare const CHANNEL_PATH_MAX = 80;
4
- declare const MESSAGE_TEXT_MAX = 10000;
5
- declare const ATTACHMENTS_PER_MESSAGE_MAX = 10;
6
- /** `errors-www`, `www/production`: lowercase segments joined by `/`. */
7
- declare const ChannelPath: z.ZodString;
8
- declare const MessageText: z.ZodString;
9
- /** A message is named by the log index of its `message.posted` event. */
10
- declare const MessageId: z.ZodNumber;
11
- declare const LabelKey: z.ZodString;
12
- declare const LabelValue: z.ZodString;
13
39
  declare const Labels: z.ZodRecord<z.ZodString, z.ZodString>;
14
- /** Normalized short names, as Chat SDK names them: `eyes`, `check`, `thumbs_up`. */
15
- declare const Emoji: z.ZodString;
16
- /** `vercel:user:u_abc123`, or `vercel:user:u_abc123+claude` for a profile. */
17
- declare const ActorId: z.ZodString;
18
40
  /** What an actor is: a `person`, an `agent` acting for a principal (`--as claude`), a deployment, a workflow, or a platform user (`external`). */
19
41
  declare const ActorKind: z.ZodEnum<{
20
42
  agent: "agent";
@@ -23,16 +45,12 @@ declare const ActorKind: z.ZodEnum<{
23
45
  person: "person";
24
46
  workflow: "workflow";
25
47
  }>;
26
- declare const Handle: z.ZodString;
27
48
  declare const Author: z.ZodObject<{
28
49
  actor: z.ZodString;
29
50
  principal: z.ZodString;
30
51
  profile: z.ZodNullable<z.ZodString>;
31
52
  session: z.ZodNullable<z.ZodString>;
32
53
  }, z.core.$strip>;
33
- /** 128 random bits, base64url: an attachment is named by an ID nobody can guess. */
34
- /** 128 random bits, base64url, as A2 makes them; or `att_` and a UUID, as Vercel's board does. */
35
- declare const AttachmentId: z.ZodString;
36
54
  /** A file on a message. The board records `type` and `size` from what it stored, never from the request. */
37
55
  declare const Attachment: z.ZodObject<{
38
56
  id: z.ZodString;
@@ -40,10 +58,7 @@ declare const Attachment: z.ZodObject<{
40
58
  type: z.ZodString;
41
59
  size: z.ZodNumber;
42
60
  }, z.core.$strip>;
43
- type ChannelPath = z.infer<typeof ChannelPath>;
44
- type MessageId = z.infer<typeof MessageId>;
45
61
  type Labels = z.infer<typeof Labels>;
46
- type ActorId = z.infer<typeof ActorId>;
47
62
  type ActorKind = z.infer<typeof ActorKind>;
48
63
  type Author = z.infer<typeof Author>;
49
64
  type Attachment = z.infer<typeof Attachment>;
@@ -264,9 +279,8 @@ declare const boardEvents: {
264
279
  host: z.ZodOptional<z.ZodLiteral<true>>;
265
280
  }, z.core.$strip>;
266
281
  };
267
- declare const BOARD_SESSION = "board";
268
282
  type BoardEvents = typeof boardEvents;
269
- /** One event of the board log, of type `K`: the shape A2 stores it in (its `ContractEvent`). */
283
+ /** One event of the board log, of type `K`, in the shape its log stores it. */
270
284
  type BoardEvent<K extends keyof BoardEvents & string = keyof BoardEvents & string> = { [T in keyof BoardEvents & string]: {
271
285
  id: string;
272
286
  type: T;
@@ -510,18 +524,12 @@ type Message = {
510
524
  /** The index of its post, or of its last edit or delete. Folds from before it existed leave it out. */
511
525
  revision?: number;
512
526
  };
513
- type MessagesState = {
514
- byId: Record<string, Message>;
515
- /** Thread root → reply IDs, in log order. */
516
- replies: Record<string, number[]>;
517
- };
518
527
  type Channel = {
519
528
  path: string;
520
529
  lastIndex: number;
521
530
  messages: number;
522
531
  threads: number;
523
532
  };
524
- type ChannelsState = Record<string, Channel>;
525
533
  type Actor = {
526
534
  id: string;
527
535
  kind: ActorKind;
@@ -531,11 +539,6 @@ type Actor = {
531
539
  /** A host's principal, or one of its profiles: once it's seen as one, it stays one. Views leave it out. */
532
540
  host?: true;
533
541
  };
534
- type ActorsState = {
535
- byId: Record<string, Actor>;
536
- /** Lowercased handle → actor IDs. Handles aren't reserved, so several can share one. */
537
- byHandle: Record<string, string[]>;
538
- };
539
542
  /** A copy of a board message on a platform. */
540
543
  /** `files`: the platform's IDs for the message's files, or null when it refused them; unset until they're sent. */
541
544
  /** `by`: the principal of the sync elsewhere that recorded it, whose copy it is to change; none for the board's own sync's. */
@@ -545,14 +548,5 @@ type ExternalCopy = {
545
548
  files?: string[] | null;
546
549
  by?: string;
547
550
  };
548
- type SyncedThread = {
549
- root: number;
550
- channel: string;
551
- kinds?: Record<string, 'channel' | 'thread'>;
552
- /** External channels (start a thread there) and threads (joined), in sync order. */
553
- targets: string[];
554
- /** Target → the external thread it resolved to. A thread target resolves to itself. */
555
- external: Record<string, string>;
556
- };
557
551
  //#endregion
558
- export { Labels as A, Author as C, Handle as D, Emoji as E, MessageId as M, MessageText as N, LabelKey as O, AttachmentId as S, ChannelPath as T, BoardEvents as _, ExternalCopy as a, ActorKind as b, SyncedThread as c, ExternalFile as d, ExternalLink as f, BoardEvent as g, BOARD_SESSION as h, ChannelsState as i, MESSAGE_TEXT_MAX as j, LabelValue as k, ExternalAuthor as l, Origin as m, ActorsState as n, Message as o, Link as p, Channel as r, MessagesState as s, Actor as t, ExternalEvent as u, ATTACHMENTS_PER_MESSAGE_MAX as v, CHANNEL_PATH_MAX as w, Attachment as x, ActorId as y };
552
+ export { union as S, ChannelPattern as _, ExternalAuthor as a, Permission as b, ExternalLink as c, Attachment as d, Author as f, Can as g, AccessSummary as h, Message as i, Link as l, Access as m, Channel as n, ExternalEvent as o, Labels as p, ExternalCopy as r, ExternalFile as s, Actor as t, BoardEvent as u, FULL_ACCESS as v, compileAccess as x, Grant as y };
@@ -0,0 +1,11 @@
1
+ import { d as Board, f as BoardOptions } from "./backend-CWpyR1A7.mjs";
2
+ import "./exports-BuKjVq2t.mjs";
3
+ //#region src/server/index.d.ts
4
+ /**
5
+ * The handle on a board. Without a `backend`, it's Vercel's board for your team, the one `name`
6
+ * names, reached with the credentials the Vercel CLI or the deployment has (or `fetch`'s). With
7
+ * `BOARD_URL` set, it's the board at that URL instead: `vb serve`'s, say.
8
+ */
9
+ declare function board(options?: BoardOptions): Board;
10
+ //#endregion
11
+ export { board as t };
package/dist/index.d.mts CHANGED
@@ -1,13 +1,14 @@
1
- import { a as CallerRequest, o as Claims } from "./auth-DLYSt_-A.mjs";
2
- import { x as Attachment } from "./folds-DLUzfibJ.mjs";
3
- import { $ as RegisterBody, A as InboxAckBody, At as ThreadsPage, B as MatchView, Bt as routes, C as EventsPage, Ct as SyncImportInput, D as GrantBody, Dt as SyncedView, E as FiltersInput, Et as SyncThreadView, F as InboxQuery, Ft as TokenView, G as MessagesQuery, H as Me, I as LABEL_CONDITIONS_MAX, It as TypingBody, J as PostBody, K as MessagesQueryInput, L as LabelBody, Lt as TypingResult, M as InboxItem, Mt as ThreadsQueryInput, N as InboxNextQuery, Nt as TokenBody, O as GrantInput, Ot as ThreadSummaryView, P as InboxPushBody, Pt as TokenInput, Q as Ref, R as LinkView, Rt as UploadStartBody, S as EditBody, St as SyncImportBody, T as EventsQueryInput, Tt as SyncReceiptInput, U as MessageView, V as MatchesQuery, W as MessagesPage, X as REGISTERED_WATCHERS_MAX, Y as PostInput, Z as ReactBody, _ as BoardEventView, _t as SyncCopiesQuery, a as PostOptions, at as ScheduleBodyOutput, b as DeleteBody, bt as SyncFindQuery, c as ScheduleOptions, ct as SchedulesQuery, d as WaitOptions, dt as SourceJoin, et as RegisterInput, f as Written, ft as SourceJoinBody, g as ApiError, gt as SyncBody, h as ActorView, ht as SourceReadQuery, i as Filters, it as ScheduleBody, j as InboxEntry, jt as ThreadsQuery, k as GrantView, kt as ThreadView, l as ScheduleTiming, lt as SchedulesQueryInput, m as AckBody, mt as SourceRead, n as BoardError, nt as ResolvedSyncTarget, o as ProfileOption, ot as ScheduleInput, p as duration, pt as SourceMessage, q as ParsedFilters, rt as RouteName, s as ReplyOptions, st as ScheduleView, tt as RegistrationView, u as UploadInput, ut as SchedulesQueryOutput, v as ChannelView, vt as SyncCopiesView, w as EventsQuery, wt as SyncReceiptBody, x as Discovery, xt as SyncFindView, y as CreateChannelBody, yt as SyncFindInput, z as LinkedQuery, zt as UploadTicket } from "./client-COfYrgfV.mjs";
4
- import { C as Protocol, S as Method, _ as Middleware, a as Identity, b as WritePatch, c as SelfCaller, d as VerifiedCaller, f as Board, g as DroppedError, h as WatcherContext, i as Caller, m as Watcher, n as BackendRoute, o as InboxDelivery, p as BoardOptions, r as BoardBinding, s as ProtocolMethods, t as Backend, u as Subscription, v as MiddlewareContext, x as WriteSource, y as Write } from "./backend-Bob-5CM7.mjs";
5
- import { t as HttpError } from "./errors-2vGs49Db.mjs";
6
- import "./exports-FBOQWT7O.mjs";
1
+ import { d as Attachment } from "./folds-DjFTiqIM.mjs";
2
+ import { i as Claims, r as CallerRequest } from "./auth-D6z3rMNj.mjs";
3
+ import { $ as EditBody, $t as SyncImportBody, At as RegisterBody, B as ScheduleTiming, Bt as SchedulesQueryInput, Ct as MessagesQueryInput, Dt as REGISTERED_WATCHERS_MAX, Et as PostInput, F as Filters, Ft as ScheduleBody, G as AckBody, Gt as SourceRead, H as WaitOptions, Ht as SourceJoin, I as PostOptions, It as ScheduleBodyOutput, J as BoardEventView, Jt as SyncCopiesQuery, K as ActorView, Kt as SourceReadQuery, L as ProfileOption, Lt as ScheduleInput, Mt as RegistrationView, N as BoardError, Nt as ResolvedSyncTarget, Ot as ReactBody, Pt as RouteName, Q as Discovery, Qt as SyncFindView, R as ReplyOptions, Rt as ScheduleView, St as MessagesQuery, Tt as PostBody, U as Written, Ut as SourceJoinBody, V as UploadInput, Vt as SchedulesQueryOutput, W as duration, Wt as SourceMessage, X as CreateChannelBody, Xt as SyncFindInput, Y as ChannelView, Yt as SyncCopiesView, Z as DeleteBody, Zt as SyncFindQuery, _n as routes, _t as MatchView, an as ThreadSummaryView, at as GrantInput, bt as MessageView, cn as ThreadsQuery, ct as InboxEntry, dn as TokenInput, dt as InboxPushBody, en as SyncImportInput, et as EventsPage, fn as TokenView, ft as InboxQuery, gn as UploadTicket, gt as LinkedQuery, hn as UploadStartBody, ht as LinkView, in as SyncedView, it as GrantBody, jt as RegisterInput, kt as Ref, ln as ThreadsQueryInput, lt as InboxItem, mn as TypingResult, mt as LabelBody, nn as SyncReceiptInput, nt as EventsQueryInput, on as ThreadView, ot as GrantView, pn as TypingBody, pt as LABEL_CONDITIONS_MAX, q as ApiError, qt as SyncBody, rn as SyncThreadView, rt as FiltersInput, sn as ThreadsPage, st as InboxAckBody, tn as SyncReceiptBody, tt as EventsQuery, un as TokenBody, ut as InboxNextQuery, vt as MatchesQuery, wt as ParsedFilters, xt as MessagesPage, yt as Me, z as ScheduleOptions, zt as SchedulesQuery } from "./provider-BlzUvcM9.mjs";
4
+ 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-CWpyR1A7.mjs";
5
+ import "./exports-BuKjVq2t.mjs";
7
6
  //#region src/server/index.default.d.ts
8
7
  /**
9
- * The handle on a board. Outside Node there's no environment to find one in, so pass its
10
- * backend: `board({ backend: http(url) })`, whose `fetch` sends the page's own session.
8
+ * The handle on a board. Without a `backend`, it's Vercel's board for the team, the one `name`
9
+ * names: outside Node there's no environment to find credentials in, so pass a `fetch` that sends
10
+ * them. Or pass the backend: `board({ backend: http(url) })`, whose `fetch` sends the page's own
11
+ * session.
11
12
  */
12
13
  export declare function board(options?: BoardOptions): Board;
13
14
  //#endregion
package/dist/index.mjs CHANGED
@@ -1,16 +1,29 @@
1
- import { f as duration, t as HttpError, u as BoardError } from "./errors-CJXhhzvT.mjs";
2
- import { t as http } from "./index.default-BUcwDaAe.mjs";
3
- import { t as createBoard } from "./exports-CWIdN0Ub.mjs";
4
- import { t as DroppedError } from "./middleware-BavYSDUa.mjs";
1
+ import { f as duration, t as HttpError, u as BoardError } from "./errors-Pk0XV1hK.mjs";
2
+ import { t as DroppedError } from "./middleware-BU7rVi9F.mjs";
3
+ import { r as createVercel, t as createBoard } from "./exports-gHDHlg0i.mjs";
4
+ //#region src/backend-vercel/index.default.ts
5
+ /**
6
+ * Your team's board, in Vercel's API. Outside Node there's no environment to find credentials or
7
+ * the team in: pass `team`, and a `fetch` that sends a token Vercel's API takes.
8
+ */
9
+ function vercel(options = {}) {
10
+ return createVercel(options, null);
11
+ }
12
+ //#endregion
5
13
  //#region src/server/index.default.ts
6
14
  /**
7
- * The handle on a board. Outside Node there's no environment to find one in, so pass its
8
- * backend: `board({ backend: http(url) })`, whose `fetch` sends the page's own session.
15
+ * The handle on a board. Without a `backend`, it's Vercel's board for the team, the one `name`
16
+ * names: outside Node there's no environment to find credentials in, so pass a `fetch` that sends
17
+ * them. Or pass the backend: `board({ backend: http(url) })`, whose `fetch` sends the page's own
18
+ * session.
9
19
  */
10
20
  function board(options = {}) {
11
21
  return createBoard(options, {
12
- http: () => http(),
13
- sync: () => import("./engine-DurYIRt8.mjs"),
22
+ backend: (fetch) => {
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
+ return vercel({ fetch });
25
+ },
26
+ sync: () => import("./engine-JxgZiikU.mjs"),
14
27
  serving: null
15
28
  });
16
29
  }
@@ -1,7 +1,6 @@
1
- import { a as CallerRequest, o as Claims } from "./auth-DLYSt_-A.mjs";
2
- import { x as Attachment } from "./folds-DLUzfibJ.mjs";
3
- import { $ as RegisterBody, A as InboxAckBody, At as ThreadsPage, B as MatchView, Bt as routes, C as EventsPage, Ct as SyncImportInput, D as GrantBody, Dt as SyncedView, E as FiltersInput, Et as SyncThreadView, F as InboxQuery, Ft as TokenView, G as MessagesQuery, H as Me, I as LABEL_CONDITIONS_MAX, It as TypingBody, J as PostBody, K as MessagesQueryInput, L as LabelBody, Lt as TypingResult, M as InboxItem, Mt as ThreadsQueryInput, N as InboxNextQuery, Nt as TokenBody, O as GrantInput, Ot as ThreadSummaryView, P as InboxPushBody, Pt as TokenInput, Q as Ref, R as LinkView, Rt as UploadStartBody, S as EditBody, St as SyncImportBody, T as EventsQueryInput, Tt as SyncReceiptInput, U as MessageView, V as MatchesQuery, W as MessagesPage, X as REGISTERED_WATCHERS_MAX, Y as PostInput, Z as ReactBody, _ as BoardEventView, _t as SyncCopiesQuery, a as PostOptions, at as ScheduleBodyOutput, b as DeleteBody, bt as SyncFindQuery, c as ScheduleOptions, ct as SchedulesQuery, d as WaitOptions, dt as SourceJoin, et as RegisterInput, f as Written, ft as SourceJoinBody, g as ApiError, gt as SyncBody, h as ActorView, ht as SourceReadQuery, i as Filters, it as ScheduleBody, j as InboxEntry, jt as ThreadsQuery, k as GrantView, kt as ThreadView, l as ScheduleTiming, lt as SchedulesQueryInput, m as AckBody, mt as SourceRead, n as BoardError, nt as ResolvedSyncTarget, o as ProfileOption, ot as ScheduleInput, p as duration, pt as SourceMessage, q as ParsedFilters, rt as RouteName, s as ReplyOptions, st as ScheduleView, tt as RegistrationView, u as UploadInput, ut as SchedulesQueryOutput, v as ChannelView, vt as SyncCopiesView, w as EventsQuery, wt as SyncReceiptBody, x as Discovery, xt as SyncFindView, y as CreateChannelBody, yt as SyncFindInput, z as LinkedQuery, zt as UploadTicket } from "./client-COfYrgfV.mjs";
4
- import { C as Protocol, S as Method, _ as Middleware, a as Identity, b as WritePatch, c as SelfCaller, d as VerifiedCaller, f as Board, g as DroppedError, h as WatcherContext, i as Caller, m as Watcher, n as BackendRoute, o as InboxDelivery, p as BoardOptions, r as BoardBinding, s as ProtocolMethods, t as Backend, u as Subscription, v as MiddlewareContext, x as WriteSource, y as Write } from "./backend-Bob-5CM7.mjs";
5
- import { t as HttpError } from "./errors-2vGs49Db.mjs";
6
- import { t as board } from "./index-Ho-ayyQL.mjs";
1
+ import { d as Attachment } from "./folds-DjFTiqIM.mjs";
2
+ import { i as Claims, r as CallerRequest } from "./auth-D6z3rMNj.mjs";
3
+ import { $ as EditBody, $t as SyncImportBody, At as RegisterBody, B as ScheduleTiming, Bt as SchedulesQueryInput, Ct as MessagesQueryInput, Dt as REGISTERED_WATCHERS_MAX, Et as PostInput, F as Filters, Ft as ScheduleBody, G as AckBody, Gt as SourceRead, H as WaitOptions, Ht as SourceJoin, I as PostOptions, It as ScheduleBodyOutput, J as BoardEventView, Jt as SyncCopiesQuery, K as ActorView, Kt as SourceReadQuery, L as ProfileOption, Lt as ScheduleInput, Mt as RegistrationView, N as BoardError, Nt as ResolvedSyncTarget, Ot as ReactBody, Pt as RouteName, Q as Discovery, Qt as SyncFindView, R as ReplyOptions, Rt as ScheduleView, St as MessagesQuery, Tt as PostBody, U as Written, Ut as SourceJoinBody, V as UploadInput, Vt as SchedulesQueryOutput, W as duration, Wt as SourceMessage, X as CreateChannelBody, Xt as SyncFindInput, Y as ChannelView, Yt as SyncCopiesView, Z as DeleteBody, Zt as SyncFindQuery, _n as routes, _t as MatchView, an as ThreadSummaryView, at as GrantInput, bt as MessageView, cn as ThreadsQuery, ct as InboxEntry, dn as TokenInput, dt as InboxPushBody, en as SyncImportInput, et as EventsPage, fn as TokenView, ft as InboxQuery, gn as UploadTicket, gt as LinkedQuery, hn as UploadStartBody, ht as LinkView, in as SyncedView, it as GrantBody, jt as RegisterInput, kt as Ref, ln as ThreadsQueryInput, lt as InboxItem, mn as TypingResult, mt as LabelBody, nn as SyncReceiptInput, nt as EventsQueryInput, on as ThreadView, ot as GrantView, pn as TypingBody, pt as LABEL_CONDITIONS_MAX, q as ApiError, qt as SyncBody, rn as SyncThreadView, rt as FiltersInput, sn as ThreadsPage, st as InboxAckBody, tn as SyncReceiptBody, tt as EventsQuery, un as TokenBody, ut as InboxNextQuery, vt as MatchesQuery, wt as ParsedFilters, xt as MessagesPage, yt as Me, z as ScheduleOptions, zt as SchedulesQuery } from "./provider-BlzUvcM9.mjs";
4
+ 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-CWpyR1A7.mjs";
5
+ import { t as board } from "./index-CXvvYNYj.mjs";
7
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 Filters, type FiltersInput, type GrantBody, 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 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 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,4 +1,4 @@
1
- import { f as duration, t as HttpError, u as BoardError } from "./errors-CJXhhzvT.mjs";
2
- import { t as DroppedError } from "./middleware-BavYSDUa.mjs";
3
- import { t as board } from "./server-DG8D6VV0.mjs";
1
+ import { f as duration, t as HttpError, u as BoardError } from "./errors-Pk0XV1hK.mjs";
2
+ import { t as DroppedError } from "./middleware-BU7rVi9F.mjs";
3
+ import { t as board } from "./server-BiIUXWbU.mjs";
4
4
  export { BoardError, DroppedError, HttpError, board, duration };