better-supabase 0.15.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{adapter-B0b6MXYS.js → adapter-Dyks1lX1.js} +1 -1
- package/dist/{agents-5n8DWRfP.d.ts → agents-CMIB3802.d.ts} +1 -1
- package/dist/{ai-cache-DyHohbFP.d.ts → ai-cache-2LGgaT7F.d.ts} +1 -1
- package/dist/{ai-chat-D1GuRnke.d.ts → ai-chat-BCaKsvLW.d.ts} +1 -1
- package/dist/{ai-schedules-CAquecT_.d.ts → ai-schedules-BmkARmQ9.d.ts} +2 -2
- package/dist/ai-sdk/agents/index.d.ts +4 -4
- package/dist/ai-sdk/batches/index.d.ts +1 -1
- package/dist/ai-sdk/cache/index.d.ts +1 -1
- package/dist/ai-sdk/chat/index.d.ts +1 -1
- package/dist/ai-sdk/embeddings/index.d.ts +2 -2
- package/dist/ai-sdk/index.d.ts +4 -4
- package/dist/ai-sdk/memory/index.d.ts +3 -3
- package/dist/ai-sdk/workflow/index.d.ts +3 -3
- package/dist/{api-DxAPqMrE.d.ts → api-hHwieEfz.d.ts} +1 -1
- package/dist/{app-tables-CF2DD-Mu.d.ts → app-tables-yMQ4ubyY.d.ts} +1 -1
- package/dist/{approvals-Crutd4-o.d.ts → approvals-Dh9dUXrN.d.ts} +1 -1
- package/dist/{assistant-CD_h8Vxx.d.ts → assistant-ndGdOBax.d.ts} +2 -2
- package/dist/astro/index.d.ts +4 -4
- package/dist/astro/index.js +2 -2
- package/dist/{auth-module-BEFESDC4.js → auth-module-BbmX-N4L.js} +12 -4
- package/dist/{authorization-hooks-Cs1vP_ej.d.ts → authorization-hooks-D_pwXlBs.d.ts} +4 -0
- package/dist/better-result/index.d.ts +2 -2
- package/dist/{bind-CrMBwrPN.d.ts → bind-JGCPGUJh.d.ts} +4 -4
- package/dist/{block-env-B_uEM2xz.d.ts → block-env-y65GF_px.d.ts} +4 -4
- package/dist/blocks/access-requests/index.d.ts +1 -1
- package/dist/blocks/activities/index.d.ts +2 -2
- package/dist/blocks/agents/index.d.ts +2 -2
- package/dist/blocks/ai-cache/index.d.ts +2 -2
- package/dist/blocks/ai-chat/index.d.ts +5 -5
- package/dist/blocks/ai-files/index.d.ts +1 -1
- package/dist/blocks/ai-keys/index.d.ts +1 -1
- package/dist/blocks/ai-schedules/index.d.ts +2 -2
- package/dist/blocks/announcements/index.d.ts +4 -4
- package/dist/blocks/api-keys/index.d.ts +2 -2
- package/dist/blocks/approvals/index.d.ts +2 -2
- package/dist/blocks/assets/index.d.ts +1 -1
- package/dist/blocks/assignment/index.d.ts +1 -1
- package/dist/blocks/attachments/index.d.ts +2 -2
- package/dist/blocks/audit/index.d.ts +5 -5
- package/dist/blocks/automations/index.d.ts +4 -4
- package/dist/blocks/billable-time/index.d.ts +1 -1
- package/dist/blocks/billing/index.d.ts +3 -3
- package/dist/blocks/bookings/index.d.ts +3 -3
- package/dist/blocks/bulk/index.d.ts +1 -1
- package/dist/blocks/calendar/index.d.ts +2 -2
- package/dist/blocks/catalog/index.d.ts +1 -1
- package/dist/blocks/channels/index.d.ts +1 -1
- package/dist/blocks/collections/index.d.ts +1 -1
- package/dist/blocks/comments/index.d.ts +4 -4
- package/dist/blocks/compliance/index.d.ts +1 -1
- package/dist/blocks/connectors/index.d.ts +1 -1
- package/dist/blocks/contacts/index.d.ts +1 -1
- package/dist/blocks/content/index.d.ts +1 -1
- package/dist/blocks/contracts/index.d.ts +1 -1
- package/dist/blocks/courses/index.d.ts +1 -1
- package/dist/blocks/created-by/index.d.ts +1 -1
- package/dist/blocks/custom-fields/index.d.ts +1 -1
- package/dist/blocks/data-lifecycle/index.d.ts +2 -2
- package/dist/blocks/deals/index.d.ts +1 -1
- package/dist/blocks/dispatch/index.d.ts +1 -1
- package/dist/blocks/documents/index.d.ts +1 -1
- package/dist/blocks/domains/index.d.ts +1 -1
- package/dist/blocks/donations/index.d.ts +1 -1
- package/dist/blocks/drive/index.d.ts +2 -2
- package/dist/blocks/employees/index.d.ts +2 -2
- package/dist/blocks/enrichment/index.d.ts +1 -1
- package/dist/blocks/enrollments/index.d.ts +1 -1
- package/dist/blocks/entitlements/index.d.ts +3 -3
- package/dist/blocks/expenses/index.d.ts +1 -1
- package/dist/blocks/field-history/index.d.ts +1 -1
- package/dist/blocks/flags/index.d.ts +1 -1
- package/dist/blocks/forecasts/index.d.ts +1 -1
- package/dist/blocks/forms/index.d.ts +2 -2
- package/dist/blocks/goals/index.d.ts +1 -1
- package/dist/blocks/guests/index.d.ts +1 -1
- package/dist/blocks/hiring/index.d.ts +1 -1
- package/dist/blocks/identities/index.d.ts +2 -2
- package/dist/blocks/imports/index.d.ts +1 -1
- package/dist/blocks/inbox/index.d.ts +5 -5
- package/dist/blocks/incidents/index.d.ts +1 -1
- package/dist/blocks/index.d.ts +2 -2
- package/dist/blocks/inventory/index.d.ts +2 -2
- package/dist/blocks/invoices/index.d.ts +1 -1
- package/dist/blocks/knowledge/index.d.ts +2 -2
- package/dist/blocks/lead-scoring/index.d.ts +1 -1
- package/dist/blocks/leases/index.d.ts +1 -1
- package/dist/blocks/leave/index.d.ts +1 -1
- package/dist/blocks/ledger/index.d.ts +1 -1
- package/dist/blocks/mail-sync/index.d.ts +1 -1
- package/dist/blocks/memberships/index.d.ts +1 -1
- package/dist/blocks/memory/index.d.ts +3 -3
- package/dist/blocks/messaging/index.d.ts +4 -4
- package/dist/blocks/metrics/index.d.ts +2 -2
- package/dist/blocks/mfa/index.d.ts +2 -2
- package/dist/blocks/moderation/index.d.ts +1 -1
- package/dist/blocks/notifications/index.d.ts +5 -5
- package/dist/blocks/numbering/index.d.ts +1 -1
- package/dist/blocks/oauth-server/index.d.ts +1 -1
- package/dist/blocks/onboarding/index.d.ts +2 -2
- package/dist/blocks/orders/index.d.ts +3 -3
- package/dist/blocks/organizations/index.d.ts +2 -2
- package/dist/blocks/outbox/index.d.ts +2 -2
- package/dist/blocks/passes/index.d.ts +2 -2
- package/dist/blocks/permissions/index.d.ts +3 -3
- package/dist/blocks/pipelines/index.d.ts +1 -1
- package/dist/blocks/posts/index.d.ts +1 -1
- package/dist/blocks/profiles/index.d.ts +1 -1
- package/dist/blocks/promotions/index.d.ts +1 -1
- package/dist/blocks/push/index.d.ts +2 -2
- package/dist/blocks/queue/index.d.ts +30 -3
- package/dist/blocks/queue/index.js +2 -2
- package/dist/blocks/quotes/index.d.ts +1 -1
- package/dist/blocks/rank/index.d.ts +2 -2
- package/dist/blocks/reactions/index.d.ts +4 -4
- package/dist/blocks/relations/index.d.ts +1 -1
- package/dist/blocks/reminders/index.d.ts +3 -3
- package/dist/blocks/reviews/index.d.ts +1 -1
- package/dist/blocks/saved-views/index.d.ts +3 -3
- package/dist/blocks/scores/index.d.ts +1 -1
- package/dist/blocks/search/index.d.ts +3 -3
- package/dist/blocks/security-events/index.d.ts +1 -1
- package/dist/blocks/segments/index.d.ts +1 -1
- package/dist/blocks/sequences/index.d.ts +1 -1
- package/dist/blocks/service-accounts/index.d.ts +1 -1
- package/dist/blocks/sessions/index.d.ts +2 -2
- package/dist/blocks/settings/index.d.ts +2 -2
- package/dist/blocks/share-links/index.d.ts +1 -1
- package/dist/blocks/shipments/index.d.ts +1 -1
- package/dist/blocks/signatures/index.d.ts +1 -1
- package/dist/blocks/signing-keys/index.d.ts +1 -1
- package/dist/blocks/sla/index.d.ts +1 -1
- package/dist/blocks/sso/index.d.ts +1 -1
- package/dist/blocks/state-machine/index.d.ts +1 -1
- package/dist/blocks/subjects/index.d.ts +2 -2
- package/dist/blocks/tags/index.d.ts +2 -2
- package/dist/blocks/tasks/index.d.ts +2 -2
- package/dist/blocks/teams/index.d.ts +1 -1
- package/dist/blocks/templates/index.d.ts +3 -3
- package/dist/blocks/time-tracking/index.d.ts +1 -1
- package/dist/blocks/timeline/index.d.ts +3 -3
- package/dist/blocks/trash/index.d.ts +1 -1
- package/dist/blocks/undo/index.d.ts +2 -2
- package/dist/blocks/updated-at/index.d.ts +1 -1
- package/dist/blocks/usage/index.d.ts +3 -3
- package/dist/blocks/vercel-marketplace/index.d.ts +1 -1
- package/dist/blocks/versions/index.d.ts +1 -1
- package/dist/blocks/waitlist/index.d.ts +1 -1
- package/dist/blocks/webhooks/index.d.ts +4 -4
- package/dist/blocks/webhooks/index.js +1 -1
- package/dist/blocks/workflow-editor/index.d.ts +6 -6
- package/dist/blocks/workflow-editor/index.js +12 -1
- package/dist/blocks/workflows/index.d.ts +4 -4
- package/dist/{bookings-D4dvGXiR.d.ts → bookings-Dox2rced.d.ts} +1 -1
- package/dist/{bucket-CiNi8sIw.d.ts → bucket-vc-QRrva.d.ts} +40 -1
- package/dist/chat-sdk/index.d.ts +1 -1
- package/dist/cli/add-Bfb_ISrO.js +1 -0
- package/dist/cli/{add-BgsUjCan.js → add-D7TkPdco.js} +17 -12
- package/dist/cli/{add-DCI5JKjA.js → add-I8OW-qJH.js} +2 -2
- package/dist/cli/{backfill-nxPbcsns.js → backfill-DIz5DnlQ.js} +1 -1
- package/dist/cli/bin.js +1 -1
- package/dist/cli/{blocks-Cr4HGePW.js → blocks-Bp5RPoft.js} +1 -1
- package/dist/cli/{blocks-BZHI8mRC.js → blocks-xk-SE8gS.js} +1 -1
- package/dist/cli/{cache-CXgR_Ahi.js → cache-AznIssjI.js} +1 -1
- package/dist/cli/{codemod-DSN7iAdg.js → codemod-Aewxza6i.js} +95 -3
- package/dist/cli/{content-mapper-DNs7lTu7.js → content-mapper-DCrz6OIv.js} +2 -2
- package/dist/cli/{doctor-DDrEM6S1.js → doctor-DkOSLPEQ.js} +29 -14
- package/dist/cli/{gen-MtijJQ9r.js → gen-CFkYUnWq.js} +10 -10
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +6 -6
- package/dist/cli/{init-D-aDv9r5.js → init-CHj9ad4S.js} +5 -5
- package/dist/cli/legacy-prefix-DkTA3Rhx.js +141 -0
- package/dist/cli/{live-iEeH15ck.js → live-DGdLR41j.js} +2 -2
- package/dist/cli/{mcp-BAPyaQ62.js → mcp-BZno503V.js} +2 -2
- package/dist/cli/{metadata-DVx9Zgbj.js → metadata-BfgHMe4q.js} +3 -3
- package/dist/cli/{migration-safety-D7PhzFxm.js → migration-safety-BnnXPAro.js} +1 -1
- package/dist/cli/{module-migration-aPCckev6.js → module-migration-O_IxewFs.js} +5 -216
- package/dist/cli/{print-BeWO7OJY.js → print-DosQIFSy.js} +1 -1
- package/dist/cli/{remove-B46Dmd2M.js → remove-DK2G_KHm.js} +5 -4
- package/dist/cli/{render-ucJmUyuM.js → render-5y5a1QZr.js} +3 -3
- package/dist/cli/{run-CvYVAztY.js → run-Bs4OKdDI.js} +20 -7
- package/dist/cli/{run-DYhLBcFW.js → run-MRET30vh.js} +20 -20
- package/dist/cli/{shared-LZroULBe.js → shared-BLqbvY2x.js} +1 -1
- package/dist/cli/{snapshot-C8MVPyO8.js → snapshot-uTUlEzY2.js} +2 -2
- package/dist/cli/{source-DANaJJVc.js → source-D2gJHKwC.js} +1 -1
- package/dist/cli/{spec-DGVNMSSB.js → spec-Cm2einTO.js} +2 -2
- package/dist/cli/{spec-g8_G5K7o.js → spec-DUjOtciN.js} +1 -1
- package/dist/cli/sql-layout-lUWenjJw.js +247 -0
- package/dist/cli/{sync-btj01bcM.js → sync-CZMRB3aU.js} +2 -1
- package/dist/cli/{upgrade-B596d4t8.js → upgrade-BFEIMC7U.js} +4 -137
- package/dist/cli/{upgrade-Dw3TMQzn.js → upgrade-fVsJniXm.js} +2 -2
- package/dist/cli/{version-Du4CgONY.js → version-B2Dr6VmJ.js} +1 -1
- package/dist/client/index.d.ts +5 -5
- package/dist/client/index.js +1 -1
- package/dist/client/native/index.d.ts +5 -5
- package/dist/client/native/index.js +1 -1
- package/dist/{client-BAEbEA7t.js → client-C_mlji5R.js} +6 -5
- package/dist/{composite-BARuBEDE.js → composite-B3TIjId4.js} +1 -1
- package/dist/{composite-Dsxj7T5K.d.ts → composite-CfYyU3vs.d.ts} +4 -3
- package/dist/config/index.d.ts +1 -1
- package/dist/{context-CEuTKrkz.d.ts → context-8kb8m5uO.d.ts} +24 -2
- package/dist/{controller-BrP0gn47.d.ts → controller-BW-5Opig.d.ts} +1 -1
- package/dist/{conversion-BAbucuXq.d.ts → conversion-3iv2r7YC.d.ts} +1 -1
- package/dist/create/index.d.ts +2 -2
- package/dist/create/index.js +1 -1
- package/dist/{define-DFBnQyYg.d.ts → define-C5AcEkEJ.d.ts} +1 -1
- package/dist/{define-block-BVcLQ3DF.d.ts → define-block-C1RHXz7L.d.ts} +3 -3
- package/dist/delegation-C7eWP2r8.d.ts +14 -0
- package/dist/{delegation--93jRsVO.js → delegation-DGOIiT8k.js} +12 -5
- package/dist/edge/index.d.ts +5 -5
- package/dist/edge/index.js +3 -3
- package/dist/{embeddings-kFbRvuic.d.ts → embeddings-D_RsS6ow.d.ts} +1 -1
- package/dist/{entitlements-CJpYQXeE.d.ts → entitlements-sO977DO-.d.ts} +1 -1
- package/dist/{envelope-Bzu0JnY2.js → envelope-DEI2iX-d.js} +1 -1
- package/dist/eve/index.d.ts +2 -2
- package/dist/{eve-BFSwTu1z.d.ts → eve-B7jxYPCw.d.ts} +2 -2
- package/dist/{executor-CVIn6JHa.d.ts → executor-BcNWcD-4.d.ts} +2 -2
- package/dist/{executor-_2ekNofh.d.ts → executor-Bi056Cnj.d.ts} +1 -1
- package/dist/expo/index.d.ts +2 -2
- package/dist/expo/index.js +2 -2
- package/dist/{field-errors-fsbFktYF.d.ts → field-errors-Dt86dCKk.d.ts} +12 -12
- package/dist/{framework-BKyTeS-j.d.ts → framework-BGdZVyPL.d.ts} +3 -3
- package/dist/{framework-DDdkR7FX.js → framework-BozTXRzt.js} +1 -1
- package/dist/{gateway-TD1pRfTP.d.ts → gateway-DzI687yd.d.ts} +3 -3
- package/dist/hono/index.d.ts +4 -4
- package/dist/hono/index.js +2 -2
- package/dist/{index-C-qpk8EQ.d.ts → index-CENWq3zb.d.ts} +1 -1
- package/dist/{index-Do2ChN_y.d.ts → index-CQhPHHDF.d.ts} +20 -2
- package/dist/{index-B938YqY-.d.ts → index-CTu-3fJB.d.ts} +51 -3
- package/dist/{index-CguFm716.d.ts → index-Cc4mIQS8.d.ts} +32 -4
- package/dist/{index-DLq69k3F.d.ts → index-CcAmFNVi.d.ts} +2 -2
- package/dist/{index-BnH4Gomw.d.ts → index-Craf712U.d.ts} +44 -12
- package/dist/{index-BUuVq1co.d.ts → index-DZKCc2WM.d.ts} +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/{knowledge-CtL-Vfgy.d.ts → knowledge-F1IhRI4Q.d.ts} +1 -1
- package/dist/list/index.d.ts +1 -1
- package/dist/{list-query-BDVutLFr.d.ts → list-query-DYhgRTd5.d.ts} +1 -1
- package/dist/mapper/bin.js +5 -5
- package/dist/mcp/index.d.ts +3 -3
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/sdk/index.d.ts +2 -2
- package/dist/mcp/sdk/index.js +1 -1
- package/dist/next/client/index.d.ts +81 -1
- package/dist/next/client/index.js +178 -2
- package/dist/next/index.d.ts +15 -14
- package/dist/next/index.js +2 -2
- package/dist/orpc/index.d.ts +4 -4
- package/dist/orpc/index.js +1 -1
- package/dist/otel/index.js +4 -4
- package/dist/{outbox-HvGAJuBe.d.ts → outbox-HxjZTfF6.d.ts} +1 -1
- package/dist/{ports-DOhtuw3c.js → ports-CaVRXjxq.js} +1 -1
- package/dist/{ports-sx226JUL.d.ts → ports-mObLgH1z.d.ts} +1 -1
- package/dist/powersync/index.d.ts +2 -2
- package/dist/preset/index.d.ts +3 -3
- package/dist/{push-token-D3Vcf0Pf.d.ts → push-token-BSSvsWXZ.d.ts} +1 -1
- package/dist/query/index.d.ts +1 -1
- package/dist/{rate-limit-o44SYkVY.js → rate-limit-Dt9vAY4E.js} +53 -0
- package/dist/react/index.d.ts +6 -6
- package/dist/react/index.js +3 -3
- package/dist/react/native/index.d.ts +1 -1
- package/dist/react/native/index.js +1 -1
- package/dist/react/server.d.ts +12 -7
- package/dist/react/server.js +8 -3
- package/dist/react/session.d.ts +5 -0
- package/dist/react/session.js +9 -1
- package/dist/{react-BuDYI62C.js → react-CZUZYn9E.js} +41 -4
- package/dist/react-router/index.d.ts +3 -3
- package/dist/react-router/index.js +2 -2
- package/dist/realtime/index.d.ts +6 -6
- package/dist/realtime/index.js +2 -1
- package/dist/{record-form-BYs9xv_N.d.ts → record-form-D9ILuVtA.d.ts} +1 -1
- package/dist/records/index.d.ts +7 -7
- package/dist/relay-gKvKJ3xf.js +208 -0
- package/dist/{resource-execute-CzHuDsil.d.ts → resource-execute-Cpnob1Vj.d.ts} +1 -1
- package/dist/{resource-types-DnKiH4G2.d.ts → resource-types-pMeLs68X.d.ts} +1 -1
- package/dist/{resources-B9cQxhjw.d.ts → resources-7iq2-5_A.d.ts} +1 -1
- package/dist/server/index.d.ts +150 -11
- package/dist/server/index.js +400 -4
- package/dist/{server-types-CFtehAsr.d.ts → server-types-CK8mUIUT.d.ts} +5 -354
- package/dist/{session-CH0SKgIz.d.ts → session-DWmFv3vB.d.ts} +2 -1
- package/dist/session-status-qQLm7jzh.d.ts +82 -0
- package/dist/{sign-in-DNCdrk05.js → sign-in-B64114O4.js} +1 -1
- package/dist/{sign-in-BsIaNx2C.js → sign-in-CmPK1AgM.js} +20 -10
- package/dist/solid/index.d.ts +7 -7
- package/dist/solid/index.js +1 -1
- package/dist/solid-start/index.d.ts +3 -3
- package/dist/solid-start/index.js +2 -2
- package/dist/spec/index.d.ts +1 -1
- package/dist/sql/index.d.ts +4 -4
- package/dist/sql/index.js +2 -2
- package/dist/{sql-ClHIdgKS.js → sql-Dl3Alk43.js} +402 -13
- package/dist/sqlite/index.d.ts +1 -1
- package/dist/ssr/index.d.ts +1 -1
- package/dist/storage/index.d.ts +3 -3
- package/dist/storage/index.js +54 -1
- package/dist/{subject-readers-BNSzkqw_.d.ts → subject-readers-8GySC9Z8.d.ts} +1 -1
- package/dist/support-B4ZBVxt3.d.ts +357 -0
- package/dist/svelte/index.d.ts +7 -7
- package/dist/svelte/index.js +1 -1
- package/dist/sveltekit/index.d.ts +4 -4
- package/dist/sveltekit/index.js +2 -2
- package/dist/{tags-BjHflcHF.d.ts → tags-qvVk79pp.d.ts} +1 -1
- package/dist/tanstack-db/index.d.ts +1 -1
- package/dist/tanstack-start/index.d.ts +3 -3
- package/dist/tanstack-start/index.js +2 -2
- package/dist/{tenant-yYg0E2-n.d.ts → tenant-DOKIJI62.d.ts} +1 -1
- package/dist/testing/index.d.ts +13 -12
- package/dist/{timeline-CtG0sehj.d.ts → timeline-CvTuXYvn.d.ts} +3 -3
- package/dist/{topic-CJrQZQaa.d.ts → topic-CZXHhZye.d.ts} +3 -3
- package/dist/{types-CAQBmpDx.d.ts → types-A4yyKEsg.d.ts} +1 -1
- package/dist/{types-SFRomQF7.d.ts → types-Czq9Xtpa.d.ts} +1 -7
- package/dist/{types-BBQLbui9.d.ts → types-DsRfiQ0v.d.ts} +1 -1
- package/dist/{usage-D7QkrwzV.d.ts → usage-Dp45V42p.d.ts} +1 -1
- package/dist/{verify-CMou8dWZ.d.ts → verify-CjvNLY7N.d.ts} +1 -1
- package/dist/vue/index.d.ts +7 -7
- package/dist/vue/index.js +1 -1
- package/dist/{watch-topic-BcGfvZOE.d.ts → watch-topic-BAxoPKZx.d.ts} +1 -1
- package/dist/workflow-sdk/builder/index.d.ts +3 -3
- package/dist/workflow-sdk/builder/index.js +1 -1
- package/dist/workflow-sdk/index.d.ts +1 -1
- package/dist/workflow-sdk/index.js +1 -1
- package/dist/{workflow-sdk-BFHu4sci.d.ts → workflow-sdk-B3Ss55Fy.d.ts} +1 -1
- package/dist/{workflow-sdk-BVlFEB5Q.js → workflow-sdk-Cf0LAOFF.js} +2 -2
- package/dist/yjs/index.d.ts +1 -1
- package/package.json +1 -1
- package/schemas/doctor-report-v1.json +1 -0
- package/skills/better-supabase-api/SKILL.md +3 -1
- package/skills/better-supabase-auth/SKILL.md +7 -0
- package/dist/cli/add-DWjlVwvP.js +0 -1
|
@@ -5,7 +5,7 @@ import { $ as SaasEventData, Ct as Events } from "../../events-vcqenSYU.js";
|
|
|
5
5
|
import { n as Logger } from "../../logger-DWVYUmwi.js";
|
|
6
6
|
import { n as BlockOptions } from "../../block-helpers-CRpAHrp_.js";
|
|
7
7
|
import { n as BlockHooks } from "../../block-hooks-DZN2w69m.js";
|
|
8
|
-
import { c as BlockOf } from "../../define-block-
|
|
8
|
+
import { c as BlockOf } from "../../define-block-C1RHXz7L.js";
|
|
9
9
|
//#region src/blocks/teams/teams.d.ts
|
|
10
10
|
interface TeamsOptions<S extends StandardSchemaV1 | undefined = undefined> extends BlockOptions {
|
|
11
11
|
/**
|
|
@@ -7,10 +7,10 @@ import { n as Logger } from "../../logger-DWVYUmwi.js";
|
|
|
7
7
|
import { r as BlockTemporalOptions } from "../../block-helpers-CRpAHrp_.js";
|
|
8
8
|
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-DWZSJrwN.js";
|
|
9
9
|
import { n as BlockHooks } from "../../block-hooks-DZN2w69m.js";
|
|
10
|
-
import { c as BlockOf } from "../../define-block-
|
|
10
|
+
import { c as BlockOf } from "../../define-block-C1RHXz7L.js";
|
|
11
11
|
import { t as ComposedEmail } from "../../email-tt2QqiSc.js";
|
|
12
|
-
import { E as WorkflowStepInfo, x as WorkflowEditor } from "../../types-
|
|
13
|
-
import { i as GraphStepCall } from "../../executor-
|
|
12
|
+
import { E as WorkflowStepInfo, x as WorkflowEditor } from "../../types-DsRfiQ0v.js";
|
|
13
|
+
import { i as GraphStepCall } from "../../executor-Bi056Cnj.js";
|
|
14
14
|
//#region src/blocks/templates/merge-fields.d.ts
|
|
15
15
|
/** How a rendered value is escaped: for HTML markup, or left as it is. */
|
|
16
16
|
type MergeEscape = "html" | "text";
|
|
@@ -8,7 +8,7 @@ import { n as Logger } from "../../logger-DWVYUmwi.js";
|
|
|
8
8
|
import { a as BlockTenantOptions, r as BlockTemporalOptions } from "../../block-helpers-CRpAHrp_.js";
|
|
9
9
|
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-DWZSJrwN.js";
|
|
10
10
|
import { n as BlockHooks } from "../../block-hooks-DZN2w69m.js";
|
|
11
|
-
import { c as BlockOf } from "../../define-block-
|
|
11
|
+
import { c as BlockOf } from "../../define-block-C1RHXz7L.js";
|
|
12
12
|
import { n as Money } from "../../money-BNRdJQzA.js";
|
|
13
13
|
import { t as CloudEvent } from "../../cloud-event-CzZTJkXv.js";
|
|
14
14
|
import { n as MetricDefinition } from "../../metric-definition-EAYI1r2n.js";
|
|
@@ -5,10 +5,10 @@ import { n as Logger } from "../../logger-DWVYUmwi.js";
|
|
|
5
5
|
import { a as BlockTenantOptions, i as CursorPageOptions, r as BlockTemporalOptions } from "../../block-helpers-CRpAHrp_.js";
|
|
6
6
|
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-DWZSJrwN.js";
|
|
7
7
|
import { n as BlockHooks } from "../../block-hooks-DZN2w69m.js";
|
|
8
|
-
import { t as BetterSupabase } from "../../define-
|
|
9
|
-
import { c as BlockOf } from "../../define-block-
|
|
8
|
+
import { t as BetterSupabase } from "../../define-C5AcEkEJ.js";
|
|
9
|
+
import { c as BlockOf } from "../../define-block-C1RHXz7L.js";
|
|
10
10
|
import { i as EventSink, t as CloudEvent } from "../../cloud-event-CzZTJkXv.js";
|
|
11
|
-
import { i as ListDefinition } from "../../list-query-
|
|
11
|
+
import { i as ListDefinition } from "../../list-query-DYhgRTd5.js";
|
|
12
12
|
//#region src/blocks/timeline/timeline.d.ts
|
|
13
13
|
/**
|
|
14
14
|
* Where a timeline entry comes from: `event` for an `activity_entries` row that
|
|
@@ -8,7 +8,7 @@ import { n as Logger } from "../../logger-DWVYUmwi.js";
|
|
|
8
8
|
import { n as BlockOptions } from "../../block-helpers-CRpAHrp_.js";
|
|
9
9
|
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-DWZSJrwN.js";
|
|
10
10
|
import { n as BlockHooks } from "../../block-hooks-DZN2w69m.js";
|
|
11
|
-
import { c as BlockOf } from "../../define-block-
|
|
11
|
+
import { c as BlockOf } from "../../define-block-C1RHXz7L.js";
|
|
12
12
|
//#region src/blocks/trash/trash.d.ts
|
|
13
13
|
interface TrashOptions<S extends StandardSchemaV1 | undefined = undefined> extends BlockOptions {
|
|
14
14
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-DWZSJrwN.js";
|
|
2
|
-
import { c as BlockOf } from "../../define-block-
|
|
3
|
-
import { n as Controller } from "../../controller-
|
|
2
|
+
import { c as BlockOf } from "../../define-block-C1RHXz7L.js";
|
|
3
|
+
import { n as Controller } from "../../controller-BW-5Opig.js";
|
|
4
4
|
import { a as UndoToken, c as undoToken, i as UndoOptions, n as Undo, o as createUndo, r as UndoCall, s as isUndoToken, t as UNDO_FUNCTIONS } from "../../undo-B1jwnVyN.js";
|
|
5
5
|
//#region src/blocks/undo/client.d.ts
|
|
6
6
|
interface UndoEntry {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
2
|
import { Mt as Plugin } from "../../types-DFdg_4yN.js";
|
|
3
3
|
import { t as UpdatedAtSqlOptions } from "../../options-DChZoVfs.js";
|
|
4
|
-
import { r as Block } from "../../define-block-
|
|
4
|
+
import { r as Block } from "../../define-block-C1RHXz7L.js";
|
|
5
5
|
//#region src/blocks/updated-at/extension.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* The `updated-at` block's repository extension. Stamps the columns generated
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { b as DbError } from "../../result-DZeA5KS6.js";
|
|
2
2
|
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-DWZSJrwN.js";
|
|
3
3
|
import { n as StripeSource, t as StripeClient } from "../../stripe-X22LjuH-.js";
|
|
4
|
-
import { _ as reportUsageToStripe, a as Usage, c as UsageEntry, d as UsageMeterInfo, f as UsageOptions, g as createUsage, h as UsageStatus, i as ReportUsageResult, l as UsageHistoryEntry, m as UsageRecorded, n as RecordUsageOptions, o as UsageBatchRecorded, p as UsagePeriod, r as ReportUsageOptions, s as UsageBreakdownEntry, t as PurgeUsageOptions, u as UsageHistoryOptions } from "../../usage-
|
|
5
|
-
import { c as BlockOf } from "../../define-block-
|
|
6
|
-
import { n as Controller, t as AuthPort } from "../../controller-
|
|
4
|
+
import { _ as reportUsageToStripe, a as Usage, c as UsageEntry, d as UsageMeterInfo, f as UsageOptions, g as createUsage, h as UsageStatus, i as ReportUsageResult, l as UsageHistoryEntry, m as UsageRecorded, n as RecordUsageOptions, o as UsageBatchRecorded, p as UsagePeriod, r as ReportUsageOptions, s as UsageBreakdownEntry, t as PurgeUsageOptions, u as UsageHistoryOptions } from "../../usage-Dp45V42p.js";
|
|
5
|
+
import { c as BlockOf } from "../../define-block-C1RHXz7L.js";
|
|
6
|
+
import { n as Controller, t as AuthPort } from "../../controller-BW-5Opig.js";
|
|
7
7
|
//#region src/blocks/usage/manifest.d.ts
|
|
8
8
|
/** The `usage` block's manifest (ADR 0029). */
|
|
9
9
|
export declare const usageBlock: BlockOf<"usage", typeof createUsage>;
|
|
@@ -6,7 +6,7 @@ import { r as BlockTemporalOptions } from "../../block-helpers-CRpAHrp_.js";
|
|
|
6
6
|
import { s as sqlTransport, t as BlockTransport } from "../../block-transport-DWZSJrwN.js";
|
|
7
7
|
import { n as BlockHooks } from "../../block-hooks-DZN2w69m.js";
|
|
8
8
|
import { a as ProblemFormat, t as BlockProblemOptions } from "../../problem-DNwN8iGz.js";
|
|
9
|
-
import { c as BlockOf } from "../../define-block-
|
|
9
|
+
import { c as BlockOf } from "../../define-block-C1RHXz7L.js";
|
|
10
10
|
import { n as Jwks } from "../../jws-D0toeQlA.js";
|
|
11
11
|
//#region src/blocks/vercel-marketplace/partner-api.d.ts
|
|
12
12
|
/** The Vercel environments a resource's secrets reach. */
|
|
@@ -8,7 +8,7 @@ import { n as Logger } from "../../logger-DWVYUmwi.js";
|
|
|
8
8
|
import { n as BlockOptions } from "../../block-helpers-CRpAHrp_.js";
|
|
9
9
|
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-DWZSJrwN.js";
|
|
10
10
|
import { n as BlockHooks } from "../../block-hooks-DZN2w69m.js";
|
|
11
|
-
import { Sn as EntitySchema, c as BlockOf, ln as RecordBindingWrite, mn as RecordRowInput, rn as RecordBinding } from "../../define-block-
|
|
11
|
+
import { Sn as EntitySchema, c as BlockOf, ln as RecordBindingWrite, mn as RecordRowInput, rn as RecordBinding } from "../../define-block-C1RHXz7L.js";
|
|
12
12
|
//#region src/blocks/versions/json-patch.d.ts
|
|
13
13
|
/** A JSON value, as a version's content holds it. */
|
|
14
14
|
type JsonValue = null | boolean | number | string | readonly JsonValue[] | {
|
|
@@ -7,7 +7,7 @@ import { n as Logger } from "../../logger-DWVYUmwi.js";
|
|
|
7
7
|
import { n as BlockOptions } from "../../block-helpers-CRpAHrp_.js";
|
|
8
8
|
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-DWZSJrwN.js";
|
|
9
9
|
import { n as BlockHooks } from "../../block-hooks-DZN2w69m.js";
|
|
10
|
-
import { c as BlockOf } from "../../define-block-
|
|
10
|
+
import { c as BlockOf } from "../../define-block-C1RHXz7L.js";
|
|
11
11
|
import { n as VerifyOptions } from "../../signatures-Dkx9OE8j.js";
|
|
12
12
|
//#region src/blocks/waitlist/waitlist.d.ts
|
|
13
13
|
type WaitlistStatus = "waiting" | "approved" | "rejected" | "joined";
|
|
@@ -7,13 +7,13 @@ import { r as BlockTemporalOptions } from "../../block-helpers-CRpAHrp_.js";
|
|
|
7
7
|
import { n as SqlClient } from "../../executor-hGjrop3A.js";
|
|
8
8
|
import { a as dbTransport, i as RpcClient, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-DWZSJrwN.js";
|
|
9
9
|
import { n as BlockHooks } from "../../block-hooks-DZN2w69m.js";
|
|
10
|
-
import { g as JobHandler, x as QueueSchemas, y as Queue } from "../../types-SFRomQF7.js";
|
|
11
10
|
import { t as BlockProblemOptions } from "../../problem-DNwN8iGz.js";
|
|
12
|
-
import {
|
|
11
|
+
import { g as JobHandler, x as QueueSchemas, y as Queue } from "../../types-Czq9Xtpa.js";
|
|
12
|
+
import { c as BlockOf } from "../../define-block-C1RHXz7L.js";
|
|
13
13
|
import { i as EventSink, t as CloudEvent } from "../../cloud-event-CzZTJkXv.js";
|
|
14
|
-
import { g as SubscriberPolicy, i as AuthorizationHooks } from "../../authorization-hooks-
|
|
14
|
+
import { g as SubscriberPolicy, i as AuthorizationHooks } from "../../authorization-hooks-D_pwXlBs.js";
|
|
15
15
|
import { a as verifySharedSecret, i as signWebhook, n as VerifyOptions, o as verifyWebhook, r as WebhookInput, t as VerifiedWebhook } from "../../signatures-Dkx9OE8j.js";
|
|
16
|
-
import { a as DatabaseWebhookPayload, c as hookError, d as stripeInboxVerify, f as verifyStripeWebhook, i as DatabaseChange, l as isDatabaseWebhook, n as AuthHookKind, o as authHook, r as AuthHooks, s as databaseChange, t as AuthHookError, u as signStripeWebhook } from "../../verify-
|
|
16
|
+
import { a as DatabaseWebhookPayload, c as hookError, d as stripeInboxVerify, f as verifyStripeWebhook, i as DatabaseChange, l as isDatabaseWebhook, n as AuthHookKind, o as authHook, r as AuthHooks, s as databaseChange, t as AuthHookError, u as signStripeWebhook } from "../../verify-CjvNLY7N.js";
|
|
17
17
|
import { A as IncomingVerify, C as isPublicAddress, D as IncomingDelivery, E as CreatedIncomingWebhook, F as UpdateIncomingWebhookInput, I as UpdatedIncomingWebhook, M as IncomingWebhooks, N as IncomingWebhooksOptions, O as IncomingDestination, P as RotatedIncomingSecret, S as ResolveHost, T as CreateIncomingWebhookInput, _ as WebhookResponse, a as WebhookSignInput, b as AllowUrl, c as standardWebhooks, d as RotateSecretOptions, f as WebhookSecretStore, g as WebhookRequest, h as WebhookPolicyError, i as StandardWebhooksOptions, j as IncomingWebhook, k as IncomingDestinationResult, l as standardWebhooksAsymmetric, m as FetchTransportOptions, n as HmacSignerOptions, o as WebhookSigner, p as sqlSecretStore, r as RawSigner, s as hmacSigner, t as AsymmetricWebhooksOptions, u as webhookPublicKey, v as WebhookTransport, w as publicUrl, x as PublicUrlOptions, y as fetchTransport } from "../../signers-BAEzvTJ0.js";
|
|
18
18
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
19
19
|
//#region src/core/hmac.d.ts
|
|
@@ -17,7 +17,7 @@ import { n as hmacHex, r as timingSafeEqual } from "../../hmac-B3CTTlfv.js";
|
|
|
17
17
|
import { i as signWebhook, o as verifySharedSecret, s as verifyWebhook, t as PUBLIC_KEY_PREFIX } from "../../signatures-CNcoq392.js";
|
|
18
18
|
import { t as cronRoute } from "../../cron-route-UU9i5i9J.js";
|
|
19
19
|
import { t as subjectReaders } from "../../subject-readers-B-pQ9Mmo.js";
|
|
20
|
-
import { n as hitRateLimit, o as receiveWebhook } from "../../rate-limit-
|
|
20
|
+
import { n as hitRateLimit, o as receiveWebhook } from "../../rate-limit-Dt9vAY4E.js";
|
|
21
21
|
import { n as defineBlock } from "../../define-block-BGqOO8B3.js";
|
|
22
22
|
import { a as signStripeWebhook, i as isDatabaseWebhook, n as databaseChange, o as stripeInboxVerify, r as hookError, s as verifyStripeWebhook, t as authHook } from "../../verify-ZLFUdlqE.js";
|
|
23
23
|
import { toHttp } from "../../events/index.js";
|
|
@@ -3,13 +3,13 @@ import { t as StandardSchemaV1 } from "../../standard-DBV730sF.js";
|
|
|
3
3
|
import { r as FieldsOf } from "../../block-fields-BE7pInWZ.js";
|
|
4
4
|
import { Ct as Events, gt as WorkflowEventData } from "../../events-vcqenSYU.js";
|
|
5
5
|
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-DWZSJrwN.js";
|
|
6
|
-
import { c as BlockOf } from "../../define-block-
|
|
6
|
+
import { c as BlockOf } from "../../define-block-C1RHXz7L.js";
|
|
7
7
|
import { g as Workflows, n as WorkflowRun } from "../../workflows-B0ZPAQu0.js";
|
|
8
|
-
import { p as SubscriptionStatus } from "../../topic-
|
|
9
|
-
import { n as TopicPort } from "../../watch-topic-
|
|
10
|
-
import { n as Controller, t as AuthPort } from "../../controller-
|
|
11
|
-
import { A as WorkflowVersionOwner, B as WorkflowGraphNode, C as WorkflowGrantPrincipal, D as WorkflowTrigger, E as WorkflowStepInfo, F as WorkflowFilterCondition, G as durationMs, H as WorkflowNodeKind, I as WorkflowFilterField, J as matchesFilter, K as evaluateCondition, L as WorkflowGraph, M as GraphScope, N as WorkflowCondition, O as WorkflowTriggerKind, P as WorkflowConditionOperator, R as WorkflowGraphDiff, S as WorkflowGrantAction, T as WorkflowNodeRunStatus, U as approved, V as WorkflowNodeCondition, W as diffGraphs, X as validateGraph, Y as topologicalOrder, _ as WorkflowCredential, a as CredentialInput, b as WorkflowDefinitionScope, c as GraphCompiler, d as RunInput, f as TestRunInput, g as WorkflowBuilderHooks, h as WorkflowAlert, i as BuilderStarter, j as WorkflowVersionStatus, k as WorkflowVersion, l as NodeRunRecord, m as VersionSaveOptions, n as BuilderOptions, o as DefinitionInput, p as TriggerInput, q as filterConditionOf, r as BuilderStartCall, s as GrantInput, t as AlertInput, u as PublishOptions, v as WorkflowDefinition, w as WorkflowNodeRun, x as WorkflowEditor, y as WorkflowDefinitionGrant, z as WorkflowGraphEdge } from "../../types-
|
|
12
|
-
import { a as GraphSubject, c as graphRunFields, i as GraphStepCall, l as startNodeOf, n as GraphRunFields, o as approvalToken, r as GraphRuntime, s as executeGraph, t as GraphApprovalCall } from "../../executor-
|
|
8
|
+
import { p as SubscriptionStatus } from "../../topic-CZXHhZye.js";
|
|
9
|
+
import { n as TopicPort } from "../../watch-topic-BAxoPKZx.js";
|
|
10
|
+
import { n as Controller, t as AuthPort } from "../../controller-BW-5Opig.js";
|
|
11
|
+
import { A as WorkflowVersionOwner, B as WorkflowGraphNode, C as WorkflowGrantPrincipal, D as WorkflowTrigger, E as WorkflowStepInfo, F as WorkflowFilterCondition, G as durationMs, H as WorkflowNodeKind, I as WorkflowFilterField, J as matchesFilter, K as evaluateCondition, L as WorkflowGraph, M as GraphScope, N as WorkflowCondition, O as WorkflowTriggerKind, P as WorkflowConditionOperator, R as WorkflowGraphDiff, S as WorkflowGrantAction, T as WorkflowNodeRunStatus, U as approved, V as WorkflowNodeCondition, W as diffGraphs, X as validateGraph, Y as topologicalOrder, _ as WorkflowCredential, a as CredentialInput, b as WorkflowDefinitionScope, c as GraphCompiler, d as RunInput, f as TestRunInput, g as WorkflowBuilderHooks, h as WorkflowAlert, i as BuilderStarter, j as WorkflowVersionStatus, k as WorkflowVersion, l as NodeRunRecord, m as VersionSaveOptions, n as BuilderOptions, o as DefinitionInput, p as TriggerInput, q as filterConditionOf, r as BuilderStartCall, s as GrantInput, t as AlertInput, u as PublishOptions, v as WorkflowDefinition, w as WorkflowNodeRun, x as WorkflowEditor, y as WorkflowDefinitionGrant, z as WorkflowGraphEdge } from "../../types-DsRfiQ0v.js";
|
|
12
|
+
import { a as GraphSubject, c as graphRunFields, i as GraphStepCall, l as startNodeOf, n as GraphRunFields, o as approvalToken, r as GraphRuntime, s as executeGraph, t as GraphApprovalCall } from "../../executor-Bi056Cnj.js";
|
|
13
13
|
//#region src/blocks/workflow-editor/workflow-editor.d.ts
|
|
14
14
|
/**
|
|
15
15
|
* The `workflow-editor` module's definitions, versions, triggers, credentials,
|
|
@@ -5,7 +5,7 @@ import { t as workflowEditorSqlOptions } from "../../options-DgQo80Xh.js";
|
|
|
5
5
|
import { n as whileSignedIn, t as defineController } from "../../controller-BEliOBOv.js";
|
|
6
6
|
import { A as requiredInstant, B as dbTransport, C as optionalText, D as recordOf, F as stringsOf, H as rpcTransport, I as textOf, M as seconds, O as recordOrEmpty, S as optionalInstant, T as randomToken, U as sqlTransport, d as enumOrThrow, k as recordsOf, n as applyTemporal, o as blockCall, p as injectableOf } from "../../block-helpers-CtBdjgO4.js";
|
|
7
7
|
import { r as withBlockHooks } from "../../block-hooks-BfxX3682.js";
|
|
8
|
-
import { n as PERMISSION_CAP_CLAIM } from "../../delegation
|
|
8
|
+
import { n as LEGACY_PERMISSION_CAP_CLAIM, r as PERMISSION_CAP_CLAIM } from "../../delegation-DGOIiT8k.js";
|
|
9
9
|
import { n as credentialRefInTenant, r as foreignCredentialRef } from "../../provider-B6g7rBZX.js";
|
|
10
10
|
import { n as event, t as defineEvents } from "../../event-map-CtPFhcOp.js";
|
|
11
11
|
import { n as blockFields } from "../../block-fields-DE_FgpOU.js";
|
|
@@ -183,6 +183,16 @@ function defaultClaims(automation, publisher) {
|
|
|
183
183
|
[PERMISSION_CAP_CLAIM]: automation.permissions
|
|
184
184
|
};
|
|
185
185
|
}
|
|
186
|
+
let warnedLegacyCap = false;
|
|
187
|
+
/**
|
|
188
|
+
* Warns once when `runAs` returns the cap under its 0.14 name only: the access
|
|
189
|
+
* functions still read it through 0.15, a later minor release won't.
|
|
190
|
+
*/
|
|
191
|
+
function warnLegacyCap(claims) {
|
|
192
|
+
if (warnedLegacyCap || claims["bsb_permission_cap"] !== void 0 || claims["bs_permission_cap"] === void 0) return;
|
|
193
|
+
warnedLegacyCap = true;
|
|
194
|
+
console.warn(`automation.runAs returned the permission cap as ${LEGACY_PERMISSION_CAP_CLAIM}, its 0.14 name. 0.15 still reads it, a later minor release won't: return it as ${PERMISSION_CAP_CLAIM} (PERMISSION_CAP_CLAIM from better-supabase/server).`);
|
|
195
|
+
}
|
|
186
196
|
/** A hook's answer, with a throw or a rejection as `undefined`. */
|
|
187
197
|
async function settled(run) {
|
|
188
198
|
try {
|
|
@@ -236,6 +246,7 @@ function runAsPublisher(serviceCall, runAs, version, tenant) {
|
|
|
236
246
|
}
|
|
237
247
|
const claims = await settled(() => runAs(automation));
|
|
238
248
|
if (claims === void 0 || claims === null || !isRecord(claims)) return err(forbidden(automation.publisher === null ? "The app has no service principal for this organization's workflow" : "The user who published this workflow can no longer run it", "WORKFLOW_PUBLISHER_REVOKED"));
|
|
249
|
+
warnLegacyCap(claims);
|
|
239
250
|
return ok(claims);
|
|
240
251
|
});
|
|
241
252
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { b as DbError } from "../../result-DZeA5KS6.js";
|
|
2
2
|
import { Ct as Events, _t as WorkflowRunEventData } from "../../events-vcqenSYU.js";
|
|
3
3
|
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-DWZSJrwN.js";
|
|
4
|
-
import { c as BlockOf } from "../../define-block-
|
|
4
|
+
import { c as BlockOf } from "../../define-block-C1RHXz7L.js";
|
|
5
5
|
import { _ as WorkflowsHooks, a as WorkflowRunStatus, c as WorkflowScheduleInput, d as WorkflowStartTicket, f as WorkflowStarter, g as Workflows, h as WorkflowTickResult, i as WorkflowRunRecord, l as WorkflowStartCall, m as WorkflowTickOptions, n as WorkflowRun, o as WorkflowRunsQuery, s as WorkflowSchedule, u as WorkflowStartRequest, v as WorkflowsOptions, y as createWorkflows } from "../../workflows-B0ZPAQu0.js";
|
|
6
|
-
import { p as SubscriptionStatus } from "../../topic-
|
|
7
|
-
import { n as TopicPort } from "../../watch-topic-
|
|
8
|
-
import { n as Controller, t as AuthPort } from "../../controller-
|
|
6
|
+
import { p as SubscriptionStatus } from "../../topic-CZXHhZye.js";
|
|
7
|
+
import { n as TopicPort } from "../../watch-topic-BAxoPKZx.js";
|
|
8
|
+
import { n as Controller, t as AuthPort } from "../../controller-BW-5Opig.js";
|
|
9
9
|
//#region src/blocks/workflows/client.d.ts
|
|
10
10
|
interface WorkflowRunsControllerOptions {
|
|
11
11
|
readonly client: {
|
|
@@ -5,7 +5,7 @@ import { r as FieldsOf } from "./block-fields-BE7pInWZ.js";
|
|
|
5
5
|
import { n as Logger } from "./logger-DWVYUmwi.js";
|
|
6
6
|
import { n as BlockOptions } from "./block-helpers-CRpAHrp_.js";
|
|
7
7
|
import { n as BlockHooks } from "./block-hooks-DZN2w69m.js";
|
|
8
|
-
import { g as JobHandler } from "./types-
|
|
8
|
+
import { g as JobHandler } from "./types-Czq9Xtpa.js";
|
|
9
9
|
import { o as WeeklyHours } from "./availability-vguUvEK2.js";
|
|
10
10
|
//#region src/blocks/bookings/series.d.ts
|
|
11
11
|
/** An ISO weekday: 1 is Monday, 7 is Sunday. */
|
|
@@ -429,6 +429,39 @@ interface Reservation {
|
|
|
429
429
|
readonly token: string;
|
|
430
430
|
readonly signedUrl: string;
|
|
431
431
|
}
|
|
432
|
+
/**
|
|
433
|
+
* A signed upload for a TUS client such as `tus-js-client`: send every request
|
|
434
|
+
* to `tusEndpoint` with `headers` (`x-signature` carries the token, `x-upsert`
|
|
435
|
+
* the upsert choice) and `metadata` plus the file's `contentType` and
|
|
436
|
+
* `cacheControl`. The browser needs no access token. Finish it with
|
|
437
|
+
* `claimReserved`, as a plain reservation.
|
|
438
|
+
*/
|
|
439
|
+
interface ResumableReservation extends Reservation {
|
|
440
|
+
readonly bucket: string;
|
|
441
|
+
/** `<storage>/upload/resumable/sign`, on the direct Storage host when hosted. */
|
|
442
|
+
readonly tusEndpoint: string;
|
|
443
|
+
/** When the token expires (ISO 8601); start the upload before then. */
|
|
444
|
+
readonly expiresAt: string;
|
|
445
|
+
readonly headers: {
|
|
446
|
+
readonly "x-signature": string;
|
|
447
|
+
readonly "x-upsert": "true" | "false";
|
|
448
|
+
};
|
|
449
|
+
/** The TUS metadata Storage needs to place the object. */
|
|
450
|
+
readonly metadata: {
|
|
451
|
+
readonly bucketName: string;
|
|
452
|
+
readonly objectName: string;
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
interface ReserveResumableOptions {
|
|
456
|
+
readonly upsert?: boolean;
|
|
457
|
+
/**
|
|
458
|
+
* Use the direct Storage host (`<project-ref>.storage.supabase.co`) on a
|
|
459
|
+
* hosted project. Defaults to true.
|
|
460
|
+
*/
|
|
461
|
+
readonly direct?: boolean;
|
|
462
|
+
/** Epoch ms, for the expiry fallback when the token carries no `exp`. */
|
|
463
|
+
readonly now?: () => number;
|
|
464
|
+
}
|
|
432
465
|
interface ReplaceOptions<Id extends string = string> extends UploadOptions {
|
|
433
466
|
/**
|
|
434
467
|
* Path the object replaces, checked like any other target before the upload.
|
|
@@ -554,6 +587,12 @@ interface BucketClient<P extends string, Id extends string = string, V extends s
|
|
|
554
587
|
reserve(target: ObjectTarget<P, Id>, options?: {
|
|
555
588
|
upsert?: boolean;
|
|
556
589
|
}): AsyncResult<Reservation>;
|
|
590
|
+
/**
|
|
591
|
+
* A signed resumable (TUS) upload for a browser or another service, with the
|
|
592
|
+
* endpoint, headers and metadata the client sends. In a support session the
|
|
593
|
+
* target must be allowed to write the path, as for `reserve`.
|
|
594
|
+
*/
|
|
595
|
+
reserveResumable(target: ObjectTarget<P, Id>, options?: ReserveResumableOptions): AsyncResult<ResumableReservation>;
|
|
557
596
|
uploadReserved(reservation: Pick<Reservation, "path" | "token">, body: UploadBody, options?: UploadOptions): AsyncResult<{
|
|
558
597
|
path: StoragePath<Id>;
|
|
559
598
|
}>;
|
|
@@ -663,4 +702,4 @@ declare function parseSize(value: string | number): number;
|
|
|
663
702
|
*/
|
|
664
703
|
declare function defineBucket<const P extends string, const Id extends string = string, const V extends string = never>(config: BucketConfig<P, Id, V>): Bucket<P, Id, V>;
|
|
665
704
|
//#endregion
|
|
666
|
-
export {
|
|
705
|
+
export { AppliedBucket as $, TtlPreset as A, StorageListV2Folder as B, TransformOptions as C, defineBucket as D, UrlOptions as E, StorageDownloadOptions as F, StorageResponse as G, StorageListV2Result as H, StorageFailure as I, StorageSignedUrlEntry as J, StorageSearchOptions as K, StorageFetchParameters as L, StorageBucketApi as M, StorageClient as N, parseSize as O, StorageDestinationOptions as P, StoragePath as Q, StorageFileOptions as R, TransferOptions as S, UploadOptions as T, StorageObjectInfo as U, StorageListV2Object as V, StorageRemoveEntry as W, StorageUrlOptions as X, StorageTransform as Y, PathIn as Z, ResumableReservation as _, BucketConnectOptions as a, SweepOptions as b, DownloadOptions as c, PathValues as d, TemplateParams as et, PurgeCacheOptions as f, ReserveResumableOptions as g, Reservation as h, BucketConfig as i, StorageApi as j, TTL as k, ImageTransform as l, ReplaceResult as m, Bucket as n, BucketDrift as o, ReplaceOptions as p, StorageSearchV2Options as q, BucketClient as r, BucketPolicy as s, ActualBucket as t, TemplateValues as tt, ObjectTarget as u, StorageAdminClient as v, UploadBody as w, SweepResult as x, StoredObject as y, StorageListEntry as z };
|
package/dist/chat-sdk/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { a as CredentialSubject, i as CredentialRef, o as CredentialToken, r as
|
|
|
4
4
|
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../block-transport-DWZSJrwN.js";
|
|
5
5
|
import { o as StreamStore } from "../store-CpheI-lN.js";
|
|
6
6
|
import { u as MessageFile } from "../messaging-C_Pr9tGx.js";
|
|
7
|
-
import { c as ChatActionHook, d as IdentityRef, f as IdentityTarget, i as AuthorizationHooks, p as PrincipalByIdentity, s as ChatAction, t as ApprovalRequestRef } from "../authorization-hooks-
|
|
7
|
+
import { c as ChatActionHook, d as IdentityRef, f as IdentityTarget, i as AuthorizationHooks, p as PrincipalByIdentity, s as ChatAction, t as ApprovalRequestRef } from "../authorization-hooks-D_pwXlBs.js";
|
|
8
8
|
import { S as StoredInboundEvent, c as DeliveryStatus, f as InboxFileSource, i as Conversation, l as InboundResult, p as InboxMessage, y as PendingInboxFile } from "../types-Dp3UCr1e.js";
|
|
9
9
|
import { a as Inbox } from "../inbox-NDKwSk_H.js";
|
|
10
10
|
import { Adapter, AdapterPostableMessage, Attachment, Author, Message, RawMessage, StateAdapter, WebhookOptions } from "chat";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as addCommand } from "./add-D7TkPdco.js";
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { a as list, p as commandMeta, r as defineCliCommand } from "./command-CQ61x6gN.js";
|
|
2
2
|
import { i as plain } from "./style-Bm2X5JrN.js";
|
|
3
|
-
import { t as VERSION } from "./version-
|
|
3
|
+
import { t as VERSION } from "./version-B2Dr6VmJ.js";
|
|
4
4
|
import { a as parseNames, n as CliError } from "./errors-BTe6A15O.js";
|
|
5
5
|
import { r as readIfExists, t as display } from "./io-DH1kcmmP.js";
|
|
6
|
-
import { t as loadSnapshot } from "./snapshot-
|
|
6
|
+
import { t as loadSnapshot } from "./snapshot-uTUlEzY2.js";
|
|
7
7
|
import { t as isRecord } from "./guards-CUlDNYZs.js";
|
|
8
|
-
import { a as toCatalog } from "./source-
|
|
9
|
-
import { f as dataMigration } from "./module-migration-
|
|
8
|
+
import { a as toCatalog } from "./source-D2gJHKwC.js";
|
|
9
|
+
import { f as dataMigration } from "./module-migration-O_IxewFs.js";
|
|
10
10
|
import { a as findConfig, f as INTEGRATIONS, s as loadConfig } from "./config-9t5ec_N7.js";
|
|
11
11
|
import { i as changeLines, n as PLAN_ARGS, r as applyPlan, u as planResult } from "./files-CX71yBm8.js";
|
|
12
|
-
import { a as wiringFiles, d as libEntry, f as needsLib, i as wiringChecklist, l as importFrom, n as latestMigrationVersion, o as wiringFor, p as resolveIntegrations, s as TEMPLATES, u as isIntegration } from "./migration-safety-
|
|
12
|
+
import { a as wiringFiles, d as libEntry, f as needsLib, i as wiringChecklist, l as importFrom, n as latestMigrationVersion, o as wiringFor, p as resolveIntegrations, s as TEMPLATES, u as isIntegration } from "./migration-safety-BnnXPAro.js";
|
|
13
13
|
import { n as installCommand, t as detectProject } from "./detect-D9JaAX20.js";
|
|
14
14
|
import { d as setBlockInJson, f as setPathInConfig, h as setPresetInJson, m as setPresetInConfig, n as addBlocksToJson, p as setPathInJson, r as addBlocksToWiring, t as addBlocksToConfig, u as setBlockInConfig } from "./config-edit-CrWfk8s3.js";
|
|
15
|
-
import { t as syncModules } from "./sync-
|
|
16
|
-
import { t as addModules } from "./add-
|
|
17
|
-
import { n as ident } from "./live-
|
|
18
|
-
import { t as blockNames } from "./blocks-
|
|
15
|
+
import { t as syncModules } from "./sync-CZMRB3aU.js";
|
|
16
|
+
import { t as addModules } from "./add-I8OW-qJH.js";
|
|
17
|
+
import { n as ident } from "./live-DGdLR41j.js";
|
|
18
|
+
import { t as blockNames } from "./blocks-xk-SE8gS.js";
|
|
19
19
|
import { i as sourceArgs, n as SOURCE_ARGS } from "./source-args-IpJRJO5t.js";
|
|
20
20
|
import { existsSync } from "node:fs";
|
|
21
21
|
import { dirname, join, posix, resolve } from "node:path";
|
|
@@ -252,7 +252,7 @@ function qualifiedName(name) {
|
|
|
252
252
|
}
|
|
253
253
|
/** The introspected tables in the shape a proposal reads. */
|
|
254
254
|
function existingTables(tables) {
|
|
255
|
-
return tables
|
|
255
|
+
return tables;
|
|
256
256
|
}
|
|
257
257
|
function candidates(logical, physical) {
|
|
258
258
|
const snake = toSnake(logical);
|
|
@@ -321,7 +321,7 @@ function matchTables(block, tables, from, schemas, errors) {
|
|
|
321
321
|
for (const name of from) {
|
|
322
322
|
const table = byName.get(qualifiedName(name));
|
|
323
323
|
if (table === void 0) {
|
|
324
|
-
errors.push(`${qualifiedName(name)} is not a table in the database.`);
|
|
324
|
+
errors.push(`${qualifiedName(name)} is not a table or view in the database.`);
|
|
325
325
|
continue;
|
|
326
326
|
}
|
|
327
327
|
const best = Object.entries(spec).filter(([logical]) => !chosen.has(logical)).map(([logical, names]) => ({
|
|
@@ -391,6 +391,7 @@ function proposeAdoption(block, tables, options = {}) {
|
|
|
391
391
|
for (const match of columns) {
|
|
392
392
|
if (match.column === null) {
|
|
393
393
|
if (table.optional?.includes(match.logical) === true) mapped[match.logical] = null;
|
|
394
|
+
else if (existing.kind === "view") errors.push(`${name} is a view with no column for ${logical}.${match.logical}, and the block can't add one to a view. Add ${table.columns[match.logical]} to the view, or map blocks.${block}.columns.${logical}.${match.logical} to the column that holds it.`);
|
|
394
395
|
else warnings.push(`${name} has no column for ${logical}.${match.logical}, so the block's migration adds ${table.columns[match.logical]}. Map blocks.${block}.columns.${logical}.${match.logical} instead when another column holds it.`);
|
|
395
396
|
continue;
|
|
396
397
|
}
|
|
@@ -417,10 +418,14 @@ function proposeAdoption(block, tables, options = {}) {
|
|
|
417
418
|
};
|
|
418
419
|
const adopted = [...chosen.values()].filter((table) => table !== null);
|
|
419
420
|
const ownTables = Object.fromEntries(tables.map((table) => [`${table.schema}.${table.name}`, "database"]));
|
|
421
|
+
const ownViews = Object.fromEntries(tables.filter((table) => table.kind === "view").map((table) => [`${table.schema}.${table.name}`, { updatable: table.updatable === true }]));
|
|
422
|
+
const ownColumns = Object.fromEntries(tables.map((table) => [`${table.schema}.${table.name}`, table.columns.map((column) => column.name)]));
|
|
420
423
|
try {
|
|
421
424
|
moduleBody(block, {
|
|
422
425
|
modules: blocks,
|
|
423
|
-
ownTables
|
|
426
|
+
ownTables,
|
|
427
|
+
ownViews,
|
|
428
|
+
ownColumns
|
|
424
429
|
});
|
|
425
430
|
errors.push(...adoptedColumnProblems(blocks, adopted.map((table) => ({ text: declaration(table) })), [...new Set(adopted.map((table) => table.schema))], ownTables));
|
|
426
431
|
} catch (error) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { n as CliError } from "./errors-BTe6A15O.js";
|
|
2
|
-
import {
|
|
2
|
+
import { T as providerLabel, _ as layoutFor, h as MEMBERSHIP_CLAIM_MODULES, v as providerOwnsMemberships } from "./module-migration-O_IxewFs.js";
|
|
3
3
|
import { r as applyPlan } from "./files-CX71yBm8.js";
|
|
4
4
|
import { n as addBlocksToJson, s as keyText, t as addBlocksToConfig } from "./config-edit-CrWfk8s3.js";
|
|
5
|
-
import { a as write, i as unlistedModuleFiles, r as nextStep } from "./sync-
|
|
5
|
+
import { a as write, i as unlistedModuleFiles, r as nextStep } from "./sync-CZMRB3aU.js";
|
|
6
6
|
import { basename, dirname } from "node:path";
|
|
7
7
|
import { readFile } from "node:fs/promises";
|
|
8
8
|
import { SQL_MODULES, resolveBlocks } from "better-supabase/sql";
|
|
@@ -3,7 +3,7 @@ import { n as CliError, r as errorText } from "./errors-BTe6A15O.js";
|
|
|
3
3
|
import { i as isLocalDatabaseUrl, r as databaseHost } from "./agent-CbuPvI2x.js";
|
|
4
4
|
import { l as stdinDatabaseUrl, n as databaseUrl } from "./config-9t5ec_N7.js";
|
|
5
5
|
import { t as connect } from "./db-CQCLx7cx.js";
|
|
6
|
-
import { n as ident } from "./live-
|
|
6
|
+
import { n as ident } from "./live-DGdLR41j.js";
|
|
7
7
|
import { r as STACK_ARG, t as DB_URL_STDIN_ARG } from "./source-args-IpJRJO5t.js";
|
|
8
8
|
//#region src/cli/commands/backfill.ts
|
|
9
9
|
const DEFAULT_BATCH = 1e3;
|
package/dist/cli/bin.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as blocksListCommand, r as blocksSearchCommand, i as blocksViewCommand } from "./blocks-
|
|
1
|
+
export { n as blocksListCommand, r as blocksSearchCommand, i as blocksViewCommand } from "./blocks-xk-SE8gS.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { p as commandMeta, r as defineCliCommand } from "./command-CQ61x6gN.js";
|
|
2
2
|
import { n as CliError } from "./errors-BTe6A15O.js";
|
|
3
3
|
import { t as SQL_ARGS } from "./args-UEwg0l-N.js";
|
|
4
|
-
import { n as listModules, t as printModule } from "./print-
|
|
4
|
+
import { n as listModules, t as printModule } from "./print-DosQIFSy.js";
|
|
5
5
|
import { t as decodePresetInput } from "./preset-BwmIfFnh.js";
|
|
6
6
|
import { BLOCK_CATEGORIES } from "better-supabase/blocks";
|
|
7
7
|
import { PRESET_CATALOG, PRESET_NAMES, glueCommand } from "better-supabase/preset";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as VERSION } from "./version-
|
|
1
|
+
import { t as VERSION } from "./version-B2Dr6VmJ.js";
|
|
2
2
|
import { dirname, resolve } from "node:path";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
import { mkdir, readFile, rename, rm, writeFile } from "node:fs/promises";
|
|
@@ -4,9 +4,12 @@ import { n as CliError } from "./errors-BTe6A15O.js";
|
|
|
4
4
|
import { t as migrateCliCall } from "./moved-CsfDQcyk.js";
|
|
5
5
|
import { t as isRecord$1 } from "./guards-CUlDNYZs.js";
|
|
6
6
|
import { a as changedFiles, i as changeLines, r as applyPlan, u as planResult } from "./files-CX71yBm8.js";
|
|
7
|
+
import { i as schemasDirOf, n as migrationsDir, o as writtenByBlocks } from "./sql-layout-lUWenjJw.js";
|
|
7
8
|
import { a as configObject, c as mask, f as setPathInConfig, g as skipSpace, h as setPresetInJson, i as closingIndex, l as properties, m as setPresetInConfig, o as indentAt, p as setPathInJson, t as addBlocksToConfig, v as codeRanges } from "./config-edit-CrWfk8s3.js";
|
|
9
|
+
import { i as legacyPrefixNames, n as LEGACY_PREFIXES, t as LEGACY_CLAIMS } from "./legacy-prefix-DkTA3Rhx.js";
|
|
8
10
|
import { a as REVIEW_0_15, c as renameSubpaths, r as PLUGIN_IMPORT_RENAMES, s as SUBPATH_RENAMES_0_15, t as BLOCK_EXPORT_RENAMES } from "./codemod-block-renames-BuSaTE_G.js";
|
|
9
11
|
import { a as RECORD_BINDING_RENAMES, n as groupConfigJson, r as groupConfigSource, t as cutRange } from "./config-group-C8tjut39.js";
|
|
12
|
+
import { existsSync } from "node:fs";
|
|
10
13
|
import { extname, join, relative, resolve } from "node:path";
|
|
11
14
|
import { readFile, readdir, stat } from "node:fs/promises";
|
|
12
15
|
import { DEFAULT_CONVENTIONS, presetSpec } from "better-supabase/preset";
|
|
@@ -44,17 +47,39 @@ function cliCalls(text, migrate) {
|
|
|
44
47
|
}
|
|
45
48
|
return calls;
|
|
46
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* A CLI call followed by `&&` and the same call again. The call starts after a
|
|
52
|
+
* shell operator, a quote, a line break or a YAML `run:`, and the repeat ends
|
|
53
|
+
* at one, so only whole commands match.
|
|
54
|
+
*/
|
|
55
|
+
const REPEATED_CALL = /((?:^|&&|\|\||[;:\n"'`(])[ \t]*)([^&|;\n"'`()]*?(?<![\w.@-])(?:better-supabase|bsb)(?:@[\w.^~-]+)?[ \t][^&|;\n"'`()]*?)[ \t]*&&[ \t]*\2(?=[ \t]*(?:&&|\|\||[;\n"'`)]|$))/g;
|
|
56
|
+
/**
|
|
57
|
+
* `text` with each run of identical CLI calls joined by `&&` kept once. Two old
|
|
58
|
+
* commands can move to the same new one (`sql sync` and `sql upgrade` both
|
|
59
|
+
* become `upgrade`), and running it twice in a row does the work twice.
|
|
60
|
+
*/
|
|
61
|
+
function collapseRepeatedCalls(text) {
|
|
62
|
+
let out = text;
|
|
63
|
+
let previous;
|
|
64
|
+
while (out !== previous) {
|
|
65
|
+
previous = out;
|
|
66
|
+
out = out.replaceAll(REPEATED_CALL, "$1$2");
|
|
67
|
+
}
|
|
68
|
+
return out;
|
|
69
|
+
}
|
|
47
70
|
/** `text` with every moved CLI call spelled the new way. */
|
|
48
71
|
function rewriteCliCalls(text, migrate) {
|
|
72
|
+
const calls = cliCalls(text, migrate);
|
|
73
|
+
if (calls.length === 0) return text;
|
|
49
74
|
let out = "";
|
|
50
75
|
let cursor = 0;
|
|
51
|
-
for (const call of
|
|
76
|
+
for (const call of calls) {
|
|
52
77
|
const original = text.slice(call.start, call.end);
|
|
53
78
|
const trailing = /\s*$/u.exec(original)?.[0] ?? "";
|
|
54
79
|
out += `${text.slice(cursor, call.start)} ${call.to.join(" ")}${trailing}`;
|
|
55
80
|
cursor = call.end;
|
|
56
81
|
}
|
|
57
|
-
return out + text.slice(cursor);
|
|
82
|
+
return collapseRepeatedCalls(out + text.slice(cursor));
|
|
58
83
|
}
|
|
59
84
|
/** One review line per moved CLI call, with the new spelling. */
|
|
60
85
|
function cliCallHints(text, migrate) {
|
|
@@ -421,6 +446,71 @@ function designFileResult(source, rewrite) {
|
|
|
421
446
|
};
|
|
422
447
|
}
|
|
423
448
|
//#endregion
|
|
449
|
+
//#region src/cli/codemod-sql-names.ts
|
|
450
|
+
/**
|
|
451
|
+
* The 0.15 `bs_` to `bsb_` rename in the app's own SQL. The upgrade migration
|
|
452
|
+
* renames the objects in the database, but SQL the app wrote (pgTAP tests, its
|
|
453
|
+
* schema files, its newest migration) still names them the old way, so the
|
|
454
|
+
* codemod lists those lines. It never rewrites SQL: a pushed migration must not
|
|
455
|
+
* change, and a test may name an object on purpose.
|
|
456
|
+
*/
|
|
457
|
+
const LEGACY_NAME = /\bbs_[a-z0-9_]+/g;
|
|
458
|
+
const CURRENT_NAME = /\bbsb_[a-z0-9_]+/g;
|
|
459
|
+
/**
|
|
460
|
+
* The `bs_` names the 0.15 rename covers, from the files better-supabase wrote:
|
|
461
|
+
* their old `bs_` names before `upgrade` rewrites them, or the `bs_` form of
|
|
462
|
+
* their `bsb_` names after.
|
|
463
|
+
*/
|
|
464
|
+
function renamedSqlNames(blockFiles) {
|
|
465
|
+
const text = blockFiles.join("\n");
|
|
466
|
+
return /* @__PURE__ */ new Set([...legacyPrefixNames(text), ...[...new Set(text.match(CURRENT_NAME))].map((name) => `bs_${name.slice(4)}`).filter((name) => !LEGACY_CLAIMS.has(name))]);
|
|
467
|
+
}
|
|
468
|
+
const renamed = (name, names) => names.has(name) || LEGACY_PREFIXES.some((prefix) => name.startsWith(prefix));
|
|
469
|
+
/** One hint per line and renamed name in `sources`. */
|
|
470
|
+
function sqlNameHints(sources, names) {
|
|
471
|
+
const hints = [];
|
|
472
|
+
for (const source of sources) for (const [index, line] of source.text.split("\n").entries()) for (const name of new Set(line.match(LEGACY_NAME))) if (renamed(name, names)) hints.push({
|
|
473
|
+
file: source.path,
|
|
474
|
+
line: index + 1,
|
|
475
|
+
message: `${name} is bsb_${name.slice(3)} since 0.15, and the upgrade migration renames it in the database. Rename it here, in SQL that runs after that migration.`
|
|
476
|
+
});
|
|
477
|
+
return hints;
|
|
478
|
+
}
|
|
479
|
+
async function sqlFiles(dir) {
|
|
480
|
+
if (!existsSync(dir)) return [];
|
|
481
|
+
const files = [];
|
|
482
|
+
for (const entry of await readdir(dir, { withFileTypes: true })) {
|
|
483
|
+
const full = join(dir, entry.name);
|
|
484
|
+
if (entry.isDirectory()) files.push(...await sqlFiles(full));
|
|
485
|
+
else if (entry.name.endsWith(".sql")) files.push(full);
|
|
486
|
+
}
|
|
487
|
+
return files.toSorted();
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* Lines of the app's SQL that name a `bs_` object the 0.15 upgrade renames: the
|
|
491
|
+
* pgTAP tests (`sql.testsDir`), the schema files no block wrote, and the newest
|
|
492
|
+
* migration the app wrote. Older migrations already ran, so they stay as they
|
|
493
|
+
* are.
|
|
494
|
+
*/
|
|
495
|
+
async function legacySqlNameHints(config) {
|
|
496
|
+
const read = async (path) => ({
|
|
497
|
+
path: relative(config.root, path).replaceAll("\\", "/"),
|
|
498
|
+
text: await readFile(path, "utf-8")
|
|
499
|
+
});
|
|
500
|
+
const [tests, schemas, migrations] = await Promise.all([
|
|
501
|
+
Promise.all((await sqlFiles(join(config.root, config.sql.testsDir))).map(read)),
|
|
502
|
+
Promise.all((await sqlFiles(join(config.root, await schemasDirOf(config)))).map(read)),
|
|
503
|
+
Promise.all((await sqlFiles(join(config.root, migrationsDir(config)))).map(read))
|
|
504
|
+
]);
|
|
505
|
+
const names = renamedSqlNames([...schemas, ...migrations].filter(writtenByBlocks).map((file) => file.text));
|
|
506
|
+
const latest = migrations.findLast((file) => !writtenByBlocks(file));
|
|
507
|
+
return sqlNameHints([
|
|
508
|
+
...tests.filter((file) => !writtenByBlocks(file)),
|
|
509
|
+
...schemas.filter((file) => !writtenByBlocks(file)),
|
|
510
|
+
...latest === void 0 ? [] : [latest]
|
|
511
|
+
], names);
|
|
512
|
+
}
|
|
513
|
+
//#endregion
|
|
424
514
|
//#region src/cli/codemod-data-contract.ts
|
|
425
515
|
/** The query guards named after the retired verbs. */
|
|
426
516
|
const DATA_CONTRACT_OPTIONS = [{
|
|
@@ -1798,7 +1888,8 @@ const CODEMODS = {
|
|
|
1798
1888
|
},
|
|
1799
1889
|
"0.15": {
|
|
1800
1890
|
name: "0.15",
|
|
1801
|
-
description: "Regroups better-supabase.config.* into database, auth, gen, api and tooling (subjects to records, appTables to tables, integrations to adapters, a block's mode, scope, entities and hooks to ownership, owner, names and callbacks, and removes ownership: \"adopt\", since a block now leaves alone the tables the schema already has; claims.tenant and the tenant plugin's column to auth.organization); renames the requireTenant option and helper to requireOrganization; renames the runtime instance bs to bsb (the CLI's short name) where a file creates, imports or destructures it, and the bs key on request contexts (ctx.bs, c.var.bs, locals.bs, context.bs) to bsb; renames imports: SqlModule to BlockSql, ModuleDefinition to BlockSqlDefinition and the other Module* SQL types to BlockSql*, SubjectRef to RecordRef, entityForm to recordForm, ShipmentCarrier to ShippingProvider, QueueBackend to QueueProvider; rewrites CLI calls in package.json scripts and GitHub workflows to the 0.15 commands (apply and adopt to add, sql sync and sql upgrade to upgrade, introspect to gen --save-snapshot, seed to db seed, env, run, keys and stack to dev); renames the blocks 0.15 renamed (work-items to tasks, parties to contacts, engagements to activities, access to permissions, rules to automations, jobs to queue, activity to timeline and the rest of the 0.14 to 0.15 guide's table) in the config's blocks and preset.blocks, in operation names under auth.authorization.operations, in better-supabase/blocks/<name> imports and in the exports named after them; turns a 0.14 preset code in the config's preset into the preset name or object it holds, and a 0.14 design file into a design with its preset inside; moves the plugins key into blocks (timestamps to updated-at, actor to created-by, softDelete to trash, with their columns as the block's options; tenant to auth.organization.column when memberships is not installed) and the better-supabase/plugins/* imports to the block extensions, better-supabase/lint guards and validation from better-supabase; moves repository calls to the data contract (findMany to list, paginate to page, findById, findUnique and findOnly to get, findFirst to list with limit: 1, exists to count, createMany and upsertMany to create and upsert with an array, updateMany and deleteMany to update and delete with a { where } filter); renames generateFeatures to gen.recordTypes, the record section exports to record bindings (defineSection to defineRecordBinding, commentsSection to commentsBinding, loadSections to loadBindings and the rest) and lists record feature imports, recordServer and sectionAction calls for the move to bsb.record; cache tags, query keys and the debug header and route that start with bs are listed for review",
|
|
1891
|
+
description: "Regroups better-supabase.config.* into database, auth, gen, api and tooling (subjects to records, appTables to tables, integrations to adapters, a block's mode, scope, entities and hooks to ownership, owner, names and callbacks, and removes ownership: \"adopt\", since a block now leaves alone the tables the schema already has; claims.tenant and the tenant plugin's column to auth.organization); renames the requireTenant option and helper to requireOrganization; renames the runtime instance bs to bsb (the CLI's short name) where a file creates, imports or destructures it, and the bs key on request contexts (ctx.bs, c.var.bs, locals.bs, context.bs) to bsb; renames imports: SqlModule to BlockSql, ModuleDefinition to BlockSqlDefinition and the other Module* SQL types to BlockSql*, SubjectRef to RecordRef, entityForm to recordForm, ShipmentCarrier to ShippingProvider, QueueBackend to QueueProvider; rewrites CLI calls in package.json scripts and GitHub workflows to the 0.15 commands (apply and adopt to add, sql sync and sql upgrade to upgrade, introspect to gen --save-snapshot, seed to db seed, env, run, keys and stack to dev); renames the blocks 0.15 renamed (work-items to tasks, parties to contacts, engagements to activities, access to permissions, rules to automations, jobs to queue, activity to timeline and the rest of the 0.14 to 0.15 guide's table) in the config's blocks and preset.blocks, in operation names under auth.authorization.operations, in better-supabase/blocks/<name> imports and in the exports named after them; turns a 0.14 preset code in the config's preset into the preset name or object it holds, and a 0.14 design file into a design with its preset inside; moves the plugins key into blocks (timestamps to updated-at, actor to created-by, softDelete to trash, with their columns as the block's options; tenant to auth.organization.column when memberships is not installed) and the better-supabase/plugins/* imports to the block extensions, better-supabase/lint guards and validation from better-supabase; moves repository calls to the data contract (findMany to list, paginate to page, findById, findUnique and findOnly to get, findFirst to list with limit: 1, exists to count, createMany and upsertMany to create and upsert with an array, updateMany and deleteMany to update and delete with a { where } filter); renames generateFeatures to gen.recordTypes, the record section exports to record bindings (defineSection to defineRecordBinding, commentsSection to commentsBinding, loadSections to loadBindings and the rest) and lists record feature imports, recordServer and sectionAction calls for the move to bsb.record; cache tags, query keys and the debug header and route that start with bs are listed for review, and so are the lines of the app's SQL tests, schema files and newest migration that name a bs_ object the upgrade renames to bsb_",
|
|
1892
|
+
sqlNames: true,
|
|
1802
1893
|
bindings: {
|
|
1803
1894
|
bs: "bsb",
|
|
1804
1895
|
SqlModule: "BlockSql",
|
|
@@ -2305,6 +2396,7 @@ async function runCodemod(config, args, paint = plain) {
|
|
|
2305
2396
|
policy: "edit"
|
|
2306
2397
|
});
|
|
2307
2398
|
}
|
|
2399
|
+
if (codemod.sqlNames === true) review.push(...await legacySqlNameHints(config));
|
|
2308
2400
|
const plan = {
|
|
2309
2401
|
root: config.root,
|
|
2310
2402
|
regenerate: `better-supabase codemod ${codemod.name}`,
|