@hasna/connectors 1.4.1 → 1.4.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/bin/index.js +1271 -317
- package/bin/mcp.js +524 -211
- package/bin/serve.js +1208 -256
- package/connectors/adobe/package.json +1 -1
- package/connectors/aitableai/package.json +1 -1
- package/connectors/alchemy/package.json +1 -1
- package/connectors/alerty/package.json +1 -1
- package/connectors/alienvault/package.json +1 -1
- package/connectors/alphamoon/package.json +1 -1
- package/connectors/alttextai/package.json +1 -1
- package/connectors/amadeus/package.json +1 -1
- package/connectors/amadeus/src/api/client.ts +6 -6
- package/connectors/amadeus/src/cli/index.ts +6 -6
- package/connectors/amadeus/src/utils/output.ts +5 -5
- package/connectors/amazon/package.json +1 -1
- package/connectors/amilia/package.json +1 -1
- package/connectors/amqpsender/package.json +1 -1
- package/connectors/announcekit/package.json +1 -1
- package/connectors/anthropic/.env.example +1 -1
- package/connectors/anyscale/package.json +1 -1
- package/connectors/apiary/package.json +1 -1
- package/connectors/apiflash/package.json +1 -1
- package/connectors/apitemplateio/package.json +1 -1
- package/connectors/apptivegrid/package.json +1 -1
- package/connectors/assemblyai/package.json +1 -1
- package/connectors/autom/package.json +1 -1
- package/connectors/automizy/package.json +1 -1
- package/connectors/autopilot/package.json +1 -1
- package/connectors/awscognito/package.json +1 -1
- package/connectors/bamboohr/package.json +1 -1
- package/connectors/bannerbear/package.json +1 -1
- package/connectors/baseten/package.json +1 -1
- package/connectors/box/package.json +1 -1
- package/connectors/brevo/package.json +1 -1
- package/connectors/calendly/package.json +1 -1
- package/connectors/cerebras/package.json +1 -1
- package/connectors/chargebee/package.json +1 -1
- package/connectors/clearbit/package.json +1 -1
- package/connectors/clickbank/README.md +2 -2
- package/connectors/cloudflare-workers/package.json +1 -1
- package/connectors/coda/package.json +1 -1
- package/connectors/coingecko/package.json +1 -1
- package/connectors/convertkit/package.json +1 -1
- package/connectors/customerio/package.json +1 -1
- package/connectors/databricks/package.json +1 -1
- package/connectors/datadog/package.json +1 -1
- package/connectors/datasoap/README.md +2 -2
- package/connectors/datasoap/package.json +1 -1
- package/connectors/datumbox/README.md +2 -2
- package/connectors/datumbox/package.json +1 -1
- package/connectors/dayschedule/README.md +2 -2
- package/connectors/dayschedule/package.json +1 -1
- package/connectors/deepgram/package.json +1 -1
- package/connectors/deepinfra/README.md +2 -2
- package/connectors/deepinfra/package.json +1 -1
- package/connectors/deepl/README.md +2 -2
- package/connectors/deepl/package.json +1 -1
- package/connectors/deepseek/package.json +1 -1
- package/connectors/demio/README.md +2 -2
- package/connectors/demio/package.json +1 -1
- package/connectors/descript/README.md +2 -2
- package/connectors/descript/package.json +1 -1
- package/connectors/detrack/README.md +2 -2
- package/connectors/detrack/package.json +1 -1
- package/connectors/devcycle/README.md +2 -2
- package/connectors/devcycle/package.json +1 -1
- package/connectors/dhl/README.md +2 -2
- package/connectors/dhl/package.json +1 -1
- package/connectors/docusign/package.json +1 -1
- package/connectors/dropbox/package.json +1 -1
- package/connectors/fal/package.json +1 -1
- package/connectors/fathom/package.json +1 -1
- package/connectors/fireworks/package.json +1 -1
- package/connectors/gitlab/package.json +1 -1
- package/connectors/googlechat/README.md +1 -2
- package/connectors/googledrive/src/api/client.ts +5 -5
- package/connectors/googledrive/src/api/files.ts +11 -11
- package/connectors/googledrive/src/api/folders.ts +2 -2
- package/connectors/googledrive/src/cli/index.ts +4 -4
- package/connectors/googledrive/src/utils/output.ts +3 -3
- package/connectors/googleforms/README.md +1 -2
- package/connectors/googleperspective/README.md +1 -2
- package/connectors/grafana/package.json +1 -1
- package/connectors/growbots/README.md +2 -2
- package/connectors/growbots/package.json +1 -1
- package/connectors/gumroad/package.json +1 -1
- package/connectors/gupshup/README.md +2 -2
- package/connectors/gupshup/package.json +1 -1
- package/connectors/guru/README.md +2 -2
- package/connectors/guru/package.json +1 -1
- package/connectors/hackernews/README.md +2 -2
- package/connectors/hackernews/package.json +1 -1
- package/connectors/halopsa/README.md +2 -2
- package/connectors/halopsa/package.json +1 -1
- package/connectors/handwrytten/README.md +2 -2
- package/connectors/handwrytten/package.json +1 -1
- package/connectors/hansei/README.md +2 -2
- package/connectors/hansei/package.json +1 -1
- package/connectors/harrypotterapi/README.md +2 -2
- package/connectors/harrypotterapi/package.json +1 -1
- package/connectors/harvest/README.md +2 -2
- package/connectors/harvest/package.json +1 -1
- package/connectors/headlesstesting/README.md +2 -2
- package/connectors/headlesstesting/package.json +1 -1
- package/connectors/homeassistant/package.json +1 -1
- package/connectors/klaviyo/package.json +1 -1
- package/connectors/lemonsqueezy/package.json +1 -1
- package/connectors/lighthouse/src/api/index.ts +1 -1
- package/connectors/linkedin/package.json +1 -1
- package/connectors/linkish/README.md +2 -2
- package/connectors/linkish/package.json +1 -1
- package/connectors/liveagent/README.md +2 -2
- package/connectors/liveagent/package.json +1 -1
- package/connectors/localazy/README.md +2 -2
- package/connectors/localazy/package.json +1 -1
- package/connectors/loginradius/README.md +2 -2
- package/connectors/loginradius/package.json +1 -1
- package/connectors/lokalise/README.md +2 -2
- package/connectors/lokalise/package.json +1 -1
- package/connectors/lonescale/README.md +2 -2
- package/connectors/lonescale/package.json +1 -1
- package/connectors/lucidchart/README.md +2 -2
- package/connectors/lucidchart/package.json +1 -1
- package/connectors/luma/package.json +1 -1
- package/connectors/magento2/README.md +2 -2
- package/connectors/magento2/package.json +1 -1
- package/connectors/mailcheck/README.md +2 -2
- package/connectors/mailcheck/package.json +1 -1
- package/connectors/mailchimp/package.json +1 -1
- package/connectors/mailerlite/README.md +2 -2
- package/connectors/mailerlite/package.json +1 -1
- package/connectors/mailersend/README.md +2 -2
- package/connectors/mailersend/package.json +1 -1
- package/connectors/mailify/README.md +2 -2
- package/connectors/mailify/package.json +1 -1
- package/connectors/mailjet/README.md +2 -2
- package/connectors/mailjet/package.json +1 -1
- package/connectors/mailmodo/README.md +2 -2
- package/connectors/mailmodo/package.json +1 -1
- package/connectors/malcore/README.md +2 -2
- package/connectors/malcore/package.json +1 -1
- package/connectors/mandrill/README.md +2 -2
- package/connectors/mandrill/package.json +1 -1
- package/connectors/marcomrobot/README.md +2 -2
- package/connectors/marcomrobot/package.json +1 -1
- package/connectors/marketingmasterio/README.md +2 -2
- package/connectors/marketingmasterio/package.json +1 -1
- package/connectors/marketplacer/README.md +2 -2
- package/connectors/marketplacer/package.json +1 -1
- package/connectors/marketstack/README.md +2 -2
- package/connectors/marketstack/package.json +1 -1
- package/connectors/matrix/README.md +1 -1
- package/connectors/matrix/package.json +1 -1
- package/connectors/mattermost/README.md +1 -1
- package/connectors/mattermost/package.json +1 -1
- package/connectors/mautic/README.md +1 -1
- package/connectors/mautic/package.json +1 -1
- package/connectors/mav/README.md +1 -1
- package/connectors/mav/package.json +1 -1
- package/connectors/maverick/README.md +1 -1
- package/connectors/maverick/package.json +1 -1
- package/connectors/mem/README.md +1 -1
- package/connectors/mem/package.json +1 -1
- package/connectors/messagebird/package.json +1 -1
- package/connectors/metabase/README.md +1 -1
- package/connectors/metabase/package.json +1 -1
- package/connectors/miro/package.json +1 -1
- package/connectors/mocean/package.json +1 -1
- package/connectors/modal/package.json +1 -1
- package/connectors/monday/package.json +1 -1
- package/connectors/monicacrm/package.json +1 -1
- package/connectors/moonclerk/package.json +1 -1
- package/connectors/moonmail/package.json +1 -1
- package/connectors/morph/package.json +1 -1
- package/connectors/mqtt/package.json +1 -1
- package/connectors/msg91/package.json +1 -1
- package/connectors/mubert/package.json +1 -1
- package/connectors/murf/package.json +1 -1
- package/connectors/mux/package.json +1 -1
- package/connectors/netlify/package.json +1 -1
- package/connectors/okta/package.json +1 -1
- package/connectors/paddle/package.json +1 -1
- package/connectors/perplexity/package.json +1 -1
- package/connectors/pinterest/package.json +1 -1
- package/connectors/pipedrive/package.json +1 -1
- package/connectors/plaid/package.json +1 -1
- package/connectors/quickchart/README.md +2 -2
- package/connectors/quintadb/README.md +2 -2
- package/connectors/rabbitmq/README.md +2 -2
- package/connectors/radar/README.md +2 -2
- package/connectors/raindrop/README.md +2 -2
- package/connectors/rapid7insightvm/README.md +2 -2
- package/connectors/raventools/README.md +2 -2
- package/connectors/rawgvideogamesdatabase/README.md +2 -2
- package/connectors/rdstationcrm/README.md +2 -2
- package/connectors/readai/README.md +2 -2
- package/connectors/roboflow/package.json +1 -1
- package/connectors/runway/package.json +1 -1
- package/connectors/sendgrid/package.json +1 -1
- package/connectors/shuffler/package.json +1 -1
- package/connectors/sierrainteractive/package.json +1 -1
- package/connectors/sifter/package.json +1 -1
- package/connectors/signaturit/package.json +1 -1
- package/connectors/signl4/package.json +1 -1
- package/connectors/simpleem/package.json +1 -1
- package/connectors/simplehash/package.json +1 -1
- package/connectors/simplekpi/package.json +1 -1
- package/connectors/simplelocalize/package.json +1 -1
- package/connectors/simplero/package.json +1 -1
- package/connectors/smartrecruiters/package.json +1 -1
- package/connectors/smtp2go/package.json +1 -1
- package/connectors/snowflake/package.json +1 -1
- package/connectors/sparkpost/package.json +1 -1
- package/connectors/split-in-batches/CLAUDE.md +1 -1
- package/connectors/split-in-batches/README.md +1 -1
- package/connectors/split-in-batches/src/api/client.test.ts +16 -17
- package/connectors/split-in-batches/src/api/client.ts +4 -3
- package/connectors/split-in-batches/src/cli/index.ts +1 -1
- package/connectors/split-io/package.json +1 -1
- package/connectors/split-io/src/api/client.test.ts +20 -0
- package/connectors/split-io/src/cli/index.ts +9 -9
- package/connectors/spreadsheet-file/.env.example +1 -1
- package/connectors/spreadsheet-file/CLAUDE.md +2 -2
- package/connectors/spreadsheet-file/README.md +3 -3
- package/connectors/spreadsheet-file/src/api/client.test.ts +8 -9
- package/connectors/spreadsheet-file/src/api/client.ts +4 -3
- package/connectors/spreadsheet-file/src/cli/index.ts +1 -1
- package/connectors/sprinklr/package.json +1 -1
- package/connectors/sprout-social/package.json +1 -1
- package/connectors/square/package.json +1 -1
- package/connectors/sse-trigger/.env.example +1 -1
- package/connectors/sse-trigger/CLAUDE.md +2 -2
- package/connectors/sse-trigger/README.md +1 -1
- package/connectors/sse-trigger/package.json +1 -1
- package/connectors/sse-trigger/src/api/client.test.ts +12 -8
- package/connectors/sse-trigger/src/api/client.ts +4 -3
- package/connectors/sse-trigger/src/api/index.ts +1 -1
- package/connectors/sse-trigger/src/cli/index.ts +1 -1
- package/connectors/sse-trigger/src/index.ts +1 -1
- package/connectors/stability-api-platform/AGENTS.md +2 -2
- package/connectors/stability-api-platform/CLAUDE.md +1 -1
- package/connectors/stability-api-platform/README.md +2 -2
- package/connectors/stability-api-platform/src/api/client.test.ts +17 -12
- package/connectors/stability-api-platform/src/api/client.ts +4 -3
- package/connectors/stability-api-platform/src/api/index.ts +0 -1
- package/connectors/stability-api-platform/src/cli/index.ts +1 -1
- package/connectors/stability-api-platform/src/index.ts +0 -1
- package/connectors/standout/package.json +1 -1
- package/connectors/statuspage/package.json +1 -1
- package/connectors/stop-and-error/.env.example +1 -1
- package/connectors/stop-and-error/CLAUDE.md +1 -1
- package/connectors/stop-and-error/README.md +1 -1
- package/connectors/stop-and-error/src/api/client.test.ts +12 -8
- package/connectors/stop-and-error/src/api/client.ts +4 -3
- package/connectors/stop-and-error/src/cli/index.ts +2 -2
- package/connectors/stoplight/package.json +1 -1
- package/connectors/stoplight-api-platform/package.json +1 -1
- package/connectors/strand-ai/CLAUDE.md +1 -1
- package/connectors/stripe-financial-connections/.env.example +1 -1
- package/connectors/stripe-financial-connections/CLAUDE.md +2 -2
- package/connectors/stripe-financial-connections/package.json +1 -1
- package/connectors/stripe-financial-connections/src/api/client.test.ts +34 -0
- package/connectors/stripe-financial-connections/src/api/client.ts +4 -3
- package/connectors/stripe-financial-connections/src/cli/index.ts +1 -1
- package/connectors/stripe-terminal/package.json +1 -1
- package/connectors/stytch/package.json +1 -1
- package/connectors/sucuri-api-platform/.env.example +1 -1
- package/connectors/sucuri-api-platform/CLAUDE.md +1 -1
- package/connectors/sucuri-api-platform/README.md +2 -2
- package/connectors/sucuri-api-platform/src/api/client.test.ts +9 -7
- package/connectors/sucuri-api-platform/src/api/client.ts +4 -3
- package/connectors/sucuri-api-platform/src/api/index.ts +1 -1
- package/connectors/sucuri-api-platform/src/cli/index.ts +1 -1
- package/connectors/sucuri-api-platform/src/index.ts +1 -1
- package/connectors/sumo-logic/package.json +1 -1
- package/connectors/supabase/package.json +1 -1
- package/connectors/supabase-api-platform/package.json +1 -1
- package/connectors/sysdig/package.json +1 -1
- package/connectors/tableau/package.json +1 -1
- package/connectors/takecareos/README.md +2 -2
- package/connectors/takecareos/package.json +1 -1
- package/connectors/telegram/src/api/bot.ts +20 -0
- package/connectors/telegram/src/api/client.ts +32 -0
- package/connectors/telegram/src/api/files.test.ts +103 -0
- package/connectors/telegram/src/api/index.ts +1 -0
- package/connectors/telegram/src/api/messages.test.ts +8 -2
- package/connectors/telegram/src/cli/files.test.ts +40 -0
- package/connectors/telegram/src/cli/files.ts +38 -0
- package/connectors/telegram/src/cli/index.ts +27 -30
- package/connectors/telegram/src/cli/updates.test.ts +176 -0
- package/connectors/telegram/src/cli/updates.ts +95 -0
- package/connectors/telegram/src/index.ts +1 -0
- package/connectors/telegram/src/types/index.ts +13 -0
- package/connectors/terraform-cloud/package.json +1 -1
- package/connectors/tettra-api-platform/CLAUDE.md +1 -1
- package/connectors/tettra-api-platform/README.md +2 -2
- package/connectors/tettra-api-platform/src/api/client.test.ts +7 -8
- package/connectors/tettra-api-platform/src/api/client.ts +4 -3
- package/connectors/tettra-api-platform/src/api/index.ts +1 -1
- package/connectors/tettra-api-platform/src/cli/index.ts +1 -1
- package/connectors/tettra-api-platform/src/index.ts +1 -1
- package/connectors/textit/package.json +1 -1
- package/connectors/thousandeyes/package.json +1 -1
- package/connectors/ticket-tailor/package.json +1 -1
- package/connectors/ticketsource/package.json +1 -1
- package/connectors/tiktokads/README.md +1 -1
- package/connectors/time-saved/package.json +1 -1
- package/connectors/tipalti/package.json +1 -1
- package/connectors/together-api-platform/.env.example +1 -1
- package/connectors/together-api-platform/CLAUDE.md +1 -1
- package/connectors/together-api-platform/README.md +1 -1
- package/connectors/together-api-platform/src/api/client.test.ts +11 -7
- package/connectors/together-api-platform/src/api/client.ts +4 -4
- package/connectors/together-api-platform/src/api/index.ts +1 -1
- package/connectors/together-api-platform/src/cli/index.ts +1 -1
- package/connectors/together-api-platform/src/index.ts +1 -1
- package/connectors/tomtom/AGENTS.md +1 -1
- package/connectors/totp/package.json +1 -1
- package/connectors/traverse/package.json +1 -1
- package/connectors/travo-ai/package.json +1 -1
- package/connectors/travo-real-estate/CLAUDE.md +1 -1
- package/connectors/travo-real-estate/README.md +1 -1
- package/connectors/travo-real-estate/src/api/client.test.ts +20 -16
- package/connectors/travo-real-estate/src/api/client.ts +4 -3
- package/connectors/travo-real-estate/src/utils/config.ts +2 -4
- package/connectors/tray-api-platform/CLAUDE.md +1 -1
- package/connectors/tray-api-platform/src/api/client.test.ts +17 -13
- package/connectors/tray-api-platform/src/api/client.ts +4 -3
- package/connectors/tray-api-platform/src/api/index.ts +1 -1
- package/connectors/tray-api-platform/src/cli/index.ts +1 -1
- package/connectors/tray-api-platform/src/index.ts +0 -1
- package/connectors/trigger-dev/package.json +1 -1
- package/connectors/trigger-dev-api-platform/package.json +1 -1
- package/connectors/turbot-pipes/package.json +1 -1
- package/connectors/turso/package.json +1 -1
- package/connectors/turso-api-platform/CLAUDE.md +1 -1
- package/connectors/turso-api-platform/README.md +2 -2
- package/connectors/turso-api-platform/package.json +1 -1
- package/connectors/turso-api-platform/src/api/client.test.ts +17 -13
- package/connectors/turso-api-platform/src/api/client.ts +4 -3
- package/connectors/turso-api-platform/src/cli/index.ts +2 -2
- package/connectors/twilio-api-platform/CLAUDE.md +1 -1
- package/connectors/twilio-api-platform/src/api/client.test.ts +11 -11
- package/connectors/twilio-api-platform/src/api/client.ts +4 -3
- package/connectors/twilio-api-platform/src/api/index.ts +1 -1
- package/connectors/twilio-api-platform/src/cli/index.ts +1 -1
- package/connectors/twilio-api-platform/src/index.ts +1 -1
- package/connectors/tyk-api-platform/.env.example +1 -1
- package/connectors/tyk-api-platform/CLAUDE.md +2 -2
- package/connectors/tyk-api-platform/README.md +1 -1
- package/connectors/tyk-api-platform/package.json +1 -1
- package/connectors/tyk-api-platform/src/api/client.test.ts +14 -15
- package/connectors/tyk-api-platform/src/api/client.ts +4 -3
- package/connectors/tyk-api-platform/src/api/index.ts +1 -1
- package/connectors/tyk-api-platform/src/cli/index.ts +1 -1
- package/connectors/tyk-api-platform/src/index.ts +1 -1
- package/connectors/umami/package.json +1 -1
- package/connectors/unifold/package.json +1 -1
- package/connectors/unione/package.json +1 -1
- package/connectors/uniprot/README.md +1 -1
- package/connectors/uniswap-api/package.json +1 -1
- package/connectors/ups/package.json +1 -1
- package/connectors/usereframe/package.json +1 -1
- package/connectors/vanta/package.json +1 -1
- package/connectors/vector-legal/.env.example +1 -1
- package/connectors/vector-legal/AGENTS.md +1 -1
- package/connectors/vector-legal/CLAUDE.md +1 -1
- package/connectors/vector-legal/README.md +1 -1
- package/connectors/vector-legal/src/api/client.test.ts +9 -5
- package/connectors/vector-legal/src/api/client.ts +4 -3
- package/connectors/vector-legal/src/api/index.ts +1 -1
- package/connectors/vector-legal/src/cli/index.ts +2 -2
- package/connectors/vector-legal/src/index.ts +0 -1
- package/connectors/vector-legal-api/CLAUDE.md +1 -1
- package/connectors/vector-legal-api/README.md +2 -2
- package/connectors/vector-legal-api/src/api/client.test.ts +12 -7
- package/connectors/vector-legal-api/src/api/client.ts +4 -3
- package/connectors/vector-legal-api/src/api/index.ts +1 -1
- package/connectors/vector-legal-api/src/cli/index.ts +1 -1
- package/connectors/vector-legal-api/src/index.ts +1 -2
- package/connectors/vela/package.json +1 -1
- package/connectors/velum-data-quality/.env.example +1 -1
- package/connectors/velum-data-quality/CLAUDE.md +1 -1
- package/connectors/velum-data-quality/src/api/client.test.ts +15 -16
- package/connectors/velum-data-quality/src/api/client.ts +4 -3
- package/connectors/velum-data-quality/src/api/index.ts +1 -1
- package/connectors/velum-data-quality/src/cli/index.ts +1 -1
- package/connectors/velum-data-quality/src/index.ts +0 -1
- package/connectors/velum-labs/package.json +1 -1
- package/connectors/vercel/package.json +1 -1
- package/connectors/vercel-api-platform/.env.example +1 -1
- package/connectors/vercel-api-platform/CLAUDE.md +2 -2
- package/connectors/vercel-api-platform/README.md +2 -2
- package/connectors/vercel-api-platform/src/api/client.test.ts +27 -6
- package/connectors/vercel-api-platform/src/api/client.ts +4 -3
- package/connectors/vercel-api-platform/src/api/index.ts +1 -1
- package/connectors/vercel-api-platform/src/cli/index.ts +2 -2
- package/connectors/vercel-api-platform/src/index.ts +0 -1
- package/connectors/vercel-blob/package.json +1 -1
- package/connectors/vercel-blob-platform/package.json +1 -1
- package/connectors/vercel-edge-config/package.json +1 -1
- package/connectors/vercel-edge-config-platform/package.json +1 -1
- package/connectors/veriphone/README.md +2 -2
- package/connectors/vertex-ai/package.json +1 -1
- package/connectors/vidyard/package.json +1 -1
- package/connectors/vonage/package.json +1 -1
- package/connectors/voygr/package.json +1 -1
- package/connectors/wait/package.json +1 -1
- package/connectors/walmart-marketplace/package.json +1 -1
- package/connectors/wato/package.json +1 -1
- package/connectors/wave-accounting/CLAUDE.md +1 -1
- package/connectors/wave-accounting/package.json +1 -1
- package/connectors/wave-accounting/src/utils/auth.ts +1 -1
- package/connectors/wayco/package.json +1 -1
- package/connectors/weaviate-api-platform/CLAUDE.md +1 -1
- package/connectors/weaviate-api-platform/src/api/client.test.ts +32 -7
- package/connectors/weaviate-api-platform/src/api/client.ts +4 -3
- package/connectors/weaviate-api-platform/src/api/index.ts +1 -1
- package/connectors/weaviate-api-platform/src/cli/index.ts +1 -1
- package/connectors/weaviate-api-platform/src/index.ts +1 -1
- package/connectors/webpagetest/package.json +1 -1
- package/connectors/weezevent/package.json +1 -1
- package/connectors/wikipedia/src/api/client.ts +1 -1
- package/connectors/wildcard/package.json +1 -1
- package/connectors/windmill/package.json +1 -1
- package/connectors/wise/package.json +1 -1
- package/connectors/withai/package.json +1 -1
- package/connectors/wiz/CLAUDE.md +1 -1
- package/connectors/wiz/package.json +1 -1
- package/connectors/wordfence/package.json +1 -1
- package/connectors/wordfence-api-platform/package.json +1 -1
- package/connectors/workflow-trigger/.env.example +1 -1
- package/connectors/workflow-trigger/CLAUDE.md +1 -1
- package/connectors/workflow-trigger/README.md +1 -1
- package/connectors/workflow-trigger/src/api/client.test.ts +10 -6
- package/connectors/workflow-trigger/src/api/client.ts +4 -3
- package/connectors/workflow-trigger/src/cli/index.ts +1 -1
- package/connectors/workos/package.json +1 -1
- package/connectors/write-binary-file/CLAUDE.md +1 -1
- package/connectors/write-binary-file/README.md +1 -1
- package/connectors/write-binary-file/package.json +1 -1
- package/connectors/write-binary-file/src/api/client.test.ts +16 -12
- package/connectors/write-binary-file/src/api/client.ts +4 -3
- package/connectors/write-binary-file/src/api/index.ts +1 -1
- package/connectors/write-binary-file/src/index.ts +1 -1
- package/connectors/wubookratechecker/src/api/client.test.ts +34 -0
- package/connectors/wubookratechecker/src/api/client.ts +3 -1
- package/connectors/wubookratechecker/src/api/index.ts +1 -1
- package/connectors/wubookratechecker/src/types/index.ts +1 -1
- package/connectors/xai/.env.example +1 -1
- package/connectors/xai-api-platform/.env.example +1 -1
- package/connectors/xai-api-platform/CLAUDE.md +1 -1
- package/connectors/xai-api-platform/README.md +1 -1
- package/connectors/xai-api-platform/src/api/client.test.ts +34 -9
- package/connectors/xai-api-platform/src/api/client.ts +4 -3
- package/connectors/xai-api-platform/src/api/index.ts +1 -1
- package/connectors/xai-api-platform/src/cli/index.ts +1 -1
- package/connectors/xai-api-platform/src/index.ts +1 -1
- package/connectors/xai-api-platform/src/utils/config.ts +3 -4
- package/connectors/xai-grok/.env.example +1 -1
- package/connectors/xai-grok/src/api/client.test.ts +3 -3
- package/connectors/xai-grok/src/cli/index.ts +1 -1
- package/connectors/xai-grok/src/utils/config.ts +1 -1
- package/connectors/ynab/package.json +1 -1
- package/connectors/you-com/README.md +2 -2
- package/connectors/you-com/package.json +1 -1
- package/connectors/yousign/package.json +1 -1
- package/connectors/zapier-api-platform/CLAUDE.md +1 -1
- package/connectors/zapier-api-platform/README.md +1 -1
- package/connectors/zapier-api-platform/src/api/client.test.ts +19 -14
- package/connectors/zapier-api-platform/src/api/client.ts +4 -3
- package/connectors/zapier-api-platform/src/api/index.ts +1 -1
- package/connectors/zapier-api-platform/src/cli/index.ts +1 -1
- package/connectors/zapier-api-platform/src/index.ts +1 -1
- package/connectors/zendesk/.env.example +4 -4
- package/connectors/zendesk/CLAUDE.md +1 -3
- package/connectors/zendesk/Makefile +18 -5
- package/connectors/zendesk/README.md +3 -8
- package/connectors/zendesk/SCAFFOLD.md +6 -5
- package/connectors/zerosettle/package.json +1 -1
- package/connectors/zoho-bigin/CLAUDE.md +1 -1
- package/connectors/zoho-campaigns/package.json +1 -1
- package/connectors/zoho-sign/package.json +1 -1
- package/connectors/zoho-subscriptions/CLAUDE.md +1 -1
- package/connectors/zohoprojects/CLAUDE.md +1 -1
- package/connectors/zolvo/package.json +1 -1
- package/connectors/zoom-api/package.json +1 -1
- package/connectors/zymbly/README.md +2 -2
- package/connectors/zymbly/package.json +1 -1
- package/dashboard/dist/assets/index-8uoGZF7B.js +280 -0
- package/dashboard/dist/index.html +1 -1
- package/dist/db/locks.d.ts +1 -1
- package/dist/index.js +17 -15
- package/dist/lib/connector-resolver.d.ts +1 -1
- package/dist/lib/llm.d.ts +1 -1
- package/dist/lib/open-browser.d.ts +18 -0
- package/dist/lib/open-browser.test.d.ts +1 -0
- package/package.json +6 -4
- package/dashboard/dist/assets/index-DlEljRrW.js +0 -285
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { describe, test, expect, mock, beforeEach, afterEach } from 'bun:test';
|
|
2
|
-
import { TursoApiPlatformClient
|
|
2
|
+
import { TursoApiPlatformClient } from './client';
|
|
3
3
|
import { TursoApiPlatform } from './index';
|
|
4
4
|
import { TursoApiPlatformApiError } from '../types';
|
|
5
5
|
|
|
6
6
|
describe('TursoApiPlatformClient', () => {
|
|
7
7
|
test('requires apiKey', () => {
|
|
8
|
-
expect(() => new TursoApiPlatformClient({ apiKey: '' })).toThrow('API key is required');
|
|
8
|
+
expect(() => new TursoApiPlatformClient({ apiKey: '', baseUrl: 'https://configured.example.com/v1' })).toThrow('API key is required');
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
test('builds canonical items URL', () => {
|
|
12
|
-
const client = new TursoApiPlatformClient({ apiKey: 'test-key' });
|
|
13
|
-
expect(client.buildUrl('/items')).toBe(
|
|
12
|
+
const client = new TursoApiPlatformClient({ apiKey: 'test-key', baseUrl: 'https://configured.example.com/v1' });
|
|
13
|
+
expect(client.buildUrl('/items')).toBe(`https://configured.example.com/v1/items`);
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
test('builds canonical item-by-id URL', () => {
|
|
17
|
-
const client = new TursoApiPlatformClient({ apiKey: 'test-key' });
|
|
18
|
-
expect(client.buildUrl('/items/item-123')).toBe(
|
|
17
|
+
const client = new TursoApiPlatformClient({ apiKey: 'test-key', baseUrl: 'https://configured.example.com/v1' });
|
|
18
|
+
expect(client.buildUrl('/items/item-123')).toBe(`https://configured.example.com/v1/items/item-123`);
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
test('respects custom base URL', () => {
|
|
@@ -27,7 +27,7 @@ describe('TursoApiPlatformClient', () => {
|
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
test('getApiKeyPreview masks key', () => {
|
|
30
|
-
const client = new TursoApiPlatformClient({ apiKey: 'abcdef1234567890' });
|
|
30
|
+
const client = new TursoApiPlatformClient({ apiKey: 'abcdef1234567890', baseUrl: 'https://configured.example.com/v1' });
|
|
31
31
|
expect(client.getApiKeyPreview()).toBe('abcdef...7890');
|
|
32
32
|
});
|
|
33
33
|
});
|
|
@@ -44,7 +44,7 @@ describe('TursoApiPlatformClient request', () => {
|
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
test('sends Bearer authorization header on list items', async () => {
|
|
47
|
-
const client = new TursoApiPlatformClient({ apiKey: 'secret-api-key' });
|
|
47
|
+
const client = new TursoApiPlatformClient({ apiKey: 'secret-api-key', baseUrl: 'https://configured.example.com/v1' });
|
|
48
48
|
let capturedUrl = '';
|
|
49
49
|
let capturedHeaders: Headers | undefined;
|
|
50
50
|
|
|
@@ -60,13 +60,13 @@ describe('TursoApiPlatformClient request', () => {
|
|
|
60
60
|
}) as unknown as typeof fetch;
|
|
61
61
|
|
|
62
62
|
const result = await client.get('/items');
|
|
63
|
-
expect(capturedUrl).toBe(
|
|
63
|
+
expect(capturedUrl).toBe(`https://configured.example.com/v1/items`);
|
|
64
64
|
expect(capturedHeaders?.get('Authorization')).toBe('Bearer secret-api-key');
|
|
65
65
|
expect(result).toEqual([{ id: '1', name: 'alpha' }]);
|
|
66
66
|
});
|
|
67
67
|
|
|
68
68
|
test('sends Bearer authorization header on get item', async () => {
|
|
69
|
-
const client = new TursoApiPlatformClient({ apiKey: 'secret-api-key' });
|
|
69
|
+
const client = new TursoApiPlatformClient({ apiKey: 'secret-api-key', baseUrl: 'https://configured.example.com/v1' });
|
|
70
70
|
let capturedUrl = '';
|
|
71
71
|
let capturedHeaders: Headers | undefined;
|
|
72
72
|
|
|
@@ -81,16 +81,16 @@ describe('TursoApiPlatformClient request', () => {
|
|
|
81
81
|
);
|
|
82
82
|
}) as unknown as typeof fetch;
|
|
83
83
|
|
|
84
|
-
const api = new TursoApiPlatform({ apiKey: 'secret-api-key' });
|
|
84
|
+
const api = new TursoApiPlatform({ apiKey: 'secret-api-key', baseUrl: 'https://configured.example.com/v1' });
|
|
85
85
|
const result = await api.getItem('item-42');
|
|
86
86
|
|
|
87
|
-
expect(capturedUrl).toBe(
|
|
87
|
+
expect(capturedUrl).toBe(`https://configured.example.com/v1/items/item-42`);
|
|
88
88
|
expect(capturedHeaders?.get('Authorization')).toBe('Bearer secret-api-key');
|
|
89
89
|
expect(result).toEqual({ id: 'item-42', name: 'beta' });
|
|
90
90
|
});
|
|
91
91
|
|
|
92
92
|
test('throws TursoApiPlatformApiError on HTTP error', async () => {
|
|
93
|
-
const client = new TursoApiPlatformClient({ apiKey: 'secret-api-key' });
|
|
93
|
+
const client = new TursoApiPlatformClient({ apiKey: 'secret-api-key', baseUrl: 'https://configured.example.com/v1' });
|
|
94
94
|
|
|
95
95
|
globalThis.fetch = mock(() =>
|
|
96
96
|
Promise.resolve(
|
|
@@ -103,4 +103,8 @@ describe('TursoApiPlatformClient request', () => {
|
|
|
103
103
|
|
|
104
104
|
await expect(client.get('/items')).rejects.toThrow(TursoApiPlatformApiError);
|
|
105
105
|
});
|
|
106
|
+
|
|
107
|
+
test('refuses to send without a configured base URL (no default endpoint)', () => {
|
|
108
|
+
expect(() => new TursoApiPlatformClient({ apiKey: 'test-key' })).toThrow(/baseUrl/);
|
|
109
|
+
});
|
|
106
110
|
});
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { TursoApiPlatformConfig, TursoApiPlatformErrorResponse } from '../types';
|
|
2
2
|
import { TursoApiPlatformApiError } from '../types';
|
|
3
3
|
|
|
4
|
-
export const DEFAULT_BASE_URL = 'https://api.tursoapiplatform.com/v1';
|
|
5
|
-
|
|
6
4
|
export interface RequestOptions {
|
|
7
5
|
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
8
6
|
params?: Record<string, string | number | boolean | undefined>;
|
|
@@ -19,7 +17,10 @@ export class TursoApiPlatformClient {
|
|
|
19
17
|
throw new Error('API key is required');
|
|
20
18
|
}
|
|
21
19
|
this.apiKey = config.apiKey;
|
|
22
|
-
|
|
20
|
+
if (!config.baseUrl) {
|
|
21
|
+
throw new Error('baseUrl is required: no default endpoint is configured; set baseUrl (profile, config, or the connector BASE_URL environment variable)');
|
|
22
|
+
}
|
|
23
|
+
this.baseUrl = config.baseUrl.replace(/\/$/, '');
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
buildUrl(path: string, params?: Record<string, string | number | boolean | undefined>): string {
|
|
@@ -55,7 +55,7 @@ authCmd
|
|
|
55
55
|
authCmd
|
|
56
56
|
.command('set-base-url')
|
|
57
57
|
.description('Set custom API base URL')
|
|
58
|
-
.argument('<url>', 'Base URL (e.g. https://
|
|
58
|
+
.argument('<url>', 'Base URL (e.g. https://configured.example.com/v1)')
|
|
59
59
|
.action((url: string) => {
|
|
60
60
|
setBaseUrl(url);
|
|
61
61
|
console.log(chalk.green(`Base URL saved to profile "${getCurrentProfile()}"`));
|
|
@@ -76,7 +76,7 @@ authCmd
|
|
|
76
76
|
|
|
77
77
|
console.log(chalk.bold('Configuration:'));
|
|
78
78
|
console.log(` Profile: ${chalk.cyan(getCurrentProfile())}`);
|
|
79
|
-
console.log(` Base URL: ${chalk.white(baseUrl || '
|
|
79
|
+
console.log(` Base URL: ${chalk.white(baseUrl || 'none configured')}`);
|
|
80
80
|
console.log(` API Key: ${chalk.green('Set')}`);
|
|
81
81
|
|
|
82
82
|
try {
|
|
@@ -4,7 +4,7 @@ Guidance for working with the Twilio Api Platform connector.
|
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
|
-
`connect-twilio-api-platform` is a TypeScript CLI and library for the Twilio Api Platform REST API (`
|
|
7
|
+
`connect-twilio-api-platform` is a TypeScript CLI and library for the Twilio Api Platform REST API (`configured.example.com/v1`). This is distinct from `connect-twilio` (classic Twilio SMS/voice at `api.twilio.com`).
|
|
8
8
|
|
|
9
9
|
## Commands
|
|
10
10
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { afterEach, describe, expect, mock, test } from 'bun:test';
|
|
2
|
-
import { TwilioApiPlatform, TwilioApiPlatformClient
|
|
2
|
+
import { TwilioApiPlatform, TwilioApiPlatformClient } from './index';
|
|
3
3
|
import { TwilioApiPlatformApiError } from '../types';
|
|
4
4
|
|
|
5
5
|
const realFetch = globalThis.fetch;
|
|
@@ -26,29 +26,29 @@ afterEach(() => {
|
|
|
26
26
|
|
|
27
27
|
describe('TwilioApiPlatformClient', () => {
|
|
28
28
|
test('requires api key', () => {
|
|
29
|
-
expect(() => new TwilioApiPlatformClient({ apiKey: '' })).toThrow('API key is required');
|
|
29
|
+
expect(() => new TwilioApiPlatformClient({ apiKey: '', baseUrl: 'https://configured.example.com/v1' })).toThrow('API key is required');
|
|
30
30
|
});
|
|
31
31
|
|
|
32
|
-
test('
|
|
33
|
-
expect(
|
|
32
|
+
test('refuses to send without a configured base URL (no default endpoint)', () => {
|
|
33
|
+
expect(() => new TwilioApiPlatformClient({ apiKey: 'test-key' })).toThrow(/baseUrl/);
|
|
34
34
|
});
|
|
35
35
|
|
|
36
36
|
test('listItems sends Bearer auth to /items', async () => {
|
|
37
37
|
const captured = installFetch();
|
|
38
|
-
const client = new TwilioApiPlatformClient({ apiKey: 'twilio-api-platform-key' });
|
|
38
|
+
const client = new TwilioApiPlatformClient({ apiKey: 'twilio-api-platform-key', baseUrl: 'https://configured.example.com/v1' });
|
|
39
39
|
await client.get('/items');
|
|
40
40
|
|
|
41
41
|
expect(captured).toHaveLength(1);
|
|
42
|
-
expect(captured[0].url).toBe('https://
|
|
42
|
+
expect(captured[0].url).toBe('https://configured.example.com/v1/items');
|
|
43
43
|
expect(new Headers(captured[0].init?.headers).get('Authorization')).toBe('Bearer twilio-api-platform-key');
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
test('getItem encodes item id in path', async () => {
|
|
47
47
|
const captured = installFetch();
|
|
48
|
-
const api = new TwilioApiPlatform({ apiKey: 'twilio-api-platform-key' });
|
|
48
|
+
const api = new TwilioApiPlatform({ apiKey: 'twilio-api-platform-key', baseUrl: 'https://configured.example.com/v1' });
|
|
49
49
|
await api.getItem('item-1');
|
|
50
50
|
|
|
51
|
-
expect(captured[0].url).toBe('https://
|
|
51
|
+
expect(captured[0].url).toBe('https://configured.example.com/v1/items/item-1');
|
|
52
52
|
expect(new Headers(captured[0].init?.headers).get('Authorization')).toBe('Bearer twilio-api-platform-key');
|
|
53
53
|
});
|
|
54
54
|
|
|
@@ -65,11 +65,11 @@ describe('TwilioApiPlatformClient', () => {
|
|
|
65
65
|
|
|
66
66
|
test('search posts JSON body to /search', async () => {
|
|
67
67
|
const captured = installFetch();
|
|
68
|
-
const api = new TwilioApiPlatform({ apiKey: 'key' });
|
|
68
|
+
const api = new TwilioApiPlatform({ apiKey: 'key', baseUrl: 'https://configured.example.com/v1' });
|
|
69
69
|
await api.search({ q: 'hello' });
|
|
70
70
|
|
|
71
71
|
const request = captured[0];
|
|
72
|
-
expect(request.url).toBe('https://
|
|
72
|
+
expect(request.url).toBe('https://configured.example.com/v1/search');
|
|
73
73
|
expect(request.init?.method).toBe('POST');
|
|
74
74
|
expect(request.init?.body).toBe(JSON.stringify({ q: 'hello' }));
|
|
75
75
|
});
|
|
@@ -79,7 +79,7 @@ describe('TwilioApiPlatformClient', () => {
|
|
|
79
79
|
Response.json({ message: 'Unauthorized' }, { status: 401 }),
|
|
80
80
|
) as unknown as typeof fetch;
|
|
81
81
|
|
|
82
|
-
const client = new TwilioApiPlatformClient({ apiKey: 'bad-key' });
|
|
82
|
+
const client = new TwilioApiPlatformClient({ apiKey: 'bad-key', baseUrl: 'https://configured.example.com/v1' });
|
|
83
83
|
await expect(client.get('/items')).rejects.toThrow(TwilioApiPlatformApiError);
|
|
84
84
|
});
|
|
85
85
|
});
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { TwilioApiPlatformConfig } from '../types';
|
|
2
2
|
import { parseApiError } from '../types';
|
|
3
3
|
|
|
4
|
-
export const DEFAULT_BASE_URL = 'https://api.twilioapiplatform.com/v1';
|
|
5
|
-
|
|
6
4
|
export interface RequestOptions {
|
|
7
5
|
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
8
6
|
params?: Record<string, string | number | boolean | undefined>;
|
|
@@ -19,7 +17,10 @@ export class TwilioApiPlatformClient {
|
|
|
19
17
|
throw new Error('API key is required');
|
|
20
18
|
}
|
|
21
19
|
this.apiKey = config.apiKey;
|
|
22
|
-
|
|
20
|
+
if (!config.baseUrl) {
|
|
21
|
+
throw new Error('baseUrl is required: no default endpoint is configured; set baseUrl (profile, config, or the connector BASE_URL environment variable)');
|
|
22
|
+
}
|
|
23
|
+
this.baseUrl = config.baseUrl.replace(/\/$/, '');
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
private buildUrl(path: string, params?: Record<string, string | number | boolean | undefined>): string {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TwilioApiPlatformConfig, TwilioApiPlatformResponse } from '../types';
|
|
2
2
|
import { TwilioApiPlatformClient, type RequestOptions } from './client';
|
|
3
3
|
|
|
4
|
-
export { TwilioApiPlatformClient
|
|
4
|
+
export { TwilioApiPlatformClient } from './client';
|
|
5
5
|
|
|
6
6
|
export class TwilioApiPlatform {
|
|
7
7
|
private readonly client: TwilioApiPlatformClient;
|
|
@@ -202,7 +202,7 @@ configCmd
|
|
|
202
202
|
console.log(chalk.bold(`Active Profile: ${profileName}`));
|
|
203
203
|
info(`Config directory: ${getConfigDir()}`);
|
|
204
204
|
info(`API Key: ${apiKey ? `${apiKey.substring(0, 8)}...` : chalk.gray('not set')}`);
|
|
205
|
-
info(`Base URL: ${baseUrl || '
|
|
205
|
+
info(`Base URL: ${baseUrl || 'none configured'}`);
|
|
206
206
|
});
|
|
207
207
|
|
|
208
208
|
configCmd
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Tyk API Platform credentials
|
|
2
2
|
TYK_API_PLATFORM_API_KEY=your-api-key-here
|
|
3
3
|
|
|
4
|
-
# Optional: override the API base URL (default
|
|
4
|
+
# Optional: override the API base URL (no default - must be configured)
|
|
5
5
|
# TYK_API_PLATFORM_BASE_URL=https://api.tykapiplatform.com/v1
|
|
@@ -53,7 +53,7 @@ connect-tyk-api-platform raw --path /search --method POST --data '{"query":"test
|
|
|
53
53
|
| Variable | Description |
|
|
54
54
|
|----------|-------------|
|
|
55
55
|
| `TYK_API_PLATFORM_API_KEY` | API key (overrides profile config) |
|
|
56
|
-
| `TYK_API_PLATFORM_BASE_URL` | API base URL (default: `
|
|
56
|
+
| `TYK_API_PLATFORM_BASE_URL` | API base URL (default: `configured.example.com/v1`) |
|
|
57
57
|
|
|
58
58
|
## Authentication
|
|
59
59
|
|
|
@@ -73,7 +73,7 @@ Profile JSON structure:
|
|
|
73
73
|
```json
|
|
74
74
|
{
|
|
75
75
|
"apiKey": "your-api-key",
|
|
76
|
-
"baseUrl": "
|
|
76
|
+
"baseUrl": "configured.example.com/v1"
|
|
77
77
|
}
|
|
78
78
|
```
|
|
79
79
|
|
|
@@ -31,7 +31,7 @@ bun run dev search --data '{"query":"gateway"}'
|
|
|
31
31
|
| Variable | Description |
|
|
32
32
|
|----------|-------------|
|
|
33
33
|
| `TYK_API_PLATFORM_API_KEY` | API key |
|
|
34
|
-
| `TYK_API_PLATFORM_BASE_URL` | Optional base URL (default: `
|
|
34
|
+
| `TYK_API_PLATFORM_BASE_URL` | Optional base URL (default: `configured.example.com/v1`) |
|
|
35
35
|
|
|
36
36
|
## Library Usage
|
|
37
37
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect, mock } from 'bun:test';
|
|
2
|
-
import { TykApiPlatformClient
|
|
2
|
+
import { TykApiPlatformClient } from './client';
|
|
3
3
|
import { TykApiPlatform } from './index';
|
|
4
4
|
import { TykApiPlatformApiError } from '../types';
|
|
5
5
|
|
|
@@ -9,12 +9,11 @@ function restoreFetch(original: typeof globalThis.fetch) {
|
|
|
9
9
|
|
|
10
10
|
describe('TykApiPlatformClient', () => {
|
|
11
11
|
it('should require an API key', () => {
|
|
12
|
-
expect(() => new TykApiPlatformClient({ apiKey: '' })).toThrow('API key is required');
|
|
12
|
+
expect(() => new TykApiPlatformClient({ apiKey: '', baseUrl: 'https://configured.example.com/v1' })).toThrow('API key is required');
|
|
13
13
|
});
|
|
14
14
|
|
|
15
|
-
it('
|
|
16
|
-
|
|
17
|
-
expect(client.getBaseUrl()).toBe(DEFAULT_BASE_URL);
|
|
15
|
+
it('refuses to send without a configured base URL (no default endpoint)', () => {
|
|
16
|
+
expect(() => new TykApiPlatformClient({ apiKey: 'test-key' })).toThrow(/baseUrl/);
|
|
18
17
|
});
|
|
19
18
|
|
|
20
19
|
it('should allow base URL override', () => {
|
|
@@ -39,14 +38,14 @@ describe('TykApiPlatformClient', () => {
|
|
|
39
38
|
);
|
|
40
39
|
}) as any;
|
|
41
40
|
|
|
42
|
-
const client = new TykApiPlatformClient({ apiKey: 'my-api-key' });
|
|
41
|
+
const client = new TykApiPlatformClient({ apiKey: 'my-api-key', baseUrl: 'https://configured.example.com/v1' });
|
|
43
42
|
await client.get('/items');
|
|
44
43
|
|
|
45
44
|
expect(capturedHeaders.Authorization).toBe('Bearer my-api-key');
|
|
46
45
|
restoreFetch(originalFetch);
|
|
47
46
|
});
|
|
48
47
|
|
|
49
|
-
it('should request GET /items on
|
|
48
|
+
it('should request GET /items on the configured base URL', async () => {
|
|
50
49
|
const originalFetch = globalThis.fetch;
|
|
51
50
|
let capturedUrl = '';
|
|
52
51
|
|
|
@@ -60,10 +59,10 @@ describe('TykApiPlatformClient', () => {
|
|
|
60
59
|
);
|
|
61
60
|
}) as any;
|
|
62
61
|
|
|
63
|
-
const client = new TykApiPlatformClient({ apiKey: 'key' });
|
|
62
|
+
const client = new TykApiPlatformClient({ apiKey: 'key', baseUrl: 'https://configured.example.com/v1' });
|
|
64
63
|
await client.get('/items');
|
|
65
64
|
|
|
66
|
-
expect(capturedUrl).toBe(
|
|
65
|
+
expect(capturedUrl).toBe(`https://configured.example.com/v1/items`);
|
|
67
66
|
restoreFetch(originalFetch);
|
|
68
67
|
});
|
|
69
68
|
|
|
@@ -81,10 +80,10 @@ describe('TykApiPlatformClient', () => {
|
|
|
81
80
|
);
|
|
82
81
|
}) as any;
|
|
83
82
|
|
|
84
|
-
const api = new TykApiPlatform({ apiKey: 'key' });
|
|
83
|
+
const api = new TykApiPlatform({ apiKey: 'key', baseUrl: 'https://configured.example.com/v1' });
|
|
85
84
|
await api.getItem('a/b');
|
|
86
85
|
|
|
87
|
-
expect(capturedUrl).toBe(
|
|
86
|
+
expect(capturedUrl).toBe(`https://configured.example.com/v1/items/a%2Fb`);
|
|
88
87
|
restoreFetch(originalFetch);
|
|
89
88
|
});
|
|
90
89
|
|
|
@@ -100,7 +99,7 @@ describe('TykApiPlatformClient', () => {
|
|
|
100
99
|
)
|
|
101
100
|
) as any;
|
|
102
101
|
|
|
103
|
-
const client = new TykApiPlatformClient({ apiKey: 'bad-key' });
|
|
102
|
+
const client = new TykApiPlatformClient({ apiKey: 'bad-key', baseUrl: 'https://configured.example.com/v1' });
|
|
104
103
|
|
|
105
104
|
try {
|
|
106
105
|
await client.get('/items');
|
|
@@ -132,10 +131,10 @@ describe('TykApiPlatformClient', () => {
|
|
|
132
131
|
);
|
|
133
132
|
}) as any;
|
|
134
133
|
|
|
135
|
-
const api = new TykApiPlatform({ apiKey: 'key' });
|
|
134
|
+
const api = new TykApiPlatform({ apiKey: 'key', baseUrl: 'https://configured.example.com/v1' });
|
|
136
135
|
await api.search({ query: 'gateway' });
|
|
137
136
|
|
|
138
|
-
expect(capturedUrl).toBe(
|
|
137
|
+
expect(capturedUrl).toBe(`https://configured.example.com/v1/search`);
|
|
139
138
|
expect(capturedMethod).toBe('POST');
|
|
140
139
|
expect(JSON.parse(capturedBody)).toEqual({ query: 'gateway' });
|
|
141
140
|
|
|
@@ -145,7 +144,7 @@ describe('TykApiPlatformClient', () => {
|
|
|
145
144
|
|
|
146
145
|
describe('TykApiPlatform', () => {
|
|
147
146
|
it('should expose underlying client', () => {
|
|
148
|
-
const api = new TykApiPlatform({ apiKey: 'key' });
|
|
147
|
+
const api = new TykApiPlatform({ apiKey: 'key', baseUrl: 'https://configured.example.com/v1' });
|
|
149
148
|
expect(api.getClient()).toBeInstanceOf(TykApiPlatformClient);
|
|
150
149
|
});
|
|
151
150
|
});
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { TykApiPlatformConfig } from '../types';
|
|
2
2
|
import { TykApiPlatformApiError } from '../types';
|
|
3
3
|
|
|
4
|
-
export const DEFAULT_BASE_URL = 'https://api.tykapiplatform.com/v1';
|
|
5
|
-
|
|
6
4
|
export interface RequestOptions {
|
|
7
5
|
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
8
6
|
params?: Record<string, string | number | boolean | undefined>;
|
|
@@ -19,7 +17,10 @@ export class TykApiPlatformClient {
|
|
|
19
17
|
throw new Error('API key is required');
|
|
20
18
|
}
|
|
21
19
|
this.apiKey = config.apiKey;
|
|
22
|
-
|
|
20
|
+
if (!config.baseUrl) {
|
|
21
|
+
throw new Error('baseUrl is required: no default endpoint is configured; set baseUrl (profile, config, or the connector BASE_URL environment variable)');
|
|
22
|
+
}
|
|
23
|
+
this.baseUrl = config.baseUrl.replace(/\/$/, '');
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
getBaseUrl(): string {
|
|
@@ -7,7 +7,7 @@ import type {
|
|
|
7
7
|
RawRequestOptions,
|
|
8
8
|
} from '../types';
|
|
9
9
|
|
|
10
|
-
export { TykApiPlatformClient
|
|
10
|
+
export { TykApiPlatformClient } from './client';
|
|
11
11
|
|
|
12
12
|
export class TykApiPlatform {
|
|
13
13
|
private readonly client: TykApiPlatformClient;
|
|
@@ -180,7 +180,7 @@ configCmd
|
|
|
180
180
|
console.log(chalk.bold(`Active Profile: ${profileName}`));
|
|
181
181
|
info(`Config directory: ${getConfigDir()}`);
|
|
182
182
|
info(`API Key: ${apiKey ? `${apiKey.substring(0, 8)}...` : chalk.gray('not set')}`);
|
|
183
|
-
info(`Base URL: ${baseUrl || chalk.gray('
|
|
183
|
+
info(`Base URL: ${baseUrl || chalk.gray('none configured')}`);
|
|
184
184
|
});
|
|
185
185
|
|
|
186
186
|
configCmd
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Vector Legal API credentials
|
|
2
2
|
VECTOR_LEGAL_API_KEY=your-api-key-here
|
|
3
3
|
|
|
4
|
-
# Optional: custom API base URL (default
|
|
4
|
+
# Optional: custom API base URL (no default - must be configured)
|
|
5
5
|
# VECTOR_LEGAL_BASE_URL=https://api.vector-legal.com/v1
|
|
@@ -10,7 +10,7 @@ Guidance for AI agents working with the Vector Legal connector.
|
|
|
10
10
|
|
|
11
11
|
- **Type**: Bearer API key
|
|
12
12
|
- **Env**: `VECTOR_LEGAL_API_KEY`
|
|
13
|
-
- **Optional**: `VECTOR_LEGAL_BASE_URL` (default
|
|
13
|
+
- **Optional**: `VECTOR_LEGAL_BASE_URL` (no default - must be set)
|
|
14
14
|
|
|
15
15
|
## API Surface
|
|
16
16
|
|
|
@@ -19,7 +19,7 @@ bun run dev -- --help # Show CLI help
|
|
|
19
19
|
|
|
20
20
|
## API Details
|
|
21
21
|
|
|
22
|
-
- **Base URL**:
|
|
22
|
+
- **Base URL**: no default (must be configured) (configurable via `VECTOR_LEGAL_BASE_URL`)
|
|
23
23
|
- **Auth**: Bearer token: `Authorization: Bearer <API_KEY>`
|
|
24
24
|
|
|
25
25
|
## API Resources
|
|
@@ -50,7 +50,7 @@ const docs = await client.documents.list();
|
|
|
50
50
|
| Variable | Description |
|
|
51
51
|
|----------|-------------|
|
|
52
52
|
| `VECTOR_LEGAL_API_KEY` | API key |
|
|
53
|
-
| `VECTOR_LEGAL_BASE_URL` | Optional base URL (default
|
|
53
|
+
| `VECTOR_LEGAL_BASE_URL` | Optional base URL (no default - must be configured) |
|
|
54
54
|
|
|
55
55
|
## License
|
|
56
56
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { afterEach, describe, expect, test } from 'bun:test';
|
|
2
|
-
import { ConnectorClient
|
|
2
|
+
import { ConnectorClient } from './client';
|
|
3
3
|
|
|
4
4
|
const realFetch = globalThis.fetch;
|
|
5
5
|
|
|
@@ -47,22 +47,22 @@ afterEach(() => {
|
|
|
47
47
|
describe('Vector Legal API client', () => {
|
|
48
48
|
test('uses default base URL and Bearer auth for GET /documents', async () => {
|
|
49
49
|
const recorded = installFetch();
|
|
50
|
-
const client = new ConnectorClient({ apiKey: 'vector-legal-key' });
|
|
50
|
+
const client = new ConnectorClient({ apiKey: 'vector-legal-key', baseUrl: 'https://configured.example.com/v1' });
|
|
51
51
|
await client.get('/documents');
|
|
52
52
|
|
|
53
53
|
expect(recorded).toHaveLength(1);
|
|
54
|
-
expect(recorded[0].url).toBe(
|
|
54
|
+
expect(recorded[0].url).toBe(`https://configured.example.com/v1/documents`);
|
|
55
55
|
expect(recorded[0].method).toBe('GET');
|
|
56
56
|
expect(headerValue(recorded[0].headers, 'Authorization')).toBe('Bearer vector-legal-key');
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
test('uses default base URL and Bearer auth for GET /documents/:id', async () => {
|
|
60
60
|
const recorded = installFetch();
|
|
61
|
-
const client = new ConnectorClient({ apiKey: 'vector-legal-key' });
|
|
61
|
+
const client = new ConnectorClient({ apiKey: 'vector-legal-key', baseUrl: 'https://configured.example.com/v1' });
|
|
62
62
|
await client.get('/documents/item-1');
|
|
63
63
|
|
|
64
64
|
expect(recorded).toHaveLength(1);
|
|
65
|
-
expect(recorded[0].url).toBe(
|
|
65
|
+
expect(recorded[0].url).toBe(`https://configured.example.com/v1/documents/item-1`);
|
|
66
66
|
expect(recorded[0].method).toBe('GET');
|
|
67
67
|
expect(headerValue(recorded[0].headers, 'Authorization')).toBe('Bearer vector-legal-key');
|
|
68
68
|
});
|
|
@@ -81,4 +81,8 @@ describe('Vector Legal API client', () => {
|
|
|
81
81
|
test('requires API key', () => {
|
|
82
82
|
expect(() => new ConnectorClient({})).toThrow('API key');
|
|
83
83
|
});
|
|
84
|
+
|
|
85
|
+
test('refuses to send without a configured base URL (no default endpoint)', () => {
|
|
86
|
+
expect(() => new ConnectorClient({ apiKey: 'test-key' })).toThrow(/baseUrl/);
|
|
87
|
+
});
|
|
84
88
|
});
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { ConnectorConfig, OutputFormat } from '../types';
|
|
2
2
|
import { ConnectorApiError, parseApiError } from '../types';
|
|
3
3
|
|
|
4
|
-
export const DEFAULT_BASE_URL = 'https://api.vector-legal.com/v1';
|
|
5
|
-
|
|
6
4
|
export interface RequestOptions {
|
|
7
5
|
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
8
6
|
params?: Record<string, string | number | boolean | undefined>;
|
|
@@ -23,7 +21,10 @@ export class ConnectorClient {
|
|
|
23
21
|
throw new Error('API key, token, or accessToken is required');
|
|
24
22
|
}
|
|
25
23
|
this.apiKey = key;
|
|
26
|
-
|
|
24
|
+
if (!config.baseUrl) {
|
|
25
|
+
throw new Error('baseUrl is required: no default endpoint is configured; set baseUrl (profile, config, or the connector BASE_URL environment variable)');
|
|
26
|
+
}
|
|
27
|
+
this.baseUrl = config.baseUrl;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
private buildUrl(path: string, params?: Record<string, string | number | boolean | undefined>): string {
|
|
@@ -41,7 +41,7 @@ export class Connector {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
export { ConnectorClient
|
|
44
|
+
export { ConnectorClient } from './client';
|
|
45
45
|
export { DocumentsApi } from './documents';
|
|
46
46
|
export { EventsApi } from './events';
|
|
47
47
|
export { SearchApi } from './search';
|