diff --git a/README.md b/README.md index a44f987..a8d24a4 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,8 @@ Edit one YAML file per service or provider. Start with [Linear](catalog/services Run `bun run import:reference /path/to/reference-checkout` to reproduce the import from the pinned revision. Supply a full commit SHA as a second argument to update the source revision, then review the changed definitions and regenerate the exports. +Reference settings describe per-connection values such as a region, tenant host, or account identifier. Related caveats describe limits in the reference definition. Hosts supply the values and implement the corresponding setup. + For a new entry or route, include the vendor documentation for its endpoint and authentication in the pull request. Tests use no service accounts or API keys. The integration order is providers, connectors for agent tools, triggers for incoming events, and channels for conversations. diff --git a/catalog/providers/cloudflare-ai-gateway.yaml b/catalog/providers/cloudflare-ai-gateway.yaml index ddd838d..08f8b4c 100644 --- a/catalog/providers/cloudflare-ai-gateway.yaml +++ b/catalog/providers/cloudflare-ai-gateway.yaml @@ -17,6 +17,12 @@ reference: send: header: cf-aig-authorization value: Bearer {token} + settings: + - id: account_id + label: Cloudflare account ID + - id: gateway_id + label: Gateway name + help: The name of the gateway in the AI Gateway section of the Cloudflare dashboard. credentials: gateway_token: type: secret diff --git a/catalog/providers/cloudflare-workers-ai.yaml b/catalog/providers/cloudflare-workers-ai.yaml index bd97082..683dd09 100644 --- a/catalog/providers/cloudflare-workers-ai.yaml +++ b/catalog/providers/cloudflare-workers-ai.yaml @@ -12,6 +12,10 @@ reference: send: header: Authorization value: Bearer {token} + settings: + - id: account_id + label: Cloudflare account ID + help: Shown on the Workers AI page of the Cloudflare dashboard. credentials: api_token: type: secret diff --git a/catalog/services/auth0.yaml b/catalog/services/auth0.yaml index 76cc5ac..8558738 100644 --- a/catalog/services/auth0.yaml +++ b/catalog/services/auth0.yaml @@ -20,6 +20,16 @@ reference: check: request: GET /api/v2/tenants/settings name: "{friendly_name}" + settings: + - id: tenant_domain + label: Auth0 tenant domain + placeholder: example-tenant.auth0.com + help: The domain of your tenant, such as example-tenant.auth0.com or, with a region, + example-tenant.au.auth0.com, or a custom domain of your tenant such as login.example.com. + host: + suffixes: + - auth0.com + owner_named: true credentials: management_token: type: secret diff --git a/catalog/services/bamboohr.yaml b/catalog/services/bamboohr.yaml index bb75e91..6aa846f 100644 --- a/catalog/services/bamboohr.yaml +++ b/catalog/services/bamboohr.yaml @@ -103,6 +103,13 @@ reference: summary: One of the monitored fields on an employee record changes. - type: employee.deleted summary: An employee record is deleted. + settings: + - id: subdomain + label: BambooHR company domain + placeholder: mycompany + help: The text before .bamboohr.com in your company's BambooHR address. If the address is + https://mycompany.bamboohr.com, enter mycompany. + pattern: ^[A-Za-z0-9-]+$ credentials: api_key: type: secret diff --git a/catalog/services/confluence.yaml b/catalog/services/confluence.yaml index c309def..3b412c4 100644 --- a/catalog/services/confluence.yaml +++ b/catalog/services/confluence.yaml @@ -29,6 +29,13 @@ reference: password: "{token}" check: request: GET /wiki/rest/api/space + settings: + - id: site + label: Confluence site + placeholder: your-domain + help: The first part of your Confluence address. If the address is + https://your-domain.atlassian.net, enter your-domain. + pattern: ^[A-Za-z0-9-]+$ credentials: mcp_sign_in: type: oauth_discovered diff --git a/catalog/services/datadog.yaml b/catalog/services/datadog.yaml index 4959939..364c6ce 100644 --- a/catalog/services/datadog.yaml +++ b/catalog/services/datadog.yaml @@ -71,6 +71,17 @@ reference: summary: Sent for a Synthetics monitor. - type: trace_analytics_alert summary: Sent for a Trace Analytics monitor. + settings: + - id: site + label: Datadog site + placeholder: datadoghq.com + help: The site parameter of your Datadog organization, such as datadoghq.com (US1), + us3.datadoghq.com or datadoghq.eu. In Datadog, your site is listed at the top of the My + Preferences page. The US1-FED and US2-FED sites are not supported by the MCP server. + host: + suffixes: + - datadoghq.com + - datadoghq.eu credentials: sign_in: type: oauth_discovered diff --git a/catalog/services/docusign.yaml b/catalog/services/docusign.yaml index 24bd8af..0509a4b 100644 --- a/catalog/services/docusign.yaml +++ b/catalog/services/docusign.yaml @@ -247,6 +247,22 @@ reference: summary: A workspace upload request is completed. - type: workspace-upload-request-sent summary: A workspace upload request is sent. + settings: + - id: environment + label: Environment + choices: + - value: production + label: Production + hosts: + account: account.docusign.com + mcp: mcp.docusign.com + api: www.docusign.net + - value: demo + label: Demo + hosts: + account: account-d.docusign.com + mcp: mcp-d.docusign.com + api: demo.docusign.net credentials: oauth_app: type: oauth diff --git a/catalog/services/figma.yaml b/catalog/services/figma.yaml index 07333e4..c0c7f66 100644 --- a/catalog/services/figma.yaml +++ b/catalog/services/figma.yaml @@ -92,6 +92,27 @@ reference: env: FIGMA_ACCESS_TOKEN hosts: - api.figma.com + settings: + - id: version + label: Version + choices: + - value: common + label: Figma + hosts: + api: api.figma.com + mcp: mcp.figma.com + - value: government + label: Figma for Government + hosts: + api: api.figma-gov.com + mcp: mcp.figma-gov.com + gaps: + - surface: settings + needs: settings.choices + detail: Figma for Government gives no sign-in page address for an OAuth app, only the API and MCP + addresses, so with that version chosen the own-app sign-in still sends people to + www.figma.com/oauth. The event setup steps and the Code Connect command-line tool also still + name api.figma.com. credentials: sign_in: type: oauth_discovered diff --git a/catalog/services/freshdesk.yaml b/catalog/services/freshdesk.yaml index 0f5fef9..933c66f 100644 --- a/catalog/services/freshdesk.yaml +++ b/catalog/services/freshdesk.yaml @@ -26,6 +26,14 @@ reference: password: X check: request: GET /api/v2/agents/me + settings: + - id: subdomain + label: Freshdesk subdomain + placeholder: acme + help: The first part of your Freshdesk address. If the address is https://acme.freshdesk.com, enter + acme. Freshdesk says custom domains are not supported for the MCP endpoint, so use the + freshdesk.com address. + pattern: ^[A-Za-z0-9-]+$ credentials: api_key: type: secret diff --git a/catalog/services/gitlab.yaml b/catalog/services/gitlab.yaml index f549311..be977e4 100644 --- a/catalog/services/gitlab.yaml +++ b/catalog/services/gitlab.yaml @@ -112,6 +112,17 @@ reference: summary: A GitLab Duo flow that references the webhook starts, finishes, or fails. An experiment behind a feature flag that is disabled by default, and not selected in the webhook's Trigger section. + settings: + - id: host + label: GitLab host + placeholder: gitlab.com + help: "The host of your GitLab: gitlab.com for GitLab.com, or the host name of your GitLab + Self-Managed or GitLab Dedicated instance (your instance URL without https://)." + host: + suffixes: + - gitlab.com + owner_named: true + default: gitlab.com credentials: sign_in: type: oauth_discovered diff --git a/catalog/services/gong.yaml b/catalog/services/gong.yaml index c6c502a..23b3aae 100644 --- a/catalog/services/gong.yaml +++ b/catalog/services/gong.yaml @@ -35,6 +35,17 @@ reference: includeAvatars: type: boolean description: Set to true to return avatars. + settings: + - id: host + label: Gong API host + placeholder: company-17.api.gong.io + help: The host of your company's API base address, shown in Gong at + https://app.gong.io/company/api-authentication?currentTab=MY_API_TAB (a technical + administrator can open it). If the base URL is https://company-17.api.gong.io, enter + company-17.api.gong.io. + host: + suffixes: + - api.gong.io credentials: api_key: type: secret diff --git a/catalog/services/intercom.yaml b/catalog/services/intercom.yaml index af57af5..1f717ed 100644 --- a/catalog/services/intercom.yaml +++ b/catalog/services/intercom.yaml @@ -300,6 +300,31 @@ reference: summary: Contacts converting from Visitors to Users - type: data_connector.execution.completed summary: Data Connector action execution completed + settings: + - id: region + label: Region + choices: + - value: us + label: US + hosts: + mcp: mcp.intercom.com + api: api.intercom.io + app: app.intercom.com + - value: eu + label: EU + hosts: + mcp: mcp.eu.intercom.com + api: api.eu.intercom.io + app: app.eu.intercom.com + - value: au + label: Australia + surfaces: + - api + - events + hosts: + api: api.au.intercom.io + app: app.au.intercom.com + default: us credentials: sign_in: type: oauth_discovered diff --git a/catalog/services/jira.yaml b/catalog/services/jira.yaml index efe3a17..4a23b6b 100644 --- a/catalog/services/jira.yaml +++ b/catalog/services/jira.yaml @@ -166,6 +166,13 @@ reference: summary: Sent when an app's access to objects is blocked. - type: app_access_to_objects_in_container_blocked summary: Sent when an app's access to objects in a container is blocked. + settings: + - id: site + label: Jira site + placeholder: your-domain + help: The first part of your Jira address. If the address is https://your-domain.atlassian.net, + enter your-domain. + pattern: ^[A-Za-z0-9-]+$ credentials: mcp_sign_in: type: oauth_discovered diff --git a/catalog/services/launchdarkly.yaml b/catalog/services/launchdarkly.yaml index c30c3b0..805522e 100644 --- a/catalog/services/launchdarkly.yaml +++ b/catalog/services/launchdarkly.yaml @@ -57,6 +57,19 @@ reference: signed_content: "{body}" event_type: "{body.kind}" event_id: "{body._id}" + settings: + - id: host + label: LaunchDarkly instance + placeholder: app.launchdarkly.com + help: The host of your LaunchDarkly instance, which is the base URI of its REST API; + app.launchdarkly.com for the commercial instance, app.eu.launchdarkly.com for the EU + instance or app.launchdarkly.us for the federal instance. The hosted MCP server is not + available on the EU and federal instances. + host: + suffixes: + - app.launchdarkly.com + - app.eu.launchdarkly.com + - app.launchdarkly.us credentials: sign_in: type: oauth_discovered diff --git a/catalog/services/mailgun.yaml b/catalog/services/mailgun.yaml index 764de30..9a65a16 100644 --- a/catalog/services/mailgun.yaml +++ b/catalog/services/mailgun.yaml @@ -64,6 +64,22 @@ reference: in the Mailgun control panel. - type: complained summary: The email recipient clicked on the spam complaint button within their email client. + settings: + - id: region + label: Mailgun region + choices: + - value: us + label: US + hosts: + api: api.mailgun.net + - value: eu + label: EU + hosts: + api: api.eu.mailgun.net + - value: au + label: AU (Contract only) + hosts: + api: api.au.mailgun.net credentials: signing_key: type: secret diff --git a/catalog/services/mattermost.yaml b/catalog/services/mattermost.yaml index cda73f5..d4cf0f4 100644 --- a/catalog/services/mattermost.yaml +++ b/catalog/services/mattermost.yaml @@ -86,6 +86,13 @@ reference: check: request: GET /api/v4/users/me account: "{username}" + settings: + - id: host + label: Mattermost host + placeholder: chat.example.com + help: The host name of your Mattermost server's Site URL, without https:// and without a path. + host: + owner_named: true credentials: personal_access_token: type: secret diff --git a/catalog/services/microsoft-teams.yaml b/catalog/services/microsoft-teams.yaml index f3b6e48..37ffbdf 100644 --- a/catalog/services/microsoft-teams.yaml +++ b/catalog/services/microsoft-teams.yaml @@ -95,6 +95,19 @@ reference: type: message text: "{text}" error: "{body.error.message}" + settings: + - id: tenant + label: App tenant ID + pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$ + placeholder: 00000000-0000-0000-0000-000000000000 + help: The bot's App Tenant ID, which you can copy from the Azure Bot's Configuration blade. + gaps: + - surface: api + needs: settings.dotted_path_value + detail: A multi-tenant bot asks for its token at login.microsoftonline.com/botframework.com, and a + setting cannot hold a value with dots, so only single-tenant bots are described. A bot whose + identity is a user-assigned managed identity gets its token from its host's MSI endpoint + instead, which is not described. credentials: bot: type: client_credentials diff --git a/catalog/services/mixpanel.yaml b/catalog/services/mixpanel.yaml index e13eb04..3e06bb1 100644 --- a/catalog/services/mixpanel.yaml +++ b/catalog/services/mixpanel.yaml @@ -12,6 +12,30 @@ reference: url: https://{region.mcp}/mcp accepts: - credential: sign_in + settings: + - id: region + label: Region + choices: + - value: us + label: US + hosts: + mcp: mcp.mixpanel.com + - value: eu + label: EU + hosts: + mcp: mcp-eu.mixpanel.com + - value: in + label: IN + hosts: + mcp: mcp-in.mixpanel.com + gaps: + - surface: api + needs: settings.choices + detail: The entry has no api surface yet, so there is nothing to apply a region setting to. When one + is written, its regional servers differ in the host name (api.mixpanel.com, + api-eu.mixpanel.com, api-in.mixpanel.com; the query description uses a host variable with + mixpanel, eu.mixpanel and in.mixpanel), so each option of the region setting will need an + api host quoted from the pages. credentials: sign_in: type: oauth_discovered diff --git a/catalog/services/okta.yaml b/catalog/services/okta.yaml index 9bc74fd..b6190df 100644 --- a/catalog/services/okta.yaml +++ b/catalog/services/okta.yaml @@ -56,6 +56,19 @@ reference: occurred_at: value: "{event.published}" unit: iso + settings: + - id: host + label: Okta org domain + placeholder: acme.okta.com + help: "Your org's whole Okta address, without https://. For https://acme.okta.com enter + acme.okta.com. An org on okta.com, oktapreview.com or okta-emea.com can be entered. An org + that reaches Okta only through a custom domain, or on another Okta domain, cannot be entered + yet: Okta's pages do not say its OAuth sign-in addresses answer on a custom domain." + host: + suffixes: + - okta.com + - oktapreview.com + - okta-emea.com credentials: api_token: type: secret diff --git a/catalog/services/pagerduty.yaml b/catalog/services/pagerduty.yaml index 5b7998f..d5d2d39 100644 --- a/catalog/services/pagerduty.yaml +++ b/catalog/services/pagerduty.yaml @@ -126,6 +126,17 @@ reference: summary: Sent when a service is deleted. - type: service.updated summary: Sent when a service is updated. + settings: + - id: host + label: PagerDuty service region + placeholder: pagerduty.com + help: Enter pagerduty.com if your PagerDuty account is in the US service region, or eu.pagerduty.com + if it is in the EU service region. EU-based accounts have eu in their web address, such as + your-subdomain.eu.pagerduty.com. + host: + suffixes: + - pagerduty.com + - eu.pagerduty.com credentials: sign_in: type: oauth_discovered diff --git a/catalog/services/pipedrive.yaml b/catalog/services/pipedrive.yaml index 6031778..25a4ea7 100644 --- a/catalog/services/pipedrive.yaml +++ b/catalog/services/pipedrive.yaml @@ -24,6 +24,13 @@ reference: - credential: app check: request: GET /api/v1/users/me + settings: + - id: company + label: Pipedrive company domain + placeholder: mycompany + help: The first part of your Pipedrive address. If the address is https://mycompany.pipedrive.com, + enter mycompany. + pattern: ^[A-Za-z0-9-]+$ credentials: mcp_login: type: oauth_discovered diff --git a/catalog/services/posthog.yaml b/catalog/services/posthog.yaml index 4a66284..7205f05 100644 --- a/catalog/services/posthog.yaml +++ b/catalog/services/posthog.yaml @@ -31,6 +31,13 @@ reference: request: GET /api/users/@me/ summary: Get the authenticated user (Retrieve users with @me as the uuid); needs the user:read scope. + settings: + - id: region + label: PostHog Cloud region + placeholder: us + help: Enter us for US Cloud (us.posthog.com) or eu for EU Cloud (eu.posthog.com). Self-hosted + installations are not covered. + pattern: ^(us|eu)$ credentials: api_key: type: secret diff --git a/catalog/services/salesforce.yaml b/catalog/services/salesforce.yaml index f85bacb..e9a7aa8 100644 --- a/catalog/services/salesforce.yaml +++ b/catalog/services/salesforce.yaml @@ -12,6 +12,21 @@ reference: url: https://api.salesforce.com/platform/mcp/v1/d/{my_domain}/platform/sobject-all accepts: - credential: app + settings: + - id: my_domain + label: My Domain name + placeholder: mycompany + help: The first part of your org's My Domain address. If your org is at mycompany.my.salesforce.com, + enter mycompany. In Setup, search for My Domain to see it. + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + gaps: + - surface: settings + needs: settings.path_choice + detail: Only the production address with a My Domain name is covered. In the MCP address, sandbox + orgs use /d/{mydomainname}--{sandboxname}/sandbox/, Developer Edition orgs + /d/{mydomainname}/develop/ and scratch orgs /d/{mydomainname}/scratch/, path parts that + differ by org type; a host setting cannot stand in a path, so a host setting does not close + this. The page also says sandboxes use different OAuth endpoints (test.salesforce.com). credentials: app: type: oauth diff --git a/catalog/services/sanity.yaml b/catalog/services/sanity.yaml index d5be399..e64b17e 100644 --- a/catalog/services/sanity.yaml +++ b/catalog/services/sanity.yaml @@ -190,6 +190,13 @@ reference: - type: delete summary: A document matching the webhook's filter was deleted; unpublishing a document also fires it. + settings: + - id: project_id + label: Sanity project ID + placeholder: abc123xy + help: The ID of the Sanity project, shown in the project's settings at sanity.io/manage. Webhooks + are created per project, at an address that starts with this ID. + pattern: ^[A-Za-z0-9-]+$ credentials: sign_in: type: oauth_discovered diff --git a/catalog/services/segment.yaml b/catalog/services/segment.yaml index 478297b..42230a4 100644 --- a/catalog/services/segment.yaml +++ b/catalog/services/segment.yaml @@ -62,6 +62,24 @@ reference: summary: A group call, sent when a source forwards one to the Webhooks destination. - type: delete summary: A deletion request was created for an affected source that has webhooks enabled. + settings: + - id: region + label: Region + choices: + - value: us + label: US-based Workspaces + hosts: + api: api.segmentapis.com + surfaces: + - api + - events + - value: eu + label: EU-based Workspaces + hosts: + api: eu1.api.segmentapis.com + surfaces: + - api + - events credentials: api_token: type: secret diff --git a/catalog/services/servicenow.yaml b/catalog/services/servicenow.yaml index 4b69ab4..23d5372 100644 --- a/catalog/services/servicenow.yaml +++ b/catalog/services/servicenow.yaml @@ -78,6 +78,16 @@ reference: - "true" - "false" - all + settings: + - id: host + label: Instance host + placeholder: myinstance.service-now.com + help: The host name of your ServiceNow instance, without https:// and without a path, such as + myinstance.service-now.com or the custom domain you set up for it. + host: + owner_named: true + suffixes: + - service-now.com credentials: oauth_app: type: oauth diff --git a/catalog/services/shopify.yaml b/catalog/services/shopify.yaml index 2ea5fe4..12589bb 100644 --- a/catalog/services/shopify.yaml +++ b/catalog/services/shopify.yaml @@ -751,6 +751,13 @@ reference: - type: variants/out_of_stock summary: Occurs whenever a variant becomes out of stock. Online channels receive this webhook only when the variant becomes out of stock online. Requires the read_products scope. + settings: + - id: shop + label: Store subdomain + placeholder: your-development-store + help: The first part of your store's myshopify.com address. If the address is + your-development-store.myshopify.com, enter your-development-store. + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ credentials: access_token: type: secret diff --git a/catalog/services/slack.yaml b/catalog/services/slack.yaml index d124ed3..2e4981e 100644 --- a/catalog/services/slack.yaml +++ b/catalog/services/slack.yaml @@ -307,6 +307,15 @@ reference: ok: true id: "{body.ts}" error: "{body.error}" + gaps: + - surface: settings + needs: settings.choices + detail: GovSlack runs on slack-gov.com and has no MCP server or Real-time Search API, which a choice + of Slack or GovSlack could express. It is left out because Slack's GovSlack page gives only + https://slack-gov.com/oauth/v2/authorize and says to call API endpoints on slack-gov.com, + and does not say that the user-token authorization address (/oauth/v2_user/authorize) or its + token method the entry uses is served there, so an option would rest on a host swap the + pages do not state. credentials: app: type: oauth diff --git a/catalog/services/twilio.yaml b/catalog/services/twilio.yaml index 5b16d29..eadeb5b 100644 --- a/catalog/services/twilio.yaml +++ b/catalog/services/twilio.yaml @@ -68,6 +68,13 @@ reference: From: "{address.route}" Body: "{text}" id: "{body.sid}" + settings: + - id: account_sid + label: Account SID + pattern: ^AC[0-9a-fA-F]{32}$ + placeholder: AC00000000000000000000000000000000 + help: Your account's SID, on the Twilio Console dashboard. Replies are sent as messages of this + account. credentials: basic: type: secret diff --git a/catalog/services/whatsapp.yaml b/catalog/services/whatsapp.yaml index 0d74bc2..8e7828b 100644 --- a/catalog/services/whatsapp.yaml +++ b/catalog/services/whatsapp.yaml @@ -122,6 +122,13 @@ reference: body: "{text}" id: "{body.messages.0.id}" error: "{body.error.message}" + settings: + - id: phone_number_id + label: Phone number ID + pattern: ^[0-9]+$ + placeholder: "106540352242922" + help: The business phone number's ID, shown in the Meta App Dashboard under WhatsApp, API Setup. It + is not the phone number itself. credentials: access_token: type: secret diff --git a/catalog/services/wordpress-site.yaml b/catalog/services/wordpress-site.yaml index 64ae464..aa8b124 100644 --- a/catalog/services/wordpress-site.yaml +++ b/catalog/services/wordpress-site.yaml @@ -20,6 +20,13 @@ reference: check: request: GET /wp-json/wp/v2/users/me account: "{name}" + settings: + - id: host + label: Site host + placeholder: example.com + help: The host name of your WordPress site, without https:// and without a path. + host: + owner_named: true credentials: application_password: type: secret diff --git a/catalog/services/x.yaml b/catalog/services/x.yaml index e61ab99..d5455ec 100644 --- a/catalog/services/x.yaml +++ b/catalog/services/x.yaml @@ -90,6 +90,17 @@ reference: summary: DM read event with user and target. - type: tweet_delete_events summary: Notice of deleted Posts for compliance. + gaps: + - surface: events + needs: events.handshake_computed_response + detail: X sends a GET with a crc_token and expects response_token, the base64 HMAC-SHA256 of it + under the client secret, prefixed with sha256=. A handshake cannot compute one, so X never + validates the address. + - surface: events + needs: events.subscribe_several_ways + detail: A webhook is registered with POST /2/webhooks, but users are then subscribed through a + separate Account Activity request that needs OAuth 1.0a tokens, and the delete request was + not read, so no subscribe is written. credentials: mcp_sign_in: type: oauth_discovered diff --git a/catalog/services/zendesk.yaml b/catalog/services/zendesk.yaml index 796d0f8..8ec73e2 100644 --- a/catalog/services/zendesk.yaml +++ b/catalog/services/zendesk.yaml @@ -361,6 +361,13 @@ reference: credential: app secret: from_response: "{signing_secret.secret}" + settings: + - id: subdomain + label: Zendesk subdomain + placeholder: mondocam + help: The first part of your Zendesk address. If the address is https://mondocam.zendesk.com, enter + mondocam. Use your Zendesk core subdomain, not a host-mapped one. + pattern: ^[A-Za-z0-9-]+$ credentials: app: type: oauth diff --git a/catalog/services/zoho-crm.yaml b/catalog/services/zoho-crm.yaml index 54fb875..796d84f 100644 --- a/catalog/services/zoho-crm.yaml +++ b/catalog/services/zoho-crm.yaml @@ -42,6 +42,33 @@ reference: type: token body_field: token event_type: "{body.module}.{body.operation}" + settings: + - id: accounts_host + label: Zoho accounts host + placeholder: accounts.zoho.com + help: The accounts address of the data center your Zoho account is in, such as accounts.zoho.com + (US) or accounts.zoho.eu (EU). + host: + suffixes: + - accounts.zoho.com + - accounts.zoho.com.au + - accounts.zoho.eu + - accounts.zoho.in + - accounts.zoho.com.cn + - accounts.zoho.jp + - accounts.zoho.sa + - accounts.zohocloud.ca + - id: api_host + label: Zoho API host + placeholder: www.zohoapis.com + help: The API domain of your data center. Zoho's pages give www.zohoapis.com (the sample + api_domain), www.zohoapis.eu and www.zohoapis.com.cn; for another data center, use the + api_domain Zoho returns with the token, if it is one of these. + host: + suffixes: + - www.zohoapis.com + - www.zohoapis.eu + - www.zohoapis.com.cn credentials: sign_in: type: oauth diff --git a/catalog/services/zoom.yaml b/catalog/services/zoom.yaml index a3ff567..5285301 100644 --- a/catalog/services/zoom.yaml +++ b/catalog/services/zoom.yaml @@ -49,6 +49,69 @@ reference: header_format: v0={signature} signed_content: v0:{header.x-zm-request-timestamp}:{body} event_type: "{body.event}" + settings: + - id: region + label: Region + choices: + - value: global + label: Global + hosts: + mcp: mcp.zoom.us + api: api.zoom.us + - value: au + label: Australia + hosts: + mcp: mcp-au.zoom.us + api: api-au.zoom.us + - value: ca + label: Canada + hosts: + mcp: mcp-ca.zoom.us + api: api-ca.zoom.us + - value: eu + label: European Union + hosts: + mcp: mcp-eu.zoom.us + api: api-eu.zoom.us + - value: in + label: India + hosts: + mcp: mcp-in.zoom.us + api: api-in.zoom.us + - value: sa + label: Saudi Arabia + hosts: + mcp: mcp-sa.zoom.us + api: api-sa.zoom.us + - value: sg + label: Singapore + hosts: + mcp: mcp-sg.zoom.us + api: api-sg.zoom.us + - value: us + label: United States + hosts: + mcp: mcp-us.zoom.us + api: api-us.zoom.us + - value: uk + label: UK + hosts: + api: api-uk.zoom.us + surfaces: + - api + - events + gaps: + - surface: events + needs: events.handshake_computed_response + detail: Zoom asks for endpoint.url_validation, answered with the plainToken and an encryptedToken + that is its HMAC-SHA-256 under the secret token. A handshake can echo a value but not + compute one, so the address cannot be validated by Zoom's own check. + - surface: events + needs: events.subscribe_secret_from_credential + detail: Zoom's POST /v2/marketplace/app/event_subscription returns only event_subscription_id; + events are signed with the app's own secret token, which already exists, so the subscription + cannot be written. It also needs an app token from the client_credentials grant (see the + sign-in gap), so webhooks are still created by hand. credentials: oauth_app: type: oauth diff --git a/scripts/catalog-yaml.mjs b/scripts/catalog-yaml.mjs index 48b6d8e..f492b99 100644 --- a/scripts/catalog-yaml.mjs +++ b/scripts/catalog-yaml.mjs @@ -21,6 +21,53 @@ export function readDefinition(file, source) { export const referenceSurfaces = ["api", "mcp", "cli", "events", "channel"] const credentialTypes = ["oauth", "oauth_discovered", "secret", "client_credentials"] +const settingId = /^[a-z][a-z0-9_]*$/u +const gapCapability = /^[a-z]+(?:\.[a-z0-9_]+)+$/u + +function validateSettingReferences(value, declared, path) { + if (typeof value === "string") { + for (const [, id] of value.matchAll(/\{settings\.([^{}]*)\}/gu)) { + if (!declared.has(id)) throw new Error(`${path}: refers to an undeclared setting`) + } + } else if (value !== null && typeof value === "object") { + for (const [key, field] of Object.entries(value)) { + validateSettingReferences(field, declared, `${path}.${key}`) + } + } +} + +function validateSettings(reference) { + const declared = new Set() + if (reference.settings !== undefined) { + if (!Array.isArray(reference.settings)) throw new Error("reference.settings: expected an array") + for (const [index, field] of reference.settings.entries()) { + const path = `reference.settings.${index}` + if (!isMapping(field) || typeof field.id !== "string" || !settingId.test(field.id) || + typeof field.label !== "string" || field.label.trim() === "" || field.secret === true) { + throw new Error(`${path}: expected a named non-secret setting`) + } + if (declared.has(field.id)) throw new Error(`${path}.id: duplicate setting`) + declared.add(field.id) + if (field.choices !== undefined && ( + !Array.isArray(field.choices) || field.choices.length === 0 || + field.choices.some(choice => !isMapping(choice) || typeof choice.value !== "string" || + typeof choice.label !== "string" || !isMapping(choice.hosts)) + )) throw new Error(`${path}.choices: expected named host choices`) + if (field.host !== undefined && !isMapping(field.host)) { + throw new Error(`${path}.host: expected host rules`) + } + } + } + if (reference.gaps !== undefined && ( + !Array.isArray(reference.gaps) || reference.gaps.some(gap => !isMapping(gap) || + ![...referenceSurfaces, "sign-in", "settings"].includes(gap.surface) || + typeof gap.needs !== "string" || !gapCapability.test(gap.needs) || + typeof gap.detail !== "string" || gap.detail.trim() === "") + )) throw new Error("reference.gaps: expected capability caveats") + for (const key of ["credentials", "surfaces", "speaks", "models"]) { + validateSettingReferences(reference[key], declared, `reference.${key}`) + } +} function validateCredentialReferences(value, credentials) { if (value === null || typeof value !== "object") return @@ -69,6 +116,7 @@ export function validateReference(reference, folder, file) { throw new Error(`Invalid sources for ${name}`) } } + validateSettings(reference) if (provider) { if ( (reference.kind !== "direct" && reference.kind !== "gateway") || diff --git a/scripts/import-reference.mjs b/scripts/import-reference.mjs index 471e28e..8d4ea11 100644 --- a/scripts/import-reference.mjs +++ b/scripts/import-reference.mjs @@ -2,6 +2,7 @@ import { execFileSync } from "node:child_process" import { readFile, writeFile } from "node:fs/promises" import { Document, parseDocument } from "yaml" import { readDefinition, validateReference } from "./catalog-yaml.mjs" +import { projectReference } from "./reference-import.mjs" const checkout = process.argv[2] const revision = process.argv[3] ?? "0621be370cd4d86c32c310390df03f5a64b1a105" @@ -25,20 +26,7 @@ for (const path of files) { if (!path.endsWith(".yaml") || file === undefined) continue const input = readDefinition(file, git("show", `${revision}:${path}`)) const folder = sourceFolder === "checked" ? "services" : "providers" - const sources = Object.fromEntries( - Object.entries(input.sources).map(([key, { read, from }]) => [key, { read, from }]), - ) - const publicDefinition = folder === "services" - ? { categories: input.categories, surfaces: input.surfaces } - : { kind: input.kind, speaks: input.speaks, models: input.models } - const reference = { - revision, - path, - domain: input.domain, - ...publicDefinition, - credentials: input.credentials, - sources, - } + const reference = projectReference(input, { revision, path, folder, file }) validateReference(reference, folder, file) const target = new URL(`../catalog/${folder}/${file}`, import.meta.url) diff --git a/scripts/reference-import.mjs b/scripts/reference-import.mjs new file mode 100644 index 0000000..5eb4860 --- /dev/null +++ b/scripts/reference-import.mjs @@ -0,0 +1,24 @@ +export function projectReference(input, { revision, path, folder }) { + const sources = Object.fromEntries( + Object.entries(input.sources).map(([key, { read, from }]) => [key, { read, from }]), + ) + const publicDefinition = folder === "services" + ? { categories: input.categories, surfaces: input.surfaces } + : { kind: input.kind, speaks: input.speaks, models: input.models } + // Keep the event caveats that the retained setup instructions explicitly point to. + const setup = input.surfaces?.events?.setup + const refersToEventGaps = Array.isArray(setup) && + setup.some(step => typeof step === "string" && /\bsee the gap on events\b/iu.test(step)) + const gaps = input.gaps?.filter(gap => gap.surface === "settings" || + gap.needs.startsWith("settings.") || (refersToEventGaps && gap.surface === "events")) + return { + revision, + path, + domain: input.domain, + ...publicDefinition, + ...(input.settings === undefined ? {} : { settings: input.settings }), + ...(gaps?.length ? { gaps } : {}), + credentials: input.credentials, + sources, + } +} diff --git a/test/fixtures/reference-import/fixture.mjs b/test/fixtures/reference-import/fixture.mjs new file mode 100644 index 0000000..0cad890 --- /dev/null +++ b/test/fixtures/reference-import/fixture.mjs @@ -0,0 +1,85 @@ +import { execFileSync, spawnSync } from "node:child_process" +import { cp, mkdir, mkdtemp, readdir, readFile, rm, symlink, writeFile } from "node:fs/promises" +import { tmpdir } from "node:os" +import { dirname, join } from "node:path" +import { fileURLToPath } from "node:url" +import { stringify } from "yaml" + +const repository = fileURLToPath(new URL("../../../", import.meta.url)) +const sources = { api: { read: "2026-11-30", from: ["https://docs.example.com"], note: "Source notes stay upstream." } } + +export function service(id, name = id) { + return { + format: 1, id, name, domain: "example.com", categories: ["example"], + credentials: { secret: { type: "secret", label: "Signing token", fields: [{ id: "token", label: "Token" }] } }, + surfaces: { mcp: { url: "https://example.com/mcp", accepts: [{ credential: "secret" }] } }, + sources, + } +} + +export function provider(id) { + return { + format: 1, id, name: "Fixture Provider", domain: "example.com", kind: "direct", + credentials: {}, + speaks: [{ format: "openai-completions", base_url: "https://example.com/{account_id}/v1" }], + settings: [{ id: "account_id", label: "Account ID" }], + sources, + } +} + +export const inputRecord = (input, revision = "a".repeat(40), folder = "services") => ({ + folder, + file: `${input.id}.yaml`, + input, + revision, + path: `catalog/${folder === "services" ? "checked" : "providers"}/${input.id}.yaml`, +}) + +export async function writeFiles(root, files) { + for (const [path, data] of Object.entries(files)) { + const target = join(root, path) + await mkdir(dirname(target), { recursive: true }) + await writeFile(target, typeof data === "string" ? data : stringify(data)) + } +} + +export async function snapshot(directory) { + const paths = (await readdir(directory, { recursive: true, withFileTypes: true })) + .filter(entry => entry.isFile()) + .map(entry => join(entry.parentPath, entry.name).slice(directory.length + 1)) + .sort() + return Object.fromEntries(await Promise.all( + paths.map(async path => [path, await readFile(join(directory, path), "utf8")]), + )) +} + +export async function withReferenceFixture(run) { + const root = await mkdtemp(join(tmpdir(), "checkfu-reference-fixture-")) + try { + const checkout = join(root, "upstream") + const destination = join(root, "destination") + await Promise.all([ + mkdir(checkout), + mkdir(join(destination, "catalog", "services"), { recursive: true }), + mkdir(join(destination, "catalog", "providers"), { recursive: true }), + ]) + await cp(join(repository, "scripts"), join(destination, "scripts"), { recursive: true }) + await symlink(join(repository, "node_modules"), join(destination, "node_modules"), "junction") + const git = (...args) => execFileSync("git", [ + "-C", checkout, "-c", "user.name=Fixture", "-c", "user.email=fixture@example.com", + "-c", "commit.gpgSign=false", "-c", "core.hooksPath=/dev/null", ...args, + ], { encoding: "utf8" }) + git("init", "--quiet") + const commit = () => { + git("add", "--all") + git("commit", "--quiet", "-m", "Update fixture catalog") + return git("rev-parse", "HEAD").trim() + } + const runImport = revision => spawnSync( + "bun", ["scripts/import-reference.mjs", checkout, revision], { cwd: destination, encoding: "utf8" }, + ) + return await run({ checkout, destination, commit, runImport }) + } finally { + await rm(root, { recursive: true, force: true }) + } +} diff --git a/test/reference-import.test.mjs b/test/reference-import.test.mjs new file mode 100644 index 0000000..31714ee --- /dev/null +++ b/test/reference-import.test.mjs @@ -0,0 +1,92 @@ +import assert from "node:assert/strict" +import { join } from "node:path" +import { test } from "node:test" +import { parse } from "yaml" +import { validateReference } from "../scripts/catalog-yaml.mjs" +import { projectReference } from "../scripts/reference-import.mjs" +import { + inputRecord, provider, service, snapshot, withReferenceFixture, writeFiles, +} from "./fixtures/reference-import/fixture.mjs" + +function regionalService() { + const input = service("regional", "Regional service") + input.settings = [ + { id: "region", label: "Region", choices: [ + { value: "us", label: "United States", hosts: { mcp: "us.example.com" } }, + { value: "eu", label: "Europe", hosts: { mcp: "eu.example.com" } }, + ] }, + { id: "tenant_host", label: "Tenant host", host: { suffixes: ["example.com"] } }, + { id: "account_id", label: "Account ID", pattern: "^[0-9]+$" }, + ] + input.surfaces.mcp.url = "https://{region.mcp}/mcp" + input.surfaces.events = { setup: ["See the gap on events."], subscribe: { url: "{events_url}" }, verify: { type: "token", header: "x-token" } } + input.surfaces.channel = { + messages: [], + reply: { request: "POST /{settings.account_id}/{address.thread}", body: { sender: "{body.sender}", route: "{header.host}" } }, + } + input.gaps = [ + { surface: "events", needs: "events.handshake_computed_response", detail: "Challenge response is host-owned." }, + { surface: "settings", needs: "settings.path_selection", detail: "Select the tenant path." }, + { surface: "api", needs: "api.bulk", detail: "A separate feature." }, + ] + return input +} + +test("projects settings and related caveats with pinned origin and no mutation", () => { + const input = regionalService() + const before = structuredClone(input) + const origin = inputRecord(input) + const projected = projectReference(input, origin) + assert.equal(projected.revision, origin.revision) + assert.equal(projected.path, origin.path) + assert.equal(projected.settings.length, 3) + assert.deepEqual(projected.settings, before.settings) + assert.deepEqual(projected.gaps, before.gaps.slice(0, 2)) + assert.deepEqual(projected.sources, { api: { read: "2026-11-30", from: ["https://docs.example.com"] } }) + assert.deepEqual(input, before) + assert.deepEqual(projectReference(input, origin), projected) + const plain = projectReference(service("plain"), inputRecord(service("plain"))) + assert.equal(Object.hasOwn(plain, "settings"), false) + assert.equal(Object.hasOwn(plain, "gaps"), false) + const model = provider("model") + assert.deepEqual(projectReference(model, inputRecord(model, origin.revision, "providers")).settings, model.settings) +}) + +test("only explicit settings references must resolve to a declared field", () => { + const input = regionalService() + const record = inputRecord(input) + const reference = projectReference(input, record) + validateReference(reference, record.folder, record.file) + reference.surfaces.channel.reply.request += "/{settings.missing}" + assert.throws(() => validateReference(reference, record.folder, record.file), + /reference\.surfaces\.channel\.reply\.request: refers to an undeclared setting/u) +}) + +test("the CLI preserves the runtime overlay and emits deterministic YAML", async () => { + await withReferenceFixture(async ({ checkout, destination, commit, runImport }) => { + const upstream = regionalService() + await writeFiles(checkout, { + "catalog/checked/regional.yaml": upstream, + "catalog/providers/model.yaml": provider("model"), + }) + const revision = commit() + await writeFiles(destination, { + "catalog/services/regional.yaml": [ + "format: 1", "id: regional", "name: Regional service", + "# Keep the runtime endpoint.", "surfaces:", " mcp:", " url: https://runtime.example.com/mcp", "", + ].join("\n"), + }) + const first = runImport(revision) + assert.equal(first.status, 0, first.stderr) + const catalog = join(destination, "catalog") + const contents = await snapshot(catalog) + const yaml = contents["services/regional.yaml"] + assert.match(yaml, /^# Keep the runtime endpoint\.$/mu) + const { surfaces, reference } = parse(yaml) + assert.deepEqual(surfaces, { mcp: { url: "https://runtime.example.com/mcp" } }) + assert.deepEqual(reference.settings, upstream.settings) + assert.equal(reference.revision, revision) + assert.equal(runImport(revision).status, 0) + assert.deepEqual(await snapshot(catalog), contents) + }) +})