better-supabase 0.34.0 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{adapter-CWzyKepA.js → adapter-ddQ9Hzka.js} +126 -91
- package/dist/{agents-DXiOPB3V.d.ts → agents-BwUHtvD6.d.ts} +4 -4
- package/dist/{ai-cache-CLiAXCPH.d.ts → ai-cache-CPOP2PYz.d.ts} +4 -4
- package/dist/{ai-chat-DlcBdOhJ.d.ts → ai-chat-BZhfCHHr.d.ts} +106 -25
- package/dist/{ai-schedules-Drx2KRTn.d.ts → ai-schedules-BZPmySUa.d.ts} +5 -5
- package/dist/ai-sdk/agents/index.d.ts +6 -6
- package/dist/ai-sdk/batches/index.d.ts +3 -3
- package/dist/ai-sdk/cache/index.d.ts +1 -1
- package/dist/ai-sdk/chat/index.d.ts +2 -2
- package/dist/ai-sdk/chat/index.js +3 -272
- package/dist/ai-sdk/embeddings/index.d.ts +2 -2
- package/dist/ai-sdk/files/index.d.ts +1 -1
- package/dist/ai-sdk/index.d.ts +5 -5
- package/dist/ai-sdk/index.js +2 -3
- package/dist/ai-sdk/mcp/index.d.ts +3 -3
- package/dist/ai-sdk/memory/index.d.ts +3 -3
- package/dist/ai-sdk/workflow/index.d.ts +6 -5
- package/dist/ai-sdk/workflow/index.js +9 -9
- package/dist/{api-myq2e9t5.d.ts → api-XEaCJbgv.d.ts} +5 -5
- package/dist/{api-keys-DbIbkGxx.d.ts → api-keys-C82fMru4.d.ts} +4 -4
- package/dist/{app-tables-Don-aNOB.d.ts → app-tables-C0XVpQEJ.d.ts} +1 -1
- package/dist/{approvals-Da4uAANx.js → approvals-D8gR1R8R.js} +95 -11
- package/dist/{approvals-DZoGtNFv.d.ts → approvals-DqCv7f-G.d.ts} +101 -7
- package/dist/{assistant-BEbRPjhn.d.ts → assistant-5heV2GeR.d.ts} +7 -3
- package/dist/assistant-BHZ6fqBR.js +300 -0
- package/dist/astro/index.d.ts +7 -7
- package/dist/astro/index.js +5 -5
- package/dist/{auth-module-CqXdm8qD.js → auth-module-DkqapRZJ.js} +1 -1
- package/dist/{authorization-DpVtxuKM.d.ts → authorization-2Rv1AJQJ.d.ts} +151 -39
- package/dist/{authorization-hooks-CxwsRnfV.d.ts → authorization-hooks-C0GfMvFm.d.ts} +8 -2
- package/dist/authz-topic-D7fPUY4P.js +13 -0
- package/dist/{automations-Bw5cX7oj.js → automations-D4QTP8nI.js} +2 -1
- package/dist/{availability-CebEOfMN.d.ts → availability-CZlcrkqD.d.ts} +49 -8
- package/dist/{base64-CVyKHBBw.js → base64-CEBz6-Jj.js} +9 -2
- package/dist/better-result/index.d.ts +3 -3
- package/dist/{bind-BA05aoY9.d.ts → bind-C2XvMlfg.d.ts} +7 -7
- package/dist/{block-env-UX42PHLP.d.ts → block-env-BQrtLPyc.d.ts} +4 -4
- package/dist/{block-helpers-disoUWCp.d.ts → block-helpers-BNtM1tqy.d.ts} +1 -1
- package/dist/{block-hooks-DrA_d1dJ.d.ts → block-hooks-CtMsgLQr.d.ts} +2 -2
- package/dist/{block-subjects-Br2MQNFn.d.ts → block-subjects-Bkieh2Xk.d.ts} +1 -1
- package/dist/{block-tables-Bre1zjau.d.ts → block-tables-DPOgnT3y.d.ts} +1 -1
- package/dist/{block-transport-BEtC_Kis.d.ts → block-transport-CDmOUuLZ.d.ts} +2 -2
- package/dist/blocks/access-requests/index.d.ts +5 -5
- package/dist/blocks/activities/index.d.ts +9 -9
- package/dist/blocks/agents/index.d.ts +4 -4
- package/dist/blocks/ai-cache/index.d.ts +3 -3
- package/dist/blocks/ai-chat/index.d.ts +8 -8
- package/dist/blocks/ai-chat/index.js +80 -20
- package/dist/blocks/ai-files/index.d.ts +3 -3
- package/dist/blocks/ai-keys/index.d.ts +4 -4
- package/dist/blocks/ai-schedules/index.d.ts +3 -3
- package/dist/blocks/announcements/index.d.ts +8 -8
- package/dist/blocks/api-keys/index.d.ts +3 -3
- package/dist/blocks/approvals/index.d.ts +16 -5
- package/dist/blocks/approvals/index.js +7 -4
- package/dist/blocks/assets/index.d.ts +6 -6
- package/dist/blocks/assignment/index.d.ts +7 -7
- package/dist/blocks/attachments/index.d.ts +4 -4
- package/dist/blocks/audit/index.d.ts +13 -13
- package/dist/blocks/audit/index.js +1 -1
- package/dist/blocks/automations/index.d.ts +12 -12
- package/dist/blocks/billable-time/index.d.ts +6 -6
- package/dist/blocks/billing/index.d.ts +9 -9
- package/dist/blocks/billing/index.js +1 -1
- package/dist/blocks/bookings/index.d.ts +6 -6
- package/dist/blocks/bulk/index.d.ts +4 -4
- package/dist/blocks/calendar/index.d.ts +46 -8
- package/dist/blocks/calendar/index.js +306 -47
- package/dist/blocks/catalog/index.d.ts +52 -15
- package/dist/blocks/catalog/index.js +53 -18
- package/dist/blocks/channels/index.d.ts +7 -7
- package/dist/blocks/collections/index.d.ts +6 -6
- package/dist/blocks/comments/index.d.ts +10 -10
- package/dist/blocks/compliance/index.d.ts +5 -5
- package/dist/blocks/connectors/index.d.ts +4 -4
- package/dist/blocks/contacts/index.d.ts +6 -6
- package/dist/blocks/content/index.d.ts +5 -5
- package/dist/blocks/contracts/index.d.ts +6 -6
- package/dist/blocks/courses/index.d.ts +5 -5
- package/dist/blocks/created-by/index.d.ts +2 -2
- package/dist/blocks/custom-fields/index.d.ts +6 -6
- package/dist/blocks/data-lifecycle/index.d.ts +8 -8
- package/dist/blocks/deals/index.d.ts +6 -6
- package/dist/blocks/deals/index.js +1 -1
- package/dist/blocks/dispatch/index.d.ts +6 -6
- package/dist/blocks/documents/index.d.ts +4 -4
- package/dist/blocks/documents/index.js +1 -1
- package/dist/blocks/domains/index.d.ts +6 -6
- package/dist/blocks/donations/index.d.ts +6 -6
- package/dist/blocks/drive/index.d.ts +6 -6
- package/dist/blocks/employees/index.d.ts +8 -8
- package/dist/blocks/enrichment/index.d.ts +6 -6
- package/dist/blocks/enrollments/index.d.ts +74 -9
- package/dist/blocks/enrollments/index.js +67 -3
- package/dist/blocks/entitlements/index.d.ts +6 -6
- package/dist/blocks/expenses/index.d.ts +93 -6
- package/dist/blocks/expenses/index.js +95 -4
- package/dist/blocks/field-history/index.d.ts +4 -4
- package/dist/blocks/flags/index.d.ts +5 -5
- package/dist/blocks/forecasts/index.d.ts +6 -6
- package/dist/blocks/forms/index.d.ts +6 -6
- package/dist/blocks/goals/index.d.ts +4 -4
- package/dist/blocks/guests/index.d.ts +6 -6
- package/dist/blocks/hiring/index.d.ts +6 -6
- package/dist/blocks/identities/index.d.ts +5 -5
- package/dist/blocks/imports/index.d.ts +5 -5
- package/dist/blocks/inbox/index.d.ts +11 -11
- package/dist/blocks/inbox/index.js +56 -1
- package/dist/blocks/incidents/index.d.ts +5 -5
- package/dist/blocks/index.d.ts +9 -9
- package/dist/blocks/inventory/index.d.ts +6 -6
- package/dist/blocks/invoices/index.d.ts +30 -10
- package/dist/blocks/invoices/index.js +28 -9
- package/dist/blocks/knowledge/index.d.ts +4 -4
- package/dist/blocks/knowledge/index.js +1 -1
- package/dist/blocks/lead-scoring/index.d.ts +7 -7
- package/dist/blocks/leases/index.d.ts +6 -6
- package/dist/blocks/leave/index.d.ts +88 -15
- package/dist/blocks/leave/index.js +65 -14
- package/dist/blocks/ledger/index.d.ts +6 -6
- package/dist/blocks/mail-sync/index.d.ts +5 -5
- package/dist/blocks/memberships/index.d.ts +2 -2
- package/dist/blocks/memory/index.d.ts +5 -5
- package/dist/blocks/memory/index.js +30 -5
- package/dist/blocks/messaging/index.d.ts +11 -11
- package/dist/blocks/metrics/index.d.ts +6 -6
- package/dist/blocks/mfa/index.d.ts +2 -2
- package/dist/blocks/moderation/index.d.ts +6 -6
- package/dist/blocks/notifications/index.d.ts +11 -11
- package/dist/blocks/notifications/index.js +1 -1
- package/dist/blocks/numbering/index.d.ts +4 -4
- package/dist/blocks/oauth-server/index.d.ts +5 -5
- package/dist/blocks/oauth-server/index.js +1 -1
- package/dist/blocks/onboarding/index.d.ts +5 -5
- package/dist/blocks/orders/index.d.ts +7 -7
- package/dist/blocks/organizations/index.d.ts +8 -8
- package/dist/blocks/outbox/index.d.ts +4 -4
- package/dist/blocks/outbox/index.js +1 -1
- package/dist/blocks/passes/index.d.ts +8 -8
- package/dist/blocks/passes/index.js +2 -2
- package/dist/blocks/permissions/index.d.ts +7 -7
- package/dist/blocks/pipelines/index.d.ts +6 -6
- package/dist/blocks/posts/index.d.ts +5 -5
- package/dist/blocks/profiles/index.d.ts +4 -4
- package/dist/blocks/promotions/index.d.ts +5 -5
- package/dist/blocks/push/index.d.ts +7 -7
- package/dist/blocks/queue/index.d.ts +6 -6
- package/dist/blocks/queue/index.js +2 -2
- package/dist/blocks/quotes/index.d.ts +119 -27
- package/dist/blocks/quotes/index.js +112 -18
- package/dist/blocks/rank/index.d.ts +4 -4
- package/dist/blocks/reactions/index.d.ts +9 -9
- package/dist/blocks/relations/index.d.ts +7 -7
- package/dist/blocks/reminders/index.d.ts +78 -11
- package/dist/blocks/reminders/index.js +118 -6
- package/dist/blocks/reviews/index.d.ts +5 -5
- package/dist/blocks/saved-views/index.d.ts +6 -6
- package/dist/blocks/scores/index.d.ts +5 -5
- package/dist/blocks/search/index.d.ts +7 -7
- package/dist/blocks/security-events/index.d.ts +7 -7
- package/dist/blocks/security-events/index.js +1 -1
- package/dist/blocks/segments/index.d.ts +7 -7
- package/dist/blocks/sequences/index.d.ts +6 -6
- package/dist/blocks/service-accounts/index.d.ts +5 -5
- package/dist/blocks/sessions/index.d.ts +2 -2
- package/dist/blocks/sessions/index.js +1 -1
- package/dist/blocks/settings/index.d.ts +6 -6
- package/dist/blocks/share-links/index.d.ts +5 -5
- package/dist/blocks/shipments/index.d.ts +6 -6
- package/dist/blocks/shipments/index.js +1 -1
- package/dist/blocks/signatures/index.d.ts +5 -5
- package/dist/blocks/signing-keys/index.d.ts +4 -4
- package/dist/blocks/signing-keys/index.js +2 -2
- package/dist/blocks/sla/index.d.ts +7 -7
- package/dist/blocks/sso/index.d.ts +6 -6
- package/dist/blocks/state-machine/index.d.ts +27 -7
- package/dist/blocks/state-machine/index.js +7 -2
- package/dist/blocks/subjects/index.d.ts +6 -6
- package/dist/blocks/tags/index.d.ts +6 -6
- package/dist/blocks/tasks/index.d.ts +9 -9
- package/dist/blocks/teams/index.d.ts +4 -4
- package/dist/blocks/templates/index.d.ts +7 -7
- package/dist/blocks/time-tracking/index.d.ts +7 -7
- package/dist/blocks/time-tracking/index.js +1 -1
- package/dist/blocks/timeline/index.d.ts +8 -8
- package/dist/blocks/trash/index.d.ts +6 -6
- package/dist/blocks/undo/index.d.ts +4 -4
- package/dist/blocks/updated-at/index.d.ts +2 -2
- package/dist/blocks/usage/index.d.ts +4 -4
- package/dist/blocks/vercel-marketplace/index.d.ts +5 -5
- package/dist/blocks/vercel-marketplace/index.js +3 -3
- package/dist/blocks/versions/index.d.ts +6 -6
- package/dist/blocks/waitlist/index.d.ts +5 -5
- package/dist/blocks/waitlist/index.js +1 -1
- package/dist/blocks/webhooks/index.d.ts +13 -13
- package/dist/blocks/webhooks/index.js +5 -5
- package/dist/blocks/workflow-editor/index.d.ts +10 -10
- package/dist/blocks/workflow-editor/index.js +65 -2
- package/dist/blocks/workflows/index.d.ts +7 -7
- package/dist/{bookings-Br0VXzaf.d.ts → bookings-Dj5cvXKv.d.ts} +4 -4
- package/dist/{bucket-DvG66r5G.d.ts → bucket-CrsJNHzi.d.ts} +1 -1
- package/dist/chat-sdk/index.d.ts +6 -6
- package/dist/claims/index.d.ts +6 -6
- package/dist/claims/index.js +2 -2
- package/dist/cli/{add-DoEtJhZG.js → add-D2CH8t_B.js} +2 -2
- package/dist/cli/add-De73Ghlh.js +1 -0
- package/dist/cli/{add-THXE7juv.js → add-Duf1-19E.js} +16 -14
- package/dist/cli/{agent-59XWXsRi.js → agent-Tqq3MAqx.js} +26 -1
- package/dist/cli/{app-table-files-BqLd5TuX.js → app-table-files-ha8X0rRE.js} +2 -2
- package/dist/cli/app-tables-BIyQcsHH.js +42 -0
- package/dist/cli/{backfill-D-2W0fNT.js → backfill-CLgA6-ll.js} +3 -3
- package/dist/cli/bin.js +1 -1
- package/dist/cli/{blocks-BVU_FoLo.js → blocks-9AeouX4h.js} +2 -2
- package/dist/cli/{blocks-XwUHeyUH.js → blocks-BVB1fMMj.js} +1 -1
- package/dist/cli/{cache-D4nwCBXc.js → cache-aMk9vF1_.js} +1 -1
- package/dist/cli/{codemod-Dh4lf_k4.js → codemod-B5wrcnF2.js} +113 -4
- package/dist/cli/{command-BpZ4AuhR.js → command-DM_x_yzZ.js} +6 -0
- package/dist/cli/{completion-DHTT6rjI.js → completion-CusuUJNn.js} +1 -1
- package/dist/cli/{completion-B08Q0xB3.js → completion-Cx2UYd-y.js} +2 -2
- package/dist/cli/{completion-CwL7e93t.js → completion-DbYb3N8e.js} +2 -2
- package/dist/cli/{config-D-Upz3jV.js → config-BeuImpav.js} +1 -1
- package/dist/cli/{content-mapper-CwFH_PEn.js → content-mapper-CEtdbshU.js} +2 -2
- package/dist/cli/{db-Diy1OebO.js → db-CeiQzhPq.js} +2 -2
- package/dist/cli/{doctor-CyAMbZ_s.js → doctor-DaOUWfRN.js} +391 -54
- package/dist/cli/env-BfWbheiC.js +1 -0
- package/dist/cli/{env-BAJn6wCA.js → env-DVV10l_r.js} +1 -1
- package/dist/cli/{gen-EAUNnUY7.js → gen-BO-2NF-G.js} +14 -14
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +7 -7
- package/dist/cli/{init-BRmmmGHJ.js → init-Xit9Hnbb.js} +9 -9
- package/dist/cli/{keys-CxajkV_7.js → keys-DJTN2Avl.js} +1 -1
- package/dist/cli/{live-CV9mn-xC.js → live-CuMpyRjF.js} +2 -2
- package/dist/cli/{mcp-CnaxcLWa.js → mcp-C7d4j5cq.js} +4 -4
- package/dist/cli/{metadata-CFQGBR5E.js → metadata-D2YvkY2D.js} +3 -3
- package/dist/cli/{migrate-z5oHDGNs.js → migrate-BCXxyTKt.js} +2 -2
- package/dist/cli/{migration-safety-BtAPMEZa.js → migration-safety-DfwTOBQ4.js} +1 -1
- package/dist/cli/{migrations-CNa62JSi.js → migrations-nomh4TBo.js} +2 -2
- package/dist/cli/{module-migration-CKJ8kRm1.js → module-migration--9T_T-zt.js} +2 -2
- package/dist/cli/{moved-BAFPdJz_.js → moved-CT6i1csY.js} +1 -1
- package/dist/cli/{parse-BueItuNJ.js → parse-qgJylE_A.js} +1 -1
- package/dist/cli/{powersync-BgoAWeRT.js → powersync-DB9WZsIv.js} +4 -4
- package/dist/cli/powersync-IBM_v_eJ.js +1 -0
- package/dist/cli/{print-CoqKHoy0.js → print-S6IF5rZm.js} +2 -2
- package/dist/cli/{providers-CfbFxUOQ.js → providers-BDTcal71.js} +1 -1
- package/dist/cli/{prune-workflows-BigCoXLw.js → prune-workflows-Zr2DjByi.js} +3 -3
- package/dist/cli/{remove-C9zwn-Kk.js → remove-CPX5Tg5s.js} +6 -6
- package/dist/cli/{render-DQCU_kBW.js → render-Bp7a7XQ9.js} +18 -4
- package/dist/cli/{run-DOD00FFl.js → run-BclCFEyP.js} +13 -41
- package/dist/cli/{run-dY9uOC3W.js → run-BlVaLnt_.js} +2 -2
- package/dist/cli/{run-CVaBuT18.js → run-kgG50x_Z.js} +44 -43
- package/dist/cli/{seed-BpaqqyO8.js → seed-Cn2R91cd.js} +2 -2
- package/dist/cli/seed-DGGjReq4.js +1 -0
- package/dist/cli/{shared-COtj7l3r.js → shared-D60W9NS-.js} +1 -1
- package/dist/cli/{skills-jZThjL3B.js → skills-DH-yPDny.js} +1 -1
- package/dist/cli/{snapshot-BvlEmTB0.js → snapshot-C3_eQUgY.js} +2 -2
- package/dist/cli/{source-BhZRCitG.js → source-Bk6XwIAK.js} +1 -1
- package/dist/cli/{spec-Bo2wIViH.js → spec-BDTpcBns.js} +1 -1
- package/dist/cli/{spec-DsMWuJLv.js → spec-C8ydQwZC.js} +3 -3
- package/dist/cli/{sql-layout-CA7xgRjR.js → sql-layout-DVQ20UMi.js} +3 -3
- package/dist/cli/{stack-147NqctC.js → stack-CmhSfY5V.js} +3 -2
- package/dist/cli/{sync-D9xSGdzO.js → sync-D-WO4Yvl.js} +4 -4
- package/dist/cli/{table-D9FbJS8h.js → table-k5OABwy3.js} +1 -1
- package/dist/cli/{upgrade-Ykf0LLEB.js → upgrade-DGe5Pv6v.js} +5 -5
- package/dist/cli/{upgrade-XK_CQKVJ.js → upgrade-XdhMuHAu.js} +3 -3
- package/dist/cli/{version-Dfdz7KSh.js → version-DKfeme2I.js} +1 -1
- package/dist/client/index.d.ts +6 -6
- package/dist/client/index.js +1 -1
- package/dist/client/native/index.d.ts +5 -5
- package/dist/client/native/index.js +2 -2
- package/dist/{client-Bky2z09B.js → client-DrejIxsu.js} +1 -1
- package/dist/{cloud-event-DXWmXrus.d.ts → cloud-event-BEmAUdl1.d.ts} +1 -1
- package/dist/commerce/index.js +1 -1
- package/dist/{compiler-qlXlokKn.d.ts → compiler-BOW4yPcW.d.ts} +2 -2
- package/dist/{composite-CIxjVcL1.d.ts → composite-B-oAH16L.d.ts} +7 -7
- package/dist/{composite-D2JnIiHt.js → composite-BidYZWZY.js} +3 -3
- package/dist/config/index.d.ts +3 -3
- package/dist/config/index.js +4 -4
- package/dist/{config-Bu6pwqcO.js → config-BKxjItQ-.js} +3 -3
- package/dist/{config-MDRA2sre.js → config-BrRlSxhx.js} +1 -1
- package/dist/{connectors-Cf2LeAuZ.d.ts → connectors-CrLRW4Ol.d.ts} +4 -4
- package/dist/{context-BGC0J3t9.d.ts → context-yfOlyAqb.d.ts} +3 -3
- package/dist/contract/index.d.ts +9 -9
- package/dist/{controller-CQrkLoRX.d.ts → controller-CAcLEndc.d.ts} +1 -1
- package/dist/{conversion-C9rndpEI.d.ts → conversion-s1NtB6S-.d.ts} +1 -1
- package/dist/create/index.d.ts +3 -3
- package/dist/create/index.js +3 -3
- package/dist/create/lite/index.d.ts +4 -4
- package/dist/create/lite/index.js +2 -2
- package/dist/credentials/index.d.ts +4 -4
- package/dist/credentials/index.js +1 -1
- package/dist/{cron-route-DSITg1yC.js → cron-route-uTsC2BD0.js} +1 -1
- package/dist/{data-engine-CMENsp3d.d.ts → data-engine-CX1oYDZl.d.ts} +1 -1
- package/dist/{define-ITQA71fw.d.ts → define-BvkaC3Oh.d.ts} +5 -5
- package/dist/{define-B6D55cO0.js → define-Duh2mMYk.js} +1 -1
- package/dist/{define-block-COmMkx2x.d.ts → define-block-Ds3aLZwz.d.ts} +12 -12
- package/dist/{documents-DeZw83ue.d.ts → documents-Btk0MhC0.d.ts} +3 -3
- package/dist/edge/index.d.ts +9 -9
- package/dist/edge/index.js +7 -7
- package/dist/elysia/index.d.ts +1 -1
- package/dist/elysia/index.js +1 -1
- package/dist/{embeddings-rVR2AKVz.d.ts → embeddings-CI6P_mtD.d.ts} +1 -1
- package/dist/{ended-NC_ZesY4.d.ts → ended-iq2wp8fc.d.ts} +8 -3
- package/dist/{entitlements-BOWTZaRf.d.ts → entitlements-Dhu-4vlH.d.ts} +2 -2
- package/dist/env/index.d.ts +1 -1
- package/dist/{messages-CRk1g6oe.js → errors-0Qid9fGz.js} +107 -3
- package/dist/eve/index.d.ts +9 -9
- package/dist/eve/index.js +3 -3
- package/dist/{eve-DIKjuPp5.d.ts → eve-DleYrhwj.d.ts} +2 -2
- package/dist/{event-calendar-DUtFyRrv.d.ts → event-calendar-DPMcqy7Q.d.ts} +1 -1
- package/dist/events/index.d.ts +3 -3
- package/dist/{events-DVt3Z9hw.d.ts → events-DCw3c6pj.d.ts} +1 -1
- package/dist/{executor-DqNRrFxx.d.ts → executor-B-o7QMPp.d.ts} +16 -2
- package/dist/{executor-CFmee_nV.d.ts → executor-DoSNec_H.d.ts} +1 -1
- package/dist/{executor-CHnoKOxk.d.ts → executor-H8ZLkeHj.d.ts} +4 -4
- package/dist/{executor-BDMqPbVU.js → executor-RYiR4z47.js} +71 -37
- package/dist/expo/index.d.ts +4 -4
- package/dist/expo/index.js +7 -7
- package/dist/{field-errors-DxPZYw2m.d.ts → field-errors-DXZk9Qjt.d.ts} +10 -10
- package/dist/{fields-CAVk9dxX.d.ts → fields-CP46SPNE.d.ts} +1 -1
- package/dist/{filter-evaluate-Bz3Fzhz2.d.ts → filter-evaluate-Bkbb0nuQ.d.ts} +1 -1
- package/dist/{filter-query-DV-x8fio.d.ts → filter-query-Xj40B5KT.d.ts} +1 -1
- package/dist/{flags-6emyAXly.d.ts → flags-Cuew4tGx.d.ts} +2 -2
- package/dist/flags-sdk/index.d.ts +2 -2
- package/dist/{framework-BFlaPuvv.d.ts → framework-Byr_j8G-.d.ts} +8 -8
- package/dist/{framework-ChzJYkJW.js → framework-z3KTPRjk.js} +4 -4
- package/dist/{gateway-DaekJ_Me.d.ts → gateway-B9k89AC4.d.ts} +3 -3
- package/dist/h3/index.d.ts +1 -1
- package/dist/h3/index.js +1 -1
- package/dist/h3/v1/index.d.ts +1 -1
- package/dist/h3/v1/index.js +1 -1
- package/dist/hono/index.d.ts +9 -10
- package/dist/hono/index.js +8 -8
- package/dist/{inbox-DavCzW7b.d.ts → inbox-yGfUVQr2.d.ts} +61 -6
- package/dist/{index-Dvpu22CJ.d.ts → index-1uV69AZq.d.ts} +1 -1
- package/dist/{index-CJB50jzQ.d.ts → index-6H-8Ib1w.d.ts} +6 -6
- package/dist/{index-M1izbwbN.d.ts → index-Ag-T51Jl.d.ts} +1 -1
- package/dist/{index-DNAkWDXc.d.ts → index-BUluRi0b.d.ts} +6 -6
- package/dist/{index-QTZIopQj.d.ts → index-C78VPlXW.d.ts} +1 -1
- package/dist/{index-D18su_r5.d.ts → index-CY612vAg.d.ts} +10 -5
- package/dist/{index-BfU0KR0X.d.ts → index-CnzGRpeH.d.ts} +5 -5
- package/dist/{index-BIAtapnD.d.ts → index-Dbd1E5Au.d.ts} +5 -5
- package/dist/{index-Bhkag9ZE.d.ts → index-Dv6lfL5p.d.ts} +14 -14
- package/dist/{index-8w4OB5En.d.ts → index-F6lsRlsr.d.ts} +1 -1
- package/dist/{index-CeUwyJ3Z.d.ts → index-kkZwp5M1.d.ts} +6 -6
- package/dist/{index-Bz0WLuh_.d.ts → index-lMApFSAd.d.ts} +5 -5
- package/dist/index.d.ts +7 -7
- package/dist/index.js +1 -1
- package/dist/{instances-D31jrmKh.js → instances-xQ2lupVE.js} +246 -12
- package/dist/jwks-cache-CBKtICNV.js +114 -0
- package/dist/{jws-B8p0ppgh.js → jws-De9qjIPV.js} +1 -1
- package/dist/{kit-9pZP5iLU.js → kit-D5rRAKWJ.js} +2 -2
- package/dist/{kit-OgFOW9rX.d.ts → kit-DCuO1ZhB.d.ts} +4 -4
- package/dist/{knowledge-DdZzUTQ-.js → knowledge-CJnZOaix.js} +67 -7
- package/dist/{knowledge-BBC2sfAY.d.ts → knowledge-DWXAxvkN.d.ts} +82 -11
- package/dist/lint/index.d.ts +1 -1
- package/dist/list/index.d.ts +3 -3
- package/dist/{list-query-C7V8kUaD.d.ts → list-query-D1h3Dmnk.d.ts} +3 -3
- package/dist/mapper/bin.js +5 -5
- package/dist/mcp/index.d.ts +3 -3
- package/dist/mcp/index.js +5 -5
- package/dist/mcp/sdk/index.d.ts +6 -6
- package/dist/mcp/sdk/index.js +2 -2
- package/dist/{messaging-D5z2TR37.d.ts → messaging-Bfe4p9Pm.d.ts} +4 -4
- package/dist/{model-messages-BcrkjsPE.js → model-messages-CIHqP7Z3.js} +1 -1
- package/dist/nestjs/index.d.ts +2 -2
- package/dist/nestjs/index.js +1 -1
- package/dist/next/client/index.d.ts +1 -1
- package/dist/next/index.d.ts +331 -79
- package/dist/next/index.js +520 -105
- package/dist/node/index.d.ts +2 -2
- package/dist/node/index.js +1 -1
- package/dist/{operations-BG6prEnh.d.ts → operations-SWpzGC_K.d.ts} +1 -1
- package/dist/{options-D4dxMGHF.js → options-Bgnm4pTD.js} +1 -0
- package/dist/{options-C13-dVMH.js → options-D-jiqb0l.js} +2 -0
- package/dist/{options-DjFbIRgV.js → options-DjdxZgHi.js} +2 -1
- package/dist/{options-CgMiQGOF.js → options-DqmTs2nv.js} +4 -1
- package/dist/{options-C-NFS6e3.js → options-DxgZ8tVc.js} +2 -1
- package/dist/{options-CuPWezcV.js → options-RYbyaVhv.js} +3 -1
- package/dist/options-SOjQVgfS.js +37 -0
- package/dist/{options-JnPEVbBJ.js → options-ScQ6Hnxo.js} +2 -1
- package/dist/{options-Sq4bYbf5.js → options-X61tvckX.js} +4 -1
- package/dist/orpc/index.d.ts +8 -8
- package/dist/orpc/index.js +6 -6
- package/dist/otel/index.d.ts +2 -2
- package/dist/otel/index.js +4 -4
- package/dist/{outbox-7zgh-7nw.d.ts → outbox-BFZS6Kvz.d.ts} +4 -4
- package/dist/{permissions-CoHsUtZS.d.ts → permissions-2UlVQDzY.d.ts} +1 -1
- package/dist/{pool-D-4HyhuW.d.ts → pool-yO-LzZAd.d.ts} +3 -3
- package/dist/{ports-CmEXVqhg.js → ports-CkygVOeE.js} +2 -2
- package/dist/{ports-XvgCe7ey.d.ts → ports-prqYrReN.d.ts} +1 -1
- package/dist/postgres/index.d.ts +4 -4
- package/dist/{postgrest-DZtM2nIS.d.ts → postgrest-Bjain6nf.d.ts} +1 -1
- package/dist/powersync/index.d.ts +6 -6
- package/dist/preset/index.d.ts +3 -3
- package/dist/preset/index.js +3 -3
- package/dist/{preset-om2rbdYw.js → preset-BvHNleCo.js} +2 -2
- package/dist/{project-B7nqCzn5.js → project-CBvowdKY.js} +5 -5
- package/dist/{provider-BI0KC4u5.d.ts → provider-bIAzxVMB.d.ts} +1 -1
- package/dist/{push-token-kcc04ZaS.d.ts → push-token-DtqJeg8w.d.ts} +1 -1
- package/dist/query/index.d.ts +1 -1
- package/dist/{rate-limit-CRhlLFhP.js → rate-limit-BJ4EMdAy.js} +1 -1
- package/dist/react/index.d.ts +9 -9
- package/dist/react/index.js +3 -3
- package/dist/react/native/index.d.ts +1 -1
- package/dist/react/native/index.js +1 -1
- package/dist/react/server.d.ts +9 -9
- package/dist/react/server.js +2 -2
- package/dist/react/session.d.ts +2 -32
- package/dist/react/session.js +1 -37
- package/dist/{react-COIov1yC.js → react-DZ7AW2yf.js} +2 -2
- package/dist/react-router/index.d.ts +6 -6
- package/dist/react-router/index.js +5 -5
- package/dist/realtime/index.d.ts +6 -6
- package/dist/{record-form-DU2EoVsv.d.ts → record-form-BQA-lawE.d.ts} +1 -1
- package/dist/{recordings-D69Va7gP.d.ts → recordings-Bw5LoocX.d.ts} +1 -1
- package/dist/records/index.d.ts +9 -9
- package/dist/{refusal-CGi-0Q18.d.ts → refusal-BX1EvmpJ.d.ts} +3 -3
- package/dist/{refusal-5c6UMpUP.js → refusal-rnbr6RZD.js} +2 -2
- package/dist/{refresh-B8t_KE3s.js → request-kind-tNDM5Z_o.js} +15 -31
- package/dist/{resolve--LfVoOMg.d.ts → resolve-BIpQRhvF.d.ts} +97 -36
- package/dist/{resolve-FW8oeXvh.js → resolve-CZV31iCm.js} +402 -392
- package/dist/{resolved-names-DYYyh35i.js → resolved-names-b6P2--jK.js} +1 -1
- package/dist/{resource-BbWk4hoP.js → resource-COaS9_i8.js} +1 -1
- package/dist/{resource-DWllVW8k.d.ts → resource-CaYpB07K.d.ts} +1 -1
- package/dist/{resource-execute-DUBYKTYU.d.ts → resource-execute-A1NbR-sd.d.ts} +2 -2
- package/dist/{resource-types-RgaljPs0.d.ts → resource-types-CTcc37WL.d.ts} +4 -4
- package/dist/{resources-Bki1J4jy.d.ts → resources-13ZFX1G6.d.ts} +2 -2
- package/dist/{resources-DYSx9NYM.js → resources-DhiK3yLO.js} +1 -1
- package/dist/{respond-DLH4tD2d.js → respond-8A3EOo61.js} +1 -1
- package/dist/{respond-BYOV7KZp.d.ts → respond-CAxhkwAi.d.ts} +15 -19
- package/dist/{sales-lines-DuNVoKHA.d.ts → sales-lines-wQHuL-pa.d.ts} +1 -1
- package/dist/{sandboxes-B2hBoBvJ.d.ts → sandboxes-BF9RxxCU.d.ts} +1 -1
- package/dist/{scores-FAORS4qU.d.ts → scores-Ce8MxQX9.d.ts} +5 -5
- package/dist/server/index.d.ts +58 -36
- package/dist/server/index.js +35 -41
- package/dist/{server-types-C2hlvhP4.d.ts → server-types-DEjva0MW.d.ts} +19 -17
- package/dist/{session-B4VasaAA.d.ts → session-BA0YDmjt.d.ts} +11 -12
- package/dist/session-BjPYE4dT.js +180 -0
- package/dist/session-CeYL3EPm.d.ts +77 -0
- package/dist/{session-status-D8CBxCqv.d.ts → session-status-Df6tuKY9.d.ts} +4 -3
- package/dist/{sign-in-CX1a5i2P.d.ts → sign-in-4u4vLtXG.d.ts} +16 -4
- package/dist/{sign-in-CxdoTEp5.js → sign-in-djgvab1X.js} +3 -3
- package/dist/{sign-in-BMm1xhKq.js → sign-in-k2lXELeC.js} +2 -2
- package/dist/{signatures-CBn7w4VR.js → signatures-DK01D2S7.js} +1 -1
- package/dist/{signers-6ih6i9aq.d.ts → signers-Dw9DBZjJ.d.ts} +4 -4
- package/dist/{signing-keys-De09WNJ3.d.ts → signing-keys-FglIQ6iL.d.ts} +2 -2
- package/dist/{signing-keys-BC5_hJN5.js → signing-keys-sGaXklwD.js} +1 -1
- package/dist/{snapshot-CVMSyTHH.js → snapshot-BOA7lkRg.js} +9 -17
- package/dist/solid/index.d.ts +10 -10
- package/dist/solid/index.js +1 -1
- package/dist/solid-start/index.d.ts +6 -6
- package/dist/solid-start/index.js +5 -5
- package/dist/spec/index.d.ts +2 -2
- package/dist/sql/index.d.ts +5 -5
- package/dist/sql/index.js +3 -3
- package/dist/{sql-DdtukoIm.js → sql-BChN3Hxv.js} +7594 -2269
- package/dist/sqlite/index.d.ts +3 -3
- package/dist/{sso-CuzAjsc8.d.ts → sso-B7w7h8RJ.d.ts} +3 -3
- package/dist/ssr/index.d.ts +5 -6
- package/dist/ssr/index.js +3 -3
- package/dist/storage/index.d.ts +3 -3
- package/dist/storage/index.js +1 -1
- package/dist/streams/index.d.ts +1 -1
- package/dist/{subject-readers-BlD8tALG.d.ts → subject-readers-YL8H9G8X.d.ts} +2 -2
- package/dist/{subjects-Bv2dPflD.d.ts → subjects-CVjAE7nz.d.ts} +3 -3
- package/dist/{support-DxYI6sDM.d.ts → support-BwtMgjVg.d.ts} +4 -4
- package/dist/{support-view-DSmCett7.d.ts → support-view-GykHOIQ2.d.ts} +1 -1
- package/dist/svelte/index.d.ts +9 -9
- package/dist/svelte/index.js +1 -1
- package/dist/sveltekit/index.d.ts +7 -7
- package/dist/sveltekit/index.js +5 -5
- package/dist/{tags--k2fbPfO.d.ts → tags-CAfvzA1U.d.ts} +1 -1
- package/dist/tanstack-db/index.d.ts +3 -3
- package/dist/tanstack-start/index.d.ts +6 -6
- package/dist/tanstack-start/index.js +5 -5
- package/dist/{tenant-DkKbvK5T.d.ts → tenant-lBgoqg9T.d.ts} +1 -1
- package/dist/testing/index.d.ts +27 -28
- package/dist/testing/index.js +5 -5
- package/dist/{timeline-Bq658xsi.d.ts → timeline-CrO48Qa6.d.ts} +5 -5
- package/dist/{topic-B6zuexk7.d.ts → topic-x-mrN_Ff.d.ts} +5 -5
- package/dist/{types-C8UyJOPJ.d.ts → types-6PMaLIyw.d.ts} +3 -3
- package/dist/{types-Dh2OGEW5.d.ts → types-BdhE7I8Z.d.ts} +5 -5
- package/dist/{types-BkYEUWdz.d.ts → types-BzIYSSWK.d.ts} +16 -1
- package/dist/{types-DCoqai8o.d.ts → types-C7K8mu9B.d.ts} +45 -15
- package/dist/{types-d0JBRTAg.d.ts → types-C9XfFGmA.d.ts} +128 -13
- package/dist/{types-BvHw2cCS.d.ts → types-CJqNGQKb.d.ts} +2 -2
- package/dist/{types-TH3zlMiM.d.ts → types-D5uf0l4_.d.ts} +1 -1
- package/dist/{types-BBqP9H6w.d.ts → types-auvHrNWC.d.ts} +4 -4
- package/dist/{undo-22ofP6Zp.d.ts → undo-CdKp5_2X.d.ts} +2 -2
- package/dist/{usage-CNCT6_3D.d.ts → usage-DZ8j5Tm_.d.ts} +4 -4
- package/dist/{vault-yGQD5Rdl.d.ts → vault-DjbG4XQS.d.ts} +2 -2
- package/dist/vercel-connect/index.d.ts +1 -1
- package/dist/vercel-sandbox/index.d.ts +2 -2
- package/dist/{verify-DY_j4GPZ.js → verify-96j8d5ps.js} +1 -1
- package/dist/{verify-BQu3eBNW.d.ts → verify-HOiu3lRR.d.ts} +2 -2
- package/dist/{view-BfEqjZJ_.js → view-Ch0Qtr36.js} +1 -1
- package/dist/{view-Cy2XxYp1.d.ts → view-DdDY88SC.d.ts} +1 -1
- package/dist/vue/index.d.ts +10 -10
- package/dist/vue/index.js +1 -1
- package/dist/{watch-topic-YYSVJGDY.d.ts → watch-topic-D6bcqOrJ.d.ts} +1 -1
- package/dist/workflow-sdk/builder/index.d.ts +29 -5
- package/dist/workflow-sdk/builder/index.js +39 -12
- package/dist/workflow-sdk/index.d.ts +1 -1
- package/dist/workflow-sdk/index.js +2 -2
- package/dist/workflow-sdk/world/index.d.ts +1 -1
- package/dist/workflow-sdk/world/index.js +1 -1
- package/dist/{workflow-sdk-BL3wzkdp.js → workflow-sdk-CBS8L2Ku.js} +5 -0
- package/dist/{workflow-sdk-yIkECybp.d.ts → workflow-sdk-D3H10W5h.d.ts} +3 -3
- package/dist/{workflows-BljkWRxE.d.ts → workflows-BI4yKqFh.d.ts} +3 -3
- package/dist/yjs/index.d.ts +2 -2
- package/dist/yjs/index.js +1 -1
- package/package.json +1 -1
- package/schemas/config-v1.json +162 -0
- package/schemas/doctor-report-v1.json +4 -0
- package/skills/better-supabase-auth/SKILL.md +45 -11
- package/dist/cli/add-C13ZqJ_N.js +0 -1
- package/dist/cli/env-UN6PJFX6.js +0 -1
- package/dist/cli/powersync-DoCruiOt.js +0 -1
- package/dist/cli/seed-ByLneY1H.js +0 -1
- package/dist/errors-D3-4c-XF.js +0 -102
- package/dist/http-BDC1IvBX.js +0 -27
- package/dist/jwks-cache-IZaiICAV.js +0 -48
- package/dist/options-Itq7QYoW.js +0 -20
- package/dist/refresh-BtbC2rZe.d.ts +0 -52
- package/dist/snapshot-BGsJw9xn.d.ts +0 -83
|
@@ -12,6 +12,175 @@ import { i as extraOf, n as blockFields, t as allWithFields } from "../../block-
|
|
|
12
12
|
import { n as defineBlock } from "../../define-block-22Jv4U_-.js";
|
|
13
13
|
import { t as expandRule } from "../../rrule-BLpe2449.js";
|
|
14
14
|
import { t as sameRange } from "../../range-Nrh_qtb_.js";
|
|
15
|
+
// src/blocks/calendar/ics-text.ts
|
|
16
|
+
/** RFC 5545 TEXT: `\n`, `\,`, `\;` and `\\`. */
|
|
17
|
+
function unescapeText(value) {
|
|
18
|
+
return value.replaceAll(/\\([nN,;\\])/g, (_, char) => char === "n" || char === "N" ? "\n" : char);
|
|
19
|
+
}
|
|
20
|
+
function escapeText(value) {
|
|
21
|
+
return value.replaceAll("\\", "\\\\").replaceAll(";", "\\;").replaceAll(",", "\\,").replaceAll(/\r?\n/g, "\\n");
|
|
22
|
+
}
|
|
23
|
+
const pad = (value, size = 2) => String(value).padStart(size, "0");
|
|
24
|
+
function compact(zoned) {
|
|
25
|
+
return `${pad(zoned.year, 4)}${pad(zoned.month)}${pad(zoned.day)}T${pad(zoned.hour)}${pad(zoned.minute)}${pad(zoned.second)}`;
|
|
26
|
+
}
|
|
27
|
+
function utc(instant) {
|
|
28
|
+
return `${compact(instant.toZonedDateTimeISO("UTC"))}Z`;
|
|
29
|
+
}
|
|
30
|
+
// src/blocks/calendar/alarms.ts
|
|
31
|
+
const ACTIONS = [
|
|
32
|
+
"display",
|
|
33
|
+
"email",
|
|
34
|
+
"audio"
|
|
35
|
+
];
|
|
36
|
+
const isAction = (value) => ACTIONS.some((action) => action === value);
|
|
37
|
+
const DURATION = /^([+-])?P(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/u;
|
|
38
|
+
const UTC_DATE_TIME = /^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})Z$/u;
|
|
39
|
+
const whole = (value) => typeof value === "number" && Number.isFinite(value) ? Math.trunc(value) : void 0;
|
|
40
|
+
/** An RFC 5545 duration in whole minutes (seconds are dropped). */
|
|
41
|
+
function durationMinutes(value) {
|
|
42
|
+
const match = DURATION.exec(value.trim().toUpperCase());
|
|
43
|
+
if (match === null || value.trim().length < 3) return;
|
|
44
|
+
const [, sign, weeks, days, hours, minutes, seconds] = match;
|
|
45
|
+
const number = (part) => Number(part ?? "0");
|
|
46
|
+
const total = number(weeks) * 10080 + number(days) * 1440 + number(hours) * 60 + number(minutes) + Math.trunc(number(seconds) / 60);
|
|
47
|
+
return sign === "-" && total !== 0 ? -total : total;
|
|
48
|
+
}
|
|
49
|
+
function minutesDuration(minutes) {
|
|
50
|
+
return `${minutes < 0 ? "-" : ""}PT${String(Math.abs(minutes))}M`;
|
|
51
|
+
}
|
|
52
|
+
function utcInstant(value) {
|
|
53
|
+
const match = UTC_DATE_TIME.exec(value.trim());
|
|
54
|
+
if (match === null) return;
|
|
55
|
+
const [, year, month, day, hour, minute, second] = match;
|
|
56
|
+
try {
|
|
57
|
+
return temporal().Instant.from(`${year}-${month}-${day}T${hour}:${minute}:${second}Z`);
|
|
58
|
+
} catch {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* A feed's or a read's alarm row as a reminder: `method` defaults to the
|
|
64
|
+
* reminders block's `notification`.
|
|
65
|
+
*/
|
|
66
|
+
function reminderOf(value) {
|
|
67
|
+
const at = optionalInstant(value["at"]);
|
|
68
|
+
const repeat = whole(value["repeat"]) ?? 0;
|
|
69
|
+
const repeatMinutes = whole(value["repeatMinutes"]);
|
|
70
|
+
const id = optionalText(value["id"]);
|
|
71
|
+
const description = optionalText(value["description"]);
|
|
72
|
+
const summary = optionalText(value["summary"]);
|
|
73
|
+
return {
|
|
74
|
+
method: optionalText(value["method"]) ?? "notification",
|
|
75
|
+
offsetMinutes: whole(value["offsetMinutes"]) ?? 0,
|
|
76
|
+
...id === void 0 ? {} : { id },
|
|
77
|
+
...value["related"] === "end" ? { related: "end" } : {},
|
|
78
|
+
...at === void 0 ? {} : { at },
|
|
79
|
+
...repeat > 0 && repeatMinutes !== void 0 ? {
|
|
80
|
+
repeat,
|
|
81
|
+
repeatMinutes
|
|
82
|
+
} : {},
|
|
83
|
+
...description === void 0 ? {} : { description },
|
|
84
|
+
...summary === void 0 ? {} : { summary }
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
/** A `calendar_event_alarms` row, as `list_calendar_events` returns it. */
|
|
88
|
+
function alarmOf(value) {
|
|
89
|
+
return {
|
|
90
|
+
...reminderOf(value),
|
|
91
|
+
method: oneOf(value["method"], ACTIONS, "display")
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/** An alarm as the jsonb `save_calendar_event` takes in `item.alarms`. */
|
|
95
|
+
function alarmItem(alarm) {
|
|
96
|
+
const item = { method: alarm.method };
|
|
97
|
+
for (const [key, value] of Object.entries(alarm)) {
|
|
98
|
+
if (value === void 0 || key === "id" || key === "offsetMinutes" && alarm.at !== void 0) continue;
|
|
99
|
+
item[key] = key === "at" ? String(value) : value;
|
|
100
|
+
}
|
|
101
|
+
return item;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* The properties of one `VALARM` as an alarm, or `undefined` for one the
|
|
105
|
+
* calendar block doesn't store: an unknown `ACTION`, a missing or unreadable
|
|
106
|
+
* `TRIGGER`, or a reminder of the reminders block (`X-BSB-METHOD`).
|
|
107
|
+
*/
|
|
108
|
+
function readAlarm(lines) {
|
|
109
|
+
let method;
|
|
110
|
+
let trigger;
|
|
111
|
+
let repeat = 0;
|
|
112
|
+
let repeatMinutes;
|
|
113
|
+
let description;
|
|
114
|
+
let summary;
|
|
115
|
+
for (const line of lines) switch (line.name) {
|
|
116
|
+
case "ACTION": {
|
|
117
|
+
const value = line.value.trim().toLowerCase();
|
|
118
|
+
method = isAction(value) ? value : void 0;
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
case "TRIGGER":
|
|
122
|
+
trigger = line;
|
|
123
|
+
break;
|
|
124
|
+
case "REPEAT":
|
|
125
|
+
repeat = Math.max(0, Math.trunc(Number(line.value.trim())) || 0);
|
|
126
|
+
break;
|
|
127
|
+
case "DURATION":
|
|
128
|
+
repeatMinutes = durationMinutes(line.value);
|
|
129
|
+
break;
|
|
130
|
+
case "DESCRIPTION":
|
|
131
|
+
description = unescapeText(line.value);
|
|
132
|
+
break;
|
|
133
|
+
case "SUMMARY":
|
|
134
|
+
summary = unescapeText(line.value);
|
|
135
|
+
break;
|
|
136
|
+
case "X-BSB-METHOD": return;
|
|
137
|
+
}
|
|
138
|
+
if (method === void 0 || trigger === void 0) return;
|
|
139
|
+
const absolute = trigger.params["VALUE"]?.toUpperCase() === "DATE-TIME";
|
|
140
|
+
const at = absolute ? utcInstant(trigger.value) : void 0;
|
|
141
|
+
const minutes = absolute ? void 0 : durationMinutes(trigger.value);
|
|
142
|
+
const when = at === void 0 ? minutes === void 0 ? void 0 : {
|
|
143
|
+
offsetMinutes: minutes === 0 ? 0 : -minutes,
|
|
144
|
+
...trigger.params["RELATED"]?.toUpperCase() === "END" ? { related: "end" } : {}
|
|
145
|
+
} : {
|
|
146
|
+
offsetMinutes: 0,
|
|
147
|
+
at
|
|
148
|
+
};
|
|
149
|
+
if (when === void 0) return;
|
|
150
|
+
return {
|
|
151
|
+
method,
|
|
152
|
+
...when,
|
|
153
|
+
...repeat > 0 && repeatMinutes !== void 0 && repeatMinutes > 0 ? {
|
|
154
|
+
repeat,
|
|
155
|
+
repeatMinutes
|
|
156
|
+
} : {},
|
|
157
|
+
...description === void 0 ? {} : { description },
|
|
158
|
+
...summary === void 0 ? {} : { summary }
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* One alarm or reminder as `VALARM` lines. An email alarm goes to the event's
|
|
163
|
+
* attendees with an address, and the text and subject RFC 5545 requires fall
|
|
164
|
+
* back to the event's title.
|
|
165
|
+
*/
|
|
166
|
+
function alarmLines(alarm, event) {
|
|
167
|
+
const action = isAction(alarm.method) ? alarm.method : void 0;
|
|
168
|
+
const lines = ["BEGIN:VALARM", `ACTION:${(action ?? "display").toUpperCase()}`];
|
|
169
|
+
if (alarm.at === void 0) {
|
|
170
|
+
const related = alarm.related === "end" ? ";RELATED=END" : "";
|
|
171
|
+
const minutes = Math.trunc(alarm.offsetMinutes);
|
|
172
|
+
lines.push(`TRIGGER${related}:${minutesDuration(minutes === 0 ? 0 : -minutes)}`);
|
|
173
|
+
} else lines.push(`TRIGGER;VALUE=DATE-TIME:${utc(alarm.at)}`);
|
|
174
|
+
if (alarm.repeat !== void 0 && alarm.repeat > 0 && alarm.repeatMinutes !== void 0) lines.push(`REPEAT:${String(Math.trunc(alarm.repeat))}`, `DURATION:${minutesDuration(Math.trunc(alarm.repeatMinutes))}`);
|
|
175
|
+
if (action !== "audio" || alarm.description !== void 0) lines.push(`DESCRIPTION:${escapeText(alarm.description ?? event.title)}`);
|
|
176
|
+
if (action === "email") {
|
|
177
|
+
lines.push(`SUMMARY:${escapeText(alarm.summary ?? event.title)}`);
|
|
178
|
+
for (const attendee of event.attendees ?? []) if (attendee.email !== "") lines.push(`ATTENDEE:mailto:${attendee.email}`);
|
|
179
|
+
}
|
|
180
|
+
if (action === void 0) lines.push(`X-BSB-METHOD:${escapeText(alarm.method)}`);
|
|
181
|
+
lines.push("END:VALARM");
|
|
182
|
+
return lines;
|
|
183
|
+
}
|
|
15
184
|
// src/blocks/calendar/availability.ts
|
|
16
185
|
const CALENDAR_EVENT_KINDS = [
|
|
17
186
|
"event",
|
|
@@ -178,13 +347,6 @@ function contentLine(line) {
|
|
|
178
347
|
}
|
|
179
348
|
}
|
|
180
349
|
}
|
|
181
|
-
/** RFC 5545 TEXT: `\n`, `\,`, `\;` and `\\`. */
|
|
182
|
-
function unescapeText(value) {
|
|
183
|
-
return value.replaceAll(/\\([nN,;\\])/g, (_, char) => char === "n" || char === "N" ? "\n" : char);
|
|
184
|
-
}
|
|
185
|
-
function escapeText(value) {
|
|
186
|
-
return value.replaceAll("\\", "\\\\").replaceAll(";", "\\;").replaceAll(",", "\\,").replaceAll(/\r?\n/g, "\\n");
|
|
187
|
-
}
|
|
188
350
|
function zoneOr(zone, fallback) {
|
|
189
351
|
if (zone === void 0) return fallback;
|
|
190
352
|
try {
|
|
@@ -249,7 +411,7 @@ function attendeeOf$1(line) {
|
|
|
249
411
|
};
|
|
250
412
|
}
|
|
251
413
|
/** One `VEVENT`'s lines as an event, or `undefined` without UID or DTSTART. */
|
|
252
|
-
function eventOf(lines, fallback) {
|
|
414
|
+
function eventOf(lines, fallback, alarmGroups) {
|
|
253
415
|
const time = temporal();
|
|
254
416
|
let uid;
|
|
255
417
|
let start;
|
|
@@ -325,6 +487,10 @@ function eventOf(lines, fallback) {
|
|
|
325
487
|
}
|
|
326
488
|
if (uid === void 0 || uid === "" || start === void 0) return;
|
|
327
489
|
const zoned = start.instant.toZonedDateTimeISO(start.tz);
|
|
490
|
+
const alarms = alarmGroups.flatMap((group) => {
|
|
491
|
+
const alarm = readAlarm(group);
|
|
492
|
+
return alarm === void 0 ? [] : [alarm];
|
|
493
|
+
});
|
|
328
494
|
const endsAt = end?.instant ?? (duration === void 0 ? start.allDay ? zoned.add({ days: 1 }).toInstant() : start.instant : zoned.add(duration).toInstant());
|
|
329
495
|
return {
|
|
330
496
|
uid,
|
|
@@ -341,14 +507,15 @@ function eventOf(lines, fallback) {
|
|
|
341
507
|
...rdates.length === 0 ? {} : { rdates },
|
|
342
508
|
...originalStart === void 0 ? {} : { originalStart },
|
|
343
509
|
attendees,
|
|
344
|
-
...transparent ? { transparency: "transparent" } : {}
|
|
510
|
+
...transparent ? { transparency: "transparent" } : {},
|
|
511
|
+
...alarms.length === 0 ? {} : { alarms }
|
|
345
512
|
};
|
|
346
513
|
}
|
|
347
514
|
/**
|
|
348
515
|
* Reads an iCalendar file (RFC 5545): unfolds lines, unescapes TEXT values and
|
|
349
|
-
* reads each `VEVENT`'s times, recurrence (`RRULE`, `EXDATE`, `RECURRENCE-ID`)
|
|
350
|
-
* and
|
|
351
|
-
* dates use `X-WR-TIMEZONE`, else UTC.
|
|
516
|
+
* reads each `VEVENT`'s times, recurrence (`RRULE`, `EXDATE`, `RECURRENCE-ID`),
|
|
517
|
+
* attendees and alarms (`VALARM`). Times in a zone Temporal does not know,
|
|
518
|
+
* floating times and dates use `X-WR-TIMEZONE`, else UTC.
|
|
352
519
|
*/
|
|
353
520
|
function parseIcs(text) {
|
|
354
521
|
const lines = text.replaceAll(/\r?\n[ \t]/g, "").split(/\r?\n/).flatMap((raw) => {
|
|
@@ -364,20 +531,31 @@ function parseIcs(text) {
|
|
|
364
531
|
const events = [];
|
|
365
532
|
let skipped = 0;
|
|
366
533
|
let current;
|
|
534
|
+
let alarms = [];
|
|
535
|
+
let alarm;
|
|
367
536
|
let depth = 0;
|
|
368
537
|
for (const line of lines) if (line.name === "BEGIN" && line.value.toUpperCase() === "VEVENT") {
|
|
369
538
|
current = [];
|
|
539
|
+
alarms = [];
|
|
370
540
|
depth = 0;
|
|
371
|
-
} else if (current !== void 0 && line.name === "BEGIN")
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
541
|
+
} else if (current !== void 0 && line.name === "BEGIN") {
|
|
542
|
+
if (depth === 0 && line.value.toUpperCase() === "VALARM") alarm = [];
|
|
543
|
+
depth += 1;
|
|
544
|
+
} else if (current !== void 0 && line.name === "END") {
|
|
545
|
+
if (depth > 0) {
|
|
546
|
+
depth -= 1;
|
|
547
|
+
if (depth === 0 && alarm !== void 0) {
|
|
548
|
+
alarms.push(alarm);
|
|
549
|
+
alarm = void 0;
|
|
550
|
+
}
|
|
551
|
+
} else if (line.value.toUpperCase() === "VEVENT") {
|
|
552
|
+
const event = eventOf(current, tz, alarms);
|
|
376
553
|
if (event === void 0) skipped += 1;
|
|
377
554
|
else events.push(event);
|
|
378
555
|
current = void 0;
|
|
379
556
|
}
|
|
380
557
|
} else if (current !== void 0 && depth === 0) current.push(line);
|
|
558
|
+
else if (alarm !== void 0 && depth === 1) alarm.push(line);
|
|
381
559
|
return {
|
|
382
560
|
...name === void 0 ? {} : { name },
|
|
383
561
|
tz,
|
|
@@ -385,13 +563,6 @@ function parseIcs(text) {
|
|
|
385
563
|
skipped
|
|
386
564
|
};
|
|
387
565
|
}
|
|
388
|
-
const pad = (value, size = 2) => String(value).padStart(size, "0");
|
|
389
|
-
function compact(zoned) {
|
|
390
|
-
return `${pad(zoned.year, 4)}${pad(zoned.month)}${pad(zoned.day)}T${pad(zoned.hour)}${pad(zoned.minute)}${pad(zoned.second)}`;
|
|
391
|
-
}
|
|
392
|
-
function utc(instant) {
|
|
393
|
-
return `${compact(instant.toZonedDateTimeISO("UTC"))}Z`;
|
|
394
|
-
}
|
|
395
566
|
function day(instant, tz) {
|
|
396
567
|
const date = instant.toZonedDateTimeISO(tz);
|
|
397
568
|
return `${pad(date.year, 4)}${pad(date.month)}${pad(date.day)}`;
|
|
@@ -490,11 +661,7 @@ function eventLines(event, stamp) {
|
|
|
490
661
|
const cn = attendee.name === void 0 ? "" : `;CN=${paramValue(attendee.name)}`;
|
|
491
662
|
lines.push(`ATTENDEE${cn};ROLE=${ROLE_OUT[attendee.role]};PARTSTAT=${attendee.response.toUpperCase()}:mailto:${attendee.email}`);
|
|
492
663
|
}
|
|
493
|
-
for (const
|
|
494
|
-
const minutes = Math.trunc(reminder.offsetMinutes);
|
|
495
|
-
const trigger = `${minutes > 0 ? "-" : ""}PT${String(Math.abs(minutes))}M`;
|
|
496
|
-
lines.push("BEGIN:VALARM", "ACTION:DISPLAY", `DESCRIPTION:${escapeText(event.title)}`, `TRIGGER:${trigger}`, `X-BSB-METHOD:${escapeText(reminder.method)}`, "END:VALARM");
|
|
497
|
-
}
|
|
664
|
+
for (const alarm of [...event.alarms ?? [], ...event.reminders ?? []]) lines.push(...alarmLines(alarm, event));
|
|
498
665
|
lines.push("END:VEVENT");
|
|
499
666
|
return lines;
|
|
500
667
|
}
|
|
@@ -702,10 +869,22 @@ function attendeeOf(value) {
|
|
|
702
869
|
...flag("optional")
|
|
703
870
|
};
|
|
704
871
|
}
|
|
705
|
-
function
|
|
872
|
+
function feedCalendarOf(value) {
|
|
873
|
+
const row = recordOf(value, "calendar feed");
|
|
874
|
+
const color = optionalText(row["color"]);
|
|
706
875
|
return {
|
|
707
|
-
|
|
708
|
-
|
|
876
|
+
id: textOf(row["id"]),
|
|
877
|
+
name: textOf(row["name"]),
|
|
878
|
+
tz: optionalText(row["tz"]) ?? "UTC",
|
|
879
|
+
...color === void 0 ? {} : { color }
|
|
880
|
+
};
|
|
881
|
+
}
|
|
882
|
+
function feedOrganizationOf(value) {
|
|
883
|
+
if (!isRecord(value)) return;
|
|
884
|
+
const name = optionalText(value["name"]);
|
|
885
|
+
return {
|
|
886
|
+
id: textOf(value["id"]),
|
|
887
|
+
...name === void 0 ? {} : { name }
|
|
709
888
|
};
|
|
710
889
|
}
|
|
711
890
|
/** A `list_calendar_events` or `calendar_feed` row as an event. */
|
|
@@ -743,6 +922,7 @@ function calendarEventOf(value) {
|
|
|
743
922
|
...typeof row["autoDecline"] === "boolean" ? { autoDecline: row["autoDecline"] } : {},
|
|
744
923
|
attendees: recordsOf(row["attendees"], "attendees").map(attendeeOf),
|
|
745
924
|
reminders: recordsOf(row["reminders"], "reminders").map(reminderOf),
|
|
925
|
+
...row["alarms"] === void 0 ? {} : { alarms: recordsOf(row["alarms"], "alarms").map(alarmOf) },
|
|
746
926
|
...updatedAt === void 0 ? {} : { updatedAt },
|
|
747
927
|
...rdates === void 0 ? {} : { rdates: rdates.map((date) => requiredInstant(date, "rdate")) },
|
|
748
928
|
...row["visibility"] === void 0 ? {} : { visibility: oneOf(row["visibility"], ["public", "private"], "public") },
|
|
@@ -755,6 +935,7 @@ function itemOf(input) {
|
|
|
755
935
|
for (const [key, value] of Object.entries(input)) {
|
|
756
936
|
if (value === void 0) continue;
|
|
757
937
|
if ((key === "exdates" || key === "rdates") && Array.isArray(value)) item[key] = value.map(String);
|
|
938
|
+
else if (key === "alarms" && Array.isArray(value)) item[key] = value.map(alarmItem);
|
|
758
939
|
else if (key === "startsAt" || key === "endsAt" || key === "originalStart") item[key] = String(value);
|
|
759
940
|
else item[key] = value;
|
|
760
941
|
}
|
|
@@ -776,7 +957,8 @@ function importItem(event) {
|
|
|
776
957
|
exdates: event.exdates,
|
|
777
958
|
...event.rdates === void 0 ? {} : { rdates: event.rdates },
|
|
778
959
|
...event.originalStart === void 0 ? {} : { originalStart: event.originalStart },
|
|
779
|
-
...event.transparency === void 0 ? {} : { transparency: event.transparency }
|
|
960
|
+
...event.transparency === void 0 ? {} : { transparency: event.transparency },
|
|
961
|
+
alarms: event.alarms ?? []
|
|
780
962
|
});
|
|
781
963
|
}
|
|
782
964
|
/** The fields of a series that an override or a new series starts from. */
|
|
@@ -794,7 +976,8 @@ function copyOf(event) {
|
|
|
794
976
|
...event.kind === void 0 ? {} : { kind: event.kind },
|
|
795
977
|
...event.transparency === void 0 ? {} : { transparency: event.transparency },
|
|
796
978
|
...event.autoDecline === void 0 ? {} : { autoDecline: event.autoDecline },
|
|
797
|
-
...event.visibility === void 0 ? {} : { visibility: event.visibility }
|
|
979
|
+
...event.visibility === void 0 ? {} : { visibility: event.visibility },
|
|
980
|
+
...event.alarms === void 0 ? {} : { alarms: event.alarms }
|
|
798
981
|
};
|
|
799
982
|
}
|
|
800
983
|
const INFINITE = {
|
|
@@ -833,6 +1016,7 @@ const EVENT_INPUT = /* @__PURE__ */ new Set([
|
|
|
833
1016
|
"kind",
|
|
834
1017
|
"transparency",
|
|
835
1018
|
"autoDecline",
|
|
1019
|
+
"alarms",
|
|
836
1020
|
"uid",
|
|
837
1021
|
"recurrenceId",
|
|
838
1022
|
"originalStart"
|
|
@@ -862,7 +1046,8 @@ function createCalendar(options) {
|
|
|
862
1046
|
range_start: range.from.toString(),
|
|
863
1047
|
range_end: range.until.toString()
|
|
864
1048
|
}, (value) => recordsOf(value, "list_calendar_events").map((raw) => [raw, calendarEventOf(raw)])).andThen((rows) => allWithFields(fields, rows));
|
|
865
|
-
|
|
1049
|
+
const feedEvents = (value, fn) => AsyncResult.from(() => allWithFields(fields, recordsOf(value, fn).map((raw) => [raw, calendarEventOf(raw)])));
|
|
1050
|
+
const client = {
|
|
866
1051
|
createCalendar: (organizationId, name, extra = {}) => {
|
|
867
1052
|
const attrs = attributesOf(extra);
|
|
868
1053
|
return call("create_calendar", {
|
|
@@ -1024,19 +1209,33 @@ function createCalendar(options) {
|
|
|
1024
1209
|
name: calendar.name,
|
|
1025
1210
|
tz: calendar.tz
|
|
1026
1211
|
})),
|
|
1027
|
-
feed: (token) =>
|
|
1028
|
-
|
|
1212
|
+
feed: (token) => client.feedData(token).map((data) => data === null ? null : toIcs(data.events, {
|
|
1213
|
+
name: data.calendar.name,
|
|
1214
|
+
tz: data.calendar.tz
|
|
1215
|
+
})),
|
|
1216
|
+
userFeed: (token) => client.userFeedData(token).map((data) => data === null ? null : toIcs(data.events)),
|
|
1217
|
+
feedData: (token) => call("calendar_feed", { token }, (value) => value).andThen((value) => {
|
|
1218
|
+
if (value === null || value === void 0) return AsyncResult.ok(null);
|
|
1029
1219
|
const row = recordOf(value, "calendar_feed");
|
|
1030
|
-
const
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1220
|
+
const organization = feedOrganizationOf(row["organization"]);
|
|
1221
|
+
const createdBy = optionalText(row["createdBy"]);
|
|
1222
|
+
return feedEvents(row["events"], "calendar_feed").map((events) => ({
|
|
1223
|
+
calendar: feedCalendarOf(row["calendar"]),
|
|
1224
|
+
...organization === void 0 ? {} : { organization },
|
|
1225
|
+
...createdBy === void 0 ? {} : { createdBy },
|
|
1226
|
+
events
|
|
1227
|
+
}));
|
|
1035
1228
|
}),
|
|
1036
|
-
|
|
1037
|
-
if (value === null || value === void 0) return null;
|
|
1229
|
+
userFeedData: (token) => call("calendar_user_feed", { token }, (value) => value).andThen((value) => {
|
|
1230
|
+
if (value === null || value === void 0) return AsyncResult.ok(null);
|
|
1038
1231
|
const row = recordOf(value, "calendar_user_feed");
|
|
1039
|
-
|
|
1232
|
+
const organization = feedOrganizationOf(row["organization"]);
|
|
1233
|
+
return feedEvents(row["events"], "calendar_user_feed").map((events) => ({
|
|
1234
|
+
userId: textOf(row["userId"]),
|
|
1235
|
+
...organization === void 0 ? {} : { organization },
|
|
1236
|
+
calendars: recordsOf(row["calendars"], "calendar_user_feed").map(feedCalendarOf),
|
|
1237
|
+
events
|
|
1238
|
+
}));
|
|
1040
1239
|
}),
|
|
1041
1240
|
setWorkingHours: (organizationId, input) => call("set_calendar_working_hours", {
|
|
1042
1241
|
tenant: organizationId,
|
|
@@ -1054,7 +1253,8 @@ function createCalendar(options) {
|
|
|
1054
1253
|
range_start: range.from.toString(),
|
|
1055
1254
|
range_end: range.until.toString()
|
|
1056
1255
|
}, freeBusyOf)
|
|
1057
|
-
}
|
|
1256
|
+
};
|
|
1257
|
+
return withBlockHooks(client, options.hooks, {
|
|
1058
1258
|
block: "calendar",
|
|
1059
1259
|
...options.logger ? { logger: options.logger } : {}
|
|
1060
1260
|
});
|
|
@@ -1184,6 +1384,58 @@ const calendarEvents = defineEvents({
|
|
|
1184
1384
|
"calendar_event.deleted": event()
|
|
1185
1385
|
});
|
|
1186
1386
|
// src/blocks/calendar/schemas.ts
|
|
1387
|
+
/** One alarm (`VALARM`) of an event. */
|
|
1388
|
+
const calendarAlarmSchema = entitySchema({
|
|
1389
|
+
title: "CalendarAlarm",
|
|
1390
|
+
fields: {
|
|
1391
|
+
id: {
|
|
1392
|
+
kind: "string",
|
|
1393
|
+
optional: true
|
|
1394
|
+
},
|
|
1395
|
+
method: {
|
|
1396
|
+
kind: "enum",
|
|
1397
|
+
values: [
|
|
1398
|
+
"display",
|
|
1399
|
+
"email",
|
|
1400
|
+
"audio"
|
|
1401
|
+
]
|
|
1402
|
+
},
|
|
1403
|
+
offsetMinutes: {
|
|
1404
|
+
kind: "integer",
|
|
1405
|
+
minimum: -525600,
|
|
1406
|
+
maximum: 525600,
|
|
1407
|
+
description: "Minutes before the start (or end); negative fires after. Ignored with at."
|
|
1408
|
+
},
|
|
1409
|
+
related: {
|
|
1410
|
+
kind: "enum",
|
|
1411
|
+
values: ["start", "end"],
|
|
1412
|
+
optional: true
|
|
1413
|
+
},
|
|
1414
|
+
at: {
|
|
1415
|
+
kind: "instant",
|
|
1416
|
+
optional: true,
|
|
1417
|
+
description: "An absolute time, instead of offsetMinutes."
|
|
1418
|
+
},
|
|
1419
|
+
repeat: {
|
|
1420
|
+
kind: "integer",
|
|
1421
|
+
optional: true,
|
|
1422
|
+
minimum: 0
|
|
1423
|
+
},
|
|
1424
|
+
repeatMinutes: {
|
|
1425
|
+
kind: "integer",
|
|
1426
|
+
optional: true,
|
|
1427
|
+
minimum: 1
|
|
1428
|
+
},
|
|
1429
|
+
description: {
|
|
1430
|
+
kind: "string",
|
|
1431
|
+
optional: true
|
|
1432
|
+
},
|
|
1433
|
+
summary: {
|
|
1434
|
+
kind: "string",
|
|
1435
|
+
optional: true
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
});
|
|
1187
1439
|
/**
|
|
1188
1440
|
* What `upsert` takes for an event. Fields left out keep their value on update,
|
|
1189
1441
|
* so every field is optional.
|
|
@@ -1288,6 +1540,13 @@ const calendarEventInputSchema = entitySchema({
|
|
|
1288
1540
|
optional: true,
|
|
1289
1541
|
description: "On an out-of-office or focus-time block: decline the invitations it covers."
|
|
1290
1542
|
},
|
|
1543
|
+
alarms: {
|
|
1544
|
+
kind: "custom",
|
|
1545
|
+
schema: calendarAlarmSchema,
|
|
1546
|
+
optional: true,
|
|
1547
|
+
array: true,
|
|
1548
|
+
description: "Replaces the event's alarms."
|
|
1549
|
+
},
|
|
1291
1550
|
uid: {
|
|
1292
1551
|
kind: "string",
|
|
1293
1552
|
optional: true,
|
|
@@ -1316,4 +1575,4 @@ const calendarBlock = defineBlock({
|
|
|
1316
1575
|
"record-timeline"
|
|
1317
1576
|
]
|
|
1318
1577
|
});
|
|
1319
|
-
export { calendarBlock, calendarEventInputSchema, calendarEventOf, calendarEvents, commonFreeTime, createCalendar, createCalendarController, expandOccurrences, freeBusyOf, fromEventCalendarUpdate, parseIcs, seriesOf, splitRule, toEventCalendarEvents, toEventCalendarResources, toIcs, workingHoursOf };
|
|
1578
|
+
export { calendarAlarmSchema, calendarBlock, calendarEventInputSchema, calendarEventOf, calendarEvents, commonFreeTime, createCalendar, createCalendarController, expandOccurrences, freeBusyOf, fromEventCalendarUpdate, parseIcs, seriesOf, splitRule, toEventCalendarEvents, toEventCalendarResources, toIcs, workingHoursOf };
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import { t as AsyncResult } from "../../result-DTOQRyGY.js";
|
|
3
3
|
import { t as StandardSchemaV1 } from "../../standard-DRX6Ch1j.js";
|
|
4
4
|
import { r as FieldsOf } from "../../block-fields-Puv5m5D3.js";
|
|
5
|
-
import { Ct as Events, j as CommerceEventData } from "../../events-
|
|
5
|
+
import { Ct as Events, j as CommerceEventData } from "../../events-DCw3c6pj.js";
|
|
6
6
|
import { n as Logger } from "../../logger-0LfhvwE4.js";
|
|
7
|
-
import { i as CursorPageOptions, n as BlockOptions } from "../../block-helpers-
|
|
8
|
-
import { a as dbTransport, i as RpcClient, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-
|
|
9
|
-
import { a as BlockTransportMiddleware, d as extendBlock, f as withBlockHooks, n as BlockHooks, p as wrapTransport } from "../../block-hooks-
|
|
10
|
-
import { h as FilterQuery } from "../../filter-query-
|
|
11
|
-
import { Sn as EntitySchema, c as BlockOf } from "../../define-block-
|
|
7
|
+
import { i as CursorPageOptions, n as BlockOptions } from "../../block-helpers-BNtM1tqy.js";
|
|
8
|
+
import { a as dbTransport, i as RpcClient, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-CDmOUuLZ.js";
|
|
9
|
+
import { a as BlockTransportMiddleware, d as extendBlock, f as withBlockHooks, n as BlockHooks, p as wrapTransport } from "../../block-hooks-CtMsgLQr.js";
|
|
10
|
+
import { h as FilterQuery } from "../../filter-query-Xj40B5KT.js";
|
|
11
|
+
import { Sn as EntitySchema, c as BlockOf } from "../../define-block-Ds3aLZwz.js";
|
|
12
12
|
import { n as Money } from "../../money-BgpAd7d3.js";
|
|
13
13
|
import { t as RankNeighbors } from "../../rank-result-B_xLQCBV.js";
|
|
14
14
|
export declare const PRODUCT_KINDS: readonly ["physical", "digital", "service"];
|
|
@@ -39,6 +39,26 @@ interface ProductInput {
|
|
|
39
39
|
readonly description?: string;
|
|
40
40
|
/** Default `physical`. */
|
|
41
41
|
readonly kind?: ProductKind;
|
|
42
|
+
/**
|
|
43
|
+
* The product's own price and currency, when your products table maps `price`
|
|
44
|
+
* and `currency`. Left out, the columns keep their value; `null` clears the
|
|
45
|
+
* price.
|
|
46
|
+
*/
|
|
47
|
+
readonly price?: Money | null;
|
|
48
|
+
/** When your products table maps `trackInventory`. */
|
|
49
|
+
readonly trackInventory?: boolean;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* `updateProduct`'s input: what it leaves out keeps its value, and `null`
|
|
53
|
+
* clears `description` or derives `slug` from the title again.
|
|
54
|
+
*/
|
|
55
|
+
interface ProductPatch {
|
|
56
|
+
readonly title?: string;
|
|
57
|
+
readonly slug?: string | null;
|
|
58
|
+
readonly description?: string | null;
|
|
59
|
+
readonly kind?: ProductKind;
|
|
60
|
+
readonly price?: Money | null;
|
|
61
|
+
readonly trackInventory?: boolean;
|
|
42
62
|
}
|
|
43
63
|
interface SavedProduct {
|
|
44
64
|
readonly id: string;
|
|
@@ -53,7 +73,10 @@ interface OptionInput {
|
|
|
53
73
|
/** Updates this option; creates one when left out. */
|
|
54
74
|
readonly id?: string;
|
|
55
75
|
readonly name: string;
|
|
56
|
-
/**
|
|
76
|
+
/**
|
|
77
|
+
* The values in display order. A value left out is removed with the variants
|
|
78
|
+
* that use it; a variant something still references is archived instead.
|
|
79
|
+
*/
|
|
57
80
|
readonly values: readonly string[];
|
|
58
81
|
}
|
|
59
82
|
interface OptionValue {
|
|
@@ -64,23 +87,31 @@ interface SavedOption {
|
|
|
64
87
|
readonly id: string;
|
|
65
88
|
readonly values: readonly OptionValue[];
|
|
66
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* On `updateVariant`, a key left out keeps its value and `null` clears `sku`,
|
|
92
|
+
* `title`, `barcode` or `weightGrams`.
|
|
93
|
+
*/
|
|
67
94
|
interface VariantInput {
|
|
68
|
-
readonly sku
|
|
95
|
+
readonly sku?: string | null;
|
|
69
96
|
/** One option value id per product option. */
|
|
70
97
|
readonly optionValues?: readonly string[];
|
|
71
|
-
readonly title?: string;
|
|
72
|
-
readonly barcode?: string;
|
|
73
|
-
readonly weightGrams?: number;
|
|
98
|
+
readonly title?: string | null;
|
|
99
|
+
readonly barcode?: string | null;
|
|
100
|
+
readonly weightGrams?: number | null;
|
|
74
101
|
/** Whether inventory counts stock for it. Default `true`. */
|
|
75
102
|
readonly trackInventory?: boolean;
|
|
76
103
|
/** Whether it sells with no stock available. Default `false`. */
|
|
77
104
|
readonly allowBackorder?: boolean;
|
|
105
|
+
/** The extra columns (`options.variantExtraColumns`) by name. */
|
|
106
|
+
readonly fields?: Readonly<Record<string, unknown>>;
|
|
78
107
|
}
|
|
79
108
|
interface SavedVariant {
|
|
80
109
|
readonly id: string;
|
|
81
|
-
readonly sku
|
|
110
|
+
readonly sku?: string;
|
|
82
111
|
/** Its rank key among the product's variants. */
|
|
83
112
|
readonly rank: string;
|
|
113
|
+
/** The extra columns, with `options.variantExtraColumns`. */
|
|
114
|
+
readonly fields?: Readonly<Record<string, unknown>>;
|
|
84
115
|
}
|
|
85
116
|
interface PriceListInput {
|
|
86
117
|
readonly id?: string;
|
|
@@ -123,11 +154,15 @@ interface CategoryInput {
|
|
|
123
154
|
readonly name: string;
|
|
124
155
|
readonly slug?: string;
|
|
125
156
|
readonly description?: string;
|
|
157
|
+
/** The extra columns (`options.categoryExtraColumns`) by name. */
|
|
158
|
+
readonly fields?: Readonly<Record<string, unknown>>;
|
|
126
159
|
}
|
|
127
160
|
interface SavedCategory {
|
|
128
161
|
readonly id: string;
|
|
129
162
|
readonly slug: string;
|
|
130
163
|
readonly rank: string;
|
|
164
|
+
/** The extra columns, with `options.categoryExtraColumns`. */
|
|
165
|
+
readonly fields?: Readonly<Record<string, unknown>>;
|
|
131
166
|
}
|
|
132
167
|
interface CollectionBase {
|
|
133
168
|
readonly id?: string;
|
|
@@ -230,12 +265,14 @@ interface ProductMedia {
|
|
|
230
265
|
interface Catalog<F extends object = Record<never, never>> {
|
|
231
266
|
/** Keys besides the input's own are the product's extra columns. */
|
|
232
267
|
createProduct(organizationId: string, input: ProductInput & Partial<F>): AsyncResult<SavedProduct & F>;
|
|
233
|
-
updateProduct(organizationId: string, productId: string, input:
|
|
268
|
+
updateProduct(organizationId: string, productId: string, input: ProductPatch & Partial<F>): AsyncResult<SavedProduct & F>;
|
|
234
269
|
/** Moves a product between `draft`, `active` and `archived`. */
|
|
235
|
-
setProductStatus(productId: string, status: ProductStatus): AsyncResult<StatusChange>;
|
|
270
|
+
setProductStatus(productId: string, status: ProductStatus | (string & {})): AsyncResult<StatusChange>;
|
|
236
271
|
deleteProduct(productId: string): AsyncResult<boolean>;
|
|
237
272
|
saveOption(productId: string, input: OptionInput): AsyncResult<SavedOption>;
|
|
238
273
|
deleteOption(optionId: string): AsyncResult<boolean>;
|
|
274
|
+
/** Puts the product's options in this order; it names each one once. */
|
|
275
|
+
reorderOptions(productId: string, optionIds: readonly string[]): AsyncResult<boolean>;
|
|
239
276
|
createVariant(productId: string, input: VariantInput): AsyncResult<SavedVariant>;
|
|
240
277
|
updateVariant(productId: string, variantId: string, input: VariantInput): AsyncResult<SavedVariant>;
|
|
241
278
|
/** Moves a variant between the variants with rank keys `previous` and `next`. */
|
|
@@ -340,4 +377,4 @@ export declare const catalogBlock: BlockOf<"catalog", typeof createCatalog, Cata
|
|
|
340
377
|
* checks.
|
|
341
378
|
*/
|
|
342
379
|
export declare const productInputSchema: EntitySchema<ProductInput>;
|
|
343
|
-
export { type BlockHooks, type BlockTransport, type BlockTransportMiddleware, type Catalog, type CatalogEvents, type CatalogOptions, type CategoryInput, type ChannelInput, type ChannelProduct, type ChannelProductsOptions, type CollectionInput, type LocaleOptions, type LocalizedProduct, type LocalizedVariant, type OptionInput, type OptionValue, type Price, type PriceInput, type PriceListInput, type ProductInput, type ProductKind, type ProductMedia, type ProductMediaInput, type ProductStatus, type ProductTranslation, type RpcClient, type SavedCategory, type SavedChannel, type SavedCollection, type SavedOption, type SavedPrice, type SavedProduct, type SavedProductMedia, type SavedVariant, type StatusChange, type VariantInput, type VariantPriceOptions, dbTransport, extendBlock, rpcTransport, sqlTransport, withBlockHooks, wrapTransport };
|
|
380
|
+
export { type BlockHooks, type BlockTransport, type BlockTransportMiddleware, type Catalog, type CatalogEvents, type CatalogOptions, type CategoryInput, type ChannelInput, type ChannelProduct, type ChannelProductsOptions, type CollectionInput, type LocaleOptions, type LocalizedProduct, type LocalizedVariant, type OptionInput, type OptionValue, type Price, type PriceInput, type PriceListInput, type ProductInput, type ProductKind, type ProductMedia, type ProductMediaInput, type ProductPatch, type ProductStatus, type ProductTranslation, type RpcClient, type SavedCategory, type SavedChannel, type SavedCollection, type SavedOption, type SavedPrice, type SavedProduct, type SavedProductMedia, type SavedVariant, type StatusChange, type VariantInput, type VariantPriceOptions, dbTransport, extendBlock, rpcTransport, sqlTransport, withBlockHooks, wrapTransport };
|