better-supabase 0.16.0 → 0.18.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/{access-sql-B-MkVARa.js → access-sql-CNIgUqWf.js} +2 -0
- package/dist/{adapter-Dyks1lX1.js → adapter-CfuBICuG.js} +3 -1
- package/dist/{ai-schedules-BmkARmQ9.d.ts → ai-schedules-DzLh6BYI.d.ts} +1 -1
- package/dist/ai-sdk/agents/index.d.ts +2 -2
- package/dist/ai-sdk/memory/index.js +1 -1
- package/dist/{api-hHwieEfz.d.ts → api-B6zteBya.d.ts} +2 -2
- package/dist/{app-tables-D29Rahtg.js → app-tables-DyswUg6J.js} +11 -2
- package/dist/{app-tables-yMQ4ubyY.d.ts → app-tables-XwCviyhP.d.ts} +1 -1
- package/dist/astro/index.d.ts +5 -5
- package/dist/astro/index.js +5 -5
- package/dist/{attachments-aJYgdYtB.js → attachments-M-Dy79Ry.js} +9 -2
- package/dist/{authorization-HZdJCaVm.d.ts → authorization-IiE__z2m.d.ts} +187 -89
- package/dist/{automations-CIwRq7zm.js → automations-B5P6vTvk.js} +2 -2
- package/dist/{automations-CD1XlL2W.js → automations-BKjJpktQ.js} +1 -1
- package/dist/{automations-Bc2ue55V.js → automations-FCnWy387.js} +2 -2
- package/dist/better-result/index.d.ts +2 -2
- package/dist/{bind-JGCPGUJh.d.ts → bind-pu5TLrla.d.ts} +4 -4
- package/dist/{block-env-y65GF_px.d.ts → block-env-CA65ulTD.d.ts} +4 -4
- package/dist/blocks/access-requests/index.d.ts +1 -1
- package/dist/blocks/access-requests/index.js +1 -1
- package/dist/blocks/activities/index.d.ts +1 -1
- package/dist/blocks/activities/index.js +1 -1
- package/dist/blocks/agents/index.d.ts +1 -1
- package/dist/blocks/agents/index.js +1 -1
- package/dist/blocks/ai-cache/index.d.ts +1 -1
- package/dist/blocks/ai-cache/index.js +1 -1
- package/dist/blocks/ai-chat/index.d.ts +4 -4
- package/dist/blocks/ai-chat/index.js +1 -1
- package/dist/blocks/ai-files/index.d.ts +1 -1
- package/dist/blocks/ai-files/index.js +1 -1
- package/dist/blocks/ai-keys/index.d.ts +1 -1
- package/dist/blocks/ai-keys/index.js +1 -1
- package/dist/blocks/ai-schedules/index.d.ts +2 -2
- package/dist/blocks/ai-schedules/index.js +1 -1
- package/dist/blocks/announcements/index.d.ts +4 -4
- package/dist/blocks/announcements/index.js +1 -1
- package/dist/blocks/api-keys/index.d.ts +2 -2
- package/dist/blocks/api-keys/index.js +1 -1
- package/dist/blocks/approvals/index.d.ts +1 -1
- package/dist/blocks/approvals/index.js +1 -1
- package/dist/blocks/assets/index.d.ts +1 -1
- package/dist/blocks/assets/index.js +1 -1
- package/dist/blocks/assignment/index.d.ts +1 -1
- package/dist/blocks/attachments/index.d.ts +40 -4
- package/dist/blocks/attachments/index.js +42 -4
- package/dist/blocks/audit/index.d.ts +5 -5
- package/dist/blocks/audit/index.js +2 -2
- package/dist/blocks/automations/index.d.ts +3 -3
- package/dist/blocks/automations/index.js +1 -1
- package/dist/blocks/billable-time/index.d.ts +1 -1
- package/dist/blocks/billing/index.d.ts +3 -3
- package/dist/blocks/billing/index.js +1 -1
- package/dist/blocks/bookings/index.d.ts +2 -2
- package/dist/blocks/bookings/index.js +1 -1
- package/dist/blocks/bulk/index.d.ts +1 -1
- package/dist/blocks/bulk/index.js +1 -1
- package/dist/blocks/calendar/index.d.ts +2 -2
- package/dist/blocks/calendar/index.js +1 -1
- package/dist/blocks/catalog/index.d.ts +1 -1
- package/dist/blocks/catalog/index.js +1 -1
- package/dist/blocks/channels/index.d.ts +1 -1
- package/dist/blocks/collections/index.d.ts +1 -1
- package/dist/blocks/collections/index.js +1 -1
- package/dist/blocks/comments/index.d.ts +5 -5
- package/dist/blocks/comments/index.js +1 -1
- package/dist/blocks/compliance/index.d.ts +1 -1
- package/dist/blocks/compliance/index.js +1 -1
- package/dist/blocks/connectors/index.d.ts +1 -1
- package/dist/blocks/connectors/index.js +1 -1
- package/dist/blocks/contacts/index.d.ts +1 -1
- package/dist/blocks/contacts/index.js +1 -1
- package/dist/blocks/content/index.d.ts +2 -2
- package/dist/blocks/content/index.js +1 -1
- package/dist/blocks/contracts/index.d.ts +1 -1
- package/dist/blocks/contracts/index.js +1 -1
- package/dist/blocks/courses/index.d.ts +2 -2
- package/dist/blocks/courses/index.js +1 -1
- package/dist/blocks/created-by/index.d.ts +4 -3
- package/dist/blocks/created-by/index.js +2 -2
- package/dist/blocks/custom-fields/index.d.ts +1 -1
- package/dist/blocks/custom-fields/index.js +1 -1
- package/dist/blocks/data-lifecycle/index.d.ts +1 -1
- package/dist/blocks/data-lifecycle/index.js +1 -1
- package/dist/blocks/deals/index.d.ts +1 -1
- package/dist/blocks/deals/index.js +1 -1
- package/dist/blocks/dispatch/index.d.ts +2 -2
- package/dist/blocks/dispatch/index.js +1 -1
- package/dist/blocks/documents/index.d.ts +1 -1
- package/dist/blocks/documents/index.js +1 -1
- package/dist/blocks/domains/index.d.ts +1 -1
- package/dist/blocks/domains/index.js +1 -1
- package/dist/blocks/donations/index.d.ts +1 -1
- package/dist/blocks/donations/index.js +1 -1
- package/dist/blocks/drive/index.d.ts +1 -1
- package/dist/blocks/drive/index.js +2 -2
- package/dist/blocks/employees/index.d.ts +2 -2
- package/dist/blocks/employees/index.js +1 -1
- package/dist/blocks/enrichment/index.d.ts +1 -1
- package/dist/blocks/enrollments/index.d.ts +1 -1
- package/dist/blocks/enrollments/index.js +1 -1
- package/dist/blocks/entitlements/index.d.ts +3 -3
- package/dist/blocks/expenses/index.d.ts +1 -1
- package/dist/blocks/expenses/index.js +1 -1
- package/dist/blocks/field-history/index.d.ts +1 -1
- package/dist/blocks/flags/index.d.ts +1 -1
- package/dist/blocks/flags/index.js +1 -1
- package/dist/blocks/forecasts/index.d.ts +1 -1
- package/dist/blocks/forms/index.d.ts +2 -2
- package/dist/blocks/forms/index.js +1 -1
- package/dist/blocks/goals/index.d.ts +1 -1
- package/dist/blocks/goals/index.js +1 -1
- package/dist/blocks/guests/index.d.ts +1 -1
- package/dist/blocks/hiring/index.d.ts +1 -1
- package/dist/blocks/hiring/index.js +1 -1
- package/dist/blocks/identities/index.d.ts +1 -1
- package/dist/blocks/identities/index.js +1 -1
- package/dist/blocks/imports/index.d.ts +1 -1
- package/dist/blocks/inbox/index.d.ts +5 -5
- package/dist/blocks/inbox/index.js +1 -1
- package/dist/blocks/incidents/index.d.ts +1 -1
- package/dist/blocks/incidents/index.js +1 -1
- package/dist/blocks/index.d.ts +4 -4
- package/dist/blocks/index.js +1 -1
- package/dist/blocks/inventory/index.d.ts +1 -1
- package/dist/blocks/inventory/index.js +1 -1
- package/dist/blocks/invoices/index.d.ts +1 -1
- package/dist/blocks/invoices/index.js +1 -1
- package/dist/blocks/knowledge/index.d.ts +1 -1
- package/dist/blocks/knowledge/index.js +1 -1
- package/dist/blocks/lead-scoring/index.d.ts +2 -2
- package/dist/blocks/lead-scoring/index.js +1 -1
- package/dist/blocks/leases/index.d.ts +1 -1
- package/dist/blocks/leases/index.js +1 -1
- package/dist/blocks/leave/index.d.ts +1 -1
- package/dist/blocks/leave/index.js +1 -1
- package/dist/blocks/ledger/index.d.ts +1 -1
- package/dist/blocks/mail-sync/index.d.ts +2 -2
- package/dist/blocks/mail-sync/index.js +1 -1
- package/dist/blocks/memberships/index.d.ts +3 -3
- package/dist/blocks/memberships/index.js +1 -1
- package/dist/blocks/memory/index.d.ts +1 -1
- package/dist/blocks/memory/index.js +1 -1
- package/dist/blocks/messaging/index.d.ts +5 -5
- package/dist/blocks/messaging/index.js +1 -1
- package/dist/blocks/metrics/index.d.ts +1 -1
- package/dist/blocks/metrics/index.js +1 -1
- package/dist/blocks/mfa/index.d.ts +2 -2
- package/dist/blocks/moderation/index.d.ts +1 -1
- package/dist/blocks/moderation/index.js +1 -1
- package/dist/blocks/notifications/index.d.ts +17 -6
- package/dist/blocks/notifications/index.js +110 -40
- package/dist/blocks/numbering/index.d.ts +1 -1
- package/dist/blocks/numbering/index.js +1 -1
- package/dist/blocks/oauth-server/index.d.ts +1 -1
- package/dist/blocks/oauth-server/index.js +1 -1
- package/dist/blocks/onboarding/index.d.ts +2 -2
- package/dist/blocks/onboarding/index.js +1 -1
- package/dist/blocks/orders/index.d.ts +2 -2
- package/dist/blocks/orders/index.js +1 -1
- package/dist/blocks/organizations/index.d.ts +38 -3
- package/dist/blocks/organizations/index.js +50 -5
- package/dist/blocks/outbox/index.d.ts +1 -1
- package/dist/blocks/outbox/index.js +1 -1
- package/dist/blocks/passes/index.d.ts +2 -2
- package/dist/blocks/passes/index.js +1 -1
- package/dist/blocks/permissions/index.d.ts +4 -4
- package/dist/blocks/permissions/index.js +2 -2
- package/dist/blocks/pipelines/index.d.ts +1 -1
- package/dist/blocks/pipelines/index.js +1 -1
- package/dist/blocks/posts/index.d.ts +2 -2
- package/dist/blocks/posts/index.js +1 -1
- package/dist/blocks/profiles/index.d.ts +1 -1
- package/dist/blocks/profiles/index.js +1 -1
- package/dist/blocks/promotions/index.d.ts +1 -1
- package/dist/blocks/promotions/index.js +1 -1
- package/dist/blocks/push/index.d.ts +76 -10
- package/dist/blocks/push/index.js +172 -43
- package/dist/blocks/queue/index.d.ts +1 -1
- package/dist/blocks/queue/index.js +1 -1
- package/dist/blocks/quotes/index.d.ts +1 -1
- package/dist/blocks/quotes/index.js +1 -1
- package/dist/blocks/rank/index.d.ts +1 -1
- package/dist/blocks/reactions/index.d.ts +4 -4
- package/dist/blocks/reactions/index.js +1 -1
- package/dist/blocks/relations/index.d.ts +1 -1
- package/dist/blocks/relations/index.js +1 -1
- package/dist/blocks/reminders/index.d.ts +1 -1
- package/dist/blocks/reminders/index.js +1 -1
- package/dist/blocks/reviews/index.d.ts +1 -1
- package/dist/blocks/reviews/index.js +1 -1
- package/dist/blocks/saved-views/index.d.ts +3 -3
- package/dist/blocks/saved-views/index.js +1 -1
- package/dist/blocks/scores/index.d.ts +1 -1
- package/dist/blocks/scores/index.js +1 -1
- package/dist/blocks/search/index.d.ts +3 -3
- package/dist/blocks/search/index.js +1 -1
- package/dist/blocks/security-events/index.d.ts +1 -1
- package/dist/blocks/security-events/index.js +1 -1
- package/dist/blocks/segments/index.d.ts +2 -2
- package/dist/blocks/segments/index.js +1 -1
- package/dist/blocks/sequences/index.d.ts +2 -2
- package/dist/blocks/sequences/index.js +1 -1
- package/dist/blocks/service-accounts/index.d.ts +1 -1
- package/dist/blocks/service-accounts/index.js +1 -1
- package/dist/blocks/sessions/index.d.ts +2 -2
- package/dist/blocks/sessions/index.js +1 -1
- package/dist/blocks/settings/index.d.ts +2 -2
- package/dist/blocks/settings/index.js +1 -1
- package/dist/blocks/share-links/index.d.ts +1 -1
- package/dist/blocks/share-links/index.js +1 -1
- package/dist/blocks/shipments/index.d.ts +2 -2
- package/dist/blocks/shipments/index.js +1 -1
- package/dist/blocks/signatures/index.d.ts +2 -2
- package/dist/blocks/signatures/index.js +1 -1
- package/dist/blocks/signing-keys/index.d.ts +1 -1
- package/dist/blocks/signing-keys/index.js +1 -1
- package/dist/blocks/sla/index.d.ts +1 -1
- package/dist/blocks/sla/index.js +1 -1
- package/dist/blocks/sso/index.d.ts +1 -1
- package/dist/blocks/sso/index.js +1 -1
- package/dist/blocks/state-machine/index.d.ts +1 -1
- package/dist/blocks/state-machine/index.js +1 -1
- package/dist/blocks/subjects/index.d.ts +2 -2
- package/dist/blocks/tags/index.d.ts +2 -2
- package/dist/blocks/tags/index.js +1 -1
- package/dist/blocks/tasks/index.d.ts +2 -2
- package/dist/blocks/tasks/index.js +1 -1
- package/dist/blocks/teams/index.d.ts +1 -1
- package/dist/blocks/teams/index.js +1 -1
- package/dist/blocks/templates/index.d.ts +2 -2
- package/dist/blocks/templates/index.js +1 -1
- package/dist/blocks/time-tracking/index.d.ts +1 -1
- package/dist/blocks/time-tracking/index.js +1 -1
- package/dist/blocks/timeline/index.d.ts +3 -3
- package/dist/blocks/trash/index.d.ts +1 -1
- package/dist/blocks/trash/index.js +1 -1
- package/dist/blocks/undo/index.d.ts +2 -2
- package/dist/blocks/updated-at/index.d.ts +7 -4
- package/dist/blocks/updated-at/index.js +2 -2
- package/dist/blocks/usage/index.d.ts +2 -2
- package/dist/blocks/usage/index.js +1 -1
- package/dist/blocks/vercel-marketplace/index.d.ts +1 -1
- package/dist/blocks/vercel-marketplace/index.js +1 -1
- package/dist/blocks/versions/index.d.ts +1 -1
- package/dist/blocks/versions/index.js +1 -1
- package/dist/blocks/waitlist/index.d.ts +1 -1
- package/dist/blocks/waitlist/index.js +1 -1
- package/dist/blocks/webhooks/index.d.ts +2 -2
- package/dist/blocks/webhooks/index.js +1 -1
- package/dist/blocks/workflow-editor/index.d.ts +4 -4
- package/dist/blocks/workflow-editor/index.js +1 -1
- package/dist/blocks/workflows/index.d.ts +4 -4
- package/dist/{channel-BjvGO39m.d.ts → channel-JcMd5lNP.d.ts} +30 -2
- package/dist/cli/{add-D7TkPdco.js → add-B1S3yK4L.js} +20 -13
- package/dist/cli/add-BQPJnapO.js +1 -0
- package/dist/cli/{add-I8OW-qJH.js → add-D7YIXslp.js} +2 -2
- package/dist/cli/{backfill-DIz5DnlQ.js → backfill-BwkyNhlC.js} +4 -4
- package/dist/cli/bin.js +1 -1
- package/dist/cli/{blocks-Bp5RPoft.js → blocks-CBqENu3C.js} +1 -1
- package/dist/cli/{blocks-xk-SE8gS.js → blocks-DDm1Zc2S.js} +2 -2
- package/dist/cli/{cache-AznIssjI.js → cache-DE2IH1-C.js} +1 -1
- package/dist/cli/{codemod-Aewxza6i.js → codemod-OHKhVV-v.js} +4 -4
- package/dist/cli/{command-CQ61x6gN.js → command-BWEEXmtz.js} +20 -0
- package/dist/cli/{completion-Dlu5AdUW.js → completion-8EDK21xj.js} +1 -1
- package/dist/cli/{completion-BwI0_Ap5.js → completion-BfnKI4QZ.js} +2 -2
- package/dist/cli/{completion-2Y3D_eNu.js → completion-Bt7LMypX.js} +2 -2
- package/dist/cli/{config-9t5ec_N7.js → config-BJSqMi04.js} +20 -6
- package/dist/cli/{config-CBqkQjjN.js → config-BlfVh0IP.js} +1 -1
- package/dist/cli/{config-CPux9Wa7.js → config-WKDixoGK.js} +1 -1
- package/dist/cli/{content-mapper-DCrz6OIv.js → content-mapper-CaygHH_k.js} +2 -2
- package/dist/cli/{db-DrBI_HNv.js → db-DYU5hUcd.js} +3 -3
- package/dist/cli/{doctor-DkOSLPEQ.js → doctor-D_nrsd9E.js} +186 -143
- package/dist/cli/{env-BBl5L8Bf.js → env-BCgVZkcb.js} +1 -1
- package/dist/cli/env-xhwXk5Ri.js +1 -0
- package/dist/cli/{gen-CFkYUnWq.js → gen-D7gMEwvg.js} +22 -15
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.js +8 -8
- package/dist/cli/{init-CHj9ad4S.js → init-ch-HWJyp.js} +7 -7
- package/dist/cli/{keys-DGEpMbeB.js → keys-CbaL0lnw.js} +1 -1
- package/dist/cli/{live-DGdLR41j.js → live-B38ePuRS.js} +2 -2
- package/dist/cli/{mcp-BZno503V.js → mcp-P9RP2SJ3.js} +3 -3
- package/dist/cli/{metadata-BfgHMe4q.js → metadata-BTihErEc.js} +3 -3
- package/dist/cli/{migration-safety-BnnXPAro.js → migration-safety-DYo1vVWC.js} +2 -2
- package/dist/cli/{module-migration-O_IxewFs.js → migrations-BoIyGczt.js} +3 -113
- package/dist/cli/module-migration-DXvo0EqU.js +119 -0
- package/dist/cli/{moved-CsfDQcyk.js → moved-DVwgE8lV.js} +1 -1
- package/dist/cli/{parse-B9Iv_-Pf.js → parse-B079x40m.js} +1 -1
- package/dist/cli/powersync-D-0yV_L_.js +283 -0
- package/dist/cli/powersync-DXVsKkAu.js +1 -0
- package/dist/cli/{print-DosQIFSy.js → print-CRon4lXf.js} +2 -1
- package/dist/cli/{remove-DK2G_KHm.js → remove-D89s99ha.js} +6 -6
- package/dist/cli/{render-5y5a1QZr.js → render-BJF9ytUi.js} +15 -6
- package/dist/cli/{run-BXx6D1aR.js → run-DmOTMa44.js} +2 -2
- package/dist/cli/{run-Bs4OKdDI.js → run-jeplMBOK.js} +29 -10
- package/dist/cli/{run-MRET30vh.js → run-x9ZY4Tm0.js} +38 -37
- package/dist/cli/{seed-Cz8PcXeT.js → seed-D9mt8bnW.js} +3 -3
- package/dist/cli/seed-EPO6AvLG.js +1 -0
- package/dist/cli/{shared-BLqbvY2x.js → shared-B38Chjgd.js} +1 -1
- package/dist/cli/{skills-toUan_OV.js → skills-FXAVPLzp.js} +1 -1
- package/dist/cli/{snapshot-uTUlEzY2.js → snapshot-BXmU3IXN.js} +3 -3
- package/dist/cli/{source-args-IpJRJO5t.js → source-args-DlckPVje.js} +1 -1
- package/dist/cli/{source-D2gJHKwC.js → source-irttnsEb.js} +1 -1
- package/dist/cli/{spec-Cm2einTO.js → spec-CDxfokey.js} +3 -3
- package/dist/cli/{spec-DUjOtciN.js → spec-DzD5wMVF.js} +1 -1
- package/dist/cli/{sql-layout-lUWenjJw.js → sql-layout-D8QrNvt4.js} +2 -2
- package/dist/cli/{stack-CWEHdO0b.js → stack-DgASZP0K.js} +1 -1
- package/dist/cli/{sync-CZMRB3aU.js → sync-s1iKFIos.js} +3 -2
- package/dist/cli/{upgrade-BFEIMC7U.js → upgrade-B4FPlK-_.js} +4 -3
- package/dist/cli/{upgrade-fVsJniXm.js → upgrade-CluxP3JJ.js} +3 -3
- package/dist/cli/{version-B2Dr6VmJ.js → version-TgFM8sOd.js} +1 -1
- package/dist/client/index.d.ts +5 -5
- package/dist/client/native/index.d.ts +4 -4
- package/dist/{composite-CfYyU3vs.d.ts → composite-C-8A8qzi.d.ts} +4 -4
- package/dist/{composite-B3TIjId4.js → composite-D24L5RIY.js} +2 -2
- package/dist/config/index.d.ts +3 -3
- package/dist/config/index.js +4 -4
- package/dist/{config-CcehOvbz.js → config-CD2OGfCG.js} +2 -1
- package/dist/{config-DWGgUQCh.js → config-mbVyJwSc.js} +7 -6
- package/dist/{context-8kb8m5uO.d.ts → context-D24k1Cpc.d.ts} +36 -4
- package/dist/{controller-BW-5Opig.d.ts → controller-BR7CZ1R9.d.ts} +1 -1
- package/dist/{conversion-3iv2r7YC.d.ts → conversion-BgtOfTaS.d.ts} +1 -1
- package/dist/create/index.d.ts +2 -2
- package/dist/create/index.js +5 -5
- package/dist/{define-C5AcEkEJ.d.ts → define-Cgru0_kF.d.ts} +1 -1
- package/dist/{define-block-C1RHXz7L.d.ts → define-block-CJWiDWa5.d.ts} +11 -4
- package/dist/edge/index.d.ts +7 -7
- package/dist/edge/index.js +7 -7
- package/dist/elysia/index.d.ts +1 -1
- package/dist/elysia/index.js +1 -1
- package/dist/{email-tt2QqiSc.d.ts → email-B3YxEzwC.d.ts} +1 -1
- package/dist/{entitlements-sO977DO-.d.ts → entitlements-DHcNt1aF.d.ts} +1 -1
- package/dist/{events-SqJLbb8q.js → events-DuLhzjP6.js} +2 -0
- package/dist/{executor-BcNWcD-4.d.ts → executor-BWFfz0ik.d.ts} +2 -2
- package/dist/expo/index.d.ts +3 -3
- package/dist/expo/index.js +3 -3
- package/dist/{extension-B-lajjex.js → extension-DTaHjwdc.js} +3 -2
- package/dist/{extension-B0EjCYhO.js → extension-mGylYROs.js} +2 -10
- package/dist/{field-errors-Dt86dCKk.d.ts → field-errors-DucQdLl7.d.ts} +6 -6
- package/dist/{framework-BozTXRzt.js → framework-CNhTg0th.js} +1 -1
- package/dist/{framework-BGdZVyPL.d.ts → framework-x9Y4uB1q.d.ts} +5 -5
- 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 +6 -6
- package/dist/hono/index.js +7 -6
- package/dist/{index-Cc4mIQS8.d.ts → index-4WT_uRRL.d.ts} +20 -4
- package/dist/{index-CENWq3zb.d.ts → index-BAcQz5DS.d.ts} +1 -1
- package/dist/{index-CTu-3fJB.d.ts → index-BH3NYExp.d.ts} +3 -3
- package/dist/{index-CcAmFNVi.d.ts → index-C0t-vNIt.d.ts} +2 -2
- package/dist/{index-DZKCc2WM.d.ts → index-C6ruLtyx.d.ts} +3 -3
- package/dist/{index-Craf712U.d.ts → index-XAyzdLns.d.ts} +9 -9
- package/dist/{index-BxYOB1Oc.d.ts → index-iRkFvJ7J.d.ts} +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/{instances-BHjCZoF8.js → instances-DDt7NdVl.js} +1 -1
- package/dist/{kit-DOwKpSkA.d.ts → kit-CVgQCIBO.d.ts} +1 -1
- package/dist/{kit-5l-o8RxL.js → kit-DhlB-vv_.js} +1 -1
- package/dist/list/index.d.ts +1 -1
- package/dist/{list-query-DYhgRTd5.d.ts → list-query-DxjuIHEL.d.ts} +1 -1
- package/dist/mapper/bin.js +7 -6
- package/dist/mcp/index.d.ts +11 -5
- package/dist/mcp/index.js +6 -6
- package/dist/mcp/sdk/index.d.ts +3 -3
- package/dist/mcp/sdk/index.js +2 -2
- package/dist/{methods-B3o7BFOW.js → methods-Cund9ZBe.js} +1 -1
- package/dist/nestjs/index.d.ts +2 -2
- package/dist/nestjs/index.js +1 -1
- package/dist/next/index.d.ts +16 -16
- package/dist/next/index.js +6 -6
- package/dist/node/index.d.ts +2 -2
- package/dist/node/index.js +1 -1
- package/dist/{operations-CSc_IsHO.d.ts → operations-CAjMgNr9.d.ts} +1 -1
- package/dist/{options-CK5WiFwG.js → options-3OYOU56e.js} +1 -1
- package/dist/{options-xD4_FRUq.js → options-56zYYXxc.js} +1 -1
- package/dist/{options-_F-enoBs.d.ts → options-5WvWOkAm.d.ts} +1 -1
- package/dist/{options-SViK_2x2.js → options-62woPFn3.js} +1 -1
- package/dist/{options-1GgseJq5.js → options-7ixoOoap.js} +1 -1
- package/dist/{options-BZsoPJGX.js → options-9dSU5RML.js} +2 -2
- package/dist/{options-y_-AkVCs.d.ts → options-B0YZtAkb.d.ts} +1 -1
- package/dist/{options-HLwOuF2H.js → options-B2Kz_tCx.js} +2 -2
- package/dist/{options-CEMawFrr.js → options-B685YSzQ.js} +1 -1
- package/dist/{options-DWbA9buW.js → options-B692WoK6.js} +2 -2
- package/dist/options-BHU1wc74.js +5 -0
- package/dist/{options-CPK2nQER.js → options-BHy0Z5Zd.js} +2 -2
- package/dist/{options-Fz6xqu-b.js → options-BKDxrPvE.js} +2 -2
- package/dist/{options-BVg58avP.js → options-BLfymS4s.js} +2 -2
- package/dist/{options-CYV4iZiQ.js → options-BOCRbzh3.js} +1 -1
- package/dist/{options-C-dQHH5-.js → options-BQWJqwHO.js} +3 -2
- package/dist/{options-Cl9Ag2Pt.js → options-BQunK6_Y.js} +2 -2
- package/dist/{options-CljDnQt2.js → options-BQyrZjwM.js} +4 -1
- package/dist/options-BR9xTHZW.js +5 -0
- package/dist/{options-D40CQzji.js → options-BRUdd5jY.js} +1 -1
- package/dist/{options-CsGl5BLH.d.ts → options-BTmaRzx2.d.ts} +13 -5
- package/dist/{options-Li1Dyu88.d.ts → options-BUCQYAeJ.d.ts} +2 -2
- package/dist/{options-DChZoVfs.d.ts → options-B_NrjVDt.d.ts} +1 -0
- package/dist/{options-B5BU2Yg7.js → options-BawzwlmC.js} +2 -2
- package/dist/{options-BlzSfWxC.d.ts → options-BbLDAp7G.d.ts} +2 -2
- package/dist/{options-DTDxFT6J.js → options-Bc4xz5jQ.js} +2 -2
- package/dist/options-BfFC4iFE.js +8 -0
- package/dist/{options-Br1Xi2Hw.js → options-BfPsL7E2.js} +1 -1
- package/dist/{options-DYBQ973I.js → options-Bfmwwc78.js} +1 -1
- package/dist/{options-c5WCsky5.js → options-BhsdveDk.js} +2 -2
- package/dist/{options-B5woz53h.js → options-BomoTH-8.js} +2 -2
- package/dist/{options-DeNejBtq.js → options-BtjkzIVh.js} +1 -1
- package/dist/options-Bvi9bl4H.js +5 -0
- package/dist/{options-IHPg8ZoA.js → options-BwKNmaJo.js} +2 -2
- package/dist/{options-CtUUU71w.js → options-BxpLtyk-.js} +4 -6
- package/dist/{options-D_bBVCXg.js → options-BzB2QxL3.js} +1 -1
- package/dist/{options-CmraJhd9.js → options-C078wBP0.js} +1 -1
- package/dist/options-C1-pwEqm.js +5 -0
- package/dist/{options-BZOliZvb.js → options-C3AdsFJ6.js} +2 -2
- package/dist/options-C7C5OhmL.d.ts +8 -0
- package/dist/{options-B2swWnJW.js → options-C87u6eSa.js} +3 -2
- package/dist/{options-CVSWgZpY.js → options-CBAEGxwS.js} +1 -1
- package/dist/{options-CM6-18FQ.d.ts → options-CDSCkYxu.d.ts} +1 -0
- package/dist/{options-9gvPo1BC.js → options-CDUr8zzX.js} +1 -1
- package/dist/{options-DMR68VAC.js → options-CFjGxfa8.js} +2 -2
- package/dist/{options-Bf96aVk5.js → options-CI6P0xhV.js} +1 -1
- package/dist/{options-B5VUf4IT.js → options-CJFMK9A_.js} +1 -1
- package/dist/{options-CRz8Ht_4.js → options-CLpgx7en.js} +3 -2
- package/dist/{options-BesyRBnM.js → options-CTXHj9zr.js} +2 -2
- package/dist/{options-D2d1fFuw.js → options-CTl8T88w.js} +1 -1
- package/dist/{options-C3RgtOLo.js → options-CTv-xmbA.js} +2 -2
- package/dist/{options-Bpl-WFPk.js → options-CUIOOv4z.js} +1 -1
- package/dist/{options-o2kfYU2x.js → options-CZDmtsbV.js} +2 -2
- package/dist/{options-CF7nRWXS.js → options-CZTscdPB.js} +1 -1
- package/dist/{options-BlncUmIc.js → options-CZdKndeo.js} +2 -2
- package/dist/{options-DplE18Ko.d.ts → options-C_7g9TTq.d.ts} +1 -1
- package/dist/{options-C_pb1Nd3.js → options-Cb2FOFj5.js} +1 -1
- package/dist/{options-t_O5ldT6.js → options-CbOstLa7.js} +2 -2
- package/dist/{options-Bt0bYMLl.js → options-CcXgWlvm.js} +2 -2
- package/dist/{options-BMjcVuaI.js → options-CfVPctAw.js} +7 -0
- package/dist/{options-DWpz3V3F.js → options-ChiL-4ZS.js} +2 -2
- package/dist/{options-E7KcmHQv.js → options-Cjgaf8ub.js} +2 -2
- package/dist/{options-DrSkIBCD.js → options-CoSPgWKy.js} +1 -1
- package/dist/{options-Bp7sgKvl.js → options-CpZ2HlSU.js} +5 -3
- package/dist/{options-CN7PHkhU.js → options-CsSe8Nba.js} +1 -1
- package/dist/{options-B9q8CROT.js → options-CsvJR-r2.js} +1 -1
- package/dist/{options-oeAq4Ho5.js → options-Cucv6sWP.js} +2 -2
- package/dist/{options-BOOEzor9.js → options-CyjL9lTf.js} +2 -2
- package/dist/{options-pOVWwbAK.d.ts → options-D-OOO9V2.d.ts} +1 -1
- package/dist/{options-nFzfgtA6.js → options-D0Y6ZMe8.js} +1 -1
- package/dist/{options-BnZS7IK-.js → options-D0sj5abR.js} +2 -2
- package/dist/{options-0qvUckqt.js → options-D2s7fT1s.js} +2 -2
- package/dist/{options-BjtrC7o6.js → options-D32-YxnO.js} +1 -1
- package/dist/{options-B0EJULm5.js → options-D610Fa6T.js} +2 -2
- package/dist/{options-BvtnxHfK.js → options-D96dScev.js} +1 -1
- package/dist/{options-DgQo80Xh.js → options-DFpyP1bg.js} +2 -2
- package/dist/{options-BYOtaF7w.js → options-DJEcS4DX.js} +1 -1
- package/dist/{options-DPgdAXO5.js → options-DJbN3bi9.js} +2 -2
- package/dist/{options-EsUh744F.js → options-DKoQoRCy.js} +2 -2
- package/dist/{options-CvD9vNvx.js → options-DM1qaMMQ.js} +1 -1
- package/dist/{options-eBPsk4WI.js → options-DNgSwhsm.js} +2 -2
- package/dist/{options-2EMA_x6_.js → options-DOIwzRXL.js} +2 -2
- package/dist/{options-D6as77gU.d.ts → options-DRIgHh4O.d.ts} +2 -2
- package/dist/{options-DDzggjN7.js → options-DRrZmJyI.js} +2 -2
- package/dist/{options-DJ-aYPVN.js → options-DUMUsvml.js} +2 -2
- package/dist/{options-Cp0HyUEk.js → options-DWwL5Kaz.js} +1 -1
- package/dist/{options-BCrqe3HH.js → options-DZHZYlpD.js} +1 -1
- package/dist/{options-BQIYfx9F.js → options-DZLkeqWn.js} +2 -2
- package/dist/{options-RKYdmIdV.js → options-DZRpXKQE.js} +1 -1
- package/dist/{options-D0G06Zm9.js → options-D_9Vxx7f.js} +2 -2
- package/dist/{options-BMGClqoa.js → options-DcHl59RC.js} +1 -1
- package/dist/{options-CW9wTqOk.js → options-Dcaql09y.js} +1 -1
- package/dist/{options-CXFz0xxS.js → options-DcnBNYmV.js} +1 -1
- package/dist/{options-21s0dpnX.js → options-DdpM-fiP.js} +2 -2
- package/dist/{options-BbnPv6p7.js → options-DhdazgTZ.js} +2 -2
- package/dist/{options-C239TLRF.js → options-Dpy-Ruo-.js} +1 -1
- package/dist/{options-DWVYM8P0.d.ts → options-DsVuVRH3.d.ts} +1 -1
- package/dist/{options-BlOPivzq.js → options-DtAJxfHS.js} +1 -1
- package/dist/{options-DXnBN2E7.js → options-Dz9Yo52Z.js} +2 -2
- package/dist/{options-DcOx8_3X.d.ts → options-HnfETSHr.d.ts} +1 -1
- package/dist/{options-CoX6VKGb.js → options-LqUXTpML.js} +1 -1
- package/dist/options-MsloEAIB.js +5 -0
- package/dist/{options-DCduTMST.js → options-P2FxqYpd.js} +2 -2
- package/dist/options-_1gAIMq7.d.ts +60 -0
- package/dist/{options-B0FcEKtH.js → options-aT89JqlB.js} +1 -1
- package/dist/{options-Cyu0hgmN.js → options-cVKZu9b0.js} +2 -2
- package/dist/options-fMxhtuVR.js +5 -0
- package/dist/{options-BxcFLL1G.js → options-fkShrmGQ.js} +2 -2
- package/dist/{options-Ctac2R0Q.js → options-gUvfr3no.js} +2 -2
- package/dist/{options-DNKyN5uq.js → options-hynwKWuf.js} +2 -2
- package/dist/{options-CkScQRJR.js → options-lsxJYfYx.js} +2 -2
- package/dist/{options-CyAhRKKm.d.ts → options-o5wCw8H7.d.ts} +2 -2
- package/dist/{options-DARkpk2P.js → options-p49DFg3H.js} +2 -2
- package/dist/{options-zkyhM3qi.js → options-pYNpXKcg.js} +1 -1
- package/dist/{options-Cqq2jUww.js → options-qtETCHzW.js} +2 -2
- package/dist/options-rnKlqYEr.js +5 -0
- package/dist/{options-KV84gAxl.js → options-sU_zGkiV.js} +2 -2
- package/dist/{options-BfLmA375.js → options-xq4MXG1M.js} +2 -2
- package/dist/{options-BA6jV6py.js → options-zzlznRA7.js} +2 -2
- package/dist/orpc/index.d.ts +21 -10
- package/dist/orpc/index.js +60 -31
- package/dist/otel/index.d.ts +1 -1
- package/dist/otel/index.js +5 -5
- package/dist/{ports-mObLgH1z.d.ts → ports-g0H1Kzwr.d.ts} +1 -1
- package/dist/powersync/index.d.ts +136 -3
- package/dist/powersync/index.js +333 -1
- package/dist/preset/index.d.ts +3 -3
- package/dist/preset/index.js +3 -3
- package/dist/{preset-CsHnIBJF.js → preset-B3CukUhu.js} +4 -4
- package/dist/{push-token-BSSvsWXZ.d.ts → push-token-Cl2EihRc.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 +5 -5
- package/dist/react-router/index.js +5 -5
- package/dist/realtime/index.d.ts +3 -3
- package/dist/realtime/index.js +1 -1
- package/dist/{record-form-D9ILuVtA.d.ts → record-form-zMwz0Ayt.d.ts} +1 -1
- package/dist/records/index.d.ts +7 -7
- package/dist/{refusal-ByBZcm0V.js → refusal-D48CMqpQ.js} +2 -2
- package/dist/{refusal-CSntB_x8.d.ts → refusal-OrlI3g4H.d.ts} +1 -1
- package/dist/{resource-DV2GC2dB.js → resource-R3KToNze.js} +1 -1
- package/dist/{resource-execute-Cpnob1Vj.d.ts → resource-execute-CKBtGL8-.d.ts} +1 -1
- package/dist/{resource-types-pMeLs68X.d.ts → resource-types-8Q5Klkpa.d.ts} +2 -2
- package/dist/{resources-C02l_YBJ.js → resources-DqIwoQsP.js} +1 -1
- package/dist/{resources-7iq2-5_A.d.ts → resources-DxpqenZA.d.ts} +1 -1
- package/dist/{respond-C3CcOZlA.js → respond-3RKp6VgU.js} +8 -1
- package/dist/{respond-Dn1_YhC1.d.ts → respond-oZeJ342J.d.ts} +6 -0
- package/dist/server/index.d.ts +9 -9
- package/dist/server/index.js +6 -6
- package/dist/{server-types-CK8mUIUT.d.ts → server-types-gR4Q1aM0.d.ts} +1 -1
- package/dist/{session-DWmFv3vB.d.ts → session-Fcft5A39.d.ts} +2 -2
- package/dist/{sign-in-B64114O4.js → sign-in-BLkRU3lc.js} +1 -1
- package/dist/solid/index.d.ts +6 -6
- package/dist/solid-start/index.d.ts +5 -5
- package/dist/solid-start/index.js +5 -5
- package/dist/spec/index.d.ts +2 -2
- package/dist/spec/index.js +1 -1
- package/dist/{spec-pins-DIx95afw.d.ts → spec-pins-BZkKfwY8.d.ts} +2 -0
- package/dist/{spec-pins-C1Vm8OBl.js → spec-pins-D3zDek-u.js} +1 -0
- package/dist/sql/index.d.ts +5 -5
- package/dist/sql/index.js +5 -5
- package/dist/{sql-Dl3Alk43.js → sql-fHTjZGqR.js} +4445 -3211
- package/dist/sql-type-iUSZpaUu.js +34 -0
- package/dist/sqlite/index.d.ts +1 -1
- package/dist/ssr/index.d.ts +1 -1
- package/dist/{statuses-DMMDwXpZ.js → statuses-Alll5Ip6.js} +2 -2
- package/dist/storage/index.js +1 -1
- package/dist/svelte/index.d.ts +6 -6
- package/dist/sveltekit/index.d.ts +6 -6
- package/dist/sveltekit/index.js +5 -5
- package/dist/{tags-qvVk79pp.d.ts → tags-sM-CH9Mn.d.ts} +1 -1
- package/dist/tanstack-db/index.d.ts +1 -1
- package/dist/tanstack-start/index.d.ts +5 -5
- package/dist/tanstack-start/index.js +5 -5
- package/dist/{tenant-DOKIJI62.d.ts → tenant-DyoVYFfC.d.ts} +1 -1
- package/dist/testing/index.d.ts +9 -9
- package/dist/testing/index.js +8 -5
- package/dist/{timeline-CvTuXYvn.d.ts → timeline-CMmo0R7g.d.ts} +3 -3
- package/dist/{topic-ikV_pLTX.js → topic-J9I3yu6f.js} +1 -1
- package/dist/{topic-CZXHhZye.d.ts → topic-nQYxoTaU.d.ts} +2 -2
- package/dist/{verify-CjvNLY7N.d.ts → verify-DEqY__0N.d.ts} +1 -1
- package/dist/vue/index.d.ts +6 -6
- package/dist/{watch-topic-BAxoPKZx.d.ts → watch-topic-UGSEWAqR.d.ts} +1 -1
- package/dist/workflow-sdk/world/index.js +1 -1
- package/dist/{workflow-sdk-Bw6_u0ar.js → workflow-sdk-DELaQEp3.js} +2 -0
- package/dist/yjs/index.d.ts +1 -1
- package/dist/yjs/index.js +1 -1
- package/package.json +1 -1
- package/schemas/config-v1.json +471 -69
- package/schemas/doctor-report-v1.json +1 -0
- package/dist/cli/add-Bfb_ISrO.js +0 -1
- package/dist/cli/env-CAU1nknN.js +0 -1
- package/dist/cli/seed-D6XijwbR.js +0 -1
- package/dist/options-63AKQNv0.js +0 -5
- package/dist/options-B-cxGmRA.js +0 -5
- package/dist/options-BPDiwSa-.js +0 -5
- package/dist/options-C6rEL6U5.js +0 -8
- package/dist/options-CE93HOYi.d.ts +0 -7
- package/dist/options-CTZNpb2n.js +0 -5
- package/dist/options-CrC78Tee.js +0 -5
- package/dist/options-DINdgVih.d.ts +0 -9
- package/dist/options-DWML05Cp.js +0 -5
- package/dist/options-Q1Bzgqpr.js +0 -5
|
@@ -5,7 +5,7 @@ import { n as Logger } from "../../logger-DWVYUmwi.js";
|
|
|
5
5
|
import { r as BlockTemporalOptions } from "../../block-helpers-CRpAHrp_.js";
|
|
6
6
|
import { a as dbTransport, i as RpcClient, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-DWZSJrwN.js";
|
|
7
7
|
import { a as BlockTransportMiddleware, d as extendBlock, f as withBlockHooks, n as BlockHooks, p as wrapTransport } from "../../block-hooks-DZN2w69m.js";
|
|
8
|
-
import { c as BlockOf } from "../../define-block-
|
|
8
|
+
import { c as BlockOf } from "../../define-block-CJWiDWa5.js";
|
|
9
9
|
//#region src/blocks/profiles/profiles.d.ts
|
|
10
10
|
interface ProfilesOptions<S extends StandardSchemaV1 | undefined = undefined> extends BlockTemporalOptions {
|
|
11
11
|
readonly transport: BlockTransport;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as isRecord } from "../../guards-6F2bCtQR.js";
|
|
2
2
|
import { a as ok, t as AsyncResult } from "../../result-ntFBW2p2.js";
|
|
3
|
-
import { t as profilesSqlOptions } from "../../options-
|
|
3
|
+
import { t as profilesSqlOptions } from "../../options-hynwKWuf.js";
|
|
4
4
|
import { B as dbTransport, H as rpcTransport, U as sqlTransport, n as applyTemporal, o as blockCall } from "../../block-helpers-CtBdjgO4.js";
|
|
5
5
|
import { i as wrapTransport, n as extendBlock, r as withBlockHooks } from "../../block-hooks-BfxX3682.js";
|
|
6
6
|
import { n as blockFields } from "../../block-fields-DE_FgpOU.js";
|
|
@@ -7,7 +7,7 @@ import { n as Logger } from "../../logger-DWVYUmwi.js";
|
|
|
7
7
|
import { n as BlockOptions } from "../../block-helpers-CRpAHrp_.js";
|
|
8
8
|
import { a as dbTransport, i as RpcClient, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-DWZSJrwN.js";
|
|
9
9
|
import { a as BlockTransportMiddleware, d as extendBlock, f as withBlockHooks, n as BlockHooks, p as wrapTransport } from "../../block-hooks-DZN2w69m.js";
|
|
10
|
-
import { c as BlockOf } from "../../define-block-
|
|
10
|
+
import { c as BlockOf } from "../../define-block-CJWiDWa5.js";
|
|
11
11
|
import { n as Money } from "../../money-BNRdJQzA.js";
|
|
12
12
|
import { g as PROMOTION_KINDS } from "../../codecs-CMWlhHZ0.js";
|
|
13
13
|
//#region src/blocks/promotions/promotions.d.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as dbError } from "../../errors-BVFgt8BZ.js";
|
|
2
2
|
import { n as isRecord } from "../../guards-6F2bCtQR.js";
|
|
3
3
|
import { t as AsyncResult } from "../../result-ntFBW2p2.js";
|
|
4
|
-
import { t as promotionsSqlOptions } from "../../options-
|
|
4
|
+
import { t as promotionsSqlOptions } from "../../options-9dSU5RML.js";
|
|
5
5
|
import { B as dbTransport, D as recordOf, H as rpcTransport, I as textOf, U as sqlTransport, m as instantArg, n as applyTemporal, o as blockCall } from "../../block-helpers-CtBdjgO4.js";
|
|
6
6
|
import { i as wrapTransport, n as extendBlock, r as withBlockHooks } from "../../block-hooks-BfxX3682.js";
|
|
7
7
|
import { n as event, t as defineEvents } from "../../event-map-CtPFhcOp.js";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference lib="esnext.temporal" />
|
|
1
2
|
import { T as ErrorMapper, t as AsyncResult } from "../../result-DZeA5KS6.js";
|
|
2
3
|
import { t as StandardSchemaV1 } from "../../standard-DBV730sF.js";
|
|
3
4
|
import { i as RowFields, r as FieldsOf } from "../../block-fields-BE7pInWZ.js";
|
|
@@ -6,9 +7,9 @@ import { n as Logger } from "../../logger-DWVYUmwi.js";
|
|
|
6
7
|
import { r as BlockTemporalOptions } from "../../block-helpers-CRpAHrp_.js";
|
|
7
8
|
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-DWZSJrwN.js";
|
|
8
9
|
import { n as BlockHooks } from "../../block-hooks-DZN2w69m.js";
|
|
9
|
-
import { c as BlockOf } from "../../define-block-
|
|
10
|
-
import { n as NotificationMessage, t as NotificationChannel } from "../../channel-
|
|
11
|
-
import { t as ExpoNotificationsLike } from "../../push-token-
|
|
10
|
+
import { c as BlockOf } from "../../define-block-CJWiDWa5.js";
|
|
11
|
+
import { n as NotificationMessage, t as NotificationChannel } from "../../channel-JcMd5lNP.js";
|
|
12
|
+
import { t as ExpoNotificationsLike } from "../../push-token-Cl2EihRc.js";
|
|
12
13
|
//#region src/blocks/push/push.d.ts
|
|
13
14
|
type PushPlatform = "ios" | "android" | "web";
|
|
14
15
|
type PushProvider = "expo" | "fcm" | "apns" | "webpush";
|
|
@@ -73,6 +74,28 @@ interface PushDevices<F extends object = Record<never, never>> {
|
|
|
73
74
|
readonly tokensFor: (userIds: readonly string[]) => AsyncResult<readonly PushTarget<F>[]>;
|
|
74
75
|
/** Service role: deletes the devices with `tokens`; resolves with how many. */
|
|
75
76
|
readonly prune: (tokens: readonly string[]) => AsyncResult<number>;
|
|
77
|
+
/**
|
|
78
|
+
* Service role: stores Expo's tickets for one notification delivery. Needs
|
|
79
|
+
* push module version 2 with the notifications block.
|
|
80
|
+
*/
|
|
81
|
+
readonly recordTickets: (deliveryId: string, tickets: readonly ExpoPushTicket[]) => AsyncResult<number>;
|
|
82
|
+
/** Service role: the tickets already stored for a delivery. */
|
|
83
|
+
readonly ticketsFor: (deliveryId: string) => AsyncResult<readonly ExpoPushTicket[]>;
|
|
84
|
+
/**
|
|
85
|
+
* Service role: reads the receipts of tickets older than `olderThan` (default
|
|
86
|
+
* 15 minutes), stores them, records `notification.delivered` or
|
|
87
|
+
* `notification.bounced` on their deliveries and prunes the devices Expo no
|
|
88
|
+
* longer reaches. Run it from a cron.
|
|
89
|
+
*/
|
|
90
|
+
readonly checkReceipts: (options?: CheckReceiptsOptions) => AsyncResult<ExpoReceiptResult>;
|
|
91
|
+
}
|
|
92
|
+
interface CheckReceiptsOptions {
|
|
93
|
+
/** Defaults to `expoPush({ devices })` over this client. */
|
|
94
|
+
readonly push?: ExpoPush;
|
|
95
|
+
/** Tickets per call, at most 1000. Default 1000. */
|
|
96
|
+
readonly limit?: number;
|
|
97
|
+
/** How long Expo needs before a receipt is ready. Default 15 minutes. */
|
|
98
|
+
readonly olderThan?: Temporal.Duration;
|
|
76
99
|
}
|
|
77
100
|
export declare function createPush<S extends StandardSchemaV1 | undefined = undefined>(options: PushDevicesOptions<S>): PushDevices<FieldsOf<S>>;
|
|
78
101
|
interface RegisterDeviceOptions {
|
|
@@ -147,11 +170,21 @@ interface ExpoPushTicket {
|
|
|
147
170
|
readonly error?: string;
|
|
148
171
|
readonly message?: string;
|
|
149
172
|
}
|
|
173
|
+
/** What Expo's receipt said about one ticket. */
|
|
174
|
+
interface ExpoPushReceipt {
|
|
175
|
+
readonly id: string;
|
|
176
|
+
readonly token: string;
|
|
177
|
+
readonly status: "ok" | "error";
|
|
178
|
+
readonly error?: string;
|
|
179
|
+
readonly message?: string;
|
|
180
|
+
}
|
|
150
181
|
interface ExpoReceiptResult {
|
|
151
182
|
readonly delivered: number;
|
|
152
183
|
readonly failed: readonly ExpoPushTicket[];
|
|
153
184
|
/** Tokens deleted because Expo reported `DeviceNotRegistered`. */
|
|
154
185
|
readonly pruned: number;
|
|
186
|
+
/** Every receipt Expo had ready; tickets without one stay unchecked. */
|
|
187
|
+
readonly receipts: readonly ExpoPushReceipt[];
|
|
155
188
|
}
|
|
156
189
|
interface ExpoPushOptions {
|
|
157
190
|
/** The Expo access token, when the project turns on push security. */
|
|
@@ -161,13 +194,37 @@ interface ExpoPushOptions {
|
|
|
161
194
|
readonly fetch?: typeof fetch;
|
|
162
195
|
/** Defaults to `https://exp.host/--/api/v2/push`. */
|
|
163
196
|
readonly endpoint?: string;
|
|
197
|
+
/**
|
|
198
|
+
* Retries of one request after a 429, a 5xx or a network error, waiting for
|
|
199
|
+
* `Retry-After` (at most 30 seconds) or 1, 2, 4 seconds. Default 3.
|
|
200
|
+
*/
|
|
201
|
+
readonly maxRetries?: number;
|
|
202
|
+
/** Waits between retries. Defaults to `setTimeout`. */
|
|
203
|
+
readonly sleep?: (milliseconds: number) => Promise<void>;
|
|
164
204
|
}
|
|
205
|
+
interface ExpoSendOptions {
|
|
206
|
+
/**
|
|
207
|
+
* Sent as the `idempotency-key` header per request, suffixed with the chunk
|
|
208
|
+
* number, e.g. the notification delivery id.
|
|
209
|
+
*/
|
|
210
|
+
readonly idempotencyKey?: string;
|
|
211
|
+
/**
|
|
212
|
+
* Tickets an earlier attempt stored: tokens with a ticket id or
|
|
213
|
+
* `DeviceNotRegistered` are not sent again, and a chunk whose tokens all have
|
|
214
|
+
* one is skipped.
|
|
215
|
+
*/
|
|
216
|
+
readonly sent?: readonly ExpoPushTicket[];
|
|
217
|
+
}
|
|
218
|
+
/** The error of every ticket in a chunk whose request failed after its retries. */
|
|
219
|
+
export declare const EXPO_REQUEST_FAILED = "RequestFailed";
|
|
165
220
|
interface ExpoPush {
|
|
166
221
|
/**
|
|
167
222
|
* Sends `message` to each token, 100 per request; tickets come back in token
|
|
168
|
-
* order.
|
|
223
|
+
* order. A request that still fails after its retries gives its tokens a
|
|
224
|
+
* `RequestFailed` ticket instead of throwing, so chunks already sent keep
|
|
225
|
+
* their tickets.
|
|
169
226
|
*/
|
|
170
|
-
readonly send: (tokens: readonly string[], message: ExpoPushMessage) => Promise<readonly ExpoPushTicket[]>;
|
|
227
|
+
readonly send: (tokens: readonly string[], message: ExpoPushMessage, options?: ExpoSendOptions) => Promise<readonly ExpoPushTicket[]>;
|
|
171
228
|
/**
|
|
172
229
|
* Reads the receipts for tickets that have an id, about 15 minutes after
|
|
173
230
|
* sending, and prunes the devices Expo no longer reaches.
|
|
@@ -188,14 +245,23 @@ interface ExpoPushChannelOptions {
|
|
|
188
245
|
readonly name?: string;
|
|
189
246
|
/** Overrides the message built from the notification and its rendered text. */
|
|
190
247
|
readonly message?: (message: NotificationMessage) => ExpoPushMessage;
|
|
191
|
-
/**
|
|
248
|
+
/**
|
|
249
|
+
* Stores each delivery's tickets in `push_tickets`, so a retried delivery
|
|
250
|
+
* skips the devices Expo already accepted and `devices.checkReceipts()` can
|
|
251
|
+
* confirm them. Needs push module version 2 with the notifications block.
|
|
252
|
+
* Default `true`.
|
|
253
|
+
*/
|
|
254
|
+
readonly storeTickets?: boolean;
|
|
255
|
+
/** Receives the tickets, to check their receipts yourself. */
|
|
192
256
|
readonly onTickets?: (tickets: readonly ExpoPushTicket[], message: NotificationMessage) => void | Promise<void>;
|
|
193
257
|
}
|
|
194
258
|
/**
|
|
195
259
|
* A notifications channel that pushes each delivery to the recipient's Expo
|
|
196
|
-
* devices. A recipient without devices is `skipped
|
|
197
|
-
*
|
|
198
|
-
*
|
|
260
|
+
* devices. A recipient without devices is `skipped`. It throws, so the delivery
|
|
261
|
+
* is retried, when a request to Expo failed after its own retries or when every
|
|
262
|
+
* ticket failed for a reason other than an unregistered device. The retry sends
|
|
263
|
+
* only to the devices without a stored ticket, with the delivery id as the
|
|
264
|
+
* idempotency key.
|
|
199
265
|
*
|
|
200
266
|
* ```ts
|
|
201
267
|
* createNotifications({
|
|
@@ -220,4 +286,4 @@ export declare const pushEvents: Events<PushEvents>;
|
|
|
220
286
|
/** The `push` block's manifest (ADR 0029). */
|
|
221
287
|
export declare const pushBlock: BlockOf<"push", typeof createPush, PushEvents>;
|
|
222
288
|
//#endregion
|
|
223
|
-
export { type BlockTransport, type ExpoNotificationsLike, type ExpoPush, type ExpoPushChannelOptions, type ExpoPushMessage, type ExpoPushOptions, type ExpoPushTicket, type ExpoReceiptResult, type PushDeviceInput, type PushDevices, type PushDevicesOptions, type PushEvents, type PushPlatform, type PushProvider, type PushTarget, type RegisterDeviceOptions, type RegisteredDevice, dbTransport, rpcTransport, sqlTransport };
|
|
289
|
+
export { type BlockTransport, type CheckReceiptsOptions, type ExpoNotificationsLike, type ExpoPush, type ExpoPushChannelOptions, type ExpoPushMessage, type ExpoPushOptions, type ExpoPushReceipt, type ExpoPushTicket, type ExpoReceiptResult, type ExpoSendOptions, type PushDeviceInput, type PushDevices, type PushDevicesOptions, type PushEvents, type PushPlatform, type PushProvider, type PushTarget, type RegisterDeviceOptions, type RegisteredDevice, dbTransport, rpcTransport, sqlTransport };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { t as
|
|
1
|
+
import { t as temporal } from "../../temporal-required-Dy0GGD8E.js";
|
|
2
|
+
import { t as pushSqlOptions } from "../../options-BR9xTHZW.js";
|
|
2
3
|
import { t as expoPushToken } from "../../push-token-D6REHMMw.js";
|
|
3
4
|
import { B as dbTransport, H as rpcTransport, I as textOf, O as recordOrEmpty, U as sqlTransport, j as run, k as recordsOf, n as applyTemporal, o as blockCall } from "../../block-helpers-CtBdjgO4.js";
|
|
4
5
|
import { r as withBlockHooks } from "../../block-hooks-BfxX3682.js";
|
|
@@ -36,11 +37,29 @@ function targetsOf(value) {
|
|
|
36
37
|
}] : [];
|
|
37
38
|
});
|
|
38
39
|
}
|
|
40
|
+
function ticketsOf(value) {
|
|
41
|
+
return recordsOf(value, "push_tickets_for").map((row) => {
|
|
42
|
+
const id = row["id"];
|
|
43
|
+
const error = row["error"];
|
|
44
|
+
return {
|
|
45
|
+
token: textOf(row["token"]),
|
|
46
|
+
...typeof id === "string" ? { id } : {},
|
|
47
|
+
...typeof error === "string" ? { error } : {}
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function uncheckedOf(value) {
|
|
52
|
+
return recordsOf(value, "unchecked_push_tickets").map((row) => ({
|
|
53
|
+
id: textOf(row["id"]),
|
|
54
|
+
token: textOf(row["token"])
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
const countOf = (value) => typeof value === "number" ? value : Number(value ?? 0);
|
|
39
58
|
function createPush(options) {
|
|
40
59
|
applyTemporal(options);
|
|
41
60
|
const call = blockCall(options.transport, options.schema, options.mappers);
|
|
42
61
|
const fields = blockFields(options.fields, "push device fields");
|
|
43
|
-
|
|
62
|
+
const client = {
|
|
44
63
|
register: (device) => writeFields(fields, device.fields, (checked) => call("register_push_device", {
|
|
45
64
|
token: device.token,
|
|
46
65
|
platform: device.platform,
|
|
@@ -51,8 +70,33 @@ function createPush(options) {
|
|
|
51
70
|
}, textOf)),
|
|
52
71
|
unregister: (token) => call("unregister_push_device", { token }, (value) => value === true),
|
|
53
72
|
tokensFor: (userIds) => call("push_tokens_for", { users: [...userIds] }, targetsOf).andThen((targets) => readAllFields(fields, targets)),
|
|
54
|
-
prune: (tokens) => call("prune_push_tokens", { tokens: [...tokens] },
|
|
55
|
-
|
|
73
|
+
prune: (tokens) => call("prune_push_tokens", { tokens: [...tokens] }, countOf),
|
|
74
|
+
recordTickets: (deliveryId, tickets) => call("record_push_tickets", {
|
|
75
|
+
delivery: deliveryId,
|
|
76
|
+
tickets: tickets.map((ticket) => ({
|
|
77
|
+
token: ticket.token,
|
|
78
|
+
id: ticket.id ?? null,
|
|
79
|
+
error: ticket.error ?? null
|
|
80
|
+
}))
|
|
81
|
+
}, countOf),
|
|
82
|
+
ticketsFor: (deliveryId) => call("push_tickets_for", { delivery: deliveryId }, ticketsOf),
|
|
83
|
+
checkReceipts: (checks = {}) => run(async () => {
|
|
84
|
+
const push = checks.push ?? expoPush({ devices: client });
|
|
85
|
+
const tickets = await call("unchecked_push_tickets", {
|
|
86
|
+
max_items: checks.limit ?? 1e3,
|
|
87
|
+
older_than: (checks.olderThan ?? temporal().Duration.from({ minutes: 15 })).toString()
|
|
88
|
+
}, uncheckedOf).orThrow();
|
|
89
|
+
const result = await push.checkReceipts(tickets);
|
|
90
|
+
if (result.receipts.length > 0) await call("complete_push_receipts", { receipts: result.receipts.map((receipt) => ({
|
|
91
|
+
id: receipt.id,
|
|
92
|
+
status: receipt.status,
|
|
93
|
+
error: receipt.error ?? null,
|
|
94
|
+
message: receipt.message ?? null
|
|
95
|
+
})) }, countOf).orThrow();
|
|
96
|
+
return result;
|
|
97
|
+
})
|
|
98
|
+
};
|
|
99
|
+
return withBlockHooks(client, options.hooks, {
|
|
56
100
|
block: "push",
|
|
57
101
|
...options.logger ? { logger: options.logger } : {}
|
|
58
102
|
});
|
|
@@ -109,6 +153,8 @@ function unregisterOnSignOut(options) {
|
|
|
109
153
|
return options.signOut();
|
|
110
154
|
};
|
|
111
155
|
}
|
|
156
|
+
/** The error of every ticket in a chunk whose request failed after its retries. */
|
|
157
|
+
const EXPO_REQUEST_FAILED = "RequestFailed";
|
|
112
158
|
const SEND_CHUNK = 100;
|
|
113
159
|
const RECEIPT_CHUNK = 1e3;
|
|
114
160
|
const NOT_REGISTERED = "DeviceNotRegistered";
|
|
@@ -117,6 +163,20 @@ function chunks(items, size) {
|
|
|
117
163
|
for (let at = 0; at < items.length; at += size) out.push(items.slice(at, at + size));
|
|
118
164
|
return out;
|
|
119
165
|
}
|
|
166
|
+
const MAX_WAIT = 3e4;
|
|
167
|
+
const wait = (milliseconds) => new Promise((resolve) => {
|
|
168
|
+
setTimeout(resolve, milliseconds);
|
|
169
|
+
});
|
|
170
|
+
const retryable = (status) => status === 429 || status >= 500;
|
|
171
|
+
/** `Retry-After` in seconds or as a date, else 1, 2, 4 seconds; at most 30. */
|
|
172
|
+
function backoff(attempt, retryAfter) {
|
|
173
|
+
if (retryAfter !== null) {
|
|
174
|
+
const seconds = Number(retryAfter);
|
|
175
|
+
const milliseconds = Number.isFinite(seconds) ? seconds * 1e3 : Date.parse(retryAfter) - Date.now();
|
|
176
|
+
if (Number.isFinite(milliseconds) && milliseconds >= 0) return Math.min(milliseconds, MAX_WAIT);
|
|
177
|
+
}
|
|
178
|
+
return Math.min(1e3 * 2 ** attempt, MAX_WAIT);
|
|
179
|
+
}
|
|
120
180
|
function errorCode(entry) {
|
|
121
181
|
const code = recordOrEmpty(entry["details"])["error"];
|
|
122
182
|
return typeof code === "string" ? code : "Unknown";
|
|
@@ -129,21 +189,42 @@ function errorCode(entry) {
|
|
|
129
189
|
function expoPush(options = {}) {
|
|
130
190
|
const endpoint = options.endpoint ?? "https://exp.host/--/api/v2/push";
|
|
131
191
|
const doFetch = options.fetch ?? globalThis.fetch;
|
|
192
|
+
const maxRetries = Math.max(0, options.maxRetries ?? 3);
|
|
193
|
+
const sleep = options.sleep ?? wait;
|
|
132
194
|
const headers = {
|
|
133
195
|
accept: "application/json",
|
|
134
196
|
"content-type": "application/json",
|
|
135
197
|
...options.accessToken ? { authorization: `Bearer ${options.accessToken}` } : {}
|
|
136
198
|
};
|
|
137
|
-
const post = async (path, body) => {
|
|
138
|
-
const
|
|
199
|
+
const post = async (path, body, idempotencyKey) => {
|
|
200
|
+
const init = {
|
|
139
201
|
method: "POST",
|
|
140
|
-
headers
|
|
202
|
+
headers: {
|
|
203
|
+
...headers,
|
|
204
|
+
...idempotencyKey === void 0 ? {} : { "idempotency-key": idempotencyKey }
|
|
205
|
+
},
|
|
141
206
|
body: JSON.stringify(body)
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
207
|
+
};
|
|
208
|
+
for (let attempt = 0;; attempt += 1) {
|
|
209
|
+
let response;
|
|
210
|
+
try {
|
|
211
|
+
response = await doFetch(`${endpoint}/${path}`, init);
|
|
212
|
+
} catch (error) {
|
|
213
|
+
if (attempt >= maxRetries) throw error;
|
|
214
|
+
await sleep(backoff(attempt, null));
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
const text = await response.text();
|
|
218
|
+
if (response.ok) {
|
|
219
|
+
const parsed = text === "" ? {} : JSON.parse(text);
|
|
220
|
+
return recordOrEmpty(parsed)["data"];
|
|
221
|
+
}
|
|
222
|
+
if (attempt < maxRetries && retryable(response.status)) {
|
|
223
|
+
await sleep(backoff(attempt, response.headers.get("retry-after")));
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
throw new Error(`Expo Push API ${path} answered ${String(response.status)}: ${text.slice(0, 500)}`);
|
|
227
|
+
}
|
|
147
228
|
};
|
|
148
229
|
const prune = async (tokens) => {
|
|
149
230
|
if (!options.devices || tokens.length === 0) return 0;
|
|
@@ -151,29 +232,51 @@ function expoPush(options = {}) {
|
|
|
151
232
|
for (const chunk of chunks([...new Set(tokens)], RECEIPT_CHUNK)) pruned += await options.devices.prune(chunk).orThrow();
|
|
152
233
|
return pruned;
|
|
153
234
|
};
|
|
235
|
+
const sendChunk = async (tokens, message, idempotencyKey) => {
|
|
236
|
+
let data;
|
|
237
|
+
try {
|
|
238
|
+
data = await post("send", tokens.map((to) => ({
|
|
239
|
+
...message,
|
|
240
|
+
to
|
|
241
|
+
})), idempotencyKey);
|
|
242
|
+
} catch (error) {
|
|
243
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
244
|
+
return tokens.map((token) => ({
|
|
245
|
+
token,
|
|
246
|
+
error: EXPO_REQUEST_FAILED,
|
|
247
|
+
message: reason.slice(0, 500)
|
|
248
|
+
}));
|
|
249
|
+
}
|
|
250
|
+
const list = Array.isArray(data) ? data : [];
|
|
251
|
+
return tokens.map((token, at) => {
|
|
252
|
+
const entry = recordOrEmpty(list[at]);
|
|
253
|
+
const text = typeof entry["message"] === "string" ? entry["message"] : void 0;
|
|
254
|
+
return entry["status"] === "ok" && typeof entry["id"] === "string" ? {
|
|
255
|
+
token,
|
|
256
|
+
id: entry["id"]
|
|
257
|
+
} : {
|
|
258
|
+
token,
|
|
259
|
+
error: errorCode(entry),
|
|
260
|
+
...text === void 0 ? {} : { message: text }
|
|
261
|
+
};
|
|
262
|
+
});
|
|
263
|
+
};
|
|
154
264
|
return {
|
|
155
|
-
send: async (tokens, message) => {
|
|
265
|
+
send: async (tokens, message, sendOptions = {}) => {
|
|
266
|
+
const done = new Map((sendOptions.sent ?? []).filter((ticket) => ticket.id !== void 0 || ticket.error === NOT_REGISTERED).map((ticket) => [ticket.token, ticket]));
|
|
156
267
|
const tickets = [];
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
const
|
|
163
|
-
for (const
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
tickets.push(entry["status"] === "ok" && typeof entry["id"] === "string" ? {
|
|
167
|
-
token,
|
|
168
|
-
id: entry["id"]
|
|
169
|
-
} : {
|
|
170
|
-
token,
|
|
171
|
-
error: errorCode(entry),
|
|
172
|
-
...message === void 0 ? {} : { message }
|
|
173
|
-
});
|
|
268
|
+
const fresh = [];
|
|
269
|
+
for (const [index, chunk] of chunks(tokens, SEND_CHUNK).entries()) {
|
|
270
|
+
const pending = chunk.filter((token) => !done.has(token));
|
|
271
|
+
const sent = pending.length === 0 ? [] : await sendChunk(pending, message, sendOptions.idempotencyKey === void 0 ? void 0 : `${sendOptions.idempotencyKey}:${String(index)}`);
|
|
272
|
+
fresh.push(...sent);
|
|
273
|
+
const byToken = new Map(sent.map((ticket) => [ticket.token, ticket]));
|
|
274
|
+
for (const token of chunk) {
|
|
275
|
+
const ticket = done.get(token) ?? byToken.get(token);
|
|
276
|
+
if (ticket) tickets.push(ticket);
|
|
174
277
|
}
|
|
175
278
|
}
|
|
176
|
-
await prune(
|
|
279
|
+
await prune(fresh.filter((ticket) => ticket.error === NOT_REGISTERED).map((ticket) => ticket.token));
|
|
177
280
|
return tickets;
|
|
178
281
|
},
|
|
179
282
|
checkReceipts: async (tickets) => {
|
|
@@ -181,22 +284,37 @@ function expoPush(options = {}) {
|
|
|
181
284
|
for (const ticket of tickets) if (ticket.id !== void 0) byId.set(ticket.id, ticket.token);
|
|
182
285
|
let delivered = 0;
|
|
183
286
|
const failed = [];
|
|
287
|
+
const receipts = [];
|
|
184
288
|
for (const ids of chunks([...byId.keys()], RECEIPT_CHUNK)) {
|
|
185
|
-
const
|
|
289
|
+
const answered = recordOrEmpty(await post("getReceipts", { ids }));
|
|
186
290
|
for (const id of ids) {
|
|
187
|
-
const receipt =
|
|
291
|
+
const receipt = answered[id];
|
|
188
292
|
if (receipt === void 0) continue;
|
|
189
293
|
const entry = recordOrEmpty(receipt);
|
|
294
|
+
const token = byId.get(id) ?? "";
|
|
190
295
|
if (entry["status"] === "ok") {
|
|
191
296
|
delivered += 1;
|
|
297
|
+
receipts.push({
|
|
298
|
+
id,
|
|
299
|
+
token,
|
|
300
|
+
status: "ok"
|
|
301
|
+
});
|
|
192
302
|
continue;
|
|
193
303
|
}
|
|
194
|
-
const
|
|
195
|
-
|
|
196
|
-
token
|
|
304
|
+
const text = typeof entry["message"] === "string" ? entry["message"] : void 0;
|
|
305
|
+
const ticket = {
|
|
306
|
+
token,
|
|
197
307
|
id,
|
|
198
308
|
error: errorCode(entry),
|
|
199
|
-
...
|
|
309
|
+
...text === void 0 ? {} : { message: text }
|
|
310
|
+
};
|
|
311
|
+
failed.push(ticket);
|
|
312
|
+
receipts.push({
|
|
313
|
+
id,
|
|
314
|
+
token,
|
|
315
|
+
status: "error",
|
|
316
|
+
error: errorCode(entry),
|
|
317
|
+
...text === void 0 ? {} : { message: text }
|
|
200
318
|
});
|
|
201
319
|
}
|
|
202
320
|
}
|
|
@@ -204,7 +322,8 @@ function expoPush(options = {}) {
|
|
|
204
322
|
return {
|
|
205
323
|
delivered,
|
|
206
324
|
failed,
|
|
207
|
-
pruned
|
|
325
|
+
pruned,
|
|
326
|
+
receipts
|
|
208
327
|
};
|
|
209
328
|
}
|
|
210
329
|
};
|
|
@@ -224,9 +343,11 @@ function defaultMessage(message) {
|
|
|
224
343
|
}
|
|
225
344
|
/**
|
|
226
345
|
* A notifications channel that pushes each delivery to the recipient's Expo
|
|
227
|
-
* devices. A recipient without devices is `skipped
|
|
228
|
-
*
|
|
229
|
-
*
|
|
346
|
+
* devices. A recipient without devices is `skipped`. It throws, so the delivery
|
|
347
|
+
* is retried, when a request to Expo failed after its own retries or when every
|
|
348
|
+
* ticket failed for a reason other than an unregistered device. The retry sends
|
|
349
|
+
* only to the devices without a stored ticket, with the delivery id as the
|
|
350
|
+
* idempotency key.
|
|
230
351
|
*
|
|
231
352
|
* ```ts
|
|
232
353
|
* createNotifications({
|
|
@@ -247,8 +368,16 @@ function expoPushChannel(options) {
|
|
|
247
368
|
status: "skipped",
|
|
248
369
|
provider: "expo"
|
|
249
370
|
};
|
|
250
|
-
const
|
|
371
|
+
const store = options.storeTickets ?? true;
|
|
372
|
+
const stored = store ? await options.devices.ticketsFor(message.deliveryId).orThrow() : [];
|
|
373
|
+
const tickets = await options.push.send(tokens, build(message), {
|
|
374
|
+
idempotencyKey: message.deliveryId,
|
|
375
|
+
sent: stored
|
|
376
|
+
});
|
|
377
|
+
if (store) await options.devices.recordTickets(message.deliveryId, tickets).orThrow();
|
|
251
378
|
await options.onTickets?.(tickets, message);
|
|
379
|
+
const failed = tickets.find((ticket) => ticket.error === EXPO_REQUEST_FAILED);
|
|
380
|
+
if (failed) throw new Error(`Expo push request failed: ${failed.message ?? "RequestFailed"}`);
|
|
252
381
|
const sent = tickets.find((ticket) => ticket.id !== void 0);
|
|
253
382
|
if (sent?.id !== void 0) return {
|
|
254
383
|
provider: "expo",
|
|
@@ -283,4 +412,4 @@ const pushBlock = defineBlock({
|
|
|
283
412
|
recipes: ["push-opt-in"]
|
|
284
413
|
});
|
|
285
414
|
//#endregion
|
|
286
|
-
export { createPush, dbTransport, expoPush, expoPushChannel, pushBlock, pushEvents, registerDevice, rpcTransport, sqlTransport, unregisterOnSignOut };
|
|
415
|
+
export { EXPO_REQUEST_FAILED, createPush, dbTransport, expoPush, expoPushChannel, pushBlock, pushEvents, registerDevice, rpcTransport, sqlTransport, unregisterOnSignOut };
|
|
@@ -9,7 +9,7 @@ import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTrans
|
|
|
9
9
|
import { n as BlockHooks } from "../../block-hooks-DZN2w69m.js";
|
|
10
10
|
import { a as ProblemFormat, t as BlockProblemOptions } from "../../problem-DNwN8iGz.js";
|
|
11
11
|
import { A as DeadJobRow, B as sqlQueueProvider, C as RunSchedulesOptions, D as ScheduleInfo, E as ScheduleFilter, F as QueuePurgeArgs, I as QueueRpcClient, L as QueueStats, M as QueueMessageBody, N as QueueMessageRow, O as ScheduleOptions, P as QueueProvider, R as TransportQueueProviderOptions, S as RetryDeadOptions, T as ScheduleDefinitions, V as transportQueueProvider, _ as ListDeadOptions, a as DrainResult, b as QueueOptions, c as EnqueueOnceOptions, d as EnsureSchedulesOptions, f as EnsureSchedulesResult, g as JobHandler, h as JobContext, i as DrainOptions, j as DueSchedule, k as WorkOptions, l as EnqueueOnceResult, m as Job, n as DeadJob, o as DrainRouteOptions, p as FailOptions, r as DrainMonitor, s as DrainRouteResult, t as ClaimOptions, u as EnqueueOptions, v as PurgeJobsOptions, w as ScheduleDefinition, x as QueueSchemas, y as Queue, z as pgmqPublicBackend } from "../../types-Czq9Xtpa.js";
|
|
12
|
-
import { Xt as BlockSchedule, c as BlockOf } from "../../define-block-
|
|
12
|
+
import { Xt as BlockSchedule, c as BlockOf } from "../../define-block-CJWiDWa5.js";
|
|
13
13
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
14
14
|
//#region src/blocks/queue/cron.d.ts
|
|
15
15
|
/**
|
|
@@ -8,7 +8,7 @@ import { n as allTenantsContext } from "../../plugin-AKwwe2gF.js";
|
|
|
8
8
|
import { n as validate } from "../../standard-BA3mLh6w.js";
|
|
9
9
|
import { o as problemResponse } from "../../problem-Bf0cJ7tk.js";
|
|
10
10
|
import { o as tenantFrom, s as tenantPathsFor } from "../../claims-Bp9My7XP.js";
|
|
11
|
-
import { n as rateLimitSqlOptions, r as webhookInboxSqlOptions, t as queueSqlOptions } from "../../options-
|
|
11
|
+
import { n as rateLimitSqlOptions, r as webhookInboxSqlOptions, t as queueSqlOptions } from "../../options-B2Kz_tCx.js";
|
|
12
12
|
import { B as dbTransport, H as rpcTransport, M as seconds, P as sleep, R as toInstant, U as sqlTransport, f as errorText, g as leaseHeartbeat, j as run, n as applyTemporal, o as blockCall, s as budget, w as pageOf } from "../../block-helpers-CtBdjgO4.js";
|
|
13
13
|
import { r as withBlockHooks } from "../../block-hooks-BfxX3682.js";
|
|
14
14
|
import { t as cronRoute } from "../../cron-route-UU9i5i9J.js";
|
|
@@ -9,7 +9,7 @@ import { n as Logger } from "../../logger-DWVYUmwi.js";
|
|
|
9
9
|
import { r as BlockTemporalOptions } from "../../block-helpers-CRpAHrp_.js";
|
|
10
10
|
import { a as dbTransport, i as RpcClient, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-DWZSJrwN.js";
|
|
11
11
|
import { a as BlockTransportMiddleware, d as extendBlock, f as withBlockHooks, n as BlockHooks, p as wrapTransport } from "../../block-hooks-DZN2w69m.js";
|
|
12
|
-
import { Zt as DefaultAutomation, c as BlockOf } from "../../define-block-
|
|
12
|
+
import { Zt as DefaultAutomation, c as BlockOf } from "../../define-block-CJWiDWa5.js";
|
|
13
13
|
import { n as Money } from "../../money-BNRdJQzA.js";
|
|
14
14
|
import { i as Totals, n as Line, r as LineInput, t as CatalogLineInput } from "../../sales-lines-Bk4mbLH1.js";
|
|
15
15
|
//#region src/blocks/quotes/quotes.d.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as isRecord } from "../../guards-6F2bCtQR.js";
|
|
2
2
|
import { t as AsyncResult } from "../../result-ntFBW2p2.js";
|
|
3
|
-
import { n as QUOTE_TO_ORDER, r as quotesSqlOptions, t as QUOTES_AUTOMATIONS } from "../../automations-
|
|
3
|
+
import { n as QUOTE_TO_ORDER, r as quotesSqlOptions, t as QUOTES_AUTOMATIONS } from "../../automations-B5P6vTvk.js";
|
|
4
4
|
import { A as requiredInstant, B as dbTransport, C as optionalText, D as recordOf, H as rpcTransport, I as textOf, S as optionalInstant, U as sqlTransport, a as bigintOf, d as enumOrThrow, k as recordsOf, n as applyTemporal, o as blockCall } from "../../block-helpers-CtBdjgO4.js";
|
|
5
5
|
import { i as wrapTransport, n as extendBlock, r as withBlockHooks } from "../../block-hooks-BfxX3682.js";
|
|
6
6
|
import { n as event, t as defineEvents } from "../../event-map-CtPFhcOp.js";
|
|
@@ -3,7 +3,7 @@ import { n as Logger } from "../../logger-DWVYUmwi.js";
|
|
|
3
3
|
import { n as BlockOptions } from "../../block-helpers-CRpAHrp_.js";
|
|
4
4
|
import { n as BlockHooks } from "../../block-hooks-DZN2w69m.js";
|
|
5
5
|
import { g as JobHandler } from "../../types-Czq9Xtpa.js";
|
|
6
|
-
import { c as BlockOf } from "../../define-block-
|
|
6
|
+
import { c as BlockOf } from "../../define-block-CJWiDWa5.js";
|
|
7
7
|
import { n as rankBetweenResult, t as RankNeighbors } from "../../rank-result-Bwe7igy-.js";
|
|
8
8
|
//#region src/core/rank-keys.d.ts
|
|
9
9
|
/** The queue `move()` enqueues on when a key grows past 24 digits. */
|
|
@@ -6,10 +6,10 @@ import { n as Logger } from "../../logger-DWVYUmwi.js";
|
|
|
6
6
|
import { a as BlockTenantOptions, r as BlockTemporalOptions } from "../../block-helpers-CRpAHrp_.js";
|
|
7
7
|
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-DWZSJrwN.js";
|
|
8
8
|
import { n as BlockHooks } from "../../block-hooks-DZN2w69m.js";
|
|
9
|
-
import { c as BlockOf } from "../../define-block-
|
|
10
|
-
import { p as SubscriptionStatus } from "../../topic-
|
|
11
|
-
import { n as TopicPort } from "../../watch-topic-
|
|
12
|
-
import { n as Controller, t as AuthPort } from "../../controller-
|
|
9
|
+
import { c as BlockOf } from "../../define-block-CJWiDWa5.js";
|
|
10
|
+
import { p as SubscriptionStatus } from "../../topic-nQYxoTaU.js";
|
|
11
|
+
import { n as TopicPort } from "../../watch-topic-UGSEWAqR.js";
|
|
12
|
+
import { n as Controller, t as AuthPort } from "../../controller-BR7CZ1R9.js";
|
|
13
13
|
//#region src/blocks/reactions/reactions.d.ts
|
|
14
14
|
interface ReactionsOptions extends BlockTemporalOptions, BlockTenantOptions {
|
|
15
15
|
readonly transport: BlockTransport;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as reactionsSqlOptions } from "../../options-
|
|
1
|
+
import { t as reactionsSqlOptions } from "../../options-BtjkzIVh.js";
|
|
2
2
|
import { n as whileSignedIn, t as defineController } from "../../controller-BEliOBOv.js";
|
|
3
3
|
import { A as requiredInstant, B as dbTransport, C as optionalText, D as recordOf, H as rpcTransport, I as textOf, U as sqlTransport, k as recordsOf, n as applyTemporal, o as blockCall } from "../../block-helpers-CtBdjgO4.js";
|
|
4
4
|
import { r as withBlockHooks } from "../../block-hooks-BfxX3682.js";
|
|
@@ -7,7 +7,7 @@ import { n as Logger } from "../../logger-DWVYUmwi.js";
|
|
|
7
7
|
import { a as BlockTenantOptions } from "../../block-helpers-CRpAHrp_.js";
|
|
8
8
|
import { t as BlockTransport } from "../../block-transport-DWZSJrwN.js";
|
|
9
9
|
import { n as BlockHooks } from "../../block-hooks-DZN2w69m.js";
|
|
10
|
-
import { Sn as EntitySchema, c as BlockOf, ln as RecordBindingWrite, rn as RecordBinding } from "../../define-block-
|
|
10
|
+
import { Sn as EntitySchema, c as BlockOf, ln as RecordBindingWrite, rn as RecordBinding } from "../../define-block-CJWiDWa5.js";
|
|
11
11
|
import { a as UndoToken } from "../../undo-B1jwnVyN.js";
|
|
12
12
|
//#region src/blocks/relations/relations.d.ts
|
|
13
13
|
interface LinkInput<F extends object = Record<never, never>> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as isRecord } from "../../guards-6F2bCtQR.js";
|
|
2
|
-
import { t as relationsSqlOptions } from "../../options-
|
|
2
|
+
import { t as relationsSqlOptions } from "../../options-BQunK6_Y.js";
|
|
3
3
|
import { C as optionalText, D as recordOf, I as textOf, k as recordsOf, o as blockCall } from "../../block-helpers-CtBdjgO4.js";
|
|
4
4
|
import { r as withBlockHooks } from "../../block-hooks-BfxX3682.js";
|
|
5
5
|
import { n as entitySchema } from "../../entity-schema-BDv6w-OQ.js";
|
|
@@ -9,7 +9,7 @@ import { a as BlockTenantOptions } from "../../block-helpers-CRpAHrp_.js";
|
|
|
9
9
|
import { t as BlockTransport } from "../../block-transport-DWZSJrwN.js";
|
|
10
10
|
import { n as BlockHooks } from "../../block-hooks-DZN2w69m.js";
|
|
11
11
|
import { g as JobHandler } from "../../types-Czq9Xtpa.js";
|
|
12
|
-
import { I as Notifier, c as BlockOf } from "../../define-block-
|
|
12
|
+
import { I as Notifier, c as BlockOf } from "../../define-block-CJWiDWa5.js";
|
|
13
13
|
import { g as SubscriberPolicy, i as AuthorizationHooks } from "../../authorization-hooks-D_pwXlBs.js";
|
|
14
14
|
//#region src/blocks/reminders/rrule.d.ts
|
|
15
15
|
interface ExpandInput {
|
|
@@ -2,7 +2,7 @@ import { n as dbError, o as isDbError } from "../../errors-BVFgt8BZ.js";
|
|
|
2
2
|
import { n as isRecord } from "../../guards-6F2bCtQR.js";
|
|
3
3
|
import { t as temporal } from "../../temporal-required-Dy0GGD8E.js";
|
|
4
4
|
import { a as ok, r as err, t as AsyncResult } from "../../result-ntFBW2p2.js";
|
|
5
|
-
import { t as remindersSqlOptions } from "../../options-
|
|
5
|
+
import { t as remindersSqlOptions } from "../../options-p49DFg3H.js";
|
|
6
6
|
import { C as optionalText, D as recordOf, I as textOf, k as recordsOf, o as blockCall } from "../../block-helpers-CtBdjgO4.js";
|
|
7
7
|
import { r as withBlockHooks } from "../../block-hooks-BfxX3682.js";
|
|
8
8
|
import { n as event, t as defineEvents } from "../../event-map-CtPFhcOp.js";
|
|
@@ -7,7 +7,7 @@ import { n as Logger } from "../../logger-DWVYUmwi.js";
|
|
|
7
7
|
import { r as BlockTemporalOptions } from "../../block-helpers-CRpAHrp_.js";
|
|
8
8
|
import { a as dbTransport, i as RpcClient, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-DWZSJrwN.js";
|
|
9
9
|
import { a as BlockTransportMiddleware, d as extendBlock, f as withBlockHooks, n as BlockHooks, p as wrapTransport } from "../../block-hooks-DZN2w69m.js";
|
|
10
|
-
import { c as BlockOf } from "../../define-block-
|
|
10
|
+
import { c as BlockOf } from "../../define-block-CJWiDWa5.js";
|
|
11
11
|
//#region src/blocks/reviews/reviews.d.ts
|
|
12
12
|
interface ReviewsOptions<S extends StandardSchemaV1 | undefined = undefined> extends BlockTemporalOptions {
|
|
13
13
|
readonly transport: BlockTransport;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as isRecord } from "../../guards-6F2bCtQR.js";
|
|
2
2
|
import { t as AsyncResult } from "../../result-ntFBW2p2.js";
|
|
3
|
-
import { t as reviewsSqlOptions } from "../../options-
|
|
3
|
+
import { t as reviewsSqlOptions } from "../../options-DJbN3bi9.js";
|
|
4
4
|
import { A as requiredInstant, B as dbTransport, C as optionalText, D as recordOf, H as rpcTransport, I as textOf, S as optionalInstant, U as sqlTransport, d as enumOrThrow, k as recordsOf, m as instantArg, n as applyTemporal, o as blockCall } from "../../block-helpers-CtBdjgO4.js";
|
|
5
5
|
import { i as wrapTransport, n as extendBlock, r as withBlockHooks } from "../../block-hooks-BfxX3682.js";
|
|
6
6
|
import { n as event, t as defineEvents } from "../../event-map-CtPFhcOp.js";
|