better-supabase 0.58.3 → 0.60.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/{account-parts-DxSyD4yi.d.ts → account-parts-D-cLYi0Y.d.ts} +1 -1
- package/dist/{adapter-base-BbnpIsy4.js → adapter-base-BHtxRoRg.js} +1 -1
- package/dist/{agents-CbsEgoLN.d.ts → agents-FJk0CNex.d.ts} +2 -2
- package/dist/{ai-schedules-D47O_Vlo.d.ts → ai-schedules-wlL3DKqu.d.ts} +1 -1
- package/dist/ai-sdk/agents/index.d.ts +1 -1
- package/dist/ai-sdk/workflow/index.d.ts +1 -1
- package/dist/{api-wRlj_7so.d.ts → api-CSx2F4zg.d.ts} +1 -1
- package/dist/{api-DsFkhsYI.js → api-Clu-XitC.js} +1 -1
- package/dist/{app-tables-IXL0Hzut.d.ts → app-tables-C_bRG0ek.d.ts} +1 -1
- package/dist/{approvals-Clg-7ghA.js → approvals-D7Xhpd52.js} +8 -6
- package/dist/{approvals-Bbxeiywy.d.ts → approvals-Dn_DM4Oi.d.ts} +6 -0
- package/dist/astro/index.d.ts +3 -3
- package/dist/astro/index.js +3 -3
- package/dist/{authorization-Dq47C4vf.d.ts → authorization-Cn_oEGoA.d.ts} +1 -1
- package/dist/better-result/index.d.ts +2 -2
- package/dist/{bind-BRkDWXXk.d.ts → bind-Dopmkg_T.d.ts} +4 -4
- package/dist/{block-env-I8juWoVO.d.ts → block-env-4tgXDIAX.d.ts} +4 -4
- package/dist/{block-tables-DmDyNlJf.d.ts → block-tables-KnVB7FH0.d.ts} +1 -1
- package/dist/blocks/access-requests/index.d.ts +1 -1
- package/dist/blocks/accounting/index.d.ts +1 -1
- package/dist/blocks/acknowledgements/index.d.ts +1 -1
- package/dist/blocks/activities/index.d.ts +2 -2
- package/dist/blocks/advisories/index.d.ts +1 -1
- package/dist/blocks/agent-checkout/index.d.ts +1 -1
- package/dist/blocks/agents/index.d.ts +1 -1
- package/dist/blocks/ai-cache/index.d.ts +1 -1
- package/dist/blocks/ai-chat/index.d.ts +1 -1
- package/dist/blocks/ai-evals/index.d.ts +1 -1
- package/dist/blocks/ai-files/index.d.ts +1 -1
- package/dist/blocks/ai-guardrails/index.d.ts +1 -1
- package/dist/blocks/ai-keys/index.d.ts +1 -1
- package/dist/blocks/ai-schedules/index.d.ts +2 -2
- package/dist/blocks/announcements/index.d.ts +4 -4
- package/dist/blocks/api-keys/index.d.ts +1 -1
- package/dist/blocks/appraisals/index.d.ts +1 -1
- package/dist/blocks/approvals/index.d.ts +2 -2
- package/dist/blocks/approvals/index.js +2 -2
- package/dist/blocks/assets/index.d.ts +2 -2
- package/dist/blocks/assignment/index.d.ts +1 -1
- package/dist/blocks/attachments/index.d.ts +5 -5
- package/dist/blocks/audit/index.d.ts +2 -2
- package/dist/blocks/automations/index.d.ts +4 -4
- package/dist/blocks/banking/index.d.ts +1 -1
- package/dist/blocks/billable-time/index.d.ts +1 -1
- package/dist/blocks/billing/index.d.ts +3 -3
- package/dist/blocks/bookings/index.d.ts +2 -2
- package/dist/blocks/bulk-actions/index.d.ts +2 -2
- package/dist/blocks/calendar/index.d.ts +3 -3
- package/dist/blocks/care/index.d.ts +27 -27
- package/dist/blocks/care/index.js +1 -1
- package/dist/blocks/care-plans/index.d.ts +3 -3
- package/dist/blocks/cases/index.d.ts +3 -3
- package/dist/blocks/catalog/index.d.ts +2 -2
- package/dist/blocks/channels/index.d.ts +1 -1
- package/dist/blocks/clinical-decision-support/index.d.ts +1 -1
- package/dist/blocks/cms/index.d.ts +5 -5
- package/dist/blocks/cms/index.js +1 -1
- package/dist/blocks/collaboration/index.d.ts +6 -6
- package/dist/blocks/collections/index.d.ts +1 -1
- package/dist/blocks/comments/index.d.ts +2 -2
- package/dist/blocks/commerce/index.d.ts +5 -5
- package/dist/blocks/commissions/index.d.ts +1 -1
- package/dist/blocks/compliance/index.d.ts +1 -1
- package/dist/blocks/connectors/index.d.ts +1 -1
- package/dist/blocks/consents/index.d.ts +2 -2
- package/dist/blocks/contacts/index.d.ts +2 -2
- package/dist/blocks/content/index.d.ts +2 -2
- package/dist/blocks/contracts/index.d.ts +1 -1
- package/dist/blocks/courses/index.d.ts +2 -2
- package/dist/blocks/created-by/index.d.ts +2 -2
- package/dist/blocks/crm/index.d.ts +17 -17
- package/dist/blocks/crm/index.js +2 -2
- package/dist/blocks/custom-fields/index.d.ts +1 -1
- package/dist/blocks/dam/index.d.ts +2 -2
- package/dist/blocks/data-lifecycle/index.d.ts +2 -2
- package/dist/blocks/deadlines/index.d.ts +1 -1
- package/dist/blocks/deals/index.d.ts +1 -1
- package/dist/blocks/dispatch/index.d.ts +2 -2
- package/dist/blocks/document-templates/index.d.ts +2 -2
- package/dist/blocks/documents/index.d.ts +1 -1
- package/dist/blocks/domains/index.d.ts +1 -1
- package/dist/blocks/donations/index.d.ts +1 -1
- package/dist/blocks/drive/index.d.ts +5 -5
- package/dist/blocks/e-prescribing/index.d.ts +1 -1
- package/dist/blocks/employees/index.d.ts +1 -1
- package/dist/blocks/enrichment/index.d.ts +1 -1
- package/dist/blocks/enrollments/index.d.ts +2 -2
- package/dist/blocks/entitlements/index.d.ts +3 -3
- package/dist/blocks/events/index.d.ts +3 -3
- package/dist/blocks/expenses/index.d.ts +1 -1
- package/dist/blocks/field-history/index.d.ts +1 -1
- package/dist/blocks/filespace/index.d.ts +8 -8
- package/dist/blocks/finance/index.d.ts +5 -5
- package/dist/blocks/finance/index.js +1 -1
- package/dist/blocks/flags/index.d.ts +1 -1
- package/dist/blocks/forecasts/index.d.ts +1 -1
- package/dist/blocks/forms/index.d.ts +3 -3
- package/dist/blocks/funding/index.d.ts +2 -2
- package/dist/blocks/goals/index.d.ts +1 -1
- package/dist/blocks/governance/index.d.ts +4 -4
- package/dist/blocks/guests/index.d.ts +1 -1
- package/dist/blocks/hiring/index.d.ts +1 -1
- package/dist/blocks/identities/index.d.ts +1 -1
- package/dist/blocks/imports/index.d.ts +2 -2
- package/dist/blocks/inbox/index.d.ts +6 -6
- package/dist/blocks/incidents/index.d.ts +1 -1
- package/dist/blocks/index.d.ts +5 -5
- package/dist/blocks/index.js +2 -2
- package/dist/blocks/inspections/index.d.ts +2 -2
- package/dist/blocks/inventory/index.d.ts +1 -1
- package/dist/blocks/invoices/index.d.ts +2 -2
- package/dist/blocks/invoices/index.js +1 -1
- package/dist/blocks/knowledge/index.d.ts +1 -1
- package/dist/blocks/lead-scoring/index.d.ts +2 -2
- package/dist/blocks/learning/index.d.ts +3 -3
- package/dist/blocks/leases/index.d.ts +1 -1
- package/dist/blocks/leave/index.d.ts +1 -1
- package/dist/blocks/ledger/index.d.ts +1 -1
- package/dist/blocks/legal-entities/index.d.ts +2 -2
- package/dist/blocks/lims/index.d.ts +2 -2
- package/dist/blocks/mail-sync/index.d.ts +3 -3
- package/dist/blocks/maintenance/index.d.ts +2 -2
- package/dist/blocks/manufacturing/index.d.ts +2 -2
- package/dist/blocks/medications/index.d.ts +1 -1
- package/dist/blocks/meetings/index.d.ts +3 -3
- package/dist/blocks/memberships/index.d.ts +2 -2
- package/dist/blocks/memory/index.d.ts +1 -1
- package/dist/blocks/messaging/index.d.ts +5 -5
- package/dist/blocks/metrics/index.d.ts +1 -1
- package/dist/blocks/mfa/index.d.ts +2 -2
- package/dist/blocks/moderation/index.d.ts +2 -2
- package/dist/blocks/notifications/index.d.ts +5 -5
- package/dist/blocks/numbering/index.d.ts +1 -1
- package/dist/blocks/oauth-server/index.d.ts +1 -1
- package/dist/blocks/observations/index.d.ts +2 -2
- package/dist/blocks/onboarding/index.d.ts +2 -2
- package/dist/blocks/option-sets/index.d.ts +2 -2
- package/dist/blocks/orders/index.d.ts +1 -1
- package/dist/blocks/organizations/index.d.ts +2 -2
- package/dist/blocks/outbox/index.d.ts +1 -1
- package/dist/blocks/passes/index.d.ts +2 -2
- package/dist/blocks/payroll-export/index.d.ts +2 -2
- package/dist/blocks/people/index.d.ts +7 -7
- package/dist/blocks/periods/index.d.ts +1 -1
- package/dist/blocks/permissions/index.d.ts +3 -3
- package/dist/blocks/pipelines/index.d.ts +2 -2
- package/dist/blocks/posts/index.d.ts +2 -2
- package/dist/blocks/procurement/index.d.ts +5 -5
- package/dist/blocks/procurement/index.js +1 -1
- package/dist/blocks/profiles/index.d.ts +1 -1
- package/dist/blocks/projects/index.d.ts +7 -7
- package/dist/blocks/projects/index.js +2 -2
- package/dist/blocks/promotions/index.d.ts +1 -1
- package/dist/blocks/prompts/index.d.ts +1 -1
- package/dist/blocks/push/index.d.ts +2 -2
- package/dist/blocks/qualifications/index.d.ts +2 -2
- package/dist/blocks/queue/index.d.ts +2 -2
- package/dist/blocks/quotes/index.d.ts +1 -1
- package/dist/blocks/rank/index.d.ts +1 -1
- package/dist/blocks/reactions/index.d.ts +4 -4
- package/dist/blocks/recruiting/index.d.ts +4 -4
- package/dist/blocks/referrals/index.d.ts +1 -1
- package/dist/blocks/relations/index.d.ts +1 -1
- package/dist/blocks/reminders/index.d.ts +1 -1
- package/dist/blocks/reviews/index.d.ts +1 -1
- package/dist/blocks/rfqs/index.d.ts +2 -2
- package/dist/blocks/risks/index.d.ts +2 -2
- package/dist/blocks/saas/index.d.ts +12 -12
- package/dist/blocks/sales/index.d.ts +1 -1
- package/dist/blocks/sales/index.js +1 -1
- package/dist/blocks/saved-views/index.d.ts +3 -3
- package/dist/blocks/scheduling/index.d.ts +4 -4
- package/dist/blocks/scores/index.d.ts +2 -2
- package/dist/blocks/search/index.d.ts +3 -3
- package/dist/blocks/security-events/index.d.ts +1 -1
- package/dist/blocks/segments/index.d.ts +2 -2
- package/dist/blocks/sequences/index.d.ts +3 -3
- package/dist/blocks/service/index.d.ts +7 -7
- package/dist/blocks/service-accounts/index.d.ts +1 -1
- package/dist/blocks/sessions/index.d.ts +2 -2
- package/dist/blocks/settings/index.d.ts +2 -2
- package/dist/blocks/share-links/index.d.ts +1 -1
- package/dist/blocks/shifts/index.d.ts +2 -2
- package/dist/blocks/shipments/index.d.ts +1 -1
- package/dist/blocks/signatures/index.d.ts +2 -2
- package/dist/blocks/signing-keys/index.d.ts +1 -1
- package/dist/blocks/sla/index.d.ts +1 -1
- package/dist/blocks/sso/index.d.ts +1 -1
- package/dist/blocks/state-machine/index.d.ts +1 -1
- package/dist/blocks/subjects/index.d.ts +2 -2
- package/dist/blocks/support/index.d.ts +5 -5
- package/dist/blocks/tags/index.d.ts +2 -2
- package/dist/blocks/tasks/index.d.ts +2 -2
- package/dist/blocks/tax/index.d.ts +2 -2
- package/dist/blocks/teams/index.d.ts +1 -1
- package/dist/blocks/templates/index.d.ts +1 -1
- package/dist/blocks/tills/index.d.ts +1 -1
- package/dist/blocks/time-entries/index.d.ts +2 -2
- package/dist/blocks/timeline/index.d.ts +1 -1
- package/dist/blocks/trash/index.d.ts +1 -1
- package/dist/blocks/undo/index.d.ts +2 -2
- package/dist/blocks/updated-at/index.d.ts +2 -2
- package/dist/blocks/usage/index.d.ts +2 -2
- package/dist/blocks/vercel-marketplace/index.d.ts +1 -1
- package/dist/blocks/versions/index.d.ts +1 -1
- package/dist/blocks/waitlist/index.d.ts +1 -1
- package/dist/blocks/warehouse/index.d.ts +1 -1
- package/dist/blocks/warranty/index.d.ts +1 -1
- package/dist/blocks/webhooks/index.d.ts +2 -2
- package/dist/blocks/workflow-editor/index.d.ts +4 -4
- package/dist/blocks/workflows/index.d.ts +4 -4
- package/dist/{blocks-RVd7m590.d.ts → blocks-sDhFO8-h.d.ts} +4 -4
- package/dist/{build-Cb9yLxtS.js → build-QM0GdQ2B.js} +1 -1
- package/dist/{cache-tags-BxpxsCtq.d.ts → cache-tags-FrJaMalu.d.ts} +1 -1
- package/dist/claims/index.d.ts +4 -4
- package/dist/{claims-source-CXAtLZ9_.d.ts → claims-source-CeefCyGV.d.ts} +1 -1
- package/dist/cli/add-BBZULhs3.js +1 -0
- package/dist/cli/{add-dbBQf6Vy.js → add-OllEkXon.js} +11 -11
- package/dist/cli/{add-BQZyQh4f.js → add-djLR310z.js} +2 -2
- package/dist/cli/{app-table-files-CITEmvRS.js → app-table-files-DnoDAkVJ.js} +4 -4
- package/dist/cli/{app-tables-BBqu3dow.js → app-tables-C4shCkBv.js} +2 -2
- package/dist/cli/{backfill-bBk3QjfK.js → backfill-_spwSvnn.js} +3 -3
- package/dist/cli/bin.js +1 -1
- package/dist/cli/{blocks-D-DV2aCE.js → blocks-Cvs0nhC2.js} +1 -1
- package/dist/cli/{blocks-CsQNweG8.js → blocks-DFkzCFQi.js} +1 -1
- package/dist/cli/{cache-sR8AQqSV.js → cache-B0JnXfiY.js} +1 -1
- package/dist/cli/{codemod-BkPcyPnF.js → codemod-D2Lnca97.js} +6 -6
- package/dist/cli/{codemod-naming-BLoVSmVF.js → codemod-naming-CHIeOTt5.js} +1 -1
- package/dist/cli/{column-renames-brM-D_th.js → column-renames-4OHEvCAj.js} +2 -2
- package/dist/cli/{config-NxPVkM-K.js → config-DD_MnPRL.js} +1 -0
- package/dist/cli/{config-BGh7rJwA.js → config-DkjilxeE.js} +1 -1
- package/dist/cli/{content-mapper-DMi2HOKi.js → content-mapper-DAYxPQ18.js} +1 -1
- package/dist/cli/{db-od92zIrO.js → db-CEUnv3hK.js} +2 -2
- package/dist/cli/{dev-ClH-7fB0.js → dev-Xw7pt3KG.js} +5 -5
- package/dist/cli/{doctor-C_BEuEGg.js → doctor-diSKQp-6.js} +724 -32
- package/dist/cli/{emit-CTzFdffA.js → emit-CICey-Za.js} +2 -2
- package/dist/cli/{gen-RKf7q3L5.js → gen-BVuNFeLB.js} +5 -5
- package/dist/cli/{gen-tasks-DmDvgVBV.js → gen-tasks-C2vwKKTc.js} +11 -11
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +8 -8
- package/dist/cli/{init-B_CCByIh.js → init-9BSoBkny.js} +9 -9
- package/dist/cli/{live-DjjMID3V.js → live-Ce8vdcCn.js} +2 -2
- package/dist/cli/{mcp-BYwrZHp1.js → mcp-UW-gEnP_.js} +2 -2
- package/dist/cli/{memo-backend-BIHqP1uE.js → memo-backend-BMdfsihK.js} +1 -1
- package/dist/cli/{metadata-DCtLUYqR.js → metadata-DqrbS0sS.js} +4 -4
- package/dist/cli/{migrate-Bq6CUPbE.js → migrate-Cn8L_0co.js} +1 -1
- package/dist/cli/{migration-safety-BvJ-JK5n.js → migration-safety-C1Ysrthi.js} +2 -2
- package/dist/cli/{module-migration-Dv6VV1om.js → module-migration-DXI95fqs.js} +1 -1
- package/dist/cli/{partition-C4g7WAwh.js → partition-CJCrIueu.js} +3 -3
- package/dist/cli/{powersync-1HMiZhFF.js → powersync-CB-7AksZ.js} +4 -4
- package/dist/cli/powersync-JTdU1Xpy.js +1 -0
- package/dist/cli/{print-D9biMrfv.js → print-AVVgXsLG.js} +2 -2
- package/dist/cli/{providers-C5fw9XC_.js → providers-B3FLmlud.js} +1 -1
- package/dist/cli/{prune-workflows-DxpPCevB.js → prune-workflows-CrLDmFf1.js} +3 -3
- package/dist/cli/{remove-CyhSdPkK.js → remove-00SZWfyi.js} +6 -6
- package/dist/cli/{render-DOz25g5T.js → render-3J7sk_CL.js} +5 -5
- package/dist/cli/{render-cache-CInSNFhV.js → render-cache-P4gQeivH.js} +1 -1
- package/dist/cli/round-trips-BHfeIu6I.js +238 -0
- package/dist/cli/{run-DVdkD1MI.js → run-CByEIEng.js} +35 -35
- package/dist/cli/{run-0bMsZ1VV.js → run-D_z9ULO7.js} +7 -7
- package/dist/cli/seed-CucH5loT.js +1 -0
- package/dist/cli/{seed-DVKgi-7l.js → seed-CvDA1ItH.js} +2 -2
- package/dist/cli/{shared-D2i8_u-U.js → shared-d021xfdn.js} +1 -1
- package/dist/cli/{source-BGVOuWXq.js → source-DdqeWoO4.js} +1 -1
- package/dist/cli/{source-args-B3Rowfv5.js → source-args-yU6N6JLm.js} +1 -1
- package/dist/cli/{spec-COotILIk.js → spec-ClfqDbVv.js} +2 -2
- package/dist/cli/{spec-C_JKo_dP.js → spec-Diudl7hC.js} +1 -1
- package/dist/cli/{sql-layout-D8dIzdy9.js → sql-layout-Bl3iOXMS.js} +4 -4
- package/dist/cli/{squash-xCseaSP1.js → squash-C07y7CsQ.js} +1 -1
- package/dist/cli/{sync-Ceqa-3R6.js → sync-Cw0ke-3h.js} +4 -4
- package/dist/cli/{upgrade-CUNKALDw.js → upgrade-niwEovfl.js} +5 -5
- package/dist/cli/{upgrade-DiMHauEU.js → upgrade-oc6s5Xoe.js} +5 -5
- package/dist/cli/{verify-BFLaU6w3.js → verify-CrFHs8Lr.js} +2 -2
- package/dist/cli/{version-C7imaHag.js → version-Bd3kCDzL.js} +1 -1
- package/dist/client/index.d.ts +5 -5
- 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/{codec-Cjquuv8M.js → codec-BI1mq95W.js} +1 -1
- package/dist/{composite-CL4zDLjs.d.ts → composite-BVEOyec_.d.ts} +3 -3
- package/dist/{composite-DYAp3Znr.js → composite-Tsm5QFS2.js} +1 -1
- package/dist/{composite-reads-BJeDe1yV.js → composite-reads-BJJBI4tL.js} +1 -1
- package/dist/{composite-reads-B9psRGqQ.d.ts → composite-reads-DvN7EgDO.d.ts} +1 -1
- package/dist/config/index.d.ts +4 -4
- package/dist/config/index.js +2 -2
- package/dist/{config-DzPViWQU.js → config-cisS43w5.js} +2 -1
- package/dist/{context-DMBXEzQa.d.ts → context-C_Rx1QaW.d.ts} +4 -3
- package/dist/contract/index.d.ts +4 -4
- package/dist/{controller-CaZv50cD.d.ts → controller-D9N4NKbM.d.ts} +1 -1
- package/dist/{conversion-D2key0v9.d.ts → conversion-CruLbcu8.d.ts} +1 -1
- package/dist/create/index.d.ts +4 -4
- package/dist/create/index.js +1 -1
- package/dist/create/lite/index.d.ts +3 -3
- package/dist/create/lite/index.js +3 -3
- package/dist/{db-blocks-Db3LVXco.d.ts → db-blocks-DB8Ct8Eu.d.ts} +11 -2
- package/dist/{define-block-kWv1wYf7.d.ts → define-block-Cd7dm2o6.d.ts} +7 -2
- package/dist/{define-runtime-Dv8OYnKW.js → define-runtime-Ca5NN0gu.js} +2 -2
- package/dist/{define-runtime-full-Bh5c_01f.js → define-runtime-full-DeuaXsV7.js} +45 -38
- package/dist/{delete-account-BHXzIUIq.d.ts → delete-account-DwGFiIYv.d.ts} +1 -1
- package/dist/{drive-Bm-up0KU.d.ts → drive-C6thwExa.d.ts} +2 -2
- package/dist/e-invoicing/index.d.ts +1 -1
- package/dist/edge/index.d.ts +5 -5
- package/dist/edge/index.js +4 -4
- package/dist/{entitlements-UGUF2RJv.d.ts → entitlements-CR5HRd3S.d.ts} +2 -2
- package/dist/eve/index.d.ts +1 -1
- package/dist/eve/index.js +1 -1
- package/dist/{executor-B0nTn-4Q.js → executor-Bot0tkvU.js} +2 -2
- package/dist/{executor-Dp4A_McY.d.ts → executor-CTuilcgE.d.ts} +2 -2
- package/dist/expo/index.d.ts +2 -2
- package/dist/expo/index.js +3 -3
- package/dist/{extract-Bs_b4ZIX.d.ts → extract-B2My7IhT.d.ts} +1 -1
- package/dist/{extras-C258FsPj.d.ts → extras-CKwPSpGL.d.ts} +1 -1
- package/dist/{field-errors-BKCtkPxS.d.ts → field-errors-CihTLojJ.d.ts} +6 -6
- package/dist/{former-permission-keys-hL23tm66.js → former-permission-keys-D8FbWktT.js} +4 -3
- package/dist/{framework-C9UiMaOq.js → framework-BYZ8c9_g.js} +1 -1
- package/dist/{framework-BUzOnlJN.d.ts → framework-giXStk8k.d.ts} +3 -3
- package/dist/generators/factories/index.d.ts +1 -1
- package/dist/generators/factories/index.js +1 -1
- package/dist/generators/index.d.ts +2 -2
- package/dist/generators/json-schema/index.d.ts +2 -2
- package/dist/generators/json-schema/index.js +1 -1
- package/dist/generators/nuqs/index.d.ts +1 -1
- package/dist/generators/nuqs/index.js +1 -1
- package/dist/generators/standard-schema/index.d.ts +1 -1
- package/dist/generators/standard-schema/index.js +1 -1
- package/dist/generators/valibot/index.d.ts +1 -1
- package/dist/generators/valibot/index.js +1 -1
- package/dist/generators/zod/index.d.ts +1 -1
- package/dist/generators/zod/index.js +1 -1
- package/dist/hono/index.d.ts +4 -4
- package/dist/hono/index.js +3 -3
- package/dist/{index-CDCyOPT7.d.ts → index-28PPT5w7.d.ts} +2 -2
- package/dist/{index-nsEUHz98.d.ts → index-69aFw9Id.d.ts} +2 -2
- package/dist/{index-BtuseUSW.d.ts → index-74TASXlD.d.ts} +1 -1
- package/dist/{index-DOBq5QFe.d.ts → index-B0dSXth6.d.ts} +1 -1
- package/dist/{index-Mq2z-GgJ.d.ts → index-BOuJSOaf.d.ts} +1 -1
- package/dist/{index-DLVuARYk.d.ts → index-BnY5lZtT.d.ts} +9 -9
- package/dist/{index-rFIDpwjh.d.ts → index-BqUY2MB-.d.ts} +1 -1
- package/dist/{index-BG-WQ0JH.d.ts → index-BrnGYShi.d.ts} +2 -2
- package/dist/{index-BMh8ACKR.d.ts → index-Bs6OCtxW.d.ts} +1 -1
- package/dist/{index-CIVA5x1i.d.ts → index-BszN5nLs.d.ts} +2 -2
- package/dist/{index-CjeQqQzW.d.ts → index-Bv2kSYet.d.ts} +4 -4
- package/dist/{index-R_k3Nh4y.d.ts → index-BvRseRob.d.ts} +3 -3
- package/dist/{index-DIK12ZTb.d.ts → index-BvZ3uvj9.d.ts} +2 -2
- package/dist/{index-ClysJ8O-.d.ts → index-C1na2fiY.d.ts} +3 -3
- package/dist/{index-DgiSwhKf.d.ts → index-C59gKJBx.d.ts} +1 -1
- package/dist/{index-DcdC0Qll.d.ts → index-CGAcXNod.d.ts} +1 -1
- package/dist/{index-DWxio8F_.d.ts → index-CMyUugyW.d.ts} +8 -8
- package/dist/{index-BYx-ObF-.d.ts → index-CdoTvK2W.d.ts} +1 -1
- package/dist/{index-CkCuMFVG.d.ts → index-CiCmlbtu.d.ts} +1 -1
- package/dist/{index-B67YUNow.d.ts → index-CiLb3DTI.d.ts} +3 -3
- package/dist/{index-CzNRwKGG.d.ts → index-Cnc4wyTo.d.ts} +2 -2
- package/dist/{index-CDrLyU72.d.ts → index-Cpj79WyM.d.ts} +1 -1
- package/dist/{index-B6i7w-iS.d.ts → index-D50ulqMJ.d.ts} +1 -1
- package/dist/{index-48l12mNt.d.ts → index-D6px-XTD.d.ts} +2 -2
- package/dist/{index-DRKAMZV3.d.ts → index-DMHxmit5.d.ts} +4 -4
- package/dist/{index-BBf3nn7Y.d.ts → index-DflyfGR8.d.ts} +2 -2
- package/dist/{index-DebFs8qq.d.ts → index-DibtbiIW.d.ts} +1 -1
- package/dist/{index-B64DT6Io.d.ts → index-DpXMVE12.d.ts} +1 -1
- package/dist/{index-GamVr8VZ.d.ts → index-DsLMqyB5.d.ts} +1 -1
- package/dist/{index-C_DCvnW0.d.ts → index-DzUnwtxa.d.ts} +1 -1
- package/dist/{index-BZdSOt51.d.ts → index-Hzbfht3Z.d.ts} +1 -1
- package/dist/{index-bkm44ycq.d.ts → index-Sl13L6VB.d.ts} +4 -4
- package/dist/{index-DskEpSgl.d.ts → index-UQOB8v1I.d.ts} +1 -1
- package/dist/{index-CDxfstYD.d.ts → index-_No9Jb9O.d.ts} +1 -1
- package/dist/{index-icogJj2C.d.ts → index-cgHbN_EA.d.ts} +4 -4
- package/dist/{index-D2aht6Cz.d.ts → index-pry9PXpK.d.ts} +2 -2
- package/dist/{index-BJ1Mv0TK.d.ts → index-wc3-R_cK.d.ts} +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/{invoices-CWp9jcI2.d.ts → invoices-BXwG7Jwp.d.ts} +5 -0
- package/dist/{json-schema-CgwH39-G.js → json-schema-BveJfXoz.js} +1 -1
- package/dist/list/export/index.d.ts +1 -1
- package/dist/list/index.d.ts +1 -1
- package/dist/list/order/index.d.ts +2 -2
- package/dist/{list-query-qCpvTDGH.d.ts → list-query-CBjzZmjx.d.ts} +1 -1
- package/dist/{manifest-CD_ZA69x.d.ts → manifest-2JeNUq8t.d.ts} +1 -1
- package/dist/{manifest-9TRpR9P-.d.ts → manifest-3e0zfaQt.d.ts} +1 -1
- package/dist/{manifest-BXatXuLx.d.ts → manifest-3or1oZTo.d.ts} +1 -1
- package/dist/{manifest-mCn7RdZs.d.ts → manifest-AS4QwWdu.d.ts} +1 -1
- package/dist/{manifest-D02pP9Nl.d.ts → manifest-B1lYVfIp.d.ts} +1 -1
- package/dist/{manifest-dSiPcx5l.d.ts → manifest-B7xyFqWo.d.ts} +1 -1
- package/dist/{manifest-DF6GzdBC.d.ts → manifest-B9m_UaiY.d.ts} +1 -1
- package/dist/{manifest-BmGsyaxx.d.ts → manifest-B9qFGJ_A.d.ts} +1 -1
- package/dist/{manifest-CTEURHfF.d.ts → manifest-BSjzLeb-.d.ts} +1 -1
- package/dist/{manifest-BG2_hkzB.d.ts → manifest-BVn2Xglt.d.ts} +1 -1
- package/dist/{manifest-C1TwYhyr.d.ts → manifest-BWKFNoxP.d.ts} +1 -1
- package/dist/{manifest-DGrcTY4n.d.ts → manifest-BXWhDMFt.d.ts} +1 -1
- package/dist/{manifest-Cfrflbtt.d.ts → manifest-Bi44m1V3.d.ts} +1 -1
- package/dist/{manifest-Bsrn5gfq.d.ts → manifest-Bluupj7R.d.ts} +1 -1
- package/dist/{manifest-D32p1K-g.d.ts → manifest-Bo0SCigB.d.ts} +1 -1
- package/dist/{manifest-C3FjJnQT.d.ts → manifest-ByRLUGaJ.d.ts} +3 -3
- package/dist/{manifest-Cx_UVMlT.d.ts → manifest-C1--UMCz.d.ts} +1 -1
- package/dist/{manifest-BizfO8zf.d.ts → manifest-C20SXAzp.d.ts} +1 -1
- package/dist/{manifest-BKY6WHm6.d.ts → manifest-C40ISJVj.d.ts} +1 -1
- package/dist/{manifest-DBptC4dz.d.ts → manifest-C7KPtGTu.d.ts} +2 -2
- package/dist/{manifest-ChKRtAF6.d.ts → manifest-C82tY_RD.d.ts} +1 -1
- package/dist/{manifest-LAVlQXiw.d.ts → manifest-C94eugvl.d.ts} +1 -1
- package/dist/{manifest-tjlvcP1t.d.ts → manifest-CBdMkxZD.d.ts} +1 -1
- package/dist/{manifest-CxUI9ZXn.d.ts → manifest-CCPioFQl.d.ts} +1 -1
- package/dist/{manifest-BdV9GNAF.d.ts → manifest-CD5D0OWo.d.ts} +1 -1
- package/dist/{manifest-B91B3Yvk.d.ts → manifest-CGnN_2Yx.d.ts} +1 -1
- package/dist/{manifest-CpMVJWDU.d.ts → manifest-CH1MFzXN.d.ts} +1 -1
- package/dist/{manifest-BkJdR1D-.d.ts → manifest-CJRob2Ms.d.ts} +1 -1
- package/dist/{manifest-BdBaGzfE.d.ts → manifest-CgljOcHt.d.ts} +1 -1
- package/dist/{manifest-BSrdiUHP.d.ts → manifest-Ci7NEusH.d.ts} +1 -1
- package/dist/{manifest-gS-wx2yB.d.ts → manifest-CiXl1kUg.d.ts} +1 -1
- package/dist/{manifest-BNIvrs6_.d.ts → manifest-CjzIpyBP.d.ts} +2 -2
- package/dist/{manifest-B-wg2F2L.d.ts → manifest-ClDcyCPP.d.ts} +3 -3
- package/dist/{manifest-CIa0-uCj.d.ts → manifest-Co0CBReD.d.ts} +1 -1
- package/dist/{manifest-CPlmHPRY.d.ts → manifest-CpmJIEt7.d.ts} +1 -1
- package/dist/{manifest-DAv6iO-q.d.ts → manifest-Cqv6c1KN.d.ts} +1 -1
- package/dist/{manifest-BOxu_JMd.d.ts → manifest-CtUKrkx1.d.ts} +1 -1
- package/dist/{manifest-C7bh84U0.d.ts → manifest-D1FPczc-.d.ts} +1 -1
- package/dist/{manifest-VjVVI7bV.d.ts → manifest-D43yma-v.d.ts} +1 -1
- package/dist/{manifest-B7IYj4OA.d.ts → manifest-DAF4J0gk.d.ts} +1 -1
- package/dist/{manifest-BSSoVDlI.d.ts → manifest-DGoI006V.d.ts} +1 -1
- package/dist/{manifest-Ce_JDK4r.d.ts → manifest-DHN6WiIJ.d.ts} +1 -1
- package/dist/{manifest-C7CtYgWC.d.ts → manifest-DIl_cNua.d.ts} +1 -1
- package/dist/{manifest-BWE_47qq.d.ts → manifest-DJhjOnvk.d.ts} +1 -1
- package/dist/{manifest-Cn85_kP6.d.ts → manifest-DMhuQgOx.d.ts} +1 -1
- package/dist/{manifest-1P6OEAwH.d.ts → manifest-DQkz9UVy.d.ts} +1 -1
- package/dist/{manifest-Cz8poTZ2.d.ts → manifest-DUZUtWBi.d.ts} +1 -1
- package/dist/{manifest-BVwoT7GU.d.ts → manifest-DY2KtVcD.d.ts} +1 -1
- package/dist/{manifest-Dc_FWIrg.d.ts → manifest-DaB1w2xo.d.ts} +1 -1
- package/dist/{manifest-DZc_37YJ.d.ts → manifest-DpXgCZEd.d.ts} +1 -1
- package/dist/{manifest-BcqqAgm9.d.ts → manifest-Dqf2Uw17.d.ts} +1 -1
- package/dist/{manifest-D5aZyD1b.js → manifest-OxHBbWrs.js} +1 -1
- package/dist/{manifest-khfEDzX4.d.ts → manifest-Utivc7Qa.d.ts} +1 -1
- package/dist/{manifest-t9v09kRa.d.ts → manifest-WJ-UHuEx.d.ts} +1 -1
- package/dist/{manifest-BNCX3M2Y.d.ts → manifest-WpIMAJCT.d.ts} +1 -1
- package/dist/{manifest-Cle7S3sn.d.ts → manifest-at0NS8cT.d.ts} +1 -1
- package/dist/{manifest-D4iEPtlb.d.ts → manifest-d7vR6coE.d.ts} +2 -2
- package/dist/{manifest-BN2J8Zo7.d.ts → manifest-gl856Z9G.d.ts} +1 -1
- package/dist/{manifest-DcnVXlH7.d.ts → manifest-iGmnzfGD.d.ts} +1 -1
- package/dist/{manifest-BWFemJ6Q.d.ts → manifest-j4_V-qhA.d.ts} +1 -1
- package/dist/{manifest-blSYzmEZ.d.ts → manifest-mAxLRfeu.d.ts} +1 -1
- package/dist/{manifest-zEA2Tw_l.d.ts → manifest-mBKFNynL.d.ts} +1 -1
- package/dist/{manifest-SoNChfLL.d.ts → manifest-wPIH-Oo7.d.ts} +1 -1
- package/dist/{manifest-Djy3wcSo.js → manifest-waO9DHVc.js} +1 -0
- package/dist/mapper/bin.js +6 -6
- package/dist/mcp/index.d.ts +2 -2
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/sdk/index.d.ts +2 -2
- package/dist/mcp/sdk/index.js +1 -1
- package/dist/{mcp-CoJbu0Hk.js → mcp-mSD-ic9W.js} +3 -3
- package/dist/next/index.d.ts +12 -12
- package/dist/next/index.js +10 -5
- package/dist/next/proxy/index.d.ts +3 -3
- package/dist/{operations-nnC3pvwn.d.ts → operations-dIOdHqYz.d.ts} +1 -1
- package/dist/orpc/index.d.ts +4 -4
- package/dist/orpc/index.js +2 -2
- package/dist/otel/index.js +5 -5
- package/dist/{permissions-Ccvec0MR.d.ts → permissions-DG0t2lrA.d.ts} +1 -1
- package/dist/{ports-CfVACwW_.d.ts → ports-CfiOCL2r.d.ts} +1 -1
- package/dist/{ports-DfDzwMCR.js → ports-DR88RF0N.js} +2 -2
- package/dist/powersync/index.d.ts +3 -3
- package/dist/powersync/index.js +1 -1
- package/dist/preset/index.d.ts +4 -4
- package/dist/{preview-CR1nZ6-E.d.ts → preview-3nes4WG4.d.ts} +2 -2
- package/dist/{project-CxoixIpG.js → project-CXcoauzs.js} +2 -2
- package/dist/{push-token-Rv1CxW_N.d.ts → push-token-CRBieazN.d.ts} +1 -1
- package/dist/query/index.d.ts +1 -1
- package/dist/react/index.d.ts +5 -5
- package/dist/react/native/index.d.ts +1 -1
- package/dist/react/server.d.ts +6 -6
- package/dist/react-router/index.d.ts +3 -3
- package/dist/react-router/index.js +3 -3
- package/dist/{read-set-BptYceHc.js → read-set-DfScfSsf.js} +3 -2
- package/dist/realtime/index.d.ts +3 -3
- package/dist/{record-form-mpamIVq3.d.ts → record-form-BggNAKZA.d.ts} +1 -1
- package/dist/records/index.d.ts +7 -7
- package/dist/{resource-execute-Bb-zKYUc.d.ts → resource-execute-BIqAzA57.d.ts} +1 -1
- package/dist/{resource-types-C8kdoZ-J.d.ts → resource-types-DcEe07vC.d.ts} +1 -1
- package/dist/{resources-B9dfA1jH.d.ts → resources-Bb_JRadM.d.ts} +1 -1
- package/dist/{sales-D_yZoFUU.js → sales-CIe7dE4J.js} +1 -1
- package/dist/server/account/index.d.ts +2 -2
- package/dist/server/accounts/index.d.ts +1 -1
- package/dist/server/index.d.ts +12 -12
- package/dist/server/index.js +4 -4
- package/dist/{server-CqRpnOo0.js → server-DA5SRGHQ.js} +2 -2
- package/dist/{server-types-C8zErBy9.d.ts → server-types-Cp2en4rP.d.ts} +2 -2
- package/dist/{session-DRn_URq0.d.ts → session-Bro3jmnu.d.ts} +1 -1
- package/dist/{sign-in-CMEBFv36.d.ts → sign-in-Cj7Y0mSU.d.ts} +11 -11
- package/dist/solid/index.d.ts +6 -6
- package/dist/solid-start/index.d.ts +3 -3
- package/dist/solid-start/index.js +3 -3
- package/dist/spec/index.d.ts +1 -1
- package/dist/spec/index.js +2 -2
- package/dist/sql/index.d.ts +5 -5
- package/dist/sql/index.js +1 -1
- package/dist/{sql-ZLYXNvXw.js → sql-BwfPwN8v.js} +304 -95
- package/dist/sqlite/index.d.ts +1 -1
- package/dist/sqlite/index.js +1 -1
- package/dist/ssr/index.d.ts +1 -1
- package/dist/svelte/index.d.ts +6 -6
- package/dist/sveltekit/index.d.ts +4 -4
- package/dist/sveltekit/index.js +3 -3
- package/dist/{tags-Bh4zXrnl.d.ts → tags-C7NyJTdU.d.ts} +1 -1
- package/dist/tanstack-db/index.d.ts +1 -1
- package/dist/tanstack-start/index.d.ts +3 -3
- package/dist/tanstack-start/index.js +3 -3
- package/dist/{tenant-DpJTJr1c.d.ts → tenant-BFABaxQ5.d.ts} +1 -1
- package/dist/testing/index.d.ts +9 -9
- package/dist/testing/index.js +4 -4
- package/dist/{timeline-CGjiciIY.d.ts → timeline-0a7kclhg.d.ts} +3 -3
- package/dist/{topic-R7kIJ_xI.d.ts → topic-BH4L7H8n.d.ts} +2 -2
- package/dist/{types-BidEA6pZ.d.ts → types-BMLgTFzf.d.ts} +2 -2
- package/dist/{verify-BfcOHiUP.d.ts → verify-tK2F49Gn.d.ts} +1 -1
- package/dist/{version-DRVVrk-u.js → version-BHgdHcZN.js} +1 -1
- package/dist/vue/index.d.ts +6 -6
- package/dist/{watch-topic-D18gT7-K.d.ts → watch-topic-BYfSlldk.d.ts} +1 -1
- package/dist/webmcp/index.d.ts +1 -1
- package/dist/webmcp/index.js +1 -1
- package/dist/yjs/index.d.ts +1 -1
- package/package.json +1 -1
- package/schemas/config-v1.json +3 -0
- package/schemas/doctor-report-v1.json +2 -0
- package/dist/cli/add-DHvo6zQZ.js +0 -1
- package/dist/cli/powersync-DLUNuNl4.js +0 -1
- package/dist/cli/round-trips-D2KD5Hpq.js +0 -56
- package/dist/cli/seed-Dlm5jjPn.js +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { d as temporalText } from "./temporal-VgABWvpY.js";
|
|
2
|
-
import { a as hasPlaceholder, f as isFunctionSpec, l as splitPlaceholders, r as containsPlaceholder, s as placeholderOf } from "./read-set-
|
|
2
|
+
import { a as hasPlaceholder, f as isFunctionSpec, l as splitPlaceholders, r as containsPlaceholder, s as placeholderOf } from "./read-set-DfScfSsf.js";
|
|
3
3
|
import { a as ok } from "./result-DijoXEFG.js";
|
|
4
4
|
import { n as isRecord$1, t as isList } from "./guards-CsRa6v57.js";
|
|
5
5
|
import { t as SPEC_PINS } from "./spec-pins-Dlz8OVqi.js";
|
|
6
|
-
import { _ as CONFIG_DEFAULTS, d as blockColumnName, f as checkTenantEntry, g as resolveJsonSchema, h as clientFunctions, l as installedBlockSubjects, m as resolveNames, n as checkFormerPermissionKeys, p as entityType, r as renames } from "./former-permission-keys-
|
|
6
|
+
import { _ as CONFIG_DEFAULTS, d as blockColumnName, f as checkTenantEntry, g as resolveJsonSchema, h as clientFunctions, l as installedBlockSubjects, m as resolveNames, n as checkFormerPermissionKeys, p as entityType, r as renames } from "./former-permission-keys-D8FbWktT.js";
|
|
7
7
|
import { t as DEFAULT_CLAIMS } from "./claims-CX-ar1vt.js";
|
|
8
8
|
import { o as tenantNames, r as composeNames } from "./entity-naming-CUsC8bC1.js";
|
|
9
9
|
import { B as resolveBlock, C as columnsWithAccess, E as hiddenColumns, I as PRESET_CATALOG, L as BLOCK_SCOPES, N as createdFromLink, P as link, S as hasComputed, T as hasColumnAccess, V as tenantNameOf, a as isRenamedInstance, g as appTableVersions, i as instancePrefix, l as APP_RANK_COLUMN, m as appTableEventKinds, s as APP_DELETED_AT_COLUMN, w as encryptedColumns, y as lookupColumn } from "./instances-07Lopbd1.js";
|
|
@@ -167,7 +167,7 @@ import { n as WARRANTY_STATUSES } from "./warranty-values-BJo_g1F1.js";
|
|
|
167
167
|
import { n as WORKFLOW_SDK_WORLD } from "./workflow-sdk-c025kSHf.js";
|
|
168
168
|
import { s as permissionMatches$1 } from "./delegation-CnCIKysL.js";
|
|
169
169
|
import { n as quoteIdent, t as compileSql } from "./sql-DqCwJ2qB.js";
|
|
170
|
-
import { t as provideConnectionRuntime } from "./define-runtime-full-
|
|
170
|
+
import { t as provideConnectionRuntime } from "./define-runtime-full-DeuaXsV7.js";
|
|
171
171
|
// src/sql/api-schema.ts
|
|
172
172
|
/** The roles PostgREST runs a request as. */
|
|
173
173
|
const API_ROLES = /* @__PURE__ */ new Set([
|
|
@@ -24494,6 +24494,35 @@ end;
|
|
|
24494
24494
|
$$;
|
|
24495
24495
|
${userGrant(`${fn("get_approval")}(uuid)`)}
|
|
24496
24496
|
|
|
24497
|
+
-- Many requests with their decisions and items in one read, in the order
|
|
24498
|
+
-- requested. A request that is missing or that the caller cannot read is left
|
|
24499
|
+
-- out instead of failing the batch.
|
|
24500
|
+
create or replace function ${fn("get_approvals")}(request_ids uuid[])
|
|
24501
|
+
returns jsonb
|
|
24502
|
+
language plpgsql
|
|
24503
|
+
stable
|
|
24504
|
+
security definer
|
|
24505
|
+
set search_path = ''
|
|
24506
|
+
as $$
|
|
24507
|
+
begin
|
|
24508
|
+
return (
|
|
24509
|
+
select coalesce(jsonb_agg(${json("r")} || jsonb_build_object(
|
|
24510
|
+
'canDecide', ${fn("approval_eligible")}(r.${c("id")}),
|
|
24511
|
+
'decisions', coalesce((
|
|
24512
|
+
select jsonb_agg(jsonb_build_object('id', x.${d("id")}, 'step', x.${d("step")}, 'approver', x.${d("approver")}, 'decision', x.${d("decision")}, 'delegateTo', ${or("decisions", "x", "delegateTo")}, 'comment', ${or("decisions", "x", "comment")}, 'createdAt', x.${d("createdAt")}) order by x.${d("createdAt")}, x.${d("id")})
|
|
24513
|
+
from ${decisions} x where x.${d("request")} = r.${c("id")}
|
|
24514
|
+
), '[]'::jsonb),
|
|
24515
|
+
'items', ${itemsOf$1(ctx, `r.${c("id")}`)}
|
|
24516
|
+
) order by array_position(get_approvals.request_ids, r.${c("id")})), '[]'::jsonb)
|
|
24517
|
+
from ${requests} r
|
|
24518
|
+
where r.${c("id")} = any (get_approvals.request_ids)
|
|
24519
|
+
and (${SERVICE_CALLER$1} or coalesce(r.${c("requestedBy")} = auth.uid(), false) or ${fn("approval_eligible")}(r.${c("id")})
|
|
24520
|
+
or (${ctx.can("tenant", `r.${c("tenant")}`, read)} and ${readable("r")}))
|
|
24521
|
+
);
|
|
24522
|
+
end;
|
|
24523
|
+
$$;
|
|
24524
|
+
${userGrant(`${fn("get_approvals")}(uuid[])`)}
|
|
24525
|
+
|
|
24497
24526
|
-- assigned: only requests whose current step the caller can decide.
|
|
24498
24527
|
create or replace function ${fn("list_approvals")}(tenant ${ctx.idType}, status text default 'pending', assigned boolean default false, subject_type text default null, subject_id text default null, page_size integer default 50, before timestamptz default null)
|
|
24499
24528
|
returns jsonb
|
|
@@ -71653,6 +71682,37 @@ const COLLECTIONS$1 = {
|
|
|
71653
71682
|
contract: contract$103,
|
|
71654
71683
|
build: build$117
|
|
71655
71684
|
};
|
|
71685
|
+
// src/sql/modules/comments-mention-groups.ts
|
|
71686
|
+
const MENTION_GROUP_KEYS = /* @__PURE__ */ new Set([
|
|
71687
|
+
"table",
|
|
71688
|
+
"group",
|
|
71689
|
+
"member",
|
|
71690
|
+
"tenant"
|
|
71691
|
+
]);
|
|
71692
|
+
function mentionGroupsOf(ctx) {
|
|
71693
|
+
const option = ctx.option("mentionGroups");
|
|
71694
|
+
if (option === void 0) return;
|
|
71695
|
+
const where = "blocks.comments.options.mentionGroups";
|
|
71696
|
+
if (!isRecord$1(option)) throw new TypeError(`${where} must be { table, group, member, tenant? }`);
|
|
71697
|
+
for (const key of Object.keys(option)) if (!MENTION_GROUP_KEYS.has(key)) throw new TypeError(`${where}.${key} is not an option. Options: table, group, member, tenant`);
|
|
71698
|
+
const text = (key) => {
|
|
71699
|
+
const value = option[key];
|
|
71700
|
+
if (value === void 0) return;
|
|
71701
|
+
if (typeof value !== "string" || value.length === 0) throw new TypeError(`${where}.${key} must be a non-empty string`);
|
|
71702
|
+
return value;
|
|
71703
|
+
};
|
|
71704
|
+
const table = text("table");
|
|
71705
|
+
const group = text("group");
|
|
71706
|
+
const member = text("member");
|
|
71707
|
+
if (table === void 0 || group === void 0 || member === void 0) throw new TypeError(`${where} needs table, group and member`);
|
|
71708
|
+
const tenant = text("tenant");
|
|
71709
|
+
return {
|
|
71710
|
+
table,
|
|
71711
|
+
group,
|
|
71712
|
+
member,
|
|
71713
|
+
...tenant !== void 0 && { tenant }
|
|
71714
|
+
};
|
|
71715
|
+
}
|
|
71656
71716
|
// src/sql/modules/messaging-tables.ts
|
|
71657
71717
|
const MESSAGE_RESERVED = ["fields"];
|
|
71658
71718
|
/** The longest thread summary `save_thread_summary` stores. */
|
|
@@ -71697,9 +71757,14 @@ function guestOnRecord(q, alias, action) {
|
|
|
71697
71757
|
return guest === "false" ? "" : `
|
|
71698
71758
|
or (${alias}.${cv("kind")} = 'subject' and ${guest})`;
|
|
71699
71759
|
}
|
|
71700
|
-
/**
|
|
71701
|
-
|
|
71702
|
-
|
|
71760
|
+
/**
|
|
71761
|
+
* With the inbox: a note shows to the inbox's staff only. `alias` qualifies the
|
|
71762
|
+
* message's columns.
|
|
71763
|
+
*/
|
|
71764
|
+
function noteReadable(q, alias) {
|
|
71765
|
+
const ms = q.cols("messages");
|
|
71766
|
+
const at = alias === void 0 ? "" : `${alias}.`;
|
|
71767
|
+
return q.ctx.installed("inbox") ? `\n and (${at}${ms("kind")} = 'message' or ${q.ctx.of("inbox").fn("inbox_note_readable")}(${at}${ms("conversation")}))` : "";
|
|
71703
71768
|
}
|
|
71704
71769
|
function tableDdl(q) {
|
|
71705
71770
|
const { ctx, t, id } = q;
|
|
@@ -71913,7 +71978,7 @@ ${renderPolicy(policy$1({
|
|
|
71913
71978
|
command: "select",
|
|
71914
71979
|
roles: ["authenticated"],
|
|
71915
71980
|
using: `(${ms("sentAt")} is not null or ${ms("author")} = (select auth.uid()))
|
|
71916
|
-
and exists (select 1 from ${t("conversations")} c where c.${cv("id")} = ${ms("conversation")})${noteReadable(q
|
|
71981
|
+
and exists (select 1 from ${t("conversations")} c where c.${cv("id")} = ${ms("conversation")})${noteReadable(q)}`
|
|
71917
71982
|
}), { target: t("messages") })}
|
|
71918
71983
|
|
|
71919
71984
|
${ddl.edits}
|
|
@@ -72167,36 +72232,6 @@ const NAMES$113 = {
|
|
|
72167
72232
|
};
|
|
72168
72233
|
/** Sorts after every uuid, so `after` without `after_id` means strictly later. */
|
|
72169
72234
|
const MAX_UUID$1 = "'ffffffff-ffff-ffff-ffff-ffffffffffff'::uuid";
|
|
72170
|
-
const MENTION_GROUP_KEYS = /* @__PURE__ */ new Set([
|
|
72171
|
-
"table",
|
|
72172
|
-
"group",
|
|
72173
|
-
"member",
|
|
72174
|
-
"tenant"
|
|
72175
|
-
]);
|
|
72176
|
-
function mentionGroupsOf(ctx) {
|
|
72177
|
-
const option = ctx.option("mentionGroups");
|
|
72178
|
-
if (option === void 0) return;
|
|
72179
|
-
const where = "blocks.comments.options.mentionGroups";
|
|
72180
|
-
if (!isRecord$1(option)) throw new TypeError(`${where} must be { table, group, member, tenant? }`);
|
|
72181
|
-
for (const key of Object.keys(option)) if (!MENTION_GROUP_KEYS.has(key)) throw new TypeError(`${where}.${key} is not an option. Options: table, group, member, tenant`);
|
|
72182
|
-
const text = (key) => {
|
|
72183
|
-
const value = option[key];
|
|
72184
|
-
if (value === void 0) return;
|
|
72185
|
-
if (typeof value !== "string" || value.length === 0) throw new TypeError(`${where}.${key} must be a non-empty string`);
|
|
72186
|
-
return value;
|
|
72187
|
-
};
|
|
72188
|
-
const table = text("table");
|
|
72189
|
-
const group = text("group");
|
|
72190
|
-
const member = text("member");
|
|
72191
|
-
if (table === void 0 || group === void 0 || member === void 0) throw new TypeError(`${where} needs table, group and member`);
|
|
72192
|
-
const tenant = text("tenant");
|
|
72193
|
-
return {
|
|
72194
|
-
table,
|
|
72195
|
-
group,
|
|
72196
|
-
member,
|
|
72197
|
-
...tenant !== void 0 && { tenant }
|
|
72198
|
-
};
|
|
72199
|
-
}
|
|
72200
72235
|
/** A column name as a JSON key of `to_jsonb(row)`. */
|
|
72201
72236
|
const key = (column) => sqlString(column.replaceAll("\"", ""));
|
|
72202
72237
|
/**
|
|
@@ -72323,7 +72358,7 @@ end;
|
|
|
72323
72358
|
$$;
|
|
72324
72359
|
${userGrant(`${fn("assign_comment")}(uuid, uuid, jsonb)`)}`;
|
|
72325
72360
|
}
|
|
72326
|
-
function build$116(ctx) {
|
|
72361
|
+
function build$116(ctx, layout) {
|
|
72327
72362
|
if (ctx.mode === "custom") return "";
|
|
72328
72363
|
const id = ctx.idType;
|
|
72329
72364
|
const m = ctx.of("messaging");
|
|
@@ -72338,6 +72373,39 @@ function build$116(ctx) {
|
|
|
72338
72373
|
const expand = groups === void 0 ? "select x from unnest(v_raw) x" : `select x from unnest(v_raw) x
|
|
72339
72374
|
union select g.${sqlIdent$1(groups.member)} from ${quotedTable(groups.table)} g where g.${sqlIdent$1(groups.group)} = any (v_raw)${groups.tenant === void 0 ? "" : ` and g.${sqlIdent$1(groups.tenant)} = create_comment.tenant`}`;
|
|
72340
72375
|
const sent = afterSend(ctx);
|
|
72376
|
+
const mq = messagingSql(m, layout.accessProvider);
|
|
72377
|
+
const pageIds = (conversation, f, notes) => `array(
|
|
72378
|
+
select x.${ms("id")} from ${m.table("messages")} x
|
|
72379
|
+
where x.${ms("conversation")} = ${conversation} and x.${ms("sentAt")} is not null${notes}
|
|
72380
|
+
and (coalesce(${f}.include_deleted, true) or x.${ms("deletedAt")} is null)
|
|
72381
|
+
and (${f}.after is null
|
|
72382
|
+
or (x.${ms("sentAt")}, x.${ms("id")}) > (${f}.after, coalesce(${f}.after_id, ${MAX_UUID$1})))
|
|
72383
|
+
order by x.${ms("sentAt")}, x.${ms("id")}
|
|
72384
|
+
limit ${pageSize(`${f}.max_rows`, 100, 500)}
|
|
72385
|
+
offset greatest(coalesce(${f}.skip, 0), 0)
|
|
72386
|
+
)`;
|
|
72387
|
+
const commentsOf = (messagesJson, ids) => `(
|
|
72388
|
+
with e as materialized (
|
|
72389
|
+
select x.row, x.n from jsonb_array_elements(${messagesJson}(${ids})) with ordinality x(row, n)
|
|
72390
|
+
),
|
|
72391
|
+
c as materialized (
|
|
72392
|
+
select c.${cv("id")} as id, c.${cv("subjectType")} as subject_type, c.${cv("subjectId")} as subject_id
|
|
72393
|
+
from ${m.table("conversations")} c
|
|
72394
|
+
where c.${cv("id")} = any (array(select distinct (e.row ->> ${key(ms("conversation"))})::uuid from e))
|
|
72395
|
+
),
|
|
72396
|
+
t as materialized (
|
|
72397
|
+
select t.${k("message")} as message, t.${k("task")} as task from ${tasks} t
|
|
72398
|
+
where t.${k("message")} = any (${ids})
|
|
72399
|
+
)
|
|
72400
|
+
select coalesce(jsonb_agg(e.row || jsonb_build_object(
|
|
72401
|
+
'subject_type', c.subject_type,
|
|
72402
|
+
'subject_id', c.subject_id,
|
|
72403
|
+
'task_id', t.task
|
|
72404
|
+
) order by e.n), '[]'::jsonb)
|
|
72405
|
+
from e
|
|
72406
|
+
join c on c.id = (e.row ->> ${key(ms("conversation"))})::uuid
|
|
72407
|
+
left join t on t.message = (e.row ->> ${key(ms("id"))})::uuid
|
|
72408
|
+
)`;
|
|
72341
72409
|
return `${schemaPreamble(ctx)}
|
|
72342
72410
|
-- Comments are a record's conversation (kind subject) on the messaging core:
|
|
72343
72411
|
-- whoever reads the record reads its comments. These functions open it,
|
|
@@ -72425,32 +72493,40 @@ security invoker
|
|
|
72425
72493
|
set search_path = ''
|
|
72426
72494
|
as $$
|
|
72427
72495
|
begin
|
|
72428
|
-
return (
|
|
72429
|
-
with e as materialized (
|
|
72430
|
-
select x.row, x.n from jsonb_array_elements(${m.fn("messaging_messages_json")}(comments_json.ids)) with ordinality x(row, n)
|
|
72431
|
-
),
|
|
72432
|
-
c as materialized (
|
|
72433
|
-
select c.${cv("id")} as id, c.${cv("subjectType")} as subject_type, c.${cv("subjectId")} as subject_id
|
|
72434
|
-
from ${m.table("conversations")} c
|
|
72435
|
-
where c.${cv("id")} = any (array(select distinct (e.row ->> ${key(ms("conversation"))})::uuid from e))
|
|
72436
|
-
),
|
|
72437
|
-
t as materialized (
|
|
72438
|
-
select t.${k("message")} as message, t.${k("task")} as task from ${tasks} t
|
|
72439
|
-
where t.${k("message")} = any (comments_json.ids)
|
|
72440
|
-
)
|
|
72441
|
-
select coalesce(jsonb_agg(e.row || jsonb_build_object(
|
|
72442
|
-
'subject_type', c.subject_type,
|
|
72443
|
-
'subject_id', c.subject_id,
|
|
72444
|
-
'task_id', t.task
|
|
72445
|
-
) order by e.n), '[]'::jsonb)
|
|
72446
|
-
from e
|
|
72447
|
-
join c on c.id = (e.row ->> ${key(ms("conversation"))})::uuid
|
|
72448
|
-
left join t on t.message = (e.row ->> ${key(ms("id"))})::uuid
|
|
72449
|
-
);
|
|
72496
|
+
return ${commentsOf(m.fn("messaging_messages_json"), "comments_json.ids")};
|
|
72450
72497
|
end;
|
|
72451
72498
|
$$;
|
|
72452
72499
|
${userGrant(`${fn("comments_json")}(uuid[])`)}
|
|
72453
72500
|
|
|
72501
|
+
-- A page of a record conversation's sent comment ids, as their owner, once
|
|
72502
|
+
-- the conversation passes the read check.
|
|
72503
|
+
create or replace function ${fn("comment_page")}(
|
|
72504
|
+
conversation uuid,
|
|
72505
|
+
after timestamptz default null,
|
|
72506
|
+
max_rows integer default 100,
|
|
72507
|
+
skip integer default 0,
|
|
72508
|
+
after_id uuid default null,
|
|
72509
|
+
include_deleted boolean default true
|
|
72510
|
+
)
|
|
72511
|
+
returns uuid[]
|
|
72512
|
+
language plpgsql
|
|
72513
|
+
stable
|
|
72514
|
+
security definer
|
|
72515
|
+
set search_path = ''
|
|
72516
|
+
as $$
|
|
72517
|
+
begin
|
|
72518
|
+
if not exists (
|
|
72519
|
+
select 1 from ${m.table("conversations")} c
|
|
72520
|
+
where c.${cv("id")} = comment_page.conversation and c.${cv("kind")} = 'subject'
|
|
72521
|
+
and (${SERVICE_CALLER$1} or ${conversationReadable(mq, "c")})
|
|
72522
|
+
) then
|
|
72523
|
+
return '{}'::uuid[];
|
|
72524
|
+
end if;
|
|
72525
|
+
return ${pageIds("comment_page.conversation", "comment_page", noteReadable(mq, "x"))};
|
|
72526
|
+
end;
|
|
72527
|
+
$$;
|
|
72528
|
+
${userGrant(`${fn("comment_page")}(uuid, timestamptz, integer, integer, uuid, boolean)`)}
|
|
72529
|
+
|
|
72454
72530
|
-- One comment the caller reads, or null.
|
|
72455
72531
|
create or replace function ${fn("get_comment")}(message uuid)
|
|
72456
72532
|
returns jsonb
|
|
@@ -72547,20 +72623,46 @@ begin
|
|
|
72547
72623
|
if v_conv is null then
|
|
72548
72624
|
return '[]'::jsonb;
|
|
72549
72625
|
end if;${readLine(ctx.read("list_comments.subject_type", "list_comments.subject_id", "list_comments"))}
|
|
72550
|
-
return ${fn("comments_json")}(
|
|
72551
|
-
select x.${ms("id")} from ${m.table("messages")} x
|
|
72552
|
-
where x.${ms("conversation")} = v_conv and x.${ms("sentAt")} is not null
|
|
72553
|
-
and (coalesce(list_comments.include_deleted, true) or x.${ms("deletedAt")} is null)
|
|
72554
|
-
and (list_comments.after is null
|
|
72555
|
-
or (x.${ms("sentAt")}, x.${ms("id")}) > (list_comments.after, coalesce(list_comments.after_id, ${MAX_UUID$1})))
|
|
72556
|
-
order by x.${ms("sentAt")}, x.${ms("id")}
|
|
72557
|
-
limit ${pageSize("list_comments.max_rows", 100, 500)}
|
|
72558
|
-
offset greatest(coalesce(list_comments.skip, 0), 0)
|
|
72559
|
-
));
|
|
72626
|
+
return ${fn("comments_json")}(${fn("comment_page")}(v_conv, list_comments.after, list_comments.max_rows, list_comments.skip, list_comments.after_id, list_comments.include_deleted));
|
|
72560
72627
|
end;
|
|
72561
72628
|
$$;
|
|
72562
72629
|
${userGrant(`${fn("list_comments")}(${id}, text, text, timestamptz, integer, integer, uuid, boolean)`)}
|
|
72563
72630
|
|
|
72631
|
+
-- list_comments without any check, as the owner. Only for the app's own
|
|
72632
|
+
-- security definer function after it checked that the caller reads the
|
|
72633
|
+
-- record and holds the comment read key in its tenant. Service role only.
|
|
72634
|
+
create or replace function ${fn("list_comments_unchecked")}(
|
|
72635
|
+
tenant ${id},
|
|
72636
|
+
subject_type text,
|
|
72637
|
+
subject_id text,
|
|
72638
|
+
after timestamptz default null,
|
|
72639
|
+
max_rows integer default 100,
|
|
72640
|
+
skip integer default 0,
|
|
72641
|
+
after_id uuid default null,
|
|
72642
|
+
include_deleted boolean default true
|
|
72643
|
+
)
|
|
72644
|
+
returns jsonb
|
|
72645
|
+
language plpgsql
|
|
72646
|
+
${ctx.readVolatility()}
|
|
72647
|
+
security definer
|
|
72648
|
+
set search_path = ''
|
|
72649
|
+
as $$
|
|
72650
|
+
declare
|
|
72651
|
+
v_conv uuid;
|
|
72652
|
+
v_ids uuid[];
|
|
72653
|
+
begin
|
|
72654
|
+
select c.${cv("id")} into v_conv from ${m.table("conversations")} c
|
|
72655
|
+
where c.${cv("tenant")} = list_comments_unchecked.tenant and c.${cv("kind")} = 'subject'
|
|
72656
|
+
and c.${cv("subjectType")} = list_comments_unchecked.subject_type and c.${cv("subjectId")} = list_comments_unchecked.subject_id;
|
|
72657
|
+
if v_conv is null then
|
|
72658
|
+
return '[]'::jsonb;
|
|
72659
|
+
end if;${readLine(ctx.read("list_comments_unchecked.subject_type", "list_comments_unchecked.subject_id", "list_comments_unchecked"))}
|
|
72660
|
+
v_ids := ${pageIds("v_conv", "list_comments_unchecked", "")};
|
|
72661
|
+
return ${commentsOf(m.fn("messaging_messages_json_unchecked"), "v_ids")};
|
|
72662
|
+
end;
|
|
72663
|
+
$$;
|
|
72664
|
+
${serviceGrant(`${fn("list_comments_unchecked")}(${id}, text, text, timestamptz, integer, integer, uuid, boolean)`)}
|
|
72665
|
+
|
|
72564
72666
|
-- The top-level comments anchored to a file, oldest first: on its pages,
|
|
72565
72667
|
-- regions and moments, on any record the caller can read.
|
|
72566
72668
|
create or replace function ${fn("list_file_comments")}(attachment uuid, max_rows integer default 100)
|
|
@@ -72584,8 +72686,32 @@ end;
|
|
|
72584
72686
|
$$;
|
|
72585
72687
|
${userGrant(`${fn("list_file_comments")}(uuid, integer)`)}
|
|
72586
72688
|
|
|
72689
|
+
-- The number of sent, not deleted comments per conversation, as their
|
|
72690
|
+
-- owner, for the conversations of the list that pass the read check.
|
|
72691
|
+
create or replace function ${fn("comment_count_rows")}(conversations uuid[])
|
|
72692
|
+
returns table (id uuid, n bigint)
|
|
72693
|
+
language plpgsql
|
|
72694
|
+
stable
|
|
72695
|
+
security definer
|
|
72696
|
+
set search_path = ''
|
|
72697
|
+
as $$
|
|
72698
|
+
begin
|
|
72699
|
+
return query
|
|
72700
|
+
select x.${ms("conversation")}, count(*) from ${m.table("messages")} x
|
|
72701
|
+
where x.${ms("conversation")} = any (array(
|
|
72702
|
+
select c.${cv("id")} from ${m.table("conversations")} c
|
|
72703
|
+
where c.${cv("id")} = any (comment_count_rows.conversations) and c.${cv("kind")} = 'subject'
|
|
72704
|
+
and (${SERVICE_CALLER$1} or ${conversationReadable(mq, "c")})
|
|
72705
|
+
))
|
|
72706
|
+
and x.${ms("sentAt")} is not null and x.${ms("deletedAt")} is null${noteReadable(mq, "x")}
|
|
72707
|
+
group by x.${ms("conversation")};
|
|
72708
|
+
end;
|
|
72709
|
+
$$;
|
|
72710
|
+
${userGrant(`${fn("comment_count_rows")}(uuid[])`)}
|
|
72711
|
+
|
|
72587
72712
|
-- Comments per record the caller can read, for counters in a list:
|
|
72588
|
-
-- { subject_id: count }, deleted ones left out.
|
|
72713
|
+
-- { subject_id: count }, deleted ones left out. The records' conversations
|
|
72714
|
+
-- are read under the caller's policies, then counted by key.
|
|
72589
72715
|
create or replace function ${fn("comment_counts")}(tenant ${id}, subject_type text, subject_ids text[])
|
|
72590
72716
|
returns jsonb
|
|
72591
72717
|
language plpgsql
|
|
@@ -72595,17 +72721,16 @@ set search_path = ''
|
|
|
72595
72721
|
as $$
|
|
72596
72722
|
begin
|
|
72597
72723
|
return (
|
|
72598
|
-
|
|
72599
|
-
|
|
72600
|
-
select c.${cv("subjectId")} as subject_id, count(*) as n
|
|
72724
|
+
with c as materialized (
|
|
72725
|
+
select c.${cv("id")} as id, c.${cv("subjectId")} as subject_id
|
|
72601
72726
|
from ${m.table("conversations")} c
|
|
72602
|
-
join ${m.table("messages")} x on x.${ms("conversation")} = c.${cv("id")}
|
|
72603
72727
|
where c.${cv("tenant")} = comment_counts.tenant and c.${cv("kind")} = 'subject'
|
|
72604
72728
|
and c.${cv("subjectType")} = comment_counts.subject_type
|
|
72605
72729
|
and c.${cv("subjectId")} = any (comment_counts.subject_ids)
|
|
72606
|
-
|
|
72607
|
-
|
|
72608
|
-
|
|
72730
|
+
)
|
|
72731
|
+
select coalesce(jsonb_object_agg(c.subject_id, n.n), '{}'::jsonb)
|
|
72732
|
+
from c
|
|
72733
|
+
join ${fn("comment_count_rows")}(array(select c.id from c)) n on n.id = c.id
|
|
72609
72734
|
);
|
|
72610
72735
|
end;
|
|
72611
72736
|
$$;
|
|
@@ -72794,7 +72919,10 @@ const COMMENTS = {
|
|
|
72794
72919
|
internal: [
|
|
72795
72920
|
"comment_message_readable",
|
|
72796
72921
|
"comments_json",
|
|
72797
|
-
"comment_sent"
|
|
72922
|
+
"comment_sent",
|
|
72923
|
+
"comment_page",
|
|
72924
|
+
"comment_count_rows",
|
|
72925
|
+
"list_comments_unchecked"
|
|
72798
72926
|
],
|
|
72799
72927
|
name: "comments",
|
|
72800
72928
|
scopes: ["tenant"],
|
|
@@ -140457,6 +140585,25 @@ end;
|
|
|
140457
140585
|
$$;
|
|
140458
140586
|
${userGrant(`${fn("purchase_invoice_approval_status")}(uuid)`)}
|
|
140459
140587
|
|
|
140588
|
+
-- The approval of many purchase invoices in one read, keyed by invoice id. An
|
|
140589
|
+
-- invoice the caller cannot read has no key.
|
|
140590
|
+
create or replace function ${fn("purchase_invoice_approval_statuses")}(invoice_ids uuid[])
|
|
140591
|
+
returns jsonb
|
|
140592
|
+
language plpgsql
|
|
140593
|
+
stable
|
|
140594
|
+
security definer
|
|
140595
|
+
set search_path = ''
|
|
140596
|
+
as $$
|
|
140597
|
+
begin
|
|
140598
|
+
return (
|
|
140599
|
+
select coalesce(jsonb_object_agg(x.${i("id")}, ${fn("invoice_approval_state")}(x.${i("id")})), '{}'::jsonb)
|
|
140600
|
+
from ${t("invoices")} x
|
|
140601
|
+
where x.${i("id")} = any (purchase_invoice_approval_statuses.invoice_ids) and ${h.can("x", n.read)}
|
|
140602
|
+
);
|
|
140603
|
+
end;
|
|
140604
|
+
$$;
|
|
140605
|
+
${userGrant(`${fn("purchase_invoice_approval_statuses")}(uuid[])`)}
|
|
140606
|
+
|
|
140460
140607
|
-- Approves a purchase bill at every pending level the caller is the approver
|
|
140461
140608
|
-- of; the service role approves the lowest pending level for its approver.
|
|
140462
140609
|
-- Needs invoices.approve and an open bill. Returns the bill with its approval.
|
|
@@ -140538,6 +140685,11 @@ function approvalContract(ctx) {
|
|
|
140538
140685
|
args: ["uuid"],
|
|
140539
140686
|
returns: "jsonb"
|
|
140540
140687
|
},
|
|
140688
|
+
{
|
|
140689
|
+
name: "purchase_invoice_approval_statuses",
|
|
140690
|
+
args: ["uuid[]"],
|
|
140691
|
+
returns: "jsonb"
|
|
140692
|
+
},
|
|
140541
140693
|
{
|
|
140542
140694
|
name: "approve_purchase_invoice",
|
|
140543
140695
|
args: ["uuid", "text"],
|
|
@@ -160945,20 +161097,20 @@ function messagesJson(q) {
|
|
|
160945
161097
|
const at = ctx.of("attachments");
|
|
160946
161098
|
const a = (column) => at.col("attachments", column);
|
|
160947
161099
|
return `,
|
|
160948
|
-
f as (
|
|
161100
|
+
f as materialized (
|
|
160949
161101
|
select coalesce(jsonb_object_agg(g.id, g.files), '{}'::jsonb) as files
|
|
160950
161102
|
from (
|
|
160951
161103
|
select a.${a("subjectId")} as id, jsonb_agg(jsonb_build_object('id', a.${a("id")}, 'name', a.${a("name")}, 'mimeType', a.${a("mimeType")}, 'size', a.${a("size")}, 'status', a.${a("status")}) order by a.${a("createdAt")}, a.${a("id")}) as files
|
|
160952
161104
|
from ${at.table("attachments")} a
|
|
160953
161105
|
where a.${a("subjectType")} = ${message}
|
|
160954
|
-
and a.${a("subjectId")} = any (array(select x::text from
|
|
161106
|
+
and a.${a("subjectId")} = any (array(select x.${ms("id")}::text from page_rows x))
|
|
160955
161107
|
and a.${a("status")} <> 'infected'
|
|
160956
161108
|
group by a.${a("subjectId")}
|
|
160957
161109
|
) g
|
|
160958
161110
|
)`;
|
|
160959
161111
|
})() : "";
|
|
160960
161112
|
const reactions = ctx.installed("reactions") ? `,
|
|
160961
|
-
r as (
|
|
161113
|
+
r as materialized (
|
|
160962
161114
|
select coalesce(jsonb_object_agg(g.tenant, ${ctx.of("reactions").fn("reaction_summary")}(g.tenant, ${message}, g.ids)), '{}'::jsonb) as reactions
|
|
160963
161115
|
from (
|
|
160964
161116
|
select m.${ms("tenant")} as tenant, array_agg(m.${ms("id")}::text) as ids from page_rows m group by m.${ms("tenant")}
|
|
@@ -160976,10 +161128,38 @@ function messagesJson(q) {
|
|
|
160976
161128
|
...files ? ["f"] : [],
|
|
160977
161129
|
...reactions ? ["r"] : []
|
|
160978
161130
|
].join(", ");
|
|
161131
|
+
const cv = q.cols("conversations");
|
|
161132
|
+
const select = (rows, ids) => ` with ${rows}${authors ? `,\n a as materialized (select ${authors.call(ids)} as authors)` : ""}${files}${reactions}
|
|
161133
|
+
select coalesce(jsonb_agg(${json} order by coalesce(x.${ms("sentAt")}, ${ctx.has("messages", "scheduledFor") ? `x.${ms("scheduledFor")}, ` : ""}x.${ms("createdAt")}), x.${ms("id")}), '[]'::jsonb)
|
|
161134
|
+
from ${from}`;
|
|
160979
161135
|
return `${authors?.sql ?? ""}
|
|
160980
161136
|
|
|
161137
|
+
-- The messages of ids the caller may read, as their owner: each distinct
|
|
161138
|
+
-- conversation of ids is checked once, so a read never weighs every
|
|
161139
|
+
-- conversation the caller can see. A sent message shows to the
|
|
161140
|
+
-- conversation's readers, an unsent one to its author.
|
|
161141
|
+
create or replace function ${fn("messaging_message_rows")}(ids uuid[])
|
|
161142
|
+
returns setof ${t("messages")}
|
|
161143
|
+
language sql
|
|
161144
|
+
stable
|
|
161145
|
+
security definer
|
|
161146
|
+
set search_path = ''
|
|
161147
|
+
as $$
|
|
161148
|
+
select m.* from ${t("messages")} m
|
|
161149
|
+
where m.${ms("id")} = any (messaging_message_rows.ids)
|
|
161150
|
+
and m.${ms("conversation")} = any (array(
|
|
161151
|
+
select c.${cv("id")} from ${t("conversations")} c
|
|
161152
|
+
where c.${cv("id")} = any (array(select distinct v.${ms("conversation")} from ${t("messages")} v where v.${ms("id")} = any (messaging_message_rows.ids)))
|
|
161153
|
+
and (${q.service} or ${conversationReadable(q, "c")})
|
|
161154
|
+
))
|
|
161155
|
+
and (${q.service} or ((m.${ms("sentAt")} is not null or m.${ms("author")} = (select auth.uid()))${noteReadable(q, "m")}))
|
|
161156
|
+
$$;
|
|
161157
|
+
${userGrant(`${fn("messaging_message_rows")}(uuid[])`)}
|
|
161158
|
+
|
|
160981
161159
|
-- The messages of ids the caller may read, oldest first, each with its
|
|
160982
|
-
-- author, files and reactions when those modules are installed.
|
|
161160
|
+
-- author, files and reactions when those modules are installed. The rows
|
|
161161
|
+
-- come from messaging_message_rows, and the conversations they belong to
|
|
161162
|
+
-- are read once more under the caller's policies.
|
|
160983
161163
|
create or replace function ${fn("messaging_messages_json")}(ids uuid[])
|
|
160984
161164
|
returns jsonb
|
|
160985
161165
|
language sql
|
|
@@ -160987,13 +161167,35 @@ stable
|
|
|
160987
161167
|
security invoker
|
|
160988
161168
|
set search_path = ''
|
|
160989
161169
|
as $$
|
|
160990
|
-
|
|
160991
|
-
select m.* from ${
|
|
160992
|
-
)
|
|
160993
|
-
|
|
160994
|
-
|
|
161170
|
+
${select(`checked as materialized (
|
|
161171
|
+
select m.* from ${fn("messaging_message_rows")}(messaging_messages_json.ids) m
|
|
161172
|
+
),
|
|
161173
|
+
page_rows as (
|
|
161174
|
+
select k.* from checked k
|
|
161175
|
+
where k.${ms("conversation")} = any (array(
|
|
161176
|
+
select c.${cv("id")} from ${t("conversations")} c
|
|
161177
|
+
where c.${cv("id")} = any (array(select distinct v.${ms("conversation")} from checked v))
|
|
161178
|
+
))
|
|
161179
|
+
)`, "messaging_messages_json.ids")}
|
|
161180
|
+
$$;
|
|
161181
|
+
${userGrant(`${fn("messaging_messages_json")}(uuid[])`)}
|
|
161182
|
+
|
|
161183
|
+
-- messaging_messages_json without any access check, for a security definer
|
|
161184
|
+
-- function that has already checked the caller reads every conversation of
|
|
161185
|
+
-- ids. Never grant it to anon or authenticated: it returns any message,
|
|
161186
|
+
-- sent or not, with its files and reactions.
|
|
161187
|
+
create or replace function ${fn("messaging_messages_json_unchecked")}(ids uuid[])
|
|
161188
|
+
returns jsonb
|
|
161189
|
+
language sql
|
|
161190
|
+
stable
|
|
161191
|
+
security definer
|
|
161192
|
+
set search_path = ''
|
|
161193
|
+
as $$
|
|
161194
|
+
${select(`page_rows as (
|
|
161195
|
+
select m.* from ${t("messages")} m where m.${ms("id")} = any (messaging_messages_json_unchecked.ids)
|
|
161196
|
+
)`, "messaging_messages_json_unchecked.ids")}
|
|
160995
161197
|
$$;
|
|
160996
|
-
${
|
|
161198
|
+
${serviceGrant(`${fn("messaging_messages_json_unchecked")}(uuid[])`)}`;
|
|
160997
161199
|
}
|
|
160998
161200
|
/**
|
|
160999
161201
|
* The service-role notifications and the event of a message once it is sent:
|
|
@@ -161288,11 +161490,7 @@ as $$
|
|
|
161288
161490
|
select case when not coalesce(${ctx.of("subjects").fn("can_subject")}(list_record_mentions.subject_type, list_record_mentions.subject_id, 'read'), false)
|
|
161289
161491
|
then '[]'::jsonb
|
|
161290
161492
|
else coalesce((
|
|
161291
|
-
|
|
161292
|
-
'message', ${fn("messaging_messages_json")}(array[p.message]) -> 0,
|
|
161293
|
-
'conversation', jsonb_build_object('id', c.${cv("id")}, 'kind', c.${cv("kind")}, 'title', c.${cv("title")}, 'subject_type', c.${cv("subjectType")}, 'subject_id', c.${cv("subjectId")})
|
|
161294
|
-
) order by p.created_at desc, p.message desc)
|
|
161295
|
-
from (
|
|
161493
|
+
with p as materialized (
|
|
161296
161494
|
select x.${rm("message")} as message, x.${rm("conversation")} as conversation, x.${rm("createdAt")} as created_at
|
|
161297
161495
|
from ${t("recordMentions")} x
|
|
161298
161496
|
where x.${rm("subjectType")} = list_record_mentions.subject_type and x.${rm("subjectId")} = list_record_mentions.subject_id
|
|
@@ -161300,8 +161498,17 @@ as $$
|
|
|
161300
161498
|
or (x.${rm("createdAt")}, x.${rm("message")}) < (list_record_mentions.before, coalesce(list_record_mentions.before_id, ${MAX_UUID})))
|
|
161301
161499
|
order by x.${rm("createdAt")} desc, x.${rm("message")} desc
|
|
161302
161500
|
limit ${pageSize("list_record_mentions.max_rows", 20, 100)}
|
|
161303
|
-
)
|
|
161501
|
+
),
|
|
161502
|
+
j as materialized (
|
|
161503
|
+
select e.row from jsonb_array_elements(${fn("messaging_messages_json")}(array(select p.message from p))) e(row)
|
|
161504
|
+
)
|
|
161505
|
+
select jsonb_agg(jsonb_build_object(
|
|
161506
|
+
'message', j.row,
|
|
161507
|
+
'conversation', jsonb_build_object('id', c.${cv("id")}, 'kind', c.${cv("kind")}, 'title', c.${cv("title")}, 'subject_type', c.${cv("subjectType")}, 'subject_id', c.${cv("subjectId")})
|
|
161508
|
+
) order by p.created_at desc, p.message desc)
|
|
161509
|
+
from p
|
|
161304
161510
|
join ${t("conversations")} c on c.${cv("id")} = p.conversation
|
|
161511
|
+
left join j on (j.row ->> ${sqlString(ms("id").replaceAll("\"", ""))})::uuid = p.message
|
|
161305
161512
|
), '[]'::jsonb)
|
|
161306
161513
|
end
|
|
161307
161514
|
$$;
|
|
@@ -162043,6 +162250,8 @@ const MESSAGING = {
|
|
|
162043
162250
|
"is_conversation_member",
|
|
162044
162251
|
"conversation_topic_allowed",
|
|
162045
162252
|
"messaging_messages_json",
|
|
162253
|
+
"messaging_message_rows",
|
|
162254
|
+
"messaging_messages_json_unchecked",
|
|
162046
162255
|
"message_authors",
|
|
162047
162256
|
"parse_mentions",
|
|
162048
162257
|
"index_record_mentions"
|
package/dist/sqlite/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as LocalTablesOption, n as DataEngine, s as LiveEngineOptions } from "../data-engine-CQiEEoNx.js";
|
|
2
2
|
import { Vt as Executor } from "../types-BJ4cg51a.js";
|
|
3
|
-
import { i as fromSqliteError, n as SqliteDatabaseLike, o as CheckSqliteOptions, r as SqliteExecutorOptions, s as checkSqlite, t as SqliteContextLike } from "../executor-
|
|
3
|
+
import { i as fromSqliteError, n as SqliteDatabaseLike, o as CheckSqliteOptions, r as SqliteExecutorOptions, s as checkSqlite, t as SqliteContextLike } from "../executor-CTuilcgE.js";
|
|
4
4
|
/** A SQLite database that may report which tables changed. */
|
|
5
5
|
interface ChangingSqliteDatabase extends SqliteDatabaseLike {
|
|
6
6
|
onChange?(handler: {
|
package/dist/sqlite/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as localEngine } from "../data-engine-MRAlinsa.js";
|
|
2
|
-
import { i as checkSqlite, r as sqliteExecutor, t as fromSqliteError } from "../executor-
|
|
2
|
+
import { i as checkSqlite, r as sqliteExecutor, t as fromSqliteError } from "../executor-Bot0tkvU.js";
|
|
3
3
|
// src/sqlite/engine.ts
|
|
4
4
|
/**
|
|
5
5
|
* A UUID v4 from SQLite's `randomblob`, for runtimes without
|
package/dist/ssr/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { A as parseCookies, C as CookieOptions, D as SessionEncoding, E as CookieWrite, M as serializeCookie, N as sessionCookieName, O as StoredSession, T as CookieScope, a as ResolveAuthOptions, d as resolveAuth, j as readSession, k as applyCookieWrites, n as AuthResolver, r as AuthState, t as AuthResolution, w as CookieRecord } from "../resolve-Chhtdk4M.js";
|
|
2
2
|
import { a as sessionStatus, i as clearSessionCookies, n as SessionStatus, o as authContext, r as SessionStatusOptions, t as ClearSessionCookiesOptions } from "../ended-B1oCwF0v.js";
|
|
3
3
|
import { n as AuthSession, o as toSession } from "../view-DKo-Koiu.js";
|
|
4
|
-
import { r as MembershipClaim } from "../entitlements-
|
|
4
|
+
import { r as MembershipClaim } from "../entitlements-CR5HRd3S.js";
|
|
5
5
|
export { type AuthResolution, type AuthResolver, type AuthSession, type AuthState, type ClearSessionCookiesOptions, type CookieOptions, type CookieRecord, type CookieScope, type CookieWrite, type MembershipClaim, type ResolveAuthOptions, type SessionEncoding, type SessionStatus, type SessionStatusOptions, type StoredSession, applyCookieWrites, authContext, clearSessionCookies, parseCookies, readSession, resolveAuth, serializeCookie, sessionCookieName, sessionStatus, toSession };
|
package/dist/svelte/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { n as AuthSession } from "../view-DKo-Koiu.js";
|
|
2
|
-
import { _ as LiveQueryHookOptions, a as DataRows, b as ProfileOf, c as DataWrites, d as ActionState, f as BroadcastOptions, g as LiveCountSource, h as LiveCountHookOptions, i as DataRow, l as ActionInputOf, m as ClientLike, n as DataId, o as DataSource, p as ClaimsOf, r as DataListOptions, s as DataState, t as fieldErrorsOf, u as ActionResultOf, v as PresenceHookOptions, x as UseActionOptions, y as PresenceTopic } from "../field-errors-
|
|
3
|
-
import { t as AuthSnapshot } from "../bind-
|
|
2
|
+
import { _ as LiveQueryHookOptions, a as DataRows, b as ProfileOf, c as DataWrites, d as ActionState, f as BroadcastOptions, g as LiveCountSource, h as LiveCountHookOptions, i as DataRow, l as ActionInputOf, m as ClientLike, n as DataId, o as DataSource, p as ClaimsOf, r as DataListOptions, s as DataState, t as fieldErrorsOf, u as ActionResultOf, v as PresenceHookOptions, x as UseActionOptions, y as PresenceTopic } from "../field-errors-CihTLojJ.js";
|
|
3
|
+
import { t as AuthSnapshot } from "../bind-Dopmkg_T.js";
|
|
4
4
|
import { b as DbError } from "../result-aun_QZHn.js";
|
|
5
|
-
import {
|
|
6
|
-
import { _ as TopicHandlers, m as Topic, p as SubscriptionStatus, r as PresenceMember, t as EventSchemas } from "../topic-
|
|
5
|
+
import { dt as QuerySpec } from "../db-blocks-DB8Ct8Eu.js";
|
|
6
|
+
import { _ as TopicHandlers, m as Topic, p as SubscriptionStatus, r as PresenceMember, t as EventSchemas } from "../topic-BH4L7H8n.js";
|
|
7
7
|
import { tt as TemplateValues } from "../bucket-CbRyXRp3.js";
|
|
8
8
|
import { a as BlockQueryActions, c as BlockRefetchOn, i as BlockMutationState, n as BlockEventSource, o as BlockQueryOptions, r as BlockMutationActions, s as BlockQueryState, t as BlockEngineOptions } from "../block-controller-CHtFwmpj.js";
|
|
9
|
-
import { n as Controller } from "../controller-
|
|
9
|
+
import { n as Controller } from "../controller-D9N4NKbM.js";
|
|
10
10
|
import { Ct as EventMap, E as BlockEventPattern, Et as Events, O as BlockEventsMatching, w as BlockEvent } from "../events-Bk63_mjA.js";
|
|
11
11
|
import { n as BlockDataOf, r as BlockMethodName, t as BlockArgsOf } from "../block-method-OJA4a62H.js";
|
|
12
|
-
import { n as BlockOptions } from "../block-env-
|
|
12
|
+
import { n as BlockOptions } from "../block-env-4tgXDIAX.js";
|
|
13
13
|
import { SupabaseClient } from "@supabase/supabase-js";
|
|
14
14
|
import { QueryClient } from "@tanstack/query-core";
|
|
15
15
|
import { Readable } from "svelte/store";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as Validated } from "../shared-DsBcvj6q.js";
|
|
2
2
|
import { O as AnyFunctions, Ut as AnyAuthorizer, in as PermissionRef, k as AnyModels } from "../types-BJ4cg51a.js";
|
|
3
|
-
import { s as BetterSupabase } from "../db-blocks-
|
|
4
|
-
import { n as FrameworkOptions, r as LocalsResource, t as FrameworkLocals } from "../framework-
|
|
3
|
+
import { s as BetterSupabase } from "../db-blocks-DB8Ct8Eu.js";
|
|
4
|
+
import { n as FrameworkOptions, r as LocalsResource, t as FrameworkLocals } from "../framework-giXStk8k.js";
|
|
5
5
|
import { a as AuthorizedContext, c as ResourceLoaderContext, i as AuthorizeOptions, l as Unwrapped, n as ActionParsed, o as BlockActionOptions, r as ActionResult, s as BlockRequireOptions } from "../kit-DN6lGKB6.js";
|
|
6
|
-
import { r as BetterServer } from "../server-types-
|
|
6
|
+
import { r as BetterServer } from "../server-types-Cp2en4rP.js";
|
|
7
7
|
import { t as RefusalRedirects } from "../refusal-DHSRBaS6.js";
|
|
8
|
-
import { i as tagFor } from "../tags-
|
|
8
|
+
import { i as tagFor } from "../tags-C7NyJTdU.js";
|
|
9
9
|
import { AnyEntry, Contributions } from "@supabase/middleware";
|
|
10
10
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
11
11
|
/** The part of SvelteKit's `RequestEvent` the bridge reads and writes. */
|