@lobu/runtime-server 20.2.0 → 21.1.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/catalogs/automations.json +0 -8
- package/dist/component.json +1 -1
- package/dist/connectors/README.md +15 -16
- package/dist/connectors/github.ts +274 -193
- package/dist/connectors/google_calendar.ts +54 -160
- package/dist/connectors/google_drive.ts +106 -131
- package/dist/connectors/google_gmail.ts +53 -30
- package/dist/connectors/hackernews.ts +2 -5
- package/dist/connectors/jira.ts +71 -27
- package/dist/connectors/linear.ts +55 -21
- package/dist/connectors/microsoft_outlook.ts +151 -110
- package/dist/connectors/postgres.ts +19 -11
- package/dist/connectors/producthunt.ts +11 -7
- package/dist/connectors/reddit.ts +36 -6
- package/dist/connectors/rss.ts +2 -2
- package/dist/connectors/whatsapp_web.ts +5 -4
- package/dist/connectors/x.ts +32 -17
- package/dist/connectors/youtube.ts +18 -5
- package/dist/db/migrations/20260917000000_views.sql +271 -0
- package/dist/db/migrations/20260917000001_views_attach_index.sql +14 -0
- package/dist/db/migrations/20260918000000_runs_turn_tool_event_uniq.sql +51 -0
- package/dist/db/migrations/20260923230000_runs_connector_artifact_hash.sql +32 -0
- package/dist/db/migrations/20260924000000_resource_source_files.sql +17 -0
- package/dist/db/migrations/20260928120000_classification_consolidation.sql +51 -0
- package/dist/dependencies.bun.lock +113 -102
- package/dist/guest.bundle.js +78 -10
- package/dist/owletto/dist/assets/_-00GgOtdu.js +1 -0
- package/dist/owletto/dist/assets/_-XlUwOWCI.js +2 -0
- package/dist/owletto/dist/assets/_agentId-B2DrawIk.js +1 -0
- package/dist/owletto/dist/assets/_agentId-CS0AcWH2.js +1 -0
- package/dist/owletto/dist/assets/_automationId-BLnqLtUv.js +1 -0
- package/dist/owletto/dist/assets/{_connectorKey._connectionId-BAJGfcy7.js → _connectorKey._connectionId-DcUWoZ-C.js} +1 -1
- package/dist/owletto/dist/assets/{_connectorKey.index-BBF8vGJS.js → _connectorKey.index-C_yKycN_.js} +1 -1
- package/dist/owletto/dist/assets/_conversationId-CpuEvflw.js +1 -0
- package/dist/owletto/dist/assets/_deploymentId-BL9tnDFl.js +1 -0
- package/dist/owletto/dist/assets/_name-DlxjWkKk.js +1 -0
- package/dist/owletto/dist/assets/_owner-Cg50UU6m.js +1 -0
- package/dist/owletto/dist/assets/_shape-BWZW4mj8.js +1 -0
- package/dist/owletto/dist/assets/_skillKey-B25fO0_O.js +1 -0
- package/dist/owletto/dist/assets/_slug-DbD-wv2m.js +1 -0
- package/dist/owletto/dist/assets/_viewKey-BcTEvQ3N.js +1 -0
- package/dist/owletto/dist/assets/_viewKey-W4RjiUWL.js +1 -0
- package/dist/owletto/dist/assets/_viewKey-iGPCKSda.js +1 -0
- package/dist/owletto/dist/assets/accept-invitation-BmQKbQem.js +1 -0
- package/dist/owletto/dist/assets/activity-route-view-BvtAoGVt.js +1 -0
- package/dist/owletto/dist/assets/{agent-card-controls-CZO6GI0s.js → agent-card-controls-bhTMPoVi.js} +1 -1
- package/dist/owletto/dist/assets/{agent-client-setup-list-_chLOorY.js → agent-client-setup-list-BBbq_2B1.js} +1 -1
- package/dist/owletto/dist/assets/{agent-connect-pages-DWBgSIYT.js → agent-connect-pages-DkDlFVY5.js} +1 -1
- package/dist/owletto/dist/assets/{agent-editor-form-BTNlg0kQ.js → agent-editor-form-DwHD9j1Y.js} +1 -1
- package/dist/owletto/dist/assets/{agent-guardrails-route-B5uoMC6o.js → agent-guardrails-route-0PsTrqMC.js} +1 -1
- package/dist/owletto/dist/assets/{agent-loading-shells-CLoLeFcB.js → agent-loading-shells-BQLjzMPy.js} +1 -1
- package/dist/owletto/dist/assets/{agent-permissions-matrix-TP00-MYL.js → agent-permissions-matrix-B-Q5rmuB.js} +1 -1
- package/dist/owletto/dist/assets/{agent-skill-context-D4a2QCoZ.js → agent-skill-context-s42Q4Wjo.js} +1 -1
- package/dist/owletto/dist/assets/{agent-skills-route-KVDDTbJB.js → agent-skills-route-Cwq1QrhW.js} +1 -1
- package/dist/owletto/dist/assets/{agent-subpage-shell-DuVYZvBE.js → agent-subpage-shell-DtzoRy6N.js} +1 -1
- package/dist/owletto/dist/assets/agent-thread-D7AGGjRV.js +8 -0
- package/dist/owletto/dist/assets/agents-BqCKU4CT.js +1 -0
- package/dist/owletto/dist/assets/agents-workbench-Cl7FO7b3.js +1 -0
- package/dist/owletto/dist/assets/app-bridge-BH3g2mKG.js +127 -0
- package/dist/owletto/dist/assets/{app._appId-D0_LQTJU.js → app._appId-CqYz3AOO.js} +1 -1
- package/dist/owletto/dist/assets/automation-detail-content-CKSywvzE.js +1 -0
- package/dist/owletto/dist/assets/automations-BqCKU4CT.js +1 -0
- package/dist/owletto/dist/assets/{calendar-C0XpOHd8.js → calendar-CHXehtu0.js} +1 -1
- package/dist/owletto/dist/assets/{callback-CO_K9eR-.js → callback-DZ3YyXeV.js} +1 -1
- package/dist/owletto/dist/assets/{card-DeFQuU_J.js → card-4Ull9W6d.js} +1 -1
- package/dist/owletto/dist/assets/{claim-CUpWOSie.js → claim-BGLCPLXq.js} +1 -1
- package/dist/owletto/dist/assets/clients-C7ubnFsS.js +1 -0
- package/dist/owletto/dist/assets/{code-editor-BqGUZFt6.js → code-editor-BHiWR94J.js} +1 -1
- package/dist/owletto/dist/assets/connect-BNatqg6j.js +1 -0
- package/dist/owletto/dist/assets/connect._clientId-BGG2IqiQ.js +1 -0
- package/dist/owletto/dist/assets/connected._clientId-7RU89sVW.js +1 -0
- package/dist/owletto/dist/assets/{connection-BgAlYjeV.js → connection-CTaUGXl6.js} +1 -1
- package/dist/owletto/dist/assets/{connection-feed-detail-B3ePAinf.js → connection-feed-detail-B1xieiEh.js} +1 -1
- package/dist/owletto/dist/assets/{connector-provenance-DgsDg0Z9.js → connector-provenance-DRdUEmQ1.js} +1 -1
- package/dist/owletto/dist/assets/{connectors-CqPQPo9U.js → connectors-NBwCLuZg.js} +1 -1
- package/dist/owletto/dist/assets/{consent-bswcIzsf.js → consent-fmhPPlpi.js} +1 -1
- package/dist/owletto/dist/assets/{core.esm-DsLgjoel.js → core.esm-C-eNiUAl.js} +1 -1
- package/dist/owletto/dist/assets/{create-Dwo04oWV.js → create-8bBbQJGY.js} +1 -1
- package/dist/owletto/dist/assets/create-Cl6cfNAp.js +1 -0
- package/dist/owletto/dist/assets/create-DrVso8O7.js +1 -0
- package/dist/owletto/dist/assets/create-automation-form-De8J-JD5.js +2 -0
- package/dist/owletto/dist/assets/{create._connectorKey-CCBb2pil.js → create._connectorKey-CHAotlsF.js} +1 -1
- package/dist/owletto/dist/assets/{cronstrue-ChFyC9ps.js → cronstrue-C5yTgk5z.js} +1 -1
- package/dist/owletto/dist/assets/deployments-C7M3fV5K.js +1 -0
- package/dist/owletto/dist/assets/deployments-D1gbQwsy.js +1 -0
- package/dist/owletto/dist/assets/deployments-body-DycIGlnL.js +1 -0
- package/dist/owletto/dist/assets/device-DyPnQkhO.js +1 -0
- package/dist/owletto/dist/assets/{device-pin-tombstone-1ikyqSdb.js → device-pin-tombstone-CwJitllC.js} +1 -1
- package/dist/owletto/dist/assets/device-rows-BBhW1C7Y.js +1 -0
- package/dist/owletto/dist/assets/{device._deviceId-DTYKGBY8.js → device._deviceId-XswfXHOc.js} +1 -1
- package/dist/owletto/dist/assets/entity-options-utGBmFX0.js +1 -0
- package/dist/owletto/dist/assets/entity-page-BxwuqqWk.js +1 -0
- package/dist/owletto/dist/assets/entity-type-page-BrWqk6so.js +1 -0
- package/dist/owletto/dist/assets/event-page-LIm4EDmJ.js +1 -0
- package/dist/owletto/dist/assets/events-feed-C4L8mQV7.js +1 -0
- package/dist/owletto/dist/assets/{full-page-spinner-BN2G_YiM.js → full-page-spinner-DsU-Cb3L.js} +1 -1
- package/dist/owletto/dist/assets/guardrails-CGFWCfbQ.js +1 -0
- package/dist/owletto/dist/assets/identity-uPYpPogR.js +1 -0
- package/dist/owletto/dist/assets/{index-hSE2E46p.js → index-1YrrvVJ4.js} +1 -1
- package/dist/owletto/dist/assets/index-BKMafTe4.js +1 -0
- package/dist/owletto/dist/assets/index-BsL1-C2-.js +1 -0
- package/dist/owletto/dist/assets/index-C58oW727.js +1 -0
- package/dist/owletto/dist/assets/index-C8CR2-Ck.css +1 -0
- package/dist/owletto/dist/assets/{index-OUb5Mlez.js → index-CDz3-ieP.js} +10 -10
- package/dist/owletto/dist/assets/{index-C6VAJ8Ku.js → index-CQ4s6nzy.js} +1 -1
- package/dist/owletto/dist/assets/index-CpWKAAGX.js +1 -0
- package/dist/owletto/dist/assets/{index-vdqhlocx.js → index-D2dcENg2.js} +1 -1
- package/dist/owletto/dist/assets/{index-C2oCgDX7.js → index-DCK0KhMM.js} +1 -1
- package/dist/owletto/dist/assets/{index-C-u4yR8Z.js → index-DXqiRON3.js} +1 -1
- package/dist/owletto/dist/assets/index-DgEc5IvT.js +1 -0
- package/dist/owletto/dist/assets/index-DtRfQcRH.js +7898 -0
- package/dist/owletto/dist/assets/index-DvhM9tuI.js +1 -0
- package/dist/owletto/dist/assets/index-DwtfHCHB.js +1 -0
- package/dist/owletto/dist/assets/index-DyYFZjh-.js +1 -0
- package/dist/owletto/dist/assets/index-nOYvNROJ.js +1 -0
- package/dist/owletto/dist/assets/index-oDoJENMF.js +1 -0
- package/dist/owletto/dist/assets/index-rPdUEOa3.js +1 -0
- package/dist/owletto/dist/assets/{json-diff-DnsW7Pin.js → json-diff-DYeX-xLk.js} +2 -2
- package/dist/owletto/dist/assets/{list-skeleton-CHzLN7GK.js → list-skeleton-s4GPSJ8J.js} +1 -1
- package/dist/owletto/dist/assets/login-Di5VF2F_.js +1 -0
- package/dist/owletto/dist/assets/logout-BuaQGSnw.js +1 -0
- package/dist/owletto/dist/assets/member-scope-gate-CJqJZk7T.js +1 -0
- package/dist/owletto/dist/assets/memory-browse-page-Bibfs2sK.js +101 -0
- package/dist/owletto/dist/assets/missing-view-CD4DOaG8.js +1 -0
- package/dist/owletto/dist/assets/{model-selector-DfbmHjLu.js → model-selector-XC5CI2Et.js} +1 -1
- package/dist/owletto/dist/assets/models--8mTFOLz.js +1 -0
- package/dist/owletto/dist/assets/{new-Df_dY6Z5.js → new-BzkA1sq2.js} +1 -1
- package/dist/owletto/dist/assets/new-C3f0BShb.js +1 -0
- package/dist/owletto/dist/assets/new-DA5LF6iB.js +1 -0
- package/dist/owletto/dist/assets/{oauth-workspace-access-D9GmiMfK.js → oauth-workspace-access-D6epOq0R.js} +1 -1
- package/dist/owletto/dist/assets/{organization-uSDYkJpX.js → organization-DOtBRqDQ.js} +1 -1
- package/dist/owletto/dist/assets/{permissions-Fe0DP6b8.js → permissions-D8uJHINS.js} +1 -1
- package/dist/owletto/dist/assets/{proposal-review-shell-D9HwnDda.js → proposal-review-shell-C3K-JXjb.js} +1 -1
- package/dist/owletto/dist/assets/{recent-C03LhMD7.js → recent-CFcWceBl.js} +1 -1
- package/dist/owletto/dist/assets/{renderer-CHNejd95.js → renderer-1nRJFMGx.js} +2 -2
- package/dist/owletto/dist/assets/{reset-password-CuISnlG_.js → reset-password-9RTWhBEb.js} +1 -1
- package/dist/owletto/dist/assets/runs-_yVh6PPB.js +1 -0
- package/dist/owletto/dist/assets/{runs-panel-DsdESupx.js → runs-panel-B2852xus.js} +1 -1
- package/dist/owletto/dist/assets/runs-table--dnFQatY.js +1 -0
- package/dist/owletto/dist/assets/{schema-value-normalization-B--OWDL8.js → schema-value-normalization-BspxVEGy.js} +1 -1
- package/dist/owletto/dist/assets/{settings-wGNHtsDP.js → settings-9lDASETT.js} +1 -1
- package/dist/owletto/dist/assets/settings-DQo_ZS2P.js +1 -0
- package/dist/owletto/dist/assets/skills-a5xQ4RE9.js +1 -0
- package/dist/owletto/dist/assets/{switch-Dzse_XFM.js → switch-CxDXvPGE.js} +1 -1
- package/dist/owletto/dist/assets/use-applied-views-DvMT3wap.js +1 -0
- package/dist/owletto/dist/assets/{use-mention-search-uyW1Uwf6.js → use-mention-search-CeTEE3oE.js} +1 -1
- package/dist/owletto/dist/assets/view-frame-HoBawpT2.js +1 -0
- package/dist/owletto/dist/index.html +2 -2
- package/dist/providers.json +0 -1
- package/dist/server-main.bundle.mjs +8997 -7479
- package/npm-shrinkwrap.json +543 -485
- package/package.json +5 -2
- package/vendor/connector-sdk/dist/connector-runtime.d.ts +4 -6
- package/vendor/connector-sdk/dist/connector-runtime.js +3 -5
- package/vendor/connector-sdk/dist/connector-types.d.ts +28 -15
- package/vendor/connector-sdk/dist/define-connector.d.ts +4 -1
- package/vendor/connector-sdk/dist/define-connector.js +4 -1
- package/vendor/connector-sdk/dist/http-client.d.ts +18 -7
- package/vendor/connector-sdk/dist/http-client.js +15 -13
- package/vendor/connector-sdk/dist/index.d.ts +1 -1
- package/vendor/connector-sdk/dist/retry.d.ts +15 -3
- package/vendor/connector-sdk/dist/retry.js +40 -64
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/core/dist/agent-policy.js +3 -0
- package/vendor/core/dist/connector-query-errors.d.ts +3 -3
- package/vendor/core/dist/connector-query-errors.js +8 -3
- package/vendor/core/dist/contracts/tools/manage-auth-profiles.d.ts +14 -0
- package/vendor/core/dist/contracts/tools/manage-auth-profiles.js +12 -1
- package/vendor/core/dist/contracts/tools/manage-automations.d.ts +0 -10
- package/vendor/core/dist/contracts/tools/manage-automations.js +0 -33
- package/vendor/core/dist/contracts/tools/manage-classifiers.d.ts +4 -34
- package/vendor/core/dist/contracts/tools/manage-classifiers.js +13 -44
- package/vendor/core/dist/contracts/tools/manage-connections.d.ts +24 -0
- package/vendor/core/dist/contracts/tools/manage-connections.js +13 -0
- package/vendor/core/dist/contracts/tools/manage-entity-schema.d.ts +15 -25
- package/vendor/core/dist/contracts/tools/manage-entity-schema.js +3 -5
- package/vendor/core/dist/contracts/tools/manage-entity.d.ts +0 -9
- package/vendor/core/dist/contracts/tools/manage-entity.js +0 -6
- package/vendor/core/dist/contracts/tools/manage-feeds.d.ts +11 -0
- package/vendor/core/dist/contracts/tools/manage-feeds.js +12 -1
- package/vendor/core/dist/contracts/tools/manage-operations.d.ts +47 -6
- package/vendor/core/dist/contracts/tools/manage-operations.js +36 -1
- package/vendor/core/dist/contracts/tools/manage-views.d.ts +293 -0
- package/vendor/core/dist/contracts/tools/manage-views.js +203 -0
- package/vendor/core/dist/contracts/tools/source-files-schema.d.ts +7 -0
- package/vendor/core/dist/contracts/tools/source-files-schema.js +19 -0
- package/vendor/core/dist/contracts/tools/source-files.d.ts +14 -0
- package/vendor/core/dist/contracts/tools/source-files.js +55 -0
- package/vendor/core/dist/contracts/tools/view-attach.d.ts +20 -0
- package/vendor/core/dist/contracts/tools/view-attach.js +45 -0
- package/vendor/core/dist/contracts/tools/view-content-hash.d.ts +37 -0
- package/vendor/core/dist/contracts/tools/view-content-hash.js +58 -0
- package/vendor/core/dist/contracts/tools/view-path.d.ts +18 -0
- package/vendor/core/dist/contracts/tools/view-path.js +24 -0
- package/vendor/core/dist/contracts/worker/protocol.d.ts +90 -8
- package/vendor/core/dist/contracts/worker/protocol.js +70 -10
- package/vendor/core/dist/index.d.ts +1 -1
- package/vendor/core/dist/provider-config-types.d.ts +0 -9
- package/vendor/core/dist/reserved.d.ts +3 -3
- package/vendor/core/dist/reserved.js +9 -1
- package/vendor/core/dist/sdk-compat.d.ts +1 -1
- package/vendor/core/dist/utils/secret-redaction.js +2 -0
- package/vendor/core/package.json +30 -5
- package/vendor/views/dist/api.d.ts +184 -0
- package/vendor/views/dist/api.js +410 -0
- package/vendor/views/dist/bridge.d.ts +141 -0
- package/vendor/views/dist/bridge.js +330 -0
- package/vendor/views/dist/index.d.ts +12 -0
- package/vendor/views/dist/index.js +10 -0
- package/vendor/views/package.json +35 -0
- package/dist/owletto/dist/assets/_-Ds4DyQjj.js +0 -2
- package/dist/owletto/dist/assets/_-VmyR6aN_.js +0 -1
- package/dist/owletto/dist/assets/_agentId-BAVnp0c7.js +0 -1
- package/dist/owletto/dist/assets/_agentId-Df-3rGi5.js +0 -1
- package/dist/owletto/dist/assets/_automationId-D696vOjd.js +0 -1
- package/dist/owletto/dist/assets/_conversationId-Ci4rgrHm.js +0 -1
- package/dist/owletto/dist/assets/_deploymentId-Iy-D5PDq.js +0 -1
- package/dist/owletto/dist/assets/_name-CeGwb0oK.js +0 -1
- package/dist/owletto/dist/assets/_owner-CFR1G8OX.js +0 -1
- package/dist/owletto/dist/assets/_skillKey-DuLcQWBu.js +0 -1
- package/dist/owletto/dist/assets/_slug-CDSO20ac.js +0 -1
- package/dist/owletto/dist/assets/accept-invitation-Db5jklHT.js +0 -1
- package/dist/owletto/dist/assets/activity-route-view-DVW3DoB7.js +0 -1
- package/dist/owletto/dist/assets/agent-thread-CzCJU3-R.js +0 -134
- package/dist/owletto/dist/assets/agents-DFs57C3c.js +0 -1
- package/dist/owletto/dist/assets/agents-workbench-C2bUlJP2.js +0 -1
- package/dist/owletto/dist/assets/automation-detail-content-DWkdhnv2.js +0 -1
- package/dist/owletto/dist/assets/automations-DFs57C3c.js +0 -1
- package/dist/owletto/dist/assets/clients-DhYr4lyL.js +0 -1
- package/dist/owletto/dist/assets/connect-Dtb-E5An.js +0 -1
- package/dist/owletto/dist/assets/connect._clientId-DWtceAAw.js +0 -1
- package/dist/owletto/dist/assets/connected._clientId-CMe-wTuV.js +0 -1
- package/dist/owletto/dist/assets/create-CcXUdke7.js +0 -1
- package/dist/owletto/dist/assets/create-Cp6hMoeU.js +0 -1
- package/dist/owletto/dist/assets/create-automation-form-CJ4meayB.js +0 -1
- package/dist/owletto/dist/assets/deployments-CjfFxyDA.js +0 -1
- package/dist/owletto/dist/assets/deployments-body-Cg0KiWGr.js +0 -1
- package/dist/owletto/dist/assets/device-DpY67Jaj.js +0 -1
- package/dist/owletto/dist/assets/device-rows-Cp3yMcuV.js +0 -1
- package/dist/owletto/dist/assets/entity-options-1EaSGMX4.js +0 -1
- package/dist/owletto/dist/assets/entity-page-DJmM70dv.js +0 -1
- package/dist/owletto/dist/assets/entity-type-page-C3mT7tXn.js +0 -1
- package/dist/owletto/dist/assets/events-feed-iliGfjit.js +0 -1
- package/dist/owletto/dist/assets/guardrails-CLlnRRy9.js +0 -1
- package/dist/owletto/dist/assets/identity-MSLryUi8.js +0 -1
- package/dist/owletto/dist/assets/index-3o4Eepb4.js +0 -1
- package/dist/owletto/dist/assets/index-BUr8321-.js +0 -7898
- package/dist/owletto/dist/assets/index-Bulu5ldM.js +0 -1
- package/dist/owletto/dist/assets/index-BvbfITqH.js +0 -1
- package/dist/owletto/dist/assets/index-ChcQMdod.css +0 -1
- package/dist/owletto/dist/assets/index-Clw9ZBj-.js +0 -1
- package/dist/owletto/dist/assets/index-D2oL4Ydo.js +0 -1
- package/dist/owletto/dist/assets/index-D7wulT4y.js +0 -1
- package/dist/owletto/dist/assets/index-DOLFe19K.js +0 -1
- package/dist/owletto/dist/assets/index-DTSA0Xh1.js +0 -1
- package/dist/owletto/dist/assets/index-DxXXVPU0.js +0 -1
- package/dist/owletto/dist/assets/index-nzvsA3hT.js +0 -1
- package/dist/owletto/dist/assets/login-CCKNM0gV.js +0 -1
- package/dist/owletto/dist/assets/logout-B-N2aodZ.js +0 -1
- package/dist/owletto/dist/assets/member-scope-gate-B560Wg-t.js +0 -1
- package/dist/owletto/dist/assets/memory-browse-page-DMDqKJn7.js +0 -101
- package/dist/owletto/dist/assets/models-M51OGDRE.js +0 -1
- package/dist/owletto/dist/assets/new-BVQS9H-Y.js +0 -1
- package/dist/owletto/dist/assets/new-DxDVE9nL.js +0 -1
- package/dist/owletto/dist/assets/runs-BnYdToDc.js +0 -1
- package/dist/owletto/dist/assets/runs-table-B7jKuILd.js +0 -1
- package/dist/owletto/dist/assets/settings-Bg9yCCoN.js +0 -1
- package/dist/owletto/dist/assets/skills-CN5Ube7A.js +0 -1
- package/vendor/core/dist/contracts/tools/manage-view-templates.d.ts +0 -165
- package/vendor/core/dist/contracts/tools/manage-view-templates.js +0 -130
|
@@ -14,9 +14,9 @@ import {
|
|
|
14
14
|
type EventEnvelope,
|
|
15
15
|
fileDownloadOutput,
|
|
16
16
|
type HttpClient,
|
|
17
|
+
HttpStatusError,
|
|
17
18
|
inlineContentBudget,
|
|
18
19
|
inlineMaxBytesSchema,
|
|
19
|
-
paginateByCursor,
|
|
20
20
|
requireBearerClient,
|
|
21
21
|
type SyncContext,
|
|
22
22
|
type SyncResult,
|
|
@@ -89,7 +89,24 @@ interface GraphPagedResponse<T> {
|
|
|
89
89
|
// ---------------------------------------------------------------------------
|
|
90
90
|
|
|
91
91
|
interface OutlookCheckpoint {
|
|
92
|
+
/** When the last complete traversal began; the next window starts here. */
|
|
92
93
|
last_sync_at?: string;
|
|
94
|
+
/**
|
|
95
|
+
* A traversal that stopped at the per-run cap with pages left. `window`
|
|
96
|
+
* is the fixed range it walks and `next_link` Graph's cursor for the first
|
|
97
|
+
* page not yet stored, so the next run continues exactly where this one
|
|
98
|
+
* stopped instead of re-reading the newest page and never reaching the rest.
|
|
99
|
+
*/
|
|
100
|
+
pending?: { window: { start: string; end: string }; next_link: string };
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const WINDOW_OVERLAP_MS = 5 * 60_000;
|
|
104
|
+
|
|
105
|
+
/** ISO timestamp `days` from now (negative for the past). */
|
|
106
|
+
function daysFromNow(days: number): string {
|
|
107
|
+
const date = new Date();
|
|
108
|
+
date.setDate(date.getDate() + days);
|
|
109
|
+
return date.toISOString();
|
|
93
110
|
}
|
|
94
111
|
|
|
95
112
|
// ---------------------------------------------------------------------------
|
|
@@ -448,67 +465,53 @@ export default class MicrosoftOutlookConnector extends ConnectorRuntime {
|
|
|
448
465
|
private async syncMessages(ctx: SyncContext, http: HttpClient): Promise<SyncResult> {
|
|
449
466
|
const config = ctx.config as Record<string, unknown>;
|
|
450
467
|
const folder = (config.folder as string) ?? 'inbox';
|
|
451
|
-
const maxResults = (config.max_results as number) ?? 50;
|
|
452
468
|
const lookbackDays = (config.lookback_days as number) ?? 30;
|
|
453
|
-
const
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
469
|
+
const checkpoint = (ctx.checkpoint ?? {}) as OutlookCheckpoint;
|
|
470
|
+
|
|
471
|
+
// A fixed window per traversal: from where the last complete one began
|
|
472
|
+
// (or the lookback) up to when this one began. Mail arriving meanwhile
|
|
473
|
+
// belongs to the next window, so a capped walk can never be pushed past
|
|
474
|
+
// messages it has not reached by newer arrivals landing at the front.
|
|
475
|
+
// The start overlaps the previous window by a few minutes: Graph can
|
|
476
|
+
// surface a message after its receivedDateTime, and `origin_id` makes the
|
|
477
|
+
// replayed boundary a supersede, not a duplicate.
|
|
478
|
+
const window = checkpoint.pending?.window ?? {
|
|
479
|
+
start: checkpoint.last_sync_at
|
|
480
|
+
? new Date(Date.parse(checkpoint.last_sync_at) - WINDOW_OVERLAP_MS).toISOString()
|
|
481
|
+
: daysFromNow(-lookbackDays),
|
|
482
|
+
end: new Date().toISOString(),
|
|
483
|
+
};
|
|
460
484
|
const firstUrl =
|
|
461
|
-
`${this.API_BASE}/me/mailFolders/${
|
|
462
|
-
`?$top=${
|
|
485
|
+
`${this.API_BASE}/me/mailFolders/${encodeURIComponent(folder)}/messages` +
|
|
486
|
+
`?$top=${this.PAGE_SIZE}` +
|
|
463
487
|
'&$orderby=receivedDateTime desc' +
|
|
464
|
-
`&$filter=receivedDateTime ge ${
|
|
488
|
+
`&$filter=receivedDateTime ge ${window.start} and receivedDateTime lt ${window.end}` +
|
|
465
489
|
'&$select=id,conversationId,subject,bodyPreview,from,toRecipients,ccRecipients,receivedDateTime,sentDateTime,hasAttachments,importance,isRead,webLink';
|
|
466
490
|
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
to: formatRecipients(msg.toRecipients ?? []),
|
|
492
|
-
cc: formatRecipients(msg.ccRecipients ?? []),
|
|
493
|
-
importance: msg.importance,
|
|
494
|
-
has_attachments: msg.hasAttachments,
|
|
495
|
-
is_read: msg.isRead,
|
|
496
|
-
},
|
|
497
|
-
});
|
|
498
|
-
fetched++;
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
if (ctx.emitEvents) await ctx.emitEvents(events.splice(0));
|
|
502
|
-
|
|
503
|
-
if (fetched >= maxResults) break;
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
return {
|
|
507
|
-
events,
|
|
508
|
-
checkpoint: {
|
|
509
|
-
last_sync_at: new Date().toISOString(),
|
|
510
|
-
} satisfies OutlookCheckpoint as Record<string, unknown>,
|
|
511
|
-
};
|
|
491
|
+
return this.walkPages<GraphMessage>(ctx, http, {
|
|
492
|
+
window,
|
|
493
|
+
firstUrl,
|
|
494
|
+
maxResults: (config.max_results as number) ?? 50,
|
|
495
|
+
toEvent: (msg) => ({
|
|
496
|
+
origin_id: `outlook_msg_${msg.id}`,
|
|
497
|
+
title: msg.subject,
|
|
498
|
+
payload_text: msg.bodyPreview || msg.subject,
|
|
499
|
+
author_name: msg.from?.emailAddress?.name || msg.from?.emailAddress?.address,
|
|
500
|
+
source_url: msg.webLink,
|
|
501
|
+
occurred_at: new Date(msg.receivedDateTime),
|
|
502
|
+
origin_type: 'email',
|
|
503
|
+
metadata: {
|
|
504
|
+
from: msg.from?.emailAddress?.address,
|
|
505
|
+
to: formatRecipients(msg.toRecipients ?? []),
|
|
506
|
+
cc: formatRecipients(msg.ccRecipients ?? []),
|
|
507
|
+
importance: msg.importance,
|
|
508
|
+
has_attachments: msg.hasAttachments,
|
|
509
|
+
is_read: msg.isRead,
|
|
510
|
+
},
|
|
511
|
+
}),
|
|
512
|
+
// The next window starts where this one ended.
|
|
513
|
+
completed: { last_sync_at: window.end },
|
|
514
|
+
});
|
|
512
515
|
}
|
|
513
516
|
|
|
514
517
|
// -------------------------------------------------------------------------
|
|
@@ -517,68 +520,106 @@ export default class MicrosoftOutlookConnector extends ConnectorRuntime {
|
|
|
517
520
|
|
|
518
521
|
private async syncCalendar(ctx: SyncContext, http: HttpClient): Promise<SyncResult> {
|
|
519
522
|
const config = ctx.config as Record<string, unknown>;
|
|
520
|
-
const
|
|
521
|
-
const lookaheadDays = (config.lookahead_days as number) ?? 30;
|
|
522
|
-
const maxResults = (config.max_results as number) ?? 100;
|
|
523
|
+
const checkpoint = (ctx.checkpoint ?? {}) as OutlookCheckpoint;
|
|
523
524
|
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
const
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
525
|
+
// A calendar view is a snapshot of a moving range, re-walked in full on
|
|
526
|
+
// every traversal; a capped walk resumes the same range next run.
|
|
527
|
+
const window = checkpoint.pending?.window ?? {
|
|
528
|
+
start: daysFromNow(-((config.lookback_days as number) ?? 7)),
|
|
529
|
+
end: daysFromNow((config.lookahead_days as number) ?? 30),
|
|
530
|
+
};
|
|
530
531
|
const firstUrl =
|
|
531
532
|
`${this.API_BASE}/me/calendarView` +
|
|
532
|
-
`?startDateTime=${
|
|
533
|
-
`&endDateTime=${
|
|
534
|
-
`&$top=${
|
|
533
|
+
`?startDateTime=${window.start}` +
|
|
534
|
+
`&endDateTime=${window.end}` +
|
|
535
|
+
`&$top=${this.PAGE_SIZE}` +
|
|
535
536
|
'&$orderby=start/dateTime' +
|
|
536
537
|
'&$select=id,subject,bodyPreview,organizer,attendees,start,end,location,isAllDay,isCancelled,webLink,createdDateTime';
|
|
537
538
|
|
|
539
|
+
return this.walkPages<GraphEvent>(ctx, http, {
|
|
540
|
+
window,
|
|
541
|
+
firstUrl,
|
|
542
|
+
maxResults: (config.max_results as number) ?? 100,
|
|
543
|
+
toEvent: (evt) => ({
|
|
544
|
+
origin_id: `outlook_evt_${evt.id}`,
|
|
545
|
+
title: evt.subject,
|
|
546
|
+
payload_text: evt.bodyPreview || evt.subject,
|
|
547
|
+
author_name: evt.organizer?.emailAddress?.name || evt.organizer?.emailAddress?.address,
|
|
548
|
+
source_url: evt.webLink,
|
|
549
|
+
occurred_at: new Date(evt.start.dateTime),
|
|
550
|
+
origin_type: 'calendar_event',
|
|
551
|
+
metadata: {
|
|
552
|
+
organizer: evt.organizer?.emailAddress?.address,
|
|
553
|
+
location: evt.location?.displayName,
|
|
554
|
+
attendee_count: evt.attendees?.length ?? 0,
|
|
555
|
+
is_all_day: evt.isAllDay,
|
|
556
|
+
is_cancelled: evt.isCancelled,
|
|
557
|
+
start_time: evt.start.dateTime,
|
|
558
|
+
end_time: evt.end.dateTime,
|
|
559
|
+
},
|
|
560
|
+
}),
|
|
561
|
+
completed: { last_sync_at: new Date().toISOString() },
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
/**
|
|
566
|
+
* Walk a Graph collection page by page, committing each page with the
|
|
567
|
+
* cursor of the next. `max_results` caps how much a run starts, never how
|
|
568
|
+
* much of a fetched page is stored: a page is committed whole, and the run
|
|
569
|
+
* stops between pages once the cap is reached, handing back `more`.
|
|
570
|
+
*/
|
|
571
|
+
private async walkPages<T>(
|
|
572
|
+
ctx: SyncContext,
|
|
573
|
+
http: HttpClient,
|
|
574
|
+
walk: {
|
|
575
|
+
window: { start: string; end: string };
|
|
576
|
+
firstUrl: string;
|
|
577
|
+
maxResults: number;
|
|
578
|
+
toEvent: (item: T) => EventEnvelope;
|
|
579
|
+
completed: OutlookCheckpoint;
|
|
580
|
+
}
|
|
581
|
+
): Promise<SyncResult> {
|
|
582
|
+
const checkpoint = (ctx.checkpoint ?? {}) as OutlookCheckpoint;
|
|
583
|
+
let url = checkpoint.pending?.next_link ?? walk.firstUrl;
|
|
584
|
+
// A saved link outlives the run that issued it and Graph may retire it.
|
|
585
|
+
// The first request of the run — the only one using a stored cursor — may
|
|
586
|
+
// restart the window from its first page instead of wedging the feed;
|
|
587
|
+
// `origin_id` makes that replay a supersede, not a duplicate.
|
|
588
|
+
let staleCursorRecoverable = checkpoint.pending !== undefined;
|
|
538
589
|
let fetched = 0;
|
|
539
590
|
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
origin_id: `outlook_evt_${evt.id}`,
|
|
553
|
-
title: evt.subject,
|
|
554
|
-
payload_text: evt.bodyPreview || evt.subject,
|
|
555
|
-
author_name: evt.organizer?.emailAddress?.name || evt.organizer?.emailAddress?.address,
|
|
556
|
-
source_url: evt.webLink,
|
|
557
|
-
occurred_at: new Date(evt.start.dateTime),
|
|
558
|
-
origin_type: 'calendar_event',
|
|
559
|
-
metadata: {
|
|
560
|
-
organizer: evt.organizer?.emailAddress?.address,
|
|
561
|
-
location: evt.location?.displayName,
|
|
562
|
-
attendee_count: evt.attendees?.length ?? 0,
|
|
563
|
-
is_all_day: evt.isAllDay,
|
|
564
|
-
is_cancelled: evt.isCancelled,
|
|
565
|
-
start_time: evt.start.dateTime,
|
|
566
|
-
end_time: evt.end.dateTime,
|
|
567
|
-
},
|
|
568
|
-
});
|
|
569
|
-
fetched++;
|
|
591
|
+
for (let page = 0; page < this.MAX_PAGES; page++) {
|
|
592
|
+
let data: GraphPagedResponse<T>;
|
|
593
|
+
try {
|
|
594
|
+
data = await http.get<GraphPagedResponse<T>>(url);
|
|
595
|
+
} catch (error) {
|
|
596
|
+
if (staleCursorRecoverable && error instanceof HttpStatusError && [400, 404, 410].includes(error.status)) {
|
|
597
|
+
staleCursorRecoverable = false;
|
|
598
|
+
url = walk.firstUrl;
|
|
599
|
+
page--;
|
|
600
|
+
continue;
|
|
601
|
+
}
|
|
602
|
+
throw error;
|
|
570
603
|
}
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
604
|
+
staleCursorRecoverable = false;
|
|
605
|
+
|
|
606
|
+
const events = data.value.map(walk.toEvent);
|
|
607
|
+
fetched += events.length;
|
|
608
|
+
const nextLink = data['@odata.nextLink'];
|
|
609
|
+
if (!nextLink) {
|
|
610
|
+
await ctx.commit(events, walk.completed as Record<string, unknown>);
|
|
611
|
+
return { status: 'complete', metadata: { items_found: fetched } };
|
|
612
|
+
}
|
|
613
|
+
const pending: OutlookCheckpoint = {
|
|
614
|
+
...(checkpoint.last_sync_at ? { last_sync_at: checkpoint.last_sync_at } : {}),
|
|
615
|
+
pending: { window: walk.window, next_link: nextLink },
|
|
616
|
+
};
|
|
617
|
+
await ctx.commit(events, pending as Record<string, unknown>);
|
|
618
|
+
url = nextLink;
|
|
619
|
+
if (fetched >= walk.maxResults) break;
|
|
575
620
|
}
|
|
576
|
-
|
|
577
|
-
return {
|
|
578
|
-
events,
|
|
579
|
-
checkpoint: {
|
|
580
|
-
last_sync_at: new Date().toISOString(),
|
|
581
|
-
} satisfies OutlookCheckpoint as Record<string, unknown>,
|
|
582
|
-
};
|
|
621
|
+
// Pages remain: the committed cursor resumes this window next run.
|
|
622
|
+
return { status: 'more', metadata: { items_found: fetched } };
|
|
583
623
|
}
|
|
624
|
+
|
|
584
625
|
}
|
|
@@ -344,6 +344,9 @@ function toDate(v: unknown): Date | null {
|
|
|
344
344
|
return null;
|
|
345
345
|
}
|
|
346
346
|
|
|
347
|
+
/** Rows per `ctx.commit` during a sync. */
|
|
348
|
+
const COMMIT_ROWS = 500;
|
|
349
|
+
|
|
347
350
|
export default class PostgresConnector extends ConnectorRuntime {
|
|
348
351
|
readonly definition: RuntimeConnectorDefinition = {
|
|
349
352
|
key: 'postgres',
|
|
@@ -466,21 +469,26 @@ export default class PostgresConnector extends ConnectorRuntime {
|
|
|
466
469
|
// to feedKey only for direct/programmatic sync calls (no feedId).
|
|
467
470
|
const originPrefix = ctx.feedId != null ? String(ctx.feedId) : ctx.feedKey;
|
|
468
471
|
|
|
469
|
-
// Map rows → events
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
for (
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
472
|
+
// Map rows → events and commit them in slices, each with the keyset
|
|
473
|
+
// checkpoint of its last row: that checkpoint resumes exactly after it,
|
|
474
|
+
// so a run cut short keeps every slice it committed.
|
|
475
|
+
for (let start = 0; start < rows.length; start += COMMIT_ROWS) {
|
|
476
|
+
const slice = rows.slice(start, start + COMMIT_ROWS);
|
|
477
|
+
const last = slice[slice.length - 1];
|
|
478
|
+
const sliceCheckpoint: PgCheckpoint = {
|
|
479
|
+
last_cursor: toCheckpointValue(last[cursorCol]),
|
|
480
|
+
last_pk: toCheckpointValue(last[pkCol]),
|
|
477
481
|
};
|
|
482
|
+
await ctx.commit(
|
|
483
|
+
slice.map((row) => this.rowToEvent(originPrefix, row, config, cursorCol, pkCol)),
|
|
484
|
+
sliceCheckpoint as unknown as Record<string, unknown>
|
|
485
|
+
);
|
|
478
486
|
}
|
|
479
487
|
|
|
480
488
|
return {
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
metadata: { items_found:
|
|
489
|
+
// A full page means rows remain past the cursor: run again now.
|
|
490
|
+
status: rows.length >= limit ? 'more' : 'complete',
|
|
491
|
+
metadata: { items_found: rows.length },
|
|
484
492
|
};
|
|
485
493
|
} finally {
|
|
486
494
|
await sql.end({ timeout: 5 });
|
|
@@ -265,10 +265,12 @@ export default class ProductHuntConnector extends ConnectorRuntime {
|
|
|
265
265
|
|
|
266
266
|
let result: ProductHuntPostsResponse;
|
|
267
267
|
try {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
268
|
+
// A GraphQL query sent as POST: safe to repeat on a 5xx.
|
|
269
|
+
result = await http.post<ProductHuntPostsResponse>(
|
|
270
|
+
this.API_URL,
|
|
271
|
+
{ query: LIST_POSTS_QUERY, variables },
|
|
272
|
+
{ idempotent: true }
|
|
273
|
+
);
|
|
272
274
|
} catch (error) {
|
|
273
275
|
if (error instanceof HttpStatusError && error.status === 401) {
|
|
274
276
|
// PH v2 API requires auth. Fail the run instead of returning an
|
|
@@ -292,7 +294,9 @@ export default class ProductHuntConnector extends ConnectorRuntime {
|
|
|
292
294
|
const edges = result.data.posts.edges;
|
|
293
295
|
const pageInfo = result.data.posts.pageInfo;
|
|
294
296
|
const nextCursor = edges.length > 0 && pageInfo.hasNextPage ? pageInfo.endCursor : null;
|
|
295
|
-
|
|
297
|
+
// Retain only pending traversal state. Once exhausted, the next sync
|
|
298
|
+
// must start at the newest posts instead of replaying the final page.
|
|
299
|
+
cursor = nextCursor;
|
|
296
300
|
return { items: edges, nextCursor };
|
|
297
301
|
},
|
|
298
302
|
{ maxPages, initialCursor: cursor, delayMs: this.RATE_LIMIT_MS }
|
|
@@ -352,9 +356,9 @@ export default class ProductHuntConnector extends ConnectorRuntime {
|
|
|
352
356
|
last_sync_at: new Date().toISOString(),
|
|
353
357
|
};
|
|
354
358
|
|
|
359
|
+
await ctx.commit(events, checkpoint as Record<string, unknown>);
|
|
355
360
|
return {
|
|
356
|
-
|
|
357
|
-
checkpoint: checkpoint as Record<string, unknown>,
|
|
361
|
+
status: 'complete',
|
|
358
362
|
metadata: {
|
|
359
363
|
items_found: events.length,
|
|
360
364
|
},
|
|
@@ -68,6 +68,7 @@ interface RedditListingResponse {
|
|
|
68
68
|
interface RedditCheckpoint {
|
|
69
69
|
last_timestamp?: string;
|
|
70
70
|
pagination_token?: string;
|
|
71
|
+
pagination_cutoff?: string;
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
// ---------------------------------------------------------------------------
|
|
@@ -273,8 +274,15 @@ export default class RedditConnector extends ConnectorRuntime {
|
|
|
273
274
|
username = await this.resolveUsername(ctx, userAccessToken);
|
|
274
275
|
}
|
|
275
276
|
|
|
276
|
-
const
|
|
277
|
+
const previous = (ctx.checkpoint ?? {}) as RedditCheckpoint;
|
|
278
|
+
const resumeAfter = previous.pagination_token ?? null;
|
|
279
|
+
let cutoffDate = new Date();
|
|
277
280
|
cutoffDate.setDate(cutoffDate.getDate() - lookbackDays);
|
|
281
|
+
// Keep items eligible for the whole bounded sweep, even across sync runs.
|
|
282
|
+
if (resumeAfter && previous.pagination_cutoff) {
|
|
283
|
+
const savedCutoff = new Date(previous.pagination_cutoff);
|
|
284
|
+
if (Number.isFinite(savedCutoff.getTime())) cutoffDate = savedCutoff;
|
|
285
|
+
}
|
|
278
286
|
|
|
279
287
|
const http = createHttpClient({
|
|
280
288
|
token: accessToken,
|
|
@@ -283,6 +291,8 @@ export default class RedditConnector extends ConnectorRuntime {
|
|
|
283
291
|
});
|
|
284
292
|
|
|
285
293
|
const events: EventEnvelope[] = [];
|
|
294
|
+
const seenItems = new Set<string>();
|
|
295
|
+
const seenCursors = new Set<string>();
|
|
286
296
|
let after: string | null = null;
|
|
287
297
|
let reachedCutoff = false;
|
|
288
298
|
|
|
@@ -303,6 +313,12 @@ export default class RedditConnector extends ConnectorRuntime {
|
|
|
303
313
|
listing = await http.get<RedditListingResponse>(url);
|
|
304
314
|
} catch (error) {
|
|
305
315
|
if (error instanceof HttpStatusError) {
|
|
316
|
+
// A saved fullname can disappear from a changing listing. The head
|
|
317
|
+
// was fetched successfully; clear the rejected anchor for next run.
|
|
318
|
+
if (cursor === resumeAfter && cursor && [400, 404].includes(error.status)) {
|
|
319
|
+
after = null;
|
|
320
|
+
return { items: [], nextCursor: null };
|
|
321
|
+
}
|
|
306
322
|
if (error.status === 404) {
|
|
307
323
|
throw new Error('Subreddit or resource not found. Please check the subreddit name.');
|
|
308
324
|
}
|
|
@@ -314,8 +330,19 @@ export default class RedditConnector extends ConnectorRuntime {
|
|
|
314
330
|
}
|
|
315
331
|
|
|
316
332
|
const children = listing.data.children;
|
|
317
|
-
if (
|
|
318
|
-
|
|
333
|
+
if (cursor) seenCursors.add(cursor);
|
|
334
|
+
after = children.length > 0 ? listing.data.after : null;
|
|
335
|
+
// Reject loops (including a provider ignoring `after` and replaying the
|
|
336
|
+
// head). End the sweep so the next run can start with a fresh listing.
|
|
337
|
+
if (after && seenCursors.has(after)) after = null;
|
|
338
|
+
if (cursor === null && after) {
|
|
339
|
+
seenCursors.add(after);
|
|
340
|
+
// Spend one page on fresh arrivals, then resume the unfinished sweep.
|
|
341
|
+
// Arrivals beyond this page are caught by the next full sweep: never
|
|
342
|
+
// use last_timestamp as a high-water mark on these mutable listings.
|
|
343
|
+
after = resumeAfter ?? after;
|
|
344
|
+
}
|
|
345
|
+
return { items: children, nextCursor: after };
|
|
319
346
|
},
|
|
320
347
|
{ maxPages: this.MAX_PAGES, delayMs: this.RATE_LIMIT_MS }
|
|
321
348
|
);
|
|
@@ -334,6 +361,8 @@ export default class RedditConnector extends ConnectorRuntime {
|
|
|
334
361
|
|
|
335
362
|
// Filter deleted/removed items
|
|
336
363
|
if (itemData.author === '[deleted]') continue;
|
|
364
|
+
if (seenItems.has(itemData.name)) continue;
|
|
365
|
+
seenItems.add(itemData.name);
|
|
337
366
|
|
|
338
367
|
// Use actual Reddit API kind (t3=post, t1=comment) instead of config
|
|
339
368
|
const isPost = child.kind === 't3';
|
|
@@ -359,12 +388,13 @@ export default class RedditConnector extends ConnectorRuntime {
|
|
|
359
388
|
|
|
360
389
|
const checkpoint: RedditCheckpoint = {
|
|
361
390
|
last_timestamp: new Date().toISOString(),
|
|
362
|
-
pagination_token: after ?? undefined,
|
|
391
|
+
pagination_token: !reachedCutoff ? (after ?? undefined) : undefined,
|
|
392
|
+
pagination_cutoff: !reachedCutoff && after ? cutoffDate.toISOString() : undefined,
|
|
363
393
|
};
|
|
364
394
|
|
|
395
|
+
await ctx.commit(events, checkpoint as Record<string, unknown>);
|
|
365
396
|
return {
|
|
366
|
-
|
|
367
|
-
checkpoint: checkpoint as Record<string, unknown>,
|
|
397
|
+
status: 'complete',
|
|
368
398
|
metadata: {
|
|
369
399
|
items_found: events.length,
|
|
370
400
|
},
|
package/dist/connectors/rss.ts
CHANGED
|
@@ -181,9 +181,9 @@ export default class RSSConnector extends ConnectorRuntime {
|
|
|
181
181
|
last_published_at: latestPublishedAt,
|
|
182
182
|
};
|
|
183
183
|
|
|
184
|
+
await ctx.commit(events, newCheckpoint as unknown as Record<string, unknown>);
|
|
184
185
|
return {
|
|
185
|
-
|
|
186
|
-
checkpoint: newCheckpoint as unknown as Record<string, unknown>,
|
|
186
|
+
status: 'complete',
|
|
187
187
|
metadata: {
|
|
188
188
|
items_found: events.length,
|
|
189
189
|
feeds_fetched: feedUrls.length - fetchErrors.length,
|
|
@@ -937,7 +937,7 @@ export default class WhatsAppWebConnector extends ConnectorRuntime<
|
|
|
937
937
|
|
|
938
938
|
private async syncMessages(
|
|
939
939
|
ctx: SyncContext<BrowserCheckpoint, WhatsAppWebConfig>
|
|
940
|
-
): Promise<SyncResult
|
|
940
|
+
): Promise<SyncResult> {
|
|
941
941
|
const dispatcher = requireExtensionDispatcher(ctx);
|
|
942
942
|
const tabId = await readyWhatsAppTab(dispatcher);
|
|
943
943
|
return await this.collectMessages(ctx, dispatcher, tabId);
|
|
@@ -954,7 +954,7 @@ export default class WhatsAppWebConnector extends ConnectorRuntime<
|
|
|
954
954
|
ctx: SyncContext<BrowserCheckpoint, WhatsAppWebConfig>,
|
|
955
955
|
dispatcher: ChromeActionDispatcher,
|
|
956
956
|
tabId: number
|
|
957
|
-
): Promise<SyncResult
|
|
957
|
+
): Promise<SyncResult> {
|
|
958
958
|
try {
|
|
959
959
|
return await this.collectMessagesInner(ctx, dispatcher, tabId);
|
|
960
960
|
} catch (error) {
|
|
@@ -968,7 +968,7 @@ export default class WhatsAppWebConnector extends ConnectorRuntime<
|
|
|
968
968
|
ctx: SyncContext<BrowserCheckpoint, WhatsAppWebConfig>,
|
|
969
969
|
dispatcher: ChromeActionDispatcher,
|
|
970
970
|
tabId: number
|
|
971
|
-
): Promise<SyncResult
|
|
971
|
+
): Promise<SyncResult> {
|
|
972
972
|
const { checkpoint, request } = buildCollectionPlan({
|
|
973
973
|
checkpoint: ctx.checkpoint as Record<string, unknown> | null,
|
|
974
974
|
config: ctx.config as Record<string, unknown>,
|
|
@@ -1144,7 +1144,8 @@ export default class WhatsAppWebConnector extends ConnectorRuntime<
|
|
|
1144
1144
|
nextCheckpoint.diagnostics =
|
|
1145
1145
|
Object.keys(diagnostics).length > 0 ? diagnostics : undefined;
|
|
1146
1146
|
|
|
1147
|
-
|
|
1147
|
+
await ctx.commit(events, nextCheckpoint as unknown as BrowserCheckpoint);
|
|
1148
|
+
return { status: "complete" };
|
|
1148
1149
|
}
|
|
1149
1150
|
|
|
1150
1151
|
async execute(ctx: ActionContext): Promise<ActionResult> {
|