/** * Pinned template source for the maintainer-only provider generator. * * NangoHQ/integration-templates is Elastic License 2.0. We read schemas and * proxy-call metadata from it at generation time and emit our own tool * descriptors under `packages/connect/src/providers/`; nothing from the * templates repo ships at runtime. * * Bump `TEMPLATE_SHA` deliberately when we want to pick up upstream updates. * The generator embeds the pin it used in each provider's manifest for * provenance, so a manifest always names the exact repository and commit its * tools were generated from. */ export interface TemplatePin { /** GitHub `owner/name` of the templates repository. */ repo: string; /** Commit to generate from, or `main` to resolve the branch head at sync time. */ sha: string; } export const TEMPLATE_REPO = 'NangoHQ/integration-templates'; export const TEMPLATE_SHA = 'bb789a55bfcf744b3c83aa9132e4ffa562106aa3'; /** * Providers whose templates are still under review upstream are generated * from the contribution branch that carries them, one pin per provider. * Remove an entry once its templates land in NangoHQ/integration-templates * and regenerate the provider from the upstream pin. */ /** * NangoHQ/integration-templates#677 adds agent-focused actions across eight * integrations (posthog run-query, attio list-attributes, stripe reads, * github tags/tree, slack invite-shared, twitter-v2 search/following, * hubspot submit-form). The pinned commit is that PR's head — upstream main * plus the change — which GitHub serves directly from the upstream * repository, so providers that only need upstream templates share the same * pin for a consistent generation source. Move these providers back to * `TEMPLATE_SHA` once #677 merges. When posthog moves, delete * `adaptPosthogRunQuery` in `generate-provider.ts` if the template already * declares `types` as pairs (the override throws once it no longer matches), * and replace the reconstructed `posthogRunQueryTemplate` fixture in * `provider-commands.test.ts` with the fetched template. */ const PIN_677: TemplatePin = { repo: 'NangoHQ/integration-templates', sha: 'c3091db1e8a623113d581197a8ee0d5b1aa87136', }; /** * NangoHQ/integration-templates#708 (merged) fixes linear attachment tools * rejecting null creator emails, surfaces GraphQL errors[] in linear * cycle/project actions (including partial `data: { field: null }` responses), * and accepts fireflies action_items as either an array or a newline-joined * string. Pinned to upstream main at the merge commit; fold back into * TEMPLATE_SHA on the next workspace-wide refresh. */ const PIN_708: TemplatePin = { repo: 'NangoHQ/integration-templates', sha: '4e61bff484f0ab28810e3f252be8bff1f49928a9', }; /** * NangoHQ/integration-templates#724 (merged) fixes fireflies get-transcript * rejecting every real transcript: the API returns sentence speaker_id as a * number and start_time/end_time as float seconds, but the template's schema * declared all three as strings. The pinned commit is the upstream main merge * commit of that PR. Fold back into TEMPLATE_SHA the next time the main pin * is bumped past it. */ const PIN_724: TemplatePin = { repo: 'NangoHQ/integration-templates', sha: '9f836014ab8bd0043dfa5200ad15d298c7149dc6', }; /** * NangoHQ/integration-templates#723 fixes google-drive shared-drive writes: * create-folder, move-file, and upload-document omitted * supportsAllDrives=true, which the Drive API requires for requests that * target shared (Team) drives, so those writes 404'd. The pinned commit is * that PR's head — upstream main plus the change — served directly by the * upstream repository. Fold back into TEMPLATE_SHA once #723 merges. */ const PIN_723: TemplatePin = { repo: 'NangoHQ/integration-templates', sha: 'a5dad336b416d450a5a1f17e85f5586df6a05408', }; export const TEMPLATE_PIN_OVERRIDES: Readonly> = { // NangoHQ/integration-templates#670 fixed clerk_list_users and // clerk_list_sessions, which previously parsed Clerk's bare-array // responses with an envelope schema and 500'd on every call. Pinned to // upstream main at the merge commit so we pick up the fix without // regenerating every other provider. Fold back into TEMPLATE_SHA on the // next workspace-wide refresh. clerk: { repo: 'NangoHQ/integration-templates', sha: '23df553a789b6e30ba1640d4605cf5bfa7ca7cae', }, // NangoHQ/integration-templates#667 resend: { repo: 'rhysbalevicius/integration-templates', sha: 'ac255e0428716e292f196f34f0252ead03b8a091', }, // NangoHQ/integration-templates#668 'incident-io': { repo: 'rhysbalevicius/integration-templates', sha: 'c4fb0d5d5b2c677f794d836a470013da46c347a2', }, // NangoHQ/integration-templates#708 (merged) — linear: nullable attachment // creator emails and GraphQL errors[] surfaced in cycle/project actions. // Linear also picks up the #704 create-cycle and archive-cycle fixes by // moving off TEMPLATE_SHA. Fold back into TEMPLATE_SHA on the next // workspace-wide refresh. linear: PIN_708, // NangoHQ/integration-templates#724 — numeric sentence speaker_id and // start/end times accepted in get-transcript. Based on upstream main, so it // also carries the merged #708 action_items fix. fireflies: PIN_724, // NangoHQ/integration-templates#723 — supportsAllDrives on create-folder, // move-file, and upload-document so shared-drive writes work. 'google-drive': PIN_723, // NangoHQ/integration-templates#677 slack: PIN_677, github: PIN_677, posthog: PIN_677, stripe: PIN_677, 'twitter-v2': PIN_677, hubspot: PIN_677, discord: PIN_677, 'google-mail': PIN_677, 'google-calendar': PIN_677, }; /** Resolves the template pin for a provider, falling back to the shared upstream pin. */ export function templatePinFor(providerId?: string): TemplatePin { if (providerId !== undefined) { const override = Object.prototype.hasOwnProperty.call(TEMPLATE_PIN_OVERRIDES, providerId) ? TEMPLATE_PIN_OVERRIDES[providerId] : undefined; if (override) return override; } return { repo: TEMPLATE_REPO, sha: TEMPLATE_SHA }; }