better-supabase 0.9.0 → 0.10.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/README.md +3 -0
- package/dist/{adapter-CEjmtazZ.js → adapter-rmWaLNe3.js} +3 -3
- package/dist/{agents-BCNhIxVZ.d.ts → agents-ByYUSZxT.d.ts} +4 -4
- package/dist/{ai-cache-Dps7aRu1.d.ts → ai-cache-CkxtAt4P.d.ts} +4 -4
- package/dist/{ai-cache-zeUL94pB.js → ai-cache-DPiuJ-zJ.js} +2 -2
- package/dist/{ai-chat-3GBSlFR4.d.ts → ai-chat-al8b3spK.d.ts} +4 -4
- package/dist/{ai-files-D2_9YLjF.js → ai-files-BXtV3ygd.js} +5 -5
- package/dist/ai-sdk/agents/index.d.ts +6 -6
- package/dist/ai-sdk/agents/index.js +1 -1
- package/dist/ai-sdk/batches/index.d.ts +3 -3
- package/dist/ai-sdk/batches/index.js +2 -2
- package/dist/ai-sdk/cache/index.d.ts +1 -1
- package/dist/ai-sdk/cache/index.js +1 -1
- package/dist/ai-sdk/chat/index.d.ts +1 -1
- package/dist/ai-sdk/chat/index.js +1 -1
- package/dist/ai-sdk/embeddings/index.d.ts +2 -2
- package/dist/ai-sdk/files/index.d.ts +1 -1
- package/dist/ai-sdk/files/index.js +3 -3
- package/dist/ai-sdk/index.d.ts +5 -5
- package/dist/ai-sdk/mcp/index.d.ts +3 -3
- package/dist/ai-sdk/mcp/index.js +2 -2
- package/dist/ai-sdk/memory/index.d.ts +3 -3
- package/dist/ai-sdk/workflow/index.d.ts +3 -3
- package/dist/ai-sdk/workflow/index.js +1 -1
- package/dist/{ai-tasks-Ih5oHfyj.d.ts → ai-tasks-Di0gmJOX.d.ts} +5 -5
- package/dist/{announcements-BHCzraR6.js → announcements-HF7LuFw5.js} +4 -4
- package/dist/{api-TG3jE5aO.d.ts → api-XJcQON_7.d.ts} +6 -6
- package/dist/{api-keys-BEQatEUW.js → api-keys-C1IZF7p8.js} +4 -4
- package/dist/{api-keys-BYoGCM9p.d.ts → api-keys-EdSNjGIZ.d.ts} +4 -4
- package/dist/{app-tables-BGl5_U2x.js → app-tables-BRjMcWhW.js} +248 -13
- package/dist/app-tables-DVidEHOI.d.ts +35 -0
- package/dist/{approvals-a2KmioBh.d.ts → approvals-DqlPHBHI.d.ts} +4 -4
- package/dist/arazzo/index.d.ts +2 -2
- package/dist/{assistant-Bf2cA6RO.d.ts → assistant-BZyhQ8bd.d.ts} +2 -2
- package/dist/astro/index.d.ts +7 -7
- package/dist/astro/index.js +5 -5
- package/dist/asyncapi/index.d.ts +1 -1
- package/dist/{attachments-DAj2Yp95.js → attachments-C8FEBBKE.js} +5 -5
- package/dist/{audit-log-BMMuGPdP.js → audit-log-CRgiHlRh.js} +6 -6
- package/dist/{auth-reply-DUCwb8YO.js → auth-reply-B_dW4jHJ.js} +1 -1
- package/dist/{authorization-DpRfs6Wx.d.ts → authorization-CdJRoZgV.d.ts} +24 -1
- package/dist/{authorization-hooks-DkmrnDX7.d.ts → authorization-hooks-Do5djkpz.d.ts} +2 -2
- package/dist/{authorizer-DH7DjkL3.js → authorizer-dVVN05Un.js} +1 -1
- package/dist/better-result/index.d.ts +4 -4
- package/dist/better-result/index.js +1 -1
- package/dist/{bind-a7sUgvf4.d.ts → bind-DkaP_0iS.d.ts} +4 -4
- package/dist/{block-fields-ffD6Gxe4.js → block-fields-BANwJ9Y_.js} +2 -2
- package/dist/{block-helpers-C86hPEjI.d.ts → block-helpers-7pMBVsE6.d.ts} +1 -1
- package/dist/{block-helpers-CfG_MvDR.js → block-helpers-BfVCR5Fc.js} +1 -1
- package/dist/{block-hooks-BsXncUlZ.js → block-hooks-ByKlh8Qy.js} +2 -2
- package/dist/{block-hooks-BLPWD3Jt.d.ts → block-hooks-C_WaodoA.d.ts} +2 -2
- package/dist/{block-transport-DaGGXjIw.d.ts → block-transport-NbUJygA7.d.ts} +2 -2
- package/dist/blocks/access-requests/index.d.ts +5 -5
- package/dist/blocks/access-requests/index.js +5 -5
- package/dist/blocks/agents/index.d.ts +4 -4
- package/dist/blocks/agents/index.js +5 -5
- package/dist/blocks/ai-cache/index.d.ts +3 -3
- package/dist/blocks/ai-cache/index.js +2 -2
- package/dist/blocks/ai-chat/index.d.ts +5 -5
- package/dist/blocks/ai-chat/index.js +3 -3
- package/dist/blocks/ai-chat/react/index.d.ts +2 -2
- package/dist/blocks/ai-chat/react/index.js +1 -1
- package/dist/blocks/ai-chat/solid/index.d.ts +2 -2
- package/dist/blocks/ai-chat/solid/index.js +1 -1
- package/dist/blocks/ai-chat/svelte/index.d.ts +2 -2
- package/dist/blocks/ai-chat/svelte/index.js +1 -1
- package/dist/blocks/ai-chat/vue/index.d.ts +2 -2
- package/dist/blocks/ai-chat/vue/index.js +1 -1
- package/dist/blocks/ai-files/index.d.ts +3 -3
- package/dist/blocks/ai-files/index.js +2 -2
- package/dist/blocks/ai-providers/index.d.ts +4 -4
- package/dist/blocks/ai-providers/index.js +5 -5
- package/dist/blocks/ai-tasks/index.d.ts +3 -3
- package/dist/blocks/ai-tasks/index.js +6 -6
- package/dist/blocks/announcements/index.d.ts +4 -4
- package/dist/blocks/announcements/index.js +2 -2
- package/dist/blocks/announcements/react/index.d.ts +1 -1
- package/dist/blocks/announcements/react/index.js +1 -1
- package/dist/blocks/announcements/solid/index.d.ts +2 -2
- package/dist/blocks/announcements/svelte/index.d.ts +2 -2
- package/dist/blocks/announcements/vue/index.d.ts +2 -2
- package/dist/blocks/api-keys/index.d.ts +6 -6
- package/dist/blocks/api-keys/index.js +3 -3
- package/dist/blocks/api-keys/react/index.d.ts +1 -1
- package/dist/blocks/api-keys/react/index.js +2 -2
- package/dist/blocks/api-keys/react/server.d.ts +1 -1
- package/dist/blocks/api-keys/solid/index.d.ts +2 -2
- package/dist/blocks/api-keys/solid/index.js +1 -1
- package/dist/blocks/api-keys/svelte/index.d.ts +2 -2
- package/dist/blocks/api-keys/svelte/index.js +1 -1
- package/dist/blocks/api-keys/vue/index.d.ts +2 -2
- package/dist/blocks/api-keys/vue/index.js +1 -1
- package/dist/blocks/approvals/index.d.ts +4 -4
- package/dist/blocks/approvals/index.js +5 -5
- package/dist/blocks/attachments/index.d.ts +4 -4
- package/dist/blocks/attachments/index.js +2 -2
- package/dist/blocks/audit/index.d.ts +5 -5
- package/dist/blocks/audit/index.js +4 -4
- package/dist/blocks/audit/react/index.d.ts +1 -1
- package/dist/blocks/audit/react/index.js +1 -1
- package/dist/blocks/audit/react/server.d.ts +1 -1
- package/dist/blocks/audit/solid/index.d.ts +2 -2
- package/dist/blocks/audit/svelte/index.d.ts +2 -2
- package/dist/blocks/audit/vue/index.d.ts +2 -2
- package/dist/blocks/billing/index.d.ts +9 -9
- package/dist/blocks/billing/index.js +7 -7
- package/dist/blocks/billing/react/index.d.ts +1 -1
- package/dist/blocks/billing/react/index.js +1 -1
- package/dist/blocks/billing/react/server.d.ts +1 -1
- package/dist/blocks/billing/solid/index.d.ts +2 -2
- package/dist/blocks/billing/solid/index.js +1 -1
- package/dist/blocks/billing/svelte/index.d.ts +2 -2
- package/dist/blocks/billing/svelte/index.js +1 -1
- package/dist/blocks/billing/vue/index.d.ts +2 -2
- package/dist/blocks/billing/vue/index.js +1 -1
- package/dist/blocks/bookings/index.d.ts +3 -3
- package/dist/blocks/bookings/index.js +2 -2
- package/dist/blocks/bookings/react/index.d.ts +1 -1
- package/dist/blocks/bookings/react/index.js +1 -1
- package/dist/blocks/bookings/solid/index.d.ts +2 -2
- package/dist/blocks/bookings/svelte/index.d.ts +2 -2
- package/dist/blocks/bookings/vue/index.d.ts +2 -2
- package/dist/blocks/bulk/index.d.ts +9 -5
- package/dist/blocks/bulk/index.js +4 -4
- package/dist/blocks/calendar/index.d.ts +3 -3
- package/dist/blocks/calendar/index.js +2 -2
- package/dist/blocks/calendar/react/index.d.ts +1 -1
- package/dist/blocks/calendar/react/index.js +1 -1
- package/dist/blocks/calendar/solid/index.d.ts +2 -2
- package/dist/blocks/calendar/svelte/index.d.ts +2 -2
- package/dist/blocks/calendar/vue/index.d.ts +2 -2
- package/dist/blocks/catalog/index.d.ts +7 -7
- package/dist/blocks/catalog/index.js +7 -7
- package/dist/blocks/collections/index.d.ts +6 -6
- package/dist/blocks/collections/index.js +6 -6
- package/dist/blocks/comments/index.d.ts +4 -4
- package/dist/blocks/comments/index.js +3 -3
- package/dist/blocks/comments/react/index.d.ts +1 -1
- package/dist/blocks/comments/react/index.js +2 -2
- package/dist/blocks/comments/react/server.d.ts +1 -1
- package/dist/blocks/comments/solid/index.d.ts +2 -2
- package/dist/blocks/comments/solid/index.js +1 -1
- package/dist/blocks/comments/svelte/index.d.ts +2 -2
- package/dist/blocks/comments/svelte/index.js +1 -1
- package/dist/blocks/comments/vue/index.d.ts +2 -2
- package/dist/blocks/comments/vue/index.js +1 -1
- package/dist/blocks/connectors/index.d.ts +4 -4
- package/dist/blocks/connectors/index.js +6 -6
- package/dist/blocks/custom-fields/index.d.ts +4 -4
- package/dist/blocks/custom-fields/index.js +5 -5
- package/dist/blocks/data-lifecycle/index.d.ts +8 -8
- package/dist/blocks/data-lifecycle/index.js +5 -5
- package/dist/blocks/deals/index.d.ts +7 -7
- package/dist/blocks/deals/index.js +8 -8
- package/dist/blocks/documents/index.d.ts +4 -4
- package/dist/blocks/documents/index.js +3 -3
- package/dist/blocks/domains/index.d.ts +6 -6
- package/dist/blocks/domains/index.js +5 -5
- package/dist/blocks/drive/index.d.ts +7 -7
- package/dist/blocks/drive/index.js +6 -6
- package/dist/blocks/employees/index.d.ts +7 -7
- package/dist/blocks/employees/index.js +7 -7
- package/dist/blocks/engagements/index.d.ts +6 -6
- package/dist/blocks/engagements/index.js +5 -5
- package/dist/blocks/entitlements/index.d.ts +6 -6
- package/dist/blocks/entitlements/index.js +1 -1
- package/dist/blocks/entitlements/react/index.d.ts +2 -2
- package/dist/blocks/entitlements/solid/index.d.ts +2 -2
- package/dist/blocks/entitlements/svelte/index.d.ts +2 -2
- package/dist/blocks/entitlements/vue/index.d.ts +2 -2
- package/dist/blocks/flags/index.d.ts +5 -5
- package/dist/blocks/flags/index.js +6 -6
- package/dist/blocks/forms/index.d.ts +6 -6
- package/dist/blocks/forms/index.js +5 -5
- package/dist/blocks/forms/react/index.d.ts +1 -1
- package/dist/blocks/forms/solid/index.d.ts +2 -2
- package/dist/blocks/forms/svelte/index.d.ts +2 -2
- package/dist/blocks/forms/vue/index.d.ts +2 -2
- package/dist/blocks/hiring/index.d.ts +6 -6
- package/dist/blocks/hiring/index.js +6 -6
- package/dist/blocks/identities/index.d.ts +5 -5
- package/dist/blocks/identities/index.js +3 -3
- package/dist/blocks/imports/index.d.ts +74 -6
- package/dist/blocks/imports/index.js +111 -7
- package/dist/blocks/inbox/index.d.ts +5 -5
- package/dist/blocks/inbox/index.js +3 -3
- package/dist/blocks/inbox/react/index.d.ts +2 -2
- package/dist/blocks/inbox/react/server.d.ts +2 -2
- package/dist/blocks/inbox/solid/index.d.ts +2 -2
- package/dist/blocks/inbox/svelte/index.d.ts +2 -2
- package/dist/blocks/inbox/vue/index.d.ts +2 -2
- package/dist/blocks/index.d.ts +26 -7
- package/dist/blocks/index.js +4 -4
- package/dist/blocks/inventory/index.d.ts +6 -6
- package/dist/blocks/inventory/index.js +5 -5
- package/dist/blocks/invoices/index.d.ts +6 -6
- package/dist/blocks/invoices/index.js +8 -8
- package/dist/blocks/jobs/index.d.ts +6 -6
- package/dist/blocks/jobs/index.js +8 -8
- package/dist/blocks/knowledge/index.d.ts +3 -3
- package/dist/blocks/knowledge/index.js +2 -2
- package/dist/blocks/leave/index.d.ts +5 -5
- package/dist/blocks/leave/index.js +4 -4
- package/dist/blocks/memory/index.d.ts +4 -4
- package/dist/blocks/memory/index.js +5 -5
- package/dist/blocks/metrics/index.d.ts +6 -6
- package/dist/blocks/metrics/index.js +5 -5
- package/dist/blocks/mfa/index.d.ts +2 -2
- package/dist/blocks/mfa/index.js +1 -1
- package/dist/blocks/mfa/react/index.d.ts +1 -1
- package/dist/blocks/mfa/react/index.js +1 -1
- package/dist/blocks/mfa/react/server.d.ts +1 -1
- package/dist/blocks/mfa/react/server.js +1 -1
- package/dist/blocks/mfa/solid/index.d.ts +2 -2
- package/dist/blocks/mfa/solid/index.js +1 -1
- package/dist/blocks/mfa/svelte/index.d.ts +2 -2
- package/dist/blocks/mfa/svelte/index.js +1 -1
- package/dist/blocks/mfa/vue/index.d.ts +2 -2
- package/dist/blocks/mfa/vue/index.js +1 -1
- package/dist/blocks/notifications/index.d.ts +9 -9
- package/dist/blocks/notifications/index.js +9 -9
- package/dist/blocks/notifications/react/index.d.ts +1 -1
- package/dist/blocks/notifications/react/server.d.ts +1 -1
- package/dist/blocks/notifications/solid/index.d.ts +2 -2
- package/dist/blocks/notifications/svelte/index.d.ts +2 -2
- package/dist/blocks/notifications/vue/index.d.ts +2 -2
- package/dist/blocks/number-sequences/index.d.ts +10 -4
- package/dist/blocks/number-sequences/index.js +22 -11
- package/dist/blocks/oauth-server/index.d.ts +5 -5
- package/dist/blocks/oauth-server/index.js +3 -3
- package/dist/blocks/onboarding/index.d.ts +3 -3
- package/dist/blocks/onboarding/index.js +2 -2
- package/dist/blocks/onboarding/react/index.d.ts +1 -1
- package/dist/blocks/onboarding/react/index.js +1 -1
- package/dist/blocks/onboarding/react/server.d.ts +1 -1
- package/dist/blocks/onboarding/solid/index.d.ts +2 -2
- package/dist/blocks/onboarding/svelte/index.d.ts +2 -2
- package/dist/blocks/onboarding/vue/index.d.ts +2 -2
- package/dist/blocks/orders/index.d.ts +6 -6
- package/dist/blocks/orders/index.js +9 -9
- package/dist/blocks/organizations/index.d.ts +5 -5
- package/dist/blocks/organizations/index.js +4 -4
- package/dist/blocks/organizations/react/index.d.ts +1 -1
- package/dist/blocks/organizations/react/index.js +2 -2
- package/dist/blocks/organizations/react/server.d.ts +1 -1
- package/dist/blocks/organizations/solid/index.d.ts +2 -2
- package/dist/blocks/organizations/solid/index.js +1 -1
- package/dist/blocks/organizations/svelte/index.d.ts +2 -2
- package/dist/blocks/organizations/svelte/index.js +1 -1
- package/dist/blocks/organizations/vue/index.d.ts +2 -2
- package/dist/blocks/organizations/vue/index.js +1 -1
- package/dist/blocks/outbox/index.d.ts +4 -4
- package/dist/blocks/outbox/index.js +5 -5
- package/dist/blocks/parties/index.d.ts +7 -7
- package/dist/blocks/parties/index.js +4 -4
- package/dist/blocks/pipelines/index.d.ts +6 -6
- package/dist/blocks/pipelines/index.js +7 -7
- package/dist/blocks/profiles/index.d.ts +4 -4
- package/dist/blocks/profiles/index.js +5 -5
- package/dist/blocks/promotions/index.d.ts +5 -5
- package/dist/blocks/promotions/index.js +6 -6
- package/dist/blocks/push/index.d.ts +6 -6
- package/dist/blocks/push/index.js +4 -4
- package/dist/blocks/quotes/index.d.ts +6 -6
- package/dist/blocks/quotes/index.js +8 -8
- package/dist/blocks/rank/index.d.ts +4 -4
- package/dist/blocks/rank/index.js +4 -4
- package/dist/blocks/reactions/index.d.ts +4 -4
- package/dist/blocks/reactions/index.js +2 -2
- package/dist/blocks/reactions/react/index.d.ts +1 -1
- package/dist/blocks/reactions/react/index.js +1 -1
- package/dist/blocks/reactions/solid/index.d.ts +2 -2
- package/dist/blocks/reactions/solid/index.js +1 -1
- package/dist/blocks/reactions/svelte/index.d.ts +2 -2
- package/dist/blocks/reactions/svelte/index.js +1 -1
- package/dist/blocks/reactions/vue/index.d.ts +2 -2
- package/dist/blocks/reactions/vue/index.js +1 -1
- package/dist/blocks/relations/index.d.ts +5 -5
- package/dist/blocks/relations/index.js +5 -5
- package/dist/blocks/reminders/index.d.ts +7 -7
- package/dist/blocks/reminders/index.js +6 -6
- package/dist/blocks/reviews/index.d.ts +5 -5
- package/dist/blocks/reviews/index.js +5 -5
- package/dist/blocks/rules/index.d.ts +75 -9
- package/dist/blocks/rules/index.js +115 -6
- package/dist/blocks/rules/react/index.d.ts +2 -2
- package/dist/blocks/rules/react/index.js +2 -2
- package/dist/blocks/rules/solid/index.d.ts +2 -2
- package/dist/blocks/rules/solid/index.js +1 -1
- package/dist/blocks/rules/svelte/index.d.ts +2 -2
- package/dist/blocks/rules/svelte/index.js +1 -1
- package/dist/blocks/rules/vue/index.d.ts +2 -2
- package/dist/blocks/rules/vue/index.js +1 -1
- package/dist/blocks/saved-views/index.d.ts +3 -3
- package/dist/blocks/saved-views/index.js +2 -2
- package/dist/blocks/saved-views/react/index.d.ts +1 -1
- package/dist/blocks/saved-views/react/index.js +1 -1
- package/dist/blocks/saved-views/react/server.d.ts +1 -1
- package/dist/blocks/saved-views/solid/index.d.ts +2 -2
- package/dist/blocks/saved-views/solid/index.js +1 -1
- package/dist/blocks/saved-views/svelte/index.d.ts +2 -2
- package/dist/blocks/saved-views/svelte/index.js +1 -1
- package/dist/blocks/saved-views/vue/index.d.ts +2 -2
- package/dist/blocks/saved-views/vue/index.js +1 -1
- package/dist/blocks/search/index.d.ts +4 -4
- package/dist/blocks/search/index.js +3 -3
- package/dist/blocks/search/react/index.d.ts +1 -1
- package/dist/blocks/search/react/index.js +1 -1
- package/dist/blocks/search/react/server.d.ts +1 -1
- package/dist/blocks/search/solid/index.d.ts +2 -2
- package/dist/blocks/search/svelte/index.d.ts +2 -2
- package/dist/blocks/search/vue/index.d.ts +2 -2
- package/dist/blocks/service-principals/index.d.ts +5 -5
- package/dist/blocks/service-principals/index.js +5 -5
- package/dist/blocks/sessions/index.d.ts +2 -2
- package/dist/blocks/sessions/index.js +2 -2
- package/dist/blocks/sessions/react/index.d.ts +1 -1
- package/dist/blocks/sessions/react/index.js +1 -1
- package/dist/blocks/sessions/react/server.d.ts +1 -1
- package/dist/blocks/sessions/solid/index.d.ts +2 -2
- package/dist/blocks/sessions/solid/index.js +1 -1
- package/dist/blocks/sessions/svelte/index.d.ts +2 -2
- package/dist/blocks/sessions/svelte/index.js +1 -1
- package/dist/blocks/sessions/vue/index.d.ts +2 -2
- package/dist/blocks/sessions/vue/index.js +1 -1
- package/dist/blocks/settings/index.d.ts +4 -4
- package/dist/blocks/settings/index.js +3 -3
- package/dist/blocks/settings/react/index.d.ts +1 -1
- package/dist/blocks/settings/react/index.js +2 -2
- package/dist/blocks/settings/react/server.d.ts +1 -1
- package/dist/blocks/settings/solid/index.d.ts +2 -2
- package/dist/blocks/settings/solid/index.js +1 -1
- package/dist/blocks/settings/svelte/index.d.ts +2 -2
- package/dist/blocks/settings/svelte/index.js +1 -1
- package/dist/blocks/settings/vue/index.d.ts +2 -2
- package/dist/blocks/settings/vue/index.js +1 -1
- package/dist/blocks/share-links/index.d.ts +12 -5
- package/dist/blocks/share-links/index.js +9 -6
- package/dist/blocks/shared-signals/index.d.ts +7 -7
- package/dist/blocks/shared-signals/index.js +4 -4
- package/dist/blocks/signing-keys/index.d.ts +4 -4
- package/dist/blocks/signing-keys/index.js +4 -4
- package/dist/blocks/sla/index.d.ts +6 -6
- package/dist/blocks/sla/index.js +5 -5
- package/dist/blocks/sso/index.d.ts +6 -6
- package/dist/blocks/sso/index.js +4 -4
- package/dist/blocks/state-machine/index.d.ts +4 -4
- package/dist/blocks/state-machine/index.js +3 -3
- package/dist/blocks/tags/index.d.ts +3 -3
- package/dist/blocks/tags/index.js +3 -3
- package/dist/blocks/tags/react/index.d.ts +1 -1
- package/dist/blocks/tags/react/index.js +2 -2
- package/dist/blocks/tags/react/server.d.ts +1 -1
- package/dist/blocks/tags/solid/index.d.ts +2 -2
- package/dist/blocks/tags/solid/index.js +1 -1
- package/dist/blocks/tags/svelte/index.d.ts +2 -2
- package/dist/blocks/tags/svelte/index.js +1 -1
- package/dist/blocks/tags/vue/index.d.ts +2 -2
- package/dist/blocks/tags/vue/index.js +1 -1
- package/dist/blocks/targets/index.d.ts +4 -4
- package/dist/blocks/targets/index.js +5 -5
- package/dist/blocks/teams/index.d.ts +4 -4
- package/dist/blocks/teams/index.js +4 -4
- package/dist/blocks/templates/index.d.ts +7 -7
- package/dist/blocks/templates/index.js +6 -6
- package/dist/blocks/time-tracking/index.d.ts +6 -6
- package/dist/blocks/time-tracking/index.js +7 -7
- package/dist/blocks/trash/index.d.ts +5 -5
- package/dist/blocks/trash/index.js +4 -4
- package/dist/blocks/undo/index.d.ts +4 -4
- package/dist/blocks/undo/index.js +1 -1
- package/dist/blocks/undo/react/index.d.ts +1 -1
- package/dist/blocks/undo/react/server.d.ts +1 -1
- package/dist/blocks/undo/solid/index.d.ts +2 -2
- package/dist/blocks/undo/svelte/index.d.ts +2 -2
- package/dist/blocks/undo/vue/index.d.ts +2 -2
- package/dist/blocks/usage/index.d.ts +4 -4
- package/dist/blocks/usage/index.js +2 -2
- package/dist/blocks/usage/react/index.d.ts +1 -1
- package/dist/blocks/usage/react/index.js +1 -1
- package/dist/blocks/usage/react/server.d.ts +1 -1
- package/dist/blocks/usage/solid/index.d.ts +2 -2
- package/dist/blocks/usage/svelte/index.d.ts +2 -2
- package/dist/blocks/usage/vue/index.d.ts +2 -2
- package/dist/blocks/versions/index.d.ts +10 -6
- package/dist/blocks/versions/index.js +18 -13
- package/dist/blocks/waitlist/index.d.ts +5 -5
- package/dist/blocks/waitlist/index.js +5 -5
- package/dist/blocks/webhooks/index.d.ts +13 -13
- package/dist/blocks/webhooks/index.js +10 -10
- package/dist/blocks/work-items/index.d.ts +7 -7
- package/dist/blocks/work-items/index.js +5 -5
- package/dist/blocks/workflow-builder/index.d.ts +7 -7
- package/dist/blocks/workflow-builder/index.js +2 -2
- package/dist/blocks/workflow-builder/react/index.d.ts +2 -2
- package/dist/blocks/workflow-builder/react/index.js +2 -2
- package/dist/blocks/workflow-builder/solid/index.d.ts +2 -2
- package/dist/blocks/workflow-builder/svelte/index.d.ts +2 -2
- package/dist/blocks/workflow-builder/vue/index.d.ts +2 -2
- package/dist/blocks/workflows/index.d.ts +5 -5
- package/dist/blocks/workflows/index.js +1 -1
- package/dist/blocks/workflows/react/index.d.ts +2 -2
- package/dist/blocks/workflows/react/index.js +1 -1
- package/dist/blocks/workflows/solid/index.d.ts +2 -2
- package/dist/blocks/workflows/svelte/index.d.ts +2 -2
- package/dist/blocks/workflows/vue/index.d.ts +2 -2
- package/dist/{bookings-0XnhHNLM.js → bookings-EJAVAuVz.js} +4 -4
- package/dist/{build-Cx08LOT7.js → build-6jmaPAgx.js} +1 -1
- package/dist/{calendar-DcFrpSOy.js → calendar-1J1E5dLq.js} +4 -4
- package/dist/chat-sdk/index.d.ts +4 -4
- package/dist/chat-sdk/index.js +2 -2
- package/dist/chat-sdk/react/index.d.ts +2 -2
- package/dist/chat-sdk/react/server.d.ts +2 -2
- package/dist/cli/{add-Bd5M6uEZ.js → add-BhI_nXAo.js} +2 -2
- package/dist/cli/{add-B0zoJUYX.js → add-CUS0AiBh.js} +6 -6
- package/dist/cli/add-ojbcMxyp.js +1 -0
- package/dist/cli/adopt-D0ASVx2G.js +1 -0
- package/dist/cli/{adopt-CebmlHL-.js → adopt-DwcU6CJd.js} +27 -8
- package/dist/cli/{agent-CCt_aXpJ.js → agent-CCrTYK3W.js} +1 -1
- package/dist/cli/{apply-Dxk8AUNU.js → apply-DBXC0Z5I.js} +40 -10
- package/dist/cli/bin.js +1 -1
- package/dist/cli/{blocks-Dq25D80b.js → blocks-B15ltTFn.js} +1 -1
- package/dist/cli/{blocks-Bzz326nn.js → blocks-BXeqIzWN.js} +1 -1
- package/dist/cli/{cache-Cx6qlRDR.js → cache-CPBYJAkb.js} +2 -2
- package/dist/cli/{codemod-woL4cVe0.js → codemod-CrI33UR2.js} +2 -2
- package/dist/cli/{command-CK9Cn8HV.js → command-D_HI1mp1.js} +17 -0
- package/dist/cli/{completion-CWoDmFZr.js → completion-DzYo025z.js} +2 -2
- package/dist/cli/{completion-J3dqnNoW.js → completion-En43UcyJ.js} +2 -2
- package/dist/cli/{completion-BO5UK6bG.js → completion-Vry-Wjw8.js} +1 -1
- package/dist/cli/{config-CLHpTk9Y.js → config-Bi_UBxXl.js} +40 -10
- package/dist/cli/{config-C1d-mbUA.js → config-DsqQr5z3.js} +1 -1
- package/dist/cli/{config-MuKY9kUj.js → config-DyJgo2d9.js} +1 -1
- package/dist/cli/{doctor-SGw36h1D.js → doctor-wACp5w6N.js} +44 -342
- package/dist/cli/{emit-ZAYeh4Yn.js → emit-j0zZ6NE_.js} +21 -2
- package/dist/cli/{env-CVXvJoLP.js → env-2v9JrxSr.js} +3 -3
- package/dist/cli/{env-DMw_MBe5.js → env-Cf5OTqbK.js} +92 -1
- package/dist/cli/{env-DJ4ZaJpe.js → env-Ch99nTQw.js} +1 -1
- package/dist/cli/env-DkBe35Rv.js +1 -0
- package/dist/cli/{gen-B344S1Oy.js → gen-BhquLu7l.js} +11 -11
- package/dist/cli/index.d.ts +6 -4
- package/dist/cli/index.js +7 -7
- package/dist/cli/{init-B1dL-RZL.js → init-BwLTO6XG.js} +15 -8
- package/dist/cli/{introspect-BPcFi8ow.js → introspect-B-gXAIqs.js} +3 -3
- package/dist/cli/{keys-jsxCNJdz.js → keys-hwtdwdkT.js} +1 -1
- package/dist/cli/live-BFfYoE0_.js +329 -0
- package/dist/cli/mcp-Bdm2oGmL.js +237 -0
- package/dist/cli/{metadata-CxBZo4KM.js → metadata-DikbSOE0.js} +2 -2
- package/dist/cli/migration-safety-LaGVPPuD.js +206 -0
- package/dist/cli/{module-migration-YFFdWC5X.js → module-migration-CLkZ8jpw.js} +1 -1
- package/dist/cli/{moved-D9OT_Uyy.js → moved-B7UFO_OM.js} +1 -1
- package/dist/cli/{parse-DE59XyWt.js → parse-CwV5a6dA.js} +1 -1
- package/dist/cli/{preset-DmcC4nWE.js → preset-DQ1DxMtI.js} +1 -1
- package/dist/cli/{run-CM_2g6KQ.js → run-BLJj7SuM.js} +43 -42
- package/dist/cli/{run-DaHfUUO9.js → run-DliGNdjI.js} +38 -70
- package/dist/cli/{scaffold-CFdDq36-.js → scaffold-6bv24GSP.js} +4 -4
- package/dist/cli/{scaffold-Dsjr7sOT.js → scaffold-DUz5fa-k.js} +1 -1
- package/dist/cli/{seed-DldDdXWO.js → seed-CIJaL1Ao.js} +4 -4
- package/dist/cli/seed-ClGWseBT.js +1 -0
- package/dist/cli/shared-CNcvDOLt.js +145 -0
- package/dist/cli/{skills-v34NDb2D.js → skills-CaxIQhzW.js} +1 -1
- package/dist/cli/{snapshot-DAxLi4hO.js → snapshot-Dvcx0BSl.js} +3 -3
- package/dist/cli/{source-args-0I9zylYy.js → source-args-BNhagtpw.js} +1 -1
- package/dist/cli/{spec-CaaSOYZS.js → spec-BewE6r6J.js} +5 -5
- package/dist/cli/{spec-De0cfceR.js → spec-DRDaIq8f.js} +1 -1
- package/dist/cli/{sql-DDLWwzh9.js → sql-BBkchli4.js} +5 -5
- package/dist/cli/{sql-0I1EQ3JG.js → sql-BCQt5TDs.js} +2 -2
- package/dist/cli/{stack-status-CRanl-CN.js → stack-status-LeEoCtV1.js} +1 -1
- package/dist/cli/{sync-DFx-6t5n.js → sync-CJ-ft-tl.js} +2 -2
- package/dist/cli/{topics-GJuIDwlY.js → topics-BBE1-Vrg.js} +1 -1
- package/dist/cli/{version-DNRW4DAP.js → version-D1wM9DNb.js} +1 -1
- package/dist/cli/{write-BS6F3Yvz.js → write-Dp1XlAVM.js} +24 -6
- package/dist/client/index.d.ts +5 -5
- package/dist/client/index.js +2 -2
- package/dist/client/native/index.d.ts +5 -5
- package/dist/client/native/index.js +2 -2
- package/dist/{client-BYaOGCOG.js → client-13Ii0c0P.js} +1 -1
- package/dist/{client-BxnLb9bz.d.ts → client-9zIKhf5D.d.ts} +2 -2
- package/dist/{client-PGRk3DGz.js → client-AxwF58Eo.js} +1 -1
- package/dist/{client-iDLLvGR4.d.ts → client-B0rvMvA8.d.ts} +3 -3
- package/dist/{client-ysNShuJZ.d.ts → client-B5nnqDmz.d.ts} +2 -2
- package/dist/{client-VvY0K3wr.d.ts → client-B7LCXnnY.d.ts} +5 -5
- package/dist/{client-D5CZ2a34.d.ts → client-B9H4BZJh.d.ts} +11 -11
- package/dist/{client-e-hFkLUf.d.ts → client-BLKpcAs0.d.ts} +2 -2
- package/dist/{client-DAHsEOVV.d.ts → client-BO9fQgBB.d.ts} +3 -3
- package/dist/{client-LLmgiCwJ.d.ts → client-B_r4denm.d.ts} +1 -1
- package/dist/{client-Tc47rlSe.d.ts → client-BaynD5V-.d.ts} +45 -7
- package/dist/{client-Co6BPmvr.d.ts → client-BtBkVSk2.d.ts} +3 -3
- package/dist/{client-xkSCp9hN.d.ts → client-ByGlM0YF.d.ts} +3 -3
- package/dist/{client-BAcILZOf.d.ts → client-C3dLIsJv.d.ts} +6 -6
- package/dist/{client-CFdMJ1h9.d.ts → client-C597NIlL.d.ts} +4 -4
- package/dist/{client-CoVGPi0c.js → client-CFeWXNXy.js} +2 -2
- package/dist/{client-Cmensu7l.d.ts → client-Cgxj38RS.d.ts} +6 -6
- package/dist/{client-WAdEBBrH.d.ts → client-CjyTNdt1.d.ts} +4 -4
- package/dist/{client-Cdedx_lw.js → client-CmHsfDHU.js} +5 -5
- package/dist/{client-Lx3mlvKO.d.ts → client-CpMv4-v5.d.ts} +4 -4
- package/dist/{client-DjTRlN3a.d.ts → client-CsRpAyIv.d.ts} +1 -1
- package/dist/{client-BUGIS__1.js → client-D0502FgY.js} +6 -6
- package/dist/{client-CiGjS6us.js → client-D727oIVC.js} +3 -3
- package/dist/{client-CHmjaI0j.d.ts → client-D9zBl9PT.d.ts} +6 -6
- package/dist/{client-WHeWTNVL.d.ts → client-DR_YEGnc.d.ts} +1 -1
- package/dist/{client-DIrCmOXz.d.ts → client-DZXFDaQE.d.ts} +3 -3
- package/dist/{client-hyP_nS5R.d.ts → client-Diu2lPbg.d.ts} +4 -4
- package/dist/{client-BVZtq_rQ.d.ts → client-Dk8gY9hi.d.ts} +2 -2
- package/dist/{client-B7QVIrJS.d.ts → client-Fi8CoJcs.d.ts} +10 -10
- package/dist/{client-DdfSIZ3M.d.ts → client-LVa6yC9u.d.ts} +4 -4
- package/dist/{client-ClZ0D-if.d.ts → client-WXJwUhr1.d.ts} +4 -4
- package/dist/{client-BOT2KVIp.js → client-fpvgtQKE.js} +1 -1
- package/dist/{client-C9QrWrnt.js → client-iB5axfa0.js} +2 -2
- package/dist/{client-01MAuqzW.js → client-jvtwGFy4.js} +1 -1
- package/dist/{client-CilSKXNu.js → client-kI6vCKVI.js} +1 -1
- package/dist/{client-CzI4QpG3.d.ts → client-kKdkLGPB.d.ts} +1 -1
- package/dist/{client-i8glKhxh.js → client-rp7YfOg1.js} +1 -1
- package/dist/{cloud-event-5rCEzIgK.d.ts → cloud-event-bwsBwVNG.d.ts} +1 -1
- package/dist/{codecs-YAekuQ08.js → codecs-C7E_OoiC.js} +3 -3
- package/dist/{codegen-DeoSt1mi.d.ts → codegen-2m4SKVdi.d.ts} +97 -14
- package/dist/{comments-D7sbd0xG.js → comments-N7Bi-oTW.js} +4 -4
- package/dist/commerce/index.js +3 -3
- package/dist/{compiler-BVxepAY0.d.ts → compiler-C6E3WwIi.d.ts} +2 -2
- package/dist/{compose-Djntdacs.js → compose-CO_cljl3.js} +1 -1
- package/dist/{composite-M6zPs1Xm.js → composite-CPV0thLs.js} +2 -2
- package/dist/{composite-djtGy6bz.d.ts → composite-DMMA_Whg.d.ts} +6 -6
- package/dist/config/index.d.ts +6 -6
- package/dist/config/index.js +4 -4
- package/dist/{config-C4MozTD7.js → config-C4RQDF6t.js} +4 -0
- package/dist/{config-BA1K4OPk.js → config-CkyahUjo.js} +4 -3
- package/dist/{connectors-CjD-R2ks.d.ts → connectors-CZdfZcIg.d.ts} +4 -4
- package/dist/{context-1sSWcd7_.d.ts → context-CCfX2szU.d.ts} +15 -3
- package/dist/{controller-D845qKh2.d.ts → controller-CCb9tHw_.d.ts} +1 -1
- package/dist/create/index.d.ts +597 -0
- package/dist/create/index.js +2049 -0
- package/dist/create/lite/index.d.ts +85 -0
- package/dist/create/lite/index.js +126 -0
- package/dist/create/supabase/index.d.ts +68 -0
- package/dist/create/supabase/index.js +312 -0
- package/dist/credentials/index.d.ts +4 -4
- package/dist/credentials/index.js +4 -4
- package/dist/{cron-route-CoL-By8Z.js → cron-route-BsgbJ-g4.js} +1 -1
- package/dist/{define-B2ln373W.js → define-CMcokcZz.js} +5 -5
- package/dist/{define-DxHHbNEb.d.ts → define-DXTC706J.d.ts} +6 -6
- package/dist/{define-block-CLZMEFeK.d.ts → define-block-BlHQxDIQ.d.ts} +6 -6
- package/dist/{documents-CWn2mtYf.d.ts → documents-BYM2viS0.d.ts} +3 -3
- package/dist/edge/index.d.ts +9 -9
- package/dist/edge/index.js +9 -9
- package/dist/elysia/index.d.ts +1 -1
- package/dist/elysia/index.js +1 -1
- package/dist/{embeddings-C2S14foD.d.ts → embeddings-Da0w4A_0.d.ts} +1 -1
- package/dist/{ended-nIdGCHxk.d.ts → ended-EcTtzzQJ.d.ts} +2 -2
- package/dist/{entitlements-BvU5dLpW.js → entitlements-AmYp2KHX.js} +3 -3
- package/dist/{entitlements-CbzCKalR.d.ts → entitlements-Bn7BTnbg.d.ts} +2 -2
- package/dist/env/index.d.ts +1 -1
- package/dist/env/index.js +6 -1
- package/dist/{envelope-CHYk5MXU.js → envelope--7d0Q3Se.js} +1 -1
- package/dist/{errors-PIpcoe4z.js → errors-7MqM7bbV.js} +1 -1
- package/dist/eve/index.d.ts +5 -5
- package/dist/{eve-DUF70Vgi.d.ts → eve-BcEr_hPo.d.ts} +2 -2
- package/dist/events/index.d.ts +3 -3
- package/dist/{events-CTreRrgP.d.ts → events-CtAHxPal.d.ts} +2 -2
- package/dist/{executor-DoE-5iM8.d.ts → executor-BicyP8Nl.d.ts} +1 -1
- package/dist/{executor-BINiCFNp.d.ts → executor-CHRwEYqt.d.ts} +1 -1
- package/dist/{executor-DKrZr3AC.d.ts → executor-CIxyatuB.d.ts} +2 -2
- package/dist/{executor-BXSHYyW2.js → executor-Cex-1PFp.js} +3 -3
- package/dist/{executor-BBHgjUJu.d.ts → executor-DzJQVTE2.d.ts} +1 -1
- package/dist/{executor-D1kYY5BA.js → executor-aKUo_Xyb.js} +2 -2
- package/dist/expo/index.d.ts +4 -4
- package/dist/expo/index.js +3 -3
- package/dist/expo-sqlite/index.d.ts +3 -3
- package/dist/expo-sqlite/index.js +2 -2
- package/dist/{field-errors-CWXN_h_E.d.ts → field-errors-nFnYWvB0.d.ts} +6 -6
- package/dist/{filter-evaluate-CjcFq0RT.d.ts → filter-evaluate-CEm52E5s.d.ts} +1 -1
- package/dist/{filter-query-BKmRYrTE.d.ts → filter-query-D3wOD1P_.d.ts} +1 -1
- package/dist/{flags-XAOsdNAc.js → flags-CtSrkVuW.js} +1 -1
- package/dist/{flags-D_D1jAHB.d.ts → flags-Dz5PIzFU.d.ts} +2 -2
- package/dist/flags-sdk/index.d.ts +1 -1
- package/dist/flags-sdk/index.js +2 -2
- package/dist/{options-BqO9GYig.js → form-definition-GVZTILhS.js} +13 -13
- package/dist/{framework-DG5Bv39u.d.ts → framework-C2oL4OaO.d.ts} +6 -6
- package/dist/{framework-INbjMZX1.js → framework-Cfm0IspZ.js} +1 -1
- package/dist/{gateway-Cup00l0w.d.ts → gateway-CJL6ZG17.d.ts} +3 -3
- package/dist/h3/index.d.ts +1 -1
- package/dist/h3/index.js +1 -1
- package/dist/h3/v1/index.d.ts +1 -1
- package/dist/h3/v1/index.js +1 -1
- package/dist/hono/index.d.ts +9 -9
- package/dist/hono/index.js +6 -6
- package/dist/{inbox-3ql4phyr.d.ts → inbox-BaUJgHOF.d.ts} +3 -3
- package/dist/index-8xwnaWHY.d.ts +344 -0
- package/dist/{index-BkzNUPId.d.ts → index-BurdFUXr.d.ts} +6 -6
- package/dist/{index-DygICr8c.d.ts → index-Cckxs8IE.d.ts} +2 -2
- package/dist/{index-CrZitvSC.d.ts → index-Ck4oK5vV.d.ts} +7 -7
- package/dist/{index-Ej8XQ9w9.d.ts → index-Co0YsJTk.d.ts} +2 -2
- package/dist/{index-CETRk4YO.d.ts → index-CxmVzT-3.d.ts} +5 -1
- package/dist/{index-Bvw9r94Q.d.ts → index-D1kMyNc7.d.ts} +1 -1
- package/dist/{index-BlqrGvb3.d.ts → index-DL8z_oDo.d.ts} +4 -4
- package/dist/{index-DfVXx4Ia.d.ts → index-DMONTkSf.d.ts} +2 -2
- package/dist/{index-jhqhynmh.d.ts → index-DTQbC3CW.d.ts} +1 -1
- package/dist/{index-BIi8i6BO.d.ts → index-DcijDfh1.d.ts} +3 -3
- package/dist/index-MCXVzkXs.d.ts +722 -0
- package/dist/{index-Brhm22eL.d.ts → index-gXy3R1Uq.d.ts} +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/index.js +6 -6
- package/dist/{kit-D5S7KNFe.d.ts → kit-BlcEFQql.d.ts} +3 -3
- package/dist/{kit-MUK34-ZG.js → kit-gqwkVhGU.js} +3 -3
- package/dist/{knowledge-BXQ2-V0a.d.ts → knowledge-BYtgA52P.d.ts} +5 -5
- package/dist/{knowledge-CJ_Mm3ic.js → knowledge-CSNKLX-s.js} +3 -3
- package/dist/list/index.d.ts +3 -3
- package/dist/{list-query-PvP3pPGQ.d.ts → list-query-DWJIiVz_.d.ts} +4 -4
- package/dist/management-D1gG89z2.d.ts +53 -0
- package/dist/mcp/index.d.ts +41 -16
- package/dist/mcp/index.js +139 -56
- package/dist/mcp/sdk/index.d.ts +6 -6
- package/dist/mcp/sdk/index.js +2 -2
- package/dist/{options-BQ07tTYr.js → methods-7u6vSgz_.js} +4 -4
- package/dist/{money-codec-C_-K5ZUU.js → money-codec-DCGgzO26.js} +1 -1
- package/dist/nestjs/index.d.ts +2 -2
- package/dist/nestjs/index.js +1 -1
- package/dist/next/index.d.ts +16 -16
- package/dist/next/index.js +10 -10
- package/dist/node/index.d.ts +2 -2
- package/dist/node/index.js +1 -1
- package/dist/{onboarding-BZvLLPaY.js → onboarding-viTTNWUp.js} +2 -2
- package/dist/openapi/index.d.ts +2 -2
- package/dist/{operations-C9-UcReN.d.ts → operations-BtuQRwTJ.d.ts} +1 -1
- package/dist/{organizations-Cw7om8uk.js → organizations-Bxrm32IG.js} +4 -4
- package/dist/orpc/index.d.ts +6 -6
- package/dist/orpc/index.js +3 -3
- package/dist/otel/index.d.ts +2 -2
- package/dist/otel/index.js +5 -5
- package/dist/{outbox-BTeqjbum.d.ts → outbox-BCGHl9X6.d.ts} +4 -4
- package/dist/{plugin-CDLJRFFg.d.ts → plugin-D5OIaP93.d.ts} +2 -2
- package/dist/plugins/actor/index.d.ts +1 -1
- package/dist/plugins/rules/index.d.ts +2 -2
- package/dist/plugins/soft-delete/index.d.ts +2 -2
- package/dist/plugins/soft-delete/index.js +1 -1
- package/dist/plugins/tenant/index.d.ts +2 -2
- package/dist/plugins/timestamps/index.d.ts +1 -1
- package/dist/plugins/validation/index.d.ts +1 -1
- package/dist/plugins/validation/index.js +1 -1
- package/dist/{pool-CwOCsX9e.d.ts → pool-BBi4mot3.d.ts} +7 -4
- package/dist/{pool-errors-GMjlCN0d.js → pool-errors-C94tPR_G.js} +1 -1
- package/dist/{ports-Ca63W4cW.d.ts → ports-B53rB7zg.d.ts} +7 -7
- package/dist/{ports-DGK3KTDH.js → ports-Bcdppx0G.js} +2 -2
- package/dist/{ports-DAdQyjZz.d.ts → ports-Dcnuo3HT.d.ts} +1 -1
- package/dist/postgres/index.d.ts +4 -4
- package/dist/postgres/index.js +11 -5
- package/dist/{postgrest-Cw9Bs5gm.d.ts → postgrest-D6fEMsp4.d.ts} +1 -1
- package/dist/powersync/index.d.ts +3 -3
- package/dist/powersync/index.js +3 -3
- package/dist/powersync/react/index.d.ts +1 -1
- package/dist/powersync/react/index.js +1 -1
- package/dist/preset/index.d.ts +4 -352
- package/dist/preset/index.js +4 -564
- package/dist/preset-BBrL6_Ln.js +648 -0
- package/dist/{provider-9gBq9W6k.d.ts → provider-CQ1SrhLa.d.ts} +1 -1
- package/dist/{push-token-asrmi7-6.d.ts → push-token-CDMgWT13.d.ts} +1 -1
- package/dist/query/index.d.ts +1 -1
- package/dist/{rank-result-DS8IoLup.js → rank-result-oUF1DYBm.js} +1 -1
- package/dist/{rate-limit--QSiFA6D.js → rate-limit-ByfWNX9N.js} +5 -5
- package/dist/react/index.d.ts +7 -7
- package/dist/react/index.js +1 -1
- package/dist/react/native/index.d.ts +1 -1
- package/dist/react/server.d.ts +8 -8
- package/dist/react/server.js +1 -1
- package/dist/react/session.d.ts +2 -2
- package/dist/{react-CKXUkwPx.js → react-BcKACxsj.js} +1 -1
- package/dist/react-router/index.d.ts +6 -6
- package/dist/react-router/index.js +5 -5
- package/dist/{read-set-GEb-i0On.js → read-set-PWiJfv6S.js} +1 -1
- package/dist/realtime/index.d.ts +7 -7
- package/dist/realtime/index.js +2 -2
- package/dist/{refusal-oD3ISM9h.d.ts → refusal-Bdr1k47u.d.ts} +1 -1
- package/dist/{refusal-br4Ma9Cf.js → refusal-Ch-u9dVd.js} +2 -2
- package/dist/{resolve-w9EpHzuM.d.ts → resolve-7atr-wWr.d.ts} +2 -2
- package/dist/{resource-C8r5xGqY.js → resource-CHGOmg1O.js} +4 -4
- package/dist/{resource-B4ka8dDH.d.ts → resource-DxcgtHq6.d.ts} +1 -1
- package/dist/{resource-execute-D0yQ-8WR.d.ts → resource-execute-C45ICrN9.d.ts} +2 -2
- package/dist/{resource-types-D2vEQVXI.d.ts → resource-types-CC59gMHE.d.ts} +5 -5
- package/dist/{resources-BklF-rjz.d.ts → resources-B71O7EVQ.d.ts} +2 -2
- package/dist/{resources-BlZdLsWQ.js → resources-B7htXQeg.js} +1 -1
- package/dist/{respond-C7I8kLK_.d.ts → respond-Cdg5ibH5.d.ts} +1 -1
- package/dist/{respond-DdhZ9Wbn.js → respond-Dpx48ATq.js} +1 -1
- package/dist/{result-BlgnMB0H.js → result-COkvI9t5.js} +7 -1
- package/dist/{rules-B0-3Iosu.js → rules-4of_Fq-6.js} +31 -5
- package/dist/runtime-BOXURhEW.js +45 -0
- package/dist/{sales-lines-BAk8In-Z.js → sales-lines-CymdiwYd.js} +3 -3
- package/dist/{sales-shared-SblIgCgI.js → sales-shared-DjCuN8xG.js} +1 -1
- package/dist/{search-B6h03cAx.js → search-LbjCylX5.js} +3 -3
- package/dist/server/index.d.ts +20 -20
- package/dist/server/index.js +10 -10
- package/dist/{server-types-OohhIQb2.d.ts → server-types-fXwJoFjt.d.ts} +12 -12
- package/dist/{session-DiWHtYrO.d.ts → session-Djo5t4KQ.d.ts} +5 -5
- package/dist/{settings-BXFn9zpS.js → settings-DxXfDUmh.js} +4 -4
- package/dist/{shared-DbO3Dfms.js → shared-9B02lczf.js} +1 -1
- package/dist/{signatures-B41ApWXA.js → signatures-C9CGYZS1.js} +1 -1
- package/dist/{signers-CXt_wA9S.d.ts → signers-BjSgNAXP.d.ts} +4 -4
- package/dist/{signing-keys-Bq9mMCTh.d.ts → signing-keys-Ccr86Y2C.d.ts} +2 -2
- package/dist/solid/index.d.ts +7 -7
- package/dist/{solid-controller-DqlvYFZa.d.ts → solid-controller-CZrt1Tg6.d.ts} +1 -1
- package/dist/solid-start/index.d.ts +6 -6
- package/dist/solid-start/index.js +5 -5
- package/dist/spec/index.d.ts +2 -2
- package/dist/sql/index.d.ts +5 -709
- package/dist/sql/index.js +5 -86238
- package/dist/{sql-DJrXG-3Z.js → sql-BQshMgmB.js} +2 -2
- package/dist/sql-CgTZOQZ7.js +87439 -0
- package/dist/{sso-BN0LnMqE.d.ts → sso-B5ZoEsXE.d.ts} +3 -3
- package/dist/{sso-BDva_-4y.js → sso-CwAnve68.js} +3 -3
- package/dist/ssr/index.d.ts +4 -4
- package/dist/{standard-B5fe2gnW.js → standard-DZmwmIhV.js} +1 -1
- package/dist/{stats-D6vkb89f.js → stats-CUhqw6Ev.js} +2 -2
- package/dist/storage/index.d.ts +3 -3
- package/dist/storage/index.js +4 -4
- package/dist/{storage-api-Cx-1iWBd.d.ts → storage-api-B4Ib2Zpo.d.ts} +2 -2
- package/dist/streams/index.d.ts +1 -1
- package/dist/streams/index.js +2 -2
- package/dist/streams/redis/index.js +1 -1
- package/dist/{subject-readers-fxP5wu0s.d.ts → subject-readers-81xiWh4M.d.ts} +2 -2
- package/dist/{subject-readers-DiePmaYP.js → subject-readers-DDyPTIOr.js} +1 -1
- package/dist/{subjects-z8VWA_lF.d.ts → subjects-DP-fvFkk.d.ts} +8 -0
- package/dist/{support-BsKkvA92.js → support-BsqhV6jP.js} +5 -5
- package/dist/{support-view-BbcZR7Io.d.ts → support-view-CznLe4jq.d.ts} +1 -1
- package/dist/svelte/index.d.ts +6 -6
- package/dist/{svelte-controller-DxxHEHxD.d.ts → svelte-controller-DDbju9CW.d.ts} +1 -1
- package/dist/sveltekit/index.d.ts +7 -7
- package/dist/sveltekit/index.js +5 -5
- package/dist/{tags-Dw8vKkcI.d.ts → tags-7NHyD1P8.d.ts} +1 -1
- package/dist/{tags-PaG0Ns_9.js → tags-DGldvcA4.js} +5 -5
- package/dist/tanstack-db/index.d.ts +2 -2
- package/dist/tanstack-db/supabase/index.d.ts +2 -2
- package/dist/tanstack-start/index.d.ts +6 -6
- package/dist/tanstack-start/index.js +5 -5
- package/dist/{tax-D_kSCdWU.js → tax-DZDpMMRw.js} +1 -1
- package/dist/{tee-Bsisfd7t.js → tee-CdRV1tcj.js} +1 -1
- package/dist/{tenant-DdmVhsff.d.ts → tenant-DW_GmsW4.d.ts} +2 -2
- package/dist/testing/index.d.ts +23 -23
- package/dist/testing/index.js +8 -51
- package/dist/{topic-ByDz9edV.js → topic-DB-1YTMj.js} +35 -16
- package/dist/{topic-cMS7UtM1.d.ts → topic-Dgs-eSYQ.d.ts} +31 -17
- package/dist/{types-YfwpIE-d.d.ts → types-BO8lVTun.d.ts} +6 -0
- package/dist/{types-D0W4fnsc.d.ts → types-C_GN-4ed.d.ts} +4 -4
- package/dist/types-DGHfTW8_.d.ts +9 -0
- package/dist/{types-pNY_UpDs.d.ts → types-DM8q3IOr.d.ts} +3 -3
- package/dist/{types-6oiy6rIa.d.ts → types-DOaUIJxW.d.ts} +4 -4
- package/dist/{types-vaoP9S9_.d.ts → types-DZj8CZMH.d.ts} +22 -8
- package/dist/{types-CdP0z5tS.d.ts → types-P1S1cj6N.d.ts} +5 -5
- package/dist/{undo-CEGIRkPA.js → undo-0qM13zul.js} +3 -3
- package/dist/{undo-DGo0skyO.d.ts → undo-D42sPjCf.d.ts} +2 -2
- package/dist/{usage-CdlfuS3i.js → usage-BrJGPvCq.js} +2 -2
- package/dist/{usage-DM2rzczj.d.ts → usage-CnQHSM_r.d.ts} +4 -4
- package/dist/{vault-tOkPLnMB.d.ts → vault-EnOQJWjn.d.ts} +2 -2
- package/dist/vercel-connect/index.d.ts +1 -1
- package/dist/vercel-connect/index.js +1 -1
- package/dist/{verify-D63A2ALE.d.ts → verify-3NLjUIER.d.ts} +2 -2
- package/dist/{verify-EQcC3Khp.js → verify-C9D_jjsQ.js} +2 -2
- package/dist/{version-D87ZteKy.js → version-Bxj_xcUY.js} +1 -1
- package/dist/{view-Dv0A949a.d.ts → view-SuASaomx.d.ts} +1 -1
- package/dist/vue/index.d.ts +7 -7
- package/dist/{vue-controller-HPfMTDa2.d.ts → vue-controller-D_ohttBZ.d.ts} +1 -1
- package/dist/{watch-DT_B3CnJ.js → watch-Blj1mQ9n.js} +1 -1
- package/dist/{watch-DDuWYv0Y.d.ts → watch-D1wwzZ04.d.ts} +5 -5
- package/dist/{watch-topic-EFpOIIDE.d.ts → watch-topic-D-rpUg5n.d.ts} +1 -1
- package/dist/{workflow-builder-OrglbXUh.js → workflow-builder-C5DBN7yq.js} +25 -9
- 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/world/index.d.ts +1 -1
- package/dist/workflow-sdk/world/index.js +2 -2
- package/dist/{workflow-sdk-q8cLwW1K.d.ts → workflow-sdk-Di5pmCAu.d.ts} +3 -3
- package/dist/{workflow-sdk-BZ6qsRlY.js → workflow-sdk-vjDWlnfX.js} +1 -1
- package/dist/{workflows-DFQeXDAI.d.ts → workflows-DJXoxDZH.d.ts} +3 -3
- package/dist/{workflows-C-OvZpeg.js → workflows-DzdX28KN.js} +3 -3
- package/dist/yjs/index.d.ts +2 -2
- package/dist/yjs/index.js +2 -2
- package/package.json +27 -15
- package/schemas/config-v1.json +180 -7
- package/schemas/doctor-report-v1.json +7 -0
- package/skills/better-supabase/SKILL.md +1 -0
- package/skills/better-supabase/references/ui-recipes.md +683 -11
- package/dist/cli/add-CT6p5psO.js +0 -1
- package/dist/cli/adopt-C9jl8z0h.js +0 -1
- package/dist/cli/env-D3gZ-OHj.js +0 -1
- package/dist/cli/seed-DtRFysBe.js +0 -1
- package/dist/cli/{detect-DYDUBLU4.js → detect-BeLVeNpA.js} +1 -1
- package/dist/{client-b2_GjzzD.js → client-BGnJ5WJi.js} +1 -1
|
@@ -0,0 +1,648 @@
|
|
|
1
|
+
import { c as PRESET_CATALOG, h as encodePreset, r as presetConfig } from "./config-C4RQDF6t.js";
|
|
2
|
+
import { r as FIELD_FORMATS } from "./field-formats-Cif5gr7c.js";
|
|
3
|
+
import { f as appTablesOf } from "./app-tables-BRjMcWhW.js";
|
|
4
|
+
//#region src/preset/render.ts
|
|
5
|
+
const CREATE_URL = "https://bettersupabase.com/create";
|
|
6
|
+
/** The comment a config with the provider access model gets above `blocks`. */
|
|
7
|
+
const PROVIDER_COMMENT = [" // The provider access model reads roles from your authorization", " // library: set `authorization` to its adapter."];
|
|
8
|
+
const key = (name) => /^[a-z_$][a-z0-9_$]*$/i.test(name) ? name : JSON.stringify(name);
|
|
9
|
+
const camel = (name) => name.replaceAll(/-([a-z0-9])/g, (_, letter) => letter.toUpperCase());
|
|
10
|
+
/** A JSON value as a TypeScript literal, one line. */
|
|
11
|
+
function literal(value) {
|
|
12
|
+
if (Array.isArray(value)) return `[${value.map(literal).join(", ")}]`;
|
|
13
|
+
if (typeof value === "object" && value !== null) {
|
|
14
|
+
const entries = Object.entries(value);
|
|
15
|
+
if (entries.length === 0) return "{}";
|
|
16
|
+
return `{ ${entries.map(([name, each]) => `${key(name)}: ${literal(each)}`).join(", ")} }`;
|
|
17
|
+
}
|
|
18
|
+
return JSON.stringify(value);
|
|
19
|
+
}
|
|
20
|
+
/** The `/create` URL of a preset, with `&design=` when `designCode` isn't empty. */
|
|
21
|
+
function createUrl(resolved, designCode = "") {
|
|
22
|
+
const preset = `${CREATE_URL}?preset=${encodePreset(resolved.preset)}`;
|
|
23
|
+
return designCode === "" ? preset : `${preset}&design=${designCode}`;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* `better-supabase.config.ts` with these keys: every block with its reason,
|
|
27
|
+
* the conventions, and the app tables, under a comment with the `/create` URL.
|
|
28
|
+
*/
|
|
29
|
+
function configSource(resolved, config, url) {
|
|
30
|
+
const lines = [
|
|
31
|
+
"import { defineConfig } from \"better-supabase/config\";",
|
|
32
|
+
"",
|
|
33
|
+
`// ${url}`,
|
|
34
|
+
"export default defineConfig({"
|
|
35
|
+
];
|
|
36
|
+
if (config.casing !== void 0) lines.push(` casing: ${literal(config.casing)},`);
|
|
37
|
+
if (config.sql !== void 0) lines.push(` sql: ${literal(config.sql)},`);
|
|
38
|
+
if (config.integrations !== void 0) lines.push(` integrations: ${literal(config.integrations)},`);
|
|
39
|
+
if (resolved.preset.access === "provider") lines.push(...PROVIDER_COMMENT);
|
|
40
|
+
lines.push(" blocks: {");
|
|
41
|
+
const entries = Object.entries(config.blocks);
|
|
42
|
+
for (const block of resolved.blocks) {
|
|
43
|
+
const entry = entries.find(([name]) => name === block.name)?.[1] ?? {};
|
|
44
|
+
const note = block.selected ? "" : ` // ${block.reason}`;
|
|
45
|
+
lines.push(` ${key(block.name)}: ${literal(entry)},${note}`);
|
|
46
|
+
}
|
|
47
|
+
lines.push(" },");
|
|
48
|
+
if (config.appTables !== void 0) {
|
|
49
|
+
lines.push(" appTables: {");
|
|
50
|
+
for (const [name, table] of Object.entries(config.appTables)) lines.push(` ${key(name)}: ${literal(table)},`);
|
|
51
|
+
lines.push(" },");
|
|
52
|
+
}
|
|
53
|
+
lines.push("});", "");
|
|
54
|
+
return lines.join("\n");
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* `better-supabase.config.ts` for a resolved preset: every block with its
|
|
58
|
+
* reason, and the conventions that differ from the defaults.
|
|
59
|
+
*/
|
|
60
|
+
function presetConfigSource(resolved) {
|
|
61
|
+
return configSource(resolved, presetConfig(resolved), createUrl(resolved));
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* `lib/blocks.ts`: the blocks with a TypeScript client, wired with
|
|
65
|
+
* `defineBlocks` over the Data API as the caller. Each block's schema (the
|
|
66
|
+
* API schema when `sql.api` is set) and shared options come from
|
|
67
|
+
* `blockConfig`, which `better-supabase gen` writes to
|
|
68
|
+
* `blocks.generated.ts`; `blockConfigImport` is its import path.
|
|
69
|
+
*/
|
|
70
|
+
function presetBlocksSource(resolved, blockConfigImport = "./supabase/blocks.generated") {
|
|
71
|
+
const clients = resolved.manifests.flatMap((manifest) => manifest.client === null ? [] : [{
|
|
72
|
+
name: manifest.name,
|
|
73
|
+
...manifest.client
|
|
74
|
+
}]);
|
|
75
|
+
return [
|
|
76
|
+
"import {",
|
|
77
|
+
" type RpcClient,",
|
|
78
|
+
" defineBlocks,",
|
|
79
|
+
" rpcTransport,",
|
|
80
|
+
"} from \"better-supabase/blocks\";",
|
|
81
|
+
...clients.map((client) => `import { ${client.export} } from "${client.subpath}";`),
|
|
82
|
+
"",
|
|
83
|
+
`import { blockConfig } from ${JSON.stringify(blockConfigImport)};`,
|
|
84
|
+
"",
|
|
85
|
+
"/** The installed blocks, with the settings `better-supabase gen` writes from the config. */",
|
|
86
|
+
"export const blockSet = defineBlocks(blockConfig, {",
|
|
87
|
+
...clients.map((client) => ` ${camel(client.name)}: ${client.export},`),
|
|
88
|
+
"});",
|
|
89
|
+
"",
|
|
90
|
+
"/**",
|
|
91
|
+
" * The blocks as typed clients, acting as the caller of `supabase`: its",
|
|
92
|
+
" * token, so RLS and each function's checks apply.",
|
|
93
|
+
" */",
|
|
94
|
+
"export function blocks(supabase: RpcClient) {",
|
|
95
|
+
" return blockSet.create({ transport: rpcTransport(supabase) });",
|
|
96
|
+
"}",
|
|
97
|
+
""
|
|
98
|
+
].join("\n");
|
|
99
|
+
}
|
|
100
|
+
/** Where `presetBlocksSource` goes, as a shadcn target. */
|
|
101
|
+
const WIRING_TARGET = "@lib/blocks.ts";
|
|
102
|
+
/**
|
|
103
|
+
* The registry glue for the preset's framework and platforms: each item
|
|
104
|
+
* whose blocks are all installed, except bundles and items that write
|
|
105
|
+
* `lib/blocks.ts`, which the preset writes itself.
|
|
106
|
+
*/
|
|
107
|
+
function presetGlue(resolved, catalog = PRESET_CATALOG) {
|
|
108
|
+
const { preset } = resolved;
|
|
109
|
+
const platforms = preset.platforms === "both" ? ["web", "native"] : [preset.platforms];
|
|
110
|
+
const installed = new Set(resolved.blocks.map((block) => block.name));
|
|
111
|
+
return catalog.glue.filter((item) => item.preset === void 0 && !item.targets.includes(WIRING_TARGET) && item.frameworks.includes(preset.framework) && item.platforms.some((platform) => platforms.includes(platform)) && item.blocks.every((block) => installed.has(block)));
|
|
112
|
+
}
|
|
113
|
+
/** The shadcn command that copies glue items into the app. */
|
|
114
|
+
function glueCommand(items) {
|
|
115
|
+
return `npx shadcn@latest add ${items.map((item) => `@better-supabase/${item.name}`).join(" ")}`;
|
|
116
|
+
}
|
|
117
|
+
/** The command that starts a project from the preset. */
|
|
118
|
+
function presetInstallCommand(resolved) {
|
|
119
|
+
return `npx better-supabase init --preset ${encodePreset(resolved.preset)}`;
|
|
120
|
+
}
|
|
121
|
+
/** The command that applies the preset to an existing project. */
|
|
122
|
+
function presetApplyCommand(resolved) {
|
|
123
|
+
return `npx better-supabase apply --preset ${encodePreset(resolved.preset)}`;
|
|
124
|
+
}
|
|
125
|
+
//#endregion
|
|
126
|
+
//#region src/preset/design.ts
|
|
127
|
+
/**
|
|
128
|
+
* The first character of a design code: how it is encoded. `0` is
|
|
129
|
+
* deflate-raw compressed JSON in base64url. Preset codes never start with
|
|
130
|
+
* `0` (their first character is the preset version, from 1), and preset
|
|
131
|
+
* names never start with a digit. The JSON's own format is `DESIGN_FORMAT`.
|
|
132
|
+
*/
|
|
133
|
+
const DESIGN_VERSION = "0";
|
|
134
|
+
/**
|
|
135
|
+
* The newest format of the design JSON, in its `version` key (ADR 0042).
|
|
136
|
+
* A code carries the lowest format that reads it, and none for format 0,
|
|
137
|
+
* so a design without format 1 keys still opens in an older release.
|
|
138
|
+
* Format 1 adds column `format`, `options`, `min`, `max`, `comment` and
|
|
139
|
+
* `identity`, and table `id`, `unique`, `indexes` and `comment`. Format 2
|
|
140
|
+
* adds table `subject` (ADR 0043). Format 3 adds table `rollups` and
|
|
141
|
+
* `lookups` (ADR 0044). Format 4 adds table `events` (ADR 0048) and
|
|
142
|
+
* subject `versions`. Format 5 adds column `access` (ADR 0051).
|
|
143
|
+
*/
|
|
144
|
+
const DESIGN_FORMAT = 5;
|
|
145
|
+
const FORMAT_1_TABLE_KEYS = [
|
|
146
|
+
"id",
|
|
147
|
+
"unique",
|
|
148
|
+
"indexes",
|
|
149
|
+
"comment"
|
|
150
|
+
];
|
|
151
|
+
const FORMAT_1_COLUMN_KEYS = [
|
|
152
|
+
"format",
|
|
153
|
+
"options",
|
|
154
|
+
"min",
|
|
155
|
+
"max",
|
|
156
|
+
"comment",
|
|
157
|
+
"identity"
|
|
158
|
+
];
|
|
159
|
+
/** The lowest design format that reads `design`. */
|
|
160
|
+
function designFormat(design) {
|
|
161
|
+
const tables = Object.values(design.appTables ?? {});
|
|
162
|
+
if (tables.some((table) => Object.values(table.columns ?? {}).some((column) => column.access !== void 0))) return 5;
|
|
163
|
+
if (tables.some((table) => table.events !== void 0 || table.subject?.versions !== void 0)) return 4;
|
|
164
|
+
if (tables.some((table) => table.rollups !== void 0 || table.lookups !== void 0)) return 3;
|
|
165
|
+
if (tables.some((table) => table.subject !== void 0)) return 2;
|
|
166
|
+
return tables.some((table) => FORMAT_1_TABLE_KEYS.some((key) => table[key] !== void 0) || Object.values(table.columns ?? {}).some((column) => FORMAT_1_COLUMN_KEYS.some((key) => column[key] !== void 0))) ? 1 : 0;
|
|
167
|
+
}
|
|
168
|
+
/** The longest design code, so a `/create` URL stays under common limits. */
|
|
169
|
+
const MAX_DESIGN_CODE_LENGTH = 6e3;
|
|
170
|
+
/**
|
|
171
|
+
* What `encodeDesign` throws when a valid design is too long for a URL, so
|
|
172
|
+
* a caller can offer the config download instead of a fix.
|
|
173
|
+
*/
|
|
174
|
+
var DesignTooLongError = class extends TypeError {
|
|
175
|
+
/** The length the code would have. */
|
|
176
|
+
length;
|
|
177
|
+
constructor(length) {
|
|
178
|
+
super(`design: the code is ${String(length)} characters; the most a URL carries is ${String(MAX_DESIGN_CODE_LENGTH)}. Download the config instead, save it as better-supabase.config.ts, then run \`better-supabase init\` and \`better-supabase sql sync\`.`);
|
|
179
|
+
this.name = "DesignTooLongError";
|
|
180
|
+
this.length = length;
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
/** The most bytes a design code inflates to; a longer one is rejected. */
|
|
184
|
+
const MAX_DESIGN_BYTES = 262144;
|
|
185
|
+
const MAX_TABLES = 100;
|
|
186
|
+
const MAX_EXTRA_COLUMNS = 64;
|
|
187
|
+
const MAX_POSITIONS = 1e3;
|
|
188
|
+
const MAX_COORDINATE = 1e6;
|
|
189
|
+
const DESIGN_CODE = /^0[A-Za-z0-9_-]+$/;
|
|
190
|
+
const COLUMN = /^[a-z_][a-z0-9_]{0,62}$/;
|
|
191
|
+
const SQL_TYPE = /^[a-z][a-z0-9_ (),.'[\]-]*$/i;
|
|
192
|
+
const QUALIFIED = /^[a-z_][a-z0-9_]{0,62}\.[a-z_][a-z0-9_]{0,62}$/;
|
|
193
|
+
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
194
|
+
/** Whether `value` has the shape of a design code. It may still fail to decode. */
|
|
195
|
+
function isDesignCode(value) {
|
|
196
|
+
return value.length <= 6e3 && DESIGN_CODE.test(value);
|
|
197
|
+
}
|
|
198
|
+
function extraColumnsOf(value, catalog) {
|
|
199
|
+
if (!isRecord(value)) throw new TypeError("design.extraColumns must be an object");
|
|
200
|
+
return Object.fromEntries(Object.entries(value).map(([module, columns]) => {
|
|
201
|
+
const at = `design.extraColumns.${module}`;
|
|
202
|
+
const block = catalog.blocks.find((each) => each.name === module);
|
|
203
|
+
if (block === void 0) throw new TypeError(`${at}: "${module}" is not a block`);
|
|
204
|
+
if (block.extraColumns === void 0) throw new TypeError(`${at}: the ${module} block takes no extra columns`);
|
|
205
|
+
if (!isRecord(columns)) throw new TypeError(`${at} must be an object of column name to SQL type`);
|
|
206
|
+
const entries = Object.entries(columns);
|
|
207
|
+
if (entries.length > MAX_EXTRA_COLUMNS) throw new TypeError(`${at} has ${String(entries.length)} columns; the most is ${String(MAX_EXTRA_COLUMNS)}`);
|
|
208
|
+
const checked = {};
|
|
209
|
+
for (const [name, type] of entries) {
|
|
210
|
+
if (!COLUMN.test(name)) throw new TypeError(`${at}: "${name}" is not a valid column name`);
|
|
211
|
+
if (typeof type !== "string" || !SQL_TYPE.test(type) || type.includes("--")) throw new TypeError(`${at}.${name} must be a SQL type such as "text not null default ''"`);
|
|
212
|
+
checked[name] = type;
|
|
213
|
+
}
|
|
214
|
+
return [module, checked];
|
|
215
|
+
}));
|
|
216
|
+
}
|
|
217
|
+
function coordinate(value) {
|
|
218
|
+
return typeof value === "number" && Number.isFinite(value) && Math.abs(value) <= MAX_COORDINATE;
|
|
219
|
+
}
|
|
220
|
+
function pairOf(value) {
|
|
221
|
+
if (!Array.isArray(value) || value.length !== 2) return;
|
|
222
|
+
const x = value[0];
|
|
223
|
+
const y = value[1];
|
|
224
|
+
return coordinate(x) && coordinate(y) ? [x, y] : void 0;
|
|
225
|
+
}
|
|
226
|
+
function positionsOf(value) {
|
|
227
|
+
if (!isRecord(value)) throw new TypeError("design.positions must be an object");
|
|
228
|
+
const entries = Object.entries(value);
|
|
229
|
+
if (entries.length > MAX_POSITIONS) throw new TypeError(`design.positions has ${String(entries.length)} entries; the most is ${String(MAX_POSITIONS)}`);
|
|
230
|
+
return Object.fromEntries(entries.map(([table, position]) => {
|
|
231
|
+
if (!QUALIFIED.test(table)) throw new TypeError(`design.positions: "${table}" is not a schema.table name`);
|
|
232
|
+
const pair = pairOf(position);
|
|
233
|
+
if (pair === void 0) throw new TypeError(`design.positions.${table} must be [x, y], two finite numbers`);
|
|
234
|
+
return [table, pair];
|
|
235
|
+
}));
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Checks a design and drops its empty parts. Throws a TypeError naming the
|
|
239
|
+
* first problem.
|
|
240
|
+
*/
|
|
241
|
+
function designOfValue(value, catalog = PRESET_CATALOG) {
|
|
242
|
+
if (!isRecord(value)) throw new TypeError("design must be an object");
|
|
243
|
+
const unknownKey = Object.keys(value).find((name) => name !== "appTables" && name !== "extraColumns" && name !== "positions" && name !== "version");
|
|
244
|
+
if (unknownKey !== void 0) throw new TypeError(`design: unknown key "${unknownKey}"; a design has appTables, extraColumns and positions`);
|
|
245
|
+
const version = value["version"] ?? 0;
|
|
246
|
+
if (typeof version !== "number" || !Number.isSafeInteger(version) || version < 0) throw new TypeError("design.version must be a whole number");
|
|
247
|
+
if (version > 5) throw new TypeError(`design: the code needs format ${String(version)}, and this better-supabase reads up to ${String(5)}; update better-supabase`);
|
|
248
|
+
const appTables = value["appTables"] === void 0 ? {} : appTablesOf(value["appTables"]);
|
|
249
|
+
if (Object.keys(appTables).length > MAX_TABLES) throw new TypeError(`design.appTables has ${String(Object.keys(appTables).length)} tables; the most is ${String(MAX_TABLES)}`);
|
|
250
|
+
const extraColumns = value["extraColumns"] === void 0 ? {} : extraColumnsOf(value["extraColumns"], catalog) ?? {};
|
|
251
|
+
const positions = value["positions"] === void 0 ? {} : positionsOf(value["positions"]) ?? {};
|
|
252
|
+
const filled = Object.fromEntries(Object.entries(extraColumns).filter(([, columns]) => Object.keys(columns).length > 0));
|
|
253
|
+
return {
|
|
254
|
+
...Object.keys(appTables).length === 0 ? {} : { appTables },
|
|
255
|
+
...Object.keys(filled).length === 0 ? {} : { extraColumns: filled },
|
|
256
|
+
...Object.keys(positions).length === 0 ? {} : { positions }
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
async function pipe(bytes, transform, limit) {
|
|
260
|
+
const reader = new Blob([bytes]).stream().pipeThrough(transform).getReader();
|
|
261
|
+
const chunks = [];
|
|
262
|
+
let length = 0;
|
|
263
|
+
for (;;) {
|
|
264
|
+
const { done, value } = await reader.read();
|
|
265
|
+
if (done) break;
|
|
266
|
+
length += value.byteLength;
|
|
267
|
+
if (length > limit) {
|
|
268
|
+
await reader.cancel();
|
|
269
|
+
throw new TypeError(`design: the code inflates past ${String(limit)} bytes`);
|
|
270
|
+
}
|
|
271
|
+
chunks.push(value);
|
|
272
|
+
}
|
|
273
|
+
const out = new Uint8Array(length);
|
|
274
|
+
let offset = 0;
|
|
275
|
+
for (const chunk of chunks) {
|
|
276
|
+
out.set(chunk, offset);
|
|
277
|
+
offset += chunk.byteLength;
|
|
278
|
+
}
|
|
279
|
+
return out;
|
|
280
|
+
}
|
|
281
|
+
function toBase64Url(bytes) {
|
|
282
|
+
let binary = "";
|
|
283
|
+
for (const byte of bytes) binary += String.fromCodePoint(byte);
|
|
284
|
+
return btoa(binary).replaceAll("+", "-").replaceAll("/", "_").replace(/=+$/, "");
|
|
285
|
+
}
|
|
286
|
+
function fromBase64Url(text) {
|
|
287
|
+
const binary = atob(text.replaceAll("-", "+").replaceAll("_", "/"));
|
|
288
|
+
return Uint8Array.from(binary, (char) => char.codePointAt(0) ?? 0);
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* The design as a code for the `&design=` parameter: `0`, then its JSON
|
|
292
|
+
* (with `version` set to `designFormat` when it is above 0) compressed with
|
|
293
|
+
* deflate-raw, in base64url. An empty design is `""`.
|
|
294
|
+
* Throws a TypeError when the design is invalid, and a `DesignTooLongError`
|
|
295
|
+
* when the code would be longer than `MAX_DESIGN_CODE_LENGTH`.
|
|
296
|
+
*/
|
|
297
|
+
async function encodeDesign(design) {
|
|
298
|
+
const checked = designOfValue(design);
|
|
299
|
+
if (Object.keys(checked).length === 0) return "";
|
|
300
|
+
const format = designFormat(checked);
|
|
301
|
+
const json = new TextEncoder().encode(JSON.stringify(format === 0 ? checked : {
|
|
302
|
+
version: format,
|
|
303
|
+
...checked
|
|
304
|
+
}));
|
|
305
|
+
const code = `${DESIGN_VERSION}${toBase64Url(await pipe(json, new CompressionStream("deflate-raw"), MAX_DESIGN_BYTES))}`;
|
|
306
|
+
if (code.length > 6e3) throw new DesignTooLongError(code.length);
|
|
307
|
+
return code;
|
|
308
|
+
}
|
|
309
|
+
/** Reads a design code. Throws a TypeError when it isn't a valid one. */
|
|
310
|
+
async function decodeDesign(code) {
|
|
311
|
+
if (code === "") return {};
|
|
312
|
+
if (!isDesignCode(code)) throw new TypeError(code.length > 6e3 ? `design: the code is longer than ${String(MAX_DESIGN_CODE_LENGTH)} characters` : `design: "${code.slice(0, 40)}" is not a design code`);
|
|
313
|
+
let json;
|
|
314
|
+
try {
|
|
315
|
+
const bytes = await pipe(fromBase64Url(code.slice(1)), new DecompressionStream("deflate-raw"), MAX_DESIGN_BYTES);
|
|
316
|
+
json = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes));
|
|
317
|
+
} catch (error) {
|
|
318
|
+
if (error instanceof TypeError && error.message.startsWith("design:")) throw error;
|
|
319
|
+
throw new TypeError("design: the code is damaged; copy it again from /create", { cause: error });
|
|
320
|
+
}
|
|
321
|
+
return designOfValue(json);
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* The design in a `/create` URL's `&design=` parameter, or in a bare design
|
|
325
|
+
* code; `undefined` when `input` has neither.
|
|
326
|
+
*/
|
|
327
|
+
async function designOf(input) {
|
|
328
|
+
const parameter = /[?&]design=([^&#]*)/.exec(input)?.[1];
|
|
329
|
+
if (parameter !== void 0) return decodeDesign(decodeURIComponent(parameter));
|
|
330
|
+
return isDesignCode(input) ? decodeDesign(input) : void 0;
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* The config keys a preset with a design sets: `presetConfig`, with each
|
|
334
|
+
* block's `options.extraColumns` and `appTables`. Throws a TypeError when the
|
|
335
|
+
* design adds columns to a block the preset doesn't install.
|
|
336
|
+
*/
|
|
337
|
+
function designConfig(resolved, design) {
|
|
338
|
+
const base = presetConfig(resolved);
|
|
339
|
+
const blocks = { ...base.blocks };
|
|
340
|
+
for (const [module, columns] of Object.entries(design.extraColumns ?? {})) {
|
|
341
|
+
const entry = blocks[module];
|
|
342
|
+
if (entry === void 0) throw new TypeError(`design.extraColumns.${module}: the preset doesn't install the ${module} block`);
|
|
343
|
+
blocks[module] = {
|
|
344
|
+
...entry,
|
|
345
|
+
options: {
|
|
346
|
+
...entry.options,
|
|
347
|
+
extraColumns: columns
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
const appTables = design.appTables === void 0 ? {} : appTablesOf(design.appTables, resolved.preset.tenantName);
|
|
352
|
+
return {
|
|
353
|
+
...base,
|
|
354
|
+
blocks,
|
|
355
|
+
...Object.keys(appTables).length === 0 ? {} : { appTables }
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* `better-supabase.config.ts` for a preset with a design. `designCode`, the
|
|
360
|
+
* design's `encodeDesign`, goes into the `/create` URL in the comment, so the
|
|
361
|
+
* canvas reopens with its positions.
|
|
362
|
+
*/
|
|
363
|
+
function designConfigSource(resolved, design, designCode = "") {
|
|
364
|
+
return configSource(resolved, designConfig(resolved, design), createUrl(resolved, designCode));
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* The command that starts a project from the preset and design: `init` with
|
|
368
|
+
* the quoted `/create` URL, or `presetInstallCommand` when `designCode` is
|
|
369
|
+
* empty.
|
|
370
|
+
*/
|
|
371
|
+
function designInstallCommand(resolved, designCode) {
|
|
372
|
+
return designCode === "" ? presetInstallCommand(resolved) : `npx better-supabase init --preset "${createUrl(resolved, designCode)}"`;
|
|
373
|
+
}
|
|
374
|
+
/** The command that applies the preset and design to an existing project. */
|
|
375
|
+
function designApplyCommand(resolved, designCode) {
|
|
376
|
+
return designCode === "" ? presetApplyCommand(resolved) : `npx better-supabase apply --preset "${createUrl(resolved, designCode)}"`;
|
|
377
|
+
}
|
|
378
|
+
//#endregion
|
|
379
|
+
//#region src/preset/design-diff.ts
|
|
380
|
+
/** `value` as JSON with sorted keys, so two configs compare by content. */
|
|
381
|
+
function canonical(value) {
|
|
382
|
+
if (Array.isArray(value)) return `[${value.map(canonical).join(",")}]`;
|
|
383
|
+
if (value !== null && typeof value === "object") return `{${Object.entries(value).filter(([, each]) => each !== void 0).toSorted(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([key, each]) => `${JSON.stringify(key)}:${canonical(each)}`).join(",")}}`;
|
|
384
|
+
return JSON.stringify(value);
|
|
385
|
+
}
|
|
386
|
+
const same = (a, b) => canonical(a) === canonical(b);
|
|
387
|
+
const isRequired = (column) => column.nullable === false;
|
|
388
|
+
const lacksDefault = (column) => column.default === void 0 && column.identity !== true;
|
|
389
|
+
const safe = (kind, table, summary, column) => ({
|
|
390
|
+
kind,
|
|
391
|
+
table,
|
|
392
|
+
...column === void 0 ? {} : { column },
|
|
393
|
+
breaking: false,
|
|
394
|
+
summary,
|
|
395
|
+
steps: []
|
|
396
|
+
});
|
|
397
|
+
const breakingChange = (kind, table, summary, steps, column) => ({
|
|
398
|
+
kind,
|
|
399
|
+
table,
|
|
400
|
+
...column === void 0 ? {} : { column },
|
|
401
|
+
breaking: true,
|
|
402
|
+
summary,
|
|
403
|
+
steps
|
|
404
|
+
});
|
|
405
|
+
/** The steps that make a new check or constraint safe on rows that may not pass it. */
|
|
406
|
+
const checkSteps = (target, rule) => [
|
|
407
|
+
`Find the rows where ${target} doesn't ${rule}, and fix them in a migration.`,
|
|
408
|
+
`Make the app write only values that ${rule}, then deploy.`,
|
|
409
|
+
`Add the constraint.`
|
|
410
|
+
];
|
|
411
|
+
const targetOf = (reference) => reference === void 0 ? "" : "block" in reference ? `${reference.block}.${reference.table}` : reference.table;
|
|
412
|
+
/** How closed a column's access is: none, then `read`, then `server`. */
|
|
413
|
+
const ACCESS_RANK = {
|
|
414
|
+
read: 1,
|
|
415
|
+
server: 2
|
|
416
|
+
};
|
|
417
|
+
const accessRank = (column) => column.access === void 0 ? 0 : ACCESS_RANK[column.access];
|
|
418
|
+
/**
|
|
419
|
+
* The changes to one column whose name and type stay: each new or tighter
|
|
420
|
+
* constraint is breaking, because rows already in the table may not pass
|
|
421
|
+
* it; anything else (a comment, a default, `onDelete`, a looser rule) is safe.
|
|
422
|
+
*/
|
|
423
|
+
function constraintChanges(table, name, before, after) {
|
|
424
|
+
const at = `${table}.${name}`;
|
|
425
|
+
const changes = [];
|
|
426
|
+
if (before.unique !== true && after.unique === true) changes.push(breakingChange("column.unique", table, `Makes ${at} unique, which fails while two rows share a value.`, checkSteps(at, "repeat a value"), name));
|
|
427
|
+
const removed = after.options === void 0 ? [] : before.options === void 0 ? after.options : before.options.filter((option) => !after.options?.includes(option));
|
|
428
|
+
if (after.options !== void 0 && removed.length > 0) changes.push(breakingChange("column.options", table, before.options === void 0 ? `Limits ${at} to ${after.options.join(", ")}.` : `Removes ${removed.join(", ")} from the options of ${at}.`, checkSteps(at, `hold one of ${after.options.join(", ")}`), name));
|
|
429
|
+
const raised = after.min !== void 0 && (before.min === void 0 || after.min > before.min);
|
|
430
|
+
const lowered = after.max !== void 0 && (before.max === void 0 || after.max < before.max);
|
|
431
|
+
if (raised || lowered) changes.push(breakingChange("column.bounds", table, `Narrows the bounds of ${at}${after.min === void 0 ? "" : ` to at least ${String(after.min)}`}${after.max === void 0 ? "" : `${after.min === void 0 ? " to" : " and"} at most ${String(after.max)}`}.`, checkSteps(at, "fit the new bounds"), name));
|
|
432
|
+
const checks = (format) => {
|
|
433
|
+
const rule = format === void 0 ? void 0 : FIELD_FORMATS[format];
|
|
434
|
+
return rule?.pattern !== void 0 || rule?.bounds !== void 0;
|
|
435
|
+
};
|
|
436
|
+
if (after.format !== void 0 && after.format !== before.format && checks(after.format)) changes.push(breakingChange("column.format", table, `Checks ${at} as ${after.format}.`, checkSteps(at, `hold a valid ${after.format}`), name));
|
|
437
|
+
if (after.references !== void 0 && targetOf(before.references) !== targetOf(after.references)) changes.push(breakingChange("column.reference", table, `Points ${at} at ${targetOf(after.references)}, which fails for values that row doesn't have.`, checkSteps(at, `match a row of ${targetOf(after.references)}`), name));
|
|
438
|
+
if (accessRank(after) > accessRank(before)) changes.push(breakingChange("column.access", table, after.access === "server" ? `Hides ${at} from signed-in users, so client reads and writes of it fail.` : `Makes ${at} read-only for signed-in users, so client writes of it fail.`, [`Move every client ${after.access === "server" ? "read and write" : "write"} of ${at} to server code that uses the service role, then deploy.`, `Change the access of ${at}.`], name));
|
|
439
|
+
if (changes.length === 0 && !same(before, after)) changes.push(safe("column.changed", table, `Changes ${at}.`, name));
|
|
440
|
+
return changes;
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* The changes to a table's own keys: a new scope, unique set, or a removed
|
|
444
|
+
* `timestamps`, `rank` or `softDelete` breaks what exists; the rest (indexes,
|
|
445
|
+
* the comment, other subject keys) is safe.
|
|
446
|
+
*/
|
|
447
|
+
function tableChanges(name, before, after) {
|
|
448
|
+
const changes = [];
|
|
449
|
+
if ((before.scope ?? "inherit") !== (after.scope ?? "inherit")) changes.push(breakingChange("table.scope", name, `Changes the scope of ${name} from ${before.scope ?? "inherit"} to ${after.scope ?? "inherit"}, which changes its scope column and policies.`, [
|
|
450
|
+
`Add the new scope column as nullable and fill it for every row in a migration.`,
|
|
451
|
+
`Move the app to the new scope, then deploy.`,
|
|
452
|
+
`Change the scope and drop the old column in a later migration.`
|
|
453
|
+
]));
|
|
454
|
+
const sets = (table) => new Set((table.unique ?? []).map((set) => set.join(",")));
|
|
455
|
+
const oldSets = sets(before);
|
|
456
|
+
const added = [...sets(after)].filter((set) => !oldSets.has(set));
|
|
457
|
+
if (added.length > 0) changes.push(breakingChange("table.unique", name, `Adds unique (${added.join("), (")}) to ${name}, which fails while two rows share those values.`, checkSteps(`(${added.join("), (")})`, "repeat across rows")));
|
|
458
|
+
const dropped = [
|
|
459
|
+
before.timestamps !== false && after.timestamps === false ? "timestamps" : void 0,
|
|
460
|
+
before.subject?.rank !== void 0 && after.subject?.rank === void 0 ? "rank" : void 0,
|
|
461
|
+
before.subject?.softDelete === true && after.subject?.softDelete !== true ? "softDelete" : void 0
|
|
462
|
+
].filter((each) => each !== void 0);
|
|
463
|
+
if (dropped.length > 0) changes.push(breakingChange("table.columns", name, `Removes ${dropped.join(", ")} from ${name}, which drops the columns ${dropped.length === 1 ? "it adds" : "they add"} and their values.`, [
|
|
464
|
+
`Stop reading ${dropped.join(", ")} in the app, then deploy.`,
|
|
465
|
+
`Export the values first if you need them.`,
|
|
466
|
+
`Remove the key and generate the migration that drops the columns.`
|
|
467
|
+
]));
|
|
468
|
+
const rest = (config) => ({
|
|
469
|
+
...config,
|
|
470
|
+
columns: void 0,
|
|
471
|
+
id: void 0,
|
|
472
|
+
rollups: void 0,
|
|
473
|
+
lookups: void 0,
|
|
474
|
+
events: void 0,
|
|
475
|
+
subject: config.subject === void 0 ? void 0 : {
|
|
476
|
+
...config.subject,
|
|
477
|
+
versions: void 0
|
|
478
|
+
}
|
|
479
|
+
});
|
|
480
|
+
if (!same(before.events, after.events)) changes.push(safe("table.events", name, `Changes the outbox events ${name} emits, which replaces its events trigger.`));
|
|
481
|
+
if (!same(before.subject?.versions, after.subject?.versions)) changes.push(safe("table.versions", name, `Changes the versions ${name} keeps, which replaces its snapshot trigger; existing versions stay.`));
|
|
482
|
+
if (changes.every((change) => change.kind === "table.events" || change.kind === "table.versions") && !same(rest(before), rest(after))) changes.push(safe("table.changed", name, `Changes table ${name}.`));
|
|
483
|
+
return changes;
|
|
484
|
+
}
|
|
485
|
+
const columnsOf = (table) => table.columns ?? {};
|
|
486
|
+
/**
|
|
487
|
+
* Pairs each name only in `before` with a name only in `after` whose value
|
|
488
|
+
* is the same: a rename, as far as a config can tell.
|
|
489
|
+
*/
|
|
490
|
+
function renames(before, after) {
|
|
491
|
+
const added = Object.keys(after).filter((name) => !(name in before));
|
|
492
|
+
const paired = /* @__PURE__ */ new Map();
|
|
493
|
+
for (const [name, value] of Object.entries(before)) {
|
|
494
|
+
if (name in after) continue;
|
|
495
|
+
const match = added.find((candidate) => ![...paired.values()].includes(candidate) && same(value, after[candidate]));
|
|
496
|
+
if (match !== void 0) paired.set(name, match);
|
|
497
|
+
}
|
|
498
|
+
return paired;
|
|
499
|
+
}
|
|
500
|
+
function columnChanges(table, before, after) {
|
|
501
|
+
const old = columnsOf(before);
|
|
502
|
+
const next = columnsOf(after);
|
|
503
|
+
const renamed = renames(old, next);
|
|
504
|
+
const renamedTo = new Set(renamed.values());
|
|
505
|
+
const changes = [];
|
|
506
|
+
for (const [name, column] of Object.entries(old)) {
|
|
507
|
+
const to = renamed.get(name);
|
|
508
|
+
const now = next[name];
|
|
509
|
+
if (to !== void 0) changes.push({
|
|
510
|
+
kind: "column.renamed",
|
|
511
|
+
table,
|
|
512
|
+
column: to,
|
|
513
|
+
from: name,
|
|
514
|
+
breaking: true,
|
|
515
|
+
summary: `Renames ${table}.${name} to ${to}.`,
|
|
516
|
+
steps: [
|
|
517
|
+
`Add ${to} as a nullable column and copy ${name} into it in a migration.`,
|
|
518
|
+
`Write both columns and move reads to ${to}, then deploy.`,
|
|
519
|
+
`Drop ${name} in a later migration${isRequired(column) ? `, then make ${to} required` : ""}.`
|
|
520
|
+
]
|
|
521
|
+
});
|
|
522
|
+
else if (now === void 0) changes.push({
|
|
523
|
+
kind: "column.dropped",
|
|
524
|
+
table,
|
|
525
|
+
column: name,
|
|
526
|
+
breaking: true,
|
|
527
|
+
summary: `Drops ${table}.${name} and its values.`,
|
|
528
|
+
steps: [
|
|
529
|
+
`Stop reading and writing ${table}.${name} in the app, then deploy.`,
|
|
530
|
+
`Export the values first if you need them.`,
|
|
531
|
+
`Remove the column and generate the migration that drops it.`
|
|
532
|
+
]
|
|
533
|
+
});
|
|
534
|
+
else if (now.type !== column.type) changes.push({
|
|
535
|
+
kind: "column.type",
|
|
536
|
+
table,
|
|
537
|
+
column: name,
|
|
538
|
+
from: column.type,
|
|
539
|
+
to: now.type,
|
|
540
|
+
breaking: true,
|
|
541
|
+
summary: `Changes ${table}.${name} from ${column.type} to ${now.type}.`,
|
|
542
|
+
steps: [
|
|
543
|
+
`Add a ${now.type} column next to ${name}.`,
|
|
544
|
+
`Fill it from ${name} with a cast in a migration, and write both columns.`,
|
|
545
|
+
`Move reads to the new column, drop ${name} in a later migration and rename the new one if you need the name.`
|
|
546
|
+
]
|
|
547
|
+
});
|
|
548
|
+
else if (!isRequired(column) && isRequired(now) && lacksDefault(now)) changes.push({
|
|
549
|
+
kind: "column.required",
|
|
550
|
+
table,
|
|
551
|
+
column: name,
|
|
552
|
+
breaking: true,
|
|
553
|
+
summary: `Makes ${table}.${name} required without a default.`,
|
|
554
|
+
steps: [
|
|
555
|
+
`Fill ${table}.${name} in every row where it is null, in a migration.`,
|
|
556
|
+
`Make the app always write it, or give it a default, then deploy.`,
|
|
557
|
+
`Make the column required.`
|
|
558
|
+
]
|
|
559
|
+
});
|
|
560
|
+
else changes.push(...constraintChanges(table, name, column, now));
|
|
561
|
+
}
|
|
562
|
+
for (const [name, column] of Object.entries(next)) {
|
|
563
|
+
if (name in old || renamedTo.has(name)) continue;
|
|
564
|
+
changes.push(isRequired(column) && lacksDefault(column) ? {
|
|
565
|
+
kind: "column.added",
|
|
566
|
+
table,
|
|
567
|
+
column: name,
|
|
568
|
+
breaking: true,
|
|
569
|
+
summary: `Adds ${table}.${name} as required without a default, which rows already in the table don't have.`,
|
|
570
|
+
steps: [
|
|
571
|
+
`Add ${name} as a nullable column.`,
|
|
572
|
+
`Fill it in every existing row, and make the app always write it, then deploy.`,
|
|
573
|
+
`Make the column required.`
|
|
574
|
+
]
|
|
575
|
+
} : safe("column.added", table, `Adds ${table}.${name}.`, name));
|
|
576
|
+
}
|
|
577
|
+
return changes;
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* What changes from `before` to `after`: each added, dropped, renamed or
|
|
581
|
+
* changed table and column, with the breaking ones marked and their
|
|
582
|
+
* expand-and-contract steps. A rename is a dropped name and an added one
|
|
583
|
+
* with the same definition.
|
|
584
|
+
*/
|
|
585
|
+
function diffAppTables(before, after, options = {}) {
|
|
586
|
+
const old = options.keepMissing === true ? Object.fromEntries(Object.entries(before).filter(([name]) => name in after)) : before;
|
|
587
|
+
const renamed = renames(old, after);
|
|
588
|
+
const renamedTo = new Set(renamed.values());
|
|
589
|
+
const changes = [];
|
|
590
|
+
for (const [name, table] of Object.entries(old)) {
|
|
591
|
+
const to = renamed.get(name);
|
|
592
|
+
const now = after[name];
|
|
593
|
+
if (to !== void 0) changes.push({
|
|
594
|
+
kind: "table.renamed",
|
|
595
|
+
table: to,
|
|
596
|
+
from: name,
|
|
597
|
+
breaking: true,
|
|
598
|
+
summary: `Renames table ${name} to ${to}.`,
|
|
599
|
+
steps: [
|
|
600
|
+
`Add ${to} next to ${name} and copy the rows in a migration.`,
|
|
601
|
+
`Write to both tables and move reads to ${to}, then deploy.`,
|
|
602
|
+
`Stop using ${name}, then drop it in a later migration.`
|
|
603
|
+
]
|
|
604
|
+
});
|
|
605
|
+
else if (now === void 0) changes.push({
|
|
606
|
+
kind: "table.dropped",
|
|
607
|
+
table: name,
|
|
608
|
+
breaking: true,
|
|
609
|
+
summary: `Drops table ${name} and its rows.`,
|
|
610
|
+
steps: [
|
|
611
|
+
`Stop reading and writing ${name} in the app, then deploy.`,
|
|
612
|
+
`Export the rows first if you need them.`,
|
|
613
|
+
`Remove the table and generate the migration that drops it.`
|
|
614
|
+
]
|
|
615
|
+
});
|
|
616
|
+
else {
|
|
617
|
+
const from = table.id ?? "uuid";
|
|
618
|
+
const toId = now.id ?? "uuid";
|
|
619
|
+
if (from !== toId) changes.push({
|
|
620
|
+
kind: "table.id",
|
|
621
|
+
table: name,
|
|
622
|
+
from,
|
|
623
|
+
to: toId,
|
|
624
|
+
breaking: true,
|
|
625
|
+
summary: `Changes the id of ${name} from ${from} to ${toId}.`,
|
|
626
|
+
steps: [
|
|
627
|
+
`Add a table with the ${toId} id and copy the rows, keeping a map from old ids to new ones.`,
|
|
628
|
+
`Point the columns that reference ${name} at the new ids, then move the app to the new table.`,
|
|
629
|
+
`Drop the old table in a later migration.`
|
|
630
|
+
]
|
|
631
|
+
});
|
|
632
|
+
changes.push(...tableChanges(name, table, now), ...columnChanges(name, table, now));
|
|
633
|
+
const computed = (config) => ({
|
|
634
|
+
rollups: config.rollups,
|
|
635
|
+
lookups: config.lookups
|
|
636
|
+
});
|
|
637
|
+
if (!same(computed(table), computed(now))) changes.push(safe("table.computed", name, `Changes the rollups and lookups of ${name}, read through ${name}_view.`));
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
for (const name of Object.keys(after)) if (!(name in old) && !renamedTo.has(name)) changes.push(safe("table.added", name, `Adds table ${name}.`));
|
|
641
|
+
return changes;
|
|
642
|
+
}
|
|
643
|
+
/** `diffAppTables` over the app tables of two `/create` designs. */
|
|
644
|
+
function diffDesigns(before, after) {
|
|
645
|
+
return diffAppTables(before.appTables ?? {}, after.appTables ?? {});
|
|
646
|
+
}
|
|
647
|
+
//#endregion
|
|
648
|
+
export { presetApplyCommand as _, MAX_DESIGN_CODE_LENGTH as a, presetGlue as b, designConfig as c, designInstallCommand as d, designOf as f, glueCommand as g, PROVIDER_COMMENT as h, DesignTooLongError as i, designConfigSource as l, isDesignCode as m, diffDesigns as n, decodeDesign as o, encodeDesign as p, DESIGN_FORMAT as r, designApplyCommand as s, diffAppTables as t, designFormat as u, presetBlocksSource as v, presetInstallCommand as x, presetConfigSource as y };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
2
|
import { b as DbError, t as AsyncResult } from "./result-Cj3yWhjH.js";
|
|
3
|
-
import { r as AuthState } from "./resolve-
|
|
3
|
+
import { r as AuthState } from "./resolve-7atr-wWr.js";
|
|
4
4
|
//#region src/credentials/provider.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Names a credential without holding it. Tables store this as a
|
package/dist/query/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { t as escapeLike } from "../escape-like-AUEPn-C5.js";
|
|
2
2
|
import { n as invalidateTables, t as BetterQueryMeta } from "../invalidate-BBqhpxyB.js";
|
|
3
|
-
import { _ as invalidateOnMutation, a as UserChangeSource, c as InfiniteExtras, d as QueriesOptions, f as QueryHelpers, g as createQueries, h as TableQueries, i as optimistic, l as InfiniteOptionsOf, m as QueryOptionsOf, n as OptimisticSnapshot, o as clearOnUserChange, p as QueryKeyOf, r as OptimisticTarget, s as BetterQueries, t as OptimisticHandlers, u as MutationOptionsOf, v as queryCache } from "../index-
|
|
3
|
+
import { _ as invalidateOnMutation, a as UserChangeSource, c as InfiniteExtras, d as QueriesOptions, f as QueryHelpers, g as createQueries, h as TableQueries, i as optimistic, l as InfiniteOptionsOf, m as QueryOptionsOf, n as OptimisticSnapshot, o as clearOnUserChange, p as QueryKeyOf, r as OptimisticTarget, s as BetterQueries, t as OptimisticHandlers, u as MutationOptionsOf, v as queryCache } from "../index-Cckxs8IE.js";
|
|
4
4
|
export { type BetterQueries, type BetterQueryMeta, type InfiniteExtras, type InfiniteOptionsOf, type MutationOptionsOf, type OptimisticHandlers, type OptimisticSnapshot, type OptimisticTarget, type QueriesOptions, type QueryHelpers, type QueryKeyOf, type QueryOptionsOf, type TableQueries, type UserChangeSource, clearOnUserChange, createQueries, escapeLike, invalidateOnMutation, invalidateTables, optimistic, queryCache };
|