better-supabase 0.5.1 → 0.6.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 +187 -46
- package/dist/access-sql-B0dF-SoF.js +181 -0
- package/dist/{actor-DaJjqD5R.d.ts → actor-CQTlc1Hh.d.ts} +1 -1
- package/dist/adapter-Bc1o3zyy.js +1106 -0
- package/dist/agents-CVHGd7It.d.ts +94 -0
- package/dist/ai-cache-CBWs1W0k.js +80 -0
- package/dist/ai-cache-DaDu_G5L.d.ts +64 -0
- package/dist/ai-chat-7amvXjmQ.d.ts +590 -0
- package/dist/ai-chat-B24UI962.js +743 -0
- package/dist/ai-files-CSPNswUY.js +319 -0
- package/dist/ai-sdk/agents/index.d.ts +74 -0
- package/dist/ai-sdk/agents/index.js +159 -0
- package/dist/ai-sdk/batches/index.d.ts +74 -0
- package/dist/ai-sdk/batches/index.js +180 -0
- package/dist/ai-sdk/cache/index.d.ts +38 -0
- package/dist/ai-sdk/cache/index.js +127 -0
- package/dist/ai-sdk/chat/index.d.ts +2 -0
- package/dist/ai-sdk/chat/index.js +246 -0
- package/dist/ai-sdk/embeddings/index.d.ts +3 -0
- package/dist/ai-sdk/embeddings/index.js +2 -0
- package/dist/ai-sdk/files/index.d.ts +61 -0
- package/dist/ai-sdk/files/index.js +111 -0
- package/dist/ai-sdk/index.d.ts +145 -0
- package/dist/ai-sdk/index.js +174 -0
- package/dist/ai-sdk/mcp/index.d.ts +102 -0
- package/dist/ai-sdk/mcp/index.js +362 -0
- package/dist/ai-sdk/memory/index.d.ts +67 -0
- package/dist/ai-sdk/memory/index.js +175 -0
- package/dist/ai-sdk/react/index.d.ts +2 -0
- package/dist/ai-sdk/react/index.js +3 -0
- package/dist/ai-sdk/react/server.d.ts +6 -0
- package/dist/ai-sdk/react/server.js +7 -0
- package/dist/ai-sdk/workflow/index.d.ts +249 -0
- package/dist/ai-sdk/workflow/index.js +575 -0
- package/dist/ai-sdk/workflow/react/index.d.ts +20 -0
- package/dist/ai-sdk/workflow/react/index.js +66 -0
- package/dist/ai-sdk/workflow/react/server.d.ts +10 -0
- package/dist/ai-sdk/workflow/react/server.js +12 -0
- package/dist/ai-tasks-Cd1HMFvB.d.ts +131 -0
- package/dist/announcements-CiyOs-xP.js +107 -0
- package/dist/announcements-ZRGnScWI.d.ts +72 -0
- package/dist/api-keys-rCGtKaZA.d.ts +156 -0
- package/dist/assistant-DwdpDH1q.d.ts +147 -0
- package/dist/astro/index.d.ts +86 -0
- package/dist/astro/index.js +93 -0
- package/dist/attributes-5dYul0u0.js +13 -0
- package/dist/auth-link-BjFPqwLz.d.ts +97 -0
- package/dist/auth-link-DrDX9KOT.js +114 -0
- package/dist/authorization-BFCqamMs.d.ts +172 -0
- package/dist/before-route-CnR0C0Jr.js +30 -0
- package/dist/bind-Bu_ZNa3W.d.ts +62 -0
- package/dist/bind-l4kAvYSv.js +97 -0
- package/dist/block-events-CrT8r7Fe.js +76 -0
- package/dist/block-fields-GFkxl4dP.js +49 -0
- package/dist/block-fields-SJ6fEf3o.d.ts +31 -0
- package/dist/block-helpers-CKtbFcRv.d.ts +37 -0
- package/dist/block-helpers-DWHxHsEQ.js +190 -0
- package/dist/block-hooks-BmjMyXTa.js +114 -0
- package/dist/block-hooks-plbZ0AbJ.d.ts +107 -0
- package/dist/{kit-transport-DJlHQUBU.js → block-transport-BLr-ZgLc.js} +11 -7
- package/dist/block-transport-DvaoPuZ9.d.ts +48 -0
- package/dist/blocks/agents/index.d.ts +3 -0
- package/dist/blocks/agents/index.js +123 -0
- package/dist/blocks/ai-cache/index.d.ts +3 -0
- package/dist/blocks/ai-cache/index.js +3 -0
- package/dist/blocks/ai-chat/index.d.ts +31 -0
- package/dist/blocks/ai-chat/index.js +5 -0
- package/dist/blocks/ai-chat/react/index.d.ts +77 -0
- package/dist/blocks/ai-chat/react/index.js +387 -0
- package/dist/blocks/ai-chat/react/server.d.ts +16 -0
- package/dist/blocks/ai-chat/react/server.js +14 -0
- package/dist/blocks/ai-files/index.d.ts +14 -0
- package/dist/blocks/ai-files/index.js +3 -0
- package/dist/blocks/ai-providers/index.d.ts +7 -0
- package/dist/blocks/ai-providers/index.js +211 -0
- package/dist/blocks/ai-tasks/index.d.ts +3 -0
- package/dist/blocks/ai-tasks/index.js +203 -0
- package/dist/blocks/announcements/index.d.ts +3 -0
- package/dist/blocks/announcements/index.js +3 -0
- package/dist/blocks/announcements/react/index.d.ts +31 -0
- package/dist/blocks/announcements/react/index.js +86 -0
- package/dist/blocks/announcements/react/server.d.ts +6 -0
- package/dist/blocks/announcements/react/server.js +7 -0
- package/dist/blocks/api-keys/index.d.ts +35 -0
- package/dist/blocks/api-keys/index.js +334 -0
- package/dist/blocks/attachments/index.d.ts +210 -0
- package/dist/blocks/attachments/index.js +222 -0
- package/dist/blocks/audit/index.d.ts +366 -0
- package/dist/blocks/audit/index.js +714 -0
- package/dist/blocks/billing/index.d.ts +265 -0
- package/dist/blocks/billing/index.js +400 -0
- package/dist/blocks/comments/index.d.ts +200 -0
- package/dist/blocks/comments/index.js +207 -0
- package/dist/blocks/connectors/index.d.ts +3 -0
- package/dist/blocks/connectors/index.js +164 -0
- package/dist/blocks/data-lifecycle/index.d.ts +251 -0
- package/dist/blocks/data-lifecycle/index.js +353 -0
- package/dist/blocks/entitlements/index.d.ts +14 -0
- package/dist/blocks/entitlements/index.js +25 -0
- package/dist/blocks/flags/index.d.ts +226 -0
- package/dist/blocks/flags/index.js +282 -0
- package/dist/blocks/inbox/index.d.ts +6 -0
- package/dist/blocks/inbox/index.js +499 -0
- package/dist/blocks/inbox/react/index.d.ts +2 -0
- package/dist/blocks/inbox/react/index.js +225 -0
- package/dist/blocks/inbox/react/server.d.ts +10 -0
- package/dist/blocks/inbox/react/server.js +12 -0
- package/dist/blocks/index.d.ts +65 -0
- package/dist/blocks/index.js +77 -0
- package/dist/blocks/jobs/index.d.ts +297 -0
- package/dist/blocks/jobs/index.js +1051 -0
- package/dist/blocks/knowledge/index.d.ts +3 -0
- package/dist/blocks/knowledge/index.js +3 -0
- package/dist/blocks/memory/index.d.ts +8 -0
- package/dist/blocks/memory/index.js +289 -0
- package/dist/blocks/notifications/index.d.ts +297 -0
- package/dist/blocks/notifications/index.js +425 -0
- package/dist/blocks/notifications/react/index.d.ts +44 -0
- package/dist/blocks/notifications/react/index.js +67 -0
- package/dist/blocks/notifications/react/server.d.ts +6 -0
- package/dist/blocks/notifications/react/server.js +7 -0
- package/dist/blocks/onboarding/index.d.ts +3 -0
- package/dist/blocks/onboarding/index.js +64 -0
- package/dist/blocks/onboarding/react/index.d.ts +28 -0
- package/dist/blocks/onboarding/react/index.js +78 -0
- package/dist/blocks/onboarding/react/server.d.ts +7 -0
- package/dist/blocks/onboarding/react/server.js +7 -0
- package/dist/blocks/organizations/index.d.ts +241 -0
- package/dist/blocks/organizations/index.js +400 -0
- package/dist/blocks/outbox/index.d.ts +3 -0
- package/dist/blocks/outbox/index.js +266 -0
- package/dist/blocks/profiles/index.d.ts +40 -0
- package/dist/blocks/profiles/index.js +28 -0
- package/dist/blocks/push/index.d.ts +185 -0
- package/dist/blocks/push/index.js +258 -0
- package/dist/blocks/settings/index.d.ts +89 -0
- package/dist/blocks/settings/index.js +104 -0
- package/dist/blocks/sso/index.d.ts +198 -0
- package/dist/blocks/sso/index.js +1297 -0
- package/dist/blocks/usage/index.d.ts +4 -0
- package/dist/blocks/usage/index.js +233 -0
- package/dist/blocks/waitlist/index.d.ts +117 -0
- package/dist/blocks/waitlist/index.js +132 -0
- package/dist/blocks/webhooks/index.d.ts +304 -0
- package/dist/{webhooks → blocks/webhooks}/index.js +468 -148
- package/dist/blocks/workflow-builder/index.d.ts +21 -0
- package/dist/blocks/workflow-builder/index.js +5 -0
- package/dist/blocks/workflow-builder/react/index.d.ts +47 -0
- package/dist/blocks/workflow-builder/react/index.js +119 -0
- package/dist/blocks/workflow-builder/react/server.d.ts +8 -0
- package/dist/blocks/workflow-builder/react/server.js +11 -0
- package/dist/blocks/workflows/index.d.ts +3 -0
- package/dist/blocks/workflows/index.js +3 -0
- package/dist/blocks/workflows/react/index.d.ts +47 -0
- package/dist/blocks/workflows/react/index.js +137 -0
- package/dist/blocks/workflows/react/server.d.ts +8 -0
- package/dist/blocks/workflows/react/server.js +11 -0
- package/dist/{index-SaTsEfGP.d.ts → bucket-Cl46E3jS.d.ts} +134 -91
- package/dist/{simplify-_0oUKqCd.js → build-BXIzE6Xv.js} +222 -124
- package/dist/{channel-FQW-CnGR.d.ts → channel-_2Mx1Oyu.d.ts} +2 -2
- package/dist/channels-CkgQ_X60.js +114 -0
- package/dist/chat-sdk/index.d.ts +303 -0
- package/dist/chat-sdk/index.js +733 -0
- package/dist/chat-sdk/react/index.d.ts +2 -0
- package/dist/chat-sdk/react/index.js +3 -0
- package/dist/chat-sdk/react/server.d.ts +3 -0
- package/dist/chat-sdk/react/server.js +2 -0
- package/dist/claims-DDBQT6BK.js +61 -0
- package/dist/{claims-BAf6c7is.js → claims-PqzCxaTD.js} +39 -2
- package/dist/cli/bin.js +1 -1
- package/dist/cli/{codemod-DqV7612m.js → codemod-Bl_tQpHn.js} +105 -2
- package/dist/cli/config-B9HkL8nF.js +2 -0
- package/dist/cli/config-DU7EJImt.js +49 -0
- package/dist/cli/config-NiPxAmUF.js +1077 -0
- package/dist/cli/{dist-xn4wlboc.js → dist-DRAVaE6w.js} +111 -1
- package/dist/cli/{doctor-C_A-KEAz.js → doctor-B4JOm_ox.js} +991 -317
- package/dist/cli/{env-DmKv_G4A.js → env-CJLbUVPB.js} +1 -1
- package/dist/cli/{env-jIFUADLY.js → env-qXgyMV6r.js} +2 -2
- package/dist/cli/fresh-import-BeYf9I3x.js +40 -0
- package/dist/cli/gen-BGLb_zou.js +3100 -0
- package/dist/cli/gen-DAH8FM2W.js +2 -0
- package/dist/cli/index.d.ts +44 -5
- package/dist/cli/index.js +7 -7
- package/dist/cli/{init-DMa6M7hV.js → init-BIIwclPg.js} +242 -27
- package/dist/cli/{introspect-BKlaIu_M.js → introspect-DNUTuNvb.js} +5 -5
- package/dist/cli/{io-k41_z-jT.js → io-DI1mTdSA.js} +12 -3
- package/dist/cli/{keys-ByKHnvP9.js → keys-BGCnnb-s.js} +8 -6
- package/dist/cli/{ohash-D7bG_EOb.js → ohash-BjQY1cBb.js} +1 -1
- package/dist/cli/{openapi-Cp5Fyta-.js → openapi-BlRJ18s3.js} +2 -2
- package/dist/cli/{project-B_GeXyHh.js → project-DZRaBaY7.js} +11 -6
- package/dist/cli/read-sets-CETOSFx4.js +223 -0
- package/dist/cli/{run-Bo_NLT5n.js → run-DNWxHynX.js} +33 -23
- package/dist/cli/{seed-CUlqWh-8.js → seed-DQzqT7LP.js} +8 -6
- package/dist/cli/{skills-LJJIhLFR.js → skills-QQs4q68J.js} +3 -2
- package/dist/cli/sql-D0GUtUPp.js +536 -0
- package/dist/cli/{config-CPVpXP5I.js → supabase-toml-B-bIukQF.js} +72 -942
- package/dist/cli/typegen-version-DeFbtzYI.js +8 -0
- package/dist/cli/{version-BCtlgDQx.js → version-hr88OZG0.js} +1 -1
- package/dist/client/index.d.ts +3 -2
- package/dist/client/index.js +11 -71
- package/dist/client/native/index.d.ts +228 -0
- package/dist/client/native/index.js +361 -0
- package/dist/client-CI0Z2zWX.js +277 -0
- package/dist/cloud-event-BnmD5fb9.js +46 -0
- package/dist/cloud-event-C1JCc1bH.d.ts +50 -0
- package/dist/{compiler-BXH_aZ7N.d.ts → compiler-DY_wkj4R.d.ts} +2 -2
- package/dist/compose-BIBNgAnq.js +53 -0
- package/dist/composite-Bt1YK3Ke.d.ts +146 -0
- package/dist/composite-DhE66P5u.js +130 -0
- package/dist/config/index.d.ts +6 -4
- package/dist/config/index.js +5 -5
- package/dist/{config-Bv7gvfzC.d.ts → config-D44Y7PAv.d.ts} +406 -214
- package/dist/{config-DreERlKo.js → config-Dn7F5k9A.js} +62 -14
- package/dist/connector-Dv8kK0MO.d.ts +107 -0
- package/dist/connectors-hkLCwyEz.d.ts +120 -0
- package/dist/context-BCrWe7ow.d.ts +237 -0
- package/dist/credentials/index.d.ts +31 -0
- package/dist/credentials/index.js +168 -0
- package/dist/cron-DVPUg5k3.js +145 -0
- package/dist/csv-CPAzEmB6.js +25 -0
- package/dist/db-exception-CnWcYPxL.js +15 -0
- package/dist/{define-cNKzqwL_.js → define-B-TVjC25.js} +784 -227
- package/dist/{define-Bp_BZa5h.d.ts → define-CJJkkr1-.d.ts} +353 -61
- package/dist/edge/index.d.ts +69 -11
- package/dist/edge/index.js +191 -75
- package/dist/elysia/index.d.ts +59 -0
- package/dist/elysia/index.js +62 -0
- package/dist/embeddings-4ZvFzjsU.js +127 -0
- package/dist/embeddings-C9KGQnXt.d.ts +68 -0
- package/dist/{refresh-CFPX0Qft.d.ts → ended-jLfvw8h-.d.ts} +20 -2
- package/dist/{entitlements-BiJZ4t49.d.ts → entitlements-DHrY2UDZ.d.ts} +16 -7
- package/dist/entitlements-DRl6ZJUm.js +24 -0
- package/dist/envelope-DqnYGRw7.js +47 -0
- package/dist/{errors-DtwXa6b8.js → errors-B11Duf73.js} +82 -13
- package/dist/errors-DLjJHPLK.js +44 -0
- package/dist/escape-like-DHfx6jRr.js +7 -0
- package/dist/escape-like-ImTK0ps_.d.ts +15 -0
- package/dist/eve/index.d.ts +220 -0
- package/dist/eve/index.js +504 -0
- package/dist/eve-gT2Fpjut.d.ts +151 -0
- package/dist/events/index.d.ts +4 -3
- package/dist/events/index.js +9 -50
- package/dist/events-DWDhx77e.d.ts +549 -0
- package/dist/executor-Bq28caBo.js +718 -0
- package/dist/executor-C-R4pucm.js +83 -0
- package/dist/executor-CaWigTyR.d.ts +148 -0
- package/dist/executor-D14tGopJ.d.ts +36 -0
- package/dist/{executor-Cghdstwu.d.ts → executor-DbvExCFC.d.ts} +7 -1
- package/dist/{sql-Coh6n4cC.js → executor-De1Of3m3.js} +210 -11
- package/dist/executor-DvsBbNBS.d.ts +261 -0
- package/dist/expo/index.d.ts +79 -0
- package/dist/expo/index.js +129 -0
- package/dist/expo-sqlite/index.d.ts +58 -0
- package/dist/expo-sqlite/index.js +104 -0
- package/dist/field-errors-BFOa7WhB.d.ts +99 -0
- package/dist/field-errors-VF1yb8yI.js +13 -0
- package/dist/framework-CONDyPYx.js +51 -0
- package/dist/framework-DuVb4Xa8.d.ts +25 -0
- package/dist/gateway-C1ssRHnf.d.ts +130 -0
- package/dist/graph-BGyLLFLX.js +265 -0
- package/dist/h3/index.d.ts +59 -0
- package/dist/h3/index.js +55 -0
- package/dist/h3/v1/index.d.ts +63 -0
- package/dist/h3/v1/index.js +49 -0
- package/dist/history-BZih6SFP.js +64 -0
- package/dist/hono/index.d.ts +56 -7
- package/dist/hono/index.js +97 -45
- package/dist/{react-C_s7kiNz.js → hooks-1BTCJsiw.js} +104 -133
- package/dist/http-Cv4T29xh.js +40 -0
- package/dist/http-DdYadv-o.js +126 -0
- package/dist/image-url-pIVlO6R1.js +41 -0
- package/dist/{impersonation-BgSHAYLf.js → impersonation-DcqaTBHx.js} +21 -6
- package/dist/inbox-i7E1ppo6.d.ts +384 -0
- package/dist/index-ACiNPN4Z.d.ts +74 -0
- package/dist/{index-DgILJRXj.d.ts → index-Bepi-Hgg.d.ts} +91 -28
- package/dist/index-BkWT_uBO.d.ts +51 -0
- package/dist/index-BpFYMsi0.d.ts +53 -0
- package/dist/{index-C7f8cOBM.d.ts → index-Bxih3l0u.d.ts} +2 -2
- package/dist/index-CaxrMD1A.d.ts +1 -0
- package/dist/index-ClmjK_o-.d.ts +55 -0
- package/dist/index-CtuakVRc.d.ts +267 -0
- package/dist/index-D48jVS-N.d.ts +246 -0
- package/dist/index-DDrYaUcq.d.ts +138 -0
- package/dist/index-DQh4VCc9.d.ts +98 -0
- package/dist/{live-D9W2M5aO.d.ts → index-DunNRdnT.d.ts} +136 -38
- package/dist/index.d.ts +65 -18
- package/dist/index.js +42 -14
- package/dist/invalidate-BBqhpxyB.d.ts +19 -0
- package/dist/json-CEnpTHlZ.js +16 -0
- package/dist/json-schema-CvER4kgT.js +502 -0
- package/dist/keys-4MnkWTTh.js +35 -0
- package/dist/kit-B5tid-q5.d.ts +60 -0
- package/dist/kit-Fm-Fv7q5.js +78 -0
- package/dist/knowledge-BXBbT0Tr.d.ts +176 -0
- package/dist/knowledge-CDmiMLew.js +255 -0
- package/dist/lint/index.d.ts +1 -1
- package/dist/lint/index.js +37 -0
- package/dist/list/index.d.ts +3 -2
- package/dist/list/index.js +1 -444
- package/dist/{index-fag8VJZ2.d.ts → list-query-BRt-zDF7.d.ts} +20 -12
- package/dist/list-query-gl808ac1.js +459 -0
- package/dist/{live-CdJBOc4f.js → live-CTAZQkwl.js} +99 -14
- package/dist/logger-DWVYUmwi.d.ts +18 -0
- package/dist/mcp/index.d.ts +38 -11
- package/dist/mcp/index.js +82 -46
- package/dist/mcp/sdk/index.d.ts +105 -0
- package/dist/mcp/sdk/index.js +126 -0
- package/dist/message-CaKlqdsX.js +219 -0
- package/dist/message-CfDoR0Y6.d.ts +94 -0
- package/dist/messages-B9-5887d.js +715 -0
- package/dist/messages-DYP0sUTe.d.ts +59 -0
- package/dist/mfa-Daak8ukG.d.ts +54 -0
- package/dist/modules-DpPwzC7E.d.ts +192 -0
- package/dist/modules-dxrVK3ID.js +228 -0
- package/dist/nestjs/index.d.ts +68 -0
- package/dist/nestjs/index.js +164 -0
- package/dist/next/client/index.d.ts +35 -0
- package/dist/next/client/index.js +36 -0
- package/dist/next/image/index.js +3 -24
- package/dist/next/index.d.ts +150 -51
- package/dist/next/index.js +261 -107
- package/dist/node/index.d.ts +4 -0
- package/dist/node/index.js +210 -0
- package/dist/node-headers-AO06VhqH.d.ts +24 -0
- package/dist/node-headers-C71zNQHe.js +55 -0
- package/dist/nuxt/index.d.ts +60 -0
- package/dist/nuxt/index.js +64 -0
- package/dist/onboarding-BZGHYJks.d.ts +62 -0
- package/dist/openapi/index.d.ts +1 -1
- package/dist/openapi/index.js +3 -3
- package/dist/orpc/index.d.ts +70 -11
- package/dist/orpc/index.js +73 -24
- package/dist/otel/index.d.ts +7 -7
- package/dist/otel/index.js +87 -57
- package/dist/outbox-Cq7pPYvl.d.ts +161 -0
- package/dist/{plugin-o144f322.d.ts → plugin-FGY8UhYm.d.ts} +30 -10
- package/dist/plugin-tfXW1-qO.js +45 -0
- package/dist/plugins/actor/index.d.ts +2 -2
- package/dist/plugins/actor/index.js +3 -3
- package/dist/plugins/rules/index.d.ts +11 -4
- package/dist/plugins/rules/index.js +40 -13
- package/dist/plugins/soft-delete/index.d.ts +5 -4
- package/dist/plugins/soft-delete/index.js +10 -5
- package/dist/plugins/tenant/index.d.ts +2 -2
- package/dist/plugins/tenant/index.js +18 -11
- package/dist/plugins/timestamps/index.d.ts +5 -3
- package/dist/plugins/timestamps/index.js +6 -4
- package/dist/plugins/validation/index.d.ts +2 -2
- package/dist/plugins/validation/index.js +10 -6
- package/dist/{pool-C9voM4Kw.d.ts → pool-CAu2nLrL.d.ts} +2 -2
- package/dist/postgres/index.d.ts +4 -4
- package/dist/postgres/index.js +1 -2
- package/dist/{postgrest-CruYKAvV.d.ts → postgrest-BLVdEnfe.d.ts} +13 -3
- package/dist/powersync/index.d.ts +43 -0
- package/dist/powersync/index.js +199 -0
- package/dist/powersync/react/index.d.ts +87 -0
- package/dist/powersync/react/index.js +108 -0
- package/dist/{problem-BW1KhzSG.js → problem-BreOl8b8.js} +14 -3
- package/dist/{problem-Blxe8S31.d.ts → problem-DD8LZFjc.d.ts} +21 -3
- package/dist/provider-BH5UWZJ6.d.ts +113 -0
- package/dist/provider-Di3sRutW.js +57 -0
- package/dist/query/index.d.ts +4 -2
- package/dist/query/index.js +4 -3
- package/dist/{query-CCbo44lG.js → query-BQ-NaZon.js} +141 -24
- package/dist/{queue-BYUCjr59.d.ts → queue-CLJurhdy.d.ts} +258 -83
- package/dist/react/index.d.ts +11 -7
- package/dist/react/index.js +7 -3
- package/dist/react/native/index.d.ts +116 -0
- package/dist/react/native/index.js +130 -0
- package/dist/react/server.d.ts +28 -10
- package/dist/react/server.js +22 -5
- package/dist/react/session.d.ts +2 -2
- package/dist/react-4ZqkP8da.js +79 -0
- package/dist/react-F80mF4-t.js +409 -0
- package/dist/react-router/index.d.ts +83 -0
- package/dist/react-router/index.js +89 -0
- package/dist/react-topic-seAWjL3_.js +38 -0
- package/dist/{read-set-DQFt1N_Y.js → read-set-DuKWC9Mj.js} +67 -25
- package/dist/realtime/index.d.ts +4 -5
- package/dist/realtime/index.js +144 -82
- package/dist/refusal-CeJWxmkH.js +61 -0
- package/dist/refusal-D1rgbzNq.d.ts +15 -0
- package/dist/replicas-CwrYp5Zj.js +94 -0
- package/dist/{view-Bn6HNKUe.js → resolve-D_IcnvFd.js} +248 -240
- package/dist/{impersonation-BmePsuxz.d.ts → resolve-KW8nCeL6.d.ts} +29 -69
- package/dist/{resource-mqfJW4YF.js → resource-BsvzCMlX.js} +4 -4
- package/dist/{resource-DNRFP7KR.d.ts → resource-D6Uc7Sk7.d.ts} +5 -5
- package/dist/respond-BUgsXNgk.js +91 -0
- package/dist/respond-DoBijysA.d.ts +93 -0
- package/dist/result-D7y2fT87.d.ts +282 -0
- package/dist/{result-BKiliPY7.js → result-DzUbqgdW.js} +27 -2
- package/dist/run-state-CPo-1X2B.d.ts +12 -0
- package/dist/run-state-CgBKzYMW.js +13 -0
- package/dist/search-CUWCRYKL.js +9 -0
- package/dist/server/index.d.ts +143 -22
- package/dist/server/index.js +46 -14
- package/dist/{respond-BR1fJWOB.d.ts → server-CeVeeXwz.d.ts} +224 -85
- package/dist/session-ChiXDZdZ.d.ts +72 -0
- package/dist/shared-CBxosKK3.js +75 -0
- package/dist/{shared-D1dRUrAg.js → shared-CxWmcyqB.js} +2 -1
- package/dist/shared-DDSjEGDR.d.ts +11 -0
- package/dist/sign-in-BCV5S2WZ.d.ts +49 -0
- package/dist/sign-in-Cb1mwv6X.js +86 -0
- package/dist/{signers-Cc6r98SW.d.ts → signers-4y62_VIi.d.ts} +13 -9
- package/dist/simplify-DDO0j0LI.js +83 -0
- package/dist/solid/index.d.ts +131 -0
- package/dist/solid/index.js +344 -0
- package/dist/solid-start/index.d.ts +75 -0
- package/dist/solid-start/index.js +58 -0
- package/dist/{spec-pins-C3oc-Tdp.js → spec-pins--j6mTok4.js} +8 -1
- package/dist/{spec-pins-CqorWDnO.d.ts → spec-pins-C89s6DyW.d.ts} +7 -0
- package/dist/sql/index.d.ts +313 -212
- package/dist/sql/index.js +34872 -6579
- package/dist/ssr/index.d.ts +6 -5
- package/dist/ssr/index.js +3 -3
- package/dist/{standard-D7r6dMUu.js → standard-BK0cqJ7y.js} +4 -3
- package/dist/{standard-J4YgMOLm.d.ts → standard-CYsm7xpT.d.ts} +1 -1
- package/dist/stats-D_AD9GGu.js +1123 -0
- package/dist/storage/index.d.ts +5 -5
- package/dist/storage/index.js +1027 -368
- package/dist/store-BdH5ruDx.js +66 -0
- package/dist/store-CGjgWu5n.d.ts +68 -0
- package/dist/streams/index.d.ts +76 -0
- package/dist/streams/index.js +77 -0
- package/dist/streams/redis/index.d.ts +52 -0
- package/dist/streams/redis/index.js +185 -0
- package/dist/stripe-BMj5LtsT.js +38 -0
- package/dist/stripe-D04h-QBT.d.ts +136 -0
- package/dist/{support-wHnK6zp-.js → support-BivNqSpK.js} +32 -11
- package/dist/{support-view-B8SlToQX.d.ts → support-view-33Oi07TT.d.ts} +1 -1
- package/dist/svelte/index.d.ts +114 -0
- package/dist/svelte/index.js +344 -0
- package/dist/sveltekit/index.d.ts +116 -0
- package/dist/sveltekit/index.js +106 -0
- package/dist/tags-B99_U9Pp.js +39 -0
- package/dist/tags-Cx-LnIQP.d.ts +30 -0
- package/dist/tanstack-db/index.d.ts +71 -0
- package/dist/tanstack-db/index.js +72 -0
- package/dist/tanstack-start/index.d.ts +75 -0
- package/dist/tanstack-start/index.js +95 -0
- package/dist/tee-CoEppCER.js +101 -0
- package/dist/{template-TxrGI5jR.js → template--jDkl3UP.js} +34 -13
- package/dist/template-CwO38Do8.d.ts +6 -0
- package/dist/temporal-BJGitm-h.js +79 -0
- package/dist/{temporal-required-CAt4Dc9Z.js → temporal-required-BVvW7SYJ.js} +3 -2
- package/dist/tenant-I1TEZ_BX.js +27 -0
- package/dist/tenant-icPeuUBN.d.ts +17 -0
- package/dist/testing/index.d.ts +315 -41
- package/dist/testing/index.js +1046 -79
- package/dist/timing-CyTQPubY.js +92 -0
- package/dist/ttl-Hr34gRu8.js +12 -0
- package/dist/{types-Dnf_wRDz.d.ts → types-6BdhkmZe.d.ts} +111 -45
- package/dist/types-BI-0Sl2v.d.ts +359 -0
- package/dist/types-C05bxW-W.d.ts +220 -0
- package/dist/types-DGs5L0VN.d.ts +192 -0
- package/dist/types-TaiEeBGA.d.ts +156 -0
- package/dist/usage-CrvrL2vw.d.ts +177 -0
- package/dist/user-change-XzvgafU4.js +130 -0
- package/dist/vault-CSO7ss5C.d.ts +50 -0
- package/dist/vercel-connect/index.d.ts +47 -0
- package/dist/vercel-connect/index.js +119 -0
- package/dist/{verify-Ce49ETPz.js → verify-DL41hbvY.js} +85 -13
- package/dist/verify-DPuWngD4.d.ts +172 -0
- package/dist/{version-DOYTYwHP.js → version-Bvv6aLjZ.js} +1 -1
- package/dist/view-BeFcRV6G.js +99 -0
- package/dist/{view-CbgObAeb.d.ts → view-DbxLNu8L.d.ts} +22 -5
- package/dist/vue/index.d.ts +141 -0
- package/dist/vue/index.js +362 -0
- package/dist/watch-DI34G86j.d.ts +60 -0
- package/dist/watch-Xuxrvxq-.js +122 -0
- package/dist/{wire-D2dT86vi.js → wire-DtZQ4sdE.js} +15 -5
- package/dist/workflow-builder-DJ1oHn8g.js +398 -0
- package/dist/workflow-sdk/builder/index.d.ts +85 -0
- package/dist/workflow-sdk/builder/index.js +250 -0
- package/dist/workflow-sdk/index.d.ts +14 -0
- package/dist/workflow-sdk/index.js +3 -0
- package/dist/workflow-sdk/world/index.d.ts +107 -0
- package/dist/workflow-sdk/world/index.js +702 -0
- package/dist/workflow-sdk-B3yLD6Br.d.ts +98 -0
- package/dist/workflow-sdk-C2WJ_G2O.js +173 -0
- package/dist/workflow-sdk-world-D-prir6O.js +1397 -0
- package/dist/workflows-B0j9WKPu.d.ts +185 -0
- package/dist/workflows-wu1WWBn7.js +216 -0
- package/package.json +461 -20
- package/schemas/ai-message-v1.json +258 -0
- package/schemas/config-v1.json +1074 -140
- package/schemas/doctor-report-v1.json +20 -1
- package/schemas/snapshot-v2.json +8 -0
- package/skills/better-supabase/SKILL.md +41 -12
- package/skills/better-supabase/references/frontend.md +96 -0
- package/skills/better-supabase/references/plugins.md +10 -6
- package/skills/better-supabase/references/troubleshooting.md +2 -1
- package/skills/better-supabase-api/SKILL.md +76 -22
- package/skills/better-supabase-api/references/adapters.md +207 -0
- package/skills/better-supabase-api/references/ai.md +125 -0
- package/skills/better-supabase-api/references/expo.md +65 -0
- package/skills/better-supabase-api/references/powersync.md +35 -0
- package/skills/better-supabase-api/references/streams-credentials.md +105 -0
- package/skills/better-supabase-auth/SKILL.md +47 -11
- package/skills/better-supabase-auth/references/authorization-providers.md +51 -0
- package/skills/better-supabase-testing/SKILL.md +3 -1
- package/dist/cli/config-dtoekM0v.js +0 -2
- package/dist/cli/gen-CIdSQZad.js +0 -2
- package/dist/cli/gen-CjElD1Vw.js +0 -2241
- package/dist/cli/read-sets-VQcPgxU9.js +0 -436
- package/dist/cli/sql-CVx-1O8G.js +0 -373
- package/dist/entitlements-CTEBm7IB.js +0 -20
- package/dist/events-aIO7vsIk.d.ts +0 -230
- package/dist/executor-BunPOO-k.d.ts +0 -402
- package/dist/executor-XycESQPH.js +0 -94
- package/dist/index-CWMDdEr4.d.ts +0 -50
- package/dist/index-DOESKG27.d.ts +0 -100
- package/dist/index-DmXSxbLi.d.ts +0 -62
- package/dist/index-Dp2VDwog.d.ts +0 -161
- package/dist/jobs/index.d.ts +0 -226
- package/dist/jobs/index.js +0 -1007
- package/dist/json-schema-m1fiwKgN.js +0 -208
- package/dist/kit-events-CTFDfSwb.js +0 -60
- package/dist/kit-transport-B82k1djG.d.ts +0 -33
- package/dist/kits-CGLLrNPd.js +0 -157
- package/dist/mfa-Cu96oJdw.d.ts +0 -30
- package/dist/notifications/index.d.ts +0 -162
- package/dist/notifications/index.js +0 -264
- package/dist/orgs/index.d.ts +0 -132
- package/dist/orgs/index.js +0 -245
- package/dist/permdock-sql-C2Inc6Xc.d.ts +0 -29
- package/dist/permdock-sql-DgOfeixi.js +0 -51
- package/dist/plugin-DwARMuQp.js +0 -59
- package/dist/server-B1mZ7CgQ.js +0 -660
- package/dist/stats-Bqob3WqT.js +0 -592
- package/dist/support-CEPwlw2G.d.ts +0 -89
- package/dist/template-mbvlysOo.d.ts +0 -6
- package/dist/temporal-CVlIV2DZ.js +0 -40
- package/dist/user-change-CHFEUro1.js +0 -49
- package/dist/webhooks/index.d.ts +0 -285
- package/skills/better-supabase-auth/references/permdock.md +0 -122
package/dist/events/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { s as nowInstant } from "../temporal-BJGitm-h.js";
|
|
2
|
+
import { n as forwardBlockEvents, t as blockCloudEvent } from "../cloud-event-BnmD5fb9.js";
|
|
3
|
+
import { t as jsonReplacer } from "../json-CEnpTHlZ.js";
|
|
4
|
+
import { a as onBlockEvent, n as BLOCK_EVENT_RENAMES, r as blockEventAttributes, t as BLOCK_ATTRIBUTES } from "../block-events-CrT8r7Fe.js";
|
|
3
5
|
//#region src/events/index.ts
|
|
4
6
|
const ROW_EVENT_TYPES = {
|
|
5
7
|
insert: "dev.better-supabase.row.created",
|
|
@@ -52,7 +54,7 @@ function toCloudEvents(notice, options) {
|
|
|
52
54
|
* Sends a CloudEvent for every mutation to `sink`. Returns a function that
|
|
53
55
|
* stops forwarding. Sends in flight are tracked on `betterSupabase.events`
|
|
54
56
|
* (`settled()`), which the Next adapter hands to `after()` and the edge
|
|
55
|
-
* entry to `waitUntil`. Use an outbox (SQL
|
|
57
|
+
* entry to `waitUntil`. Use an outbox (SQL modules) when events must not be lost.
|
|
56
58
|
*/
|
|
57
59
|
function forwardMutations(betterSupabase, sink, options) {
|
|
58
60
|
return betterSupabase.events.on("mutation", (notice) => {
|
|
@@ -74,49 +76,6 @@ function forwardMutations(betterSupabase, sink, options) {
|
|
|
74
76
|
}
|
|
75
77
|
});
|
|
76
78
|
}
|
|
77
|
-
/**
|
|
78
|
-
* A kit event as a CloudEvent: `dev.better-supabase.support.started` with
|
|
79
|
-
* the event data and the actor (`actorId`) as `data` and the tenant as
|
|
80
|
-
* `partitionkey`.
|
|
81
|
-
*/
|
|
82
|
-
function kitCloudEvent(event, options) {
|
|
83
|
-
return {
|
|
84
|
-
specversion: "1.0",
|
|
85
|
-
id: options.id?.() ?? crypto.randomUUID(),
|
|
86
|
-
source: options.source,
|
|
87
|
-
type: `${options.typePrefix ?? "dev.better-supabase"}.${event.type}`,
|
|
88
|
-
...event.subject ? { subject: event.subject } : {},
|
|
89
|
-
time: (options.now?.() ?? event.time).toString(),
|
|
90
|
-
datacontenttype: "application/json",
|
|
91
|
-
data: event.actorId ? {
|
|
92
|
-
...event.data,
|
|
93
|
-
actorId: event.actorId
|
|
94
|
-
} : event.data,
|
|
95
|
-
...event.tenant ? { partitionkey: event.tenant } : {}
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Sends a CloudEvent for every kit event (`support.*`, `org.*`, ...) to
|
|
100
|
-
* `sink`. Returns a function that stops forwarding. Like
|
|
101
|
-
* `forwardMutations`, sends are tracked on `betterSupabase.events`.
|
|
102
|
-
*/
|
|
103
|
-
function forwardKitEvents(betterSupabase, sink, options) {
|
|
104
|
-
const types = options.types;
|
|
105
|
-
return betterSupabase.events.on("kit", (event) => {
|
|
106
|
-
if (types && !types.some((pattern) => pattern.endsWith(".*") ? event.type.startsWith(pattern.slice(0, -1)) : pattern === event.type)) return;
|
|
107
|
-
const events = [kitCloudEvent(event, options)];
|
|
108
|
-
const report = (error) => {
|
|
109
|
-
(options.onError ?? ((cause) => {
|
|
110
|
-
betterSupabase.events.logger.error("event sink failed", { cause });
|
|
111
|
-
}))(error, events);
|
|
112
|
-
};
|
|
113
|
-
try {
|
|
114
|
-
betterSupabase.events.track(Promise.resolve(sink.send(events)).catch(report));
|
|
115
|
-
} catch (error) {
|
|
116
|
-
report(error);
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
79
|
const STRUCTURED = "application/cloudevents+json";
|
|
121
80
|
const BATCH = "application/cloudevents-batch+json";
|
|
122
81
|
/** The HTTP protocol binding: headers and body for one event (or a batch). */
|
|
@@ -125,11 +84,11 @@ function toHttp(events, mode = "structured") {
|
|
|
125
84
|
switch (mode) {
|
|
126
85
|
case "batch": return [{
|
|
127
86
|
headers: { "content-type": BATCH },
|
|
128
|
-
body: JSON.stringify(list)
|
|
87
|
+
body: JSON.stringify(list, jsonReplacer)
|
|
129
88
|
}];
|
|
130
89
|
case "structured": return list.map((event) => ({
|
|
131
90
|
headers: { "content-type": STRUCTURED },
|
|
132
|
-
body: JSON.stringify(event)
|
|
91
|
+
body: JSON.stringify(event, jsonReplacer)
|
|
133
92
|
}));
|
|
134
93
|
case "binary": return list.map((event) => {
|
|
135
94
|
const headers = {};
|
|
@@ -140,7 +99,7 @@ function toHttp(events, mode = "structured") {
|
|
|
140
99
|
headers["content-type"] = event.datacontenttype ?? "application/json";
|
|
141
100
|
return {
|
|
142
101
|
headers,
|
|
143
|
-
body: event.data === void 0 ? "" : JSON.stringify(event.data)
|
|
102
|
+
body: event.data === void 0 ? "" : JSON.stringify(event.data, jsonReplacer)
|
|
144
103
|
};
|
|
145
104
|
});
|
|
146
105
|
default: throw new TypeError(`Unknown CloudEvents mode ${String(mode)}`);
|
|
@@ -190,4 +149,4 @@ function httpSink(url, options = {}) {
|
|
|
190
149
|
} };
|
|
191
150
|
}
|
|
192
151
|
//#endregion
|
|
193
|
-
export {
|
|
152
|
+
export { BLOCK_ATTRIBUTES, BLOCK_EVENT_RENAMES, ROW_EVENT_TYPES, blockCloudEvent, blockEventAttributes, forwardBlockEvents, forwardMutations, fromHttp, httpSink, isCloudEvent, onBlockEvent, toCloudEvents, toHttp };
|
|
@@ -0,0 +1,549 @@
|
|
|
1
|
+
/// <reference lib="esnext.temporal" />
|
|
2
|
+
import { b as DbError } from "./result-D7y2fT87.js";
|
|
3
|
+
import { g as MutationKind, h as MutationIntent, v as Operation } from "./executor-DvsBbNBS.js";
|
|
4
|
+
import { m as RequestContext } from "./plugin-FGY8UhYm.js";
|
|
5
|
+
import { n as Logger } from "./logger-DWVYUmwi.js";
|
|
6
|
+
//#region src/core/block-events.d.ts
|
|
7
|
+
/** `support.*`: support sessions, where a platform admin views the app as a user. */
|
|
8
|
+
interface SupportEventData {
|
|
9
|
+
/** Absent on `support.denied`. */
|
|
10
|
+
readonly sessionId?: string;
|
|
11
|
+
readonly adminId: string;
|
|
12
|
+
readonly targetUserId: string;
|
|
13
|
+
readonly reason?: string;
|
|
14
|
+
readonly readOnly?: boolean;
|
|
15
|
+
readonly expiresAt?: Temporal.Instant;
|
|
16
|
+
/** `support.denied`: which check refused it. */
|
|
17
|
+
readonly denial?: "authorize" | "permission" | "policy" | "store";
|
|
18
|
+
/** `support.ended`: who or what ended it. */
|
|
19
|
+
readonly endedBy?: "admin" | "expired" | "revoked";
|
|
20
|
+
/** The organization the session is scoped to, when it has one. */
|
|
21
|
+
readonly organizationId?: string | null;
|
|
22
|
+
}
|
|
23
|
+
/** `organization.*`: organizations and their members. */
|
|
24
|
+
interface OrganizationEventData {
|
|
25
|
+
readonly organizationId: string;
|
|
26
|
+
/** The member the event is about. */
|
|
27
|
+
readonly userId?: string;
|
|
28
|
+
readonly role?: string;
|
|
29
|
+
readonly previousRole?: string;
|
|
30
|
+
}
|
|
31
|
+
/** `invitation.*`. The token is never part of the event. */
|
|
32
|
+
interface InvitationEventData {
|
|
33
|
+
readonly invitationId: string;
|
|
34
|
+
/** Absent for a platform-scope invitation. */
|
|
35
|
+
readonly organizationId?: string;
|
|
36
|
+
readonly email?: string;
|
|
37
|
+
readonly role?: string;
|
|
38
|
+
}
|
|
39
|
+
/** `notification.*`. */
|
|
40
|
+
interface NotificationEventData {
|
|
41
|
+
readonly notificationId: string;
|
|
42
|
+
readonly organizationId?: string | null;
|
|
43
|
+
readonly type: string;
|
|
44
|
+
readonly recipientIds?: readonly string[];
|
|
45
|
+
readonly channel?: string;
|
|
46
|
+
readonly error?: string;
|
|
47
|
+
}
|
|
48
|
+
/** `webhook.*`: outgoing webhooks. */
|
|
49
|
+
interface WebhookEventData {
|
|
50
|
+
readonly endpointId: string;
|
|
51
|
+
readonly organizationId?: string;
|
|
52
|
+
/** `webhook.disabled`: when the endpoint started failing. */
|
|
53
|
+
readonly failingSince?: string;
|
|
54
|
+
readonly deliveryId?: string;
|
|
55
|
+
readonly eventType?: string;
|
|
56
|
+
/** The HTTP status of the attempt, when there was a response. */
|
|
57
|
+
readonly status?: number;
|
|
58
|
+
readonly attempt?: number;
|
|
59
|
+
readonly error?: string;
|
|
60
|
+
}
|
|
61
|
+
/** `billing.*`: Stripe customers, checkouts, subscriptions and seats. */
|
|
62
|
+
interface BillingEventData {
|
|
63
|
+
readonly organizationId: string;
|
|
64
|
+
readonly customerId?: string;
|
|
65
|
+
readonly subscriptionId?: string;
|
|
66
|
+
/** The Stripe subscription status. */
|
|
67
|
+
readonly status?: string;
|
|
68
|
+
/** `billing.seats_synced`: the new and the previous quantity. */
|
|
69
|
+
readonly quantity?: number;
|
|
70
|
+
readonly previousQuantity?: number;
|
|
71
|
+
/** The Stripe event that caused it. */
|
|
72
|
+
readonly stripeEventId?: string;
|
|
73
|
+
}
|
|
74
|
+
/** `comment.*`, written to the outbox by the comments module. */
|
|
75
|
+
interface CommentEventData {
|
|
76
|
+
readonly commentId: string;
|
|
77
|
+
readonly organizationId: string;
|
|
78
|
+
readonly subjectType: string;
|
|
79
|
+
readonly subjectId: string;
|
|
80
|
+
readonly authorId?: string;
|
|
81
|
+
readonly parentId?: string;
|
|
82
|
+
/** `comment.created`: every mention; `comment.mentioned`: the new ones. */
|
|
83
|
+
readonly mentionIds?: readonly string[];
|
|
84
|
+
}
|
|
85
|
+
/** `attachment.*`, written to the outbox by the attachments module. */
|
|
86
|
+
interface AttachmentEventData {
|
|
87
|
+
readonly attachmentId: string;
|
|
88
|
+
readonly organizationId: string;
|
|
89
|
+
readonly uploadedBy?: string;
|
|
90
|
+
readonly subjectType?: string;
|
|
91
|
+
readonly subjectId?: string;
|
|
92
|
+
readonly mimeType?: string;
|
|
93
|
+
readonly size?: number;
|
|
94
|
+
/** `attachment.scanned`: `clean`, `infected` or `failed`. */
|
|
95
|
+
readonly status?: string;
|
|
96
|
+
}
|
|
97
|
+
/** `data_export.*`, written to the outbox by the data-lifecycle module. */
|
|
98
|
+
interface DataExportEventData {
|
|
99
|
+
readonly exportId: string;
|
|
100
|
+
readonly subject: "user" | "organization";
|
|
101
|
+
readonly organizationId?: string;
|
|
102
|
+
readonly userId?: string;
|
|
103
|
+
readonly requestedBy?: string;
|
|
104
|
+
/** `data_export.completed`: the object paths and when they stop being served. */
|
|
105
|
+
readonly files?: readonly string[];
|
|
106
|
+
readonly expiresAt?: string;
|
|
107
|
+
/** `data_export.failed`. */
|
|
108
|
+
readonly error?: string;
|
|
109
|
+
}
|
|
110
|
+
/** `organization.deletion_*` and `organization.purged`, from the data-lifecycle module. */
|
|
111
|
+
interface OrganizationDeletionEventData {
|
|
112
|
+
readonly organizationId: string;
|
|
113
|
+
/** Who requested or cancelled; absent for the purge. */
|
|
114
|
+
readonly userId?: string;
|
|
115
|
+
readonly purgeAfter?: string;
|
|
116
|
+
}
|
|
117
|
+
/** `organization.domain_*`, from the sso module. */
|
|
118
|
+
interface OrganizationDomainEventData {
|
|
119
|
+
readonly organizationId: string;
|
|
120
|
+
readonly domainId?: string;
|
|
121
|
+
readonly domain: string;
|
|
122
|
+
/** The member who verified it, when the app passed one. */
|
|
123
|
+
readonly userId?: string | null;
|
|
124
|
+
}
|
|
125
|
+
/** `waitlist.*`, from the waitlist module. */
|
|
126
|
+
interface WaitlistEventData {
|
|
127
|
+
readonly entryId: string;
|
|
128
|
+
readonly email: string;
|
|
129
|
+
}
|
|
130
|
+
/** `invite_code.*`, from the waitlist module. The code itself is never part of the event. */
|
|
131
|
+
interface InviteCodeEventData {
|
|
132
|
+
readonly codeId: string;
|
|
133
|
+
readonly organizationId?: string | null;
|
|
134
|
+
readonly prefix: string;
|
|
135
|
+
readonly role?: string | null;
|
|
136
|
+
}
|
|
137
|
+
/** `sso_provider.*`, from the sso module. */
|
|
138
|
+
interface SsoProviderEventData {
|
|
139
|
+
readonly organizationId: string;
|
|
140
|
+
readonly providerId: string;
|
|
141
|
+
readonly domains: readonly string[];
|
|
142
|
+
readonly userId?: string | null;
|
|
143
|
+
}
|
|
144
|
+
/** `scim_user.*` and `scim_group.*`, from the sso module. */
|
|
145
|
+
interface ScimEventData {
|
|
146
|
+
readonly organizationId: string;
|
|
147
|
+
readonly scimUserId?: string;
|
|
148
|
+
readonly scimGroupId?: string;
|
|
149
|
+
}
|
|
150
|
+
/** `api_key.*`, from the api-keys module. The secret is never part of the event. */
|
|
151
|
+
interface ApiKeyEventData {
|
|
152
|
+
readonly keyId: string;
|
|
153
|
+
readonly organizationId?: string | null;
|
|
154
|
+
readonly userId?: string | null;
|
|
155
|
+
readonly name: string;
|
|
156
|
+
readonly publicId: string;
|
|
157
|
+
/** `api_key.rotated`: the key it replaced. */
|
|
158
|
+
readonly previousKeyId?: string;
|
|
159
|
+
}
|
|
160
|
+
/** `organization_setting.*` and `platform_setting.*`, from the settings module. */
|
|
161
|
+
interface SettingEventData {
|
|
162
|
+
readonly organizationId?: string;
|
|
163
|
+
readonly key: string;
|
|
164
|
+
}
|
|
165
|
+
/** `flag.*`, from the flags module. */
|
|
166
|
+
interface FlagEventData {
|
|
167
|
+
readonly key: string;
|
|
168
|
+
/** `flag.override_set`: the variant, or `null` when the override was removed. */
|
|
169
|
+
readonly variant?: string | null;
|
|
170
|
+
readonly organizationId?: string | null;
|
|
171
|
+
readonly userId?: string | null;
|
|
172
|
+
}
|
|
173
|
+
/** `announcement.*`, from the announcements module. */
|
|
174
|
+
interface AnnouncementEventData {
|
|
175
|
+
readonly announcementId: string;
|
|
176
|
+
}
|
|
177
|
+
/** `credential.*`, from the credentials module. The secret is never part of the event. */
|
|
178
|
+
interface CredentialEventData {
|
|
179
|
+
readonly provider: string;
|
|
180
|
+
readonly name: string;
|
|
181
|
+
}
|
|
182
|
+
/** `connector.*` and `connector_grant.*`, from the connectors module. */
|
|
183
|
+
interface ConnectorEventData {
|
|
184
|
+
readonly organizationId: string;
|
|
185
|
+
readonly serverId: string;
|
|
186
|
+
readonly name?: string;
|
|
187
|
+
/** `connector.fingerprint_decided`. */
|
|
188
|
+
readonly fingerprint?: string;
|
|
189
|
+
readonly approved?: boolean;
|
|
190
|
+
/** `connector_grant.*`. */
|
|
191
|
+
readonly grantId?: string;
|
|
192
|
+
readonly userId?: string;
|
|
193
|
+
}
|
|
194
|
+
/** `agent.*`, from the agents module. */
|
|
195
|
+
interface AgentEventData {
|
|
196
|
+
readonly organizationId: string;
|
|
197
|
+
readonly agentId: string;
|
|
198
|
+
readonly slug?: string;
|
|
199
|
+
readonly visibility?: string;
|
|
200
|
+
/** `agent.installed` and `agent.uninstalled`: the member. */
|
|
201
|
+
readonly userId?: string;
|
|
202
|
+
}
|
|
203
|
+
/** `ai_provider_key.*`, from the ai-providers module. Only the credential reference is stored. */
|
|
204
|
+
interface AiProviderKeyEventData {
|
|
205
|
+
readonly organizationId: string;
|
|
206
|
+
readonly keyId: string;
|
|
207
|
+
readonly provider: string;
|
|
208
|
+
readonly name: string;
|
|
209
|
+
}
|
|
210
|
+
/** `ai_tool_policy.set` and `ai_tool_approval.decided`, from the ai-chat module. */
|
|
211
|
+
interface AiToolEventData {
|
|
212
|
+
readonly organizationId: string;
|
|
213
|
+
readonly tool: string;
|
|
214
|
+
readonly policy?: string | null;
|
|
215
|
+
readonly chatId?: string;
|
|
216
|
+
readonly approvalId?: string;
|
|
217
|
+
readonly decision?: string;
|
|
218
|
+
}
|
|
219
|
+
/** `incoming_webhook.*`, from the webhooks-in module. Secrets are never part of the event. */
|
|
220
|
+
interface IncomingWebhookEventData {
|
|
221
|
+
readonly organizationId: string;
|
|
222
|
+
readonly endpointId: string;
|
|
223
|
+
readonly name?: string;
|
|
224
|
+
readonly verify?: string;
|
|
225
|
+
readonly enabled?: boolean;
|
|
226
|
+
/** `incoming_webhook.token_rotated`: whether the secret changed too. */
|
|
227
|
+
readonly secretRotated?: boolean;
|
|
228
|
+
}
|
|
229
|
+
/** `inbox_conversation.*` and `inbox_message.received`, from the inbox module. */
|
|
230
|
+
interface InboxEventData {
|
|
231
|
+
readonly conversationId: string;
|
|
232
|
+
readonly organizationId: string;
|
|
233
|
+
readonly inboxId: string;
|
|
234
|
+
readonly contactId?: string | null;
|
|
235
|
+
readonly assigneeId?: string | null;
|
|
236
|
+
readonly previousAssigneeId?: string | null;
|
|
237
|
+
readonly status?: string;
|
|
238
|
+
/** `inbox_message.received`. */
|
|
239
|
+
readonly messageId?: string;
|
|
240
|
+
}
|
|
241
|
+
/** `push.*`, from the push module. */
|
|
242
|
+
interface PushDeviceEventData {
|
|
243
|
+
readonly deviceId: string;
|
|
244
|
+
readonly userId: string;
|
|
245
|
+
readonly platform?: string;
|
|
246
|
+
readonly provider?: string;
|
|
247
|
+
}
|
|
248
|
+
/** `workflow_run.*`, from the workflows module. */
|
|
249
|
+
interface WorkflowRunEventData {
|
|
250
|
+
readonly runId: string;
|
|
251
|
+
readonly organizationId?: string | null;
|
|
252
|
+
readonly engine: string;
|
|
253
|
+
readonly externalId?: string | null;
|
|
254
|
+
readonly definition?: string | null;
|
|
255
|
+
readonly status: string;
|
|
256
|
+
readonly error?: string | null;
|
|
257
|
+
}
|
|
258
|
+
/** `workflow.published` and `workflow_alert.triggered`, from the workflow-builder module. */
|
|
259
|
+
interface WorkflowEventData {
|
|
260
|
+
readonly organizationId?: string | null;
|
|
261
|
+
readonly definitionId?: string;
|
|
262
|
+
readonly versionId?: string;
|
|
263
|
+
readonly version?: number;
|
|
264
|
+
/** `workflow_alert.triggered`. */
|
|
265
|
+
readonly alertId?: string;
|
|
266
|
+
readonly definition?: string;
|
|
267
|
+
readonly onEvent?: string;
|
|
268
|
+
readonly channel?: string;
|
|
269
|
+
readonly runId?: string;
|
|
270
|
+
readonly status?: string;
|
|
271
|
+
readonly error?: string | null;
|
|
272
|
+
}
|
|
273
|
+
/** `object.uploaded`, from the attachments module: a Storage object in a scanned bucket. */
|
|
274
|
+
interface StorageObjectEventData {
|
|
275
|
+
readonly bucket: string;
|
|
276
|
+
readonly path: string;
|
|
277
|
+
}
|
|
278
|
+
/** `audit.revealed`, from the audit module: who looked at restricted details. */
|
|
279
|
+
interface AuditRevealEventData {
|
|
280
|
+
readonly organizationId?: string | null;
|
|
281
|
+
readonly entries: readonly string[];
|
|
282
|
+
}
|
|
283
|
+
/** `ai_chat.*` and `ai_chat_message.completed`, written to the outbox by the ai-chat module. */
|
|
284
|
+
interface AiChatEventData {
|
|
285
|
+
readonly chatId: string;
|
|
286
|
+
readonly organizationId: string;
|
|
287
|
+
readonly ownerId: string;
|
|
288
|
+
/** `ai_chat_message.completed`: the saved answer. */
|
|
289
|
+
readonly messageId?: string;
|
|
290
|
+
readonly model?: string;
|
|
291
|
+
/** `complete`, `aborted` or `error`. */
|
|
292
|
+
readonly status?: string;
|
|
293
|
+
/** `ai_chat.shared`: the share link and the message it ends at. */
|
|
294
|
+
readonly shareId?: string;
|
|
295
|
+
readonly leafId?: string;
|
|
296
|
+
}
|
|
297
|
+
/** Every block event type and its data. */
|
|
298
|
+
interface BlockEventMap {
|
|
299
|
+
"support.started": SupportEventData;
|
|
300
|
+
"support.ended": SupportEventData;
|
|
301
|
+
"support.denied": SupportEventData;
|
|
302
|
+
"organization.created": OrganizationEventData;
|
|
303
|
+
"organization.updated": OrganizationEventData;
|
|
304
|
+
"organization.deleted": OrganizationEventData;
|
|
305
|
+
"organization.member_added": OrganizationEventData;
|
|
306
|
+
"organization.member_removed": OrganizationEventData;
|
|
307
|
+
"organization.member_left": OrganizationEventData;
|
|
308
|
+
"organization.member_suspended": OrganizationEventData;
|
|
309
|
+
"organization.member_resumed": OrganizationEventData;
|
|
310
|
+
"organization.role_changed": OrganizationEventData;
|
|
311
|
+
"organization.ownership_transferred": OrganizationEventData;
|
|
312
|
+
"organization.switched": OrganizationEventData;
|
|
313
|
+
"organization.domain_added": OrganizationDomainEventData;
|
|
314
|
+
"organization.domain_updated": OrganizationDomainEventData;
|
|
315
|
+
"organization.domain_verified": OrganizationDomainEventData;
|
|
316
|
+
"organization.domain_removed": OrganizationDomainEventData;
|
|
317
|
+
"sso_provider.registered": SsoProviderEventData;
|
|
318
|
+
"sso_provider.unregistered": SsoProviderEventData;
|
|
319
|
+
"scim_user.saved": ScimEventData;
|
|
320
|
+
"scim_user.deleted": ScimEventData;
|
|
321
|
+
"scim_group.saved": ScimEventData;
|
|
322
|
+
"scim_group.deleted": ScimEventData;
|
|
323
|
+
"waitlist.approved": WaitlistEventData;
|
|
324
|
+
"waitlist.rejected": WaitlistEventData;
|
|
325
|
+
"invite_code.created": InviteCodeEventData;
|
|
326
|
+
"invite_code.revoked": InviteCodeEventData;
|
|
327
|
+
"api_key.created": ApiKeyEventData;
|
|
328
|
+
"api_key.revoked": ApiKeyEventData;
|
|
329
|
+
"api_key.rotated": ApiKeyEventData;
|
|
330
|
+
"organization_setting.updated": SettingEventData;
|
|
331
|
+
"organization_setting.reset": SettingEventData;
|
|
332
|
+
"platform_setting.updated": SettingEventData;
|
|
333
|
+
"platform_setting.reset": SettingEventData;
|
|
334
|
+
"flag.saved": FlagEventData;
|
|
335
|
+
"flag.deleted": FlagEventData;
|
|
336
|
+
"flag.override_set": FlagEventData;
|
|
337
|
+
"announcement.saved": AnnouncementEventData;
|
|
338
|
+
"announcement.deleted": AnnouncementEventData;
|
|
339
|
+
"credential.set": CredentialEventData;
|
|
340
|
+
"credential.deleted": CredentialEventData;
|
|
341
|
+
"connector.saved": ConnectorEventData;
|
|
342
|
+
"connector.deleted": ConnectorEventData;
|
|
343
|
+
"connector.fingerprint_decided": ConnectorEventData;
|
|
344
|
+
"connector_grant.created": ConnectorEventData;
|
|
345
|
+
"connector_grant.revoked": ConnectorEventData;
|
|
346
|
+
"agent.saved": AgentEventData;
|
|
347
|
+
"agent.published": AgentEventData;
|
|
348
|
+
"agent.deleted": AgentEventData;
|
|
349
|
+
"agent.installed": AgentEventData;
|
|
350
|
+
"agent.uninstalled": AgentEventData;
|
|
351
|
+
"ai_provider_key.saved": AiProviderKeyEventData;
|
|
352
|
+
"ai_provider_key.deleted": AiProviderKeyEventData;
|
|
353
|
+
"ai_tool_policy.set": AiToolEventData;
|
|
354
|
+
"ai_tool_approval.decided": AiToolEventData;
|
|
355
|
+
"incoming_webhook.created": IncomingWebhookEventData;
|
|
356
|
+
"incoming_webhook.updated": IncomingWebhookEventData;
|
|
357
|
+
"incoming_webhook.enabled_set": IncomingWebhookEventData;
|
|
358
|
+
"incoming_webhook.token_rotated": IncomingWebhookEventData;
|
|
359
|
+
"incoming_webhook.secret_rotated": IncomingWebhookEventData;
|
|
360
|
+
"incoming_webhook.deleted": IncomingWebhookEventData;
|
|
361
|
+
"inbox_conversation.opened": InboxEventData;
|
|
362
|
+
"inbox_conversation.assigned": InboxEventData;
|
|
363
|
+
"inbox_conversation.resolved": InboxEventData;
|
|
364
|
+
"inbox_conversation.reopened": InboxEventData;
|
|
365
|
+
"inbox_message.received": InboxEventData;
|
|
366
|
+
"push.device_registered": PushDeviceEventData;
|
|
367
|
+
"push.device_unregistered": PushDeviceEventData;
|
|
368
|
+
"workflow_run.completed": WorkflowRunEventData;
|
|
369
|
+
"workflow_run.failed": WorkflowRunEventData;
|
|
370
|
+
"workflow_run.cancelled": WorkflowRunEventData;
|
|
371
|
+
"workflow.published": WorkflowEventData;
|
|
372
|
+
"workflow_alert.triggered": WorkflowEventData;
|
|
373
|
+
"audit.revealed": AuditRevealEventData;
|
|
374
|
+
"object.uploaded": StorageObjectEventData;
|
|
375
|
+
"invitation.created": InvitationEventData;
|
|
376
|
+
"invitation.resent": InvitationEventData;
|
|
377
|
+
"invitation.updated": InvitationEventData;
|
|
378
|
+
"invitation.accepted": InvitationEventData;
|
|
379
|
+
"invitation.declined": InvitationEventData;
|
|
380
|
+
"invitation.revoked": InvitationEventData;
|
|
381
|
+
"notification.created": NotificationEventData;
|
|
382
|
+
"notification.delivered": NotificationEventData;
|
|
383
|
+
"notification.failed": NotificationEventData;
|
|
384
|
+
"webhook.delivered": WebhookEventData;
|
|
385
|
+
"webhook.failed": WebhookEventData;
|
|
386
|
+
"webhook.disabled": WebhookEventData;
|
|
387
|
+
"webhook.secret_rotated": WebhookEventData;
|
|
388
|
+
"billing.customer_linked": BillingEventData;
|
|
389
|
+
"billing.checkout_completed": BillingEventData;
|
|
390
|
+
"billing.subscription_created": BillingEventData;
|
|
391
|
+
"billing.subscription_updated": BillingEventData;
|
|
392
|
+
"billing.subscription_deleted": BillingEventData;
|
|
393
|
+
"billing.seats_synced": BillingEventData;
|
|
394
|
+
"comment.created": CommentEventData;
|
|
395
|
+
"comment.mentioned": CommentEventData;
|
|
396
|
+
"comment.deleted": CommentEventData;
|
|
397
|
+
"attachment.uploaded": AttachmentEventData;
|
|
398
|
+
"attachment.scanned": AttachmentEventData;
|
|
399
|
+
"data_export.requested": DataExportEventData;
|
|
400
|
+
"data_export.completed": DataExportEventData;
|
|
401
|
+
"data_export.failed": DataExportEventData;
|
|
402
|
+
"organization.deletion_requested": OrganizationDeletionEventData;
|
|
403
|
+
"organization.deletion_cancelled": OrganizationDeletionEventData;
|
|
404
|
+
"organization.purged": OrganizationDeletionEventData;
|
|
405
|
+
"ai_chat_message.completed": AiChatEventData;
|
|
406
|
+
"ai_chat.shared": AiChatEventData;
|
|
407
|
+
"ai_chat.share_revoked": AiChatEventData;
|
|
408
|
+
}
|
|
409
|
+
type BlockEventType = keyof BlockEventMap;
|
|
410
|
+
/**
|
|
411
|
+
* Event types that changed name in 0.6, old to new, for sinks and consumers
|
|
412
|
+
* that still receive the old ones (`BLOCK_EVENT_RENAMES[type] ?? type`).
|
|
413
|
+
* `better-supabase codemod 0.6` rewrites the string literals.
|
|
414
|
+
*/
|
|
415
|
+
declare const BLOCK_EVENT_RENAMES: Readonly<Record<string, BlockEventType>>;
|
|
416
|
+
/** Where an event came from, beyond its data. */
|
|
417
|
+
interface BlockEventMeta {
|
|
418
|
+
/** e.g. `organizations/<id>`; becomes the CloudEvents `subject`. */
|
|
419
|
+
readonly subject?: string;
|
|
420
|
+
readonly tenant?: string;
|
|
421
|
+
/** The user who caused it. */
|
|
422
|
+
readonly actorId?: string;
|
|
423
|
+
readonly context?: RequestContext;
|
|
424
|
+
}
|
|
425
|
+
/** A block event as `betterSupabase.on('block', handler)` receives it. */
|
|
426
|
+
type BlockEvent<K extends BlockEventType = BlockEventType> = { readonly [T in K]: BlockEventMeta & {
|
|
427
|
+
readonly type: T;
|
|
428
|
+
/** A copy: changing it never changes what the block does (invariant 5). */
|
|
429
|
+
readonly data: BlockEventMap[T];
|
|
430
|
+
readonly time: Temporal.Instant;
|
|
431
|
+
}; }[K];
|
|
432
|
+
/** A type, or a `prefix.*` pattern such as `support.*`. */
|
|
433
|
+
type BlockEventPattern = BlockEventType | `${BlockEventType extends `${infer P}.${string}` ? P : never}.*`;
|
|
434
|
+
/** The event types a pattern matches. */
|
|
435
|
+
type BlockEventsMatching<P extends BlockEventPattern> = P extends `${infer Prefix}.*` ? Extract<BlockEventType, `${Prefix}.${string}`> : Extract<P, BlockEventType>;
|
|
436
|
+
/**
|
|
437
|
+
* Fixed OpenTelemetry attribute names for block work, so dashboards and
|
|
438
|
+
* queries can rely on them.
|
|
439
|
+
*/
|
|
440
|
+
declare const BLOCK_ATTRIBUTES: {
|
|
441
|
+
readonly event: "better_supabase.block.event";
|
|
442
|
+
readonly tenant: "better_supabase.tenant";
|
|
443
|
+
readonly actor: "better_supabase.actor.id";
|
|
444
|
+
readonly supportSessionId: "better_supabase.support.session_id";
|
|
445
|
+
readonly organizationId: "better_supabase.organization.id";
|
|
446
|
+
readonly invitationId: "better_supabase.invitation.id";
|
|
447
|
+
readonly notificationType: "better_supabase.notification.type";
|
|
448
|
+
readonly webhookEndpointId: "better_supabase.webhook.endpoint_id";
|
|
449
|
+
};
|
|
450
|
+
/** The `BLOCK_ATTRIBUTES` an event carries. */
|
|
451
|
+
declare function blockEventAttributes(event: BlockEvent): Record<string, string>;
|
|
452
|
+
/**
|
|
453
|
+
* Listens to the block events that match `pattern` (`'support.started'` or
|
|
454
|
+
* `'support.*'`). Returns a function that stops listening.
|
|
455
|
+
*/
|
|
456
|
+
declare function onBlockEvent<P extends BlockEventPattern>(betterSupabase: {
|
|
457
|
+
readonly events: EventHub;
|
|
458
|
+
}, pattern: P, handler: (event: BlockEvent<BlockEventsMatching<P>>) => void): () => void;
|
|
459
|
+
//#endregion
|
|
460
|
+
//#region src/core/events.d.ts
|
|
461
|
+
interface QueryEvent {
|
|
462
|
+
readonly table: string;
|
|
463
|
+
readonly operation: Operation["kind"];
|
|
464
|
+
readonly ok: boolean;
|
|
465
|
+
readonly durationMs: number;
|
|
466
|
+
readonly rows: number;
|
|
467
|
+
/**
|
|
468
|
+
* An unbounded read returned `maxRows` rows: PostgREST's `db-max-rows`
|
|
469
|
+
* probably cut it short. Add `limit` or use `paginate`.
|
|
470
|
+
*/
|
|
471
|
+
readonly truncated: boolean;
|
|
472
|
+
}
|
|
473
|
+
interface MutationNotice {
|
|
474
|
+
readonly table: string;
|
|
475
|
+
readonly kind: MutationKind;
|
|
476
|
+
/** See `MutationEvent.intent`. */
|
|
477
|
+
readonly intent?: MutationIntent;
|
|
478
|
+
/** A copy of the returned rows: changing it never changes the result. */
|
|
479
|
+
readonly rows: readonly Readonly<Record<string, unknown>>[];
|
|
480
|
+
/** See `MutationEvent.keys`. */
|
|
481
|
+
readonly keys?: readonly Readonly<Record<string, unknown>>[];
|
|
482
|
+
/** See `MutationEvent.tenant`. */
|
|
483
|
+
readonly tenant?: string;
|
|
484
|
+
readonly context: RequestContext;
|
|
485
|
+
}
|
|
486
|
+
/** A successful RPC registered with `betterSupabase.defineRpc(name, { invalidates })`. */
|
|
487
|
+
interface RpcNotice {
|
|
488
|
+
readonly name: string;
|
|
489
|
+
/** App keys of the tables the function changes. */
|
|
490
|
+
readonly invalidates: readonly string[];
|
|
491
|
+
readonly context: RequestContext;
|
|
492
|
+
}
|
|
493
|
+
interface ErrorEvent {
|
|
494
|
+
readonly table?: string;
|
|
495
|
+
readonly error: DbError;
|
|
496
|
+
}
|
|
497
|
+
interface AuthEvent {
|
|
498
|
+
readonly source: "bearer" | "cookie" | "none";
|
|
499
|
+
readonly ok: boolean;
|
|
500
|
+
readonly userId?: string;
|
|
501
|
+
/**
|
|
502
|
+
* Why there is no user: the anon reason (`expired`, `signed_out`, ...) or
|
|
503
|
+
* the invalid reason (`token`, `claims`, `actor`).
|
|
504
|
+
*/
|
|
505
|
+
readonly reason?: "none" | "expired" | "signed_out" | "refresh_failed" | "token" | "claims" | "actor";
|
|
506
|
+
/** The user's `source` as the resolver set it, e.g. a custom resolver's name. */
|
|
507
|
+
readonly rawSource?: string;
|
|
508
|
+
}
|
|
509
|
+
interface RefreshEvent {
|
|
510
|
+
readonly ok: boolean;
|
|
511
|
+
readonly shared: boolean;
|
|
512
|
+
readonly durationMs: number;
|
|
513
|
+
}
|
|
514
|
+
interface BetterSupabaseEvents {
|
|
515
|
+
query: QueryEvent;
|
|
516
|
+
mutation: MutationNotice;
|
|
517
|
+
rpc: RpcNotice;
|
|
518
|
+
error: ErrorEvent;
|
|
519
|
+
auth: AuthEvent;
|
|
520
|
+
refresh: RefreshEvent;
|
|
521
|
+
/** Support sessions, organizations, invitations, notifications and webhooks. */
|
|
522
|
+
block: BlockEvent;
|
|
523
|
+
}
|
|
524
|
+
type EventName = keyof BetterSupabaseEvents;
|
|
525
|
+
type EventHandler<K extends EventName> = (event: BetterSupabaseEvents[K]) => void;
|
|
526
|
+
/**
|
|
527
|
+
* Observers only: a handler that throws is reported to the logger and never
|
|
528
|
+
* changes a result.
|
|
529
|
+
*/
|
|
530
|
+
declare class EventHub {
|
|
531
|
+
#private;
|
|
532
|
+
readonly logger: Logger;
|
|
533
|
+
constructor(logger?: Logger);
|
|
534
|
+
on<K extends EventName>(name: K, handler: EventHandler<K>): () => void;
|
|
535
|
+
has(name: EventName): boolean;
|
|
536
|
+
/**
|
|
537
|
+
* Keeps async work a handler started (a sink send) until it settles, so
|
|
538
|
+
* adapters can hand it to `after()` or `waitUntil`. Its outcome is ignored:
|
|
539
|
+
* handlers report their own failures.
|
|
540
|
+
*/
|
|
541
|
+
track(work: PromiseLike<unknown>): void;
|
|
542
|
+
/** Whether tracked work is still running. */
|
|
543
|
+
get pending(): boolean;
|
|
544
|
+
/** Resolves once the work tracked so far has settled. Never rejects. */
|
|
545
|
+
settled(): Promise<void>;
|
|
546
|
+
emit<K extends EventName>(name: K, event: BetterSupabaseEvents[K]): void;
|
|
547
|
+
}
|
|
548
|
+
//#endregion
|
|
549
|
+
export { CredentialEventData as A, OrganizationEventData as B, BlockEventMap as C, BlockEventsMatching as D, BlockEventType as E, InvitationEventData as F, StorageObjectEventData as G, ScimEventData as H, InviteCodeEventData as I, WebhookEventData as J, SupportEventData as K, NotificationEventData as L, FlagEventData as M, InboxEventData as N, CommentEventData as O, IncomingWebhookEventData as P, onBlockEvent as Q, OrganizationDeletionEventData as R, BlockEvent as S, BlockEventPattern as T, SettingEventData as U, PushDeviceEventData as V, SsoProviderEventData as W, WorkflowRunEventData as X, WorkflowEventData as Y, blockEventAttributes as Z, AttachmentEventData as _, EventHub as a, BLOCK_EVENT_RENAMES as b, QueryEvent as c, AgentEventData as d, AiChatEventData as f, ApiKeyEventData as g, AnnouncementEventData as h, EventHandler as i, DataExportEventData as j, ConnectorEventData as k, RefreshEvent as l, AiToolEventData as m, BetterSupabaseEvents as n, EventName as o, AiProviderKeyEventData as p, WaitlistEventData as q, ErrorEvent as r, MutationNotice as s, AuthEvent as t, RpcNotice as u, AuditRevealEventData as v, BlockEventMeta as w, BillingEventData as x, BLOCK_ATTRIBUTES as y, OrganizationDomainEventData as z };
|