@oomol-lab/open-connector 1.6.5 → 1.8.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/README.md +4 -0
- package/assets/open-connector/catalog/apps/airtable.json +134 -0
- package/assets/open-connector/catalog/apps/aisa.json +6985 -319
- package/assets/open-connector/catalog/apps/baizhi_mcp.json +135 -0
- package/assets/open-connector/catalog/apps/cal.json +24 -6
- package/assets/open-connector/catalog/apps/discordbot.json +2888 -248
- package/assets/open-connector/catalog/apps/drawio_mcp.json +192 -0
- package/assets/open-connector/catalog/apps/enormail.json +411 -0
- package/assets/open-connector/catalog/apps/feishu_app_bot.json +158 -0
- package/assets/open-connector/catalog/apps/firecrawl.json +176 -32
- package/assets/open-connector/catalog/apps/framejet.json +273 -0
- package/assets/open-connector/catalog/apps/futunn.json +2967 -0
- package/assets/open-connector/catalog/apps/github.json +275 -0
- package/assets/open-connector/catalog/apps/gitlab.json +125 -0
- package/assets/open-connector/catalog/apps/gmail.json +376 -0
- package/assets/open-connector/catalog/apps/google_analytics.json +4 -1
- package/assets/open-connector/catalog/apps/google_bigquery.json +4 -1
- package/assets/open-connector/catalog/apps/google_search_console.json +4 -1
- package/assets/open-connector/catalog/apps/googlecalendar.json +210 -1
- package/assets/open-connector/catalog/apps/googlechat.json +694 -7
- package/assets/open-connector/catalog/apps/googledocs.json +4 -1
- package/assets/open-connector/catalog/apps/googledrive.json +479 -0
- package/assets/open-connector/catalog/apps/googlesheets.json +148 -1
- package/assets/open-connector/catalog/apps/granola.json +23 -0
- package/assets/open-connector/catalog/apps/hithink_finance.json +6 -3
- package/assets/open-connector/catalog/apps/indexed.json +1115 -0
- package/assets/open-connector/catalog/apps/keepa.json +3534 -987
- package/assets/open-connector/catalog/apps/linear.json +133 -0
- package/assets/open-connector/catalog/apps/linear_mcp.json +510 -0
- package/assets/open-connector/catalog/apps/moneyforward_mcp.json +1432 -0
- package/assets/open-connector/catalog/apps/notion.json +588 -1
- package/assets/open-connector/catalog/apps/notion_mcp.json +490 -0
- package/assets/open-connector/catalog/apps/odoo.json +619 -0
- package/assets/open-connector/catalog/apps/one_drive.json +185 -0
- package/assets/open-connector/catalog/apps/outlook.json +212 -8
- package/assets/open-connector/catalog/apps/outlook_calendar.json +23 -2
- package/assets/open-connector/catalog/apps/postiz.json +334 -0
- package/assets/open-connector/catalog/apps/proworkflow.json +529 -0
- package/assets/open-connector/catalog/apps/sellersprite_mcp.json +2 -1
- package/assets/open-connector/catalog/apps/shopify.json +282 -0
- package/assets/open-connector/catalog/apps/slack.json +405 -0
- package/assets/open-connector/catalog/apps/slackbot.json +214 -0
- package/assets/open-connector/catalog/apps/spotify.json +46 -43
- package/assets/open-connector/catalog/apps/stripe.json +96 -0
- package/assets/open-connector/catalog/apps/telegram.json +138 -0
- package/assets/open-connector/catalog/apps/tencent_docs.json +3 -0
- package/assets/open-connector/catalog/apps/weixin_store.json +543 -2
- package/assets/open-connector/catalog/apps/wisburg.json +1528 -0
- package/assets/open-connector/catalog/apps/woocommerce.json +127 -0
- package/assets/open-connector/catalog/apps/youtube.json +4 -1
- package/assets/open-connector/catalog/apps/zendesk.json +152 -0
- package/assets/open-connector/catalog/apps/zerotier.json +3319 -0
- package/assets/open-connector/catalog/apps-index.json +1 -1
- package/assets/open-connector/migrations/0014_saas_project.sql +55 -0
- package/assets/open-connector/migrations/0015_saas_cleanup_runtime.sql +8 -0
- package/assets/open-connector/migrations/0016_trigger_policy.sql +1 -0
- package/assets/open-connector/migrations/0017_trigger_subscriptions.sql +17 -0
- package/assets/open-connector/migrations/postgresql/0014_saas_project.sql +55 -0
- package/assets/open-connector/migrations/postgresql/0015_saas_cleanup_runtime.sql +8 -0
- package/assets/open-connector/migrations/postgresql/0016_trigger_policy.sql +1 -0
- package/assets/open-connector/migrations/postgresql/0017_trigger_subscriptions.sql +17 -0
- package/package.json +2 -2
- package/src/connection-service.d.ts +40 -7
- package/src/connection-service.js +60 -18
- package/src/core/action-policy.d.ts +8 -1
- package/src/core/action-policy.js +51 -0
- package/src/core/cast.d.ts +13 -0
- package/src/core/cast.js +18 -1
- package/src/core/guarded-fetch.d.ts +11 -3
- package/src/core/guarded-fetch.js +19 -7
- package/src/core/provider-scenarios.js +67 -13
- package/src/core/remote-http.d.ts +33 -0
- package/src/core/remote-http.js +104 -0
- package/src/core/request.d.ts +1 -0
- package/src/core/request.js +11 -1
- package/src/core/types.d.ts +5 -1
- package/src/marketplace/marketplace-service.d.ts +0 -1
- package/src/marketplace/marketplace-service.js +80 -92
- package/src/mcp.js +26 -9
- package/src/oauth/oauth-client-config-service.d.ts +16 -1
- package/src/oauth/oauth-client-config-service.js +59 -3
- package/src/oauth/oauth-flow-service.d.ts +14 -1
- package/src/oauth/oauth-flow-service.js +14 -6
- package/src/providers/17track/runtime.js +1 -1
- package/src/providers/action-contracts.generated.d.ts +20 -6
- package/src/providers/aifinmarket/runtime.js +1 -1
- package/src/providers/airtable/executors.d.ts +3 -0
- package/src/providers/airtable/executors.js +2 -0
- package/src/providers/airtable/trigger-on-record-changed.d.ts +2 -0
- package/src/providers/airtable/trigger-on-record-changed.definition.d.ts +4 -0
- package/src/providers/airtable/trigger-on-record-changed.definition.js +54 -0
- package/src/providers/airtable/trigger-on-record-changed.js +235 -0
- package/src/providers/aisa/executors.js +912 -50
- package/src/providers/aliyun_ack/runtime.js +1 -1
- package/src/providers/aliyun_sls/runtime.js +1 -1
- package/src/providers/app_store_server/runtime-helpers.js +1 -1
- package/src/providers/baizhi_mcp/actions.d.ts +2 -0
- package/src/providers/baizhi_mcp/actions.js +40 -0
- package/src/providers/baizhi_mcp/executors.d.ts +3 -0
- package/src/providers/baizhi_mcp/executors.js +102 -0
- package/src/providers/bazhuayu/runtime.js +2 -2
- package/src/providers/bilibili/runtime.js +2 -4
- package/src/providers/bilibili/upload.js +9 -7
- package/src/providers/cal/actions.js +5 -1
- package/src/providers/cloudflare_browser_rendering/executors.js +1 -1
- package/src/providers/cloudflare_dns/executors.js +1 -1
- package/src/providers/{cloudflare-current-user.js → cloudflare_dns/runtime-user.js} +2 -2
- package/src/providers/cloudflare_dns/runtime.d.ts +1 -1
- package/src/providers/cloudflare_dns/runtime.js +1 -1
- package/src/providers/cloudflare_r2/executors.js +1 -1
- package/src/providers/cloudflare_r2/runtime.d.ts +1 -1
- package/src/providers/cloudflare_r2/runtime.js +1 -1
- package/src/providers/cloudflare_worker/executors.js +1 -1
- package/src/providers/cloudflare_worker/runtime.d.ts +1 -1
- package/src/providers/cloudflare_worker/runtime.js +1 -1
- package/src/providers/dingtalk_mcp/runtime.js +1 -1
- package/src/providers/discordbot/executors.d.ts +0 -9
- package/src/providers/discordbot/executors.js +9 -101
- package/src/providers/discordbot/runtime-guilds.d.ts +3 -0
- package/src/providers/discordbot/runtime-guilds.js +464 -0
- package/src/providers/discordbot/runtime.d.ts +42 -0
- package/src/providers/discordbot/runtime.js +124 -0
- package/src/providers/drawio_mcp/executors.d.ts +3 -0
- package/src/providers/drawio_mcp/executors.js +19 -0
- package/src/providers/drawio_mcp/runtime.d.ts +8 -0
- package/src/providers/drawio_mcp/runtime.js +175 -0
- package/src/providers/enormail/executors.d.ts +4 -0
- package/src/providers/enormail/executors.js +97 -0
- package/src/providers/fastmoss_mcp/executors.js +2 -2
- package/src/providers/feishu_app_bot/executors.d.ts +3 -0
- package/src/providers/feishu_app_bot/executors.js +2 -0
- package/src/providers/feishu_app_bot/trigger-config.d.ts +1 -0
- package/src/providers/feishu_app_bot/trigger-config.js +10 -0
- package/src/providers/feishu_app_bot/trigger-on-event.d.ts +2 -0
- package/src/providers/feishu_app_bot/trigger-on-event.definition.d.ts +4 -0
- package/src/providers/feishu_app_bot/trigger-on-event.definition.js +63 -0
- package/src/providers/feishu_app_bot/trigger-on-event.js +29 -0
- package/src/providers/feishu_app_bot/trigger-subscriptions.d.ts +5 -0
- package/src/providers/feishu_app_bot/trigger-subscriptions.js +70 -0
- package/src/providers/finchina/executors.js +1 -1
- package/src/providers/framejet/executors.d.ts +4 -0
- package/src/providers/framejet/executors.js +19 -0
- package/src/providers/framejet/runtime.d.ts +16 -0
- package/src/providers/framejet/runtime.js +148 -0
- package/src/providers/futunn/actions.d.ts +2 -0
- package/src/providers/futunn/actions.js +152 -0
- package/src/providers/futunn/actions.research.d.ts +2 -0
- package/src/providers/futunn/actions.research.js +423 -0
- package/src/providers/futunn/actions.trading.d.ts +2 -0
- package/src/providers/futunn/actions.trading.js +204 -0
- package/src/providers/futunn/executors.d.ts +3 -0
- package/src/providers/futunn/executors.js +24 -0
- package/src/providers/futunn/runtime-research.d.ts +3 -0
- package/src/providers/futunn/runtime-research.js +133 -0
- package/src/providers/futunn/runtime-trading.d.ts +3 -0
- package/src/providers/futunn/runtime-trading.js +39 -0
- package/src/providers/futunn/runtime.d.ts +2 -0
- package/src/providers/futunn/runtime.js +50 -0
- package/src/providers/futunn/transport.d.ts +11 -0
- package/src/providers/futunn/transport.js +76 -0
- package/src/providers/gildata/executors.js +1 -1
- package/src/providers/github/executors.d.ts +3 -0
- package/src/providers/github/executors.js +6 -0
- package/src/providers/github/trigger-on-repo-event.d.ts +2 -0
- package/src/providers/github/trigger-on-repo-event.definition.d.ts +4 -0
- package/src/providers/github/trigger-on-repo-event.definition.js +94 -0
- package/src/providers/github/trigger-on-repo-event.js +168 -0
- package/src/providers/github/trigger-watch-pull-request.d.ts +2 -0
- package/src/providers/github/trigger-watch-pull-request.definition.d.ts +4 -0
- package/src/providers/github/trigger-watch-pull-request.definition.js +49 -0
- package/src/providers/github/trigger-watch-pull-request.js +106 -0
- package/src/providers/gitlab/executors.d.ts +3 -0
- package/src/providers/gitlab/executors.js +2 -0
- package/src/providers/gitlab/trigger-on-project-event.d.ts +2 -0
- package/src/providers/gitlab/trigger-on-project-event.definition.d.ts +5 -0
- package/src/providers/gitlab/trigger-on-project-event.definition.js +63 -0
- package/src/providers/gitlab/trigger-on-project-event.js +186 -0
- package/src/providers/gmail/executors.d.ts +3 -0
- package/src/providers/gmail/executors.js +5 -3
- package/src/providers/gmail/message.d.ts +6 -8
- package/src/providers/gmail/message.js +4 -0
- package/src/providers/gmail/scopes.d.ts +32 -0
- package/src/providers/gmail/scopes.js +37 -0
- package/src/providers/gmail/trigger-on-message-received.d.ts +2 -0
- package/src/providers/gmail/trigger-on-message-received.definition.d.ts +4 -0
- package/src/providers/gmail/trigger-on-message-received.definition.js +74 -0
- package/src/providers/gmail/trigger-on-message-received.js +232 -0
- package/src/providers/google_analytics/executors.js +2 -2
- package/src/providers/google_analytics/scopes.js +6 -1
- package/src/providers/google_bigquery/executors.js +2 -2
- package/src/providers/google_bigquery/scopes.js +2 -0
- package/src/providers/google_search_console/executors.js +2 -2
- package/src/providers/google_search_console/scopes.js +2 -0
- package/src/providers/googleads/executors.js +1 -1
- package/src/providers/googleads/scopes.d.ts +1 -3
- package/src/providers/googleads/scopes.js +2 -4
- package/src/providers/googlecalendar/executors.d.ts +3 -0
- package/src/providers/googlecalendar/executors.js +3 -1
- package/src/providers/googlecalendar/runtime-shared.js +2 -2
- package/src/providers/googlecalendar/scopes.js +2 -0
- package/src/providers/googlecalendar/trigger-on-event-changed.d.ts +2 -0
- package/src/providers/googlecalendar/trigger-on-event-changed.definition.d.ts +4 -0
- package/src/providers/googlecalendar/trigger-on-event-changed.definition.js +74 -0
- package/src/providers/googlecalendar/trigger-on-event-changed.js +233 -0
- package/src/providers/googlechat/executors.d.ts +1 -3
- package/src/providers/googlechat/executors.js +219 -28
- package/src/providers/googlechat/members.d.ts +55 -0
- package/src/providers/googlechat/members.js +293 -0
- package/src/providers/googlechat/runtime.d.ts +16 -0
- package/src/providers/googlechat/runtime.js +25 -0
- package/src/providers/googlechat/scopes.d.ts +22 -3
- package/src/providers/googlechat/scopes.js +30 -7
- package/src/providers/googledocs/executors.js +1 -1
- package/src/providers/googledrive/executors.d.ts +3 -0
- package/src/providers/googledrive/executors.js +9 -2
- package/src/providers/{google-auth.d.ts → googledrive/runtime-auth.d.ts} +2 -2
- package/src/providers/{google-auth.js → googledrive/runtime-auth.js} +3 -3
- package/src/providers/googledrive/runtime-collaboration.js +1 -1
- package/src/providers/{google-runtime.d.ts → googledrive/runtime-request.d.ts} +1 -1
- package/src/providers/{google-runtime.js → googledrive/runtime-request.js} +2 -2
- package/src/providers/googledrive/trigger-changes.d.ts +12 -0
- package/src/providers/googledrive/trigger-changes.definition.d.ts +7 -0
- package/src/providers/googledrive/trigger-changes.definition.js +101 -0
- package/src/providers/googledrive/trigger-changes.js +452 -0
- package/src/providers/googledrive/trigger-on-file-change.d.ts +2 -0
- package/src/providers/googledrive/trigger-on-file-change.definition.d.ts +4 -0
- package/src/providers/googledrive/trigger-on-file-change.definition.js +77 -0
- package/src/providers/googledrive/trigger-on-file-change.js +258 -0
- package/src/providers/googleforms/executors.js +2 -2
- package/src/providers/googleforms/scopes.d.ts +0 -3
- package/src/providers/googleforms/scopes.js +2 -6
- package/src/providers/googlemeet/executors.js +2 -2
- package/src/providers/googlemeet/scopes.d.ts +0 -3
- package/src/providers/googlemeet/scopes.js +2 -6
- package/src/providers/googlesheets/executors.d.ts +3 -0
- package/src/providers/googlesheets/executors.js +3 -1
- package/src/providers/googlesheets/scopes.js +2 -0
- package/src/providers/googlesheets/trigger-on-row-added.d.ts +2 -0
- package/src/providers/googlesheets/trigger-on-row-added.definition.d.ts +4 -0
- package/src/providers/googlesheets/trigger-on-row-added.definition.js +54 -0
- package/src/providers/googlesheets/trigger-on-row-added.js +234 -0
- package/src/providers/googleslides/executors.js +2 -2
- package/src/providers/googleslides/scopes.d.ts +0 -3
- package/src/providers/googleslides/scopes.js +2 -6
- package/src/providers/googletasks/executors.js +2 -2
- package/src/providers/googletasks/scopes.d.ts +0 -3
- package/src/providers/googletasks/scopes.js +2 -6
- package/src/providers/granola/actions.js +2 -0
- package/src/providers/granola/runtime-mcp.js +2 -0
- package/src/providers/granola/runtime.js +2 -2
- package/src/providers/hithink_finance/runtime.js +1 -1
- package/src/providers/indexed/executors.d.ts +4 -0
- package/src/providers/indexed/executors.js +16 -0
- package/src/providers/indexed/runtime.d.ts +26 -0
- package/src/providers/indexed/runtime.js +129 -0
- package/src/providers/indiegogo/executors.js +1 -1
- package/src/providers/investoday_mcp/executors.js +2 -2
- package/src/providers/iyunbiao/runtime.js +2 -2
- package/src/providers/keepa/actions.d.ts +1 -1
- package/src/providers/keepa/actions.js +371 -149
- package/src/providers/keepa/deal-attributes.d.ts +1 -0
- package/src/providers/keepa/deal-attributes.js +26 -0
- package/src/providers/keepa/runtime.js +212 -18
- package/src/providers/kingdee/executors.js +1 -1
- package/src/providers/kingdee/runtime.js +2 -2
- package/src/providers/kuaidi100/runtime.js +1 -1
- package/src/providers/linear/executors.d.ts +3 -0
- package/src/providers/linear/executors.js +14 -9
- package/src/providers/linear/trigger-on-issue-changed.d.ts +2 -0
- package/src/providers/linear/trigger-on-issue-changed.definition.d.ts +5 -0
- package/src/providers/linear/trigger-on-issue-changed.definition.js +43 -0
- package/src/providers/linear/trigger-on-issue-changed.js +215 -0
- package/src/providers/linear_mcp/actions.d.ts +47 -0
- package/src/providers/linear_mcp/actions.js +102 -0
- package/src/providers/linear_mcp/endpoints.d.ts +3 -0
- package/src/providers/linear_mcp/endpoints.js +3 -0
- package/src/providers/linear_mcp/executors.d.ts +3 -0
- package/src/providers/linear_mcp/executors.js +9 -0
- package/src/providers/linear_mcp/runtime-mcp.d.ts +15 -0
- package/src/providers/linear_mcp/runtime-mcp.js +238 -0
- package/src/providers/lingxing_mcp/runtime.js +1 -1
- package/src/providers/mcdonalds_cn_mcp/runtime.js +1 -1
- package/src/providers/metabase/mcp-runtime.js +1 -1
- package/src/providers/moneyforward_mcp/executors.d.ts +3 -0
- package/src/providers/moneyforward_mcp/executors.js +11 -0
- package/src/providers/moneyforward_mcp/manifest.d.ts +31 -0
- package/src/providers/moneyforward_mcp/manifest.js +204 -0
- package/src/providers/moneyforward_mcp/runtime.d.ts +18 -0
- package/src/providers/moneyforward_mcp/runtime.js +296 -0
- package/src/providers/notion/executors.d.ts +3 -0
- package/src/providers/notion/executors.js +41 -3
- package/src/providers/notion/trigger-on-database-page-event.d.ts +2 -0
- package/src/providers/notion/trigger-on-database-page-event.definition.d.ts +4 -0
- package/src/providers/notion/trigger-on-database-page-event.definition.js +63 -0
- package/src/providers/notion/trigger-on-database-page-event.js +293 -0
- package/src/providers/notion_mcp/endpoints.d.ts +3 -0
- package/src/providers/notion_mcp/endpoints.js +3 -0
- package/src/providers/notion_mcp/executors.d.ts +3 -0
- package/src/providers/notion_mcp/executors.js +176 -0
- package/src/providers/notion_mcp/mcp-response.d.ts +86 -0
- package/src/providers/notion_mcp/mcp-response.js +314 -0
- package/src/providers/odoo/executors.d.ts +3 -0
- package/src/providers/odoo/executors.js +32 -0
- package/src/providers/odoo/runtime.d.ts +16 -0
- package/src/providers/odoo/runtime.js +140 -0
- package/src/providers/one_drive/executors.d.ts +3 -0
- package/src/providers/one_drive/executors.js +2 -0
- package/src/providers/one_drive/trigger-on-item-changed.d.ts +2 -0
- package/src/providers/one_drive/trigger-on-item-changed.definition.d.ts +4 -0
- package/src/providers/one_drive/trigger-on-item-changed.definition.js +63 -0
- package/src/providers/one_drive/trigger-on-item-changed.js +214 -0
- package/src/providers/outlook/executors.d.ts +3 -0
- package/src/providers/outlook/executors.js +29 -6
- package/src/providers/outlook/microsoft-graph.js +17 -6
- package/src/providers/outlook/trigger-on-message-received.d.ts +2 -0
- package/src/providers/outlook/trigger-on-message-received.definition.d.ts +4 -0
- package/src/providers/outlook/trigger-on-message-received.definition.js +93 -0
- package/src/providers/outlook/trigger-on-message-received.js +226 -0
- package/src/providers/outlook_calendar/executors.js +30 -7
- package/src/providers/patsnap_mcp/executors.js +2 -2
- package/src/providers/postiz/executors.d.ts +4 -0
- package/src/providers/postiz/executors.js +83 -0
- package/src/providers/provider-loader.d.ts +5 -0
- package/src/providers/provider-loader.js +4 -0
- package/src/providers/provider-runtime.d.ts +15 -0
- package/src/providers/provider-runtime.js +57 -4
- package/src/providers/proworkflow/executors.d.ts +4 -0
- package/src/providers/proworkflow/executors.js +135 -0
- package/src/providers/registry.generated.js +14 -0
- package/src/providers/scrape_creators/catalog.js +1 -1
- package/src/providers/scrape_creators/runtime.js +1 -1
- package/src/providers/sellersprite_mcp/executors.js +2 -2
- package/src/providers/sellersprite_mcp/official-actions.js +3 -2
- package/src/providers/sentry/runtime.js +6 -7
- package/src/providers/shopify/executors.d.ts +3 -0
- package/src/providers/shopify/executors.js +2 -0
- package/src/providers/shopify/trigger-on-shop-event.d.ts +2 -0
- package/src/providers/shopify/trigger-on-shop-event.definition.d.ts +4 -0
- package/src/providers/shopify/trigger-on-shop-event.definition.js +214 -0
- package/src/providers/shopify/trigger-on-shop-event.js +165 -0
- package/src/providers/slack/actions.js +52 -3
- package/src/providers/slack/executors.d.ts +3 -0
- package/src/providers/slack/executors.js +2 -0
- package/src/providers/slack/runtime.js +58 -21
- package/src/providers/slack/trigger-on-message-posted.d.ts +2 -0
- package/src/providers/slack/trigger-on-message-posted.definition.d.ts +4 -0
- package/src/providers/slack/trigger-on-message-posted.definition.js +80 -0
- package/src/providers/slack/trigger-on-message-posted.js +176 -0
- package/src/providers/slickdeals/runtime.js +1 -1
- package/src/providers/sorftime_mcp/executors.js +2 -2
- package/src/providers/spotify/runtime.js +15 -4
- package/src/providers/stripe/executors.d.ts +3 -0
- package/src/providers/stripe/executors.js +2 -0
- package/src/providers/stripe/trigger-on-event.d.ts +2 -0
- package/src/providers/stripe/trigger-on-event.definition.d.ts +4 -0
- package/src/providers/stripe/trigger-on-event.definition.js +43 -0
- package/src/providers/stripe/trigger-on-event.js +212 -0
- package/src/providers/telegram/executors.d.ts +3 -0
- package/src/providers/telegram/executors.js +2 -0
- package/src/providers/telegram/trigger-on-update.d.ts +2 -0
- package/src/providers/telegram/trigger-on-update.definition.d.ts +5 -0
- package/src/providers/telegram/trigger-on-update.definition.js +78 -0
- package/src/providers/telegram/trigger-on-update.js +141 -0
- package/src/providers/tikhub/bounded-response.d.ts +1 -1
- package/src/providers/tikhub/bounded-response.js +8 -34
- package/src/providers/tikhub/endpoint-catalog.js +1 -1
- package/src/providers/tikhub/runtime.js +2 -2
- package/src/providers/tongdaxin/executors.js +79 -15
- package/src/providers/uspto/executors.js +1 -1
- package/src/providers/waffo/executors.js +1 -1
- package/src/providers/waffo/runtime.js +1 -1
- package/src/providers/wecom_mcp/runtime.js +1 -1
- package/src/providers/weixin_store/access-token.d.ts +2 -1
- package/src/providers/weixin_store/access-token.js +15 -4
- package/src/providers/weixin_store/executors.js +97 -12
- package/src/providers/wisburg/executors.d.ts +4 -0
- package/src/providers/wisburg/executors.js +13 -0
- package/src/providers/wisburg/runtime.d.ts +12 -0
- package/src/providers/wisburg/runtime.js +133 -0
- package/src/providers/woocommerce/executors.d.ts +3 -0
- package/src/providers/woocommerce/executors.js +2 -0
- package/src/providers/woocommerce/trigger-on-store-event.d.ts +2 -0
- package/src/providers/woocommerce/trigger-on-store-event.definition.d.ts +4 -0
- package/src/providers/woocommerce/trigger-on-store-event.definition.js +55 -0
- package/src/providers/woocommerce/trigger-on-store-event.js +179 -0
- package/src/providers/xydc_mcp/executors.js +2 -2
- package/src/providers/youtube/executors.js +1 -1
- package/src/providers/youtube/runtime.js +1 -1
- package/src/providers/zendesk/executors.d.ts +3 -0
- package/src/providers/zendesk/executors.js +2 -0
- package/src/providers/zendesk/trigger-on-event.d.ts +2 -0
- package/src/providers/zendesk/trigger-on-event.definition.d.ts +5 -0
- package/src/providers/zendesk/trigger-on-event.definition.js +101 -0
- package/src/providers/zendesk/trigger-on-event.js +188 -0
- package/src/providers/zerotier/executors.d.ts +9 -0
- package/src/providers/zerotier/executors.js +629 -0
- package/src/providers/zerotier/runtime.d.ts +54 -0
- package/src/providers/zerotier/runtime.js +207 -0
- package/src/saas/saas-cleanup-service.d.ts +26 -0
- package/src/saas/saas-cleanup-service.js +124 -0
- package/src/saas/saas-client.d.ts +86 -0
- package/src/saas/saas-client.js +369 -0
- package/src/saas/saas-execution-service.d.ts +15 -0
- package/src/saas/saas-execution-service.js +21 -0
- package/src/saas/saas-oauth-service.d.ts +25 -0
- package/src/saas/saas-oauth-service.js +197 -0
- package/src/saas/saas-project-service.d.ts +61 -0
- package/src/saas/saas-project-service.js +211 -0
- package/src/server/actions/action-idempotency.d.ts +1 -0
- package/src/server/actions/action-idempotency.js +1 -0
- package/src/server/actions/action-runner.d.ts +7 -0
- package/src/server/actions/action-runner.js +43 -7
- package/src/server/actions/run-log-summary.js +9 -0
- package/src/server/api/auth.d.ts +1 -0
- package/src/server/api/auth.js +13 -2
- package/src/server/api/cache-policy.js +4 -1
- package/src/server/api/connection-input.d.ts +7 -1
- package/src/server/api/connection-input.js +7 -1
- package/src/server/api/connection-routes.d.ts +3 -1
- package/src/server/api/connection-routes.js +21 -3
- package/src/server/api/http-utils.d.ts +4 -3
- package/src/server/api/oauth-completion-page.d.ts +124 -0
- package/src/server/api/oauth-completion-page.js +113 -18
- package/src/server/api/openapi.js +123 -15
- package/src/server/api/policy-input.js +6 -0
- package/src/server/api/runtime-api.d.ts +18 -3
- package/src/server/api/runtime-api.js +36 -5
- package/src/server/api/saas-completion-page.d.ts +2 -0
- package/src/server/api/saas-completion-page.js +103 -0
- package/src/server/connect-app.d.ts +5 -0
- package/src/server/connect-app.js +50 -0
- package/src/server/connect-server.d.ts +12 -0
- package/src/server/connect-server.js +157 -15
- package/src/server/connector-runtime.d.ts +3 -1
- package/src/server/connector-runtime.js +5 -2
- package/src/server/files/transit-files.js +16 -7
- package/src/server/proxy/proxy-runner.d.ts +5 -1
- package/src/server/proxy/proxy-runner.js +72 -26
- package/src/server/storage/connection-request-store.d.ts +41 -1
- package/src/server/storage/connection-request-store.js +245 -20
- package/src/server/storage/connection-store.d.ts +16 -0
- package/src/server/storage/connection-store.js +119 -0
- package/src/server/storage/node-runtime-database.js +3 -3
- package/src/server/storage/{postgres-migrations.d.ts → postgres/migrations.d.ts} +2 -2
- package/src/server/storage/{postgres-migrations.js → postgres/migrations.js} +1 -1
- package/src/server/storage/postgres/runtime-store.d.ts +43 -0
- package/src/server/storage/{postgres-runtime-store.js → postgres/runtime-store.js} +59 -94
- package/src/server/storage/runtime-database.d.ts +4 -0
- package/src/server/storage/runtime-sql.d.ts +1 -1
- package/src/server/storage/runtime-sql.js +2 -1
- package/src/server/storage/runtime-store.d.ts +1 -0
- package/src/server/storage/runtime-token-service.d.ts +2 -0
- package/src/server/storage/runtime-token-service.js +3 -0
- package/src/server/storage/saas-project-store.d.ts +77 -0
- package/src/server/storage/saas-project-store.js +273 -0
- package/src/server/storage/{sqlite-runtime-store.d.ts → sqlite/runtime-store.d.ts} +21 -25
- package/src/server/storage/{sqlite-runtime-store.js → sqlite/runtime-store.js} +100 -115
- package/src/server/storage/trigger-store.d.ts +16 -0
- package/src/server/storage/trigger-store.js +96 -0
- package/src/triggers/common/config.d.ts +2 -0
- package/src/triggers/common/config.js +17 -0
- package/src/triggers/common/configOptions.d.ts +13 -0
- package/src/triggers/common/configOptions.js +1 -0
- package/src/triggers/common/encoding.d.ts +3 -0
- package/src/triggers/common/encoding.js +19 -0
- package/src/triggers/common/integration.d.ts +115 -0
- package/src/triggers/common/integration.js +31 -0
- package/src/triggers/common/json.d.ts +6 -0
- package/src/triggers/common/json.js +91 -0
- package/src/triggers/common/poll.d.ts +41 -0
- package/src/triggers/common/poll.js +15 -0
- package/src/triggers/common/proxy.d.ts +14 -0
- package/src/triggers/common/proxy.js +1 -0
- package/src/triggers/common/types.d.ts +42 -0
- package/src/triggers/common/types.js +1 -0
- package/src/triggers/maintenance.d.ts +40 -0
- package/src/triggers/maintenance.js +120 -0
- package/src/triggers/metadata.d.ts +8 -0
- package/src/triggers/metadata.js +1 -0
- package/src/triggers/request.d.ts +33 -0
- package/src/triggers/request.js +52 -0
- package/src/triggers/resources.d.ts +12 -0
- package/src/triggers/resources.js +121 -0
- package/src/triggers/signature.d.ts +4 -0
- package/src/triggers/signature.js +48 -0
- package/src/triggers/store.d.ts +29 -0
- package/src/triggers/store.js +1 -0
- package/src/triggers/subscriptions.d.ts +22 -0
- package/src/triggers/subscriptions.js +220 -0
- package/src/triggers/trigger-runner.d.ts +34 -0
- package/src/triggers/trigger-runner.js +169 -0
- package/src/providers/sentry/scopes.d.ts +0 -1
- package/src/providers/sentry/scopes.js +0 -7
- package/src/server/storage/postgres-runtime-store.d.ts +0 -39
- /package/src/providers/{cloudflare-current-user.d.ts → cloudflare_dns/runtime-user.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { compactObject, optionalBoolean, optionalInteger, optionalNumber, optionalRecord, optionalString, requiredString, } from "../../core/cast.js";
|
|
1
|
+
import { compactObject, optionalBoolean, optionalInteger, optionalNumber, optionalRecord, optionalString, optionalStringArray, requiredString, } from "../../core/cast.js";
|
|
2
2
|
import { assertPublicHttpUrl, readBoundedResponseBytes } from "../../core/request.js";
|
|
3
|
-
import { createProviderTimeout, defineProviderExecutors, isAbortLikeError, ProviderRequestError, providerInputError, providerResponseError, providerUserAgent, requiredInputString, requiredResponseRecord, runProviderRequest, } from "../provider-runtime.js";
|
|
3
|
+
import { createProviderTimeout, defineProviderExecutors, isAbortLikeError, ProviderRequestError, providerInputError, providerResponseError, providerUserAgent, requiredInputString, requiredResponseRecord, runProviderRequest, withRetryAfterSeconds, } from "../provider-runtime.js";
|
|
4
4
|
import { slackConversationTypes } from "./constants.js";
|
|
5
5
|
export const slackApiBaseUrl = "https://slack.com/api";
|
|
6
6
|
const slackFileUrlMaxBytes = 100 * 1024 * 1024;
|
|
@@ -196,7 +196,8 @@ async function slackGetChannelMessages(input, context) {
|
|
|
196
196
|
url.searchParams.set("cursor", String(input.cursor));
|
|
197
197
|
}
|
|
198
198
|
applySlackHistoryWindow(url, input);
|
|
199
|
-
|
|
199
|
+
const includeRaw = applySlackIncludeRaw(url, input);
|
|
200
|
+
return readSlackMessagePage(await slackGetJson(url, context), "conversations.history", includeRaw);
|
|
200
201
|
}
|
|
201
202
|
async function slackConversationsMembers(input, context) {
|
|
202
203
|
const url = slackApiUrl("conversations.members");
|
|
@@ -214,6 +215,7 @@ async function slackConversationsMembers(input, context) {
|
|
|
214
215
|
};
|
|
215
216
|
}
|
|
216
217
|
async function slackSearchMessages(input, context) {
|
|
218
|
+
const includeRaw = input.includeRaw === true;
|
|
217
219
|
const query = requiredString(input.query, "query", (message) => new ProviderRequestError(400, message));
|
|
218
220
|
if (input.page != null && input.cursor != null) {
|
|
219
221
|
throw new ProviderRequestError(400, "page and cursor cannot be used together");
|
|
@@ -244,7 +246,7 @@ async function slackSearchMessages(input, context) {
|
|
|
244
246
|
const payload = await slackGetJson(url, context);
|
|
245
247
|
return {
|
|
246
248
|
query: optionalString(payload.query) ?? query,
|
|
247
|
-
matches: (payload.messages?.matches ?? []).map((match) => normalizeSearchMessageMatch(match)),
|
|
249
|
+
matches: (payload.messages?.matches ?? []).map((match) => normalizeSearchMessageMatch(match, includeRaw)),
|
|
248
250
|
total: typeof payload.messages?.total === "number" ? payload.messages.total : 0,
|
|
249
251
|
pagination: payload.messages?.pagination ?? {},
|
|
250
252
|
paging: payload.messages?.paging ?? {},
|
|
@@ -318,7 +320,8 @@ async function slackGetThread(input, context) {
|
|
|
318
320
|
url.searchParams.set("cursor", String(input.cursor));
|
|
319
321
|
}
|
|
320
322
|
applySlackHistoryWindow(url, input);
|
|
321
|
-
|
|
323
|
+
const includeRaw = applySlackIncludeRaw(url, input);
|
|
324
|
+
return readSlackMessagePage(await slackGetJson(url, context), "conversations.replies", includeRaw);
|
|
322
325
|
}
|
|
323
326
|
async function slackListConversations(input, context) {
|
|
324
327
|
const url = slackApiUrl("conversations.list");
|
|
@@ -651,7 +654,7 @@ async function slackFormRequestJson(context, method, body) {
|
|
|
651
654
|
async function readSlackResponseJson(response) {
|
|
652
655
|
const payload = (optionalRecord(await response.json().catch(() => undefined)) ?? {});
|
|
653
656
|
if (!response.ok) {
|
|
654
|
-
throw slackHttpError(response
|
|
657
|
+
throw slackHttpError(response, payload);
|
|
655
658
|
}
|
|
656
659
|
assertSlackPayload(payload);
|
|
657
660
|
// Preserve HTTP/Slack failures (including Retry-After) above, but require
|
|
@@ -844,6 +847,15 @@ function normalizeConversation(conversation) {
|
|
|
844
847
|
purpose: typeof purpose?.value === "string" ? purpose.value : null,
|
|
845
848
|
userId: optionalString(conversation.user),
|
|
846
849
|
locale: optionalString(conversation.locale),
|
|
850
|
+
created: optionalInteger(conversation.created),
|
|
851
|
+
updated: optionalInteger(conversation.updated),
|
|
852
|
+
creatorId: optionalString(conversation.creator),
|
|
853
|
+
isShared: optionalBoolean(conversation.is_shared),
|
|
854
|
+
isExtShared: optionalBoolean(conversation.is_ext_shared),
|
|
855
|
+
isOrgShared: optionalBoolean(conversation.is_org_shared),
|
|
856
|
+
contextTeamId: optionalString(conversation.context_team_id),
|
|
857
|
+
lastRead: optionalString(conversation.last_read),
|
|
858
|
+
unreadCount: optionalInteger(conversation.unread_count),
|
|
847
859
|
});
|
|
848
860
|
}
|
|
849
861
|
/**
|
|
@@ -863,13 +875,27 @@ function applySlackHistoryWindow(url, input) {
|
|
|
863
875
|
url.searchParams.set("inclusive", String(input.inclusive));
|
|
864
876
|
}
|
|
865
877
|
}
|
|
878
|
+
/**
|
|
879
|
+
* Apply the shared `includeRaw` opt-in of `conversations.history` /
|
|
880
|
+
* `conversations.replies` and report whether it is on. Only a literal `true`
|
|
881
|
+
* opts in. Slack leaves message metadata out of both methods unless the
|
|
882
|
+
* request sets `include_all_metadata`, and `raw` promises the whole record, so
|
|
883
|
+
* opting in asks for it too.
|
|
884
|
+
*/
|
|
885
|
+
function applySlackIncludeRaw(url, input) {
|
|
886
|
+
const includeRaw = input.includeRaw === true;
|
|
887
|
+
if (includeRaw) {
|
|
888
|
+
url.searchParams.set("include_all_metadata", "true");
|
|
889
|
+
}
|
|
890
|
+
return includeRaw;
|
|
891
|
+
}
|
|
866
892
|
/**
|
|
867
893
|
* Read one `conversations.history` / `conversations.replies` page. A page whose
|
|
868
894
|
* list is missing or whose rows are not objects is rejected rather than
|
|
869
895
|
* flattened into an empty result, so a broken upstream response cannot pass
|
|
870
896
|
* for the documented end of a walk.
|
|
871
897
|
*/
|
|
872
|
-
function readSlackMessagePage(payload, method) {
|
|
898
|
+
function readSlackMessagePage(payload, method, includeRaw = false) {
|
|
873
899
|
if (payload.has_more !== undefined && typeof payload.has_more !== "boolean") {
|
|
874
900
|
throw slackResponseError(`${method} has_more`);
|
|
875
901
|
}
|
|
@@ -879,7 +905,7 @@ function readSlackMessagePage(payload, method) {
|
|
|
879
905
|
if (!record) {
|
|
880
906
|
throw slackResponseError(`${method} message`);
|
|
881
907
|
}
|
|
882
|
-
return normalizeSlackMessage(record);
|
|
908
|
+
return normalizeSlackMessage(record, includeRaw);
|
|
883
909
|
}),
|
|
884
910
|
hasMore: payload.has_more ?? false,
|
|
885
911
|
nextCursor: readSlackNextCursor(payload, method),
|
|
@@ -927,8 +953,13 @@ function requireSlackId(value, label) {
|
|
|
927
953
|
* missing value stays distinguishable from an empty one. `userId` is the one
|
|
928
954
|
* exception kept for compatibility: it stays `""` on a message with no
|
|
929
955
|
* author, where `botId` / `username` carry the identity instead.
|
|
956
|
+
*
|
|
957
|
+
* `files`, `attachments`, `blocks` and `metadata` stay out of the row: they
|
|
958
|
+
* are unbounded nested payloads on a row read in bulk. With `includeRaw` the
|
|
959
|
+
* whole untouched record rides along under `raw` for a consumer that needs
|
|
960
|
+
* them, or any other field this normalizer does not model.
|
|
930
961
|
*/
|
|
931
|
-
function normalizeSlackMessage(message) {
|
|
962
|
+
function normalizeSlackMessage(message, includeRaw = false) {
|
|
932
963
|
const edited = optionalRecord(message.edited) ?? {};
|
|
933
964
|
const reactions = Array.isArray(message.reactions) ? message.reactions : undefined;
|
|
934
965
|
return compactObject({
|
|
@@ -943,13 +974,16 @@ function normalizeSlackMessage(message) {
|
|
|
943
974
|
clientMsgId: optionalString(message.client_msg_id),
|
|
944
975
|
text: typeof message.text === "string" ? message.text : "",
|
|
945
976
|
editedTs: optionalString(edited.ts),
|
|
977
|
+
editedUserId: optionalString(edited.user),
|
|
946
978
|
threadTs: optionalString(message.thread_ts),
|
|
947
979
|
parentUserId: optionalString(message.parent_user_id),
|
|
948
980
|
replyCount: optionalInteger(message.reply_count),
|
|
949
981
|
replyUsersCount: optionalInteger(message.reply_users_count),
|
|
982
|
+
replyUserIds: optionalStringArray(message.reply_users),
|
|
950
983
|
latestReply: optionalString(message.latest_reply),
|
|
951
984
|
isLocked: optionalBoolean(message.is_locked),
|
|
952
985
|
reactions: reactions?.map((reaction) => normalizeSlackReaction(optionalRecord(reaction) ?? {})),
|
|
986
|
+
raw: includeRaw ? message : undefined,
|
|
953
987
|
});
|
|
954
988
|
}
|
|
955
989
|
function normalizeSlackReaction(reaction) {
|
|
@@ -959,7 +993,7 @@ function normalizeSlackReaction(reaction) {
|
|
|
959
993
|
userIds: Array.isArray(reaction.users) ? reaction.users.map((user) => String(user)) : undefined,
|
|
960
994
|
});
|
|
961
995
|
}
|
|
962
|
-
function normalizeSearchMessageMatch(match) {
|
|
996
|
+
function normalizeSearchMessageMatch(match, includeRaw = false) {
|
|
963
997
|
const channel = optionalRecord(match.channel) ?? {};
|
|
964
998
|
return compactObject({
|
|
965
999
|
matchId: optionalString(match.iid),
|
|
@@ -972,6 +1006,7 @@ function normalizeSearchMessageMatch(match) {
|
|
|
972
1006
|
permalink: optionalString(match.permalink),
|
|
973
1007
|
teamId: optionalString(match.team),
|
|
974
1008
|
type: optionalString(match.type),
|
|
1009
|
+
raw: includeRaw ? match : undefined,
|
|
975
1010
|
});
|
|
976
1011
|
}
|
|
977
1012
|
function normalizeUser(user) {
|
|
@@ -986,6 +1021,14 @@ function normalizeUser(user) {
|
|
|
986
1021
|
isAdmin: typeof user.is_admin === "boolean" ? user.is_admin : null,
|
|
987
1022
|
isOwner: typeof user.is_owner === "boolean" ? user.is_owner : null,
|
|
988
1023
|
locale: optionalString(user.locale),
|
|
1024
|
+
email: optionalString(profile.email),
|
|
1025
|
+
tz: optionalString(user.tz),
|
|
1026
|
+
tzOffset: optionalInteger(user.tz_offset),
|
|
1027
|
+
updated: optionalInteger(user.updated),
|
|
1028
|
+
teamId: optionalString(user.team_id),
|
|
1029
|
+
isRestricted: optionalBoolean(user.is_restricted),
|
|
1030
|
+
isUltraRestricted: optionalBoolean(user.is_ultra_restricted),
|
|
1031
|
+
isAppUser: optionalBoolean(user.is_app_user),
|
|
989
1032
|
});
|
|
990
1033
|
}
|
|
991
1034
|
function normalizeFile(file) {
|
|
@@ -1037,17 +1080,11 @@ function formatSlackPayloadError(payload) {
|
|
|
1037
1080
|
}
|
|
1038
1081
|
return `${error}: ${details.join("; ")}`;
|
|
1039
1082
|
}
|
|
1040
|
-
function slackHttpError(
|
|
1041
|
-
const message = payload.error ? formatSlackPayloadError(payload) : `slack request failed with ${status}`;
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
// The action envelope carries provider details; retain pacing so callers
|
|
1046
|
-
// can resume the same page without guessing when this workspace may retry.
|
|
1047
|
-
return new ProviderRequestError(status, message, { ...payload, retryAfterSeconds });
|
|
1048
|
-
}
|
|
1049
|
-
}
|
|
1050
|
-
return new ProviderRequestError(status, message, payload);
|
|
1083
|
+
function slackHttpError(response, payload) {
|
|
1084
|
+
const message = payload.error ? formatSlackPayloadError(payload) : `slack request failed with ${response.status}`;
|
|
1085
|
+
// The action envelope carries provider details; retain pacing so callers
|
|
1086
|
+
// can resume the same page without guessing when this workspace may retry.
|
|
1087
|
+
return new ProviderRequestError(response.status, message, withRetryAfterSeconds(response, payload));
|
|
1051
1088
|
}
|
|
1052
1089
|
function slackResponseError(message) {
|
|
1053
1090
|
return new ProviderRequestError(502, `slack response is invalid: ${message}`);
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { jsonSchema as s } from "../../core/json-schema.js";
|
|
2
|
+
const defaultPageSize = 15;
|
|
3
|
+
export const snapshot = {
|
|
4
|
+
configInputs: [
|
|
5
|
+
{
|
|
6
|
+
handle: "channelId",
|
|
7
|
+
jsonSchema: s.string({ pattern: "^[CDG][A-Z0-9]{2,31}$" }),
|
|
8
|
+
nullable: false,
|
|
9
|
+
description: "Slack conversation ID to watch, e.g. C0122KQ70S7E.",
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
handle: "fromUserIds",
|
|
13
|
+
jsonSchema: s.array(s.string({ pattern: "^[UW][A-Z0-9]{2,31}$" })),
|
|
14
|
+
nullable: false,
|
|
15
|
+
value: [],
|
|
16
|
+
description: "Only trigger on messages written by these Slack user IDs. Empty means any author.",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
handle: "ignoreUserIds",
|
|
20
|
+
jsonSchema: s.array(s.string({ pattern: "^[UW][A-Z0-9]{2,31}$" })),
|
|
21
|
+
nullable: false,
|
|
22
|
+
value: [],
|
|
23
|
+
description: "Never trigger on messages written by these Slack user IDs.",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
handle: "includeBotMessages",
|
|
27
|
+
jsonSchema: s.boolean(),
|
|
28
|
+
nullable: false,
|
|
29
|
+
value: false,
|
|
30
|
+
description: "Also trigger on messages posted by bots and apps.",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
handle: "includeSystemMessages",
|
|
34
|
+
jsonSchema: s.boolean(),
|
|
35
|
+
nullable: false,
|
|
36
|
+
value: false,
|
|
37
|
+
description: "Also trigger on Slack system notices.",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
handle: "maxMessagesPerPoll",
|
|
41
|
+
jsonSchema: s.integer({ maximum: 100, minimum: 1 }),
|
|
42
|
+
nullable: false,
|
|
43
|
+
value: defaultPageSize,
|
|
44
|
+
description: "Maximum number of messages processed per poll.",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
handle: "textContains",
|
|
48
|
+
jsonSchema: s.string(),
|
|
49
|
+
nullable: false,
|
|
50
|
+
value: "",
|
|
51
|
+
description: "Only trigger when message text contains this string, case-insensitively.",
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
definitionVersion: 2,
|
|
55
|
+
description: "Polls one Slack conversation and triggers when a new message is posted to it.",
|
|
56
|
+
displayName: "New Channel Message",
|
|
57
|
+
key: "slack.on_message_posted",
|
|
58
|
+
name: "on_message_posted",
|
|
59
|
+
outputs: [
|
|
60
|
+
{
|
|
61
|
+
handle: "events",
|
|
62
|
+
jsonSchema: s.array(s.object({
|
|
63
|
+
botId: { type: ["string", "null"] },
|
|
64
|
+
channelId: s.string(),
|
|
65
|
+
files: s.array(s.object({ id: s.string(), mimetype: s.string(), name: s.string() }, { additionalProperties: false, required: ["id", "name", "mimetype"] })),
|
|
66
|
+
messageTs: s.string(),
|
|
67
|
+
subtype: { type: ["string", "null"] },
|
|
68
|
+
text: s.string(),
|
|
69
|
+
threadTs: { type: ["string", "null"] },
|
|
70
|
+
userId: { type: ["string", "null"] },
|
|
71
|
+
}, {
|
|
72
|
+
additionalProperties: false,
|
|
73
|
+
required: ["channelId", "messageTs", "threadTs", "userId", "botId", "subtype", "text", "files"],
|
|
74
|
+
})),
|
|
75
|
+
nullable: false,
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
provider: "slack",
|
|
79
|
+
type: "poll",
|
|
80
|
+
};
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { HttpRequestError } from "../../server/api/http-utils.js";
|
|
2
|
+
import { eventsPollOutputs, PermanentPollError, PollConnectionError, TransientPollError, } from "../../triggers/common/poll.js";
|
|
3
|
+
import { snapshot } from "./trigger-on-message-posted.definition.js";
|
|
4
|
+
const seedBackoffMs = 60_000;
|
|
5
|
+
const plainSubtypes = new Set(["file_share", "thread_broadcast", "me_message", "bot_message"]);
|
|
6
|
+
const credentialErrors = new Set([
|
|
7
|
+
"invalid_auth",
|
|
8
|
+
"not_authed",
|
|
9
|
+
"token_revoked",
|
|
10
|
+
"token_expired",
|
|
11
|
+
"account_inactive",
|
|
12
|
+
"two_factor_setup_required",
|
|
13
|
+
]);
|
|
14
|
+
const permanentErrors = new Set([
|
|
15
|
+
"channel_not_found",
|
|
16
|
+
"not_in_channel",
|
|
17
|
+
"not_allowed_token_type",
|
|
18
|
+
"access_denied",
|
|
19
|
+
"channel_is_limited_access",
|
|
20
|
+
"ekm_access_denied",
|
|
21
|
+
"enterprise_is_restricted",
|
|
22
|
+
"no_permission",
|
|
23
|
+
"team_access_not_granted",
|
|
24
|
+
"invalid_ts_oldest",
|
|
25
|
+
"invalid_ts_latest",
|
|
26
|
+
"method_deprecated",
|
|
27
|
+
"deprecated_endpoint",
|
|
28
|
+
"accesslimited",
|
|
29
|
+
]);
|
|
30
|
+
export const slackMessagePosted = {
|
|
31
|
+
buildOutputs: eventsPollOutputs,
|
|
32
|
+
snapshot,
|
|
33
|
+
async poll(context) {
|
|
34
|
+
const config = resolveConfig(context.config);
|
|
35
|
+
if (context.checkpoint === null) {
|
|
36
|
+
return { checkpoint: { lastTs: await seed(context, config.channelId) }, events: [] };
|
|
37
|
+
}
|
|
38
|
+
const checkpoint = readCheckpoint(context.checkpoint);
|
|
39
|
+
const history = await fetchHistory(context, config, checkpoint);
|
|
40
|
+
const messages = timedMessages(history);
|
|
41
|
+
const events = [];
|
|
42
|
+
let filtered = 0;
|
|
43
|
+
for (const entry of messages.toReversed()) {
|
|
44
|
+
if (!matches(entry.message, config)) {
|
|
45
|
+
filtered += 1;
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
events.push(event(entry, config.channelId));
|
|
49
|
+
}
|
|
50
|
+
return { checkpoint: nextCheckpoint(checkpoint, history, messages), events, filtered };
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
function resolveConfig(value) {
|
|
54
|
+
return {
|
|
55
|
+
channelId: value.channelId,
|
|
56
|
+
fromUserIds: value.fromUserIds,
|
|
57
|
+
ignoreUserIds: value.ignoreUserIds,
|
|
58
|
+
includeBotMessages: value.includeBotMessages,
|
|
59
|
+
includeSystemMessages: value.includeSystemMessages,
|
|
60
|
+
maxMessagesPerPoll: value.maxMessagesPerPoll,
|
|
61
|
+
textContains: value.textContains,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
async function seed(context, channelId) {
|
|
65
|
+
const result = await slackGet(context, { channel: channelId, limit: 1 });
|
|
66
|
+
success(result, "baseline history fetch");
|
|
67
|
+
const ts = result.data.messages?.[0]?.ts;
|
|
68
|
+
return ts != null && validTs(ts) ? ts : `${Math.floor((context.now.getTime() - seedBackoffMs) / 1000)}.000000`;
|
|
69
|
+
}
|
|
70
|
+
function readCheckpoint(value) {
|
|
71
|
+
const checkpoint = value;
|
|
72
|
+
if (typeof checkpoint.lastTs != "string" || checkpoint.lastTs.length == 0) {
|
|
73
|
+
throw new PermanentPollError("Slack checkpoint lastTs is missing.");
|
|
74
|
+
}
|
|
75
|
+
const drainLatest = checkpoint.drainLatest;
|
|
76
|
+
const pendingHighTs = checkpoint.pendingHighTs;
|
|
77
|
+
if (drainLatest == null && pendingHighTs == null)
|
|
78
|
+
return { lastTs: checkpoint.lastTs };
|
|
79
|
+
if (typeof drainLatest != "string" ||
|
|
80
|
+
drainLatest.length == 0 ||
|
|
81
|
+
typeof pendingHighTs != "string" ||
|
|
82
|
+
pendingHighTs.length == 0) {
|
|
83
|
+
throw new PermanentPollError("Slack checkpoint drain fields are incomplete.");
|
|
84
|
+
}
|
|
85
|
+
return { drainLatest, lastTs: checkpoint.lastTs, pendingHighTs };
|
|
86
|
+
}
|
|
87
|
+
async function fetchHistory(context, config, checkpoint) {
|
|
88
|
+
const result = await slackGet(context, {
|
|
89
|
+
channel: config.channelId,
|
|
90
|
+
inclusive: "false",
|
|
91
|
+
latest: checkpoint.drainLatest,
|
|
92
|
+
limit: config.maxMessagesPerPoll,
|
|
93
|
+
oldest: checkpoint.lastTs,
|
|
94
|
+
});
|
|
95
|
+
success(result, "history list");
|
|
96
|
+
return result.data;
|
|
97
|
+
}
|
|
98
|
+
async function slackGet(context, query) {
|
|
99
|
+
try {
|
|
100
|
+
return await context.connector.execute({
|
|
101
|
+
endpoint: "/conversations.history",
|
|
102
|
+
method: "GET",
|
|
103
|
+
query: Object.fromEntries(Object.entries(query).filter((entry) => entry[1] != null)),
|
|
104
|
+
}, context.signal);
|
|
105
|
+
}
|
|
106
|
+
catch (cause) {
|
|
107
|
+
throw new TransientPollError("Slack proxy request failed.", { cause });
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function success(result, operation) {
|
|
111
|
+
const body = result.data != null && typeof result.data === "object" && !Array.isArray(result.data)
|
|
112
|
+
? result.data
|
|
113
|
+
: {};
|
|
114
|
+
if (result.status >= 200 && result.status < 300 && body.ok === true)
|
|
115
|
+
return;
|
|
116
|
+
const code = typeof body.error == "string" ? body.error : "";
|
|
117
|
+
if (code === "missing_scope")
|
|
118
|
+
throw new HttpRequestError("scope_missing", "Slack history permission is missing for the selected conversation", 403);
|
|
119
|
+
if (credentialErrors.has(code))
|
|
120
|
+
throw new PollConnectionError(`Slack ${operation} rejected with ${code}.`);
|
|
121
|
+
if (permanentErrors.has(code))
|
|
122
|
+
throw new PermanentPollError(`Slack ${operation} rejected with ${code}.`);
|
|
123
|
+
throw new TransientPollError(`Slack ${operation} failed with ${code || `status ${result.status}`}.`);
|
|
124
|
+
}
|
|
125
|
+
function timedMessages(history) {
|
|
126
|
+
return (history.messages ?? []).flatMap((message) => message.ts != null && validTs(message.ts) ? [{ message, ts: message.ts }] : []);
|
|
127
|
+
}
|
|
128
|
+
function nextCheckpoint(checkpoint, history, messages) {
|
|
129
|
+
const newestTs = messages[0]?.ts;
|
|
130
|
+
const oldestTs = messages.at(-1)?.ts;
|
|
131
|
+
if (history.has_more === true) {
|
|
132
|
+
if (newestTs == null || oldestTs == null)
|
|
133
|
+
throw new TransientPollError("Slack history reports has_more without a usable timestamp.");
|
|
134
|
+
return {
|
|
135
|
+
drainLatest: oldestTs,
|
|
136
|
+
lastTs: checkpoint.lastTs,
|
|
137
|
+
pendingHighTs: checkpoint.pendingHighTs ?? newestTs,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
if (checkpoint.pendingHighTs != null)
|
|
141
|
+
return { lastTs: checkpoint.pendingHighTs };
|
|
142
|
+
return { lastTs: newestTs ?? checkpoint.lastTs };
|
|
143
|
+
}
|
|
144
|
+
function matches(message, config) {
|
|
145
|
+
if (!config.includeBotMessages && (message.bot_id != null || message.subtype == "bot_message"))
|
|
146
|
+
return false;
|
|
147
|
+
if (!config.includeSystemMessages && message.subtype != null && !plainSubtypes.has(message.subtype))
|
|
148
|
+
return false;
|
|
149
|
+
if (config.fromUserIds.length > 0 && (message.user == null || !config.fromUserIds.includes(message.user)))
|
|
150
|
+
return false;
|
|
151
|
+
if (message.user != null && config.ignoreUserIds.includes(message.user))
|
|
152
|
+
return false;
|
|
153
|
+
return (config.textContains.length == 0 || (message.text ?? "").toLowerCase().includes(config.textContains.toLowerCase()));
|
|
154
|
+
}
|
|
155
|
+
function event(entry, channelId) {
|
|
156
|
+
return {
|
|
157
|
+
dedupeKey: `${channelId}:${entry.ts}`,
|
|
158
|
+
payload: {
|
|
159
|
+
botId: entry.message.bot_id ?? null,
|
|
160
|
+
channelId,
|
|
161
|
+
files: (entry.message.files ?? []).map((file) => ({
|
|
162
|
+
id: file.id ?? "",
|
|
163
|
+
mimetype: file.mimetype ?? "",
|
|
164
|
+
name: file.name ?? "",
|
|
165
|
+
})),
|
|
166
|
+
messageTs: entry.ts,
|
|
167
|
+
subtype: entry.message.subtype ?? null,
|
|
168
|
+
text: entry.message.text ?? "",
|
|
169
|
+
threadTs: entry.message.thread_ts ?? null,
|
|
170
|
+
userId: entry.message.user ?? null,
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
function validTs(value) {
|
|
175
|
+
return /^\d+(?:\.\d+)?$/.test(value) && !Number.isNaN(new Date(Math.round(Number(value) * 1000)).getTime());
|
|
176
|
+
}
|
|
@@ -45,7 +45,7 @@ export const proxy = defineProviderProxy({
|
|
|
45
45
|
baseUrl: sorftimeMcpEndpoint,
|
|
46
46
|
auth: { type: "api_key_authorization", prefix: "Bearer " },
|
|
47
47
|
skipDnsValidation: true,
|
|
48
|
-
redirect: "
|
|
48
|
+
redirect: "manual",
|
|
49
49
|
timeoutMs: requestTimeoutMs,
|
|
50
50
|
allowedEndpoint(endpoint) {
|
|
51
51
|
const url = new URL(endpoint, sorftimeMcpEndpoint);
|
|
@@ -79,7 +79,7 @@ function withSorftimeClient(context, run) {
|
|
|
79
79
|
authorization: `Bearer ${context.apiKey}`,
|
|
80
80
|
"user-agent": providerUserAgent,
|
|
81
81
|
},
|
|
82
|
-
redirect: "
|
|
82
|
+
redirect: "manual",
|
|
83
83
|
signal: context.signal,
|
|
84
84
|
mapError: mapSorftimeError,
|
|
85
85
|
}, run);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { compactObject, optionalBoolean, optionalInteger, optionalString } from "../../core/cast.js";
|
|
2
|
-
import { providerUserAgent, ProviderRequestError } from "../provider-runtime.js";
|
|
2
|
+
import { providerInputError, providerUserAgent, ProviderRequestError } from "../provider-runtime.js";
|
|
3
3
|
export const spotifyApiBaseUrl = "https://api.spotify.com/v1/";
|
|
4
4
|
export const spotifyActionHandlers = {
|
|
5
5
|
get_current_user_profile(_input, deps) {
|
|
@@ -131,9 +131,7 @@ export const spotifyActionHandlers = {
|
|
|
131
131
|
query: {
|
|
132
132
|
market: optionalString(input.market),
|
|
133
133
|
limit: stringifyOptionalInteger(input.limit),
|
|
134
|
-
|
|
135
|
-
seed_tracks: joinStringArray(input.seedTracks),
|
|
136
|
-
seed_genres: joinStringArray(input.seedGenres),
|
|
134
|
+
...buildRecommendationSeedQuery(input),
|
|
137
135
|
},
|
|
138
136
|
});
|
|
139
137
|
},
|
|
@@ -761,6 +759,19 @@ function buildPagingQuery(input, extraQuery) {
|
|
|
761
759
|
...(extraQuery ?? {}),
|
|
762
760
|
};
|
|
763
761
|
}
|
|
762
|
+
// Spotify takes 1 to 5 seed values in any combination of seed_artists, seed_tracks, and seed_genres.
|
|
763
|
+
function buildRecommendationSeedQuery(input) {
|
|
764
|
+
const query = {
|
|
765
|
+
seed_artists: joinStringArray(input.seedArtists),
|
|
766
|
+
seed_tracks: joinStringArray(input.seedTracks),
|
|
767
|
+
seed_genres: joinStringArray(input.seedGenres),
|
|
768
|
+
};
|
|
769
|
+
const seedCount = [input.seedArtists, input.seedTracks, input.seedGenres].reduce((count, seeds) => count + (Array.isArray(seeds) ? seeds.length : 0), 0);
|
|
770
|
+
if (seedCount < 1 || seedCount > 5) {
|
|
771
|
+
throw providerInputError(`get_recommendations needs 1 to 5 seeds across seedArtists, seedTracks, and seedGenres; received ${seedCount}`);
|
|
772
|
+
}
|
|
773
|
+
return query;
|
|
774
|
+
}
|
|
764
775
|
function buildPlaybackQuery(input) {
|
|
765
776
|
return {
|
|
766
777
|
market: optionalString(input.market),
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { CredentialValidators, ProviderExecutors, ProviderProxyExecutor } from "../../core/types.ts";
|
|
2
|
+
import type { IntegrationDefinition } from "../../triggers/common/integration.ts";
|
|
3
|
+
import type { PollDefinition } from "../../triggers/common/poll.ts";
|
|
2
4
|
import type { ProviderActionHandlers } from "../provider-runtime.ts";
|
|
3
5
|
import type { ApiKeyProviderContext } from "../provider-runtime.ts";
|
|
4
6
|
type StripeActionContext = ApiKeyProviderContext;
|
|
@@ -7,4 +9,5 @@ export declare const stripeActionHandlers: ProviderActionHandlers<"stripe", Stri
|
|
|
7
9
|
export declare const executors: ProviderExecutors;
|
|
8
10
|
export declare const proxy: ProviderProxyExecutor;
|
|
9
11
|
export declare const credentialValidators: CredentialValidators;
|
|
12
|
+
export declare const triggers: readonly (IntegrationDefinition | PollDefinition)[];
|
|
10
13
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { compactObject, optionalRecord, optionalString } from "../../core/cast.js";
|
|
2
2
|
import { ProviderRequestError, defineApiKeyProviderExecutors, defineProviderProxy, providerUserAgent, requiredResponseRecord, } from "../provider-runtime.js";
|
|
3
|
+
import { stripeEvent } from "./trigger-on-event.js";
|
|
3
4
|
const service = "stripe";
|
|
4
5
|
const stripeApiBaseUrl = "https://api.stripe.com";
|
|
5
6
|
const stripeApiVersion = "2024-06-20";
|
|
@@ -289,3 +290,4 @@ function mapStripeError(status, message) {
|
|
|
289
290
|
}
|
|
290
291
|
return new ProviderRequestError(502, message, status);
|
|
291
292
|
}
|
|
293
|
+
export const triggers = [stripeEvent];
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsonSchema as s } from "../../core/json-schema.js";
|
|
2
|
+
export const snapshot = {
|
|
3
|
+
configInputs: [
|
|
4
|
+
{
|
|
5
|
+
handle: "apiVersion",
|
|
6
|
+
jsonSchema: s.string({ maxLength: 40 }),
|
|
7
|
+
nullable: false,
|
|
8
|
+
value: "",
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
handle: "events",
|
|
12
|
+
jsonSchema: s.array(s.string({ maxLength: 120, pattern: "^(\\*|[a-z0-9_]+(?:\\.[a-z0-9_]+)+)$" }), {
|
|
13
|
+
minItems: 1,
|
|
14
|
+
uniqueItems: true,
|
|
15
|
+
}),
|
|
16
|
+
nullable: false,
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
handle: "includeConnectedAccounts",
|
|
20
|
+
jsonSchema: s.boolean(),
|
|
21
|
+
nullable: false,
|
|
22
|
+
value: false,
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
definitionVersion: 2,
|
|
26
|
+
description: "Triggers when selected Stripe events happen on the connected account.",
|
|
27
|
+
displayName: "Account Event",
|
|
28
|
+
endpoint: {
|
|
29
|
+
body: { allowArray: false, allowEmpty: false, formats: ["json"] },
|
|
30
|
+
methods: ["POST"],
|
|
31
|
+
successStatus: 202,
|
|
32
|
+
},
|
|
33
|
+
key: "stripe.on_event",
|
|
34
|
+
name: "on_event",
|
|
35
|
+
outputs: [
|
|
36
|
+
{ handle: "body", jsonSchema: { type: "object" }, nullable: false },
|
|
37
|
+
{ handle: "event", jsonSchema: s.string(), nullable: false },
|
|
38
|
+
{ handle: "eventId", jsonSchema: s.string(), nullable: false },
|
|
39
|
+
{ handle: "livemode", jsonSchema: s.boolean(), nullable: false },
|
|
40
|
+
],
|
|
41
|
+
provider: "stripe",
|
|
42
|
+
type: "integration",
|
|
43
|
+
};
|