better-supabase 0.35.0 → 0.37.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-ChJkI2jo.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-CbY2qdzT.d.ts} +5 -5
- package/dist/{api-keys-DbIbkGxx.d.ts → api-keys-BncNDlWG.d.ts} +4 -4
- package/dist/{app-tables-X3yzJljM.d.ts → app-tables-BlhdqqHf.d.ts} +1 -1
- package/dist/{approvals-DZoGtNFv.d.ts → approvals-CXW3yFWZ.d.ts} +101 -7
- package/dist/{approvals-Da4uAANx.js → approvals-D8gR1R8R.js} +95 -11
- 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-C7yjZttV.d.ts} +155 -54
- package/dist/{authorization-hooks-CxwsRnfV.d.ts → authorization-hooks-CR8TVvqo.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-BspFMDdW.d.ts} +7 -7
- package/dist/{block-env-h_uPl2f_.d.ts → block-env-CLco8YUl.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-DfomofFv.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 +58 -17
- package/dist/blocks/catalog/index.js +65 -16
- 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 +175 -14
- package/dist/blocks/inventory/index.js +206 -13
- 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 +84 -17
- package/dist/blocks/orders/index.js +63 -4
- 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 +6 -6
- package/dist/blocks/promotions/index.js +1 -1
- 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 +77 -8
- package/dist/blocks/shipments/index.js +58 -5
- 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 +34 -7
- package/dist/blocks/state-machine/index.js +9 -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 +125 -12
- package/dist/blocks/templates/index.js +157 -7
- package/dist/blocks/time-tracking/index.d.ts +7 -7
- package/dist/blocks/timeline/index.d.ts +13 -11
- package/dist/blocks/timeline/index.js +3 -1
- 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/{carrier-D2b_028L.d.ts → carrier-B2eytEjR.d.ts} +10 -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-8zKWiO0X.js +1 -0
- package/dist/cli/{add-DzgsOE8V.js → add-Buuy7BSU.js} +2 -2
- package/dist/cli/{add-CYreXA68.js → add-DqfJVb1F.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-Ku-4tPUu.js} +2 -2
- package/dist/cli/app-tables-Dg0sh4dH.js +42 -0
- package/dist/cli/{backfill-BLLTSDSa.js → backfill-Dspz6kVJ.js} +3 -3
- package/dist/cli/bin.js +1 -1
- package/dist/cli/{blocks-CpRvI7x8.js → blocks-B8LAph-w.js} +1 -1
- package/dist/cli/{blocks-uzh1g_0v.js → blocks-CqVBlc4L.js} +2 -2
- package/dist/cli/{cache-BPWC7tGD.js → cache-BbuuCIRU.js} +1 -1
- package/dist/cli/{codemod-CbJVS_kG.js → codemod-DIAy8uXt.js} +139 -4
- package/dist/cli/{command-BpZ4AuhR.js → command-67WobzTC.js} +12 -0
- package/dist/cli/{completion-CwL7e93t.js → completion-C3nMZgUZ.js} +2 -2
- package/dist/cli/{completion-DHTT6rjI.js → completion-DSrus7H1.js} +1 -1
- package/dist/cli/{completion-B08Q0xB3.js → completion-Dm0S3ub0.js} +2 -2
- package/dist/cli/{config-D-Upz3jV.js → config-cbK-wiNs.js} +1 -1
- package/dist/cli/{content-mapper-Cjkm2Sg3.js → content-mapper-NXfJ5VkP.js} +2 -2
- package/dist/cli/{db-Diy1OebO.js → db-bK5eCLaE.js} +2 -2
- package/dist/cli/{doctor-D94FEJZs.js → doctor-CUOyLE0c.js} +386 -49
- package/dist/cli/env-AFfMXxWw.js +1 -0
- package/dist/cli/{env-BAJn6wCA.js → env-CCT-dMFm.js} +1 -1
- package/dist/cli/{gen-Cd0VNDjE.js → gen-s9canfdC.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-Zs0Ca5on.js} +9 -9
- package/dist/cli/{keys-CxajkV_7.js → keys-Dj5sJNj7.js} +1 -1
- package/dist/cli/{live-NFNeZsP7.js → live-BaLsNove.js} +2 -2
- package/dist/cli/{mcp-WZ8t7NMz.js → mcp-ST7bVpJD.js} +4 -4
- package/dist/cli/{metadata-BzMkmrZR.js → metadata-aOvlCOOg.js} +3 -3
- package/dist/cli/{migrate-C9gyDAV7.js → migrate-ClBx3Ggx.js} +2 -2
- package/dist/cli/{migration-safety-BNi8PIiM.js → migration-safety-mjm1pghO.js} +1 -1
- package/dist/cli/{migrations-Ds0J_TmZ.js → migrations-tzItvwxT.js} +2 -2
- package/dist/cli/{module-migration-hFrlzQZ5.js → module-migration-D0Rjdvdx.js} +2 -2
- package/dist/cli/{moved-BAFPdJz_.js → moved-CY0yDtAr.js} +1 -1
- package/dist/cli/{parse-BueItuNJ.js → parse-yAC-NFMq.js} +1 -1
- package/dist/cli/{powersync-oFiwgsBi.js → powersync-DryX_DMG.js} +4 -4
- package/dist/cli/powersync-vvu2-72V.js +1 -0
- package/dist/cli/{print-BtreoJSm.js → print-fOUnKwA9.js} +2 -2
- package/dist/cli/{providers-Be2dgyuR.js → providers-BR1d_5jA.js} +1 -1
- package/dist/cli/{prune-workflows-BPxgRrqY.js → prune-workflows-CCjzNrxl.js} +3 -3
- package/dist/cli/{remove-B4ad996E.js → remove-B_0OIusa.js} +6 -6
- package/dist/cli/{render-C-Mfq-o3.js → render-BCJKDX3c.js} +18 -4
- package/dist/cli/{run-D2nuyyPo.js → run-4VUQTR-R.js} +12 -48
- package/dist/cli/{run-cLdnJHH0.js → run-BctvQX_g.js} +45 -43
- package/dist/cli/{run-dY9uOC3W.js → run-DX4X7xqV.js} +2 -2
- package/dist/cli/seed-CLlvrV8I.js +1 -0
- package/dist/cli/{seed-BpaqqyO8.js → seed-DSC6f0oh.js} +2 -2
- package/dist/cli/{shared-DCHxLAEL.js → shared-oY7PGamd.js} +1 -1
- package/dist/cli/{skills-jZThjL3B.js → skills-B5p6bDwe.js} +1 -1
- package/dist/cli/{snapshot-CloKPNxv.js → snapshot-CWtER9-4.js} +2 -2
- package/dist/cli/{source-Bwyp18Rj.js → source-D4uav_v9.js} +1 -1
- package/dist/cli/{spec-DsVq4_qV.js → spec-BPsyEzqH.js} +1 -1
- package/dist/cli/{spec-DAUF4ybu.js → spec-DTnBeaCD.js} +3 -3
- package/dist/cli/{sql-layout-CHpEL0oq.js → sql-layout-DbhEQqq0.js} +2 -2
- package/dist/cli/{stack-147NqctC.js → stack-CQXLe5j0.js} +3 -2
- package/dist/cli/{sync-DZu1r34s.js → sync-CazH5FX4.js} +4 -4
- package/dist/cli/{table-D9FbJS8h.js → table-BIQA9Hdt.js} +1 -1
- package/dist/cli/{upgrade-Bpvi70zm.js → upgrade-Cyx6ESpc.js} +5 -5
- package/dist/cli/{upgrade-A-BALvp3.js → upgrade-Dyb4-f0Q.js} +3 -3
- package/dist/cli/{version-B59mZJoy.js → version-D1ZKUFng.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-BjgxkfJJ.d.ts} +1 -1
- package/dist/{codecs-B9v5Y5HH.js → codecs-D_pOvjvD.js} +1 -0
- package/dist/{codecs-B1VO2BGL.d.ts → codecs-DaP45ETv.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-D2JnIiHt.js → composite-BidYZWZY.js} +3 -3
- package/dist/{composite-CIxjVcL1.d.ts → composite-DPN4SFud.d.ts} +7 -7
- package/dist/config/index.d.ts +3 -3
- package/dist/config/index.js +4 -4
- package/dist/{config-DQP0IvDX.js → config-Dx3bEPlX.js} +1 -1
- package/dist/{config-BZWSFxkG.js → config-uSliwPS6.js} +3 -3
- package/dist/{connectors-Cf2LeAuZ.d.ts → connectors-DDsdz-cn.d.ts} +4 -4
- package/dist/{context-CderJRZf.d.ts → context-D6OZQdcT.d.ts} +3 -3
- package/dist/contract/index.d.ts +9 -9
- package/dist/{controller-DaWA9eWS.d.ts → controller-DhcSXkAC.d.ts} +1 -1
- package/dist/{conversion-C9rndpEI.d.ts → conversion-CLBBITW5.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-C_He1bQO.d.ts} +5 -5
- package/dist/{define-B6D55cO0.js → define-Duh2mMYk.js} +1 -1
- package/dist/{define-block-COmMkx2x.d.ts → define-block-CDw9YGVh.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-BwpmNC5k.d.ts} +8 -3
- package/dist/{entitlements-BefkpQIz.d.ts → entitlements-Bi4y8w8e.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-DddDlibJ.d.ts} +9 -1
- package/dist/{executor-CHnoKOxk.d.ts → executor-CxMHiDp_.d.ts} +4 -4
- package/dist/{executor-CFmee_nV.d.ts → executor-DoSNec_H.d.ts} +1 -1
- package/dist/{executor-BDMqPbVU.js → executor-RYiR4z47.js} +71 -37
- package/dist/{executor-DqNRrFxx.d.ts → executor-uNDJBzT8.d.ts} +16 -2
- 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-CJ_i6HFg.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-B6JAPr1i.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-ChLuLxy-.d.ts → index-Bc5t2QRU.d.ts} +14 -14
- package/dist/{index-BbDiBiKt.d.ts → index-Bm1ftdBA.d.ts} +4 -4
- package/dist/{index-C13UgV67.d.ts → index-C71uHfVj.d.ts} +5 -5
- package/dist/{index-BQlLxOj5.d.ts → index-CRwpDGxd.d.ts} +1 -1
- package/dist/{index-DXUiRyEk.d.ts → index-Cbwvf4yE.d.ts} +5 -5
- package/dist/{index-D9aV0Fvx.d.ts → index-ChvuVimY.d.ts} +6 -6
- package/dist/{index-M1izbwbN.d.ts → index-CvLTqmdq.d.ts} +1 -1
- package/dist/{index-BIAtapnD.d.ts → index-DAS_5OfK.d.ts} +5 -5
- package/dist/{index-D18su_r5.d.ts → index-DjJUamhw.d.ts} +10 -5
- package/dist/{index-ZQZMQF4l.d.ts → index-DrDCN45q.d.ts} +6 -6
- package/dist/{index-8w4OB5En.d.ts → index-F6lsRlsr.d.ts} +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.js +1 -1
- package/dist/{instances-D9YrkoAy.js → instances-DKULdpWB.js} +291 -17
- 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-lHFpu2_1.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-BkbLV-Yc.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-BDjgCmT9.d.ts} +1 -1
- package/dist/{options-D4dxMGHF.js → options-Bgnm4pTD.js} +1 -0
- package/dist/{options-C9bp3SEA.js → options-CEwoGUk_.js} +3 -1
- package/dist/{options-yRwYr4up.js → options-CGQC7Wue.js} +4 -1
- package/dist/{options-C13-dVMH.js → options-D-jiqb0l.js} +2 -0
- 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-DikdzUKf.d.ts} +4 -4
- package/dist/{permissions-C8p6RlIZ.d.ts → permissions-BGx22GP3.d.ts} +1 -1
- package/dist/{pool-D-4HyhuW.d.ts → pool-BJAjQcrJ.d.ts} +3 -3
- package/dist/{ports-CmEXVqhg.js → ports-CkygVOeE.js} +2 -2
- package/dist/{ports-C-8uduFM.d.ts → ports-D63bA3p4.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-oc_liUHz.js} +2 -2
- package/dist/{project-DVlXQGEp.js → project-Cs0kz5OP.js} +5 -5
- package/dist/{provider-BI0KC4u5.d.ts → provider-CVlXXbda.d.ts} +1 -1
- package/dist/{push-token-D41lOoE8.d.ts → push-token-BsyX0KlT.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-C-gIxGXe.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-CjUUBfhY.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-FW8oeXvh.js → resolve-CZV31iCm.js} +402 -392
- package/dist/{resolve--LfVoOMg.d.ts → resolve-XlMQRUeG.d.ts} +97 -36
- package/dist/{resolved-names-h-3UbKcw.js → resolved-names-sd6RuTju.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-B7-QaS6R.d.ts} +2 -2
- package/dist/{resource-types-RgaljPs0.d.ts → resource-types-CF3Uc6OW.d.ts} +4 -4
- package/dist/{resources-DYSx9NYM.js → resources-DhiK3yLO.js} +1 -1
- package/dist/{resources-Bki1J4jy.d.ts → resources-DnHSmJIM.d.ts} +2 -2
- package/dist/{respond-DLH4tD2d.js → respond-8A3EOo61.js} +1 -1
- package/dist/{respond-BYOV7KZp.d.ts → respond-D7kUatjc.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-DpI82uNq.d.ts} +19 -17
- package/dist/session-BjPYE4dT.js +180 -0
- package/dist/session-JV1z0kxa.d.ts +77 -0
- package/dist/{session-B4VasaAA.d.ts → session-s-mUZ8RQ.d.ts} +11 -12
- package/dist/{session-status-D8CBxCqv.d.ts → session-status-CJjTuFtA.d.ts} +4 -3
- package/dist/{sign-in-CX1a5i2P.d.ts → sign-in-D5Bg7R47.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-CWYbu_6y.js} +11090 -2788
- 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/{statuses-BTrQ5H4S.js → statuses-Qqpzda35.js} +12 -1
- package/dist/stock-detail-BMqvwq1q.js +12 -0
- package/dist/stock-detail-BRIt7CjU.d.ts +19 -0
- 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-D1Km_Q42.d.ts} +2 -2
- package/dist/{subjects-Bv2dPflD.d.ts → subjects-CVjAE7nz.d.ts} +3 -3
- package/dist/{support-DxYI6sDM.d.ts → support-Dj5V2WTs.d.ts} +4 -4
- package/dist/{support-view-DSmCett7.d.ts → support-view-DKZkZeM5.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-BihwKkTT.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-DqnE50Ju.d.ts} +1 -1
- package/dist/testing/index.d.ts +28 -29
- package/dist/testing/index.js +6 -6
- package/dist/{timeline-Bq658xsi.d.ts → timeline-c6I3uxya.d.ts} +5 -5
- package/dist/{topic-BVq5RdsI.d.ts → topic-Dp7VGPd-.d.ts} +5 -5
- package/dist/{types-C8UyJOPJ.d.ts → types-6PMaLIyw.d.ts} +3 -3
- package/dist/{types-BBqP9H6w.d.ts → types-BXLiM6VM.d.ts} +4 -4
- 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-TH3zlMiM.d.ts → types-D5uf0l4_.d.ts} +1 -1
- package/dist/{types-hTj5OuFo.d.ts → types-DLXTmZtm.d.ts} +2 -2
- package/dist/{types-d0JBRTAg.d.ts → types-DtiDatvu.d.ts} +128 -13
- 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-CbhvnoVC.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-Cpc1upDA.d.ts} +2 -2
- package/dist/{view-BfEqjZJ_.js → view-Ch0Qtr36.js} +1 -1
- package/dist/{view-Cy2XxYp1.d.ts → view-eHgOOyRS.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-CtJAkWT4.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-yIkECybp.d.ts → workflow-sdk-CUt0E4v6.d.ts} +3 -3
- package/dist/{workflow-sdk-BL3wzkdp.js → workflow-sdk-pB1jCLIL.js} +26 -1
- 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 +131 -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
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
2
|
import { T as ErrorMapper, t as AsyncResult } from "../../result-DTOQRyGY.js";
|
|
3
|
-
import {
|
|
4
|
-
import { Ct as Events } from "../../events-
|
|
3
|
+
import { et as RecordRef } from "../../types-BzIYSSWK.js";
|
|
4
|
+
import { Ct as Events } from "../../events-DddDlibJ.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, i as RpcClient, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-
|
|
8
|
-
import { a as BlockTransportMiddleware, d as extendBlock, f as withBlockHooks, n as BlockHooks, p as wrapTransport } from "../../block-hooks-
|
|
6
|
+
import { a as BlockTenantOptions, r as BlockTemporalOptions } from "../../block-helpers-BNtM1tqy.js";
|
|
7
|
+
import { a as dbTransport, i as RpcClient, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-CDmOUuLZ.js";
|
|
8
|
+
import { a as BlockTransportMiddleware, d as extendBlock, f as withBlockHooks, n as BlockHooks, p as wrapTransport } from "../../block-hooks-CtMsgLQr.js";
|
|
9
9
|
import { t as EnrollmentsSqlOptions } from "../../options-Dk6D88Zx.js";
|
|
10
|
-
import { c as BlockOf, rn as RecordBinding } from "../../define-block-
|
|
10
|
+
import { c as BlockOf, rn as RecordBinding } from "../../define-block-CDw9YGVh.js";
|
|
11
11
|
interface EnrollmentsOptions extends BlockTemporalOptions, BlockTenantOptions {
|
|
12
12
|
readonly transport: BlockTransport;
|
|
13
13
|
/**
|
|
@@ -24,12 +24,29 @@ interface EnrollmentsOptions extends BlockTemporalOptions, BlockTenantOptions {
|
|
|
24
24
|
declare const STATUSES: readonly ["active", "completed", "cancelled"];
|
|
25
25
|
/** Where an enrollment stands. A cancelled one keeps its completed steps. */
|
|
26
26
|
type EnrollmentStatus = (typeof STATUSES)[number];
|
|
27
|
+
/** Who a step is for: members with a role, or one user. */
|
|
28
|
+
type EnrollmentAssignee = {
|
|
29
|
+
readonly role: string;
|
|
30
|
+
} | {
|
|
31
|
+
readonly userId: string;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* When a step is due: whole days (from -3650 to 3650) after the enrollment's
|
|
35
|
+
* start or end. The start falls back to when it enrolled; a step due from the
|
|
36
|
+
* end has no due date until the enrollment has one.
|
|
37
|
+
*/
|
|
38
|
+
interface EnrollmentDue {
|
|
39
|
+
readonly days: number;
|
|
40
|
+
readonly from: "start" | "end";
|
|
41
|
+
}
|
|
27
42
|
/** A step of a program. */
|
|
28
43
|
interface EnrollmentStep {
|
|
29
44
|
/** Lowercase letters, digits, `_`, `.` or `-`, starting with a letter. */
|
|
30
45
|
readonly id: string;
|
|
31
46
|
readonly title?: string;
|
|
32
47
|
readonly description?: string;
|
|
48
|
+
readonly assignee?: EnrollmentAssignee;
|
|
49
|
+
readonly due?: EnrollmentDue;
|
|
33
50
|
}
|
|
34
51
|
/** A program of steps that subjects enroll in. */
|
|
35
52
|
interface EnrollmentProgram {
|
|
@@ -70,6 +87,41 @@ interface EnrollmentProgress {
|
|
|
70
87
|
readonly completedAt: Temporal.Instant;
|
|
71
88
|
readonly completedBy?: string;
|
|
72
89
|
}
|
|
90
|
+
/** A step of an enrollment with an assignee or a due date. */
|
|
91
|
+
interface EnrollmentScheduledStep {
|
|
92
|
+
readonly step: string;
|
|
93
|
+
readonly assignee?: EnrollmentAssignee;
|
|
94
|
+
/** Rendered from the step's `due` and the enrollment's dates. */
|
|
95
|
+
readonly dueAt?: Temporal.Instant;
|
|
96
|
+
/** Set once the step is done. */
|
|
97
|
+
readonly completedAt?: Temporal.Instant;
|
|
98
|
+
}
|
|
99
|
+
/** An open step with an assignee or a due date, from `openSteps`. */
|
|
100
|
+
interface EnrollmentOpenStep {
|
|
101
|
+
readonly enrollmentId: string;
|
|
102
|
+
readonly organizationId: string;
|
|
103
|
+
readonly program: string;
|
|
104
|
+
readonly subject: RecordRef;
|
|
105
|
+
readonly step: string;
|
|
106
|
+
readonly title?: string;
|
|
107
|
+
readonly assignee?: EnrollmentAssignee;
|
|
108
|
+
readonly dueAt?: Temporal.Instant;
|
|
109
|
+
}
|
|
110
|
+
/** The dates an enrollment's due dates count from; `null` clears one. */
|
|
111
|
+
interface EnrollmentDates {
|
|
112
|
+
readonly startsAt?: Temporal.Instant | null;
|
|
113
|
+
readonly endsAt?: Temporal.Instant | null;
|
|
114
|
+
}
|
|
115
|
+
interface EnrollmentOpenStepsFilter {
|
|
116
|
+
/** Steps assigned to this role. */
|
|
117
|
+
readonly role?: string;
|
|
118
|
+
/** Steps assigned to this user. */
|
|
119
|
+
readonly userId?: string;
|
|
120
|
+
/** Steps due before this instant. */
|
|
121
|
+
readonly dueBefore?: Temporal.Instant;
|
|
122
|
+
/** Default 50, at most 200. */
|
|
123
|
+
readonly pageSize?: number;
|
|
124
|
+
}
|
|
73
125
|
/** A subject's enrollment in a program, with its completed steps. */
|
|
74
126
|
interface Enrollment {
|
|
75
127
|
readonly id: string;
|
|
@@ -86,8 +138,13 @@ interface Enrollment {
|
|
|
86
138
|
readonly totalSteps: number;
|
|
87
139
|
/** Oldest first. */
|
|
88
140
|
readonly progress: readonly EnrollmentProgress[];
|
|
141
|
+
/** The steps with an assignee or a due date, in step order. */
|
|
142
|
+
readonly schedule: readonly EnrollmentScheduledStep[];
|
|
89
143
|
readonly enrolledBy?: string;
|
|
90
144
|
readonly enrolledAt: Temporal.Instant;
|
|
145
|
+
/** When it starts; due dates from the start fall back to `enrolledAt`. */
|
|
146
|
+
readonly startsAt?: Temporal.Instant;
|
|
147
|
+
readonly endsAt?: Temporal.Instant;
|
|
91
148
|
readonly completedAt?: Temporal.Instant;
|
|
92
149
|
readonly cancelledAt?: Temporal.Instant;
|
|
93
150
|
readonly updatedAt: Temporal.Instant;
|
|
@@ -110,9 +167,17 @@ interface Enrollments {
|
|
|
110
167
|
deleteProgram(programId: string): AsyncResult<boolean>;
|
|
111
168
|
/**
|
|
112
169
|
* Enrolls a subject. An enrolled subject keeps its enrollment, and a
|
|
113
|
-
* cancelled one starts again with its completed steps.
|
|
170
|
+
* cancelled one starts again with its completed steps. With `dates`, it sets
|
|
171
|
+
* them as `setDates` does.
|
|
172
|
+
*/
|
|
173
|
+
enroll(program: string, subject: RecordRef, dates?: EnrollmentDates): AsyncResult<Enrollment>;
|
|
174
|
+
/** Sets the dates its due dates count from and renders them again. */
|
|
175
|
+
setDates(enrollmentId: string, dates: EnrollmentDates): AsyncResult<Enrollment>;
|
|
176
|
+
/**
|
|
177
|
+
* Open steps of active enrollments that have an assignee or a due date,
|
|
178
|
+
* soonest due first. Without `enrollments.read`, the caller's own.
|
|
114
179
|
*/
|
|
115
|
-
|
|
180
|
+
openSteps(filter?: EnrollmentOpenStepsFilter): AsyncResult<readonly EnrollmentOpenStep[]>;
|
|
116
181
|
/** A subject's enrollment in a program, or `null`. */
|
|
117
182
|
enrollment(program: string, subject: RecordRef): AsyncResult<Enrollment | null>;
|
|
118
183
|
/**
|
|
@@ -171,4 +236,4 @@ export declare const enrollmentsEvents: Events<EnrollmentsEvents>;
|
|
|
171
236
|
export declare const enrollmentsBinding: RecordBinding<Enrollments, readonly Enrollment[]>;
|
|
172
237
|
/** The `enrollments` block's manifest (ADR 0029). */
|
|
173
238
|
export declare const enrollmentsBlock: BlockOf<"enrollments", typeof createEnrollments, EnrollmentsEvents, Record<never, never>, never, typeof enrollmentsBinding>;
|
|
174
|
-
export { type BlockHooks, type BlockTransport, type BlockTransportMiddleware, type Enrollment, type EnrollmentEventData, type EnrollmentProgram, type EnrollmentProgramEventData, type EnrollmentProgramInput, type EnrollmentProgress, type EnrollmentStatus, type EnrollmentStep, type Enrollments, type EnrollmentsEvents, type EnrollmentsFilter, type EnrollmentsOptions, type EnrollmentsSqlOptions, type RpcClient, dbTransport, extendBlock, rpcTransport, sqlTransport, withBlockHooks, wrapTransport };
|
|
239
|
+
export { type BlockHooks, type BlockTransport, type BlockTransportMiddleware, type Enrollment, type EnrollmentAssignee, type EnrollmentDates, type EnrollmentDue, type EnrollmentEventData, type EnrollmentOpenStep, type EnrollmentOpenStepsFilter, type EnrollmentProgram, type EnrollmentProgramEventData, type EnrollmentProgramInput, type EnrollmentProgress, type EnrollmentScheduledStep, type EnrollmentStatus, type EnrollmentStep, type Enrollments, type EnrollmentsEvents, type EnrollmentsFilter, type EnrollmentsOptions, type EnrollmentsSqlOptions, type RpcClient, dbTransport, extendBlock, rpcTransport, sqlTransport, withBlockHooks, wrapTransport };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { n as isRecord } from "../../guards-CsRa6v57.js";
|
|
2
|
+
import { t as AsyncResult } from "../../result-8xza7w5W.js";
|
|
2
3
|
import { t as enrollmentsSqlOptions } from "../../options-eIEk0vqV.js";
|
|
3
4
|
import { n as event, t as defineEvents } from "../../event-map-DxfsFgQT.js";
|
|
4
5
|
import { A as recordsOf, C as optionalInstant, L as textOf, O as recordOf, U as rpcTransport, V as dbTransport, W as sqlTransport, d as enumOrThrow, j as requiredInstant, m as instantArg, n as applyTemporal, o as blockCall, w as optionalText } from "../../block-helpers-I7UzjNEf.js";
|
|
@@ -19,12 +20,60 @@ function optional(key, value) {
|
|
|
19
20
|
return out;
|
|
20
21
|
}
|
|
21
22
|
const texts = (value) => Array.isArray(value) ? value.map((item) => textOf(item)) : [];
|
|
23
|
+
const FROM = ["start", "end"];
|
|
24
|
+
function assigneeOf(value) {
|
|
25
|
+
if (!isRecord(value)) return;
|
|
26
|
+
const role = optionalText(value["role"]);
|
|
27
|
+
if (role !== void 0) return { role };
|
|
28
|
+
const userId = optionalText(value["userId"]);
|
|
29
|
+
return userId === void 0 ? void 0 : { userId };
|
|
30
|
+
}
|
|
31
|
+
function dueOf(value) {
|
|
32
|
+
if (!isRecord(value)) return;
|
|
33
|
+
return {
|
|
34
|
+
days: Number(value["days"] ?? 0),
|
|
35
|
+
from: enumOrThrow(value["from"], FROM, "due date anchor")
|
|
36
|
+
};
|
|
37
|
+
}
|
|
22
38
|
function stepOf(value, fn) {
|
|
23
39
|
const row = recordOf(value, fn);
|
|
24
40
|
return {
|
|
25
41
|
id: textOf(row["id"]),
|
|
26
42
|
...optional("title", optionalText(row["title"])),
|
|
27
|
-
...optional("description", optionalText(row["description"]))
|
|
43
|
+
...optional("description", optionalText(row["description"])),
|
|
44
|
+
...optional("assignee", assigneeOf(row["assignee"])),
|
|
45
|
+
...optional("due", dueOf(row["due"]))
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function scheduledOf(value, fn) {
|
|
49
|
+
const row = recordOf(value, fn);
|
|
50
|
+
return {
|
|
51
|
+
step: textOf(row["step"]),
|
|
52
|
+
...optional("assignee", assigneeOf(row["assignee"])),
|
|
53
|
+
...optional("dueAt", optionalInstant(row["dueAt"])),
|
|
54
|
+
...optional("completedAt", optionalInstant(row["completedAt"]))
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function openStepOf(value, fn) {
|
|
58
|
+
const row = recordOf(value, fn);
|
|
59
|
+
return {
|
|
60
|
+
enrollmentId: textOf(row["id"]),
|
|
61
|
+
organizationId: textOf(row["organizationId"]),
|
|
62
|
+
program: textOf(row["program"]),
|
|
63
|
+
subject: {
|
|
64
|
+
type: textOf(row["subjectType"]),
|
|
65
|
+
id: textOf(row["subjectId"])
|
|
66
|
+
},
|
|
67
|
+
step: textOf(row["step"]),
|
|
68
|
+
...optional("title", optionalText(row["title"])),
|
|
69
|
+
...optional("assignee", assigneeOf(row["assignee"])),
|
|
70
|
+
...optional("dueAt", optionalInstant(row["dueAt"]))
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function datesArg(dates) {
|
|
74
|
+
return {
|
|
75
|
+
...optional("startsAt", instantArg(dates.startsAt)),
|
|
76
|
+
...optional("endsAt", instantArg(dates.endsAt))
|
|
28
77
|
};
|
|
29
78
|
}
|
|
30
79
|
function programOf(value, fn) {
|
|
@@ -67,7 +116,10 @@ function enrollmentOf(value, fn) {
|
|
|
67
116
|
completedSteps: Number(row["completedSteps"] ?? 0),
|
|
68
117
|
totalSteps: Number(row["totalSteps"] ?? 0),
|
|
69
118
|
progress: recordsOf(row["progress"] ?? [], fn).map((item) => progressOf(item, fn)),
|
|
119
|
+
schedule: recordsOf(row["schedule"] ?? [], fn).map((item) => scheduledOf(item, fn)),
|
|
70
120
|
enrolledAt: requiredInstant(row["enrolledAt"], "enrolledAt"),
|
|
121
|
+
...optional("startsAt", optionalInstant(row["startsAt"])),
|
|
122
|
+
...optional("endsAt", optionalInstant(row["endsAt"])),
|
|
71
123
|
updatedAt: requiredInstant(row["updatedAt"], "updatedAt"),
|
|
72
124
|
...optional("organizationId", optionalText(row["organizationId"])),
|
|
73
125
|
...optional("programVersion", typeof version === "number" ? version : void 0),
|
|
@@ -87,6 +139,10 @@ function createEnrollments(options) {
|
|
|
87
139
|
const call = blockCall(options.transport, options.schema, options.mappers);
|
|
88
140
|
const tenant = () => requireTenant(options.tenant);
|
|
89
141
|
const one = (fn) => (value) => enrollmentOf(value, fn);
|
|
142
|
+
const setDates = (enrollmentId, dates) => call("set_enrollment_dates", {
|
|
143
|
+
enrollment_id: enrollmentId,
|
|
144
|
+
dates: datesArg(dates)
|
|
145
|
+
}, one("set_enrollment_dates"));
|
|
90
146
|
return withBlockHooks({
|
|
91
147
|
saveProgram: (program) => tenant().andThen((organizationId) => call("save_enrollment_program", {
|
|
92
148
|
tenant: organizationId,
|
|
@@ -94,12 +150,20 @@ function createEnrollments(options) {
|
|
|
94
150
|
}, (value) => programOf(value, "save_enrollment_program"))),
|
|
95
151
|
programs: () => tenant().andThen((organizationId) => call("enrollment_programs", { tenant: organizationId }, (value) => recordsOf(value, "enrollment_programs").map((row) => programOf(row, "enrollment_programs")))),
|
|
96
152
|
deleteProgram: (programId) => call("delete_enrollment_program", { program_id: programId }, (value) => value === true),
|
|
97
|
-
enroll: (program, subject) => tenant().andThen((organizationId) => call("enroll", {
|
|
153
|
+
enroll: (program, subject, dates) => tenant().andThen((organizationId) => call("enroll", {
|
|
98
154
|
tenant: organizationId,
|
|
99
155
|
program,
|
|
100
156
|
subject_type: subject.type,
|
|
101
157
|
subject_id: subject.id
|
|
102
|
-
}, one("enroll"))),
|
|
158
|
+
}, one("enroll"))).andThen((enrollment) => dates === void 0 ? AsyncResult.ok(enrollment) : setDates(enrollment.id, dates)),
|
|
159
|
+
setDates: (enrollmentId, dates) => setDates(enrollmentId, dates),
|
|
160
|
+
openSteps: (filter = {}) => tenant().andThen((organizationId) => call("open_enrollment_steps", {
|
|
161
|
+
tenant: organizationId,
|
|
162
|
+
assignee_role: filter.role ?? null,
|
|
163
|
+
assignee_user: filter.userId ?? null,
|
|
164
|
+
due_before: instantArg(filter.dueBefore) ?? null,
|
|
165
|
+
page_size: filter.pageSize ?? null
|
|
166
|
+
}, (value) => recordsOf(value, "open_enrollment_steps").map((row) => openStepOf(row, "open_enrollment_steps")))),
|
|
103
167
|
enrollment: (program, subject) => tenant().andThen((organizationId) => call("enrollment", {
|
|
104
168
|
tenant: organizationId,
|
|
105
169
|
program,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { T as ErrorMapper, t as AsyncResult } from "../../result-DTOQRyGY.js";
|
|
2
2
|
import { n as Logger } from "../../logger-0LfhvwE4.js";
|
|
3
|
-
import { n as SqlClient } from "../../executor-
|
|
4
|
-
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-
|
|
5
|
-
import { n as BlockHooks } from "../../block-hooks-
|
|
6
|
-
import { c as BlockOf } from "../../define-block-
|
|
7
|
-
import { a as hasEntitlement, n as EntitlementKey, t as EntitlementClaimOptions } from "../../entitlements-
|
|
8
|
-
import { n as Controller, t as AuthPort } from "../../controller-
|
|
3
|
+
import { n as SqlClient } from "../../executor-DoSNec_H.js";
|
|
4
|
+
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-CDmOUuLZ.js";
|
|
5
|
+
import { n as BlockHooks } from "../../block-hooks-CtMsgLQr.js";
|
|
6
|
+
import { c as BlockOf } from "../../define-block-CDw9YGVh.js";
|
|
7
|
+
import { a as hasEntitlement, n as EntitlementKey, t as EntitlementClaimOptions } from "../../entitlements-Bi4y8w8e.js";
|
|
8
|
+
import { n as Controller, t as AuthPort } from "../../controller-DhcSXkAC.js";
|
|
9
9
|
/** The Stripe event sent when a customer's active entitlements change. */
|
|
10
10
|
export declare const ENTITLEMENTS_UPDATED = "entitlements.active_entitlement_summary.updated";
|
|
11
11
|
/**
|
|
@@ -2,12 +2,12 @@
|
|
|
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 { n as ExtraFields, r as FieldsOf } from "../../block-fields-Puv5m5D3.js";
|
|
5
|
-
import { Ct as Events } from "../../events-
|
|
5
|
+
import { Ct as Events } from "../../events-DddDlibJ.js";
|
|
6
6
|
import { n as Logger } from "../../logger-0LfhvwE4.js";
|
|
7
|
-
import { a as BlockTenantOptions, r as BlockTemporalOptions } 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 { Sn as EntitySchema, c as BlockOf } from "../../define-block-
|
|
7
|
+
import { a as BlockTenantOptions, r as BlockTemporalOptions } 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 { Sn as EntitySchema, c as BlockOf } from "../../define-block-CDw9YGVh.js";
|
|
11
11
|
import { n as Money } from "../../money-BgpAd7d3.js";
|
|
12
12
|
type ExpenseReportStatus = "draft" | "submitted" | "approved" | "rejected" | "reimbursed" | "cancelled";
|
|
13
13
|
interface ExpensesOptions<S extends StandardSchemaV1 | undefined = undefined> extends BlockTemporalOptions, BlockTenantOptions {
|
|
@@ -132,6 +132,59 @@ interface ExpenseReportListOptions {
|
|
|
132
132
|
readonly everyone?: boolean;
|
|
133
133
|
readonly pageSize?: number;
|
|
134
134
|
}
|
|
135
|
+
type ExpenseStatus = "draft" | "submitted" | "approved" | "rejected" | "reimbursed";
|
|
136
|
+
interface Expense<F extends object = Record<never, never>> {
|
|
137
|
+
readonly id: string;
|
|
138
|
+
readonly organizationId: string;
|
|
139
|
+
readonly userId?: string;
|
|
140
|
+
readonly employeeId?: string;
|
|
141
|
+
readonly categoryId?: string;
|
|
142
|
+
readonly spentOn: Temporal.PlainDate;
|
|
143
|
+
readonly description?: string;
|
|
144
|
+
readonly merchant?: string;
|
|
145
|
+
readonly amount: Money;
|
|
146
|
+
readonly status: ExpenseStatus;
|
|
147
|
+
readonly submittedAt?: Temporal.Instant;
|
|
148
|
+
readonly decidedBy?: string;
|
|
149
|
+
readonly decidedAt?: Temporal.Instant;
|
|
150
|
+
readonly decisionNote?: string;
|
|
151
|
+
readonly reimbursedAt?: Temporal.Instant;
|
|
152
|
+
readonly reimbursement?: string;
|
|
153
|
+
readonly createdAt: Temporal.Instant;
|
|
154
|
+
readonly updatedAt: Temporal.Instant;
|
|
155
|
+
readonly fields: ExtraFields<F>;
|
|
156
|
+
}
|
|
157
|
+
interface ExpenseInput<F extends object = Record<never, never>> {
|
|
158
|
+
readonly spentOn: Temporal.PlainDate;
|
|
159
|
+
readonly amount: Money;
|
|
160
|
+
readonly categoryId?: string;
|
|
161
|
+
readonly description?: string;
|
|
162
|
+
readonly merchant?: string;
|
|
163
|
+
readonly userId?: string;
|
|
164
|
+
readonly employeeId?: string;
|
|
165
|
+
/**
|
|
166
|
+
* An expense of the organization itself, without a member or employee. Needs
|
|
167
|
+
* `options.companyExpenses` and `expenses.manage`.
|
|
168
|
+
*/
|
|
169
|
+
readonly company?: boolean;
|
|
170
|
+
readonly fields?: Partial<F>;
|
|
171
|
+
}
|
|
172
|
+
/** What it leaves out keeps its value; `null` clears the column. */
|
|
173
|
+
interface ExpenseUpdate<F extends object = Record<never, never>> {
|
|
174
|
+
readonly spentOn?: Temporal.PlainDate;
|
|
175
|
+
readonly amount?: Money;
|
|
176
|
+
readonly categoryId?: string | null;
|
|
177
|
+
readonly description?: string | null;
|
|
178
|
+
readonly merchant?: string | null;
|
|
179
|
+
readonly fields?: Partial<F>;
|
|
180
|
+
}
|
|
181
|
+
interface ExpenseListOptions {
|
|
182
|
+
readonly status?: ExpenseStatus;
|
|
183
|
+
readonly userId?: string;
|
|
184
|
+
readonly employeeId?: string;
|
|
185
|
+
readonly everyone?: boolean;
|
|
186
|
+
readonly pageSize?: number;
|
|
187
|
+
}
|
|
135
188
|
interface ReimbursementInput {
|
|
136
189
|
readonly paidAt?: Temporal.Instant;
|
|
137
190
|
readonly reference?: string;
|
|
@@ -172,6 +225,22 @@ interface Expenses<F extends object = Record<never, never>> {
|
|
|
172
225
|
}): AsyncResult<ExpenseReport<F>>;
|
|
173
226
|
get(reportId: string): AsyncResult<ExpenseReport<F>>;
|
|
174
227
|
list(options?: ExpenseReportListOptions): AsyncResult<readonly ExpenseReport<F>[]>;
|
|
228
|
+
createExpense(input: ExpenseInput<F>): AsyncResult<Expense<F>>;
|
|
229
|
+
updateExpense(expenseId: string, update: ExpenseUpdate<F>): AsyncResult<Expense<F>>;
|
|
230
|
+
submitExpense(expenseId: string): AsyncResult<Expense<F>>;
|
|
231
|
+
/** Moves a submitted expense back to draft. */
|
|
232
|
+
withdrawExpense(expenseId: string): AsyncResult<Expense<F>>;
|
|
233
|
+
/** Deletes a draft expense. */
|
|
234
|
+
deleteExpense(expenseId: string): AsyncResult<boolean>;
|
|
235
|
+
decideExpense(expenseId: string, decision: {
|
|
236
|
+
readonly approved: boolean;
|
|
237
|
+
readonly note?: string;
|
|
238
|
+
}): AsyncResult<Expense<F>>;
|
|
239
|
+
reimburseExpense(expenseId: string, input?: {
|
|
240
|
+
readonly reference?: string;
|
|
241
|
+
}): AsyncResult<Expense<F>>;
|
|
242
|
+
getExpense(expenseId: string): AsyncResult<Expense<F>>;
|
|
243
|
+
listExpenses(options?: ExpenseListOptions): AsyncResult<readonly Expense<F>[]>;
|
|
175
244
|
}
|
|
176
245
|
/** The `expenses` SQL module as typed calls. */
|
|
177
246
|
export declare function createExpenses<S extends StandardSchemaV1 | undefined = undefined>(options: ExpensesOptions<S>): Expenses<FieldsOf<S>>;
|
|
@@ -195,6 +264,15 @@ interface ExpenseReportSubmittedEventData extends ExpenseReportEventData {
|
|
|
195
264
|
interface ExpenseReportPostedEventData extends ExpenseReportEventData {
|
|
196
265
|
readonly transactionId: string;
|
|
197
266
|
}
|
|
267
|
+
interface ExpenseEventData {
|
|
268
|
+
readonly organizationId: string;
|
|
269
|
+
readonly id: string;
|
|
270
|
+
readonly userId: string | null;
|
|
271
|
+
readonly employeeId?: string | null;
|
|
272
|
+
readonly status: "draft" | "submitted" | "approved" | "rejected" | "reimbursed";
|
|
273
|
+
readonly amount: string;
|
|
274
|
+
readonly currency: string;
|
|
275
|
+
}
|
|
198
276
|
/** The events of the `expenses` block: type to data. */
|
|
199
277
|
type ExpensesEvents = {
|
|
200
278
|
readonly "expense_report.created": ExpenseReportEventData;
|
|
@@ -203,6 +281,15 @@ type ExpensesEvents = {
|
|
|
203
281
|
readonly "expense_report.reimbursed": ExpenseReportPostedEventData;
|
|
204
282
|
readonly "expense_report.cancelled": ExpenseReportEventData;
|
|
205
283
|
readonly "expense_report.rejected": ExpenseReportEventData;
|
|
284
|
+
readonly "expense.created": ExpenseEventData;
|
|
285
|
+
readonly "expense.submitted": ExpenseEventData;
|
|
286
|
+
readonly "expense.approved": ExpenseEventData;
|
|
287
|
+
readonly "expense.rejected": ExpenseEventData;
|
|
288
|
+
readonly "expense.reimbursed": ExpenseEventData;
|
|
289
|
+
/** A submitted expense went back to draft. */
|
|
290
|
+
readonly "expense.withdrawn": ExpenseEventData;
|
|
291
|
+
/** A draft expense was deleted. */
|
|
292
|
+
readonly "expense.deleted": ExpenseEventData;
|
|
206
293
|
};
|
|
207
294
|
/** The `expenses` block's event types, for its manifest and `onBlockEvent`. */
|
|
208
295
|
export declare const expensesEvents: Events<ExpensesEvents>;
|
|
@@ -214,4 +301,4 @@ export declare const expenseReportInputSchema: EntitySchema<ExpenseReportInput>;
|
|
|
214
301
|
export declare const expenseLineInputSchema: EntitySchema<ExpenseLineInput>;
|
|
215
302
|
/** What `saveCategory` takes. */
|
|
216
303
|
export declare const expenseCategoryInputSchema: EntitySchema<ExpenseCategoryInput>;
|
|
217
|
-
export { type BlockHooks, type BlockTransport, type BlockTransportMiddleware, type ExpenseCategory, type ExpenseCategoryInput, type ExpenseLine, type ExpenseLineInput, type ExpenseLineUpdate, type ExpensePolicyViolation, type ExpenseReport, type ExpenseReportEventData, type ExpenseReportInput, type ExpenseReportListOptions, type ExpenseReportPostedEventData, type ExpenseReportStatus, type ExpenseReportSubmittedEventData, type Expenses, type ExpensesEvents, type ExpensesOptions, type ReimbursementInput, type RpcClient, dbTransport, extendBlock, rpcTransport, sqlTransport, withBlockHooks, wrapTransport };
|
|
304
|
+
export { type BlockHooks, type BlockTransport, type BlockTransportMiddleware, type Expense, type ExpenseCategory, type ExpenseCategoryInput, type ExpenseEventData, type ExpenseInput, type ExpenseLine, type ExpenseLineInput, type ExpenseLineUpdate, type ExpenseListOptions, type ExpensePolicyViolation, type ExpenseReport, type ExpenseReportEventData, type ExpenseReportInput, type ExpenseReportListOptions, type ExpenseReportPostedEventData, type ExpenseReportStatus, type ExpenseReportSubmittedEventData, type ExpenseStatus, type ExpenseUpdate, type Expenses, type ExpensesEvents, type ExpensesOptions, type ReimbursementInput, type RpcClient, dbTransport, extendBlock, rpcTransport, sqlTransport, withBlockHooks, wrapTransport };
|
|
@@ -2,9 +2,9 @@ import { n as dbError } from "../../errors-B7tCfCvX.js";
|
|
|
2
2
|
import { n as isRecord } from "../../guards-CsRa6v57.js";
|
|
3
3
|
import { t as temporal } from "../../temporal-required-w_2u4EDp.js";
|
|
4
4
|
import { t as AsyncResult } from "../../result-8xza7w5W.js";
|
|
5
|
-
import { t as expensesSqlOptions } from "../../options-
|
|
5
|
+
import { t as expensesSqlOptions } from "../../options-RYbyaVhv.js";
|
|
6
6
|
import { n as event, t as defineEvents } from "../../event-map-DxfsFgQT.js";
|
|
7
|
-
import { A as recordsOf, L as textOf, O as recordOf, U as rpcTransport, V as dbTransport, W as sqlTransport, j as requiredInstant, m as instantArg, n as applyTemporal, o as blockCall, w as optionalText } from "../../block-helpers-I7UzjNEf.js";
|
|
7
|
+
import { A as recordsOf, L as textOf, O as recordOf, U as rpcTransport, V as dbTransport, W as sqlTransport, d as enumOrThrow, j as requiredInstant, m as instantArg, n as applyTemporal, o as blockCall, w as optionalText } from "../../block-helpers-I7UzjNEf.js";
|
|
8
8
|
import { i as wrapTransport, n as extendBlock, r as withBlockHooks } from "../../block-hooks-CadxQ9-_.js";
|
|
9
9
|
import { n as entitySchema, r as moneyField } from "../../entity-schema-DEIz0I8i.js";
|
|
10
10
|
import { n as blockFields } from "../../block-fields-Bjcv6_zc.js";
|
|
@@ -74,6 +74,37 @@ function reportOf(value, fn) {
|
|
|
74
74
|
...optional("cancelledAt", optionalInstant(row["cancelledAt"], "cancelledAt"))
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
+
const EXPENSE_STATUSES = [
|
|
78
|
+
"draft",
|
|
79
|
+
"submitted",
|
|
80
|
+
"approved",
|
|
81
|
+
"rejected",
|
|
82
|
+
"reimbursed"
|
|
83
|
+
];
|
|
84
|
+
function expenseOf(value, fn) {
|
|
85
|
+
const row = recordOf(value, fn);
|
|
86
|
+
return {
|
|
87
|
+
id: textOf(row["id"]),
|
|
88
|
+
organizationId: textOf(row["organizationId"]),
|
|
89
|
+
spentOn: temporal().PlainDate.from(textOf(row["spentOn"])),
|
|
90
|
+
amount: moneyOf(row["amount"], row["currency"], "amount"),
|
|
91
|
+
status: enumOrThrow(row["status"], EXPENSE_STATUSES, "expense status"),
|
|
92
|
+
fields: isRecord(row["fields"]) ? row["fields"] : {},
|
|
93
|
+
createdAt: requiredInstant(row["createdAt"], "createdAt"),
|
|
94
|
+
updatedAt: requiredInstant(row["updatedAt"], "updatedAt"),
|
|
95
|
+
...optional("userId", optionalText(row["userId"])),
|
|
96
|
+
...optional("employeeId", optionalText(row["employeeId"])),
|
|
97
|
+
...optional("categoryId", optionalText(row["categoryId"])),
|
|
98
|
+
...optional("description", optionalText(row["description"])),
|
|
99
|
+
...optional("merchant", optionalText(row["merchant"])),
|
|
100
|
+
...optional("submittedAt", optionalInstant(row["submittedAt"], "submittedAt")),
|
|
101
|
+
...optional("decidedBy", optionalText(row["decidedBy"])),
|
|
102
|
+
...optional("decidedAt", optionalInstant(row["decidedAt"], "decidedAt")),
|
|
103
|
+
...optional("decisionNote", optionalText(row["decisionNote"])),
|
|
104
|
+
...optional("reimbursedAt", optionalInstant(row["reimbursedAt"], "reimbursedAt")),
|
|
105
|
+
...optional("reimbursement", optionalText(row["reimbursement"]))
|
|
106
|
+
};
|
|
107
|
+
}
|
|
77
108
|
function violationOf(value) {
|
|
78
109
|
const row = recordOf(value, "check_expense_report");
|
|
79
110
|
const kind = textOf(row["kind"]);
|
|
@@ -108,6 +139,7 @@ function createExpenses(options) {
|
|
|
108
139
|
const call = blockCall(options.transport, options.schema, options.mappers);
|
|
109
140
|
const tenant = () => requireTenant(options.tenant);
|
|
110
141
|
const report = (fn) => (value) => reportOf(value, fn);
|
|
142
|
+
const expense = (fn) => (value) => expenseOf(value, fn);
|
|
111
143
|
const line = (fn) => (value) => lineOf(value, fn);
|
|
112
144
|
const category = (fn) => (value) => categoryOf(value, fn);
|
|
113
145
|
const fields = blockFields(options.fields, "expense report fields");
|
|
@@ -175,7 +207,59 @@ function createExpenses(options) {
|
|
|
175
207
|
status: list.status ?? null,
|
|
176
208
|
everyone: list.everyone ?? false,
|
|
177
209
|
page_size: list.pageSize ?? null
|
|
178
|
-
}, (value) => recordsOf(value, "list_expense_reports").map(report("list_expense_reports"))).andThen(fields.rows))
|
|
210
|
+
}, (value) => recordsOf(value, "list_expense_reports").map(report("list_expense_reports"))).andThen(fields.rows)),
|
|
211
|
+
createExpense: (input) => fields.args(input.fields).andThen((checked) => tenant().andThen((organizationId) => call("create_expense", {
|
|
212
|
+
tenant: organizationId,
|
|
213
|
+
spent_on: input.spentOn.toString(),
|
|
214
|
+
amount: amountText(input.amount),
|
|
215
|
+
currency: input.amount.currency,
|
|
216
|
+
category_id: input.categoryId ?? null,
|
|
217
|
+
description: input.description ?? null,
|
|
218
|
+
merchant: input.merchant ?? null,
|
|
219
|
+
user_id: input.userId ?? null,
|
|
220
|
+
...optional("employee_id", input.employeeId),
|
|
221
|
+
...input.company === true ? { company: true } : {},
|
|
222
|
+
...checked === void 0 ? {} : { fields: checked }
|
|
223
|
+
}, expense("create_expense")).andThen(fields.row))),
|
|
224
|
+
updateExpense: (expenseId, update) => fields.args(update.fields).andThen((checked) => {
|
|
225
|
+
const clear = [
|
|
226
|
+
["category", update.categoryId],
|
|
227
|
+
["description", update.description],
|
|
228
|
+
["merchant", update.merchant]
|
|
229
|
+
].filter(([, value]) => value === null).map(([name]) => name);
|
|
230
|
+
return call("update_expense", {
|
|
231
|
+
expense_id: expenseId,
|
|
232
|
+
spent_on: update.spentOn?.toString() ?? null,
|
|
233
|
+
amount: update.amount ? amountText(update.amount) : null,
|
|
234
|
+
currency: update.amount?.currency ?? null,
|
|
235
|
+
category_id: update.categoryId ?? null,
|
|
236
|
+
description: update.description ?? null,
|
|
237
|
+
merchant: update.merchant ?? null,
|
|
238
|
+
...clear.length === 0 ? {} : { clear },
|
|
239
|
+
...checked === void 0 ? {} : { fields: checked }
|
|
240
|
+
}, expense("update_expense")).andThen(fields.row);
|
|
241
|
+
}),
|
|
242
|
+
withdrawExpense: (expenseId) => call("withdraw_expense", { expense_id: expenseId }, expense("withdraw_expense")).andThen(fields.row),
|
|
243
|
+
deleteExpense: (expenseId) => call("delete_expense", { expense_id: expenseId }, (value) => value === true),
|
|
244
|
+
submitExpense: (expenseId) => call("submit_expense", { expense_id: expenseId }, expense("submit_expense")).andThen(fields.row),
|
|
245
|
+
decideExpense: (expenseId, decision) => call("decide_expense", {
|
|
246
|
+
expense_id: expenseId,
|
|
247
|
+
approved: decision.approved,
|
|
248
|
+
note: decision.note ?? null
|
|
249
|
+
}, expense("decide_expense")).andThen(fields.row),
|
|
250
|
+
reimburseExpense: (expenseId, input = {}) => call("reimburse_expense", {
|
|
251
|
+
expense_id: expenseId,
|
|
252
|
+
reference: input.reference ?? null
|
|
253
|
+
}, expense("reimburse_expense")).andThen(fields.row),
|
|
254
|
+
getExpense: (expenseId) => call("get_expense", { expense_id: expenseId }, expense("get_expense")).andThen(fields.row),
|
|
255
|
+
listExpenses: (list = {}) => tenant().andThen((organizationId) => call("list_expenses", {
|
|
256
|
+
tenant: organizationId,
|
|
257
|
+
user_id: list.userId ?? null,
|
|
258
|
+
status: list.status ?? null,
|
|
259
|
+
everyone: list.everyone ?? false,
|
|
260
|
+
page_size: list.pageSize ?? null,
|
|
261
|
+
...optional("employee_id", list.employeeId)
|
|
262
|
+
}, (value) => recordsOf(value, "list_expenses").map(expense("list_expenses"))).andThen(fields.rows))
|
|
179
263
|
}, options.hooks, {
|
|
180
264
|
block: "expenses",
|
|
181
265
|
...options.logger ? { logger: options.logger } : {}
|
|
@@ -189,7 +273,14 @@ const expensesEvents = defineEvents({
|
|
|
189
273
|
"expense_report.approved": event(),
|
|
190
274
|
"expense_report.reimbursed": event(),
|
|
191
275
|
"expense_report.cancelled": event(),
|
|
192
|
-
"expense_report.rejected": event()
|
|
276
|
+
"expense_report.rejected": event(),
|
|
277
|
+
"expense.created": event(),
|
|
278
|
+
"expense.submitted": event(),
|
|
279
|
+
"expense.approved": event(),
|
|
280
|
+
"expense.rejected": event(),
|
|
281
|
+
"expense.reimbursed": event(),
|
|
282
|
+
"expense.withdrawn": event(),
|
|
283
|
+
"expense.deleted": event()
|
|
193
284
|
});
|
|
194
285
|
// src/blocks/expenses/schemas.ts
|
|
195
286
|
/** What `create` takes. */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
2
|
import { T as ErrorMapper, t as AsyncResult } from "../../result-DTOQRyGY.js";
|
|
3
3
|
import { n as Logger } from "../../logger-0LfhvwE4.js";
|
|
4
|
-
import { r as BlockTemporalOptions } from "../../block-helpers-
|
|
5
|
-
import { a as dbTransport, i as RpcClient, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-
|
|
6
|
-
import { a as BlockTransportMiddleware, d as extendBlock, f as withBlockHooks, n as BlockHooks, p as wrapTransport } from "../../block-hooks-
|
|
7
|
-
import { c as BlockOf } from "../../define-block-
|
|
4
|
+
import { r as BlockTemporalOptions } from "../../block-helpers-BNtM1tqy.js";
|
|
5
|
+
import { a as dbTransport, i as RpcClient, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-CDmOUuLZ.js";
|
|
6
|
+
import { a as BlockTransportMiddleware, d as extendBlock, f as withBlockHooks, n as BlockHooks, p as wrapTransport } from "../../block-hooks-CtMsgLQr.js";
|
|
7
|
+
import { c as BlockOf } from "../../define-block-CDw9YGVh.js";
|
|
8
8
|
/** One column's change on one record. */
|
|
9
9
|
interface FieldChange {
|
|
10
10
|
/** Increases with every change; pass it as `before` for the next page. */
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { T as ErrorMapper, t as AsyncResult } from "../../result-DTOQRyGY.js";
|
|
2
2
|
import { t as StandardSchemaV1 } from "../../standard-DRX6Ch1j.js";
|
|
3
3
|
import { r as FieldsOf } from "../../block-fields-Puv5m5D3.js";
|
|
4
|
-
import { Ct as Events, z as FlagEventData } from "../../events-
|
|
4
|
+
import { Ct as Events, z as FlagEventData } from "../../events-DddDlibJ.js";
|
|
5
5
|
import { n as Logger } from "../../logger-0LfhvwE4.js";
|
|
6
|
-
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-
|
|
7
|
-
import { n as BlockHooks } from "../../block-hooks-
|
|
8
|
-
import { c as BlockOf } from "../../define-block-
|
|
9
|
-
import { A as flagDefinitionsOf, C as chooseSplitVariant, D as expandSegments, E as evaluateFlag, O as flagBucket, S as RequestFlagContext, T as createFlagsProvider, _ as FlagSplit, a as FlagContextOptions, b as FlagsProvider, c as FlagDetails, d as FlagOverride, f as FlagReason, g as FlagRule, h as FlagRolloutStep, i as FlagContext, j as rolloutPercentageAt, k as flagContext, l as FlagErrorCode, m as FlagRolloutSchedule, n as FlagClient, o as FlagContextSource, p as FlagResolution, r as FlagCondition, s as FlagDefinition, t as EvaluateFlagOptions, u as FlagEvaluation, v as FlagType, w as createFlagClient, x as FlagsProviderOptions, y as FlagValue } from "../../flags-
|
|
6
|
+
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-CDmOUuLZ.js";
|
|
7
|
+
import { n as BlockHooks } from "../../block-hooks-CtMsgLQr.js";
|
|
8
|
+
import { c as BlockOf } from "../../define-block-CDw9YGVh.js";
|
|
9
|
+
import { A as flagDefinitionsOf, C as chooseSplitVariant, D as expandSegments, E as evaluateFlag, O as flagBucket, S as RequestFlagContext, T as createFlagsProvider, _ as FlagSplit, a as FlagContextOptions, b as FlagsProvider, c as FlagDetails, d as FlagOverride, f as FlagReason, g as FlagRule, h as FlagRolloutStep, i as FlagContext, j as rolloutPercentageAt, k as flagContext, l as FlagErrorCode, m as FlagRolloutSchedule, n as FlagClient, o as FlagContextSource, p as FlagResolution, r as FlagCondition, s as FlagDefinition, t as EvaluateFlagOptions, u as FlagEvaluation, v as FlagType, w as createFlagClient, x as FlagsProviderOptions, y as FlagValue } from "../../flags-Cuew4tGx.js";
|
|
10
10
|
interface FlagsOptions<S extends StandardSchemaV1 | undefined = undefined> {
|
|
11
11
|
/**
|
|
12
12
|
* The caller's transport: `rpcTransport(supabase, { schema: "api" })` for
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
2
|
import { T as ErrorMapper, t as AsyncResult } from "../../result-DTOQRyGY.js";
|
|
3
|
-
import { Ct as Events } from "../../events-
|
|
4
|
-
import { C as ForecastSnapshotEventData } from "../../index-
|
|
3
|
+
import { Ct as Events } from "../../events-DddDlibJ.js";
|
|
4
|
+
import { C as ForecastSnapshotEventData } from "../../index-DjJUamhw.js";
|
|
5
5
|
import { n as Logger } from "../../logger-0LfhvwE4.js";
|
|
6
|
-
import { r as BlockTemporalOptions } from "../../block-helpers-
|
|
7
|
-
import { a as dbTransport, i as RpcClient, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-
|
|
8
|
-
import { a as BlockTransportMiddleware, d as extendBlock, f as withBlockHooks, n as BlockHooks, p as wrapTransport } from "../../block-hooks-
|
|
9
|
-
import { c as BlockOf } from "../../define-block-
|
|
6
|
+
import { r as BlockTemporalOptions } from "../../block-helpers-BNtM1tqy.js";
|
|
7
|
+
import { a as dbTransport, i as RpcClient, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-CDmOUuLZ.js";
|
|
8
|
+
import { a as BlockTransportMiddleware, d as extendBlock, f as withBlockHooks, n as BlockHooks, p as wrapTransport } from "../../block-hooks-CtMsgLQr.js";
|
|
9
|
+
import { c as BlockOf } from "../../define-block-CDw9YGVh.js";
|
|
10
10
|
import { n as Money } from "../../money-BgpAd7d3.js";
|
|
11
11
|
import { t as DealForecast } from "../../deal-forecast-CN_BEy9s.js";
|
|
12
12
|
/** A stored forecast call. */
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import { D as ValidationIssue, T as ErrorMapper, t as AsyncResult } from "../../result-DTOQRyGY.js";
|
|
3
3
|
import { t as StandardSchemaV1$1 } from "../../standard-DRX6Ch1j.js";
|
|
4
4
|
import { r as FieldsOf } from "../../block-fields-Puv5m5D3.js";
|
|
5
|
-
import { B as FormEventData, Ct as Events, V as FormSubmissionEventData } from "../../events-
|
|
5
|
+
import { B as FormEventData, Ct as Events, V as FormSubmissionEventData } from "../../events-DddDlibJ.js";
|
|
6
6
|
import { n as Logger } from "../../logger-0LfhvwE4.js";
|
|
7
|
-
import { r as BlockTemporalOptions } from "../../block-helpers-
|
|
8
|
-
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-
|
|
9
|
-
import { n as BlockHooks } from "../../block-hooks-
|
|
10
|
-
import { c as BlockOf } from "../../define-block-
|
|
11
|
-
import { n as Controller } from "../../controller-
|
|
7
|
+
import { r as BlockTemporalOptions } from "../../block-helpers-BNtM1tqy.js";
|
|
8
|
+
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-CDmOUuLZ.js";
|
|
9
|
+
import { n as BlockHooks } from "../../block-hooks-CtMsgLQr.js";
|
|
10
|
+
import { c as BlockOf } from "../../define-block-CDw9YGVh.js";
|
|
11
|
+
import { n as Controller } from "../../controller-DhcSXkAC.js";
|
|
12
12
|
import { _ as isFormDefinition, a as FormDefinition, c as FormJson, d as FormScoring, f as FormStep, g as formSchema, h as formDefinitionProblems, i as FormCondition, l as FormJsonSchema, m as UNSCORED_FIELD_TYPES, n as FORM_FIELD_TYPES, o as FormField, p as NPS_MAX, r as FORM_SCHEMA_DIALECT, s as FormFieldType, t as FORM_DEFINITION_SCHEMA, u as FormOption } from "../../form-definition-BN8shngm.js";
|
|
13
13
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
14
14
|
/** A submission's answers, by field key. */
|
|
@@ -3,10 +3,10 @@ import { t as AsyncResult } from "../../result-DTOQRyGY.js";
|
|
|
3
3
|
import { t as StandardSchemaV1 } from "../../standard-DRX6Ch1j.js";
|
|
4
4
|
import { n as ExtraFields, r as FieldsOf } from "../../block-fields-Puv5m5D3.js";
|
|
5
5
|
import { n as Logger } from "../../logger-0LfhvwE4.js";
|
|
6
|
-
import { n as BlockOptions } from "../../block-helpers-
|
|
7
|
-
import { a as dbTransport, i as RpcClient, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-
|
|
8
|
-
import { a as BlockTransportMiddleware, d as extendBlock, f as withBlockHooks, n as BlockHooks, p as wrapTransport } from "../../block-hooks-
|
|
9
|
-
import { c as BlockOf } from "../../define-block-
|
|
6
|
+
import { n as BlockOptions } from "../../block-helpers-BNtM1tqy.js";
|
|
7
|
+
import { a as dbTransport, i as RpcClient, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-CDmOUuLZ.js";
|
|
8
|
+
import { a as BlockTransportMiddleware, d as extendBlock, f as withBlockHooks, n as BlockHooks, p as wrapTransport } from "../../block-hooks-CtMsgLQr.js";
|
|
9
|
+
import { c as BlockOf } from "../../define-block-CDw9YGVh.js";
|
|
10
10
|
/**
|
|
11
11
|
* A metric the database computes, or any other name the app keeps the actual
|
|
12
12
|
* value of itself.
|