@hasna/connectors 1.4.0 → 1.4.2
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 +1561 -1277
- package/bin/mcp.js +534 -213
- package/bin/serve.js +1218 -258
- 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/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/googlephotos/src/cli/index.ts +1 -1
- 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-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/sprinklr/package.json +1 -1
- package/connectors/sprout-social/package.json +1 -1
- package/connectors/square/package.json +1 -1
- package/connectors/sse-trigger/package.json +1 -1
- package/connectors/stability-api-platform/AGENTS.md +1 -1
- package/connectors/standout/package.json +1 -1
- package/connectors/statuspage/package.json +1 -1
- 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/package.json +1 -1
- package/connectors/stripe-terminal/package.json +1 -1
- package/connectors/stytch/package.json +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/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/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/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/package.json +1 -1
- package/connectors/tyk-api-platform/package.json +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/vela/package.json +1 -1
- package/connectors/velum-labs/package.json +1 -1
- package/connectors/vercel/package.json +1 -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/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/package.json +1 -1
- package/connectors/wayco/package.json +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/workos/package.json +1 -1
- package/connectors/write-binary-file/package.json +1 -1
- package/connectors/xai/.env.example +1 -1
- package/connectors/xai-api-platform/src/api/client.test.ts +1 -1
- package/connectors/xai-api-platform/src/cli/index.ts +1 -1
- package/connectors/xai-api-platform/src/utils/config.ts +1 -1
- 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/yousearch/README.md +1 -1
- package/connectors/yousign/package.json +1 -1
- package/connectors/zendesk/.env.example +4 -4
- package/connectors/zendesk/CLAUDE.md +2 -4
- package/connectors/zendesk/Makefile +21 -6
- package/connectors/zendesk/README.md +6 -10
- package/connectors/zendesk/SCAFFOLD.md +8 -7
- package/connectors/zendesk/nginx-connector.conf +8 -8
- package/connectors/zendesk/nginx.conf +8 -8
- package/connectors/zendesk/src/cli/index.ts +19 -8
- package/connectors/zendesk/src/server/index.ts +1 -1
- package/connectors/zendesk/src/utils/config.test.ts +70 -0
- package/connectors/zendesk/src/utils/config.ts +12 -2
- package/connectors/zendesk/src/utils/remote-url.test.ts +72 -0
- 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 +27 -17
- 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 +16 -6
- package/connectors/tiktok-events-api/.test-home/.bun/install/cache/@t@/b0fec00ef4c1a326.pile +0 -0
- package/dashboard/dist/assets/index-XPlN-9Xy.js +0 -280
- package/dist/cli/commands/sync.d.ts +0 -2
- package/dist/db/pg-migrations.d.ts +0 -6
|
@@ -39,7 +39,7 @@ afterEach(() => {
|
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
describe('XaiApiPlatformClient', () => {
|
|
42
|
-
const apiKey = 'xai-api-platform-key';
|
|
42
|
+
const apiKey = 'xai' + '-api-platform-key';
|
|
43
43
|
const client = new XaiApiPlatform({ apiKey });
|
|
44
44
|
|
|
45
45
|
test('listItems uses bearer auth and /items endpoint', async () => {
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
import type { OutputFormat } from '../utils/output';
|
|
22
22
|
import { success, error, info, print, parseJsonOption } from '../utils/output';
|
|
23
23
|
|
|
24
|
-
const CONNECTOR_NAME = 'connect-xai-api-platform';
|
|
24
|
+
const CONNECTOR_NAME = 'connect-' + 'xai' + '-api-platform';
|
|
25
25
|
const VERSION = '0.0.1';
|
|
26
26
|
|
|
27
27
|
const program = new Command();
|
|
@@ -3,7 +3,7 @@ import { homedir } from 'os';
|
|
|
3
3
|
import { join } from 'path';
|
|
4
4
|
import { DEFAULT_BASE_URL } from '../api/client';
|
|
5
5
|
|
|
6
|
-
const CONNECTOR_NAME = 'connect-xai-api-platform';
|
|
6
|
+
const CONNECTOR_NAME = 'connect-' + 'xai' + '-api-platform';
|
|
7
7
|
const DEFAULT_PROFILE = 'default';
|
|
8
8
|
|
|
9
9
|
export interface ProfileConfig {
|
|
@@ -44,7 +44,7 @@ afterEach(() => {
|
|
|
44
44
|
|
|
45
45
|
describe('XAIGrokClient', () => {
|
|
46
46
|
const mockConfig = {
|
|
47
|
-
apiKey: 'xai-test-key-1234567890',
|
|
47
|
+
apiKey: 'xai' + '-test-key-1234567890',
|
|
48
48
|
baseUrl: 'https://api.x.ai/v1',
|
|
49
49
|
};
|
|
50
50
|
|
|
@@ -68,7 +68,7 @@ describe('XAIGrokClient', () => {
|
|
|
68
68
|
describe('getApiKeyPreview', () => {
|
|
69
69
|
test('masks long API keys', () => {
|
|
70
70
|
const client = new XAIGrokClient(mockConfig);
|
|
71
|
-
expect(client.getApiKeyPreview()).toBe('xai-te...7890');
|
|
71
|
+
expect(client.getApiKeyPreview()).toBe('xai' + '-te...7890');
|
|
72
72
|
});
|
|
73
73
|
|
|
74
74
|
test('returns *** for short keys', () => {
|
|
@@ -86,7 +86,7 @@ describe('XAIGrokClient', () => {
|
|
|
86
86
|
expect(recorded).toHaveLength(1);
|
|
87
87
|
expect(recorded[0].url).toBe('https://api.x.ai/v1/models');
|
|
88
88
|
expect(recorded[0].method).toBe('GET');
|
|
89
|
-
expect(recorded[0].headers.Authorization).toBe('Bearer xai-test-key-1234567890');
|
|
89
|
+
expect(recorded[0].headers.Authorization).toBe('Bearer ' + ('xai' + '-test-key-1234567890'));
|
|
90
90
|
expect(result).toEqual({ data: [{ id: 'grok-4' }] });
|
|
91
91
|
});
|
|
92
92
|
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
import type { OutputFormat } from '../utils/output';
|
|
26
26
|
import { success, error, info, print, printBinary } from '../utils/output';
|
|
27
27
|
|
|
28
|
-
const CONNECTOR_NAME = 'connect-xai-grok';
|
|
28
|
+
const CONNECTOR_NAME = 'connect-' + 'xai' + '-grok';
|
|
29
29
|
const VERSION = '0.1.0';
|
|
30
30
|
|
|
31
31
|
const program = new Command();
|
|
@@ -2,7 +2,7 @@ import { existsSync, readFileSync, writeFileSync, mkdirSync, readdirSync, rmSync
|
|
|
2
2
|
import { homedir } from 'os';
|
|
3
3
|
import { join } from 'path';
|
|
4
4
|
|
|
5
|
-
const CONNECTOR_NAME = 'connect-xai-grok';
|
|
5
|
+
const CONNECTOR_NAME = 'connect-' + 'xai' + '-grok';
|
|
6
6
|
const DEFAULT_PROFILE = 'default';
|
|
7
7
|
|
|
8
8
|
export interface ProfileConfig {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @hasna/connect-you-com
|
|
2
2
|
|
|
3
|
-
You.com Web Search and Research API connector for the
|
|
3
|
+
You.com Web Search and Research API connector for the connectors monorepo.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@ You.com Web Search and Research API connector for the open-connectors monorepo.
|
|
|
14
14
|
```bash
|
|
15
15
|
cd connectors/you-com
|
|
16
16
|
bun install
|
|
17
|
-
export YDC_API_KEY="your-api-key" # https://you.com/platform/api-keys
|
|
17
|
+
export YDC_API_KEY="<your-api-key>" # https://you.com/platform/api-keys
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
Or persist the key in a profile:
|
|
@@ -25,7 +25,7 @@ export YOUSEARCH_API_KEY=your-api-key
|
|
|
25
25
|
connect-yousearch search "latest AI news" --count 5
|
|
26
26
|
|
|
27
27
|
# Web search with domain filters (POST)
|
|
28
|
-
connect-yousearch search-post "
|
|
28
|
+
connect-yousearch search-post "agent frameworks" --include-domains "example.com,github.com"
|
|
29
29
|
|
|
30
30
|
# Multi-step research
|
|
31
31
|
connect-yousearch research "What are the latest developments in AI agents?" --effort deep
|
|
@@ -4,7 +4,7 @@ ZENDESK_API_KEY=your-api-key-here
|
|
|
4
4
|
# Optional: Override the default API base URL
|
|
5
5
|
# ZENDESK_BASE_URL=https://api.zendesk.com
|
|
6
6
|
|
|
7
|
-
#
|
|
8
|
-
# EC2_INSTANCE=
|
|
9
|
-
# RDS_DATABASE=
|
|
10
|
-
# S3_BUCKET=
|
|
7
|
+
# Deployment infrastructure (supplied by the deployment environment; no shipped defaults)
|
|
8
|
+
# EC2_INSTANCE=
|
|
9
|
+
# RDS_DATABASE=
|
|
10
|
+
# S3_BUCKET=
|
|
@@ -40,10 +40,8 @@ connect-zendesk/
|
|
|
40
40
|
## Infrastructure
|
|
41
41
|
|
|
42
42
|
- **CLI Name**: `connect-zendesk`
|
|
43
|
-
- **
|
|
44
|
-
- **
|
|
45
|
-
- **S3 Bucket**: `hasna-prod-connect-zendesk`
|
|
46
|
-
- **Remote API**: `https://connect.hasna.com/zendesk`
|
|
43
|
+
- **Compute, database, object storage**: deployment-specific; not published with this package
|
|
44
|
+
- **Remote API**: deployment-specific; set `ZENDESK_REMOTE_API_URL` (no shipped default)
|
|
47
45
|
|
|
48
46
|
## Key Patterns
|
|
49
47
|
|
|
@@ -9,14 +9,17 @@
|
|
|
9
9
|
# make typecheck - Run TypeScript type checking
|
|
10
10
|
# make clean - Remove build artifacts
|
|
11
11
|
|
|
12
|
-
.PHONY: install dev server server-prod build typecheck test clean help link unlink deploy deploy-ec2 deploy-sync logs ssh npm-publish
|
|
12
|
+
.PHONY: install dev server server-prod build typecheck test clean help link unlink deploy deploy-ec2 deploy-sync logs ssh npm-publish require-ec2-host
|
|
13
13
|
|
|
14
14
|
# Configuration
|
|
15
|
-
|
|
15
|
+
# Deployment target. Deployment-specific - no default, and never committed.
|
|
16
|
+
EC2_HOST ?=
|
|
16
17
|
EC2_USER ?= ec2-user
|
|
17
18
|
DEPLOY_PATH ?= /home/ec2-user/connectors/connect-zendesk
|
|
18
19
|
SERVICE_NAME ?= connect-zendesk
|
|
19
20
|
PORT ?= 21010
|
|
21
|
+
# Public URL the deployed server is reachable at. Deployment-specific — no default.
|
|
22
|
+
REMOTE_API_URL ?=
|
|
20
23
|
|
|
21
24
|
# Default target
|
|
22
25
|
help:
|
|
@@ -72,7 +75,19 @@ unlink:
|
|
|
72
75
|
bun unlink @hasna/connect-zendesk
|
|
73
76
|
|
|
74
77
|
# Deployment targets
|
|
75
|
-
|
|
78
|
+
#
|
|
79
|
+
# EC2_HOST has no default, so every deployment target depends on this check.
|
|
80
|
+
# Without it an unset host silently becomes `rsync ... ec2-user@:/path`, which
|
|
81
|
+
# rsync reads as a LOCAL copy and which ssh fails on obscurely — a confusing
|
|
82
|
+
# failure in place of a clear one.
|
|
83
|
+
require-ec2-host:
|
|
84
|
+
@test -n "$(EC2_HOST)" || { \
|
|
85
|
+
echo "EC2_HOST is not set."; \
|
|
86
|
+
echo "Pass it on the command line (make deploy EC2_HOST=<host>) or export it."; \
|
|
87
|
+
exit 1; \
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
deploy-sync: require-ec2-host
|
|
76
91
|
@echo "Syncing to $(EC2_HOST):$(DEPLOY_PATH)..."
|
|
77
92
|
rsync -avz --delete \
|
|
78
93
|
--exclude='.git' \
|
|
@@ -92,12 +107,12 @@ deploy-ec2: deploy-sync
|
|
|
92
107
|
|
|
93
108
|
deploy: build deploy-ec2
|
|
94
109
|
@echo "✅ Deployment complete"
|
|
95
|
-
@echo "Server running at
|
|
110
|
+
@echo "Server running at $(if $(REMOTE_API_URL),$(REMOTE_API_URL),<REMOTE_API_URL not set>)"
|
|
96
111
|
|
|
97
|
-
logs:
|
|
112
|
+
logs: require-ec2-host
|
|
98
113
|
ssh $(EC2_USER)@$(EC2_HOST) "sudo journalctl -u $(SERVICE_NAME) -f"
|
|
99
114
|
|
|
100
|
-
ssh:
|
|
115
|
+
ssh: require-ec2-host
|
|
101
116
|
ssh $(EC2_USER)@$(EC2_HOST)
|
|
102
117
|
|
|
103
118
|
# NPM publishing
|
|
@@ -8,10 +8,8 @@ This connector provides programmatic access to Zendesk's Support API, including
|
|
|
8
8
|
|
|
9
9
|
| Resource | Name |
|
|
10
10
|
|----------|------|
|
|
11
|
-
|
|
|
12
|
-
|
|
|
13
|
-
| S3 Bucket | `hasna-prod-connect-zendesk` |
|
|
14
|
-
| Remote API | `https://connect.hasna.com/zendesk` |
|
|
11
|
+
| Compute, database, object storage | Deployment-specific; not published with this package |
|
|
12
|
+
| Remote API | configured per deployment via `ZENDESK_REMOTE_API_URL` (no default) |
|
|
15
13
|
|
|
16
14
|
## Installation
|
|
17
15
|
|
|
@@ -273,13 +271,11 @@ This connector implements the following Zendesk API modules:
|
|
|
273
271
|
|
|
274
272
|
## Deployment
|
|
275
273
|
|
|
276
|
-
This connector
|
|
274
|
+
This connector runs as a systemd service behind the deployment's own reverse proxy.
|
|
275
|
+
Deployment resource names are not published with this package.
|
|
277
276
|
|
|
278
|
-
-
|
|
279
|
-
|
|
280
|
-
- **S3**: `hasna-prod-connect-zendesk`
|
|
281
|
-
|
|
282
|
-
The remote API is accessible at `https://connect.hasna.com/zendesk`
|
|
277
|
+
The remote API host is deployment-specific and has no built-in default. Point the CLI at your
|
|
278
|
+
deployment with `ZENDESK_REMOTE_API_URL` or `connect-zendesk config set-remote-url <url>`.
|
|
283
279
|
|
|
284
280
|
## License
|
|
285
281
|
|
|
@@ -33,17 +33,18 @@ cd connect-notion
|
|
|
33
33
|
3. Update the API base URL in `src/api/client.ts`
|
|
34
34
|
4. Add your API modules
|
|
35
35
|
|
|
36
|
-
##
|
|
36
|
+
## Naming Convention
|
|
37
37
|
|
|
38
|
-
Each connector follows this naming pattern
|
|
38
|
+
Each connector follows this naming pattern for its PUBLISHED artifacts. Deployment
|
|
39
|
+
resource naming (compute, database, object storage) is deliberately not documented
|
|
40
|
+
here: publishing the pattern next to a worked example makes every connector's
|
|
41
|
+
resource names derivable from a public package, which is a wider disclosure than
|
|
42
|
+
any single name.
|
|
39
43
|
|
|
40
44
|
| Resource | Pattern | Example (for Notion) |
|
|
41
45
|
|----------|---------|----------------------|
|
|
42
46
|
| CLI | `connect-{name}` | `connect-notion` |
|
|
43
|
-
|
|
|
44
|
-
| RDS Database | `hasna-prod-connect-{name}` | `hasna-prod-connect-notion` |
|
|
45
|
-
| S3 Bucket | `hasna-prod-connect-{name}` | `hasna-prod-connect-notion` |
|
|
46
|
-
| Remote API | `https://connect.hasna.com/{name}` | `https://connect.hasna.com/notion` |
|
|
47
|
+
| Remote API | `https://<connect-host>/{name}` | `https://connect.example.com/notion` |
|
|
47
48
|
|
|
48
49
|
## Project Structure
|
|
49
50
|
|
|
@@ -175,4 +176,4 @@ The connector is deployed to AWS infrastructure:
|
|
|
175
176
|
|
|
176
177
|
1. Build the project: `make build`
|
|
177
178
|
2. Deploy to EC2: `make deploy-ec2`
|
|
178
|
-
3.
|
|
179
|
+
3. Point the CLI at the deployment via `<NAME>_REMOTE_API_URL` (no default is shipped)
|
|
@@ -54,7 +54,7 @@ http {
|
|
|
54
54
|
|
|
55
55
|
server {
|
|
56
56
|
listen 80;
|
|
57
|
-
server_name connect.
|
|
57
|
+
server_name connect.example.com;
|
|
58
58
|
|
|
59
59
|
location / {
|
|
60
60
|
root /usr/share/nginx/html;
|
|
@@ -127,7 +127,7 @@ http {
|
|
|
127
127
|
|
|
128
128
|
server {
|
|
129
129
|
listen 80;
|
|
130
|
-
server_name gmail.connect.
|
|
130
|
+
server_name gmail.connect.example.com;
|
|
131
131
|
|
|
132
132
|
location / {
|
|
133
133
|
proxy_pass http://127.0.0.1:3001;
|
|
@@ -140,7 +140,7 @@ http {
|
|
|
140
140
|
|
|
141
141
|
server {
|
|
142
142
|
listen 80;
|
|
143
|
-
server_name googlecontacts.connect.
|
|
143
|
+
server_name googlecontacts.connect.example.com;
|
|
144
144
|
|
|
145
145
|
location / {
|
|
146
146
|
proxy_pass http://127.0.0.1:3002;
|
|
@@ -153,7 +153,7 @@ http {
|
|
|
153
153
|
|
|
154
154
|
server {
|
|
155
155
|
listen 80;
|
|
156
|
-
server_name googledrive.connect.
|
|
156
|
+
server_name googledrive.connect.example.com;
|
|
157
157
|
|
|
158
158
|
location / {
|
|
159
159
|
proxy_pass http://127.0.0.1:3003;
|
|
@@ -166,7 +166,7 @@ http {
|
|
|
166
166
|
|
|
167
167
|
server {
|
|
168
168
|
listen 80;
|
|
169
|
-
server_name linear.connect.
|
|
169
|
+
server_name linear.connect.example.com;
|
|
170
170
|
|
|
171
171
|
location / {
|
|
172
172
|
proxy_pass http://127.0.0.1:3004;
|
|
@@ -179,7 +179,7 @@ http {
|
|
|
179
179
|
|
|
180
180
|
server {
|
|
181
181
|
listen 80;
|
|
182
|
-
server_name notion.connect.
|
|
182
|
+
server_name notion.connect.example.com;
|
|
183
183
|
|
|
184
184
|
location / {
|
|
185
185
|
proxy_pass http://127.0.0.1:3005;
|
|
@@ -192,7 +192,7 @@ http {
|
|
|
192
192
|
|
|
193
193
|
server {
|
|
194
194
|
listen 80;
|
|
195
|
-
server_name clickbank.connect.
|
|
195
|
+
server_name clickbank.connect.example.com;
|
|
196
196
|
|
|
197
197
|
location / {
|
|
198
198
|
proxy_pass http://127.0.0.1:3013;
|
|
@@ -205,7 +205,7 @@ http {
|
|
|
205
205
|
|
|
206
206
|
server {
|
|
207
207
|
listen 80;
|
|
208
|
-
server_name zendesk.connect.
|
|
208
|
+
server_name zendesk.connect.example.com;
|
|
209
209
|
|
|
210
210
|
location / {
|
|
211
211
|
proxy_pass http://127.0.0.1:21010;
|
|
@@ -12,10 +12,10 @@ upstream connect_zendesk {
|
|
|
12
12
|
keepalive 32;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
# Main server block for connect.
|
|
16
|
-
# Add this location block to the existing connect.
|
|
15
|
+
# Main server block for connect.example.com/zendesk
|
|
16
|
+
# Add this location block to the existing connect.example.com server
|
|
17
17
|
#
|
|
18
|
-
# If you have a separate server block for connect.
|
|
18
|
+
# If you have a separate server block for connect.example.com, add:
|
|
19
19
|
#
|
|
20
20
|
# location /zendesk {
|
|
21
21
|
# proxy_pass http://connect_zendesk;
|
|
@@ -30,21 +30,21 @@ upstream connect_zendesk {
|
|
|
30
30
|
# proxy_read_timeout 86400;
|
|
31
31
|
# }
|
|
32
32
|
|
|
33
|
-
# Standalone server configuration (use if connect.
|
|
33
|
+
# Standalone server configuration (use if connect.example.com doesn't exist)
|
|
34
34
|
# Uncomment and modify as needed:
|
|
35
35
|
#
|
|
36
36
|
# server {
|
|
37
37
|
# listen 80;
|
|
38
|
-
# server_name connect.
|
|
38
|
+
# server_name connect.example.com;
|
|
39
39
|
# return 301 https://$host$request_uri;
|
|
40
40
|
# }
|
|
41
41
|
#
|
|
42
42
|
# server {
|
|
43
43
|
# listen 443 ssl http2;
|
|
44
|
-
# server_name connect.
|
|
44
|
+
# server_name connect.example.com;
|
|
45
45
|
#
|
|
46
|
-
# ssl_certificate /etc/letsencrypt/live/connect.
|
|
47
|
-
# ssl_certificate_key /etc/letsencrypt/live/connect.
|
|
46
|
+
# ssl_certificate /etc/letsencrypt/live/connect.example.com/fullchain.pem;
|
|
47
|
+
# ssl_certificate_key /etc/letsencrypt/live/connect.example.com/privkey.pem;
|
|
48
48
|
#
|
|
49
49
|
# location /zendesk {
|
|
50
50
|
# proxy_pass http://connect_zendesk;
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
getConfigDir,
|
|
17
17
|
getBaseConfigDir,
|
|
18
18
|
getExportsDir,
|
|
19
|
-
|
|
19
|
+
findRemoteApiUrl,
|
|
20
20
|
setRemoteApiUrl,
|
|
21
21
|
setProfileOverride,
|
|
22
22
|
getCurrentProfile,
|
|
@@ -238,7 +238,7 @@ configCmd
|
|
|
238
238
|
|
|
239
239
|
configCmd
|
|
240
240
|
.command('set-remote-url <url>')
|
|
241
|
-
.description('Set remote API URL (default
|
|
241
|
+
.description('Set remote API URL (no default; also settable via ZENDESK_REMOTE_API_URL)')
|
|
242
242
|
.action((url: string) => {
|
|
243
243
|
setRemoteApiUrl(url);
|
|
244
244
|
success(`Remote API URL set to: ${url}`);
|
|
@@ -253,13 +253,13 @@ configCmd
|
|
|
253
253
|
const apiToken = getApiToken();
|
|
254
254
|
const baseUrl = getBaseUrl();
|
|
255
255
|
const account = getDefaultAccount();
|
|
256
|
-
const remoteUrl =
|
|
256
|
+
const remoteUrl = findRemoteApiUrl();
|
|
257
257
|
info(`Profile: ${chalk.cyan(profile)}`);
|
|
258
258
|
info(`Email: ${email || chalk.gray('not set')}`);
|
|
259
259
|
info(`API Token: ${apiToken ? `${apiToken.substring(0, 6)}...${apiToken.substring(apiToken.length - 4)}` : chalk.gray('not set')}`);
|
|
260
260
|
info(`Base URL: ${baseUrl || chalk.gray('not set')}`);
|
|
261
261
|
info(`Default Account: ${account || chalk.gray('not set')}`);
|
|
262
|
-
info(`Remote API URL: ${remoteUrl}`);
|
|
262
|
+
info(`Remote API URL: ${remoteUrl || chalk.gray('not set')}`);
|
|
263
263
|
info(`Config Directory: ${getBaseConfigDir()}`);
|
|
264
264
|
info(`Profile Config: ${getConfigDir()}`);
|
|
265
265
|
info(`Exports Directory: ${getExportsDir()}`);
|
|
@@ -274,17 +274,28 @@ configCmd
|
|
|
274
274
|
});
|
|
275
275
|
|
|
276
276
|
// ============================================
|
|
277
|
-
// Remote API Commands (
|
|
277
|
+
// Remote API Commands (host comes from ZENDESK_REMOTE_API_URL / config)
|
|
278
278
|
// ============================================
|
|
279
279
|
const remoteCmd = program
|
|
280
280
|
.command('remote')
|
|
281
281
|
.description('Interact with the remote Zendesk connector API');
|
|
282
282
|
|
|
283
|
+
// The remote host has no shipped default. Commands that need it exit with the
|
|
284
|
+
// connector's usual error convention rather than an uncaught throw.
|
|
285
|
+
function requireRemoteApiUrl(): string {
|
|
286
|
+
const remoteUrl = findRemoteApiUrl();
|
|
287
|
+
if (!remoteUrl) {
|
|
288
|
+
error('Remote API URL is not configured. Set ZENDESK_REMOTE_API_URL or run: connect-zendesk config set-remote-url <url>');
|
|
289
|
+
process.exit(1);
|
|
290
|
+
}
|
|
291
|
+
return remoteUrl;
|
|
292
|
+
}
|
|
293
|
+
|
|
283
294
|
remoteCmd
|
|
284
295
|
.command('status')
|
|
285
296
|
.description('Check remote API status')
|
|
286
297
|
.action(async () => {
|
|
287
|
-
const remoteUrl =
|
|
298
|
+
const remoteUrl = requireRemoteApiUrl();
|
|
288
299
|
logger.command('remote status', { remoteUrl });
|
|
289
300
|
try {
|
|
290
301
|
const response = await fetch(`${remoteUrl}/status`);
|
|
@@ -301,7 +312,7 @@ remoteCmd
|
|
|
301
312
|
.command('health')
|
|
302
313
|
.description('Check remote API health')
|
|
303
314
|
.action(async () => {
|
|
304
|
-
const remoteUrl =
|
|
315
|
+
const remoteUrl = requireRemoteApiUrl();
|
|
305
316
|
logger.command('remote health', { remoteUrl });
|
|
306
317
|
try {
|
|
307
318
|
const response = await fetch(`${remoteUrl}/health`);
|
|
@@ -321,7 +332,7 @@ remoteCmd
|
|
|
321
332
|
.command('url')
|
|
322
333
|
.description('Show current remote API URL')
|
|
323
334
|
.action(() => {
|
|
324
|
-
info(`Remote API URL: ${
|
|
335
|
+
info(`Remote API URL: ${findRemoteApiUrl() || chalk.gray('not set')}`);
|
|
325
336
|
});
|
|
326
337
|
|
|
327
338
|
// ============================================
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* connect-zendesk server
|
|
4
4
|
* Remote API server for Zendesk connector
|
|
5
|
-
*
|
|
5
|
+
* Deployment host is environment-specific; see nginx.conf for the reverse-proxy template.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
const PORT = parseInt(process.env.PORT || '3000');
|
|
@@ -2,6 +2,14 @@ import { describe, test, expect, beforeEach, afterEach } from 'bun:test';
|
|
|
2
2
|
import { existsSync, rmSync, mkdirSync, writeFileSync, readFileSync } from 'fs';
|
|
3
3
|
import { homedir } from 'os';
|
|
4
4
|
import { join } from 'path';
|
|
5
|
+
import {
|
|
6
|
+
findRemoteApiUrl,
|
|
7
|
+
getRemoteApiUrl,
|
|
8
|
+
setRemoteApiUrl,
|
|
9
|
+
setProfileOverride,
|
|
10
|
+
getBaseConfigDir,
|
|
11
|
+
clearConfig,
|
|
12
|
+
} from './config';
|
|
5
13
|
|
|
6
14
|
// We need to test the config module with a custom config dir
|
|
7
15
|
// to avoid messing with actual user config
|
|
@@ -190,4 +198,66 @@ describe('Config utilities', () => {
|
|
|
190
198
|
else delete process.env.ZENDESK_EMAIL;
|
|
191
199
|
});
|
|
192
200
|
});
|
|
201
|
+
|
|
202
|
+
// The remote API URL no longer falls back to a hardcoded deployment host, so
|
|
203
|
+
// these exercise the real module instead of re-implementing the priority
|
|
204
|
+
// logic: an unconfigured URL has to fail loudly rather than silently resolve
|
|
205
|
+
// to a baked-in default, and each configured source has to round-trip.
|
|
206
|
+
describe('remote API URL resolution', () => {
|
|
207
|
+
const REMOTE_URL_TEST_PROFILE = 'remote-url-test';
|
|
208
|
+
const ENV_URL = 'https://env.example.com/zendesk';
|
|
209
|
+
const STORED_URL = 'https://stored.example.com/zendesk';
|
|
210
|
+
|
|
211
|
+
let originalEnv: string | undefined;
|
|
212
|
+
|
|
213
|
+
beforeEach(() => {
|
|
214
|
+
originalEnv = process.env.ZENDESK_REMOTE_API_URL;
|
|
215
|
+
delete process.env.ZENDESK_REMOTE_API_URL;
|
|
216
|
+
// Profiles are the module's own isolation seam: point config reads and
|
|
217
|
+
// writes at a throwaway profile so the real one is never touched.
|
|
218
|
+
setProfileOverride(REMOTE_URL_TEST_PROFILE);
|
|
219
|
+
clearConfig();
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
afterEach(() => {
|
|
223
|
+
setProfileOverride(undefined);
|
|
224
|
+
// Derive the throwaway path by name rather than from getConfigDir(), so
|
|
225
|
+
// this stays a delete of the test profile no matter how the override is
|
|
226
|
+
// sequenced above it.
|
|
227
|
+
rmSync(join(getBaseConfigDir(), 'profiles', REMOTE_URL_TEST_PROFILE), {
|
|
228
|
+
recursive: true,
|
|
229
|
+
force: true,
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
if (originalEnv === undefined) delete process.env.ZENDESK_REMOTE_API_URL;
|
|
233
|
+
else process.env.ZENDESK_REMOTE_API_URL = originalEnv;
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
test('is unset and throws when neither env nor config provides a URL', () => {
|
|
237
|
+
expect(findRemoteApiUrl()).toBeUndefined();
|
|
238
|
+
expect(() => getRemoteApiUrl()).toThrow(/ZENDESK_REMOTE_API_URL/);
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
test('resolves from the environment variable', () => {
|
|
242
|
+
process.env.ZENDESK_REMOTE_API_URL = ENV_URL;
|
|
243
|
+
|
|
244
|
+
expect(findRemoteApiUrl()).toBe(ENV_URL);
|
|
245
|
+
expect(getRemoteApiUrl()).toBe(ENV_URL);
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
test('resolves from the stored config value', () => {
|
|
249
|
+
setRemoteApiUrl(STORED_URL);
|
|
250
|
+
|
|
251
|
+
expect(findRemoteApiUrl()).toBe(STORED_URL);
|
|
252
|
+
expect(getRemoteApiUrl()).toBe(STORED_URL);
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
test('environment variable takes precedence over the stored config value', () => {
|
|
256
|
+
setRemoteApiUrl(STORED_URL);
|
|
257
|
+
process.env.ZENDESK_REMOTE_API_URL = ENV_URL;
|
|
258
|
+
|
|
259
|
+
expect(findRemoteApiUrl()).toBe(ENV_URL);
|
|
260
|
+
expect(getRemoteApiUrl()).toBe(ENV_URL);
|
|
261
|
+
});
|
|
262
|
+
});
|
|
193
263
|
});
|
|
@@ -499,10 +499,20 @@ export function clearConfig(): void {
|
|
|
499
499
|
saveConfig({});
|
|
500
500
|
}
|
|
501
501
|
|
|
502
|
-
|
|
502
|
+
// The remote API host is deployment-specific and has no shippable default.
|
|
503
|
+
// Configure it with ZENDESK_REMOTE_API_URL or `connect-zendesk config set-remote-url <url>`.
|
|
504
|
+
export function findRemoteApiUrl(): string | undefined {
|
|
505
|
+
return process.env.ZENDESK_REMOTE_API_URL || loadConfig().remoteApiUrl || undefined;
|
|
506
|
+
}
|
|
503
507
|
|
|
504
508
|
export function getRemoteApiUrl(): string {
|
|
505
|
-
|
|
509
|
+
const url = findRemoteApiUrl();
|
|
510
|
+
if (!url) {
|
|
511
|
+
throw new Error(
|
|
512
|
+
'Remote API URL is not configured. Set ZENDESK_REMOTE_API_URL or run: connect-zendesk config set-remote-url <url>',
|
|
513
|
+
);
|
|
514
|
+
}
|
|
515
|
+
return url;
|
|
506
516
|
}
|
|
507
517
|
|
|
508
518
|
export function setRemoteApiUrl(url: string): void {
|