better-supabase 0.17.0 → 0.18.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/{access-sql-B-MkVARa.js → access-sql-CNIgUqWf.js} +2 -0
- package/dist/{adapter-Dyks1lX1.js → adapter-CfuBICuG.js} +3 -1
- package/dist/{ai-schedules-Dk9H3kAp.d.ts → ai-schedules-DzLh6BYI.d.ts} +1 -1
- package/dist/ai-sdk/agents/index.d.ts +2 -2
- package/dist/ai-sdk/memory/index.js +1 -1
- package/dist/{api-CpL3hm87.d.ts → api-B6zteBya.d.ts} +1 -1
- package/dist/{app-tables-Q0TYfeih.js → app-tables-DyswUg6J.js} +10 -2
- package/dist/{app-tables-dS02piE7.d.ts → app-tables-XwCviyhP.d.ts} +1 -1
- package/dist/astro/index.d.ts +3 -3
- package/dist/astro/index.js +5 -5
- package/dist/{attachments-aJYgdYtB.js → attachments-M-Dy79Ry.js} +9 -2
- package/dist/{authorization-CNsvnwle.d.ts → authorization-IiE__z2m.d.ts} +169 -87
- package/dist/{automations-CIwRq7zm.js → automations-B5P6vTvk.js} +2 -2
- package/dist/{automations-CD1XlL2W.js → automations-BKjJpktQ.js} +1 -1
- package/dist/{automations-Bc2ue55V.js → automations-FCnWy387.js} +2 -2
- package/dist/{bind-C801IaK-.d.ts → bind-pu5TLrla.d.ts} +3 -3
- package/dist/{block-env-BeG4DiiO.d.ts → block-env-CA65ulTD.d.ts} +4 -4
- package/dist/blocks/access-requests/index.d.ts +1 -1
- package/dist/blocks/access-requests/index.js +1 -1
- package/dist/blocks/activities/index.d.ts +1 -1
- package/dist/blocks/activities/index.js +1 -1
- package/dist/blocks/agents/index.d.ts +1 -1
- package/dist/blocks/agents/index.js +1 -1
- package/dist/blocks/ai-cache/index.d.ts +1 -1
- package/dist/blocks/ai-cache/index.js +1 -1
- package/dist/blocks/ai-chat/index.d.ts +4 -4
- package/dist/blocks/ai-chat/index.js +1 -1
- package/dist/blocks/ai-files/index.d.ts +1 -1
- package/dist/blocks/ai-files/index.js +1 -1
- package/dist/blocks/ai-keys/index.d.ts +1 -1
- package/dist/blocks/ai-keys/index.js +1 -1
- package/dist/blocks/ai-schedules/index.d.ts +2 -2
- package/dist/blocks/ai-schedules/index.js +1 -1
- package/dist/blocks/announcements/index.d.ts +4 -4
- package/dist/blocks/announcements/index.js +1 -1
- package/dist/blocks/api-keys/index.d.ts +2 -2
- package/dist/blocks/api-keys/index.js +1 -1
- package/dist/blocks/approvals/index.d.ts +1 -1
- package/dist/blocks/approvals/index.js +1 -1
- package/dist/blocks/assets/index.d.ts +1 -1
- package/dist/blocks/assets/index.js +1 -1
- package/dist/blocks/assignment/index.d.ts +1 -1
- package/dist/blocks/attachments/index.d.ts +40 -4
- package/dist/blocks/attachments/index.js +42 -4
- package/dist/blocks/audit/index.d.ts +3 -3
- package/dist/blocks/audit/index.js +2 -2
- package/dist/blocks/automations/index.d.ts +3 -3
- package/dist/blocks/automations/index.js +1 -1
- package/dist/blocks/billable-time/index.d.ts +1 -1
- package/dist/blocks/billing/index.d.ts +2 -2
- package/dist/blocks/billing/index.js +1 -1
- package/dist/blocks/bookings/index.d.ts +2 -2
- package/dist/blocks/bookings/index.js +1 -1
- package/dist/blocks/bulk/index.d.ts +1 -1
- package/dist/blocks/bulk/index.js +1 -1
- package/dist/blocks/calendar/index.d.ts +2 -2
- package/dist/blocks/calendar/index.js +1 -1
- package/dist/blocks/catalog/index.d.ts +1 -1
- package/dist/blocks/catalog/index.js +1 -1
- package/dist/blocks/channels/index.d.ts +1 -1
- package/dist/blocks/collections/index.d.ts +1 -1
- package/dist/blocks/collections/index.js +1 -1
- package/dist/blocks/comments/index.d.ts +5 -5
- package/dist/blocks/comments/index.js +1 -1
- package/dist/blocks/compliance/index.d.ts +1 -1
- package/dist/blocks/compliance/index.js +1 -1
- package/dist/blocks/connectors/index.d.ts +1 -1
- package/dist/blocks/connectors/index.js +1 -1
- package/dist/blocks/contacts/index.d.ts +1 -1
- package/dist/blocks/contacts/index.js +1 -1
- package/dist/blocks/content/index.d.ts +2 -2
- package/dist/blocks/content/index.js +1 -1
- package/dist/blocks/contracts/index.d.ts +1 -1
- package/dist/blocks/contracts/index.js +1 -1
- package/dist/blocks/courses/index.d.ts +2 -2
- package/dist/blocks/courses/index.js +1 -1
- package/dist/blocks/created-by/index.d.ts +1 -1
- package/dist/blocks/created-by/index.js +1 -1
- package/dist/blocks/custom-fields/index.d.ts +1 -1
- package/dist/blocks/custom-fields/index.js +1 -1
- package/dist/blocks/data-lifecycle/index.d.ts +1 -1
- package/dist/blocks/data-lifecycle/index.js +1 -1
- package/dist/blocks/deals/index.d.ts +1 -1
- package/dist/blocks/deals/index.js +1 -1
- package/dist/blocks/dispatch/index.d.ts +2 -2
- package/dist/blocks/dispatch/index.js +1 -1
- package/dist/blocks/documents/index.d.ts +1 -1
- package/dist/blocks/documents/index.js +1 -1
- package/dist/blocks/domains/index.d.ts +1 -1
- package/dist/blocks/domains/index.js +1 -1
- package/dist/blocks/donations/index.d.ts +1 -1
- package/dist/blocks/donations/index.js +1 -1
- package/dist/blocks/drive/index.d.ts +1 -1
- package/dist/blocks/drive/index.js +2 -2
- package/dist/blocks/employees/index.d.ts +2 -2
- package/dist/blocks/employees/index.js +1 -1
- package/dist/blocks/enrichment/index.d.ts +1 -1
- package/dist/blocks/enrollments/index.d.ts +1 -1
- package/dist/blocks/enrollments/index.js +1 -1
- package/dist/blocks/entitlements/index.d.ts +3 -3
- package/dist/blocks/expenses/index.d.ts +1 -1
- package/dist/blocks/expenses/index.js +1 -1
- package/dist/blocks/field-history/index.d.ts +1 -1
- package/dist/blocks/flags/index.d.ts +1 -1
- package/dist/blocks/flags/index.js +1 -1
- package/dist/blocks/forecasts/index.d.ts +1 -1
- package/dist/blocks/forms/index.d.ts +2 -2
- package/dist/blocks/forms/index.js +1 -1
- package/dist/blocks/goals/index.d.ts +1 -1
- package/dist/blocks/goals/index.js +1 -1
- package/dist/blocks/guests/index.d.ts +1 -1
- package/dist/blocks/hiring/index.d.ts +1 -1
- package/dist/blocks/hiring/index.js +1 -1
- package/dist/blocks/identities/index.d.ts +1 -1
- package/dist/blocks/identities/index.js +1 -1
- package/dist/blocks/imports/index.d.ts +1 -1
- package/dist/blocks/inbox/index.d.ts +5 -5
- package/dist/blocks/inbox/index.js +1 -1
- package/dist/blocks/incidents/index.d.ts +1 -1
- package/dist/blocks/incidents/index.js +1 -1
- package/dist/blocks/index.d.ts +4 -4
- package/dist/blocks/index.js +1 -1
- package/dist/blocks/inventory/index.d.ts +1 -1
- package/dist/blocks/inventory/index.js +1 -1
- package/dist/blocks/invoices/index.d.ts +1 -1
- package/dist/blocks/invoices/index.js +1 -1
- package/dist/blocks/knowledge/index.d.ts +1 -1
- package/dist/blocks/knowledge/index.js +1 -1
- package/dist/blocks/lead-scoring/index.d.ts +2 -2
- package/dist/blocks/lead-scoring/index.js +1 -1
- package/dist/blocks/leases/index.d.ts +1 -1
- package/dist/blocks/leases/index.js +1 -1
- package/dist/blocks/leave/index.d.ts +1 -1
- package/dist/blocks/leave/index.js +1 -1
- package/dist/blocks/ledger/index.d.ts +1 -1
- package/dist/blocks/mail-sync/index.d.ts +2 -2
- package/dist/blocks/mail-sync/index.js +1 -1
- package/dist/blocks/memberships/index.d.ts +3 -3
- package/dist/blocks/memberships/index.js +1 -1
- package/dist/blocks/memory/index.d.ts +1 -1
- package/dist/blocks/memory/index.js +1 -1
- package/dist/blocks/messaging/index.d.ts +5 -5
- package/dist/blocks/messaging/index.js +1 -1
- package/dist/blocks/metrics/index.d.ts +1 -1
- package/dist/blocks/metrics/index.js +1 -1
- package/dist/blocks/mfa/index.d.ts +2 -2
- package/dist/blocks/moderation/index.d.ts +1 -1
- package/dist/blocks/moderation/index.js +1 -1
- package/dist/blocks/notifications/index.d.ts +17 -6
- package/dist/blocks/notifications/index.js +110 -40
- package/dist/blocks/numbering/index.d.ts +1 -1
- package/dist/blocks/numbering/index.js +1 -1
- package/dist/blocks/oauth-server/index.d.ts +1 -1
- package/dist/blocks/oauth-server/index.js +1 -1
- package/dist/blocks/onboarding/index.d.ts +2 -2
- package/dist/blocks/onboarding/index.js +1 -1
- package/dist/blocks/orders/index.d.ts +2 -2
- package/dist/blocks/orders/index.js +1 -1
- package/dist/blocks/organizations/index.d.ts +38 -3
- package/dist/blocks/organizations/index.js +50 -5
- package/dist/blocks/outbox/index.d.ts +1 -1
- package/dist/blocks/outbox/index.js +1 -1
- package/dist/blocks/passes/index.d.ts +2 -2
- package/dist/blocks/passes/index.js +1 -1
- package/dist/blocks/permissions/index.d.ts +4 -4
- package/dist/blocks/permissions/index.js +2 -2
- package/dist/blocks/pipelines/index.d.ts +1 -1
- package/dist/blocks/pipelines/index.js +1 -1
- package/dist/blocks/posts/index.d.ts +2 -2
- package/dist/blocks/posts/index.js +1 -1
- package/dist/blocks/profiles/index.d.ts +1 -1
- package/dist/blocks/profiles/index.js +1 -1
- package/dist/blocks/promotions/index.d.ts +1 -1
- package/dist/blocks/promotions/index.js +1 -1
- package/dist/blocks/push/index.d.ts +76 -10
- package/dist/blocks/push/index.js +172 -43
- package/dist/blocks/queue/index.d.ts +1 -1
- package/dist/blocks/queue/index.js +1 -1
- package/dist/blocks/quotes/index.d.ts +1 -1
- package/dist/blocks/quotes/index.js +1 -1
- package/dist/blocks/rank/index.d.ts +1 -1
- package/dist/blocks/reactions/index.d.ts +4 -4
- package/dist/blocks/reactions/index.js +1 -1
- package/dist/blocks/relations/index.d.ts +1 -1
- package/dist/blocks/relations/index.js +1 -1
- package/dist/blocks/reminders/index.d.ts +1 -1
- package/dist/blocks/reminders/index.js +1 -1
- package/dist/blocks/reviews/index.d.ts +1 -1
- package/dist/blocks/reviews/index.js +1 -1
- package/dist/blocks/saved-views/index.d.ts +2 -2
- package/dist/blocks/saved-views/index.js +1 -1
- package/dist/blocks/scores/index.d.ts +1 -1
- package/dist/blocks/scores/index.js +1 -1
- package/dist/blocks/search/index.d.ts +3 -3
- package/dist/blocks/search/index.js +1 -1
- package/dist/blocks/security-events/index.d.ts +1 -1
- package/dist/blocks/security-events/index.js +1 -1
- package/dist/blocks/segments/index.d.ts +2 -2
- package/dist/blocks/segments/index.js +1 -1
- package/dist/blocks/sequences/index.d.ts +2 -2
- package/dist/blocks/sequences/index.js +1 -1
- package/dist/blocks/service-accounts/index.d.ts +1 -1
- package/dist/blocks/service-accounts/index.js +1 -1
- package/dist/blocks/sessions/index.d.ts +2 -2
- package/dist/blocks/sessions/index.js +1 -1
- package/dist/blocks/settings/index.d.ts +2 -2
- package/dist/blocks/settings/index.js +1 -1
- package/dist/blocks/share-links/index.d.ts +1 -1
- package/dist/blocks/share-links/index.js +1 -1
- package/dist/blocks/shipments/index.d.ts +2 -2
- package/dist/blocks/shipments/index.js +1 -1
- package/dist/blocks/signatures/index.d.ts +2 -2
- package/dist/blocks/signatures/index.js +1 -1
- package/dist/blocks/signing-keys/index.d.ts +1 -1
- package/dist/blocks/signing-keys/index.js +1 -1
- package/dist/blocks/sla/index.d.ts +1 -1
- package/dist/blocks/sla/index.js +1 -1
- package/dist/blocks/sso/index.d.ts +1 -1
- package/dist/blocks/sso/index.js +1 -1
- package/dist/blocks/state-machine/index.d.ts +1 -1
- package/dist/blocks/state-machine/index.js +1 -1
- package/dist/blocks/subjects/index.d.ts +2 -2
- package/dist/blocks/tags/index.d.ts +2 -2
- package/dist/blocks/tags/index.js +1 -1
- package/dist/blocks/tasks/index.d.ts +2 -2
- package/dist/blocks/tasks/index.js +1 -1
- package/dist/blocks/teams/index.d.ts +1 -1
- package/dist/blocks/teams/index.js +1 -1
- package/dist/blocks/templates/index.d.ts +2 -2
- package/dist/blocks/templates/index.js +1 -1
- package/dist/blocks/time-tracking/index.d.ts +1 -1
- package/dist/blocks/time-tracking/index.js +1 -1
- package/dist/blocks/timeline/index.d.ts +1 -1
- package/dist/blocks/trash/index.d.ts +1 -1
- package/dist/blocks/trash/index.js +1 -1
- package/dist/blocks/undo/index.d.ts +2 -2
- package/dist/blocks/updated-at/index.d.ts +1 -1
- package/dist/blocks/updated-at/index.js +1 -1
- package/dist/blocks/usage/index.d.ts +2 -2
- package/dist/blocks/usage/index.js +1 -1
- package/dist/blocks/vercel-marketplace/index.d.ts +1 -1
- package/dist/blocks/vercel-marketplace/index.js +1 -1
- package/dist/blocks/versions/index.d.ts +1 -1
- package/dist/blocks/versions/index.js +1 -1
- package/dist/blocks/waitlist/index.d.ts +1 -1
- package/dist/blocks/waitlist/index.js +1 -1
- package/dist/blocks/webhooks/index.d.ts +1 -1
- package/dist/blocks/webhooks/index.js +1 -1
- package/dist/blocks/workflow-editor/index.d.ts +4 -4
- package/dist/blocks/workflow-editor/index.js +1 -1
- package/dist/blocks/workflows/index.d.ts +4 -4
- package/dist/{channel-BjvGO39m.d.ts → channel-JcMd5lNP.d.ts} +30 -2
- package/dist/cli/{add-DMcrsWjC.js → add-B1S3yK4L.js} +18 -13
- package/dist/cli/add-BQPJnapO.js +1 -0
- package/dist/cli/{add-BinNYhFD.js → add-D7YIXslp.js} +2 -2
- package/dist/cli/{backfill-DxBB62Zr.js → backfill-BwkyNhlC.js} +4 -4
- package/dist/cli/bin.js +1 -1
- package/dist/cli/{blocks-rxOS-Mzz.js → blocks-CBqENu3C.js} +1 -1
- package/dist/cli/{blocks-DSgTifw0.js → blocks-DDm1Zc2S.js} +2 -2
- package/dist/cli/{cache-oU0yHKf0.js → cache-DE2IH1-C.js} +1 -1
- package/dist/cli/{codemod-Dsrv_3gQ.js → codemod-OHKhVV-v.js} +4 -4
- package/dist/cli/{command-CQ61x6gN.js → command-BWEEXmtz.js} +20 -0
- package/dist/cli/{completion-Dlu5AdUW.js → completion-8EDK21xj.js} +1 -1
- package/dist/cli/{completion-BwI0_Ap5.js → completion-BfnKI4QZ.js} +2 -2
- package/dist/cli/{completion-2Y3D_eNu.js → completion-Bt7LMypX.js} +2 -2
- package/dist/cli/{config-2rwFHbwj.js → config-BJSqMi04.js} +17 -5
- package/dist/cli/{config-C6XylzKz.js → config-BlfVh0IP.js} +1 -1
- package/dist/cli/{config-CPux9Wa7.js → config-WKDixoGK.js} +1 -1
- package/dist/cli/{content-mapper-DLbXilBz.js → content-mapper-CaygHH_k.js} +2 -2
- package/dist/cli/{db-Bwrr3GHM.js → db-DYU5hUcd.js} +3 -3
- package/dist/cli/{doctor-CKt5Yyl4.js → doctor-D_nrsd9E.js} +17 -16
- package/dist/cli/{env-BBl5L8Bf.js → env-BCgVZkcb.js} +1 -1
- package/dist/cli/env-xhwXk5Ri.js +1 -0
- package/dist/cli/{gen-CeG6lbka.js → gen-D7gMEwvg.js} +22 -15
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.js +8 -8
- package/dist/cli/{init-DrQlf9RL.js → init-ch-HWJyp.js} +7 -7
- package/dist/cli/{keys-DGEpMbeB.js → keys-CbaL0lnw.js} +1 -1
- package/dist/cli/{live-BvWGM4c3.js → live-B38ePuRS.js} +2 -2
- package/dist/cli/{mcp-BrOnGB15.js → mcp-P9RP2SJ3.js} +3 -3
- package/dist/cli/{metadata-BNSdPuKp.js → metadata-BTihErEc.js} +3 -3
- package/dist/cli/{migration-safety-NtB3dsRU.js → migration-safety-DYo1vVWC.js} +2 -2
- package/dist/cli/{module-migration-mKhX88V_.js → migrations-BoIyGczt.js} +3 -113
- package/dist/cli/module-migration-DXvo0EqU.js +119 -0
- package/dist/cli/{moved-CsfDQcyk.js → moved-DVwgE8lV.js} +1 -1
- package/dist/cli/{parse-B9Iv_-Pf.js → parse-B079x40m.js} +1 -1
- package/dist/cli/powersync-D-0yV_L_.js +283 -0
- package/dist/cli/powersync-DXVsKkAu.js +1 -0
- package/dist/cli/{print-Dh8iuPK3.js → print-CRon4lXf.js} +2 -1
- package/dist/cli/{remove-DfFXVBRr.js → remove-D89s99ha.js} +6 -6
- package/dist/cli/{render-ChIwdIOJ.js → render-BJF9ytUi.js} +8 -5
- package/dist/cli/{run-BXx6D1aR.js → run-DmOTMa44.js} +2 -2
- package/dist/cli/{run-CLSHSVYo.js → run-jeplMBOK.js} +29 -10
- package/dist/cli/{run-D48ZEU58.js → run-x9ZY4Tm0.js} +38 -37
- package/dist/cli/{seed-CG-pA-5N.js → seed-D9mt8bnW.js} +3 -3
- package/dist/cli/seed-EPO6AvLG.js +1 -0
- package/dist/cli/{shared-D0XBFSlz.js → shared-B38Chjgd.js} +1 -1
- package/dist/cli/{skills-toUan_OV.js → skills-FXAVPLzp.js} +1 -1
- package/dist/cli/{snapshot-C6vh_n3t.js → snapshot-BXmU3IXN.js} +3 -3
- package/dist/cli/{source-args-MTLYpifA.js → source-args-DlckPVje.js} +1 -1
- package/dist/cli/{source-BZbEK5if.js → source-irttnsEb.js} +1 -1
- package/dist/cli/{spec-B4LhpI6t.js → spec-CDxfokey.js} +3 -3
- package/dist/cli/{spec-C-dhdKwa.js → spec-DzD5wMVF.js} +1 -1
- package/dist/cli/{sql-layout-26LSoifK.js → sql-layout-D8QrNvt4.js} +2 -2
- package/dist/cli/{stack-CWEHdO0b.js → stack-DgASZP0K.js} +1 -1
- package/dist/cli/{sync-CHGMZCJ5.js → sync-s1iKFIos.js} +3 -2
- package/dist/cli/{upgrade-C0dVsqNX.js → upgrade-B4FPlK-_.js} +4 -3
- package/dist/cli/{upgrade-GB9rqUGT.js → upgrade-CluxP3JJ.js} +3 -3
- package/dist/cli/{version-T507a49w.js → version-TgFM8sOd.js} +1 -1
- package/dist/client/index.d.ts +5 -5
- package/dist/client/native/index.d.ts +4 -4
- package/dist/{composite-B7f1MMgr.d.ts → composite-C-8A8qzi.d.ts} +2 -2
- package/dist/{composite-B3TIjId4.js → composite-D24L5RIY.js} +2 -2
- package/dist/config/index.d.ts +3 -3
- package/dist/config/index.js +4 -4
- package/dist/{config-CIBc79_8.js → config-CD2OGfCG.js} +2 -1
- package/dist/{config-BVNNJwGC.js → config-mbVyJwSc.js} +3 -3
- package/dist/{context-CKCgjEDF.d.ts → context-D24k1Cpc.d.ts} +29 -4
- package/dist/{controller-CJUXhshv.d.ts → controller-BR7CZ1R9.d.ts} +1 -1
- package/dist/{conversion-DgHdDlTK.d.ts → conversion-BgtOfTaS.d.ts} +1 -1
- package/dist/create/index.d.ts +2 -2
- package/dist/create/index.js +5 -5
- package/dist/{define-block-Xxw8Hroe.d.ts → define-block-CJWiDWa5.d.ts} +10 -3
- package/dist/edge/index.d.ts +5 -5
- package/dist/edge/index.js +7 -7
- package/dist/elysia/index.d.ts +1 -1
- package/dist/elysia/index.js +1 -1
- package/dist/{email-tt2QqiSc.d.ts → email-B3YxEzwC.d.ts} +1 -1
- package/dist/{entitlements-B0jmjNLD.d.ts → entitlements-DHcNt1aF.d.ts} +1 -1
- package/dist/{events-SqJLbb8q.js → events-DuLhzjP6.js} +2 -0
- package/dist/expo/index.d.ts +1 -1
- package/dist/expo/index.js +3 -3
- package/dist/{field-errors-DqlebtTE.d.ts → field-errors-DucQdLl7.d.ts} +5 -5
- package/dist/{framework-BozTXRzt.js → framework-CNhTg0th.js} +1 -1
- package/dist/{framework-CF6zFU7a.d.ts → framework-x9Y4uB1q.d.ts} +4 -4
- 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 +4 -4
- package/dist/hono/index.js +7 -6
- package/dist/{index-Dbb7BQdi.d.ts → index-4WT_uRRL.d.ts} +14 -3
- package/dist/{index-BCeTYhFk.d.ts → index-BAcQz5DS.d.ts} +1 -1
- package/dist/{index-lB-8iPmY.d.ts → index-BH3NYExp.d.ts} +2 -2
- package/dist/{index-B8YjrfVl.d.ts → index-C0t-vNIt.d.ts} +1 -1
- package/dist/{index-DUxXdQN_.d.ts → index-C6ruLtyx.d.ts} +2 -2
- package/dist/{index-ClMN0f98.d.ts → index-XAyzdLns.d.ts} +8 -8
- package/dist/{index-BxYOB1Oc.d.ts → index-iRkFvJ7J.d.ts} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{instances-QOzIz9-q.js → instances-DDt7NdVl.js} +1 -1
- package/dist/{kit-DOwKpSkA.d.ts → kit-CVgQCIBO.d.ts} +1 -1
- package/dist/{kit-5l-o8RxL.js → kit-DhlB-vv_.js} +1 -1
- package/dist/mapper/bin.js +7 -6
- package/dist/mcp/index.d.ts +9 -3
- package/dist/mcp/index.js +6 -6
- package/dist/mcp/sdk/index.d.ts +1 -1
- package/dist/mcp/sdk/index.js +2 -2
- package/dist/{methods-B3o7BFOW.js → methods-Cund9ZBe.js} +1 -1
- package/dist/nestjs/index.d.ts +2 -2
- package/dist/nestjs/index.js +1 -1
- package/dist/next/index.d.ts +12 -12
- package/dist/next/index.js +6 -6
- package/dist/node/index.d.ts +2 -2
- package/dist/node/index.js +1 -1
- package/dist/{operations-Dc07aV_H.d.ts → operations-CAjMgNr9.d.ts} +1 -1
- package/dist/{options-CK5WiFwG.js → options-3OYOU56e.js} +1 -1
- package/dist/{options-xD4_FRUq.js → options-56zYYXxc.js} +1 -1
- package/dist/{options-_F-enoBs.d.ts → options-5WvWOkAm.d.ts} +1 -1
- package/dist/{options-SViK_2x2.js → options-62woPFn3.js} +1 -1
- package/dist/{options-1GgseJq5.js → options-7ixoOoap.js} +1 -1
- package/dist/{options-BZsoPJGX.js → options-9dSU5RML.js} +2 -2
- package/dist/{options-y_-AkVCs.d.ts → options-B0YZtAkb.d.ts} +1 -1
- package/dist/{options-HLwOuF2H.js → options-B2Kz_tCx.js} +2 -2
- package/dist/{options-CEMawFrr.js → options-B685YSzQ.js} +1 -1
- package/dist/{options-DWbA9buW.js → options-B692WoK6.js} +2 -2
- package/dist/options-BHU1wc74.js +5 -0
- package/dist/{options-CPK2nQER.js → options-BHy0Z5Zd.js} +2 -2
- package/dist/{options-Fz6xqu-b.js → options-BKDxrPvE.js} +2 -2
- package/dist/{options-BVg58avP.js → options-BLfymS4s.js} +2 -2
- package/dist/{options-CYV4iZiQ.js → options-BOCRbzh3.js} +1 -1
- package/dist/{options-tSsUF0-7.js → options-BQWJqwHO.js} +1 -1
- package/dist/{options-Cl9Ag2Pt.js → options-BQunK6_Y.js} +2 -2
- package/dist/{options-CljDnQt2.js → options-BQyrZjwM.js} +4 -1
- package/dist/options-BR9xTHZW.js +5 -0
- package/dist/{options-D40CQzji.js → options-BRUdd5jY.js} +1 -1
- package/dist/{options-CsGl5BLH.d.ts → options-BTmaRzx2.d.ts} +13 -5
- package/dist/{options-Li1Dyu88.d.ts → options-BUCQYAeJ.d.ts} +2 -2
- package/dist/{options-B5BU2Yg7.js → options-BawzwlmC.js} +2 -2
- package/dist/{options-BlzSfWxC.d.ts → options-BbLDAp7G.d.ts} +2 -2
- package/dist/{options-DTDxFT6J.js → options-Bc4xz5jQ.js} +2 -2
- package/dist/options-BfFC4iFE.js +8 -0
- package/dist/{options-Br1Xi2Hw.js → options-BfPsL7E2.js} +1 -1
- package/dist/{options-DYBQ973I.js → options-Bfmwwc78.js} +1 -1
- package/dist/{options-c5WCsky5.js → options-BhsdveDk.js} +2 -2
- package/dist/{options-B5woz53h.js → options-BomoTH-8.js} +2 -2
- package/dist/{options-DeNejBtq.js → options-BtjkzIVh.js} +1 -1
- package/dist/options-Bvi9bl4H.js +5 -0
- package/dist/{options-IHPg8ZoA.js → options-BwKNmaJo.js} +2 -2
- package/dist/{options-CtUUU71w.js → options-BxpLtyk-.js} +4 -6
- package/dist/{options-D_bBVCXg.js → options-BzB2QxL3.js} +1 -1
- package/dist/{options-CmraJhd9.js → options-C078wBP0.js} +1 -1
- package/dist/options-C1-pwEqm.js +5 -0
- package/dist/{options-BZOliZvb.js → options-C3AdsFJ6.js} +2 -2
- package/dist/options-C7C5OhmL.d.ts +8 -0
- package/dist/{options-CCUaRLgd.js → options-C87u6eSa.js} +1 -1
- package/dist/{options-CVSWgZpY.js → options-CBAEGxwS.js} +1 -1
- package/dist/{options-9gvPo1BC.js → options-CDUr8zzX.js} +1 -1
- package/dist/{options-DMR68VAC.js → options-CFjGxfa8.js} +2 -2
- package/dist/{options-Bf96aVk5.js → options-CI6P0xhV.js} +1 -1
- package/dist/{options-B5VUf4IT.js → options-CJFMK9A_.js} +1 -1
- package/dist/{options-CRz8Ht_4.js → options-CLpgx7en.js} +3 -2
- package/dist/{options-BesyRBnM.js → options-CTXHj9zr.js} +2 -2
- package/dist/{options-D2d1fFuw.js → options-CTl8T88w.js} +1 -1
- package/dist/{options-C3RgtOLo.js → options-CTv-xmbA.js} +2 -2
- package/dist/{options-Bpl-WFPk.js → options-CUIOOv4z.js} +1 -1
- package/dist/{options-o2kfYU2x.js → options-CZDmtsbV.js} +2 -2
- package/dist/{options-CF7nRWXS.js → options-CZTscdPB.js} +1 -1
- package/dist/{options-BlncUmIc.js → options-CZdKndeo.js} +2 -2
- package/dist/{options-DplE18Ko.d.ts → options-C_7g9TTq.d.ts} +1 -1
- package/dist/{options-C_pb1Nd3.js → options-Cb2FOFj5.js} +1 -1
- package/dist/{options-t_O5ldT6.js → options-CbOstLa7.js} +2 -2
- package/dist/{options-Bt0bYMLl.js → options-CcXgWlvm.js} +2 -2
- package/dist/{options-BMjcVuaI.js → options-CfVPctAw.js} +7 -0
- package/dist/{options-DWpz3V3F.js → options-ChiL-4ZS.js} +2 -2
- package/dist/{options-E7KcmHQv.js → options-Cjgaf8ub.js} +2 -2
- package/dist/{options-DrSkIBCD.js → options-CoSPgWKy.js} +1 -1
- package/dist/{options-Bp7sgKvl.js → options-CpZ2HlSU.js} +5 -3
- package/dist/{options-CN7PHkhU.js → options-CsSe8Nba.js} +1 -1
- package/dist/{options-B9q8CROT.js → options-CsvJR-r2.js} +1 -1
- package/dist/{options-oeAq4Ho5.js → options-Cucv6sWP.js} +2 -2
- package/dist/{options-BOOEzor9.js → options-CyjL9lTf.js} +2 -2
- package/dist/{options-pOVWwbAK.d.ts → options-D-OOO9V2.d.ts} +1 -1
- package/dist/{options-nFzfgtA6.js → options-D0Y6ZMe8.js} +1 -1
- package/dist/{options-BnZS7IK-.js → options-D0sj5abR.js} +2 -2
- package/dist/{options-0qvUckqt.js → options-D2s7fT1s.js} +2 -2
- package/dist/{options-BjtrC7o6.js → options-D32-YxnO.js} +1 -1
- package/dist/{options-B0EJULm5.js → options-D610Fa6T.js} +2 -2
- package/dist/{options-BvtnxHfK.js → options-D96dScev.js} +1 -1
- package/dist/{options-DgQo80Xh.js → options-DFpyP1bg.js} +2 -2
- package/dist/{options-BYOtaF7w.js → options-DJEcS4DX.js} +1 -1
- package/dist/{options-DPgdAXO5.js → options-DJbN3bi9.js} +2 -2
- package/dist/{options-EsUh744F.js → options-DKoQoRCy.js} +2 -2
- package/dist/{options-CvD9vNvx.js → options-DM1qaMMQ.js} +1 -1
- package/dist/{options-eBPsk4WI.js → options-DNgSwhsm.js} +2 -2
- package/dist/{options-2EMA_x6_.js → options-DOIwzRXL.js} +2 -2
- package/dist/{options-D6as77gU.d.ts → options-DRIgHh4O.d.ts} +2 -2
- package/dist/{options-DDzggjN7.js → options-DRrZmJyI.js} +2 -2
- package/dist/{options-DJ-aYPVN.js → options-DUMUsvml.js} +2 -2
- package/dist/{options-Cp0HyUEk.js → options-DWwL5Kaz.js} +1 -1
- package/dist/{options-BCrqe3HH.js → options-DZHZYlpD.js} +1 -1
- package/dist/{options-BQIYfx9F.js → options-DZLkeqWn.js} +2 -2
- package/dist/{options-RKYdmIdV.js → options-DZRpXKQE.js} +1 -1
- package/dist/{options-D0G06Zm9.js → options-D_9Vxx7f.js} +2 -2
- package/dist/{options-BMGClqoa.js → options-DcHl59RC.js} +1 -1
- package/dist/{options-CW9wTqOk.js → options-Dcaql09y.js} +1 -1
- package/dist/{options-CXFz0xxS.js → options-DcnBNYmV.js} +1 -1
- package/dist/{options-21s0dpnX.js → options-DdpM-fiP.js} +2 -2
- package/dist/{options-BbnPv6p7.js → options-DhdazgTZ.js} +2 -2
- package/dist/{options-C239TLRF.js → options-Dpy-Ruo-.js} +1 -1
- package/dist/{options-DWVYM8P0.d.ts → options-DsVuVRH3.d.ts} +1 -1
- package/dist/{options-BlOPivzq.js → options-DtAJxfHS.js} +1 -1
- package/dist/{options-DXnBN2E7.js → options-Dz9Yo52Z.js} +2 -2
- package/dist/{options-DcOx8_3X.d.ts → options-HnfETSHr.d.ts} +1 -1
- package/dist/{options-CoX6VKGb.js → options-LqUXTpML.js} +1 -1
- package/dist/options-MsloEAIB.js +5 -0
- package/dist/{options-DCduTMST.js → options-P2FxqYpd.js} +2 -2
- package/dist/options-_1gAIMq7.d.ts +60 -0
- package/dist/{options-B0FcEKtH.js → options-aT89JqlB.js} +1 -1
- package/dist/{options-Cyu0hgmN.js → options-cVKZu9b0.js} +2 -2
- package/dist/options-fMxhtuVR.js +5 -0
- package/dist/{options-BxcFLL1G.js → options-fkShrmGQ.js} +2 -2
- package/dist/{options-Ctac2R0Q.js → options-gUvfr3no.js} +2 -2
- package/dist/{options-DNKyN5uq.js → options-hynwKWuf.js} +2 -2
- package/dist/{options-CkScQRJR.js → options-lsxJYfYx.js} +2 -2
- package/dist/{options-CyAhRKKm.d.ts → options-o5wCw8H7.d.ts} +2 -2
- package/dist/{options-DARkpk2P.js → options-p49DFg3H.js} +2 -2
- package/dist/{options-zkyhM3qi.js → options-pYNpXKcg.js} +1 -1
- package/dist/{options-Cqq2jUww.js → options-qtETCHzW.js} +2 -2
- package/dist/options-rnKlqYEr.js +5 -0
- package/dist/{options-KV84gAxl.js → options-sU_zGkiV.js} +2 -2
- package/dist/{options-BfLmA375.js → options-xq4MXG1M.js} +2 -2
- package/dist/{options-BA6jV6py.js → options-zzlznRA7.js} +2 -2
- package/dist/orpc/index.d.ts +19 -8
- package/dist/orpc/index.js +60 -31
- package/dist/otel/index.d.ts +1 -1
- package/dist/otel/index.js +5 -5
- package/dist/{ports-DnpAuTvB.d.ts → ports-g0H1Kzwr.d.ts} +1 -1
- package/dist/powersync/index.d.ts +135 -2
- package/dist/powersync/index.js +333 -1
- package/dist/preset/index.d.ts +3 -3
- package/dist/preset/index.js +3 -3
- package/dist/{preset-BIANzB5p.js → preset-B3CukUhu.js} +4 -4
- package/dist/{push-token-C_mFkYfq.d.ts → push-token-Cl2EihRc.d.ts} +1 -1
- package/dist/query/index.d.ts +1 -1
- package/dist/react/index.d.ts +5 -5
- package/dist/react/native/index.d.ts +1 -1
- package/dist/react/server.d.ts +5 -5
- package/dist/react-router/index.d.ts +3 -3
- package/dist/react-router/index.js +5 -5
- package/dist/realtime/index.d.ts +3 -3
- package/dist/realtime/index.js +1 -1
- package/dist/{record-form-xWvVcb86.d.ts → record-form-zMwz0Ayt.d.ts} +1 -1
- package/dist/records/index.d.ts +7 -7
- package/dist/{refusal-ByBZcm0V.js → refusal-D48CMqpQ.js} +2 -2
- package/dist/{refusal-CSntB_x8.d.ts → refusal-OrlI3g4H.d.ts} +1 -1
- package/dist/{resource-DV2GC2dB.js → resource-R3KToNze.js} +1 -1
- package/dist/{resource-execute-DqWfEc56.d.ts → resource-execute-CKBtGL8-.d.ts} +1 -1
- package/dist/{resource-types-BIoz_ElD.d.ts → resource-types-8Q5Klkpa.d.ts} +1 -1
- package/dist/{resources-C02l_YBJ.js → resources-DqIwoQsP.js} +1 -1
- package/dist/{resources-Bt2PDKE7.d.ts → resources-DxpqenZA.d.ts} +1 -1
- package/dist/{respond-C3CcOZlA.js → respond-3RKp6VgU.js} +8 -1
- package/dist/{respond-Dn1_YhC1.d.ts → respond-oZeJ342J.d.ts} +6 -0
- package/dist/server/index.d.ts +6 -6
- package/dist/server/index.js +6 -6
- package/dist/{session-C1OuXbtN.d.ts → session-Fcft5A39.d.ts} +1 -1
- package/dist/{sign-in-B64114O4.js → sign-in-BLkRU3lc.js} +1 -1
- package/dist/solid/index.d.ts +5 -5
- package/dist/solid-start/index.d.ts +3 -3
- package/dist/solid-start/index.js +5 -5
- package/dist/spec/index.d.ts +2 -2
- package/dist/spec/index.js +1 -1
- package/dist/{spec-pins-DIx95afw.d.ts → spec-pins-BZkKfwY8.d.ts} +2 -0
- package/dist/{spec-pins-C1Vm8OBl.js → spec-pins-D3zDek-u.js} +1 -0
- package/dist/sql/index.d.ts +5 -5
- package/dist/sql/index.js +5 -5
- package/dist/{sql-ClTmzHs8.js → sql-fHTjZGqR.js} +2608 -1415
- package/dist/sql-type-iUSZpaUu.js +34 -0
- package/dist/ssr/index.d.ts +1 -1
- package/dist/{statuses-DMMDwXpZ.js → statuses-Alll5Ip6.js} +2 -2
- package/dist/storage/index.js +1 -1
- package/dist/svelte/index.d.ts +5 -5
- package/dist/sveltekit/index.d.ts +3 -3
- package/dist/sveltekit/index.js +5 -5
- package/dist/tanstack-start/index.d.ts +3 -3
- package/dist/tanstack-start/index.js +5 -5
- package/dist/{tenant-DVvjw9H-.d.ts → tenant-DyoVYFfC.d.ts} +1 -1
- package/dist/testing/index.d.ts +7 -7
- package/dist/testing/index.js +6 -3
- package/dist/{timeline-BBfKuMVL.d.ts → timeline-CMmo0R7g.d.ts} +2 -2
- package/dist/{topic-ikV_pLTX.js → topic-J9I3yu6f.js} +1 -1
- package/dist/{topic-BtLz-qTI.d.ts → topic-nQYxoTaU.d.ts} +1 -1
- package/dist/vue/index.d.ts +5 -5
- package/dist/{watch-topic-tnfOTa3-.d.ts → watch-topic-UGSEWAqR.d.ts} +1 -1
- package/dist/workflow-sdk/world/index.js +1 -1
- package/dist/{workflow-sdk-Bw6_u0ar.js → workflow-sdk-DELaQEp3.js} +2 -0
- package/dist/yjs/index.d.ts +1 -1
- package/dist/yjs/index.js +1 -1
- package/package.json +1 -1
- package/schemas/config-v1.json +449 -69
- package/dist/cli/add-z-3pXI6C.js +0 -1
- package/dist/cli/env-CAU1nknN.js +0 -1
- package/dist/cli/seed-CUxW5Dks.js +0 -1
- package/dist/options-63AKQNv0.js +0 -5
- package/dist/options-B-cxGmRA.js +0 -5
- package/dist/options-BPDiwSa-.js +0 -5
- package/dist/options-C6rEL6U5.js +0 -8
- package/dist/options-CE93HOYi.d.ts +0 -7
- package/dist/options-CTZNpb2n.js +0 -5
- package/dist/options-CrC78Tee.js +0 -5
- package/dist/options-DINdgVih.d.ts +0 -9
- package/dist/options-DWML05Cp.js +0 -5
- package/dist/options-Q1Bzgqpr.js +0 -5
package/dist/orpc/index.d.ts
CHANGED
|
@@ -4,12 +4,12 @@ import { r as AuthState } from "../resolve-CXX6DHv3.js";
|
|
|
4
4
|
import { i as ProblemDetails } from "../problem-DNwN8iGz.js";
|
|
5
5
|
import { t as BetterSupabase } from "../define-Cgru0_kF.js";
|
|
6
6
|
import { a as ServerContext, c as ServerOptions, n as BetterServer } from "../server-types-gR4Q1aM0.js";
|
|
7
|
-
import { i as MiddlewareOptions, r as GuardOptions } from "../respond-
|
|
8
|
-
import { c as ResourceLoaderContext, i as AuthorizeOptions } from "../kit-
|
|
7
|
+
import { i as MiddlewareOptions, r as GuardOptions } from "../respond-oZeJ342J.js";
|
|
8
|
+
import { c as ResourceLoaderContext, i as AuthorizeOptions } from "../kit-CVgQCIBO.js";
|
|
9
9
|
import { t as Validated } from "../shared-CRRfQAKG.js";
|
|
10
|
-
import { a as ResourceHandler } from "../resource-types-
|
|
10
|
+
import { a as ResourceHandler } from "../resource-types-8Q5Klkpa.js";
|
|
11
11
|
import { i as RouteRateLimitRule, n as RateLimitVerdict, r as RateLimiter, t as RateLimitRouteOptions } from "../rate-limit-Bztf32cl.js";
|
|
12
|
-
import { t as Api } from "../api-
|
|
12
|
+
import { t as Api } from "../api-B6zteBya.js";
|
|
13
13
|
import { AnyEntry, Contributions } from "@supabase/middleware";
|
|
14
14
|
import { AnySchema, BuilderWithMiddlewares, DecoratedMiddleware, DecoratedProcedure, MetaPlugin, ORPCError, Schema } from "@orpc/server";
|
|
15
15
|
//#region src/orpc/router.d.ts
|
|
@@ -88,10 +88,17 @@ export declare function toOrpc<const Entries extends readonly AnyEntry[]>(entrie
|
|
|
88
88
|
} & Contributions<Entries>>, options?: ToOrpcOptions): (request: Request, env?: unknown) => Promise<Response>;
|
|
89
89
|
//#endregion
|
|
90
90
|
//#region src/orpc/index.d.ts
|
|
91
|
-
/**
|
|
92
|
-
|
|
91
|
+
/**
|
|
92
|
+
* Initial context: pass `{ context: { request } }` to the oRPC handler, or `{
|
|
93
|
+
* context: { headers } }` from an adapter that has no `Request` (the Node
|
|
94
|
+
* handler, a WebSocket peer). `url` defaults to `http://localhost/`.
|
|
95
|
+
*/
|
|
96
|
+
export type OrpcRequestContext = {
|
|
93
97
|
readonly request: Request;
|
|
94
|
-
}
|
|
98
|
+
} | {
|
|
99
|
+
readonly headers: Headers;
|
|
100
|
+
readonly url?: string;
|
|
101
|
+
};
|
|
95
102
|
/** What `middleware()` adds to `context`. */
|
|
96
103
|
export interface OrpcContext<M extends AnyModels, F extends AnyFunctions, E, C = unknown, P = unknown, B = unknown> {
|
|
97
104
|
readonly bsb: ServerContext<M, F, E, C, P, B>;
|
|
@@ -125,10 +132,14 @@ export interface OrpcFetchOptions {
|
|
|
125
132
|
readonly prefix?: `/${string}`;
|
|
126
133
|
}
|
|
127
134
|
export type OrpcMiddleware<M extends AnyModels, F extends AnyFunctions, E, C = unknown, P = unknown, B = unknown> = DecoratedMiddleware<OrpcRequestContext, OrpcContext<M, F, E, C, P, B>, unknown, any, Record<never, never>>;
|
|
128
|
-
/**
|
|
135
|
+
/**
|
|
136
|
+
* What a `rateLimit()` key function reads: the procedure's context, its path
|
|
137
|
+
* and the request (built from `context.headers` when the context has none).
|
|
138
|
+
*/
|
|
129
139
|
export interface OrpcRateLimitInput<TContext extends OrpcRequestContext> {
|
|
130
140
|
readonly context: TContext;
|
|
131
141
|
readonly path: readonly string[];
|
|
142
|
+
readonly request: Request;
|
|
132
143
|
}
|
|
133
144
|
/** The middleware `rateLimit()` returns; it adds nothing to `context`. */
|
|
134
145
|
export type OrpcRateLimitMiddleware<TContext extends OrpcRequestContext> = DecoratedMiddleware<TContext, Record<never, never>, unknown, any, Record<never, never>>;
|
package/dist/orpc/index.js
CHANGED
|
@@ -6,13 +6,13 @@ import { c as toProblem } from "../problem-Bf0cJ7tk.js";
|
|
|
6
6
|
import { i as claimsOf } from "../claims-Bp9My7XP.js";
|
|
7
7
|
import { t as callWithInput } from "../block-method-C9hWdHom.js";
|
|
8
8
|
import { t as tenantOf } from "../tenant-BgIiMQpo.js";
|
|
9
|
-
import { c as extendServer, n as flushEvents, s as createServer, x as refreshFor } from "../adapter-
|
|
9
|
+
import { c as extendServer, n as flushEvents, s as createServer, x as refreshFor } from "../adapter-CfuBICuG.js";
|
|
10
10
|
import { r as checkPermission } from "../authorizer-BGhXaDmo.js";
|
|
11
11
|
import { n as toSession } from "../view-C8Ve14ja.js";
|
|
12
|
-
import {
|
|
12
|
+
import { i as guard, n as defaultExpose, s as settle, t as assertCookieRefresh } from "../respond-3RKp6VgU.js";
|
|
13
13
|
import { t as TABLE_VERBS } from "../resource-DvgXqZB_.js";
|
|
14
|
-
import { r as contextOf, t as defineResource } from "../resource-
|
|
15
|
-
import { t as authorizeCaller } from "../kit-
|
|
14
|
+
import { r as contextOf, t as defineResource } from "../resource-R3KToNze.js";
|
|
15
|
+
import { t as authorizeCaller } from "../kit-DhlB-vv_.js";
|
|
16
16
|
import { t as rateLimitGate } from "../rate-limit-BWKGlhTM.js";
|
|
17
17
|
import { bufferRequest, pipeline, seedContext } from "@supabase/middleware";
|
|
18
18
|
import { COMMON_ERROR_STATUS_MAP, ORPCError, os } from "@orpc/server";
|
|
@@ -194,6 +194,22 @@ function withHeaders(response, headers) {
|
|
|
194
194
|
for (const [name, value] of headers) copy.headers.set(name, value);
|
|
195
195
|
return copy;
|
|
196
196
|
}
|
|
197
|
+
const built = /* @__PURE__ */ new WeakMap();
|
|
198
|
+
/**
|
|
199
|
+
* A `Request` carrying `headers`, built once per `Headers` object so nested
|
|
200
|
+
* middleware share the per-request cache.
|
|
201
|
+
*/
|
|
202
|
+
function requestFromHeaders(headers, url = "http://localhost/") {
|
|
203
|
+
const known = built.get(headers);
|
|
204
|
+
if (known) return known;
|
|
205
|
+
const request = new Request(url, { headers });
|
|
206
|
+
built.set(headers, request);
|
|
207
|
+
return request;
|
|
208
|
+
}
|
|
209
|
+
/** The context's request, built from its headers when it has none. */
|
|
210
|
+
function requestOf(context) {
|
|
211
|
+
return "request" in context ? context.request : requestFromHeaders(context.headers, context.url);
|
|
212
|
+
}
|
|
197
213
|
/** ORPC integration: middleware adding the caller's repositories to `context`. */
|
|
198
214
|
function createOrpc(betterSupabase, options = {}) {
|
|
199
215
|
const server = createServer(betterSupabase, options);
|
|
@@ -208,44 +224,57 @@ function createOrpc(betterSupabase, options = {}) {
|
|
|
208
224
|
data: problem
|
|
209
225
|
});
|
|
210
226
|
};
|
|
211
|
-
const middleware = (middlewareOptions = {}) =>
|
|
212
|
-
|
|
213
|
-
const
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
227
|
+
const middleware = (middlewareOptions = {}) => {
|
|
228
|
+
assertCookieRefresh(middlewareOptions);
|
|
229
|
+
const cookies = middlewareOptions.cookies;
|
|
230
|
+
return os.$context().middleware(async ({ context, next }, input) => {
|
|
231
|
+
const request = requestOf(context);
|
|
232
|
+
const refresh = refreshFor(middlewareOptions.refresh, request) ?? false;
|
|
233
|
+
const readsCookies = cookies !== false;
|
|
234
|
+
const known = contexts.get(request);
|
|
235
|
+
const reuse = known?.cookies === readsCookies && (known.refresh || !refresh);
|
|
236
|
+
const ctx = reuse ? known.ctx : await server.context(request, {
|
|
237
|
+
refresh,
|
|
238
|
+
cookies: readsCookies
|
|
239
|
+
});
|
|
240
|
+
contexts.set(request, {
|
|
241
|
+
ctx,
|
|
242
|
+
refresh: reuse ? known.refresh || refresh : refresh,
|
|
243
|
+
cookies: readsCookies
|
|
244
|
+
});
|
|
245
|
+
const denied = guard(ctx.auth, middlewareOptions.allow, middlewareOptions.aal, middlewareOptions.scopes);
|
|
246
|
+
if (denied) throw toOrpcError(denied);
|
|
247
|
+
const caller = await authorizeCaller(ctx.auth, middlewareOptions, input, tenantOf(toSession(ctx.auth), tenantClaim), options.authorizer, ctx);
|
|
248
|
+
if ("kind" in caller) throw toOrpcError(caller);
|
|
249
|
+
try {
|
|
250
|
+
return await next({ context: {
|
|
251
|
+
bsb: ctx,
|
|
252
|
+
db: ctx.db,
|
|
253
|
+
auth: ctx.auth
|
|
254
|
+
} });
|
|
255
|
+
} catch (cause) {
|
|
256
|
+
const thrown = dbErrorOf(cause);
|
|
257
|
+
if (thrown) throw toOrpcError(thrown);
|
|
258
|
+
throw cause;
|
|
259
|
+
}
|
|
218
260
|
});
|
|
219
|
-
|
|
220
|
-
if (denied) throw toOrpcError(denied);
|
|
221
|
-
const caller = await authorizeCaller(ctx.auth, middlewareOptions, input, tenantOf(toSession(ctx.auth), tenantClaim), options.authorizer, ctx);
|
|
222
|
-
if ("kind" in caller) throw toOrpcError(caller);
|
|
223
|
-
try {
|
|
224
|
-
return await next({ context: {
|
|
225
|
-
bsb: ctx,
|
|
226
|
-
db: ctx.db,
|
|
227
|
-
auth: ctx.auth
|
|
228
|
-
} });
|
|
229
|
-
} catch (cause) {
|
|
230
|
-
const thrown = dbErrorOf(cause);
|
|
231
|
-
if (thrown) throw toOrpcError(thrown);
|
|
232
|
-
throw cause;
|
|
233
|
-
}
|
|
234
|
-
});
|
|
261
|
+
};
|
|
235
262
|
return extendServer(server, {
|
|
236
263
|
toOrpcError,
|
|
237
264
|
middleware,
|
|
238
265
|
rateLimit(rateLimitOptions) {
|
|
239
266
|
const gate = rateLimitGate(rateLimitOptions);
|
|
240
267
|
return os.$context().middleware(async ({ context, path, next }) => {
|
|
268
|
+
const request = requestOf(context);
|
|
241
269
|
const outcome = await gate({
|
|
242
270
|
context,
|
|
243
|
-
path
|
|
271
|
+
path,
|
|
272
|
+
request
|
|
244
273
|
});
|
|
245
274
|
if (outcome.kind === "skip") return next();
|
|
246
|
-
const kept = limits.get(
|
|
275
|
+
const kept = limits.get(request) ?? new Headers();
|
|
247
276
|
for (const [name, value] of outcome.headers) kept.set(name, value);
|
|
248
|
-
limits.set(
|
|
277
|
+
limits.set(request, kept);
|
|
249
278
|
if (outcome.kind === "deny") throw toOrpcError(outcome.error);
|
|
250
279
|
return next();
|
|
251
280
|
});
|
|
@@ -285,7 +314,7 @@ function createOrpc(betterSupabase, options = {}) {
|
|
|
285
314
|
const settled = await settle(() => run({
|
|
286
315
|
input,
|
|
287
316
|
db: context.db,
|
|
288
|
-
request: context
|
|
317
|
+
request: requestOf(context)
|
|
289
318
|
}));
|
|
290
319
|
if (!settled.ok) throw toOrpcError(settled.error);
|
|
291
320
|
return settled.data;
|
package/dist/otel/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Mt as Plugin } from "../types-DFdg_4yN.js";
|
|
2
2
|
import { o as EventHub } from "../events-vcqenSYU.js";
|
|
3
|
-
import { t as SPEC_PINS } from "../spec-pins-
|
|
3
|
+
import { t as SPEC_PINS } from "../spec-pins-BZkKfwY8.js";
|
|
4
4
|
import { Attributes, Meter, Tracer } from "@opentelemetry/api";
|
|
5
5
|
//#region src/otel/index.d.ts
|
|
6
6
|
export declare const INSTRUMENTATION_NAME = "better-supabase";
|
package/dist/otel/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as definePlugin } from "../plugin-AKwwe2gF.js";
|
|
2
|
-
import { t as SPEC_PINS } from "../spec-pins-
|
|
2
|
+
import { t as SPEC_PINS } from "../spec-pins-D3zDek-u.js";
|
|
3
3
|
import { i as blockEventAttributes } from "../block-events-pBXPzwnW.js";
|
|
4
4
|
import { SpanKind, SpanStatusCode, context, metrics, propagation, trace } from "@opentelemetry/api";
|
|
5
5
|
//#endregion
|
|
@@ -40,9 +40,9 @@ function systemOf(executor) {
|
|
|
40
40
|
* ```
|
|
41
41
|
*/
|
|
42
42
|
function otel(options = {}) {
|
|
43
|
-
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.
|
|
43
|
+
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.18.0");
|
|
44
44
|
let histogram;
|
|
45
|
-
if (options.metrics !== false) histogram = (options.meter ?? metrics.getMeter("better-supabase", "0.
|
|
45
|
+
if (options.metrics !== false) histogram = (options.meter ?? metrics.getMeter("better-supabase", "0.18.0")).createHistogram("db.client.operation.duration", {
|
|
46
46
|
unit: "s",
|
|
47
47
|
description: "Duration of database client operations.",
|
|
48
48
|
advice: { explicitBucketBoundaries: [
|
|
@@ -219,7 +219,7 @@ function otel(options = {}) {
|
|
|
219
219
|
* `betterSupabase.events`. Returns a function that stops listening.
|
|
220
220
|
*/
|
|
221
221
|
function traceAuth(betterSupabase, options = {}) {
|
|
222
|
-
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.
|
|
222
|
+
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.18.0");
|
|
223
223
|
const offAuth = betterSupabase.events.on("auth", (event) => {
|
|
224
224
|
const span = tracer.startSpan("auth.resolve", {
|
|
225
225
|
kind: SpanKind.INTERNAL,
|
|
@@ -257,7 +257,7 @@ function traceAuth(betterSupabase, options = {}) {
|
|
|
257
257
|
* an error status. Returns a function that stops listening.
|
|
258
258
|
*/
|
|
259
259
|
function traceBlockEvents(betterSupabase, options = {}) {
|
|
260
|
-
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.
|
|
260
|
+
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.18.0");
|
|
261
261
|
return betterSupabase.events.on("block", (event) => {
|
|
262
262
|
const attributes = {
|
|
263
263
|
...options.attributes,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as AsyncResult } from "./result-DZeA5KS6.js";
|
|
2
|
-
import { n as TopicPort } from "./watch-topic-
|
|
2
|
+
import { n as TopicPort } from "./watch-topic-UGSEWAqR.js";
|
|
3
3
|
import { SupabaseClient } from "@supabase/supabase-js";
|
|
4
4
|
//#region src/client/ports.d.ts
|
|
5
5
|
/**
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { f as Result } from "../result-DZeA5KS6.js";
|
|
1
2
|
import { Bt as Executor } from "../types-DFdg_4yN.js";
|
|
3
|
+
import { t as BlockTransport } from "../block-transport-DWZSJrwN.js";
|
|
2
4
|
import { C as UploadRouteOptions, E as uploadRoute, S as UploadRoute, T as uploadOutcome, _ as UploadConnectorOptions, b as UploadOutcome, c as LocalTablesOption, d as CreateUploadRepository, f as CrudEntryLike, g as UploadConnector, h as RejectedStore, m as RejectedChange, n as DataEngine, p as CrudQueueLike, s as LiveEngineOptions, v as UploadErrorContext, w as createUploadConnector, x as UploadRepository, y as UploadFunction } from "../data-engine-BWoz9lED.js";
|
|
3
|
-
import {
|
|
5
|
+
import { n as TopicPort } from "../watch-topic-UGSEWAqR.js";
|
|
6
|
+
import { t as AuthSnapshot } from "../bind-pu5TLrla.js";
|
|
4
7
|
import { C as quoteSqliteIdent, S as likeToGlob, _ as SqliteQuery, a as postgrestTimestamp, b as SqliteValue, c as sqliteCompiler, d as SqliteDecode, f as SqliteInsertPlan, g as SqlitePlan, h as SqliteNested, i as fromSqliteError, l as SqliteColumn, m as SqliteKeys, n as SqliteDatabaseLike, o as CheckSqliteOptions, p as SqliteKeyedPlan, r as SqliteExecutorOptions, s as checkSqlite, t as SqliteContextLike, u as SqliteCompilerOptions, v as SqliteReturning, w as sqliteValue, x as compileSqlite, y as SqliteSelectPlan } from "../executor-BWFfz0ik.js";
|
|
5
8
|
//#region src/powersync/sync.d.ts
|
|
6
9
|
/** The part of PowerSync's `SyncStatus` the engine reads. */
|
|
@@ -138,4 +141,134 @@ interface SyncWithAuthOptions<C> {
|
|
|
138
141
|
*/
|
|
139
142
|
export declare function syncWithAuth<C>(db: SyncedDatabaseLike<C>, auth: AuthSourceLike, options: SyncWithAuthOptions<C>): () => void;
|
|
140
143
|
//#endregion
|
|
141
|
-
|
|
144
|
+
//#region src/powersync/attachments.d.ts
|
|
145
|
+
interface AttachmentQueueRouteOptions {
|
|
146
|
+
/**
|
|
147
|
+
* `blocks.attachments.options.path`, for `path()`. Default
|
|
148
|
+
* `{organization_id}/attachments/{id}`.
|
|
149
|
+
*/
|
|
150
|
+
readonly path?: string;
|
|
151
|
+
/** `blocks.attachments.options.extraColumns` a `PUT` sends too. */
|
|
152
|
+
readonly extraColumns?: readonly string[];
|
|
153
|
+
}
|
|
154
|
+
/** The attachment columns `path()` reads, as PowerSync syncs them. */
|
|
155
|
+
interface AttachmentPathRow {
|
|
156
|
+
readonly id: string;
|
|
157
|
+
readonly organization_id?: string | null;
|
|
158
|
+
readonly subject_type?: string | null;
|
|
159
|
+
readonly subject_id?: string | null;
|
|
160
|
+
readonly name?: string | null;
|
|
161
|
+
readonly version?: number | null;
|
|
162
|
+
}
|
|
163
|
+
/** An upload route for the attachments table, with the object path builder. */
|
|
164
|
+
interface AttachmentQueueRoute extends UploadFunction {
|
|
165
|
+
/**
|
|
166
|
+
* The object path of the row's current version, the same as the database's
|
|
167
|
+
* `object_path`: give it to PowerSync's `AttachmentQueue` as the file's
|
|
168
|
+
* storage path.
|
|
169
|
+
*/
|
|
170
|
+
path(row: AttachmentPathRow): string;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Replays the attachments table for `createUploadConnector`, with
|
|
174
|
+
* `blocks.attachments.options.offline` on: a `PUT` inserts the record under the
|
|
175
|
+
* id the client chose, counting a `conflict` as applied, and a `DELETE` removes
|
|
176
|
+
* the record first, which queues its files for deletion. A `PATCH` fails with
|
|
177
|
+
* `unsupported`. Upload the file to `route.path(row)`; the storage trigger
|
|
178
|
+
* marks the record uploaded.
|
|
179
|
+
*
|
|
180
|
+
* ```ts
|
|
181
|
+
* const attachments = attachmentQueueRoute(server.db.attachments);
|
|
182
|
+
* tables: { attachments },
|
|
183
|
+
* ```
|
|
184
|
+
*/
|
|
185
|
+
export declare function attachmentQueueRoute(repository: CreateUploadRepository<never, never>, options?: AttachmentQueueRouteOptions): AttachmentQueueRoute;
|
|
186
|
+
//#endregion
|
|
187
|
+
//#region src/powersync/notifications.d.ts
|
|
188
|
+
/** The notification functions the local transport answers from SQLite. */
|
|
189
|
+
type LocalNotificationFunction = "get_notification" | "list_notifications" | "notification_page" | "notification_counts" | "mark_notifications_read" | "mark_notifications_unread" | "dismiss_notifications";
|
|
190
|
+
interface PowerSyncNotificationsOptions {
|
|
191
|
+
/**
|
|
192
|
+
* Where every other function goes, and every call when `local` is `false`:
|
|
193
|
+
* `rpcTransport(supabase)`.
|
|
194
|
+
*/
|
|
195
|
+
readonly server: BlockTransport;
|
|
196
|
+
/**
|
|
197
|
+
* The synced table names, as `powersync streams` wrote them into the client
|
|
198
|
+
* schema. Default `notification_recipients` and `notification_events`.
|
|
199
|
+
*/
|
|
200
|
+
readonly tables?: {
|
|
201
|
+
readonly recipients?: string;
|
|
202
|
+
readonly events?: string;
|
|
203
|
+
};
|
|
204
|
+
/**
|
|
205
|
+
* The tenant column, when `config.tenancy` renames it. Default
|
|
206
|
+
* `organization_id`.
|
|
207
|
+
*/
|
|
208
|
+
readonly tenantColumn?: string;
|
|
209
|
+
/** Function names, when the instance renames them (`blocks.<name>.entities`). */
|
|
210
|
+
readonly functions?: Partial<Record<LocalNotificationFunction, string>>;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* A block transport for the notifications module on PowerSync: the feed, its
|
|
214
|
+
* counts and marking read, unread or dismissed run on the synced tables, so the
|
|
215
|
+
* inbox works offline. Writes go into PowerSync's upload queue, which
|
|
216
|
+
* `notificationRecipientsRoute` replays on the server. Every other function
|
|
217
|
+
* (sending, preferences, resolving) goes to `server`.
|
|
218
|
+
*
|
|
219
|
+
* ```ts
|
|
220
|
+
* const notifications = createNotifications({
|
|
221
|
+
* transport: powersyncNotificationsTransport(powersync, {
|
|
222
|
+
* server: rpcTransport(supabase),
|
|
223
|
+
* }),
|
|
224
|
+
* });
|
|
225
|
+
* ```
|
|
226
|
+
*
|
|
227
|
+
* The synced rows are the signed-in user's only (the `powersync streams` query
|
|
228
|
+
* filters by `auth.user_id()`), so the local reads add no user filter.
|
|
229
|
+
*/
|
|
230
|
+
export declare function powersyncNotificationsTransport(database: PowerSyncDatabaseLike, options: PowerSyncNotificationsOptions): BlockTransport;
|
|
231
|
+
/**
|
|
232
|
+
* The upload route's notifications client: the server one, not the local
|
|
233
|
+
* transport.
|
|
234
|
+
*/
|
|
235
|
+
interface NotificationRecipientWrites {
|
|
236
|
+
markRead(options: {
|
|
237
|
+
readonly ids: readonly string[];
|
|
238
|
+
}): PromiseLike<Result<unknown>>;
|
|
239
|
+
markUnread(options: {
|
|
240
|
+
readonly ids: readonly string[];
|
|
241
|
+
}): PromiseLike<Result<unknown>>;
|
|
242
|
+
dismiss(ids: readonly string[]): PromiseLike<Result<unknown>>;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* The upload route for `notification_recipients`: replays a local mark read,
|
|
246
|
+
* unread or dismiss through the server's functions, which check the caller owns
|
|
247
|
+
* the row. Pass a notifications client on `rpcTransport(supabase)`; one on
|
|
248
|
+
* `powersyncNotificationsTransport` would write the change locally again.
|
|
249
|
+
*
|
|
250
|
+
* ```ts
|
|
251
|
+
* createUploadConnector({
|
|
252
|
+
* routes: {
|
|
253
|
+
* notification_recipients: notificationRecipientsRoute(
|
|
254
|
+
* serverNotifications,
|
|
255
|
+
* ),
|
|
256
|
+
* },
|
|
257
|
+
* });
|
|
258
|
+
* ```
|
|
259
|
+
*/
|
|
260
|
+
export declare function notificationRecipientsRoute(notifications: NotificationRecipientWrites): UploadFunction;
|
|
261
|
+
/**
|
|
262
|
+
* A topic port for the notifications feed on PowerSync: the feed reads again
|
|
263
|
+
* when the synced notification tables change, from a sync or a local write,
|
|
264
|
+
* instead of on a Realtime broadcast.
|
|
265
|
+
*
|
|
266
|
+
* ```ts
|
|
267
|
+
* createNotificationsController({
|
|
268
|
+
* ports: { topic: powersyncTopicPort(powersync) },
|
|
269
|
+
* });
|
|
270
|
+
* ```
|
|
271
|
+
*/
|
|
272
|
+
export declare function powersyncTopicPort(database: PowerSyncDatabaseLike, tables?: readonly string[]): TopicPort;
|
|
273
|
+
//#endregion
|
|
274
|
+
export { type AttachmentPathRow, type AttachmentQueueRoute, type AttachmentQueueRouteOptions, type AuthSourceLike, type CheckSqliteOptions, type CreateUploadRepository, type CrudEntryLike, type CrudQueueLike, type LocalNotificationFunction, type NotificationRecipientWrites, type PowerSyncDatabaseLike, type PowerSyncEngineOptions, type PowerSyncExecutorOptions, type PowerSyncNotificationsOptions, type RejectedChange, type RejectedStore, type SqliteColumn, type SqliteCompilerOptions, type SqliteContextLike, type SqliteDecode, type SqliteInsertPlan, type SqliteKeyedPlan, type SqliteKeys, type SqliteNested, type SqlitePlan, type SqliteQuery, type SqliteReturning, type SqliteSelectPlan, type SqliteValue, type SyncStatusLike, type SyncWithAuthOptions, type SyncedDatabaseLike, type UploadConnector, type UploadConnectorOptions, type UploadErrorContext, type UploadFunction, type UploadOutcome, type UploadRepository, type UploadRoute, type UploadRouteOptions, checkSqlite, compileSqlite, createUploadConnector, fromSqliteError, likeToGlob, postgrestTimestamp, quoteSqliteIdent, sqliteCompiler, sqliteValue, uploadOutcome, uploadRoute };
|