@oomol-lab/open-connector 1.9.2 → 1.9.3
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 -2
- package/assets/open-connector/catalog/apps/allratestoday.json +174 -0
- package/assets/open-connector/catalog/apps/slackbot.json +20 -1
- package/assets/open-connector/catalog/apps-index.json +1 -1
- package/package.json +1 -1
- package/src/connection-error.d.ts +7 -0
- package/src/connection-error.js +10 -0
- package/src/connection-service.d.ts +2 -50
- package/src/connection-service.js +6 -130
- package/src/connection-store.d.ts +41 -0
- package/src/connection-store.js +1 -0
- package/src/core/guarded-fetch.d.ts +3 -0
- package/src/core/guarded-fetch.js +8 -1
- package/src/core/provider-network-policy.d.ts +15 -0
- package/src/core/provider-network-policy.js +11 -0
- package/src/core/request.d.ts +18 -14
- package/src/core/request.js +11 -35
- package/src/credential-resolver.d.ts +24 -0
- package/src/credential-resolver.js +131 -0
- package/src/mcp.js +1 -1
- package/src/oauth/oauth-client-config-service.d.ts +1 -1
- package/src/oauth/oauth-client-config-service.js +14 -2
- package/src/oauth/oauth-credential-refresh-service.js +1 -1
- package/src/oauth/oauth-flow-service.d.ts +9 -1
- package/src/oauth/oauth-flow-service.js +11 -1
- package/src/providers/abuseipdb/executors.js +3 -4
- package/src/providers/action-contracts.generated.d.ts +1 -0
- package/src/providers/addressfinder/executors.js +2 -3
- package/src/providers/aeroleads/executors.js +3 -3
- package/src/providers/affinity/runtime.js +6 -7
- package/src/providers/aftership/executors.js +2 -2
- package/src/providers/agent_mail/runtime.js +2 -2
- package/src/providers/agentql/runtime.js +2 -2
- package/src/providers/agenty/runtime.js +5 -6
- package/src/providers/agiled/runtime.d.ts +0 -1
- package/src/providers/agiled/runtime.js +2 -3
- package/src/providers/agility/runtime.js +2 -3
- package/src/providers/ahrefs/runtime.js +3 -3
- package/src/providers/aifinmarket/runtime.js +6 -7
- package/src/providers/airtable/executors.js +3 -3
- package/src/providers/alchemy/runtime.js +2 -2
- package/src/providers/algolia/runtime.js +3 -3
- package/src/providers/aliyun_oss/executors.js +7 -7
- package/src/providers/allratestoday/executors.d.ts +3 -0
- package/src/providers/allratestoday/executors.js +18 -0
- package/src/providers/allratestoday/runtime.d.ts +17 -0
- package/src/providers/allratestoday/runtime.js +104 -0
- package/src/providers/alpaca/runtime.js +2 -3
- package/src/providers/alpha_vantage/runtime.js +2 -2
- package/src/providers/alt_text_ai/runtime.js +2 -2
- package/src/providers/altiria/executors.js +3 -3
- package/src/providers/amap/runtime.js +3 -3
- package/src/providers/ambee/runtime.js +2 -2
- package/src/providers/ambivo/executors.js +3 -3
- package/src/providers/amilia/runtime.js +1 -1
- package/src/providers/amplemarket/runtime.js +2 -2
- package/src/providers/amplitude/runtime.js +3 -3
- package/src/providers/anysearch/runtime.js +4 -4
- package/src/providers/apaleo/runtime.js +2 -2
- package/src/providers/api_sports/executors.js +3 -4
- package/src/providers/apiverve/executors.js +2 -3
- package/src/providers/apollo/executors.js +2 -3
- package/src/providers/appcircle/runtime.js +5 -5
- package/src/providers/appdrag/executors.js +2 -3
- package/src/providers/arcgis_online/executors.js +2 -2
- package/src/providers/auth0_management/runtime.js +2 -3
- package/src/providers/autoblogger/executors.js +3 -3
- package/src/providers/baidu_maps/runtime.js +3 -3
- package/src/providers/baidu_netdisk/runtime-mcp.js +3 -4
- package/src/providers/bark/executors.js +5 -5
- package/src/providers/bitrise/runtime.js +3 -3
- package/src/providers/bouncer/executors.js +3 -4
- package/src/providers/browse_ai/runtime.js +3 -4
- package/src/providers/browserstack/executors.js +6 -7
- package/src/providers/buildkite/runtime.js +3 -3
- package/src/providers/bunnycdn/runtime.js +3 -3
- package/src/providers/businessmap/runtime.js +6 -7
- package/src/providers/buttondown/runtime.js +2 -2
- package/src/providers/byteforms/runtime.js +2 -2
- package/src/providers/calendly/runtime.js +2 -2
- package/src/providers/captainbi/runtime.js +6 -6
- package/src/providers/castingwords/runtime.js +1 -1
- package/src/providers/chatpdf/runtime.js +4 -4
- package/src/providers/check/executors.js +3 -4
- package/src/providers/checkly/executors.js +3 -4
- package/src/providers/chengxin/runtime.js +3 -3
- package/src/providers/cincopa/executors.js +3 -4
- package/src/providers/circle/executors.js +3 -4
- package/src/providers/clearout/executors.js +1 -2
- package/src/providers/clickhelp/runtime.js +5 -5
- package/src/providers/clickhouse/runtime.js +4 -4
- package/src/providers/clinicalkey/runtime.js +3 -3
- package/src/providers/clinicaltrials_gov/runtime.js +4 -5
- package/src/providers/clockify/runtime.js +4 -4
- package/src/providers/close/runtime.js +3 -3
- package/src/providers/cloudconvert/runtime.js +8 -9
- package/src/providers/cloudflare_dns/runtime.js +2 -2
- package/src/providers/cloudflare_email_routing/runtime.js +2 -2
- package/src/providers/cloudflare_r2/runtime.js +5 -5
- package/src/providers/cloudflare_worker/runtime.js +10 -10
- package/src/providers/cloudinary/runtime.js +4 -4
- package/src/providers/cloudlayer/runtime.js +5 -5
- package/src/providers/codacy/runtime.js +2 -2
- package/src/providers/codemagic/runtime.js +2 -2
- package/src/providers/confluence/executors.js +4 -4
- package/src/providers/confluence/runtime.d.ts +0 -1
- package/src/providers/confluence/runtime.js +6 -7
- package/src/providers/contactout/runtime.js +5 -5
- package/src/providers/contentful/runtime.js +2 -2
- package/src/providers/contentstack_content_delivery/runtime.js +1 -1
- package/src/providers/cronly/runtime.js +2 -2
- package/src/providers/crossref/runtime.js +3 -3
- package/src/providers/cutt_ly/runtime.js +3 -3
- package/src/providers/cyberimpact/runtime.js +3 -3
- package/src/providers/dachser/executors.js +2 -2
- package/src/providers/dailybot/runtime.js +1 -1
- package/src/providers/databox/runtime.js +2 -2
- package/src/providers/databricks/runtime.js +2 -2
- package/src/providers/datacite/runtime.js +1 -1
- package/src/providers/datadog/executors.js +3 -4
- package/src/providers/datascope/runtime.js +2 -2
- package/src/providers/daytona/executors.js +3 -3
- package/src/providers/deepgram/runtime.js +2 -2
- package/src/providers/deepl/runtime.js +4 -4
- package/src/providers/detrack/executors.js +5 -5
- package/src/providers/deutschlandgpt/runtime.js +2 -2
- package/src/providers/dialmycalls/runtime.js +4 -4
- package/src/providers/diffbot/executors.js +4 -4
- package/src/providers/digistore24/executors.js +3 -3
- package/src/providers/dingtalk_bot/executors.js +1 -1
- package/src/providers/discourse/executors.d.ts +0 -1
- package/src/providers/discourse/executors.js +6 -7
- package/src/providers/docugenerate/runtime.js +3 -3
- package/src/providers/doppler/runtime.shared.js +3 -3
- package/src/providers/doppler_marketing_automation/runtime.js +4 -4
- package/src/providers/dovetail/runtime.js +2 -2
- package/src/providers/dropcontact/runtime.js +3 -3
- package/src/providers/dub/executors.js +6 -6
- package/src/providers/dumplingai/runtime.js +2 -2
- package/src/providers/elevenlabs/executors.js +4 -4
- package/src/providers/elevenreader/runtime.js +1 -1
- package/src/providers/emailoctopus/runtime.js +4 -4
- package/src/providers/embase/runtime.js +3 -3
- package/src/providers/emelia/executors.js +2 -2
- package/src/providers/enigma/executors.js +3 -3
- package/src/providers/eodhd_apis/executors.js +2 -2
- package/src/providers/eventzilla/runtime.js +3 -4
- package/src/providers/evervault/runtime.js +1 -1
- package/src/providers/excalidraw_mcp/runtime.js +3 -4
- package/src/providers/excel/runtime.js +6 -6
- package/src/providers/expofp/runtime.js +2 -2
- package/src/providers/faktoora/runtime.js +5 -5
- package/src/providers/fast_note_sync/runtime.js +2 -2
- package/src/providers/feathery/executors.js +2 -3
- package/src/providers/feishu_app_bot/executors.js +2 -3
- package/src/providers/feishu_custom_bot/executors.js +2 -3
- package/src/providers/ffhub/executors.js +2 -3
- package/src/providers/fidel_api/executors.js +2 -3
- package/src/providers/files_com/executors.js +2 -3
- package/src/providers/fireberry/runtime.d.ts +0 -1
- package/src/providers/fireberry/runtime.js +3 -4
- package/src/providers/firehydrant/executors.js +2 -3
- package/src/providers/float/executors.js +2 -3
- package/src/providers/flomo/executors.js +5 -6
- package/src/providers/flowiseai/executors.js +2 -3
- package/src/providers/fluxguard/executors.js +2 -3
- package/src/providers/folk/executors.js +2 -3
- package/src/providers/football_data/executors.js +2 -3
- package/src/providers/forem/executors.js +2 -3
- package/src/providers/formbricks/executors.js +2 -3
- package/src/providers/formsite/executors.js +3 -4
- package/src/providers/formspree/executors.js +2 -2
- package/src/providers/freshdesk/executors.js +3 -4
- package/src/providers/freshservice/executors.js +3 -4
- package/src/providers/freshteam/runtime.js +3 -4
- package/src/providers/full_contact/executors.js +3 -3
- package/src/providers/fusion-api/runtime.js +2 -3
- package/src/providers/gagelist/executors.js +3 -3
- package/src/providers/gainsight_nxt/executors.js +2 -2
- package/src/providers/gamma/executors.js +4 -3
- package/src/providers/gangtise/runtime.js +3 -4
- package/src/providers/gatherup/runtime.js +1 -1
- package/src/providers/geckoboard/executors.js +2 -3
- package/src/providers/gemini/runtime.d.ts +0 -1
- package/src/providers/gemini/runtime.js +5 -6
- package/src/providers/genpage/runtime.js +2 -2
- package/src/providers/geokeo/executors.js +4 -4
- package/src/providers/getnote/runtime.js +2 -3
- package/src/providers/github/runtime-shared.js +2 -2
- package/src/providers/glyphic/runtime.js +3 -4
- package/src/providers/gmail/executors.js +125 -27
- package/src/providers/gong/runtime.js +6 -7
- package/src/providers/googlecalendar/runtime-shared.js +3 -4
- package/src/providers/googledrive/runtime-request.js +2 -3
- package/src/providers/googlesheets/runtime-shared.js +3 -4
- package/src/providers/gorgias/runtime.js +4 -4
- package/src/providers/gotify/executors.js +7 -8
- package/src/providers/greenhouse/executors.js +3 -3
- package/src/providers/gumloop/executors.js +2 -3
- package/src/providers/gumroad/executors.js +2 -3
- package/src/providers/habitica/executors.js +2 -3
- package/src/providers/hackerrank_work/executors.js +2 -3
- package/src/providers/harvest/executors.js +3 -4
- package/src/providers/haveibeenpwned/executors.js +2 -3
- package/src/providers/headout/executors.js +3 -4
- package/src/providers/healthchecks_io/executors.js +2 -3
- package/src/providers/helium10/runtime.js +4 -5
- package/src/providers/helpdesk/runtime.js +4 -4
- package/src/providers/home_assistant/runtime-ws.js +9 -10
- package/src/providers/hotjar/executors.js +4 -4
- package/src/providers/httpsms/runtime.js +3 -4
- package/src/providers/hub_planner/executors.js +3 -3
- package/src/providers/hubspot/runtime.js +3 -4
- package/src/providers/humaans/runtime.js +3 -3
- package/src/providers/hunter/runtime.js +3 -3
- package/src/providers/icypeas/executors.js +3 -4
- package/src/providers/ima/runtime.js +7 -7
- package/src/providers/infolobby/runtime.js +6 -6
- package/src/providers/instabot/runtime.js +6 -6
- package/src/providers/instatus/runtime.js +4 -4
- package/src/providers/intuiface/executors.js +3 -3
- package/src/providers/iplocate/runtime.js +4 -5
- package/src/providers/ipregistry/executors.js +2 -2
- package/src/providers/jiminny/runtime.js +4 -4
- package/src/providers/jin10/executors.js +4 -5
- package/src/providers/jira/executors.js +4 -4
- package/src/providers/kaleido/runtime.js +2 -2
- package/src/providers/kandji/runtime.js +2 -2
- package/src/providers/keygen/executors.js +4 -4
- package/src/providers/keyword/runtime.js +2 -2
- package/src/providers/kie_ai/executors.js +1 -1
- package/src/providers/kintone/runtime.js +1 -1
- package/src/providers/kit/runtime.js +2 -2
- package/src/providers/klangio/runtime.js +4 -4
- package/src/providers/klaviyo/executors.js +1 -1
- package/src/providers/klazify/executors.js +3 -3
- package/src/providers/klipfolio/runtime.js +3 -3
- package/src/providers/knack/executors.js +1 -1
- package/src/providers/kommo/runtime.js +2 -2
- package/src/providers/kontent_ai/executors.js +3 -4
- package/src/providers/l2s/executors.js +3 -4
- package/src/providers/latchshot/executors.js +2 -2
- package/src/providers/leadboxer/runtime.js +4 -4
- package/src/providers/leadiq/runtime.js +4 -4
- package/src/providers/linguapop/runtime.js +1 -1
- package/src/providers/lingvanex_translation_api/runtime.js +5 -6
- package/src/providers/lingxing_mcp/runtime.js +3 -4
- package/src/providers/linkup/runtime.js +5 -6
- package/src/providers/liveagent/executors.js +6 -6
- package/src/providers/loops/executors.js +2 -2
- package/src/providers/loyjoy/runtime.js +2 -2
- package/src/providers/loyverse/executors.js +4 -4
- package/src/providers/lusha/runtime.js +3 -3
- package/src/providers/mailbluster/runtime.js +3 -4
- package/src/providers/mailcoach/runtime.js +4 -4
- package/src/providers/mailgenius/executors.js +3 -4
- package/src/providers/mailjet/runtime.js +3 -3
- package/src/providers/mails_so/runtime.js +1 -1
- package/src/providers/mailsoftly/runtime.js +5 -5
- package/src/providers/mailtrap/runtime.js +4 -5
- package/src/providers/manus/runtime.js +3 -3
- package/src/providers/mautic/runtime.js +3 -3
- package/src/providers/megaventory/runtime.js +3 -3
- package/src/providers/memberstack/runtime.js +2 -2
- package/src/providers/mendeley/executors.js +2 -3
- package/src/providers/mindbody/runtime.js +3 -3
- package/src/providers/minerstat/executors.js +3 -3
- package/src/providers/mintlify/runtime.js +3 -3
- package/src/providers/missive/executors.js +3 -5
- package/src/providers/mixpanel/executors.js +3 -3
- package/src/providers/mobile_text_alerts/runtime.js +3 -3
- package/src/providers/mocean/executors.js +3 -3
- package/src/providers/moco/executors.js +5 -5
- package/src/providers/moesif/runtime.js +4 -4
- package/src/providers/monday/runtime-common.js +3 -3
- package/src/providers/monica_crm/runtime.js +4 -4
- package/src/providers/moorcheh/runtime.js +3 -3
- package/src/providers/more_trees/runtime.d.ts +0 -1
- package/src/providers/more_trees/runtime.js +7 -8
- package/src/providers/moxie/runtime.js +2 -2
- package/src/providers/msg91/runtime.js +4 -4
- package/src/providers/mx/runtime.js +1 -1
- package/src/providers/needle/runtime.js +3 -4
- package/src/providers/netlify/runtime.js +2 -3
- package/src/providers/niftyimages/executors.js +2 -2
- package/src/providers/northbeam/runtime.js +1 -1
- package/src/providers/nozbe_teams/executors.js +4 -4
- package/src/providers/npm/runtime.js +4 -4
- package/src/providers/nusii_proposals/runtime.js +2 -2
- package/src/providers/ocr_web_service/executors.js +4 -4
- package/src/providers/octopus_deploy/executors.js +3 -3
- package/src/providers/oksign/runtime.js +3 -4
- package/src/providers/one_drive/executors.js +6 -6
- package/src/providers/one_password_events/runtime.js +1 -1
- package/src/providers/onfleet/runtime.js +3 -3
- package/src/providers/onlyoffice_docspace/runtime.js +4 -4
- package/src/providers/oomnitza/runtime.js +3 -4
- package/src/providers/otter_ai/executors.js +2 -2
- package/src/providers/oura/runtime.js +1 -1
- package/src/providers/paddle/executors.js +3 -3
- package/src/providers/pagerduty/runtime.js +2 -2
- package/src/providers/paradym/runtime.js +4 -4
- package/src/providers/parallel/runtime.js +3 -3
- package/src/providers/partner_stack_partner/runtime.js +1 -1
- package/src/providers/payrexx/runtime.js +5 -6
- package/src/providers/permit_io/runtime.js +2 -2
- package/src/providers/pinboard/executors.js +5 -6
- package/src/providers/pinpoint/runtime.js +2 -2
- package/src/providers/placid/runtime.js +3 -3
- package/src/providers/plain/runtime.js +5 -5
- package/src/providers/planetscale/runtime.js +2 -2
- package/src/providers/planhat/executors.js +6 -6
- package/src/providers/plausible_analytics/runtime.js +3 -3
- package/src/providers/posthog/runtime.js +3 -3
- package/src/providers/predis_ai/executors.js +3 -3
- package/src/providers/printavo/runtime.js +2 -2
- package/src/providers/prospeo/runtime.js +2 -3
- package/src/providers/provider-runtime.d.ts +13 -1
- package/src/providers/provider-runtime.js +25 -10
- package/src/providers/push_by_techulus/executors.js +3 -4
- package/src/providers/pushover/runtime.js +4 -5
- package/src/providers/pushsafer/runtime.js +4 -5
- package/src/providers/pylon/runtime.js +2 -2
- package/src/providers/qase/runtime.js +3 -3
- package/src/providers/qdrant/runtime.js +1 -1
- package/src/providers/qichacha/runtime.js +2 -2
- package/src/providers/qingflow/runtime.js +2 -2
- package/src/providers/quickchart/runtime.js +2 -2
- package/src/providers/quintadb/runtime.js +2 -2
- package/src/providers/quo/runtime.js +2 -2
- package/src/providers/rawg/runtime.js +4 -4
- package/src/providers/razorpay/runtime.js +4 -5
- package/src/providers/readme/runtime.js +6 -6
- package/src/providers/referralhero/runtime.js +3 -3
- package/src/providers/registry.generated.js +1 -0
- package/src/providers/render/executors.js +3 -3
- package/src/providers/respond_io/executors.js +3 -3
- package/src/providers/reversecontact/runtime.js +3 -3
- package/src/providers/ritekit/executors.js +2 -2
- package/src/providers/riveter/executors.js +2 -3
- package/src/providers/rocket_chat/executors.js +3 -4
- package/src/providers/rocket_reach/executors.js +3 -4
- package/src/providers/saucelabs/runtime.js +4 -4
- package/src/providers/scopus/runtime.js +3 -3
- package/src/providers/scrape_do/executors.js +2 -2
- package/src/providers/scraperapi/runtime.js +4 -4
- package/src/providers/scrapfly/executors.js +2 -2
- package/src/providers/scrapingant/executors.js +6 -7
- package/src/providers/scrapingbee/executors.js +3 -3
- package/src/providers/scrapingdog/executors.js +1 -1
- package/src/providers/screenshot_fyi/executors.js +3 -4
- package/src/providers/screenshotbase/runtime.js +3 -3
- package/src/providers/search_api/runtime.js +2 -2
- package/src/providers/securitytrails/executors.js +2 -2
- package/src/providers/semantic_scholar/executors.js +2 -2
- package/src/providers/sendbird/executors.js +2 -2
- package/src/providers/sendfox/executors.js +3 -3
- package/src/providers/sendgrid/executors.js +5 -5
- package/src/providers/sendmator/runtime.js +3 -4
- package/src/providers/seqera/runtime.js +3 -4
- package/src/providers/serveravatar/executors.js +3 -3
- package/src/providers/sheetdb/runtime.js +2 -2
- package/src/providers/short_menu/runtime.js +3 -3
- package/src/providers/shortcut/runtime.js +3 -3
- package/src/providers/shortpixel/runtime.js +2 -2
- package/src/providers/shotstack/runtime.js +4 -4
- package/src/providers/signpath/runtime.js +2 -2
- package/src/providers/signwell/runtime.js +5 -6
- package/src/providers/similarweb_digitalrank_api/runtime.js +3 -3
- package/src/providers/simla/runtime.js +5 -5
- package/src/providers/simplybook_me/executors.js +6 -6
- package/src/providers/sitespeakai/runtime.js +3 -3
- package/src/providers/slickdeals/runtime.js +2 -3
- package/src/providers/smartsuite/runtime.js +3 -3
- package/src/providers/sonarcloud/runtime.js +5 -5
- package/src/providers/sorftime/runtime.js +8 -8
- package/src/providers/spider/runtime.js +2 -2
- package/src/providers/splunk_http_event_collector/runtime.js +7 -8
- package/src/providers/sportsdata/runtime.js +4 -4
- package/src/providers/spyfu/runtime.js +4 -5
- package/src/providers/square/runtime.js +4 -4
- package/src/providers/stannp/runtime.js +2 -2
- package/src/providers/stripe/executors.js +2 -2
- package/src/providers/supermemory/runtime.js +3 -3
- package/src/providers/survey_monkey/runtime.js +3 -3
- package/src/providers/taiga/runtime.js +4 -4
- package/src/providers/talenox/executors.js +4 -4
- package/src/providers/tally/runtime.js +3 -3
- package/src/providers/tavily/runtime.js +3 -4
- package/src/providers/teamcamp/executors.js +2 -2
- package/src/providers/teamtailor/executors.js +2 -2
- package/src/providers/telegram/executors.js +6 -7
- package/src/providers/teltel/executors.js +2 -2
- package/src/providers/templated/executors.js +3 -3
- package/src/providers/tencent_docs/runtime.js +4 -4
- package/src/providers/tencent_maps/runtime.js +3 -3
- package/src/providers/textcortex/runtime.js +3 -3
- package/src/providers/the_cat_api/runtime.js +3 -3
- package/src/providers/the_colony/runtime.js +3 -3
- package/src/providers/the_odds_api/runtime.js +3 -4
- package/src/providers/the_official_board/runtime.js +4 -4
- package/src/providers/thehive/runtime.js +1 -1
- package/src/providers/tikhub/endpoint-catalog.js +2 -3
- package/src/providers/tiktok_business/runtime.js +2 -2
- package/src/providers/timecamp/runtime.js +2 -2
- package/src/providers/timelink/runtime.js +2 -2
- package/src/providers/totp/runtime.js +4 -5
- package/src/providers/trawlingweb/runtime.js +2 -2
- package/src/providers/trilium/runtime.js +2 -2
- package/src/providers/triple_whale/runtime.js +3 -3
- package/src/providers/truvera/runtime.js +2 -2
- package/src/providers/tuskr/runtime.js +2 -2
- package/src/providers/typebot/runtime.js +2 -2
- package/src/providers/typeform/runtime.js +2 -2
- package/src/providers/uptimerobot/executors.js +3 -4
- package/src/providers/v2ex/runtime.js +8 -9
- package/src/providers/valyu/runtime.js +3 -3
- package/src/providers/vapi/runtime.js +4 -4
- package/src/providers/vectorshift/runtime.js +3 -3
- package/src/providers/venafitlsprotectcloud/runtime.js +2 -3
- package/src/providers/venafitlsprotectdatacenter/runtime.js +2 -3
- package/src/providers/vida/runtime.js +4 -4
- package/src/providers/vonage/runtime.js +3 -3
- package/src/providers/walmart_marketplace/runtime.js +5 -5
- package/src/providers/weatherapi/executors.js +3 -4
- package/src/providers/web_of_science/runtime.js +4 -4
- package/src/providers/web_of_science_expanded/runtime.js +9 -9
- package/src/providers/webex/runtime.js +3 -3
- package/src/providers/webinarjam/runtime.js +4 -4
- package/src/providers/webscraping_ai/runtime.js +3 -3
- package/src/providers/webvizio/runtime.js +3 -4
- package/src/providers/wecom_bot/smart-runtime.js +4 -5
- package/src/providers/wecom_mcp/runtime.js +3 -4
- package/src/providers/wejam_ai/runtime.js +3 -3
- package/src/providers/wolfram_alpha_api/runtime.js +3 -3
- package/src/providers/woocommerce/runtime.js +1 -1
- package/src/providers/woodpecker_co/executors.js +3 -4
- package/src/providers/woot/runtime.js +6 -6
- package/src/providers/workable/runtime.js +3 -3
- package/src/providers/workday/runtime.js +4 -4
- package/src/providers/workiom/runtime.js +2 -2
- package/src/providers/workiz/runtime.js +2 -2
- package/src/providers/workpath/executors.js +3 -4
- package/src/providers/worksnaps/executors.js +2 -2
- package/src/providers/y_gy/runtime.js +2 -2
- package/src/providers/zenscrape/runtime.js +3 -3
- package/src/providers/zep/runtime.js +4 -4
- package/src/providers/zeplin/runtime.js +2 -2
- package/src/providers/zhihu/executors.js +6 -6
- package/src/providers/zylvie/runtime.js +4 -4
- package/src/saas/saas-cleanup-service.d.ts +2 -0
- package/src/saas/saas-cleanup-service.js +2 -1
- package/src/saas/saas-execution-service.d.ts +1 -1
- package/src/server/actions/action-runner.js +1 -1
- package/src/server/api/auth.js +3 -0
- package/src/server/api/connection-routes.js +1 -1
- package/src/server/api/console-catalog-routes.js +1 -1
- package/src/server/api/console-oauth-routes.d.ts +3 -1
- package/src/server/api/console-oauth-routes.js +22 -9
- package/src/server/api/oauth-completion-page.d.ts +57 -0
- package/src/server/api/oauth-completion-page.js +135 -10
- package/src/server/api/openapi.d.ts +5 -0
- package/src/server/api/openapi.js +62 -2
- package/src/server/api/runtime-api.d.ts +2 -1
- package/src/server/api/runtime-app-routes.js +1 -1
- package/src/server/api/runtime-execution-routes.js +2 -1
- package/src/server/connect-app.d.ts +4 -0
- package/src/server/connect-app.js +14 -1
- package/src/server/connect-server.d.ts +6 -0
- package/src/server/connect-server.js +114 -4
- package/src/server/connector-runtime.d.ts +6 -8
- package/src/server/connector-runtime.js +8 -28
- package/src/server/proxy/proxy-runner.js +1 -1
- package/src/server/slack-event-verification.d.ts +37 -0
- package/src/server/slack-event-verification.js +91 -0
- package/src/server/storage/connection-request-store.d.ts +1 -1
- package/src/server/storage/connection-store.d.ts +1 -1
- package/src/server/storage/postgres/runtime-store.d.ts +1 -1
- package/src/server/storage/runtime-database.d.ts +1 -1
- package/src/server/storage/saas-project-store.d.ts +1 -1
- package/src/triggers/maintenance.d.ts +2 -0
- package/src/triggers/maintenance.js +2 -1
- package/src/triggers/sources/slack-signature.d.ts +10 -0
- package/src/triggers/sources/slack-signature.js +13 -0
- package/src/triggers/sources/slack.js +9 -11
- package/src/triggers/trigger-runner.js +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { compactObject, optionalString } from "../../core/cast.js";
|
|
2
|
-
import { createProviderTimeout, isAbortLikeError, providerUserAgent, ProviderRequestError, } from "../provider-runtime.js";
|
|
2
|
+
import { createProviderTimeout, isAbortLikeError, providerUserAgent, ProviderRequestError, defaultProviderRequestTimeoutMs, } from "../provider-runtime.js";
|
|
3
3
|
export const glyphicApiBaseUrl = "https://api.glyphic.ai";
|
|
4
|
-
const glyphicRequestTimeoutMs = 30_000;
|
|
5
4
|
export const glyphicActionHandlers = {
|
|
6
5
|
async list_calls(input, context) {
|
|
7
6
|
const payload = await requestGlyphicJson({
|
|
@@ -99,7 +98,7 @@ async function requestGlyphicArray(path, context, label) {
|
|
|
99
98
|
return readResponseArray(payload, label);
|
|
100
99
|
}
|
|
101
100
|
async function requestGlyphicJson(input, context, mode) {
|
|
102
|
-
const timeout = createProviderTimeout(context.signal
|
|
101
|
+
const timeout = createProviderTimeout(context.signal);
|
|
103
102
|
try {
|
|
104
103
|
const response = await context.fetcher(buildGlyphicUrl(input.path, input.query), {
|
|
105
104
|
method: input.method,
|
|
@@ -121,7 +120,7 @@ async function requestGlyphicJson(input, context, mode) {
|
|
|
121
120
|
throw error;
|
|
122
121
|
}
|
|
123
122
|
if (timeout.didTimeout() || isAbortLikeError(error)) {
|
|
124
|
-
throw new ProviderRequestError(504, `Glyphic request timed out after ${
|
|
123
|
+
throw new ProviderRequestError(504, `Glyphic request timed out after ${defaultProviderRequestTimeoutMs / 1000} seconds`);
|
|
125
124
|
}
|
|
126
125
|
const message = error instanceof Error && error.message.trim() ? error.message : "request failed";
|
|
127
126
|
throw new ProviderRequestError(502, `Glyphic request failed: ${message}`);
|
|
@@ -2,7 +2,7 @@ import { format as schemaFormat } from "@cfworker/json-schema";
|
|
|
2
2
|
import { looseArray, optionalBoolean, optionalNumberLike, optionalRawString, optionalRecord, optionalString, } from "../../core/cast.js";
|
|
3
3
|
import { encodePathSegment } from "../../core/request.js";
|
|
4
4
|
import { googleBearerProxyAuth, googleServiceAccountValidator, resolveGoogleAccessToken, } from "../googledrive/runtime-auth.js";
|
|
5
|
-
import { defineProviderExecutors, defineProviderProxy, providerInputError, ProviderRequestError, providerResponseError, readProviderErrorTextBody, readProviderJsonBody, requiredInputString, requiredResponseRecord, runProviderRequest, withRetryAfterSeconds, } from "../provider-runtime.js";
|
|
5
|
+
import { defineProviderExecutors, defineProviderProxy, providerInputError, ProviderRequestError, providerResponseError, readProviderErrorTextBody, readProviderJsonBody, readRetryAfterSeconds, requiredInputString, requiredResponseRecord, runProviderRequest, providerRequestErrorCode, withRetryAfterSeconds, } from "../provider-runtime.js";
|
|
6
6
|
import { decodeGmailAttachment } from "./attachment-stream.js";
|
|
7
7
|
import { gmailMaxMimeBytes } from "./limits.js";
|
|
8
8
|
import { assertMatchingReplySubject, buildRecipients, normalizeGmailMessage, normalizeMessageId, normalizeThreadId, readHeader, resolveReplyHeaders, summarizeGmailMessage, } from "./message.js";
|
|
@@ -13,6 +13,16 @@ import { gmailMessageReceived } from "./trigger-on-message-received.js";
|
|
|
13
13
|
const service = "gmail";
|
|
14
14
|
const gmailApiBaseUrl = "https://gmail.googleapis.com/gmail/v1";
|
|
15
15
|
const detailHydrationBatchSize = 10;
|
|
16
|
+
// Hydration fans out one detail request per listed id, which can exceed Gmail's per-user quota.
|
|
17
|
+
// The retry below keeps hydrated rows and paces the rest instead of discarding the page.
|
|
18
|
+
// Six attempts let the backoff climb 1, 2, 4, 8, 16 s (about 31 s of waiting per message at most),
|
|
19
|
+
// long enough for the moving average to drain, without retrying one message forever.
|
|
20
|
+
const hydrationMaxAttempts = 6;
|
|
21
|
+
const hydrationBaseBackoffMs = 1_000;
|
|
22
|
+
// Total time one action may spend waiting out rate limits. It stays well below the few minutes a
|
|
23
|
+
// caller typically allows one action call, so a persistent limit still comes back as rate_limited
|
|
24
|
+
// (which the caller can pace) rather than as a client-side timeout.
|
|
25
|
+
const hydrationRetryBudgetMs = 120_000;
|
|
16
26
|
// Attachments may reach Gmail's 25 MB cap, and the base64 JSON envelope is a third larger again;
|
|
17
27
|
// the default 30 s request budget covers fetch, decode, and disk write, so give this transfer longer.
|
|
18
28
|
const attachmentDownloadTimeoutMs = 120_000;
|
|
@@ -49,11 +59,11 @@ export const gmailActionHandlers = {
|
|
|
49
59
|
})),
|
|
50
60
|
};
|
|
51
61
|
},
|
|
52
|
-
list_threads(input, { userId, accessToken, fetcher }) {
|
|
53
|
-
return listThreads(input, userId, accessToken, fetcher);
|
|
62
|
+
list_threads(input, { userId, accessToken, fetcher, signal }) {
|
|
63
|
+
return listThreads(input, userId, accessToken, fetcher, signal);
|
|
54
64
|
},
|
|
55
|
-
fetch_emails(input, { userId, accessToken, fetcher }) {
|
|
56
|
-
return fetchEmails(input, userId, accessToken, fetcher);
|
|
65
|
+
fetch_emails(input, { userId, accessToken, fetcher, signal }) {
|
|
66
|
+
return fetchEmails(input, userId, accessToken, fetcher, signal);
|
|
57
67
|
},
|
|
58
68
|
async get_message(input, { userId, accessToken, fetcher }) {
|
|
59
69
|
const message = await getMessageResource(userId, normalizeMessageId(input.messageId), accessToken, fetcher, "full");
|
|
@@ -92,8 +102,8 @@ export const gmailActionHandlers = {
|
|
|
92
102
|
create_email_draft(input, context) {
|
|
93
103
|
return createEmailDraft(input, context);
|
|
94
104
|
},
|
|
95
|
-
list_drafts(input, { userId, accessToken, fetcher }) {
|
|
96
|
-
return listDrafts(input, userId, accessToken, fetcher);
|
|
105
|
+
list_drafts(input, { userId, accessToken, fetcher, signal }) {
|
|
106
|
+
return listDrafts(input, userId, accessToken, fetcher, signal);
|
|
97
107
|
},
|
|
98
108
|
get_draft(input, { userId, accessToken, fetcher }) {
|
|
99
109
|
return getDraft(input, userId, accessToken, fetcher);
|
|
@@ -233,7 +243,7 @@ export const credentialValidators = {
|
|
|
233
243
|
},
|
|
234
244
|
customCredential: googleServiceAccountValidator(service, gmailOAuthScopes),
|
|
235
245
|
};
|
|
236
|
-
async function fetchEmails(input, userId, accessToken, fetcher) {
|
|
246
|
+
async function fetchEmails(input, userId, accessToken, fetcher, signal) {
|
|
237
247
|
const detail = trimmedString(input.detail) || "summary";
|
|
238
248
|
const url = new URL(gmailUserUrl(userId, "messages"));
|
|
239
249
|
const query = trimmedString(input.query);
|
|
@@ -265,7 +275,7 @@ async function fetchEmails(input, userId, accessToken, fetcher) {
|
|
|
265
275
|
}
|
|
266
276
|
const includeFullMessage = detail === "full";
|
|
267
277
|
const format = includeFullMessage ? "full" : "metadata";
|
|
268
|
-
const hydrated = await hydrateInBatches(messages, (message) => getMessageResource(userId, message.id, accessToken, fetcher, format));
|
|
278
|
+
const hydrated = await hydrateInBatches(messages, (message) => getMessageResource(userId, message.id, accessToken, fetcher, format), signal);
|
|
269
279
|
return {
|
|
270
280
|
messages: hydrated.map((message) => includeFullMessage ? normalizeGmailMessage(message) : summarizeGmailMessage(message)),
|
|
271
281
|
nextPageToken: payload.nextPageToken ?? null,
|
|
@@ -285,7 +295,7 @@ async function fetchMessagesByThreadId(input, userId, accessToken, fetcher) {
|
|
|
285
295
|
messages: (thread.messages ?? []).map((message) => normalizeGmailMessage(message)),
|
|
286
296
|
};
|
|
287
297
|
}
|
|
288
|
-
async function listThreads(input, userId, accessToken, fetcher) {
|
|
298
|
+
async function listThreads(input, userId, accessToken, fetcher, signal) {
|
|
289
299
|
const url = new URL(gmailUserUrl(userId, "threads"));
|
|
290
300
|
const query = trimmedString(input.query);
|
|
291
301
|
if (query) {
|
|
@@ -300,7 +310,7 @@ async function listThreads(input, userId, accessToken, fetcher) {
|
|
|
300
310
|
const payload = await fetchJson(url.toString(), accessToken, fetcher);
|
|
301
311
|
const threads = payload.threads ?? [];
|
|
302
312
|
if (input.verbose === true) {
|
|
303
|
-
const hydrated = await hydrateInBatches(threads, (thread) => getThreadResource(userId, thread.id, accessToken, fetcher, "full"));
|
|
313
|
+
const hydrated = await hydrateInBatches(threads, (thread) => getThreadResource(userId, thread.id, accessToken, fetcher, "full"), signal);
|
|
304
314
|
return {
|
|
305
315
|
threads: hydrated.map((thread) => ({
|
|
306
316
|
threadId: thread.id,
|
|
@@ -465,7 +475,7 @@ function latestReplyMessage(thread) {
|
|
|
465
475
|
throw providerInputError("thread has no non-draft messages to reply to");
|
|
466
476
|
return latest;
|
|
467
477
|
}
|
|
468
|
-
async function listDrafts(input, userId, accessToken, fetcher) {
|
|
478
|
+
async function listDrafts(input, userId, accessToken, fetcher, signal) {
|
|
469
479
|
const url = new URL(gmailUserUrl(userId, "drafts"));
|
|
470
480
|
if (input.pageToken != null) {
|
|
471
481
|
url.searchParams.set("pageToken", String(input.pageToken));
|
|
@@ -476,7 +486,7 @@ async function listDrafts(input, userId, accessToken, fetcher) {
|
|
|
476
486
|
const payload = await fetchJson(url.toString(), accessToken, fetcher);
|
|
477
487
|
const drafts = payload.drafts ?? [];
|
|
478
488
|
if (input.verbose === true) {
|
|
479
|
-
const hydrated = await hydrateInBatches(drafts, (draft) => getDraftResource(userId, draft.id, accessToken, fetcher, "full"));
|
|
489
|
+
const hydrated = await hydrateInBatches(drafts, (draft) => getDraftResource(userId, draft.id, accessToken, fetcher, "full"), signal);
|
|
480
490
|
return {
|
|
481
491
|
drafts: hydrated.map((draft) => ({
|
|
482
492
|
id: draft.id,
|
|
@@ -780,14 +790,94 @@ function normalizeThread(thread) {
|
|
|
780
790
|
messages: (thread.messages ?? []).map((message) => normalizeGmailMessage(message)),
|
|
781
791
|
};
|
|
782
792
|
}
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
793
|
+
/**
|
|
794
|
+
* Hydrate every item, in order, or fail the whole call: a caller advances its page cursor on
|
|
795
|
+
* success, so a partial page must never look complete.
|
|
796
|
+
*
|
|
797
|
+
* Items run in batches of up to `detailHydrationBatchSize`. A per-user rate limit on one item
|
|
798
|
+
* keeps every row already hydrated and requeues only the limited items; the batch width halves
|
|
799
|
+
* (down to 1) and the next batch waits out `Retry-After` or an exponential, jittered backoff.
|
|
800
|
+
* Each clean batch widens the next one by a single item again. When an item runs out of
|
|
801
|
+
* attempts, or the next wait would overrun the action's retry budget, the rate-limit error
|
|
802
|
+
* with the longest `Retry-After` is thrown unchanged, so the action still reports `rate_limited`.
|
|
803
|
+
* Any other error rejects immediately, exactly like the plain batch it replaces.
|
|
804
|
+
*/
|
|
805
|
+
async function hydrateInBatches(items, hydrate, signal) {
|
|
806
|
+
const hydrated = new Array(items.length);
|
|
807
|
+
const attempts = new Array(items.length).fill(0);
|
|
808
|
+
const deadline = Date.now() + hydrationRetryBudgetMs;
|
|
809
|
+
let pending = items.map((_item, index) => index);
|
|
810
|
+
let width = detailHydrationBatchSize;
|
|
811
|
+
while (pending.length > 0) {
|
|
812
|
+
const batch = pending.slice(0, width);
|
|
813
|
+
const outcomes = await Promise.all(batch.map(async (index) => {
|
|
814
|
+
attempts[index] += 1;
|
|
815
|
+
try {
|
|
816
|
+
hydrated[index] = await hydrate(items[index]);
|
|
817
|
+
return undefined;
|
|
818
|
+
}
|
|
819
|
+
catch (error) {
|
|
820
|
+
if (isRetryableGmailRateLimit(error))
|
|
821
|
+
return error;
|
|
822
|
+
throw error;
|
|
823
|
+
}
|
|
824
|
+
}));
|
|
825
|
+
const limited = batch.filter((_index, position) => outcomes[position] !== undefined);
|
|
826
|
+
pending = [...limited, ...pending.slice(batch.length)];
|
|
827
|
+
if (limited.length === 0) {
|
|
828
|
+
width = Math.min(detailHydrationBatchSize, width + 1);
|
|
829
|
+
continue;
|
|
830
|
+
}
|
|
831
|
+
// Surface the error carrying the longest Retry-After so the caller can pace the connection.
|
|
832
|
+
const pacingError = outcomes
|
|
833
|
+
.filter((error) => error !== undefined)
|
|
834
|
+
.reduce((longest, error) => (gmailRetryAfterMs(error) > gmailRetryAfterMs(longest) ? error : longest));
|
|
835
|
+
const attempt = Math.max(...limited.map((index) => attempts[index]));
|
|
836
|
+
if (attempt >= hydrationMaxAttempts)
|
|
837
|
+
throw pacingError;
|
|
838
|
+
const delayMs = hydrationRetryDelayMs(attempt, gmailRetryAfterMs(pacingError));
|
|
839
|
+
if (Date.now() + delayMs > deadline)
|
|
840
|
+
throw pacingError;
|
|
841
|
+
width = Math.max(1, Math.floor(width / 2));
|
|
842
|
+
await sleepFor(delayMs, signal);
|
|
788
843
|
}
|
|
789
844
|
return hydrated;
|
|
790
845
|
}
|
|
846
|
+
/**
|
|
847
|
+
* A rate limit worth waiting out inside this action: whatever the runtime reports as `rate_limited`
|
|
848
|
+
* (any 429, and the 403 rate-limit reasons `readGmailError` labels), except an exhausted daily or
|
|
849
|
+
* project quota, which stays `rate_limited` but does not recover within one action.
|
|
850
|
+
*/
|
|
851
|
+
function isRetryableGmailRateLimit(error) {
|
|
852
|
+
return (error instanceof GmailRequestError && !error.quotaExhausted && providerRequestErrorCode(error) === "rate_limited");
|
|
853
|
+
}
|
|
854
|
+
function gmailRetryAfterMs(error) {
|
|
855
|
+
return (optionalNumberLike(optionalRecord(error.details)?.retryAfterSeconds) ?? 0) * 1_000;
|
|
856
|
+
}
|
|
857
|
+
/** Honour the upstream `Retry-After` when present, else equal-jitter exponential backoff. */
|
|
858
|
+
function hydrationRetryDelayMs(attempt, retryAfterMs) {
|
|
859
|
+
if (retryAfterMs > 0)
|
|
860
|
+
return retryAfterMs;
|
|
861
|
+
const backoffMs = hydrationBaseBackoffMs * 2 ** (attempt - 1);
|
|
862
|
+
return backoffMs / 2 + Math.random() * (backoffMs / 2);
|
|
863
|
+
}
|
|
864
|
+
function sleepFor(delayMs, signal) {
|
|
865
|
+
return new Promise((resolve, reject) => {
|
|
866
|
+
if (signal?.aborted) {
|
|
867
|
+
reject(signal.reason);
|
|
868
|
+
return;
|
|
869
|
+
}
|
|
870
|
+
const onAbort = () => {
|
|
871
|
+
clearTimeout(timer);
|
|
872
|
+
reject(signal.reason);
|
|
873
|
+
};
|
|
874
|
+
const timer = setTimeout(() => {
|
|
875
|
+
signal?.removeEventListener("abort", onAbort);
|
|
876
|
+
resolve();
|
|
877
|
+
}, delayMs);
|
|
878
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
879
|
+
});
|
|
880
|
+
}
|
|
791
881
|
function buildLabelPayload(input) {
|
|
792
882
|
return Object.fromEntries(Object.entries(input).filter(([key, value]) => key !== "userId" && key !== "labelId" && value !== undefined));
|
|
793
883
|
}
|
|
@@ -864,12 +954,18 @@ async function assertGmailResponse(response) {
|
|
|
864
954
|
}
|
|
865
955
|
throw await readGmailError(response);
|
|
866
956
|
}
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
957
|
+
// Gmail answers both of these with a 403, which would otherwise read as an authorization failure.
|
|
958
|
+
// Per-user rate limits clear within seconds; exhausted daily or project quotas do not.
|
|
959
|
+
const gmailRateLimitReasons = new Set(["rateLimitExceeded", "userRateLimitExceeded"]);
|
|
960
|
+
const gmailExhaustedQuotaReasons = new Set(["dailyLimitExceeded", "quotaExceeded"]);
|
|
961
|
+
/** A Gmail API failure that also records whether the upstream reason was an exhausted quota. */
|
|
962
|
+
class GmailRequestError extends ProviderRequestError {
|
|
963
|
+
quotaExhausted;
|
|
964
|
+
constructor(status, message, details, code, quotaExhausted) {
|
|
965
|
+
super(status, message, details, code);
|
|
966
|
+
this.quotaExhausted = quotaExhausted;
|
|
967
|
+
}
|
|
968
|
+
}
|
|
873
969
|
async function readGmailError(response) {
|
|
874
970
|
const text = await readProviderErrorTextBody(response, "gmail error response");
|
|
875
971
|
let error;
|
|
@@ -879,8 +975,10 @@ async function readGmailError(response) {
|
|
|
879
975
|
catch {
|
|
880
976
|
// A malformed response must not expose its raw body or change status classification.
|
|
881
977
|
}
|
|
882
|
-
const
|
|
883
|
-
|
|
884
|
-
|
|
978
|
+
const reasons = looseArray(error?.errors).flatMap((entry) => optionalString(optionalRecord(entry)?.reason) ?? []);
|
|
979
|
+
const quotaExhausted = reasons.some((reason) => gmailExhaustedQuotaReasons.has(reason));
|
|
980
|
+
const rateLimited = response.status === 403 && (quotaExhausted || reasons.some((reason) => gmailRateLimitReasons.has(reason)));
|
|
981
|
+
const retryAfterSeconds = rateLimited ? readRetryAfterSeconds(response.headers) : undefined;
|
|
982
|
+
return new GmailRequestError(response.status, optionalString(error?.message) ?? `gmail request failed with ${response.status}`, retryAfterSeconds === undefined ? withRetryAfterSeconds(response) : { retryAfterSeconds }, rateLimited ? "rate_limited" : undefined, quotaExhausted);
|
|
885
983
|
}
|
|
886
984
|
export const triggers = [gmailMessageReceived];
|
|
@@ -2,9 +2,8 @@ import { Buffer } from "node:buffer";
|
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
import { compactObject, optionalRecord, optionalString } from "../../core/cast.js";
|
|
4
4
|
import { assertPublicHttpUrl } from "../../core/request.js";
|
|
5
|
-
import { createProviderTimeout, isAbortLikeError, providerUserAgent, ProviderRequestError, requiredInputString, } from "../provider-runtime.js";
|
|
5
|
+
import { createProviderTimeout, isAbortLikeError, providerUserAgent, ProviderRequestError, requiredInputString, providerInputError, defaultProviderRequestTimeoutMs, } from "../provider-runtime.js";
|
|
6
6
|
export const gongDefaultApiBaseUrl = "https://api.gong.io";
|
|
7
|
-
const gongDefaultTimeoutMs = 30_000;
|
|
8
7
|
const gongCredentialHelpUrl = "https://help.gong.io/docs/receive-access-to-the-api";
|
|
9
8
|
export const gongActionHandlers = {
|
|
10
9
|
list_users(input, context) {
|
|
@@ -115,7 +114,7 @@ export async function validateGongCredential(input, fetcher, signal) {
|
|
|
115
114
|
};
|
|
116
115
|
}
|
|
117
116
|
async function requestGongJson(input) {
|
|
118
|
-
const timeout = createProviderTimeout(input.context.signal
|
|
117
|
+
const timeout = createProviderTimeout(input.context.signal);
|
|
119
118
|
try {
|
|
120
119
|
const response = await input.context.fetcher(buildGongUrl(input.context.apiBaseUrl, input.path, input.query), {
|
|
121
120
|
method: input.method,
|
|
@@ -134,7 +133,7 @@ async function requestGongJson(input) {
|
|
|
134
133
|
throw error;
|
|
135
134
|
}
|
|
136
135
|
if (timeout.didTimeout() || isAbortLikeError(error)) {
|
|
137
|
-
throw new ProviderRequestError(504, `Gong ${input.path} request timed out after ${
|
|
136
|
+
throw new ProviderRequestError(504, `Gong ${input.path} request timed out after ${defaultProviderRequestTimeoutMs / 1000} seconds`);
|
|
138
137
|
}
|
|
139
138
|
const message = error instanceof Error && error.message.trim() ? error.message : "request failed";
|
|
140
139
|
throw new ProviderRequestError(502, `Gong ${input.path} request failed: ${message}`);
|
|
@@ -158,7 +157,7 @@ export function normalizeGongApiBaseUrl(value) {
|
|
|
158
157
|
}
|
|
159
158
|
assertPublicHttpUrl(url.toString(), {
|
|
160
159
|
fieldName: "apiBaseUrl",
|
|
161
|
-
createError:
|
|
160
|
+
createError: providerInputError,
|
|
162
161
|
});
|
|
163
162
|
url.search = "";
|
|
164
163
|
url.hash = "";
|
|
@@ -214,10 +213,10 @@ function mapGongHttpError(status, message, phase) {
|
|
|
214
213
|
return new ProviderRequestError(429, message);
|
|
215
214
|
}
|
|
216
215
|
if (phase === "validate" && [400, 401, 403].includes(status)) {
|
|
217
|
-
return
|
|
216
|
+
return providerInputError(message);
|
|
218
217
|
}
|
|
219
218
|
if ([400, 404].includes(status)) {
|
|
220
|
-
return
|
|
219
|
+
return providerInputError(message);
|
|
221
220
|
}
|
|
222
221
|
if ([401, 403].includes(status)) {
|
|
223
222
|
return new ProviderRequestError(status, message);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { optionalRecord, optionalString as asOptionalString, pickOptionalString } from "../../core/cast.js";
|
|
2
|
-
import { providerUserAgent, ProviderRequestError, withRetryAfterSeconds } from "../provider-runtime.js";
|
|
2
|
+
import { providerUserAgent, ProviderRequestError, withRetryAfterSeconds, defaultProviderRequestTimeoutMs, } from "../provider-runtime.js";
|
|
3
3
|
export const googlecalendarApiBaseUrl = "https://www.googleapis.com/calendar/v3";
|
|
4
4
|
const service = "googlecalendar";
|
|
5
|
-
const googleDefaultRequestTimeoutMs = 30_000;
|
|
6
5
|
export async function googlecalendarJsonRequest(url, input) {
|
|
7
6
|
try {
|
|
8
7
|
const response = await googlecalendarRequest(url, input);
|
|
@@ -50,7 +49,7 @@ export async function googlecalendarRequest(url, input) {
|
|
|
50
49
|
};
|
|
51
50
|
const response = await googleFetchWithTimeout(target.toString(), {
|
|
52
51
|
fetcher: input.fetcher,
|
|
53
|
-
timeoutMs:
|
|
52
|
+
timeoutMs: defaultProviderRequestTimeoutMs,
|
|
54
53
|
init: requestInit,
|
|
55
54
|
});
|
|
56
55
|
await assertGoogleResponse(response);
|
|
@@ -95,7 +94,7 @@ function maybeRewriteSyncTokenError(error, syncTokenAware) {
|
|
|
95
94
|
return error;
|
|
96
95
|
}
|
|
97
96
|
async function googleFetchWithTimeout(url, input) {
|
|
98
|
-
const timeoutMs = input.timeoutMs ??
|
|
97
|
+
const timeoutMs = input.timeoutMs ?? defaultProviderRequestTimeoutMs;
|
|
99
98
|
if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) {
|
|
100
99
|
return input.fetcher(url, input.init);
|
|
101
100
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { looseArray, optionalRecord, optionalString } from "../../core/cast.js";
|
|
2
|
-
import { createProviderTimeout, isAbortLikeError, providerUserAgent, ProviderRequestError, providerInputError, providerResponseError, } from "../provider-runtime.js";
|
|
2
|
+
import { createProviderTimeout, isAbortLikeError, providerUserAgent, ProviderRequestError, providerInputError, providerResponseError, defaultProviderRequestTimeoutMs, } from "../provider-runtime.js";
|
|
3
3
|
const defaultService = "googledrive";
|
|
4
|
-
const googleDefaultRequestTimeoutMs = 30_000;
|
|
5
4
|
export async function googleJsonRequest(url, input) {
|
|
6
5
|
const response = await googleRequest(url, input);
|
|
7
6
|
return (await response.json());
|
|
@@ -41,7 +40,7 @@ export async function googleRequest(url, input) {
|
|
|
41
40
|
: headers,
|
|
42
41
|
...(input.rawBody != null ? { body: input.rawBody } : hasJsonBody ? { body: JSON.stringify(input.body) } : {}),
|
|
43
42
|
};
|
|
44
|
-
const timeoutMs = input.timeoutMs ??
|
|
43
|
+
const timeoutMs = input.timeoutMs ?? defaultProviderRequestTimeoutMs;
|
|
45
44
|
const timeout = createProviderTimeout(input.signal, timeoutMs);
|
|
46
45
|
let response;
|
|
47
46
|
try {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { compactObject, objectArray, optionalBoolean, optionalIntegerLike, optionalRecord, optionalString as optionalTrimmedString, pickOptionalBoolean, pickOptionalInteger, pickOptionalString, requiredRecord, stringArray, } from "../../core/cast.js";
|
|
2
|
-
import { isAbortLikeError, providerUserAgent, ProviderRequestError } from "../provider-runtime.js";
|
|
2
|
+
import { isAbortLikeError, providerUserAgent, ProviderRequestError, defaultProviderRequestTimeoutMs, } from "../provider-runtime.js";
|
|
3
3
|
export { compactObject, optionalBoolean, optionalIntegerLike as asOptionalInteger, optionalRecord as asOptionalObject, pickOptionalBoolean, pickOptionalInteger, pickOptionalString, };
|
|
4
4
|
const service = "googlesheets";
|
|
5
|
-
const googleDefaultRequestTimeoutMs = 30_000;
|
|
6
5
|
export async function googleJsonRequest(url, input) {
|
|
7
6
|
const response = await googleRequest(url, input);
|
|
8
7
|
return (await response.json());
|
|
@@ -44,7 +43,7 @@ export async function googleRequest(url, input) {
|
|
|
44
43
|
};
|
|
45
44
|
const response = await googleFetchWithTimeout(target.toString(), {
|
|
46
45
|
fetcher: input.fetcher,
|
|
47
|
-
timeoutMs: input.timeoutMs ??
|
|
46
|
+
timeoutMs: input.timeoutMs ?? defaultProviderRequestTimeoutMs,
|
|
48
47
|
init: requestInit,
|
|
49
48
|
});
|
|
50
49
|
await assertGoogleResponse(response);
|
|
@@ -141,7 +140,7 @@ export function asStringArray(value) {
|
|
|
141
140
|
return stringArray(value, "string array", (message) => new ProviderRequestError(400, message));
|
|
142
141
|
}
|
|
143
142
|
async function googleFetchWithTimeout(url, input) {
|
|
144
|
-
const timeoutMs = input.timeoutMs ??
|
|
143
|
+
const timeoutMs = input.timeoutMs ?? defaultProviderRequestTimeoutMs;
|
|
145
144
|
if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) {
|
|
146
145
|
return input.fetcher(url, input.init);
|
|
147
146
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Buffer } from "node:buffer";
|
|
2
2
|
import { optionalBoolean, optionalInteger, optionalRecord, optionalString } from "../../core/cast.js";
|
|
3
|
-
import { providerUserAgent, ProviderRequestError } from "../provider-runtime.js";
|
|
3
|
+
import { providerUserAgent, ProviderRequestError, providerInputError } from "../provider-runtime.js";
|
|
4
4
|
const gorgiasValidationPath = "/api/account";
|
|
5
5
|
export const gorgiasActionHandlers = {
|
|
6
6
|
async get_account(_input, context) {
|
|
@@ -202,16 +202,16 @@ async function readGorgiasPayload(response) {
|
|
|
202
202
|
function createGorgiasError(response, payload, phase, notFoundAsInvalidInput) {
|
|
203
203
|
const message = extractGorgiasErrorMessage(payload) ?? `Gorgias request failed with ${response.status}`;
|
|
204
204
|
if (phase === "validate" && (response.status === 401 || response.status === 403)) {
|
|
205
|
-
return
|
|
205
|
+
return providerInputError(message);
|
|
206
206
|
}
|
|
207
207
|
if (response.status === 401 || response.status === 403) {
|
|
208
208
|
return new ProviderRequestError(response.status, message);
|
|
209
209
|
}
|
|
210
210
|
if (response.status === 404 && notFoundAsInvalidInput) {
|
|
211
|
-
return
|
|
211
|
+
return providerInputError(message);
|
|
212
212
|
}
|
|
213
213
|
if (response.status === 400 || response.status === 422) {
|
|
214
|
-
return
|
|
214
|
+
return providerInputError(message);
|
|
215
215
|
}
|
|
216
216
|
if (response.status === 429) {
|
|
217
217
|
return new ProviderRequestError(429, message);
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { compactObject, optionalInteger, optionalRawString, optionalRecord, optionalString, requiredRecord, requiredString, } from "../../core/cast.js";
|
|
3
3
|
import { assertPublicHttpUrl, isPrivateNetworkAccessAllowed } from "../../core/request.js";
|
|
4
|
-
import { createProviderFetch, createProviderTimeout, defineProviderExecutors, defineProviderProxy, isAbortLikeError, providerUserAgent, ProviderRequestError, readProviderJsonBody, requireApiKeyCredential, } from "../provider-runtime.js";
|
|
4
|
+
import { createProviderFetch, createProviderTimeout, defineProviderExecutors, defineProviderProxy, isAbortLikeError, providerUserAgent, ProviderRequestError, readProviderJsonBody, requireApiKeyCredential, providerInputError, defaultProviderRequestTimeoutMs, } from "../provider-runtime.js";
|
|
5
5
|
const service = "gotify";
|
|
6
|
-
const gotifyRequestTimeoutMs = 30_000;
|
|
7
6
|
export const gotifyActionHandlers = {
|
|
8
7
|
async send_message(input, context) {
|
|
9
8
|
const payload = await requestGotifyJson({
|
|
@@ -110,11 +109,11 @@ export const credentialValidators = {
|
|
|
110
109
|
},
|
|
111
110
|
};
|
|
112
111
|
function normalizeGotifyBaseUrl(value, allowPrivateNetwork = isPrivateNetworkAccessAllowed()) {
|
|
113
|
-
const rawValue = requiredString(value, "baseUrl",
|
|
112
|
+
const rawValue = requiredString(value, "baseUrl", providerInputError);
|
|
114
113
|
const url = assertPublicHttpUrl(rawValue, {
|
|
115
114
|
fieldName: "baseUrl",
|
|
116
115
|
allowPrivateNetwork,
|
|
117
|
-
createError:
|
|
116
|
+
createError: providerInputError,
|
|
118
117
|
});
|
|
119
118
|
if (url.username || url.password) {
|
|
120
119
|
throw new ProviderRequestError(400, "baseUrl must not include username or password");
|
|
@@ -124,7 +123,7 @@ function normalizeGotifyBaseUrl(value, allowPrivateNetwork = isPrivateNetworkAcc
|
|
|
124
123
|
return url.toString().replace(/\/+$/u, "");
|
|
125
124
|
}
|
|
126
125
|
async function requestGotifyJson(input) {
|
|
127
|
-
const timeout = createProviderTimeout(input.context.signal
|
|
126
|
+
const timeout = createProviderTimeout(input.context.signal);
|
|
128
127
|
try {
|
|
129
128
|
const headers = {
|
|
130
129
|
accept: "application/json",
|
|
@@ -157,7 +156,7 @@ async function requestGotifyJson(input) {
|
|
|
157
156
|
throw error;
|
|
158
157
|
}
|
|
159
158
|
if (timeout.didTimeout() || isAbortLikeError(error)) {
|
|
160
|
-
throw new ProviderRequestError(504, `Gotify ${input.path} request timed out after ${Math.ceil(
|
|
159
|
+
throw new ProviderRequestError(504, `Gotify ${input.path} request timed out after ${Math.ceil(defaultProviderRequestTimeoutMs / 1000)} seconds`);
|
|
161
160
|
}
|
|
162
161
|
throw new ProviderRequestError(502, error instanceof Error
|
|
163
162
|
? `Gotify ${input.path} request failed: ${error.message}`
|
|
@@ -219,10 +218,10 @@ function readGotifyErrorMessage(payload) {
|
|
|
219
218
|
}
|
|
220
219
|
function mapGotifyHttpError(status, message, phase) {
|
|
221
220
|
if (phase === "validate" && (status === 401 || status === 403)) {
|
|
222
|
-
return
|
|
221
|
+
return providerInputError(message);
|
|
223
222
|
}
|
|
224
223
|
if (status === 400 || status === 404 || status === 422) {
|
|
225
|
-
return
|
|
224
|
+
return providerInputError(message);
|
|
226
225
|
}
|
|
227
226
|
if (status === 429) {
|
|
228
227
|
return new ProviderRequestError(429, message);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Buffer } from "node:buffer";
|
|
2
2
|
import { optionalInteger, optionalRecord, optionalString } from "../../core/cast.js";
|
|
3
|
-
import { defineApiKeyProviderExecutors, defineProviderProxy, ProviderRequestError, providerUserAgent, } from "../provider-runtime.js";
|
|
3
|
+
import { defineApiKeyProviderExecutors, defineProviderProxy, ProviderRequestError, providerUserAgent, providerInputError, } from "../provider-runtime.js";
|
|
4
4
|
const service = "greenhouse";
|
|
5
5
|
const greenhouseBaseUrl = "https://harvest.greenhouse.io/v1";
|
|
6
6
|
const validationPath = "/users";
|
|
@@ -200,13 +200,13 @@ async function mapGreenhouseError(response, phase) {
|
|
|
200
200
|
? `Greenhouse API request failed: ${detail}`
|
|
201
201
|
: `Greenhouse API request failed with HTTP ${response.status}`;
|
|
202
202
|
if (phase === "validate" && (response.status === 401 || response.status === 403)) {
|
|
203
|
-
return
|
|
203
|
+
return providerInputError(message);
|
|
204
204
|
}
|
|
205
205
|
if (response.status === 401 || response.status === 403) {
|
|
206
206
|
return new ProviderRequestError(401, message);
|
|
207
207
|
}
|
|
208
208
|
if (response.status === 404 || response.status === 422) {
|
|
209
|
-
return
|
|
209
|
+
return providerInputError(message);
|
|
210
210
|
}
|
|
211
211
|
if (response.status === 429) {
|
|
212
212
|
return new ProviderRequestError(429, message);
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { compactObject, objectArray, optionalRecord, optionalString, requiredRecord, requiredString, } from "../../core/cast.js";
|
|
2
|
-
import { defineProviderExecutors, defineProviderProxy, isAbortLikeError, providerInputError, providerResponseError, providerUserAgent, ProviderRequestError, requireApiKeyCredential, } from "../provider-runtime.js";
|
|
2
|
+
import { defineProviderExecutors, defineProviderProxy, isAbortLikeError, providerInputError, providerResponseError, providerUserAgent, ProviderRequestError, requireApiKeyCredential, defaultProviderRequestTimeoutMs, } from "../provider-runtime.js";
|
|
3
3
|
const service = "gumloop";
|
|
4
4
|
const gumloopApiBaseUrl = "https://api.gumloop.com/api/v1";
|
|
5
5
|
const gumloopValidationPath = "/list_saved_items";
|
|
6
|
-
const gumloopDefaultRequestTimeoutMs = 30_000;
|
|
7
6
|
export const gumloopActionHandlers = {
|
|
8
7
|
list_saved_flows(input, context) {
|
|
9
8
|
return listGumloopSavedFlows(input, context);
|
|
@@ -231,7 +230,7 @@ async function killGumloopFlowRun(input, context) {
|
|
|
231
230
|
}
|
|
232
231
|
async function requestGumloopJson(options) {
|
|
233
232
|
const hasJsonBody = options.body !== undefined;
|
|
234
|
-
const timeoutSignal = AbortSignal.timeout(
|
|
233
|
+
const timeoutSignal = AbortSignal.timeout(defaultProviderRequestTimeoutMs);
|
|
235
234
|
const signal = options.signal ? AbortSignal.any([options.signal, timeoutSignal]) : timeoutSignal;
|
|
236
235
|
try {
|
|
237
236
|
const response = await options.fetcher(buildGumloopUrl(options.path, options.query), {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { optionalInteger, optionalRecord, optionalString, requiredString } from "../../core/cast.js";
|
|
2
|
-
import { defineApiKeyProviderExecutors, defineProviderProxy, isAbortLikeError, providerInputError, providerUserAgent, ProviderRequestError, } from "../provider-runtime.js";
|
|
2
|
+
import { defineApiKeyProviderExecutors, defineProviderProxy, isAbortLikeError, providerInputError, providerUserAgent, ProviderRequestError, defaultProviderRequestTimeoutMs, } from "../provider-runtime.js";
|
|
3
3
|
const service = "gumroad";
|
|
4
4
|
const gumroadApiBaseUrl = "https://api.gumroad.com/v2";
|
|
5
5
|
const gumroadValidationPath = "/user";
|
|
6
|
-
const gumroadRequestTimeoutMs = 30_000;
|
|
7
6
|
export const gumroadActionHandlers = {
|
|
8
7
|
get_current_user(_input, context) {
|
|
9
8
|
return requestGumroad({
|
|
@@ -180,7 +179,7 @@ async function requestGumroad(input) {
|
|
|
180
179
|
else {
|
|
181
180
|
headers["content-type"] = "application/x-www-form-urlencoded;charset=UTF-8";
|
|
182
181
|
}
|
|
183
|
-
const timeoutSignal = AbortSignal.timeout(
|
|
182
|
+
const timeoutSignal = AbortSignal.timeout(defaultProviderRequestTimeoutMs);
|
|
184
183
|
const signal = input.signal ? AbortSignal.any([input.signal, timeoutSignal]) : timeoutSignal;
|
|
185
184
|
try {
|
|
186
185
|
const response = await input.fetcher(url, {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { compactObject, looseArray, optionalBoolean, optionalBooleanOrNull, optionalInteger, optionalNumber, optionalRecord, optionalRawString, optionalString, rawStringOrNull, requiredRecord, requiredString, } from "../../core/cast.js";
|
|
2
|
-
import { createProviderFetch, createProviderProxyUrl, defineProviderExecutors, isAbortLikeError, normalizeProviderProxyHeaders, providerInputError, ProviderRequestError, providerResponseError, providerUserAgent, requireApiKeyCredential, requiredInputString, toProviderProxyError, } from "../provider-runtime.js";
|
|
2
|
+
import { createProviderFetch, createProviderProxyUrl, defineProviderExecutors, isAbortLikeError, normalizeProviderProxyHeaders, providerInputError, ProviderRequestError, providerResponseError, providerUserAgent, requireApiKeyCredential, requiredInputString, toProviderProxyError, defaultProviderRequestTimeoutMs, } from "../provider-runtime.js";
|
|
3
3
|
const service = "habitica";
|
|
4
4
|
const habiticaApiBaseUrl = "https://habitica.com/api/v3";
|
|
5
5
|
const habiticaFetch = createProviderFetch({ skipDnsValidation: true });
|
|
6
|
-
const habiticaDefaultRequestTimeoutMs = 30_000;
|
|
7
6
|
export const habiticaActionHandlers = {
|
|
8
7
|
get_user_profile(input, context) {
|
|
9
8
|
return getUserProfile(input, context);
|
|
@@ -295,7 +294,7 @@ async function deleteTag(input, context) {
|
|
|
295
294
|
};
|
|
296
295
|
}
|
|
297
296
|
async function requestHabitica(input) {
|
|
298
|
-
const timeoutSignal = AbortSignal.timeout(
|
|
297
|
+
const timeoutSignal = AbortSignal.timeout(defaultProviderRequestTimeoutMs);
|
|
299
298
|
const signal = input.signal ? AbortSignal.any([input.signal, timeoutSignal]) : timeoutSignal;
|
|
300
299
|
try {
|
|
301
300
|
const response = await input.fetcher(buildHabiticaUrl(input.path, input.query), {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { optionalIntegerLike, optionalRawString, optionalRecord, requiredString } from "../../core/cast.js";
|
|
2
|
-
import { defineApiKeyProviderExecutors, defineProviderProxy, isAbortLikeError, providerInputError, providerUserAgent, ProviderRequestError, } from "../provider-runtime.js";
|
|
2
|
+
import { defineApiKeyProviderExecutors, defineProviderProxy, isAbortLikeError, providerInputError, providerUserAgent, ProviderRequestError, defaultProviderRequestTimeoutMs, } from "../provider-runtime.js";
|
|
3
3
|
const service = "hackerrank_work";
|
|
4
4
|
const hackerrankWorkApiBaseUrl = "https://www.hackerrank.com/x/api/v3";
|
|
5
|
-
const hackerrankWorkDefaultRequestTimeoutMs = 30_000;
|
|
6
5
|
export const hackerrankWorkActionHandlers = {
|
|
7
6
|
async list_tests(input, context) {
|
|
8
7
|
const payload = await requestHackerrankWorkJson("/tests", context, {
|
|
@@ -93,7 +92,7 @@ export const credentialValidators = {
|
|
|
93
92
|
},
|
|
94
93
|
};
|
|
95
94
|
async function requestHackerrankWorkJson(path, context, query, mode) {
|
|
96
|
-
const timeoutSignal = AbortSignal.timeout(
|
|
95
|
+
const timeoutSignal = AbortSignal.timeout(defaultProviderRequestTimeoutMs);
|
|
97
96
|
const signal = context.signal ? AbortSignal.any([context.signal, timeoutSignal]) : timeoutSignal;
|
|
98
97
|
try {
|
|
99
98
|
const response = await context.fetcher(buildHackerrankWorkUrl(path, query), {
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { compactObject, optionalBoolean, optionalInteger, optionalRecord, optionalString } from "../../core/cast.js";
|
|
2
|
-
import { createProviderFetch, createProviderProxyUrl, defineProviderExecutors, isAbortLikeError, normalizeProviderProxyHeaders, ProviderRequestError, providerUserAgent, readProviderProxyErrorMessage, readProviderProxyResponse, requiredResponseRecord, toProviderProxyError, } from "../provider-runtime.js";
|
|
2
|
+
import { createProviderFetch, createProviderProxyUrl, defineProviderExecutors, isAbortLikeError, normalizeProviderProxyHeaders, ProviderRequestError, providerUserAgent, readProviderProxyErrorMessage, readProviderProxyResponse, requiredResponseRecord, toProviderProxyError, defaultProviderRequestTimeoutMs, } from "../provider-runtime.js";
|
|
3
3
|
import { harvestOAuthScopes } from "./scopes.js";
|
|
4
4
|
const service = "harvest";
|
|
5
5
|
const harvestApiBaseUrl = "https://api.harvestapp.com";
|
|
6
6
|
const harvestAccountsUrl = "https://id.getharvest.com/api/v2/accounts";
|
|
7
7
|
const harvestFetch = createProviderFetch({ skipDnsValidation: true });
|
|
8
8
|
const harvestValidationPath = "/v2/users/me";
|
|
9
|
-
const harvestRequestTimeoutMs = 30_000;
|
|
10
9
|
export const harvestActionHandlers = {
|
|
11
10
|
get_current_user(_input, context) {
|
|
12
11
|
return getCurrentUser(context);
|
|
@@ -407,7 +406,7 @@ async function requestHarvest(input) {
|
|
|
407
406
|
headers.set("Content-Type", "application/json");
|
|
408
407
|
body = JSON.stringify(input.body);
|
|
409
408
|
}
|
|
410
|
-
const timeoutSignal = AbortSignal.timeout(
|
|
409
|
+
const timeoutSignal = AbortSignal.timeout(defaultProviderRequestTimeoutMs);
|
|
411
410
|
const signal = input.signal ? AbortSignal.any([input.signal, timeoutSignal]) : timeoutSignal;
|
|
412
411
|
try {
|
|
413
412
|
const response = await input.fetcher(url, {
|
|
@@ -470,7 +469,7 @@ async function fetchHarvestCurrentAccount(credential, fetcher, signal) {
|
|
|
470
469
|
};
|
|
471
470
|
}
|
|
472
471
|
async function requestHarvestAccounts(accessToken, fetcher, signal) {
|
|
473
|
-
const timeoutSignal = AbortSignal.timeout(
|
|
472
|
+
const timeoutSignal = AbortSignal.timeout(defaultProviderRequestTimeoutMs);
|
|
474
473
|
const resolvedSignal = signal ? AbortSignal.any([signal, timeoutSignal]) : timeoutSignal;
|
|
475
474
|
try {
|
|
476
475
|
const response = await fetcher(harvestAccountsUrl, {
|