better-supabase 0.35.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-X3yzJljM.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-D1P3VBOd.d.ts → authorization-2Rv1AJQJ.d.ts} +114 -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/{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-Bvv-Zrdh.d.ts → bind-C2XvMlfg.d.ts} +7 -7
- package/dist/{block-env-h_uPl2f_.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-pj3eHfoP.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 +39 -17
- package/dist/blocks/catalog/index.js +35 -15
- 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/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 +26 -10
- package/dist/blocks/invoices/index.js +23 -7
- 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 +111 -17
- 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/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-DzgsOE8V.js → add-D2CH8t_B.js} +2 -2
- package/dist/cli/add-De73Ghlh.js +1 -0
- package/dist/cli/{add-CYreXA68.js → add-Duf1-19E.js} +16 -14
- package/dist/cli/{agent-59XWXsRi.js → agent-Tqq3MAqx.js} +26 -1
- package/dist/cli/{app-table-files-BnISa3uY.js → app-table-files-ha8X0rRE.js} +2 -2
- package/dist/cli/app-tables-BIyQcsHH.js +42 -0
- package/dist/cli/{backfill-BLLTSDSa.js → backfill-CLgA6-ll.js} +3 -3
- package/dist/cli/bin.js +1 -1
- package/dist/cli/{blocks-uzh1g_0v.js → blocks-9AeouX4h.js} +2 -2
- package/dist/cli/{blocks-CpRvI7x8.js → blocks-BVB1fMMj.js} +1 -1
- package/dist/cli/{cache-BPWC7tGD.js → cache-aMk9vF1_.js} +1 -1
- package/dist/cli/{codemod-CbJVS_kG.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-Cjkm2Sg3.js → content-mapper-CEtdbshU.js} +2 -2
- package/dist/cli/{db-Diy1OebO.js → db-CeiQzhPq.js} +2 -2
- package/dist/cli/{doctor-D94FEJZs.js → doctor-DaOUWfRN.js} +386 -49
- package/dist/cli/env-BfWbheiC.js +1 -0
- package/dist/cli/{env-BAJn6wCA.js → env-DVV10l_r.js} +1 -1
- package/dist/cli/{gen-Cd0VNDjE.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-Co1N9ZoA.js → init-Xit9Hnbb.js} +9 -9
- package/dist/cli/{keys-CxajkV_7.js → keys-DJTN2Avl.js} +1 -1
- package/dist/cli/{live-NFNeZsP7.js → live-CuMpyRjF.js} +2 -2
- package/dist/cli/{mcp-WZ8t7NMz.js → mcp-C7d4j5cq.js} +4 -4
- package/dist/cli/{metadata-BzMkmrZR.js → metadata-D2YvkY2D.js} +3 -3
- package/dist/cli/{migrate-C9gyDAV7.js → migrate-BCXxyTKt.js} +2 -2
- package/dist/cli/{migration-safety-BNi8PIiM.js → migration-safety-DfwTOBQ4.js} +1 -1
- package/dist/cli/{migrations-Ds0J_TmZ.js → migrations-nomh4TBo.js} +2 -2
- package/dist/cli/{module-migration-hFrlzQZ5.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-oFiwgsBi.js → powersync-DB9WZsIv.js} +4 -4
- package/dist/cli/powersync-IBM_v_eJ.js +1 -0
- package/dist/cli/{print-BtreoJSm.js → print-S6IF5rZm.js} +2 -2
- package/dist/cli/{providers-Be2dgyuR.js → providers-BDTcal71.js} +1 -1
- package/dist/cli/{prune-workflows-BPxgRrqY.js → prune-workflows-Zr2DjByi.js} +3 -3
- package/dist/cli/{remove-B4ad996E.js → remove-CPX5Tg5s.js} +6 -6
- package/dist/cli/{render-C-Mfq-o3.js → render-Bp7a7XQ9.js} +18 -4
- package/dist/cli/{run-D2nuyyPo.js → run-BclCFEyP.js} +12 -48
- package/dist/cli/{run-dY9uOC3W.js → run-BlVaLnt_.js} +2 -2
- package/dist/cli/{run-cLdnJHH0.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-DCHxLAEL.js → shared-D60W9NS-.js} +1 -1
- package/dist/cli/{skills-jZThjL3B.js → skills-DH-yPDny.js} +1 -1
- package/dist/cli/{snapshot-CloKPNxv.js → snapshot-C3_eQUgY.js} +2 -2
- package/dist/cli/{source-Bwyp18Rj.js → source-Bk6XwIAK.js} +1 -1
- package/dist/cli/{spec-DsVq4_qV.js → spec-BDTpcBns.js} +1 -1
- package/dist/cli/{spec-DAUF4ybu.js → spec-C8ydQwZC.js} +3 -3
- package/dist/cli/{sql-layout-CHpEL0oq.js → sql-layout-DVQ20UMi.js} +2 -2
- package/dist/cli/{stack-147NqctC.js → stack-CmhSfY5V.js} +3 -2
- package/dist/cli/{sync-DZu1r34s.js → sync-D-WO4Yvl.js} +4 -4
- package/dist/cli/{table-D9FbJS8h.js → table-k5OABwy3.js} +1 -1
- package/dist/cli/{upgrade-Bpvi70zm.js → upgrade-DGe5Pv6v.js} +5 -5
- package/dist/cli/{upgrade-A-BALvp3.js → upgrade-XdhMuHAu.js} +3 -3
- package/dist/cli/{version-B59mZJoy.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-BZWSFxkG.js → config-BKxjItQ-.js} +3 -3
- package/dist/{config-DQP0IvDX.js → config-BrRlSxhx.js} +1 -1
- package/dist/{connectors-Cf2LeAuZ.d.ts → connectors-CrLRW4Ol.d.ts} +4 -4
- package/dist/{context-CderJRZf.d.ts → context-yfOlyAqb.d.ts} +3 -3
- package/dist/contract/index.d.ts +9 -9
- package/dist/{controller-DaWA9eWS.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-BefkpQIz.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-D1meOs_H.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-BbDiBiKt.d.ts → index-6H-8Ib1w.d.ts} +4 -4
- package/dist/{index-M1izbwbN.d.ts → index-Ag-T51Jl.d.ts} +1 -1
- package/dist/{index-ZQZMQF4l.d.ts → index-BUluRi0b.d.ts} +6 -6
- package/dist/{index-BQlLxOj5.d.ts → index-C78VPlXW.d.ts} +1 -1
- package/dist/{index-D18su_r5.d.ts → index-CY612vAg.d.ts} +10 -5
- package/dist/{index-DXUiRyEk.d.ts → index-CnzGRpeH.d.ts} +5 -5
- package/dist/{index-BIAtapnD.d.ts → index-Dbd1E5Au.d.ts} +5 -5
- package/dist/{index-ChLuLxy-.d.ts → index-Dv6lfL5p.d.ts} +14 -14
- package/dist/{index-8w4OB5En.d.ts → index-F6lsRlsr.d.ts} +1 -1
- package/dist/{index-D9aV0Fvx.d.ts → index-kkZwp5M1.d.ts} +6 -6
- package/dist/{index-C13UgV67.d.ts → index-lMApFSAd.d.ts} +5 -5
- package/dist/index.d.ts +7 -7
- package/dist/index.js +1 -1
- package/dist/{instances-D9YrkoAy.js → instances-xQ2lupVE.js} +218 -11
- 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-t_hlXkS4.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-C9bp3SEA.js → options-DqmTs2nv.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-CuaWhsQS.js → options-X61tvckX.js} +2 -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-C8p6RlIZ.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-C-8uduFM.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-B_sSI9vg.js → preset-BvHNleCo.js} +2 -2
- package/dist/{project-DVlXQGEp.js → project-CBvowdKY.js} +5 -5
- package/dist/{provider-BI0KC4u5.d.ts → provider-bIAzxVMB.d.ts} +1 -1
- package/dist/{push-token-D41lOoE8.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-h-3UbKcw.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-C9nO-Mat.js → sql-BChN3Hxv.js} +7382 -2219
- 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-gezshhcs.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-BVq5RdsI.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-hTj5OuFo.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-BOclyLFd.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 +126 -0
- package/schemas/doctor-report-v1.json +4 -0
- package/skills/better-supabase-auth/SKILL.md +45 -11
- package/dist/cli/add-BaB3y1lv.js +0 -1
- package/dist/cli/env-UN6PJFX6.js +0 -1
- package/dist/cli/powersync-J2Kms2NT.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
|
@@ -2,18 +2,51 @@
|
|
|
2
2
|
import { T as ErrorMapper, t as AsyncResult } from "../../result-DTOQRyGY.js";
|
|
3
3
|
import { t as StandardSchemaV1 } from "../../standard-DRX6Ch1j.js";
|
|
4
4
|
import { i as RowFields, r as FieldsOf } from "../../block-fields-Puv5m5D3.js";
|
|
5
|
-
import {
|
|
6
|
-
import { Ct as Events } from "../../events-
|
|
7
|
-
import { N as QuoteEventData } from "../../index-
|
|
5
|
+
import { et as RecordRef } from "../../types-BzIYSSWK.js";
|
|
6
|
+
import { Ct as Events } from "../../events-DCw3c6pj.js";
|
|
7
|
+
import { N as QuoteEventData } from "../../index-CY612vAg.js";
|
|
8
8
|
import { n as Logger } from "../../logger-0LfhvwE4.js";
|
|
9
|
-
import { r as BlockTemporalOptions } from "../../block-helpers-
|
|
10
|
-
import { a as dbTransport, i as RpcClient, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-
|
|
11
|
-
import { a as BlockTransportMiddleware, d as extendBlock, f as withBlockHooks, n as BlockHooks, p as wrapTransport } from "../../block-hooks-
|
|
12
|
-
import { Zt as DefaultAutomation, c as BlockOf } from "../../define-block-
|
|
9
|
+
import { r as BlockTemporalOptions } from "../../block-helpers-BNtM1tqy.js";
|
|
10
|
+
import { a as dbTransport, i as RpcClient, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-CDmOUuLZ.js";
|
|
11
|
+
import { a as BlockTransportMiddleware, d as extendBlock, f as withBlockHooks, n as BlockHooks, p as wrapTransport } from "../../block-hooks-CtMsgLQr.js";
|
|
12
|
+
import { Zt as DefaultAutomation, c as BlockOf } from "../../define-block-Ds3aLZwz.js";
|
|
13
13
|
import { n as Money } from "../../money-BgpAd7d3.js";
|
|
14
|
-
import { i as Totals, n as Line, r as LineInput, t as CatalogLineInput } from "../../sales-lines-
|
|
14
|
+
import { i as Totals, n as Line, r as LineInput, t as CatalogLineInput } from "../../sales-lines-wQHuL-pa.js";
|
|
15
15
|
type QuoteStatus = "draft" | "sent" | "viewed" | "accepted" | "rejected" | "changes_requested" | "expired" | "withdrawn";
|
|
16
16
|
type QuoteDecision = "accepted" | "rejected" | "changes_requested";
|
|
17
|
+
/** A quote line, with its place on the quote. */
|
|
18
|
+
interface QuoteLine extends Line {
|
|
19
|
+
/** 1-based; `selected` in a decision names lines by it. */
|
|
20
|
+
readonly position: number;
|
|
21
|
+
/** The heading the line sits under. */
|
|
22
|
+
readonly section?: string;
|
|
23
|
+
/** An optional line counts only while `selected`. */
|
|
24
|
+
readonly optional: boolean;
|
|
25
|
+
readonly selected: boolean;
|
|
26
|
+
}
|
|
27
|
+
/** The totals of one tax rate (and tax code), after the document discount. */
|
|
28
|
+
interface QuoteTaxLine {
|
|
29
|
+
readonly taxRateBps: number;
|
|
30
|
+
readonly taxCode?: string;
|
|
31
|
+
readonly net: Money;
|
|
32
|
+
readonly tax: Money;
|
|
33
|
+
readonly gross: Money;
|
|
34
|
+
/** This rate's share of the document discount. */
|
|
35
|
+
readonly discount: Money;
|
|
36
|
+
}
|
|
37
|
+
/** How a quote is priced: tax-inclusive prices, a document discount, a deposit. */
|
|
38
|
+
interface QuotePricing {
|
|
39
|
+
/** Unit amounts include tax, so tax is counted out of them. */
|
|
40
|
+
readonly pricesIncludeTax: boolean;
|
|
41
|
+
/** A percentage off the whole quote, in basis points (1000 for 10%). */
|
|
42
|
+
readonly discountBps: number;
|
|
43
|
+
/** An amount off the whole quote, after `discountBps`. */
|
|
44
|
+
readonly discountAmount: Money;
|
|
45
|
+
/** The deposit asked on acceptance, in basis points of the total. */
|
|
46
|
+
readonly depositBps?: number;
|
|
47
|
+
/** `depositBps` of the total, in minor units of the quote's currency. */
|
|
48
|
+
readonly depositDue: Money;
|
|
49
|
+
}
|
|
17
50
|
/** A quote. `F` types the extra columns the `fields` schema describes. */
|
|
18
51
|
interface Quote<F extends object = Record<never, never>> {
|
|
19
52
|
readonly id: string;
|
|
@@ -21,9 +54,8 @@ interface Quote<F extends object = Record<never, never>> {
|
|
|
21
54
|
readonly number: bigint;
|
|
22
55
|
/** `Q-12`; every revision of a quote shares it. */
|
|
23
56
|
readonly identifier: string;
|
|
57
|
+
/** Counts up each time the quote is sent again after a change. */
|
|
24
58
|
readonly revision: number;
|
|
25
|
-
/** The revision this one replaces. */
|
|
26
|
-
readonly supersedesId?: string;
|
|
27
59
|
readonly title: string;
|
|
28
60
|
readonly company?: RecordRef;
|
|
29
61
|
readonly contact?: RecordRef;
|
|
@@ -41,7 +73,14 @@ interface Quote<F extends object = Record<never, never>> {
|
|
|
41
73
|
/** Who decided: the customer's name, or the member who recorded it. */
|
|
42
74
|
readonly decidedBy?: string;
|
|
43
75
|
readonly decisionNote?: string;
|
|
44
|
-
|
|
76
|
+
/** The signed-in user who decided, a member or a portal guest. */
|
|
77
|
+
readonly decidedUserId?: string;
|
|
78
|
+
/** The customer's IP address and user agent, when they answered. */
|
|
79
|
+
readonly decidedIp?: string;
|
|
80
|
+
readonly decidedUserAgent?: string;
|
|
81
|
+
readonly pricing: QuotePricing;
|
|
82
|
+
readonly lines: readonly QuoteLine[];
|
|
83
|
+
readonly taxLines: readonly QuoteTaxLine[];
|
|
45
84
|
readonly totals: Totals;
|
|
46
85
|
/** The app's extra columns (`options.extraColumns`), by column name. */
|
|
47
86
|
readonly fields: RowFields<F>;
|
|
@@ -58,12 +97,46 @@ interface QuoteInput<F extends object = Record<never, never>> {
|
|
|
58
97
|
readonly terms?: string | null;
|
|
59
98
|
readonly note?: string | null;
|
|
60
99
|
readonly origin?: RecordRef;
|
|
100
|
+
readonly pricesIncludeTax?: boolean;
|
|
101
|
+
readonly discountBps?: number;
|
|
102
|
+
/** In the quote's currency. */
|
|
103
|
+
readonly discountAmount?: Money;
|
|
104
|
+
readonly depositBps?: number | null;
|
|
61
105
|
/**
|
|
62
106
|
* Values for the app's extra columns (`options.extraColumns`); left out keeps
|
|
63
107
|
* the stored ones.
|
|
64
108
|
*/
|
|
65
109
|
readonly fields?: Partial<F> & Readonly<Record<string, unknown>>;
|
|
66
110
|
}
|
|
111
|
+
/** A published revision: the quote exactly as it was sent then. */
|
|
112
|
+
interface QuoteVersion<F extends object = Record<never, never>> {
|
|
113
|
+
readonly revision: number;
|
|
114
|
+
readonly publishedAt: Temporal.Instant;
|
|
115
|
+
readonly quote: Quote<F>;
|
|
116
|
+
}
|
|
117
|
+
/** A published revision, without its snapshot. */
|
|
118
|
+
interface QuoteVersionSummary {
|
|
119
|
+
readonly revision: number;
|
|
120
|
+
readonly total: Money;
|
|
121
|
+
readonly publishedAt: Temporal.Instant;
|
|
122
|
+
readonly publishedBy?: string;
|
|
123
|
+
}
|
|
124
|
+
/** The customer's answer. */
|
|
125
|
+
interface QuoteAnswer {
|
|
126
|
+
readonly name: string;
|
|
127
|
+
readonly note?: string;
|
|
128
|
+
/**
|
|
129
|
+
* On acceptance, the positions of the optional lines the customer takes; the
|
|
130
|
+
* others drop out of the totals. Left out keeps the current choice.
|
|
131
|
+
*/
|
|
132
|
+
readonly selected?: readonly number[];
|
|
133
|
+
}
|
|
134
|
+
/** What a customer's answer did. */
|
|
135
|
+
interface QuoteResponse {
|
|
136
|
+
readonly status: QuoteStatus;
|
|
137
|
+
readonly identifier: string;
|
|
138
|
+
readonly revision: number;
|
|
139
|
+
}
|
|
67
140
|
/** What the customer sees through the quote's link. */
|
|
68
141
|
interface PublicQuote {
|
|
69
142
|
readonly identifier: string;
|
|
@@ -73,17 +146,22 @@ interface PublicQuote {
|
|
|
73
146
|
readonly currency: string;
|
|
74
147
|
readonly validUntil?: Temporal.PlainDate;
|
|
75
148
|
readonly terms?: string;
|
|
76
|
-
readonly
|
|
77
|
-
readonly
|
|
78
|
-
readonly
|
|
79
|
-
readonly
|
|
80
|
-
readonly lines: readonly Line[];
|
|
149
|
+
readonly pricing: QuotePricing;
|
|
150
|
+
readonly totals: Totals;
|
|
151
|
+
readonly lines: readonly QuoteLine[];
|
|
152
|
+
readonly taxLines: readonly QuoteTaxLine[];
|
|
81
153
|
}
|
|
82
154
|
/**
|
|
83
155
|
* A quote line. With the catalog block installed, a line can name a product
|
|
84
156
|
* variant and take its price in the quote's currency and its title.
|
|
85
157
|
*/
|
|
86
|
-
type QuoteLineInput = LineInput | CatalogLineInput
|
|
158
|
+
type QuoteLineInput = (LineInput | CatalogLineInput) & {
|
|
159
|
+
readonly section?: string;
|
|
160
|
+
/** Left out of the totals unless `selected`. */
|
|
161
|
+
readonly optional?: boolean;
|
|
162
|
+
/** Defaults to `true` for a required line and `false` for an optional one. */
|
|
163
|
+
readonly selected?: boolean;
|
|
164
|
+
};
|
|
87
165
|
interface Quotes<F extends object = Record<never, never>> {
|
|
88
166
|
create(organizationId: string, input: QuoteInput<F> & {
|
|
89
167
|
readonly title: string;
|
|
@@ -100,20 +178,33 @@ interface Quotes<F extends object = Record<never, never>> {
|
|
|
100
178
|
decide(quoteId: string, decision: QuoteDecision, options?: {
|
|
101
179
|
readonly note?: string;
|
|
102
180
|
readonly by?: string;
|
|
181
|
+
readonly selected?: readonly number[];
|
|
103
182
|
}): AsyncResult<Quote<F>>;
|
|
104
|
-
/**
|
|
183
|
+
/**
|
|
184
|
+
* Back to draft for changes, as the next revision. The sent revision stays
|
|
185
|
+
* published in `versions`; an accepted quote can't be revised.
|
|
186
|
+
*/
|
|
105
187
|
revise(quoteId: string): AsyncResult<Quote<F>>;
|
|
188
|
+
/** The revisions sent so far, oldest first. */
|
|
189
|
+
versions(quoteId: string): AsyncResult<readonly QuoteVersionSummary[]>;
|
|
190
|
+
/** The quote as it was sent at `revision`. */
|
|
191
|
+
version(quoteId: string, revision: number): AsyncResult<QuoteVersion<F>>;
|
|
106
192
|
/** A draft quote from a deal, once per deal. Needs the deals module. */
|
|
107
193
|
fromDeal(dealId: string): AsyncResult<Quote<F>>;
|
|
108
194
|
/** The quote behind a link, for the customer's page. Marks it viewed. */
|
|
109
195
|
view(token: string): AsyncResult<PublicQuote>;
|
|
110
196
|
/** The customer's answer through the link. */
|
|
111
|
-
respond(token: string, decision: QuoteDecision, answer:
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
197
|
+
respond(token: string, decision: QuoteDecision, answer: QuoteAnswer): AsyncResult<QuoteResponse>;
|
|
198
|
+
/**
|
|
199
|
+
* A quote shared with the signed-in guest (portal), as the customer sees it.
|
|
200
|
+
* Marks it viewed.
|
|
201
|
+
*/
|
|
202
|
+
portalView(quoteId: string): AsyncResult<PublicQuote>;
|
|
203
|
+
/**
|
|
204
|
+
* The signed-in guest's answer, with no token. The name defaults to the
|
|
205
|
+
* guest's email.
|
|
206
|
+
*/
|
|
207
|
+
portalRespond(quoteId: string, decision: QuoteDecision, answer?: Partial<QuoteAnswer>): AsyncResult<QuoteResponse>;
|
|
117
208
|
/** Expires sent quotes past their date. Service role only. */
|
|
118
209
|
expire(): AsyncResult<number>;
|
|
119
210
|
}
|
|
@@ -131,8 +222,9 @@ interface QuotesOptions<S extends StandardSchemaV1 | undefined = undefined> exte
|
|
|
131
222
|
readonly mappers?: readonly ErrorMapper[];
|
|
132
223
|
}
|
|
133
224
|
/**
|
|
134
|
-
* The quotes block: quotes with lines,
|
|
135
|
-
*
|
|
225
|
+
* The quotes block: quotes with lines, sections and optional lines, document
|
|
226
|
+
* discounts and tax-inclusive prices, published versions, a public link and a
|
|
227
|
+
* portal the customer answers through, expiry, and quotes made from deals.
|
|
136
228
|
*/
|
|
137
229
|
export declare function createQuotes<S extends StandardSchemaV1 | undefined = undefined>(options: QuotesOptions<S>): Quotes<FieldsOf<S>>;
|
|
138
230
|
/** The events of the `quotes` block: type to data. */
|
|
@@ -159,4 +251,4 @@ export declare const quotesBlock: BlockOf<"quotes", typeof createQuotes, QuotesE
|
|
|
159
251
|
export declare const QUOTE_TO_ORDER: DefaultAutomation;
|
|
160
252
|
/** The automations the quotes block ships. */
|
|
161
253
|
export declare const QUOTES_AUTOMATIONS: readonly DefaultAutomation[];
|
|
162
|
-
export { type BlockHooks, type BlockTransport, type BlockTransportMiddleware, type CatalogLineInput, type Line, type LineInput, type PublicQuote, type Quote, type QuoteDecision, type QuoteInput, type QuoteLineInput, type QuoteStatus, type Quotes, type QuotesEvents, type QuotesOptions, type RecordRef, type RpcClient, type Totals, dbTransport, extendBlock, rpcTransport, sqlTransport, withBlockHooks, wrapTransport };
|
|
254
|
+
export { type BlockHooks, type BlockTransport, type BlockTransportMiddleware, type CatalogLineInput, type Line, type LineInput, type PublicQuote, type Quote, type QuoteAnswer, type QuoteDecision, type QuoteInput, type QuoteLine, type QuoteLineInput, type QuotePricing, type QuoteResponse, type QuoteStatus, type QuoteTaxLine, type QuoteVersion, type QuoteVersionSummary, type Quotes, type QuotesEvents, type QuotesOptions, type RecordRef, type RpcClient, type Totals, dbTransport, extendBlock, rpcTransport, sqlTransport, withBlockHooks, wrapTransport };
|
|
@@ -6,7 +6,7 @@ import { A as recordsOf, C as optionalInstant, L as textOf, O as recordOf, U as
|
|
|
6
6
|
import { i as wrapTransport, n as extendBlock, r as withBlockHooks } from "../../block-hooks-CadxQ9-_.js";
|
|
7
7
|
import { l as writeFields, n as blockFields, o as readFields } from "../../block-fields-Bjcv6_zc.js";
|
|
8
8
|
import { n as defineBlock } from "../../define-block-22Jv4U_-.js";
|
|
9
|
-
import { i as moneyOf, n as amountsError, s as unknownCurrency } from "../../money-codec-SKPm8FPw.js";
|
|
9
|
+
import { i as moneyOf, n as amountsError, s as unknownCurrency, t as amountText } from "../../money-codec-SKPm8FPw.js";
|
|
10
10
|
import { i as refOf, n as compact, r as plainDate, t as attrsArg } from "../../sales-shared-CY3s_wBx.js";
|
|
11
11
|
import { i as totalsOf, n as lineArg, r as lineOf, t as lineAmounts } from "../../sales-lines-axwWhnLk.js";
|
|
12
12
|
// src/blocks/quotes/quotes.ts
|
|
@@ -26,7 +26,6 @@ const KNOWN = /* @__PURE__ */ new Set([
|
|
|
26
26
|
"number",
|
|
27
27
|
"identifier",
|
|
28
28
|
"revision",
|
|
29
|
-
"supersedes_id",
|
|
30
29
|
"title",
|
|
31
30
|
"company_type",
|
|
32
31
|
"company_id",
|
|
@@ -45,6 +44,14 @@ const KNOWN = /* @__PURE__ */ new Set([
|
|
|
45
44
|
"decided_at",
|
|
46
45
|
"decided_by",
|
|
47
46
|
"decision_note",
|
|
47
|
+
"decided_user_id",
|
|
48
|
+
"decided_ip",
|
|
49
|
+
"decided_user_agent",
|
|
50
|
+
"prices_include_tax",
|
|
51
|
+
"discount_bps",
|
|
52
|
+
"discount_amount",
|
|
53
|
+
"deposit_bps",
|
|
54
|
+
"deposit_due",
|
|
48
55
|
"created_by",
|
|
49
56
|
"created_at",
|
|
50
57
|
"updated_at",
|
|
@@ -54,9 +61,64 @@ const KNOWN = /* @__PURE__ */ new Set([
|
|
|
54
61
|
"tax_total",
|
|
55
62
|
"total",
|
|
56
63
|
"lines",
|
|
64
|
+
"tax_lines",
|
|
65
|
+
"taxLines",
|
|
57
66
|
"token",
|
|
58
|
-
"fields"
|
|
67
|
+
"fields",
|
|
68
|
+
"publishedAt"
|
|
59
69
|
]);
|
|
70
|
+
function quoteLineOf(value, currency) {
|
|
71
|
+
const row = recordOf(value, "quote line");
|
|
72
|
+
const optional = row["optional"] === true;
|
|
73
|
+
return compact({
|
|
74
|
+
...lineOf(row, currency),
|
|
75
|
+
position: Number(row["position"] ?? 0),
|
|
76
|
+
section: optionalText(row["section"]),
|
|
77
|
+
optional,
|
|
78
|
+
selected: typeof row["selected"] === "boolean" ? row["selected"] : !optional
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
function taxLineOf(value, currency) {
|
|
82
|
+
const row = recordOf(value, "quote tax line");
|
|
83
|
+
const at = (key) => moneyOf(row[key] ?? "0", currency, `quote tax line ${key}`);
|
|
84
|
+
return compact({
|
|
85
|
+
taxRateBps: Number(row["taxRateBps"] ?? 0),
|
|
86
|
+
taxCode: optionalText(row["taxCode"]),
|
|
87
|
+
net: at("net"),
|
|
88
|
+
tax: at("tax"),
|
|
89
|
+
gross: at("gross"),
|
|
90
|
+
discount: at("discount")
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
/** Pricing from a row (snake keys) or a public quote (camel keys). */
|
|
94
|
+
function pricingOf(row, currency, camel) {
|
|
95
|
+
const key = (snake, camelKey) => camel ? row[camelKey] : row[snake];
|
|
96
|
+
const depositBps = key("deposit_bps", "depositBps");
|
|
97
|
+
return compact({
|
|
98
|
+
pricesIncludeTax: key("prices_include_tax", "pricesIncludeTax") === true,
|
|
99
|
+
discountBps: Number(key("discount_bps", "discountBps") ?? 0),
|
|
100
|
+
discountAmount: moneyOf(key("discount_amount", "discountAmount") ?? "0", currency, "quote discountAmount"),
|
|
101
|
+
depositBps: depositBps === null || depositBps === void 0 ? void 0 : Number(depositBps),
|
|
102
|
+
depositDue: moneyOf(key("deposit_due", "depositDue") ?? "0", currency, "quote depositDue")
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function responseOf(value) {
|
|
106
|
+
const row = recordOf(value, "quote response");
|
|
107
|
+
return {
|
|
108
|
+
status: enumOrThrow(row["status"], STATUSES, "quote status"),
|
|
109
|
+
identifier: textOf(row["identifier"]),
|
|
110
|
+
revision: Number(row["revision"] ?? 1)
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
function versionSummaryOf(value) {
|
|
114
|
+
const row = recordOf(value, "quote version");
|
|
115
|
+
return compact({
|
|
116
|
+
revision: Number(row["revision"]),
|
|
117
|
+
total: moneyOf(row["total"], row["currency"], "quote version total"),
|
|
118
|
+
publishedAt: requiredInstant(row["publishedAt"], "publishedAt"),
|
|
119
|
+
publishedBy: optionalText(row["publishedBy"])
|
|
120
|
+
});
|
|
121
|
+
}
|
|
60
122
|
function quoteOf(value) {
|
|
61
123
|
const row = recordOf(value, "quote");
|
|
62
124
|
const currency = textOf(row["currency"]);
|
|
@@ -66,7 +128,6 @@ function quoteOf(value) {
|
|
|
66
128
|
number: bigintOf(row["number"], "quote number"),
|
|
67
129
|
identifier: textOf(row["identifier"]),
|
|
68
130
|
revision: Number(row["revision"] ?? 1),
|
|
69
|
-
supersedesId: optionalText(row["supersedes_id"]),
|
|
70
131
|
title: textOf(row["title"]),
|
|
71
132
|
company: refOf(row["company_type"], row["company_id"]),
|
|
72
133
|
contact: refOf(row["contact_type"], row["contact_id"]),
|
|
@@ -82,7 +143,12 @@ function quoteOf(value) {
|
|
|
82
143
|
decidedAt: optionalInstant(row["decided_at"]),
|
|
83
144
|
decidedBy: optionalText(row["decided_by"]),
|
|
84
145
|
decisionNote: optionalText(row["decision_note"]),
|
|
85
|
-
|
|
146
|
+
decidedUserId: optionalText(row["decided_user_id"]),
|
|
147
|
+
decidedIp: optionalText(row["decided_ip"]),
|
|
148
|
+
decidedUserAgent: optionalText(row["decided_user_agent"]),
|
|
149
|
+
pricing: pricingOf(row, currency, false),
|
|
150
|
+
lines: recordsOf(row["lines"], "quote lines").map((line) => quoteLineOf(line, currency)),
|
|
151
|
+
taxLines: recordsOf(row["taxLines"] ?? [], "quote tax lines").map((line) => taxLineOf(line, currency)),
|
|
86
152
|
totals: totalsOf(row, false),
|
|
87
153
|
fields: isRecord(row["fields"]) ? row["fields"] : Object.fromEntries(Object.entries(row).filter(([key]) => !KNOWN.has(key))),
|
|
88
154
|
createdAt: requiredInstant(row["created_at"], "createdAt")
|
|
@@ -91,7 +157,6 @@ function quoteOf(value) {
|
|
|
91
157
|
function publicOf(value) {
|
|
92
158
|
const row = recordOf(value, "public_quote");
|
|
93
159
|
const currency = textOf(row["currency"]);
|
|
94
|
-
const at = (key) => moneyOf(row[key], currency, `public_quote ${key}`);
|
|
95
160
|
return compact({
|
|
96
161
|
identifier: textOf(row["identifier"]),
|
|
97
162
|
revision: Number(row["revision"] ?? 1),
|
|
@@ -100,16 +165,19 @@ function publicOf(value) {
|
|
|
100
165
|
currency,
|
|
101
166
|
validUntil: plainDate(row["validUntil"]),
|
|
102
167
|
terms: optionalText(row["terms"]),
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
168
|
+
pricing: pricingOf(row, currency, true),
|
|
169
|
+
totals: totalsOf({
|
|
170
|
+
...row,
|
|
171
|
+
listTotal: row["listTotal"] ?? row["subtotal"]
|
|
172
|
+
}, true),
|
|
173
|
+
lines: recordsOf(row["lines"], "quote lines").map((line) => quoteLineOf(line, currency)),
|
|
174
|
+
taxLines: recordsOf(row["taxLines"] ?? [], "quote tax lines").map((line) => taxLineOf(line, currency))
|
|
108
175
|
});
|
|
109
176
|
}
|
|
110
177
|
/**
|
|
111
|
-
* The quotes block: quotes with lines,
|
|
112
|
-
*
|
|
178
|
+
* The quotes block: quotes with lines, sections and optional lines, document
|
|
179
|
+
* discounts and tax-inclusive prices, published versions, a public link and a
|
|
180
|
+
* portal the customer answers through, expiry, and quotes made from deals.
|
|
113
181
|
*/
|
|
114
182
|
function createQuotes(options) {
|
|
115
183
|
applyTemporal(options);
|
|
@@ -117,9 +185,10 @@ function createQuotes(options) {
|
|
|
117
185
|
const fields = blockFields(options.fields, "quote fields");
|
|
118
186
|
const quote = (fn, args, then) => call(fn, args, then).andThen((row) => readFields(fields, row));
|
|
119
187
|
const attrsOf = (input, checked) => {
|
|
120
|
-
const { fields: _fields, ...rest } = input;
|
|
188
|
+
const { fields: _fields, discountAmount, ...rest } = input;
|
|
121
189
|
return {
|
|
122
190
|
...attrsArg(rest),
|
|
191
|
+
...discountAmount === void 0 ? {} : { discountAmount: amountText(discountAmount) },
|
|
123
192
|
...checked === void 0 ? {} : { fields: checked }
|
|
124
193
|
};
|
|
125
194
|
};
|
|
@@ -161,17 +230,42 @@ function createQuotes(options) {
|
|
|
161
230
|
quote: quoteId,
|
|
162
231
|
decision,
|
|
163
232
|
note: decide.note ?? null,
|
|
164
|
-
by: decide.by ?? null
|
|
233
|
+
by: decide.by ?? null,
|
|
234
|
+
selected: decide.selected ?? null
|
|
165
235
|
}, quoteOf),
|
|
166
236
|
revise: (quoteId) => quote("revise_quote", { quote: quoteId }, quoteOf),
|
|
237
|
+
versions: (quoteId) => call("quote_versions", { quote: quoteId }, (value) => recordsOf(value, "quote versions").map(versionSummaryOf)),
|
|
238
|
+
version: (quoteId, revision) => call("quote_version", {
|
|
239
|
+
quote: quoteId,
|
|
240
|
+
revision
|
|
241
|
+
}, (value) => {
|
|
242
|
+
const row = recordOf(value, "quote version");
|
|
243
|
+
return {
|
|
244
|
+
revision: Number(row["revision"]),
|
|
245
|
+
publishedAt: requiredInstant(row["publishedAt"], "publishedAt"),
|
|
246
|
+
quote: quoteOf(row)
|
|
247
|
+
};
|
|
248
|
+
}).andThen((version) => readFields(fields, version.quote).map((parsed) => ({
|
|
249
|
+
...version,
|
|
250
|
+
quote: parsed
|
|
251
|
+
}))),
|
|
167
252
|
fromDeal: (dealId) => quote("quote_from_deal", { deal: dealId }, quoteOf),
|
|
168
253
|
view: (token) => call("public_quote", { token }, publicOf),
|
|
169
254
|
respond: (token, decision, answer) => call("respond_to_quote", {
|
|
170
255
|
token,
|
|
171
256
|
decision,
|
|
172
257
|
name: answer.name,
|
|
173
|
-
note: answer.note ?? null
|
|
174
|
-
|
|
258
|
+
note: answer.note ?? null,
|
|
259
|
+
selected: answer.selected ?? null
|
|
260
|
+
}, responseOf),
|
|
261
|
+
portalView: (quoteId) => call("portal_quote", { quote: quoteId }, publicOf),
|
|
262
|
+
portalRespond: (quoteId, decision, answer = {}) => call("respond_to_portal_quote", {
|
|
263
|
+
quote: quoteId,
|
|
264
|
+
decision,
|
|
265
|
+
name: answer.name ?? null,
|
|
266
|
+
note: answer.note ?? null,
|
|
267
|
+
selected: answer.selected ?? null
|
|
268
|
+
}, responseOf),
|
|
175
269
|
expire: () => call("expire_quotes", {}, (value) => Number(value ?? 0))
|
|
176
270
|
}, options.hooks, {
|
|
177
271
|
block: "quotes",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as AsyncResult } from "../../result-DTOQRyGY.js";
|
|
2
2
|
import { n as Logger } from "../../logger-0LfhvwE4.js";
|
|
3
|
-
import { n as BlockOptions } from "../../block-helpers-
|
|
4
|
-
import { n as BlockHooks } from "../../block-hooks-
|
|
5
|
-
import { _ as JobHandler } from "../../types-
|
|
6
|
-
import { c as BlockOf } from "../../define-block-
|
|
3
|
+
import { n as BlockOptions } from "../../block-helpers-BNtM1tqy.js";
|
|
4
|
+
import { n as BlockHooks } from "../../block-hooks-CtMsgLQr.js";
|
|
5
|
+
import { _ as JobHandler } from "../../types-BdhE7I8Z.js";
|
|
6
|
+
import { c as BlockOf } from "../../define-block-Ds3aLZwz.js";
|
|
7
7
|
import { n as rankBetweenResult, t as RankNeighbors } from "../../rank-result-B_xLQCBV.js";
|
|
8
8
|
/** The queue `move()` enqueues on when a key grows past 24 digits. */
|
|
9
9
|
export declare const RANK_REBALANCE_QUEUE = "rank.rebalance";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
2
|
import { T as ErrorMapper, b as DbError, t as AsyncResult } from "../../result-DTOQRyGY.js";
|
|
3
|
-
import {
|
|
4
|
-
import { A as CollaborationEventData, Ct as Events } from "../../events-
|
|
3
|
+
import { et as RecordRef } from "../../types-BzIYSSWK.js";
|
|
4
|
+
import { A as CollaborationEventData, Ct as Events } from "../../events-DCw3c6pj.js";
|
|
5
5
|
import { n as Logger } from "../../logger-0LfhvwE4.js";
|
|
6
|
-
import { a as BlockTenantOptions, r as BlockTemporalOptions } from "../../block-helpers-
|
|
7
|
-
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-
|
|
8
|
-
import { n as BlockHooks } from "../../block-hooks-
|
|
9
|
-
import { c as BlockOf } from "../../define-block-
|
|
10
|
-
import { p as SubscriptionStatus } from "../../topic-
|
|
11
|
-
import { n as TopicPort } from "../../watch-topic-
|
|
12
|
-
import { n as Controller, t as AuthPort } from "../../controller-
|
|
6
|
+
import { a as BlockTenantOptions, r as BlockTemporalOptions } from "../../block-helpers-BNtM1tqy.js";
|
|
7
|
+
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-CDmOUuLZ.js";
|
|
8
|
+
import { n as BlockHooks } from "../../block-hooks-CtMsgLQr.js";
|
|
9
|
+
import { c as BlockOf } from "../../define-block-Ds3aLZwz.js";
|
|
10
|
+
import { p as SubscriptionStatus } from "../../topic-x-mrN_Ff.js";
|
|
11
|
+
import { n as TopicPort } from "../../watch-topic-D6bcqOrJ.js";
|
|
12
|
+
import { n as Controller, t as AuthPort } from "../../controller-CAcLEndc.js";
|
|
13
13
|
interface ReactionsOptions extends BlockTemporalOptions, BlockTenantOptions {
|
|
14
14
|
readonly transport: BlockTransport;
|
|
15
15
|
/**
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import { T as ErrorMapper, t as AsyncResult } from "../../result-DTOQRyGY.js";
|
|
3
3
|
import { t as StandardSchemaV1 } from "../../standard-DRX6Ch1j.js";
|
|
4
4
|
import { i as RowFields, r as FieldsOf } from "../../block-fields-Puv5m5D3.js";
|
|
5
|
-
import {
|
|
6
|
-
import { Ct as Events, et as SaasSubjectEventData } from "../../events-
|
|
5
|
+
import { et as RecordRef } from "../../types-BzIYSSWK.js";
|
|
6
|
+
import { Ct as Events, et as SaasSubjectEventData } from "../../events-DCw3c6pj.js";
|
|
7
7
|
import { n as Logger } from "../../logger-0LfhvwE4.js";
|
|
8
|
-
import { a as BlockTenantOptions } from "../../block-helpers-
|
|
9
|
-
import { t as BlockTransport } from "../../block-transport-
|
|
10
|
-
import { n as BlockHooks } from "../../block-hooks-
|
|
11
|
-
import { Sn as EntitySchema, c as BlockOf, ln as RecordBindingWrite, rn as RecordBinding } from "../../define-block-
|
|
12
|
-
import { a as UndoToken } from "../../undo-
|
|
8
|
+
import { a as BlockTenantOptions } from "../../block-helpers-BNtM1tqy.js";
|
|
9
|
+
import { t as BlockTransport } from "../../block-transport-CDmOUuLZ.js";
|
|
10
|
+
import { n as BlockHooks } from "../../block-hooks-CtMsgLQr.js";
|
|
11
|
+
import { Sn as EntitySchema, c as BlockOf, ln as RecordBindingWrite, rn as RecordBinding } from "../../define-block-Ds3aLZwz.js";
|
|
12
|
+
import { a as UndoToken } from "../../undo-CdKp5_2X.js";
|
|
13
13
|
interface LinkInput<F extends object = Record<never, never>> {
|
|
14
14
|
/**
|
|
15
15
|
* A kind, or its inverse name (`blocked_by` stores `blocks` from the other
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import { T as ErrorMapper, t as AsyncResult } from "../../result-DTOQRyGY.js";
|
|
3
3
|
import { t as StandardSchemaV1 } from "../../standard-DRX6Ch1j.js";
|
|
4
4
|
import { i as RowFields, r as FieldsOf } from "../../block-fields-Puv5m5D3.js";
|
|
5
|
-
import {
|
|
6
|
-
import { Ct as Events, et as SaasSubjectEventData } from "../../events-
|
|
5
|
+
import { et as RecordRef } from "../../types-BzIYSSWK.js";
|
|
6
|
+
import { Ct as Events, et as SaasSubjectEventData } from "../../events-DCw3c6pj.js";
|
|
7
7
|
import { n as Logger } from "../../logger-0LfhvwE4.js";
|
|
8
|
-
import { a as BlockTenantOptions } from "../../block-helpers-
|
|
9
|
-
import { t as BlockTransport } from "../../block-transport-
|
|
10
|
-
import { n as BlockHooks } from "../../block-hooks-
|
|
11
|
-
import { _ as JobHandler } from "../../types-
|
|
12
|
-
import { I as Notifier, c as BlockOf } from "../../define-block-
|
|
13
|
-
import { g as SubscriberPolicy, i as AuthorizationHooks } from "../../authorization-hooks-
|
|
8
|
+
import { a as BlockTenantOptions } from "../../block-helpers-BNtM1tqy.js";
|
|
9
|
+
import { t as BlockTransport } from "../../block-transport-CDmOUuLZ.js";
|
|
10
|
+
import { n as BlockHooks } from "../../block-hooks-CtMsgLQr.js";
|
|
11
|
+
import { _ as JobHandler, c as EnqueueOnceOptions, l as EnqueueOnceResult } from "../../types-BdhE7I8Z.js";
|
|
12
|
+
import { I as Notifier, c as BlockOf } from "../../define-block-Ds3aLZwz.js";
|
|
13
|
+
import { g as SubscriberPolicy, i as AuthorizationHooks } from "../../authorization-hooks-C0GfMvFm.js";
|
|
14
14
|
interface ExpandInput {
|
|
15
15
|
readonly dtstart: Temporal.ZonedDateTime;
|
|
16
16
|
/** An `RRULE` value, with or without the `RRULE:` prefix. */
|
|
@@ -92,6 +92,48 @@ export declare function deliverReminder(payload: DeliveryPayload, effects: {
|
|
|
92
92
|
}): Promise<void>;
|
|
93
93
|
/** The queue `reminders.job` handles. */
|
|
94
94
|
export declare const REMINDER_DELIVERY_QUEUE = "reminders.deliver";
|
|
95
|
+
/** The payload `schedule` enqueues on `reminders.deliver`. */
|
|
96
|
+
interface ReminderJobPayload {
|
|
97
|
+
readonly reminderId: string;
|
|
98
|
+
/** ISO text. */
|
|
99
|
+
readonly occurrenceAt: string;
|
|
100
|
+
readonly organizationId: string;
|
|
101
|
+
readonly userId?: string;
|
|
102
|
+
readonly subject?: RecordRef;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* The jobs queue `schedule` enqueues on: the `queue` block's client, typed by
|
|
106
|
+
* shape so this block doesn't need it.
|
|
107
|
+
*/
|
|
108
|
+
interface ReminderJobs {
|
|
109
|
+
enqueueOnce(queue: typeof REMINDER_DELIVERY_QUEUE, payload: ReminderJobPayload, options: EnqueueOnceOptions): AsyncResult<EnqueueOnceResult>;
|
|
110
|
+
}
|
|
111
|
+
/** What `schedule` plans and when. */
|
|
112
|
+
interface ReminderScheduleOptions {
|
|
113
|
+
/** Default: now. */
|
|
114
|
+
readonly now?: Temporal.Instant;
|
|
115
|
+
/** How far ahead to enqueue deliveries, in minutes. Default 1440 (a day). */
|
|
116
|
+
readonly horizonMinutes?: number;
|
|
117
|
+
/**
|
|
118
|
+
* How far back a missed delivery still goes out, in minutes. Default 15, so a
|
|
119
|
+
* schedule run that comes late still sends what fell due since.
|
|
120
|
+
*/
|
|
121
|
+
readonly lookbackMinutes?: number;
|
|
122
|
+
}
|
|
123
|
+
/** What one `schedule` run did. */
|
|
124
|
+
interface ReminderScheduleResult {
|
|
125
|
+
/** Deliveries due in the window. */
|
|
126
|
+
readonly planned: number;
|
|
127
|
+
/** New jobs on `reminders.deliver`. */
|
|
128
|
+
readonly enqueued: number;
|
|
129
|
+
/** Deliveries that already had a job. */
|
|
130
|
+
readonly duplicates: number;
|
|
131
|
+
/**
|
|
132
|
+
* Schedule rows that couldn't be expanded: a rule kept in columns
|
|
133
|
+
* (`ruleFormat: "columns"`), or an unknown time zone.
|
|
134
|
+
*/
|
|
135
|
+
readonly skipped: number;
|
|
136
|
+
}
|
|
95
137
|
interface RemindersOptions<S extends StandardSchemaV1 | undefined = undefined> extends BlockTenantOptions {
|
|
96
138
|
readonly transport: BlockTransport;
|
|
97
139
|
readonly schema?: string;
|
|
@@ -125,6 +167,11 @@ interface RemindersOptions<S extends StandardSchemaV1 | undefined = undefined> e
|
|
|
125
167
|
* parsed.
|
|
126
168
|
*/
|
|
127
169
|
readonly fields?: S;
|
|
170
|
+
/**
|
|
171
|
+
* The jobs queue `schedule` enqueues deliveries on, such as the client
|
|
172
|
+
* `createQueue` returns.
|
|
173
|
+
*/
|
|
174
|
+
readonly jobs?: ReminderJobs;
|
|
128
175
|
/** `withBlockHooks` hooks around the client's methods. */
|
|
129
176
|
readonly hooks?: NoInfer<BlockHooks<Reminders<FieldsOf<S>>>>;
|
|
130
177
|
/** Receives the errors `after` hooks throw. Default: `console`. */
|
|
@@ -142,14 +189,26 @@ interface ReminderEntry {
|
|
|
142
189
|
readonly method: string;
|
|
143
190
|
/** Minutes before the occurrence; negative fires after it. */
|
|
144
191
|
readonly offsetMinutes: number;
|
|
192
|
+
/** A one-time reminder's own time, in place of the subject's schedule. */
|
|
193
|
+
readonly remindAt?: Temporal.Instant;
|
|
145
194
|
}
|
|
195
|
+
/**
|
|
196
|
+
* When a reminder fires: minutes before each occurrence of the subject's rule
|
|
197
|
+
* (or its `on.<type>.at` column), or once at `at`.
|
|
198
|
+
*/
|
|
199
|
+
type ReminderWhen = number | {
|
|
200
|
+
readonly at: Temporal.Instant;
|
|
201
|
+
};
|
|
146
202
|
/**
|
|
147
203
|
* `F` is the extra fields `options.fields` describes. `upsert` and `list` act
|
|
148
204
|
* in the block's `tenant`.
|
|
149
205
|
*/
|
|
150
206
|
interface Reminders<F extends object = Record<never, never>> {
|
|
151
|
-
/**
|
|
152
|
-
|
|
207
|
+
/**
|
|
208
|
+
* Sets a reminder on `subject`: `offsetMinutes` before each occurrence, or
|
|
209
|
+
* once at `{ at }`. `fields` fills the app's extra columns.
|
|
210
|
+
*/
|
|
211
|
+
upsert(subject: RecordRef, when?: ReminderWhen, fields?: Partial<F> & Readonly<Record<string, unknown>>): AsyncResult<SavedReminder<F>>;
|
|
153
212
|
/**
|
|
154
213
|
* The caller's reminders on `subject`, the earliest before the occurrence
|
|
155
214
|
* first.
|
|
@@ -169,7 +228,15 @@ interface Reminders<F extends object = Record<never, never>> {
|
|
|
169
228
|
deliver(delivery: DeliveryPayload): AsyncResult<boolean>;
|
|
170
229
|
/** The handler for the `reminders.deliver` queue. */
|
|
171
230
|
readonly job: JobHandler<unknown>;
|
|
231
|
+
/**
|
|
232
|
+
* Service role. Reads every reminder's schedule and enqueues one
|
|
233
|
+
* `reminders.deliver` job per occurrence due in the window on `jobs`, once
|
|
234
|
+
* per reminder and occurrence.
|
|
235
|
+
*/
|
|
236
|
+
schedule(options?: ReminderScheduleOptions): AsyncResult<ReminderScheduleResult>;
|
|
172
237
|
}
|
|
238
|
+
/** The `reminders.deliver` payload, for the queue's `queues` map. */
|
|
239
|
+
export declare const reminderJobSchema: StandardSchemaV1<ReminderJobPayload>;
|
|
173
240
|
export declare function createReminders<S extends StandardSchemaV1 | undefined = undefined>(options: RemindersOptions<S>): Reminders<FieldsOf<S>>;
|
|
174
241
|
/** The events of the `reminders` block: type to data. */
|
|
175
242
|
type RemindersEvents = {
|
|
@@ -181,4 +248,4 @@ export declare const remindersEvents: Events<RemindersEvents>;
|
|
|
181
248
|
export declare const remindersBlock: BlockOf<"reminders", typeof createReminders, RemindersEvents, {
|
|
182
249
|
readonly notifier: "optional";
|
|
183
250
|
}>;
|
|
184
|
-
export type { DeliveryPayload, ExpandInput, PlannedDelivery, ReminderEntry, ReminderPlanInput, Reminders, RemindersEvents, RemindersOptions, SavedReminder };
|
|
251
|
+
export type { DeliveryPayload, ExpandInput, PlannedDelivery, ReminderEntry, ReminderJobPayload, ReminderJobs, ReminderPlanInput, ReminderScheduleOptions, ReminderScheduleResult, ReminderWhen, Reminders, RemindersEvents, RemindersOptions, SavedReminder };
|