better-supabase 0.10.0 → 0.12.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 +1 -0
- package/dist/{access-sql-DUSSMaC3.js → access-sql-CTJPHjCL.js} +1 -1
- package/dist/{actor-KHDOKGb1.js → actor-CAL8mMih.js} +1 -1
- package/dist/{adapter-rmWaLNe3.js → adapter-CRNH2aX_.js} +390 -267
- package/dist/{agents-ByYUSZxT.d.ts → agents-CGP2AQge.d.ts} +7 -7
- package/dist/{ai-cache-CkxtAt4P.d.ts → ai-cache-BdeJKlrV.d.ts} +5 -5
- package/dist/{ai-cache-DPiuJ-zJ.js → ai-cache-CLninP-F.js} +2 -2
- package/dist/{ai-chat-al8b3spK.d.ts → ai-chat-D-2MH1sU.d.ts} +7 -7
- package/dist/{ai-files-BXtV3ygd.js → ai-files-ChFDkMLN.js} +18 -10
- package/dist/ai-sdk/agents/index.d.ts +6 -6
- package/dist/ai-sdk/agents/index.js +2 -2
- package/dist/ai-sdk/batches/index.d.ts +4 -4
- package/dist/ai-sdk/batches/index.js +4 -4
- package/dist/ai-sdk/cache/index.d.ts +2 -2
- 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 +5 -5
- package/dist/ai-sdk/embeddings/index.d.ts +2 -2
- package/dist/ai-sdk/files/index.d.ts +2 -2
- package/dist/ai-sdk/files/index.js +4 -4
- package/dist/ai-sdk/index.d.ts +6 -6
- package/dist/ai-sdk/index.js +2 -2
- package/dist/ai-sdk/mcp/index.d.ts +4 -4
- package/dist/ai-sdk/mcp/index.js +4 -4
- package/dist/ai-sdk/memory/index.d.ts +3 -3
- package/dist/ai-sdk/workflow/index.d.ts +4 -4
- package/dist/ai-sdk/workflow/index.js +6 -6
- package/dist/{ai-tasks-Di0gmJOX.d.ts → ai-tasks-ZvPnNudQ.d.ts} +8 -8
- package/dist/{announcements-HF7LuFw5.js → announcements-BNxTW5HJ.js} +4 -4
- package/dist/{api-CFjuYKFY.js → api-C43_FYDp.js} +1 -1
- package/dist/{api-XJcQON_7.d.ts → api-DoWK3dTw.d.ts} +6 -6
- package/dist/{api-keys-EdSNjGIZ.d.ts → api-keys-AgDXbcql.d.ts} +7 -7
- package/dist/{api-keys-C1IZF7p8.js → api-keys-BSXwI2jF.js} +6 -6
- package/dist/{app-tables-DVidEHOI.d.ts → app-tables-BrMBjyuq.d.ts} +1 -1
- package/dist/{approvals-DqlPHBHI.d.ts → approvals-CyX709B-.d.ts} +7 -7
- package/dist/arazzo/index.d.ts +2 -2
- package/dist/arazzo/index.js +2 -2
- package/dist/{assistant-BZyhQ8bd.d.ts → assistant-DZsHsYIx.d.ts} +4 -4
- package/dist/astro/index.d.ts +12 -12
- package/dist/astro/index.js +5 -5
- package/dist/asyncapi/index.d.ts +1 -1
- package/dist/asyncapi/index.js +2 -2
- package/dist/{attachments-C8FEBBKE.js → attachments-CK8D8bIV.js} +14 -8
- package/dist/{audit-log-CRgiHlRh.js → audit-log-ovUlF4Mk.js} +7 -7
- package/dist/auth-module-DbZv2WrR.js +10 -0
- package/dist/{auth-reply-B_dW4jHJ.js → auth-reply-Daq72lY4.js} +2 -2
- package/dist/{authorization-CdJRoZgV.d.ts → authorization-ClWBcXJi.d.ts} +23 -2
- package/dist/{authorization-hooks-Do5djkpz.d.ts → authorization-hooks-WDQMKIsc.d.ts} +2 -2
- package/dist/{authorizer-dVVN05Un.js → authorizer-B3yyCVUF.js} +2 -2
- package/dist/{base64-BmeCBgGo.js → base64-D4aqdnDR.js} +4 -4
- package/dist/better-result/index.d.ts +5 -5
- package/dist/better-result/index.js +1 -1
- package/dist/{bind-DkaP_0iS.d.ts → bind-Bfo40o63.d.ts} +4 -4
- package/dist/{block-fields-BANwJ9Y_.js → block-fields-Bv1hV855.js} +3 -3
- package/dist/{block-fields-5UA84ZUg.d.ts → block-fields-DnaDbgZS.d.ts} +2 -2
- package/dist/{block-helpers-7pMBVsE6.d.ts → block-helpers-CjcQM1yA.d.ts} +2 -2
- package/dist/{block-helpers-BfVCR5Fc.js → block-helpers-DkVZNDrj.js} +4 -4
- package/dist/{block-hooks-ByKlh8Qy.js → block-hooks-C22vuIUd.js} +3 -3
- package/dist/{block-hooks-C_WaodoA.d.ts → block-hooks-DcPJHztl.d.ts} +3 -3
- package/dist/{block-transport-NbUJygA7.d.ts → block-transport-DezJPPA0.d.ts} +2 -2
- package/dist/{block-transport-G4t1umrR.js → block-transport-J7ZepTq2.js} +1 -1
- package/dist/blocks/access-requests/index.d.ts +8 -8
- package/dist/blocks/access-requests/index.js +6 -6
- 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 +2 -2
- package/dist/blocks/ai-chat/react/index.d.ts +2 -2
- package/dist/blocks/ai-chat/react/index.js +2 -2
- 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 +5 -5
- 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 +7 -7
- package/dist/blocks/ai-tasks/index.d.ts +3 -3
- package/dist/blocks/ai-tasks/index.js +7 -7
- 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 +2 -2
- 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 +7 -7
- package/dist/blocks/api-keys/index.js +5 -5
- package/dist/blocks/api-keys/react/index.d.ts +1 -1
- package/dist/blocks/api-keys/react/index.js +3 -3
- 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 +6 -6
- package/dist/blocks/attachments/index.d.ts +4 -4
- package/dist/blocks/attachments/index.js +2 -2
- package/dist/blocks/audit/index.d.ts +6 -6
- package/dist/blocks/audit/index.js +6 -6
- package/dist/blocks/audit/react/index.d.ts +1 -1
- package/dist/blocks/audit/react/index.js +2 -2
- 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 +26 -10
- package/dist/blocks/billing/index.js +43 -10
- package/dist/blocks/billing/react/index.d.ts +2 -2
- 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 +3 -3
- package/dist/blocks/bookings/solid/index.d.ts +2 -2
- package/dist/blocks/bookings/solid/index.js +1 -1
- package/dist/blocks/bookings/svelte/index.d.ts +2 -2
- package/dist/blocks/bookings/svelte/index.js +1 -1
- package/dist/blocks/bookings/vue/index.d.ts +2 -2
- package/dist/blocks/bookings/vue/index.js +1 -1
- package/dist/blocks/bulk/index.d.ts +5 -5
- package/dist/blocks/bulk/index.js +3 -3
- 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 +3 -3
- package/dist/blocks/calendar/solid/index.d.ts +2 -2
- package/dist/blocks/calendar/solid/index.js +1 -1
- package/dist/blocks/calendar/svelte/index.d.ts +2 -2
- package/dist/blocks/calendar/svelte/index.js +1 -1
- package/dist/blocks/calendar/vue/index.d.ts +2 -2
- package/dist/blocks/calendar/vue/index.js +1 -1
- package/dist/blocks/catalog/index.d.ts +10 -10
- package/dist/blocks/catalog/index.js +8 -8
- package/dist/blocks/collections/index.d.ts +10 -10
- 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 +3 -3
- 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 +7 -7
- package/dist/blocks/custom-fields/index.d.ts +6 -6
- package/dist/blocks/custom-fields/index.js +4 -4
- package/dist/blocks/data-lifecycle/index.d.ts +9 -9
- package/dist/blocks/data-lifecycle/index.js +7 -7
- package/dist/blocks/deals/index.d.ts +9 -9
- package/dist/blocks/deals/index.js +9 -9
- package/dist/blocks/documents/index.d.ts +4 -4
- package/dist/blocks/documents/index.js +4 -4
- package/dist/blocks/domains/index.d.ts +7 -7
- package/dist/blocks/domains/index.js +6 -6
- package/dist/blocks/drive/index.d.ts +9 -10
- package/dist/blocks/drive/index.js +20 -11
- package/dist/blocks/employees/index.d.ts +9 -9
- package/dist/blocks/employees/index.js +8 -8
- package/dist/blocks/engagements/index.d.ts +9 -9
- package/dist/blocks/engagements/index.js +5 -5
- package/dist/blocks/entitlements/index.d.ts +7 -7
- package/dist/blocks/entitlements/index.js +2 -2
- 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 +8 -8
- package/dist/blocks/flags/index.js +6 -6
- package/dist/blocks/forms/index.d.ts +9 -9
- 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 +9 -9
- package/dist/blocks/hiring/index.js +6 -6
- package/dist/blocks/identities/index.d.ts +6 -6
- package/dist/blocks/identities/index.js +3 -3
- package/dist/blocks/imports/index.d.ts +6 -6
- package/dist/blocks/imports/index.js +3 -3
- 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 +8 -8
- package/dist/blocks/index.js +3 -3
- package/dist/blocks/inventory/index.d.ts +9 -9
- package/dist/blocks/inventory/index.js +6 -6
- package/dist/blocks/invoices/index.d.ts +9 -9
- package/dist/blocks/invoices/index.js +8 -8
- package/dist/blocks/jobs/index.d.ts +61 -11
- package/dist/blocks/jobs/index.js +126 -13
- package/dist/blocks/knowledge/index.d.ts +3 -3
- package/dist/blocks/knowledge/index.js +2 -2
- package/dist/blocks/leave/index.d.ts +8 -8
- package/dist/blocks/leave/index.js +5 -5
- package/dist/blocks/memory/index.d.ts +4 -4
- package/dist/blocks/memory/index.js +6 -6
- package/dist/blocks/metrics/index.d.ts +7 -7
- 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 +13 -13
- package/dist/blocks/notifications/index.js +11 -11
- 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 +5 -5
- package/dist/blocks/number-sequences/index.js +2 -2
- package/dist/blocks/oauth-server/index.d.ts +28 -8
- package/dist/blocks/oauth-server/index.js +24 -15
- 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 +2 -2
- 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 +12 -12
- package/dist/blocks/orders/index.js +10 -10
- 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 +3 -3
- 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 +9 -9
- package/dist/blocks/parties/index.js +4 -4
- package/dist/blocks/pipelines/index.d.ts +10 -10
- package/dist/blocks/pipelines/index.js +7 -7
- package/dist/blocks/profiles/index.d.ts +7 -7
- package/dist/blocks/profiles/index.js +5 -5
- package/dist/blocks/promotions/index.d.ts +9 -9
- package/dist/blocks/promotions/index.js +7 -7
- package/dist/blocks/push/index.d.ts +9 -9
- package/dist/blocks/push/index.js +4 -4
- package/dist/blocks/quotes/index.d.ts +9 -9
- package/dist/blocks/quotes/index.js +8 -8
- package/dist/blocks/rank/index.d.ts +6 -6
- package/dist/blocks/rank/index.js +3 -3
- 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 +2 -2
- 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 +8 -8
- package/dist/blocks/relations/index.js +4 -4
- package/dist/blocks/reminders/index.d.ts +10 -10
- package/dist/blocks/reminders/index.js +8 -8
- package/dist/blocks/reviews/index.d.ts +8 -8
- package/dist/blocks/reviews/index.js +5 -5
- package/dist/blocks/rules/index.d.ts +9 -9
- package/dist/blocks/rules/index.js +5 -5
- 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/svelte/index.d.ts +2 -2
- package/dist/blocks/rules/vue/index.d.ts +2 -2
- package/dist/blocks/saved-views/index.d.ts +3 -3
- package/dist/blocks/saved-views/index.js +1 -1
- 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 +2 -2
- 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 +8 -8
- package/dist/blocks/service-principals/index.js +6 -6
- package/dist/blocks/sessions/index.d.ts +2 -2
- package/dist/blocks/sessions/index.js +1 -1
- 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 +3 -3
- 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 +7 -7
- package/dist/blocks/share-links/index.js +3 -3
- package/dist/blocks/shared-signals/index.d.ts +8 -8
- package/dist/blocks/shared-signals/index.js +7 -7
- package/dist/blocks/signing-keys/index.d.ts +5 -5
- package/dist/blocks/signing-keys/index.js +47 -21
- package/dist/blocks/sla/index.d.ts +9 -9
- package/dist/blocks/sla/index.js +5 -5
- package/dist/blocks/sso/index.d.ts +7 -7
- package/dist/blocks/sso/index.js +4 -4
- package/dist/blocks/state-machine/index.d.ts +5 -5
- package/dist/blocks/state-machine/index.js +2 -2
- package/dist/blocks/tags/index.d.ts +3 -3
- package/dist/blocks/tags/index.js +2 -2
- package/dist/blocks/tags/react/index.d.ts +1 -1
- package/dist/blocks/tags/react/index.js +3 -3
- 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 +7 -7
- package/dist/blocks/targets/index.js +5 -5
- package/dist/blocks/teams/index.d.ts +7 -7
- package/dist/blocks/teams/index.js +3 -3
- package/dist/blocks/templates/index.d.ts +10 -10
- package/dist/blocks/templates/index.js +7 -7
- package/dist/blocks/time-tracking/index.d.ts +9 -9
- package/dist/blocks/time-tracking/index.js +7 -7
- package/dist/blocks/trash/index.d.ts +8 -8
- package/dist/blocks/trash/index.js +4 -4
- package/dist/blocks/undo/index.d.ts +4 -4
- package/dist/blocks/undo/index.js +2 -2
- 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 +2 -2
- 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/vercel-marketplace/index.d.ts +193 -0
- package/dist/blocks/vercel-marketplace/index.js +300 -0
- package/dist/blocks/versions/index.d.ts +8 -8
- package/dist/blocks/versions/index.js +4 -4
- package/dist/blocks/waitlist/index.d.ts +9 -9
- package/dist/blocks/waitlist/index.js +5 -5
- package/dist/blocks/webhooks/index.d.ts +16 -16
- package/dist/blocks/webhooks/index.js +15 -15
- package/dist/blocks/work-items/index.d.ts +9 -9
- package/dist/blocks/work-items/index.js +6 -6
- package/dist/blocks/workflow-builder/index.d.ts +8 -8
- 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 +3 -3
- 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 +2 -2
- package/dist/blocks/workflows/react/index.d.ts +2 -2
- package/dist/blocks/workflows/react/index.js +2 -2
- 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-EJAVAuVz.js → bookings-DQ7P888X.js} +5 -5
- package/dist/{storage-api-B4Ib2Zpo.d.ts → bucket-BbePDVwc.d.ts} +235 -219
- package/dist/{build-6jmaPAgx.js → build-C-D_vn0U.js} +7 -2
- package/dist/{build-Cm0T5MVG.js → build-CT6SPZkI.js} +1 -1
- package/dist/{calendar-1J1E5dLq.js → calendar-eqyuQAoy.js} +7 -7
- package/dist/chat-sdk/index.d.ts +6 -6
- package/dist/chat-sdk/index.js +3 -3
- package/dist/chat-sdk/react/index.d.ts +2 -2
- package/dist/chat-sdk/react/server.d.ts +2 -2
- package/dist/cli/{add-BhI_nXAo.js → add-BcOHumvq.js} +2 -2
- package/dist/cli/add-DnAyR9w_.js +1 -0
- package/dist/cli/{add-CUS0AiBh.js → add-TT72pQk6.js} +5 -5
- package/dist/cli/adopt-BuS-DC7_.js +1 -0
- package/dist/cli/{adopt-DwcU6CJd.js → adopt-mbB1bcIG.js} +6 -6
- package/dist/cli/{apply-DBXC0Z5I.js → apply-CiBFOFGw.js} +16 -22
- package/dist/cli/bin.js +1 -1
- package/dist/cli/{blocks-B15ltTFn.js → blocks-5-JGzwXX.js} +1 -1
- package/dist/cli/{blocks-BXeqIzWN.js → blocks-DeLQOlUK.js} +1 -1
- package/dist/cli/{cache-CPBYJAkb.js → cache-DQwgb3rg.js} +8 -3
- package/dist/cli/{catalog-Di15TkM2.js → catalog-Cm6BtquM.js} +2 -1
- package/dist/cli/{codemod-CrI33UR2.js → codemod-BzAMX4el.js} +2 -2
- package/dist/cli/{command-D_HI1mp1.js → command-dfdVhU_2.js} +39 -1
- package/dist/cli/{completion-Vry-Wjw8.js → completion-4lLjtI49.js} +1 -1
- package/dist/cli/{completion-En43UcyJ.js → completion-D4InNrxw.js} +2 -2
- package/dist/cli/{completion-DzYo025z.js → completion-zsp5s0zI.js} +2 -2
- package/dist/cli/{config-DsqQr5z3.js → config-CCyweX7Y.js} +1 -1
- package/dist/cli/{config-DyJgo2d9.js → config-DI6ielsx.js} +1 -1
- package/dist/cli/{config-Bi_UBxXl.js → config-yZ55rsKZ.js} +17 -5
- package/dist/cli/db-TRymMyAW.js +90 -0
- package/dist/cli/{design-edit-B-WsnhUF.js → design-edit-0U9iCTiS.js} +29 -2
- package/dist/cli/{detect-BeLVeNpA.js → detect-DQsVeBHg.js} +1 -1
- package/dist/cli/{doctor-wACp5w6N.js → doctor-DOfy6kjt.js} +332 -108
- package/dist/cli/{emit-j0zZ6NE_.js → emit-56LAG_Px.js} +11 -5
- package/dist/cli/{env-Ch99nTQw.js → env-B7TWPEt0.js} +1 -1
- package/dist/cli/{env-Cf5OTqbK.js → env-C8R7Nf0a.js} +2 -1
- package/dist/cli/env-Cmu99uKR.js +1 -0
- package/dist/cli/{env-2v9JrxSr.js → env-Dh5K5t2U.js} +33 -32
- package/dist/cli/{gen-BhquLu7l.js → gen-D3sC5jDn.js} +11 -11
- package/dist/cli/index.d.ts +3 -1
- package/dist/cli/index.js +10 -9
- package/dist/cli/{init-BwLTO6XG.js → init-DNomoycJ.js} +16 -22
- package/dist/cli/{introspect-B-gXAIqs.js → introspect-kYX06Q2g.js} +3 -3
- package/dist/cli/{keys-hwtdwdkT.js → keys-B8dIJwwi.js} +2 -2
- package/dist/cli/{live-BFfYoE0_.js → live-CkV3d3yp.js} +2 -2
- package/dist/cli/{mcp-Bdm2oGmL.js → mcp-DrxB2Wuw.js} +4 -4
- package/dist/cli/{metadata-DikbSOE0.js → metadata-BGkle6WM.js} +2 -2
- package/dist/cli/{migration-safety-LaGVPPuD.js → migration-safety-DjVpz2D6.js} +1 -1
- package/dist/cli/{module-migration-CLkZ8jpw.js → module-migration-CPhuiY8C.js} +1 -1
- package/dist/cli/{moved-B7UFO_OM.js → moved-BMQu1YNY.js} +1 -1
- package/dist/cli/{parse-CwV5a6dA.js → parse-QzDvMpXH.js} +1 -1
- package/dist/cli/{preset-DQ1DxMtI.js → preset-CfIs24cc.js} +1 -1
- package/dist/cli/run-Bck-p0MI.js +63 -0
- package/dist/cli/{run-DliGNdjI.js → run-BhJKAanr.js} +26 -5
- package/dist/cli/{run-BLJj7SuM.js → run-DRZ10srj.js} +52 -43
- package/dist/cli/{scaffold-6bv24GSP.js → scaffold-DoURlDEI.js} +3 -3
- package/dist/cli/{scaffold-DUz5fa-k.js → scaffold-mzy3OsN5.js} +1 -1
- package/dist/cli/seed-C5q4UUIL.js +1 -0
- package/dist/cli/{seed-CIJaL1Ao.js → seed-CIdg6s7m.js} +6 -5
- package/dist/cli/{shared-CNcvDOLt.js → shared-DKLuA1Tp.js} +2 -2
- package/dist/cli/{skills-CaxIQhzW.js → skills-D3zwIlGA.js} +1 -1
- package/dist/cli/{snapshot-Dvcx0BSl.js → snapshot-BBKFojqM.js} +4 -4
- package/dist/cli/{source-args-BNhagtpw.js → source-args-Cwo7zwvq.js} +8 -2
- package/dist/cli/{spec-DRDaIq8f.js → spec-DOgQUZwM.js} +1 -1
- package/dist/cli/{spec-BewE6r6J.js → spec-DZeIP9ta.js} +3 -3
- package/dist/cli/{sql-BCQt5TDs.js → sql-CL_Lbhwl.js} +2 -2
- package/dist/cli/{sql-BBkchli4.js → sql-DLOvvnBV.js} +5 -5
- package/dist/cli/stack-env-_uWWNHWq.js +87 -0
- package/dist/cli/{stack-status-LeEoCtV1.js → stack-status-_NUgd-g5.js} +43 -3
- package/dist/cli/{supabase-toml-DjLgBYEo.js → supabase-toml-BC5sNVKU.js} +1 -1
- package/dist/cli/{sync-CJ-ft-tl.js → sync-DBvknfOK.js} +2 -2
- package/dist/cli/{version-D1wM9DNb.js → version-B7akdvDv.js} +1 -1
- package/dist/cli/{write-Dp1XlAVM.js → write-VZljwoTB.js} +2 -2
- package/dist/client/index.d.ts +6 -6
- package/dist/client/index.js +4 -4
- package/dist/client/native/index.d.ts +6 -6
- package/dist/client/native/index.js +4 -4
- package/dist/{client-ByGlM0YF.d.ts → client-BAOZuBhz.d.ts} +4 -4
- package/dist/{client-fpvgtQKE.js → client-BDO6i2Oe.js} +2 -2
- package/dist/{client-Dk8gY9hi.d.ts → client-BJN0IMEp.d.ts} +2 -2
- package/dist/{client-Fi8CoJcs.d.ts → client-BMcjLG0V.d.ts} +13 -13
- package/dist/{client-B5nnqDmz.d.ts → client-BN_fXOs7.d.ts} +2 -2
- package/dist/{client-CpMv4-v5.d.ts → client-BONsuFYf.d.ts} +4 -4
- package/dist/{client-Diu2lPbg.d.ts → client-BPn9XhAM.d.ts} +7 -7
- package/dist/{client-B0rvMvA8.d.ts → client-BtC-r4hE.d.ts} +3 -3
- package/dist/{client-Cgxj38RS.d.ts → client-BuneNd-C.d.ts} +9 -9
- package/dist/{client-D0502FgY.js → client-CFKONrrU.js} +4 -4
- package/dist/{client-CvITjt-9.js → client-CHR8IBNG.js} +10 -2
- package/dist/{client-B9H4BZJh.d.ts → client-CHwNV8Kz.d.ts} +12 -12
- package/dist/{client-kKdkLGPB.d.ts → client-CLQHsa-2.d.ts} +2 -2
- package/dist/{client-C3dLIsJv.d.ts → client-CMxxwT3N.d.ts} +9 -9
- package/dist/{client-C597NIlL.d.ts → client-CU7aNN_B.d.ts} +8 -8
- package/dist/{client-DZXFDaQE.d.ts → client-CYEdJKjk.d.ts} +6 -6
- package/dist/{client-LVa6yC9u.d.ts → client-CYhSGlCN.d.ts} +5 -5
- package/dist/{client-CWs3X4g1.js → client-C_-NZRrg.js} +1 -1
- package/dist/{client-kI6vCKVI.js → client-CcPxbHeT.js} +2 -2
- package/dist/{client-AxwF58Eo.js → client-CosiUrUb.js} +1 -1
- package/dist/{client-CsRpAyIv.d.ts → client-D3gRTNSi.d.ts} +2 -2
- package/dist/{client-D727oIVC.js → client-D7T7OLiw.js} +4 -4
- package/dist/{client-9zIKhf5D.d.ts → client-DB34f_7i.d.ts} +3 -3
- package/dist/{client-CjyTNdt1.d.ts → client-DCawyopp.d.ts} +5 -5
- package/dist/{client-BtBkVSk2.d.ts → client-Dqa4XyJ5.d.ts} +7 -7
- package/dist/{client-BLKpcAs0.d.ts → client-Dr5h2r9r.d.ts} +3 -3
- package/dist/{client-BO9fQgBB.d.ts → client-DrTqKgvy.d.ts} +4 -4
- package/dist/{client-13Ii0c0P.js → client-DyfWYU8S.js} +2 -2
- package/dist/{client-iB5axfa0.js → client-Dz1jWDA2.js} +3 -3
- package/dist/{client-jvtwGFy4.js → client-DzTtOVRR.js} +2 -2
- package/dist/{client-B_r4denm.d.ts → client-GCCRI9ge.d.ts} +3 -3
- package/dist/{client-DR_YEGnc.d.ts → client-P6v3h7vh.d.ts} +2 -2
- package/dist/{client-D9zBl9PT.d.ts → client-P8l8ncxV.d.ts} +7 -7
- package/dist/{client-CFeWXNXy.js → client-UnM3e32l.js} +2 -2
- package/dist/{client-DG7FwgZD.js → client-arq4daO_.js} +1 -1
- package/dist/{client-CmHsfDHU.js → client-eCDPjOMo.js} +6 -6
- package/dist/{client-rp7YfOg1.js → client-iaFm0aVf.js} +1 -1
- package/dist/{client-WXJwUhr1.d.ts → client-kWg4OqIr.d.ts} +5 -5
- package/dist/{client-B7LCXnnY.d.ts → client-tvG258_1.d.ts} +6 -6
- package/dist/{client-BaynD5V-.d.ts → client-wKmX-f3r.d.ts} +7 -7
- package/dist/{cloud-event-bwsBwVNG.d.ts → cloud-event-DXkNoI6v.d.ts} +1 -1
- package/dist/{codecs-C7E_OoiC.js → codecs-D-rpDifG.js} +3 -3
- package/dist/{codecs-Bm46sVxr.d.ts → codecs-RwFNK8Jh.d.ts} +2 -2
- package/dist/{codegen-2m4SKVdi.d.ts → codegen-C64C0NZG.d.ts} +13 -2
- package/dist/{comments-N7Bi-oTW.js → comments-CV5O8q50.js} +5 -5
- package/dist/commerce/index.d.ts +2 -2
- package/dist/commerce/index.js +6 -6
- package/dist/{compiler-C6E3WwIi.d.ts → compiler-D_Gjpw_O.d.ts} +2 -2
- package/dist/{compose-CO_cljl3.js → compose-CP0ss-cQ.js} +3 -3
- package/dist/{composite-CPV0thLs.js → composite-1kPAxXto.js} +3 -3
- package/dist/{composite-DMMA_Whg.d.ts → composite-DzvBL5nb.d.ts} +13 -13
- package/dist/config/index.d.ts +4 -4
- package/dist/config/index.js +2 -2
- package/dist/{config-C4RQDF6t.js → config-DHhQmmuD.js} +22 -1
- package/dist/{config-CkyahUjo.js → config-NQmw_wsk.js} +1 -1
- package/dist/{connector-Cp8CqssJ.d.ts → connector-D9NMNkv0.d.ts} +1 -1
- package/dist/{connectors-CZdfZcIg.d.ts → connectors-BwPNt-ZG.d.ts} +7 -7
- package/dist/{context-BDDgjoxz.js → context-BiwgsycK.js} +1 -1
- package/dist/{context-CCfX2szU.d.ts → context-Cv3KlxWY.d.ts} +2 -2
- package/dist/{controller-CCb9tHw_.d.ts → controller-BZhiIb-N.d.ts} +1 -1
- package/dist/cors-h_v7TPxl.js +24 -0
- package/dist/cors-kLq6VM06.d.ts +15 -0
- package/dist/create/index.d.ts +25 -3
- package/dist/create/index.js +1002 -915
- package/dist/create/supabase/index.d.ts +1 -1
- package/dist/credentials/index.d.ts +5 -5
- package/dist/credentials/index.js +8 -8
- package/dist/{cron-CUaKTjWC.js → cron-BHdXZFsJ.js} +1 -1
- package/dist/{cron-route-BsgbJ-g4.js → cron-route-mTvWhork.js} +3 -3
- package/dist/{define-CMcokcZz.js → define-Bu1v781m.js} +82 -16
- package/dist/{define-DXTC706J.d.ts → define-DYZnvAbs.d.ts} +96 -43
- package/dist/{define-block-BlHQxDIQ.d.ts → define-block-BHxLHLys.d.ts} +7 -7
- package/dist/{delegation-Dt8hMJWu.js → delegation-B7uNnz6z.js} +2 -2
- package/dist/{documents-BYM2viS0.d.ts → documents-CqtVr2fg.d.ts} +4 -4
- package/dist/edge/index.d.ts +27 -38
- package/dist/edge/index.js +12 -32
- package/dist/elysia/index.d.ts +1 -1
- package/dist/elysia/index.js +1 -1
- package/dist/{embeddings-Da0w4A_0.d.ts → embeddings-CKhygw4C.d.ts} +1 -1
- package/dist/{ended-EcTtzzQJ.d.ts → ended-De6H52nX.d.ts} +2 -2
- package/dist/{entitlements-AmYp2KHX.js → entitlements-C8UvF1Rz.js} +3 -3
- package/dist/{entitlements-Bn7BTnbg.d.ts → entitlements-CtBGXb3B.d.ts} +2 -2
- package/dist/{envelope--7d0Q3Se.js → envelope-C4Z55LKW.js} +4 -4
- package/dist/{errors-8i6tSICm.js → errors-BV1SKTVs.js} +15 -1
- package/dist/{errors-7MqM7bbV.js → errors-D3BR8iUk.js} +2 -2
- package/dist/{escape-like-AUEPn-C5.d.ts → escape-like-B339PlP-.d.ts} +1 -1
- package/dist/eve/index.d.ts +5 -5
- package/dist/eve/index.js +2 -2
- package/dist/{eve-BcEr_hPo.d.ts → eve-B6ru2Bt4.d.ts} +2 -2
- package/dist/events/index.d.ts +3 -3
- package/dist/{events-CtAHxPal.d.ts → events-P3raDX2E.d.ts} +3 -3
- package/dist/{executor-CHRwEYqt.d.ts → executor-BWgJNbGh.d.ts} +1 -1
- package/dist/{executor-Cex-1PFp.js → executor-BiB0wMBA.js} +4 -4
- package/dist/{executor-BicyP8Nl.d.ts → executor-BnMC0lj3.d.ts} +2 -2
- package/dist/{executor-CIxyatuB.d.ts → executor-CvsNcQsa.d.ts} +3 -3
- package/dist/{executor-aKUo_Xyb.js → executor-CxGQiQN_.js} +3 -3
- package/dist/{executor-DzJQVTE2.d.ts → executor-D1hECPGG.d.ts} +1 -1
- package/dist/expo/index.d.ts +11 -9
- package/dist/expo/index.js +42 -7
- package/dist/expo-sqlite/index.d.ts +3 -3
- package/dist/expo-sqlite/index.js +2 -2
- package/dist/{field-errors-nFnYWvB0.d.ts → field-errors-Z-sgsdoN.d.ts} +7 -7
- package/dist/{filter-evaluate-CEm52E5s.d.ts → filter-evaluate-BJcaL3o1.d.ts} +1 -1
- package/dist/{filter-query-D3wOD1P_.d.ts → filter-query-Bc_Qa8V_.d.ts} +1 -1
- package/dist/{flags-Dz5PIzFU.d.ts → flags-6KK6Vqkr.d.ts} +3 -3
- package/dist/{flags-CtSrkVuW.js → flags-aUR7Rod6.js} +1 -1
- package/dist/flags-sdk/index.d.ts +1 -1
- package/dist/flags-sdk/index.js +2 -2
- package/dist/{framework-C2oL4OaO.d.ts → framework-BQhTsLX-.d.ts} +7 -7
- package/dist/{framework-Cfm0IspZ.js → framework-C6PKBgme.js} +2 -2
- package/dist/{function-contract-B4c0XuTU.d.ts → function-contract-DWqFl_QO.d.ts} +1 -1
- package/dist/{gateway-CJL6ZG17.d.ts → gateway-Bq_tWwxE.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/{hmac-DCud0myt.js → hmac-BgpThYQW.js} +2 -1
- package/dist/hono/index.d.ts +34 -25
- package/dist/hono/index.js +18 -12
- package/dist/{http-BF-V0CUF.js → http-C7trc6uN.js} +2 -2
- package/dist/{impersonation-CDeCzZP6.js → impersonation-DxU6yHJV.js} +1 -1
- package/dist/{inbox-BaUJgHOF.d.ts → inbox-Du5aPwKB.d.ts} +4 -4
- package/dist/{index-DTQbC3CW.d.ts → index-1Vsg-7YV.d.ts} +1 -1
- package/dist/{index-8xwnaWHY.d.ts → index-BJLPQr2s.d.ts} +38 -5
- package/dist/{index-DL8z_oDo.d.ts → index-BpyBH5O2.d.ts} +4 -4
- package/dist/{index-Ck4oK5vV.d.ts → index-C-_fs7EI.d.ts} +8 -8
- package/dist/{index-BurdFUXr.d.ts → index-CXFf-c-j.d.ts} +7 -7
- package/dist/{index-MCXVzkXs.d.ts → index-Cm2-g_4H.d.ts} +5 -5
- package/dist/{index-DcijDfh1.d.ts → index-DTQSeHx2.d.ts} +4 -4
- package/dist/{index-D1kMyNc7.d.ts → index-Hc4tetmB.d.ts} +2 -2
- package/dist/{index-gXy3R1Uq.d.ts → index-QWTq2o31.d.ts} +1 -1
- package/dist/{index-Cckxs8IE.d.ts → index-XcTBR4Gb.d.ts} +3 -3
- package/dist/{index-DMONTkSf.d.ts → index-k-rrfG1g.d.ts} +2 -2
- package/dist/{index-Co0YsJTk.d.ts → index-wTnPJUhv.d.ts} +2 -2
- package/dist/index.d.ts +13 -13
- package/dist/index.js +10 -10
- package/dist/jwks-cache-C4rA69hD.js +49 -0
- package/dist/{jws-milwSg7E.js → jws-CwBB5QAT.js} +5 -3
- package/dist/{kit-BlcEFQql.d.ts → kit-De-EVRhw.d.ts} +4 -4
- package/dist/{kit-gqwkVhGU.js → kit-LTbHrWWD.js} +6 -6
- package/dist/{knowledge-BYtgA52P.d.ts → knowledge-B5zdpDD-.d.ts} +6 -6
- package/dist/{knowledge-CSNKLX-s.js → knowledge-BbdXOJvY.js} +4 -4
- package/dist/lint/index.d.ts +1 -1
- package/dist/lint/index.js +47 -2
- package/dist/list/index.d.ts +3 -3
- package/dist/{list-query-DWJIiVz_.d.ts → list-query-aXr2WkGA.d.ts} +5 -5
- package/dist/mcp/index.d.ts +21 -21
- package/dist/mcp/index.js +10 -10
- package/dist/mcp/sdk/index.d.ts +17 -17
- package/dist/mcp/sdk/index.js +5 -5
- package/dist/{messages-Cx4ttLJJ.js → messages-D5nIfCCf.js} +2 -2
- package/dist/{mfa-DtflCXEt.d.ts → mfa-YzkRjNad.d.ts} +1 -1
- package/dist/{model-messages-CTu-6kBu.js → model-messages-CIdqdUtk.js} +1 -1
- package/dist/{money-codec-DCGgzO26.js → money-codec-C21MWw50.js} +2 -2
- package/dist/nestjs/index.d.ts +2 -2
- package/dist/nestjs/index.js +1 -1
- package/dist/next/index.d.ts +34 -29
- package/dist/next/index.js +14 -14
- package/dist/node/index.d.ts +2 -2
- package/dist/node/index.js +1 -1
- package/dist/{onboarding-viTTNWUp.js → onboarding-Du6kCmhF.js} +2 -2
- package/dist/openapi/index.d.ts +2 -2
- package/dist/openapi/index.js +2 -2
- package/dist/{operations-BtuQRwTJ.d.ts → operations-DQCWqkt3.d.ts} +1 -1
- package/dist/{options-CZk_fbbg.js → options-BCrqe3HH.js} +2 -1
- package/dist/options-CEMawFrr.js +5 -0
- package/dist/options-RKYdmIdV.js +5 -0
- package/dist/{options-CbSOj53r.d.ts → options-ZQzNKKBS.d.ts} +1 -1
- package/dist/{organizations-Bxrm32IG.js → organizations-CO2qg44D.js} +6 -6
- package/dist/orpc/index.d.ts +18 -18
- package/dist/orpc/index.js +7 -7
- package/dist/otel/index.d.ts +2 -2
- package/dist/otel/index.js +5 -5
- package/dist/{outbox-BCGHl9X6.d.ts → outbox-B1hZ7PPY.d.ts} +6 -6
- package/dist/{payments-h45bswA-.js → payments-CzjCdIcz.js} +1 -1
- package/dist/{plugin-D5OIaP93.d.ts → plugin-D-95Q0w0.d.ts} +3 -3
- package/dist/plugins/actor/index.d.ts +1 -1
- package/dist/plugins/actor/index.js +1 -1
- package/dist/plugins/rules/index.d.ts +2 -2
- package/dist/plugins/rules/index.js +1 -1
- package/dist/plugins/soft-delete/index.d.ts +3 -3
- package/dist/plugins/soft-delete/index.js +2 -2
- package/dist/plugins/tenant/index.d.ts +2 -2
- package/dist/plugins/tenant/index.js +2 -2
- package/dist/plugins/timestamps/index.d.ts +1 -1
- package/dist/plugins/timestamps/index.js +1 -1
- package/dist/plugins/validation/index.d.ts +2 -2
- package/dist/plugins/validation/index.js +3 -3
- package/dist/{pool-BBi4mot3.d.ts → pool-cM3rpOQr.d.ts} +3 -3
- package/dist/{pool-errors-C94tPR_G.js → pool-errors-CGqvTQOC.js} +2 -2
- package/dist/{ports-Dcnuo3HT.d.ts → ports-BCDIbC_U.d.ts} +2 -2
- package/dist/{ports-B53rB7zg.d.ts → ports-P0A5wo_-.d.ts} +11 -11
- package/dist/{ports-Bcdppx0G.js → ports-aALjot-D.js} +11 -7
- package/dist/postgres/index.d.ts +5 -5
- package/dist/postgres/index.js +3 -3
- package/dist/{postgrest-D6fEMsp4.d.ts → postgrest-CjnO1hbr.d.ts} +1 -1
- package/dist/powersync/index.d.ts +4 -4
- package/dist/powersync/index.js +4 -4
- package/dist/powersync/react/index.d.ts +3 -3
- package/dist/powersync/react/index.js +1 -1
- package/dist/preset/index.d.ts +4 -4
- package/dist/preset/index.js +3 -3
- package/dist/{preset-BBrL6_Ln.js → preset-Cf0T9GRt.js} +49 -6
- package/dist/{problem-CEjyhV5T.d.ts → problem-DCDIQiTA.d.ts} +1 -1
- package/dist/{problem-pIiL3WbE.js → problem-JRCohp1j.js} +1 -1
- package/dist/{provider-DKh2xFZb.js → provider-C-Ti38J6.js} +1 -1
- package/dist/{provider-CQ1SrhLa.d.ts → provider-DXgx5oSA.d.ts} +2 -2
- package/dist/{push-token-CDMgWT13.d.ts → push-token-y1Gnz5bQ.d.ts} +1 -1
- package/dist/query/index.d.ts +2 -2
- package/dist/{rank-result-Dngpt2n5.d.ts → rank-result-BcYfDA0x.d.ts} +1 -1
- package/dist/{rank-result-oUF1DYBm.js → rank-result-DtQuIvob.js} +2 -2
- package/dist/{rate-limit-BtbddDnE.js → rate-limit-DVZ7qIzW.js} +1 -1
- package/dist/{rate-limit-ByfWNX9N.js → rate-limit-I3AncmM8.js} +8 -8
- package/dist/{rate-limit-C88MEAOm.d.ts → rate-limit-c6c1mB6R.d.ts} +2 -2
- package/dist/react/index.d.ts +8 -8
- package/dist/react/index.js +2 -2
- package/dist/react/native/index.d.ts +1 -1
- package/dist/react/native/index.js +1 -1
- package/dist/react/server.d.ts +9 -9
- package/dist/react/server.js +2 -2
- package/dist/react/session.d.ts +2 -2
- package/dist/{react-BcKACxsj.js → react-DzukE6Wp.js} +3 -3
- package/dist/react-router/index.d.ts +11 -11
- package/dist/react-router/index.js +6 -6
- package/dist/{read-set-PWiJfv6S.js → read-set-DeesfeL_.js} +2 -2
- package/dist/realtime/index.d.ts +6 -6
- package/dist/realtime/index.js +2 -2
- package/dist/{refusal-Bdr1k47u.d.ts → refusal-C7geIBRl.d.ts} +1 -1
- package/dist/{refusal-Ch-u9dVd.js → refusal-CFpfmjcS.js} +4 -4
- package/dist/{resolve-CAR9oaKW.js → resolve-AtncaPTU.js} +17 -9
- package/dist/{resolve-7atr-wWr.d.ts → resolve-Ceft-18-.d.ts} +9 -5
- package/dist/{resource-CHGOmg1O.js → resource-Bdkqi8jo.js} +6 -6
- package/dist/{resource-DxcgtHq6.d.ts → resource-DYEtc-KN.d.ts} +1 -1
- package/dist/{resource-execute-C45ICrN9.d.ts → resource-execute-Bxvgmx-n.d.ts} +2 -2
- package/dist/{resource-types-CC59gMHE.d.ts → resource-types-LW1i5-h3.d.ts} +6 -6
- package/dist/{resources-B7htXQeg.js → resources-Ck7itNeX.js} +3 -3
- package/dist/{resources-B71O7EVQ.d.ts → resources-D3_FAz_H.d.ts} +2 -2
- package/dist/{respond-Cdg5ibH5.d.ts → respond-BSL36dQp.d.ts} +3 -3
- package/dist/{respond-Dpx48ATq.js → respond-Bhp3G__q.js} +5 -5
- package/dist/{result-Cj3yWhjH.d.ts → result-BREt7qOh.d.ts} +15 -1
- package/dist/{result-COkvI9t5.js → result-DIeYscA3.js} +1 -1
- package/dist/{rrule-zBh3CA1r.js → rrule-Cw4x4Pf_.js} +1 -1
- package/dist/{rules-4of_Fq-6.js → rules-BiQgmZ_U.js} +4 -4
- package/dist/{sales-lines-CymdiwYd.js → sales-lines-CQ1iC6QM.js} +3 -3
- package/dist/{sales-shared-DjCuN8xG.js → sales-shared-CDSytDEn.js} +2 -2
- package/dist/{search-LbjCylX5.js → search-ZP13UTT4.js} +3 -3
- package/dist/server/index.d.ts +38 -30
- package/dist/server/index.js +19 -64
- package/dist/{server-types-fXwJoFjt.d.ts → server-types-fLdep4gb.d.ts} +50 -30
- package/dist/{session-Djo5t4KQ.d.ts → session-DObioXpX.d.ts} +11 -11
- package/dist/{settings-DxXfDUmh.js → settings-BiHDFglz.js} +5 -5
- package/dist/{shared-9B02lczf.js → shared-C9zvURqC.js} +1 -1
- package/dist/{shared-as0EG51f.js → shared-D5Djh43x.js} +1 -1
- package/dist/{sign-in-D0xN6E_l.js → sign-in-z2BaBdps.js} +10 -3
- package/dist/{signatures-BMdJ7neI.d.ts → signatures-BXlDXV3D.d.ts} +1 -1
- package/dist/{signatures-C9CGYZS1.js → signatures-CeIoAelK.js} +5 -5
- package/dist/{signers-BjSgNAXP.d.ts → signers-BwKV-9S6.d.ts} +6 -6
- package/dist/{signing-keys-Ccr86Y2C.d.ts → signing-keys-v2MRYkDF.d.ts} +20 -5
- package/dist/solid/index.d.ts +8 -8
- package/dist/solid/index.js +1 -1
- package/dist/{solid-controller-CZrt1Tg6.d.ts → solid-controller-CWotGxcG.d.ts} +1 -1
- package/dist/solid-start/index.d.ts +11 -11
- package/dist/solid-start/index.js +5 -5
- package/dist/spec/index.d.ts +3 -3
- package/dist/spec/index.js +3 -3
- package/dist/sql/index.d.ts +4 -4
- package/dist/sql/index.js +2 -2
- package/dist/{sql-BQshMgmB.js → sql-BPKRNutj.js} +3 -3
- package/dist/{sql-CgTZOQZ7.js → sql-CT1Jnwp8.js} +1919 -698
- package/dist/{sso-CwAnve68.js → sso-BaU_6ePE.js} +4 -4
- package/dist/{sso-B5ZoEsXE.d.ts → sso-Bu0mVh0V.d.ts} +4 -4
- package/dist/ssr/index.d.ts +4 -4
- package/dist/ssr/index.js +3 -3
- package/dist/{standard-DZmwmIhV.js → standard-B1BigegP.js} +2 -2
- package/dist/{standard-C3_AAF3g.d.ts → standard-BcUQuUgu.d.ts} +1 -1
- package/dist/{stats-CUhqw6Ev.js → stats-Di5VAsYU.js} +4 -4
- package/dist/storage/index.d.ts +3 -3
- package/dist/storage/index.js +17 -6
- package/dist/{store-B5qYKsTh.d.ts → store-B18bIvKc.d.ts} +1 -1
- package/dist/streams/index.d.ts +3 -3
- package/dist/streams/index.js +3 -3
- package/dist/streams/redis/index.d.ts +1 -1
- package/dist/streams/redis/index.js +2 -2
- package/dist/{subject-readers-81xiWh4M.d.ts → subject-readers-BUChuOxL.d.ts} +2 -2
- package/dist/{subject-readers-DDyPTIOr.js → subject-readers-BpwUFJtp.js} +1 -1
- package/dist/{support-BsqhV6jP.js → support-C2wPYwD7.js} +8 -8
- package/dist/{support-view-CznLe4jq.d.ts → support-view-Bj_lZ8Wr.d.ts} +1 -1
- package/dist/svelte/index.d.ts +7 -7
- package/dist/svelte/index.js +1 -1
- package/dist/{svelte-controller-DDbju9CW.d.ts → svelte-controller-sS4X66yL.d.ts} +1 -1
- package/dist/sveltekit/index.d.ts +13 -13
- package/dist/sveltekit/index.js +7 -7
- package/dist/{tags-DGldvcA4.js → tags-BqgaxCnv.js} +5 -5
- package/dist/{tags-7NHyD1P8.d.ts → tags-BrGopDVG.d.ts} +1 -1
- 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 +11 -11
- package/dist/tanstack-start/index.js +5 -5
- package/dist/{tax-DDZUB_oc.d.ts → tax-DMWDUzKt.d.ts} +2 -2
- package/dist/{tax-DZDpMMRw.js → tax-wm9g2mD2.js} +2 -2
- package/dist/{tee-CdRV1tcj.js → tee-Cw-iJAWL.js} +1 -1
- package/dist/{template-DdgYjIZ5.js → template-Dw3dTmKe.js} +1 -1
- package/dist/{temporal-required-DqRzr7i0.js → temporal-required-nfZ87U-0.js} +1 -1
- package/dist/{tenant-DW_GmsW4.d.ts → tenant-DZMLVuyQ.d.ts} +2 -2
- package/dist/testing/index.d.ts +134 -60
- package/dist/testing/index.js +251 -120
- package/dist/{topic-Dgs-eSYQ.d.ts → topic-DAY_HOX2.d.ts} +20 -6
- package/dist/{topic-DB-1YTMj.js → topic-mee21pux.js} +85 -17
- package/dist/{types-C_GN-4ed.d.ts → types-BA1eTvy4.d.ts} +5 -5
- package/dist/{types-P1S1cj6N.d.ts → types-BEEFkNFY.d.ts} +7 -7
- package/dist/{types-DZj8CZMH.d.ts → types-Bels39_u.d.ts} +10 -10
- package/dist/{types-BO8lVTun.d.ts → types-BrpW5ixT.d.ts} +8 -1
- package/dist/{types-DM8q3IOr.d.ts → types-DOC7wnh6.d.ts} +17 -8
- package/dist/{types-DOaUIJxW.d.ts → types-D_2rClz-.d.ts} +5 -5
- package/dist/{undo-0qM13zul.js → undo-B5LgpGLy.js} +4 -4
- package/dist/{undo-D42sPjCf.d.ts → undo-BsdYRox7.d.ts} +3 -3
- package/dist/upload-claim-BBFCZbBF.js +33 -0
- package/dist/{usage-CnQHSM_r.d.ts → usage-C504GF55.d.ts} +23 -5
- package/dist/{usage-BrJGPvCq.js → usage-DdqT13_X.js} +14 -3
- package/dist/{vault-EnOQJWjn.d.ts → vault-ClkzMGTP.d.ts} +3 -3
- package/dist/vercel-connect/index.d.ts +1 -1
- package/dist/vercel-connect/index.js +2 -2
- package/dist/{verify-3NLjUIER.d.ts → verify-DU4p9-Ve.d.ts} +4 -4
- package/dist/{verify-C9D_jjsQ.js → verify-DnU-uWU2.js} +5 -5
- package/dist/{version-Bxj_xcUY.js → version-DSWxci83.js} +1 -1
- package/dist/{view-DZ63nqwt.js → view-CYX1wsgp.js} +3 -3
- package/dist/{view-SuASaomx.d.ts → view-KQhe6eNc.d.ts} +3 -3
- package/dist/vue/index.d.ts +8 -8
- package/dist/vue/index.js +1 -1
- package/dist/{vue-controller-D_ohttBZ.d.ts → vue-controller-BUo1oove.d.ts} +1 -1
- package/dist/{watch-D1wwzZ04.d.ts → watch-5btote1y.d.ts} +6 -6
- package/dist/{watch-Blj1mQ9n.js → watch-BAuIzC2r.js} +1 -1
- package/dist/{watch-topic-D-rpUg5n.d.ts → watch-topic-C79ZW5-R.d.ts} +1 -1
- package/dist/{wire-DEY0ajW9.js → wire-BCJxCtHS.js} +2 -2
- package/dist/{workflow-builder-C5DBN7yq.js → workflow-builder-CynLqc6H.js} +7 -7
- 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 +6 -6
- package/dist/{workflow-sdk-Di5pmCAu.d.ts → workflow-sdk-CWdCWj7M.d.ts} +3 -3
- package/dist/{workflow-sdk-vjDWlnfX.js → workflow-sdk-QnnzIQRc.js} +2 -2
- package/dist/{workflow-sdk-world-DPMdBfzn.js → workflow-sdk-world-QzcxaaCD.js} +1 -1
- package/dist/{workflows-DJXoxDZH.d.ts → workflows-DQBCzrHC.d.ts} +4 -4
- package/dist/{workflows-DzdX28KN.js → workflows-H9qJge3f.js} +5 -5
- package/dist/yjs/index.d.ts +3 -3
- package/dist/yjs/index.js +3 -3
- package/package.json +10 -1
- package/schemas/cli-commands-v1.json +15 -0
- package/schemas/config-v1.json +47 -3
- package/schemas/doctor-report-v1.json +4 -0
- package/schemas/snapshot-v2.json +4 -0
- package/dist/cli/add-ojbcMxyp.js +0 -1
- package/dist/cli/adopt-D0ASVx2G.js +0 -1
- package/dist/cli/env-DkBe35Rv.js +0 -1
- package/dist/cli/seed-ClGWseBT.js +0 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { c as mapDbError, n as dbError, o as isDbError, r as dbErrorOf } from "./errors-
|
|
2
|
-
import { t as temporal } from "./temporal-required-
|
|
3
|
-
import { a as ok, r as err, s as toDbError, t as AsyncResult } from "./result-
|
|
1
|
+
import { c as mapDbError, n as dbError, o as isDbError, r as dbErrorOf } from "./errors-BV1SKTVs.js";
|
|
2
|
+
import { t as temporal } from "./temporal-required-nfZ87U-0.js";
|
|
3
|
+
import { a as ok, r as err, s as toDbError, t as AsyncResult } from "./result-DIeYscA3.js";
|
|
4
4
|
import { n as isRecord } from "./guards-6F2bCtQR.js";
|
|
5
|
-
import { a as postgrestExecutor, n as StatsRecorder } from "./stats-
|
|
6
|
-
import { o as problemResponse } from "./problem-
|
|
5
|
+
import { a as postgrestExecutor, n as StatsRecorder } from "./stats-Di5VAsYU.js";
|
|
6
|
+
import { o as problemResponse } from "./problem-JRCohp1j.js";
|
|
7
7
|
import { loadEnv } from "./env/index.js";
|
|
8
|
-
import { i as userContext, t as actClaim } from "./impersonation-
|
|
8
|
+
import { i as userContext, t as actClaim } from "./impersonation-DxU6yHJV.js";
|
|
9
9
|
import { t as fromPgError } from "./pg-error-BV_X8Isq.js";
|
|
10
10
|
import { i as forwardBlockEvents, t as DEFAULT_TYPE_PREFIX } from "./cloud-event-CTh9Sr5w.js";
|
|
11
11
|
import { a as replicaState, i as primaryCookieWrite, o as routedExecutor, r as pinnedUntil, s as withPrimaryPin } from "./replicas-BvIL4_jL.js";
|
|
12
|
-
import { t as authContext } from "./context-
|
|
13
|
-
import { a as narrowCap, i as delegatedClaims, r as contextClaims } from "./delegation-
|
|
14
|
-
import { d as parseCookies, h as sessionCookieName, m as serializeCookie, n as prefetchJwks, r as resolveAuth, s as AUTH_CACHE_HEADERS, u as clearSessionAtScopes } from "./resolve-
|
|
15
|
-
import { t as credentialProviderOf } from "./provider-
|
|
16
|
-
import { a as respond, n as defaultPrefetchJwks, r as guard, t as defaultExpose } from "./respond-
|
|
12
|
+
import { t as authContext } from "./context-BiwgsycK.js";
|
|
13
|
+
import { a as narrowCap, i as delegatedClaims, r as contextClaims } from "./delegation-B7uNnz6z.js";
|
|
14
|
+
import { d as parseCookies, h as sessionCookieName, m as serializeCookie, n as prefetchJwks, r as resolveAuth, s as AUTH_CACHE_HEADERS, u as clearSessionAtScopes } from "./resolve-AtncaPTU.js";
|
|
15
|
+
import { t as credentialProviderOf } from "./provider-C-Ti38J6.js";
|
|
16
|
+
import { a as respond, n as defaultPrefetchJwks, r as guard, t as defaultExpose } from "./respond-Bhp3G__q.js";
|
|
17
17
|
import { createClient } from "@supabase/supabase-js";
|
|
18
18
|
import { defineMiddleware, getEnv, pipeline, seedContext } from "@supabase/middleware";
|
|
19
19
|
import { PostgrestClient } from "@supabase/postgrest-js";
|
|
@@ -835,10 +835,19 @@ where bucket_id = $1 and name = $2 and user_metadata ->> 'supportSessionId' = $5
|
|
|
835
835
|
const OWN_COPY = `update storage.objects
|
|
836
836
|
set owner = $3::uuid, owner_id = $4, user_metadata = coalesce(user_metadata, '{}'::jsonb) || $5::jsonb
|
|
837
837
|
where bucket_id = $1 and name = $2 and owner_id is null`;
|
|
838
|
+
const OWN_SIGNED_UPLOAD = `${OWN_COPY}
|
|
839
|
+
returning name`;
|
|
838
840
|
const OWN_MOVE = `update storage.objects
|
|
839
841
|
set owner = $3::uuid, owner_id = $4, user_metadata = coalesce(user_metadata, '{}'::jsonb) || $5::jsonb
|
|
840
842
|
where bucket_id = $1 and name = $2 and owner_id is not distinct from $6`;
|
|
841
843
|
const UUID = /^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/i;
|
|
844
|
+
const OWNED = {
|
|
845
|
+
name: "StorageApiError",
|
|
846
|
+
message: "The object belongs to another user",
|
|
847
|
+
status: 403,
|
|
848
|
+
statusCode: "403",
|
|
849
|
+
code: "AccessDenied"
|
|
850
|
+
};
|
|
842
851
|
const HIDDEN_URL = "Either the object does not exist or you do not have access to it";
|
|
843
852
|
const LIST_SORT_COLUMNS = /* @__PURE__ */ new Set([
|
|
844
853
|
"name",
|
|
@@ -1094,9 +1103,17 @@ function infoOf(row) {
|
|
|
1094
1103
|
* decide as for the target's own request. Then the service client writes,
|
|
1095
1104
|
* the admin connection makes the target the owner of the stored object,
|
|
1096
1105
|
* and its `user_metadata` records the session id and the admin's id. A
|
|
1097
|
-
* refused dry run resolves to Storage's `403`.
|
|
1098
|
-
*
|
|
1099
|
-
*
|
|
1106
|
+
* refused dry run resolves to Storage's `403`.
|
|
1107
|
+
*
|
|
1108
|
+
* `createSignedUploadUrl` runs the same dry run as `upload` before the
|
|
1109
|
+
* service client signs the URL. The object a browser uploads there has no
|
|
1110
|
+
* owner, so `claimSignedUpload(bucket, path)` finishes the upload: it checks again
|
|
1111
|
+
* that the target may insert at the path, then makes the target the owner
|
|
1112
|
+
* of an object without one and stamps the session on its `user_metadata`.
|
|
1113
|
+
* An object another user owns is refused with a `403`. `uploadToSignedUrl`
|
|
1114
|
+
* claims what it stores. Every write in a read-only session resolves to a
|
|
1115
|
+
* `403` `SUPPORT_READ_ONLY` error, and without `adminSql`, `session` or a
|
|
1116
|
+
* `sql` client with `transaction` to a `403` `SUPPORT_STORAGE_WRITES` error.
|
|
1100
1117
|
*/
|
|
1101
1118
|
function supportStorage(options) {
|
|
1102
1119
|
const readOnly = options.readOnly ?? true;
|
|
@@ -1106,9 +1123,7 @@ function supportStorage(options) {
|
|
|
1106
1123
|
session
|
|
1107
1124
|
} : void 0;
|
|
1108
1125
|
const refusal = readOnly ? apiError(403, "The support session is read-only", "SUPPORT_READ_ONLY") : apiError(403, "Storage writes in a support session need adminSql, session and a sql client with transaction", "SUPPORT_STORAGE_WRITES");
|
|
1109
|
-
const signedRefusal = readOnly ? refusal : apiError(403, "Signed uploads are not available in a support session", "SUPPORT_STORAGE_WRITES");
|
|
1110
1126
|
const refuse = () => Promise.resolve(failed(refusal));
|
|
1111
|
-
const refuseSigned = () => Promise.resolve(failed(signedRefusal));
|
|
1112
1127
|
const rows = (query, values) => sql.queryRaw(query, values);
|
|
1113
1128
|
let versioned;
|
|
1114
1129
|
const upsertStatement = () => (versioned ??= rows(CURRENT_VERSION_INDEX, []).then(([row]) => row?.["versioned"] === true).catch((cause) => {
|
|
@@ -1132,277 +1147,373 @@ function supportStorage(options) {
|
|
|
1132
1147
|
throw cause;
|
|
1133
1148
|
}
|
|
1134
1149
|
};
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1150
|
+
const rehearseStore = (bucket, active, name, statement, metadata) => rehearse(async (client) => {
|
|
1151
|
+
await client.queryRaw(statement, [
|
|
1152
|
+
bucket,
|
|
1153
|
+
name,
|
|
1154
|
+
ownerOf(active.targetUserId),
|
|
1155
|
+
active.targetUserId,
|
|
1156
|
+
JSON.stringify(metadata)
|
|
1157
|
+
]);
|
|
1158
|
+
return null;
|
|
1159
|
+
});
|
|
1160
|
+
const claimFor = async (bucket, { adminSql: ownerSql, session: active }, name) => {
|
|
1161
|
+
const [claimed] = await ownerSql.queryRaw(OWN_SIGNED_UPLOAD, [
|
|
1162
|
+
bucket,
|
|
1163
|
+
name,
|
|
1164
|
+
ownerOf(active.targetUserId),
|
|
1165
|
+
active.targetUserId,
|
|
1166
|
+
JSON.stringify(stampOf(active))
|
|
1167
|
+
]);
|
|
1168
|
+
if (claimed) return {
|
|
1169
|
+
data: { path: name },
|
|
1170
|
+
error: null
|
|
1140
1171
|
};
|
|
1141
|
-
const
|
|
1172
|
+
const [found] = await ownerSql.queryRaw(SOURCE_OBJECT, [bucket, name]);
|
|
1173
|
+
if (!found) return failed(NOT_FOUND);
|
|
1174
|
+
return found["owner_id"] === active.targetUserId ? {
|
|
1175
|
+
data: { path: name },
|
|
1176
|
+
error: null
|
|
1177
|
+
} : failed(OWNED);
|
|
1178
|
+
};
|
|
1179
|
+
const claimSignedUpload = (bucket, path) => {
|
|
1180
|
+
if (!writer) return refuse();
|
|
1181
|
+
return settled(async () => {
|
|
1142
1182
|
const name = normalizePath(path);
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
});
|
|
1146
|
-
const list = (path, listOptions = {}) => settled(async () => {
|
|
1147
|
-
const problem = listProblem(listOptions);
|
|
1148
|
-
if (problem) return failed(invalid(problem));
|
|
1149
|
-
let prefix = path ?? "";
|
|
1150
|
-
if (prefix.length > 0 && !prefix.endsWith("/")) prefix = `${prefix}/`;
|
|
1151
|
-
const column = listOptions.sortBy?.column ?? "name";
|
|
1152
|
-
const escape = column !== "name";
|
|
1153
|
-
const safePrefix = escape ? escapeLike(prefix) : prefix;
|
|
1154
|
-
const search = listOptions.search ?? "";
|
|
1155
|
-
const safeSearch = escape ? escapeLike(search) : search;
|
|
1156
|
-
return {
|
|
1157
|
-
data: (await rows(SEARCH, [
|
|
1158
|
-
safePrefix,
|
|
1159
|
-
bucket,
|
|
1160
|
-
listOptions.limit ?? 100,
|
|
1161
|
-
(safePrefix + safeSearch).split("/").length,
|
|
1162
|
-
listOptions.offset ?? 0,
|
|
1163
|
-
safeSearch,
|
|
1164
|
-
column,
|
|
1165
|
-
listOptions.sortBy?.order ?? "asc"
|
|
1166
|
-
])).map(listEntryOf),
|
|
1167
|
-
error: null
|
|
1168
|
-
};
|
|
1169
|
-
});
|
|
1170
|
-
const listV2 = (listOptions = {}) => settled(async () => {
|
|
1171
|
-
const problem = listV2Problem(listOptions);
|
|
1172
|
-
if (problem) return failed(invalid(problem));
|
|
1173
|
-
const limit = Math.min(listOptions.limit ?? 1e3, 1e3);
|
|
1174
|
-
const prefix = listOptions.prefix ?? "";
|
|
1175
|
-
const cursor = listOptions.cursor ? decodeCursor(listOptions.cursor) : void 0;
|
|
1176
|
-
if (listOptions.cursor && !cursor) return failed(apiError(400, "Invalid continuation token", "InvalidParameter"));
|
|
1177
|
-
const sortOrder = filled(cursor?.sortOrder) ?? listOptions.sortBy?.order;
|
|
1178
|
-
const sortColumn = filled(cursor?.sortColumn) ?? listOptions.sortBy?.column;
|
|
1179
|
-
let found;
|
|
1180
|
-
if (listOptions.with_delimiter) found = await rows(SEARCH_V2, [
|
|
1181
|
-
prefix,
|
|
1182
|
-
bucket,
|
|
1183
|
-
limit + 1,
|
|
1184
|
-
prefix ? prefix.split("/").length : 1,
|
|
1185
|
-
cursor?.startAfter ?? "",
|
|
1186
|
-
sortOrder ?? "asc",
|
|
1187
|
-
sortColumn ?? "name",
|
|
1188
|
-
filled(cursor?.sortColumnAfter) ?? null
|
|
1189
|
-
]);
|
|
1190
|
-
else {
|
|
1191
|
-
const page = flatPage(bucket, listOptions.prefix, limit + 1, cursor, sortColumn, sortOrder);
|
|
1192
|
-
found = await rows(page.text, page.values);
|
|
1193
|
-
}
|
|
1194
|
-
const entries = listOptions.with_delimiter ? delimited(found, prefix) : found;
|
|
1195
|
-
const hasNext = entries.length > limit;
|
|
1196
|
-
const count = hasNext ? limit : entries.length;
|
|
1197
|
-
const folders = [];
|
|
1198
|
-
const objects = [];
|
|
1199
|
-
for (const entry of entries.slice(0, count)) if (entry["id"] === null || entry["id"] === void 0) folders.push(folderOf(entry));
|
|
1200
|
-
else objects.push(objectOf(entry));
|
|
1201
|
-
const last = entries[count - 1];
|
|
1202
|
-
const after = last && sortColumn && sortColumn !== "name" ? iso(last[sortColumn]) : void 0;
|
|
1203
|
-
const nextCursor = hasNext && last ? encodeCursor({
|
|
1204
|
-
startAfter: String(last["name"]),
|
|
1205
|
-
...sortOrder ? { sortOrder } : {},
|
|
1206
|
-
...sortColumn ? { sortColumn } : {},
|
|
1207
|
-
...typeof after === "string" ? { sortColumnAfter: new Date(after).toISOString() } : {}
|
|
1208
|
-
}) : void 0;
|
|
1209
|
-
return {
|
|
1210
|
-
data: {
|
|
1211
|
-
hasNext,
|
|
1212
|
-
...nextCursor === void 0 ? {} : { nextCursor },
|
|
1213
|
-
folders,
|
|
1214
|
-
objects
|
|
1215
|
-
},
|
|
1216
|
-
error: null
|
|
1217
|
-
};
|
|
1218
|
-
});
|
|
1219
|
-
const store = (method) => (path, body, fileOptions = {}) => {
|
|
1220
|
-
if (!writer) return refuse();
|
|
1221
|
-
const { adminSql: ownerSql, session: active } = writer;
|
|
1222
|
-
return settled(async () => {
|
|
1223
|
-
const name = normalizePath(path);
|
|
1224
|
-
const owner = ownerOf(active.targetUserId);
|
|
1225
|
-
const metadata = {
|
|
1226
|
-
...fileOptions.metadata,
|
|
1227
|
-
...stampOf(active)
|
|
1228
|
-
};
|
|
1229
|
-
const statement = method === "update" || fileOptions.upsert === true ? await upsertStatement() : INSERT_OBJECT;
|
|
1230
|
-
const refused = await rehearse(async (client) => {
|
|
1231
|
-
await client.queryRaw(statement, [
|
|
1232
|
-
bucket,
|
|
1233
|
-
name,
|
|
1234
|
-
owner,
|
|
1235
|
-
active.targetUserId,
|
|
1236
|
-
JSON.stringify(metadata)
|
|
1237
|
-
]);
|
|
1238
|
-
return null;
|
|
1239
|
-
});
|
|
1240
|
-
if (refused) return failed(refused);
|
|
1241
|
-
const reply = await admin()[method](name, body, {
|
|
1242
|
-
...fileOptions,
|
|
1243
|
-
metadata
|
|
1244
|
-
});
|
|
1245
|
-
if (reply.error) return reply;
|
|
1183
|
+
const active = writer.session;
|
|
1184
|
+
const refused = await rehearse(async (client) => {
|
|
1246
1185
|
try {
|
|
1247
|
-
await
|
|
1186
|
+
await client.queryRaw(INSERT_OBJECT, [
|
|
1248
1187
|
bucket,
|
|
1249
1188
|
name,
|
|
1250
|
-
|
|
1189
|
+
ownerOf(active.targetUserId),
|
|
1251
1190
|
active.targetUserId,
|
|
1252
|
-
active
|
|
1191
|
+
JSON.stringify(stampOf(active))
|
|
1253
1192
|
]);
|
|
1254
1193
|
} catch (cause) {
|
|
1255
|
-
|
|
1256
|
-
|
|
1194
|
+
if (fromPgError(cause)?.code === "23505") return null;
|
|
1195
|
+
throw cause;
|
|
1257
1196
|
}
|
|
1258
|
-
return
|
|
1197
|
+
return NOT_FOUND;
|
|
1259
1198
|
});
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
const
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
await client.queryRaw(INSERT_OBJECT, [
|
|
1277
|
-
target,
|
|
1278
|
-
name,
|
|
1279
|
-
owner,
|
|
1280
|
-
active.targetUserId,
|
|
1281
|
-
stamp
|
|
1282
|
-
]);
|
|
1283
|
-
return null;
|
|
1284
|
-
}
|
|
1285
|
-
const [moved] = await client.queryRaw(MOVE_OBJECT, [
|
|
1286
|
-
bucket,
|
|
1287
|
-
source,
|
|
1288
|
-
target,
|
|
1289
|
-
name,
|
|
1290
|
-
owner,
|
|
1291
|
-
active.targetUserId
|
|
1292
|
-
]);
|
|
1293
|
-
return moved ? null : NOT_FOUND;
|
|
1294
|
-
});
|
|
1295
|
-
if (refused) return failed(refused);
|
|
1296
|
-
const reply = await admin()[method](source, name, destination);
|
|
1297
|
-
if (reply.error) return reply;
|
|
1298
|
-
try {
|
|
1299
|
-
await (method === "copy" ? ownerSql.queryRaw(OWN_COPY, [
|
|
1300
|
-
target,
|
|
1301
|
-
name,
|
|
1302
|
-
owner,
|
|
1303
|
-
active.targetUserId,
|
|
1304
|
-
stamp
|
|
1305
|
-
]) : ownerSql.queryRaw(OWN_MOVE, [
|
|
1306
|
-
target,
|
|
1307
|
-
name,
|
|
1308
|
-
owner,
|
|
1309
|
-
active.targetUserId,
|
|
1310
|
-
stamp,
|
|
1311
|
-
previousOwner
|
|
1312
|
-
]));
|
|
1313
|
-
} catch (cause) {
|
|
1314
|
-
const written = options.admin.from(target);
|
|
1315
|
-
await (method === "copy" ? written.remove([name]) : written.move(name, source, { destinationBucket: bucket }));
|
|
1316
|
-
return failed(sqlFailure(cause));
|
|
1317
|
-
}
|
|
1318
|
-
return reply;
|
|
1199
|
+
if (refused) return failed(refused);
|
|
1200
|
+
return claimFor(bucket, writer, name);
|
|
1201
|
+
});
|
|
1202
|
+
};
|
|
1203
|
+
return {
|
|
1204
|
+
claimSignedUpload,
|
|
1205
|
+
from(bucket) {
|
|
1206
|
+
const admin = () => options.admin.from(bucket);
|
|
1207
|
+
const visible = async (path) => {
|
|
1208
|
+
const [row] = await rows(VISIBLE_OBJECT, [bucket, path]);
|
|
1209
|
+
return row?.["visible"] === true;
|
|
1210
|
+
};
|
|
1211
|
+
const checked = (path, read) => settled(async () => {
|
|
1212
|
+
const name = normalizePath(path);
|
|
1213
|
+
if (!await visible(name)) return failed(NOT_FOUND);
|
|
1214
|
+
return read(name);
|
|
1319
1215
|
});
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
const
|
|
1329
|
-
const
|
|
1330
|
-
|
|
1331
|
-
await
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1216
|
+
const list = (path, listOptions = {}) => settled(async () => {
|
|
1217
|
+
const problem = listProblem(listOptions);
|
|
1218
|
+
if (problem) return failed(invalid(problem));
|
|
1219
|
+
let prefix = path ?? "";
|
|
1220
|
+
if (prefix.length > 0 && !prefix.endsWith("/")) prefix = `${prefix}/`;
|
|
1221
|
+
const column = listOptions.sortBy?.column ?? "name";
|
|
1222
|
+
const escape = column !== "name";
|
|
1223
|
+
const safePrefix = escape ? escapeLike(prefix) : prefix;
|
|
1224
|
+
const search = listOptions.search ?? "";
|
|
1225
|
+
const safeSearch = escape ? escapeLike(search) : search;
|
|
1226
|
+
return {
|
|
1227
|
+
data: (await rows(SEARCH, [
|
|
1228
|
+
safePrefix,
|
|
1229
|
+
bucket,
|
|
1230
|
+
listOptions.limit ?? 100,
|
|
1231
|
+
(safePrefix + safeSearch).split("/").length,
|
|
1232
|
+
listOptions.offset ?? 0,
|
|
1233
|
+
safeSearch,
|
|
1234
|
+
column,
|
|
1235
|
+
listOptions.sortBy?.order ?? "asc"
|
|
1236
|
+
])).map(listEntryOf),
|
|
1340
1237
|
error: null
|
|
1341
1238
|
};
|
|
1342
|
-
return admin().remove(permitted);
|
|
1343
1239
|
});
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
const [row] = await rows(versionId === void 0 ? OBJECT_INFO : `${OBJECT_INFO} and o.version = $3`, versionId === void 0 ? [bucket, name] : [
|
|
1240
|
+
const listV2 = (listOptions = {}) => settled(async () => {
|
|
1241
|
+
const problem = listV2Problem(listOptions);
|
|
1242
|
+
if (problem) return failed(invalid(problem));
|
|
1243
|
+
const limit = Math.min(listOptions.limit ?? 1e3, 1e3);
|
|
1244
|
+
const prefix = listOptions.prefix ?? "";
|
|
1245
|
+
const cursor = listOptions.cursor ? decodeCursor(listOptions.cursor) : void 0;
|
|
1246
|
+
if (listOptions.cursor && !cursor) return failed(apiError(400, "Invalid continuation token", "InvalidParameter"));
|
|
1247
|
+
const sortOrder = filled(cursor?.sortOrder) ?? listOptions.sortBy?.order;
|
|
1248
|
+
const sortColumn = filled(cursor?.sortColumn) ?? listOptions.sortBy?.column;
|
|
1249
|
+
let found;
|
|
1250
|
+
if (listOptions.with_delimiter) found = await rows(SEARCH_V2, [
|
|
1251
|
+
prefix,
|
|
1357
1252
|
bucket,
|
|
1358
|
-
|
|
1359
|
-
|
|
1253
|
+
limit + 1,
|
|
1254
|
+
prefix ? prefix.split("/").length : 1,
|
|
1255
|
+
cursor?.startAfter ?? "",
|
|
1256
|
+
sortOrder ?? "asc",
|
|
1257
|
+
sortColumn ?? "name",
|
|
1258
|
+
filled(cursor?.sortColumnAfter) ?? null
|
|
1360
1259
|
]);
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
error: null
|
|
1365
|
-
} : failed(NOT_FOUND);
|
|
1366
|
-
}),
|
|
1367
|
-
download: (path, downloadOptions, parameters) => checked(path, (name) => admin().download(name, downloadOptions, parameters)),
|
|
1368
|
-
createSignedUrl: (path, expiresIn, urlOptions) => checked(path, (name) => admin().createSignedUrl(name, expiresIn, urlOptions)),
|
|
1369
|
-
createSignedUrls: (paths, expiresIn, urlOptions) => settled(async () => {
|
|
1370
|
-
const names = paths.map(normalizePath);
|
|
1371
|
-
const seen = new Set((await rows(VISIBLE_OBJECTS, [bucket, names])).map((row) => String(row["path"])));
|
|
1372
|
-
const shown = [...new Set(names.filter((name) => seen.has(name)))];
|
|
1373
|
-
const signed = /* @__PURE__ */ new Map();
|
|
1374
|
-
if (shown.length > 0) {
|
|
1375
|
-
const reply = await admin().createSignedUrls(shown, expiresIn, urlOptions);
|
|
1376
|
-
if (reply.error) return failed(reply.error);
|
|
1377
|
-
for (const entry of reply.data) if (entry.path !== null) signed.set(entry.path, entry);
|
|
1260
|
+
else {
|
|
1261
|
+
const page = flatPage(bucket, listOptions.prefix, limit + 1, cursor, sortColumn, sortOrder);
|
|
1262
|
+
found = await rows(page.text, page.values);
|
|
1378
1263
|
}
|
|
1264
|
+
const entries = listOptions.with_delimiter ? delimited(found, prefix) : found;
|
|
1265
|
+
const hasNext = entries.length > limit;
|
|
1266
|
+
const count = hasNext ? limit : entries.length;
|
|
1267
|
+
const folders = [];
|
|
1268
|
+
const objects = [];
|
|
1269
|
+
for (const entry of entries.slice(0, count)) if (entry["id"] === null || entry["id"] === void 0) folders.push(folderOf(entry));
|
|
1270
|
+
else objects.push(objectOf(entry));
|
|
1271
|
+
const last = entries[count - 1];
|
|
1272
|
+
const after = last && sortColumn && sortColumn !== "name" ? iso(last[sortColumn]) : void 0;
|
|
1273
|
+
const nextCursor = hasNext && last ? encodeCursor({
|
|
1274
|
+
startAfter: String(last["name"]),
|
|
1275
|
+
...sortOrder ? { sortOrder } : {},
|
|
1276
|
+
...sortColumn ? { sortColumn } : {},
|
|
1277
|
+
...typeof after === "string" ? { sortColumnAfter: new Date(after).toISOString() } : {}
|
|
1278
|
+
}) : void 0;
|
|
1379
1279
|
return {
|
|
1380
|
-
data:
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1280
|
+
data: {
|
|
1281
|
+
hasNext,
|
|
1282
|
+
...nextCursor === void 0 ? {} : { nextCursor },
|
|
1283
|
+
folders,
|
|
1284
|
+
objects
|
|
1285
|
+
},
|
|
1385
1286
|
error: null
|
|
1386
1287
|
};
|
|
1387
|
-
})
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1288
|
+
});
|
|
1289
|
+
const createSignedUploadUrl = (path, uploadOptions) => {
|
|
1290
|
+
if (!writer) return refuse();
|
|
1291
|
+
return settled(async () => {
|
|
1292
|
+
const name = normalizePath(path);
|
|
1293
|
+
const statement = uploadOptions?.upsert === true ? await upsertStatement() : INSERT_OBJECT;
|
|
1294
|
+
const refused = await rehearseStore(bucket, writer.session, name, statement, stampOf(writer.session));
|
|
1295
|
+
if (refused) return failed(refused);
|
|
1296
|
+
return admin().createSignedUploadUrl(name, uploadOptions);
|
|
1297
|
+
});
|
|
1298
|
+
};
|
|
1299
|
+
const uploadToSignedUrl = (path, token, body, fileOptions = {}) => {
|
|
1300
|
+
if (!writer) return refuse();
|
|
1301
|
+
return settled(async () => {
|
|
1302
|
+
const name = normalizePath(path);
|
|
1303
|
+
const metadata = {
|
|
1304
|
+
...fileOptions.metadata,
|
|
1305
|
+
...stampOf(writer.session)
|
|
1306
|
+
};
|
|
1307
|
+
const statement = fileOptions.upsert === true ? await upsertStatement() : INSERT_OBJECT;
|
|
1308
|
+
const refused = await rehearseStore(bucket, writer.session, name, statement, metadata);
|
|
1309
|
+
if (refused) return failed(refused);
|
|
1310
|
+
const reply = await admin().uploadToSignedUrl(name, token, body, {
|
|
1311
|
+
...fileOptions,
|
|
1312
|
+
metadata
|
|
1313
|
+
});
|
|
1314
|
+
if (reply.error) return reply;
|
|
1315
|
+
try {
|
|
1316
|
+
const claimed = await claimFor(bucket, writer, name);
|
|
1317
|
+
return claimed.error ? claimed : reply;
|
|
1318
|
+
} catch (cause) {
|
|
1319
|
+
await admin().remove([name]);
|
|
1320
|
+
return failed(sqlFailure(cause));
|
|
1321
|
+
}
|
|
1322
|
+
});
|
|
1323
|
+
};
|
|
1324
|
+
const store = (method) => (path, body, fileOptions = {}) => {
|
|
1325
|
+
if (!writer) return refuse();
|
|
1326
|
+
const { adminSql: ownerSql, session: active } = writer;
|
|
1327
|
+
return settled(async () => {
|
|
1328
|
+
const name = normalizePath(path);
|
|
1329
|
+
const owner = ownerOf(active.targetUserId);
|
|
1330
|
+
const metadata = {
|
|
1331
|
+
...fileOptions.metadata,
|
|
1332
|
+
...stampOf(active)
|
|
1333
|
+
};
|
|
1334
|
+
const statement = method === "update" || fileOptions.upsert === true ? await upsertStatement() : INSERT_OBJECT;
|
|
1335
|
+
const refused = await rehearseStore(bucket, active, name, statement, metadata);
|
|
1336
|
+
if (refused) return failed(refused);
|
|
1337
|
+
const reply = await admin()[method](name, body, {
|
|
1338
|
+
...fileOptions,
|
|
1339
|
+
metadata
|
|
1340
|
+
});
|
|
1341
|
+
if (reply.error) return reply;
|
|
1342
|
+
try {
|
|
1343
|
+
await ownerSql.queryRaw(OWN_UPLOAD, [
|
|
1344
|
+
bucket,
|
|
1345
|
+
name,
|
|
1346
|
+
owner,
|
|
1347
|
+
active.targetUserId,
|
|
1348
|
+
active.id
|
|
1349
|
+
]);
|
|
1350
|
+
} catch (cause) {
|
|
1351
|
+
await admin().remove([name]);
|
|
1352
|
+
return failed(sqlFailure(cause));
|
|
1353
|
+
}
|
|
1354
|
+
return reply;
|
|
1355
|
+
});
|
|
1356
|
+
};
|
|
1357
|
+
const relocate = (method) => (from, to, destination = {}) => {
|
|
1358
|
+
if (!writer) return refuse();
|
|
1359
|
+
const { adminSql: ownerSql, session: active } = writer;
|
|
1360
|
+
return settled(async () => {
|
|
1361
|
+
const source = normalizePath(from);
|
|
1362
|
+
const name = normalizePath(to);
|
|
1363
|
+
const target = destination.destinationBucket ?? bucket;
|
|
1364
|
+
const owner = ownerOf(active.targetUserId);
|
|
1365
|
+
const stamp = JSON.stringify(stampOf(active));
|
|
1366
|
+
let previousOwner = null;
|
|
1367
|
+
const refused = await rehearse(async (client) => {
|
|
1368
|
+
const [found] = await client.queryRaw(SOURCE_OBJECT, [bucket, source]);
|
|
1369
|
+
if (!found) return NOT_FOUND;
|
|
1370
|
+
previousOwner = text(found["owner_id"]) ?? null;
|
|
1371
|
+
if (method === "copy") {
|
|
1372
|
+
await client.queryRaw(INSERT_OBJECT, [
|
|
1373
|
+
target,
|
|
1374
|
+
name,
|
|
1375
|
+
owner,
|
|
1376
|
+
active.targetUserId,
|
|
1377
|
+
stamp
|
|
1378
|
+
]);
|
|
1379
|
+
return null;
|
|
1380
|
+
}
|
|
1381
|
+
const [moved] = await client.queryRaw(MOVE_OBJECT, [
|
|
1382
|
+
bucket,
|
|
1383
|
+
source,
|
|
1384
|
+
target,
|
|
1385
|
+
name,
|
|
1386
|
+
owner,
|
|
1387
|
+
active.targetUserId
|
|
1388
|
+
]);
|
|
1389
|
+
return moved ? null : NOT_FOUND;
|
|
1390
|
+
});
|
|
1391
|
+
if (refused) return failed(refused);
|
|
1392
|
+
const reply = await admin()[method](source, name, destination);
|
|
1393
|
+
if (reply.error) return reply;
|
|
1394
|
+
try {
|
|
1395
|
+
await (method === "copy" ? ownerSql.queryRaw(OWN_COPY, [
|
|
1396
|
+
target,
|
|
1397
|
+
name,
|
|
1398
|
+
owner,
|
|
1399
|
+
active.targetUserId,
|
|
1400
|
+
stamp
|
|
1401
|
+
]) : ownerSql.queryRaw(OWN_MOVE, [
|
|
1402
|
+
target,
|
|
1403
|
+
name,
|
|
1404
|
+
owner,
|
|
1405
|
+
active.targetUserId,
|
|
1406
|
+
stamp,
|
|
1407
|
+
previousOwner
|
|
1408
|
+
]));
|
|
1409
|
+
} catch (cause) {
|
|
1410
|
+
const written = options.admin.from(target);
|
|
1411
|
+
await (method === "copy" ? written.remove([name]) : written.move(name, source, { destinationBucket: bucket }));
|
|
1412
|
+
return failed(sqlFailure(cause));
|
|
1413
|
+
}
|
|
1414
|
+
return reply;
|
|
1415
|
+
});
|
|
1416
|
+
};
|
|
1417
|
+
const remove = (paths) => {
|
|
1418
|
+
if (!writer) return refuse();
|
|
1419
|
+
return settled(async () => {
|
|
1420
|
+
const entries = paths.map((entry) => typeof entry === "string" ? normalizePath(entry) : {
|
|
1421
|
+
...entry,
|
|
1422
|
+
path: normalizePath(entry.path)
|
|
1423
|
+
});
|
|
1424
|
+
const names = entries.map((entry) => typeof entry === "string" ? entry : entry.path);
|
|
1425
|
+
const removable = /* @__PURE__ */ new Set();
|
|
1426
|
+
const refused = await rehearse(async (client) => {
|
|
1427
|
+
await client.queryRaw(ALLOW_DELETE);
|
|
1428
|
+
const deleted = await client.queryRaw(DELETE_OBJECTS, [bucket, [...new Set(names)]]);
|
|
1429
|
+
for (const row of deleted) removable.add(String(row["name"]));
|
|
1430
|
+
return null;
|
|
1431
|
+
});
|
|
1432
|
+
if (refused) return failed(refused);
|
|
1433
|
+
const permitted = entries.filter((_, index) => removable.has(names[index] ?? ""));
|
|
1434
|
+
if (permitted.length === 0) return {
|
|
1435
|
+
data: [],
|
|
1436
|
+
error: null
|
|
1437
|
+
};
|
|
1438
|
+
return admin().remove(permitted);
|
|
1439
|
+
});
|
|
1440
|
+
};
|
|
1441
|
+
return {
|
|
1442
|
+
exists: (path) => settled(async () => ({
|
|
1443
|
+
data: await visible(normalizePath(path)),
|
|
1444
|
+
error: null
|
|
1445
|
+
})).then((reply) => reply.error === null ? reply : {
|
|
1446
|
+
data: false,
|
|
1447
|
+
error: reply.error
|
|
1448
|
+
}),
|
|
1449
|
+
info: (path, infoOptions) => settled(async () => {
|
|
1450
|
+
const versionId = infoOptions?.versionId;
|
|
1451
|
+
const name = normalizePath(path);
|
|
1452
|
+
const [row] = await rows(versionId === void 0 ? OBJECT_INFO : `${OBJECT_INFO} and o.version = $3`, versionId === void 0 ? [bucket, name] : [
|
|
1453
|
+
bucket,
|
|
1454
|
+
name,
|
|
1455
|
+
versionId
|
|
1456
|
+
]);
|
|
1457
|
+
const object = row?.["object"];
|
|
1458
|
+
return isRecord(object) ? {
|
|
1459
|
+
data: infoOf(object),
|
|
1460
|
+
error: null
|
|
1461
|
+
} : failed(NOT_FOUND);
|
|
1462
|
+
}),
|
|
1463
|
+
download: (path, downloadOptions, parameters) => checked(path, (name) => admin().download(name, downloadOptions, parameters)),
|
|
1464
|
+
createSignedUrl: (path, expiresIn, urlOptions) => checked(path, (name) => admin().createSignedUrl(name, expiresIn, urlOptions)),
|
|
1465
|
+
createSignedUrls: (paths, expiresIn, urlOptions) => settled(async () => {
|
|
1466
|
+
const names = paths.map(normalizePath);
|
|
1467
|
+
const seen = new Set((await rows(VISIBLE_OBJECTS, [bucket, names])).map((row) => String(row["path"])));
|
|
1468
|
+
const shown = [...new Set(names.filter((name) => seen.has(name)))];
|
|
1469
|
+
const signed = /* @__PURE__ */ new Map();
|
|
1470
|
+
if (shown.length > 0) {
|
|
1471
|
+
const reply = await admin().createSignedUrls(shown, expiresIn, urlOptions);
|
|
1472
|
+
if (reply.error) return failed(reply.error);
|
|
1473
|
+
for (const entry of reply.data) if (entry.path !== null) signed.set(entry.path, entry);
|
|
1474
|
+
}
|
|
1475
|
+
return {
|
|
1476
|
+
data: names.map((name) => signed.get(name) ?? {
|
|
1477
|
+
error: HIDDEN_URL,
|
|
1478
|
+
path: name,
|
|
1479
|
+
signedUrl: null
|
|
1480
|
+
}),
|
|
1481
|
+
error: null
|
|
1482
|
+
};
|
|
1483
|
+
}),
|
|
1484
|
+
getPublicUrl: (path, urlOptions) => admin().getPublicUrl(path, urlOptions),
|
|
1485
|
+
list,
|
|
1486
|
+
listV2,
|
|
1487
|
+
upload: store("upload"),
|
|
1488
|
+
update: store("update"),
|
|
1489
|
+
createSignedUploadUrl,
|
|
1490
|
+
uploadToSignedUrl,
|
|
1491
|
+
remove,
|
|
1492
|
+
copy: relocate("copy"),
|
|
1493
|
+
move: relocate("move"),
|
|
1494
|
+
purgeCache: (path, cacheOptions, parameters) => writer ? checked(path, (name) => admin().purgeCache(name, cacheOptions, parameters)) : refuse()
|
|
1495
|
+
};
|
|
1496
|
+
}
|
|
1497
|
+
};
|
|
1401
1498
|
}
|
|
1402
1499
|
//#endregion
|
|
1403
1500
|
//#region src/server/server.ts
|
|
1501
|
+
/** The header `better_supabase.acting_member()` reads for a service caller. */
|
|
1502
|
+
const ACTOR_HEADER = "x-bs-actor";
|
|
1404
1503
|
/** The environment as `getEnv` resolves it, one variable at a time. */
|
|
1405
1504
|
const RUNTIME_ENV = new Proxy({}, { get: (_target, key) => typeof key === "string" ? getEnv(key) : void 0 });
|
|
1505
|
+
/**
|
|
1506
|
+
* `options.env` as given when it is loaded already, parsed when it is a
|
|
1507
|
+
* variable map (never merged with the runtime's), else the runtime's.
|
|
1508
|
+
*/
|
|
1509
|
+
function envOf(env) {
|
|
1510
|
+
if (env === void 0) return loadEnv(RUNTIME_ENV);
|
|
1511
|
+
return isLoadedEnv(env) ? env : loadEnv(env);
|
|
1512
|
+
}
|
|
1513
|
+
/** An `EnvSource` holds only strings, so a `URL` in `jwksUrl` means a loaded env. */
|
|
1514
|
+
function isLoadedEnv(env) {
|
|
1515
|
+
return env.jwksUrl instanceof URL;
|
|
1516
|
+
}
|
|
1406
1517
|
const needsPostgres = (method) => dbError("invalid_request", `${method} needs createServer(betterSupabase, { postgres: createPostgres() })`);
|
|
1407
1518
|
/**
|
|
1408
1519
|
* A framework adapter's server: `server` plus the adapter's own methods,
|
|
@@ -1424,7 +1535,7 @@ function extendServer(server, extra) {
|
|
|
1424
1535
|
function createServer(betterSupabase, options = {}) {
|
|
1425
1536
|
const credentials = options.credentials === void 0 ? {} : { credentials: credentialProviderOf(options.credentials) };
|
|
1426
1537
|
let loaded;
|
|
1427
|
-
const env = () => loaded ??= options.env
|
|
1538
|
+
const env = () => loaded ??= envOf(options.env);
|
|
1428
1539
|
const lite = liteBackend(options, env);
|
|
1429
1540
|
if (lite === void 0 && (options.prefetchJwks ?? defaultPrefetchJwks()) && options.auth?.jwks === void 0) try {
|
|
1430
1541
|
prefetchJwks({
|
|
@@ -1448,10 +1559,17 @@ function createServer(betterSupabase, options = {}) {
|
|
|
1448
1559
|
const dbFor = (auth, context = {}) => {
|
|
1449
1560
|
let supabase;
|
|
1450
1561
|
const rest = restAt(env().url, auth);
|
|
1562
|
+
const storage = { from: (bucket) => (supabase ??= supabaseFor(auth)).storage.from(bucket) };
|
|
1451
1563
|
const db = betterSupabase.connect(rest, {
|
|
1452
1564
|
...authContext(auth),
|
|
1453
1565
|
...context
|
|
1454
|
-
}, auth.kind === "invalid" ? {
|
|
1566
|
+
}, auth.kind === "invalid" ? {
|
|
1567
|
+
executor: refusingExecutor(auth.error),
|
|
1568
|
+
storage
|
|
1569
|
+
} : tunedExecutor ? {
|
|
1570
|
+
executor: postgrestExecutor(rest, executorOptions),
|
|
1571
|
+
storage
|
|
1572
|
+
} : { storage });
|
|
1455
1573
|
return withLazyClient(db, () => supabase ??= supabaseFor(auth));
|
|
1456
1574
|
};
|
|
1457
1575
|
const sqlFor = (claims, context, stats, session, storage) => {
|
|
@@ -1651,6 +1769,7 @@ function createServer(betterSupabase, options = {}) {
|
|
|
1651
1769
|
const rest = (sharesClient ? void 0 : supabase) ?? restAt(env().url, auth, headers);
|
|
1652
1770
|
const connected = betterSupabase.connect(rest, context, {
|
|
1653
1771
|
stats: recorder,
|
|
1772
|
+
storage: { from: (bucket) => client().storage.from(bucket) },
|
|
1654
1773
|
...auth.kind === "invalid" ? { executor: refusingExecutor(auth.error) } : url && replica ? { executor: routedExecutor(postgrestExecutor(rest, executorOptions), postgrestExecutor(restAt(url, auth, headers), executorOptions), replica) } : tunedExecutor ? { executor: postgrestExecutor(rest, executorOptions) } : {}
|
|
1655
1774
|
});
|
|
1656
1775
|
db = withLazyClient(connected, client);
|
|
@@ -1762,9 +1881,12 @@ function createServer(betterSupabase, options = {}) {
|
|
|
1762
1881
|
return resolving;
|
|
1763
1882
|
},
|
|
1764
1883
|
contextFromResolution: (resolution, request, contextOptions = {}) => fromResolution(resolution, request, contextOptions, contextOptions.tenant ?? syncTenant(request, resolution.auth)),
|
|
1765
|
-
admin: (context = {}) => {
|
|
1766
|
-
const client = serviceClient()
|
|
1767
|
-
|
|
1884
|
+
admin: (context = {}, adminOptions = {}) => {
|
|
1885
|
+
const client = adminOptions.as === void 0 ? serviceClient() : supabaseFor({
|
|
1886
|
+
kind: "service",
|
|
1887
|
+
keyName: "secret"
|
|
1888
|
+
}, { [ACTOR_HEADER]: adminOptions.as });
|
|
1889
|
+
const db = betterSupabase.connect(client, {
|
|
1768
1890
|
actor: {
|
|
1769
1891
|
id: "service",
|
|
1770
1892
|
kind: "service",
|
|
@@ -1773,6 +1895,7 @@ function createServer(betterSupabase, options = {}) {
|
|
|
1773
1895
|
claims: { role: "service_role" },
|
|
1774
1896
|
...context
|
|
1775
1897
|
}, tunedExecutor ? { executor: postgrestExecutor(client, executorOptions) } : {});
|
|
1898
|
+
return Object.defineProperty(db, "$authAdmin", { get: () => client.auth.admin });
|
|
1776
1899
|
},
|
|
1777
1900
|
support,
|
|
1778
1901
|
deleteAccount: (userId, deleteOptions) => deleteAccount(betterSupabase, serviceClient, userId, {
|