@vercel/board 0.28.0 → 0.30.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 (139) hide show
  1. package/dist/{a2-B0_VlbtC.mjs → a2-D_28Pdip.mjs} +197 -259
  2. package/dist/access-CQ39gqEV.mjs +226 -0
  3. package/dist/access.d.mts +1 -1
  4. package/dist/access.mjs +3 -3
  5. package/dist/{actors-BLXVp4oZ.mjs → actors-xPiamLWk.mjs} +3 -3
  6. package/dist/{auth-lTkOgvcE.mjs → auth-BPinwfN0.mjs} +3 -226
  7. package/dist/backend-a2/blob-vercel.d.mts +1 -1
  8. package/dist/backend-a2/contract.d.mts +2 -2
  9. package/dist/backend-a2/contract.mjs +3 -3
  10. package/dist/backend-a2/scheduler-local.d.mts +1 -1
  11. package/dist/backend-a2/scheduler-local.mjs +1 -1
  12. package/dist/backend-a2/scheduler-qstash.d.mts +3 -3
  13. package/dist/backend-a2/scheduler-qstash.mjs +8 -8
  14. package/dist/backend-a2/scheduler-vercel.d.mts +3 -3
  15. package/dist/backend-a2/scheduler-vercel.mjs +6 -6
  16. package/dist/backend-a2/store-memory.d.mts +2 -2
  17. package/dist/backend-a2/store-memory.mjs +3 -3
  18. package/dist/backend-a2/store-postgres.d.mts +1 -1
  19. package/dist/backend-a2/store-postgres.mjs +34 -15
  20. package/dist/backend-a2/store-redis-http.d.mts +1 -1
  21. package/dist/backend-a2/store-redis-http.mjs +6 -6
  22. package/dist/backend-a2/store-redis.d.mts +2 -2
  23. package/dist/backend-a2/store-redis.mjs +5 -5
  24. package/dist/backend-a2/store-sqlite.d.mts +1 -1
  25. package/dist/backend-a2/store-sqlite.mjs +3 -3
  26. package/dist/backend-a2.d.mts +20 -7
  27. package/dist/backend-a2.mjs +2 -1
  28. package/dist/{backend-http-BvNFrvcY.mjs → backend-http-16SbvnAK.mjs} +2 -2
  29. package/dist/{backend-http-E7YU0qhn.d.mts → backend-http-3PoBYQoo.d.mts} +15 -3
  30. package/dist/{backend-http-CfLVYqmj.mjs → backend-http-BPaNYLWj.mjs} +4 -5
  31. package/dist/backend-http.d.mts +1 -1
  32. package/dist/backend-http.mjs +1 -1
  33. package/dist/backend-http.node.d.mts +1 -1
  34. package/dist/backend-http.node.mjs +1 -1
  35. package/dist/{backend-ZKYTe3xa.d.mts → backend-n3hajfrD.d.mts} +12 -6
  36. package/dist/{backend-vercel-D87pIp2k.mjs → backend-vercel-C4Kee2-K.mjs} +260 -30
  37. package/dist/{backend-vercel-DTrDiSk5.mjs → backend-vercel-Kd8nvW5A.mjs} +3 -3
  38. package/dist/{backend-vercel-CIRObA0t.d.mts → backend-vercel-qznuDxnN.d.mts} +20 -5
  39. package/dist/backend-vercel.d.mts +1 -1
  40. package/dist/backend-vercel.mjs +1 -1
  41. package/dist/backend-vercel.node.d.mts +1 -1
  42. package/dist/backend-vercel.node.mjs +1 -1
  43. package/dist/{blob-B-9AvYis.d.mts → blob-CqILvdmr.d.mts} +2 -2
  44. package/dist/blob-DQK5prXT.mjs +182 -0
  45. package/dist/{chat-provider-DnHibqnM.mjs → chat-provider-COtsU5jB.mjs} +2 -2
  46. package/dist/{chat-provider-DsNEBQiA.d.mts → chat-provider-D6jVT4wS.d.mts} +5 -3
  47. package/dist/cli-commands.d.mts +1 -1
  48. package/dist/cli-commands.mjs +1 -1
  49. package/dist/cli-embedded.d.mts +2 -2
  50. package/dist/cli-embedded.mjs +1 -1
  51. package/dist/cli.mjs +5 -5
  52. package/dist/{client-xLxeDz0f.d.mts → client-CjAatpV4.d.mts} +67 -10
  53. package/dist/{commands-BFookFtn.mjs → commands-B5DHjZKK.mjs} +54 -10
  54. package/dist/{commands-D6gvrOh3.d.mts → commands-BtH69yqt.d.mts} +17 -0
  55. package/dist/{conformance-DlnfuzEB.mjs → conformance-C7fwIvmN.mjs} +258 -18
  56. package/dist/conformance.d.mts +1 -1
  57. package/dist/conformance.mjs +1 -1
  58. package/dist/{engine-Bfe6pcXb.mjs → engine-DkdkXQEy.mjs} +21 -13
  59. package/dist/{errors-CB4tnZGz.d.mts → errors-87TVtXeb.d.mts} +1 -1
  60. package/dist/{client-D0Px7KzF.mjs → errors-C_5rB8Iz.mjs} +104 -4
  61. package/dist/{events-CewD4kw7.mjs → events-qf5XG5VQ.mjs} +2 -2
  62. package/dist/{exports-CCzw2Vdw.mjs → exports-CG0P8Qi4.mjs} +59 -33
  63. package/dist/exports-CrGA5_yN.d.mts +5 -0
  64. package/dist/{external-BV_cUncs.mjs → external-D3p5T57R.mjs} +4 -2
  65. package/dist/{folds-jS9wlh9_.d.mts → folds-8wRRXjAt.d.mts} +4 -0
  66. package/dist/{folds-Dyjput8M.mjs → folds-DGYkMW19.mjs} +3 -2
  67. package/dist/{index-C05it0mC.d.mts → index-BygAXP7t.d.mts} +2 -2
  68. package/dist/index.d.mts +6 -6
  69. package/dist/{index.default-DmKxH_E6.mjs → index.default-DhkgpfR2.mjs} +1 -1
  70. package/dist/index.mjs +5 -6
  71. package/dist/index.node.d.mts +6 -6
  72. package/dist/index.node.mjs +3 -4
  73. package/dist/inspect/app.js +29 -29
  74. package/dist/inspect/engine.js +5 -5
  75. package/dist/{internal-CvsrprnU-CRY89I-b.mjs → internal-CvsrprnU-zZMpDiRY.mjs} +1 -1
  76. package/dist/{local-DhkrAqPP.mjs → local-C76Fy5ad.mjs} +1 -1
  77. package/dist/{main-eci7w-aP.mjs → main-D2s-QBOK.mjs} +76 -26
  78. package/dist/{middleware-ChKM1zuu.mjs → middleware-DlJQYiwV.mjs} +2 -2
  79. package/dist/{node-Zd_C-gxP.mjs → node-D8Rtg1su.mjs} +1 -1
  80. package/dist/{platform-B4TnJtWu-CwcTyKg2.mjs → platform-B4TnJtWu-Do3agKr5.mjs} +1 -1
  81. package/dist/{project-DMDST9kl.mjs → project-C_2xs57L.mjs} +1 -1
  82. package/dist/{provider-poIkXapd.mjs → provider-BaVmi4Hi.mjs} +3 -1
  83. package/dist/{provider-Cdg1qadh.d.mts → provider-Bm46LAdp.d.mts} +9 -2
  84. package/dist/{redis-tables-DN9PfIDi.mjs → redis-tables-BWJZHUGg.mjs} +41 -25
  85. package/dist/{reducer-CjmvZSAb-D_OSISmj.mjs → reducer-Bswr11ar-P324o9vn.mjs} +2 -2
  86. package/dist/{reducer-CYPHsSmd-BQIfozGi.d.mts → reducer-CYPHsSmd-BXjGiptm.d.mts} +1 -1
  87. package/dist/{reducers-BcmSs4qf.mjs → reducers-8jqLewgw.mjs} +5 -5
  88. package/dist/{retryable-lazy-DZWmHpii-Bye-W8q7.mjs → retryable-lazy-DZWmHpii-DpTc5PIP.mjs} +1 -1
  89. package/dist/{scheduler-task-X1SToDjP-BVoWuInI.mjs → scheduler-task-X1SToDjP-D2Il2rln.mjs} +1 -1
  90. package/dist/{schemas-Be08nyfW.mjs → schemas-DBmUO6pr.mjs} +2 -1
  91. package/dist/{serve-B09an9DQ.mjs → serve-lPoBDEds.mjs} +7 -6
  92. package/dist/{server-qgez0Xny-D5mLfqFQ.d.mts → server-B9gu0qi1-DI1WvcVK.d.mts} +10 -4
  93. package/dist/{server-DTX0prGr.mjs → server-D82a4uMe.mjs} +4 -4
  94. package/dist/{server-DtFrWxi3-Boa6gdWO.mjs → server-DX7mM6nm-D7N_7bug.mjs} +32 -23
  95. package/dist/{serving-CvOWEym2.mjs → serving-DKny38LK.mjs} +1 -1
  96. package/dist/{session-clear-wHd5GCpZ-BnKSxReK.mjs → session-clear-XJYpmUpg-2q8l_FJR.mjs} +14 -2
  97. package/dist/{sql-U9WTxrwJ.mjs → sql-Bj0fk6dn.mjs} +2 -2
  98. package/dist/{sqlite-db-Ds4majtT.mjs → sqlite-db-Dc8G78XV.mjs} +1 -1
  99. package/dist/{store-D0MhBvg6-4Z2L0Kqd.d.mts → store-DEzcHZOA-B-5vhxef.d.mts} +12 -2
  100. package/dist/store-N8PXxDAS-DWWgv-Vz.mjs +5 -0
  101. package/dist/{store-codec-DwrWlgQx-CYxGW0aD.mjs → store-codec-pAG2oPgQ-SqDXlPBR.mjs} +4 -4
  102. package/dist/store-memory-4IBl0Ztu.mjs +2 -0
  103. package/dist/{store-memory-Bas9Uq5C.mjs → store-memory-B0PkVSuQ.mjs} +14 -7
  104. package/dist/{store-polling-BZt2Rf3D-BiEM6_HB.mjs → store-polling-BZt2Rf3D-Div-bJ_D.mjs} +2 -2
  105. package/dist/{store-presence-polling-JuAy2Ck2-CYpuK75X.mjs → store-presence-polling-JuAy2Ck2-Dh-g_KYM.mjs} +3 -3
  106. package/dist/{store-sqlite-CxxPCcCT.mjs → store-sqlite-D85t3tE7.mjs} +14 -7
  107. package/dist/store-sqlite-iBTYYKBj.mjs +2 -0
  108. package/dist/{stream-buffer-DrTyiIuo-BKy-vI14.mjs → stream-buffer-DrTyiIuo-Be10yOBR.mjs} +2 -2
  109. package/dist/sync-github.d.mts +4 -2
  110. package/dist/sync-github.mjs +4 -14
  111. package/dist/sync-kapso.d.mts +3 -2
  112. package/dist/sync-kapso.mjs +3 -3
  113. package/dist/sync-linear.d.mts +12 -2
  114. package/dist/sync-linear.mjs +191 -9
  115. package/dist/sync-slack.d.mts +41 -5
  116. package/dist/sync-slack.mjs +70 -11
  117. package/dist/sync.chat.d.mts +1 -1
  118. package/dist/sync.chat.mjs +1 -1
  119. package/dist/sync.d.mts +2 -2
  120. package/dist/sync.mjs +3 -3
  121. package/dist/tags-BpFo6q0_.mjs +14 -0
  122. package/dist/{targets-C-wdR5wP.mjs → targets-Cgjs29T0.mjs} +1 -1
  123. package/dist/{tokens-BuCU-61R.mjs → tokens-C5_yGRlL.mjs} +2 -2
  124. package/dist/{types-aCAf6lGU.d.mts → types-shZmGZ-q.d.mts} +2 -2
  125. package/dist/{watchers-hash-7DJU9b-n.mjs → watchers-hash-B_5b0-ZG.mjs} +50 -19
  126. package/docs/01-board/04-messages.md +93 -0
  127. package/docs/01-board/08-middleware.md +5 -2
  128. package/docs/02-sync/03-slack.md +6 -2
  129. package/docs/02-sync/07-linear.md +28 -6
  130. package/docs/04-reference/01-cli.md +27 -12
  131. package/docs/04-reference/02-board.md +20 -5
  132. package/docs/04-reference/03-http.md +17 -6
  133. package/docs/04-reference/05-conformance.md +14 -3
  134. package/package.json +2 -2
  135. package/dist/errors-CusN4x2l.mjs +0 -88
  136. package/dist/exports-D22M68rk.d.mts +0 -5
  137. package/dist/store-N8PXxDAS-BWBgzBHp.mjs +0 -5
  138. package/dist/store-memory-ZLiZbH3R.mjs +0 -2
  139. package/dist/store-sqlite-BmwL3pUR.mjs +0 -2
@@ -1,5 +1,6 @@
1
1
  import { a as typeOf, n as DIRECT_UPLOAD_BYTES_MAX, t as ATTACHMENT_BYTES_MAX } from "./files-SniSmeEr.mjs";
2
2
  import { r as normalizeEmoji } from "./emoji-CTLpvH-A.mjs";
3
+ import { ZodError } from "zod";
3
4
  //#region src/client/sse.ts
4
5
  /** Parses a text/event-stream body into messages. */
5
6
  async function* parseSse(body, signal) {
@@ -230,10 +231,13 @@ function createBoardClient(options) {
230
231
  const size = input.data instanceof Blob ? input.data.size : input.data.byteLength;
231
232
  if (size > 4194304) {
232
233
  if (size > 104857600) throw new BoardError("too_large", `Attachments are at most ${DIRECT_UPLOAD_BYTES_MAX / 1024 / 1024} MB.`, 413);
234
+ const bytes = input.data instanceof Blob ? await input.data.arrayBuffer() : input.data;
235
+ const sha256 = btoa(String.fromCharCode(...new Uint8Array(await crypto.subtle.digest("SHA-256", bytes))));
233
236
  const ticket = await call("POST", "/attachments/uploads", { body: {
234
237
  name: input.name,
235
238
  type,
236
- size
239
+ size,
240
+ sha256
237
241
  } }).catch((error) => {
238
242
  if (error instanceof BoardError && error.status === 404 && error.code === "not_found") throw new BoardError("too_large", `This board takes files of at most ${ATTACHMENT_BYTES_MAX / 1024 / 1024} MB.`, 413);
239
243
  throw error;
@@ -260,13 +264,24 @@ function createBoardClient(options) {
260
264
  },
261
265
  /** An attachment's bytes, as the board serves them: `content-type` is the file's type. */
262
266
  download: (id, opts = {}) => raw("GET", `/attachments/${encodeURIComponent(id)}`, opts.signal ? { signal: opts.signal } : {}),
263
- edit: (id, text) => call("POST", `/messages/${path(id)}/edit`, { body: { text } }),
264
- delete: (id) => call("POST", `/messages/${path(id)}/delete`, { body: {} }),
267
+ /**
268
+ * `revision` is the message's as you read it: if it's been edited or deleted since, nothing
269
+ * changes, and it throws a 409 `revision_conflict`.
270
+ */
271
+ edit: (id, text, opts = {}) => call("POST", `/messages/${path(id)}/edit`, { body: {
272
+ text,
273
+ ...opts
274
+ } }),
275
+ delete: (id, opts = {}) => call("POST", `/messages/${path(id)}/delete`, { body: { ...opts } }),
265
276
  /** `emoji` is a short name, `:name:`, or the character itself. */
266
277
  react: (id, emoji, opts = {}) => call("POST", `/messages/${path(id)}/reactions`, { body: {
267
278
  emoji: normalizeEmoji(emoji),
268
279
  ...opts
269
280
  } }),
281
+ /**
282
+ * `if` is what the labels must be now, a value or null for one that mustn't be set: if one
283
+ * isn't, nothing changes, and it throws a 409 `label_conflict`.
284
+ */
270
285
  label: (id, change) => call("POST", `/messages/${path(id)}/labels`, { body: change }),
271
286
  /**
272
287
  * Shows typing in the platform threads the message's thread is synced to
@@ -405,4 +420,89 @@ async function toError(response) {
405
420
  return new BoardError("http_error", `The board answered ${`${response.status} ${response.statusText}`.trim()}.`, response.status);
406
421
  }
407
422
  //#endregion
408
- export { handleErrors as i, createBoardClient as n, duration as r, BoardError as t };
423
+ //#region src/server/errors.ts
424
+ var HttpError = class extends Error {
425
+ status;
426
+ code;
427
+ /** What fixes it, when there's one (`BoardError`'s `hint`). */
428
+ hint;
429
+ /** `handle` for a handle's own error on its way through: everything else is the board's. */
430
+ origin;
431
+ constructor(status, code, message, options = {}) {
432
+ super(message);
433
+ this.status = status;
434
+ this.code = code;
435
+ this.hint = options.hint;
436
+ this.origin = options.origin ?? "board";
437
+ }
438
+ };
439
+ /** A request a host's own verifier rejected with `response`, which the board answers with as it is. */
440
+ var RejectedError = class extends HttpError {
441
+ response;
442
+ constructor(response) {
443
+ super(response.status, "rejected", `rejected with ${response.status}`);
444
+ this.response = response;
445
+ }
446
+ };
447
+ const badRequest = (message, code = "invalid_request") => new HttpError(400, code, message);
448
+ const unauthorized = (message) => new HttpError(401, "unauthorized", message);
449
+ const forbidden = (message) => new HttpError(403, "forbidden", message);
450
+ const notFound = (message, code = "not_found") => new HttpError(404, code, message);
451
+ const duplicateId = () => new HttpError(409, "duplicate_id", "that id was already used for a different write");
452
+ const json = (body, status = 200, headers) => new Response(JSON.stringify(body), {
453
+ status,
454
+ headers: {
455
+ "content-type": "application/json",
456
+ ...headers
457
+ }
458
+ });
459
+ /**
460
+ * The issue a request is told about. A union that matched no option says only "Invalid input", so
461
+ * it's the first issue of the option that came closest, the one with the fewest, at its own path.
462
+ */
463
+ function reported(issue) {
464
+ if (issue.code !== "invalid_union" || issue.errors.length === 0) return issue;
465
+ const first = issue.errors.reduce((best, option) => option.length < best.length ? option : best)[0];
466
+ return first ? reported({
467
+ ...first,
468
+ path: [...issue.path, ...first.path]
469
+ }) : issue;
470
+ }
471
+ /** Every failure becomes `{ error: { code, message, hint? } }` with a matching status. */
472
+ function toErrorResponse(error) {
473
+ if (error instanceof RejectedError) return error.response;
474
+ if (error instanceof HttpError) {
475
+ const response = json({ error: {
476
+ code: error.code,
477
+ message: error.message,
478
+ ...error.hint !== void 0 ? { hint: error.hint } : {}
479
+ } }, error.status);
480
+ if (error.origin === "handle") handleErrors.add(response);
481
+ return response;
482
+ }
483
+ if (error instanceof ZodError) {
484
+ const issue = error.issues[0] && reported(error.issues[0]);
485
+ const path = issue?.path.length ? `${issue.path.join(".")}: ` : "";
486
+ return json({ error: {
487
+ code: "invalid_request",
488
+ message: `${path}${issue?.message ?? "invalid request"}`
489
+ } }, 400);
490
+ }
491
+ const code = error?.code;
492
+ if (code === "INVALID_PAYLOAD") return json({ error: {
493
+ code: "invalid_request",
494
+ message: error.message
495
+ } }, 400);
496
+ if (code === "PARTIAL_DUPLICATE_BATCH" || code === "DUPLICATE_EVENT_ID") return toErrorResponse(duplicateId());
497
+ if (code === "STORE_UNAVAILABLE" || code === "STORE_NOT_CONFIGURED") return json({ error: {
498
+ code: "unavailable",
499
+ message: error.message
500
+ } }, 503);
501
+ console.error("[board]", error);
502
+ return json({ error: {
503
+ code: "internal",
504
+ message: "internal error"
505
+ } }, 500);
506
+ }
507
+ //#endregion
508
+ export { forbidden as a, toErrorResponse as c, createBoardClient as d, duration as f, duplicateId as i, unauthorized as l, RejectedError as n, json as o, badRequest as r, notFound as s, HttpError as t, BoardError as u };
@@ -1,5 +1,5 @@
1
- import { d as LabelKey, p as Labels } from "./schemas-Be08nyfW.mjs";
2
- import { n as ExternalEvent, r as ExternalLocation } from "./external-BV_cUncs.mjs";
1
+ import { d as LabelKey, p as Labels } from "./schemas-DBmUO6pr.mjs";
2
+ import { n as ExternalEvent, r as ExternalLocation } from "./external-D3p5T57R.mjs";
3
3
  import { z } from "zod";
4
4
  //#region src/sync/events.ts
5
5
  const EventBase = z.object({
@@ -1,13 +1,12 @@
1
1
  import { t as ATTACHMENT_BYTES_MAX } from "./files-SniSmeEr.mjs";
2
- import "./schemas-Be08nyfW.mjs";
3
- import { A as SchedulesQuery, B as SyncReceiptBody, C as MatchesQuery, D as Ref, E as ReactBody, F as SyncBody, G as UploadStartBody, H as SyncUnlinkBody, I as SyncCodeBody, L as SyncCopiesQuery, M as SourceJoinBody, N as SourceReadQuery, O as RegisterBody, P as SyncAccountBody, R as SyncFindQuery, S as LinkedQuery, T as PostBody, U as ThreadsQuery, V as SyncRootsQuery, W as TypingBody, _ as InboxAckBody, a as METHODS, b as InboxQuery, c as queryObject, d as VERSION, f as SYNC, g as IdentityUnlinkBody, h as EventsQuery, j as SignInQuery, k as ScheduleBody, l as readCapped, m as EditBody, o as createRouter, p as AckBody, s as openapi, u as readJson, v as InboxNextQuery, w as MessagesQuery, x as LabelBody, y as InboxPushBody, z as SyncImportBody } from "./watchers-hash-7DJU9b-n.mjs";
4
- import { n as createBoardClient, t as BoardError } from "./client-D0Px7KzF.mjs";
2
+ import "./schemas-DBmUO6pr.mjs";
3
+ import { A as ScheduleBody, B as SyncImportBody, C as LinkedQuery, D as ReactBody, E as PostBody, F as SyncAccountBody, G as TypingBody, H as SyncRootsQuery, I as SyncBody, K as UploadStartBody, L as SyncCodeBody, M as SignInQuery, N as SourceJoinBody, O as Ref, P as SourceReadQuery, R as SyncCopiesQuery, S as LabelBody, T as MessagesQuery, U as SyncUnlinkBody, V as SyncReceiptBody, W as ThreadsQuery, _ as IdentityUnlinkBody, a as METHODS, b as InboxPushBody, c as queryObject, d as VERSION, f as SYNC, g as EventsQuery, h as EditBody, j as SchedulesQuery, k as RegisterBody, l as readCapped, m as DeleteBody, o as createRouter, p as AckBody, s as openapi, u as readJson, v as InboxAckBody, w as MatchesQuery, x as InboxQuery, y as InboxNextQuery, z as SyncFindQuery } from "./watchers-hash-B_5b0-ZG.mjs";
4
+ import { a as forbidden, c as toErrorResponse, d as createBoardClient, l as unauthorized, n as RejectedError, o as json, r as badRequest, s as notFound, t as HttpError, u as BoardError } from "./errors-C_5rB8Iz.mjs";
5
5
  import { r as derivedId } from "./wait-until-Dw4XrIDQ.mjs";
6
- import { a as forbidden, c as toErrorResponse, l as unauthorized, n as RejectedError, o as json, r as badRequest, s as notFound, t as HttpError } from "./errors-CusN4x2l.mjs";
7
- import { d as issuersOf, g as verifiesTokens, l as hostPrincipal, o as createAuthority, s as fromTokens } from "./auth-lTkOgvcE.mjs";
8
- import { i as resolveActor, r as claimsOf, t as KNOWN_AGENTS } from "./actors-BLXVp4oZ.mjs";
9
- import { r as runMiddleware, t as DroppedError } from "./middleware-ChKM1zuu.mjs";
10
- import { n as syncTarget, r as withEmailMentions, t as mentionsEmails } from "./targets-C-wdR5wP.mjs";
6
+ import { i as resolveActor, r as claimsOf, t as KNOWN_AGENTS } from "./actors-xPiamLWk.mjs";
7
+ import { d as issuersOf, g as verifiesTokens, l as hostPrincipal, o as createAuthority, s as fromTokens } from "./auth-BPinwfN0.mjs";
8
+ import { r as runMiddleware, t as DroppedError } from "./middleware-DlJQYiwV.mjs";
9
+ import { n as syncTarget, r as withEmailMentions, t as mentionsEmails } from "./targets-Cgjs29T0.mjs";
11
10
  //#region src/server/policy.ts
12
11
  /**
13
12
  * The policy a board's options say: verifying requests, and `access` over them and over the
@@ -216,7 +215,6 @@ async function inputOf(name, request, url, params) {
216
215
  case "message":
217
216
  case "posted":
218
217
  case "synced":
219
- case "delete":
220
218
  case "cancelSchedule":
221
219
  case "attachment":
222
220
  case "uploadFinish": return { id };
@@ -237,6 +235,10 @@ async function inputOf(name, request, url, params) {
237
235
  id,
238
236
  ...EditBody.parse(await body())
239
237
  };
238
+ case "delete": return {
239
+ id,
240
+ ...DeleteBody.parse(await body())
241
+ };
240
242
  case "react": return {
241
243
  id,
242
244
  ...ReactBody.parse(await body())
@@ -513,6 +515,25 @@ async function createServe(context) {
513
515
  }));
514
516
  }
515
517
  /**
518
+ * A schedule, on a backend whose sends post elsewhere: its message through the middleware once,
519
+ * as the caller's post of it, since its text and labels never change and no send comes back here.
520
+ */
521
+ function screenSchedule(caller, input, signal) {
522
+ const { channel, re, text, labels, noSync, attachments } = input;
523
+ return screenPost(caller, {
524
+ ...channel !== void 0 ? { channel } : {},
525
+ ...re !== void 0 ? { re } : {},
526
+ text,
527
+ ...labels ? { labels } : {},
528
+ ...noSync !== void 0 ? { noSync } : {},
529
+ ...attachments ? { attachments } : {}
530
+ }, signal, (screened) => backend.schedule(caller, {
531
+ ...input,
532
+ text: screened.text,
533
+ ...screened.labels ? { labels: screened.labels } : {}
534
+ }, signal));
535
+ }
536
+ /**
516
537
  * The caller's own message, still there, where it may post: what an edit of it changes. One it
517
538
  * can't read may still be its own, as board()'s own code finds it, only if it was written there
518
539
  * without reading too: one its principal wrote where it reads (a repo's workflows share one) is
@@ -709,22 +730,27 @@ async function createServe(context) {
709
730
  switch (name) {
710
731
  case "post": return importPost(caller, input, signal);
711
732
  case "edit": {
712
- const { id, text } = input;
733
+ const { id, text, revision } = input;
713
734
  return change({
714
735
  op: "edit",
715
736
  author,
716
737
  from: null,
717
738
  message: id,
718
739
  text: await withEmails(text),
719
- source
740
+ source,
741
+ ...revision !== void 0 ? { revision } : {}
742
+ });
743
+ }
744
+ case "delete": {
745
+ const { id, revision } = input;
746
+ return change({
747
+ op: "delete",
748
+ author,
749
+ from: null,
750
+ message: id,
751
+ ...revision !== void 0 ? { revision } : {}
720
752
  });
721
753
  }
722
- case "delete": return change({
723
- op: "delete",
724
- author,
725
- from: null,
726
- message: input.id
727
- });
728
754
  case "react": {
729
755
  const { id, emoji, remove } = input;
730
756
  return change({
@@ -737,14 +763,15 @@ async function createServe(context) {
737
763
  });
738
764
  }
739
765
  case "label": {
740
- const { id, set, unset } = input;
766
+ const { id, set, unset, if: expected } = input;
741
767
  return change({
742
768
  op: "labels",
743
769
  author,
744
770
  from: null,
745
771
  message: id,
746
772
  ...set ? { set } : {},
747
- ...unset ? { unset } : {}
773
+ ...unset ? { unset } : {},
774
+ ...expected ? { if: expected } : {}
748
775
  });
749
776
  }
750
777
  default: return invoke(name, me, input, signal);
@@ -780,7 +807,8 @@ async function createServe(context) {
780
807
  ...input.labels ? { labels: input.labels } : {},
781
808
  ...input.noSync ? { noSync: true } : {},
782
809
  ...input.attachments?.length ? { attachments: input.attachments } : {},
783
- ...input.id !== void 0 ? { id: input.id } : {}
810
+ ...input.id !== void 0 ? { id: input.id } : {},
811
+ ...input.after !== void 0 ? { after: input.after } : {}
784
812
  }, signal));
785
813
  for (const target of targets) await backend.syncReceipt(me, {
786
814
  kind: "thread",
@@ -796,27 +824,25 @@ async function createServe(context) {
796
824
  switch (name) {
797
825
  case "post": return post(caller, input, signal);
798
826
  case "edit": {
799
- const { id, text } = input;
827
+ const edit = input;
800
828
  const send = (body) => screenEdit(caller, body, signal, (patched) => backend.edit(caller, patched, signal));
801
- if (!engine || !mentionsEmails(text) || !await mayPost(caller, { re: id }, signal)) return send({
802
- id,
803
- text
804
- });
829
+ if (!engine || !mentionsEmails(edit.text) || !await mayPost(caller, { re: edit.id }, signal)) return send(edit);
805
830
  return send({
806
- id,
807
- text: await withEmails(text)
831
+ ...edit,
832
+ text: await withEmails(edit.text)
808
833
  });
809
834
  }
810
835
  case "syncImport": return syncImport(caller, input, signal);
811
836
  case "schedule": {
812
837
  const body = input;
838
+ const schedule = (made) => backend.sendsSchedulesHere === false ? screenSchedule(caller, made, signal) : backend.schedule(caller, made, signal);
813
839
  const allowed = engine && mentionsEmails(body.text) ? await mayPost(caller, body, signal) : null;
814
- if (!allowed) return backend.schedule(caller, body, signal);
840
+ if (!allowed) return schedule(body);
815
841
  const text = await withEmails(body.text);
816
- const answer = await backend.schedule(caller, {
842
+ const answer = await schedule({
817
843
  ...body,
818
844
  text
819
- }, signal);
845
+ });
820
846
  const { access } = allowed;
821
847
  return text !== body.text && access !== null && !access.readable(answer.schedule.channel) ? {
822
848
  ...answer,
@@ -1087,9 +1113,9 @@ async function createServe(context) {
1087
1113
  });
1088
1114
  },
1089
1115
  pull: () => engine ? engine.pull() : Promise.resolve(0),
1090
- async readSource(key, target, limit) {
1116
+ async readSource(key, target, limit, after) {
1091
1117
  if (!engine || !entries[key]) throw notFound(`this board doesn't run sync entry ${key}: read it where its sync runs`, "not_synced_here");
1092
- return engine.readSource(key, target, limit);
1118
+ return engine.readSource(key, target, limit, after);
1093
1119
  },
1094
1120
  async joinSource(key, target) {
1095
1121
  if (!engine || !entries[key]) throw notFound(`this board doesn't run sync entry ${key}: join it where its sync runs`, "not_synced_here");
@@ -1227,7 +1253,7 @@ function createBoard(options, runtime) {
1227
1253
  receive: async (key, item, meta) => (await server()).receive(key, item, meta),
1228
1254
  pull: async () => ownEntries.length > 0 ? (await server()).pull() : 0,
1229
1255
  sync: ownEntries,
1230
- readSource: async (key, target, limit) => (await server()).readSource(key, target, limit),
1256
+ readSource: async (key, target, limit, after) => (await server()).readSource(key, target, limit, after),
1231
1257
  joinSource: async (key, target) => (await server()).joinSource(key, target),
1232
1258
  locate: (url) => {
1233
1259
  const read = /* @__PURE__ */ new Map();
@@ -0,0 +1,5 @@
1
+ import "./auth-CU56Q2Xh.mjs";
2
+ import "./folds-8wRRXjAt.mjs";
3
+ import "./client-CjAatpV4.mjs";
4
+ import "./backend-n3hajfrD.mjs";
5
+ import "./errors-87TVtXeb.mjs";
@@ -1,4 +1,4 @@
1
- import { h as MessageId, m as MESSAGE_TEXT_MAX } from "./schemas-Be08nyfW.mjs";
1
+ import { h as MessageId, m as MESSAGE_TEXT_MAX } from "./schemas-DBmUO6pr.mjs";
2
2
  import { z } from "zod";
3
3
  //#region src/contract/external.ts
4
4
  /**
@@ -125,6 +125,8 @@ const ExternalEvent = z.discriminatedUnion("kind", [
125
125
  type: z.string(),
126
126
  title: z.string(),
127
127
  url: z.string().nullable(),
128
+ /** What the PR or issue says, under its title and link on a root it opens or retitles. */
129
+ body: z.string().nullable().optional(),
128
130
  labels: z.record(z.string(), z.string()),
129
131
  unset: z.array(z.string()),
130
132
  /** Key prefixes the platform owns on the root, e.g. `tag.`: keys under them that aren't in `labels` are unset. */
@@ -133,7 +135,7 @@ const ExternalEvent = z.discriminatedUnion("kind", [
133
135
  reply: z.string().nullable(),
134
136
  /** Create the root if the board hasn't seen this thread. */
135
137
  createRoot: z.boolean(),
136
- /** The thread's title changed on the platform: a root that came from it says the new one. */
138
+ /** The thread's title or body changed on the platform: a root that came from it says the new one. */
137
139
  retitled: z.boolean().optional(),
138
140
  author: ExternalAuthor
139
141
  })
@@ -31,6 +31,7 @@ declare const Author: z.ZodObject<{
31
31
  session: z.ZodNullable<z.ZodString>;
32
32
  }, z.core.$strip>;
33
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. */
34
35
  declare const AttachmentId: z.ZodString;
35
36
  /** A file on a message. The board records `type` and `size` from what it stored, never from the request. */
36
37
  declare const Attachment: z.ZodObject<{
@@ -467,6 +468,7 @@ declare const ExternalEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
467
468
  type: z.ZodString;
468
469
  title: z.ZodString;
469
470
  url: z.ZodNullable<z.ZodString>;
471
+ body: z.ZodOptional<z.ZodNullable<z.ZodString>>;
470
472
  labels: z.ZodRecord<z.ZodString, z.ZodString>;
471
473
  unset: z.ZodArray<z.ZodString>;
472
474
  owns: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -522,6 +524,8 @@ type Message = {
522
524
  blind?: true;
523
525
  /** The index of the last event that changed it. Folds from before it existed leave it out. */
524
526
  version?: number;
527
+ /** The index of its post, or of its last edit or delete. Folds from before it existed leave it out. */
528
+ revision?: number;
525
529
  };
526
530
  type MessagesState = {
527
531
  byId: Record<string, Message>;
@@ -1,5 +1,5 @@
1
- import { b as actorKind } from "./schemas-Be08nyfW.mjs";
2
- import { c as externalMessageKey, l as isThreadTarget } from "./external-BV_cUncs.mjs";
1
+ import { b as actorKind } from "./schemas-DBmUO6pr.mjs";
2
+ import { c as externalMessageKey, l as isThreadTarget } from "./external-D3p5T57R.mjs";
3
3
  import { t as canonicalEmoji } from "./emoji-CTLpvH-A.mjs";
4
4
  import { n as setOwn, t as own } from "./own-OwgPWdmh.mjs";
5
5
  //#region src/contract/folds.ts
@@ -7,6 +7,7 @@ const iso = (date) => typeof date === "string" ? date : date.toISOString();
7
7
  function foldMessages(state, event) {
8
8
  const changed = foldMessage(state, event);
9
9
  if (changed) changed.version = event.index;
10
+ if (changed && (event.type === "message.posted" || event.type === "message.edited" || event.type === "message.deleted")) changed.revision = event.index;
10
11
  return state;
11
12
  }
12
13
  /** Applies `event`, and returns the message it changed: none for an event that changes nothing. */
@@ -1,5 +1,5 @@
1
- import { d as Board, f as BoardOptions } from "./backend-ZKYTe3xa.mjs";
2
- import "./exports-D22M68rk.mjs";
1
+ import { d as Board, f as BoardOptions } from "./backend-n3hajfrD.mjs";
2
+ import "./exports-CrGA5_yN.mjs";
3
3
  //#region src/server/index.d.ts
4
4
  /**
5
5
  * The handle on a board. With a `backend`, the board lives there: `a2()` keeps it in this
package/dist/index.d.mts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { a as CallerRequest, o as Claims } from "./auth-CU56Q2Xh.mjs";
2
- import { x as Attachment } from "./folds-jS9wlh9_.mjs";
3
- import { $ as RegisterInput, A as InboxItem, At as SyncRootsQuery, B as Me, Bt as TypingResult, C as EventsQuery, Ct as SyncFindInput, D as IdentityView, Dt as SyncImportInput, E as IdentityUnlinkBody, Et as SyncImportBody, F as LinkView, Ft as ThreadView, G as ParsedFilters, H as MessagesPage, Ht as UploadTicket, I as LinkedAccount, It as ThreadsPage, J as PostInput, K as PersonView, L as LinkedQuery, Lt as ThreadsQuery, M as InboxPushBody, Mt as SyncUnlinkBody, N as InboxQuery, Nt as SyncedView, O as InboxAckBody, Ot as SyncReceiptBody, P as LabelBody, Pt as ThreadSummaryView, Q as RegisterBody, R as MatchView, Rt as ThreadsQueryInput, S as EventsPage, St as SyncCopiesView, T as FiltersInput, Tt as SyncFindView, U as MessagesQuery, Ut as routes, V as MessageView, Vt as UploadStartBody, W as MessagesQueryInput, X as ReactBody, Y as REGISTERED_WATCHERS_MAX, Z as Ref, _ as BoardEventView, _t as SyncAccountInput, a as PostOptions, at as ScheduleInput, b as Discovery, bt as SyncCodeView, c as ScheduleOptions, ct as SchedulesQueryInput, d as WaitOptions, dt as SourceJoin, et as RegistrationView, f as Written, ft as SourceJoinBody, g as ApiError, gt as SyncAccountBody, h as ActorView, ht as SourceReadQuery, i as Filters, it as ScheduleBodyOutput, j as InboxNextQuery, jt as SyncThreadView, k as InboxEntry, kt as SyncReceiptInput, l as ScheduleTiming, lt as SchedulesQueryOutput, m as AckBody, mt as SourceRead, n as BoardError, nt as RouteName, o as ProfileOption, ot as ScheduleView, p as duration, pt as SourceMessage, q as PostBody, rt as ScheduleBody, s as ReplyOptions, st as SchedulesQuery, tt as ResolvedSyncTarget, u as UploadInput, ut as SignInQuery, v as ChannelView, vt as SyncBody, w as EventsQueryInput, wt as SyncFindQuery, x as EditBody, xt as SyncCopiesQuery, y as DeleteBody, yt as SyncCodeBody, z as MatchesQuery, zt as TypingBody } from "./client-xLxeDz0f.mjs";
4
- import { S as Protocol, _ 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 Method, y as WritePatch } from "./backend-ZKYTe3xa.mjs";
5
- import { t as HttpError } from "./errors-CB4tnZGz.mjs";
6
- import "./exports-D22M68rk.mjs";
2
+ import { x as Attachment } from "./folds-8wRRXjAt.mjs";
3
+ import { $ as RegisterBody, A as InboxItem, At as SyncReceiptInput, B as MatchesQuery, Bt as TypingBody, C as EventsQuery, Ct as SyncCopiesView, D as IdentityView, Dt as SyncImportBody, E as IdentityUnlinkBody, Et as SyncFindView, F as LabelBody, Ft as ThreadSummaryView, G as MessagesQueryInput, H as MessageView, Ht as UploadStartBody, I as LinkView, It as ThreadView, J as PostBody, K as ParsedFilters, L as LinkedAccount, Lt as ThreadsPage, M as InboxPushBody, Mt as SyncThreadView, N as InboxQuery, Nt as SyncUnlinkBody, O as InboxAckBody, Ot as SyncImportInput, P as LABEL_CONDITIONS_MAX, Pt as SyncedView, Q as Ref, R as LinkedQuery, Rt as ThreadsQuery, S as EventsPage, St as SyncCopiesQuery, T as FiltersInput, Tt as SyncFindQuery, U as MessagesPage, Ut as UploadTicket, V as Me, Vt as TypingResult, W as MessagesQuery, Wt as routes, X as REGISTERED_WATCHERS_MAX, Y as PostInput, Z as ReactBody, _ as BoardEventView, _t as SyncAccountBody, a as PostOptions, at as ScheduleBodyOutput, b as Discovery, bt as SyncCodeBody, c as ScheduleOptions, ct as SchedulesQuery, d as WaitOptions, dt as SignInQuery, et as RegisterInput, f as Written, ft as SourceJoin, g as ApiError, gt as SourceReadQuery, h as ActorView, ht as SourceRead, i as Filters, it as ScheduleBody, j as InboxNextQuery, jt as SyncRootsQuery, k as InboxEntry, kt as SyncReceiptBody, l as ScheduleTiming, lt as SchedulesQueryInput, m as AckBody, mt as SourceMessage, n as BoardError, nt as ResolvedSyncTarget, o as ProfileOption, ot as ScheduleInput, p as duration, pt as SourceJoinBody, q as PersonView, rt as RouteName, s as ReplyOptions, st as ScheduleView, tt as RegistrationView, u as UploadInput, ut as SchedulesQueryOutput, v as ChannelView, vt as SyncAccountInput, w as EventsQueryInput, wt as SyncFindInput, x as EditBody, xt as SyncCodeView, y as DeleteBody, yt as SyncBody, z as MatchView, zt as ThreadsQueryInput } from "./client-CjAatpV4.mjs";
4
+ import { S as Protocol, _ 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 Method, y as WritePatch } from "./backend-n3hajfrD.mjs";
5
+ import { t as HttpError } from "./errors-87TVtXeb.mjs";
6
+ import "./exports-CrGA5_yN.mjs";
7
7
  //#region src/server/index.default.d.ts
8
8
  /**
9
9
  * The handle on a board. Outside Node there's no environment to find one in, so pass its
@@ -11,4 +11,4 @@ import "./exports-D22M68rk.mjs";
11
11
  */
12
12
  export declare function board(options?: BoardOptions): Board;
13
13
  //#endregion
14
- 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 DeleteBody, type Discovery, DroppedError, type EditBody, type EventsPage, type EventsQuery, type EventsQueryInput, type Filters, type FiltersInput, HttpError, type Identity, type IdentityUnlinkBody, type IdentityView, type InboxAckBody, type InboxDelivery, type InboxEntry, type InboxItem, type InboxNextQuery, type InboxPushBody, type InboxQuery, type LabelBody, type LinkView, type LinkedAccount, 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 PersonView, 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 SignInQuery, type SourceJoin, type SourceJoinBody, type SourceMessage, type SourceRead, type SourceReadQuery, type Subscription, type SyncAccountBody, type SyncAccountInput, type SyncBody, type SyncCodeBody, type SyncCodeView, type SyncCopiesQuery, type SyncCopiesView, type SyncFindInput, type SyncFindQuery, type SyncFindView, type SyncImportBody, type SyncImportInput, type SyncReceiptBody, type SyncReceiptInput, type SyncRootsQuery, type SyncThreadView, type SyncUnlinkBody, type SyncedView, type ThreadSummaryView, type ThreadView, type ThreadsPage, type ThreadsQuery, type ThreadsQueryInput, 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, duration, type routes };
14
+ 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 DeleteBody, type Discovery, DroppedError, type EditBody, type EventsPage, type EventsQuery, type EventsQueryInput, type Filters, type FiltersInput, HttpError, type Identity, type IdentityUnlinkBody, type IdentityView, type InboxAckBody, type InboxDelivery, type InboxEntry, type InboxItem, type InboxNextQuery, type InboxPushBody, type InboxQuery, type LABEL_CONDITIONS_MAX, type LabelBody, type LinkView, type LinkedAccount, 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 PersonView, 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 SignInQuery, type SourceJoin, type SourceJoinBody, type SourceMessage, type SourceRead, type SourceReadQuery, type Subscription, type SyncAccountBody, type SyncAccountInput, type SyncBody, type SyncCodeBody, type SyncCodeView, type SyncCopiesQuery, type SyncCopiesView, type SyncFindInput, type SyncFindQuery, type SyncFindView, type SyncImportBody, type SyncImportInput, type SyncReceiptBody, type SyncReceiptInput, type SyncRootsQuery, type SyncThreadView, type SyncUnlinkBody, type SyncedView, type ThreadSummaryView, type ThreadView, type ThreadsPage, type ThreadsQuery, type ThreadsQueryInput, 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, duration, type routes };
@@ -1,4 +1,4 @@
1
- import { r as createHttp } from "./backend-http-CfLVYqmj.mjs";
1
+ import { r as createHttp } from "./backend-http-BPaNYLWj.mjs";
2
2
  //#region src/backend-http/index.default.ts
3
3
  /**
4
4
  * The board at `url`, which keeps the log. Outside Node there's no environment to find it or a
package/dist/index.mjs CHANGED
@@ -1,8 +1,7 @@
1
- import { r as duration, t as BoardError } from "./client-D0Px7KzF.mjs";
2
- import { t as HttpError } from "./errors-CusN4x2l.mjs";
3
- import { t as http } from "./index.default-DmKxH_E6.mjs";
4
- import { t as createBoard } from "./exports-CCzw2Vdw.mjs";
5
- import { t as DroppedError } from "./middleware-ChKM1zuu.mjs";
1
+ import { f as duration, t as HttpError, u as BoardError } from "./errors-C_5rB8Iz.mjs";
2
+ import { t as http } from "./index.default-DhkgpfR2.mjs";
3
+ import { t as createBoard } from "./exports-CG0P8Qi4.mjs";
4
+ import { t as DroppedError } from "./middleware-DlJQYiwV.mjs";
6
5
  //#region src/server/index.default.ts
7
6
  /**
8
7
  * The handle on a board. Outside Node there's no environment to find one in, so pass its
@@ -11,7 +10,7 @@ import { t as DroppedError } from "./middleware-ChKM1zuu.mjs";
11
10
  function board(options = {}) {
12
11
  return createBoard(options, {
13
12
  http: () => http(),
14
- sync: () => import("./engine-Bfe6pcXb.mjs"),
13
+ sync: () => import("./engine-DkdkXQEy.mjs"),
15
14
  serving: null
16
15
  });
17
16
  }
@@ -1,7 +1,7 @@
1
1
  import { a as CallerRequest, o as Claims } from "./auth-CU56Q2Xh.mjs";
2
- import { x as Attachment } from "./folds-jS9wlh9_.mjs";
3
- import { $ as RegisterInput, A as InboxItem, At as SyncRootsQuery, B as Me, Bt as TypingResult, C as EventsQuery, Ct as SyncFindInput, D as IdentityView, Dt as SyncImportInput, E as IdentityUnlinkBody, Et as SyncImportBody, F as LinkView, Ft as ThreadView, G as ParsedFilters, H as MessagesPage, Ht as UploadTicket, I as LinkedAccount, It as ThreadsPage, J as PostInput, K as PersonView, L as LinkedQuery, Lt as ThreadsQuery, M as InboxPushBody, Mt as SyncUnlinkBody, N as InboxQuery, Nt as SyncedView, O as InboxAckBody, Ot as SyncReceiptBody, P as LabelBody, Pt as ThreadSummaryView, Q as RegisterBody, R as MatchView, Rt as ThreadsQueryInput, S as EventsPage, St as SyncCopiesView, T as FiltersInput, Tt as SyncFindView, U as MessagesQuery, Ut as routes, V as MessageView, Vt as UploadStartBody, W as MessagesQueryInput, X as ReactBody, Y as REGISTERED_WATCHERS_MAX, Z as Ref, _ as BoardEventView, _t as SyncAccountInput, a as PostOptions, at as ScheduleInput, b as Discovery, bt as SyncCodeView, c as ScheduleOptions, ct as SchedulesQueryInput, d as WaitOptions, dt as SourceJoin, et as RegistrationView, f as Written, ft as SourceJoinBody, g as ApiError, gt as SyncAccountBody, h as ActorView, ht as SourceReadQuery, i as Filters, it as ScheduleBodyOutput, j as InboxNextQuery, jt as SyncThreadView, k as InboxEntry, kt as SyncReceiptInput, l as ScheduleTiming, lt as SchedulesQueryOutput, m as AckBody, mt as SourceRead, n as BoardError, nt as RouteName, o as ProfileOption, ot as ScheduleView, p as duration, pt as SourceMessage, q as PostBody, rt as ScheduleBody, s as ReplyOptions, st as SchedulesQuery, tt as ResolvedSyncTarget, u as UploadInput, ut as SignInQuery, v as ChannelView, vt as SyncBody, w as EventsQueryInput, wt as SyncFindQuery, x as EditBody, xt as SyncCopiesQuery, y as DeleteBody, yt as SyncCodeBody, z as MatchesQuery, zt as TypingBody } from "./client-xLxeDz0f.mjs";
4
- import { S as Protocol, _ 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 Method, y as WritePatch } from "./backend-ZKYTe3xa.mjs";
5
- import { t as HttpError } from "./errors-CB4tnZGz.mjs";
6
- import { t as board } from "./index-C05it0mC.mjs";
7
- 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 DeleteBody, type Discovery, DroppedError, type EditBody, type EventsPage, type EventsQuery, type EventsQueryInput, type Filters, type FiltersInput, HttpError, type Identity, type IdentityUnlinkBody, type IdentityView, type InboxAckBody, type InboxDelivery, type InboxEntry, type InboxItem, type InboxNextQuery, type InboxPushBody, type InboxQuery, type LabelBody, type LinkView, type LinkedAccount, 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 PersonView, 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 SignInQuery, type SourceJoin, type SourceJoinBody, type SourceMessage, type SourceRead, type SourceReadQuery, type Subscription, type SyncAccountBody, type SyncAccountInput, type SyncBody, type SyncCodeBody, type SyncCodeView, type SyncCopiesQuery, type SyncCopiesView, type SyncFindInput, type SyncFindQuery, type SyncFindView, type SyncImportBody, type SyncImportInput, type SyncReceiptBody, type SyncReceiptInput, type SyncRootsQuery, type SyncThreadView, type SyncUnlinkBody, type SyncedView, type ThreadSummaryView, type ThreadView, type ThreadsPage, type ThreadsQuery, type ThreadsQueryInput, 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 };
2
+ import { x as Attachment } from "./folds-8wRRXjAt.mjs";
3
+ import { $ as RegisterBody, A as InboxItem, At as SyncReceiptInput, B as MatchesQuery, Bt as TypingBody, C as EventsQuery, Ct as SyncCopiesView, D as IdentityView, Dt as SyncImportBody, E as IdentityUnlinkBody, Et as SyncFindView, F as LabelBody, Ft as ThreadSummaryView, G as MessagesQueryInput, H as MessageView, Ht as UploadStartBody, I as LinkView, It as ThreadView, J as PostBody, K as ParsedFilters, L as LinkedAccount, Lt as ThreadsPage, M as InboxPushBody, Mt as SyncThreadView, N as InboxQuery, Nt as SyncUnlinkBody, O as InboxAckBody, Ot as SyncImportInput, P as LABEL_CONDITIONS_MAX, Pt as SyncedView, Q as Ref, R as LinkedQuery, Rt as ThreadsQuery, S as EventsPage, St as SyncCopiesQuery, T as FiltersInput, Tt as SyncFindQuery, U as MessagesPage, Ut as UploadTicket, V as Me, Vt as TypingResult, W as MessagesQuery, Wt as routes, X as REGISTERED_WATCHERS_MAX, Y as PostInput, Z as ReactBody, _ as BoardEventView, _t as SyncAccountBody, a as PostOptions, at as ScheduleBodyOutput, b as Discovery, bt as SyncCodeBody, c as ScheduleOptions, ct as SchedulesQuery, d as WaitOptions, dt as SignInQuery, et as RegisterInput, f as Written, ft as SourceJoin, g as ApiError, gt as SourceReadQuery, h as ActorView, ht as SourceRead, i as Filters, it as ScheduleBody, j as InboxNextQuery, jt as SyncRootsQuery, k as InboxEntry, kt as SyncReceiptBody, l as ScheduleTiming, lt as SchedulesQueryInput, m as AckBody, mt as SourceMessage, n as BoardError, nt as ResolvedSyncTarget, o as ProfileOption, ot as ScheduleInput, p as duration, pt as SourceJoinBody, q as PersonView, rt as RouteName, s as ReplyOptions, st as ScheduleView, tt as RegistrationView, u as UploadInput, ut as SchedulesQueryOutput, v as ChannelView, vt as SyncAccountInput, w as EventsQueryInput, wt as SyncFindInput, x as EditBody, xt as SyncCodeView, y as DeleteBody, yt as SyncBody, z as MatchView, zt as ThreadsQueryInput } from "./client-CjAatpV4.mjs";
4
+ import { S as Protocol, _ 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 Method, y as WritePatch } from "./backend-n3hajfrD.mjs";
5
+ import { t as HttpError } from "./errors-87TVtXeb.mjs";
6
+ import { t as board } from "./index-BygAXP7t.mjs";
7
+ 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 DeleteBody, type Discovery, DroppedError, type EditBody, type EventsPage, type EventsQuery, type EventsQueryInput, type Filters, type FiltersInput, HttpError, type Identity, type IdentityUnlinkBody, type IdentityView, type InboxAckBody, type InboxDelivery, type InboxEntry, type InboxItem, type InboxNextQuery, type InboxPushBody, type InboxQuery, type LABEL_CONDITIONS_MAX, type LabelBody, type LinkView, type LinkedAccount, 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 PersonView, 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 SignInQuery, type SourceJoin, type SourceJoinBody, type SourceMessage, type SourceRead, type SourceReadQuery, type Subscription, type SyncAccountBody, type SyncAccountInput, type SyncBody, type SyncCodeBody, type SyncCodeView, type SyncCopiesQuery, type SyncCopiesView, type SyncFindInput, type SyncFindQuery, type SyncFindView, type SyncImportBody, type SyncImportInput, type SyncReceiptBody, type SyncReceiptInput, type SyncRootsQuery, type SyncThreadView, type SyncUnlinkBody, type SyncedView, type ThreadSummaryView, type ThreadView, type ThreadsPage, type ThreadsQuery, type ThreadsQueryInput, 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,5 +1,4 @@
1
- import { r as duration, t as BoardError } from "./client-D0Px7KzF.mjs";
2
- import { t as HttpError } from "./errors-CusN4x2l.mjs";
3
- import { t as DroppedError } from "./middleware-ChKM1zuu.mjs";
4
- import { t as board } from "./server-DTX0prGr.mjs";
1
+ import { f as duration, t as HttpError, u as BoardError } from "./errors-C_5rB8Iz.mjs";
2
+ import { t as DroppedError } from "./middleware-DlJQYiwV.mjs";
3
+ import { t as board } from "./server-D82a4uMe.mjs";
5
4
  export { BoardError, DroppedError, HttpError, board, duration };