better-supabase 0.30.0 → 0.31.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 (205) hide show
  1. package/dist/{adapter-D4aNBxhm.js → adapter-BTbj5N9C.js} +2 -52
  2. package/dist/ai-sdk/agents/index.d.ts +2 -2
  3. package/dist/{app-tables-yyVncXEt.d.ts → app-tables-B2mKMNRQ.d.ts} +1 -1
  4. package/dist/astro/index.js +2 -2
  5. package/dist/{authorization-CDU9tYA_.d.ts → authorization-DfEkyFt_.d.ts} +10 -3
  6. package/dist/{bind-p7asfI6H.d.ts → bind-DAx0bMSi.d.ts} +2 -2
  7. package/dist/{block-env-B8wG3xeh.d.ts → block-env-Dz7Caxk0.d.ts} +3 -3
  8. package/dist/blocks/ai-chat/index.d.ts +3 -3
  9. package/dist/blocks/announcements/index.d.ts +3 -3
  10. package/dist/blocks/api-keys/index.d.ts +1 -1
  11. package/dist/blocks/attachments/index.d.ts +1 -1
  12. package/dist/blocks/audit/index.d.ts +2 -2
  13. package/dist/blocks/automations/index.d.ts +1 -1
  14. package/dist/blocks/billing/index.d.ts +1 -1
  15. package/dist/blocks/bookings/index.d.ts +1 -1
  16. package/dist/blocks/calendar/index.d.ts +7 -3
  17. package/dist/blocks/calendar/index.js +5 -1
  18. package/dist/blocks/comments/index.d.ts +4 -4
  19. package/dist/blocks/employees/index.js +1 -4
  20. package/dist/blocks/entitlements/index.d.ts +2 -2
  21. package/dist/blocks/forms/index.d.ts +1 -1
  22. package/dist/blocks/inbox/index.d.ts +4 -4
  23. package/dist/blocks/index.d.ts +1 -1
  24. package/dist/blocks/messaging/index.d.ts +4 -4
  25. package/dist/blocks/mfa/index.d.ts +1 -1
  26. package/dist/blocks/notifications/index.d.ts +3 -3
  27. package/dist/blocks/notifications/index.js +5 -43
  28. package/dist/blocks/onboarding/index.d.ts +1 -1
  29. package/dist/blocks/organizations/index.d.ts +34 -21
  30. package/dist/blocks/organizations/index.js +5 -1
  31. package/dist/blocks/permissions/index.d.ts +32 -3
  32. package/dist/blocks/permissions/index.js +23 -2
  33. package/dist/blocks/push/index.d.ts +10 -2
  34. package/dist/blocks/push/index.js +23 -7
  35. package/dist/blocks/reactions/index.d.ts +3 -3
  36. package/dist/blocks/saved-views/index.d.ts +1 -1
  37. package/dist/blocks/search/index.d.ts +2 -2
  38. package/dist/blocks/sessions/index.d.ts +1 -1
  39. package/dist/blocks/settings/index.d.ts +1 -1
  40. package/dist/blocks/subjects/index.d.ts +1 -1
  41. package/dist/blocks/tags/index.d.ts +1 -1
  42. package/dist/blocks/tasks/index.js +1 -1
  43. package/dist/blocks/teams/index.d.ts +7 -1
  44. package/dist/blocks/teams/index.js +8 -7
  45. package/dist/blocks/undo/index.d.ts +1 -1
  46. package/dist/blocks/usage/index.d.ts +1 -1
  47. package/dist/blocks/workflow-editor/index.d.ts +3 -3
  48. package/dist/blocks/workflows/index.d.ts +3 -3
  49. package/dist/cli/{add-Dggyehsy.js → add-B9wP0YGU.js} +2 -2
  50. package/dist/cli/{add-D4w-Axib.js → add-DjZXKd7X.js} +10 -10
  51. package/dist/cli/add-ZcEOEK23.js +1 -0
  52. package/dist/cli/{app-table-files-CiGuwLkO.js → app-table-files-mtvjHa48.js} +2 -2
  53. package/dist/cli/{backfill-DjVjXW_P.js → backfill-Coshdvh_.js} +2 -2
  54. package/dist/cli/bin.js +1 -1
  55. package/dist/cli/{blocks-jRL9K1R8.js → blocks-BWCuA0nq.js} +2 -2
  56. package/dist/cli/{blocks-Bbmb6W_F.js → blocks-hiSazThw.js} +1 -1
  57. package/dist/cli/{cache-BuoIFlUJ.js → cache-x2wWAy0h.js} +1 -1
  58. package/dist/cli/{codemod-DRavXBCb.js → codemod-BnjV7BpC.js} +210 -11
  59. package/dist/cli/{command-DIPmo0wh.js → command-CCAwhiOh.js} +6 -0
  60. package/dist/cli/{completion-DxPxMtyP.js → completion-BJaB84Pe.js} +2 -2
  61. package/dist/cli/{completion-DyLMSjOD.js → completion-BkUhs1ms.js} +1 -1
  62. package/dist/cli/{completion-FUgqm2-N.js → completion-DmUVsUVQ.js} +2 -2
  63. package/dist/cli/{config-BfapErxs.js → config-zId1jkLx.js} +1 -1
  64. package/dist/cli/{content-mapper-BCtyfKXl.js → content-mapper-DvOSOdTE.js} +2 -2
  65. package/dist/cli/{db-CWvH1_46.js → db-DXKyVEDF.js} +1 -1
  66. package/dist/cli/{doctor-Di2ZekfN.js → doctor-Ywy8oJEU.js} +41 -16
  67. package/dist/cli/env-CNjT_uOV.js +1 -0
  68. package/dist/cli/{env-B2CbnbzD.js → env-XMiKvhtV.js} +1 -1
  69. package/dist/cli/{gen-STKC9vkK.js → gen-B-FbQmG1.js} +14 -14
  70. package/dist/cli/index.d.ts +1 -1
  71. package/dist/cli/index.js +7 -7
  72. package/dist/cli/{init-DW6_nIwj.js → init-fb9e1BKX.js} +9 -9
  73. package/dist/cli/{keys-V-HcO-21.js → keys-ORiPz1sM.js} +1 -1
  74. package/dist/cli/{live-0G4Plw3K.js → live-DIt7TP-N.js} +2 -2
  75. package/dist/cli/{mcp-flKS8iU5.js → mcp-CVWwraga.js} +3 -3
  76. package/dist/cli/{metadata-VARUbXEe.js → metadata-CannIjel.js} +3 -3
  77. package/dist/cli/{migrate-Bkq07XcT.js → migrate-Ht2TzIQF.js} +2 -2
  78. package/dist/cli/{migration-safety-BfVeza5j.js → migration-safety-nNyB05I-.js} +1 -1
  79. package/dist/cli/{migrations-BCq7Zs2E.js → migrations-bAd7dpk1.js} +2 -2
  80. package/dist/cli/{module-migration-lbeUrsYv.js → module-migration-CkNux8dr.js} +2 -2
  81. package/dist/cli/{moved-DNOtp9LA.js → moved-C3WyRHkA.js} +1 -1
  82. package/dist/cli/{parse-BPf3kGnc.js → parse-DjHbTaFI.js} +1 -1
  83. package/dist/cli/{powersync-B15CfH5Y.js → powersync-B2v0tDwp.js} +100 -7
  84. package/dist/cli/powersync-D3mAQ6QE.js +1 -0
  85. package/dist/cli/{print-DjxpBRnv.js → print-CxQ0rBKT.js} +2 -2
  86. package/dist/cli/{providers-dyxcHQY3.js → providers-DtI90lSw.js} +1 -1
  87. package/dist/cli/{remove-BLq5gbal.js → remove-DYtE4IZ4.js} +6 -6
  88. package/dist/cli/{render-CizUf3RW.js → render-QGWfEoiB.js} +3 -3
  89. package/dist/cli/{run-ChEjR7yw.js → run-B5aMwErM.js} +2 -2
  90. package/dist/cli/{run-MwM__teL.js → run-BNoJKf5I.js} +40 -39
  91. package/dist/cli/{run-ChOY6s4o.js → run-DiYX1XEa.js} +8 -8
  92. package/dist/cli/{seed-CDnL4Tnc.js → seed-C-Hu2n_E.js} +1 -1
  93. package/dist/cli/seed-Cm-c0BDd.js +1 -0
  94. package/dist/cli/{shared-DV5wIv-7.js → shared-D_CFi5di.js} +1 -1
  95. package/dist/cli/{skills-DM3oeIxY.js → skills-D98y0bSB.js} +1 -1
  96. package/dist/cli/{snapshot-B5LXkVMC.js → snapshot-BlQ4DDcJ.js} +9 -4
  97. package/dist/cli/{source-BoLNG_2A.js → source-CelMBQMj.js} +1 -1
  98. package/dist/cli/{spec-D6QeE2Zx.js → spec-BxcoGE0h.js} +1 -1
  99. package/dist/cli/{spec-Dz-PGCaM.js → spec-iBx1LcYO.js} +3 -3
  100. package/dist/cli/{sql-layout-zo02f3Dm.js → sql-layout-Dp4Rottt.js} +2 -2
  101. package/dist/cli/{stack-ClESAZYf.js → stack-B2slzrYH.js} +1 -1
  102. package/dist/cli/{sync-m-oZ_SyI.js → sync-BnORI43S.js} +4 -4
  103. package/dist/cli/{table-dyKddjwo.js → table-D6HUECKI.js} +1 -1
  104. package/dist/cli/{upgrade-C9sgVZ5z.js → upgrade-CR6-WmIc.js} +5 -5
  105. package/dist/cli/{upgrade-WwEJaX3i.js → upgrade-fz92aCnh.js} +3 -3
  106. package/dist/cli/{version-D2BQuqta.js → version-Dz8ZlOuh.js} +1 -1
  107. package/dist/client/index.d.ts +5 -5
  108. package/dist/client/native/index.d.ts +4 -4
  109. package/dist/{composite-CBRbvn5j.js → composite-B4qB6k31.js} +2 -2
  110. package/dist/config/index.d.ts +2 -2
  111. package/dist/config/index.js +4 -4
  112. package/dist/{config-r7njjNgh.js → config-B7g-HDis.js} +3 -3
  113. package/dist/{config-bqKaPjst.js → config-R0m0fBiD.js} +1 -1
  114. package/dist/{context-nbYYjv7U.d.ts → context-DWWoP1wK.d.ts} +1 -1
  115. package/dist/{controller-TRocodqG.d.ts → controller-Br9dGKGe.d.ts} +1 -1
  116. package/dist/{controller-qG-B1eDn.js → controller-W97g2WGG.js} +1 -1
  117. package/dist/create/index.d.ts +3 -3
  118. package/dist/create/index.js +3 -3
  119. package/dist/create/lite/index.d.ts +3 -3
  120. package/dist/create/lite/index.js +3 -3
  121. package/dist/delivery-events-DbL8IHIY.js +53 -0
  122. package/dist/edge/index.js +3 -3
  123. package/dist/{entitlements-B1i1-wfe.d.ts → entitlements-CBjm2lvD.d.ts} +1 -1
  124. package/dist/eve/index.js +1 -1
  125. package/dist/expo/index.js +3 -2
  126. package/dist/{field-errors-tJvehEFc.d.ts → field-errors-CEjsMAgd.d.ts} +4 -4
  127. package/dist/{framework-DYEUraqt.js → framework-CqiZk89W.js} +1 -1
  128. package/dist/hono/index.js +2 -2
  129. package/dist/{index-BkzXwuIN.d.ts → index-Clyd2Goi.d.ts} +1 -1
  130. package/dist/{index-zsgNmE8m.d.ts → index-D98bQs8a.d.ts} +7 -7
  131. package/dist/{index-BKrxynq9.d.ts → index-DIdPoQtO.d.ts} +2 -2
  132. package/dist/{index-CWAQRWY8.d.ts → index-I8YLxKq8.d.ts} +2 -2
  133. package/dist/{index-8US7qlvW.d.ts → index-eRBuKtMt.d.ts} +2 -2
  134. package/dist/{index-BM6NmKSc.d.ts → index-uIU65iEn.d.ts} +6 -6
  135. package/dist/{instances-C7qUTjhJ.js → instances-DY_ORk5g.js} +2 -0
  136. package/dist/mapper/bin.js +5 -5
  137. package/dist/mcp/index.d.ts +1 -1
  138. package/dist/mcp/index.js +1 -1
  139. package/dist/mcp/sdk/index.js +1 -1
  140. package/dist/next/index.d.ts +73 -6
  141. package/dist/next/index.js +88 -35
  142. package/dist/{operations-CB9atU2e.d.ts → operations-hm1Isvvs.d.ts} +1 -1
  143. package/dist/{options-BKBy5wM_.js → options-CF6EVF_G.js} +2 -1
  144. package/dist/{options-COo7_3MX.js → options-DSCW40_5.js} +3 -1
  145. package/dist/orpc/index.js +2 -1
  146. package/dist/otel/index.js +4 -4
  147. package/dist/{ports-hpbyMySO.d.ts → ports-DOrPTJzl.d.ts} +1 -1
  148. package/dist/powersync/index.d.ts +204 -4
  149. package/dist/powersync/index.js +361 -4
  150. package/dist/preset/index.d.ts +3 -3
  151. package/dist/preset/index.js +3 -3
  152. package/dist/{preset-DCdEnJj9.js → preset-CXhpPmPV.js} +2 -2
  153. package/dist/{project-B32wb5J6.js → project-DJ9Uo0sT.js} +5 -5
  154. package/dist/{push-token-DQ1ycFPU.d.ts → push-token-B4vcIU4s.d.ts} +1 -1
  155. package/dist/query/index.d.ts +1 -1
  156. package/dist/query/index.js +1 -1
  157. package/dist/react/index.d.ts +5 -5
  158. package/dist/react/index.js +1 -1
  159. package/dist/react/native/index.d.ts +1 -1
  160. package/dist/react/server.d.ts +5 -5
  161. package/dist/react/server.js +1 -1
  162. package/dist/{react-CcrQQl0_.js → react-mdVjpewL.js} +2 -2
  163. package/dist/react-router/index.js +2 -2
  164. package/dist/realtime/index.d.ts +3 -3
  165. package/dist/{record-type-DRbnlj5q.js → record-type-BEUyEsFx.js} +2 -2
  166. package/dist/records/index.d.ts +5 -5
  167. package/dist/records/index.js +3 -3
  168. package/dist/{replicas-Dyoh3CEg.js → refresh-DLBgnxjL.js} +51 -1
  169. package/dist/{resolved-names-iLBOUaib.js → resolved-names-kMRjmSIy.js} +1 -1
  170. package/dist/{runtime-CoKxZibd.js → runtime-LRJM7UqY.js} +19 -20
  171. package/dist/server/index.d.ts +1 -1
  172. package/dist/server/index.js +4 -4
  173. package/dist/{sign-in-Cyj3ZlFX.js → sign-in-CuZ1Ag7O.js} +17 -2
  174. package/dist/solid/index.d.ts +5 -5
  175. package/dist/solid-start/index.js +2 -2
  176. package/dist/spec/index.js +1 -1
  177. package/dist/sql/index.d.ts +4 -4
  178. package/dist/sql/index.js +3 -3
  179. package/dist/{sql-CyeDg3Yh.js → sql-DHp0L7zK.js} +404 -165
  180. package/dist/ssr/index.d.ts +1 -1
  181. package/dist/svelte/index.d.ts +5 -5
  182. package/dist/sveltekit/index.js +2 -2
  183. package/dist/tanstack-start/index.js +2 -2
  184. package/dist/{tenant-C9YE_kqK.d.ts → tenant-FfgNhd5x.d.ts} +1 -1
  185. package/dist/testing/index.d.ts +13 -4
  186. package/dist/testing/index.js +17 -15
  187. package/dist/{timeline-DvXtXq5q.d.ts → timeline-DqEoD8bb.d.ts} +1 -1
  188. package/dist/{timeline--VU3A1e4.js → timeline-Dz3hO2I6.js} +1 -1
  189. package/dist/{topic-breZqx_4.d.ts → topic-BaUElNw2.d.ts} +1 -1
  190. package/dist/{types-C3I7S51U.d.ts → types-CMN0h_Ix.d.ts} +2 -2
  191. package/dist/vue/index.d.ts +5 -5
  192. package/dist/{watch-topic-ItO3dz8m.d.ts → watch-topic-BabDTZ-L.d.ts} +1 -1
  193. package/dist/workflow-sdk/world/index.js +2 -2
  194. package/dist/{workflow-sdk-BWPsdzVK.js → workflow-sdk-DJJkP0dT.js} +12 -1
  195. package/dist/yjs/index.d.ts +1 -1
  196. package/package.json +1 -1
  197. package/schemas/config-v1.json +9 -1
  198. package/schemas/doctor-report-v1.json +1 -0
  199. package/skills/better-supabase/references/ui-recipes.md +524 -295
  200. package/skills/better-supabase-api/references/powersync.md +16 -0
  201. package/skills/better-supabase-auth/SKILL.md +4 -1
  202. package/dist/cli/add-BdhGOwkB.js +0 -1
  203. package/dist/cli/env-CynGCICL.js +0 -1
  204. package/dist/cli/powersync-DnBsDchT.js +0 -1
  205. package/dist/cli/seed-BOun22-k.js +0 -1
@@ -9,7 +9,7 @@ import { i as forwardBlockEvents, t as DEFAULT_TYPE_PREFIX } from "./cloud-event
9
9
  import { loadEnv } from "./env/index.js";
10
10
  import { i as userContext, t as actClaim } from "./impersonation-DM3oWNoD.js";
11
11
  import { t as fromPgError } from "./pg-error-B5QLDcbG.js";
12
- import { a as replicaState, i as primaryCookieWrite, o as routedExecutor, r as pinnedUntil, s as withPrimaryPin } from "./replicas-Dyoh3CEg.js";
12
+ import { c as primaryCookieWrite, d as withPrimaryPin, l as replicaState, n as refreshFor, r as shouldCheckSession, s as pinnedUntil, u as routedExecutor } from "./refresh-DLBgnxjL.js";
13
13
  import { t as authContext } from "./context-DBicfUNz.js";
14
14
  import { a as delegatedClaims, i as contextClaims, o as narrowCap } from "./delegation-DGOIiT8k.js";
15
15
  import { c as AUTH_CACHE_HEADERS, d as clearSessionAtScopes, f as parseCookies, g as sessionCookieName, h as serializeCookie, i as resolveAuth, n as prefetchJwks, r as requestToken } from "./resolve-B0mW2m7f.js";
@@ -505,56 +505,6 @@ function withServerContext(core) {
505
505
  })();
506
506
  }
507
507
  //#endregion
508
- //#region src/server/refresh.ts
509
- /**
510
- * A router or browser prefetch, by its request headers: Next.js route and
511
- * segment prefetches (`next-router-prefetch`, `next-router-segment-prefetch`),
512
- * Next's middleware prefetch (`x-middleware-prefetch`), and browser and
513
- * speculation-rules prefetches (`purpose`, `sec-purpose`, `x-moz`).
514
- */
515
- function isPrefetch(request) {
516
- const h = request.headers;
517
- return h.has("next-router-prefetch") || h.has("next-router-segment-prefetch") || h.get("x-middleware-prefetch") === "1" || h.get("purpose") === "prefetch" || h.get("x-moz") === "prefetch" || (h.get("sec-purpose")?.includes("prefetch") ?? false);
518
- }
519
- const FORM_TYPES = ["application/x-www-form-urlencoded", "multipart/form-data"];
520
- /**
521
- * Whether a request should refresh an expired session cookie: page loads,
522
- * client navigations (`rsc`, `x-sveltekit-*`, `_data` loaders), form posts and
523
- * Server Actions. Prefetches, assets and `fetch` calls from scripts read the
524
- * session as it is, so a burst of parallel requests never races on the
525
- * single-use refresh token.
526
- */
527
- function shouldRefresh(request) {
528
- const h = request.headers;
529
- if (request.method !== "GET" && request.method !== "HEAD") {
530
- if (h.has("next-action") || h.has("x-sveltekit-action")) return true;
531
- if (h.get("sec-fetch-dest") === "document") return true;
532
- const type = h.get("content-type") ?? "";
533
- return FORM_TYPES.some((form) => type.startsWith(form));
534
- }
535
- if (isPrefetch(request)) return false;
536
- if (h.get("rsc") === "1") return true;
537
- const dest = h.get("sec-fetch-dest");
538
- if (dest) return dest === "document";
539
- return h.get("accept")?.includes("text/html") ?? false;
540
- }
541
- /**
542
- * Whether a request should ask the Auth server if the session still exists
543
- * (`checkSession`): full page loads, and `paths` you list for client
544
- * navigations. Never prefetches or mutations.
545
- */
546
- function shouldCheckSession(request, paths) {
547
- if (request.method !== "GET" && request.method !== "HEAD") return false;
548
- if (isPrefetch(request)) return false;
549
- if (request.headers.get("sec-fetch-dest") === "document") return true;
550
- return paths?.includes(new URL(request.url).pathname) ?? false;
551
- }
552
- /** `policy` for one request. */
553
- function refreshFor(policy, request) {
554
- if (policy === void 0 || typeof policy === "boolean") return policy;
555
- return policy === "navigation" ? shouldRefresh(request) : policy(request);
556
- }
557
- //#endregion
558
508
  //#region src/server/entries/session.ts
559
509
  function checkFor(policy, request) {
560
510
  if (policy === void 0 || typeof policy === "boolean") return policy ?? false;
@@ -2298,4 +2248,4 @@ async function resolveToken(server, token) {
2298
2248
  return auth;
2299
2249
  }
2300
2250
  //#endregion
2301
- export { suspendAccount as A, shouldRefresh as C, SERVER_EVENT_SOURCE as D, defineAuthorizationHooks as E, endSessions as O, shouldCheckSession as S, serverCore as T, withSupport as _, unexpectedResponse as a, isPrefetch as b, extendServer as c, clearSupportCookie as d, supportCookie as f, withTenant as g, TENANT_HEADER as h, resolveToken as i, deleteAccount as j, lastSignIns as k, supportStorage as l, supportCookieValue as m, flushEvents as n, withFlush as o, supportCookieMaxAge as p, handle as r, createServer as s, bearerRequest as t, SUPPORT_COOKIE as u, outageResponse as v, withServerContext as w, refreshFor as x, withSession as y };
2251
+ export { SERVER_EVENT_SOURCE as C, deleteAccount as D, suspendAccount as E, defineAuthorizationHooks as S, lastSignIns as T, withSupport as _, unexpectedResponse as a, withServerContext as b, extendServer as c, clearSupportCookie as d, supportCookie as f, withTenant as g, TENANT_HEADER as h, resolveToken as i, supportStorage as l, supportCookieValue as m, flushEvents as n, withFlush as o, supportCookieMaxAge as p, handle as r, createServer as s, bearerRequest as t, SUPPORT_COOKIE as u, outageResponse as v, endSessions as w, serverCore as x, withSession as y };
@@ -2,8 +2,8 @@ import { a as SessionActor, c as agentClaims, r as AgentActOptions } from "../..
2
2
  import { d as KnowledgeSearchOptions, o as KnowledgeHit, r as Knowledge } from "../../knowledge-CsLPACGJ.js";
3
3
  import { t as Agent } from "../../agents-CM_cCtcr.js";
4
4
  import { P as AiToolPolicy, _ as AiModerationAction, b as AiModerationStage, i as AiChat } from "../../ai-chat-B7_vQvxU.js";
5
- import { r as AuthorizationOperation } from "../../authorization-CDU9tYA_.js";
6
- import { t as OperationTable } from "../../operations-CB9atU2e.js";
5
+ import { r as AuthorizationOperation } from "../../authorization-DfEkyFt_.js";
6
+ import { t as OperationTable } from "../../operations-hm1Isvvs.js";
7
7
  import { i as SearchToolOptions, r as ResultsFilter } from "../../embeddings-I3s5sTDt.js";
8
8
  import { n as GatewayOptions } from "../../gateway-options-BlVCqgb8.js";
9
9
  import { LanguageModel, LanguageModelMiddleware, StopCondition, ToolLoopAgent, ToolLoopAgentSettings, ToolSet } from "ai";
@@ -1,4 +1,4 @@
1
- import { Tr as AppTableConfig } from "./context-nbYYjv7U.js";
1
+ import { Tr as AppTableConfig } from "./context-DWWoP1wK.js";
2
2
  //#region src/config/app-tables.d.ts
3
3
  /**
4
4
  * The columns every app table gets, which `columns` may not name: `id`,
@@ -1,9 +1,9 @@
1
1
  import { i as storageImageUrl } from "../image-url-_d7xYsXK.js";
2
- import { c as extendServer, n as flushEvents, s as createServer } from "../adapter-D4aNBxhm.js";
2
+ import { c as extendServer, n as flushEvents, s as createServer } from "../adapter-BTbj5N9C.js";
3
3
  import { n as defaultExpose } from "../respond-CZMWbUs3.js";
4
4
  import { i as requireCaller, o as runAction } from "../kit-Bcd9wYCV.js";
5
5
  import { t as around } from "../shared-Bf-I13Ht.js";
6
- import { i as localsOf, r as frameworkEntry } from "../framework-DYEUraqt.js";
6
+ import { i as localsOf, r as frameworkEntry } from "../framework-CqiZk89W.js";
7
7
  import { r as refusalResponse } from "../refusal-DDlInPff.js";
8
8
  //#region src/astro/index.ts
9
9
  function runtimeEnv(locals) {
@@ -313,7 +313,7 @@ interface BlockNameRegistry {
313
313
  readonly "recurrenceDates": "id" | "tenant" | "event" | "kind" | "at";
314
314
  };
315
315
  readonly functions: "calendar_attendee_auto_decline" | "calendar_block_auto_decline" | "calendar_busy_blocks" | "calendar_free_busy" | "calendar_rule_starts" | "cancel_calendar_occurrence" | "create_calendar" | "delete_calendar" | "delete_calendar_event" | "import_calendar_events" | "list_calendar_events" | "list_calendar_working_hours" | "list_calendars" | "remove_calendar_attendee" | "respond_calendar_event" | "save_calendar_event" | "set_calendar_attendee" | "set_calendar_working_hours" | "split_calendar_event";
316
- readonly actions: "manage" | "write" | "read";
316
+ readonly actions: "manage" | "write" | "read" | "create" | "update" | "delete";
317
317
  readonly hooks: "before_calendar_event_save" | "after_calendar_event_save";
318
318
  readonly entities: {
319
319
  readonly "calendar_event": "id" | "tenant_id" | "calendar_id" | "uid" | "title" | "description" | "location" | "starts_at" | "ends_at" | "all_day" | "tz" | "status" | "rrule" | "exdates" | "recurrence_id" | "original_start" | "subject_type" | "subject_id" | "color" | "kind" | "transparency" | "auto_decline" | "created_by" | "created_at" | "updated_at" | "visibility" | "owner_id" | "rdates";
@@ -1239,8 +1239,8 @@ interface BlockNameRegistry {
1239
1239
  readonly "overrides": "tenant" | "role" | "permission" | "granted";
1240
1240
  readonly "platformAssignments": "user" | "role";
1241
1241
  };
1242
- readonly functions: "can" | "can_assign" | "can_assign_as" | "can_user" | "is_platform" | "member_can" | "permission_claims" | "tenant_ids_with";
1243
- readonly actions: never;
1242
+ readonly functions: "can" | "can_assign" | "can_assign_as" | "can_user" | "is_platform" | "list_roles" | "member_can" | "permission_claims" | "set_permission_override" | "tenant_ids_with";
1243
+ readonly actions: "listRoles" | "setOverride";
1244
1244
  readonly hooks: never;
1245
1245
  readonly entities: {};
1246
1246
  readonly primary: never;
@@ -2158,6 +2158,10 @@ type CalendarRuleDialect = {
2158
2158
  readonly position: string;
2159
2159
  };
2160
2160
  };
2161
+ type CalendarReadOnly = {
2162
+ readonly column: string;
2163
+ readonly values: readonly string[];
2164
+ };
2161
2165
  type CalendarAccessFunctions = {
2162
2166
  readonly read?: string;
2163
2167
  readonly write?: string;
@@ -2178,6 +2182,7 @@ type CalendarSqlOptions = {
2178
2182
  readonly attendeeKey?: "email" | "any";
2179
2183
  readonly calendarDetails?: boolean;
2180
2184
  readonly ruleDialect?: CalendarRuleDialect;
2185
+ readonly readOnly?: CalendarReadOnly;
2181
2186
  };
2182
2187
  //#endregion
2183
2188
  //#region src/blocks/catalog/options.d.ts
@@ -2908,6 +2913,8 @@ type TasksSqlOptions = {
2908
2913
  readonly extraColumns?: ExtraColumns;
2909
2914
  /** Whether an item's author can delete it without the delete key. */
2910
2915
  readonly authorCanDelete?: boolean;
2916
+ readonly notify?: boolean;
2917
+ readonly actionPath?: string;
2911
2918
  };
2912
2919
  //#endregion
2913
2920
  //#region src/blocks/teams/options.d.ts
@@ -3,8 +3,8 @@ import { o as BlockTenant } from "./block-helpers-D5emQ2O6.js";
3
3
  import { t as BetterSupabase, y as Db } from "./define-D8_9X5fZ.js";
4
4
  import { n as DataEngine } from "./data-engine-rvbR2C4F.js";
5
5
  import { Dn as GeneratedBlocks } from "./define-block-DWVZSZv1.js";
6
- import { rt as BetterQueries } from "./index-BM6NmKSc.js";
7
- import { t as ClientPorts } from "./ports-hpbyMySO.js";
6
+ import { rt as BetterQueries } from "./index-uIU65iEn.js";
7
+ import { t as ClientPorts } from "./ports-DOrPTJzl.js";
8
8
  import { SupabaseClient } from "@supabase/supabase-js";
9
9
  //#region src/client/bind.d.ts
10
10
  interface AuthUser {
@@ -1,7 +1,7 @@
1
1
  import { Dn as GeneratedBlocks } from "./define-block-DWVZSZv1.js";
2
- import { n as TopicPort } from "./watch-topic-ItO3dz8m.js";
3
- import { t as ClientPorts } from "./ports-hpbyMySO.js";
4
- import { t as AuthPort } from "./controller-TRocodqG.js";
2
+ import { n as TopicPort } from "./watch-topic-BabDTZ-L.js";
3
+ import { t as ClientPorts } from "./ports-DOrPTJzl.js";
4
+ import { t as AuthPort } from "./controller-Br9dGKGe.js";
5
5
  import { SupabaseClient } from "@supabase/supabase-js";
6
6
  //#region src/blocks/block-env.d.ts
7
7
  /**
@@ -4,9 +4,9 @@ import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTrans
4
4
  import { a as AiMessagePart, c as AiReasoningPart, d as AiTextPart, f as AiToolApprovalPart, g as isAiMessage, h as aiMessageSchema, i as AiMessage, l as AiSourcePart, m as AiToolResultPart, n as AiDataPart, o as AiMessagePartType, p as AiToolCallPart, r as AiFilePart, s as AiMessageRole, t as AI_MESSAGE_SCHEMA_ID, u as AiStepPart } from "../../message-Bg4TKA12.js";
5
5
  import { $ as AiRunStep, A as AiStoredMessageStatus, B as AiSandbox, C as AiProject, D as AiSaveResult, E as AiRunStatus, F as AiUserMessageTrigger, G as AiHarnessSession, H as AiSandboxStopper, I as SharedAiChat, J as AiHarnessStatus, K as AiHarnessSessionPatch, L as aiChatListTopic, M as AiToolApproval, N as AiToolApprovalRequest, O as AiShareLink, P as AiToolPolicy, Q as AiRunState, R as aiChatTopic, S as AiPendingInputRequest, T as AiRunRelease, U as AiSandboxes, V as AiSandboxStatus, W as NewAiSandbox, X as AiRun, Y as AiPendingApproval, Z as AiRunQuery, _ as AiModerationAction, a as AiChatInput, b as AiModerationStage, c as AiChatPatch, d as AiChatShare, et as AiRunStepInput, f as AiChatVisibility, g as AiModelInput, h as AiModel, i as AiChat, j as AiStreamClaim, k as AiStoredMessage, l as AiChatQuery, m as AiMessageSibling, n as AiApprovalDecision, nt as AiRuns, o as AiChatOptions, p as AiFeedback, q as AiHarnessSessions, r as AiAssistantMessageOptions, rt as createHarnessSessions, s as AiChatPage, t as AiAppendResult, tt as AiRunStepStatus, u as AiChatRecord, v as AiModerationEvent, w as AiProjectInput, x as AiPendingInput, y as AiModerationInput, z as createAiChat } from "../../ai-chat-B7_vQvxU.js";
6
6
  import { c as BlockOf } from "../../define-block-DWVZSZv1.js";
7
- import { p as SubscriptionStatus } from "../../topic-breZqx_4.js";
8
- import { n as TopicPort } from "../../watch-topic-ItO3dz8m.js";
9
- import { n as Controller, t as AuthPort } from "../../controller-TRocodqG.js";
7
+ import { p as SubscriptionStatus } from "../../topic-BaUElNw2.js";
8
+ import { n as TopicPort } from "../../watch-topic-BabDTZ-L.js";
9
+ import { n as Controller, t as AuthPort } from "../../controller-Br9dGKGe.js";
10
10
  import { StandardSchemaV1 } from "@standard-schema/spec";
11
11
  //#region src/core/contracts/ai-message.d.ts
12
12
  /**
@@ -8,9 +8,9 @@ import { r as BlockTemporalOptions } from "../../block-helpers-D5emQ2O6.js";
8
8
  import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-9EUA3q_I.js";
9
9
  import { n as BlockHooks } from "../../block-hooks-B8itxzEE.js";
10
10
  import { c as BlockOf } from "../../define-block-DWVZSZv1.js";
11
- import { p as SubscriptionStatus } from "../../topic-breZqx_4.js";
12
- import { n as TopicPort } from "../../watch-topic-ItO3dz8m.js";
13
- import { n as Controller, t as AuthPort } from "../../controller-TRocodqG.js";
11
+ import { p as SubscriptionStatus } from "../../topic-BaUElNw2.js";
12
+ import { n as TopicPort } from "../../watch-topic-BabDTZ-L.js";
13
+ import { n as Controller, t as AuthPort } from "../../controller-Br9dGKGe.js";
14
14
  //#region src/blocks/announcements/announcements.d.ts
15
15
  type AnnouncementSeverity = "info" | "success" | "warning" | "critical";
16
16
  /**
@@ -4,7 +4,7 @@ import { r as AuthState } from "../../resolve-CtX6T0c0.js";
4
4
  import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-9EUA3q_I.js";
5
5
  import { t as BlockProblemOptions } from "../../problem-DNwN8iGz.js";
6
6
  import { c as BlockOf } from "../../define-block-DWVZSZv1.js";
7
- import { n as Controller, t as AuthPort } from "../../controller-TRocodqG.js";
7
+ import { n as Controller, t as AuthPort } from "../../controller-Br9dGKGe.js";
8
8
  import { _ as createApiKeys, a as ApiKeyExtraClaims, c as ApiKeyState, d as CreateApiKeyInput, f as CreatedApiKey, g as apiKeyResolver, h as apiKeyClaims, i as ApiKeyExtraClaim, l as ApiKeys, m as apiKeyChecksum, n as ApiKeyCheck, o as ApiKeyReservedClaim, p as ParsedApiKey, r as ApiKeyClaimsOptions, s as ApiKeyResolverOptions, t as ApiKey, u as ApiKeysOptions, v as parseApiKey } from "../../api-keys-JE-aykZE.js";
9
9
  import { Entry } from "@supabase/middleware";
10
10
  import { AuthMode, JWTClaims, UserClaims } from "@supabase/server";
@@ -3,7 +3,7 @@ import { Ct as Events, ot as StorageObjectEventData, y as AttachmentEventData }
3
3
  import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-9EUA3q_I.js";
4
4
  import { t as Author } from "../../block-authors-DzXLUiIq.js";
5
5
  import { At as NewAttachment, Ct as AttachmentScannerOptions, Dt as AttachmentVersion, Et as AttachmentUpload, Ft as ScannedObject, It as attachmentVersionOf, Lt as createAttachmentScanner, Mt as ObjectScanner, Nt as ObjectScannerOptions, Ot as Attachments, Pt as ScanVerdict, Rt as createAttachments, Sn as EntitySchema, St as AttachmentScanner, Tt as AttachmentStorage, _t as AttachmentDownload, bt as AttachmentReplacement, c as BlockOf, gt as AttachmentBucket, ht as Attachment, jt as ObjectScanJob, kt as AttachmentsOptions, ln as RecordBindingWrite, mn as RecordRowInput, rn as RecordBinding, vt as AttachmentImageUrlOptions, wt as AttachmentStatus, xt as AttachmentScanJob, yt as AttachmentImages, zt as createObjectScanner } from "../../define-block-DWVZSZv1.js";
6
- import { n as Controller } from "../../controller-TRocodqG.js";
6
+ import { n as Controller } from "../../controller-Br9dGKGe.js";
7
7
  //#region src/blocks/attachments/record-binding.d.ts
8
8
  /** A pending write to a record's files, for `useOptimistic`. */
9
9
  type AttachmentsOptimisticAction = {
@@ -11,9 +11,9 @@ import { Yt as WhereInput, t as BetterSupabase } from "../../define-D8_9X5fZ.js"
11
11
  import { c as BlockOf } from "../../define-block-DWVZSZv1.js";
12
12
  import { i as EventSink, t as CloudEvent } from "../../cloud-event-0pQ9vFNS.js";
13
13
  import { i as ListDefinition } from "../../list-query-BcU8NnNL.js";
14
- import { n as Controller, t as AuthPort } from "../../controller-TRocodqG.js";
14
+ import { n as Controller, t as AuthPort } from "../../controller-Br9dGKGe.js";
15
15
  import { a as UndoToken } from "../../undo-0HkWXASn.js";
16
- import { n as AuditCategory } from "../../context-nbYYjv7U.js";
16
+ import { n as AuditCategory } from "../../context-DWWoP1wK.js";
17
17
  //#region src/blocks/audit/audit.d.ts
18
18
  interface PurgeAuditLogOptions extends BlockTemporalOptions {
19
19
  /**
@@ -8,7 +8,7 @@ import { a as dbTransport, i as RpcClient, o as rpcTransport, s as sqlTransport,
8
8
  import { a as BlockTransportMiddleware, d as extendBlock, f as withBlockHooks, n as BlockHooks, p as wrapTransport } from "../../block-hooks-B8itxzEE.js";
9
9
  import { _ as FilterRule, d as FilterLimits, f as FilterNode, h as FilterQuery, i as FilterCombinator, m as FilterOperatorSpec, r as FilterClock } from "../../filter-query-DBt7OKuH.js";
10
10
  import { $t as createActionRegistry, Bt as Action, Gt as ActionInfo, Ht as ActionContext, Jt as ActionRegistry, Kt as ActionOrigin, L as NotifierInput, Qt as actionKey, Ut as ActionDescriptor, Vt as ActionCall, Wt as ActionHandler, Yt as ActionSpec, Zt as DefaultAutomation, c as BlockOf, en as defineAction, qt as ActionRef } from "../../define-block-DWVZSZv1.js";
11
- import { n as Controller, t as AuthPort } from "../../controller-TRocodqG.js";
11
+ import { n as Controller, t as AuthPort } from "../../controller-Br9dGKGe.js";
12
12
  import { o as ApprovalRequestInput } from "../../approvals-BfEafAzt.js";
13
13
  import { n as FilterRecordField, t as FilterEvaluation } from "../../filter-evaluate-BRpNiNPG.js";
14
14
  import { a as checkRuleConditions, c as ruleFilterFields, i as RuleFieldDefinition, n as RuleField, o as defineRuleFields, r as RuleFieldCatalog, s as ruleFilterFieldInfo, t as RULE_LIMITS } from "../../fields-snbaZ14h.js";
@@ -9,7 +9,7 @@ import { n as BlockHooks } from "../../block-hooks-B8itxzEE.js";
9
9
  import { n as StripeSource, r as StripeTaxId, t as StripeClient } from "../../stripe-X22LjuH-.js";
10
10
  import { c as BlockOf } from "../../define-block-DWVZSZv1.js";
11
11
  import { i as EventSink } from "../../cloud-event-0pQ9vFNS.js";
12
- import { n as Controller, t as AuthPort } from "../../controller-TRocodqG.js";
12
+ import { n as Controller, t as AuthPort } from "../../controller-Br9dGKGe.js";
13
13
  import { d as stripeInboxVerify, f as verifyStripeWebhook, u as signStripeWebhook } from "../../verify-41mZmspj.js";
14
14
  //#region src/blocks/billing/events.d.ts
15
15
  /** The events of the `billing` block: type to data. */
@@ -1,7 +1,7 @@
1
1
  import { b as DbError } from "../../result-DZeA5KS6.js";
2
2
  import { Ct as Events, tt as SchedulingEventData } from "../../events-B2qbZps6.js";
3
3
  import { c as BlockOf } from "../../define-block-DWVZSZv1.js";
4
- import { n as Controller } from "../../controller-TRocodqG.js";
4
+ import { n as Controller } from "../../controller-Br9dGKGe.js";
5
5
  import { o as WeeklyHours } from "../../availability-BdeKCHpl.js";
6
6
  import { C as bookingSeriesOf, S as BookingWeekday, T as parseRecurrence, _ as BookedSeries, a as BookingExceptionInput, b as BookingSeriesScope, c as BookingResourceInput, d as BookingStatus, f as Bookings, g as createBookings, h as PublicBookingService, i as BookingDuration, l as BookingServiceInput, m as PlacedBooking, n as Booking, o as BookingExpirePayload, p as BookingsOptions, r as BookingCustomer, s as BookingRange, t as BOOKING_EXPIRE_QUEUE, u as BookingSlot, v as BookingRecurrence, w as formatRecurrence, x as BookingSeriesStatus, y as BookingSeries } from "../../bookings-xsmM2TA_.js";
7
7
  import { t as EventCalendarEvent } from "../../event-calendar-DVLs2wUO.js";
@@ -7,7 +7,7 @@ import { n as Logger } from "../../logger-DWVYUmwi.js";
7
7
  import { t as BlockTransport } from "../../block-transport-9EUA3q_I.js";
8
8
  import { n as BlockHooks } from "../../block-hooks-B8itxzEE.js";
9
9
  import { Sn as EntitySchema, c as BlockOf } from "../../define-block-DWVZSZv1.js";
10
- import { n as Controller } from "../../controller-TRocodqG.js";
10
+ import { n as Controller } from "../../controller-Br9dGKGe.js";
11
11
  import { C as IcsEvent, D as parseIcs, E as ToIcsOptions, O as toIcs, S as CalendarEventStatus, T as ParsedIcs, _ as expandOccurrences, a as FreeBusy, b as AttendeeRole, c as WorkingHoursInput, d as workingHoursOf, f as CalendarEvent, g as SplitRules, h as OccurrenceRange, i as CommonFreeTimeOptions, l as commonFreeTime, m as OccurrenceOptions, n as CalendarEventKind, o as WeeklyHours, p as CalendarOccurrence, r as CalendarTransparency, s as WorkingHours, t as BusyRange, u as freeBusyOf, v as splitRule, w as IcsSource, x as CalendarAttendee, y as AttendeeResponse } from "../../availability-BdeKCHpl.js";
12
12
  import { a as fromEventCalendarUpdate, c as toEventCalendarResources, i as OccurrenceMove, n as EventCalendarOptions, o as seriesOf, r as EventCalendarResource, s as toEventCalendarEvents, t as EventCalendarEvent } from "../../event-calendar-DVLs2wUO.js";
13
13
  import { t as VisibleRange } from "../../range-p5V4rBhZ.js";
@@ -97,6 +97,10 @@ interface CalendarEventInput {
97
97
  /** Only on insert. Default the new id. */
98
98
  readonly uid?: string;
99
99
  }
100
+ interface CalendarOccurrenceRef {
101
+ readonly seriesId: string;
102
+ readonly originalStart: Temporal.Instant;
103
+ }
100
104
  interface SavedCalendarEvent {
101
105
  readonly id: string;
102
106
  readonly uid: string;
@@ -144,7 +148,7 @@ interface Calendar<F extends object = Record<never, never>> {
144
148
  readonly id: string;
145
149
  }>;
146
150
  /** Removes one occurrence of a series (an `EXDATE`), or a single event. */
147
- cancelOccurrence(occurrence: CalendarOccurrence): AsyncResult<boolean>;
151
+ cancelOccurrence(occurrence: CalendarOccurrence | CalendarOccurrenceRef): AsyncResult<boolean>;
148
152
  setAttendee(eventId: string, attendee: CalendarAttendeeInput): AsyncResult<boolean>;
149
153
  removeAttendee(eventId: string, email: string): AsyncResult<boolean>;
150
154
  removeAttendeeById(attendeeId: string): AsyncResult<boolean>;
@@ -235,4 +239,4 @@ export declare const calendarBlock: BlockOf<"calendar", typeof createCalendar, C
235
239
  */
236
240
  export declare const calendarEventInputSchema: EntitySchema<CalendarEventInput>;
237
241
  //#endregion
238
- export { type AttendeeResponse, type AttendeeRole, type BusyRange, type Calendar, type CalendarActions, type CalendarAttendee, type CalendarAttendeeInput, type CalendarAttributes, type CalendarController, type CalendarControllerOptions, type CalendarEvent, type CalendarEventInput, type CalendarEventKind, type CalendarEventStatus, type CalendarEvents, type CalendarGrant, type CalendarGrantRole, type CalendarImport, type CalendarInfo, type CalendarOccurrence, type CalendarOptions, type CalendarSnapshot, type CalendarTransparency, type CalendarVisibility, type CommonFreeTimeOptions, type EventCalendarEvent, type EventCalendarOptions, type EventCalendarResource, type FreeBusy, type IcsEvent, type IcsSource, type OccurrenceMove, type OccurrenceOptions, type OccurrenceRange, type ParsedIcs, type SavedCalendarEvent, type SplitRules, type ToIcsOptions, type WeeklyHours, type WorkingHours, type WorkingHoursInput, commonFreeTime, expandOccurrences, freeBusyOf, fromEventCalendarUpdate, parseIcs, seriesOf, splitRule, toEventCalendarEvents, toEventCalendarResources, toIcs, workingHoursOf };
242
+ export { type AttendeeResponse, type AttendeeRole, type BusyRange, type Calendar, type CalendarActions, type CalendarAttendee, type CalendarAttendeeInput, type CalendarAttributes, type CalendarController, type CalendarControllerOptions, type CalendarEvent, type CalendarEventInput, type CalendarEventKind, type CalendarEventStatus, type CalendarEvents, type CalendarGrant, type CalendarGrantRole, type CalendarImport, type CalendarInfo, type CalendarOccurrence, type CalendarOccurrenceRef, type CalendarOptions, type CalendarSnapshot, type CalendarTransparency, type CalendarVisibility, type CommonFreeTimeOptions, type EventCalendarEvent, type EventCalendarOptions, type EventCalendarResource, type FreeBusy, type IcsEvent, type IcsSource, type OccurrenceMove, type OccurrenceOptions, type OccurrenceRange, type ParsedIcs, type SavedCalendarEvent, type SplitRules, type ToIcsOptions, type WeeklyHours, type WorkingHours, type WorkingHoursInput, commonFreeTime, expandOccurrences, freeBusyOf, fromEventCalendarUpdate, parseIcs, seriesOf, splitRule, toEventCalendarEvents, toEventCalendarResources, toIcs, workingHoursOf };
@@ -2,7 +2,7 @@ import { n as dbError } from "../../errors-BVFgt8BZ.js";
2
2
  import { n as isRecord } from "../../guards-6F2bCtQR.js";
3
3
  import { t as temporal } from "../../temporal-required-DcLhnDhQ.js";
4
4
  import { t as AsyncResult } from "../../result-ntFBW2p2.js";
5
- import { t as calendarSqlOptions } from "../../options-BKBy5wM_.js";
5
+ import { t as calendarSqlOptions } from "../../options-CF6EVF_G.js";
6
6
  import { n as event, t as defineEvents } from "../../event-map-CtPFhcOp.js";
7
7
  import { t as defineController } from "../../controller-BEliOBOv.js";
8
8
  import { A as recordsOf, C as optionalInstant, L as textOf, O as recordOf, j as requiredInstant, o as blockCall, w as optionalText, x as oneOf } from "../../block-helpers-B0f0ZVb5.js";
@@ -954,6 +954,10 @@ function createCalendar(options) {
954
954
  }, (value) => ({ id: textOf(recordOf(value, "split_calendar_event")["id"]) })));
955
955
  },
956
956
  cancelOccurrence: (occurrence) => {
957
+ if ("seriesId" in occurrence) return call("cancel_calendar_occurrence", {
958
+ event_id: occurrence.seriesId,
959
+ original_start: occurrence.originalStart.toString()
960
+ }, (value) => value === true);
957
961
  const series = occurrence.series;
958
962
  if (!occurrence.recurring || series === void 0) return call("delete_calendar_event", { event_id: occurrence.event.id }, (value) => value === true);
959
963
  return call("cancel_calendar_occurrence", {
@@ -7,14 +7,14 @@ import { n as Logger } from "../../logger-DWVYUmwi.js";
7
7
  import { a as BlockTenantOptions, i as CursorPageOptions, r as BlockTemporalOptions } from "../../block-helpers-D5emQ2O6.js";
8
8
  import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-9EUA3q_I.js";
9
9
  import { n as BlockHooks } from "../../block-hooks-B8itxzEE.js";
10
- import { F as CommentsSqlOptions } from "../../authorization-CDU9tYA_.js";
10
+ import { F as CommentsSqlOptions } from "../../authorization-DfEkyFt_.js";
11
11
  import { t as Author } from "../../block-authors-DzXLUiIq.js";
12
12
  import { a as isFileAnchor, i as fileAnchor, n as FileAnchor, o as conversationTopic, r as FileAnchorAt, t as AnchorRegion } from "../../anchors-7F34QyHa.js";
13
13
  import { c as MessageEdit, l as MessageEdition, o as Message } from "../../messaging-DQP09JsY.js";
14
14
  import { Sn as EntitySchema, c as BlockOf, ln as RecordBindingWrite, mn as RecordRowInput, rn as RecordBinding } from "../../define-block-DWVZSZv1.js";
15
- import { p as SubscriptionStatus } from "../../topic-breZqx_4.js";
16
- import { n as TopicPort } from "../../watch-topic-ItO3dz8m.js";
17
- import { n as Controller, t as AuthPort } from "../../controller-TRocodqG.js";
15
+ import { p as SubscriptionStatus } from "../../topic-BaUElNw2.js";
16
+ import { n as TopicPort } from "../../watch-topic-BabDTZ-L.js";
17
+ import { n as Controller, t as AuthPort } from "../../controller-Br9dGKGe.js";
18
18
  //#region src/blocks/comments/comments.d.ts
19
19
  interface CommentsOptions<S extends StandardSchemaV1 | undefined = undefined> extends BlockTemporalOptions, BlockTenantOptions {
20
20
  /**
@@ -73,10 +73,7 @@ function contractPatchArgs(patch) {
73
73
  if (salary === void 0) return argsOf(rest);
74
74
  return {
75
75
  ...argsOf(rest),
76
- ...salary === null ? {
77
- salary: null,
78
- currency: null
79
- } : {
76
+ ...salary === null ? { salary: null } : {
80
77
  salary: amountText(salary),
81
78
  currency: salary.currency
82
79
  }
@@ -4,8 +4,8 @@ import { n as SqlClient } from "../../executor-DXQIx4sW.js";
4
4
  import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-9EUA3q_I.js";
5
5
  import { n as BlockHooks } from "../../block-hooks-B8itxzEE.js";
6
6
  import { c as BlockOf } from "../../define-block-DWVZSZv1.js";
7
- import { n as Controller, t as AuthPort } from "../../controller-TRocodqG.js";
8
- import { i as hasEntitlement, n as EntitlementKey, t as EntitlementClaimOptions } from "../../entitlements-B1i1-wfe.js";
7
+ import { n as Controller, t as AuthPort } from "../../controller-Br9dGKGe.js";
8
+ import { i as hasEntitlement, n as EntitlementKey, t as EntitlementClaimOptions } from "../../entitlements-CBjm2lvD.js";
9
9
  //#region src/blocks/entitlements/entitlements.d.ts
10
10
  /** The Stripe event sent when a customer's active entitlements change. */
11
11
  export declare const ENTITLEMENTS_UPDATED = "entitlements.active_entitlement_summary.updated";
@@ -8,7 +8,7 @@ import { r as BlockTemporalOptions } from "../../block-helpers-D5emQ2O6.js";
8
8
  import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-9EUA3q_I.js";
9
9
  import { n as BlockHooks } from "../../block-hooks-B8itxzEE.js";
10
10
  import { c as BlockOf } from "../../define-block-DWVZSZv1.js";
11
- import { n as Controller } from "../../controller-TRocodqG.js";
11
+ import { n as Controller } from "../../controller-Br9dGKGe.js";
12
12
  import { _ as isFormDefinition, a as FormDefinition, c as FormJson, d as FormScoring, f as FormStep, g as formSchema, h as formDefinitionProblems, i as FormCondition, l as FormJsonSchema, m as UNSCORED_FIELD_TYPES, n as FORM_FIELD_TYPES, o as FormField, p as NPS_MAX, r as FORM_SCHEMA_DIALECT, s as FormFieldType, t as FORM_DEFINITION_SCHEMA, u as FormOption } from "../../form-definition-BjEtH8BT.js";
13
13
  import { StandardSchemaV1 } from "@standard-schema/spec";
14
14
  //#region src/blocks/forms/validate.d.ts
@@ -2,10 +2,10 @@ import { Ct as Events, H as InboxEventData } from "../../events-B2qbZps6.js";
2
2
  import { a as dbTransport, i as RpcClient, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-9EUA3q_I.js";
3
3
  import { d as MessageKind, p as MessageReaction, u as MessageFile } from "../../messaging-DQP09JsY.js";
4
4
  import { Zt as DefaultAutomation, c as BlockOf } from "../../define-block-DWVZSZv1.js";
5
- import { p as SubscriptionStatus } from "../../topic-breZqx_4.js";
6
- import { n as TopicPort } from "../../watch-topic-ItO3dz8m.js";
7
- import { l as StoragePort } from "../../ports-hpbyMySO.js";
8
- import { n as Controller, t as AuthPort } from "../../controller-TRocodqG.js";
5
+ import { p as SubscriptionStatus } from "../../topic-BaUElNw2.js";
6
+ import { n as TopicPort } from "../../watch-topic-BabDTZ-L.js";
7
+ import { l as StoragePort } from "../../ports-DOrPTJzl.js";
8
+ import { n as Controller, t as AuthPort } from "../../controller-Br9dGKGe.js";
9
9
  import { S as StoredInboundEvent, _ as MessageDirection, a as ConversationEvent, b as PurgedContact, c as DeliveryStatus, d as InboxCounts, f as InboxFileSource, g as MessageDelivery, h as InboxUpload, i as Conversation, l as InboundResult, m as InboxRow, n as BotMode, o as ConversationPriority, p as InboxMessage, r as Contact, s as ConversationStatus, t as AuthorType, u as InboxChannel, v as MessageTemplate, x as ScheduledInboxMessage, y as PendingInboxFile } from "../../types-B-D6fYx2.js";
10
10
  import { a as Inbox, c as InboxPatch, d as StartConversationInput, f as TemplateInput, i as InboundInput, l as MessageInput, n as ConversationFilter, o as InboxHooks, p as createInbox, r as CreateInboxInput, s as InboxOptions, t as ContactInput, u as ScheduledMessageInput } from "../../inbox-c8B86Trp.js";
11
11
  //#region src/blocks/inbox/rows.d.ts
@@ -12,7 +12,7 @@ import { a as OptionInput, c as OptionSpecs, d as optionsJsonSchema, i as Option
12
12
  import { A as CreateBlocksOptions, An as BlockNaming, C as BlockContext, Cn as EntitySchemaSpec, D as Blocks, Dn as GeneratedBlocks, E as BlockSinks, En as GeneratedBlock, F as BlockPorts, Fn as entityNames, I as Notifier, L as NotifierInput, M as createBlockClient, Mn as EntityNames, N as createBlocks, Nn as EntityNoun, O as BlocksEventMap, On as fillTopic, P as defineBlocks, Pn as EntityRename, R as PortName, S as BlockClientSource, Sn as EntitySchema, T as BlockSet, Tn as entitySchema, _ as BlockProvider, a as BlockConsumes, b as BLOCK_EVENT_SOURCE, bn as BlockSchemas, c as BlockOf, d as ClientOf, f as ConsumedPorts, g as BlockEnvKey, h as defineBlock, i as BlockCategory, j as UniquePort, jn as blockNames, k as BlocksHooks, kn as generatedOptions, l as BlockOptionSchemas, m as UsingOptions, n as BLOCK_CATEGORIES, o as BlockDefinition, p as ProvidedPorts, r as Block, s as BlockInvalidates, t as AnyBlock, tn as AnyRecordBinding, u as BlockProvides, v as BlockWiring, w as BlockMap, wn as EntitySchemas, x as BlockClientOptions, xn as EntityFieldSpecs, y as BlockWorker } from "../define-block-DWVZSZv1.js";
13
13
  import { t as VisibleRange } from "../range-p5V4rBhZ.js";
14
14
  import { t as subjectKey } from "../block-subjects-C1_9DkSA.js";
15
- import { t as BlockEnv } from "../block-env-B8wG3xeh.js";
15
+ import { t as BlockEnv } from "../block-env-Dz7Caxk0.js";
16
16
  //#region src/blocks/block-env-options.d.ts
17
17
  /** What a hook passes a block creator from the env. */
18
18
  interface EnvBlockOptions {
@@ -4,14 +4,14 @@ import { Ct as Events } from "../../events-B2qbZps6.js";
4
4
  import { _ as ConversationEventData, k as MessageEventData } from "../../index-B4wttiLh.js";
5
5
  import { a as dbTransport, i as RpcClient, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-9EUA3q_I.js";
6
6
  import { a as BlockTransportMiddleware, d as extendBlock, f as withBlockHooks, n as BlockHooks, p as wrapTransport } from "../../block-hooks-B8itxzEE.js";
7
- import { P as MessagingSqlOptions } from "../../authorization-CDU9tYA_.js";
7
+ import { P as MessagingSqlOptions } from "../../authorization-DfEkyFt_.js";
8
8
  import { a as isFileAnchor, i as fileAnchor, n as FileAnchor, o as conversationTopic, r as FileAnchorAt, t as AnchorRegion } from "../../anchors-7F34QyHa.js";
9
9
  import { _ as NotifyLevel, a as FollowTarget, b as UnreadCount, c as MessageEdit, d as MessageKind, f as MessageListOptions, g as NewMessage, h as MessagingOptions, i as ConversationSummary, l as MessageEdition, m as Messaging, n as ConversationAccess, o as Message, p as MessageReaction, r as ConversationKind, s as MessageCursor, t as Conversation, u as MessageFile, v as OpenConversation, x as createMessaging, y as RecordMention } from "../../messaging-DQP09JsY.js";
10
10
  import { a as ThreadSummary, i as ThreadSummarizer, n as SummaryMessage, o as ThreadSummaryInput, r as SummaryTarget, s as ThreadSummaryOutput, t as SummarizeOptions } from "../../summaries-8jQTELIX.js";
11
11
  import { Sn as EntitySchema, c as BlockOf } from "../../define-block-DWVZSZv1.js";
12
- import { p as SubscriptionStatus } from "../../topic-breZqx_4.js";
13
- import { n as TopicPort } from "../../watch-topic-ItO3dz8m.js";
14
- import { n as Controller, t as AuthPort } from "../../controller-TRocodqG.js";
12
+ import { p as SubscriptionStatus } from "../../topic-BaUElNw2.js";
13
+ import { n as TopicPort } from "../../watch-topic-BabDTZ-L.js";
14
+ import { n as Controller, t as AuthPort } from "../../controller-Br9dGKGe.js";
15
15
  //#region src/blocks/messaging/mentions.d.ts
16
16
  type MentionScope = "channel" | "here";
17
17
  interface ParsedMentions {
@@ -1,7 +1,7 @@
1
1
  import { b as DbError, f as Result } from "../../result-DZeA5KS6.js";
2
2
  import { t as Aal } from "../../mfa-oIOYTpvc.js";
3
3
  import { r as Block } from "../../define-block-DWVZSZv1.js";
4
- import { n as Controller, t as AuthPort } from "../../controller-TRocodqG.js";
4
+ import { n as Controller, t as AuthPort } from "../../controller-Br9dGKGe.js";
5
5
  import { t as AuthReply } from "../../auth-reply-Dj124sbX.js";
6
6
  //#region src/blocks/mfa/client.d.ts
7
7
  /** A factor as `auth.mfa.listFactors()` returns it. */
@@ -10,9 +10,9 @@ import { t as BlockProblemOptions } from "../../problem-DNwN8iGz.js";
10
10
  import { c as BlockOf } from "../../define-block-DWVZSZv1.js";
11
11
  import { i as EventSink, t as CloudEvent } from "../../cloud-event-0pQ9vFNS.js";
12
12
  import { g as SubscriberPolicy, i as AuthorizationHooks } from "../../authorization-hooks-BWhkMZfH.js";
13
- import { p as SubscriptionStatus } from "../../topic-breZqx_4.js";
14
- import { n as TopicPort } from "../../watch-topic-ItO3dz8m.js";
15
- import { n as Controller, t as AuthPort } from "../../controller-TRocodqG.js";
13
+ import { p as SubscriptionStatus } from "../../topic-BaUElNw2.js";
14
+ import { n as TopicPort } from "../../watch-topic-BabDTZ-L.js";
15
+ import { n as Controller, t as AuthPort } from "../../controller-Br9dGKGe.js";
16
16
  import { n as VerifyOptions } from "../../signatures-Dkx9OE8j.js";
17
17
  import { a as NotificationItem, i as NotificationAction, n as NotificationMessage, o as NotificationSubject, r as NotificationSendResult, s as RenderedText, t as NotificationChannel } from "../../channel-JcMd5lNP.js";
18
18
  import { a as DeliveryTransport, c as UnsubscribeTarget, i as DeliverySendOptions, l as mailHeaders, n as DeliveryMessages, o as EmailMessage, r as DeliveryReceipt, s as MailCategory, t as DeliveryChannel } from "../../delivery-n6lZGuGx.js";
@@ -19,6 +19,7 @@ import { n as blockFields, s as rowFields } from "../../block-fields-BjXgX_5c.js
19
19
  import { n as defineBlock } from "../../define-block-BGqOO8B3.js";
20
20
  import { t as allowedSubscribers } from "../../subscribers-BvZxcd63.js";
21
21
  import { t as mailHeaders } from "../../delivery-Bm0jxmzI.js";
22
+ import { n as emitDeliveryEvent, r as recordedDeliveryEventOf, t as deliveryEventKindOf } from "../../delivery-events-DbL8IHIY.js";
22
23
  //#region src/blocks/notifications/email.ts
23
24
  function defaultCompose(message) {
24
25
  const text = message.text;
@@ -205,41 +206,12 @@ const SUPPRESSION_REASONS = [
205
206
  "complaint",
206
207
  "manual"
207
208
  ];
208
- const DELIVERY_EVENT_KINDS = [
209
- "delivered",
210
- "opened",
211
- "clicked",
212
- "bounced",
213
- "complained",
214
- "delayed"
215
- ];
216
209
  const DELIVERY_STATUSES = [
217
210
  "pending",
218
211
  "sent",
219
212
  "failed",
220
213
  "skipped"
221
214
  ];
222
- const kindOf = (value) => DELIVERY_EVENT_KINDS.find((kind) => kind === value) ?? null;
223
- const recordedOf = (value) => {
224
- if (!isRecord(value)) return null;
225
- const kind = kindOf(value["kind"]);
226
- if (kind === null) return null;
227
- return {
228
- deliveryId: String(value["delivery_id"]),
229
- notificationId: String(value["notification_id"]),
230
- tenant: nullableText(value["tenant"]),
231
- type: String(value["type"]),
232
- channel: String(value["channel"]),
233
- userId: nullableText(value["user_id"]),
234
- subject: {
235
- type: String(value["subject_type"]),
236
- id: String(value["subject_id"])
237
- },
238
- kind,
239
- providerStatus: kindOf(value["provider_status"]),
240
- recorded: value["recorded"] === true
241
- };
242
- };
243
215
  const subjectDeliveryOf = (row) => ({
244
216
  id: String(row["id"]),
245
217
  notificationId: String(row["notification_id"]),
@@ -249,7 +221,7 @@ const subjectDeliveryOf = (row) => ({
249
221
  status: DELIVERY_STATUSES.find((status) => status === row["status"]) ?? "pending",
250
222
  provider: nullableText(row["provider"]),
251
223
  providerMessageId: nullableText(row["provider_message_id"]),
252
- providerStatus: kindOf(row["provider_status"]),
224
+ providerStatus: deliveryEventKindOf(row["provider_status"]),
253
225
  providerStatusAt: nullableInstant(row["provider_status_at"]),
254
226
  templateKey: nullableText(row["template_key"]),
255
227
  error: nullableText(row["error"]),
@@ -257,7 +229,7 @@ const subjectDeliveryOf = (row) => ({
257
229
  createdAt: nullableInstant(row["created_at"]),
258
230
  deliveredAt: nullableInstant(row["delivered_at"]),
259
231
  events: (Array.isArray(row["events"]) ? row["events"] : []).filter(isRecord).flatMap((event) => {
260
- const kind = kindOf(event["kind"]);
232
+ const kind = deliveryEventKindOf(event["kind"]);
261
233
  return kind === null ? [] : [{
262
234
  kind,
263
235
  occurredAt: nullableInstant(event["occurred_at"]),
@@ -769,18 +741,8 @@ function createNotifications(options) {
769
741
  occurred_at: input.occurredAt?.toString() ?? null,
770
742
  detail: input.detail ?? {},
771
743
  suppress: input.suppress ?? null
772
- }, recordedOf).map((recorded) => {
773
- if (recorded?.recorded === true) emit(`notification.${recorded.kind}`, {
774
- notificationId: recorded.notificationId,
775
- organizationId: recorded.tenant,
776
- type: recorded.type,
777
- channel: recorded.channel,
778
- deliveryId: recorded.deliveryId,
779
- provider: input.provider,
780
- providerEventId: input.providerEventId ?? null,
781
- subjectType: recorded.subject.type,
782
- subjectId: recorded.subject.id
783
- }, recorded.tenant);
744
+ }, recordedDeliveryEventOf).map((recorded) => {
745
+ if (recorded !== null) emitDeliveryEvent(emitEvent, recorded, input.provider, input.providerEventId ?? null);
784
746
  return recorded;
785
747
  });
786
748
  },
@@ -5,7 +5,7 @@ import { n as BlockOptions } from "../../block-helpers-D5emQ2O6.js";
5
5
  import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-9EUA3q_I.js";
6
6
  import { n as BlockHooks } from "../../block-hooks-B8itxzEE.js";
7
7
  import { c as BlockOf } from "../../define-block-DWVZSZv1.js";
8
- import { n as Controller, t as AuthPort } from "../../controller-TRocodqG.js";
8
+ import { n as Controller, t as AuthPort } from "../../controller-Br9dGKGe.js";
9
9
  //#region src/blocks/onboarding/onboarding.d.ts
10
10
  type ChecklistScope = "user" | "organization";
11
11
  /** One step. `events` completes it when the outbox records one of those types. */