better-supabase 0.31.0 → 0.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1703) hide show
  1. package/README.md +11 -10
  2. package/codemods/0.32.json +31 -0
  3. package/dist/access-sql-Dao1C0fz.js +383 -0
  4. package/dist/actor-B5b0i1Fs.js +149 -0
  5. package/dist/actor-DseNR02I.d.ts +104 -0
  6. package/dist/adapter-CWzyKepA.js +2260 -0
  7. package/dist/agents-DXiOPB3V.d.ts +115 -0
  8. package/dist/ai-cache-CLiAXCPH.d.ts +80 -0
  9. package/dist/ai-cache-D9D36eh4.js +86 -0
  10. package/dist/ai-chat-DlcBdOhJ.d.ts +532 -0
  11. package/dist/ai-files-DCMVGSds.js +337 -0
  12. package/dist/ai-message-cnroprVB.js +13 -0
  13. package/dist/ai-schedules-Drx2KRTn.d.ts +164 -0
  14. package/dist/ai-sdk/agents/index.d.ts +8 -12
  15. package/dist/ai-sdk/agents/index.js +10 -12
  16. package/dist/ai-sdk/batches/index.d.ts +12 -7
  17. package/dist/ai-sdk/batches/index.js +16 -9
  18. package/dist/ai-sdk/cache/index.d.ts +2 -4
  19. package/dist/ai-sdk/cache/index.js +3 -4
  20. package/dist/ai-sdk/chat/index.d.ts +77 -2
  21. package/dist/ai-sdk/chat/index.js +179 -28
  22. package/dist/ai-sdk/embeddings/index.d.ts +2 -2
  23. package/dist/ai-sdk/embeddings/index.js +1 -1
  24. package/dist/ai-sdk/files/index.d.ts +3 -5
  25. package/dist/ai-sdk/files/index.js +5 -6
  26. package/dist/ai-sdk/index.d.ts +75 -21
  27. package/dist/ai-sdk/index.js +112 -66
  28. package/dist/ai-sdk/mcp/index.d.ts +28 -13
  29. package/dist/ai-sdk/mcp/index.js +56 -17
  30. package/dist/ai-sdk/memory/index.d.ts +3 -5
  31. package/dist/ai-sdk/memory/index.js +3 -4
  32. package/dist/ai-sdk/react/index.d.ts +2 -2
  33. package/dist/ai-sdk/react/index.js +3 -1
  34. package/dist/ai-sdk/react/server.d.ts +7 -4
  35. package/dist/ai-sdk/react/server.js +10 -3
  36. package/dist/ai-sdk/workflow/index.d.ts +12 -13
  37. package/dist/ai-sdk/workflow/index.js +17 -17
  38. package/dist/ai-sdk/workflow/react/index.d.ts +1 -3
  39. package/dist/ai-sdk/workflow/react/index.js +3 -3
  40. package/dist/ai-sdk/workflow/react/server.d.ts +1 -3
  41. package/dist/ai-sdk/workflow/react/server.js +1 -2
  42. package/dist/anchors-sCLvYj-8.d.ts +36 -0
  43. package/dist/api-keys-DbIbkGxx.d.ts +211 -0
  44. package/dist/api-myq2e9t5.d.ts +482 -0
  45. package/dist/api-wwix_K5c.js +691 -0
  46. package/dist/app-tables-IrglDJCs.d.ts +26 -0
  47. package/dist/approvals-DZoGtNFv.d.ts +127 -0
  48. package/dist/approvals-Da4uAANx.js +166 -0
  49. package/dist/assistant-BEbRPjhn.d.ts +209 -0
  50. package/dist/astro/index.d.ts +7 -10
  51. package/dist/astro/index.js +8 -9
  52. package/dist/attachments-BWtUQgsL.js +375 -0
  53. package/dist/attributes-BZNkR2z2.js +51 -0
  54. package/dist/auth-link-BmJsQG4a.js +117 -0
  55. package/dist/auth-link-DRjtI1Ky.d.ts +102 -0
  56. package/dist/auth-module-CqXdm8qD.js +50 -0
  57. package/dist/auth-reply-BMPJQssh.d.ts +9 -0
  58. package/dist/auth-reply-Cnwn3I_q.js +30 -0
  59. package/dist/auth-wFlGgwTZ.js +19 -0
  60. package/dist/authorization-BlmDNI2b.d.ts +3734 -0
  61. package/dist/authorization-hooks-CxwsRnfV.d.ts +219 -0
  62. package/dist/authorizer-BtIPDO-c.js +194 -0
  63. package/dist/automation-acq3iK9y.js +74 -0
  64. package/dist/automations-BfH8GJqv.js +27 -0
  65. package/dist/automations-Bw5cX7oj.js +29 -0
  66. package/dist/automations-CCc5RUw-.js +31 -0
  67. package/dist/automations-Dou1t3lt.js +313 -0
  68. package/dist/availability-CebEOfMN.d.ts +236 -0
  69. package/dist/base64-CVyKHBBw.js +41 -0
  70. package/dist/batch-limit-DqQ3d6op.js +4 -0
  71. package/dist/before-route-Ra3OhI2x.js +29 -0
  72. package/dist/better-result/index.d.ts +4 -6
  73. package/dist/better-result/index.js +2 -3
  74. package/dist/bind-DP-KLgYI.d.ts +102 -0
  75. package/dist/block-authors-C5z3tGVu.d.ts +10 -0
  76. package/dist/block-authors-DCQ4zl8e.js +13 -0
  77. package/dist/block-env-CJ38ZSTP.d.ts +30 -0
  78. package/dist/block-event-listener-DCi7c89M.js +15 -0
  79. package/dist/block-events-Bp6GPIBN.js +82 -0
  80. package/dist/block-fields-Bjcv6_zc.js +139 -0
  81. package/dist/block-fields-Puv5m5D3.d.ts +56 -0
  82. package/dist/block-helpers-I7UzjNEf.js +435 -0
  83. package/dist/block-helpers-disoUWCp.d.ts +56 -0
  84. package/dist/block-hooks-CadxQ9-_.js +129 -0
  85. package/dist/block-hooks-DrA_d1dJ.d.ts +115 -0
  86. package/dist/block-method-DIbWG4Mj.js +20 -0
  87. package/dist/block-method-QSaPsL2P.d.ts +12 -0
  88. package/dist/block-subjects-Br2MQNFn.d.ts +4 -0
  89. package/dist/block-subjects-cRlVtKDO.js +54 -0
  90. package/dist/block-tables-CQTU71zn.d.ts +34 -0
  91. package/dist/block-tenant-Bun03JuO.js +13 -0
  92. package/dist/block-transport-BEtC_Kis.d.ts +67 -0
  93. package/dist/blocks/access-requests/index.d.ts +9 -15
  94. package/dist/blocks/access-requests/index.js +11 -14
  95. package/dist/blocks/activities/index.d.ts +13 -21
  96. package/dist/blocks/activities/index.js +16 -21
  97. package/dist/blocks/agents/index.d.ts +4 -8
  98. package/dist/blocks/agents/index.js +11 -14
  99. package/dist/blocks/ai-cache/index.d.ts +3 -5
  100. package/dist/blocks/ai-cache/index.js +5 -6
  101. package/dist/blocks/ai-chat/index.d.ts +10 -19
  102. package/dist/blocks/ai-chat/index.js +20 -28
  103. package/dist/blocks/ai-files/index.d.ts +5 -9
  104. package/dist/blocks/ai-files/index.js +5 -6
  105. package/dist/blocks/ai-keys/index.d.ts +4 -10
  106. package/dist/blocks/ai-keys/index.js +14 -18
  107. package/dist/blocks/ai-schedules/index.d.ts +3 -5
  108. package/dist/blocks/ai-schedules/index.js +14 -16
  109. package/dist/blocks/announcements/index.d.ts +12 -20
  110. package/dist/blocks/announcements/index.js +12 -16
  111. package/dist/blocks/api-keys/index.d.ts +4 -116
  112. package/dist/blocks/api-keys/index.js +17 -22
  113. package/dist/blocks/approvals/index.d.ts +4 -8
  114. package/dist/blocks/approvals/index.js +7 -173
  115. package/dist/blocks/assets/index.d.ts +9 -17
  116. package/dist/blocks/assets/index.js +13 -17
  117. package/dist/blocks/assignment/index.d.ts +9 -17
  118. package/dist/blocks/assignment/index.js +10 -14
  119. package/dist/blocks/attachments/index.d.ts +6 -18
  120. package/dist/blocks/attachments/index.js +19 -24
  121. package/dist/blocks/audit/index.d.ts +15 -31
  122. package/dist/blocks/audit/index.js +27 -35
  123. package/dist/blocks/automations/index.d.ts +14 -26
  124. package/dist/blocks/automations/index.js +18 -23
  125. package/dist/blocks/billable-time/index.d.ts +9 -19
  126. package/dist/blocks/billable-time/index.js +15 -20
  127. package/dist/blocks/billing/index.d.ts +12 -22
  128. package/dist/blocks/billing/index.js +19 -24
  129. package/dist/blocks/bookings/index.d.ts +8 -18
  130. package/dist/blocks/bookings/index.js +17 -23
  131. package/dist/blocks/bulk/index.d.ts +6 -12
  132. package/dist/blocks/bulk/index.js +10 -13
  133. package/dist/blocks/calendar/index.d.ts +13 -23
  134. package/dist/blocks/calendar/index.js +35 -32
  135. package/dist/blocks/catalog/index.d.ts +12 -20
  136. package/dist/blocks/catalog/index.js +17 -21
  137. package/dist/blocks/channels/index.d.ts +9 -17
  138. package/dist/blocks/channels/index.js +11 -15
  139. package/dist/blocks/collections/index.d.ts +11 -17
  140. package/dist/blocks/collections/index.js +13 -16
  141. package/dist/blocks/comments/index.d.ts +16 -26
  142. package/dist/blocks/comments/index.js +21 -26
  143. package/dist/blocks/compliance/index.d.ts +9 -17
  144. package/dist/blocks/compliance/index.js +13 -17
  145. package/dist/blocks/connectors/index.d.ts +4 -8
  146. package/dist/blocks/connectors/index.js +13 -16
  147. package/dist/blocks/contacts/index.d.ts +10 -18
  148. package/dist/blocks/contacts/index.js +12 -16
  149. package/dist/blocks/content/index.d.ts +8 -16
  150. package/dist/blocks/content/index.js +13 -17
  151. package/dist/blocks/contracts/index.d.ts +11 -21
  152. package/dist/blocks/contracts/index.js +17 -22
  153. package/dist/blocks/courses/index.d.ts +11 -21
  154. package/dist/blocks/courses/index.js +17 -22
  155. package/dist/blocks/created-by/index.d.ts +3 -7
  156. package/dist/blocks/created-by/index.js +4 -5
  157. package/dist/blocks/custom-fields/index.d.ts +10 -16
  158. package/dist/blocks/custom-fields/index.js +13 -16
  159. package/dist/blocks/data-lifecycle/index.d.ts +10 -26
  160. package/dist/blocks/data-lifecycle/index.js +17 -23
  161. package/dist/blocks/deals/index.d.ts +12 -20
  162. package/dist/blocks/deals/index.js +18 -22
  163. package/dist/blocks/dispatch/index.d.ts +11 -23
  164. package/dist/blocks/dispatch/index.js +19 -24
  165. package/dist/blocks/documents/index.d.ts +4 -8
  166. package/dist/blocks/documents/index.js +9 -12
  167. package/dist/blocks/domains/index.d.ts +8 -14
  168. package/dist/blocks/domains/index.js +12 -15
  169. package/dist/blocks/donations/index.d.ts +13 -23
  170. package/dist/blocks/donations/index.js +21 -26
  171. package/dist/blocks/drive/index.d.ts +116 -20
  172. package/dist/blocks/drive/index.js +138 -26
  173. package/dist/blocks/employees/index.d.ts +13 -23
  174. package/dist/blocks/employees/index.js +18 -23
  175. package/dist/blocks/enrichment/index.d.ts +8 -16
  176. package/dist/blocks/enrichment/index.js +11 -15
  177. package/dist/blocks/enrollments/index.d.ts +9 -17
  178. package/dist/blocks/enrollments/index.js +13 -17
  179. package/dist/blocks/entitlements/index.d.ts +8 -14
  180. package/dist/blocks/entitlements/index.js +8 -32
  181. package/dist/blocks/expenses/index.d.ts +22 -19
  182. package/dist/blocks/expenses/index.js +25 -23
  183. package/dist/blocks/field-history/index.d.ts +6 -10
  184. package/dist/blocks/field-history/index.js +5 -7
  185. package/dist/blocks/flags/index.d.ts +49 -20
  186. package/dist/blocks/flags/index.js +65 -19
  187. package/dist/blocks/forecasts/index.d.ts +10 -16
  188. package/dist/blocks/forecasts/index.js +11 -14
  189. package/dist/blocks/forms/index.d.ts +11 -25
  190. package/dist/blocks/forms/index.js +17 -24
  191. package/dist/blocks/goals/index.d.ts +8 -12
  192. package/dist/blocks/goals/index.js +9 -11
  193. package/dist/blocks/guests/index.d.ts +9 -19
  194. package/dist/blocks/guests/index.js +14 -19
  195. package/dist/blocks/hiring/index.d.ts +10 -18
  196. package/dist/blocks/hiring/index.js +12 -15
  197. package/dist/blocks/identities/index.d.ts +7 -11
  198. package/dist/blocks/identities/index.js +7 -9
  199. package/dist/blocks/imports/index.d.ts +8 -18
  200. package/dist/blocks/imports/index.js +11 -16
  201. package/dist/blocks/inbox/index.d.ts +11 -21
  202. package/dist/blocks/inbox/index.js +26 -23
  203. package/dist/blocks/incidents/index.d.ts +9 -17
  204. package/dist/blocks/incidents/index.js +14 -18
  205. package/dist/blocks/index.d.ts +14 -20
  206. package/dist/blocks/index.js +17 -20
  207. package/dist/blocks/inventory/index.d.ts +11 -17
  208. package/dist/blocks/inventory/index.js +12 -15
  209. package/dist/blocks/invoices/index.d.ts +34 -21
  210. package/dist/blocks/invoices/index.js +31 -18
  211. package/dist/blocks/knowledge/index.d.ts +3 -5
  212. package/dist/blocks/knowledge/index.js +5 -6
  213. package/dist/blocks/lead-scoring/index.d.ts +10 -14
  214. package/dist/blocks/lead-scoring/index.js +11 -13
  215. package/dist/blocks/leases/index.d.ts +11 -21
  216. package/dist/blocks/leases/index.js +20 -25
  217. package/dist/blocks/leave/index.d.ts +50 -17
  218. package/dist/blocks/leave/index.js +35 -14
  219. package/dist/blocks/ledger/index.d.ts +9 -17
  220. package/dist/blocks/ledger/index.js +13 -17
  221. package/dist/blocks/mail-sync/index.d.ts +6 -12
  222. package/dist/blocks/mail-sync/index.js +26 -25
  223. package/dist/blocks/memberships/index.d.ts +5 -9
  224. package/dist/blocks/memberships/index.js +4 -5
  225. package/dist/blocks/memory/index.d.ts +4 -8
  226. package/dist/blocks/memory/index.js +12 -15
  227. package/dist/blocks/messaging/index.d.ts +14 -24
  228. package/dist/blocks/messaging/index.js +19 -24
  229. package/dist/blocks/metrics/index.d.ts +9 -17
  230. package/dist/blocks/metrics/index.js +14 -18
  231. package/dist/blocks/mfa/index.d.ts +5 -9
  232. package/dist/blocks/mfa/index.js +7 -9
  233. package/dist/blocks/moderation/index.d.ts +9 -17
  234. package/dist/blocks/moderation/index.js +13 -17
  235. package/dist/blocks/notifications/index.d.ts +18 -34
  236. package/dist/blocks/notifications/index.js +32 -42
  237. package/dist/blocks/numbering/index.d.ts +6 -12
  238. package/dist/blocks/numbering/index.js +8 -11
  239. package/dist/blocks/oauth-server/index.d.ts +7 -13
  240. package/dist/blocks/oauth-server/index.js +12 -15
  241. package/dist/blocks/onboarding/index.d.ts +7 -13
  242. package/dist/blocks/onboarding/index.js +8 -11
  243. package/dist/blocks/orders/index.d.ts +17 -29
  244. package/dist/blocks/orders/index.js +22 -28
  245. package/dist/blocks/organizations/index.d.ts +11 -21
  246. package/dist/blocks/organizations/index.js +16 -19
  247. package/dist/blocks/outbox/index.d.ts +4 -6
  248. package/dist/blocks/outbox/index.js +11 -13
  249. package/dist/blocks/passes/index.d.ts +12 -22
  250. package/dist/blocks/passes/index.js +20 -25
  251. package/dist/blocks/permissions/index.d.ts +50 -15
  252. package/dist/blocks/permissions/index.js +99 -19
  253. package/dist/blocks/pipelines/index.d.ts +12 -18
  254. package/dist/blocks/pipelines/index.js +12 -15
  255. package/dist/blocks/posts/index.d.ts +10 -18
  256. package/dist/blocks/posts/index.js +15 -19
  257. package/dist/blocks/profiles/index.d.ts +8 -12
  258. package/dist/blocks/profiles/index.js +9 -11
  259. package/dist/blocks/promotions/index.d.ts +11 -17
  260. package/dist/blocks/promotions/index.js +13 -16
  261. package/dist/blocks/push/index.d.ts +12 -18
  262. package/dist/blocks/push/index.js +13 -16
  263. package/dist/blocks/queue/index.d.ts +187 -39
  264. package/dist/blocks/queue/index.js +226 -60
  265. package/dist/blocks/quotes/index.d.ts +13 -21
  266. package/dist/blocks/quotes/index.js +14 -17
  267. package/dist/blocks/rank/index.d.ts +7 -13
  268. package/dist/blocks/rank/index.js +8 -10
  269. package/dist/blocks/reactions/index.d.ts +11 -19
  270. package/dist/blocks/reactions/index.js +13 -17
  271. package/dist/blocks/relations/index.d.ts +11 -21
  272. package/dist/blocks/relations/index.js +18 -23
  273. package/dist/blocks/reminders/index.d.ts +12 -22
  274. package/dist/blocks/reminders/index.js +21 -25
  275. package/dist/blocks/reviews/index.d.ts +9 -15
  276. package/dist/blocks/reviews/index.js +11 -14
  277. package/dist/blocks/saved-views/index.d.ts +11 -21
  278. package/dist/blocks/saved-views/index.js +16 -21
  279. package/dist/blocks/scores/index.d.ts +6 -12
  280. package/dist/blocks/scores/index.js +10 -13
  281. package/dist/blocks/search/index.d.ts +9 -19
  282. package/dist/blocks/search/index.js +15 -19
  283. package/dist/blocks/security-events/index.d.ts +10 -24
  284. package/dist/blocks/security-events/index.js +17 -23
  285. package/dist/blocks/segments/index.d.ts +10 -18
  286. package/dist/blocks/segments/index.js +11 -15
  287. package/dist/blocks/sequences/index.d.ts +9 -17
  288. package/dist/blocks/sequences/index.js +15 -19
  289. package/dist/blocks/service-accounts/index.d.ts +9 -15
  290. package/dist/blocks/service-accounts/index.js +11 -14
  291. package/dist/blocks/sessions/index.d.ts +4 -8
  292. package/dist/blocks/sessions/index.js +9 -11
  293. package/dist/blocks/settings/index.d.ts +8 -16
  294. package/dist/blocks/settings/index.js +14 -18
  295. package/dist/blocks/share-links/index.d.ts +9 -17
  296. package/dist/blocks/share-links/index.js +16 -20
  297. package/dist/blocks/shipments/index.d.ts +14 -24
  298. package/dist/blocks/shipments/index.js +25 -31
  299. package/dist/blocks/signatures/index.d.ts +10 -16
  300. package/dist/blocks/signatures/index.js +10 -13
  301. package/dist/blocks/signing-keys/index.d.ts +5 -9
  302. package/dist/blocks/signing-keys/index.js +8 -10
  303. package/dist/blocks/sla/index.d.ts +11 -19
  304. package/dist/blocks/sla/index.js +17 -21
  305. package/dist/blocks/sso/index.d.ts +7 -19
  306. package/dist/blocks/sso/index.js +14 -21
  307. package/dist/blocks/state-machine/index.d.ts +7 -13
  308. package/dist/blocks/state-machine/index.js +9 -12
  309. package/dist/blocks/subjects/index.d.ts +7 -11
  310. package/dist/blocks/subjects/index.js +12 -14
  311. package/dist/blocks/tags/index.d.ts +11 -21
  312. package/dist/blocks/tags/index.js +20 -25
  313. package/dist/blocks/tasks/index.d.ts +13 -27
  314. package/dist/blocks/tasks/index.js +22 -29
  315. package/dist/blocks/teams/index.d.ts +8 -14
  316. package/dist/blocks/teams/index.js +10 -13
  317. package/dist/blocks/templates/index.d.ts +12 -22
  318. package/dist/blocks/templates/index.js +16 -21
  319. package/dist/blocks/time-tracking/index.d.ts +31 -25
  320. package/dist/blocks/time-tracking/index.js +29 -29
  321. package/dist/blocks/timeline/index.d.ts +10 -14
  322. package/dist/blocks/timeline/index.js +11 -13
  323. package/dist/blocks/trash/index.d.ts +10 -18
  324. package/dist/blocks/trash/index.js +11 -14
  325. package/dist/blocks/undo/index.d.ts +4 -8
  326. package/dist/blocks/undo/index.js +6 -8
  327. package/dist/blocks/updated-at/index.d.ts +3 -7
  328. package/dist/blocks/updated-at/index.js +4 -5
  329. package/dist/blocks/usage/index.d.ts +6 -10
  330. package/dist/blocks/usage/index.js +10 -13
  331. package/dist/blocks/vercel-marketplace/index.d.ts +9 -17
  332. package/dist/blocks/vercel-marketplace/index.js +17 -21
  333. package/dist/blocks/versions/index.d.ts +10 -20
  334. package/dist/blocks/versions/index.js +17 -22
  335. package/dist/blocks/waitlist/index.d.ts +10 -16
  336. package/dist/blocks/waitlist/index.js +11 -14
  337. package/dist/blocks/webhooks/index.d.ts +16 -34
  338. package/dist/blocks/webhooks/index.js +33 -44
  339. package/dist/blocks/workflow-editor/index.d.ts +13 -21
  340. package/dist/blocks/workflow-editor/index.js +22 -27
  341. package/dist/blocks/workflows/index.d.ts +8 -14
  342. package/dist/blocks/workflows/index.js +14 -18
  343. package/dist/bookings-Br0VXzaf.d.ts +285 -0
  344. package/dist/bucket-DvG66r5G.d.ts +693 -0
  345. package/dist/build-Ckxct2EX.js +2065 -0
  346. package/dist/build-D1-V9dd8.js +732 -0
  347. package/dist/carrier-D2b_028L.d.ts +165 -0
  348. package/dist/casing-DQzG9ANZ.js +15 -0
  349. package/dist/channel-B_kufDZy.d.ts +101 -0
  350. package/dist/channels-BxeTTtCY.js +113 -0
  351. package/dist/chat-sdk/index.d.ts +174 -41
  352. package/dist/chat-sdk/index.js +425 -83
  353. package/dist/claim-names-BKig1LOk.js +24 -0
  354. package/dist/claims/index.d.ts +8 -0
  355. package/dist/claims/index.js +8 -0
  356. package/dist/claims-CqTr_N1n.js +98 -0
  357. package/dist/claims-DouHL7ZL.js +62 -0
  358. package/dist/cli/_format-Ba0DoWjl.js +99 -0
  359. package/dist/cli/add-BDLLVLI8.js +99 -0
  360. package/dist/cli/add-BaOCKKt6.js +1 -0
  361. package/dist/cli/add-D2pKTbPw.js +1222 -0
  362. package/dist/cli/agent-59XWXsRi.js +184 -0
  363. package/dist/cli/app-table-files-CimWi_eh.js +343 -0
  364. package/dist/cli/arazzo-1.0-D3OaSeZw.js +531 -0
  365. package/dist/cli/arazzo-1.1-DaT2KAkP.js +704 -0
  366. package/dist/cli/args-_ZVgRBkx.js +26 -0
  367. package/dist/cli/asyncapi-3.0.0-Ca-UwtUW.js +5592 -0
  368. package/dist/cli/asyncapi-3.1.0-DUxf5zNu.js +5832 -0
  369. package/dist/cli/authorization-DJkkOjjG.js +230 -0
  370. package/dist/cli/backfill-B1xAsdL4.js +292 -0
  371. package/dist/cli/bin.js +5 -5
  372. package/dist/cli/blocks-DtZtn-R4.js +1 -0
  373. package/dist/cli/blocks-rBeis04I.js +155 -0
  374. package/dist/cli/cache-CvBRwv02.js +643 -0
  375. package/dist/cli/codemod-DYbVbJ-e.js +2884 -0
  376. package/dist/cli/codemod-block-renames-Dt3X1Wvg.js +238 -0
  377. package/dist/cli/command-BpZ4AuhR.js +1021 -0
  378. package/dist/cli/compare-yl4sSwVn.js +8 -0
  379. package/dist/cli/completion-B08Q0xB3.js +29 -0
  380. package/dist/cli/completion-CwL7e93t.js +210 -0
  381. package/dist/cli/completion-DHTT6rjI.js +1 -0
  382. package/dist/cli/config-CrwCec-B.js +1 -0
  383. package/dist/cli/config-D-Upz3jV.js +46 -0
  384. package/dist/cli/config-DrrkMihk.js +2030 -0
  385. package/dist/cli/config-edit-C6sQ1MqT.js +619 -0
  386. package/dist/cli/config-group-D4JWh4kG.js +388 -0
  387. package/dist/cli/content-mapper-DrhtDsAm.js +181 -0
  388. package/dist/cli/db-B8zfxjl2.js +77 -0
  389. package/dist/cli/db-Diy1OebO.js +246 -0
  390. package/dist/cli/detect-BcUDaO8I.js +83 -0
  391. package/dist/cli/dist-CYnD1kyT.js +128 -0
  392. package/dist/cli/dist-MKwjiW2w.js +1114 -0
  393. package/dist/cli/doctor-Dn4TzGmw.js +4687 -0
  394. package/dist/cli/env-BAJn6wCA.js +142 -0
  395. package/dist/cli/env-BCuUsWOh.js +1109 -0
  396. package/dist/cli/env-D70ihdbB.js +1 -0
  397. package/dist/cli/env-UN6PJFX6.js +1 -0
  398. package/dist/cli/errors-DcJ_PayO.js +97 -0
  399. package/dist/cli/exec-CXBufciC.js +461 -0
  400. package/dist/cli/fastest-levenshtein-B_QF6At5.js +119 -0
  401. package/dist/cli/files-DQayErI8.js +999 -0
  402. package/dist/cli/fresh-import-CdO2oQaQ.js +39 -0
  403. package/dist/cli/gen-BbeS0KgF.js +390 -0
  404. package/dist/cli/guards-DxwRG0Uv.js +7 -0
  405. package/dist/cli/in-stack-diff-huI7fGMX.js +185 -0
  406. package/dist/cli/index.d.ts +1 -53
  407. package/dist/cli/index.js +10 -11
  408. package/dist/cli/init-C30xdMSs.js +556 -0
  409. package/dist/cli/io-CQzy8PEZ.js +36 -0
  410. package/dist/cli/json5-DhsZB2va.js +784 -0
  411. package/dist/cli/jsonc-DU9Clnrz.js +1 -0
  412. package/dist/cli/jsonc-u_UiXFxs.js +43 -0
  413. package/dist/cli/keys-CxajkV_7.js +105 -0
  414. package/dist/cli/legacy-prefix-D8Jfku6I.js +153 -0
  415. package/dist/cli/live-Ctc8Qh9Y.js +339 -0
  416. package/dist/cli/mcp-5J0kUOtD.js +240 -0
  417. package/dist/cli/metadata-DxhUNctA.js +149 -0
  418. package/dist/cli/migrate-ockrh3UX.js +45 -0
  419. package/dist/cli/migration-safety-CLrqC0D-.js +925 -0
  420. package/dist/cli/migrations-CZTg2UJM.js +116 -0
  421. package/dist/cli/module-migration-BptQzmj2.js +118 -0
  422. package/dist/cli/moved-BAFPdJz_.js +253 -0
  423. package/dist/cli/ohash-imLR_J5Y.js +276 -0
  424. package/dist/cli/openapi-3.0-BJiTNq_x.js +927 -0
  425. package/dist/cli/openapi-3.1-BcWCoii2.js +869 -0
  426. package/dist/cli/openapi-3.2-MXPkeoTk.js +1030 -0
  427. package/dist/cli/orphans-CPcR85QN.js +27 -0
  428. package/dist/cli/parse-BueItuNJ.js +181 -0
  429. package/dist/cli/powersync-CmsXOuui.js +1 -0
  430. package/dist/cli/powersync-DIvsipKr.js +375 -0
  431. package/dist/cli/preset-BQnjDCSR.js +100 -0
  432. package/dist/cli/print-DdHt8xCc.js +66 -0
  433. package/dist/cli/prompts-D9b6uf21.js +1133 -0
  434. package/dist/cli/providers-k-1cEna6.js +99 -0
  435. package/dist/cli/prune-workflows-Ddv-GfkO.js +153 -0
  436. package/dist/cli/redact--zOGdWzo.js +37 -0
  437. package/dist/cli/remove-DEEQDoc7.js +237 -0
  438. package/dist/cli/render-SjSVz8yK.js +2216 -0
  439. package/dist/cli/rolldown-runtime-DegdyBIC.js +25 -0
  440. package/dist/cli/run-DdhIK7-K.js +1451 -0
  441. package/dist/cli/run-Ixt9mEb6.js +703 -0
  442. package/dist/cli/run-dY9uOC3W.js +62 -0
  443. package/dist/cli/seed-BpaqqyO8.js +187 -0
  444. package/dist/cli/seed-ByLneY1H.js +1 -0
  445. package/dist/cli/shared-p6sxli_5.js +150 -0
  446. package/dist/cli/shell-C1U618XA.js +9 -0
  447. package/dist/cli/skills-jZThjL3B.js +120 -0
  448. package/dist/cli/snapshot-Dd_8B9g-.js +728 -0
  449. package/dist/cli/source-BYvVe_Es.js +317 -0
  450. package/dist/cli/source-args-Bz5QQne2.js +58 -0
  451. package/dist/cli/spec-BxQgllJY.js +7449 -0
  452. package/dist/cli/spec-liRzcZTa.js +1 -0
  453. package/dist/cli/sql-layout-DHwiUOaD.js +260 -0
  454. package/dist/cli/stack-147NqctC.js +134 -0
  455. package/dist/cli/stack-env-BQhbUFa7.js +92 -0
  456. package/dist/cli/stack-status-Mxgqb3I4.js +45 -0
  457. package/dist/cli/stacks-C5YL6Un9.js +230 -0
  458. package/dist/cli/style-B5-nByxb.js +34 -0
  459. package/dist/cli/supabase-toml-B6-eEV5p.js +1155 -0
  460. package/dist/cli/sync-CreQWj53.js +318 -0
  461. package/dist/cli/table-D9FbJS8h.js +88 -0
  462. package/dist/cli/toml-VX0BsvYq.js +422 -0
  463. package/dist/cli/topics-Cdg0V7Tt.js +29 -0
  464. package/dist/cli/trace-D3TNqWBg.js +6 -0
  465. package/dist/cli/upgrade-3NQOUO1_.js +270 -0
  466. package/dist/cli/upgrade-U7IKj45h.js +40 -0
  467. package/dist/cli/validate-C_WTnX1U.js +7426 -0
  468. package/dist/cli/version-mBwP-aMG.js +3 -0
  469. package/dist/cli/yaml-JsusTbcC.js +2250 -0
  470. package/dist/client/index.d.ts +7 -7
  471. package/dist/client/index.js +9 -12
  472. package/dist/client/native/index.d.ts +7 -23
  473. package/dist/client/native/index.js +15 -22
  474. package/dist/client-Bky2z09B.js +290 -0
  475. package/dist/clone-H_gCsL29.js +32 -0
  476. package/dist/cloud-event-CLvsaPqH.js +62 -0
  477. package/dist/cloud-event-DXWmXrus.d.ts +62 -0
  478. package/dist/codecs-B1VO2BGL.d.ts +220 -0
  479. package/dist/codecs-B9v5Y5HH.js +357 -0
  480. package/dist/commerce/index.d.ts +5 -13
  481. package/dist/commerce/index.js +13 -16
  482. package/dist/compiler-qlXlokKn.d.ts +12 -0
  483. package/dist/compose-BRBlPSEY.js +52 -0
  484. package/dist/composite-CIxjVcL1.d.ts +79 -0
  485. package/dist/composite-D2JnIiHt.js +125 -0
  486. package/dist/config/index.d.ts +6 -6
  487. package/dist/config/index.js +7 -7
  488. package/dist/config-Bu6pwqcO.js +1102 -0
  489. package/dist/config-MDRA2sre.js +1672 -0
  490. package/dist/connectors-Cf2LeAuZ.d.ts +145 -0
  491. package/dist/context-D7jICqdN.d.ts +4279 -0
  492. package/dist/context-DSevnLrT.js +40 -0
  493. package/dist/contract/index.d.ts +16 -0
  494. package/dist/contract/index.js +0 -0
  495. package/dist/controller-BJmh7gFm.js +78 -0
  496. package/dist/controller-DxtxeYdf.d.ts +50 -0
  497. package/dist/controller-y1kSMuCU.js +72 -0
  498. package/dist/conversion-Bj9j3KnG.js +76 -0
  499. package/dist/conversion-C9rndpEI.d.ts +84 -0
  500. package/dist/cookie-DDkqvqe4.d.ts +3 -0
  501. package/dist/cookie-DJI6xXJ9.js +4 -0
  502. package/dist/cors-9SDsndtb.d.ts +13 -0
  503. package/dist/cors-DrDFLMNn.js +23 -0
  504. package/dist/create/index.d.ts +4 -28
  505. package/dist/create/index.js +9 -15
  506. package/dist/create/lite/index.d.ts +5 -25
  507. package/dist/create/lite/index.js +14 -24
  508. package/dist/create/oauth/index.d.ts +1 -1
  509. package/dist/create/oauth/index.js +1 -2
  510. package/dist/create/supabase/index.d.ts +2 -4
  511. package/dist/create/supabase/index.js +3 -6
  512. package/dist/create-blocks-D7q1boXV.js +367 -0
  513. package/dist/credentials/index.d.ts +6 -10
  514. package/dist/credentials/index.js +11 -12
  515. package/dist/cron-BD8VrQQl.js +147 -0
  516. package/dist/cron-route-DSITg1yC.js +23 -0
  517. package/dist/csv-Bwn9insJ.js +88 -0
  518. package/dist/csv-Dd1iKsk-.d.ts +26 -0
  519. package/dist/data-engine-BbqQwso_.js +174 -0
  520. package/dist/data-engine-CMENsp3d.d.ts +269 -0
  521. package/dist/data-hooks-BToeAcQ_.js +277 -0
  522. package/dist/db-exception-Dv18UZ-I.js +30 -0
  523. package/dist/deal-forecast-CN_BEy9s.d.ts +21 -0
  524. package/dist/deal-forecast-DsVFoMkJ.js +38 -0
  525. package/dist/define-B6D55cO0.js +2073 -0
  526. package/dist/define-ITQA71fw.d.ts +1242 -0
  527. package/dist/define-block-22Jv4U_-.js +63 -0
  528. package/dist/define-block-COmMkx2x.d.ts +1669 -0
  529. package/dist/delegation-C2rLpkHO.js +147 -0
  530. package/dist/delivery-CWcbh87x.d.ts +69 -0
  531. package/dist/delivery-SmPHu2_H.js +28 -0
  532. package/dist/delivery-events-0mAEuscm.js +52 -0
  533. package/dist/documents-DeZw83ue.d.ts +150 -0
  534. package/dist/edge/index.d.ts +20 -26
  535. package/dist/edge/index.js +20 -24
  536. package/dist/elysia/index.d.ts +2 -6
  537. package/dist/elysia/index.js +4 -6
  538. package/dist/email-BRm6wMWQ.d.ts +40 -0
  539. package/dist/embeddings--v4BJdUL.js +127 -0
  540. package/dist/embeddings-rVR2AKVz.d.ts +76 -0
  541. package/dist/ended-NC_ZesY4.d.ts +22 -0
  542. package/dist/entitlements-Dydkg-TV.js +47 -0
  543. package/dist/entitlements-sLoj3M6Y.js +44 -0
  544. package/dist/entitlements-w04ivvAy.d.ts +70 -0
  545. package/dist/entity-naming-BES3pkQI.js +130 -0
  546. package/dist/entity-schema-DEIz0I8i.js +38 -0
  547. package/dist/env/index.d.ts +1 -1
  548. package/dist/env/index.js +1 -2
  549. package/dist/envelope-CapD-JtH.js +90 -0
  550. package/dist/errors-B7tCfCvX.js +327 -0
  551. package/dist/errors-BdjHv5SV.js +43 -0
  552. package/dist/errors-D3-4c-XF.js +102 -0
  553. package/dist/escape-like-CK6L7gkj.d.ts +26 -0
  554. package/dist/escape-like-gxNXs145.js +6 -0
  555. package/dist/eve/index.d.ts +247 -16
  556. package/dist/eve/index.js +334 -26
  557. package/dist/eve-DIKjuPp5.d.ts +213 -0
  558. package/dist/event-calendar-DUtFyRrv.d.ts +63 -0
  559. package/dist/event-map-DxfsFgQT.js +18 -0
  560. package/dist/events/index.d.ts +3 -3
  561. package/dist/events/index.js +7 -8
  562. package/dist/events-BRKIxVQD.js +25 -0
  563. package/dist/events-DVt3Z9hw.d.ts +850 -0
  564. package/dist/events-Da482tiF.js +81 -0
  565. package/dist/executor-BDMqPbVU.js +482 -0
  566. package/dist/executor-C0_TT717.js +840 -0
  567. package/dist/executor-CFmee_nV.d.ts +35 -0
  568. package/dist/executor-CHnoKOxk.d.ts +168 -0
  569. package/dist/executor-Dc4Pl44u.js +207 -0
  570. package/dist/executor-DqNRrFxx.d.ts +99 -0
  571. package/dist/expo/index.d.ts +5 -9
  572. package/dist/expo/index.js +10 -12
  573. package/dist/extension-DQ9-oOVC.js +58 -0
  574. package/dist/extension-WdHd5uqI.js +102 -0
  575. package/dist/extension-Z8Pe7fXA.js +120 -0
  576. package/dist/extension-rdpYvpyN.js +52 -0
  577. package/dist/extension-shared-DJb_PfD4.js +59 -0
  578. package/dist/extra-Dz9n5y1s.js +9 -0
  579. package/dist/field-errors-DKCaSlZw.d.ts +208 -0
  580. package/dist/field-formats-Cap-V7UP.js +101 -0
  581. package/dist/field-formats-DVukMbRa.d.ts +36 -0
  582. package/dist/fields-BBcdKD-S.js +107 -0
  583. package/dist/fields-CAVk9dxX.d.ts +76 -0
  584. package/dist/filter-evaluate-Bz3Fzhz2.d.ts +35 -0
  585. package/dist/filter-evaluate-D_LLfdtE.js +216 -0
  586. package/dist/filter-query-DV-x8fio.d.ts +131 -0
  587. package/dist/filter-query-Ds7Z6lgZ.js +565 -0
  588. package/dist/flags-0EXDD3Iz.js +361 -0
  589. package/dist/flags-6emyAXly.d.ts +315 -0
  590. package/dist/flags-sdk/index.d.ts +217 -28
  591. package/dist/flags-sdk/index.js +255 -35
  592. package/dist/form-definition-8cCCt5zj.js +362 -0
  593. package/dist/form-definition-BN8shngm.d.ts +117 -0
  594. package/dist/format-BT0Z3V54.d.ts +77 -0
  595. package/dist/framework-BFlaPuvv.d.ts +46 -0
  596. package/dist/framework-ChzJYkJW.js +58 -0
  597. package/dist/function-contract-Bf6llTkE.js +7 -0
  598. package/dist/function-contract-DgDBYbXu.d.ts +25 -0
  599. package/dist/gateway-DaekJ_Me.d.ts +120 -0
  600. package/dist/gateway-options-DQGQzdkD.js +26 -0
  601. package/dist/gateway-options-Mut8jih_.d.ts +27 -0
  602. package/dist/guards-CsRa6v57.js +11 -0
  603. package/dist/guest-actions-CEwttioE.js +8 -0
  604. package/dist/guest-actions-DfHHp98H.d.ts +3 -0
  605. package/dist/h3/index.d.ts +2 -6
  606. package/dist/h3/index.js +4 -6
  607. package/dist/h3/v1/index.d.ts +3 -5
  608. package/dist/h3/v1/index.js +4 -5
  609. package/dist/history-6KiVNWdH.js +269 -0
  610. package/dist/hmac-DNcfpmI9.js +22 -0
  611. package/dist/hono/index.d.ts +18 -22
  612. package/dist/hono/index.js +16 -17
  613. package/dist/http-BDC1IvBX.js +27 -0
  614. package/dist/http-BRUI3qim.js +140 -0
  615. package/dist/http-D4lH1xqY.js +39 -0
  616. package/dist/image-url-bsGeybeg.js +83 -0
  617. package/dist/impersonation-BOCJcsmS.d.ts +26 -0
  618. package/dist/impersonation-D-quM36V.js +61 -0
  619. package/dist/inbox-DavCzW7b.d.ts +326 -0
  620. package/dist/index-8w4OB5En.d.ts +102 -0
  621. package/dist/index-BIAtapnD.d.ts +570 -0
  622. package/dist/index-BWR29Vvw.d.ts +76 -0
  623. package/dist/index-BZCmy767.d.ts +234 -0
  624. package/dist/index-BdC2IqkU.d.ts +152 -0
  625. package/dist/index-BgkHbf9C.d.ts +637 -0
  626. package/dist/index-BvcMQYL-.d.ts +326 -0
  627. package/dist/index-CbUXFzQV.d.ts +107 -0
  628. package/dist/index-CiE37wKX.d.ts +289 -0
  629. package/dist/index-D18su_r5.d.ts +402 -0
  630. package/dist/index-DU0UwWvL.d.ts +667 -0
  631. package/dist/index-Dj4VKpYZ.d.ts +49 -0
  632. package/dist/index-Dvpu22CJ.d.ts +291 -0
  633. package/dist/index-IKfbX_39.d.ts +23 -0
  634. package/dist/index-M1izbwbN.d.ts +145 -0
  635. package/dist/index.d.ts +13 -41
  636. package/dist/index.js +29 -34
  637. package/dist/instance-property-BlH7QSDl.js +6 -0
  638. package/dist/instances-D31jrmKh.js +16636 -0
  639. package/dist/invalidate-DAB9CaPm.d.ts +19 -0
  640. package/dist/iso4217-oKsif_hW.js +175 -0
  641. package/dist/json-O5vFw243.js +21 -0
  642. package/dist/json-schema-D9eVL_xi.js +884 -0
  643. package/dist/jwks-cache-IZaiICAV.js +48 -0
  644. package/dist/jws-B8p0ppgh.js +204 -0
  645. package/dist/jws-CxgTsbgG.d.ts +64 -0
  646. package/dist/kit-9pZP5iLU.js +163 -0
  647. package/dist/kit-OgFOW9rX.d.ts +92 -0
  648. package/dist/knowledge-BBC2sfAY.d.ts +215 -0
  649. package/dist/knowledge-DdZzUTQ-.js +299 -0
  650. package/dist/lint/index.d.ts +1 -5
  651. package/dist/lint/index.js +8 -10
  652. package/dist/list/index.d.ts +3 -3
  653. package/dist/list/index.js +3 -3
  654. package/dist/list-query-C7V8kUaD.d.ts +220 -0
  655. package/dist/list-query-D-tgs1eY.js +558 -0
  656. package/dist/live-BVi3q4bX.js +277 -0
  657. package/dist/logger-0LfhvwE4.d.ts +16 -0
  658. package/dist/logger-BkF8ukXV.js +20 -0
  659. package/dist/lookup-upE-e1zw.js +17 -0
  660. package/dist/management-DtX4ic1F.d.ts +55 -0
  661. package/dist/mapper/bin.js +13 -17
  662. package/dist/mcp/index.d.ts +4 -299
  663. package/dist/mcp/index.js +71 -42
  664. package/dist/mcp/sdk/index.d.ts +7 -11
  665. package/dist/mcp/sdk/index.js +12 -14
  666. package/dist/message-Cc4bkdNw.d.ts +97 -0
  667. package/dist/messages-CRk1g6oe.js +512 -0
  668. package/dist/messaging-D5z2TR37.d.ts +295 -0
  669. package/dist/methods-BjfDv4Gy.js +9 -0
  670. package/dist/metric-definition-2KQYeUZ1.d.ts +67 -0
  671. package/dist/metric-definition-D4H6IQT7.js +116 -0
  672. package/dist/mfa-CM5r904M.d.ts +34 -0
  673. package/dist/model-Lxa_mOzB.d.ts +338 -0
  674. package/dist/model-messages-BcrkjsPE.js +205 -0
  675. package/dist/model-messages-CGSUU450.d.ts +32 -0
  676. package/dist/money-BgpAd7d3.d.ts +89 -0
  677. package/dist/money-DH--bbYr.js +196 -0
  678. package/dist/money-codec-SKPm8FPw.js +40 -0
  679. package/dist/my-work-kinds-DNPq3ccL.js +10 -0
  680. package/dist/nestjs/index.d.ts +3 -5
  681. package/dist/nestjs/index.js +5 -6
  682. package/dist/next/client/index.d.ts +1 -5
  683. package/dist/next/client/index.js +2 -4
  684. package/dist/next/image/index.d.ts +1 -3
  685. package/dist/next/image/index.js +2 -3
  686. package/dist/next/index.d.ts +98 -106
  687. package/dist/next/index.js +88 -87
  688. package/dist/node/index.d.ts +3 -3
  689. package/dist/node/index.js +6 -7
  690. package/dist/node-headers-C3FExlg9.js +54 -0
  691. package/dist/node-headers-TnS4T7V_.d.ts +25 -0
  692. package/dist/nuxt/index.d.ts +0 -2
  693. package/dist/nuxt/index.js +1 -2
  694. package/dist/operations-BNFbWv1t.js +28 -0
  695. package/dist/operations-CsCwruKT.d.ts +4 -0
  696. package/dist/optional-peer-5SOYr3lL.js +31 -0
  697. package/dist/options--rohtkkC.js +4 -0
  698. package/dist/options-1iHDmlZ5.js +8 -0
  699. package/dist/options-2QJXZPPS.js +4 -0
  700. package/dist/options-B-JqrC61.d.ts +8 -0
  701. package/dist/options-B3xH2JvJ.js +8 -0
  702. package/dist/options-B4sTqDrt.js +4 -0
  703. package/dist/options-B56njigZ.js +19 -0
  704. package/dist/options-B5A3UmKY.d.ts +17 -0
  705. package/dist/options-B6m9gYRH.d.ts +11 -0
  706. package/dist/options-B7Pl708M.js +8 -0
  707. package/dist/options-B7YrdiUc.js +11 -0
  708. package/dist/options-B8c2_hIB.js +9 -0
  709. package/dist/options-B9w_Y08G.d.ts +6 -0
  710. package/dist/options-BDF60ouf.js +4 -0
  711. package/dist/options-BDMPjyrI.js +4 -0
  712. package/dist/options-BHdHuY5r.js +14 -0
  713. package/dist/options-BLMeCbtT.js +31 -0
  714. package/dist/options-BLQePOPy.d.ts +8 -0
  715. package/dist/options-BLn1PFyu.js +4 -0
  716. package/dist/options-BMO-FnOT.js +7 -0
  717. package/dist/options-BNRvoEkj.js +4 -0
  718. package/dist/options-BPQOiVx2.js +7 -0
  719. package/dist/options-BSTJmfX4.js +10 -0
  720. package/dist/options-BTRH26MJ.js +9 -0
  721. package/dist/options-BTaQszYn.js +9 -0
  722. package/dist/options-BYo7hMHK.js +10 -0
  723. package/dist/options-B_bxCZYM.js +7 -0
  724. package/dist/options-BaBaVWS-.js +10 -0
  725. package/dist/options-BamaRO-q.d.ts +12 -0
  726. package/dist/options-BcBdiPSZ.js +7 -0
  727. package/dist/options-BfY4pyQE.js +23 -0
  728. package/dist/options-BgCS5ODi.js +9 -0
  729. package/dist/options-Bi96Lzuf.js +9 -0
  730. package/dist/options-BjEsSoFp.js +17 -0
  731. package/dist/options-Bkx8vwip.js +4 -0
  732. package/dist/options-BmFSI07A.js +4 -0
  733. package/dist/options-BmwDdKwE.js +7 -0
  734. package/dist/options-Bn3NjXfn.js +7 -0
  735. package/dist/options-BqK4xV67.js +13 -0
  736. package/dist/options-Bs2dC-at.js +11 -0
  737. package/dist/options-BvttpM1M.js +4 -0
  738. package/dist/options-Bwrwb8do.d.ts +10 -0
  739. package/dist/options-BxdqA2Ex.js +19 -0
  740. package/dist/options-BzxR82Tu.js +9 -0
  741. package/dist/options-C-NFS6e3.js +13 -0
  742. package/dist/options-C13-dVMH.js +7 -0
  743. package/dist/options-C1RIyAe1.js +7 -0
  744. package/dist/options-C1kZ3qLd.js +8 -0
  745. package/dist/options-C2RjdunU.js +27 -0
  746. package/dist/options-C4kpi6HE.js +8 -0
  747. package/dist/options-C5MfwOAO.js +8 -0
  748. package/dist/options-C5fKQ3EJ.d.ts +10 -0
  749. package/dist/options-CJR59q8s.js +17 -0
  750. package/dist/options-CJVYQue3.d.ts +10 -0
  751. package/dist/options-CLy7CcMn.js +8 -0
  752. package/dist/options-COfEYic3.js +8 -0
  753. package/dist/options-CRwTY_q2.d.ts +58 -0
  754. package/dist/options-CcW7h8mv.js +9 -0
  755. package/dist/options-Ceu2j1vv.js +7 -0
  756. package/dist/options-CgBKgmI8.js +7 -0
  757. package/dist/options-CgMiQGOF.js +9 -0
  758. package/dist/options-CptvcSmF.js +11 -0
  759. package/dist/options-CsLUAt04.js +8 -0
  760. package/dist/options-CtyjhSGk.js +15 -0
  761. package/dist/options-CuPWezcV.js +7 -0
  762. package/dist/options-CyDOOWlk.js +7 -0
  763. package/dist/options-CyYZvdSy.js +10 -0
  764. package/dist/options-CzIPn0fF.js +4 -0
  765. package/dist/options-CzWjw2HY.js +10 -0
  766. package/dist/options-CztbWdz9.js +4 -0
  767. package/dist/options-D4LuPM8a.js +4 -0
  768. package/dist/options-D4dxMGHF.js +7 -0
  769. package/dist/options-D5a9CHgP.js +7 -0
  770. package/dist/options-D6tpMRvp.d.ts +13 -0
  771. package/dist/options-D848Os4l.js +10 -0
  772. package/dist/options-DCZPW5gR.d.ts +15 -0
  773. package/dist/options-DFSHZFLN.js +4 -0
  774. package/dist/options-DFemc2im.js +9 -0
  775. package/dist/options-DFgHHwzD.js +12 -0
  776. package/dist/options-DNZ9r_Vo.d.ts +8 -0
  777. package/dist/options-DP7NwQPZ.js +4 -0
  778. package/dist/options-DPQaafyc.js +7 -0
  779. package/dist/options-DQkhhBLy.js +4 -0
  780. package/dist/options-DTTz33na.js +9 -0
  781. package/dist/options-DToWdVqW.js +4 -0
  782. package/dist/options-DUNUGuhM.js +4 -0
  783. package/dist/options-DWgpi5ns.js +7 -0
  784. package/dist/options-DeamnVOY.d.ts +12 -0
  785. package/dist/options-Dg7eK-_J.d.ts +8 -0
  786. package/dist/options-DiIlMZpc.js +8 -0
  787. package/dist/options-DjFbIRgV.js +16 -0
  788. package/dist/options-DjtCYRWb.js +4 -0
  789. package/dist/options-Dk6D88Zx.d.ts +6 -0
  790. package/dist/options-DpwRG4tO.js +8 -0
  791. package/dist/options-DvgKdZ2K.js +9 -0
  792. package/dist/options-DwIoRvic.js +4 -0
  793. package/dist/options-GwwLsKf5.js +8 -0
  794. package/dist/options-I1ZHfDP0.d.ts +58 -0
  795. package/dist/options-Itq7QYoW.js +20 -0
  796. package/dist/options-JnPEVbBJ.js +17 -0
  797. package/dist/options-Jwux4JDX.js +7 -0
  798. package/dist/options-Lg76d-cV.js +7 -0
  799. package/dist/options-Lh6uxepF.d.ts +24 -0
  800. package/dist/options-Oki2W_c3.js +4 -0
  801. package/dist/options-PM7IaIFP.js +10 -0
  802. package/dist/options-PTLBl6QT.js +7 -0
  803. package/dist/options-PheFo4JY.js +10 -0
  804. package/dist/options-SlC_jZ7y.js +4 -0
  805. package/dist/options-Sq4bYbf5.js +13 -0
  806. package/dist/options-XiD_Y3oK.js +14 -0
  807. package/dist/options-Z-bd_H1E.js +88 -0
  808. package/dist/options-ax_ssX_m.js +4 -0
  809. package/dist/options-bNB8_nlW.js +23 -0
  810. package/dist/options-eIEk0vqV.js +4 -0
  811. package/dist/options-eLIedotm.js +7 -0
  812. package/dist/options-jg0FMHA5.js +4 -0
  813. package/dist/options-mypVYaqR.js +9 -0
  814. package/dist/options-ompJjxkV.js +4 -0
  815. package/dist/options-pbc4H8_A.js +7 -0
  816. package/dist/options-uUGi0Phf.d.ts +14 -0
  817. package/dist/options-yRwYr4up.js +4 -0
  818. package/dist/options-z2Zhi97E.js +9 -0
  819. package/dist/options-zYV6M0vr.js +8 -0
  820. package/dist/orpc/index.d.ts +13 -19
  821. package/dist/orpc/index.js +20 -23
  822. package/dist/otel/index.d.ts +4 -6
  823. package/dist/otel/index.js +8 -10
  824. package/dist/outbox-7zgh-7nw.d.ts +197 -0
  825. package/dist/payments-B4JchZuJ.js +15 -0
  826. package/dist/payments-BBGSGRQ7.d.ts +112 -0
  827. package/dist/permissions-BDt27oYF.js +48 -0
  828. package/dist/permissions-BP593xxk.d.ts +44 -0
  829. package/dist/permissions-controller-B4uI5IPH.js +33 -0
  830. package/dist/pg-error-D92B6jlF.js +25 -0
  831. package/dist/plugin-Ca2qBiFZ.js +47 -0
  832. package/dist/pool-D-4HyhuW.d.ts +121 -0
  833. package/dist/pool-errors-JrZie6u3.js +26 -0
  834. package/dist/ports-BVLhLUvR.d.ts +87 -0
  835. package/dist/ports-CmEXVqhg.js +150 -0
  836. package/dist/postgres/index.d.ts +5 -11
  837. package/dist/postgres/index.js +7 -9
  838. package/dist/postgrest-DZtM2nIS.d.ts +51 -0
  839. package/dist/postgrest-executor-lf8Mt4J0.js +1064 -0
  840. package/dist/powersync/index.d.ts +7 -25
  841. package/dist/powersync/index.js +14 -24
  842. package/dist/preset/index.d.ts +3 -3
  843. package/dist/preset/index.js +3 -3
  844. package/dist/preset-om2rbdYw.js +1038 -0
  845. package/dist/problem-C0SVHhd3.js +161 -0
  846. package/dist/problem-NGBjN-TO.d.ts +77 -0
  847. package/dist/project-D4ArwcS5.js +1749 -0
  848. package/dist/provider-B6qpleR9.js +56 -0
  849. package/dist/provider-BI0KC4u5.d.ts +142 -0
  850. package/dist/providers-C9sBIBYE.js +62 -0
  851. package/dist/push-token-B0j171on.d.ts +22 -0
  852. package/dist/push-token-CO28k46S.js +15 -0
  853. package/dist/queries-BLrxg_GL.js +238 -0
  854. package/dist/query/index.d.ts +3 -3
  855. package/dist/query/index.js +11 -15
  856. package/dist/range-BN3kpJAE.d.ts +6 -0
  857. package/dist/range-Nrh_qtb_.js +6 -0
  858. package/dist/rank-keys-CEBzd9Xa.js +59 -0
  859. package/dist/rank-result-B_xLQCBV.d.ts +12 -0
  860. package/dist/rank-result-DzaTKKhH.js +17 -0
  861. package/dist/rate-limit-C89Yzwd9.d.ts +48 -0
  862. package/dist/rate-limit-CRhlLFhP.js +380 -0
  863. package/dist/rate-limit-DXJbLVg0.js +48 -0
  864. package/dist/ratelimit-headers-CpB-cDD6.js +61 -0
  865. package/dist/react/index.d.ts +11 -11
  866. package/dist/react/index.js +6 -6
  867. package/dist/react/native/index.d.ts +3 -5
  868. package/dist/react/native/index.js +5 -5
  869. package/dist/react/server.d.ts +13 -15
  870. package/dist/react/server.js +9 -10
  871. package/dist/react/session.d.ts +4 -6
  872. package/dist/react/session.js +2 -3
  873. package/dist/react-COIov1yC.js +1006 -0
  874. package/dist/react-CqOVutZj.js +80 -0
  875. package/dist/react-router/index.d.ts +7 -12
  876. package/dist/react-router/index.js +10 -12
  877. package/dist/read-set-DEDoIHMM.js +198 -0
  878. package/dist/realtime/index.d.ts +7 -7
  879. package/dist/realtime/index.js +6 -7
  880. package/dist/realtime-status-CocmAOPv.js +10 -0
  881. package/dist/realtime-status-D3oUx3o4.d.ts +6 -0
  882. package/dist/record-bindings-jTZw-GVe.js +25 -0
  883. package/dist/record-form-DU2EoVsv.d.ts +80 -0
  884. package/dist/record-type-oQxekQTX.js +219 -0
  885. package/dist/recordings-D69Va7gP.d.ts +117 -0
  886. package/dist/records/index.d.ts +10 -14
  887. package/dist/records/index.js +13 -16
  888. package/dist/refresh-B8t_KE3s.js +142 -0
  889. package/dist/refresh-BtbC2rZe.d.ts +52 -0
  890. package/dist/refusal-5c6UMpUP.js +63 -0
  891. package/dist/refusal-CGi-0Q18.d.ts +30 -0
  892. package/dist/relay-CllqA-lV.js +248 -0
  893. package/dist/resolve--LfVoOMg.d.ts +287 -0
  894. package/dist/resolve-FW8oeXvh.js +927 -0
  895. package/dist/resolved-names-DYYyh35i.js +130 -0
  896. package/dist/resource-BbWk4hoP.js +561 -0
  897. package/dist/resource-DQ4kIBpa.js +104 -0
  898. package/dist/resource-DWllVW8k.d.ts +124 -0
  899. package/dist/resource-execute-DUBYKTYU.d.ts +13 -0
  900. package/dist/resource-schemas-Bq0g2RCQ.js +81 -0
  901. package/dist/resource-types-RgaljPs0.d.ts +155 -0
  902. package/dist/resources-Bki1J4jy.d.ts +5 -0
  903. package/dist/resources-DYSx9NYM.js +63 -0
  904. package/dist/respond-BYOV7KZp.d.ts +108 -0
  905. package/dist/respond-DLH4tD2d.js +106 -0
  906. package/dist/result-8xza7w5W.js +145 -0
  907. package/dist/result-DTOQRyGY.d.ts +347 -0
  908. package/dist/rows-Ce8dsmfM.js +79 -0
  909. package/dist/rows-D-RqIsRz.js +38 -0
  910. package/dist/rrule-BLpe2449.js +289 -0
  911. package/dist/run-keys-BnzqxtYc.d.ts +59 -0
  912. package/dist/run-state-D0Tbl-nM.d.ts +11 -0
  913. package/dist/run-state-DGiyDQxH.js +12 -0
  914. package/dist/run-watch-DJk4Q603.js +52 -0
  915. package/dist/runtime-qslVrC9l.js +43 -0
  916. package/dist/sales-lines-DuNVoKHA.d.ts +36 -0
  917. package/dist/sales-lines-axwWhnLk.js +44 -0
  918. package/dist/sales-shared-CY3s_wBx.js +21 -0
  919. package/dist/sandboxes-B2hBoBvJ.d.ts +85 -0
  920. package/dist/schemas-CpoEiAeT.js +213 -0
  921. package/dist/scope-dD_OAgRU.js +89 -0
  922. package/dist/scores-Bvk_JgXL.js +176 -0
  923. package/dist/scores-FAORS4qU.d.ts +172 -0
  924. package/dist/search-DtbkD0h0.js +8 -0
  925. package/dist/server/index.d.ts +39 -70
  926. package/dist/server/index.js +55 -59
  927. package/dist/server-types-C2hlvhP4.d.ts +521 -0
  928. package/dist/session-B4VasaAA.d.ts +96 -0
  929. package/dist/session-status-D8CBxCqv.d.ts +80 -0
  930. package/dist/shared-Bmcnxwie.js +16 -0
  931. package/dist/shared-Ci1g9nl4.js +90 -0
  932. package/dist/shared-DsBcvj6q.d.ts +9 -0
  933. package/dist/sign-in-BMm1xhKq.js +730 -0
  934. package/dist/sign-in-C9pZE1kM.d.ts +53 -0
  935. package/dist/sign-in-CX1a5i2P.d.ts +52 -0
  936. package/dist/sign-in-CxdoTEp5.js +399 -0
  937. package/dist/signatures-CBn7w4VR.js +144 -0
  938. package/dist/signatures-jPr9JXyw.d.ts +41 -0
  939. package/dist/signers-6ih6i9aq.d.ts +380 -0
  940. package/dist/signing-keys-BC5_hJN5.js +163 -0
  941. package/dist/signing-keys-De09WNJ3.d.ts +117 -0
  942. package/dist/simplify-BzThKn5b.js +82 -0
  943. package/dist/snapshot-BGsJw9xn.d.ts +83 -0
  944. package/dist/snapshot-CVMSyTHH.js +138 -0
  945. package/dist/solid/index.d.ts +12 -22
  946. package/dist/solid/index.js +10 -16
  947. package/dist/solid-start/index.d.ts +6 -9
  948. package/dist/solid-start/index.js +8 -9
  949. package/dist/spec/index.d.ts +6 -48
  950. package/dist/spec/index.js +23 -39
  951. package/dist/spec-6Vr7sc0Z.js +123 -0
  952. package/dist/spec-pins-CuQ2anBw.d.ts +125 -0
  953. package/dist/spec-pins-FKUzgF6K.js +61 -0
  954. package/dist/sql/index.d.ts +6 -5
  955. package/dist/sql/index.js +5 -5
  956. package/dist/sql-C1K5JALb.js +420 -0
  957. package/dist/sql-DiUP7fKX.js +140711 -0
  958. package/dist/sql-type-XWMeZRAl.js +33 -0
  959. package/dist/sqlite/index.d.ts +3 -9
  960. package/dist/sqlite/index.js +5 -8
  961. package/dist/sso-CRnaFJh0.js +216 -0
  962. package/dist/sso-CuzAjsc8.d.ts +159 -0
  963. package/dist/ssr/index.d.ts +5 -5
  964. package/dist/ssr/index.js +3 -3
  965. package/dist/standard-BD2aOUsf.js +24 -0
  966. package/dist/standard-DRX6Ch1j.d.ts +5 -0
  967. package/dist/stats-BTJgRMEp.js +82 -0
  968. package/dist/statuses-BTrQ5H4S.js +27 -0
  969. package/dist/statuses-Bv-0XoYC.js +27 -0
  970. package/dist/storage/index.d.ts +3 -3
  971. package/dist/storage/index.js +27 -40
  972. package/dist/storage-api-COQr77e8.js +9 -0
  973. package/dist/store-CKKzmsWB.js +68 -0
  974. package/dist/store-c7QxUHX-.d.ts +81 -0
  975. package/dist/streams/index.d.ts +3 -7
  976. package/dist/streams/index.js +5 -6
  977. package/dist/streams/redis/index.d.ts +1 -3
  978. package/dist/streams/redis/index.js +6 -7
  979. package/dist/stripe/index.d.ts +1 -3
  980. package/dist/stripe/index.js +3 -4
  981. package/dist/stripe-Bl-sjnl6.d.ts +154 -0
  982. package/dist/stripe-DKRwRWew.js +31 -0
  983. package/dist/subject-readers-BARV5rNp.js +48 -0
  984. package/dist/subject-readers-BlD8tALG.d.ts +19 -0
  985. package/dist/subject-type-BarjdHZV.js +7 -0
  986. package/dist/subjects-BGwLJ3IB.d.ts +148 -0
  987. package/dist/subjects-Bv2dPflD.d.ts +86 -0
  988. package/dist/subscribers-C57054Pc.js +32 -0
  989. package/dist/summaries-CUemsYwV.d.ts +67 -0
  990. package/dist/supabase-mcp-DY32eoax.d.ts +44 -0
  991. package/dist/supabase-mcp-QvebHckf.js +27 -0
  992. package/dist/support-DxYI6sDM.d.ts +351 -0
  993. package/dist/support-view-CvDEgyGY.js +17 -0
  994. package/dist/support-view-DSmCett7.d.ts +15 -0
  995. package/dist/svelte/index.d.ts +11 -21
  996. package/dist/svelte/index.js +9 -15
  997. package/dist/sveltekit/index.d.ts +9 -14
  998. package/dist/sveltekit/index.js +12 -14
  999. package/dist/table-schema-CwXg7oBz.d.ts +77 -0
  1000. package/dist/table-schema-D-ss9ozY.js +291 -0
  1001. package/dist/tables-BSiVuKKx.js +72 -0
  1002. package/dist/tags--k2fbPfO.d.ts +28 -0
  1003. package/dist/tags-CW-KvjdL.js +38 -0
  1004. package/dist/tanstack-db/index.d.ts +4 -8
  1005. package/dist/tanstack-db/index.js +4 -6
  1006. package/dist/tanstack-start/index.d.ts +7 -12
  1007. package/dist/tanstack-start/index.js +8 -10
  1008. package/dist/tax-BD9dN1rx.d.ts +168 -0
  1009. package/dist/tax-BwckP5dv.js +139 -0
  1010. package/dist/tee-CVOMhEX-.js +100 -0
  1011. package/dist/template-CNq9xcfx.js +125 -0
  1012. package/dist/temporal-DKTdGK9i.js +94 -0
  1013. package/dist/temporal-required-w_2u4EDp.js +19 -0
  1014. package/dist/tenant-B3IIq8Eq.d.ts +14 -0
  1015. package/dist/tenant-Beqd7TTq.js +48 -0
  1016. package/dist/tenant-source-46lMuMEn.js +7 -0
  1017. package/dist/testing/index.d.ts +120 -127
  1018. package/dist/testing/index.js +277 -129
  1019. package/dist/timeline-Bq658xsi.d.ts +147 -0
  1020. package/dist/timeline-Bs-FGMIJ.js +49 -0
  1021. package/dist/timing-B6yHayKA.js +94 -0
  1022. package/dist/topic-D2MyBeaI.d.ts +411 -0
  1023. package/dist/topic-k17VvXRj.js +640 -0
  1024. package/dist/transport-CS4cVH4S.js +30 -0
  1025. package/dist/ttl-cache-C5S0L2wx.js +31 -0
  1026. package/dist/types-BBqP9H6w.d.ts +175 -0
  1027. package/dist/types-BFEKRmEK.d.ts +449 -0
  1028. package/dist/types-BkYEUWdz.d.ts +1095 -0
  1029. package/dist/types-C8UyJOPJ.d.ts +247 -0
  1030. package/dist/types-DCoqai8o.d.ts +215 -0
  1031. package/dist/types-Dh2OGEW5.d.ts +648 -0
  1032. package/dist/types-DnrJ_crV.js +28 -0
  1033. package/dist/types-TH3zlMiM.d.ts +192 -0
  1034. package/dist/types-d0JBRTAg.d.ts +660 -0
  1035. package/dist/undo-22ofP6Zp.d.ts +44 -0
  1036. package/dist/undo-Dki6Ujak.js +43 -0
  1037. package/dist/upload-claim-Bo2mpBz4.js +32 -0
  1038. package/dist/usage-CNCT6_3D.d.ts +230 -0
  1039. package/dist/user-change-Ngy8z1fZ.js +133 -0
  1040. package/dist/variants-BaMleC56.js +51 -0
  1041. package/dist/vault-yGQD5Rdl.d.ts +60 -0
  1042. package/dist/vercel-connect/index.d.ts +194 -20
  1043. package/dist/vercel-connect/index.js +265 -33
  1044. package/dist/vercel-sandbox/index.d.ts +166 -0
  1045. package/dist/vercel-sandbox/index.js +171 -0
  1046. package/dist/verify-BQu3eBNW.d.ts +144 -0
  1047. package/dist/verify-DY_j4GPZ.js +129 -0
  1048. package/dist/view-BfEqjZJ_.js +117 -0
  1049. package/dist/view-Cy2XxYp1.d.ts +107 -0
  1050. package/dist/vue/index.d.ts +12 -22
  1051. package/dist/vue/index.js +10 -16
  1052. package/dist/watch-topic-C2KxpeaB.js +56 -0
  1053. package/dist/watch-topic-q6krNw0T.d.ts +29 -0
  1054. package/dist/wire-DIoLA8VL.js +90 -0
  1055. package/dist/wiring-DJBSLdyF.js +12 -0
  1056. package/dist/workflow-sdk/builder/index.d.ts +12 -14
  1057. package/dist/workflow-sdk/builder/index.js +12 -11
  1058. package/dist/workflow-sdk/index.d.ts +62 -6
  1059. package/dist/workflow-sdk/index.js +75 -10
  1060. package/dist/workflow-sdk/world/index.d.ts +13 -20
  1061. package/dist/workflow-sdk/world/index.js +115 -26
  1062. package/dist/workflow-sdk-BL3wzkdp.js +2749 -0
  1063. package/dist/workflow-sdk-q2jnEaAJ.js +302 -0
  1064. package/dist/workflow-sdk-yIkECybp.d.ts +171 -0
  1065. package/dist/workflows-BljkWRxE.d.ts +256 -0
  1066. package/dist/yjs/index.d.ts +3 -5
  1067. package/dist/yjs/index.js +6 -7
  1068. package/package.json +56 -31
  1069. package/schemas/config-v1.json +60 -3
  1070. package/schemas/doctor-report-v1.json +1 -0
  1071. package/schemas/snapshot-v2.json +7 -0
  1072. package/skills/better-supabase/SKILL.md +4 -4
  1073. package/skills/better-supabase/references/block-extensions.md +2 -2
  1074. package/skills/better-supabase/references/troubleshooting.md +1 -1
  1075. package/skills/better-supabase/references/ui-recipes.md +73 -36
  1076. package/skills/better-supabase-api/SKILL.md +1 -1
  1077. package/skills/better-supabase-api/references/adapters.md +3 -3
  1078. package/skills/better-supabase-api/references/ai.md +8 -0
  1079. package/skills/better-supabase-auth/SKILL.md +19 -19
  1080. package/skills/better-supabase-auth/references/authorization-providers.md +1 -1
  1081. package/dist/access-sql-CTDNuxRv.js +0 -385
  1082. package/dist/actor-CoveJgya.d.ts +0 -106
  1083. package/dist/actor-go7p9-CJ.js +0 -150
  1084. package/dist/adapter-BTbj5N9C.js +0 -2251
  1085. package/dist/agents-CM_cCtcr.d.ts +0 -117
  1086. package/dist/ai-cache-BFRKxgZ4.js +0 -87
  1087. package/dist/ai-cache-BTGqckta.d.ts +0 -82
  1088. package/dist/ai-chat-B7_vQvxU.d.ts +0 -619
  1089. package/dist/ai-files-m_2z3rH1.js +0 -339
  1090. package/dist/ai-message-DfaP8sis.js +0 -14
  1091. package/dist/ai-schedules-CZEfo-_M.d.ts +0 -166
  1092. package/dist/anchors-7F34QyHa.d.ts +0 -40
  1093. package/dist/api-3C0AWFeP.js +0 -696
  1094. package/dist/api-59rv5hL6.d.ts +0 -495
  1095. package/dist/api-keys-JE-aykZE.d.ts +0 -213
  1096. package/dist/app-tables-B2mKMNRQ.d.ts +0 -28
  1097. package/dist/approvals-BfEafAzt.d.ts +0 -129
  1098. package/dist/assistant-B49qATbj.d.ts +0 -157
  1099. package/dist/attachments-BXbLnNxm.js +0 -376
  1100. package/dist/attributes-Bzf51_nc.js +0 -47
  1101. package/dist/auth-DyF_LRxd.js +0 -20
  1102. package/dist/auth-link-B4NL84XU.d.ts +0 -104
  1103. package/dist/auth-link-D3-bU6yz.js +0 -118
  1104. package/dist/auth-module-BbmX-N4L.js +0 -52
  1105. package/dist/auth-reply-Dj124sbX.d.ts +0 -11
  1106. package/dist/auth-reply-tlXB2FQ9.js +0 -31
  1107. package/dist/authorization-DfEkyFt_.d.ts +0 -3867
  1108. package/dist/authorization-hooks-BWhkMZfH.d.ts +0 -221
  1109. package/dist/authorizer-B6X09otb.d.ts +0 -118
  1110. package/dist/authorizer-BGhXaDmo.js +0 -172
  1111. package/dist/automation-D41DXyvT.js +0 -75
  1112. package/dist/automations-8L3NEuoq.js +0 -29
  1113. package/dist/automations-BKjJpktQ.js +0 -33
  1114. package/dist/automations-BMuqwZZn.js +0 -314
  1115. package/dist/automations-EzXteupo.js +0 -31
  1116. package/dist/availability-BdeKCHpl.d.ts +0 -236
  1117. package/dist/base64-B9Wlsdj7.js +0 -42
  1118. package/dist/batch-limit-DKVQDz4o.js +0 -5
  1119. package/dist/before-route-B23K2zYU.js +0 -30
  1120. package/dist/bind-DAx0bMSi.d.ts +0 -104
  1121. package/dist/block-authors-Bw3zdzgl.js +0 -14
  1122. package/dist/block-authors-DzXLUiIq.d.ts +0 -12
  1123. package/dist/block-env-Dz7Caxk0.d.ts +0 -32
  1124. package/dist/block-event-listener-Bu6G0TFH.js +0 -16
  1125. package/dist/block-events-IWAyafO3.js +0 -83
  1126. package/dist/block-fields-BE7pInWZ.d.ts +0 -58
  1127. package/dist/block-fields-BjXgX_5c.js +0 -140
  1128. package/dist/block-helpers-B0f0ZVb5.js +0 -437
  1129. package/dist/block-helpers-D5emQ2O6.d.ts +0 -62
  1130. package/dist/block-hooks-B8itxzEE.d.ts +0 -117
  1131. package/dist/block-hooks-DKtz0HRh.js +0 -130
  1132. package/dist/block-method-C9hWdHom.js +0 -21
  1133. package/dist/block-method-CiVa2G-J.d.ts +0 -14
  1134. package/dist/block-subjects-C1_9DkSA.d.ts +0 -6
  1135. package/dist/block-subjects-DFSuFY1a.js +0 -55
  1136. package/dist/block-tenant-DHp7subc.js +0 -14
  1137. package/dist/block-transport-9EUA3q_I.d.ts +0 -69
  1138. package/dist/bookings-xsmM2TA_.d.ts +0 -289
  1139. package/dist/bucket-SvRQwYS4.d.ts +0 -705
  1140. package/dist/build-CH2N3Yf0.js +0 -2073
  1141. package/dist/build-DbIRFcHQ.js +0 -735
  1142. package/dist/carrier-KzeYXVrW.d.ts +0 -169
  1143. package/dist/casing-DdFWEtqr.js +0 -16
  1144. package/dist/channel-JcMd5lNP.d.ts +0 -105
  1145. package/dist/channels-CfcFPuo_.js +0 -114
  1146. package/dist/claims-Bp9My7XP.js +0 -88
  1147. package/dist/claims-DTy6R6my.js +0 -63
  1148. package/dist/cli/_format-Cax5EsM9.js +0 -101
  1149. package/dist/cli/add-B9wP0YGU.js +0 -99
  1150. package/dist/cli/add-DjZXKd7X.js +0 -1231
  1151. package/dist/cli/add-ZcEOEK23.js +0 -1
  1152. package/dist/cli/agent-CbuPvI2x.js +0 -185
  1153. package/dist/cli/app-table-files-mtvjHa48.js +0 -346
  1154. package/dist/cli/arazzo-1.0-BalU61-_.js +0 -532
  1155. package/dist/cli/arazzo-1.1-Bnfasbun.js +0 -705
  1156. package/dist/cli/args-UEwg0l-N.js +0 -27
  1157. package/dist/cli/asyncapi-3.0.0-C78dBjR6.js +0 -5593
  1158. package/dist/cli/asyncapi-3.1.0-g-7aIfV1.js +0 -5833
  1159. package/dist/cli/backfill-Coshdvh_.js +0 -293
  1160. package/dist/cli/blocks-BWCuA0nq.js +0 -156
  1161. package/dist/cli/blocks-hiSazThw.js +0 -1
  1162. package/dist/cli/cache-x2wWAy0h.js +0 -607
  1163. package/dist/cli/codemod-BnjV7BpC.js +0 -2634
  1164. package/dist/cli/codemod-block-renames-BuSaTE_G.js +0 -239
  1165. package/dist/cli/command-CCAwhiOh.js +0 -1003
  1166. package/dist/cli/compare-BmIWVEui.js +0 -9
  1167. package/dist/cli/completion-BJaB84Pe.js +0 -211
  1168. package/dist/cli/completion-BkUhs1ms.js +0 -1
  1169. package/dist/cli/completion-DmUVsUVQ.js +0 -30
  1170. package/dist/cli/config-Cskysxp-.js +0 -2000
  1171. package/dist/cli/config-Df5cXWNN.js +0 -1
  1172. package/dist/cli/config-edit-CrWfk8s3.js +0 -621
  1173. package/dist/cli/config-group-CP-B9uRt.js +0 -390
  1174. package/dist/cli/config-zId1jkLx.js +0 -47
  1175. package/dist/cli/content-mapper-DvOSOdTE.js +0 -182
  1176. package/dist/cli/db-CQCLx7cx.js +0 -78
  1177. package/dist/cli/db-DXKyVEDF.js +0 -247
  1178. package/dist/cli/detect-D9JaAX20.js +0 -84
  1179. package/dist/cli/dist-D_VbPAMR.js +0 -129
  1180. package/dist/cli/dist-DuiMMRbJ.js +0 -1112
  1181. package/dist/cli/doctor-Ywy8oJEU.js +0 -4684
  1182. package/dist/cli/env-BK0xKMeU.js +0 -1113
  1183. package/dist/cli/env-Bat6ogep.js +0 -1
  1184. package/dist/cli/env-CNjT_uOV.js +0 -1
  1185. package/dist/cli/env-XMiKvhtV.js +0 -143
  1186. package/dist/cli/errors-BTe6A15O.js +0 -98
  1187. package/dist/cli/exec-Ca5s-ygi.js +0 -463
  1188. package/dist/cli/fastest-levenshtein-dhRRvrM2.js +0 -120
  1189. package/dist/cli/files-CX71yBm8.js +0 -1010
  1190. package/dist/cli/fresh-import-DzgsGHkX.js +0 -40
  1191. package/dist/cli/gen-B-FbQmG1.js +0 -394
  1192. package/dist/cli/guards-CUlDNYZs.js +0 -8
  1193. package/dist/cli/in-stack-diff-Cp-tVPj2.js +0 -186
  1194. package/dist/cli/init-fb9e1BKX.js +0 -559
  1195. package/dist/cli/io-DH1kcmmP.js +0 -37
  1196. package/dist/cli/json5-ChRycquj.js +0 -787
  1197. package/dist/cli/jsonc-C8M0EhHB.js +0 -1
  1198. package/dist/cli/jsonc-D5Fu67jw.js +0 -45
  1199. package/dist/cli/keys-ORiPz1sM.js +0 -106
  1200. package/dist/cli/legacy-prefix-R7UChFFl.js +0 -154
  1201. package/dist/cli/live-DIt7TP-N.js +0 -341
  1202. package/dist/cli/mcp-CVWwraga.js +0 -241
  1203. package/dist/cli/metadata-CannIjel.js +0 -150
  1204. package/dist/cli/migrate-Ht2TzIQF.js +0 -46
  1205. package/dist/cli/migration-safety-nNyB05I-.js +0 -928
  1206. package/dist/cli/migrations-bAd7dpk1.js +0 -117
  1207. package/dist/cli/module-migration-CkNux8dr.js +0 -119
  1208. package/dist/cli/moved-C3WyRHkA.js +0 -254
  1209. package/dist/cli/ohash-BjQY1cBb.js +0 -277
  1210. package/dist/cli/openapi-3.0-t7xwkuRH.js +0 -928
  1211. package/dist/cli/openapi-3.1-CVze7tBS.js +0 -870
  1212. package/dist/cli/openapi-3.2-CFoMYM01.js +0 -1031
  1213. package/dist/cli/orphans-BAboqyVM.js +0 -28
  1214. package/dist/cli/parse-DjHbTaFI.js +0 -182
  1215. package/dist/cli/powersync-B2v0tDwp.js +0 -377
  1216. package/dist/cli/powersync-D3mAQ6QE.js +0 -1
  1217. package/dist/cli/preset-BwmIfFnh.js +0 -101
  1218. package/dist/cli/print-CxQ0rBKT.js +0 -68
  1219. package/dist/cli/prompts-jqnr94b9.js +0 -1140
  1220. package/dist/cli/providers-DtI90lSw.js +0 -301
  1221. package/dist/cli/redact-KGAk2Ul9.js +0 -38
  1222. package/dist/cli/remove-DYtE4IZ4.js +0 -239
  1223. package/dist/cli/render-QGWfEoiB.js +0 -2225
  1224. package/dist/cli/rolldown-runtime-kJ_i4yPo.js +0 -26
  1225. package/dist/cli/run-B5aMwErM.js +0 -63
  1226. package/dist/cli/run-BNoJKf5I.js +0 -706
  1227. package/dist/cli/run-DiYX1XEa.js +0 -1459
  1228. package/dist/cli/seed-C-Hu2n_E.js +0 -188
  1229. package/dist/cli/seed-Cm-c0BDd.js +0 -1
  1230. package/dist/cli/shared-D_CFi5di.js +0 -151
  1231. package/dist/cli/shell-Btv_4Yhe.js +0 -10
  1232. package/dist/cli/skills-D98y0bSB.js +0 -121
  1233. package/dist/cli/snapshot-BlQ4DDcJ.js +0 -734
  1234. package/dist/cli/source-CelMBQMj.js +0 -320
  1235. package/dist/cli/source-args-v8ljFDfc.js +0 -59
  1236. package/dist/cli/spec-BxcoGE0h.js +0 -1
  1237. package/dist/cli/spec-iBx1LcYO.js +0 -7530
  1238. package/dist/cli/sql-layout-Dp4Rottt.js +0 -261
  1239. package/dist/cli/stack-B2slzrYH.js +0 -135
  1240. package/dist/cli/stack-env-3ziggrU3.js +0 -93
  1241. package/dist/cli/stack-status-BkkYRlXG.js +0 -46
  1242. package/dist/cli/stacks-CiDBH1dB.js +0 -232
  1243. package/dist/cli/style-Bm2X5JrN.js +0 -35
  1244. package/dist/cli/supabase-toml-CncmQbO0.js +0 -1164
  1245. package/dist/cli/sync-BnORI43S.js +0 -322
  1246. package/dist/cli/table-D6HUECKI.js +0 -89
  1247. package/dist/cli/toml-DB-MNnFs.js +0 -424
  1248. package/dist/cli/topics-BpdnYmWb.js +0 -30
  1249. package/dist/cli/trace-VbdO6bcN.js +0 -7
  1250. package/dist/cli/upgrade-CR6-WmIc.js +0 -272
  1251. package/dist/cli/upgrade-fz92aCnh.js +0 -41
  1252. package/dist/cli/validate-B3lF3-jB.js +0 -7522
  1253. package/dist/cli/version-Dz8ZlOuh.js +0 -4
  1254. package/dist/cli/yaml-CYCbJ6et.js +0 -2252
  1255. package/dist/client-C_mlji5R.js +0 -288
  1256. package/dist/clone-CkG0-hlI.js +0 -33
  1257. package/dist/cloud-event-0pQ9vFNS.d.ts +0 -64
  1258. package/dist/cloud-event-XsM53POL.js +0 -63
  1259. package/dist/codecs-CMWlhHZ0.d.ts +0 -222
  1260. package/dist/codecs-CSUFGrdP.js +0 -358
  1261. package/dist/compiler-BEeVWXPS.d.ts +0 -14
  1262. package/dist/compose-DKW0Tr3e.js +0 -53
  1263. package/dist/composite-B4qB6k31.js +0 -130
  1264. package/dist/composite-BJ9s-IJJ.d.ts +0 -83
  1265. package/dist/config-B7g-HDis.js +0 -1111
  1266. package/dist/config-R0m0fBiD.js +0 -1679
  1267. package/dist/connectors-uC5baoFV.d.ts +0 -147
  1268. package/dist/context-DBicfUNz.js +0 -41
  1269. package/dist/context-DWWoP1wK.d.ts +0 -4344
  1270. package/dist/controller-BEliOBOv.js +0 -79
  1271. package/dist/controller-Br9dGKGe.d.ts +0 -52
  1272. package/dist/controller-W97g2WGG.js +0 -73
  1273. package/dist/conversion-Dq1S7xzE.js +0 -77
  1274. package/dist/conversion-g8HzH9My.d.ts +0 -86
  1275. package/dist/cors-h_v7TPxl.js +0 -24
  1276. package/dist/cors-kLq6VM06.d.ts +0 -15
  1277. package/dist/create-blocks-BfrDUSM6.js +0 -370
  1278. package/dist/cron-DdT4ti8a.js +0 -148
  1279. package/dist/cron-route-FjKgRvTY.js +0 -24
  1280. package/dist/csv-2rXGPNtP.js +0 -89
  1281. package/dist/csv-DhHQS2x_.d.ts +0 -28
  1282. package/dist/data-engine-D1BkmBoR.js +0 -173
  1283. package/dist/data-engine-rvbR2C4F.d.ts +0 -273
  1284. package/dist/data-hooks-CdcZfVS1.js +0 -280
  1285. package/dist/db-exception-Lngc1W49.js +0 -31
  1286. package/dist/deal-forecast-CKBnRodz.js +0 -39
  1287. package/dist/deal-forecast-LwO-Z4_C.d.ts +0 -23
  1288. package/dist/define-D-dLADd5.js +0 -2084
  1289. package/dist/define-D8_9X5fZ.d.ts +0 -1263
  1290. package/dist/define-block-BGqOO8B3.js +0 -64
  1291. package/dist/define-block-DWVZSZv1.d.ts +0 -1687
  1292. package/dist/delegation-C7eWP2r8.d.ts +0 -14
  1293. package/dist/delegation-DGOIiT8k.js +0 -153
  1294. package/dist/delivery-Bm0jxmzI.js +0 -29
  1295. package/dist/delivery-events-DbL8IHIY.js +0 -53
  1296. package/dist/delivery-n6lZGuGx.d.ts +0 -71
  1297. package/dist/documents-BbwYyynk.d.ts +0 -152
  1298. package/dist/email-B3YxEzwC.d.ts +0 -42
  1299. package/dist/embeddings-I3s5sTDt.d.ts +0 -78
  1300. package/dist/embeddings-vVzseUw0.js +0 -128
  1301. package/dist/ended-EZzN9QTM.d.ts +0 -26
  1302. package/dist/entitlements-CBjm2lvD.d.ts +0 -54
  1303. package/dist/entitlements-tGL6-69B.js +0 -45
  1304. package/dist/entity-naming-Dtyq5sKE.js +0 -131
  1305. package/dist/entity-schema-B1YmMtP8.js +0 -39
  1306. package/dist/envelope-DEI2iX-d.js +0 -90
  1307. package/dist/errors-BVFgt8BZ.js +0 -328
  1308. package/dist/errors-CyxMxzlu.js +0 -44
  1309. package/dist/escape-like-DHfx6jRr.js +0 -7
  1310. package/dist/escape-like-PReMbEEU.d.ts +0 -30
  1311. package/dist/eve-BfhVFV33.d.ts +0 -157
  1312. package/dist/event-calendar-DVLs2wUO.d.ts +0 -65
  1313. package/dist/event-map-CtPFhcOp.js +0 -19
  1314. package/dist/events-B2qbZps6.d.ts +0 -854
  1315. package/dist/events-D6IZ5CE8.js +0 -82
  1316. package/dist/events-DuLhzjP6.js +0 -26
  1317. package/dist/executor-BfirBzOr.d.ts +0 -174
  1318. package/dist/executor-BlS0kCrN.d.ts +0 -104
  1319. package/dist/executor-C2Ne-Scm.js +0 -208
  1320. package/dist/executor-DXQIx4sW.d.ts +0 -37
  1321. package/dist/executor-DqIci3Jb.js +0 -486
  1322. package/dist/executor-WolvKszH.js +0 -843
  1323. package/dist/extension-DTaHjwdc.js +0 -59
  1324. package/dist/extension-DeAd_MqI.js +0 -121
  1325. package/dist/extension-DzCc0IOd.js +0 -103
  1326. package/dist/extension-mGylYROs.js +0 -53
  1327. package/dist/extension-shared-Djm8mGHD.js +0 -60
  1328. package/dist/extra-CGQ2_q3S.js +0 -10
  1329. package/dist/field-errors-CEjsMAgd.d.ts +0 -216
  1330. package/dist/field-formats-C6QKA3UR.js +0 -102
  1331. package/dist/field-formats-CAFNkKSN.d.ts +0 -38
  1332. package/dist/fields-BBm49w-E.js +0 -108
  1333. package/dist/fields-snbaZ14h.d.ts +0 -78
  1334. package/dist/filter-evaluate-BRpNiNPG.d.ts +0 -37
  1335. package/dist/filter-evaluate-lCToXzZI.js +0 -217
  1336. package/dist/filter-query-CQ6d5GnQ.js +0 -566
  1337. package/dist/filter-query-DBt7OKuH.d.ts +0 -133
  1338. package/dist/flags-DDKTThrO.d.ts +0 -246
  1339. package/dist/flags-DF_SCqp5.js +0 -279
  1340. package/dist/form-definition-BTpM_tz1.js +0 -363
  1341. package/dist/form-definition-BjEtH8BT.d.ts +0 -119
  1342. package/dist/format-u-65igKI.d.ts +0 -79
  1343. package/dist/framework-CqiZk89W.js +0 -58
  1344. package/dist/framework-DVYTtQXA.d.ts +0 -47
  1345. package/dist/function-contract-DxFNOmsm.d.ts +0 -27
  1346. package/dist/function-contract-pEmsaUIf.js +0 -8
  1347. package/dist/gateway-Ve7cByEr.d.ts +0 -115
  1348. package/dist/gateway-options-BlVCqgb8.d.ts +0 -29
  1349. package/dist/gateway-options-Cl74B7k6.js +0 -27
  1350. package/dist/guards-6F2bCtQR.js +0 -12
  1351. package/dist/guest-actions-1T1DeS5Y.d.ts +0 -5
  1352. package/dist/guest-actions-B7zdhfnh.js +0 -9
  1353. package/dist/history-GH1HJWQV.js +0 -271
  1354. package/dist/hmac-B3CTTlfv.js +0 -23
  1355. package/dist/http-7-UvHjQe.js +0 -28
  1356. package/dist/http-BjjojWg3.js +0 -40
  1357. package/dist/http-DzbloBR-.js +0 -141
  1358. package/dist/image-url-_d7xYsXK.js +0 -84
  1359. package/dist/impersonation-DM3oWNoD.js +0 -62
  1360. package/dist/impersonation-YTa9dZUv.d.ts +0 -28
  1361. package/dist/inbox-c8B86Trp.d.ts +0 -321
  1362. package/dist/index-B4wttiLh.d.ts +0 -407
  1363. package/dist/index-Clyd2Goi.d.ts +0 -338
  1364. package/dist/index-Cxsnd-OL.d.ts +0 -305
  1365. package/dist/index-D98bQs8a.d.ts +0 -665
  1366. package/dist/index-DIdPoQtO.d.ts +0 -240
  1367. package/dist/index-DbyDZZlc.d.ts +0 -53
  1368. package/dist/index-I8YLxKq8.d.ts +0 -729
  1369. package/dist/index-NRMMhhEi.d.ts +0 -104
  1370. package/dist/index-X2fkPUwb.d.ts +0 -51
  1371. package/dist/index-eRBuKtMt.d.ts +0 -158
  1372. package/dist/index-pZn6S_iq.d.ts +0 -149
  1373. package/dist/index-uIU65iEn.d.ts +0 -588
  1374. package/dist/instance-property-hRh88y_s.js +0 -7
  1375. package/dist/instances-DY_ORk5g.js +0 -16605
  1376. package/dist/invalidate-DMp4eqfF.d.ts +0 -21
  1377. package/dist/iso4217-B-durg_y.js +0 -176
  1378. package/dist/json-DaByVJpw.js +0 -22
  1379. package/dist/json-schema-DHJxiizN.js +0 -888
  1380. package/dist/jwks-cache-DEsKI0hJ.js +0 -49
  1381. package/dist/jws-D0toeQlA.d.ts +0 -66
  1382. package/dist/jws-DOgHJKHb.js +0 -205
  1383. package/dist/kit-B8yWCRN7.d.ts +0 -94
  1384. package/dist/kit-Bcd9wYCV.js +0 -133
  1385. package/dist/knowledge-CsLPACGJ.d.ts +0 -217
  1386. package/dist/knowledge-tCrrU99q.js +0 -300
  1387. package/dist/list-query-BcU8NnNL.d.ts +0 -222
  1388. package/dist/list-query-BnpA2BDg.js +0 -559
  1389. package/dist/live-C21DgbsD.js +0 -275
  1390. package/dist/logger-DWVYUmwi.d.ts +0 -18
  1391. package/dist/logger-glM28NVN.js +0 -21
  1392. package/dist/lookup-BaP5bI27.js +0 -18
  1393. package/dist/management-wtecfrNf.d.ts +0 -57
  1394. package/dist/message-Bg4TKA12.d.ts +0 -99
  1395. package/dist/messages-ecPW_nOv.js +0 -492
  1396. package/dist/messaging-DQP09JsY.d.ts +0 -297
  1397. package/dist/methods-Cund9ZBe.js +0 -11
  1398. package/dist/metric-definition-BjxVn4R5.js +0 -117
  1399. package/dist/metric-definition-EAYI1r2n.d.ts +0 -69
  1400. package/dist/mfa-oIOYTpvc.d.ts +0 -36
  1401. package/dist/model-hwpvole9.d.ts +0 -340
  1402. package/dist/model-messages-CkZSDDHP.js +0 -206
  1403. package/dist/model-messages-DrR4lZ_c.d.ts +0 -34
  1404. package/dist/money-BNRdJQzA.d.ts +0 -91
  1405. package/dist/money-BZl985O-.js +0 -197
  1406. package/dist/money-codec-BJuS2zEW.js +0 -41
  1407. package/dist/my-work-kinds-BU3SlA-6.js +0 -11
  1408. package/dist/node-headers-BPtMP4_V.d.ts +0 -27
  1409. package/dist/node-headers-C71zNQHe.js +0 -55
  1410. package/dist/operations-DVHRHvv6.js +0 -29
  1411. package/dist/operations-hm1Isvvs.d.ts +0 -6
  1412. package/dist/optional-peer-C1NbBRJm.js +0 -32
  1413. package/dist/options-3OYOU56e.js +0 -11
  1414. package/dist/options-56zYYXxc.js +0 -10
  1415. package/dist/options-5WvWOkAm.d.ts +0 -26
  1416. package/dist/options-62woPFn3.js +0 -12
  1417. package/dist/options-7ixoOoap.js +0 -10
  1418. package/dist/options-9dSU5RML.js +0 -5
  1419. package/dist/options-B0YZtAkb.d.ts +0 -15
  1420. package/dist/options-B2Kz_tCx.js +0 -10
  1421. package/dist/options-B5E2MGIz.js +0 -15
  1422. package/dist/options-B685YSzQ.js +0 -5
  1423. package/dist/options-B692WoK6.js +0 -9
  1424. package/dist/options-BHU1wc74.js +0 -5
  1425. package/dist/options-BHy0Z5Zd.js +0 -5
  1426. package/dist/options-BJtdsK7b.js +0 -8
  1427. package/dist/options-BKDxrPvE.js +0 -5
  1428. package/dist/options-BLfymS4s.js +0 -5
  1429. package/dist/options-BOCRbzh3.js +0 -5
  1430. package/dist/options-BOqfYsM1.js +0 -13
  1431. package/dist/options-BQWJqwHO.js +0 -9
  1432. package/dist/options-BQunK6_Y.js +0 -8
  1433. package/dist/options-BQyrZjwM.js +0 -28
  1434. package/dist/options-BR9xTHZW.js +0 -5
  1435. package/dist/options-BRUdd5jY.js +0 -8
  1436. package/dist/options-BSsYXjhC.js +0 -9
  1437. package/dist/options-BTmaRzx2.d.ts +0 -60
  1438. package/dist/options-BUCQYAeJ.d.ts +0 -10
  1439. package/dist/options-B_NrjVDt.d.ts +0 -12
  1440. package/dist/options-BawzwlmC.js +0 -11
  1441. package/dist/options-BbLDAp7G.d.ts +0 -10
  1442. package/dist/options-BfPsL7E2.js +0 -9
  1443. package/dist/options-Bfmwwc78.js +0 -8
  1444. package/dist/options-BhsdveDk.js +0 -21
  1445. package/dist/options-BomoTH-8.js +0 -5
  1446. package/dist/options-BtjkzIVh.js +0 -8
  1447. package/dist/options-Bvi9bl4H.js +0 -5
  1448. package/dist/options-BwKNmaJo.js +0 -5
  1449. package/dist/options-BxpLtyk-.js +0 -18
  1450. package/dist/options-BzB2QxL3.js +0 -5
  1451. package/dist/options-C078wBP0.js +0 -5
  1452. package/dist/options-C3AdsFJ6.js +0 -9
  1453. package/dist/options-C7C5OhmL.d.ts +0 -8
  1454. package/dist/options-C87u6eSa.js +0 -10
  1455. package/dist/options-CBAEGxwS.js +0 -8
  1456. package/dist/options-CDSCkYxu.d.ts +0 -14
  1457. package/dist/options-CDUr8zzX.js +0 -8
  1458. package/dist/options-CF6EVF_G.js +0 -17
  1459. package/dist/options-CFjGxfa8.js +0 -5
  1460. package/dist/options-CI6P0xhV.js +0 -10
  1461. package/dist/options-CJFMK9A_.js +0 -8
  1462. package/dist/options-CLpgx7en.js +0 -10
  1463. package/dist/options-CSCXNYJO.d.ts +0 -8
  1464. package/dist/options-CTXHj9zr.js +0 -16
  1465. package/dist/options-CTl8T88w.js +0 -11
  1466. package/dist/options-CUIOOv4z.js +0 -15
  1467. package/dist/options-CZDmtsbV.js +0 -8
  1468. package/dist/options-CZTscdPB.js +0 -5
  1469. package/dist/options-CZdKndeo.js +0 -9
  1470. package/dist/options-C_7g9TTq.d.ts +0 -12
  1471. package/dist/options-Cb2FOFj5.js +0 -5
  1472. package/dist/options-CbOstLa7.js +0 -5
  1473. package/dist/options-CcXgWlvm.js +0 -24
  1474. package/dist/options-CfVPctAw.js +0 -89
  1475. package/dist/options-Cjgaf8ub.js +0 -8
  1476. package/dist/options-CoSPgWKy.js +0 -9
  1477. package/dist/options-CpZ2HlSU.js +0 -32
  1478. package/dist/options-CsSe8Nba.js +0 -8
  1479. package/dist/options-CsvJR-r2.js +0 -9
  1480. package/dist/options-Cucv6sWP.js +0 -12
  1481. package/dist/options-CyjL9lTf.js +0 -5
  1482. package/dist/options-D-OOO9V2.d.ts +0 -10
  1483. package/dist/options-D0Y6ZMe8.js +0 -5
  1484. package/dist/options-D0bzZx9a.d.ts +0 -10
  1485. package/dist/options-D0sj5abR.js +0 -9
  1486. package/dist/options-D1hSuf50.d.ts +0 -12
  1487. package/dist/options-D610Fa6T.js +0 -5
  1488. package/dist/options-D96dScev.js +0 -24
  1489. package/dist/options-DFpyP1bg.js +0 -5
  1490. package/dist/options-DJEcS4DX.js +0 -5
  1491. package/dist/options-DJbN3bi9.js +0 -11
  1492. package/dist/options-DKoQoRCy.js +0 -13
  1493. package/dist/options-DM1qaMMQ.js +0 -9
  1494. package/dist/options-DNgSwhsm.js +0 -11
  1495. package/dist/options-DOIwzRXL.js +0 -16
  1496. package/dist/options-DRIgHh4O.d.ts +0 -16
  1497. package/dist/options-DRrZmJyI.js +0 -8
  1498. package/dist/options-DSCW40_5.js +0 -12
  1499. package/dist/options-DUMUsvml.js +0 -5
  1500. package/dist/options-DWwL5Kaz.js +0 -9
  1501. package/dist/options-DZHZYlpD.js +0 -10
  1502. package/dist/options-DZLkeqWn.js +0 -9
  1503. package/dist/options-DZRpXKQE.js +0 -5
  1504. package/dist/options-DZen3UiC.js +0 -14
  1505. package/dist/options-D_9Vxx7f.js +0 -8
  1506. package/dist/options-DcHl59RC.js +0 -11
  1507. package/dist/options-Dcaql09y.js +0 -11
  1508. package/dist/options-DcnBNYmV.js +0 -8
  1509. package/dist/options-DdpM-fiP.js +0 -9
  1510. package/dist/options-DhoLMknl.js +0 -10
  1511. package/dist/options-DlohRAYd.d.ts +0 -13
  1512. package/dist/options-Dpy-Ruo-.js +0 -14
  1513. package/dist/options-DsVuVRH3.d.ts +0 -17
  1514. package/dist/options-DtAJxfHS.js +0 -8
  1515. package/dist/options-Dz9Yo52Z.js +0 -8
  1516. package/dist/options-HnfETSHr.d.ts +0 -19
  1517. package/dist/options-LqUXTpML.js +0 -8
  1518. package/dist/options-MsloEAIB.js +0 -5
  1519. package/dist/options-P2FxqYpd.js +0 -17
  1520. package/dist/options-_1gAIMq7.d.ts +0 -60
  1521. package/dist/options-aT89JqlB.js +0 -5
  1522. package/dist/options-cVKZu9b0.js +0 -9
  1523. package/dist/options-eTepQ1rZ.js +0 -15
  1524. package/dist/options-fkShrmGQ.js +0 -8
  1525. package/dist/options-gUvfr3no.js +0 -11
  1526. package/dist/options-hynwKWuf.js +0 -20
  1527. package/dist/options-jsOCvLUz.js +0 -10
  1528. package/dist/options-o5wCw8H7.d.ts +0 -14
  1529. package/dist/options-p49DFg3H.js +0 -8
  1530. package/dist/options-pYNpXKcg.js +0 -8
  1531. package/dist/options-qtETCHzW.js +0 -10
  1532. package/dist/options-rnKlqYEr.js +0 -5
  1533. package/dist/options-sU_zGkiV.js +0 -10
  1534. package/dist/options-xq4MXG1M.js +0 -5
  1535. package/dist/options-zzlznRA7.js +0 -10
  1536. package/dist/outbox-BZ712Z3X.d.ts +0 -199
  1537. package/dist/payments-BXvabJOw.js +0 -16
  1538. package/dist/payments-BYcN34Fp.d.ts +0 -114
  1539. package/dist/permissions-controller-BMsqIE5T.js +0 -34
  1540. package/dist/pg-error-B5QLDcbG.js +0 -26
  1541. package/dist/plugin-AKwwe2gF.js +0 -48
  1542. package/dist/pool-DDR1ndk7.d.ts +0 -123
  1543. package/dist/pool-errors-JUBcGrre.js +0 -27
  1544. package/dist/ports-DOrPTJzl.d.ts +0 -89
  1545. package/dist/ports-DvpNseap.js +0 -152
  1546. package/dist/postgrest-AJc8hnJU.d.ts +0 -53
  1547. package/dist/postgrest-executor-B_Uezhrm.js +0 -1068
  1548. package/dist/preset-CXhpPmPV.js +0 -1042
  1549. package/dist/problem-Bf0cJ7tk.js +0 -162
  1550. package/dist/problem-DNwN8iGz.d.ts +0 -79
  1551. package/dist/project-DJ9Uo0sT.js +0 -1760
  1552. package/dist/provider-B6g7rBZX.js +0 -57
  1553. package/dist/provider-CWjzAIX9.d.ts +0 -112
  1554. package/dist/push-token-B4vcIU4s.d.ts +0 -24
  1555. package/dist/push-token-D6REHMMw.js +0 -16
  1556. package/dist/queries-BWYYS9um.js +0 -239
  1557. package/dist/range-DwpWe8e7.js +0 -7
  1558. package/dist/range-p5V4rBhZ.d.ts +0 -8
  1559. package/dist/rank-keys-DcPMt_Jk.js +0 -60
  1560. package/dist/rank-result-BBJIK-k_.js +0 -18
  1561. package/dist/rank-result-Bwe7igy-.d.ts +0 -14
  1562. package/dist/rate-limit-BWKGlhTM.js +0 -49
  1563. package/dist/rate-limit-Bztf32cl.d.ts +0 -50
  1564. package/dist/rate-limit-fZ_d8gSE.js +0 -380
  1565. package/dist/ratelimit-headers-kEcXyO3H.js +0 -62
  1566. package/dist/react-BKCnIuZs.js +0 -79
  1567. package/dist/react-mdVjpewL.js +0 -1016
  1568. package/dist/read-set-B1sDib5O.js +0 -199
  1569. package/dist/realtime-status-BhNkb-Ow.d.ts +0 -8
  1570. package/dist/realtime-status-asHvhiOh.js +0 -11
  1571. package/dist/record-bindings-Z51mGfhB.js +0 -26
  1572. package/dist/record-form-CubgBrtI.d.ts +0 -82
  1573. package/dist/record-type-BEUyEsFx.js +0 -221
  1574. package/dist/recordings-DeZYx-Kv.d.ts +0 -119
  1575. package/dist/refresh-D02Pbf5B.d.ts +0 -54
  1576. package/dist/refresh-DLBgnxjL.js +0 -144
  1577. package/dist/refusal-B0VmlAxF.d.ts +0 -32
  1578. package/dist/refusal-DDlInPff.js +0 -64
  1579. package/dist/relay-CIKcAVjf.js +0 -248
  1580. package/dist/resolve-B0mW2m7f.js +0 -932
  1581. package/dist/resolve-CtX6T0c0.d.ts +0 -288
  1582. package/dist/resolved-names-kMRjmSIy.js +0 -133
  1583. package/dist/resource-BUJcZKiW.js +0 -520
  1584. package/dist/resource-DvgXqZB_.js +0 -105
  1585. package/dist/resource-WxN0IsvB.d.ts +0 -123
  1586. package/dist/resource-execute-BzqR8DdD.d.ts +0 -15
  1587. package/dist/resource-schemas-up6bKOUi.js +0 -82
  1588. package/dist/resource-types-BVbHgTPg.d.ts +0 -157
  1589. package/dist/resources-BSbRa0Ab.d.ts +0 -7
  1590. package/dist/resources-jb3R6rEa.js +0 -64
  1591. package/dist/respond-CZMWbUs3.js +0 -107
  1592. package/dist/respond-Dzu_-EPH.d.ts +0 -112
  1593. package/dist/result-DZeA5KS6.d.ts +0 -351
  1594. package/dist/result-ntFBW2p2.js +0 -146
  1595. package/dist/rows-BdqXmiB-.js +0 -80
  1596. package/dist/rows-jijHLVE_.js +0 -39
  1597. package/dist/rrule-C9Ot6ax8.js +0 -290
  1598. package/dist/run-state-BMCD_1Lt.d.ts +0 -13
  1599. package/dist/run-state-CgBKzYMW.js +0 -13
  1600. package/dist/run-watch-B-LoK5m1.js +0 -53
  1601. package/dist/runtime-LRJM7UqY.js +0 -44
  1602. package/dist/sales-lines-BsmrNHe9.d.ts +0 -38
  1603. package/dist/sales-lines-DO7oRu1o.js +0 -45
  1604. package/dist/sales-shared-BuTA8JK7.js +0 -22
  1605. package/dist/schemas-CLOTvdsC.js +0 -216
  1606. package/dist/scope-DgWjuXUw.js +0 -90
  1607. package/dist/scores-Y8TvyJi1.d.ts +0 -174
  1608. package/dist/scores-bY2Is0kx.js +0 -177
  1609. package/dist/search-Cn_DGluL.js +0 -9
  1610. package/dist/server-types-BkTIxW_H.d.ts +0 -597
  1611. package/dist/session-BOzx2qHC.d.ts +0 -100
  1612. package/dist/session-status-BP8eYVnA.d.ts +0 -82
  1613. package/dist/shared-BeHTi8Fu.js +0 -17
  1614. package/dist/shared-Bf-I13Ht.js +0 -91
  1615. package/dist/shared-CRRfQAKG.d.ts +0 -11
  1616. package/dist/sign-in-BzihC_8k.d.ts +0 -50
  1617. package/dist/sign-in-CmPK1AgM.js +0 -402
  1618. package/dist/sign-in-CuZ1Ag7O.js +0 -718
  1619. package/dist/sign-in-D54FLMQy.d.ts +0 -55
  1620. package/dist/signatures-CX1b4WHa.js +0 -145
  1621. package/dist/signatures-Dkx9OE8j.d.ts +0 -43
  1622. package/dist/signers-ZmxO1I05.d.ts +0 -390
  1623. package/dist/signing-keys-CWtpMask.js +0 -164
  1624. package/dist/signing-keys-udgP7Aod.d.ts +0 -119
  1625. package/dist/simplify-DDO0j0LI.js +0 -83
  1626. package/dist/spec-BMvCCNnd.js +0 -124
  1627. package/dist/spec-pins-BZkKfwY8.d.ts +0 -127
  1628. package/dist/spec-pins-D3zDek-u.js +0 -62
  1629. package/dist/sql-CYt7EhH0.js +0 -421
  1630. package/dist/sql-DHp0L7zK.js +0 -138385
  1631. package/dist/sql-type-iUSZpaUu.js +0 -34
  1632. package/dist/sso-CkU_4mtK.d.ts +0 -161
  1633. package/dist/sso-DdDpJQzw.js +0 -217
  1634. package/dist/standard-BA3mLh6w.js +0 -25
  1635. package/dist/standard-DBV730sF.d.ts +0 -7
  1636. package/dist/stats-BHl1-zj9.js +0 -83
  1637. package/dist/statuses-Alll5Ip6.js +0 -29
  1638. package/dist/statuses-zRcc2TeZ.js +0 -28
  1639. package/dist/storage-api-Dg78Wqsg.js +0 -10
  1640. package/dist/store-CpheI-lN.d.ts +0 -83
  1641. package/dist/store-McN-2esd.js +0 -69
  1642. package/dist/stripe-BJUfp5jM.js +0 -32
  1643. package/dist/stripe-X22LjuH-.d.ts +0 -156
  1644. package/dist/subject-readers-CB5Te02u.d.ts +0 -21
  1645. package/dist/subject-readers-VHcrWhmq.js +0 -49
  1646. package/dist/subject-type-BRnK7Av3.js +0 -8
  1647. package/dist/subjects-BYCL-6hA.d.ts +0 -145
  1648. package/dist/subjects-CiBNKy2y.d.ts +0 -90
  1649. package/dist/subscribers-BvZxcd63.js +0 -33
  1650. package/dist/summaries-8jQTELIX.d.ts +0 -69
  1651. package/dist/supabase-mcp-Dz9DgrKP.js +0 -28
  1652. package/dist/supabase-mcp-Z4vtsuoO.d.ts +0 -46
  1653. package/dist/support-BxyPOFk4.d.ts +0 -357
  1654. package/dist/support-view-g4YLBeqX.js +0 -18
  1655. package/dist/support-view-nqUWKHEs.d.ts +0 -17
  1656. package/dist/table-schema-BlF6k62Q.d.ts +0 -81
  1657. package/dist/table-schema-C80xItaV.js +0 -293
  1658. package/dist/tables-Cb-3_VWc.js +0 -73
  1659. package/dist/tags-CIZTqtlY.js +0 -39
  1660. package/dist/tags-Cm48BsOa.d.ts +0 -30
  1661. package/dist/tax-BkCNWWMc.js +0 -140
  1662. package/dist/tax-DPShHual.d.ts +0 -170
  1663. package/dist/tee-V97_v1ZS.js +0 -101
  1664. package/dist/template-Drgg3v2J.js +0 -126
  1665. package/dist/temporal-Dbo0fLzc.js +0 -95
  1666. package/dist/temporal-required-DcLhnDhQ.js +0 -20
  1667. package/dist/tenant-BgIiMQpo.js +0 -27
  1668. package/dist/tenant-FfgNhd5x.d.ts +0 -17
  1669. package/dist/tenant-source-bqWpSr86.js +0 -8
  1670. package/dist/timeline-DqEoD8bb.d.ts +0 -151
  1671. package/dist/timeline-Dz3hO2I6.js +0 -50
  1672. package/dist/timing-dypS0nxW.js +0 -95
  1673. package/dist/topic-BaUElNw2.d.ts +0 -415
  1674. package/dist/topic-DnsNG4Kj.js +0 -643
  1675. package/dist/ttl-cache-Bhr9swjT.js +0 -32
  1676. package/dist/types-B-D6fYx2.d.ts +0 -194
  1677. package/dist/types-CK2X2wCB.d.ts +0 -618
  1678. package/dist/types-CMN0h_Ix.d.ts +0 -461
  1679. package/dist/types-CPl9uJ0G.d.ts +0 -912
  1680. package/dist/types-CwQgFo8c.d.ts +0 -177
  1681. package/dist/types-DMihLukJ.d.ts +0 -251
  1682. package/dist/types-R6syp1el.js +0 -29
  1683. package/dist/types-iCyZ3lMx.d.ts +0 -217
  1684. package/dist/types-nspa5I-a.d.ts +0 -664
  1685. package/dist/undo-0HkWXASn.d.ts +0 -46
  1686. package/dist/undo-BbftL9-4.js +0 -44
  1687. package/dist/upload-claim-B1ZU8ydB.js +0 -33
  1688. package/dist/usage-BkWAPkg2.d.ts +0 -232
  1689. package/dist/user-change-DgWC6RRC.js +0 -135
  1690. package/dist/variants-Cy--Ub-a.js +0 -53
  1691. package/dist/vault-BkdPmL7f.d.ts +0 -62
  1692. package/dist/verify-41mZmspj.d.ts +0 -146
  1693. package/dist/verify-7EucfCnv.js +0 -130
  1694. package/dist/view-C8Ve14ja.js +0 -247
  1695. package/dist/view-C8_xvD-j.d.ts +0 -97
  1696. package/dist/watch-topic-BabDTZ-L.d.ts +0 -31
  1697. package/dist/watch-topic-CuaWfCuv.js +0 -57
  1698. package/dist/wire-ChYn1g21.js +0 -91
  1699. package/dist/wiring-CDNuQoJJ.js +0 -13
  1700. package/dist/workflow-sdk-Cf0LAOFF.js +0 -242
  1701. package/dist/workflow-sdk-DJJkP0dT.js +0 -2545
  1702. package/dist/workflow-sdk-rg3IbCZC.d.ts +0 -163
  1703. package/dist/workflows-xL6t0TXx.d.ts +0 -258
@@ -0,0 +1,2065 @@
1
+ import { r as isPlainObject } from "./clone-H_gCsL29.js";
2
+ import { n as isRecord } from "./guards-CsRa6v57.js";
3
+ import { t as instanceProperty } from "./instance-property-BlH7QSDl.js";
4
+ import { s as problemType, t as PROBLEM_CONTENT_TYPE } from "./problem-C0SVHhd3.js";
5
+ import { t as buildJsonSchema } from "./json-schema-D9eVL_xi.js";
6
+ import { n as pageQuery, r as pageSchema } from "./resource-schemas-Bq0g2RCQ.js";
7
+ import { r as planResource } from "./resource-DQ4kIBpa.js";
8
+ import { t as topicStatus } from "./realtime-status-CocmAOPv.js";
9
+ import { r as dataschemaOf } from "./cloud-event-CLvsaPqH.js";
10
+ import { ROW_EVENT_TYPES } from "./events/index.js";
11
+ // src/spec/merge.ts
12
+ /** Escapes a key for a JSON Pointer (RFC 6901). */
13
+ function pointerToken(key) {
14
+ return key.replaceAll("~", "~0").replaceAll("/", "~1");
15
+ }
16
+ /**
17
+ * Deep merge: objects merge key by key, anything else (arrays included) is
18
+ * replaced by the patch. `onConflict` hears each replaced leaf whose value
19
+ * differs, with its JSON Pointer. Neither input is changed.
20
+ */
21
+ function mergeJson(base, patch, onConflict, pointer = "") {
22
+ if (!isPlainObject(base) || !isPlainObject(patch)) {
23
+ if (onConflict && base !== void 0 && JSON.stringify(base) !== JSON.stringify(patch)) onConflict(pointer);
24
+ return patch;
25
+ }
26
+ const out = { ...base };
27
+ for (const [key, value] of Object.entries(patch)) out[key] = Object.hasOwn(base, key) ? mergeJson(base[key], value, onConflict, `${pointer}/${pointerToken(key)}`) : value;
28
+ return out;
29
+ }
30
+ // src/spec/schemas.ts
31
+ /** `customer_tags` to `CustomerTags`. */
32
+ function pascal(value) {
33
+ return value.replaceAll(/(^|[_\-.\s])(\w)/g, (_, _sep, char) => char.toUpperCase());
34
+ }
35
+ const schemaRef = (name) => ({ $ref: `#/components/schemas/${name}` });
36
+ const tableDefs = /* @__PURE__ */ new WeakMap();
37
+ /**
38
+ * The 2020-12 `$defs` for every table (`customersRow`, `customersInsert`),
39
+ * built once per metadata object and JSON column config.
40
+ */
41
+ function tableSchemas(meta, json = {}) {
42
+ let byJson = tableDefs.get(meta);
43
+ if (!byJson) {
44
+ byJson = /* @__PURE__ */ new Map();
45
+ tableDefs.set(meta, byJson);
46
+ }
47
+ const key = JSON.stringify(json);
48
+ let defs = byJson.get(key);
49
+ if (!defs) {
50
+ defs = buildJsonSchema({
51
+ meta,
52
+ config: { json }
53
+ })["$defs"];
54
+ byJson.set(key, defs);
55
+ }
56
+ return defs;
57
+ }
58
+ const converted = /* @__PURE__ */ new WeakMap();
59
+ function nameOf(schema) {
60
+ const id = schema["$id"] ?? schema["id"];
61
+ if (typeof id !== "string" || id === "") return;
62
+ return (id.split(/[/#]/u).findLast((part) => part !== "") ?? id).replace(/\.(?:schema\.)?json$/u, "");
63
+ }
64
+ /**
65
+ * Converts a Standard Schema through Standard JSON Schema (2020-12), or
66
+ * `undefined` when the library does not implement it. The schema's `$id`, `id`
67
+ * and `$schema` are lifted out: the id becomes the component name.
68
+ */
69
+ function convertStandard(schema, direction) {
70
+ let cache = converted.get(schema);
71
+ if (!cache) {
72
+ cache = /* @__PURE__ */ new Map();
73
+ converted.set(schema, cache);
74
+ }
75
+ const hit = cache.get(direction);
76
+ if (hit !== void 0) return hit ?? void 0;
77
+ const convert = schema["~standard"].jsonSchema?.[direction];
78
+ if (typeof convert !== "function") {
79
+ cache.set(direction, null);
80
+ return;
81
+ }
82
+ const raw = convert({ target: "draft-2020-12" });
83
+ const name = nameOf(raw);
84
+ const { $schema: _schema, $id: _id, id: _plainId, ...rest } = raw;
85
+ const result = {
86
+ schema: rest,
87
+ ...name ? { name } : {}
88
+ };
89
+ cache.set(direction, result);
90
+ return result;
91
+ }
92
+ // src/spec/presets.ts
93
+ /** JSON Schema for RFC 9457 Problem Details as better-supabase sends them. */
94
+ const PROBLEM_SCHEMA = {
95
+ type: "object",
96
+ required: [
97
+ "type",
98
+ "title",
99
+ "status"
100
+ ],
101
+ properties: {
102
+ type: {
103
+ type: "string",
104
+ format: "uri-reference",
105
+ examples: [problemType("not_found").type]
106
+ },
107
+ title: { type: "string" },
108
+ status: {
109
+ type: "integer",
110
+ minimum: 100,
111
+ maximum: 599
112
+ },
113
+ detail: { type: "string" },
114
+ instance: { type: "string" },
115
+ kind: { type: "string" },
116
+ code: { type: "string" },
117
+ hint: { type: "string" },
118
+ constraint: { type: "string" },
119
+ column: { type: "string" },
120
+ columns: {
121
+ type: "array",
122
+ items: { type: "string" }
123
+ },
124
+ required: {
125
+ type: "string",
126
+ enum: ["aal1", "aal2"]
127
+ },
128
+ scopes: {
129
+ type: "array",
130
+ items: { type: "string" }
131
+ },
132
+ permission: { type: "string" },
133
+ approval: {
134
+ type: "object",
135
+ required: ["id"],
136
+ properties: { id: { type: "string" } }
137
+ },
138
+ issues: {
139
+ type: "array",
140
+ items: {
141
+ type: "object",
142
+ required: ["message"],
143
+ properties: {
144
+ message: { type: "string" },
145
+ path: {
146
+ type: "array",
147
+ items: { type: ["string", "integer"] }
148
+ }
149
+ }
150
+ }
151
+ }
152
+ }
153
+ };
154
+ /** The default error responses: today's Problem Details answers, 400 to 422. */
155
+ const DEFAULT_ERRORS = [
156
+ {
157
+ name: "BadRequest",
158
+ status: 400,
159
+ description: "The request is invalid."
160
+ },
161
+ {
162
+ name: "Unauthorized",
163
+ status: 401,
164
+ description: "Missing or invalid credentials."
165
+ },
166
+ {
167
+ name: "Forbidden",
168
+ status: 403,
169
+ description: "Row-level security or a plugin denied the request."
170
+ },
171
+ {
172
+ name: "NotFound",
173
+ status: 404,
174
+ description: "No row matches."
175
+ },
176
+ {
177
+ name: "Conflict",
178
+ status: 409,
179
+ description: "A unique or foreign key constraint failed."
180
+ },
181
+ {
182
+ name: "Unprocessable",
183
+ status: 422,
184
+ description: "Validation or a check constraint failed."
185
+ }
186
+ ];
187
+ /** Name of the shared 403 response of operations that declare a permission. */
188
+ const PERMISSION_DENIED = "PermissionDenied";
189
+ const problem = (code, detail, extra = {}) => ({ value: {
190
+ ...problemType("forbidden"),
191
+ status: 403,
192
+ kind: "forbidden",
193
+ code,
194
+ detail,
195
+ ...extra
196
+ } });
197
+ /** The 403 of an operation with a permission, with one example per problem code. */
198
+ function permissionDeniedResponse() {
199
+ return {
200
+ description: "The authorizer denied the permission (`PERMISSION_DENIED`), the token lacks an OAuth scope (`INSUFFICIENT_SCOPE`), the action needs an approval (`APPROVAL_REQUIRED`), or row-level security denied the request.",
201
+ content: { [PROBLEM_CONTENT_TYPE]: {
202
+ schema: schemaRef("Problem"),
203
+ examples: {
204
+ permissionDenied: {
205
+ summary: "PERMISSION_DENIED",
206
+ ...problem("PERMISSION_DENIED", "Permission invoices.update is required", { permission: "invoices.update" })
207
+ },
208
+ insufficientScope: {
209
+ summary: "INSUFFICIENT_SCOPE",
210
+ ...problem("INSUFFICIENT_SCOPE", "The token lacks a required scope", { scopes: ["invoices.update"] })
211
+ },
212
+ approvalRequired: {
213
+ summary: "APPROVAL_REQUIRED",
214
+ ...problem("APPROVAL_REQUIRED", "invoices.update needs an approval", {
215
+ permission: "invoices.update",
216
+ approval: { id: "apr_123" }
217
+ })
218
+ }
219
+ }
220
+ } }
221
+ };
222
+ }
223
+ function errorResponse(error) {
224
+ return {
225
+ description: error.description,
226
+ content: { [PROBLEM_CONTENT_TYPE]: { schema: schemaRef("Problem") } }
227
+ };
228
+ }
229
+ /** The scheme name of the `oauth2` preset. */
230
+ const OAUTH_SCHEME = "supabaseOAuth";
231
+ /** Security schemes and top-level requirements for the presets. */
232
+ function resolveSecurity(presets, supabaseUrl, oauthScopes = {}) {
233
+ const schemes = {};
234
+ const requirements = [];
235
+ for (const preset of presets) {
236
+ if (typeof preset === "object") {
237
+ schemes[preset.name] = preset.scheme;
238
+ requirements.push({ [preset.name]: preset.scopes ?? [] });
239
+ continue;
240
+ }
241
+ switch (preset) {
242
+ case "bearer":
243
+ schemes["supabaseJwt"] = {
244
+ type: "http",
245
+ scheme: "bearer",
246
+ bearerFormat: "JWT",
247
+ description: "A Supabase access token. Requests run as that user under row-level security."
248
+ };
249
+ requirements.push({ supabaseJwt: [] });
250
+ break;
251
+ case "oauth2": {
252
+ if (!supabaseUrl) throw new TypeError("better-supabase/spec: oauth2 security needs supabaseUrl");
253
+ const origin = supabaseUrl.replace(/\/$/, "");
254
+ const auth = `${origin}/auth/v1`;
255
+ schemes[OAUTH_SCHEME] = {
256
+ type: "oauth2",
257
+ description: "The Supabase OAuth 2.1 server.",
258
+ flows: { authorizationCode: {
259
+ authorizationUrl: `${auth}/oauth/authorize`,
260
+ tokenUrl: `${auth}/oauth/token`,
261
+ scopes: oauthScopes
262
+ } },
263
+ metadataUrl: `${origin}/.well-known/oauth-authorization-server/auth/v1`
264
+ };
265
+ requirements.push({ [OAUTH_SCHEME]: [] });
266
+ break;
267
+ }
268
+ case "apiKey":
269
+ schemes["supabaseApiKey"] = {
270
+ type: "apiKey",
271
+ name: "apikey",
272
+ in: "header",
273
+ description: "The project's publishable key."
274
+ };
275
+ requirements.push({ supabaseApiKey: [] });
276
+ break;
277
+ default: throw new TypeError(`Unknown security preset "${String(preset)}"`);
278
+ }
279
+ }
280
+ return {
281
+ schemes,
282
+ requirements
283
+ };
284
+ }
285
+ // src/spec/build-resource.ts
286
+ const METHODS = /* @__PURE__ */ new Set([
287
+ "get",
288
+ "put",
289
+ "post",
290
+ "patch",
291
+ "delete",
292
+ "head",
293
+ "options",
294
+ "trace",
295
+ "query"
296
+ ]);
297
+ function isMethod(value) {
298
+ return METHODS.has(value);
299
+ }
300
+ /** The error statuses each operation can answer with. */
301
+ const OPERATION_STATUSES = {
302
+ list: [
303
+ 400,
304
+ 401,
305
+ 403
306
+ ],
307
+ create: [
308
+ 400,
309
+ 401,
310
+ 403,
311
+ 409,
312
+ 422
313
+ ],
314
+ get: [
315
+ 401,
316
+ 403,
317
+ 404
318
+ ],
319
+ update: [
320
+ 400,
321
+ 401,
322
+ 403,
323
+ 404,
324
+ 409,
325
+ 422
326
+ ],
327
+ delete: [
328
+ 401,
329
+ 403,
330
+ 404,
331
+ 409
332
+ ]
333
+ };
334
+ /** The error statuses each contract verb can answer with. */
335
+ const VERB_STATUSES$1 = {
336
+ page: [
337
+ 400,
338
+ 401,
339
+ 403
340
+ ],
341
+ count: [
342
+ 400,
343
+ 401,
344
+ 403
345
+ ],
346
+ aggregate: [
347
+ 400,
348
+ 401,
349
+ 403
350
+ ],
351
+ upsert: [
352
+ 400,
353
+ 401,
354
+ 403,
355
+ 409,
356
+ 422
357
+ ]
358
+ };
359
+ /**
360
+ * Statuses an operation only documents when it can answer with them; other
361
+ * errors apply everywhere.
362
+ */
363
+ const SCOPED_STATUSES = /* @__PURE__ */ new Set([
364
+ 400,
365
+ 401,
366
+ 403,
367
+ 404,
368
+ 409,
369
+ 422
370
+ ]);
371
+ const JSON_TYPE = "application/json";
372
+ function pageParameters(cursor, maxPageSize) {
373
+ return pageQuery(cursor, maxPageSize).map((p) => ({
374
+ name: p.name,
375
+ in: "query",
376
+ required: false,
377
+ description: p.description,
378
+ schema: p.schema
379
+ }));
380
+ }
381
+ function isParameter(value) {
382
+ return isPlainObject(value) && typeof value["name"] === "string" && typeof value["in"] === "string" && isPlainObject(value["schema"]);
383
+ }
384
+ function isPlanCarrier(input) {
385
+ return typeof input === "object" && "plan" in input;
386
+ }
387
+ /**
388
+ * `description` and `deprecated` from comments, read structurally so older
389
+ * metadata still works.
390
+ */
391
+ function docsOf(value) {
392
+ if (!value) return {};
393
+ const description = "description" in value ? value.description : void 0;
394
+ const deprecated = "deprecated" in value ? value.deprecated : void 0;
395
+ return {
396
+ ...typeof description === "string" && description !== "" ? { description } : {},
397
+ ...deprecated === true ? { deprecated: true } : {}
398
+ };
399
+ }
400
+ function jsonContent(schema) {
401
+ return { [JSON_TYPE]: { schema } };
402
+ }
403
+ function jsonResponse(schema, description) {
404
+ return {
405
+ description,
406
+ content: jsonContent(schema)
407
+ };
408
+ }
409
+ function mutableProperties(schema) {
410
+ const properties = schema["properties"];
411
+ if (!isPlainObject(properties)) return;
412
+ const copy = {};
413
+ for (const [key, value] of Object.entries(properties)) if (isPlainObject(value)) copy[key] = { ...value };
414
+ schema["properties"] = copy;
415
+ return copy;
416
+ }
417
+ function createBuildContext(meta, options) {
418
+ const prefix = options.extensionPrefix ?? "x-better-supabase-";
419
+ const diagnostics = [];
420
+ const report = (diagnostic) => {
421
+ diagnostics.push(diagnostic);
422
+ };
423
+ const base = (options.basePath ?? "").replace(/\/$/, "");
424
+ const globalErrors = options.errors ?? DEFAULT_ERRORS;
425
+ const schemas = { Problem: structuredClone(PROBLEM_SCHEMA) };
426
+ const responses = {};
427
+ for (const error of globalErrors) responses[error.name] = errorResponse(error);
428
+ const operations = [];
429
+ const tags = [...options.tags ?? []];
430
+ const served = /* @__PURE__ */ new Map();
431
+ const { authorizer } = options;
432
+ const addTag = (name, description) => {
433
+ if (tags.some((tag) => tag.name === name)) return;
434
+ tags.push({
435
+ name,
436
+ ...description ? { description } : {}
437
+ });
438
+ };
439
+ const addComponent = (name, schema) => {
440
+ const existing = schemas[name];
441
+ if (existing && JSON.stringify(existing) !== JSON.stringify(schema)) {
442
+ report({
443
+ code: "component-conflict",
444
+ severity: "error",
445
+ message: `Two different schemas are named "${name}"; the first one is kept`,
446
+ pointer: `/components/schemas/${pointerToken(name)}`
447
+ });
448
+ return;
449
+ }
450
+ schemas[name] = schema;
451
+ };
452
+ const keyOf = (ref, where) => {
453
+ if (authorizer) try {
454
+ return authorizer.key(ref);
455
+ } catch {
456
+ report({
457
+ code: "permission-unresolved",
458
+ severity: "error",
459
+ message: `${where}: the authorizer has no key for this permission`
460
+ });
461
+ return;
462
+ }
463
+ if (typeof ref === "string") return ref;
464
+ report({
465
+ code: "permission-unresolved",
466
+ severity: "error",
467
+ message: `${where}: a permission that is not a string needs an authorizer`
468
+ });
469
+ };
470
+ const converted = (standard, direction, where) => {
471
+ const result = convertStandard(standard, direction);
472
+ if (!result) report({
473
+ code: "schema-unconvertible",
474
+ severity: "warning",
475
+ message: `${where}: the schema does not implement Standard JSON Schema, so the spec allows any value`
476
+ });
477
+ return result;
478
+ };
479
+ const schemaOf = (standard, direction, role, operationId) => {
480
+ const result = converted(standard, direction, `${operationId} ${role}`);
481
+ if (!result) return {};
482
+ const name = options.componentName ? options.componentName({
483
+ kind: "schema",
484
+ id: result.name,
485
+ schema: result.schema,
486
+ role,
487
+ operationId
488
+ }) : result.name;
489
+ if (!name) return structuredClone(result.schema);
490
+ addComponent(name, structuredClone(result.schema));
491
+ return schemaRef(name);
492
+ };
493
+ const objectParameters = (standard, location, where) => {
494
+ const result = converted(standard, "input", where);
495
+ const properties = result?.schema["properties"];
496
+ if (!result || !isPlainObject(properties)) return [];
497
+ const required = result.schema["required"];
498
+ const requiredNames = Array.isArray(required) ? required : [];
499
+ return Object.entries(properties).flatMap(([name, schema]) => {
500
+ if (!isPlainObject(schema)) return [];
501
+ const description = schema["description"];
502
+ return [{
503
+ name,
504
+ in: location,
505
+ required: location === "path" || requiredNames.includes(name),
506
+ ...typeof description === "string" ? { description } : {},
507
+ schema: structuredClone(schema)
508
+ }];
509
+ });
510
+ };
511
+ const usedErrors = (errors, statuses, permission) => {
512
+ const out = {};
513
+ for (const error of errors) {
514
+ if (SCOPED_STATUSES.has(error.status) && !statuses.includes(error.status)) continue;
515
+ const status = String(error.status);
516
+ if (Object.hasOwn(out, status)) continue;
517
+ if (error.status === 403 && permission) continue;
518
+ responses[error.name] ??= errorResponse(error);
519
+ out[status] = { ref: error.name };
520
+ }
521
+ if (permission) {
522
+ responses[PERMISSION_DENIED] ??= permissionDeniedResponse();
523
+ out["403"] = { ref: PERMISSION_DENIED };
524
+ }
525
+ return out;
526
+ };
527
+ const extendFor = (extend, name) => {
528
+ if (!extend) return;
529
+ const all = extend["*"];
530
+ const own = extend[name];
531
+ if (!all && !own) return;
532
+ return mergeJson(all ?? {}, own ?? {});
533
+ };
534
+ return {
535
+ meta,
536
+ options,
537
+ prefix,
538
+ base,
539
+ globalErrors,
540
+ diagnostics,
541
+ schemas,
542
+ responses,
543
+ operations,
544
+ tags,
545
+ served,
546
+ report,
547
+ addTag,
548
+ addComponent,
549
+ keyOf,
550
+ schemaOf,
551
+ objectParameters,
552
+ usedErrors,
553
+ extendFor
554
+ };
555
+ }
556
+ function resourceScope(ctx, key, input) {
557
+ const { meta, options, prefix, base, globalErrors, operations, served, report, addTag, addComponent, keyOf, schemaOf, usedErrors, extendFor } = ctx;
558
+ const { authorizer } = options;
559
+ let plan;
560
+ if (isPlanCarrier(input)) plan = input.plan;
561
+ else {
562
+ if (!meta.tables[key]) throw new TypeError(`better-supabase/spec: unknown table "${key}"`);
563
+ plan = planResource(meta, key, input === true ? {} : input, authorizer);
564
+ }
565
+ const tableKey = plan.table;
566
+ const table = plan.meta;
567
+ const description = plan.description;
568
+ const name = pascal(tableKey);
569
+ const tableDocs = docsOf(table);
570
+ const defs = tableSchemas(meta, options.json ?? {});
571
+ const componentFor = (variant) => {
572
+ const defaultName = `${name}${variant}`;
573
+ return options.componentName?.({
574
+ kind: "table",
575
+ table: tableKey,
576
+ variant,
577
+ defaultName
578
+ }) ?? defaultName;
579
+ };
580
+ const components = {};
581
+ for (const variant of [
582
+ "Row",
583
+ "Insert",
584
+ "Update"
585
+ ]) {
586
+ const def = defs[`${tableKey}${variant}`];
587
+ if (!def) continue;
588
+ const schema = structuredClone(def);
589
+ if (tableDocs.description && schema["description"] === void 0) schema["description"] = tableDocs.description;
590
+ if (tableDocs.deprecated) schema["deprecated"] = true;
591
+ const properties = mutableProperties(schema);
592
+ for (const [column, property] of Object.entries(properties ?? {})) {
593
+ const docs = docsOf(table.columns[column]);
594
+ if (docs.description && property["description"] === void 0) property["description"] = docs.description;
595
+ if (docs.deprecated) property["deprecated"] = true;
596
+ }
597
+ const examples = options.examples?.[tableKey];
598
+ if (variant === "Row" && examples && examples.length > 0) schema["examples"] = structuredClone(examples);
599
+ const componentName = componentFor(variant);
600
+ components[variant] = componentName;
601
+ addComponent(componentName, schema);
602
+ }
603
+ const rowName = components.Row ?? componentFor("Row");
604
+ const cursor = plan.pagination === "cursor";
605
+ const pageName = componentFor("Page");
606
+ addComponent(pageName, pageSchema(schemaRef(rowName), cursor));
607
+ const tag = description.tag ?? tableKey;
608
+ addTag(tag, description.description ?? tableDocs.description);
609
+ const collection = `${base}${description.path ?? `/${tableKey}`}`;
610
+ const keyParam = plan.keyParam;
611
+ const rowProperties = defs[`${tableKey}Row`]?.["properties"];
612
+ const keySchema = keyParam && isPlainObject(rowProperties) ? rowProperties[keyParam] : void 0;
613
+ const idParameter = keyParam ? {
614
+ name: keyParam,
615
+ in: "path",
616
+ required: true,
617
+ schema: isPlainObject(keySchema) ? structuredClone(keySchema) : { type: "string" }
618
+ } : void 0;
619
+ const item = keyParam ? `${collection}/{${keyParam}}` : void 0;
620
+ const errors = description.errors ?? globalErrors;
621
+ const servedTable = {
622
+ table,
623
+ components,
624
+ operations: []
625
+ };
626
+ served.set(tableKey, servedTable);
627
+ const names = /* @__PURE__ */ new Set([
628
+ ...plan.operations,
629
+ ...plan.verbs,
630
+ ...plan.actions.map((action) => action.name)
631
+ ]);
632
+ for (const extendKey of Object.keys(description.extend ?? {})) if (extendKey !== "*" && !names.has(extendKey)) report({
633
+ code: "extend-unknown",
634
+ severity: "warning",
635
+ message: `${tableKey}.extend.${extendKey} names no operation or action of the resource`
636
+ });
637
+ const add = (opName, source, method, path, fields) => {
638
+ const defaultId = `${opName}${name}`;
639
+ const id = options.operationId?.({
640
+ source,
641
+ method,
642
+ path,
643
+ defaultId
644
+ }) ?? defaultId;
645
+ const ref = plan.permissions[opName];
646
+ const permission = ref === void 0 ? void 0 : keyOf(ref, `${tableKey}.${opName}`);
647
+ const extend = extendFor(description.extend, opName);
648
+ const { extensions, ...rest } = fields;
649
+ const operation = {
650
+ id,
651
+ method,
652
+ path,
653
+ tags: [tag],
654
+ source,
655
+ ...rest,
656
+ extensions: {
657
+ [`${prefix}table`]: `${table.schema}.${table.name}`,
658
+ ...extensions,
659
+ ...permission === void 0 ? {} : { [`${prefix}permission`]: permission }
660
+ },
661
+ ...permission === void 0 ? {} : { permission },
662
+ ...description.security ? { security: description.security } : {},
663
+ ...extend ? { extend } : {},
664
+ ...tableDocs.deprecated ? { deprecated: true } : {}
665
+ };
666
+ operations.push(operation);
667
+ servedTable.operations.push(operation);
668
+ };
669
+ const outputOf = (operation, fallback) => {
670
+ const output = description.output?.[operation];
671
+ return output ? schemaOf(output, "output", "output", `${operation}${name}`) : fallback;
672
+ };
673
+ const resourceOp = (operation) => ({
674
+ kind: "resource",
675
+ table: tableKey,
676
+ operation
677
+ });
678
+ const errorsFor = (operation) => usedErrors(errors, OPERATION_STATUSES[operation], plan.permissions[operation] !== void 0);
679
+ const opExtension = (operation) => ({ [`${prefix}operation`]: operation });
680
+ return {
681
+ ctx,
682
+ plan,
683
+ tableKey,
684
+ name,
685
+ description,
686
+ components,
687
+ componentFor,
688
+ rowName,
689
+ pageName,
690
+ cursor,
691
+ collection,
692
+ item,
693
+ idParameter,
694
+ errors,
695
+ add,
696
+ outputOf,
697
+ resourceOp,
698
+ errorsFor,
699
+ opExtension
700
+ };
701
+ }
702
+ function addTableOperation(scope, operation) {
703
+ const { plan, tableKey, name, description, components, componentFor, rowName, pageName, cursor, collection, item, idParameter, add, outputOf, resourceOp, errorsFor, opExtension } = scope;
704
+ const { schemaOf } = scope.ctx;
705
+ switch (operation) {
706
+ case "list": {
707
+ const listOutput = description.output?.list;
708
+ const pageRef = listOutput ? pageSchema(schemaOf(listOutput, "output", "item", `list${name}`), cursor) : schemaRef(pageName);
709
+ add("list", resourceOp("list"), "get", collection, {
710
+ summary: `List ${tableKey}`,
711
+ extensions: opExtension("list"),
712
+ parameters: description.list ? description.list.openapi.filter(isParameter) : pageParameters(cursor, plan.maxPageSize),
713
+ responses: {
714
+ "200": jsonResponse(pageRef, `A page of ${tableKey}.`),
715
+ ...errorsFor("list")
716
+ }
717
+ });
718
+ break;
719
+ }
720
+ case "create": {
721
+ const body = description.input?.create ? schemaOf(description.input.create, "input", "input", `create${name}`) : schemaRef(components.Insert ?? componentFor("Insert"));
722
+ add("create", resourceOp("create"), "post", collection, {
723
+ summary: `Create a ${tableKey} row`,
724
+ extensions: opExtension("create"),
725
+ parameters: [],
726
+ requestBody: {
727
+ required: true,
728
+ content: jsonContent(body)
729
+ },
730
+ responses: {
731
+ "201": jsonResponse(outputOf("create", schemaRef(rowName)), "Created."),
732
+ ...errorsFor("create")
733
+ }
734
+ });
735
+ break;
736
+ }
737
+ case "get":
738
+ if (!item || !idParameter) break;
739
+ add("get", resourceOp("get"), "get", item, {
740
+ summary: `Get a ${tableKey} row`,
741
+ extensions: opExtension("get"),
742
+ parameters: [idParameter],
743
+ responses: {
744
+ "200": jsonResponse(outputOf("get", schemaRef(rowName)), "The row."),
745
+ ...errorsFor("get")
746
+ }
747
+ });
748
+ break;
749
+ case "update": {
750
+ if (!item || !idParameter) break;
751
+ const body = description.input?.update ? schemaOf(description.input.update, "input", "input", `update${name}`) : schemaRef(components.Update ?? componentFor("Update"));
752
+ add("update", resourceOp("update"), "patch", item, {
753
+ summary: `Update a ${tableKey} row`,
754
+ extensions: opExtension("update"),
755
+ parameters: [idParameter],
756
+ requestBody: {
757
+ required: true,
758
+ content: jsonContent(body)
759
+ },
760
+ responses: {
761
+ "200": jsonResponse(outputOf("update", schemaRef(rowName)), "Updated."),
762
+ ...errorsFor("update")
763
+ }
764
+ });
765
+ break;
766
+ }
767
+ case "delete":
768
+ if (!item || !idParameter) break;
769
+ add("delete", resourceOp("delete"), "delete", item, {
770
+ summary: `Delete a ${tableKey} row`,
771
+ extensions: opExtension("delete"),
772
+ parameters: [idParameter],
773
+ responses: {
774
+ "204": { description: "Deleted." },
775
+ ...errorsFor("delete")
776
+ }
777
+ });
778
+ break;
779
+ default: throw new TypeError(`better-supabase/spec: unknown operation "${String(operation)}"`);
780
+ }
781
+ }
782
+ function addAction(scope, action) {
783
+ const { tableKey, name, idParameter, collection, errors, add } = scope;
784
+ const { prefix, schemaOf, objectParameters, usedErrors } = scope.ctx;
785
+ const method = action.method.toLowerCase();
786
+ if (!isMethod(method)) throw new TypeError(`${tableKey}.actions.${action.name}: unknown method`);
787
+ const operationId = `${action.name}${name}`;
788
+ const parameters = [...action.params.length > 0 && idParameter ? [idParameter] : [], ...action.query ? objectParameters(action.query, "query", `${operationId} query`) : []];
789
+ const status = String(action.status ?? (action.output ? 200 : 204));
790
+ const statuses = [
791
+ ...action.input || action.query ? [400] : [],
792
+ 401,
793
+ 403,
794
+ ...action.params.length > 0 ? [404] : [],
795
+ ...action.input ? [422] : []
796
+ ];
797
+ add(action.name, {
798
+ kind: "action",
799
+ table: tableKey,
800
+ action: action.name
801
+ }, method, `${collection}${action.path}`, {
802
+ ...action.summary ? { summary: action.summary } : {},
803
+ ...action.description ? { description: action.description } : {},
804
+ ...action.deprecated ? { deprecated: true } : {},
805
+ extensions: {
806
+ [`${prefix}action`]: action.name,
807
+ ...action.emits ? { [`${prefix}emits`]: [...action.emits] } : {}
808
+ },
809
+ parameters,
810
+ ...action.input ? { requestBody: {
811
+ required: true,
812
+ content: jsonContent(schemaOf(action.input, "input", "input", operationId))
813
+ } } : {},
814
+ responses: {
815
+ [status]: action.output ? jsonResponse(schemaOf(action.output, "output", "output", operationId), action.summary ?? "Done.") : { description: action.summary ?? "Done." },
816
+ ...usedErrors(errors, statuses, action.permission !== void 0)
817
+ }
818
+ });
819
+ }
820
+ const VERB_ARGUMENTS = {
821
+ page: "The page arguments of `db.<table>.page()`: `where`, `orderBy`, `size` with `page`, `offset` with `limit`, or `after`.",
822
+ count: "The arguments of `db.<table>.count()`, such as `where`.",
823
+ aggregate: "The arguments of `db.<table>.aggregate()`: the aggregates and `groupBy`.",
824
+ upsert: "A row to insert or update, or an array of rows."
825
+ };
826
+ function addVerb(scope, verb) {
827
+ const { plan, tableKey, components, componentFor, rowName, collection, errors, add } = scope;
828
+ const { prefix, usedErrors } = scope.ctx;
829
+ const row = schemaRef(rowName);
830
+ const insert = schemaRef(components.Insert ?? componentFor("Insert"));
831
+ const body = verb === "upsert" ? { oneOf: [insert, {
832
+ type: "array",
833
+ items: insert
834
+ }] } : { type: "object" };
835
+ const output = (() => {
836
+ switch (verb) {
837
+ case "page": return pageSchema(row, plan.pagination === "cursor");
838
+ case "count": return {
839
+ type: "integer",
840
+ minimum: 0
841
+ };
842
+ case "aggregate": return {};
843
+ case "upsert": return { oneOf: [row, {
844
+ type: "array",
845
+ items: row
846
+ }] };
847
+ default: throw new TypeError(`Unknown verb ${String(verb)}`);
848
+ }
849
+ })();
850
+ add(verb, {
851
+ kind: "verb",
852
+ owner: "table",
853
+ name: tableKey,
854
+ verb
855
+ }, "post", `${collection}/${verb}`, {
856
+ summary: `${verb[0].toUpperCase()}${verb.slice(1)} ${tableKey}`,
857
+ extensions: { [`${prefix}verb`]: verb },
858
+ parameters: [],
859
+ requestBody: {
860
+ required: verb === "upsert",
861
+ description: VERB_ARGUMENTS[verb],
862
+ content: jsonContent(body)
863
+ },
864
+ responses: {
865
+ "200": jsonResponse(output, "The result."),
866
+ ...usedErrors(errors, VERB_STATUSES$1[verb], plan.permissions[verb] !== void 0)
867
+ }
868
+ });
869
+ }
870
+ /** Adds one resource's components, tag and operations to the build. */
871
+ function buildResource(ctx, key, input) {
872
+ const scope = resourceScope(ctx, key, input);
873
+ for (const operation of scope.plan.operations) addTableOperation(scope, operation);
874
+ for (const verb of scope.plan.verbs) addVerb(scope, verb);
875
+ for (const action of scope.plan.actions) addAction(scope, action);
876
+ }
877
+ // src/spec/build-blocks.ts
878
+ /** The contract verbs that only read, so `requirePermissions` skips them. */
879
+ const READ_VERBS = /* @__PURE__ */ new Set([
880
+ "list",
881
+ "page",
882
+ "get",
883
+ "count",
884
+ "aggregate"
885
+ ]);
886
+ const VERB_STATUSES = [
887
+ 400,
888
+ 401,
889
+ 403,
890
+ 404,
891
+ 409,
892
+ 422
893
+ ];
894
+ function isStandard(value) {
895
+ return isPlainObject(value) && isPlainObject(value["~standard"]);
896
+ }
897
+ /** Every verb of an instance: its methods, then `member.method`. */
898
+ function instanceVerbs(surface) {
899
+ return [...surface.methods, ...Object.entries(surface.members).flatMap(([member, methods]) => methods.map((method) => `${member}.${method}`))];
900
+ }
901
+ /**
902
+ * The body schema of `create` and `list` when the block has one entity with
903
+ * that schema; any other verb takes its arguments as documented on the client.
904
+ */
905
+ function inputOf(surface, verb) {
906
+ const field = verb === "create" ? "input" : verb === "list" ? "listFilter" : void 0;
907
+ if (field === void 0) return;
908
+ const found = Object.values(surface.schemas).flatMap((entity) => {
909
+ const schema = entity[field];
910
+ return isStandard(schema) ? [schema] : [];
911
+ });
912
+ return found.length === 1 ? found[0] : void 0;
913
+ }
914
+ /** The block instances `options.blocks` publishes, with their descriptions. */
915
+ function publishedBlocks(source, input) {
916
+ if (input === false || source === void 0) return {};
917
+ if (input === void 0) return Object.fromEntries(source.instances.map((key) => [key, {}]));
918
+ return Object.fromEntries(Object.entries(input).map(([key, entry]) => [key, entry === true ? {} : entry]));
919
+ }
920
+ /** Adds `POST /<instance>/<verb>` for each published block instance. */
921
+ function buildBlocks(ctx, source, input) {
922
+ if (source === void 0) return;
923
+ for (const [key, description] of Object.entries(publishedBlocks(source, input))) {
924
+ if (!source.instances.includes(key)) {
925
+ ctx.report({
926
+ code: "block-unknown",
927
+ severity: "error",
928
+ message: `blocks.${key} names no block instance of betterSupabase.blocks()`
929
+ });
930
+ continue;
931
+ }
932
+ const surface = source.describe?.(key);
933
+ if (!surface) {
934
+ ctx.report({
935
+ code: "block-undescribed",
936
+ severity: "warning",
937
+ message: `The ${key} block instance can't list its methods, so the API leaves it out`
938
+ });
939
+ continue;
940
+ }
941
+ buildInstance(ctx, key, surface, description);
942
+ }
943
+ }
944
+ function buildInstance(ctx, key, surface, description) {
945
+ const { options, prefix, base, globalErrors, operations, report, addTag, keyOf, schemaOf, usedErrors } = ctx;
946
+ const available = instanceVerbs(surface);
947
+ const verbs = description.verbs ?? available;
948
+ const tag = description.tag ?? key;
949
+ const property = instanceProperty(key);
950
+ const collection = `${base}${description.path ?? `/${key}`}`;
951
+ addTag(tag, description.description);
952
+ for (const verb of verbs) {
953
+ if (!available.includes(verb)) {
954
+ report({
955
+ code: "block-verb-unknown",
956
+ severity: "error",
957
+ message: `blocks.${key}.verbs: the ${surface.block} client has no ${verb} method`
958
+ });
959
+ continue;
960
+ }
961
+ const [first, second] = verb.split(".");
962
+ const member = second === void 0 ? void 0 : first;
963
+ const method = second ?? first ?? verb;
964
+ const source = {
965
+ kind: "verb",
966
+ owner: "block",
967
+ name: key,
968
+ ...member === void 0 ? {} : { member },
969
+ verb: method
970
+ };
971
+ const path = `${collection}/${verb.replaceAll(".", "/")}`;
972
+ const defaultId = `${property}.${verb}`;
973
+ const id = options.operationId?.({
974
+ source,
975
+ method: "post",
976
+ path,
977
+ defaultId
978
+ }) ?? defaultId;
979
+ const ref = description.permissions?.[verb];
980
+ const permission = ref === void 0 ? void 0 : keyOf(ref, `blocks.${key}.${verb}`);
981
+ const standard = inputOf(surface, verb);
982
+ const body = standard ? schemaOf(standard, "input", "input", id) : {};
983
+ operations.push({
984
+ id,
985
+ method: "post",
986
+ path,
987
+ tags: [tag],
988
+ source,
989
+ summary: `${verb} (${key})`,
990
+ description: `Calls \`db.${property}.${verb}()\`. A method that takes more than one argument takes them as a JSON array.`,
991
+ parameters: [],
992
+ requestBody: {
993
+ required: false,
994
+ content: jsonContent(body)
995
+ },
996
+ responses: {
997
+ "200": jsonResponse({}, "What the method returns."),
998
+ ...usedErrors(globalErrors, VERB_STATUSES, permission !== void 0)
999
+ },
1000
+ extensions: {
1001
+ [`${prefix}block`]: surface.block,
1002
+ [`${prefix}instance`]: key,
1003
+ [`${prefix}verb`]: verb,
1004
+ ...permission === void 0 ? {} : { [`${prefix}permission`]: permission }
1005
+ },
1006
+ ...permission === void 0 ? {} : { permission },
1007
+ ...description.security ? { security: description.security } : {}
1008
+ });
1009
+ }
1010
+ }
1011
+ // src/spec/data-api.ts
1012
+ const REST = "/rest/v1";
1013
+ const DEFAULT_TAG = "Data API";
1014
+ const ERROR = "DataApiError";
1015
+ /** The error body PostgREST answers with. */
1016
+ const ERROR_SCHEMA = {
1017
+ type: "object",
1018
+ required: ["message"],
1019
+ properties: {
1020
+ code: { type: "string" },
1021
+ message: { type: "string" },
1022
+ details: { type: ["string", "null"] },
1023
+ hint: { type: ["string", "null"] }
1024
+ }
1025
+ };
1026
+ /**
1027
+ * Query parameters PostgREST reserves, so a column with the name gets no
1028
+ * filter.
1029
+ */
1030
+ const RESERVED = /* @__PURE__ */ new Set([
1031
+ "select",
1032
+ "order",
1033
+ "limit",
1034
+ "offset",
1035
+ "columns",
1036
+ "on_conflict",
1037
+ "or",
1038
+ "and",
1039
+ "not"
1040
+ ]);
1041
+ const INTEGER = /* @__PURE__ */ new Set([
1042
+ "int2",
1043
+ "int4",
1044
+ "int8"
1045
+ ]);
1046
+ const NUMBER = /* @__PURE__ */ new Set([
1047
+ "float4",
1048
+ "float8",
1049
+ "numeric",
1050
+ "oid",
1051
+ "money"
1052
+ ]);
1053
+ /** The scheme names the `apiKey` and `bearer` presets register. */
1054
+ const DATA_API_SECURITY = [{
1055
+ supabaseApiKey: [],
1056
+ supabaseJwt: []
1057
+ }, { supabaseApiKey: [] }];
1058
+ /** JSON Schema for a Postgres type as PostgREST writes it. */
1059
+ function typeSchema(meta, type) {
1060
+ if (type.startsWith("_")) return {
1061
+ type: "array",
1062
+ items: typeSchema(meta, type.slice(1))
1063
+ };
1064
+ const values = meta.enums[type];
1065
+ if (values) return {
1066
+ type: "string",
1067
+ enum: [...values]
1068
+ };
1069
+ if (INTEGER.has(type)) return { type: "integer" };
1070
+ if (NUMBER.has(type)) return { type: "number" };
1071
+ switch (type) {
1072
+ case "bool": return { type: "boolean" };
1073
+ case "uuid": return {
1074
+ type: "string",
1075
+ format: "uuid"
1076
+ };
1077
+ case "timestamptz": return {
1078
+ type: "string",
1079
+ format: "date-time"
1080
+ };
1081
+ case "date": return {
1082
+ type: "string",
1083
+ format: "date"
1084
+ };
1085
+ case "json":
1086
+ case "jsonb":
1087
+ case "record":
1088
+ case "void": return {};
1089
+ default: return { type: "string" };
1090
+ }
1091
+ }
1092
+ /**
1093
+ * A table schema with database column names, as the Data API reads and writes
1094
+ * them.
1095
+ */
1096
+ function databaseCased(schema, table) {
1097
+ const dbName = (name) => table.columns[name]?.db ?? name;
1098
+ const properties = schema["properties"];
1099
+ const required = schema["required"];
1100
+ return {
1101
+ ...schema,
1102
+ ...isPlainObject(properties) ? { properties: Object.fromEntries(Object.entries(properties).map(([name, value]) => [dbName(name), value])) } : {},
1103
+ ...Array.isArray(required) ? { required: required.map((name) => typeof name === "string" ? dbName(name) : name) } : {}
1104
+ };
1105
+ }
1106
+ const qualified = (schema, name) => schema === "public" ? name : `${schema}.${name}`;
1107
+ const STRING = { type: "string" };
1108
+ const header = (name, description, schema, required = false) => ({
1109
+ name,
1110
+ in: "header",
1111
+ required,
1112
+ description,
1113
+ schema: schema ?? STRING
1114
+ });
1115
+ const query = (name, description, schema) => ({
1116
+ name,
1117
+ in: "query",
1118
+ required: false,
1119
+ description,
1120
+ schema: schema ?? STRING
1121
+ });
1122
+ /**
1123
+ * The `Accept-Profile` or `Content-Profile` header a table outside `public`
1124
+ * needs.
1125
+ */
1126
+ function profile(schema, write) {
1127
+ return schema === "public" ? [] : [header(write ? "Content-Profile" : "Accept-Profile", `The schema of the table, \`${schema}\`.`, {
1128
+ type: "string",
1129
+ enum: [schema]
1130
+ }, true)];
1131
+ }
1132
+ const PREFER_WRITE = header("Prefer", "`return=representation` answers with the written rows; `return=minimal` (the default) answers without a body.");
1133
+ /**
1134
+ * Documents the Data API: table operations under `/rest/v1/<table>` and RPCs
1135
+ * under `/rest/v1/rpc/<name>`.
1136
+ */
1137
+ function buildDataApi(ctx, dataApi) {
1138
+ const { meta, options, operations, report, addTag, addComponent, responses } = ctx;
1139
+ const tag = dataApi.tag ?? DEFAULT_TAG;
1140
+ const origin = options.supabaseUrl?.replace(/\/$/, "");
1141
+ if (!origin) report({
1142
+ code: "data-api-server-missing",
1143
+ severity: "warning",
1144
+ message: "dataApi needs supabaseUrl: without it the /rest/v1 paths resolve against the document's servers"
1145
+ });
1146
+ const servers = origin ? [{
1147
+ url: origin,
1148
+ description: "The Supabase project."
1149
+ }] : void 0;
1150
+ const defs = tableSchemas(meta, options.json ?? {});
1151
+ const tableKeys = /* @__PURE__ */ new Set();
1152
+ const unknownTable = (key, where) => {
1153
+ report({
1154
+ code: "data-api-table-unknown",
1155
+ severity: "error",
1156
+ message: `${where}: no table or view "${key}"`
1157
+ });
1158
+ };
1159
+ if (dataApi.tables === true) for (const key of Object.keys(meta.tables).toSorted()) tableKeys.add(key);
1160
+ else for (const key of dataApi.tables ?? []) if (meta.tables[key]) tableKeys.add(key);
1161
+ else unknownTable(key, "dataApi.tables");
1162
+ for (const key of Object.keys(dataApi.operations ?? {})) if (!meta.tables[key]) unknownTable(key, "dataApi.operations");
1163
+ else if (!tableKeys.has(key)) tableKeys.add(key);
1164
+ const functionKeys = [];
1165
+ if (dataApi.functions === true) functionKeys.push(...Object.keys(meta.functions).toSorted());
1166
+ else for (const key of dataApi.functions ?? []) if (meta.functions[key]) functionKeys.push(key);
1167
+ else report({
1168
+ code: "data-api-function-unknown",
1169
+ severity: "error",
1170
+ message: `dataApi.functions: no function "${key}"`
1171
+ });
1172
+ if (tableKeys.size === 0 && functionKeys.length === 0) return;
1173
+ addTag(tag, "The Supabase Data API (PostgREST). Every request runs under row-level security.");
1174
+ addComponent(ERROR, structuredClone(ERROR_SCHEMA));
1175
+ responses[ERROR] ??= {
1176
+ description: "PostgREST rejected the request.",
1177
+ content: jsonContent(schemaRef(ERROR))
1178
+ };
1179
+ const errors = { "4XX": { ref: ERROR } };
1180
+ /**
1181
+ * The database-cased component of a table variant, or `undefined` when the
1182
+ * table has none.
1183
+ */
1184
+ const component = (key, variant) => {
1185
+ const table = meta.tables[key];
1186
+ const schema = defs[`${key}${variant}`];
1187
+ if (!table || !schema) return;
1188
+ const name = `DataApi${pascal(table.schema === "public" ? "" : `${table.schema}_`)}${pascal(table.name)}${variant}`;
1189
+ addComponent(name, databaseCased(structuredClone(schema), table));
1190
+ return schemaRef(name);
1191
+ };
1192
+ const push = (draft) => {
1193
+ const { defaultId, ...rest } = draft;
1194
+ operations.push({
1195
+ ...rest,
1196
+ id: options.operationId?.({
1197
+ source: draft.source,
1198
+ method: draft.method,
1199
+ path: draft.path,
1200
+ defaultId
1201
+ }) ?? defaultId,
1202
+ tags: [tag],
1203
+ ...servers ? { servers } : {},
1204
+ security: DATA_API_SECURITY,
1205
+ extensions: {}
1206
+ });
1207
+ };
1208
+ for (const key of tableKeys) {
1209
+ const table = meta.tables[key];
1210
+ if (table) buildTable(key, table);
1211
+ }
1212
+ for (const key of functionKeys) {
1213
+ const fn = meta.functions[key];
1214
+ if (fn) buildFunction(key, fn);
1215
+ }
1216
+ function buildTable(key, table) {
1217
+ const row = component(key, "Row") ?? {};
1218
+ const insert = component(key, "Insert");
1219
+ const update = component(key, "Update");
1220
+ const rows = {
1221
+ type: "array",
1222
+ items: row
1223
+ };
1224
+ const path = `${REST}/${table.name}`;
1225
+ const name = pascal(table.schema === "public" ? table.name : `${table.schema}_${table.name}`);
1226
+ const label = qualified(table.schema, table.name);
1227
+ const filters = Object.values(table.columns).filter((column) => !RESERVED.has(column.db)).map((column) => query(column.db, `Filters on \`${column.db}\` with an operator and a value: \`eq.<value>\`, \`in.(a,b)\`, \`is.null\`.`));
1228
+ const viewOperations = ["select"];
1229
+ if (insert) viewOperations.push("insert");
1230
+ if (update) viewOperations.push("update", "delete");
1231
+ const allowed = dataApi.operations?.[key] ?? (table.kind === "view" ? viewOperations : [
1232
+ "select",
1233
+ "insert",
1234
+ "update",
1235
+ "delete"
1236
+ ]);
1237
+ const source = (operation) => ({
1238
+ kind: "data-api",
1239
+ table: key,
1240
+ operation
1241
+ });
1242
+ const written = (status, description) => ({ [status]: jsonResponse(rows, `${description} The body holds the rows with \`Prefer: return=representation\`.`) });
1243
+ for (const operation of allowed) switch (operation) {
1244
+ case "select":
1245
+ push({
1246
+ defaultId: `dataApiSelect${name}`,
1247
+ method: "get",
1248
+ path,
1249
+ summary: `Read rows of ${label}`,
1250
+ parameters: [
1251
+ query("select", "The columns to return, comma separated, and embedded relations as `relation(columns)`. Defaults to `*`."),
1252
+ query("order", "Sort order, such as `created_at.desc,id`."),
1253
+ query("limit", "The most rows to return.", {
1254
+ type: "integer",
1255
+ minimum: 0
1256
+ }),
1257
+ query("offset", "The rows to skip.", {
1258
+ type: "integer",
1259
+ minimum: 0
1260
+ }),
1261
+ ...filters,
1262
+ header("Range", "A row range, such as `0-24`."),
1263
+ header("Prefer", "`count=exact`, `count=planned` or `count=estimated` adds the total to `Content-Range`."),
1264
+ ...profile(table.schema, false)
1265
+ ],
1266
+ responses: {
1267
+ "200": {
1268
+ ...jsonResponse(rows, "The rows."),
1269
+ headers: { "Content-Range": {
1270
+ description: "The returned range and the total, such as `0-24/100`.",
1271
+ schema: { type: "string" }
1272
+ } }
1273
+ },
1274
+ "206": jsonResponse(rows, "Part of the rows, for a `Range` request."),
1275
+ ...errors
1276
+ },
1277
+ source: source("select")
1278
+ });
1279
+ break;
1280
+ case "insert":
1281
+ push({
1282
+ defaultId: `dataApiInsert${name}`,
1283
+ method: "post",
1284
+ path,
1285
+ summary: `Insert rows into ${label}`,
1286
+ parameters: [
1287
+ query("columns", "The columns to read from the body, comma separated."),
1288
+ query("on_conflict", "The unique columns an upsert matches on, comma separated."),
1289
+ PREFER_WRITE,
1290
+ ...profile(table.schema, true)
1291
+ ],
1292
+ requestBody: {
1293
+ required: true,
1294
+ content: jsonContent(insert ? { oneOf: [insert, {
1295
+ type: "array",
1296
+ items: insert
1297
+ }] } : {})
1298
+ },
1299
+ responses: {
1300
+ ...written("201", "Created."),
1301
+ ...errors
1302
+ },
1303
+ source: source("insert")
1304
+ });
1305
+ break;
1306
+ case "update":
1307
+ push({
1308
+ defaultId: `dataApiUpdate${name}`,
1309
+ method: "patch",
1310
+ path,
1311
+ summary: `Update rows of ${label}`,
1312
+ description: "Updates every row the filters match.",
1313
+ parameters: [
1314
+ ...filters,
1315
+ PREFER_WRITE,
1316
+ ...profile(table.schema, true)
1317
+ ],
1318
+ requestBody: {
1319
+ required: true,
1320
+ content: jsonContent(update ?? {})
1321
+ },
1322
+ responses: {
1323
+ ...written("200", "Updated."),
1324
+ "204": { description: "Updated, without a body." },
1325
+ ...errors
1326
+ },
1327
+ source: source("update")
1328
+ });
1329
+ break;
1330
+ case "delete":
1331
+ push({
1332
+ defaultId: `dataApiDelete${name}`,
1333
+ method: "delete",
1334
+ path,
1335
+ summary: `Delete rows of ${label}`,
1336
+ description: "Deletes every row the filters match.",
1337
+ parameters: [
1338
+ ...filters,
1339
+ PREFER_WRITE,
1340
+ ...profile(table.schema, true)
1341
+ ],
1342
+ responses: {
1343
+ ...written("200", "Deleted."),
1344
+ "204": { description: "Deleted, without a body." },
1345
+ ...errors
1346
+ },
1347
+ source: source("delete")
1348
+ });
1349
+ break;
1350
+ default: throw new TypeError(`Unknown Data API operation "${String(operation)}"`);
1351
+ }
1352
+ }
1353
+ function argumentsSchema(signature) {
1354
+ const required = signature.args.filter((arg) => arg.optional !== true).map((arg) => arg.name);
1355
+ return {
1356
+ type: "object",
1357
+ properties: Object.fromEntries(signature.args.map((arg) => [arg.name, typeSchema(meta, arg.type)])),
1358
+ ...required.length > 0 ? { required } : {},
1359
+ additionalProperties: false
1360
+ };
1361
+ }
1362
+ function resultSchema(fn) {
1363
+ const { result } = fn;
1364
+ let one;
1365
+ if (result && "table" in result) one = component(result.table, "Row") ?? {};
1366
+ else if (result) one = {
1367
+ type: "object",
1368
+ properties: Object.fromEntries(result.columns.map((column) => [column.db, {}])),
1369
+ required: result.columns.map((column) => column.db)
1370
+ };
1371
+ else {
1372
+ const rowTable = Object.entries(meta.tables).find(([, table]) => table.name === fn.returns && table.schema === fn.schema);
1373
+ one = rowTable ? component(rowTable[0], "Row") ?? {} : typeSchema(meta, fn.returns);
1374
+ }
1375
+ return fn.returnsSet ? {
1376
+ type: "array",
1377
+ items: one
1378
+ } : one;
1379
+ }
1380
+ function buildFunction(key, fn) {
1381
+ const signatures = fn.overloads ?? [fn];
1382
+ const bodies = signatures.map(argumentsSchema);
1383
+ const [only] = bodies;
1384
+ const body = bodies.length === 1 && only ? only : { oneOf: bodies };
1385
+ const takesArgs = signatures.some((signature) => signature.args.length > 0);
1386
+ push({
1387
+ defaultId: `dataApiRpc${pascal(fn.schema === "public" ? fn.name : `${fn.schema}_${fn.name}`)}`,
1388
+ method: "post",
1389
+ path: `${REST}/rpc/${fn.name}`,
1390
+ summary: `Call ${qualified(fn.schema, fn.name)}`,
1391
+ description: `A ${fn.volatility} function.${fn.volatility === "volatile" ? "" : " A GET with the arguments as query parameters calls it too."}`,
1392
+ parameters: profile(fn.schema, true),
1393
+ requestBody: {
1394
+ required: takesArgs,
1395
+ content: jsonContent(body)
1396
+ },
1397
+ responses: {
1398
+ ...fn.returns === "void" && !fn.returnsSet ? { "204": { description: "Done." } } : { "200": jsonResponse(resultSchema(fn), "The result.") },
1399
+ ...errors
1400
+ },
1401
+ source: {
1402
+ kind: "data-api",
1403
+ function: key,
1404
+ operation: "rpc"
1405
+ }
1406
+ });
1407
+ }
1408
+ }
1409
+ /** Adds the `apiKey` and `bearer` schemes the Data API operations require. */
1410
+ function withDataApiSchemes(security, operations, supabaseUrl) {
1411
+ if (!operations.some((operation) => operation.source.kind === "data-api")) return security;
1412
+ const { schemes } = resolveSecurity(["apiKey", "bearer"], supabaseUrl);
1413
+ return {
1414
+ schemes: {
1415
+ ...schemes,
1416
+ ...security.schemes
1417
+ },
1418
+ requirements: security.requirements
1419
+ };
1420
+ }
1421
+ // src/spec/events.ts
1422
+ /**
1423
+ * Whether a value is a `defineTopic()` result: a template string and the `sql`,
1424
+ * `trigger` and `subscribe` methods. `better-supabase upgrade` and `spec` use
1425
+ * the same check.
1426
+ */
1427
+ function isTopicLike(value) {
1428
+ return isRecord(value) && typeof value["template"] === "string" && typeof value["sql"] === "function" && typeof value["trigger"] === "function" && typeof value["subscribe"] === "function";
1429
+ }
1430
+ /**
1431
+ * The `defineTopic()` results in modules or arrays, for `events.topics`. A
1432
+ * module's topics are keyed by export name; a topic in an array by its `name`.
1433
+ * Other values are skipped, and a topic reached twice is kept once.
1434
+ *
1435
+ * ```ts
1436
+ * import * as topics from "../realtime/topics";
1437
+ * defineApi(betterSupabase, {
1438
+ * info,
1439
+ * events: { topics: topicsFrom(topics) },
1440
+ * });
1441
+ * ```
1442
+ */
1443
+ function topicsFrom(...sources) {
1444
+ const topics = {};
1445
+ const seen = /* @__PURE__ */ new Set();
1446
+ for (const source of sources) {
1447
+ const entries = Array.isArray(source) ? source.map((value) => [void 0, value]) : Object.entries(source);
1448
+ for (const [key, value] of entries) {
1449
+ if (!isTopicLike(value) || seen.has(value)) continue;
1450
+ seen.add(value);
1451
+ topics[key ?? value.name ?? value.template] = value;
1452
+ }
1453
+ }
1454
+ return topics;
1455
+ }
1456
+ const OPEN = { type: "object" };
1457
+ const DEFAULT_INTENTS = [
1458
+ "insert",
1459
+ "update",
1460
+ "delete"
1461
+ ];
1462
+ /** An id safe for AsyncAPI channel, operation and component keys. */
1463
+ function safeKey(value) {
1464
+ return value.replaceAll(/[^A-Za-z0-9_-]/g, "_");
1465
+ }
1466
+ const keyPart = (value) => safeKey(pascal(value));
1467
+ /** The CloudEvents attributes in HTTP binary mode (`ce-*` headers). */
1468
+ const CLOUD_EVENT_TRAIT = {
1469
+ description: "CloudEvents 1.0 attributes in HTTP binary mode.",
1470
+ contentType: "application/json",
1471
+ headers: {
1472
+ type: "object",
1473
+ properties: {
1474
+ "ce-specversion": {
1475
+ type: "string",
1476
+ const: "1.0"
1477
+ },
1478
+ "ce-id": { type: "string" },
1479
+ "ce-source": {
1480
+ type: "string",
1481
+ format: "uri-reference"
1482
+ },
1483
+ "ce-type": { type: "string" },
1484
+ "ce-subject": { type: "string" },
1485
+ "ce-time": {
1486
+ type: "string",
1487
+ format: "date-time"
1488
+ },
1489
+ "ce-dataschema": {
1490
+ type: "string",
1491
+ format: "uri"
1492
+ },
1493
+ "ce-partitionkey": { type: "string" }
1494
+ }
1495
+ }
1496
+ };
1497
+ function cloudEventHeaders(type, dataschema) {
1498
+ return {
1499
+ type: "object",
1500
+ required: [
1501
+ "ce-specversion",
1502
+ "ce-id",
1503
+ "ce-source",
1504
+ "ce-type"
1505
+ ],
1506
+ properties: {
1507
+ "ce-type": {
1508
+ type: "string",
1509
+ const: type
1510
+ },
1511
+ ...dataschema ? { "ce-dataschema": {
1512
+ type: "string",
1513
+ const: dataschema
1514
+ } } : {}
1515
+ }
1516
+ };
1517
+ }
1518
+ function convert(schema, where, ctx) {
1519
+ if (schema === true) return OPEN;
1520
+ const converted = convertStandard(schema, "output");
1521
+ if (converted) return converted.schema;
1522
+ ctx.report({
1523
+ code: "asyncapi-schema-opaque",
1524
+ severity: "warning",
1525
+ message: `${where}: the schema does not implement Standard JSON Schema; the payload is left open`
1526
+ });
1527
+ return OPEN;
1528
+ }
1529
+ function tableChannels(ctx, selection, channels, messages) {
1530
+ if (selection === false) return;
1531
+ const realtime = ctx.meta.realtime ?? {};
1532
+ const keys = selection === true ? Object.keys(realtime) : selection;
1533
+ for (const key of keys) {
1534
+ const table = ctx.meta.tables[key];
1535
+ const config = realtime[key];
1536
+ if (!table || !config) {
1537
+ ctx.report({
1538
+ code: "asyncapi-table-unknown",
1539
+ severity: "error",
1540
+ message: `events.tables names "${key}", which is not in database.realtime.tables`
1541
+ });
1542
+ continue;
1543
+ }
1544
+ const id = `table${keyPart(key)}`;
1545
+ const base = `bsb:t:${table.schema}.${table.name}`;
1546
+ const address = config.user ? `${base}:u:{userId}` : config.tenant ? `${base}:{tenant}` : base;
1547
+ const messageId = `${id}Change`;
1548
+ messages[messageId] = {
1549
+ id: messageId,
1550
+ name: "change",
1551
+ title: `${key} changed`,
1552
+ summary: `A row of ${table.schema}.${table.name} was inserted, updated or deleted. Clients refetch through row-level security.`,
1553
+ contentType: "application/json",
1554
+ payload: {
1555
+ type: "object",
1556
+ required: [
1557
+ "schema",
1558
+ "table",
1559
+ "operation"
1560
+ ],
1561
+ properties: {
1562
+ schema: {
1563
+ type: "string",
1564
+ const: table.schema
1565
+ },
1566
+ table: {
1567
+ type: "string",
1568
+ const: table.name
1569
+ },
1570
+ operation: {
1571
+ type: "string",
1572
+ enum: [
1573
+ "INSERT",
1574
+ "UPDATE",
1575
+ "DELETE"
1576
+ ]
1577
+ }
1578
+ }
1579
+ },
1580
+ extensions: { [`${ctx.prefix}event`]: "change" }
1581
+ };
1582
+ channels.push({
1583
+ id,
1584
+ address,
1585
+ title: `${key} changes`,
1586
+ protocol: "ws",
1587
+ ...config.user ? { parameters: { userId: { description: "The signed-in user's id." } } } : config.tenant ? { parameters: { tenant: { description: `The row's \`${config.tenant}\` value.` } } } : {},
1588
+ messages: [messageId],
1589
+ operations: [{
1590
+ id: `receive${keyPart(key)}Changes`,
1591
+ action: "receive",
1592
+ summary: `Change signals for ${key}`
1593
+ }],
1594
+ extensions: {
1595
+ [`${ctx.prefix}table`]: `${table.schema}.${table.name}`,
1596
+ [`${ctx.prefix}realtime-status`]: topicStatus({ private: true })
1597
+ }
1598
+ });
1599
+ }
1600
+ }
1601
+ function topicChannels(ctx, topics, channels, messages) {
1602
+ for (const [key, topic] of Object.entries(topics)) {
1603
+ const id = `topic${keyPart(key)}`;
1604
+ const ids = [];
1605
+ const events = Object.entries(topic.events ?? {});
1606
+ if (events.length === 0) {
1607
+ ctx.report({
1608
+ code: "asyncapi-topic-open",
1609
+ severity: "info",
1610
+ message: `Topic "${key}" lists no events; it is documented with one open message`
1611
+ });
1612
+ events.push(["*", true]);
1613
+ }
1614
+ for (const [event, schema] of events) {
1615
+ const messageId = `${id}${event === "*" ? "Any" : keyPart(event)}`;
1616
+ ids.push(messageId);
1617
+ messages[messageId] = {
1618
+ id: messageId,
1619
+ ...event === "*" ? {} : { name: event },
1620
+ title: event === "*" ? `${key} broadcast` : `${key} ${event}`,
1621
+ contentType: "application/json",
1622
+ payload: convert(schema, `topics.${key}.events.${event}`, ctx),
1623
+ extensions: { [`${ctx.prefix}event`]: event }
1624
+ };
1625
+ }
1626
+ if (topic.presence) {
1627
+ const messageId = `${id}Presence`;
1628
+ ids.push(messageId);
1629
+ messages[messageId] = {
1630
+ id: messageId,
1631
+ name: "presence",
1632
+ title: `${key} presence`,
1633
+ contentType: "application/json",
1634
+ payload: topic.presenceSchema ? convert(topic.presenceSchema, `topics.${key}.presence`, ctx) : OPEN,
1635
+ extensions: { [`${ctx.prefix}event`]: "presence" }
1636
+ };
1637
+ }
1638
+ const permission = topic.permission === void 0 ? void 0 : ctx.keyOf(topic.permission, `topics.${key}`);
1639
+ const extra = permission === void 0 ? {} : { permission };
1640
+ const operations = [{
1641
+ id: `receive${keyPart(key)}`,
1642
+ action: "receive",
1643
+ ...topic.summary ? { summary: topic.summary } : {},
1644
+ ...extra
1645
+ }];
1646
+ if (topic.send === true || topic.clientSend === true || topic.presence) operations.push({
1647
+ id: `send${keyPart(key)}`,
1648
+ action: "send",
1649
+ ...extra
1650
+ });
1651
+ const params = [...topic.template.matchAll(/\{([^}]+)\}/g)].map((match) => match[1] ?? "");
1652
+ channels.push({
1653
+ id,
1654
+ address: topic.template,
1655
+ ...topic.summary ? { summary: topic.summary } : {},
1656
+ ...topic.description ? { description: topic.description } : {},
1657
+ title: topic.name ?? key,
1658
+ ...params.length > 0 ? { parameters: Object.fromEntries(params.map((name) => [name, {}])) } : {},
1659
+ protocol: "ws",
1660
+ messages: ids,
1661
+ operations,
1662
+ extensions: {
1663
+ [`${ctx.prefix}private`]: topic.private ?? true,
1664
+ [`${ctx.prefix}realtime-status`]: topic.status ?? topicStatus(topic)
1665
+ }
1666
+ });
1667
+ }
1668
+ }
1669
+ function withActor(schema) {
1670
+ const properties = schema["properties"];
1671
+ if (!isPlainObject(properties) || "actorId" in properties) return schema;
1672
+ return {
1673
+ ...schema,
1674
+ properties: {
1675
+ ...properties,
1676
+ actorId: {
1677
+ type: "string",
1678
+ description: "Who caused the event."
1679
+ }
1680
+ }
1681
+ };
1682
+ }
1683
+ function cloudEventChannel(ctx, input, channels, messages) {
1684
+ const ids = [];
1685
+ const add = (messageId, type, title, payload, table) => {
1686
+ const { dataschema } = dataschemaOf(input, {
1687
+ type,
1688
+ ...table ? { table } : {}
1689
+ });
1690
+ ids.push(messageId);
1691
+ messages[messageId] = {
1692
+ id: messageId,
1693
+ name: type,
1694
+ title,
1695
+ contentType: "application/json",
1696
+ headers: cloudEventHeaders(type, dataschema),
1697
+ payload,
1698
+ traits: ["cloudEvent"],
1699
+ extensions: {
1700
+ [`${ctx.prefix}cloudevent-type`]: type,
1701
+ ...dataschema ? { [`${ctx.prefix}dataschema`]: dataschema } : {}
1702
+ }
1703
+ };
1704
+ };
1705
+ const rows = input.rows ?? false;
1706
+ const rowTables = rows === true ? Object.keys(ctx.meta.tables) : rows === false ? [] : rows;
1707
+ const defs = rowTables.length > 0 ? tableSchemas(ctx.meta, ctx.json) : {};
1708
+ for (const table of rowTables) {
1709
+ if (!ctx.meta.tables[table]) {
1710
+ ctx.report({
1711
+ code: "asyncapi-table-unknown",
1712
+ severity: "error",
1713
+ message: `events.cloudEvents.rows names an unknown table "${table}"`
1714
+ });
1715
+ continue;
1716
+ }
1717
+ const component = ctx.served.get(table)?.components.Row;
1718
+ const row = component ? schemaRef(component) : defs[`${table}Row`] ?? OPEN;
1719
+ for (const intent of input.intents ?? DEFAULT_INTENTS) {
1720
+ const last = ROW_EVENT_TYPES[intent].split(".").at(-1) ?? intent;
1721
+ const type = input.typePrefix ? `${input.typePrefix}.row.${last}` : ROW_EVENT_TYPES[intent];
1722
+ add(`row${keyPart(table)}${keyPart(last)}`, type, `${table} ${last}`, {
1723
+ type: "object",
1724
+ required: ["table", "row"],
1725
+ properties: {
1726
+ table: {
1727
+ type: "string",
1728
+ const: table
1729
+ },
1730
+ row,
1731
+ actorId: { type: "string" }
1732
+ }
1733
+ }, table);
1734
+ }
1735
+ }
1736
+ for (const [event, schema] of Object.entries(input.blocks ?? {})) {
1737
+ if (schema === void 0) continue;
1738
+ const type = `${input.typePrefix ?? "dev.better-supabase"}.${event}`;
1739
+ add(`block${keyPart(event)}`, type, event, withActor(convert(schema, `events.cloudEvents.blocks.${event}`, ctx)));
1740
+ }
1741
+ if (ids.length === 0) return false;
1742
+ channels.push({
1743
+ id: "cloudEvents",
1744
+ address: input.address ?? "events",
1745
+ title: "CloudEvents",
1746
+ description: `CloudEvents from \`${input.source}\`, sent to the event sink.`,
1747
+ protocol: "http",
1748
+ messages: ids,
1749
+ operations: [{
1750
+ id: "sendCloudEvents",
1751
+ action: "send"
1752
+ }]
1753
+ });
1754
+ return true;
1755
+ }
1756
+ /**
1757
+ * The built channels and messages first, then the app's own (which win on an
1758
+ * id), and the workflows with every `WorkflowSource` run on `operations`.
1759
+ */
1760
+ function eventParts(options, ctx, operations) {
1761
+ const built = buildEvents(options.events, ctx);
1762
+ return {
1763
+ channels: [...built.channels, ...options.channels ?? []],
1764
+ messages: {
1765
+ ...built.messages,
1766
+ ...options.messages
1767
+ },
1768
+ ...Object.keys(built.messageTraits).length > 0 ? { messageTraits: built.messageTraits } : {},
1769
+ workflows: (options.workflows ?? []).flatMap((workflow) => typeof workflow === "function" ? workflow(operations) : [workflow])
1770
+ };
1771
+ }
1772
+ /** Channels and messages from the realtime tables, topics and CloudEvents. */
1773
+ function buildEvents(events, ctx) {
1774
+ const channels = [];
1775
+ const messages = {};
1776
+ const messageTraits = {};
1777
+ if (!events) return {
1778
+ channels,
1779
+ messages,
1780
+ messageTraits
1781
+ };
1782
+ tableChannels(ctx, events.tables ?? true, channels, messages);
1783
+ topicChannels(ctx, events.topics ?? {}, channels, messages);
1784
+ if (events.cloudEvents && cloudEventChannel(ctx, events.cloudEvents, channels, messages)) messageTraits["cloudEvent"] = CLOUD_EVENT_TRAIT;
1785
+ return {
1786
+ channels,
1787
+ messages,
1788
+ messageTraits
1789
+ };
1790
+ }
1791
+ // src/spec/build.ts
1792
+ const READ_METHODS = /* @__PURE__ */ new Set([
1793
+ "get",
1794
+ "head",
1795
+ "options",
1796
+ "query"
1797
+ ]);
1798
+ const modelCache = /* @__PURE__ */ new WeakMap();
1799
+ const NO_PLUGINS = [];
1800
+ const NO_BLOCKS = {};
1801
+ /** One `WeakMap` level of the model cache, created on first use. */
1802
+ function level(map, key, empty) {
1803
+ let value = map.get(key);
1804
+ if (value === void 0) {
1805
+ value = empty();
1806
+ map.set(key, value);
1807
+ }
1808
+ return value;
1809
+ }
1810
+ /**
1811
+ * Builds the version-neutral API model once per metadata, plugin list, block
1812
+ * set and options object. Formats lower it to each version; `defineApi` wraps
1813
+ * it.
1814
+ */
1815
+ function buildApiModel(source, options) {
1816
+ const plugins = source.plugins ?? NO_PLUGINS;
1817
+ const blocks = source.options?.blocks;
1818
+ return level(level(level(level(modelCache, source.meta, () => /* @__PURE__ */ new WeakMap()), plugins, () => /* @__PURE__ */ new WeakMap()), blocks ?? NO_BLOCKS, () => /* @__PURE__ */ new WeakMap()), options, () => build(source.meta, plugins, blocks, options));
1819
+ }
1820
+ /** The tables `options.resources` publishes: every table unless it says so. */
1821
+ function publishedResources(meta, options) {
1822
+ if (options.resources === false) return {};
1823
+ return options.resources ?? Object.fromEntries(Object.keys(meta.tables).map((key) => [key, true]));
1824
+ }
1825
+ function build(meta, plugins, blocks, options) {
1826
+ const ctx = createBuildContext(meta, options);
1827
+ for (const [key, input] of Object.entries(publishedResources(meta, options))) buildResource(ctx, key, input);
1828
+ buildBlocks(ctx, blocks, options.blocks);
1829
+ for (const [index, route] of (options.routes ?? []).entries()) buildRoute(ctx, route, index);
1830
+ if (options.dataApi) buildDataApi(ctx, options.dataApi);
1831
+ const security = withDataApiSchemes(buildSecurity(ctx), ctx.operations, options.supabaseUrl);
1832
+ applyPlugins(ctx, plugins);
1833
+ validateOperations(ctx);
1834
+ return finalizeModel(ctx, security);
1835
+ }
1836
+ function buildRoute(ctx, route, index) {
1837
+ const { options, base, globalErrors, operations, prefix, addTag, keyOf, schemaOf, objectParameters, usedErrors } = ctx;
1838
+ const method = route.method.toLowerCase();
1839
+ if (!isMethod(method)) throw new TypeError(`better-supabase/spec: routes[${index}] has an unknown method "${route.method}"`);
1840
+ const path = `${base}${route.path}`;
1841
+ const defaultId = `${method}${route.path.split("/").filter(Boolean).map((segment) => segment.replaceAll(/[{}]/g, "")).map(pascal).join("")}`;
1842
+ const source = { kind: "route" };
1843
+ const id = route.operationId ?? options.operationId?.({
1844
+ source,
1845
+ method,
1846
+ path,
1847
+ defaultId
1848
+ }) ?? defaultId;
1849
+ const declared = route.params ? objectParameters(route.params, "path", `${id} params`) : [];
1850
+ const parameters = [];
1851
+ for (const [, param] of path.matchAll(/\{(\w+)\}/g)) parameters.push(declared.find((entry) => entry.name === param) ?? {
1852
+ name: param,
1853
+ in: "path",
1854
+ required: true,
1855
+ schema: { type: "string" }
1856
+ });
1857
+ if (route.query) parameters.push(...objectParameters(route.query, "query", `${id} query`));
1858
+ const permission = route.permission === void 0 ? void 0 : keyOf(route.permission, `routes[${index}]`);
1859
+ const secured = route.security === void 0 || route.security.length > 0;
1860
+ const status = String(route.status ?? (route.output || route.stream ? 200 : 204));
1861
+ const success = route.stream ? {
1862
+ description: route.summary ?? "A stream of events.",
1863
+ content: { [route.stream.contentType ?? "text/event-stream"]: { itemSchema: schemaOf(route.stream.item, "output", "item", id) } }
1864
+ } : route.output ? jsonResponse(schemaOf(route.output, "output", "output", id), route.summary ?? "OK.") : { description: route.summary ?? "Done." };
1865
+ const routeTags = [...route.tags ?? []];
1866
+ for (const tag of routeTags) addTag(tag);
1867
+ operations.push({
1868
+ id,
1869
+ method,
1870
+ path,
1871
+ tags: routeTags,
1872
+ source,
1873
+ ...route.summary ? { summary: route.summary } : {},
1874
+ ...route.description ? { description: route.description } : {},
1875
+ ...route.deprecated ? { deprecated: true } : {},
1876
+ parameters,
1877
+ ...route.input ? { requestBody: {
1878
+ required: true,
1879
+ content: jsonContent(schemaOf(route.input, "input", "input", id))
1880
+ } } : {},
1881
+ responses: {
1882
+ [status]: success,
1883
+ ...usedErrors(route.errors ?? globalErrors, [...route.input || route.query ? [400, 422] : [], ...secured ? [401, 403] : []], permission !== void 0)
1884
+ },
1885
+ ...route.security ? { security: route.security } : {},
1886
+ ...permission === void 0 ? {} : { permission },
1887
+ extensions: permission === void 0 ? {} : { [`${prefix}permission`]: permission },
1888
+ ...route.extend ? { extend: route.extend } : {}
1889
+ });
1890
+ }
1891
+ function buildSecurity(ctx) {
1892
+ const { options, operations } = ctx;
1893
+ const oauthScopes = {};
1894
+ if (options.permissionScopes === "keys") {
1895
+ for (const operation of operations) if (operation.permission) oauthScopes[operation.permission] = `Permission ${operation.permission}.`;
1896
+ }
1897
+ const security = resolveSecurity(options.security ?? ["bearer"], options.supabaseUrl, oauthScopes);
1898
+ if (options.permissionScopes === "keys") for (const operation of operations) {
1899
+ const key = operation.permission;
1900
+ if (!key || operation.security?.length === 0) continue;
1901
+ operation.security = (operation.security ?? security.requirements).map((requirement) => {
1902
+ const scopes = requirement[OAUTH_SCHEME];
1903
+ return scopes ? {
1904
+ ...requirement,
1905
+ [OAUTH_SCHEME]: [...scopes, key]
1906
+ } : requirement;
1907
+ });
1908
+ }
1909
+ return security;
1910
+ }
1911
+ function applyPlugins(ctx, plugins) {
1912
+ const { meta, prefix, served, schemas, report } = ctx;
1913
+ const describe = describeApi(meta, prefix, served, schemas);
1914
+ for (const plugin of plugins) {
1915
+ if (!plugin.describe) continue;
1916
+ try {
1917
+ plugin.describe(describe);
1918
+ } catch (error) {
1919
+ report({
1920
+ code: "plugin-describe-failed",
1921
+ severity: "warning",
1922
+ message: `The ${plugin.name} plugin's describe() threw: ${error instanceof Error ? error.message : String(error)}`
1923
+ });
1924
+ }
1925
+ }
1926
+ }
1927
+ /** Reports writes without a permission and duplicate operation ids. */
1928
+ function validateOperations(ctx) {
1929
+ const { options, operations, report } = ctx;
1930
+ if (options.requirePermissions) for (const operation of operations) {
1931
+ if (operation.source.kind === "data-api") continue;
1932
+ if ((operation.source.kind === "resource" ? operation.source.operation !== "list" && operation.source.operation !== "get" : operation.source.kind === "verb" ? !READ_VERBS.has(operation.source.verb) : !READ_METHODS.has(operation.method)) && operation.permission === void 0) report({
1933
+ code: "permission-missing",
1934
+ severity: "error",
1935
+ message: `${operation.id} writes but declares no permission`,
1936
+ pointer: `/operations/${pointerToken(operation.id)}`
1937
+ });
1938
+ }
1939
+ const seen = /* @__PURE__ */ new Set();
1940
+ for (const operation of operations) {
1941
+ if (seen.has(operation.id)) report({
1942
+ code: "operation-id-duplicate",
1943
+ severity: "error",
1944
+ message: `Two operations have the id "${operation.id}"`,
1945
+ pointer: `/operations/${pointerToken(operation.id)}`
1946
+ });
1947
+ seen.add(operation.id);
1948
+ }
1949
+ }
1950
+ function finalizeModel(ctx, security) {
1951
+ const { meta, options, prefix, served, keyOf, report, schemas, operations, tags, responses, diagnostics } = ctx;
1952
+ const { enrich } = options;
1953
+ const finalSchemas = {};
1954
+ for (const [name, schema] of Object.entries(schemas)) finalSchemas[name] = enrich?.schema?.(schema, { name }) ?? schema;
1955
+ const finalOperations = operations.map((operation) => enrich?.operation?.(operation) ?? operation);
1956
+ const { messageTraits, ...parts } = eventParts(options, {
1957
+ meta,
1958
+ json: options.json ?? {},
1959
+ prefix,
1960
+ served,
1961
+ keyOf,
1962
+ report
1963
+ }, finalOperations);
1964
+ const messages = {};
1965
+ for (const [id, message] of Object.entries(parts.messages)) messages[id] = enrich?.message?.(message, { id }) ?? message;
1966
+ return {
1967
+ model: {
1968
+ info: options.info,
1969
+ ...options.self ? { self: options.self } : {},
1970
+ servers: options.servers ?? [],
1971
+ tags,
1972
+ operations: finalOperations,
1973
+ schemas: finalSchemas,
1974
+ responses,
1975
+ securitySchemes: security.schemes,
1976
+ security: security.requirements,
1977
+ ...options.securityProfileRequirements ? { securityProfileRequirements: options.securityProfileRequirements } : {},
1978
+ channels: parts.channels.map((channel) => enrich?.channel?.(channel) ?? channel),
1979
+ messages,
1980
+ ...messageTraits ? { messageTraits } : {},
1981
+ webhooks: options.webhooks ?? [],
1982
+ workflows: parts.workflows.map((workflow) => enrich?.workflow?.(workflow) ?? workflow),
1983
+ fragments: options.fragments ?? [],
1984
+ ...options.realtimeUrl ? { realtimeUrl: options.realtimeUrl } : {},
1985
+ extensionPrefix: prefix
1986
+ },
1987
+ diagnostics
1988
+ };
1989
+ }
1990
+ /** An operation's name within its resource: the operation, verb or action. */
1991
+ function operationName(operation) {
1992
+ switch (operation.source.kind) {
1993
+ case "action": return operation.source.action;
1994
+ case "resource": return operation.source.operation;
1995
+ case "verb": return operation.source.verb;
1996
+ case "data-api":
1997
+ case "route":
1998
+ case "fragment": return operation.id;
1999
+ default: {
2000
+ const unknown = operation.source;
2001
+ throw new TypeError(`Unknown operation source ${String(unknown)}`);
2002
+ }
2003
+ }
2004
+ }
2005
+ function describeApi(meta, prefix, served, schemas) {
2006
+ const columnSchemas = (table, column) => {
2007
+ const entry = served.get(table);
2008
+ if (!entry) return [];
2009
+ return [
2010
+ "Row",
2011
+ "Insert",
2012
+ "Update"
2013
+ ].flatMap((variant) => {
2014
+ const name = entry.components[variant];
2015
+ const schema = name ? schemas[name] : void 0;
2016
+ const properties = schema?.["properties"];
2017
+ if (!schema || !isPlainObject(properties)) return [];
2018
+ const property = properties[column];
2019
+ if (!isPlainObject(property)) return [];
2020
+ return [{
2021
+ variant,
2022
+ schema,
2023
+ properties,
2024
+ property
2025
+ }];
2026
+ });
2027
+ };
2028
+ const replace = (schema, properties, column, property) => {
2029
+ schema["properties"] = {
2030
+ ...properties,
2031
+ [column]: property
2032
+ };
2033
+ };
2034
+ return {
2035
+ schema: meta,
2036
+ extensionPrefix: prefix,
2037
+ resources: [...served.values()].map((entry) => ({
2038
+ table: entry.table,
2039
+ operations: entry.operations.map(operationName)
2040
+ })),
2041
+ addParameter(table, parameter, names) {
2042
+ for (const operation of served.get(table)?.operations ?? []) {
2043
+ const name = operationName(operation);
2044
+ if (names && !names.includes(name)) continue;
2045
+ if (operation.parameters.some((entry) => entry.name === parameter.name && entry.in === parameter.in)) continue;
2046
+ operation.parameters.push({ ...parameter });
2047
+ }
2048
+ },
2049
+ markReadOnly(table, column, description) {
2050
+ for (const { variant, schema, properties, property } of columnSchemas(table, column)) {
2051
+ replace(schema, properties, column, {
2052
+ ...property,
2053
+ readOnly: true,
2054
+ ...description && property["description"] === void 0 ? { description } : {}
2055
+ });
2056
+ const required = schema["required"];
2057
+ if (variant !== "Row" && Array.isArray(required)) schema["required"] = required.filter((name) => name !== column);
2058
+ }
2059
+ },
2060
+ describeColumn(table, column, patch) {
2061
+ for (const { schema, properties, property } of columnSchemas(table, column)) replace(schema, properties, column, mergeJson(property, patch));
2062
+ }
2063
+ };
2064
+ }
2065
+ export { topicsFrom as a, PROBLEM_SCHEMA as c, mergeJson as d, pointerToken as f, safeKey as i, convertStandard as l, publishedResources as n, publishedBlocks as o, CLOUD_EVENT_TRAIT as r, DEFAULT_ERRORS as s, buildApiModel as t, pascal as u };